setup response if correlation id is the good one
167879
def on_response(self, msg):
        
        LOGGER.debug("natsd.Requester.on_response: " + str(sys.getsizeof(msg)) + " bytes received")
        working_response = json.loads(msg.data.decode())
        working_properties = DriverTools.json2properties(working_response['properties'])
        working_body = b''+bytes(working_response['body'], 'utf8') if 'body' in working_response else None
        if DriverTools.MSG_CORRELATION_ID in working_properties:
            if self.corr_id == working_properties[DriverTools.MSG_CORRELATION_ID]:
                if DriverTools.MSG_SPLIT_COUNT in working_properties and \
                        int(working_properties[DriverTools.MSG_SPLIT_COUNT]) > 1:
                    working_body_decoded = base64.b64decode(working_body) if working_body is not None else None
                    if self.split_responses is None:
                        self.split_responses = []
                        self.split_responses_mid = working_properties[DriverTools.MSG_SPLIT_MID]
                    if working_properties[DriverTools.MSG_SPLIT_MID] == self.split_responses_mid:
                        response = {
                            'properties': working_properties,
                            'body': working_body_decoded
                        }
                        self.split_responses.insert(int(working_properties[DriverTools.MSG_SPLIT_OID]), response)

                        if self.split_responses.__len__() == int(working_properties[DriverTools.MSG_SPLIT_COUNT]):
                            properties = {}
                            body = b''
                            for num in range(0, self.split_responses.__len__()):
                                properties.update(self.split_responses[num]['properties'])
                                body += self.split_responses[num]['body']
                            self.response = {
                                'properties': properties,
                                'body': body
                            }
                            self.split_responses = None
                            self.split_responses_mid = None

                    else:
                        LOGGER.warn("natsd.Requester.on_response - discarded response : (" +
                                    str(working_properties[DriverTools.MSG_CORRELATION_ID]) + "," +
                                    str(working_properties[DriverTools.MSG_SPLIT_MID]) + ")")
                        LOGGER.debug("natsd.Requester.on_response - discarded response : " + str({
                            'properties': working_properties,
                            'body': working_body_decoded
                        }))
                else:
                    working_body_decoded = base64.b64decode(working_body) if working_body is not None else \
                        bytes(json.dumps({}), 'utf8')
                    self.response = {
                        'properties': working_properties,
                        'body': working_body_decoded
                    }
            else:
                working_body_decoded = base64.b64decode(working_body) if working_body is not None else None
                LOGGER.warn("natsd.Requester.on_response - discarded response : " +
                            str(working_properties[DriverTools.MSG_CORRELATION_ID]))
                LOGGER.debug("natsd.Requester.on_response - discarded response : " + str({
                    'properties': working_properties,
                    'body': working_body_decoded
                }))
        else:
            working_body_decoded = base64.b64decode(working_body) if working_body is not None else None
            LOGGER.warn("natsd.Requester.on_response - discarded response (no correlation ID)")
            LOGGER.debug("natsd.Requester.on_response - discarded response : " + str({
                'properties': working_properties,
                'body': working_body_decoded
            }))
390598
def item_id(response):
    
    dict_keys = ['item_0', 'item_1', 'item_2',
                 'item_3', 'item_4', 'item_5']
    new_keys = ['item_0_name', 'item_1_name', 'item_2_name',
                'item_3_name', 'item_4_name', 'item_5_name']

    for player in response['players']:
        for key, new_key in zip(dict_keys, new_keys):
            for item in items['items']:
                if item['id'] == player[key]:
                    player[new_key] = item['localized_name']

    return response
1189078
def identify_id(id: str) -> bool:
    
    return re.match(r'^https?://', id, flags=re.IGNORECASE) is not None
378919
def check_id(self):
        
        if self.response_id != self.command.get_command_id():
            raise Exception(
                "Error decoding response : the response id {} doesn't match the command id {}".format(self.response_id,
                                                                                                      self.command.get_command_id()))
268173
protected boolean isCorrelated(CorrelationIdentifier cid) {
        for (CorrelationIdentifier id : correlationIds) {
            if (id.equals(cid)) {
                return true;
            }
        }
        return false;
    }
1290918
protected function _ensureRespondentOrgData()
    {
        if (! isset($this->_gemsData['gr2o_id_user'], $this->_gemsData['gco_code'])) {
            $sql = "SELECT *
                FROM gems__respondents INNER JOIN
                    gems__respondent2org ON grs_id_user = gr2o_id_user INNER JOIN
                    gems__consents ON gr2o_consent = gco_description
                WHERE gr2o_id_user = ? AND gr2o_id_organization = ? LIMIT 1";

            $respId = $this->_gemsData['gap_id_user'];
            $orgId  = $this->_gemsData['gap_id_organization'];
            // \MUtil_Echo::track($this->_gemsData);

            if ($row = $this->db->fetchRow($sql, array($respId, $orgId))) {
                $this->_gemsData = $this->_gemsData + $row;
            } else {
                $appId = $this->_appointmentId;
                throw new \Gems_Exception("Respondent data missing for appointment id $appId.");
            }
        }
    }
