# Path: coherence/extern/et.py
# def new_encode_entity(text, pattern=utf8_escape):
#     def escape_entities(m, map=elementtree.ElementTree._escape_map):
#     def XMLParser(encoding='utf-8'):
# def namespace_map_update(namespaces):
# def indent(elem, level=0):
# def parse_xml(data, encoding="utf-8", dump_invalid_data=False):
# def qname(tag, ns=None):
# def textElement(parent, tag, namespace, text):
# def textElementIfNotNone(parent, tag, namespace, text):
# class ElementInterface(elementtree.ElementTree._ElementInterface): pass


from twisted.python.util import OrderedDict
from coherence.extern.et import ET, textElement
    if method:
        # append the method call
        if is_response is True:
            method += "Response"
        re = ET.SubElement(body, method)
        if encoding:
            re.set(NS_SOAP_ENV + "encodingStyle", encoding)
    else:
        re = body

    # append the arguments
    if isinstance(arguments, (dict, OrderedDict)):
        type_map = {str: 'xsd:string',
                    unicode: 'xsd:string',
                    int: 'xsd:int',
                    float: 'xsd:float',
                    bool: 'xsd:boolean'}

        for arg_name, arg_val in arguments.iteritems():
            arg_type = type_map[type(arg_val)]
            if arg_type == 'xsd:string' and type(arg_val) == unicode:
                arg_val = arg_val.encode('utf-8')
            if arg_type == 'xsd:int' or arg_type == 'xsd:float':
                arg_val = str(arg_val)
            if arg_type == 'xsd:boolean':
                if arg_val == True:
                    arg_val = '1'
                else:
                    arg_val = '0'


# Path: coherence/extern/et.py
# def new_encode_entity(text, pattern=utf8_escape):
#     def escape_entities(m, map=elementtree.ElementTree._escape_map):
#     def XMLParser(encoding='utf-8'):
# def namespace_map_update(namespaces):
# def indent(elem, level=0):
# def parse_xml(data, encoding="utf-8", dump_invalid_data=False):
# def qname(tag, ns=None):
# def textElement(parent, tag, namespace, text):
# def textElementIfNotNone(parent, tag, namespace, text):
# class ElementInterface(elementtree.ElementTree._ElementInterface): pass


# Path: coherence/upnp/core/soap_lite.py
from twisted.python.util import OrderedDict
from coherence.extern.et import ET, textElement

    if method:
        # append the method call
        if is_response is True:
            method += "Response"
        re = ET.SubElement(body, method)
        if encoding:
            re.set(NS_SOAP_ENV + "encodingStyle", encoding)
    else:
        re = body

    # append the arguments
    if isinstance(arguments, (dict, OrderedDict)):
        type_map = {str: 'xsd:string',
                    unicode: 'xsd:string',
                    int: 'xsd:int',
                    float: 'xsd:float',
                    bool: 'xsd:boolean'}

        for arg_name, arg_val in arguments.iteritems():
            arg_type = type_map[type(arg_val)]
            if arg_type == 'xsd:string' and type(arg_val) == unicode:
                arg_val = arg_val.encode('utf-8')
            if arg_type == 'xsd:int' or arg_type == 'xsd:float':
                arg_val = str(arg_val)
            if arg_type == 'xsd:boolean':
                if arg_val == True:
                    arg_val = '1'
                else:
                    arg_val = '0'


            e = ET.SubElement(re, arg_name)