code: def test_pyomo_set() -> None:
      def square2(m: tp.Any) -> float:
          return (m.x - 1) ** 2  # type: ignore
  
      model = pyomo.ConcreteModel()
      model.P = pyomo.Set(initialize=list(range(1, 11)))
      model.Q = pyomo.Set(initialize=list(range(6, 16)))
      model.R = model.P ^ model.Q  # XOR
      model.x = pyomo.Var(domain=model.R)
      model.obj = pyomo.Objective(rule=square2)
      model.constraint1 = pyomo.Constraint(rule=lambda m: m.x >= 2)
  
      func = core.Pyomo(model)
      func.parametrization.random_state.seed(12)
      optimizer = ng.optimizers.OnePlusOne(
          parametrization=func.parametrization, budget=100
      )
      recommendation = optimizer.minimize(func.function)
  
      np.testing.assert_almost_equal(
          recommendation.kwargs["x"], 2.0, decimal=1
      )
  
file_path: nevergrad/nevergrad/functions/pyomo/test_core.py
imports: import typing
  import os
  import numpy
  import pyomo.environ
  import nevergrad
  from .None import core
label_desc: Use image node_id 5 for calling a global function with example usage: test_pyomo_set() and returns: unknown