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 _load_json_file(self, load_file: str):
      if not os.path.exists(load_file):
          raise FileNotFoundError(f"{load_file} not found.")
      try:
          with open(load_file, "r") as f:
              return json.load(f)
      except json.decoder.JSONDecodeError as e:
          with open(load_file, "r") as f:
              _file_content: str = f.read()
          # TODO: for trials only, use UUID mechanism that could be added to the dataclass or aggregate to resolve collisions. Or investigate and fix locking.
          surrounding_files = os.listdir(os.path.dirname(load_file))
          raise ValueError(
              f"Invalid JSON file: {repr(_file_content)} in path {load_file} with folder ls={surrounding_files}."
          ) from e
  
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 5 for calling the HyperparamsOnDiskRepository obj's underlying member method code with example usage: obj._load_json_file(load_file) and returns: json