code: def detect_number_of_threads():
      
      log.warning('Deprecated, use `init_num_threads` instead.')
      try:
          nthreads = int(os.environ.get('NUMEXPR_NUM_THREADS', ''))
      except ValueError:
          try:
              nthreads = int(os.environ.get('OMP_NUM_THREADS', ''))
          except ValueError:
              nthreads = detect_number_of_cores()
  
      # Check that we don't surpass the MAX_THREADS in interpreter.cpp
      if nthreads > MAX_THREADS:
          nthreads = MAX_THREADS
      return nthreads
docs: DEPRECATED: use `_init_num_threads` instead.
      If this is modified, please update the note in: https://github.com/pydata/numexpr/wiki/Numexpr-Users-Guide