:type response_code: int
        :type messages: list[str]
        :type response_id: str

        :rtype: str
514068
def _generate_message_error(cls, response_code, messages, response_id):
        

        line_response_code = cls._FORMAT_RESPONSE_CODE_LINE \
            .format(response_code)
        line_response_id = cls._FORMAT_RESPONSE_ID_LINE.format(response_id)
        line_error_message = cls._FORMAT_ERROR_MESSAGE_LINE.format(
            cls._GLUE_ERROR_MESSAGE_STRING_EMPTY.join(messages)
        )

        return cls._glue_all_error_message(
            [line_response_code, line_response_id, line_error_message]
        )
1347904
def decode_response(client_message, to_object=None):
    
    parameters = dict(response=None)
    parameters['response'] = client_message.read_str()
    return parameters
105830
def response_class(self, cls):
        
        s = self._clone()
        s._response_class = cls
        return s
1115093
def response_message(cls, result, request_id):
        ''''''
        if isinstance(result, CodeMessageError):
            payload = cls.error_payload(result, request_id)
        else:
            payload = cls.response_payload(result, request_id)
        return cls.encode_payload(payload)
629698
def do_response(self, response_args=None, request=None, **kwargs):
        

        links = [Link(href=h, rel=OIC_ISSUER) for h in kwargs['hrefs']]

        _response = JRD(subject=kwargs['subject'], links=links)

        info = {
            'response': _response.to_json(),
            'http_headers': [('Content-type', 'application/json')]
        }

        return info
362997
def getErrorResponse(self, errorCode, errorDescr):
		
		self.errorCode = errorCode
		self.errorDescr = errorDescr
		self.response = "yes"
		return self
923784
def get_response(_code):
    
    if _code:
        code = str(_code)
        return code[:-2] + str(int(code[-2:-1]) + 1) + code[-1]
    else:
        return None
14692
def build_response(cls, code=Status.SYSTEM_ERROR, errors=None):
        
        errors = [errors] if not isinstance(errors, list) else errors
        return cls(code, errors)
1055796
def get_message_id(message):
    """"""
    if message is None:
        return None

    if isinstance(message, int):
        return message

    try:
        if message.SUBCLASS_OF_ID == 0x790009e3:
            # hex(crc32(b'Message')) = 0x790009e3
            return message.id
    except AttributeError:
        pass

    raise TypeError('Invalid message type: {}'.format(type(message)))
1121628
def check_status_code(response, codes=None):
    
    codes = codes or [httplib.OK]
    checker = (
        codes
        if callable(codes)
        else lambda resp: resp.status_code in codes
    )
    if not checker(response):
        raise exceptions.ApiError(response, response.json())
978777
def rpc_error(id: Union[str, int], error_msg: str,
              warnings: List[Any] = []) -> rpcq.messages.RPCError:
    
    return rpcq.messages.RPCError(
        jsonrpc='2.0',
        id=id,
        error=error_msg,
        warnings=[rpc_warning(warning) for warning in warnings])
51874
def __response_url(self, message_id):
        
        if self.from_.pid != 0:
            path = AGENT_RESPONSE_PATH % (self.from_.pid, message_id)

        return "http://%s:%s/%s" % (self.host, self.port, path)
1073408
def check_status_code(response, codes=None):
    
    codes = codes or [200]
    if response.status_code not in codes:
        raise StatusCodeError(response.status_code)
189580
def to_array(self):
        
        array = super(ResponseParameters, self).to_array()
        if self.migrate_to_chat_id is not None:
            array['migrate_to_chat_id'] = int(self.migrate_to_chat_id)  # type int
        if self.retry_after is not None:
            array['retry_after'] = int(self.retry_after)  # type int
        return array
557681
def get_message_id(self):
        """"""
        message_id = self.json_response.get("messageId", None)
        self.logger.info("%s\t%s" % (self.request_method, self.request_url))
        return message_id
1215715
def _process_for_id(cls, response_raw):
        

        json = response_raw.body_bytes.decode()
        obj = converter.json_to_class(dict, json)
        id_ = converter.deserialize(
            Id,
            cls._unwrap_response_single(obj, cls._FIELD_ID)
        )

        return client.BunqResponse(id_.id_, response_raw.headers)
1248749
def get_replies_to(self, msg):
        
        mid = msg.get_message_id()
        msg_hash = self.get_messages()
        for m in msg_hash.keys():
            if m.get_message_id() == mid:
                return msg_hash[m]
        return None