This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
class NodeView(object): | |
def __init__(self, graph, data=False): | |
self.G = graph | |
self.data = data | |
def __iter__(self): | |
if data: | |
return iter(self.G.node.items()) | |
return iter(self.G.node) |