class_docstr: Constraints put extra requirements to make one sample valid.
  
  For example, a constraint can be used to express that a variable should be larger than another variable,
  or certain combinations of variables should be strictly avoided.
  
  :class:`Constraint` is a subclass of :class:`MutableAnnotation`, and thus can be used as a normal mutable.
  It has a special :meth:`contains` method, which is used to check whether a sample satisfies the constraint.
  A constraint is satisfied if and only if :meth:`contains` returns ``None``.
  
  In general, users should inherit from :class:`Constraint` to implement customized constraints.
  :class:`ExpressionConstraint` is a special constraint
  that can be used to express constraints in a more concise way.
  
  See Also
  --------
  ExpressionConstraint
docstr: Override this to implement customized constraint.
  It should return a list of leaf mutables that are used in the constraint.
  
  See Also
  --------
  nni.mutable.Mutable.leaf_mutables
docstr_tok: ["Override","this","to","implement","customized","constraint",".","It","should","return","a","list","of","leaf","mutables","that","are","used","in","the","constraint",".","See","Also","--","--","--","--","nni.mutable.Mutable.leaf_mutables"]
code: def leaf_mutables(
      self, is_leaf: Callable[[Mutable], bool]
  ) -> Iterable[LabeledMutable]:
      """Override this to implement customized constraint.
      It should return a list of leaf mutables that are used in the constraint.
  
      See Also
      --------
      nni.mutable.Mutable.leaf_mutables
      """
      return super().leaf_mutables(is_leaf)
  
imports: from __future__ import annotations
  import logging
  from typing import Iterable, Callable
  from numpy.random import RandomState
  from .exception import ConstraintViolation, SampleValidationError
  from .mutable import LabeledMutable, Mutable, Sample, MutableExpression
  from .utils import auto_label
label_desc: Use image node_id 1 for calling the Constraint obj's underlying member method code with example usage: obj.leaf_mutables(is_leaf) and returns: super