parameters: (request_setting, session_setting, dict_class=OrderedDict)
return_statement: return merged_setting
docstring: 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`
docstring_summary: 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`
docstring_tokens: 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
function: 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
function_tokens: 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