code: def filter(self, scored_list):
          '''
          Filtering with top-n ranking.
  
          Args:
              scored_list:    The list of scoring.
  
          Retruns:
              The list of filtered result.
  
          '''
          top_n_key = -1 * self.top_n
          top_n_list = sorted(scored_list, key=lambda x: x[1])[top_n_key:]
          result_list = sorted(top_n_list, key=lambda x: x[0])
          return result_lisf filter(self, scored_list):
          '''
          Filtering with top-n ranking.
  
          Args:
              scored_list:    The list of scoring.
  
          Retruns:
              The list of filtered result.
  
          '''
          top_n_key = -1 * self.top_n
          top_n_list = sorted(scored_list, key=lambda x: x[1])[top_n_key:]
          result_list = sorted(top_n_list, key=lambda x: x[0])
          return result_list
docs: Filtering with top-n ranking.
  
          Args:
              scored_list:    The list of scoring.
  
          Retruns:
              The list of filtered result.