code: def load_jobs_from_directory(directory: Path) -> list[Job]:
      """
      Returns all jobs stored in the provided directory, assuming that the
      directory is structured as `<model>/<dataset>/<job>`.
      """
      return [
          Job.load(directory / model / dataset / job)
          for model in os.listdir(directory)
          if (directory / model).is_dir() and model in MODEL_REGISTRY
          for dataset in os.listdir(directory / model)
          if (directory / model / dataset).is_dir()
          for job in os.listdir(directory / model / dataset)
          if (directory / model / dataset / job).is_dir()
      ]
  
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 2 for calling a global function with example usage: load_jobs_from_directory(directory) and returns: unknown