<commit_before>#!/usr/bin/python
# Search a title on IMDb and display a nice line.

import imdb
import sys


def main(argv):
    if len(argv) < 2:
        print 'Usage: %s <search query>' % argv[0]
        raise SystemExit(0)

    result = imdb.SearchTitle(' '.join(argv[1:]))
    if not result:
        print 'Not found.'
        raise SystemExit(1)

    t = result[0]
    infos = [t.name + (' (%i)' % t.year if t.year else '')]
    if t.genres:
        infos.append(', '.join(t.genres[:3]))
    if t.directors:
        infos.append(', '.join(d.name for d in t.directors[:2]))
    if t.actors:
        infos.append(', '.join(a.name for a in t.actors[:3]))
    if t.duration:
        infos.append(t.duration)
    if t.rating:
        infos.append('%.1f/10' % t.rating)
    infos.extend([t.url, 'tg'])
    print ' - '.join(infos)


if __name__ == '__main__':
    main(sys.argv)
<commit_msg>imdb_cli: fix output utf8<commit_after>#!/usr/bin/python
# Search a title on IMDb and display a nice line.

import imdb
import sys


def main(argv):
    if len(argv) < 2:
        print 'Usage: %s <search query>' % argv[0]
        raise SystemExit(0)

    result = imdb.SearchTitle(' '.join(argv[1:]))
    if not result:
        print 'Not found.'
        raise SystemExit(1)

    t = result[0]
    infos = [t.name + (' (%i)' % t.year if t.year else '')]
    if t.genres:
        infos.append(', '.join(t.genres[:3]))
    if t.directors:
        infos.append(', '.join(d.name for d in t.directors[:2]))
    if t.actors:
        infos.append(', '.join(a.name for a in t.actors[:3]))
    if t.duration:
        infos.append(t.duration)
    if t.rating:
        infos.append('%.1f/10' % t.rating)
    infos.extend([t.url, 'tg'])
    print ' - '.join(i.encode('utf-8') for i in infos)


if __name__ == '__main__':
    main(sys.argv)

{'fraction_non_alphanumeric': 0.17336268574573474, 'fraction_numerical': 0.014309301045679693, 'mean_word_length': 2.3666666666666667, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '4177701', 'n_tokens_mistral': 696, 'n_tokens_neox': 677, 'n_words': 173}