code: def main(
      _config: Dict[str, Any],
      _seed: int,
      data_path: str,
      evaluations_path: str,
      surrogate: str,
      metrics: str,
      inputs: Dict[str, bool],
      outputs: Dict[str, Any],
  ):
      print(_config)
  
      pl.seed_everything(_seed)
      logging.getLogger("pytorch_lightning").setLevel(logging.WARNING)
  
      # First, get the tracker
      print("Fetching the data...")
      tracker = ModelTracker.from_directory(
          Path(evaluations_path), data_path=Path(data_path)
      )
  
      # Then, initialize the surrogate
      print("Initializing the surrogate...")
      metrics_list = metrics.split(",")
      surrogate_instance = create_surrogate(
          surrogate,
          tracker=tracker,
          predict=metrics_list,
          input_flags=inputs,
          output_normalization=outputs["normalization"],
          impute_simulatable=outputs["imputation"],
          **(_config[surrogate] if surrogate in _config else {}),
      )
  
      # And evaluate it
      print("Evaluating the surrogate...")
      evaluator = SurrogateAnalyzer(
          surrogate_instance, tracker=tracker, metrics=metrics_list
      )
      result = evaluator.run()
  
      print(result.mean())
  
      # Eventually, we store the results
      print("Storing the results...")
      with tempfile.TemporaryDirectory() as d:
          path = Path(d) / "results.parquet"
          result.to_parquet(str(path))
          ex.add_artifact(path, content_type="application/octet-stream")
  
file_path: gluonts/src/gluonts/nursery/tsbench/src/cli/analysis/scripts/surrogate.py
imports: import logging
  import tempfile
  from pathlib import Path
  from typing import Any, Dict
  import pytorch_lightning
  from sacred import Experiment
  from tsbench.analysis import SurrogateAnalyzer
  from tsbench.constants import DEFAULT_DATA_PATH, DEFAULT_EVALUATIONS_PATH
  from tsbench.evaluations.tracking import ModelTracker
  from tsbench.surrogate import create_surrogate
label_desc: Use image node_id 2 for calling a global function with example usage: main(_config, _seed, data_path, evaluations_path, surrogate, metrics, inputs, outputs) without return types