<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_node(self, node_name):
 """ Add a node if it does not exist yet, or error out. Args: node_name (str):
 The unique name of the node to add. Raises: KeyError: Raised if a node with the same name already exist in the graph """

        graph = self.graph
        if node_name in graph:
            raise KeyError('node %s already exists' % node_name)
        graph[node_name] = set()