dfe8d88a87a4b98f831f69012e22f8b7611f7d25,osmnx/simplify.py,,consolidate_intersections_rebuild_graph,#Any#Any#Any#,408

Before Change


        if len(nodes_subset) > 1:
            for osmid in nodes_subset.index:
                neighbors = set(list(G.predecessors(osmid)) + list(G.successors(osmid)))
                neighbors_in_cluster = [n for n in nodes_subset.index if n in neighbors]
                if len(neighbors_in_cluster) == 0:
                    ndfc.append(osmid)

    // move each the node that does not belong to its cluster into its own

After Change


        if len(nodes_subset) > 1:
            // identify all the (weakly connected) component in cluster
            wccs = list(nx.weakly_connected_components(G.subgraph(nodes_subset.index)))
            if len(wccs) > 1:
                // if there are multiple components in this cluster
                suffix = 0
                for wcc in wccs:
                    // set subcluster xy to the centroid of just these nodes
                    subcluster_centroid = node_points.loc[wcc].unary_union.centroid
                    gdf.loc[wcc, "x"] = subcluster_centroid.x
                    gdf.loc[wcc, "y"] = subcluster_centroid.y
                    // move to subcluster by appending suffix to nodes cluster label
                    gdf.loc[wcc, "cluster"] = "{}-{}".format(cluster_label, suffix)
                    suffix += 1


    // STEP 4
    // create new empty graph and copy over misc graph data
    H = nx.MultiDiGraph()
    H.graph = G.graph

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: gboeing/osmnx
Commit Name: dfe8d88a87a4b98f831f69012e22f8b7611f7d25
Time: 2020-05-13
Author: boeing@usc.edu
File Name: osmnx/simplify.py
Class Name:
Method Name: consolidate_intersections_rebuild_graph


Project Name: librosa/librosa
Commit Name: 9b95e0f07b60b6a144893dcc506dfaf90db61c95
Time: 2020-05-18
Author: bmcfee@users.noreply.github.com
File Name: librosa/feature/utils.py
Class Name:
Method Name: stack_memory


Project Name: theislab/scanpy
Commit Name: 4b1f799c8403626ff56c7bf23fb1fbdb79dcb015
Time: 2019-01-14
Author: fidel.ramirez@gmail.com
File Name: scanpy/plotting/_tools/__init__.py
Class Name:
Method Name: _rank_genes_groups_plot