code: def check_arraylike(
      fun_name: str, *args: Any, emit_warning=False, stacklevel=3
  ):
      """Check if all args fit JAX's definition of arraylike."""
      assert isinstance(
          fun_name, str
      ), f"fun_name must be a string. Got {fun_name}"
      if any(not _arraylike(arg) for arg in args):
          pos, arg = next(
              (i, arg)
              for i, arg in enumerate(args)
              if not _arraylike(arg)
          )
          msg = f"{fun_name} requires ndarray or scalar arguments, got {type(arg)} at position {pos}."
          if emit_warning:
              warnings.warn(
                  msg
                  + " In a future JAX release this will be an error.",
                  category=DeprecationWarning,
                  stacklevel=stacklevel,
              )
          else:
              raise TypeError(msg.format(fun_name, type(arg), pos))
  
imports: from __future__ import annotations
  from collections.abc import Sequence
  from functools import partial
  import re
  import textwrap
  from typing import Any, Callable, NamedTuple, TypeVar
  import warnings
  from jax._src import api
  from jax._src import config
  from jax._src import core
  from jax._src import dtypes
  from jax._src.lax import lax
  from jax._src.util import safe_zip, safe_map
  from jax._src.typing import Array, ArrayLike, DimSize, DType, DTypeLike, Shape
  import numpy
label_desc: Use image node_id 13 for calling a global function with example usage: check_arraylike(fun_name) without return types