(a, b)
| 704 | |
| 705 | |
| 706 | def _merge_json(a, b): |
| 707 | if b: |
| 708 | a = a.copy() |
| 709 | for key, b_val in b.items(): |
| 710 | if key in a: |
| 711 | a_val = a[key] |
| 712 | if isinstance(a_val, dict) and isinstance(b_val, dict): |
| 713 | a[key] = _merge_json(a_val, b_val) |
| 714 | elif isinstance(a_val, (list, tuple)) and isinstance( |
| 715 | b_val, (list, tuple) |
| 716 | ): |
| 717 | a[key] = list(a_val) + list(b_val) |
| 718 | else: |
| 719 | a[key] = b_val |
| 720 | else: |
| 721 | a[key] = b_val |
| 722 | return a |
| 723 | |
| 724 | |
| 725 | class _Translator: |
no outgoing calls
no test coverage detected
searching dependent graphs…