code: def _output_dtype(dtype_or_range):
      """Determine the output dtype for rescale_intensity.
  
      The dtype is determined according to the following rules:
      - if ``dtype_or_range`` is a dtype, that is the output dtype.
      - if ``dtype_or_range`` is a dtype string, that is the dtype used, unless
        it is not a NumPy data type (e.g. 'uint12' for 12-bit unsigned integers),
        in which case the data type that can contain it will be used
        (e.g. uint16 in this case).
      - if ``dtype_or_range`` is a pair of values, the output data type will be
        float.
  
      Parameters
      ----------
      dtype_or_range : type, string, or 2-tuple of int/float
          The desired range for the output, expressed as either a NumPy dtype or
          as a (min, max) pair of numbers.
  
      Returns
      -------
      out_dtype : type
          The data type appropriate for the desired output.
      """
      if type(dtype_or_range) in [list, tuple, np.ndarray]:
          # pair of values: always return float.
          return np.float_
      if type(dtype_or_range) == type:
          # already a type: return it
          return dtype_or_range
      if dtype_or_range in DTYPE_RANGE:
          # string key in DTYPE_RANGE dictionary
          try:
              # if it's a canonical numpy dtype, convert
              return np.dtype(dtype_or_range).type
          except TypeError:  # uint10, uint12, uint14
              # otherwise, return uint16
              return np.uint16
      else:
          raise ValueError(
              "Incorrect value for out_range, should be a valid image data "
              "type or a pair of values, got %s." % str(dtype_or_range)
          )
  
imports: import numpy
  from warnings import warn
label_desc: Use image node_id 2 for calling a global function with example usage: _output_dtype(dtype_or_range) and returns: np, dtype_or_range, np, np