class_docstr: A directed graph.
  Stores a set of nodes, edges and adjacency matrix.
class_docstr_tok: ["A","directed","graph",".","Stores","a","set","of","nodes",",","edges","and","adjacency","matrix","."]
docstr: Add a new named node to the graph.
docstr_tok: ["Add","a","new","named","node","to","the","graph","."]
code: def add_node(self, node_name):
      """
      Add a new named node to the graph.
      """
      try:
          return self.nodes[self.nodes.index(node_name)]
      except ValueError:
          node = Node(node_name)
          self.nodes.append(node)
          return node
  
file_path: keon-algos/algorithms/graph/graph.py
label_desc: Use image node_id 2 for calling the DirectedGraph obj's underlying member method code with example usage: obj.add_node(node_name) and returns: self, node