code: def write_output(
      outputs, configurations, output_dir, configuration_space, metric
  ):
      arff_object = dict()
      arff_object["attributes"] = [
          ("instance_id", "STRING"),
          ("repetition", "NUMERIC"),
          ("algorithm", "STRING"),
          (metric, "NUMERIC"),
          (
              "runstatus",
              [
                  "ok",
                  "timeout",
                  "memout",
                  "not_applicable",
                  "crash",
                  "other",
              ],
          ),
      ]
      arff_object["relation"] = "ALGORITHM_RUNS"
      arff_object["description"] = ""
  
      data = []
      keep_configurations = set()
      for dataset, (configuration_id, value) in outputs.items():
          if not np.isfinite(value):
              runstatus = "not_applicable"
              value = None
          else:
              runstatus = "ok"
  
          line = [dataset, 1, configuration_id + 1, value, runstatus]
          data.append(line)
          keep_configurations.add(configuration_id)
  
      arff_object["data"] = data
  
      with open(
          os.path.join(output_dir, "algorithm_runs.arff"), "w"
      ) as fh:
          arff.dump(arff_object, fh)
  
      hyperparameters = []
      for idx in configurations:
          if idx not in keep_configurations:
              continue
          configuration = configurations[idx]
          line = {"idx": idx + 1}
          for hp_name in configuration:
              value = configuration[hp_name]
              if value is not None:
                  line[hp_name] = value
  
          hyperparameters.append(line)
  
      fieldnames = ["idx"]
      for hyperparameter in configuration_space.get_hyperparameters():
          fieldnames.append(hyperparameter.name)
      fieldnames = [fieldnames[0]] + sorted(fieldnames[1:])
      with open(
          os.path.join(output_dir, "configurations.csv"), "w"
      ) as fh:
          csv_writer = csv.DictWriter(fh, fieldnames=fieldnames)
          csv_writer.writeheader()
          for line in hyperparameters:
              csv_writer.writerow(line)
  
      description = dict()
      description["algorithms_deterministic"] = ",".join(
          [
              str(configuration_id + 1)
              for configuration_id in sorted(configurations.keys())
          ]
      )
      description["algorithms_stochastic"] = ",".join([])
      description["performance_measures"] = metric
      description["performance_type"] = "solution_quality"
  
      with open(
          os.path.join(output_dir, "description.results.txt"), "w"
      ) as fh:
          for key in description:
              fh.write("%s: %s\n" % (key, description[key]))
  
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 2 for calling a global function with example usage: write_output(outputs, configurations, output_dir, configuration_space, metric) without return types