def boolToUbyte(x):
    assert isinstance(x,np.ndarray)
    assert x.dtype in [np.bool]
    assert len(x.shape) == 1
    assert x.shape[0] % 8 == 0
    
    out =   1*x[7::8] + \
            2*x[6::8] + \
            4*x[5::8] + \
            8*x[4::8] + \
           16*x[3::8] + \
           32*x[2::8] + \
           64*x[1::8] + \
          128*x[0::8]
    
    out = out.astype(np.ubyte)
    return out
Iterates over the collection.
dataset/ETHPy150Open bolme/pyvision/src/pyvision/other/distance.py/boolToUbyte--crossover with--dataset/ETHPy150Open hvandenb/splunk-elasticsearch/search-elasticsearch/bin/splunklib/client.py/ReadOnlyCollection.iter