class_docstr: A job provides data available for a single training job.
  
  It is first obtained from a training job run on AWS Sagemaker. By storing
  it locally, it can be loaded from the file system at a later point and no
  Sagemaker connection is required. The initializer of this class should not
  be used directly.
class_docstr_tok: ["A","job","provides","data","available","for","a","single","training","job",".","It","is","first","obtained","from","a","training","job","run","on","AWS","Sagemaker",".","By","storing","it","locally",",","it","can","be","loaded","from","the","file","system","at","a","later","point","and","no","Sagemaker","connection","is","required",".","The","initializer","of","this","class","should","not","be","used","directly","."]
docstr: Args:
      model: The model that the experiment was run for.
      dataset: The dataset that the model was trained on.
      config: The configuration as a dictionary. Must contain the seed and optionally some
          hyperparameters for the model.
      performance: The performances of all models associated with the training job.
      source_path: An optional path in the file system where the job was loaded from. This is
          required to load forecasts from the file. Mutually exclusive with `source_job`.
      source_job: An optional Sagemaker training job that this job was initialized from.
          Required to call the `save` method. Mutually exclusive with `source_path`.
docstr_tok: ["Args",":","model",":","The","model","that","the","experiment","was","run","for",".","dataset",":","The","dataset","that","the","model","was","trained","on",".","config",":","The","configuration","as","a","dictionary",".","Must","contain","the","seed","and","optionally","some","hyperparameters","for","the","model",".","performance",":","The","performances","of","all","models","associated","with","the","training","job",".","source_path",":","An","optional","path","in","the","file","system","where","the","job","was","loaded","from",".","This","is","required","to","load","forecasts","from","the","file",".","Mutually","exclusive","with","`","source_job","`",".","source_job",":","An","optional","Sagemaker","training","job","that","this","job","was","initialized","from",".","Required","to","call","the","`","save","`","method",".","Mutually","exclusive","with","`","source_path","`","."]
code: def __init__(
      self,
      model: str,
      dataset: str,
      config: dict[str, Any],
      performance: dict[str, Any],
      source_path: Path | None = None,
      source_job: TrainingJob | None = None,
  ):
      """
      Args:
          model: The model that the experiment was run for.
          dataset: The dataset that the model was trained on.
          config: The configuration as a dictionary. Must contain the seed and optionally some
              hyperparameters for the model.
          performance: The performances of all models associated with the training job.
          source_path: An optional path in the file system where the job was loaded from. This is
              required to load forecasts from the file. Mutually exclusive with `source_job`.
          source_job: An optional Sagemaker training job that this job was initialized from.
              Required to call the `save` method. Mutually exclusive with `source_path`.
      """
      assert (source_path is None) != (
          source_job is None
      ), "Exactly one of `source_path` or `source_job` must bet set."
  
      self.model = model
      self.dataset = dataset
      self.config = config
      self.performance = performance
      self.source_path = source_path
      self.source_job = source_job
  
imports: from __future__ import annotations
  import json
  import math
  import os
  import shutil
  from pathlib import Path
  from typing import Any, cast, Dict, List, Optional, Union
  import numpy
  from tsbench.config import MODEL_REGISTRY
  from tsbench.evaluations.aws import Analysis, TrainingJob
  from tsbench.evaluations.metrics import Metric, Performance
  from tsbench.forecasts import QuantileForecasts
label_desc: Use image node_id 3 to create a new Job object  with example: obj = Job(model, dataset, config, performance, source_path, source_job)