code: def test_logs_constraint():
      def f(x, y):
          return -(x**2) - (y - 1) ** 2 + 1
  
      def c(x, y):
          return x**2 + y**2
  
      constraint = NonlinearConstraint(c, -np.inf, 3)
  
      optimizer = BayesianOptimization(
          f=f,
          pbounds={"x": (-200, 200), "y": (-200, 200)},
          constraint=constraint,
      )
  
      with pytest.raises(KeyError):
          load_logs(optimizer, [str(test_dir / "test_logs.log")])
  
      load_logs(
          optimizer, [str(test_dir / "test_logs_constrained.log")]
      )
  
      assert len(optimizer.space) == 7
  
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 9 for calling a global function with example usage: test_logs_constraint() and returns: unknown, unknown