MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / recurse

Function recurse

lib/matplotlib/cbook.py:781–802  ·  view source on GitHub ↗
(obj, start, all, current_path)

Source from the content-addressed store, hash-verified

779 outstream.write("\n")
780
781 def recurse(obj, start, all, current_path):
782 if show_progress:
783 outstream.write("%d\r" % len(all))
784
785 all[id(obj)] = None
786
787 referents = gc.get_referents(obj)
788 for referent in referents:
789 # If we've found our way back to the start, this is
790 # a cycle, so print it out
791 if referent is start:
792 print_path(current_path)
793
794 # Don't go back through the original list of objects, or
795 # through temporary references to the object, since those
796 # are just an artifact of the cycle detector itself.
797 elif referent is objects or isinstance(referent, types.FrameType):
798 continue
799
800 # We haven't seen this object before, so recurse
801 elif id(referent) not in all:
802 recurse(referent, start, all, current_path + [obj])
803
804 for obj in objects:
805 outstream.write(f"Examining: {obj!r}\n")

Callers 1

print_cyclesFunction · 0.70

Calls 2

print_pathFunction · 0.85
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…