def recursionindex(self):
cache = {}<EOL>for i, entry in enumerate(self):<EOL><INDENT>key = entry.frame.code.path, id(entry.frame.code.raw), entry.lineno<EOL>values = cache.setdefault(key, [])<EOL>if values:<EOL><INDENT>f = entry.frame<EOL>loc = f.f_locals<EOL>for otherloc in values:<EOL><INDENT>if f.is_true(<EOL>f.eval(<EOL>co_equal,<EOL>__recursioncache_locals_1=loc,<EOL>__recursioncache_locals_2=otherloc,<EOL>)<EOL>):<EOL><INDENT>return i<EOL><DEDENT><DEDENT><DEDENT>values.append(entry.frame.f_locals)<EOL><DEDENT>return None<EOL>
return the index of the frame/TracebackEntry where recursion
            originates if appropriate, None if no recursion occurred