def verify_partial_ordering(G, ordering):
            """Verifies that `ordering` is a partial ordering of graph `G`."""

            ordering = tuple(ordering)
            assert(set(ordering) == set(vertices(G)))
            for v, w in pairwise(ordering):
                # need to ensure that v > w, from a graph theoretic perspective
                self.assert_(v not in adjacent(G,w))
Verifies that `ordering` is a partial ordering of graph `G`.
recipes/Python/498260_Examples_algorithm_compositiobserver_pattern/recipe-498260.py