def check_match(self, matching):
        # For the sake of brevity, rename `matching` to `M`.
        M = matching
        matched_vertices = frozenset(itertools.chain(*M.items()))
        # Assert that the maximum number of vertices (10) is matched.
        assert matched_vertices == frozenset(range(12)) - {1, 10}
        # Assert that no vertex appears in two edges, or in other words, that
        # the matching (u, v) and (v, u) both appear in the matching
        # dictionary.
        assert all(u == M[M[u]] for u in range(12) if u in M)
Asserts that the matching is what we expect from the bipartite graph
dataset/ETHPy150Open networkx/networkx/networkx/algorithms/bipartite/tests/test_matching.py/TestMatching.check_match