class_docstr: Hyperparams repository that saves data AutoML-related info.
class_docstr_tok: ["Hyperparams","repository","that","saves","data","AutoML-related","info","."]
code: def save(
      self, _dataclass: SubDataclassT, scope: ScopedLocation, deep=False
  ) -> "VanillaHyperparamsRepository":
      # Sanitizing
      _dataclass: SubDataclassT = copy.deepcopy(_dataclass)
      scope = scope.at_dc(_dataclass)
  
      # Sanity checks: good type
      if not isinstance(_dataclass, BaseDataclass):
          raise ValueError(
              f"Was expecting a dataclass. Got `{_dataclass.__class__.__name__}`."
          )
      # Sanity checks: sufficient scope depth
      scope = scope[
          : _dataclass.__class__
      ]  # Sanitizing scope to dtype loc.
      _id_from_scope: ScopedLocationAttr = scope[_dataclass.__class__]
      if _id_from_scope is not None:
          if _id_from_scope != _dataclass.get_id():
              raise ValueError(
                  f"The scope `{scope}` with {_dataclass.__class__.__name__} id `{_id_from_scope}` does not match the provided dataclass id `{_dataclass.get_id()}` for `{_dataclass}`."
              )
          scope.pop()
          # else check if the scope is at least of the good class length:
      elif len(scope) != list(dataclass_2_subloc_attr.keys()).index(
          _dataclass.__class__
      ):
          raise ValueError(
              f"The scope `{scope}` is not of the good length for dataclass type `{_dataclass.__class__.__name__}`."
          )
  
      # Passthrough dc's sublocation when saving shallow:
      if not deep:
          if isinstance(_dataclass, RootDataclass):
              _dataclass.set_sublocation(self.root.get_sublocation())
          elif scope.with_dc(_dataclass) in self.root:
              prev_dc: SubDataclassT = self.root[
                  scope.with_dc(_dataclass)
              ]
              _dataclass.set_sublocation(prev_dc.get_sublocation())
          else:
              _dataclass = _dataclass.empty()
  
      # Finally storing.
      if isinstance(_dataclass, RootDataclass):
          self.root = _dataclass
      else:
          self.root[scope].store(_dataclass)
      return self
  
imports: import copy
  import multiprocessing
  import os
  from abc import abstractmethod
  from neuraxle.base import BaseService, MetaServiceMixin
  from neuraxle.logging.logging import NeuraxleLogger
  from neuraxle.logging.warnings import RaiseDeprecatedClass
  from neuraxle.metaopt.data.vanilla import BaseDataclass, RootDataclass, ScopedLocation, ScopedLocationAttr, SubDataclassT, dataclass_2_subloc_attr
label_desc: Use image node_id 4 for calling the VanillaHyperparamsRepository obj's underlying member method code with example usage: obj.save(_dataclass, scope, deep) and returns: self