code: def debug(dbg=True):
      
      global _debug_handler
      if dbg and _debug_handler is None:
          _debug_handler = logging.StreamHandler()
          logger.addHandler(_debug_handler)
          logger.setLevel(logging.DEBUG)
      elif not dbg and _debug_handler is not None:
          logger.removeHandler(_debug_handler)
          _debug_handler = None
          logger.setLevel(logging.WARNING)
docs: Enables or disables debugging messages on the standard output.