code: def test_3d():
      def obj_func(x, y, z):
          assert isinstance(x, float)
          assert isinstance(y, str)
          assert isinstance(z, int)
          # Global maximum of 4 is at x=4
          return (
              -4.0
              * numpy.exp(-((x - 4.0) ** 2) / 10.0)
              * numpy.cos(1.5 * (x - 4.0)) ** 2
              - int(y) * z
          )
  
      parameters = [
          sherpa.Continuous("x", [0.0, 7.0]),
          sherpa.Choice("y", ["-1", "0", "1"]),
          sherpa.Discrete("z", [1, 5]),
      ]
  
      bayesian_optimization = GPyOpt(
          max_concurrent=1,
          max_num_trials=100,
          model_type="GP",
          acquisition_type="EI",
      )
  
      study = sherpa.Study(
          algorithm=bayesian_optimization,
          parameters=parameters,
          lower_is_better=True,
          disable_dashboard=True,
      )
  
      for trial in study:
          print("Trial {}:\t{}".format(trial.id, trial.parameters))
  
          fval = obj_func(**trial.parameters)
          print("Function Value: {}".format(fval))
          study.add_observation(
              trial=trial, iteration=1, objective=fval
          )
          study.finalize(trial, status="COMPLETED")
      rval = study.get_best_result()
      print(rval)
  
      assert numpy.isclose(rval["x"], 4.0, atol=0.1)
      assert rval["y"] == 1
      assert rval["z"] == 5
  
imports: import sherpa
  import pandas
  import pytest
  import numpy
  import collections
  import GPyOpt
  from sherpa.algorithms.bayesian_optimization import GPyOpt
  from sherpa.algorithms import Repeat
label_desc: Use image node_id 20 for calling a global function with example usage: test_3d() and returns: unknown