code: def trans_O_4x4_3x3(Mw, minimal=False, trans=False):
      if minimal:
          T0 = np.empty((4, 6))
          T1 = np.empty((4, 4))
  
          for O, I in ((T0, Mw), (T1, T0.T)):
              t0 = I[1, :] + I[2, :]
              t1 = I[3, :] + I[4, :]
              t2 = I[1, :] - I[2, :]
              t3 = I[3, :] - I[4, :]
  
              O[0, :] = t0 + t1 + I[0, :]
              O[1, :] = t2 * 0.625 + t3 * 1.500
              O[2, :] = t0 * 0.390625 + t1 * 2.250
              O[3, :] = t2 * 0.244140625 + t3 * 3.375 + I[5, :]
  
              # t0 = I[1,:] + I[2,:]
              # t1 = I[3,:] + I[4,:]
              # t2 = I[1,:] - I[2,:]
              # t3 = I[3,:] - I[4,:]
  
              # O[0,:] = t0 + t1  + I[0,:]
              # O[1,:] = t2*0.700 + t3*1.500
              # O[2,:] = t0*0.490 + t1*2.250
              # O[3,:] = t2*0.343 + t3*3.375 + I[5,:]
  
              # t0 =  I[1,:] + I[2,:]
              # t1 =  I[3,:] + I[4,:]
              # t2 =  I[1,:] - I[2,:]
              # t3 =  I[3,:] - I[4,:]
              # O[0,:] = t0 + t1     + I[0,:]
              # O[1,:] = t2 + t3*2.0
              # O[2,:] = t0 + t1*4.0
              # O[3,:] = t2 + t3*8.0 + I[5,:]
  
          return T1.T
  
      else:
          return np.dot(
              np.dot(O_4x4_3x3[trans[0]], Mw), O_4x4_3x3[trans[1]].T
          )
  
imports: from __future__ import division
  import numpy
  from struct import pack, unpack
  from neon import logger
label_desc: Use image node_id 12 for calling a global function with example usage: trans_O_4x4_3x3(Mw, minimal, trans) and returns: T1, np