def _compressbits(bitvector, wordsize=32):
    ans = []
    for start in range(0, len(bitvector), wordsize):
        compressed = 0
        for i in range(wordsize):
            if i + start < len(bitvector) and bitvector[i + start]:
                compressed += 2**i
        ans.append(compressed)

    return ans
Compress binary vector into vector of long ints.
dataset/ETHPy150Open oddt/oddt/oddt/toolkits/rdk.py/_compressbits