code: def _get_batch_non_diagonal(array):
      xp = cuda.get_array_module(array)
      if xp == np:
          return _get_batch_non_diagonal_cpu(array)
      else:
          return _get_batch_non_diagonal_gpu(array)
  
imports: from functools import lru_cache
  from chainer import cuda
  from chainer import function
  from chainer.utils import type_check
  import numpy
label_desc: Use image node_id 13 for calling a global function with example usage: _get_batch_non_diagonal(array) and returns: _get_batch_non_diagonal_cpu, _get_batch_non_diagonal_gpu