code: def validate_communities(result, expected):
      assert set_of_sets(result) == set_of_sets(expected)
  
file_path: networkx/networkx/algorithms/community/tests/test_centrality.py
imports: from operator import itemgetter
  import networkx
label_desc: Use image node_id 2 for calling a global function with example usage: validate_communities(result, expected) without return types