

def extract(self, to_path):
    namelist = self._archive.namelist()
    leading = self.has_leading_dir(namelist)
    for name in namelist:
        data = self._archive.read(name)
        if leading:
            name = self.split_leading_dir(name)[1]
        filename = os.path.join(to_path, name)
        dirname = os.path.dirname(filename)
        if (dirname and (not os.path.exists(self))):
            os.makedirs(dirname)
        if filename.endswith(('/', '\\')):
            if (not os.path.exists(filename)):
                os.makedirs(filename)
        else:
            with open(filename, 'wb') as outfile:
                outfile.write(data)

dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/utils/archive.py ZipArchive.extract/VarMisuse@103/120 `dirname`->`self`