def run_mp(songs):
stats = Stats()<EOL>if CONFIG['<STR_LIT>']:<EOL><INDENT>good = open('<STR_LIT>', '<STR_LIT:w>')<EOL>bad = open('<STR_LIT>', '<STR_LIT:w>')<EOL><DEDENT>logger.debug('<STR_LIT>', CONFIG['<STR_LIT>'])<EOL>chunksize = math.ceil(len(songs) / os.cpu_count())<EOL>try:<EOL><INDENT>with Pool(CONFIG['<STR_LIT>']) as pool:<EOL><INDENT>for result in pool.imap_unordered(get_lyrics, songs, chunksize):<EOL><INDENT>if result is None:<EOL><INDENT>continue<EOL><DEDENT>for source, runtime in result.runtimes.items():<EOL><INDENT>stats.add_result(source, result.source == source, runtime)<EOL><DEDENT>found = process_result(result)<EOL>if CONFIG['<STR_LIT>']:<EOL><INDENT>if found:<EOL><INDENT>good.write(f'<STR_LIT>')<EOL>good.flush()<EOL><DEDENT>else:<EOL><INDENT>bad.write(str(result.song) + '<STR_LIT:\n>')<EOL>bad.flush()<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>finally:<EOL><INDENT>if CONFIG['<STR_LIT>']:<EOL><INDENT>good.close()<EOL>bad.close()<EOL><DEDENT><DEDENT>return stats<EOL>
Concurrently calls get_lyrics to fetch the lyrics of a large list of songs.