python/data_mining/graph.py
def put(self, (operation, edge)):
        """Process next item (graph edge) in the stream.

        Args:
            operation (int): Integer in {1, -1} for ADD, REMOVE respectively.
            edge ((int, int)): an _added edge_ connecting nodes edge[0] and edge[1].

        Combination of main loop and `SampleEdge` function in [1]: Algorithm 1.
        """
        self.t += 1
        self.s += operation
        if operation == self.ADD:
            if self.sample_edge(edge):
                self.update_counters(self.ADD, edge)
        elif edge in self.reservoir:
            self.update_counters(self.REMOVE, edge)
            self.reservoir.pop_edge(edge)
            self.d_i += 1
        else:
            self.d_o += 1
Process next item (graph edge) in the stream.

        Args:
            operation (int): Integer in {1, -1} for ADD, REMOVE respectively.
            edge ((int, int)): an _added edge_ connecting nodes edge[0] and edge[1].

        Combination of main loop and `SampleEdge` function in [1]: Algorithm 1.
        
Process next item (graph edge) in the stream.
Process next item ( graph edge ) in the stream .
def put(self, (operation, edge)):
        self.t += 1
        self.s += operation
        if operation == self.ADD:
            if self.sample_edge(edge):
                self.update_counters(self.ADD, edge)
        elif edge in self.reservoir:
            self.update_counters(self.REMOVE, edge)
            self.reservoir.pop_edge(edge)
            self.d_i += 1
        else:
            self.d_o += 1
def put ( self , ( operation , edge ) ) : self . t += 1 self . s += operation if operation == self . ADD : if self . sample_edge ( edge ) : self . update_counters ( self . ADD , edge ) elif edge in self . reservoir : self . update_counters ( self . REMOVE , edge ) self . reservoir . pop_edge ( edge ) self . d_i += 1 else : self . d_o += 1
Process next item (graph edge) in the stream.
Process next item ( graph edge ) in the stream .
"""Process next item (graph edge) in the stream.

        Args:
            operation (int): Integer in {1, -1} for ADD, REMOVE respectively.
            edge ((int, int)): an _added edge_ connecting nodes edge[0] and edge[1].

        Combination of main loop and `SampleEdge` function in [1]: Algorithm 1.
        """
self
operation
Integer in {1, -1} for ADD, REMOVE respectively.
Integer in { 1 - 1 } for ADD REMOVE respectively .
edge
an _added edge_ connecting nodes edge[0] and edge[1].
an _added edge_ connecting nodes edge [ 0 ] and edge [ 1 ] .