code: def _set_shape(self, shape, trans):
      if trans:
          shape = [shape[1], shape[0]]
      if self.nbatch > 0:
          shape = [self.nbatch, shape[0], shape[1]]
      return shape
  
imports: import unittest
  import numpy
  import chainer
  from chainer import cuda
  import chainer.functions
  from chainer import gradient_check
  from chainer import testing
  from chainer.testing import attr
  from chainer import utils
  from chainer.utils import type_check
label_desc: Use image node_id 2 for calling the TestCooMatMul obj's underlying member method code with example usage: obj._set_shape(shape, trans) and returns: shape