code: def result_type(*arrays_and_dtypes: Union[Array, Dtype]) -> Dtype:
      """
      Array API compatible wrapper for :py:func:`np.result_type <numpy.result_type>`.
  
      See its docstring for more information.
      """
      # Note: we use a custom implementation that gives only the type promotions
      # required by the spec rather than using np.result_type. NumPy implements
      # too many extra type promotions like int64 + uint64 -> float64, and does
      # value-based casting on scalar arrays.
      A = []
      for a in arrays_and_dtypes:
          if isinstance(a, Array):
              a = a.dtype
          elif isinstance(a, np.ndarray) or a not in _all_dtypes:
              raise TypeError(
                  "result_type() inputs must be array_api arrays or dtypes"
              )
          A.append(a)
  
      if len(A) == 0:
          raise ValueError("at least one array or dtype is required")
      elif len(A) == 1:
          return A[0]
      else:
          t = A[0]
          for t2 in A[1:]:
              t = _result_type(t, t2)
          return t
  
file_path: cupy/cupy/array_api/_data_type_functions.py
imports: from __future__ import annotations
  from ._array_object import Array
  from ._dtypes import _all_dtypes, _result_type
  from dataclasses import dataclass
  from typing import TYPE_CHECKING, List, Tuple, Union
  import cupy
label_desc: Use image node_id 7 for calling a global function with example usage: result_type() and returns: A, t