class_docstr: Raised if a given collection is not a partition.
code: def __init__(self, G, collection):
      msg = f"{collection} is not a valid partition of the graph {G}"
      super().__init__(msg)
  
file_path: networkx/networkx/algorithms/community/quality.py
imports: from itertools import combinations
  import networkx
  from networkx import NetworkXError
  from networkx.algorithms.community.community_utils import is_partition
  from networkx.utils.decorators import argmap
label_desc: Use image node_id 1 to create a new NotAPartition object from inherited base classes: NetworkXError with example: obj = NotAPartition(G, collection)