def METHOD_NAME(obj):
    if isinstance(obj, dict):
        obj = OrderedDict(sorted(obj.items()))
        for k, v in obj.items():
            if isinstance(v, dict) or isinstance(v, list):
                obj[k] = METHOD_NAME(v)
    if isinstance(obj, list):
        for i, v in enumerate(obj):
            if isinstance(v, dict) or isinstance(v, list):
                obj[i] = METHOD_NAME(v)
        obj = sorted(obj, key=lambda x: json.dumps(x))
    return obj