parameters: (test_path: str, test_name: str, written_paths: Set[str],
                        paths_to_tests: Dict[str, str])
docstring: Unzips all of the benchmarking artifacts for a given test and backend.
docstring_summary: Unzips all of the benchmarking artifacts for a given test and backend.
docstring_tokens: Unzips all of the benchmarking artifacts for a given test and backend .
function: def extract_artifacts(test_path: str, test_name: str, written_paths: Set[str],
                        paths_to_tests: Dict[str, str]):
    """Unzips all of the benchmarking artifacts for a given test and backend."""
    outputs = os.path.join(test_path, 'test.outputs', 'outputs.zip')
    if FLAGS.dry_run and not os.path.exists(outputs):
      # The artifacts may or may not be present on disk during a dry run. If they
      # are then we want to collision check them, but if they aren't that's fine.
      return
  
    archive = zipfile.ZipFile(outputs)
    # Filter out directory names.
    filenames = [name for name in archive.namelist() if name[-1] != os.sep]
  
    for filename in filenames:
      # Check for collisions.
      check_collision(filename, test_name, written_paths, paths_to_tests)
  
      # Extract and update flagfile path.
      if not FLAGS.dry_run:
        archive.extract(filename, FLAGS.artifacts_dir)
        if filename.endswith('flagfile'):
          update_path(filename)
function_tokens: def extract_artifacts ( test_path : str , test_name : str , written_paths : Set [ str ] , paths_to_tests : Dict [ str , str ] ) : outputs = os . path . join ( test_path , 'test.outputs' , 'outputs.zip' ) if FLAGS . dry_run and not os . path . exists ( outputs ) : # The artifacts may or may not be present on disk during a dry run. If they # are then we want to collision check them, but if they aren't that's fine. return archive = zipfile . ZipFile ( outputs ) # Filter out directory names. filenames = [ name for name in archive . namelist ( ) if name [ - 1 ] != os . sep ] for filename in filenames : # Check for collisions. check_collision ( filename , test_name , written_paths , paths_to_tests ) # Extract and update flagfile path. if not FLAGS . dry_run : archive . extract ( filename , FLAGS . artifacts_dir ) if filename . endswith ( 'flagfile' ) : update_path ( filename )