<commit_before>from urlparse import urlparse
import os
import adapters
try:
    import paramiko
except ImportError:
    pass


"""The following protocals are supported ftp, ftps, http and https.
sftp and ssh require paramiko to be installed
"""


class Transporter(object):

    availible_adapters = {
        "ftp": adapters.FtpAdapter,
        "ftps": adapters.FtpAdapter,
        "file": adapters.LocalFileAdapter
    }
    adapter = None

    def __init__(self, uri):
        uri = urlparse(uri)
        if uri.scheme not in self.availible_adapters:
            msg = u"{0} is not a support scheme. Availible schemes: {1}".format(
                    uri.scheme, [s for s in self.availible_adapters])
            raise NotImplemented(msg)

        self.adapter = self.availible_adapters[uri.scheme](uri)

    def __getattr__(self, attr):
        return getattr(self.adapter, attr)
<commit_msg>Use LocalFileAdapter when no scheme is given<commit_after>from urlparse import urlparse
import os
import adapters
try:
    import paramiko
except ImportError:
    pass


"""The following protocals are supported ftp, ftps, http and https.
sftp and ssh require paramiko to be installed
"""


class Transporter(object):

    availible_adapters = {
        "ftp": adapters.FtpAdapter,
        "ftps": adapters.FtpAdapter,
        "file": adapters.LocalFileAdapter
    }
    default_scheme = "file"
    adapter = None

    def __init__(self, uri):
        uri = urlparse(uri)
        scheme = uri.scheme or self.default_scheme
        if scheme not in self.availible_adapters:
            msg = u"{0} is not a support scheme. Availible schemes: {1}".format(
                    scheme, [s for s in self.availible_adapters])
            raise NotImplemented(msg)

        self.adapter = self.availible_adapters[scheme](uri)

    def __getattr__(self, attr):
        return getattr(self.adapter, attr)

{'fraction_non_alphanumeric': 0.08615221987315011, 'fraction_numerical': 0.0021141649048625794, 'mean_word_length': 2.786, 'pattern_counts': {'":': 6, '<': 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': '3799025', 'n_tokens_mistral': 597, 'n_tokens_neox': 560, 'n_words': 170}