code: def degree_iter(self, nbunch=None, t=None):
          
  
          if nbunch is None:
              nodes_nbrs = ((n, succs, self._pred[n]) for n, succs in self._succ.items())
          else:
              nodes_nbrs = ((n, self._succ[n], self._pred[n]) for n in self.nbunch_iter(nbunch))
  
          if t is None:
              for n, succ, pred in nodes_nbrs:
                  yield (n, len(succ) + len(pred))
  
          else:
              for n, succ, pred in nodes_nbrs:
                  edges_succ = len([v for v in succ.keys() if self.__presence_test(n, v, t)])
                  edges_pred = len([v for v in pred.keys() if self.__presence_test(v, n, t)])
                  yield (n, edges_succ + edges_pred)
docs: Return an iterator for (node, degree) at time t.
  
              The node degree is the number of edges adjacent to the node in a given timeframe.
  
              Parameters
              ----------
              nbunch : iterable container, optional (default=all nodes)
                  A container of nodes.  The container will be iterated
                  through once.
  
              t : snapshot id (default=None)
                  If None will be returned an iterator over the degree of nodes on the flattened graph.
  
  
              Returns
              -------
              nd_iter : an iterator
                  The iterator returns two-tuples of (node, degree).
  
              See Also
              --------
              degree
  
              Examples
              --------
              >>> G = dn.DynDiGraph()
              >>> G.add_interaction(0, 1, t=0)
              >>> list(G.degree_iter(0, t=0))
              [(0, 1)]
              >>> list(G.degree_iter([0,1], t=0))
              [(0, 1), (1, 1)]