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
code: def default(self, memo: Sample | None = None) -> None:
      memo = {} if memo is None else memo
      for mutable in self.simplify().values():
          if mutable is not self:
              mutable.default(memo)
      # Exception could raise here.
      # Use `robust_default()` if the exception is expected and `random()` should be retried.
      return self.freeze(memo)
  
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 4 for calling the Constraint obj's underlying member method code with example usage: obj.default(memo) and returns: self