<commit_before># -*- coding: utf-8 -*-

class Slot(object):
    def __init__(self,combd):
        #@note if you want to fix threads_num, set it in initialize,not here
        self.threads_num = combd.threads_num
        self.sleep = combd.sleep
        self.sleep_max = combd.sleep_max
        self.debug=combd.debug
        self.combd=combd

        self.initialize()


    def initialize(self):
        """Hook for subclass initialization.

        This block is execute before thread initial

        Example::

            class UserSlot(Slot):
                def initialize(self,*args,**kwargs):
                    self.attr = kwargs.get('attr',None)

                def slot(self, result):
                    ...

        """
        pass

    def __enter__(self):
        print "You should overwrite __enter__ method by subclass"
        return False


    def __exit__(self, exc_type, exc_val, exc_tb):
        print "You should overwrite __exit__ method by subclass"
        pass


    def slot(self):
        pass


    # @staticmethod
    # def options():
    #     """
    #     replace this method for custom-defined method
    #     :return:
    #     """
    #     return ()
    #     pass
<commit_msg>准备支持python3<commit_after># -*- coding: utf-8 -*-

class Slot(object):
    def __init__(self,combd):
        #@note if you want to fix threads_num, set it in initialize,not here
        self.threads_num = combd.threads_num
        self.sleep = combd.sleep
        self.sleep_max = combd.sleep_max
        self.debug=combd.debug
        self.combd=combd

        self.initialize()


    def initialize(self):
        """Hook for subclass initialization.

        This block is execute before thread initial

        Example::

            class UserSlot(Slot):
                def initialize(self,*args,**kwargs):
                    self.attr = kwargs.get('attr',None)

                def slot(self, result):
                    ...

        """
        pass

    def __enter__(self):
        print "You should overwrite __enter__ method by subclass"
        return False


    def __exit__(self, exc_type, exc_val, exc_tb):
        print "You should overwrite __exit__ method by subclass"
        pass


    def slot(self,msg):
        pass


    # @staticmethod
    # def options():
    #     """
    #     replace this method for custom-defined method
    #     :return:
    #     """
    #     return ()
    #     pass

{'fraction_non_alphanumeric': 0.09615384615384616, 'fraction_numerical': 0.0012274959083469722, 'mean_word_length': 1.7379619260918253, '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': '287695', 'n_tokens_mistral': 706, 'n_tokens_neox': 659, 'n_words': 186}