<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_document_summary(self, N=None, cite_sort=True, refresh=True):
 """Return a summary string of documents. Parameters N : int or None (optional, default=None) Maximum number of documents to include in the summary. If None, return all documents. cite_sort : bool (optional, default=True) Whether to sort xml by number of citations, in decreasing order, or not. refresh : bool (optional, default=True) Whether to refresh the cached abstract file (if it exists) or not. Returns ------- s : str Text summarizing an author's documents. """

        abstracts = self.get_abstracts(refresh=refresh)

        if cite_sort:
            counts = [(a, int(a.citedby_count)) for a in abstracts]
            counts.sort(reverse=True, key=itemgetter(1))
            abstracts = [a[0] for a in counts]

        if N is None:
            N = len(abstracts)

        s = [u'{0} of {1} documents'.format(N, len(abstracts))]

        for i in range(N):
            s += ['{0:2d}. {1}\n'.format(i + 1, str(abstracts[i]))]

        return '\n'.join(s)