<commit_before>from enum import Enum, unique
from collections import namedtuple, UserList

@unique
class Suit(Enum):
    JOKER = 0
    CLUB = 1
    SPADE = 2
    DIAMOND = 3
    HEART = 4

@unique
class Value(Enum):
    JOKER = 0
    ONE = 1
    TWO = 2
    THREE = 3
    FOUR = 4
    FIVE = 5
    SIX = 6
    SEVEN = 7
    EIGHT = 8
    NINE = 9
    TEN = 10
    JACK = 11
    QUEEN = 12
    KING = 13

standard_suits = [suit for suit in Suit if suit != Suit.JOKER]
standard_values = [value for value in Value if value != Value.JOKER]
Card = namedtuple('Card', ['Suit', 'Value'])
    
class Deck(UserList):
    def __init__(self, cards=[]):
        self._deck_holder = self.data = cards

    def fill(self, jokers=0):
        for _ in range(jokers):
            self._deck_holder.append(Card(Suit.JOKER, 0))

        for suit in standard_suits:
            for value in standard_values:
                self._deck_holder.append(Card(suit, value))

    def draw(self):
        return self.pop()

    def insert(card, position=0):
        self.insert(card)

if __name__ == '__main__':
    d = Deck()
    d.fill(jokers=2)

    for card in d:
        print(card)<commit_msg>fill -> new_pack<commit_after>from enum import Enum, unique
from collections import namedtuple, UserList

@unique
class Suit(Enum):
    JOKER = 0
    CLUB = 1
    SPADE = 2
    DIAMOND = 3
    HEART = 4

@unique
class Value(Enum):
    JOKER = 0
    ONE = 1
    TWO = 2
    THREE = 3
    FOUR = 4
    FIVE = 5
    SIX = 6
    SEVEN = 7
    EIGHT = 8
    NINE = 9
    TEN = 10
    JACK = 11
    QUEEN = 12
    KING = 13

standard_suits = [suit for suit in Suit if suit != Suit.JOKER]
standard_values = [value for value in Value if value != Value.JOKER]
Card = namedtuple('Card', ['Suit', 'Value'])
    
class Deck(UserList):
    def __init__(self, cards=[]):
        self._deck_holder = self.data = cards

    def new_pack(self, jokers=0):
        self.clear()

        for _ in range(jokers):
            self._deck_holder.append(Card(Suit.JOKER, Value.JOKER))

        for suit in standard_suits:
            for value in standard_values:
                self._deck_holder.append(Card(suit, value))

    def found_pack(self):
        '''I found this abandoned pack of playing cards at the library. It's
        probably not complete... But what if it is...? Oh, wow. Who cares? Look
        at the design on the back! I'm keeping these.'''
        pass

    def draw(self):
        return self.pop()

    def insert(card, position=0):
        self.insert(card)

if __name__ == '__main__':
    d = Deck()
    d.new_pack(jokers=2)

    for card in d:
        print(card)
{'fraction_non_alphanumeric': 0.10610079575596817, 'fraction_numerical': 0.02008336491095112, 'mean_word_length': 2.1692677070828332, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2662394', 'n_tokens_mistral': 978, 'n_tokens_neox': 886, 'n_words': 280}