def sort_dict(od, d):
    if isinstance(od, dict):
        ret = OrderedDict()
        for k in od.keys():
            v = d.get(k)
            # don't append null tags!
            if v is not None:
                if isinstance(v, dict):
                    v = sort_dict(od[k], v)
                elif isinstance(v, list):
                    v = [sort_dict(od[k][0], v1) for v1 in v]
                ret[k] = v
        if hasattr(od, 'namespace'):
            ret.namespace = od.namespace
            ret.qualified = od.qualified
        return ret
    else:
        return d
Sort parameters (same order as xsd:sequence)
dataset/ETHPy150Open uwdata/termite-data-server/web2py/gluon/contrib/pysimplesoap/helpers.py/sort_dict