83717
public final String getCorrelationId() {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "getCorrelationId");

        String value = null;
        int choice = getApi().getChoiceField(JsApiAccess.CORRELATIONID);

        /* If it is stored as a String, just extract it */
        if (choice == JsApiAccess.IS_CORRELATIONID_STRINGVALUE) {
            value = (String) getApi().getField(JsApiAccess.CORRELATIONID_STRINGVALUE);
        }

        /* If it is stored as a binary, we have to convert it */
        else if (choice == JsApiAccess.IS_CORRELATIONID_BINARYVALUE) {
            byte[] binValue = (byte[]) getApi().getField(JsApiAccess.CORRELATIONID_BINARYVALUE);

            if (binValue != null) {
                /* It'll be more economical to get the length right immediately */
                StringBuffer sbuf = new StringBuffer((binValue.length * 2) + 3);

                /* Insert the ID: then add on the binary value as a hex string */
                sbuf.append(ID_STRING);
                HexString.binToHex(binValue, 0, binValue.length, sbuf);

                /* Return the String representation */
                value = sbuf.toString();
            }

        }

        /* If the choice was 'Empty' do nothing as value is already null. */

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "getCorrelationId", value);

        return value;
    }
150796
function _check(err, id) {
        updateProgress(1);
        if (err) {
            alert('Failed to load ' + id + ': ' + err);
        }
        loadc++;
        if (itemc == loadc) callback();
    }
1149988
private void addCorrelationIDToQueueReservedAttributes(Map<String, MessageAttributeValue> messageAttributes,
                                                   SQSMessage message) throws JMSException {

        String correlationID = message.getJMSCorrelationID();
        if (correlationID != null) {
            addStringAttribute(messageAttributes, SQSMessage.JMS_SQS_CORRELATION_ID, correlationID);
        }
    }
786358
def checkResponse(self, ps, action):
        ''' 
        
        '''
        namespaceURI = self.wsAddressURI
        d = {namespaceURI:("MessageID","Action","To","From","RelatesTo")}
        typecodes = self._getWSAddressTypeCodes(**d)
        pyobjs = ps.ParseHeaderElements(typecodes)

        got_action = pyobjs.get((namespaceURI,"Action"))
        self._checkAction(action, got_action)

        From = pyobjs.get((namespaceURI,"From"))
        self._checkFrom(From)

        RelatesTo = pyobjs.get((namespaceURI,"RelatesTo"))
        self._checkRelatesTo(RelatesTo)

        To = pyobjs.get((namespaceURI,"To"))
        if To: self._checkReplyTo(To)
820307
def register_or_check(klass, finish, mean, between, refresh_presision, configuration):
		""""""
		m, created = klass.objects.get_or_create(finish=finish, configuration=configuration)
		if created:
			m.mean=mean
			m.between=between
			m.refresh_presision=refresh_presision
			m.save()
		else:
			diff = abs(float(m.mean) - mean)
			if not(diff < 0.006 and m.between == between and m.refresh_presision == refresh_presision):
				raise InvalidMeasurementError("There are diferents values for the same measurement.")
		return m
712456
public void setXctCorrelationID(String value) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setXctCorrelationID", value);

        if (value != null) {
            getHdr2().setField(JsHdr2Access.XCT_CORRELATION_ID_DATA, value);
        }
        else {
            getHdr2().setChoiceField(JsHdr2Access.XCT_CORRELATION_ID, JsHdr2Access.IS_XCT_CORRELATION_ID_EMPTY);
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setXctCorrelationID");
    }
892848
def sanity_check_insdcio(handle, id_marker, fake_id_line):
    """"""
    found_id = False
    found_end_marker = False
    for line in handle:
        line = line.strip()
        if not line:
            continue
        if line.startswith(id_marker):
            found_id = True
            break
        if line.startswith('//'):
            found_end_marker = True
            break

    handle.seek(0)
    # We found an ID, file looks good.
    if found_id:
        return handle

    # If there's no ID and no end marker, just give up.
    if not found_end_marker:
        return handle

    # If we found an end marker but no ID, fake one.
    new_handle = StringIO()
    new_handle.write("%s\n" % fake_id_line)
    new_handle.write(handle.read())
    new_handle.seek(0)
    return new_handle
628020
async def RelationById(self, relation_ids):
        '''
        
        '''
        # map input types to rpc msg
        _params = dict()
        msg = dict(type='Uniter',
                   request='RelationById',
                   version=5,
                   params=_params)
        _params['relation-ids'] = relation_ids
        reply = await self.rpc(msg)
        return reply
239538
def check(self):
        
        if self.fq_name:
            self['uuid'] = self._check_fq_name(self.fq_name)
        elif self.uuid:
            self['fq_name'] = self._check_uuid(self.uuid)
        return True
292970
@Override
    public void process(Request request, Response response)
    {
		if (!response.hasHeader(CORRELATION_ID))
		{
			response.addHeader(CORRELATION_ID, request.getHeader(CORRELATION_ID));
		}
    }
1115110
def handle_id_request(msg):
    """"""
    node_id = msg.gateway.add_sensor()
    return msg.copy(
        ack=0, sub_type=msg.gateway.const.Internal['I_ID_RESPONSE'],
        payload=node_id) if node_id is not None else None