docs: def add_edge(self, u, v, attr_dict=None, **attr):
          """Version of add_edge that only writes to the database once"""
          if attr_dict is None:
              attr_dict = attr
          else:
              try:
                  attr_dict.update(attr)
              except AttributeError:
                  raise NetworkXError(
                      "The attr_dict argument must be a dictionary."
                  )
          if u not in self.node:
              self.node[u] = {}
          if v not in self.node:
              self.node[v] = {}
          if u in self.adj:
              datadict = self.adj[u].get(v, {})
          else:
              self.adj[u] = {v: {}}
              datadict = self.adj[u][v]
          datadict.update(attr_dict)
          self.succ[u][v] = datadict
          assert u in self.succ, "Failed to add edge {u}->{v} ({u} not in successors)".format(u=u, v=v)
          assert v in self.succ[u], "Failed to add edge {u}->{v} ({v} not in succ[{u}])".format(u=u, v=v)