code: def main(
      _seed: int,
      data_path: str,
      evaluations_path: str,
      weighting: EnsembleWeighting,
      size: int,
      model_class: Optional[str],
  ):
      np.random.seed(_seed)
      torch.manual_seed(_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)
      )
  
      # Evaluate the ensemble that can be built
      print("Evaluating the ensemble...")
      evaluator = EnsembleAnalyzer(
          tracker,
          ensemble_size=size,
          ensemble_weighting=weighting,
          config_class=MODEL_REGISTRY[model_class]
          if model_class is not None
          else None,
      )
      df, configs = evaluator.run()
  
      # Eventually, we store the results
      print("Storing the results...")
      with tempfile.TemporaryDirectory() as d:
          df_path = Path(d) / "results.parquet"
          df.to_parquet(str(df_path))
          ex.add_artifact(
              df_path, content_type="application/octet-stream"
          )
  
          config_path = Path(d) / "configs.pickle"
          with config_path.open("wb+") as f:
              pickle.dump(configs, f)
          ex.add_artifact(
              config_path, content_type="application/octet-stream"
          )
  
file_path: gluonts/src/gluonts/nursery/tsbench/src/cli/analysis/scripts/ensemble.py
imports: import logging
  import pickle
  import tempfile
  from pathlib import Path
  from typing import Optional
  import numpy
  import torch
  from sacred import Experiment
  from tsbench.analysis import EnsembleAnalyzer
  from tsbench.config import MODEL_REGISTRY
  from tsbench.constants import DEFAULT_DATA_PATH, DEFAULT_EVALUATIONS_PATH
  from tsbench.evaluations.tracking import ModelTracker
  from tsbench.forecasts import EnsembleWeighting
label_desc: Use image node_id 2 for calling a global function with example usage: main(_seed, data_path, evaluations_path, weighting, size, model_class) without return types