<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def random_words(lang='en', wordlist='best', nwords=5, bits_per_word=12, ascii_only=False):
 """ Returns a string of random, space separated words. These words are of the given language and from the given wordlist. There will be `nwords` words in the string. `bits_per_word` determines the amount of entropy provided by each word; when it's higher, this function will choose from a larger list of words, some of which are more rare. You can restrict the selection of words to those written in ASCII characters by setting `ascii_only` to True. """

    n_choices = 2 ** bits_per_word
    choices = top_n_list(lang, n_choices, wordlist, ascii_only=ascii_only)
    if len(choices) < n_choices:
        raise ValueError(
            "There aren't enough words in the wordlist to provide %d bits of "
            "entropy per word." % bits_per_word
        )
    return ' '.join([random.choice(choices) for i in range(nwords)])