class_docstr: This class represents an abstract partition.
  
  A partition is a set of disjoint sets whose union equals a given set.
  
  See Also
  ========
  
  sympy.utilities.iterables.partitions,
  sympy.utilities.iterables.multiset_partitions
docstr: Return a canonical key that can be used for sorting.
  
  Ordering is based on the size and sorted elements of the partition
  and ties are broken with the rank.
  
  Examples
  ========
  
  >>> from sympy import default_sort_key
  >>> from sympy.combinatorics import Partition
  >>> from sympy.abc import x
  >>> a = Partition([1, 2])
  >>> b = Partition([3, 4])
  >>> c = Partition([1, x])
  >>> d = Partition(list(range(4)))
  >>> l = [d, b, a + 1, a, c]
  >>> l.sort(key=default_sort_key); l
  [Partition({1, 2}), Partition({1}, {2}), Partition({1, x}), Partition({3, 4}), Partition({0, 1, 2, 3})]
code: def sort_key(self, order=None):
      """Return a canonical key that can be used for sorting.
  
      Ordering is based on the size and sorted elements of the partition
      and ties are broken with the rank.
  
      Examples
      ========
  
      >>> from sympy import default_sort_key
      >>> from sympy.combinatorics import Partition
      >>> from sympy.abc import x
      >>> a = Partition([1, 2])
      >>> b = Partition([3, 4])
      >>> c = Partition([1, x])
      >>> d = Partition(list(range(4)))
      >>> l = [d, b, a + 1, a, c]
      >>> l.sort(key=default_sort_key); l
      [Partition({1, 2}), Partition({1}, {2}), Partition({1, x}), Partition({3, 4}), Partition({0, 1, 2, 3})]
      """
      if order is None:
          members = self.members
      else:
          members = tuple(
              sorted(
                  self.members, key=lambda w: default_sort_key(w, order)
              )
          )
      return tuple(
          map(default_sort_key, (self.size, members, self.rank))
      )
  
imports: from sympy.core import Basic, Dict, sympify, Tuple
  from sympy.core.numbers import Integer
  from sympy.core.sorting import default_sort_key
  from sympy.core.sympify import _sympify
  from sympy.functions.combinatorial.numbers import bell
  from sympy.matrices import zeros
  from sympy.sets.sets import FiniteSet, Union
  from sympy.utilities.iterables import flatten, group
  from sympy.utilities.misc import as_int
  from collections import defaultdict
label_desc: Use image node_id 2 for calling the Partition obj's underlying member method code with example usage: obj.sort_key(order) and returns: tuple