code: def _color_network(G):
      """Colors the network so that neighboring nodes all have distinct colors.
  
      Returns a dict keyed by color to a set of nodes with that color.
      """
      coloring = {}  # color => set(node)
      colors = nx.coloring.greedy_color(G)
      for node, color in colors.items():
          if color in coloring:
              coloring[color].add(node)
          else:
              coloring[color] = {node}
      return coloring
  
file_path: networkx/networkx/algorithms/community/label_propagation.py
imports: from collections import Counter, defaultdict, deque
  import networkx
  from networkx.utils import groups, not_implemented_for, py_random_state
label_desc: Use image node_id 5 for calling a global function with example usage: _color_network(G) and returns: coloring