<commit_before>#!/bin/env python
# -*- coding: utf-8 -*-

import base_parser

class FortuneCookieMessageParser(base_parser.BaseCookieParser):

    _message = None

    _cookie_tag = False

    def handle_starttag(self, tag, attrs):
        if tag == 'a':
            dict_attrs = dict(attrs)
            if 'class' in dict_attrs and dict_attrs['class'] == 'cookie-link':
                self._cookie_tag = True

    def handle_endtag(self, tag):
        self._cookie_tag = False

    def handle_data(self, data):
        if self._cookie_tag:
            self._message = data

    def handle_comment(self, data):
        pass

    def handle_charref(self, name):
        pass

    def handle_decl(self, data):
        pass

    def get_cookie_message(self):
        return self._message
<commit_msg>rm inutil<commit_after>#!/bin/env python
# -*- coding: utf-8 -*-

import base_parser

class FortuneCookieMessageParser(base_parser.BaseCookieParser):

    _message = None

    _cookie_tag = False

    def handle_starttag(self, tag, attrs):
        if tag == 'a':
            dict_attrs = dict(attrs)
            if 'class' in dict_attrs and dict_attrs['class'] == 'cookie-link':
                self._cookie_tag = True

    def handle_endtag(self, tag):
        self._cookie_tag = False

    def handle_data(self, data):
        if self._cookie_tag:
            self._message = data

    def get_cookie_message(self):
        return self._message

{'fraction_non_alphanumeric': 0.10103806228373702, 'fraction_numerical': 0.001384083044982699, 'mean_word_length': 2.386416861826698, 'pattern_counts': {'":': 0, '<': 3, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7035409', 'n_tokens_mistral': 445, 'n_tokens_neox': 425, 'n_words': 105}