code: def test_modularity_communities(func):
      G = nx.karate_club_graph()
      john_a = frozenset(
          [
              8,
              14,
              15,
              18,
              20,
              22,
              23,
              24,
              25,
              26,
              27,
              28,
              29,
              30,
              31,
              32,
              33,
          ]
      )
      mr_hi = frozenset([0, 4, 5, 6, 10, 11, 16, 19])
      overlap = frozenset([1, 2, 3, 7, 9, 12, 13, 17, 21])
      expected = {john_a, overlap, mr_hi}
      assert set(func(G, weight=None)) == expected
  
file_path: networkx/networkx/algorithms/community/tests/test_modularity_max.py
imports: import pytest
  import networkx
  from networkx.algorithms.community import greedy_modularity_communities, naive_greedy_modularity_communities
label_desc: Use image node_id 1 for calling a global function with example usage: test_modularity_communities(func) without return types