#NEWLINE# def merge_hooks( request_hooks , session_hooks , dict_class = OrderedDict ) : #NEWLINE# #INDENT# "\n    Properly merges both requests and session hooks.\n\n    This is necessary because when request_hooks == {'response': []}, the\n    merge breaks Session hooks entirely.\n    " #NEWLINE# if ( ( session_hooks is None ) or ( session_hooks . get ( 'response' ) == [ ] ) ) : #NEWLINE# #INDENT# return request_hooks #NEWLINE# #UNINDENT# if ( ( request_hooks is None ) or ( request_hooks . get ( 'response' ) == [ ] ) ) : #NEWLINE# #INDENT# return request_hooks #NEWLINE# #UNINDENT# return merge_setting ( request_hooks , session_hooks , dict_class )