def _extract_jar(self, coordinate, jar_path):
    with open(jar_path, 'rb') as f:
      outdir = os.path.join(self.workdir, 'extracted', sha1(f.read()).hexdigest())
    if not os.path.exists(outdir):
      ZIP.extract(jar_path, outdir)
      self.context.log.debug('Extracting jar {jar} at {jar_path}.'
                             .format(jar=coordinate, jar_path=jar_path))
    else:
      self.context.log.debug('Jar {jar} already extracted at {jar_path}.'
                             .format(jar=coordinate, jar_path=jar_path))
    return outdir
Extracts the jar to a subfolder of workdir/extracted and returns the path to it.
dataset/ETHPy150Open pantsbuild/pants/src/python/pants/backend/codegen/tasks/protobuf_gen.py/ProtobufGen._extract_jar