code: def _gen_datasets_from_func(fzx, N, dim_z, dim_x):
      """Generates train and test datasets from the function."""
      Z_tr, X_tr, Y_tr = gen_data_from_func(fzx, N, dim_z, dim_x)
      ZX_tr = np.concatenate((Z_tr, X_tr), axis=1)
      Z_te, X_te, Y_te = gen_data_from_func(fzx, 2 * N, dim_z, dim_x)
      ZX_te = np.concatenate((Z_te, X_te), axis=1)
      return Z_tr, X_tr, Y_tr, ZX_tr, Z_te, X_te, Y_te, ZX_te
  
imports: from __future__ import division
  from argparse import Namespace
  from copy import deepcopy
  import numpy
  from .None import kernel
  from .unittest_euclidean_gp import fit_se_gp_with_dataset, fit_matern_gp_with_dataset, fit_poly_gp_with_dataset
  from .None import euclidean_gp
  from ..utils.base_test_class import BaseTestClass, execute_tests
  from ..utils.general_utils import compute_average_sq_prediction_error
  from ..utils.option_handler import load_options
label_desc: Use image node_id 4 for calling a global function with example usage: _gen_datasets_from_func(fzx, N, dim_z, dim_x) and returns: Z_tr,  X_tr,  Y_tr,  ZX_tr,  Z_te,  X_te,  Y_te,  ZX_te