code: def _labeling_complete(labeling, G):
      """Determines whether or not LPA is done.
  
      Label propagation is complete when all nodes have a label that is
      in the set of highest frequency labels amongst its neighbors.
  
      Nodes with no neighbors are considered complete.
      """
      return all(
          labeling[v] in _most_frequent_labels(v, labeling, G)
          for v in G
          if len(G[v]) > 0
      )
  
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 6 for calling a global function with example usage: _labeling_complete(labeling, G) and returns: all