code: def fit_cpgp_with_dataset(dataset, FitterClass):
      """Fits and returns a CPGP."""
      gp_fitter = FitterClass(
          dataset.X_train, dataset.Y_train, dataset.domain_file_name
      )
      ret_gp = gp_fitter.fit_gp()
      return ret_gp[1], gp_fitter.domain
  
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 5 for calling a global function with example usage: fit_cpgp_with_dataset(dataset, FitterClass) and returns: ret_gp,  gp_fitter