def update_params(old_params: Mapping[(str, Any)], new_params: Mapping[(str, Any)], check=False) -> Dict[(str, Any)]:
    '    Update old_params with new_params.\n\n    If check==False, this merely adds and overwrites the content of old_params.\n\n    If check==True, this only allows updating of parameters that are already\n    present in old_params.\n\n    Parameters\n    ----------\n    old_params\n    new_params\n    check\n\n    Returns\n    -------\n    updated_params\n    '
    updated_params = dict(old_params)
    if new_params:
        for (key, val) in new_params.items():
            if ((key not in old_params) and check):
                raise ValueError((((("'" + key) + "' is not a valid parameter key, ") + 'consider one of \n') + str(list(old_params.keys()))))
            if (val is not None):
                updated_params[key] = val
    return updated_params
Update old_params with new_params.

If check==False, this merely adds and overwrites the content of old_params.

If check==True, this only allows updating of parameters that are already
present in old_params.

Parameters
----------
old_params
new_params
check

Returns
-------
updated_params
def update_params(old_params: Mapping[(str, Any)], new_params: Mapping[(str, Any)], check=False) -> Dict[(str, Any)]:
    '    Update old_params with new_params.\n\n    If check==False, this merely adds and overwrites the content of old_params.\n\n    If check==True, this only allows updating of parameters that are already\n    present in old_params.\n\n    Parameters\n    ----------\n    old_params\n    new_params\n    check\n\n    Returns\n    -------\n    updated_params\n    '
    updated_params = dict(old_params)
    if new_params:
        for (key, val) in new_params.items():
            if ((key not in old_params) and check):
                raise ValueError((((("'" + key) + "' is not a valid parameter key, ") + 'consider one of \n') + str(list(old_params.keys()))))
            if (val is not None):
                updated_params[key] = val
    return updated_params