<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_node_by_hash(self, node_hash: str) -> Optional[Node]: """Look up a node by its hash."""

        return self.session.query(Node).filter(Node.sha512 == node_hash).one_or_none()