code: def _rank_promotion_warning_or_error(
      fun_name: str, shapes: Sequence[Shape]
  ):
      if config.numpy_rank_promotion.value == "warn":
          msg = (
              "Following NumPy automatic rank promotion for {} on shapes {}. "
              "Set the jax_numpy_rank_promotion config option to 'allow' to "
              "disable this warning; for more information, see "
              "https://jax.readthedocs.io/en/latest/rank_promotion_warning.html."
          )
          warnings.warn(
              msg.format(fun_name, " ".join(map(str, shapes)))
          )
      elif config.numpy_rank_promotion.value == "raise":
          msg = (
              "Operands could not be broadcast together for {} on shapes {} "
              "and with the config option jax_numpy_rank_promotion='raise'. "
              "For more information, see "
              "https://jax.readthedocs.io/en/latest/rank_promotion_warning.html."
          )
          raise ValueError(
              msg.format(fun_name, " ".join(map(str, shapes)))
          )
  
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 6 for calling a global function with example usage: _rank_promotion_warning_or_error(fun_name, shapes) without return types