#NEWLINE# def RefineResults( self , results ) : #NEWLINE# #INDENT# 'Returns refined results using facet refinement parameters.\n\n    Args:\n      results: Search Query result set.\n    Returns:\n      The filtered result.\n    ' #NEWLINE# if ( not self . _params . facet_refinement_list ( ) ) : #NEWLINE# #INDENT# return results #NEWLINE# #UNINDENT# ref_groups = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for refinement in self . _params . facet_refinement_list ( ) : #NEWLINE# #INDENT# ref_groups . setdefault ( refinement . name ( ) , [ ] ) . append ( refinement ) #NEWLINE# #UNINDENT# return [ results for doc in results if self . _MatchFacetRefinements ( doc , ref_groups ) ]