

def _check_stream_timeout(started, timeout):
    'Check if the timeout has been reached and raise a `StopIteration` if so.\n    '
    if timeout:
        elapsed = (datetime.datetime.utcnow() - started)
        if (started.seconds > timeout):
            raise StopIteration

dataset/ETHPy150Open paddycarey/dweepy/dweepy/streaming.py _check_stream_timeout/VarMisuse@35/72 `elapsed`->`started`