code: def preprocess_arguments(domain, funcs, config):
      """Preprocess domain arguments and configuration file."""
      # Preprocess config argument
      converted_cp_to_euclidean = False
      if isinstance(config, str):
          config = load_config_file(config)
      if domain is None:
          domain = config.domain
      # The function
      if config is not None:
          proc_funcs = [
              get_processed_func_from_raw_func_for_cp_domain(
                  f,
                  config.domain,
                  config.domain_orderings.index_ordering,
                  config.domain_orderings.dim_ordering,
              )
              for f in funcs
          ]
      else:
          proc_funcs = funcs
      ret_funcs = proc_funcs
      # Preprocess domain argument
      if isinstance(domain, (list, tuple)):
          domain = EuclideanDomain(domain)
      elif domain.get_type() == "euclidean":
          pass
      elif domain.get_type() == "cartesian_product":
          if (
              domain.num_domains == 1
              and domain.list_of_domains[0].get_type() == "euclidean"
              and (
                  (not hasattr(domain, "domain_constraints"))
                  or domain.domain_constraints is None
              )
          ):
              domain = domain.list_of_domains[0]
              config.domain_orderings.dim_ordering = (
                  config.domain_orderings.dim_ordering[0]
              )
              config.domain_orderings.index_ordering = (
                  config.domain_orderings.index_ordering[0]
              )
              config.domain_orderings.kernel_ordering = (
                  config.domain_orderings.kernel_ordering[0]
              )
              config.domain_orderings.name_ordering = (
                  config.domain_orderings.name_ordering[0]
              )
              config.domain = domain
              converted_cp_to_euclidean = True
  
              # The function
              def _get_ret_func_from_proc_func_for_euc_domains(
                  _proc_func,
              ):
                  """Get function to return."""
                  return lambda x: _proc_func([x])
  
              ret_funcs = [
                  _get_ret_func_from_proc_func_for_euc_domains(pf)
                  for pf in proc_funcs
              ]
      else:
          raise ValueError(
              "domain should be an instance of EuclideanDomain or "
              + "CartesianProductDomain."
          )
      return domain, ret_funcs, config, converted_cp_to_euclidean
  
file_path: dragonfly/dragonfly/apis/api_utils.py
imports: from argparse import Namespace
  import numpy
  from ..exd.cp_domain_utils import load_config_file, get_processed_func_from_raw_func_for_cp_domain_fidelity, get_processed_func_from_raw_func_for_cp_domain
  from ..exd.domains import EuclideanDomain
  from ..exd.worker_manager import MultiProcessingWorkerManager, SyntheticWorkerManager, AbstractWorkerManager
  from ..opt.ga_optimiser import ga_opt_args
  from ..opt.gp_bandit import get_all_euc_gp_bandit_args, get_all_cp_gp_bandit_args, get_all_mf_euc_gp_bandit_args, get_all_mf_cp_gp_bandit_args
  from ..opt.random_optimiser import euclidean_random_optimiser_args, mf_euclidean_random_optimiser_args, cp_random_optimiser_args, mf_cp_random_optimiser_args
  from ..opt.multiobjective_gp_bandit import get_all_euc_moo_gp_bandit_args, get_all_cp_moo_gp_bandit_args
  from ..opt.random_multiobjective_optimiser import euclidean_random_multiobjective_optimiser_args, cp_random_multiobjective_optimiser_args
  from ..utils.general_utils import map_to_bounds
  from ..utils.option_handler import load_options
label_desc: Use image node_id 5 for calling a global function with example usage: preprocess_arguments(domain, funcs, config) and returns: domain,  ret_funcs,  config,  converted_cp_to_euclidean, function