def extract(self, extractdir=None, verbose=False):
        """Extract archive files to a directory."""
        if extractdir is None:
            filebase, ext = os.path.splitext(self.path)
            if ext in ('.gz', '.bz2', '.xz'):
                filebase, _ext = os.path.splitext(filebase)
            extractdir = os.path.basename(filebase)
            if os.path.exists(extractdir):
                tempdir = tempfile.mkdtemp(prefix='vimball-', dir=os.getcwd())
                extractdir = os.path.join(tempdir.split('/')[-1], extractdir)

        self.fd.seek(0)
        for filename, lines, offset in self.files:
            filepath = os.path.join(extractdir, filename)
            try:
                directory = os.path.dirname(filepath)
                mkdir_p(directory)
            except __HOLE__ as e:
                raise ArchiveError("failed creating directory '{}': {}".format(
                    directory, os.strerror(e.errno)))
            with open(filepath, 'w') as f:
                if verbose:
                    print(filepath)
                self.fd.seek(offset)
                for i in range(lines):
                    f.write(self.readline())
dataset/ETHPy150Open radhermit/vimball/vimball/base.py/Vimball.extract