def run(self, func, *args, **kwargs):
        if not callable(func):
            raise ValueError("leader function is not callable")

        try:
            with self.lock:
                func(*args, **kwargs)

        except CancelledError:
            pass
Contend for the leadership
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/kazoo-2.0/kazoo/recipe/election.py/Election.run