Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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')
def __enter__(self):
try:
mkl.domain_set_num_threads(self.n_threads, domain='fft')
except:
raise ValueError("Class argument {} result in invalid number of threads {}".format(self.workers, self.n_threads))