(structure)
| 157 | return nodes |
| 158 | |
| 159 | def structure_to_list(structure): |
| 160 | if isinstance(structure, dict): |
| 161 | nodes = [] |
| 162 | nodes.append(structure) |
| 163 | if 'nodes' in structure: |
| 164 | nodes.extend(structure_to_list(structure['nodes'])) |
| 165 | return nodes |
| 166 | elif isinstance(structure, list): |
| 167 | nodes = [] |
| 168 | for item in structure: |
| 169 | nodes.extend(structure_to_list(item)) |
| 170 | return nodes |
| 171 | |
| 172 | |
| 173 | def get_leaf_nodes(structure): |
no outgoing calls
no test coverage detected