Parses returned messages and checks submit outcome.
323094
def _check_outcome(self, jobs):
        """"""
        if self.skip:
            return False

        if not jobs:
            logger.error("Import failed!")
            return False

        failed_jobs = []
        for job in jobs:
            status = job.get("status")
            if not status:
                failed_jobs.append(job)
                continue

            if status.lower() != "success":
                failed_jobs.append(job)

        for job in failed_jobs:
            logger.error("job: %s; status: %s", job.get("id"), job.get("status"))
        if len(failed_jobs) == len(jobs):
            logger.error("Import failed!")
        elif failed_jobs:
            logger.error("Some import jobs failed!")
        else:
            logger.info("Results successfully updated!")

        return not failed_jobs
1370234
def action_parse_results(result):
    
    passed = True
    for test, result in result.items():
        if result['success']:
            hookenv.action_set({test: 'PASS'})
        else:
            hookenv.action_set({test: 'FAIL - {}'.format(result['message'])})
            passed = False
    if not passed:
        hookenv.action_fail("One or more tests failed")
    return 0 if passed else 1
1070456
def callback(self, result, message):
        
        self.results.put(result)
        message.ack()
963211
def _result_handler(self, response: Dict[str, Any]):
        
        res = response.get("MESSAGE")
        result = res.get("RESULT")
        return result
1074184
public void parseResponse(String results) {

        cancelUpdateProgress();
        stopLoadingAnimation();

        if ((!m_canceled) && CmsStringUtil.isNotEmptyOrWhitespaceOnly(results)) {
            JSONObject jsonObject = JSONParser.parseStrict(results).isObject();
            boolean success = jsonObject.get(I_CmsUploadConstants.KEY_SUCCESS).isBoolean().booleanValue();
            // If the upload is done so fast that we did not receive any progress information, then
            // the content length is unknown. For that reason take the request size to show how
            // much bytes were uploaded.
            double size = jsonObject.get(I_CmsUploadConstants.KEY_REQUEST_SIZE).isNumber().doubleValue();
            long requestSize = new Double(size).longValue();
            if (m_contentLength == 0) {
                m_contentLength = requestSize;
            }
            if (success) {
                m_uploadedFiles = new ArrayList<String>();
                List<String> uploadedFileIds = new ArrayList<String>();
                displayDialogInfo(
                    org.opencms.gwt.client.Messages.get().key(
                        org.opencms.gwt.client.Messages.GUI_UPLOAD_INFO_FINISHING_0),
                    false);
                JSONValue uploadedFilesVal = jsonObject.get(I_CmsUploadConstants.KEY_UPLOADED_FILE_NAMES);
                JSONValue uploadHook = jsonObject.get(I_CmsUploadConstants.KEY_UPLOAD_HOOK);
                String hookUri = null;
                if ((uploadHook != null) && (uploadHook.isString() != null)) {
                    hookUri = uploadHook.isString().stringValue();
                    JSONValue uploadedFileIdsVal = jsonObject.get(I_CmsUploadConstants.KEY_UPLOADED_FILES);
                    JSONArray uploadedFileIdsArray = uploadedFileIdsVal.isArray();
                    if (uploadedFileIdsArray != null) {
                        for (int i = 0; i < uploadedFileIdsArray.size(); i++) {
                            JSONString entry = uploadedFileIdsArray.get(i).isString();
                            if (entry != null) {
                                uploadedFileIds.add(entry.stringValue());
                            }
                        }
                    }
                }
                JSONArray uploadedFilesArray = uploadedFilesVal.isArray();
                if (uploadedFilesArray != null) {
                    for (int i = 0; i < uploadedFilesArray.size(); i++) {
                        JSONString entry = uploadedFilesArray.get(i).isString();
                        if (entry != null) {
                            m_uploadedFiles.add(entry.stringValue());
                        }
                    }
                }
                m_progressInfo.finish();
                final I_CmsUploadContext context = m_context;
                closeOnSuccess();
                if (hookUri != null) {
                    // Set the context to be null so that it isn't called when the upload dialog closed;
                    // we want it to be called when the upload property dialog is closed instead.<p>
                    m_context = null;
                    CloseHandler<PopupPanel> closeHandler;
                    closeHandler = new CloseHandler<PopupPanel>() {

                        public void onClose(CloseEvent<PopupPanel> event) {

                            if (context != null) {
                                context.onUploadFinished(m_uploadedFiles);
                            }
                        }
                    };

                    String title = Messages.get().key(Messages.GUI_UPLOAD_HOOK_DIALOG_TITLE_0);
                    CmsUploadHookDialog.openDialog(title, hookUri, uploadedFileIds, closeHandler);
                }
            } else {
                String message = jsonObject.get(I_CmsUploadConstants.KEY_MESSAGE).isString().stringValue();
                String stacktrace = jsonObject.get(I_CmsUploadConstants.KEY_STACKTRACE).isString().stringValue();
                showErrorReport(message, stacktrace);
            }
        }
    }
