845e17c851184c10ca62122c95d876c35475cc14,osmnx/simplification.py,,_build_path,#Any#Any#Any#Any#,91

Before Change


        // first node is a successor of the path"s final node, then this is
        // actually a self loop, so add path"s first node to end of path to
        // close it
        path.append(path[0])

    return path

After Change


                    successor = successors[0]
                    path.append(successor)
                else:
                    if len(successors) == 0:
                        // we are coming to the end of a self-looping edge, so
                        // add path"s first node to end of path to close it,
                        // then return
                        return path + [path[0]]
                    else:
                        // if len successors > 1, then successor must have been
                        // an endpoint because you can go in 2 new directions.
                        // this should never occur in practice
                        raise Exception("Should never hit this point.")

            // if this successor is an endpoint, we"ve completed the path,
            // so return it
            return path


def _get_paths_to_simplify(G, strict=True):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: gboeing/osmnx
Commit Name: 845e17c851184c10ca62122c95d876c35475cc14
Time: 2020-06-05
Author: boeing@usc.edu
File Name: osmnx/simplification.py
Class Name:
Method Name: _build_path


Project Name: TheAlgorithms/Python
Commit Name: 023f5e092d38f7e220ae68a23f7183eeb8fd9e04
Time: 2019-05-22
Author: vargasnikolass@gmail.com
File Name: sorts/bucket_sort.py
Class Name:
Method Name: bucket_sort


Project Name: keras-team/keras
Commit Name: 2ab9f0ef616c6d05124bdf9c81eb542d73f8e5b6
Time: 2015-06-30
Author: francois.chollet@gmail.com
File Name: keras/layers/containers.py
Class Name: Graph
Method Name: get_input