def METHOD_NAME(obj):
    """
    Much, much faster than copy.deepcopy, but just for parser tree nodes.
    """
    # If it's already in the cache, just return it.
    new_obj = copy.copy(obj)
    # Copy children
    new_children = []
    for child in obj.children:
        if isinstance(child, tree.Leaf):
            new_child = copy.copy(child)
            new_child.parent = new_obj
        else:
            new_child = METHOD_NAME(child)
            new_child.parent = new_obj
        new_children.append(new_child)
    new_obj.children = new_children
    return new_obj