code: def set_partition(ssli):
      """extract a partition from a list of tuples
  
      this should be correctly called select largest disjoint sets.
      Begun and Gabriel 1981 do not seem to be bothered by sets of accepted
      hypothesis with joint elements,
      e.g. maximal_accepted_sets = { {1,2,3}, {2,3,4} }
  
      This creates a set partition from a list of sets given as tuples.
      It tries to find the partition with the largest sets. That is, sets are
      included after being sorted by length.
  
      If the list does not include the singletons, then it will be only a
      partial partition. Missing items are singletons (I think).
  
      Examples
      --------
      >>> li
      [(5, 6, 7, 8), (1, 2, 3), (4, 5), (0, 1)]
      >>> set_partition(li)
      ([(5, 6, 7, 8), (1, 2, 3)], [0, 4])
  
      """
      part = []
      for s in sorted(list(set(ssli)), key=len)[::-1]:
          # print(s,
          s_ = set(s).copy()
          if not any(set(s_).intersection(set(t)) for t in part):
              # print('inside:', s
              part.append(s)
          # else: print(part
  
      missing = list(
          {i for ll in ssli for i in ll}
          - {i for ll in part for i in ll}
      )
      return part, missing
  
imports: from collections import namedtuple
  from statsmodels.compat.python import lzip, lrange
  import copy
  import math
  import numpy
  from numpy.testing import assert_almost_equal, assert_equal
  from scipy import stats, interpolate
  from statsmodels.iolib.table import SimpleTable
  from statsmodels.stats.multitest import multipletests, _ecdf, fdrcorrection, fdrcorrection_twostage
  from statsmodels.graphics import utils
  from statsmodels.tools.sm_exceptions import ValueWarning
label_desc: Use image node_id 29 for calling a global function with example usage: set_partition(ssli) and returns: part,  missing