      "        if neighbor is None or neighbor.key not in self.adj_nodes:\n",
      "            raise Exception('Invalid neighbor')\n",
      "\n",
      "\n",
      "class Graph:\n",
      "\n",
 
</s> remove     "        if neighbor is None:\n",
    "            raise Exception('Invalid neighbor')\n",
    "        if neighbor.key in self.adj_nodes:\n",
    "            neighbor.incoming_edges -= 1\n",
    "            del self.adj_weights[neighbor.key]\n",
    "            del self.adj_nodes[neighbor.key]\n",
    "        else:\n",
 </s> add     "        if neighbor is None or neighbor.key not in self.adj_nodes:\n", </s> remove         if neighbor is None:
            raise Exception('Invalid neighbor')
        if neighbor.key in self.adj_nodes:
            neighbor.incoming_edges -= 1
            del self.adj_weights[neighbor.key]
            del self.adj_nodes[neighbor.key]
        else:
 </s> add         if neighbor is None or neighbor.key not in self.adj_nodes:
    "        neighbor.incoming_edges -= 1\n",
    "        del self.adj_weights[neighbor.key]\n",
    "        del self.adj_nodes[neighbor.key]\n",
      "        if neighbor is None or neighbor.key not in self.adj_nodes:\n",
      "            raise Exception('Invalid neighbor')\n",
    "        neighbor.incoming_edges -= 1\n",
    "        del self.adj_weights[neighbor.key]\n",
    "        del self.adj_nodes[neighbor.key]\n",
      "\n",
      "\n",
      "class Graph:\n",
      "\n",
keep add keep keep keep keep
 Update graph remove_neighbor error handling (#93) 
graphs_trees/graph/graph_solution.ipynb