<commit_before>import uuid


class BaseTransport(object):
    """Base transport class."""

    REQUEST_ID_KEY = 'requestId'
    REQUEST_ACTION_KEY = 'action'

    def __init__(self, data_format_class, data_format_options, handler_class,
                 handler_options, name):
        self._data_format = data_format_class(**data_format_options)
        self._data_type = self._data_format.data_type
        self._handler = handler_class(self, **handler_options)
        self._connected = False
        self._name = name

    @staticmethod
    def _uuid():
        return str(uuid.uuid1())

    def _assert_not_connected(self):
        assert not self._connected, 'transport connection already created'

    def _assert_connected(self):
        assert self._connected, 'transport connection has not created'

    def _encode(self, obj):
        return self._data_format.encode(obj)

    def _decode(self, data):
        return self._data_format.decode(data)

    def _call_handler_method(self, name, *args):
        getattr(self._handler, name)(*args)

    def name(self):
        return self._name

    def is_connected(self):
        return self._connected

    def connect(self, url, **options):
        raise NotImplementedError

    def send_request(self, action, request, **params):
        raise NotImplementedError

    def request(self, action, request, **params):<commit_msg>Rename is_connected method to connected<commit_after>import uuid


class BaseTransport(object):
    """Base transport class."""

    REQUEST_ID_KEY = 'requestId'
    REQUEST_ACTION_KEY = 'action'

    def __init__(self, data_format_class, data_format_options, handler_class,
                 handler_options, name):
        self._data_format = data_format_class(**data_format_options)
        self._data_type = self._data_format.data_type
        self._handler = handler_class(self, **handler_options)
        self._connected = False
        self._name = name

    @staticmethod
    def _uuid():
        return str(uuid.uuid1())

    def _assert_not_connected(self):
        assert not self._connected, 'transport connection already created'

    def _assert_connected(self):
        assert self._connected, 'transport connection has not created'

    def _encode(self, obj):
        return self._data_format.encode(obj)

    def _decode(self, data):
        return self._data_format.decode(data)

    def _call_handler_method(self, name, *args):
        getattr(self._handler, name)(*args)

    def name(self):
        return self._name

    def connected(self):
        return self._connected

    def connect(self, url, **options):
        raise NotImplementedError

    def send_request(self, action, request, **params):
        raise NotImplementedError

    def request(self, action, request, **params):
{'fraction_non_alphanumeric': 0.09373881932021468, 'fraction_numerical': 0.0007155635062611807, 'mean_word_length': 3.1545319465081723, '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': '2874740', 'n_tokens_mistral': 804, 'n_tokens_neox': 767, 'n_words': 191}