code: def build_gp_with_dataset(dataset, kern=None):
      """Function to build a SE GP with the dataset."""
      mean_func = lambda x: np.array([np.median(dataset[1])] * len(x))
      noise_var = dataset[1].std() ** 2 / 20
      kern = dataset[2] if kern is None else kern
      return GP(dataset[0], dataset[1], kern, mean_func, noise_var)
  
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 2 for calling a global function with example usage: build_gp_with_dataset(dataset, kern) and returns: GP