<commit_before>try:
    from urllib import urlretrieve
except ImportError:
    from urllib.request import urlretrieve

try:
    from urlparse import urlparse
except ImportError:
    from urllib.parse import urlparse

import os


def simple_discovery(name, var=None, secure=True):
    '''Perform simple discovery and save the discovered ACI locally.

    :param name: Name of app.
    :type name: str.
    :param var: Directory to save app to.
    :type var: str.
    :param secure: Choose to use HTTPS or HTTP.
    :type secure: bool.
    :returns:  str -- the name of the ACI.
    '''
    if secure:
        protocol = 'https'
    else:
        protocol = 'http'

    url = '{protocol}://{path}.aci'.format(path=path, protocol=protocol)

    parsed = urlparse(url)
    _, local_file = os.path.split(parsed.path)

    if var is not None:
        local_file = os.path.join(var, local_file)

    urlretrieve(url, local_file)

    return local_file


class AppContainer(object):
    def __init__(self, path=None):
        self.path = path<commit_msg>Fix path -> name<commit_after>try:
    from urllib import urlretrieve
except ImportError:
    from urllib.request import urlretrieve

try:
    from urlparse import urlparse
except ImportError:
    from urllib.parse import urlparse

import os


def simple_discovery(name, var=None, secure=True):
    '''Perform simple discovery and save the discovered ACI locally.

    :param name: Name of app.
    :type name: str.
    :param var: Directory to save app to.
    :type var: str.
    :param secure: Choose to use HTTPS or HTTP.
    :type secure: bool.
    :returns:  str -- the name of the ACI.
    '''
    if secure:
        protocol = 'https'
    else:
        protocol = 'http'

    url = '{protocol}://{name}.aci'.format(name=name, protocol=protocol)

    parsed = urlparse(url)
    _, local_file = os.path.split(parsed.path)

    if var is not None:
        local_file = os.path.join(var, local_file)

    urlretrieve(url, local_file)

    return local_file


class AppContainer(object):
    def __init__(self, path=None):
        self.path = path
{'fraction_non_alphanumeric': 0.09728183118741059, 'fraction_numerical': 0.0, 'mean_word_length': 2.84954128440367, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '2815985', 'n_tokens_mistral': 668, 'n_tokens_neox': 651, 'n_words': 213}