#NEWLINE# def __num_two_factors( x ) : #NEWLINE# #INDENT# 'Return how many times integer x can be evenly divided by 2.\n\n    Returns 0 for non-positive integers.\n    ' #NEWLINE# if ( x <= 0 ) : #NEWLINE# #INDENT# return 0 #NEWLINE# #UNINDENT# num_twos = 0 #NEWLINE# while ( ( x % 2 ) == 0 ) : #NEWLINE# #INDENT# num_twos += 1 #NEWLINE# x //= 2 #NEWLINE# #UNINDENT# return num_twos