code: def test_greedy_modularity_communities_relabeled():
      # Test for gh-4966
      G = nx.balanced_tree(2, 2)
      mapping = {
          0: "a",
          1: "b",
          2: "c",
          3: "d",
          4: "e",
          5: "f",
          6: "g",
          7: "h",
      }
      G = nx.relabel_nodes(G, mapping)
      expected = [
          frozenset({"e", "d", "a", "b"}),
          frozenset({"c", "f", "g"}),
      ]
      assert greedy_modularity_communities(G) == 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 4 for calling a global function with example usage: test_greedy_modularity_communities_relabeled() without return types