code: def safe_dtype(*dtypes):
      """Determine a dtype to safely cast all of the given dtypes to.
  
      Safe dtypes are valid numpy dtypes or python types which can be
      cast to numpy dtypes.  See numpy.sctypes for a list of valid
      dtypes.  Composite dtypes and string dtypes are not safe dtypes.
  
      Parameters
      ----------
      dtypes : sequence of ``np.dtype``
  
      Returns
      -------
      dtype : np.dtype
  
      Examples
      --------
      >>> c1 = CoordinateSystem('ij', 'input', coord_dtype=np.float32)
      >>> c2 = CoordinateSystem('kl', 'input', coord_dtype=np.complex_)
      >>> safe_dtype(c1.coord_dtype, c2.coord_dtype)
      dtype('complex128')
  
      >>> # Strings are invalid dtypes
      >>> safe_dtype(type('foo'))
      Traceback (most recent call last):
      ...
      TypeError: dtype must be valid numpy dtype int, uint, float, complex or object
  
      >>> # Check for a valid dtype
      >>> myarr = np.zeros(2, np.float32)
      >>> myarr.dtype.isbuiltin
      1
  
      >>> # Composite dtypes are invalid
      >>> mydtype = np.dtype([('name', 'S32'), ('age', 'i4')])
      >>> myarr = np.zeros(2, mydtype)
      >>> myarr.dtype.isbuiltin
      0
      >>> safe_dtype(mydtype)
      Traceback (most recent call last):
      ...
      TypeError: dtype must be valid numpy dtype int, uint, float, complex or object
      """
      arrays = [np.zeros(2, dtype) for dtype in dtypes]
      kinds = [a.dtype.kind for a in arrays]
      if not set(kinds).issubset("iubfcO"):
          raise TypeError(
              "dtype must be valid numpy dtype "
              "int, uint, float, complex or object"
          )
      return np.array(arrays).dtype
  
imports: import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: safe_dtype() and returns: np