

def _bitsfor(maxval):
    ' Convert a maxval into a number of bits (left shift).\n        Raises a ValueError if the maxval is not a power of 2. '
    maxvalbits = int(round((math.log(maxval) / math.log(2))))
    if (maxval != (1 << maxvalbits)):
        raise ValueError(('maxval must be a power of 2, not %d' % maxvalbits))
    return maxvalbits

dataset/ETHPy150Open dpwe/audfprint/hash_table.py _bitsfor/VarMisuse@55/138 `maxval`->`maxvalbits`