code: def _check_is_partition(parts, whole):
      whole = set(whole)
      parts = [set(x) for x in parts]
      if set.intersection(*parts) != set():
          raise ValueError(
              "Is not a partition because intersection is not null."
          )
      if set.union(*parts) != whole:
          raise ValueError(
              "Is not a partition because union is not the whole."
          )
  
imports: from pandas.compat import OrderedDict, lmap
  from pandas.core.index import Index, MultiIndex
  from pandas.core.series import Series
label_desc: Use image node_id 1 for calling a global function with example usage: _check_is_partition(parts, whole) without return types