code: def trans_O_3x3_4x4(Mw, minimal=False, trans=False):
      if minimal:
          T0 = np.empty((3, 6))
          T1 = np.empty((3, 3))
  
          for O, I in ((T0, Mw), (T1, T0.T)):
              # np.array([
              # [ 1, 1,         1 ,       1,     1,     0 ],
              # [ 0, 0.625,    -0.625,    1.5,  -1.5,   0 ],
              # [ 0, 0.390625,  0.390625, 2.25,  2.25,  1 ]]).T,
  
              t0 = I[1, :] + I[2, :]
              t1 = I[3, :] + I[4, :]
  
              O[0, :] = I[0, :] + t0 + t1
              O[1, :] = 0.625 * (I[1, :] - I[2, :]) + 1.5 * (
                  I[3, :] - I[4, :]
              )
              O[2, :] = 0.390625 * t0 + 2.25 * t1 + I[5, :]
  
              # {400.0/441.00, -625.0/1078.0, -625.0/1078.0, 25.0/198.00, 25.0/198.00, 0.},
              # {0.,           -125.0/308.0,   125.0/308.0,  25.0/132.0, -25.0/132.0,  0.},
              # {0.,           -25.0/88.0,    -25.0/88.0,    25.0/88.0,   25.0/88.0,   1.}
  
              # {400/441, -25*25/98*11, -25*25/98*11, 1*25/18*11,  1*25/18*11,  0 },
              # {0,        -5*25/28*11,   5*25/28*11, 1*25/12*11, -1*25/12*11,  0 },
              # {0,        -1*25/ 8*11,  -1*25/ 8*11, 1*25/ 8*11,  1*25/ 8*11,  1 }
  
              # t0 = I[1,:] + I[2,:]
              # t1 = I[3,:] + I[4,:]
  
              # O[0,:] = I[0,:]*f400_441 - t0*f625_1078 + t1*f25_198
              # O[1,:] = f125_308 * (I[2,:] - I[1,:]) + f25_132 * (I[3,:] - I[4,:])
              # O[2,:] = (t1 - t0)*f25_88 + I[5,:]
  
              # t0 = rcp6 * I[1,:]
              # t1 = rcp6 * I[2,:]
              # t2 = rcp6 * (I[3,:] + I[4,:])
              # t3 = t0 + t1
  
              # O[0,:] = rcp4 * (I[0,:] + t2) - t3
              # O[1,:] = t1 - t0 + rcp12 * (I[3,:] - I[4,:])
              # O[2,:] = t2 - t3 + I[5,:]
  
              # t0 = -rcp6 * (I[1,:] + I[2,:])
              # t1 =  rcp6 * (I[3,:] + I[4,:])
  
              # O[0,:] = rcp4 * (I[0,:] + t1) + t0
              # O[1,:] = rcp6 * (I[2,:] - I[1,:]) + rcp12 * (I[3,:] - I[4,:])
              # O[2,:] = t0 + t1 + I[5,:]
  
              # t0 = I[1,:] + I[2,:]
              # t1 = I[3,:] + I[4,:]
  
              # O[0,:] = I[0,:] + t0 + t1
              # O[1,:] = I[1,:] - I[2,:] + 2*(I[3,:] - I[4,:])
              # O[2,:] = t0 + 4*t1 + I[5,:]
  
          return T1.T
  
      else:
          return np.dot(
              np.dot(F_4x4_3x3[trans[0]].T, Mw), F_4x4_3x3[trans[1]]
          )
  
imports: from __future__ import division
  import numpy
  from struct import pack, unpack
  from neon import logger
label_desc: Use image node_id 14 for calling a global function with example usage: trans_O_3x3_4x4(Mw, minimal, trans) and returns: T1, np