code: def load_parameters(config):
      """Parses all the parameters from json config file."""
      # pylint: disable=too-many-branches
      exp_info = {}
      exp_info["name"] = unicode_to_str(config.get("name"))
      if exp_info["name"] is None:
          raise ValueError("Experiment name is required")
      # Domain -------------------------------------------------------
      parameters = []
      _parameters = config["domain"]
      if isinstance(_parameters, dict):
          for key in list(_parameters.keys()):
              param = load_parameter(_parameters[key], key)
              parameters.append(param)
      elif isinstance(_parameters, list):
          for _parameter in _parameters:
              param = load_parameter(_parameter)
              parameters.append(param)
      else:
          raise ValueError("Wrong parameter type.")
      # domain_constraints -------------------------------------------
      domain_constraints = config.get("domain_constraints", None)
      if domain_constraints is not None:
          domain_constraints = _load_domain_constraints(
              domain_constraints
          )
      # Fidelity space -----------------------------------------------
      fidel_parameters = []
      _parameters = config.get("fidel_space", {})
      if isinstance(_parameters, dict):
          for key in list(_parameters.keys()):
              param = load_parameter(_parameters[key], key)
              fidel_parameters.append(param)
      elif isinstance(_parameters, list):
          for _parameter in _parameters:
              param = load_parameter(_parameter)
              fidel_parameters.append(param)
      else:
          raise ValueError("Wrong parameter type.")
      # fidel_space_constraints ---------------------------------------
      fidel_space_constraints = config.get(
          "fidel_space_constraints", None
      )
      if fidel_space_constraints is not None:
          fidel_space_constraints = _load_domain_constraints(
              fidel_space_constraints
          )
      # fidel_to_opt --------------------------------------------------
      fidel_to_opt = config.get("fidel_to_opt", None)
      if fidel_to_opt is not None:
          fidel_to_opt = _load_fidel_to_opt_parameters(fidel_to_opt)
      # Return
      return {
          "exp_info": exp_info,
          "domain": parameters,
          "fidel_space": fidel_parameters,
          "fidel_to_opt": fidel_to_opt,
          "domain_constraints": domain_constraints,
          "fidel_space_constraints": fidel_space_constraints,
      }
  
file_path: dragonfly/dragonfly/parse/config_parser.py
imports: from __future__ import absolute_import
  import sys
  import json
  from collections import OrderedDict
  from numbers import Number
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: load_parameters(config) and returns: dict