#NEWLINE# def get_num_words_with_entropy( bits_of_entropy , wordlist ) : #NEWLINE# #INDENT# ' Gets the number of words randomly selected from a given wordlist that\n        would result in the number of bits of entropy specified.\n    ' #NEWLINE# entropy_per_word = ( math . log ( len ( wordlist ) ) / math . log ( 2 ) ) #NEWLINE# num_words = int ( math . ceil ( ( bits_of_entropy / entropy_per_word ) ) ) #NEWLINE# return num_words