code: def _dtype(dtype, xp):
      dtype = xp.dtype(dtype)
      if dtype.kind in "fc":
          return dtype
      if dtype in (xp.int8, xp.uint8):
          return xp.float16
      if dtype in (xp.int16, xp.uint16):
          return xp.float32
      return xp.float64
  
file_path: cupy/tests/cupyx_tests/scipy_tests/stats_tests/test_morestats.py
imports: import numpy
  import cupy
  from cupy import testing
  import cupyx
  import cupyx.scipy.stats
label_desc: Use image node_id 1 for calling a global function with example usage: _dtype(dtype, xp) and returns: xp, dtype, xp, xp