code: def _get_best_sentences(sentences, count, rating, *args, **kwargs):
      rate = rating
      if isinstance(rating, dict):
          assert not args and not kwargs
  
          def rate(s):
              return rating[s]
  
      infos = (
          SentenceInfo(s, o, rate(s, *args, **kwargs))
          for o, s in enumerate(sentences)
      )
  
      # sort sentences by rating in descending order
      infos = sorted(infos, key=attrgetter("rating"), reverse=True)
      # get `count` first best rated sentences
      if not callable(count):
          count = ItemsCount(count)
      infos = count(infos)
      # sort sentences by their order in document
      infos = sorted(infos, key=attrgetter("order"))
  
      return tuple(i.sentence for i in infos)
  
file_path: sumy/sumy/summarizers/_summarizer.py
imports: from __future__ import absolute_import
  from __future__ import division, print_function, unicode_literals
  from collections import namedtuple
  from operator import attrgetter
  from ..utils import ItemsCount
  from .._compat import to_unicode
  from ..nlp.stemmers import null_stemmer
label_desc: Use image node_id 5 for calling the AbstractSummarizer obj's underlying member method code with example usage: obj._get_best_sentences(sentences, count, rating) and returns: tuple, rating