    def parse_file(self, f):
        # parse file, return parser or dict with data
        if hasattr(f, "seekable"):
            if f.seekable():
                f.seek(0)
        elif hasattr(f, "seek"):
            f.seek(0)
        if six.PY3 and isinstance(f, six.moves.http_client.HTTPResponse):
            # HTTPResponse needs special handling in py3
            reader = codecs.getreader("utf-8")
            parser = json.load(reader(f))
        else:
            parser = json.load(f)
        return parser