parameters: (self, last_query_handle, warn)
return_statement: return ""
docstring: Returns all messages from the error log prepended with 'WARNINGS:' or 'ERROR:' for
      last_query_handle, depending on whether warn is True or False. Note that the error
      log may contain messages that are not errors (e.g. warnings).
docstring_summary: Returns all messages from the error log prepended with 'WARNINGS:' or 'ERROR:' for
      last_query_handle, depending on whether warn is True or False. Note that the error
      log may contain messages that are not errors (e.g. warnings).
docstring_tokens: Returns all messages from the error log prepended with WARNINGS : or ERROR : for last_query_handle depending on whether warn is True or False . Note that the error log may contain messages that are not errors ( e . g . warnings ) .
function: def _get_warn_or_error_log(self, last_query_handle, warn):
      """Returns all messages from the error log prepended with 'WARNINGS:' or 'ERROR:' for
      last_query_handle, depending on whether warn is True or False. Note that the error
      log may contain messages that are not errors (e.g. warnings)."""
      if last_query_handle is None:
        return "Query could not be executed"
      req = TGetLogReq(last_query_handle)
  
      def GetLog():
        return self.imp_service.GetLog(req)
      # GetLog rpc is idempotent and so safe to retry.
      resp = self._do_hs2_rpc(GetLog, retry_on_error=True)
      self._check_hs2_rpc_status(resp.status)
  
      log = utf8_decode_if_needed(resp.log)
  
      # Strip progress message out of HS2 log.
      log = HS2_LOG_PROGRESS_REGEX.sub("", log)
      if log and log.strip():
        log = self._append_retried_query_link(log)
        type_str = "WARNINGS" if warn is True else "ERROR"
        return "%s: %s" % (type_str, log)
      return ""
function_tokens: def _get_warn_or_error_log ( self , last_query_handle , warn ) : if last_query_handle is None : return "Query could not be executed" req = TGetLogReq ( last_query_handle ) def GetLog ( ) : return self . imp_service . GetLog ( req ) # GetLog rpc is idempotent and so safe to retry. resp = self . _do_hs2_rpc ( GetLog , retry_on_error = True ) self . _check_hs2_rpc_status ( resp . status ) log = utf8_decode_if_needed ( resp . log ) # Strip progress message out of HS2 log. log = HS2_LOG_PROGRESS_REGEX . sub ( "" , log ) if log and log . strip ( ) : log = self . _append_retried_query_link ( log ) type_str = "WARNINGS" if warn is True else "ERROR" return "%s: %s" % ( type_str , log ) return ""