code: def test_discrete_search_callback_on_evaluate_before():
      allowed_values = [[1], [1]]
      new_discrete_search_callback = callback.DiscreteSearchCallback(
          allowed_values=allowed_values
      )
  
      space = search.SearchSpace(1, 2, [0, 0], [1, 1])
      optimizer = swarm.PSO()
      func = function.Function(Sphere())
  
      opt_model = Opytimizer(space, optimizer, func)
  
      try:
          new_discrete_search_callback.on_evaluate_before(None)
      except:
          new_discrete_search_callback.on_evaluate_before(
              opt_model.space
          )
  
file_path: opytimizer/tests/opytimizer/utils/test_callback.py
imports: from opytimark.markers.n_dimensional import Sphere
  from opytimizer.core import function
  from opytimizer.optimizers import swarm
  from opytimizer.opytimizer import Opytimizer
  from opytimizer.spaces import search
  from opytimizer.utils import callback
label_desc: Use image node_id 12 for calling a global function with example usage: test_discrete_search_callback_on_evaluate_before() without return types