Recursively merge update dict into original dict (in-place). For nested dicts, merges recursively. For other types, overwrites. Args: original (dict): Target dict to be updated in-place. update (dict): Source dict with new values.
(original, update)
| 88 | |
| 89 | |
| 90 | def deep_update(original, update): |
| 91 | |
| 92 | """Recursively merge update dict into original dict (in-place). |
| 93 | |
| 94 | For nested dicts, merges recursively. For other types, overwrites. |
| 95 | |
| 96 | Args: |
| 97 | original (dict): Target dict to be updated in-place. |
| 98 | update (dict): Source dict with new values. |
| 99 | """ |
| 100 | for key, value in update.items(): |
| 101 | if isinstance(value, dict) and key in original: |
| 102 | if len(value) == 0: |
| 103 | original[key] = value |
| 104 | deep_update(original[key], value) |
| 105 | else: |
| 106 | original[key] = value |
| 107 | |
| 108 | |
| 109 | def prepare_model_dir(**kwargs): |
no outgoing calls
no test coverage detected
searching dependent graphs…