<commit_before>from urllib.parse import urlparse

from nm_payment.drivers import bbs


_BUILTIN_DRIVERS = {
    'bbs+tcp': bbs.open_tcp,
}

_drivers = {}
_drivers.update(_BUILTIN_DRIVERS)


def register_driver(uri_scheme, factory):
    _drivers[uri_scheme] = factory


def open_terminal(uri, *args, **kwargs):
    scheme = urlparse(uri).scheme
    if not scheme or scheme == uri:
        raise ValueError("Malformed terminal uri")
    try:
        driver = _drivers[scheme]
    except KeyError:
        raise Exception("Unrecognised terminal uri")
    else:
        return driver(uri, *args, **kwargs)

__all__ = [register_driver, open_terminal]<commit_msg>__all__ should contain strings<commit_after>from urllib.parse import urlparse

from nm_payment.drivers import bbs


_BUILTIN_DRIVERS = {
    'bbs+tcp': bbs.open_tcp,
}

_drivers = {}
_drivers.update(_BUILTIN_DRIVERS)


def register_driver(uri_scheme, factory):
    _drivers[uri_scheme] = factory


def open_terminal(uri, *args, **kwargs):
    scheme = urlparse(uri).scheme
    if not scheme or scheme == uri:
        raise ValueError("Malformed terminal uri")
    try:
        driver = _drivers[scheme]
    except KeyError:
        raise Exception("Unrecognised terminal uri")
    else:
        return driver(uri, *args, **kwargs)

__all__ = ['register_driver', 'open_terminal']
{'fraction_non_alphanumeric': 0.10337078651685393, 'fraction_numerical': 0.0, 'mean_word_length': 3.911764705882353, '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': '4474871', 'n_tokens_mistral': 458, 'n_tokens_neox': 437, 'n_words': 104}