class_docstr: Tests for bipartite matching algorithms.
class_docstr_tok: ["Tests","for","bipartite","matching","algorithms","."]
docstr: Asserts that the matching is what we expect from the bipartite graph
  constructed in the :meth:`setup` fixture.
docstr_tok: ["Asserts","that","the","matching","is","what","we","expect","from","the","bipartite","graph","constructed","in","the",":","meth",":","`","setup","`","fixture","."]
code: def check_match(self, matching):
      """Asserts that the matching is what we expect from the bipartite graph
      constructed in the :meth:`setup` fixture.
  
      """
      # 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)
  
imports: import itertools
  import pytest
  import networkx
  from networkx.algorithms.bipartite.matching import eppstein_matching, hopcroft_karp_matching, maximum_matching, minimum_weight_full_matching, to_vertex_cover
label_desc: Use image node_id 2 for calling the TestMatching obj's underlying member method code with example usage: obj.check_match(matching) without return types