# Path: turbulenz_tools/tools/json2json.py
# LOG = logging.getLogger('asset')
# def merge(source_files, output_filename="default.json", output_metrics=True):
# def _parser():
# def main():


from simplejson import loads as json_loads, dumps as json_dumps, encoder as json_encoder
    from xml.etree import cElementTree as ElementTree
    from xml.etree import ElementTree
from turbulenz_tools.tools.json2json import float_to_string
        for k, v in value.items():
            if k[:1] == "@":
                attribs[k[1:]] = v
            elif k == "#text":
                text = v
            elif k == "#tail":
                tail = v
            elif isinstance(v, list):
                for v2 in v:
                    sublist.append(internal2elem({k:v2}, factory=factory))
            else:
                sublist.append(internal2elem({k:v}, factory=factory))
    else:
        text = value
    e = factory(tag, attribs)
    for sub in sublist:
        e.append(sub)
    e.text = text
    e.tail = tail
    return e

def elem2json(elem, strip=True, indent=0, convert_types=False):
    """Convert an ElementTree or Element into a JSON string."""
    if hasattr(elem, 'getroot'):
        elem = elem.getroot()

    internal = elem2internal(elem, strip=strip, convert_types=convert_types)

    # Module 'simplejson' has no 'encoder' member
    # pylint: disable=E1101

# Path: turbulenz_tools/tools/json2json.py
# LOG = logging.getLogger('asset')
# def merge(source_files, output_filename="default.json", output_metrics=True):
# def _parser():
# def main():


# Path: turbulenz_tools/utils/xml_json.py
from simplejson import loads as json_loads, dumps as json_dumps, encoder as json_encoder
    from xml.etree import cElementTree as ElementTree
    from xml.etree import ElementTree
from turbulenz_tools.tools.json2json import float_to_string

        for k, v in value.items():
            if k[:1] == "@":
                attribs[k[1:]] = v
            elif k == "#text":
                text = v
            elif k == "#tail":
                tail = v
            elif isinstance(v, list):
                for v2 in v:
                    sublist.append(internal2elem({k:v2}, factory=factory))
            else:
                sublist.append(internal2elem({k:v}, factory=factory))
    else:
        text = value
    e = factory(tag, attribs)
    for sub in sublist:
        e.append(sub)
    e.text = text
    e.tail = tail
    return e

def elem2json(elem, strip=True, indent=0, convert_types=False):
    """Convert an ElementTree or Element into a JSON string."""
    if hasattr(elem, 'getroot'):
        elem = elem.getroot()

    internal = elem2internal(elem, strip=strip, convert_types=convert_types)

    # Module 'simplejson' has no 'encoder' member
    # pylint: disable=E1101

    json_encoder.FLOAT_REPR = float_to_string