def _merge_namespaces()

in generator/namespaces.py [0:0]


def _merge_namespaces(dct, merge_dct):
    """Recursively merge namespaces."""
    for k, _ in merge_dct.items():
        if k in dct and isinstance(dct[k], dict) and isinstance(merge_dct[k], Mapping):
            if "glean_app" in merge_dct[k] and merge_dct[k]["glean_app"] is False:
                # if glean_app gets set to False, Glean views and explores should not be generated
                dct[k] = merge_dct[k]
            else:
                _merge_namespaces(dct[k], merge_dct[k])
        else:
            if k == "owners" and "owners" in dct:
                # combine owners
                dct[k] += merge_dct[k]
            else:
                dct[k] = merge_dct[k]