def event_download_photos(photos):
try:<EOL><INDENT>assert gevent<EOL>assert grequests<EOL><DEDENT>except NameError:<EOL><INDENT>logger.error('<STR_LIT>')<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>global counter<EOL>counter = len(photos)<EOL>from gevent.pool import Pool<EOL>pool = Pool(multiprocessing.cpu_count())<EOL>jobs = [pool.spawn(download_photo_async, photo) for photo in photos]<EOL>pool.join()<EOL>
Use asynchronous I/O to download photos

    :param photos: The photos to be downloaded
    :type photos: list of dicts