code: def main():
      parser = ArgumentParser()
  
      parser.add_argument(
          "--working-directory", type=str, required=True
      )
      parser.add_argument("--cutoff", type=int, default=-1)
      parser.add_argument("--only-best", type=bool, default=True)
  
      args = parser.parse_args()
      working_directory = args.working_directory
      cutoff = args.cutoff
      only_best = args.only_best
  
      for task_type in ("classification", "regression"):
          if task_type == "classification":
              metadata_sets = itertools.product(
                  [0, 1],
                  [BINARY_CLASSIFICATION, MULTICLASS_CLASSIFICATION],
                  CLASSIFICATION_METRICS,
              )
              input_directory = os.path.join(
                  working_directory, "configuration", "classification"
              )
          elif task_type == "regression":
              metadata_sets = itertools.product(
                  [0, 1], [REGRESSION], REGRESSION_METRICS
              )
              input_directory = os.path.join(
                  working_directory, "configuration", "regression"
              )
          else:
              raise ValueError(task_type)
  
          output_dir = os.path.join(
              working_directory, "configuration_results"
          )
  
          for sparse, task, metric in metadata_sets:
              print(TASK_TYPES_TO_STRING[task], metric, sparse)
  
              output_dir_ = os.path.join(
                  output_dir,
                  "%s_%s_%s"
                  % (
                      metric,
                      TASK_TYPES_TO_STRING[task],
                      "sparse" if sparse else "dense",
                  ),
              )
  
              configuration_space = pipeline.get_configuration_space(
                  DummyDatamanager(
                      info={"is_sparse": sparse, "task": task},
                      feat_type={"A": "numerical", "B": "categorical"},
                  )
              )
  
              outputs, configurations = retrieve_matadata(
                  validation_directory=input_directory,
                  metric=metric,
                  cutoff=cutoff,
                  configuration_space=configuration_space,
                  only_best=only_best,
              )
  
              if len(outputs) == 0:
                  print(
                      "No output found for %s, %s, %s"
                      % (
                          metric,
                          TASK_TYPES_TO_STRING[task],
                          "sparse" if sparse else "dense",
                      )
                  )
                  continue
  
              try:
                  os.makedirs(output_dir_)
              except:
                  pass
  
              write_output(
                  outputs,
                  configurations,
                  output_dir_,
                  configuration_space,
                  metric,
              )
  
file_path: auto-sklearn/scripts/02_retrieve_metadata.py
imports: from argparse import ArgumentParser
  import csv
  import glob
  import itertools
  import json
  import os
  import arff
  import numpy
  from ConfigSpace.configuration_space import Configuration
  from ConfigSpace.util import deactivate_inactive_hyperparameters
  from autosklearn.data.abstract_data_manager import AbstractDataManager
  from autosklearn.constants import *
  from autosklearn.metrics import CLASSIFICATION_METRICS, REGRESSION_METRICS
  from autosklearn.util import pipeline
label_desc: Use image node_id 3 for calling a global function with example usage: main() without return types