in src/lic/ppl/world/diff_stack.py [0:0]
def get_node_earlier_version(self, node: RVIdentifier) -> Optional[Variable]:
"""
Get the earlier version of the node in the diff stack.
:param node: the node to be looked up in the diff stack.
:returns: the earlier version of the node in the diff stack if None, it
means the node is not available in diff stack and instead it can be
available in the world vars.
"""
node_indices = self.node_to_diffs_[node]
if not node_indices:
raise ValueError(f"Node {node} is missing")
if len(node_indices) == 1:
return None
return self.diff_stack_[node_indices[-2]].get_node_raise_error(node)