code: def __ua_convert__(dispatchables, coerce):
      if coerce:
          try:
              replaced = [
                  cupy.asarray(d.value)
                  if d.coercible and d.type is np.ndarray
                  else d.value
                  for d in dispatchables
              ]
          except TypeError:
              return NotImplemented
      else:
          replaced = [d.value for d in dispatchables]
  
      if not all(
          d.type is not np.ndarray or isinstance(r, cupy.ndarray)
          for r, d in zip(replaced, dispatchables)
      ):
          return NotImplemented
  
      return replaced
  
imports: from numbers import Number
  import warnings
  import numpy
  import cupy
  from cupy.fft._fft import _fft, _default_fft_func, hfft, ihfft, _swap_direction
label_desc: Use image node_id 1 for calling a global function with example usage: __ua_convert__(dispatchables, coerce) and returns: replaced, NotImplemented, NotImplemented