def transaction_filter(transaction, txn_filter):
  """
  Using the given dictionary of transaction-filtering rules,
  decide whether any of them apply to the given transaction.
  """
  if 'asof' in txn_filter and transaction.date.date() < txn_filter['asof']:
    return False
  return True