<jupyter_start><jupyter_text>Blackboard<jupyter_code>import numpy as np
from collections import defaultdict, Counter
import matplotlib.pyplot as plt
class Deck(object):
    
    def __init__(self, numbers, seeds):
        self.n, self.s = numbers, seeds
        self.shuffle()
        self.counter = defaultdict(lambda: 0)
                
    def shuffle(self):
        self.deck = []
        for num in self.n:
            for seed in self.s:
                self.deck.append((num, seed))
    
    def serve(self, cards=5, reinsert=True):
        hand = [self.deck[x] for x in 
            np.random.choice(range(len(self.deck)), 
                             cards, replace=False)]
        if not reinsert:
            self.deck = [x for x in self.deck if x not in hand]
        return hand
    
    def run_test(self, iterations):
        for i in range(iterations):
            h = self.serve(reinsert=True)
            self.counter[Deck.comb(h)] += 1
    
    @staticmethod
    def comb(hand):
        numbers = [x for x, y in hand]
        return tuple([y for x, y in Counter(numbers).most_common()])

n, s = range(1, 14), ['C', 'Q', 'F', 'P']
d = Deck(n, s)
results = []
for i in range(100):
    d = Deck(n, s)
    d.run_test(5000)
    c_map = [(1, 1, 1, 1, 1), (2, 1, 1, 1), (2, 2, 1), (3, 1, 1), (3, 2), 
             (4, 1)]
    res = np.zeros(len(c_map))
    for k, v in d.counter.items():
        res[c_map.index(k)] = v
    results.append(res / res.sum())
M = np.array(results)
c = (2, 2, 1)
i = c_map.index(c)
i_r = M[:,i]
print (np.argmax(i_r), i_r.mean(), i_r.std())
plt.boxplot(i_r)
plt.show()<jupyter_output>81 0.047850000000000004 0.0032312691005238177
{'fraction_non_alphanumeric': 0.15011961722488038, 'fraction_numerical': 0.045454545454545456, 'mean_word_length': 2.174573055028463, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '93180', 'license': 'MIT', 'n_tokens_mistral': 674, 'n_tokens_neox': 610, 'n_words': 165, 'path': 'playground/game/playground.ipynb', 'repo_name': 'afflint/pygen', 'size': '1672'}