@staticmethod
    def _wait(func, timeout):
        """
        Keep calling *func* (a lambda function) until it returns True,
        for a maximum of *timeout* seconds. Return True if *func* does,
        or False if time runs out.
        """

        for n in range(0, timeout*10):
            if func(): return True
            else: time.sleep(0.1)

        return False
dataset/ETHPy150Open rapidsms/rapidsms-core-dev/lib/rapidsms/router.py/Router._wait/original