'Return a list of document identifiers for all documents in
this corpus, or for the documents with the given file(s) if
specified.'

def documents(self, fileids=None):

    if (fileids is None):
        return self._documents
    if isinstance(fileids, string_types):
        fileids = [fileids]
    for f in fileids:
        if (f not in self._fileids):
            raise KeyError(('File    id    %s    not    found' % fileids))
    return sorted(set((f[:(-4)] for f in fileids)))
