MCPcopy Index your code
hub / github.com/clips/pattern / flatten

Function flatten

pattern/graph/__init__.py:792–795  ·  view source on GitHub ↗
(list)

Source from the content-addressed store, hash-verified

790 """
791 # Based on: Connelly Barnes, http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/119466
792 def flatten(list):
793 # Flattens a linked list of the form [0,[1,[2,[]]]]
794 while len(list) > 0:
795 yield list[0]; list=list[1]
796 G = adjacency(graph, directed=directed, heuristic=heuristic)
797 q = [(0, id1, ())] # Heap of (cost, path_head, path_rest).
798 visited = set() # Visited nodes.

Callers 1

dijkstra_shortest_pathFunction · 0.70

Calls 1

lenFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…