import time


def _is_active(log_stream: dict, cut_off: int) -> bool:
    """
    Determine if the given stream is still active and worth tailing.

    :param log_stream:
        A dictionary returned by `describe_log_streams` describing the
        log_stream under consideration.
    :param cut_off:
        The number of seconds to wait before calling a log_stream inactive.
        If the stream does not have a `lastIngestionTime` more recent than
        `cut_off` seconds ago it will be considered not active.
    :return:
        Whether the given log stream is active.
    """
    last_ingest = log_stream["lastIngestionTime"] / 1000
    return time.time() - last_ingest < cut_off