def _get_prefix_length(number1, number2, bits):
 for i in range(bits):
  if ((number1 >> i) == (number2 >> i)):
   return (bits - i)
 return 0

def _get_prefix_length ( number1 , number2 , bits ) : for i in range ( bits ) : if ( ( number1 >> i ) == ( number2 >> i ) ) : return ( bits - i ) return 0
get the number of leading bits that are same for two numbers .