code: def set_debug(self, debug=1):
          
          self._check_if_ready()
          self.debug = debug
          self.main_loop.debug = debug
docs: Set the debug level.
  
          :type  debug: int
          :param debug: The debug level.