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","`",","]
code: def _save_dc(
      self, _dataclass: SubDataclassT, scope: ScopedLocation, deep=False
  ):
      scope, save_folder, save_file = self._get_dataclass_filename_path(
          scope, _dataclass
      )
  
      if os.path.exists(save_file):
          os.remove(save_file)
          with open(save_file, "w") as f:
              import threading
  
              # import psutil
              # process_name = psutil.Process(os.getpid()).name()
              thread_name = threading.current_thread().name
              json.dump(
                  f'being overwritten by thread "{thread_name}".',
                  f,
                  indent=4,
              )
  
      os.makedirs(save_folder, exist_ok=True)
      tmp_save_file = save_file + ".tmp"
      with open(tmp_save_file, "w") as f:
          json_content = to_json(_dataclass.empty())
          if len(json_content) == 0:
              raise ValueError(
                  f"Can't possibly save an empty dataclass. Something went wrong with dataclass {_dataclass} at scope {scope}."
              )
          json.dump(json_content, f, indent=4)
  
      if os.path.exists(save_file):
          os.remove(save_file)
      shutil.move(tmp_save_file, save_file)
  
      if deep is True and _dataclass.has_sublocation_dataclasses():
          for sub_dc in _dataclass.get_sublocation_values():
              self._save_dc(sub_dc, scope=scope, deep=deep)
  
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 7 for calling the HyperparamsOnDiskRepository obj's underlying member method code with example usage: obj._save_dc(_dataclass, scope, deep) without return types