(structure, order=None)
| 638 | |
| 639 | |
| 640 | def format_structure(structure, order=None): |
| 641 | if not order: |
| 642 | return structure |
| 643 | if isinstance(structure, dict): |
| 644 | if 'nodes' in structure: |
| 645 | structure['nodes'] = format_structure(structure['nodes'], order) |
| 646 | if not structure.get('nodes'): |
| 647 | structure.pop('nodes', None) |
| 648 | structure = reorder_dict(structure, order) |
| 649 | elif isinstance(structure, list): |
| 650 | structure = [format_structure(item, order) for item in structure] |
| 651 | return structure |
| 652 | |
| 653 | |
| 654 | class ConfigLoader: |
no test coverage detected