code: def _as_array(data):
      if isinstance(data, chainer.get_array_types()):
          return data
      else:
          device = chainer.backend.get_device_from_array(data[0])
          with chainer.using_device(device):
              return device.xp.asarray(data)
  
imports: import six
  import chainer
  from chainer.dataset import dataset_mixin
label_desc: Use image node_id 1 for calling a global function with example usage: _as_array(data) and returns: data, device