

def __init__(self, data=None, **attr):
    'Initialize a graph with edges, name, graph attributes.\n\n        Parameters\n        ----------\n        data : input graph\n            Data to initialize graph.  If data=None (default) an empty\n            graph is created.  The data can be an edge list, or any\n            NetworkX graph object.  If the corresponding optional Python\n            packages are installed the data can also be a NumPy matrix\n            or 2d ndarray, a SciPy sparse matrix, or a PyGraphviz graph.\n        name : string, optional (default=\'\')\n            An optional name for the graph.\n        attr : keyword arguments, optional (default= no attributes)\n            Attributes to add to graph as key=value pairs.\n\n        See Also\n        --------\n        convert\n\n        Examples\n        --------\n        >>> G = nx.Graph()   # or DiGraph, MultiGraph, MultiDiGraph, etc\n        >>> G = nx.Graph(name=\'my graph\')\n        >>> e = [(1,2),(2,3),(3,4)] # list of edges\n        >>> G = nx.Graph(e)\n\n        Arbitrary graph attribute pairs (key=value) may be assigned\n\n        >>> G=nx.Graph(e, day="Friday")\n        >>> G.graph\n        {\'day\': \'Friday\'}\n\n        '
    self.graph = {
        
    }
    self.node = {
        
    }
    self.adj = {
        
    }
    self.pred = {
        
    }
    self.succ = self.adj
    if (data is not None):
        convert.to_networkx_graph(data, create_using=self)
    self.graph.update(attr)
    self.edge = self.adj

dataset/ETHPy150Open networkx/networkx/networkx/classes/tests/timingclasses.py TimingDiGraph.__init__/original