class_docstr: Hyperparams repository that saves json files for every AutoML trial.
  
  .. seealso::
      :class:`AutoML`,
      :class:`Trainer`,
class_docstr_tok: ["Hyperparams","repository","that","saves","json","files","for","every","AutoML","trial",".","..","seealso",":",":",":","class",":","`","AutoML","`",",",":","class",":","`","Trainer","`",","]
docstr: Get metadata from scope.
  
  The fetched metadata will be the one that is the last item
  that is not a None in the provided scope.
  
  :param scope: scope to get metadata from.
  :return: metadata from scope.
docstr_tok: ["Get","metadata","from","scope",".","The","fetched","metadata","will","be","the","one","that","is","the","last","item","that","is","not","a","None","in","the","provided","scope",".",":","param","scope",":","scope","to","get","metadata","from",".",":","return",":","metadata","from","scope","."]
code: def load(self, scope: ScopedLocation, deep=False) -> SubDataclassT:
      """
      Get metadata from scope.
  
      The fetched metadata will be the one that is the last item
      that is not a None in the provided scope.
  
      :param scope: scope to get metadata from.
      :return: metadata from scope.
      """
      try:
          loaded = self._load_dc(scope=scope, deep=deep)
      except (KeyError, FileNotFoundError) as e:
          if scope == ScopedLocation():
              raise ValueError(
                  "An error occured: should be able to load Root from json repo without problems."
              ) from e
          try:
              loaded: BaseDataclass = scope.new_dataclass_from_id()
          except Exception as err:
              raise err from e
      if (
          scope == ScopedLocation()
          or scope == ScopedLocation.default().popped()
      ) and len(loaded) == 0:
          # loaded2 = self._load_dc(scope=scope, deep=deep)
          # loaded3 = self._load_dc(scope=scope, deep=deep)
          # loaded4 = self._load_dc(scope=scope, deep=deep)
          # loaded5 = self._load_dc(scope=scope, deep=deep)
          raise ValueError(
              "Len 0 while it should be longer: " + str(loaded)
          )
      return loaded
  
imports: import json
  import os
  import shutil
  from copy import deepcopy
  from typing import List, Optional
  from neuraxle.logging.logging import NeuraxleLogger
  from neuraxle.metaopt.data.vanilla import BaseDataclass, DataclassHasListMixin, RootDataclass, ScopedLocation, SubDataclassT, dataclass_2_id_attr, from_json, to_json
  from neuraxle.metaopt.repositories.repo import HyperparamsRepository
label_desc: Use image node_id 2 for calling the HyperparamsOnDiskRepository obj's underlying member method code with example usage: obj.load(scope, deep) and returns: loaded