code: def test_connected_communities():
      test = nx.Graph()
      # community 1
      test.add_edge("a", "b")
      test.add_edge("c", "a")
      test.add_edge("c", "b")
      test.add_edge("d", "a")
      test.add_edge("d", "b")
      test.add_edge("d", "c")
      test.add_edge("e", "a")
      test.add_edge("e", "b")
      test.add_edge("e", "c")
      test.add_edge("e", "d")
      # community 2
      test.add_edge("1", "2")
      test.add_edge("3", "1")
      test.add_edge("3", "2")
      test.add_edge("4", "1")
      test.add_edge("4", "2")
      test.add_edge("4", "3")
      test.add_edge("5", "1")
      test.add_edge("5", "2")
      test.add_edge("5", "3")
      test.add_edge("5", "4")
      # edge between community 1 and 2
      test.add_edge("a", "1")
      # community 3
      test.add_edge("x", "y")
      # community 4 with only a single node
      test.add_node("z")
  
      # The expected communities are:
      ground_truth1 = {
          frozenset(["a", "b", "c", "d", "e"]),
          frozenset(["1", "2", "3", "4", "5"]),
          frozenset(["x", "y"]),
          frozenset(["z"]),
      }
      ground_truth2 = {
          frozenset(["a", "b", "c", "d", "e", "1", "2", "3", "4", "5"]),
          frozenset(["x", "y"]),
          frozenset(["z"]),
      }
      ground_truth = (ground_truth1, ground_truth2)
  
      communities = nx.community.label_propagation_communities(test)
      result = {frozenset(c) for c in communities}
      assert result in ground_truth
  
imports: from itertools import chain, combinations
  import pytest
  import networkx
label_desc: Use image node_id 5 for calling a global function with example usage: test_connected_communities() without return types