def get_doc(log, docs, index):
    """Get one document from a multi-document source."""
    doc_count = len(docs)
    max_index = doc_count - 1
    if index > max_index:
        log.critical((
            "DOCUMENT_INDEX is too high; the maximum zero-based index is {}"
            " when the document count is {}."
            ).format(max_index, doc_count), 1)
    return docs[index]