code: def test_1d_minimize():
      def obj_func(x):
          # 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
          )
  
      parameters = [sherpa.Continuous("x1", [0.0, 7.0])]
  
      bayesian_optimization = GPyOpt(
          max_concurrent=1,
          max_num_trials=12,
          model_type="GP",
          acquisition_type="EI",
          initial_data_points=[{"x1": 2}, {"x1": 5}],
          num_initial_data_points=2,
      )
  
      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["x1"])
          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)
  
      # bounds = [{'name': 'x', 'type': 'continuous', 'domain': (0, 7)}]
      # Xinit = numpy.array([2, 5]).reshape(-1, 1)
      # yinit = obj_func(Xinit)
      # myBopt = gpyopt_package.methods.BayesianOptimization(f=obj_func,
      #                                              # function to optimize
      #                                              domain=bounds,
      #                                              # box-constraints of the problem
      #                                              acquisition_type='EI',
      #                                              X=Xinit,
      #                                              y=yinit,
      #                                              initial_design_numdata=0,
      #                                              initial_design_type='random',
      #                                              evaluator_type='local_penalization',
      #                                              batch_size=1,
      #                                              maximize=True,
      #                                              exact_feval=False)
      # # Run the optimization
      # max_iter = 10  # evaluation budget
      # max_time = 60  # time budget
      # eps = 10e-6  # Minimum allows distance between the las two observations
      #
      # myBopt.run_optimization(max_iter, max_time, eps)
      # print(myBopt.get_evaluations())
  
      assert numpy.isclose(rval["x1"], 4.0, atol=0.1)
  
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 19 for calling a global function with example usage: test_1d_minimize() and returns: unknown