(data, node_id=0)
| 130 | return {} |
| 131 | |
| 132 | def write_node_id(data, node_id=0): |
| 133 | if isinstance(data, dict): |
| 134 | data['node_id'] = str(node_id).zfill(4) |
| 135 | node_id += 1 |
| 136 | for key in list(data.keys()): |
| 137 | if 'nodes' in key: |
| 138 | node_id = write_node_id(data[key], node_id) |
| 139 | elif isinstance(data, list): |
| 140 | for index in range(len(data)): |
| 141 | node_id = write_node_id(data[index], node_id) |
| 142 | return node_id |
| 143 | |
| 144 | def get_nodes(structure): |
| 145 | if isinstance(structure, dict): |
no outgoing calls
no test coverage detected