def _number_of_set_bits(x):
 x -= ((x >> 1) & 1431655765)
 x = (((x >> 2) & 858993459) + (x & 858993459))
 x = (((x >> 4) + x) & 252645135)
 x += (x >> 8)
 x += (x >> 16)
 return (x & 63)

def _number_of_set_bits ( x ) : x -= ( ( x >> 1 ) & 1431655765 ) x = ( ( ( x >> 2 ) & 858993459 ) + ( x & 858993459 ) ) x = ( ( ( x >> 4 ) + x ) & 252645135 ) x += ( x >> 8 ) x += ( x >> 16 ) return ( x & 63 )
returns the number of bits that are set in a 32bit int .