code: def _load_search_space_file(search_space_path):
      # FIXME
      # we need this because PyYAML 6.0 does not support YAML 1.2,
      # which means it is not fully compatible with JSON
      content = Path(search_space_path).read_text(encoding="utf8")
      try:
          return json.loads(content)
      except Exception:
          return yaml.safe_load(content)
  
file_path: nni/nni/experiment/config/experiment_config.py
imports: from dataclasses import dataclass
  import json
  import logging
  from pathlib import Path
  from typing import Any, List, Optional, Union
  from typing_extensions import Literal
  import yaml
  from .algorithm import _AlgorithmConfig
  from .base import ConfigBase
  from .shared_storage import SharedStorageConfig
  from .training_service import TrainingServiceConfig
  from .None import utils
label_desc: Use image node_id 1 for calling a global function with example usage: _load_search_space_file(search_space_path) and returns: json, yaml