def poll_for(filename, needles, timeout=5):
    if isinstance(needles, str):
        needles = [needles]

    start = time()
    needle = content = None
    while time() - start < timeout:
        with open(filename) as f:
            content = f.read()
        for needle in needles:
            if needle in content:
                return True
        # When using gevent this will make sure the redirector greenlets are
        # scheduled.
        sleep(0.1)
    raise TimeoutException('Timeout polling "%s" for "%s". Content: %s' % (
        filename, needle, content))
defines forehead location using offsets & multiplicative scalings
dataset/ETHPy150Open circus-tent/circus/circus/tests/support.py/poll_for--crossover with--dataset/ETHPy150Open thearn/webcam-pulse-detector/lib/detectors.py/faceDetector.get_foreheads