docstr: Conditionally raise a runtime error, with message given by this enumeration
  item.
  
  See [`equinox.error_if`][] for more information on the behaviour of errors.
  
  **Arguments:**
  
  - `token`: the token to thread the error on to. This should be a PyTree
      containing at least one array. The error will be checked after this array
      has been computed, and before the return value from this function is used.
  - `pred`: the condition to raise the error on. Will raise if this evaluates to
      True at runtime.
  
  **Returns:**
  
  `token` is returned unchanged.
docstr_tok: ["Conditionally","raise","a","runtime","error",",","with","message","given","by","this","enumeration","item",".","See","[","`","equinox.error_if","`","]","[","]","for","more","information","on","the","behaviour","of","errors",".","*","*","Arguments",":","*","*","-","`","token","`",":","the","token","to","thread","the","error","on","to",".","This","should","be","a","PyTree","containing","at","least","one","array",".","The","error","will","be","checked","after","this","array","has","been","computed",",","and","before","the","return","value","from","this","function","is","used",".","-","`","pred","`",":","the","condition","to","raise","the","error","on",".","Will","raise","if","this","evaluates","to","True","at","runtime",".","*","*","Returns",":","*","*","`","token","`","is","returned","unchanged","."]
code: def error_if(self, token, pred):
      """Conditionally raise a runtime error, with message given by this enumeration
      item.
  
      See [`equinox.error_if`][] for more information on the behaviour of errors.
  
      **Arguments:**
  
      - `token`: the token to thread the error on to. This should be a PyTree
          containing at least one array. The error will be checked after this array
          has been computed, and before the return value from this function is used.
      - `pred`: the condition to raise the error on. Will raise if this evaluates to
          True at runtime.
  
      **Returns:**
  
      `token` is returned unchanged.
      """
      return branched_error_if(
          token, pred, self._value, self._enumeration._index_to_message
      )
  
imports: import warnings
  from typing import Any, cast, TYPE_CHECKING, Union
  import jax._src.traceback_util
  import jax.core
  import jax.numpy
  import numpy
  from jaxtyping import Array, ArrayLike, Bool, Int
  from ._doc_utils import doc_repr
  from ._errors import branched_error_if
  from ._module import field, Module
label_desc: Use image node_id 4 for calling the EnumerationItem obj's underlying member method code with example usage: obj.error_if(token, pred) and returns: branched_error_if