Given an ast element (list), walk it in a dfs to get every el (list) out of it :param tree_el ast: :rtype: list[ast]
(tree_el)
| 56 | |
| 57 | |
| 58 | def walk(tree_el): |
| 59 | """ |
| 60 | Given an ast element (list), walk it in a dfs to get every el (list) out of it |
| 61 | |
| 62 | :param tree_el ast: |
| 63 | :rtype: list[ast] |
| 64 | """ |
| 65 | |
| 66 | if not tree_el: |
| 67 | return [] |
| 68 | ret = [tree_el] |
| 69 | for el in tree_el: |
| 70 | if isinstance(el, list): |
| 71 | ret += walk(el) |
| 72 | return ret |
| 73 | |
| 74 | |
| 75 | def make_calls(body_el): |