code: def test_kwargs_not_the_same():
      def target_function(x, y):
          return np.cos(2 * x) * np.cos(y) + np.sin(x)
  
      def constraint_function(a, b):
          return np.cos(a) * np.cos(b) - np.sin(a) * np.sin(b)
  
      constraint_limit_upper = 0.5
  
      constraint = NonlinearConstraint(
          constraint_function, -np.inf, constraint_limit_upper
      )
      pbounds = {"x": (0, 6), "y": (0, 6)}
  
      optimizer = BayesianOptimization(
          f=target_function,
          constraint=constraint,
          pbounds=pbounds,
          verbose=0,
          random_state=1,
      )
      with raises(
          TypeError, match="Encountered TypeError when evaluating"
      ):
          optimizer.maximize(
              init_points=2,
              n_iter=10,
          )
  
file_path: BayesianOptimization/tests/test_constraint.py
imports: import numpy
  from bayes_opt import BayesianOptimization
  from pytest import approx, raises
  from scipy.optimize import NonlinearConstraint
label_desc: Use image node_id 5 for calling a global function with example usage: test_kwargs_not_the_same() and returns: unknown, unknown