def loop_waiting_for_flag(self, instance, timeout=5):
        timeout = float(timeout) / 100
        count = 100
        while asyncore.socket_map and count > 0:
            asyncore.loop(timeout=0.01, count=1, use_poll=self.use_poll)
            if instance.flag:
                return
            count -= 1
            time.sleep(timeout)
        self.fail("flag not set")
dataset/ETHPy150Open amrdraz/kodr/app/brython/www/src/Lib/test/test_asyncore.py/BaseTestAPI.loop_waiting_for_flag/original