def METHOD_NAME(worker_id):
    try:
        psutil.Process().cpu_affinity([loader_cores[worker_id]])
    except IndexError:
        raise ValueError(f"Cannot use CPU affinity for worker ID "
                         f"{worker_id} on CPU {loader_cores}")
    worker_init_fn_old(worker_id)