code: def set_threshold(level, force=False):
      prev_level = _global_log.threshold
      if prev_level > DEBUG or force:
          # If we're running at DEBUG, don't change the threshold, as there's
          # likely a good reason why we're running at this level.
          _global_log.threshold = level
          if level <= DEBUG:
              info(
                  "set_threshold: setting threshold to DEBUG level,"
                  " it can be changed only with force argument"
              )
      else:
          info(
              "set_threshold: not changing threshold from DEBUG level"
              " %s to %s" % (prev_level, level)
          )
      return prev_level
  
file_path: numpy/numpy/distutils/log.py
imports: import sys
  from distutils.log import *
  from distutils.log import Log
  from distutils.log import _global_log
  from numpy.distutils.misc_util import red_text, default_text, cyan_text, green_text, is_sequence, is_string
label_desc: Use image node_id 2 for calling a global function with example usage: set_threshold(level, force) and returns: prev_level