def select_card(cards, stats, i):
    card = cards[i]
    nearest = stats['dists']['cbow'][i]
    perp = stats['ngram']['perp'][i]
    perp_per = stats['ngram']['perp_per'][i]
    perp_max = stats['ngram']['perp_max'][i]

    if nearest > 0.9 or perp_per > 2.0 or perp_max > 10.0:
        return None
        
    ((_, total_good, _, _), _) = mtg_validate.process_props([card])
    if not total_good == 1:
        return False

    # print '===='
    # print nearest
    # print perp
    # print perp_per
    # print perp_max
    # print '----'
    # print card.format()

    return True
dataset/ETHPy150Open billzorn/mtgencode/scripts/pairing.py/select_card/original