docs: 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::
  
          >>> with process_per_thread():
          ...     do_something() # one thread per process
  
      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