code: def load_config(config_params, config_file=None, *args, **kwargs):
      """Loads configuration from parameters."""
      config_params = _preprocess_config_params(config_params)
      domain_params = config_params["domain"]
      domain_constraints = (
          None
          if not ("domain_constraints" in config_params.keys())
          else config_params["domain_constraints"]
      )
      domain_info = Namespace(config_file=config_file)
      domain, domain_orderings = load_domain_from_params(
          domain_params,
          domain_constraints=domain_constraints,
          domain_info=domain_info,
          *args,
          **kwargs,
      )
      config = Namespace(
          name=config_params["name"],
          domain=domain,
          domain_orderings=domain_orderings,
      )
      # Check the fidelity space
      if "fidel_space" in config_params.keys():
          fidel_space_params = config_params["fidel_space"]
          fidel_space_constraints = (
              None
              if not ("fidel_space_constraints" in config_params.keys())
              else config_params["fidel_space_constraints"]
          )
          fidel_space_info = Namespace(config_file=config_file)
          fidel_space, fidel_space_orderings = load_domain_from_params(
              fidel_space_params,
              domain_constraints=fidel_space_constraints,
              domain_info=fidel_space_info,
              *args,
              **kwargs,
          )
          if len(fidel_space.list_of_domains) > 0:
              config.fidel_space = fidel_space
              config.fidel_space_orderings = fidel_space_orderings
              (
                  config.raw_fidel_to_opt,
                  config.fidel_to_opt,
              ) = _process_fidel_to_opt(
                  config_params["fidel_to_opt"],
                  fidel_space,
                  fidel_space_orderings,
                  config_file,
              )
      return config
  
imports: from __future__ import print_function
  from argparse import Namespace
  from copy import deepcopy
  import numpy
  from warnings import warn
  from .None import domains
  from ..parse.config_parser import config_parser
  from ..utils.general_utils import flatten_list_of_objects_and_iterables, get_original_order_from_reordered_list, transpose_list_of_lists
  from ..utils.oper_utils import random_sample_from_euclidean_domain, random_sample_from_discrete_euclidean_domain, random_sample_from_integral_domain, random_sample_from_prod_discrete_domain
label_desc: Use image node_id 6 for calling a global function with example usage: load_config(config_params, config_file) and returns: config