A transaction of type X must be in the block at position Y. The
    first argument is interpreted as the name of a transaction family.
    The second argument must be interpretable as an integer and defines
    the index of the transaction in the block that must be checked.
    Negative numbers can be used and count backwards from the last
    transaction in the block. The first transaction in the block has
    index 0. The last transaction in the block has index -1. If abs(Y)
    is larger than the number of transactions per block, then there
    would not be a transaction of type X at Y and the block would be
    invalid. For example, the string "XatY:intkey,0" means the first
    transaction in the block must be an intkey transaction.

def _do_xaty(transactions, arguments):
    """
    A transaction of type X must be in the block at position Y. The
    first argument is interpreted as the name of a transaction family.
    The second argument must be interpretable as an integer and defines
    the index of the transaction in the block that must be checked.
    Negative numbers can be used and count backwards from the last
    transaction in the block. The first transaction in the block has
    index 0. The last transaction in the block has index -1. If abs(Y)
    is larger than the number of transactions per block, then there
    would not be a transaction of type X at Y and the block would be
    invalid. For example, the string "XatY:intkey,0" means the first
    transaction in the block must be an intkey transaction.
    """
    try:
        family, num = arguments.split(',')
        position = int(num.strip())
    except ValueError:
        LOGGER.warning("Ignore, XatY requires arguments in the format "
                       "family,position not %s", arguments)
        return True

    family = family.strip()
    if abs(position) >= len(transactions):
        LOGGER.debug("Block does not have enough transactions to "
                     "validate this rule XatY:%s", arguments)
        return False
    txn = transactions[position]

    header = TransactionHeader()
    header.ParseFromString(txn.header)
    if header.family_name != family:
        LOGGER.debug("Transaction at postion %s is not of type %s",
                     position, family)
        return False
    return True