code: def check_user_dtype_supported(dtype, fun_name=None):
      if issubdtype(dtype, extended):
          return
      # Avoid using `dtype in [...]` because of numpy dtype equality overloading.
      if isinstance(dtype, type) and dtype in {
          bool,
          int,
          float,
          builtins.complex,
      }:
          return
      np_dtype = np.dtype(dtype)
      if int4 is not None:
          is_custom_dtype = np_dtype.type in [
              *_custom_float_scalar_types,
              int4,
              uint4,
          ]
      else:
          is_custom_dtype = np_dtype.type in _custom_float_scalar_types
      if np_dtype.kind not in "biufc" and not is_custom_dtype:
          msg = f"JAX only supports number and bool dtypes, got dtype {dtype}"
          msg += f" in {fun_name}" if fun_name else ""
          raise TypeError(msg)
      if dtype is not None and np_dtype != canonicalize_dtype(dtype):
          msg = (
              "Explicitly requested dtype {} {} is not available, "
              "and will be truncated to dtype {}. To enable more dtypes, set the "
              "jax_enable_x64 configuration option or the JAX_ENABLE_X64 shell "
              "environment variable. "
              "See https://github.com/google/jax#current-gotchas for more."
          )
          fun_name = f"requested in {fun_name}" if fun_name else ""
          truncated_dtype = canonicalize_dtype(dtype).name
          warnings.warn(
              msg.format(dtype, fun_name, truncated_dtype), stacklevel=3
          )
  
imports: from __future__ import annotations
  import abc
  import builtins
  import functools
  from typing import cast, overload, Any, Literal, Union
  import warnings
  import ml_dtypes
  import numpy
  from jax._src import config
  from jax._src.typing import DType, DTypeLike
  from jax._src.util import set_module
  from jax._src import traceback_util
label_desc: Use image node_id 29 for calling a global function with example usage: check_user_dtype_supported(dtype, fun_name) without return types