      "        if source_key not in self.nodes:\n",
      "            self.add_node(source_key)\n",
      "        if dest_key not in self.nodes:\n",
      "            self.add_node(dest_key)\n",
      "        self.nodes[source_key].add_neighbor(self.nodes[dest_key],\n",
      "                                            weight)\n",
      "\n",
      "    def add_undirected_edge(self, src_key, dst_key, weight=0):\n",
      "        if src_key is None or dst_key is None:\n",
      "            raise TypeError('key cannot be None')\n",
      "        self.add_edge(src_key, dst_key, weight)\n",
 
</s> remove         self.nodes[source_key].add_neighbor(self.nodes[dest_key],
                                            weight)
 </s> add         self.nodes[source_key].add_neighbor(self.nodes[dest_key], weight) </s> remove     "            raise Exception('Invalid key')\n",
 </s> add     "            raise KeyError('Invalid key')\n", </s> remove     "        if key in self.nodes:\n",
    "            return self.nodes[key]\n",
    "        self.nodes[key] = Node(key)\n",
 </s> add     "        if key not in self.nodes:\n",
    "            self.nodes[key] = Node(key)\n", </s> remove             raise Exception('Invalid key')
 </s> add             raise KeyError('Invalid key') </s> remove         if key in self.nodes:
            return self.nodes[key]
        self.nodes[key] = Node(key)
 </s> add         if key not in self.nodes:
            self.nodes[key] = Node(key)
    "        self.nodes[source_key].add_neighbor(self.nodes[dest_key], weight)\n",
      "        if source_key not in self.nodes:\n",
      "            self.add_node(source_key)\n",
      "        if dest_key not in self.nodes:\n",
      "            self.add_node(dest_key)\n",
    "        self.nodes[source_key].add_neighbor(self.nodes[dest_key], weight)\n",
    "        self.nodes[source_key].add_neighbor(self.nodes[dest_key], weight)\n",
      "\n",
      "    def add_undirected_edge(self, src_key, dst_key, weight=0):\n",
      "        if src_key is None or dst_key is None:\n",
      "            raise TypeError('key cannot be None')\n",
      "        self.add_edge(src_key, dst_key, weight)\n",
keep keep keep keep replace replace keep keep keep keep keep
 Update graph challenge (#122)

Simplify add_node logic.  Use more specific TypeError Exception. 
graphs_trees/graph/graph_solution.ipynb