See Also: confirmMapIdentityResponse()

        Args:
          subject:
          vendorSpecific:

        Returns:
768880
def confirmMapIdentity(self, subject, vendorSpecific=None):
        
        response = self.confirmMapIdentityResponse(subject, vendorSpecific)
        return self._read_boolean_response(response)
454011
function (txReceipt, addressToNameMap) {
    const oThis = this;

    var decodedEvents = [];

    // txReceipt is mandatory, return error if not present
    if (!txReceipt) {
      return responseHelper.error({
        internal_error_identifier: 'tx_receipt_not_found',
        api_error_identifier: 'receipt_not_found',
        error_config: basicHelper.fetchErrorConfig()
      });
    }

    // Transaction failed
    if (txReceipt.status && parseInt(txReceipt.status, 16) !== 1) {
      logger.error("Transaction failed as status is ", txReceipt);
      return responseHelper.error({
        internal_error_identifier: 'tx_receipt_status_failed',
        api_error_identifier: 'transaction_receipt_failed',
        error_config: basicHelper.fetchErrorConfig()
      });
    }

    // if block not mined, return error
    if (!txReceipt.blockNumber) {
      return responseHelper.error({
        internal_error_identifier: 'l_w_ld_1',
        api_error_identifier: 'receipt_not_found',
        error_config: basicHelper.fetchErrorConfig()
      });
    }

    var toAddr = txReceipt.to
      , contractName = oThis.getContractNameFor(toAddr, addressToNameMap);

    // if the address is a known address
    if (contractName && txReceipt.logs.length > 0) {
      var abiDecoder = require('abi-decoder')
        , relevantLogs = [];

      for (var i = 0; i < txReceipt.logs.length; i++) {
        const currContractName = oThis.getContractNameFor(txReceipt.logs[i].address, addressToNameMap)
          , currContractABI = coreAddresses.getAbiForContract(currContractName);

        // if contract name is null, continue to next log element.
        if (!currContractName) {
          continue;
        }

        // ABI not found for a contract for which name was recognized, hence error
        if (!currContractABI) {
          return responseHelper.error({
            internal_error_identifier: 'l_w_ld_2',
            api_error_identifier: 'abi_not_found_for_contract',
            error_config: basicHelper.fetchErrorConfig()
          });
        }

        // push the log element to relevant log array
        relevantLogs.push(txReceipt.logs[i]);
        abiDecoder.addABI(currContractABI);
      }

      if (relevantLogs.length > 0) {
        decodedEvents = abiDecoder.decodeLogs(relevantLogs);
      }
    }

    return responseHelper.successWithData({
      rawTransactionReceipt: txReceipt,
      formattedTransactionReceipt: {
        transactionHash: txReceipt.transactionHash,
        blockHash: txReceipt.blockHash,
        blockNumber: txReceipt.blockNumber,
        eventsData: decodedEvents,
        toAddress: toAddr,
        contractAddress: txReceipt.contractAddress || ''
      }
    });
  }
704467
@SuppressWarnings("unchecked")
    private <T extends IEntity> List<T> getResultEntities(List<IntuitMessage> intuitMessages) {
        List<T> resultEntities = new ArrayList<T>();
        int i = 0;
        for(IntuitMessage intuitMessage : intuitMessages) {
            if(!isContainResponse(intuitMessage, i)) {
                LOG.warn("Response object with index="+i+" was expected, got nothing.");
            } else {
                resultEntities.add((T) getReturnEntity(intuitMessage, i));
            }
            i++;
        }

        return resultEntities;
    }
388496
def _clean_tx(response_dict):
    '''  '''
    confirmed_txrefs = []
    for confirmed_txref in response_dict.get('txrefs', []):
        confirmed_txref['confirmed'] = parser.parse(confirmed_txref['confirmed'])
        confirmed_txrefs.append(confirmed_txref)
    response_dict['txrefs'] = confirmed_txrefs

    unconfirmed_txrefs = []
    for unconfirmed_txref in response_dict.get('unconfirmed_txrefs', []):
        unconfirmed_txref['received'] = parser.parse(unconfirmed_txref['received'])
        unconfirmed_txrefs.append(unconfirmed_txref)
    response_dict['unconfirmed_txrefs'] = unconfirmed_txrefs

    return response_dict
