code: def test_utility_function():
      util = UtilityFunction(kind="ucb", kappa=1.0, xi=1.0)
      assert util.kind == "ucb"
  
      util = UtilityFunction(kind="ei", kappa=1.0, xi=1.0)
      assert util.kind == "ei"
  
      util = UtilityFunction(kind="poi", kappa=1.0, xi=1.0)
      assert util.kind == "poi"
  
      with pytest.raises(NotImplementedError):
          util = UtilityFunction(kind="other", kappa=1.0, xi=1.0)
  
file_path: BayesianOptimization/tests/test_util.py
imports: import pytest
  import numpy
  from bayes_opt import BayesianOptimization
  from bayes_opt.util import UtilityFunction, Colours
  from bayes_opt.util import acq_max, load_logs, ensure_rng
  from sklearn.gaussian_process.kernels import Matern
  from sklearn.gaussian_process import GaussianProcessRegressor
  from scipy.optimize import NonlinearConstraint
  from pathlib import Path
label_desc: Use image node_id 3 for calling a global function with example usage: test_utility_function() without return types