code: def _nan_like(
      x: Union[Array, np.ndarray]
  ) -> Union[Array, np.ndarray]:
      dtype = np.result_type(x)
      if np.issubdtype(dtype, np.inexact):
          return np.broadcast_to(np.array(np.nan, dtype), x.shape)
      elif np.issubdtype(dtype, np.integer):
          return np.broadcast_to(
              np.array(np.iinfo(dtype).max, dtype), x.shape
          )
      elif np.issubdtype(dtype, np.bool_):
          return np.broadcast_to(np.array(True, dtype), x.shape)
      else:
          return x
  
imports: import functools
  import inspect
  import warnings
  from collections.abc import Sequence
  from typing import Literal, Union
  import jax
  import jax._src.traceback_util
  import jax.core
  import jax.lax
  import jax.numpy
  import jax.tree_util
  import numpy
  from jaxtyping import Array, ArrayLike, Bool, Int, PyTree
  from ._ad import filter_custom_jvp
  from ._config import EQX_ON_ERROR, EQX_ON_ERROR_BREAKPOINT_FRAMES
  from ._doc_utils import doc_remove_args
  from ._filters import combine, is_array, partition
  from ._jit import filter_jit
  from ._misc import currently_jitting
  from ._unvmap import unvmap_any, unvmap_max
label_desc: Use image node_id 1 for calling a global function with example usage: _nan_like(x) and returns: np, np, np, x