code: def _stop_gradient_impl(x: T) -> T:
      if not valid_jaxtype(x):
          raise TypeError(
              "stop_gradient only works on valid JAX arrays, but "
              f"input argument is: {x}"
          )
      return x
  
imports: from __future__ import annotations
  import types
  from typing import Any, Callable, TypeVar
  from jax._src import core
  from jax._src import traceback_util
  from jax._src.core import Primitive, valid_jaxtype, raise_to_shaped, get_aval
  from jax._src.tree_util import register_pytree_node
  from jax._src.typing import Array, ArrayLike
  from jax._src.util import safe_map
label_desc: Use image node_id 7 for calling a global function with example usage: _stop_gradient_impl(x) and returns: x