code: def load_experiment_config(
      experiment: Union[str, Path, Dict]
  ) -> Dict:
      config = {}
      if isinstance(experiment, dict):
          config = dict(experiment)
      else:
          experiment_path = Path(str(experiment)).expanduser()
          with experiment_path.open() as f:
              if experiment_path.suffix in {".json", ".yaml", ".yml"}:
                  config = yaml.safe_load(f)
              elif experiment_path.suffix in {".toml"}:
                  config = toml.load(f)
              else:
                  raise ValueError(
                      "Only Dict, json, yaml and toml experiment files are supported"
                  )
      return config
  
imports: import logging
  import os
  import traceback
  from abc import ABCMeta, abstractmethod
  from pathlib import Path
  from typing import Any, Callable, Dict, List, Mapping, Type, Union
  import toml
  import yaml
label_desc: Use image node_id 1 for calling the ExperimentConfig obj's underlying member method code with example usage: obj.load_experiment_config(experiment) and returns: config