def METHOD_NAME(parent, parent_key, node):
    if not isinstance(node, dict):
        return
    if len(node) == 1 and LEAF_KEY in node and parent is not None:
        parent[parent_key] = node[LEAF_KEY]
    else:
        for key, value in node.items():
            METHOD_NAME(node, key, value)