code: def fit_cpmfgp_with_dataset(dataset, *args, **kwargs):
      """Fits and returns a CPMFGP."""
      config = dataset.config
      mfgp_fitter = cpgp.CPMFGPFitter(
          dataset.ZZ_train,
          dataset.XX_train,
          dataset.YY_train,
          fidel_space=config.fidel_space,
          domain=config.domain,
          fidel_space_kernel_ordering=config.fidel_space_orderings.kernel_ordering,
          domain_kernel_ordering=config.domain_orderings.kernel_ordering,
          *args,
          **kwargs,
      )
      ret = mfgp_fitter.fit_gp()
      return ret[1]
  
imports: from argparse import Namespace
  import numpy
  import os
  from time import time
  from ..exd.cp_domain_utils import load_cp_domain_from_config_file, get_processed_func_from_raw_func_for_cp_domain, get_processed_func_from_raw_func_via_config, load_config_file, sample_from_config_space
  from .None import cartesian_product_gp
  from ..test_data.park1_3.park1_3 import park1_3
  from ..test_data.park1_3.park1_3_mf import park1_3_mf
  from ..test_data.park2_4.park2_4 import park2_4
  from ..test_data.park2_4.park2_4_mf import park2_4_mf
  from ..utils.base_test_class import BaseTestClass, execute_tests
  from ..utils.general_utils import map_to_bounds, get_idxs_from_list_of_lists
label_desc: Use image node_id 6 for calling a global function with example usage: fit_cpmfgp_with_dataset(dataset) and returns: ret