code: def find_defined_levels():
      
      defined_levels = {}
      for name in dir(logging):
          if name.isupper():
              value = getattr(logging, name)
              if isinstance(value, int):
                  defined_levels[name] = value
      return defined_levels
docs: Find the defined logging levels.
  
      :returns: A dictionary with level names as keys and integers as values.
  
      Here's what the result looks like by default (when
      no custom levels or level names have been defined):
  
      >>> find_defined_levels()
      {'NOTSET': 0,
       'DEBUG': 10,
       'INFO': 20,
       'WARN': 30,
       'WARNING': 30,
       'ERROR': 40,
       'FATAL': 50,
       'CRITICAL': 50}