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"]
docstr: Returns a constraint-free parameter, for the optimization process
docstr_tok: ["Returns","a","constraint-free","parameter",",","for","the","optimization","process"]
code: def parameter(self) -> core.Parameter:
      """Returns a constraint-free parameter, for the optimization process"""
      param = self._layers[0].copy()
      # remove last layer and make sure it is the last one
      if self._layer_index != param._layers.pop()._layer_index:
          raise RuntimeError(
              "Constraint layer should be unique and placed last"
          )
      return param
  
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 5 for calling the Constraint obj's underlying member method code with example usage: obj.parameter() and returns: param