docs: def add_edges_from(self, ebunch, attr_dict=None, **attr):
          """Version of add_edges_from 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 dict."
                  )
          for e in ebunch:
              ne = len(e)
              if ne == 3:
                  u, v, dd = e
                  assert hasattr(dd, "update")
              elif ne == 2:
                  u, v = e
                  dd = {}
              else:
                  raise NetworkXError(
                      "Edge tupse {} must be a 2-tuple or 3-tuple.".format(e)
                  )
              if u not in self.node:
                  self.node[u] = {}
              if v not in self.node:
                  self.node[v] = {}
              datadict = self.adj.get(u, {}).get(v, {})
              datadict.update(attr_dict)
              datadict.update(dd)
              self.succ[u][v] = datadict
              assert(u in self.succ)
              assert(v in self.succ[u])