(level)
| 32 | """ |
| 33 | |
| 34 | def inner(level): |
| 35 | for item in level: |
| 36 | item_id = id(item) |
| 37 | if item_id not in garbage_ids: |
| 38 | continue |
| 39 | if item_id in visited_ids: |
| 40 | continue |
| 41 | if item_id in stack_ids: |
| 42 | candidate = stack[stack.index(item) :] |
| 43 | candidate.append(item) |
| 44 | found.append(candidate) |
| 45 | continue |
| 46 | |
| 47 | stack.append(item) |
| 48 | stack_ids.add(item_id) |
| 49 | inner(gc.get_referents(item)) |
| 50 | stack.pop() |
| 51 | stack_ids.remove(item_id) |
| 52 | visited_ids.add(item_id) |
| 53 | |
| 54 | found: typing.List[object] = [] |
| 55 | stack = [] |
no test coverage detected