def __init__(self, data=None, edge_removal=True, **attr):
        """Initialize a directed graph with interaction, name, graph attributes.

        Parameters
        ----------
        data : input graph
            Data to initialize graph.  If data=None (default) an empty
            graph is created.  The data can be an interaction list, or any
            NetworkX/DyNetx graph object.  If the corresponding optional Python
            packages are installed the data can also be a NumPy matrix
            or 2d ndarray, a SciPy sparse matrix, or a PyGraphviz graph.

        edge_removal : bool, optional (default=True)
            Specify if the dynamic graph instance should allows edge removal or not.

        attr : keyword arguments, optional (default= no attributes)
            Attributes to add to graph as key=value pairs.

        Examples
        --------
        >>> G = dn.DynDiGraph()
        >>> G = dn.DynDiGraph(edge_removal=True)
        """
        super(self.__class__, self).__init__(data, **attr)
        self.time_to_edge = defaultdict(int)
        self.snapshots = {}
        self.edge_removal = edge_removal
        self.directed = True
def __init__ ( self , data = None , edge_removal = True , ** attr ) : super ( self . __class__ , self ) . __init__ ( data , ** attr ) self . time_to_edge = defaultdict ( int ) self . snapshots = { } self . edge_removal = edge_removal self . directed = True
Initialize a directed graph with interaction, name, graph attributes.

        Parameters
        ----------
        data : input graph
            Data to initialize graph.  If data=None (default) an empty
            graph is created.  The data can be an interaction list, or any
            NetworkX/DyNetx graph object.  If the corresponding optional Python
            packages are installed the data can also be a NumPy matrix
            or 2d ndarray, a SciPy sparse matrix, or a PyGraphviz graph.

        edge_removal : bool, optional (default=True)
            Specify if the dynamic graph instance should allows edge removal or not.

        attr : keyword arguments, optional (default= no attributes)
            Attributes to add to graph as key=value pairs.

        Examples
        --------
        >>> G = dn.DynDiGraph()
        >>> G = dn.DynDiGraph(edge_removal=True)