code: def _inv(x):
      if x.ndim == 2:
          return numpy.linalg.inv(x)
      return numpy.array([numpy.linalg.inv(ix) for ix in x])
  
imports: import unittest
  import numpy
  import chainer
  from chainer.backends import cuda
  from chainer import functions
  from chainer import testing
  from chainer.testing import attr
  from chainer.utils import type_check
label_desc: Use image node_id 1 for calling a global function with example usage: _inv(x) and returns: numpy, numpy