Walk through the ast tree and return all nodes :param ast tree: :rtype: list[ast]
(tree)
| 22 | |
| 23 | |
| 24 | def walk(tree): |
| 25 | """ |
| 26 | Walk through the ast tree and return all nodes |
| 27 | :param ast tree: |
| 28 | :rtype: list[ast] |
| 29 | """ |
| 30 | ret = [] |
| 31 | if type(tree) == list: |
| 32 | for el in tree: |
| 33 | if el.get('type'): |
| 34 | ret.append(el) |
| 35 | ret += walk(el) |
| 36 | elif type(tree) == dict: |
| 37 | for k, v in tree.items(): |
| 38 | if type(v) == dict and v.get('type'): |
| 39 | ret.append(v) |
| 40 | ret += walk(v) |
| 41 | if type(v) == list: |
| 42 | ret += walk(v) |
| 43 | return ret |
| 44 | |
| 45 | |
| 46 | def resolve_owner(callee): |
no outgoing calls
no test coverage detected