code: def dict_to_sets(colors):
      if len(colors) == 0:
          return []
  
      k = max(colors.values()) + 1
      sets = [set() for _ in range(k)]
  
      for node, color in colors.items():
          sets[color].add(node)
  
      return sets
  
imports: import itertools
  import pytest
  import networkx
label_desc: Use image node_id 3 for calling a global function with example usage: dict_to_sets(colors) and returns: sets, list