code: def test_abstract_model_example() -> None:
      import pyomo.environ as pyomo
  
      def square(m):
          return pyomo.quicksum((m.x[i] - 0.5) ** 2 for i in m.x)
  
      abstract_model = pyomo.AbstractModel()
      abstract_model.F = pyomo.Set()
      abstract_model.Xmin = pyomo.Param(
          abstract_model.F, within=pyomo.Reals, default=0.0
      )
      abstract_model.x = pyomo.Var(abstract_model.F, within=pyomo.Reals)
      abstract_model.constraints = pyomo.Constraint(
          abstract_model.F, rule=lambda m, i: m.x[i] >= m.Xmin[i]
      )
      abstract_model.obj = pyomo.Objective(rule=square)
  
      import nevergrad as ng
      import nevergrad.functions.pyomo as ng_pyomo
  
      # Load the values of the parameters from external file
      data_path = str(Path(__file__).with_name("test_model_1.dat"))
  
      # DOC_ABSTRACT_100
      data = pyomo.DataPortal()
      data.load(filename=data_path, model=abstract_model)
      model = abstract_model.create_instance(data)
      # DOC_ABSTRACT_101
  
      func = ng_pyomo.Pyomo(model)
      optimizer = ng.optimizers.OnePlusOne(
          parametrization=func.parametrization, budget=200
      )
      recommendation = optimizer.minimize(func.function)
  
      np.testing.assert_almost_equal(
          recommendation.kwargs['x["New York"]'],
          model.Xmin["New York"],
          decimal=1,
      )
      np.testing.assert_almost_equal(
          recommendation.kwargs['x["Hong Kong"]'],
          model.Xmin["Hong Kong"],
          decimal=1,
      )
  
imports: from pathlib import Path
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: test_abstract_model_example() and returns: pyomo