code: def _load(self) -> Dict[str, Union[Dataset, Predictor]]:
      if "metadata" in self.channels:
          path = self.channels.pop("metadata")
          self.hyperparameters["freq"] = MetaData.parse_file(
              path / "metadata.json"
          ).freq
  
      model: Optional[Predictor] = None
      if "model" in self.channels:
          path = self.channels.pop("model")
          with tarfile.open(path / "model.tar.gz") as targz:
              safe_extractall(targz, path)
          model = Predictor.deserialize(path)
  
      file_dataset = partial(
          FileDataset, freq=self.hyperparameters["freq"]
      )
  
      datasets = valmap(file_dataset, self.channels)
      if self._listify_dataset():
          datasets = valmap(list, datasets)
      if model is not None:
          datasets["model"] = model
  
      return datasets
  
file_path: gluonts/src/gluonts/shell/env.py
imports: import os
  import tarfile
  from distutils.util import strtobool
  from functools import partial
  from typing import Dict, Optional, Union
  from toolz import valmap
  from gluonts.dataset.common import Dataset, FileDataset, MetaData
  from gluonts.model import Predictor
  from gluonts.util import safe_extractall
  from .None import sagemaker
label_desc: Use image node_id 2 for calling the TrainEnv obj's underlying member method code with example usage: obj._load() and returns: datasets