class_docstr: Operator for applying a constraint on a Parameter
  
  Parameters
  ----------
  func: function
      the constraint function, taking the same arguments that the function to optimize.
      This constraint function must return a float (or a list/tuple/array of floats),
      positive if the constraint is not satisfied, null or negative otherwise.
  optimizer: str
      name of the optimizer to use for solving the constraint
  budget: int
      the budget to use for applying the constraint
  
  Example
  -------
  >>> constrained_parameter = Constraint(constraint_function)(parameter)
  >>> constrained_parameter.value  # value after trying to satisfy the constraint
class_docstr_tok: ["Operator","for","applying","a","constraint","on","a","Parameter","Parameters","--","--","--","--","--","func",":","function","the","constraint","function",",","taking","the","same","arguments","that","the","function","to","optimize",".","This","constraint","function","must","return","a","float","(","or","a","list\/tuple\/array","of","floats",")",",","positive","if","the","constraint","is","not","satisfied",",","null","or","negative","otherwise",".","optimizer",":","str","name","of","the","optimizer","to","use","for","solving","the","constraint","budget",":","int","the","budget","to","use","for","applying","the","constraint","Example","--","--","--","-",">",">",">","constrained_parameter","=","Constraint","(","constraint_function",")","(","parameter",")",">",">",">","constrained_parameter.value","#","value","after","trying","to","satisfy","the","constraint"]
code: def __init__(
      self,
      func: tp.Callable[..., tp.Loss],
      optimizer: str = "NGOpt",
      budget: int = 100,
  ) -> None:
      super().__init__()
      self._func = func
      self._opt_cls = optimizers.registry[optimizer]
      self._budget = budget
      self._cache: tp.Any = None
  
file_path: nevergrad/nevergrad/ops/constraints.py
imports: import numpy
  import nevergrad.common.typing
  from nevergrad.common import errors
  from nevergrad.parametrization import core
  from nevergrad import optimizers
  from nevergrad import callbacks
label_desc: Use image node_id 1 to create a new Constraint object from inherited base classes: core with example: obj = Constraint(func, optimizer, budget)