def __init__(self, zippath):
        self.zippath = zippath
        self.name = os.path.splitext(os.path.basename(zippath))[0]

        self.contents = {"":""}
        self.packages = {""}

        z = zipfile.ZipFile(zippath, 'r')
        files = [i.filename for i in z.infolist()]

        for f in files:
            base, ext = os.path.splitext(f)
            if ext != ".py":
                continue

            paths = base.split('/')
            if len(paths) > 0 and paths[len(paths) - 1] == "__init__":
                paths.pop()
                self.packages.add('.'.join(paths))

            try:
                self.contents['.'.join(paths)] = z.read(f).decode('utf-8')
            except __HOLE__:
                print(f, "in", zippath, "is not utf-8 encoded, unable to load plugin")
                continue

            while len(paths) > 1:
                paths.pop()
                parent = '.'.join(paths)
                if parent not in self.contents:
                    self.contents[parent] = ""
                    self.packages.add(parent)

        z.close()
dataset/ETHPy150Open spywhere/Javatar/tests/stubs/sublime_plugin.py/ZipLoader.__init__