def create_function_from_response_pdu(resp_pdu, req_pdu=None):
function_code = pdu_to_function_code_or_raise_error(resp_pdu)<EOL>function = function_code_to_function_map[function_code]<EOL>if req_pdu is not None and'<STR_LIT>' in inspect.getargspec(function.create_from_response_pdu).args:  <EOL><INDENT>return function.create_from_response_pdu(resp_pdu, req_pdu)<EOL><DEDENT>return function.create_from_response_pdu(resp_pdu)<EOL>
Parse response PDU and return instance of :class:`ModbusFunction` or
    raise error.

    :param resp_pdu: PDU of response.
    :param  req_pdu: Request PDU, some functions require more info than in
        response PDU in order to create instance. Default is None.
    :return: Number or list with response data.