code: def get_level_value(level):
      
      try:
          # integral constants also work: they are the level value
          return int(level)
      except ValueError:
          try:
              return LEVELS_DICT[level.upper()]
          except KeyError:
              logging.warning("level '%s' cannot be translated to a level value (not present in LEVELS_DICT)" % level)
              return None
docs: Returns the logging value associated with a particular level name.  The
      argument must be present in LEVELS_DICT or be an integer constant.
      Otherwise None will be returned.