utils¶
| MODULE | DESCRIPTION |
|---|---|
logging |
|
merge_dicts_with_priority
¶
merge_dicts_with_priority(
dict1: dict, dict2: dict | None
) -> dict
Merges two dictionaries with priority to dict1.
All keys and values from dict1 will be returned in the new dictionary, substituting keys with different
values from dict2. Keys and values exclusive to dict2 will be returned as well. The function is
recursively called for all nested dictionaries.
| PARAMETER | DESCRIPTION |
|---|---|
|
Priority dictionary to merge. Values in dict1 are always in the returned dictionary.
TYPE:
|
|
Secondary dictionary to merge.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict
|
Merged dictionary.
TYPE:
|
Source code in src/downmixer/utils/__init__.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | |
safe_get
¶
safe_get(dict, *args, default=None)
Source code in src/downmixer/utils/__init__.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |