True if both transfers are for the same mediated transfer.

def is_send_transfer_almost_equal(
        send_channel: NettingChannelState,
        send: LockedTransferUnsignedState,
        received: LockedTransferSignedState,
) -> bool:
    """ True if both transfers are for the same mediated transfer. """
    # The only thing that may change is the direction of the transfer
    return (
        isinstance(send, LockedTransferUnsignedState) and
        isinstance(received, LockedTransferSignedState) and
        send.payment_identifier == received.payment_identifier and
        send.token == received.token and
        send.lock.amount == received.lock.amount - send_channel.mediation_fee and
        send.lock.expiration == received.lock.expiration and
        send.lock.secrethash == received.lock.secrethash and
        send.initiator == received.initiator and
        send.target == received.target
    )