def METHOD_NAME(events_queue: Queue, put_events_fn: Callable[[List[Any]], None]) -> None:
    """Periodically check whether the instance has posted any new events to the queue.  If they have,
    write ALL events (not just the new events) to DBFS.
    """
    all_events = []
    done = False
    got_new_events = False
    time_posted_last_batch = time.time()
    while not done:
        try:
            event_or_done = events_queue.get(timeout=1)
            if event_or_done == DONE:
                done = True
            else:
                all_events.append(event_or_done)
                got_new_events = True
        except Empty:
            pass
        enough_time_between_batches = time.time() - time_posted_last_batch > 1
        if got_new_events and (done or enough_time_between_batches):
            put_events_fn(all_events)
            got_new_events = False
            time_posted_last_batch = time.time()