code: def test_callback_doc() -> None:
      # DOC_CALLBACK_0
      import nevergrad as ng
  
      def my_function(x):
          return abs(sum(x - 1))
  
      def print_candidate_and_value(optimizer, candidate, value):
          print(candidate, value)
  
      optimizer = ng.optimizers.NGOpt(parametrization=2, budget=4)
      optimizer.register_callback("tell", print_candidate_and_value)
      optimizer.minimize(my_function)
  
file_path: nevergrad/nevergrad/optimization/test_doc.py
imports: import warnings
  import numpy
  import nevergrad
label_desc: Use image node_id 7 for calling a global function with example usage: test_callback_doc() and returns: abs