<commit_before>#!/usr/bin/env python
"""
Autocompletion example that shows meta-information alongside the completions.
"""
from __future__ import unicode_literals

from prompt_toolkit.contrib.completers import WordCompleter
from prompt_toolkit import prompt, CompleteStyle


animal_completer = WordCompleter([
    'alligator',
    'ant',
    'ape',
    'bat',

    'bear', 'beaver', 'bee', 'bison', 'butterfly', 'cat', 'chicken',
    'crocodile', 'dinosaur', 'dog', 'dolphin', 'dove', 'duck', 'eagle',
    'elephant',
], meta_dict={
    'alligator': 'An alligator is a crocodilian in the genus Alligator of the family Alligatoridae.',
    'ant': 'Ants are eusocial insects of the family Formicidae',
    'ape': 'Apes (Hominoidea) are a branch of Old World tailless anthropoid catarrhine primates ',
    'bat': 'Bats are mammals of the order Chiroptera',
}, ignore_case=True)


def main():
    text = prompt('Give some animals: ', completer=animal_completer,
                  complete_style=CompleteStyle.MULTI_COLUMN)
    print('You said: %s' % text)


if __name__ == '__main__':
    main()
<commit_msg>Fixed import of CompleteStyle in example.<commit_after>#!/usr/bin/env python
"""
Autocompletion example that shows meta-information alongside the completions.
"""
from __future__ import unicode_literals

from prompt_toolkit.contrib.completers import WordCompleter
from prompt_toolkit.shortcuts import prompt, CompleteStyle


animal_completer = WordCompleter([
    'alligator',
    'ant',
    'ape',
    'bat',

    'bear', 'beaver', 'bee', 'bison', 'butterfly', 'cat', 'chicken',
    'crocodile', 'dinosaur', 'dog', 'dolphin', 'dove', 'duck', 'eagle',
    'elephant',
], meta_dict={
    'alligator': 'An alligator is a crocodilian in the genus Alligator of the family Alligatoridae.',
    'ant': 'Ants are eusocial insects of the family Formicidae',
    'ape': 'Apes (Hominoidea) are a branch of Old World tailless anthropoid catarrhine primates ',
    'bat': 'Bats are mammals of the order Chiroptera',
}, ignore_case=True)


def main():
    text = prompt('Give some animals: ', completer=animal_completer,
                  complete_style=CompleteStyle.MULTI_COLUMN)
    print('You said: %s' % text)


if __name__ == '__main__':
    main()

{'fraction_non_alphanumeric': 0.12733748886910062, 'fraction_numerical': 0.0, 'mean_word_length': 4.3246445497630335, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3224320', 'n_tokens_mistral': 749, 'n_tokens_neox': 711, 'n_words': 217}