def merge_hooks(request_hooks, session_hooks, dict_class=OrderedDict):
 if ((session_hooks is None) or (session_hooks.get('response') == [])):
  return request_hooks
 if ((request_hooks is None) or (request_hooks.get('response') == [])):
  return session_hooks
 return merge_setting(request_hooks, session_hooks, dict_class)

def merge_hooks ( request_hooks , session_hooks , dict_class = OrderedDict ) : if ( ( session_hooks is None ) or ( session_hooks . get ( 'response' ) == [ ] ) ) : return request_hooks if ( ( request_hooks is None ) or ( request_hooks . get ( 'response' ) == [ ] ) ) : return session_hooks return merge_setting ( request_hooks , session_hooks , dict_class )
properly merges both requests and session hooks .