code: def gen_gp_test_data():
      """This function generates a bunch of test data."""
      # pylint: disable=too-many-locals
      # Dataset 1
      f1 = lambda x: (x**2).sum(axis=1)
      N1 = 5
      X1_tr = np.array(list(range(N1))).astype(float).reshape(
          (N1, 1)
      ) / N1 + 1 / (2 * N1)
      Y1_tr = f1(X1_tr)
      X1_te = np.random.random((50, 1))
      Y1_te = f1(X1_te)
      kernel1 = SEKernel(1, 1, 0.5)
      # Dataset 2
      N2 = 100
      D2 = 10
      f2 = lambda x: ((x**2) * list(range(1, D2 + 1)) / D2).sum(
          axis=1
      )
      X2_tr = np.random.random((N2, D2))
      Y2_tr = f2(X2_tr)
      X2_te = np.random.random((N2, D2))
      Y2_te = f2(X2_te)
      kernel2 = SEKernel(D2, 10, 0.2 * np.sqrt(D2))
      # Dataset 3
      N3 = 200
      D3 = 6
      f3 = lambda x: (
          (x**3 + 2 * x**2 - x + 2) * list(range(1, D3 + 1)) / D3
      ).sum(axis=1)
      X3_tr = np.random.random((N3, D3))
      Y3_tr = f3(X3_tr)
      X3_te = np.random.random((N3, D3))
      Y3_te = f3(X3_te)
      kernel3 = SEKernel(D3, 10, 0.2 * np.sqrt(D3))
      # Dataset 4
      N4 = 400
      D4 = 8
      f4 = lambda x: (
          (np.sin(x**2) + 2 * np.cos(x**2) - x + 2)
          * list(range(1, D4 + 1))
          / D4
      ).sum(axis=1)
      X4_tr = np.random.random((N4, D4))
      Y4_tr = f4(X4_tr)
      X4_te = np.random.random((N4, D4))
      Y4_te = f4(X4_te)
      kernel4 = SEKernel(D4, 10, 0.2 * np.sqrt(D4))
      # put all datasets into a list.
      return [
          (X1_tr, Y1_tr, kernel1, X1_te, Y1_te),
          (X2_tr, Y2_tr, kernel2, X2_te, Y2_te),
          (X3_tr, Y3_tr, kernel3, X3_te, Y3_te),
          (X4_tr, Y4_tr, kernel4, X4_te, Y4_te),
      ]
  
file_path: dragonfly/dragonfly/gp/unittest_gp_core.py
imports: from __future__ import absolute_import
  from __future__ import division
  from ..utils.base_test_class import BaseTestClass, execute_tests
  import numpy
  from .gp_core import GP
  from .kernel import SEKernel
label_desc: Use image node_id 1 for calling a global function with example usage: gen_gp_test_data() and returns: list