code: def test_simplest_example() -> None:
      # DOC_SIMPLEST_0
      import nevergrad as ng
  
      def square(x):
          return sum((x - 0.5) ** 2)
  
      # optimization on x as an array of shape (2,)
      optimizer = ng.optimizers.NGOpt(parametrization=2, budget=100)
      recommendation = optimizer.minimize(square)  # best value
      print(recommendation.value)
      # >>> [0.49999998 0.50000004]
      # DOC_SIMPLEST_1
      np.testing.assert_array_almost_equal(
          recommendation.value, [0.5, 0.5], decimal=1
      )
  
file_path: nevergrad/nevergrad/optimization/test_doc.py
imports: import warnings
  import numpy
  import nevergrad
label_desc: Use image node_id 1 for calling a global function with example usage: test_simplest_example() and returns: sum