code: def _get_float_dtype(dtype: Dtype):
      """Promote dtype to float32 or float64 as appropriate."""
      if dtype is None:
          return np.dtype(np.float32)
      rv = np.promote_types(dtype, np.float32)
      if np.float32 != rv != np.float64:
          raise TypeError(
              f"Dtype {dtype} cannot be safely promoted to float32 or float64"
          )
      return rv
  
file_path: cugraph/python/nx-cugraph/nx_cugraph/utils/misc.py
imports: from __future__ import annotations
  import itertools
  import operator
  import sys
  from random import Random
  from typing import TYPE_CHECKING, SupportsIndex
  import cupy
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: _get_float_dtype(dtype) and returns: rv, np