Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _workers_to_num_threads(w):
if w is None:
return mkl.domain_get_max_threads(domain='fft')
return int(w)
def __exit__(self, *args):
# restore default
max_num_threads = mkl.domain_get_max_threads(domain='fft')
mkl.domain_set_num_threads(max_num_threads, domain='fft')