<commit_before>try:
    from zookeeper import ZooKeeperException as ZookeeperError
    from zkpython import ZKClient, ChildrenWatch, DataWatch
    def adjust_zk_logging_level():
        pass
except ImportError:
    from kazoo.client import KazooClient as ZKClient
    from kazoo.recipe.watchers import ChildrenWatch, DataWatch
    from kazoo.exceptions import ZookeeperError
    def adjust_zk_logging_level():
        import logging
        import kazoo
        kazoo.client.log.setLevel(logging.WARNING)
        kazoo.protocol.connection.log.setLevel(logging.WARNING)

class MasterDetector(object):
    def __init__(self, uri, agent):
        self.uri = uri
        self.agent = agent
        self.zk = ZKClient(uri, 10)
        self.masterSeq = None

    def choose(self, children):
        if not children:
            self.agent.onNoMasterDetectedMessage()
            return True
        masterSeq = min(children)<commit_msg>filter out 'log_replicas' node for master detection<commit_after>try:
    from zookeeper import ZooKeeperException as ZookeeperError
    from zkpython import ZKClient, ChildrenWatch, DataWatch
    def adjust_zk_logging_level():
        pass
except ImportError:
    from kazoo.client import KazooClient as ZKClient
    from kazoo.recipe.watchers import ChildrenWatch, DataWatch
    from kazoo.exceptions import ZookeeperError
    def adjust_zk_logging_level():
        import logging
        import kazoo
        kazoo.client.log.setLevel(logging.WARNING)
        kazoo.protocol.connection.log.setLevel(logging.WARNING)

class MasterDetector(object):
    def __init__(self, uri, agent):
        self.uri = uri
        self.agent = agent
        self.zk = ZKClient(uri, 10)
        self.masterSeq = None

    def choose(self, children):
        children = [child for child in children if child != 'log_replicas']
        if not children:
            self.agent.onNoMasterDetectedMessage()
            return True
        masterSeq = min(children)
{'fraction_non_alphanumeric': 0.0673758865248227, 'fraction_numerical': 0.002026342451874367, 'mean_word_length': 2.9031620553359683, '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': '3905942', 'n_tokens_mistral': 577, 'n_tokens_neox': 559, 'n_words': 148}