code: def get_device_from_array(*arrays):
      """Gets the device from arrays.
  
      The device on which the given array reside is returned.
  
      .. note::
  
          Unlike :func:`get_array_module`, this method does not recognize
          :class:`~chainer.Variable` objects.
          If you need to get device from the :class:`~chainer.Variable` instance
          ``v``, you need to use ``get_device_from_array(v.array)``.
  
      Args:
          arrays (array or list of arrays):
              Arrays to determine the device. If multiple arrays are given, the
              device correspoinding to the first array which is not NumPy array
              is returned.
  
      Returns:
          chainer.backend.Device: Device instance.
      """
      for array in arrays:
          device = GpuDevice.from_array(array)
          if device is not None:
              return device
  
          if isinstance(array, chainerx.ndarray):
              return ChainerxDevice(array.device)
  
          device = Intel64Device.from_array(array)
          if device is not None:
              return device
  
      return CpuDevice()
  
imports: import numpy
  import six
  import chainer
  from chainer.backends import _chainerx
  from chainer.backends import _cpu
  from chainer.backends import cuda
  from chainer.backends import intel64
  import chainerx
  from chainer._backend import Device
  from chainer.backends._chainerx import ChainerxDevice
  from chainer.backends._chainerx import from_chx
  from chainer.backends._chainerx import to_chx
  from chainer.backends._cpu import CpuDevice
  from chainer.backends.cuda import GpuDevice
  from chainer.backends.intel64 import Intel64Device
  from chainer import types
label_desc: Use image node_id 8 for calling a global function with example usage: get_device_from_array() and returns: CpuDevice, device, ChainerxDevice, device