'Return a nested list containing referrers of the given object.'

def ascend(self, obj, depth=1):

    depth += 1
    parents = []
    refs = gc.get_referrers(obj)
    self.ignore.append(refs)
    if (len(refs) > self.maxparents):
        return [(('[%s    referrers]' % len(refs)), [])]
    try:
        ascendcode = self.ascend.__code__
    except AttributeError:
        ascendcode = self.ascend.im_func.func_code
    for parent in refs:
        if (inspect.isframe(parent) and (parent.f_code is ascendcode)):
            continue
        if (parent in self.ignore):
            continue
        if (depth <= self.maxdepth):
            parents.append((parent, self.ascend(parent, depth)))
        else:
            parents.append((parent, []))
    return parents
