<commit_before>#!/usr/bin/env python
"""Main apt-select script"""

from sys import exit, stderr, version_info
from os import getcwd
from apt_select.arguments import get_args
from apt_select.utils import get_html, URLGetError
from apt_select.mirrors import Mirrors
from apt_select.apt_system import AptSources, SourcesFileError

# Support input for Python 2 and 3
get_input = input
if version_info[:2] <= (2, 7):
    get_input = raw_input


def set_args():
    """Set arguments, disallow bad combination"""
    parser = get_args()
    args = parser.parse_args()

    # Convert status argument to format used by Launchpad
    args.min_status = args.min_status.replace('-', ' ')
    if not args.ping_only and (args.min_status != 'unknown'):
        args.min_status = args.min_status.capitalize()

    if args.choose and (not args.top_number or args.top_number < 2):
        parser.print_usage()
        exit((
            "error: -c/--choose option requires -t/--top-number NUMBER "
            "where NUMBER is greater than 1."
        ))

    return args


def get_mirrors(mirrors_url):
    """Fetch list of Ubuntu mirrors"""
    stderr.write("Getting list of mirrors...")
    try:
        mirrors_list = get_html(mirrors_url)
    except URLGetError as err:
        exit("Error getting list from %s:\n\t%s" % (mirrors_list, err))
    stderr.write("done.\n")

    return mirrors_list.splitlines()<commit_msg>Fix bad reference<commit_after>#!/usr/bin/env python
"""Main apt-select script"""

from sys import exit, stderr, version_info
from os import getcwd
from apt_select.arguments import get_args
from apt_select.utils import get_html, URLGetError
from apt_select.mirrors import Mirrors
from apt_select.apt_system import AptSources, SourcesFileError

# Support input for Python 2 and 3
get_input = input
if version_info[:2] <= (2, 7):
    get_input = raw_input


def set_args():
    """Set arguments, disallow bad combination"""
    parser = get_args()
    args = parser.parse_args()

    # Convert status argument to format used by Launchpad
    args.min_status = args.min_status.replace('-', ' ')
    if not args.ping_only and (args.min_status != 'unknown'):
        args.min_status = args.min_status.capitalize()

    if args.choose and (not args.top_number or args.top_number < 2):
        parser.print_usage()
        exit((
            "error: -c/--choose option requires -t/--top-number NUMBER "
            "where NUMBER is greater than 1."
        ))

    return args


def get_mirrors(mirrors_url):
    """Fetch list of Ubuntu mirrors"""
    stderr.write("Getting list of mirrors...")
    try:
        mirrors_list = get_html(mirrors_url)
    except URLGetError as err:
        exit("Error getting list from %s:\n\t%s" % (mirrors_url, err))
    stderr.write("done.\n")

    return mirrors_list.splitlines()
{'fraction_non_alphanumeric': 0.10941385435168739, 'fraction_numerical': 0.00497335701598579, 'mean_word_length': 3.2602118003025717, 'pattern_counts': {'":': 0, '<': 7, '<?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': '3587469', 'n_tokens_mistral': 911, 'n_tokens_neox': 854, 'n_words': 259}