code: def test_y_max_within_pbounds():
      PBOUNDS = {"p1": (0, 2), "p2": (1, 100)}
      space = TargetSpace(target_func, PBOUNDS)
      assert space._target_max() == None
      space.probe(params={"p1": 1, "p2": 2})
      space.probe(params={"p1": 0, "p2": 1})
      with pytest.warns(UserWarning):
          space.probe(params={"p1": 5, "p2": 1})
      assert space._target_max() == 3
  
imports: import pytest
  import numpy
  from bayes_opt.constraint import ConstraintModel
  from bayes_opt.target_space import TargetSpace
  from bayes_opt.util import NotUniqueError
label_desc: Use image node_id 13 for calling a global function with example usage: test_y_max_within_pbounds() without return types