Flatten the nested dictionary to a flat dictionary.
(metrics: dict[str, Any])
| 928 | |
| 929 | |
| 930 | def flatten_dict(metrics: dict[str, Any]) -> dict[str, Any]: |
| 931 | """ |
| 932 | Flatten the nested dictionary to a flat dictionary. |
| 933 | """ |
| 934 | result = {} |
| 935 | for key, value in metrics.items(): |
| 936 | if isinstance(value, dict): |
| 937 | result.update(flatten_dict(value)) |
| 938 | else: |
| 939 | result[key] = value |
| 940 | return result |
no test coverage detected
searching dependent graphs…