<commit_before>
class CardValue:

    rankValue = {
        "2" : 2,
        "3" : 3,
        "4" : 4,
        "5" : 5,
        "6" : 6,
        "7" : 7,
        "8" : 8,
        "9" : 9,
        "J" : 10,
        "Q" : 11,
        "K" : 12,
        "A" : 13,
    }


    order = ['2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K', 'A']

    def getSingleCardValue(self, card):
        try:
            return self.rankValue[card.rank]
        except KeyError:
            return 0

    def get_hand_value(self, hand):
        pass

    def find_hand_name(self, cards):
        """

        input format:

        [...
        {
            "rank": "4",
            "suit": "spades"
        },
        ...
        ]

        Array of tuples, each tuple looks like ('rank', 'suit')
        2-10, J, Q, K, A
        hearts, spades, clubs, diamonds

        :param cards: Cards array
        :return: Returns card strenghs in INT
        """
        cards = sorted(cards, key=lambda x: self.order.index(x[0]))
        #cards = sorted(cards, key=lambda x: x[1])
        print(cards)


        # is straight flush
        # poker
        # full house
        # flush
        # staight
        # drill
        # 2p
        # p
        # high
        # nothing

        result = sum([self.order.index(x[0]) for x in cards])

        if self.has_straight_flush(cards):
            return result * 100

        if self.has_poker(cards):
            return result * 80

        if self.has_full_house(cards):
            return result * 60

        if self.has_flush(cards):
            return result * 50

        if self.has_straight(cards):
            return result * 40

        if self.has_drill(cards):
            return result * 30

        if self.has_2p(cards):
            return result * 20

        if self.has_p(cards):
            return result * 10

        if self.has_high(cards):
            return result * 5

        return sum([self.order.index(x[0]) for x in cards])

    def has_straight_flush(self, cards):
        return False

    def has_poker(self, cards):
        return False

    def has_full_house(self, cards):
        return False<commit_msg>implemented poker<commit_after>
class CardValue:

    rankValue = {
        "2" : 2,
        "3" : 3,
        "4" : 4,
        "5" : 5,
        "6" : 6,
        "7" : 7,
        "8" : 8,
        "9" : 9,
        "J" : 10,
        "Q" : 11,
        "K" : 12,
        "A" : 13,
    }


    order = ['2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K', 'A']

    def getSingleCardValue(self, card):
        try:
            return self.rankValue[card.rank]
        except KeyError:
            return 0

    def get_hand_value(self, hand):
        pass

    def find_hand_name(self, cards):
        """

        input format:

        [...
        {
            "rank": "4",
            "suit": "spades"
        },
        ...
        ]

        Array of tuples, each tuple looks like ('rank', 'suit')
        2-10, J, Q, K, A
        hearts, spades, clubs, diamonds

        :param cards: Cards array
        :return: Returns card strenghs in INT
        """
        cards = sorted(cards, key=lambda x: self.order.index(x[0]))
        #cards = sorted(cards, key=lambda x: x[1])
        print(cards)


        # is straight flush
        # poker
        # full house
        # flush
        # staight
        # drill
        # 2p
        # p
        # high
        # nothing

        result = sum([self.order.index(x[0]) for x in cards])

        if self.has_straight_flush(cards):
            return result * 100

        if self.has_poker(cards):
            return result * 80

        if self.has_full_house(cards):
            return result * 60

        if self.has_flush(cards):
            return result * 50

        if self.has_straight(cards):
            return result * 40

        if self.has_drill(cards):
            return result * 30

        if self.has_2p(cards):
            return result * 20

        if self.has_p(cards):
            return result * 10

        if self.has_high(cards):
            return result * 5

        return sum([self.order.index(x[0]) for x in cards])

    def has_straight_flush(self, cards):
        return False

    def has_poker(self, cards):
        dist = self.get_card_dist(cards)
        for rank, num in dist.iteritems():
            if num >= 4:
                print("Found poker")
                return True
        return False

    def has_full_house(self, cards):
        return False
{'fraction_non_alphanumeric': 0.12439347154830172, 'fraction_numerical': 0.028010586678429643, 'mean_word_length': 1.37434554973822, 'pattern_counts': {'":': 4, '<': 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': '7095044', 'n_tokens_mistral': 1540, 'n_tokens_neox': 1402, 'n_words': 392}