<commit_before># coding=utf-8
from xml.etree.ElementTree import Element, tostring, fromstring
from houston.client import Client, Connection, Status
from houston.utils import xml_to_dict, dict_to_xml, Dispatcher
from houston.errors import ApiException
from unittest import TestCase
import logging
from datetime import datetime, timedelta

class TestDispatcher(Dispatcher):
    
    def do_login(self, xml):
        return """<?xml version="1.0"?>
        <sms_api>
            <error_type></error_type>
            <session_id>my_session_id</session_id>
            <api_doc_version></api_doc_version>
        </sms_api>
        """<commit_msg>docstring for TestDispatcher class<commit_after># coding=utf-8
from xml.etree.ElementTree import Element, tostring, fromstring
from houston.client import Client, Connection, Status
from houston.utils import xml_to_dict, dict_to_xml, Dispatcher
from houston.errors import ApiException
from unittest import TestCase
import logging
from datetime import datetime, timedelta

class TestDispatcher(Dispatcher):
    """
    This dispatcher mimicks the responses we get back from the 
    Foneworx XML api (according to their API docs). Instead of going
    over the network I send back the XML response straight away.
    """
    
    def do_login(self, xml):
        return """<?xml version="1.0"?>
        <sms_api>
            <error_type></error_type>
            <session_id>my_session_id</session_id>
            <api_doc_version></api_doc_version>
        </sms_api>
        """
{'fraction_non_alphanumeric': 0.084155161078238, 'fraction_numerical': 0.0039447731755424065, 'mean_word_length': 3.5432835820895523, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 2, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, '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': '1900925', 'n_tokens_mistral': 450, 'n_tokens_neox': 431, 'n_words': 131}