code: def is_coloring(G, coloring):
      """Determine if the coloring is a valid coloring for the graph G."""
      # Verify that the coloring is valid.
      return all(coloring[s] != coloring[d] for s, d in G.edges)
  
file_path: networkx/networkx/algorithms/coloring/equitable_coloring.py
imports: from collections import defaultdict
  import networkx
label_desc: Use image node_id 1 for calling a global function with example usage: is_coloring(G, coloring) and returns: all