<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def sign(self, data: bytes, v: int = 27) -> Signature: """ Sign data hash with local private key """

        assert v in (0, 27), 'Raiden is only signing messages with v in (0, 27)'
        _hash = eth_sign_sha3(data)
        signature = self.private_key.sign_msg_hash(message_hash=_hash)
        sig_bytes = signature.to_bytes()
        # adjust last byte to v
        return sig_bytes[:-1] + bytes([sig_bytes[-1] + v])