49296
def _hm_verify_message_crc_uk(
            self,
            thermostat_id,
            protocol,
            source,
            expectedFunction,
            expectedLength,
            datal
    ):
        """"""
        # expectedLength only used for read msgs as always 7 for write
        badresponse = 0
        if protocol == constants.HMV3_ID:
            checksum = datal[len(datal) - 2:]
            rxmsg = datal[:len(datal) - 2]
            crc = CRC16()   # Initialises the CRC
            expectedchecksum = crc.run(rxmsg)
            if expectedchecksum == checksum:
                logging.info("CRC is correct")
            else:
                logging.error("CRC is INCORRECT")
                serror = "Incorrect CRC"
                sys.stderr.write(serror)
                badresponse += 1
            dest_addr = datal[0]
            frame_len_l = datal[1]
            frame_len_h = datal[2]
            frame_len = (frame_len_h << 8) | frame_len_l
            source_addr = datal[3]
            func_code = datal[4]

            if (dest_addr != 129 and dest_addr != 160):
                logging.info("dest_addr is ILLEGAL")
                serror = "Illegal Dest Addr: %s\n" % (dest_addr)
                sys.stderr.write(serror)
                badresponse += 1

            if dest_addr != thermostat_id:
                logging.info("dest_addr is INCORRECT")
                serror = "Incorrect Dest Addr: %s\n" % (dest_addr)
                sys.stderr.write(serror)
                badresponse += 1

            if (source_addr < 1 or source_addr > 32):
                logging.info("source_addr is ILLEGAL")
                serror = "Illegal Src Addr: %s\n" % (source_addr)
                sys.stderr.write(serror)
                badresponse += 1

            if source_addr != source:
                logging.info("source addr is INCORRECT")
                serror = "Incorrect Src Addr: %s\n" % (source_addr)
                sys.stderr.write(serror)
                badresponse += 1

            if (
                func_code != constants.FUNC_WRITE
                and func_code != constants.FUNC_READ
            ):
                logging.info("Func Code is UNKNWON")
                serror = "Unknown Func Code: %s\n" % (func_code)
                sys.stderr.write(serror)
                badresponse += 1

            if func_code != expectedFunction:
                logging.info("Func Code is UNEXPECTED")
                serror = "Unexpected Func Code: %s\n" % (func_code)
                sys.stderr.write(serror)
                badresponse += 1

            if (
                    func_code == constants.FUNC_WRITE and frame_len != 7
            ):
                # Reply to Write is always 7 long
                logging.info("response length is INCORRECT")
                serror = "Incorrect length: %s\n" % (frame_len)
                sys.stderr.write(serror)
                badresponse += 1

            if len(datal) != frame_len:
                logging.info("response length MISMATCHES header")
                serror = "Mismatch length: %s %s\n" % (len(datal), frame_len)
                sys.stderr.write(serror)
                badresponse += 1

            # if (func_code == constants.FUNC_READ and
            #   expectedLength !=len(datal) ):
            #   # Read response length is wrong
            #   logging.info("response length
            #    not EXPECTED value")
            #   logging.info("Got %s when expecting %s",
            #   len(datal), expectedLength)
            #   logging.info("Data is:\n %s", datal)
            #   s = "Incorrect length: %s\n" % (frame_len)
            #   sys.stderr.write(s)
            #   badresponse += 1

            if (badresponse == 0):
                return True
            else:
                return False

        else:
            assert 0, "Un-supported protocol found %s" % protocol
249669
def recvSecurityResult(self, data):
        
        result = UInt32Be()
        data.readType(result)
        if result == UInt32Be(1):
            log.info("Authentification failed")
            if self._version.value == ProtocolVersion.RFB003008:
                self.expectWithHeader(4, self.recvSecurityFailed)
        else:
            log.debug("Authentification OK")
            self.sendClientInit()
992601
def listNodes(self, vendorSpecific=None):
        
        response = self.listNodesResponse(vendorSpecific)
        return self._read_dataone_type_response(response, 'NodeList')
114502
def _isNewTxn(self, identifier, reply, txnId) -> bool:
        
        return (identifier not in self.processedRequests or
                reply.reqId not in self.processedRequests[identifier]) and \
            txnId is not None
1305933
def hasReservation(self, pid, subject, vendorSpecific=None):
        
        response = self.hasReservationResponse(pid, subject, vendorSpecific)
        return self._read_boolean_404_response(response)
1248008
def verify(verified_entity, verification_key):
        
        verification = get_object_or_none(Verification, verified_entity=verified_entity)

        if verification is None:
            raise ServerError(VerificationHandler.STATUS_VERIFICATION_NOT_FOUND)
        if not verification.verify(verification_key):
            raise ServerError(VerificationHandler.STATUS_INVALID_VERIFICATION_KEY)

        verification.verified = True
        verification.save()
71471
def verify_recipient(self, recipient):
        
        if not self.conv_info:
            return True

        _info = self.conv_info

        try:
            if recipient == _info['entity_id']:
                return True
        except KeyError:
            pass

        try:
            if recipient in self.return_addrs:
                return True
        except KeyError:
            pass

        return False
670704
def getSubjectInfo(self, subject, vendorSpecific=None):
        
        response = self.getSubjectInfoResponse(subject, vendorSpecific)
        return self._read_dataone_type_response(response, 'SubjectInfo')
1079980
def createGroup(self, group, vendorSpecific=None):
        
        response = self.createGroupResponse(group, vendorSpecific)
        return self._read_boolean_response(response)
947930
def verify(self, **kwargs):
        
        super(RegistrationResponse, self).verify(**kwargs)

        has_reg_uri = "registration_client_uri" in self
        has_reg_at = "registration_access_token" in self
        if has_reg_uri != has_reg_at:
            raise VerificationError((
                "Only one of registration_client_uri"
                " and registration_access_token present"), self)

        return True
288781
def _response_matches_request(self, response):
        
        # Accept success/failure command responses
        if super(DiagnosticResponseReceiver,
                self)._response_matches_request(response):
            return True

        if ('bus' in self.diagnostic_request and
                response.get('bus', None) != self.diagnostic_request['bus']):
            return False
        if (self.diagnostic_request['id'] != 0x7df and
                response.get('id', None) != self.diagnostic_request['id']):
            return False

        if (response.get('success', True) and
                response.get('pid', None) !=
                    self.diagnostic_request.get('pid', None)):
            return False

        return response.get('mode', None) == self.diagnostic_request['mode']
1086392
def getConsumedCredits(self):
        

        if 'status' in self._response.keys():
            if (self._response['status'] is not None) and ('credits' in self._response['status'].keys()):
                if self._response['status']['credits'] is not None:
                    return self._response['status']['credits']
                else:
                    return '0'
            else:
                print("Not credits field\n")
        else:
            return None
1140929
def validate_v2_svc_catalog_endpoint_data(self, expected, actual):
        
        self.log.debug('Validating service catalog endpoint data...')
        self.log.debug('actual: {}'.format(repr(actual)))
        for k, v in six.iteritems(expected):
            if k in actual:
                ret = self._validate_dict_data(expected[k][0], actual[k][0])
                if ret:
                    return self.endpoint_error(k, ret)
            else:
                return "endpoint {} does not exist".format(k)
        return ret