def degree_iter(self, nbunch=None, weight=None):
        if nbunch is None:
            nodes_nbrs = self.adj.items()
        else:
            nodes_nbrs=((n,self.adj[n]) for n in self.nbunch_iter(nbunch))

        if weight is None:
            for n,nbrs in nodes_nbrs:
                deg = sum([len(data) for data in nbrs.values()])
                yield (n, deg+(n in nbrs and len(nbrs[n])))
        else:
        # edge weighted graph - degree is sum of nbr edge weights
            for n,nbrs in nodes_nbrs:
                deg = sum([d.get(weight,1)
                           for data in nbrs.values()
                           for d in data.values()])
                if n in nbrs:
                    deg += sum([d.get(weight,1)
                           for key,d in nbrs[n].items()])
                yield (n, deg)
Delegate all other attributes to self.session
dataset/ETHPy150Open networkx/networkx/networkx/classes/tests/timingclasses.py/TimingMultiGraph.degree_iter--crossover with--dataset/ETHPy150Open dgilland/flask-alchy/flask_alchy.py/Alchy.__getattr__