code: def _extract(self, path, outdir, filter_func=None):
      
      with open_zip(path) as archive_file:
        for name in archive_file.namelist():
          # While we're at it, we also perform this safety test.
          if name.startswith('/') or name.startswith('..'):
            raise ValueError('Zip file contains unsafe path: {}'.format(name))
          if (not filter_func or filter_func(name)):
            archive_file.extract(name, outdir)
docs: Extract from a zip file, with an optional filter.
  
      :param function filter_func: optional filter with the filename as the parameter.  Returns True
                                   if the file should be extracted.