class_docstr: Unit tests for the
  :func:`~networkx.algorithms.matching.is_perfect_matching` function.
code: def test_valid_not_path(self):
      G = nx.cycle_graph(4)
      G.add_edge(0, 4)
      G.add_edge(1, 4)
      G.add_edge(5, 2)
  
      assert nx.is_perfect_matching(G, {(1, 4), (0, 3), (5, 2)})
  
imports: import math
  from itertools import permutations
  from pytest import raises
  import networkx
  from networkx.algorithms.matching import matching_dict_to_set
  from networkx.utils import edges_equal
label_desc: Use image node_id 3 for calling the TestIsPerfectMatching obj's underlying member method code with example usage: obj.test_valid_not_path() without return types