<commit_before>#!/usr/bin/env  python3

#   Copyright (c) 2015, <NAME>
#   All rights reserved.

import os
import sys
import argparse
import urllib.error as urlerr

import tvmaze as tv
import folder

def main():
    parser = argparse.ArgumentParser()
    parser.add_argument(
        "-v", "--version", action="version", version="%(prog)s -- 0.0.1.dev1"
    )
    parser.add_argument(
        "-y", "--no-confirm", action="store_true",
        help="Do not ask for confirmation"
    )
    parser.add_argument(
        "--no-showname", action="store_true",
        help="Remove the show name from the filename"
    )
    parser.add_argument(
        "path", type=str, metavar="FILE", nargs="+",
        help="FILE location"
    )
    args = parser.parse_args()

    fileList = []
    for path in args.path:
        if os.path.isdir(path):
            content = map( (lambda x: os.path.join(path, x) ), os.listdir(path))

        else:
            content = [ os.path.join(os.curdir, path) ]

        fileList += [ x for x in content ]

    files = [ x for x in map( (lambda x: folder.Folder(x)), fileList ) if x.show ]

    if not files:
        print("Nothing to do...")
        sys.exit(1)

    shows = {}
    for serie, proper in set( (x.show, x.properShow) for x in files ):
        try:
            print("Downloading episode list for {0}.".format(proper))
            shows[serie] = tv.Show(serie)

        except urlerr.URLError as err:
            print("Cant download list for {0}".format(proper))
            print("{0}".format(err.strerror))

    if args.no_showname:
        for ep in files:
            ep.setEpName(shows[ep.show].getTitle(ep.season, ep.episode))

    else:
        for ep in files:
            ep.setFullName(shows[ep.show].getTitle(ep.season, ep.episode))
<commit_msg>change 'no-showname' option to 'complete'<commit_after>#!/usr/bin/env  python3

#   Copyright (c) 2015, <NAME>
#   All rights reserved.

import os
import sys
import argparse
import urllib.error as urlerr

import tvmaze as tv
import folder

def main():
    parser = argparse.ArgumentParser()
    parser.add_argument(
        "-v", "--version", action="version", version="%(prog)s -- 0.0.1.dev1"
    )
    parser.add_argument(
        "-y", "--no-confirm", action="store_true",
        help="Do not ask for confirmation"
    )
    parser.add_argument(
        "-c", "--complete", action="store_true",
        help="Add the serie name to the final filename"
    )
    parser.add_argument(
        "path", type=str, metavar="FILE", nargs="+",
        help="FILE location"
    )
    args = parser.parse_args()

    fileList = []
    for path in args.path:
        if os.path.isdir(path):
            content = map( (lambda x: os.path.join(path, x) ), os.listdir(path))

        else:
            content = [ os.path.join(os.curdir, path) ]

        fileList += [ x for x in content ]

    files = [ x for x in map( (lambda x: folder.Folder(x)), fileList ) if x.show ]

    if not files:
        print("Nothing to do...")
        sys.exit(1)

    shows = {}
    for serie, proper in set( (x.show, x.properShow) for x in files ):
        try:
            print("Downloading episode list for {0}.".format(proper))
            shows[serie] = tv.Show(serie)

        except urlerr.URLError as err:
            print("Cant download list for {0}".format(proper))
            print("{0}".format(err.strerror))

    for ep in files:
        ep.properShow = shows[ep.show].showName
        if args.complete:
            ep.setFullName(shows[ep.show].getTitle(ep.season, ep.episode))

        else:
            ep.setEpName(shows[ep.show].getTitle(ep.season, ep.episode))

{'fraction_non_alphanumeric': 0.14199726402188784, 'fraction_numerical': 0.007113543091655267, 'mean_word_length': 2.2642857142857142, 'pattern_counts': {'":': 0, '<': 5, '<?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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2076079', 'n_tokens_mistral': 1226, 'n_tokens_neox': 1186, 'n_words': 306}