(request_setting, session_setting, dict_class=OrderedDict)
return merged_setting
Determines appropriate setting for a given request, taking into account
    the explicit setting on that request, and the setting in the session. If a
    setting is a dictionary, they will be merged together using `dict_class`
Determines appropriate setting for a given request, taking into account
    the explicit setting on that request, and the setting in the session. If a
    setting is a dictionary, they will be merged together using `dict_class`
Determines appropriate setting for a given request taking into account the explicit setting on that request and the setting in the session . If a setting is a dictionary they will be merged together using dict_class
def merge_setting(request_setting, session_setting, dict_class=OrderedDict):
    """Determines appropriate setting for a given request, taking into account
    the explicit setting on that request, and the setting in the session. If a
    setting is a dictionary, they will be merged together using `dict_class`
    """

    if session_setting is None:
        return request_setting

    if request_setting is None:
        return session_setting

    # Bypass if not a dictionary (e.g. verify)
    if not (
            isinstance(session_setting, Mapping) and
            isinstance(request_setting, Mapping)
    ):
        return request_setting

    merged_setting = dict_class(to_key_val_list(session_setting))
    merged_setting.update(to_key_val_list(request_setting))

    # Remove keys that are set to None. Extract keys first to avoid altering
    # the dictionary during iteration.
    none_keys = [k for (k, v) in merged_setting.items() if v is None]
    for key in none_keys:
        del merged_setting[key]

    return merged_setting
def merge_setting ( request_setting , session_setting , dict_class = OrderedDict ) : if session_setting is None : return request_setting if request_setting is None : return session_setting # Bypass if not a dictionary (e.g. verify) if not ( isinstance ( session_setting , Mapping ) and isinstance ( request_setting , Mapping ) ) : return request_setting merged_setting = dict_class ( to_key_val_list ( session_setting ) ) merged_setting . update ( to_key_val_list ( request_setting ) ) # Remove keys that are set to None. Extract keys first to avoid altering # the dictionary during iteration. none_keys = [ k for ( k , v ) in merged_setting . items ( ) if v is None ] for key in none_keys : del merged_setting [ key ] return merged_setting