'rp(X, depth=None, er=None, imdom=0, bf=0, src=None, stopkind=None, nocyc=False, ref=None)
Reference pattern forming.
Arguments
X       Set of objects for which a reference pattern is sought.
depth   The depth to which the pattern will be generated. The
default is taken from depth of this module.
er      The equivalence relation to partition the referrers. The default
is Clodo.
imdom   If true, the immediate dominators will be used instead
of the referrers. This will take longer time to calculate,
but may be useful to reduce the complexity of the reference
pattern.
bf      If true, the pattern will be printed in breadth-first
order instead of depth-first. (Experimental.)
src     If specified, an alternative reference source instead
of the default root.
stopkind
nocyc
ref
Description
Return a reference pattern object based on the objects in the set X.
The reference pattern object is of class ReferencePattern. It is
described in XXX.'

def rp(self, X, depth=None, er=None, imdom=0, bf=0, src=None, stopkind=None, nocyc=False, ref=None):

    if (depth is None):
        depth = self.depth
    X = self.UniSet.idset_adapt(X)
    if (src is not None):
        src = self.UniSet.idset_adapt(src)
        self = self._root.guppy.Root().guppy.heapy.RefPat
        self.View.root = tuple(src.nodes)
        X = self.Use.idset(X.nodes)
    if (er is None):
        er = self.er
    if imdom:
        relimg = (lambda X: X.imdom)
    elif (ref is not None):
        if (ref == 'gc'):
            relimg = (lambda X: X.referrers_gc)
        elif (ref == 'gcx'):
            relimg = (lambda x: (((x.referrers_gc - self._root.guppy.sets.ImmNodeSet) - self._parent.heapyc.NodeGraph) - self.View.ObservationList))
        elif (ref == 'imdom'):
            relimg = (lambda X: X.imdom)
        elif callable(ref):
            relimg = ref
        else:
            raise ValueError, "ref    should    be    'gc',    'gcx',    'imdom',    or    a    callable"
    else:
        relimg = (lambda X: X.referrers)
    if (stopkind is None):
        stopkind = self.stopkind
    rp = ReferencePattern(self, X, depth, er, relimg, bf, stopkind, nocyc)
    return rp
