def _wrapx(input, output, repeat):
 output[...] = 0
 nbytes = (((repeat - 1) // 8) + 1)
 unused = ((nbytes * 8) - repeat)
 for i in range(nbytes):
  _min = (i * 8)
  _max = min(((i + 1) * 8), repeat)
  for j in range(_min, _max):
   if (j != _min):
    np.left_shift(output[..., i], 1, output[..., i])
   np.add(output[..., i], input[..., j], output[..., i])
 np.left_shift(output[..., i], unused, output[..., i])

def _wrapx ( input , output , repeat ) : output [ ... ] = 0 nbytes = ( ( ( repeat - 1 ) // 8 ) + 1 ) unused = ( ( nbytes * 8 ) - repeat ) for i in range ( nbytes ) : _min = ( i * 8 ) _max = min ( ( ( i + 1 ) * 8 ) , repeat ) for j in range ( _min , _max ) : if ( j != _min ) : np . left_shift ( output [ ... , i ] , 1 , output [ ... , i ] ) np . add ( output [ ... , i ] , input [ ... , j ] , output [ ... , i ] ) np . left_shift ( output [ ... , i ] , unused , output [ ... , i ] )
wrap the x format column boolean array into an uint8 array .