code: def delete_node(self, node_name, graph=None):
          
          if not graph:
              graph = self.graph
          if node_name not in graph:
              raise KeyError('node %s does not exist' % node_name)
          graph.pop(node_name)
  
          for node, edges in six.iteritems(graph):
              if node_name in edges:
                  edges.remove(node_name)
docs: Deletes this node and all edges referencing it.