code: def test_discrete_search_callback_on_task_begin():
      space = search.SearchSpace(1, 2, [0, 0], [1, 1])
      optimizer = swarm.PSO()
      func = function.Function(Sphere())
  
      opt_model = Opytimizer(space, optimizer, func)
  
      try:
          allowed_values = [[1]]
          new_discrete_search_callback = (
              callback.DiscreteSearchCallback(
                  allowed_values=allowed_values
              )
          )
          new_discrete_search_callback.on_task_begin(opt_model)
      except:
          allowed_values = [[1], [1]]
          new_discrete_search_callback = (
              callback.DiscreteSearchCallback(
                  allowed_values=allowed_values
              )
          )
          new_discrete_search_callback.on_task_begin(opt_model)
  
      try:
          allowed_values = [[10], [10]]
          new_discrete_search_callback = (
              callback.DiscreteSearchCallback(
                  allowed_values=allowed_values
              )
          )
          new_discrete_search_callback.on_task_begin(opt_model)
      except:
          allowed_values = [[1], [1]]
          new_discrete_search_callback = (
              callback.DiscreteSearchCallback(
                  allowed_values=allowed_values
              )
          )
          new_discrete_search_callback.on_task_begin(opt_model)
  
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 11 for calling a global function with example usage: test_discrete_search_callback_on_task_begin() without return types