I find myself often writing code like the following:
from multiprocessing import Pool def foo(data, threads=4): if threads > 1: pool = Pool(thread