code: def _ones_like(arr):
      device = backend.get_device_from_array(arr)
      with chainer.using_device(device):
          return device.xp.ones_like(arr)
  
imports: from __future__ import absolute_import
  import warnings
  import numpy
  import six
  import chainer
  from chainer import backend
  from chainer.backends import _cpu
  from chainer.backends import cuda
  from chainer import configuration
  from chainer import testing
  from chainer import utils
  from chainer import variable
  import chainerx
label_desc: Use image node_id 2 for calling a global function with example usage: _ones_like(arr) and returns: device