Return a mapping of exit codes to status strings.

    Args:
        context (scriptworker.context.Context): the scriptworker context

    Returns:
        dict: the mapping of exit codes to status strings.
973799
def get_reversed_statuses(context):
    
    _rev = {v: k for k, v in STATUSES.items()}
    _rev.update(dict(context.config['reversed_statuses']))
    return _rev
881204
private void findErrorMessages(FacesContext context) {
        if (context.getMessageList().isEmpty() || context.isValidationFailed()) {
            return;
        }
        for (FacesMessage msg : context.getMessageList()) {
            if (msg.getSeverity().equals(FacesMessage.SEVERITY_ERROR) || msg.getSeverity().equals(FacesMessage.SEVERITY_FATAL)) {
                validationFailed(context);
                break;
            }
        }
    }
911150
def get_context_for_help_msgs(self, context_dict):
        
        context_dict = copy(context_dict)
        context_dict['wrapped_func'] = get_callable_name(context_dict['wrapped_func'])
        return context_dict
155887
def output(context, id):
    

    colors = {
        'pre-run': '\x1b[6;30;44m',
        'running': '\x1b[6;30;42m',
        'post-run': '\x1b[6;30;44m',
        'failure': '\x1b[6;30;41m'}
    result = job.list_jobstates(context, id=id, sort='created_at')
    jobstates = result.json()['jobstates']

    for js in jobstates:
        color = colors.get(js['status'], '')
        click.echo('%s[%s]\x1b[0m %s' % (
            color,
            js['status'],
            js['comment']))
        f_l = job.list_files(
            context,
            id=id,
            where='jobstate_id:' + js['id'],
            sort='created_at')
        for f in f_l.json()['files']:
            click.echo(dci_file.content(context, id=f['id']).text)
1368606
def context_lookup(self, vars):
        
        while isinstance(vars, IscmExpr):
            vars = vars.resolve(self.context)
        #
        for (k,v) in vars.items():
            if isinstance(v, IscmExpr):
                vars[k] = v.resolve(self.context)
        return vars
265510
def context(self, line):
        
        # XXX due to a limitation in Visitor,
        # non-python code after the last python code
        # in a file is not added to self.lines, so we
        # have to guard against IndexErrors.
        idx = line - 1
        if idx >= len(self.lines):
            return self.prefix
        return self.lines[idx]
1038616
def extract_status_code(error):
    
    try:
        return int(error.code)
    except (AttributeError, TypeError, ValueError):
        try:
            return int(error.status_code)
        except (AttributeError, TypeError, ValueError):
            try:
                return int(error.errno)
            except (AttributeError, TypeError, ValueError):
                return 500
521214
def get_context_data(self, **kwargs):
        
        context = super(BaseEntrySearch, self).get_context_data(**kwargs)
        context.update({'error': self.error, 'pattern': self.pattern})
        return context
1170651
def _update_exit_code_from_error(self, error):
        '''
        '''
        for error_type, exit_code in self.ERROR_CODE_MAP.items():
            if isinstance(error, error_type):
                self.update_exit_code(exit_code)
                break
        else:
            self.update_exit_code(ExitStatus.generic_error)
410726
def get_context():
    
    pid = os.getpid()
    if pid not in context:
        context[pid] = zmq.Context()
        logger.debug('renewed context for PID %d', pid)
    return context[pid]
1360933
def available(self, context):
	
		
		
		try:
			if self.__available is None:
				status_code, msg = self.__endpoint.get("")
				self.__available = status_code == 200
		except:
			self.__available = False
			
		return self.__available
657099
def cmd_status_codes_counter(self):
        
        status_codes = defaultdict(int)
        for line in self._valid_lines:
            status_codes[line.status_code] += 1
        return status_codes
465761
def get_register_context(self):
        
        logging.debug("GDB getting register context")
        resp = b''
        reg_num_list = [reg.reg_num for reg in self._register_list]
        vals = self._context.read_core_registers_raw(reg_num_list)
        #print("Vals: %s" % vals)
        for reg, regValue in zip(self._register_list, vals):
            if reg.bitsize == 64:
                resp += six.b(conversion.u64_to_hex16le(regValue))
            else:
                resp += six.b(conversion.u32_to_hex8le(regValue))
            logging.debug("GDB reg: %s = 0x%X", reg.name, regValue)

        return resp
1300875
def http_context(self, worker_ctx):
        
        http = {}
        if isinstance(worker_ctx.entrypoint, HttpRequestHandler):
            try:
                request = worker_ctx.args[0]
                try:
                    if request.mimetype == 'application/json':
                        data = request.data
                    else:
                        data = request.form
                except ClientDisconnected:
                    data = {}

                urlparts = urlsplit(request.url)
                http.update({
                    'url': '{}://{}{}'.format(
                        urlparts.scheme, urlparts.netloc, urlparts.path
                    ),
                    'query_string': urlparts.query,
                    'method': request.method,
                    'data': data,
                    'headers': dict(get_headers(request.environ)),
                    'env': dict(get_environ(request.environ)),
                })
            except:
                pass  # probably not a compatible entrypoint

        self.client.http_context(http)
1106697
def user_context(self, worker_ctx, exc_info):
        
        user = {}
        for key in worker_ctx.context_data:
            for matcher in self.user_type_context_keys:
                if re.search(matcher, key):
                    user[key] = worker_ctx.context_data[key]
                    break

        self.client.user_context(user)
436921
def context_complete(context_id):
    """"""
    logging.info('Context %s is.......... DONE.', context_id)

    from furious.context import get_current_async_with_context

    _, context = get_current_async_with_context()

    if not context:
        logging.error("Could not load context")
        return

    for task_id, result in context.result.items():
        logging.info("#########################")
        logging.info("Task Id: %s and Result: %s", task_id, result)

    return context_id
1256327
def context(src):
    
    try:
        yield
    except Exception:
        etype, err, tb = sys.exc_info()
        msg = 'An error occurred with source id=%s. Error: %s'
        msg %= (src.source_id, err)
        raise_(etype, msg, tb)