code: def gen_cpmfgp_test_data_from_config_file(
      config_file_name, raw_func, num_tr_data, num_te_data
  ):
      """Generates datasets for CP Multi-fidelity GP fitting."""
  
      # Generate data
      def _generate_data(_proc_func, _config, _num_data):
          """Generates data."""
          ZX_proc = sample_from_config_space(_config, _num_data)
          YY_proc = [_proc_func(z, x) for (z, x) in ZX_proc]
          ZZ_proc = get_idxs_from_list_of_lists(ZX_proc, 0)
          XX_proc = get_idxs_from_list_of_lists(ZX_proc, 1)
          return ZZ_proc, XX_proc, YY_proc, ZX_proc
  
      # Get dataset for testing
      def _get_dataset_for_testing(
          _proc_func, _config, _num_tr_data, _num_te_data
      ):
          """Get dataset for testing."""
          ZZ_train, XX_train, YY_train, ZX_train = _generate_data(
              _proc_func, _config, _num_tr_data
          )
          ZZ_test, XX_test, YY_test, ZX_test = _generate_data(
              _proc_func, _config, _num_te_data
          )
          return Namespace(
              config_file_name=config_file_name,
              config=config,
              raw_func=raw_func,
              ZZ_train=ZZ_train,
              XX_train=XX_train,
              YY_train=YY_train,
              ZX_train=ZX_train,
              ZZ_test=ZZ_test,
              XX_test=XX_test,
              YY_test=YY_test,
              ZX_test=ZX_test,
          )
  
      # Generate the data and return
      config = load_config_file(config_file_name)
      proc_func = get_processed_func_from_raw_func_via_config(
          raw_func, config
      )
      return _get_dataset_for_testing(
          proc_func, config, num_tr_data, num_te_data
      )
  
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 3 for calling a global function with example usage: gen_cpmfgp_test_data_from_config_file(config_file_name, raw_func, num_tr_data, num_te_data) and returns: _get_dataset_for_testing, ZZ_proc,  XX_proc,  YY_proc,  ZX_proc, Namespace