<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def one_thread_per_process():
 """Return a context manager where only one thread is allocated to a process. This function is intended to be used as a with statement like:: Notes: This function only works when MKL (Intel Math Kernel Library) is installed and used in, for example, NumPy and SciPy. Otherwise this function does nothing. """

    try:
        import mkl
        is_mkl = True
    except ImportError:
        is_mkl = False

    if is_mkl:
        n_threads = mkl.get_max_threads()
        mkl.set_num_threads(1)
        try:
            # block nested in the with statement
            yield
        finally:
            # revert to the original value
            mkl.set_num_threads(n_threads)
    else:
        yield