<commit_before>from convenience_hole import all_hands_in_range
from convenience import pr
from deuces.deuces import Card, Evaluator

e = Evaluator()

board = [Card.new('Qs'), Card.new('Jd'), Card.new('2c')]
range_list = ['AA', 'KK', 'QQ', 'AK', 'AKs']


## tricky ones highlighted:
##  1   2    3    4       5        6     7          8             9
## sf quad boat flush straight trip set 2p overp tp 1.5p mp wp ah nmh
##                             ^^^^^^^^    ^^^^^^^^^^^^^^^^^^^ ^^^^^^

print "Range:", range_list
print "Board:",
pr(board)
hr_list = [0] * 10
lol = all_hands_in_range(range_list)
for L in lol:
    hr = e.evaluate(L, board)
    rc = e.get_rank_class(hr)
    hr_list[rc] += 1


print('\nResults\n========')
print hr_list
for i in range(1,10):
    print e.class_to_string(i), hr_list[i]<commit_msg>Print percentages. Sensible alignment.<commit_after>from convenience_hole import all_hands_in_range
from convenience import pr
from deuces.deuces import Card, Evaluator

e = Evaluator()

board = [Card.new('Qs'), Card.new('Jd'), Card.new('2c')]
range_list = ['AA', 'KK', 'QQ', 'AK', 'AKs']


## tricky ones highlighted:
##  1   2    3    4       5        6     7          8             9
## sf quad boat flush straight trip set 2p overp tp 1.5p mp wp ah nmh
##                             ^^^^^^^^    ^^^^^^^^^^^^^^^^^^^ ^^^^^^

print "Range:", range_list
print "Board:",
pr(board)
rc_counts = [0] * 10
lol = all_hands_in_range(range_list)
for L in lol:
    hr = e.evaluate(L, board)
    rc = e.get_rank_class(hr)
    rc_counts[rc] += 1

def pad_to(n, s):
    while len(s) < n:
        s += ' '
    return s

print('\nResults\n========')
denom = float(sum(rc_counts))
for i in range(1,10):
    n = rc_counts[i]
    rc_str = pad_to(15, e.class_to_string(i))
    print rc_str, n, '\t', round(n / denom * 100, 2)
{'fraction_non_alphanumeric': 0.17543859649122806, 'fraction_numerical': 0.025219298245614034, 'mean_word_length': 2.8020833333333335, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '725134', 'n_tokens_mistral': 706, 'n_tokens_neox': 672, 'n_words': 189}