def lookup_phrase(phrase_key, phrase_book):
    v = phrase_book.get(phrase_key)
    if v is None:
        raise ValueError('Could not find phrase with key "%s".' % phrase_key)
    assert isinstance(v, list)
    return choice(v)
dataset/ETHPy150Open fdb/choicewords/choicewords.py/lookup_phrase/original