<commit_before>import select


EV_READ = 1
EV_WRITE = 2


class BasePoller(object):
    is_availabe = False

    def __init__(self):
        self.objects = {}

    def register(self, key, f):
        self.objects[key] = f

    def unregister(self, key):
        return self.objects.pop(key, None)

    def poll(self, timeout=None):
        raise NotImplementedError()

    def get(self, key):
        return self.objects.get(key)

    def __len__(self):
        return len(self.objects)

    def __iter__(self):
        # Make a copy when iterating so that modifications to this object
        # are possible while we're going over it.
        return iter(self.objects.values())


class SelectPoller(BasePoller):
    is_availabe = hasattr(select, 'select')

    def poll(self, timeout=None):
        objs = self.objects.values()
        rlist, wlist, _ = select.select(objs, objs, [], timeout)
        return [(x, 'read') for x in rlist] + [(x, 'write') for x in wlist]


class PollPoller(BasePoller):
    is_availabe = hasattr(select, 'poll')

    def __init__(self):
        BasePoller.__init__(self)
        self.pollobj = select.poll()
        self.objects = {}
        self.fd_to_object = {}

    def register(self, key, f):<commit_msg>Delete some dead code<commit_after>import select


EV_READ = 1
EV_WRITE = 2


class BasePoller(object):
    is_availabe = False

    def __init__(self):
        self.objects = {}

    def register(self, key, f):
        self.objects[key] = f

    def unregister(self, key):
        return self.objects.pop(key, None)

    def poll(self, timeout=None):
        raise NotImplementedError()

    def get(self, key):
        return self.objects.get(key)

    def __len__(self):
        return len(self.objects)

    def __iter__(self):
        # Make a copy when iterating so that modifications to this object
        # are possible while we're going over it.
        return iter(self.objects.values())


class SelectPoller(BasePoller):
    is_availabe = hasattr(select, 'select')

    def poll(self, timeout=None):
        objs = self.objects.values()
        rlist, wlist, _ = select.select(objs, objs, [], timeout)
        return [(x, 'read') for x in rlist] + [(x, 'write') for x in wlist]


class PollPoller(BasePoller):
    is_availabe = hasattr(select, 'poll')

    def __init__(self):
        BasePoller.__init__(self)
        self.pollobj = select.poll()
        self.fd_to_object = {}

    def register(self, key, f):
{'fraction_non_alphanumeric': 0.11688311688311688, 'fraction_numerical': 0.0016233766233766235, 'mean_word_length': 2.668154761904762, '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': '3972369', 'n_tokens_mistral': 821, 'n_tokens_neox': 770, 'n_words': 211}