from concurrent.futures import ThreadPoolExecutor from functools import partial threads = ThreadPoolExecutor(max_workers=20) def check_and_execute(name, key):