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: Creates a set partition from a restricted growth string.
  
  Explanation
  ===========
  
  The indices given in rgs are assumed to be the index
  of the element as given in elements *as provided* (the
  elements are not sorted by this routine). Block numbering
  starts from 0. If any block was not referenced in ``rgs``
  an error will be raised.
  
  Examples
  ========
  
  >>> from sympy.combinatorics import Partition
  >>> Partition.from_rgs([0, 1, 2, 0, 1], list('abcde'))
  Partition({c}, {a, d}, {b, e})
  >>> Partition.from_rgs([0, 1, 2, 0, 1], list('cbead'))
  Partition({e}, {a, c}, {b, d})
  >>> a = Partition([1, 4], [2], [3, 5])
  >>> Partition.from_rgs(a.RGS, a.members)
  Partition({2}, {1, 4}, {3, 5})
code: def from_rgs(self, rgs, elements):
      """
      Creates a set partition from a restricted growth string.
  
      Explanation
      ===========
  
      The indices given in rgs are assumed to be the index
      of the element as given in elements *as provided* (the
      elements are not sorted by this routine). Block numbering
      starts from 0. If any block was not referenced in ``rgs``
      an error will be raised.
  
      Examples
      ========
  
      >>> from sympy.combinatorics import Partition
      >>> Partition.from_rgs([0, 1, 2, 0, 1], list('abcde'))
      Partition({c}, {a, d}, {b, e})
      >>> Partition.from_rgs([0, 1, 2, 0, 1], list('cbead'))
      Partition({e}, {a, c}, {b, d})
      >>> a = Partition([1, 4], [2], [3, 5])
      >>> Partition.from_rgs(a.RGS, a.members)
      Partition({2}, {1, 4}, {3, 5})
      """
      if len(rgs) != len(elements):
          raise ValueError("mismatch in rgs and element lengths")
      max_elem = max(rgs) + 1
      partition = [[] for i in range(max_elem)]
      j = 0
      for i in rgs:
          partition[i].append(elements[j])
          j += 1
      if not all(p for p in partition):
          raise ValueError("some blocks of the partition were empty.")
      return Partition(*partition)
  
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 10 for calling the Partition obj's underlying member method code with example usage: obj.from_rgs(rgs, elements) and returns: Partition