MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / sort

Function sort

lib/sqlalchemy/util/topological.py:58–74  ·  view source on GitHub ↗

sort the given list of items by dependency. 'tuples' is a list of tuples representing a partial ordering. deterministic_order is no longer used, the order is now always deterministic given the order of "allitems". the flag is there for backwards compatibility with Alembic.

(
    tuples: Collection[Tuple[_T, _T]],
    allitems: Collection[_T],
    deterministic_order: bool = True,
)

Source from the content-addressed store, hash-verified

56
57
58def sort(
59 tuples: Collection[Tuple[_T, _T]],
60 allitems: Collection[_T],
61 deterministic_order: bool = True,
62) -> Iterator[_T]:
63 """sort the given list of items by dependency.
64
65 'tuples' is a list of tuples representing a partial ordering.
66
67 deterministic_order is no longer used, the order is now always
68 deterministic given the order of "allitems". the flag is there
69 for backwards compatibility with Alembic.
70
71 """
72
73 for set_ in sort_as_subsets(tuples, allitems):
74 yield from set_
75
76
77def find_cycles(

Callers

nothing calls this directly

Calls 1

sort_as_subsetsFunction · 0.85

Tested by

no test coverage detected