code: def _get_expected_xp(backend_config, is_function):
      # Returns a pair of xp's expected in forward() and backward() respectively.
      xp = backend_config.xp
  
      if xp is chainerx:
          forward_xp = backend_config.device.fallback_device.xp
      else:
          forward_xp = xp
  
      if is_function:
          # chainer.Function
          backward_xp = forward_xp
      else:
          # chainer.FunctionNode
          backward_xp = xp
  
      return forward_xp, backward_xp
  
imports: import unittest
  import numpy
  import chainer
  from chainer import testing
  import chainer.testing.backend
  import chainerx
label_desc: Use image node_id 1 for calling a global function with example usage: _get_expected_xp(backend_config, is_function) and returns: forward_xp,  backward_xp