def _filter_collection(collection, date_range, cherry_pick):
    'Filter Document collection.'
    if date_range:
        collection_size_before = collection.count()
        collection = collection.find({'published_date': in_range(*date_range)})
        logger.debug('Filtered out {} Documents that do not fall in the given range.'.format((collection_size_before - collection.count())))
    if cherry_pick:
        logger.debug('Cherry-picked CVE `{cve_id}`'.format(cve_id=cherry_pick))
        collection = collection.find({'cve.id_': cherry_pick})
    return collection
Filter Document collection.
def _filter_collection(collection, date_range, cherry_pick):
    
    if date_range:
        collection_size_before = collection.count()
        collection = collection.find({'published_date': in_range(*date_range)})
        logger.debug('Filtered out {} Documents that do not fall in the given range.'.format((collection_size_before - collection.count())))
    if cherry_pick:
        logger.debug('Cherry-picked CVE `{cve_id}`'.format(cve_id=cherry_pick))
        collection = collection.find({'cve.id_': cherry_pick})
    return collection