def _stackcopy(a, b):
 if (a.ndim == 3):
  a[:] = b[:, :, np.newaxis]
 else:
  a[:] = b

def _stackcopy ( a , b ) : if ( a . ndim == 3 ) : a [ : ] = b [ : , : , np . newaxis ] else : a [ : ] = b
copy b into each color layer of a .