fde7cc023ea226bf01563d0cbce919e85f8701fd,model.py,,_last,#Any#Any#,190

Before Change


    :param T_tot: total number of time steps to run the model.
    :return: dictionary {layer j: last time t}
    
    last = {}
    curr_ind = [graph.number_of_nodes() - 1]  // start with output layer
    t = T_tot
    while len(last) < graph.number_of_nodes():
        next_ind = []  // layers at prev time point
        for ind in curr_ind:
            if ind not in last:
                last[ind] = t
                // then add adjacency list onto next_ind
                next_ind.extend(graph.predecessors(ind))
        curr_ind = next_ind

After Change


    while len(curr_layers) > 0:
        next_layers = []  // layers at prev time point
        for layer in curr_layers:
            if "last" not in graph.node[layer]:
                graph.node[layer]["last"] = t
                // then add adjacency list onto next_layer
                next_layers.extend(graph.predecessors(layer))
        curr_layers = next_layers
        t -= 1

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 7

Instances


Project Name: neuroailab/tnn
Commit Name: fde7cc023ea226bf01563d0cbce919e85f8701fd
Time: 2016-10-02
Author: qbilius@gmail.com
File Name: model.py
Class Name:
Method Name: _last


Project Name: neuroailab/tnn
Commit Name: fde7cc023ea226bf01563d0cbce919e85f8701fd
Time: 2016-10-02
Author: qbilius@gmail.com
File Name: model.py
Class Name:
Method Name: _first


Project Name: bokeh/bokeh
Commit Name: c3534b1a8a5de16cc797c2b4d239059322c766db
Time: 2016-01-09
Author: bryanv@continuum.io
File Name: bokeh/application/handlers/script.py
Class Name: ScriptHandler
Method Name: __init__


Project Name: bokeh/bokeh
Commit Name: c3534b1a8a5de16cc797c2b4d239059322c766db
Time: 2016-01-09
Author: bryanv@continuum.io
File Name: bokeh/application/handlers/notebook.py
Class Name: NotebookHandler
Method Name: __init__