<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _parse_to_recoverable_signature(sig):
 """ Returns a parsed recoverable signature of length 65 bytes """

    # Buffer for getting values of signature object
    assert isinstance(sig, bytes)
    assert len(sig) == 65

    # Make a recoverable signature of 65 bytes
    rec_sig = ffi.new("secp256k1_ecdsa_recoverable_signature *")
    # Retrieving the recid from the last byte of the signed key
    recid = ord(sig[64:65])

    # Parse a revoverable signature
    parsable_sig = lib.secp256k1_ecdsa_recoverable_signature_parse_compact(
        ctx,
        rec_sig,
        sig,
        recid
    )
    # Verify that the signature is parsable
    if not parsable_sig:
        raise InvalidSignatureError()

    return rec_sig