def all_bit_strings(bits, dtype='uint8'):
 return np.array([[int(x) for x in np.binary_repr(i, width=bits)] for i in xrange(0, (2 ** bits))], dtype=dtype)

def all_bit_strings ( bits , dtype = 'uint8' ) : return np . array ( [ [ int ( x ) for x in np . binary_repr ( i , width = bits ) ] for i in xrange ( 0 , ( 2 ** bits ) ) ] , dtype = dtype )
create a matrix of all binary strings of a given width as the rows .