def _general_multithread(func):
def multithread(templates, stream, *args, **kwargs):<EOL><INDENT>with pool_boy(ThreadPool, len(stream), **kwargs) as pool:<EOL><INDENT>return _pool_normxcorr(templates, stream, pool=pool, func=func)<EOL><DEDENT><DEDENT>return multithread<EOL>
return the general multithreading function using func