694592
function parse(msg) {
  let model;
  if (typeof msg === 'object') {
    // data is a MessageEvent not a raw string
    msg = msg.data;
  }

  if (msg.startsWith(PullMessage.TYPE)) {
    // pull
    return new PullMessage();
  }

  if (msg.startsWith(RegisteredMessage.TYPE)) {
    // registered ack
    return new RegisteredMessage();
  }

  if (msg.startsWith(PushMessage.TYPE + '/')) {
    // push/modelStr
    model = msg.substring(PushMessage.TYPE.length + 1);
    return new PushMessage(model);
  }

  if (msg.startsWith(PushKevSMessage.TYPE + '/')) {
    // push/kevsStr
    model = msg.substring(PushKevSMessage.TYPE.length + 1);
    return new PushKevSMessage(model);
  }

  if (msg.startsWith(RegisterMessage.TYPE)) {
    // register/nodeName/modelStr
    const payload = msg.substring(RegisterMessage.TYPE.length + 1);
    let index = 0;
    let ch = payload.charAt(index);
    while (index < payload.length && ch !== '/') {
      index++;
      ch = payload[index];
    }
    const nodeName = payload.substring(0, index);
    return new RegisterMessage(nodeName, payload.substring(index + 1));
  }

  return null;
}
610594
function parseResult(text, callback) {
  var errors = [], i = 0, l, errBlock, match, match2, lines;

  text = text.replace(/\r/g, '');
  lines = text.split('\n');

  match = skippingRegex.exec(lines[i]);
  if (match) {
    i++;
  }

  match = successRegex.exec(lines[i]);
  if (match) {
    callback(null, createParseSuccessObj(match));
    return;
  }

  for (l = lines.length; i < l; i++) {
    match = fileRegex.exec(lines[i]);
    if (match) {
      match2 = errorRegex.exec(lines[++i]);
      errBlock = createFailObj(match);
      for (var j = i; match2 && j < lines.length;) {
        errBlock.errors.push(createErrorObj(match2));
        match2 = errorRegex.exec(lines[++j]);
      }
      i = --j;
      errors.push(errBlock);
    } else {
      match = abstractRegex.exec(lines[i]);
      if (match) {
        callback(createErrorGJSLintFailed(match, errors));
        return;
      }
    }
  }
  callback(createParseErrorUnknown(lines));

}
465069
def parse(response):
        """"""
        if response.status_code == 400:
            try:
                msg = json.loads(response.content)['message']
            except (KeyError, ValueError):
                msg = ''
            raise ApiError(msg)
        return response
666706
def validate_result(self, (result_array, result_keywords, )):
        '''
        
        '''
        if len(result_array) != 1 or len(result_keywords) > 0:
            raise BadSyntax('Syntax error processing line: %s' %\
                            self._last_line)
        return result_array[0]
1197669
def result(self, res):
        ''''''
        return self >> Parser(lambda _, index: Value.success(index, res))
618824
public function getResultMessage() {
    // We're only handling the results that our code actually generates.
    switch ($this->result_code) {
      case self::RES_SUCCESS:
        return "SUCCESS";
      case self::RES_FAILURE:
        return "FAILURE";
      case self::RES_NOTSTORED:
        return "NOT STORED";
      case self::RES_NOTFOUND:
        return "NOT FOUND";
    }
    return "UNKNOWN";
  }
335189
def _ValidateReturnValue(return_value, type_check_dict):
  """"""
  return_check = type_check_dict.get("returns", None)
  if not return_check:
    return []

  messages = []
  if not _ValidateValue(return_value, return_check):
    message = ("Invalid return value '%s'. Expected %s" %
               (return_value, _FormatTypeCheck(return_check)))
    messages.append(message)
  return messages
622387
def check_error(result):
    
    return (result.value != ReturnCode.SUCCESSFUL) and (result.value < ReturnCode.WARNING)
1313000
def post_parse(self):
        """"""
        if self.cache and not self.cache_loaded:
            self.cache_writer_cls(self.file_name, self.wavefront).write()
156698
function handleResults(results) {
    ctrl.matches = results;
    ctrl.hidden  = shouldHide();

    // If loading is in progress, then we'll end the progress. This is needed for example,
    // when the `clear` button was clicked, because there we always show the loading process, to prevent flashing.
    if (ctrl.loading) setLoading(false);

    if ($scope.selectOnMatch) selectItemOnMatch();

    positionDropdown();
    reportMessages(true, ReportType.Count);
  }
291335
function parse(msg) {
	var pMsg;
  if (typeof msg === 'object') {
    // data is a MessageEvent not a raw string
    pMsg = msg.data;
  } else {
		pMsg = msg;
	}

  var model;
  if (startsWith(pMsg, REGISTER)) {
    var payload = pMsg.substring(REGISTER.length + SEP.length);
    var i = 0;
    var ch = payload.charAt(i);
    var buffer = '';
    while (i < payload.length && ch !== '/') {
      i++;
      buffer += ch;
      ch = payload.charAt(i);
    }

    if (ch !== '/') {
      buffer += ch;
    } else {
      i++;
    }
    model = null;
    if (i < payload.length) {
      model = payload.substring(i, payload.length);
    }
    return new RegisterMessage(buffer, model);
  }

  if (startsWith(pMsg, PUSH + SEP)) {
    model = pMsg.substring(PUSH.length + SEP.length);
    return new PushMessage(model);
  }

  if (startsWith(pMsg, KEVS + SEP)) {
    model = pMsg.substring(KEVS.length + SEP.length);
    return new PushKevSMessage(model);
  }

  if (startsWith(pMsg, PULL)) {
    return new PullMessage();
  }

  /* retro compat */
  if (startsWith(pMsg, 'get')) {
    return new PullMessage();
  }

  return null;
}
1182629
function getResult(matcherName, pass, ...messageWithPlaceholderValues) {
  const formattedMessage = format.apply(this, messageWithPlaceholderValues);
  messages[matcherName] = formattedMessage; // Save {not} message for later use
  return {
    pass,
    message: formattedMessage.replace(' {not}', pass ? ' not' : '')
  };
}