code: def nontraceable(x, *, name="nontraceable operation"):
      """Identity function, which raises an error if it is transformed in any way. (i.e.
      in `jax.grad`, `jax.vmap` etc.)
  
      This is useful at the end of the `impl` rule for higher-order final-style
      primitives, for checking that no other tracers were captured via closure.
      """
      dynamic, static = partition(x, is_array)
      bind = ft.partial(nontraceable_p.bind, name=name)
      dynamic = jtu.tree_map(bind, dynamic)
      return combine(dynamic, static)
  
file_path: equinox/equinox/internal/_nontraceable.py
imports: import functools
  from typing import Optional
  import jax
  import jax.core
  import jax.interpreters.ad
  import jax.interpreters.batching
  import jax.interpreters.mlir
  import jax.tree_util
  from jaxtyping import PyTree
  from .._ad import nondifferentiable
  from .._errors import error_if
  from .._filters import combine, is_array, partition
label_desc: Use image node_id 2 for calling a global function with example usage: nontraceable(x) and returns: combine