code: def log_warning(self, msg):
          
          if self.__logger:
              self.__logger.warning(msg)
  
          if self.__raise_exception_on_warning:
              raise RuntimeError(msg)
docs: Log a warning if ``logger`` exists.
  
          Args:
              msg: Warning to log.
  
          Warning:
              Can raise a ``RuntimeError`` if this was asked in the constructor.