def METHOD_NAME(
        todo_dir,
        min_iters=None,
        min_progress=None,
        timeout_iters=None,
        max_iters=None,
        zero_entries=None,
        zero_entries_filter=".*",
        verbose=False):
    timeout_fn = "%s/timeout" % todo_dir
    # make clean removes todo dir, but helps debugging
    if os.path.exists(timeout_fn):
        print("WARNING: removing %s" % timeout_fn)
        os.remove(timeout_fn)
    alls = glob.glob("%s/*_all.txt" % todo_dir)
    max_iter = 0
    for fn in alls:
        n = int(re.match(r".*/([0-9]*)_all.txt", fn).group(1))
        max_iter = max(max_iter, n)
    if max_iter == 0:
        print("Incomplete: no iters")
        sys.exit(1)
    verbose and print("Max iter: %u, need: %s" % (max_iter, min_iters))
    # Don't allow early termination if below min_iters
    if min_iters is not None and max_iter < min_iters:
        print("Incomplete: not enough iters")
        sys.exit(1)
    # Force early termination if at or above max_iters.
    if max_iters is not None and max_iter >= max_iters:
        print(
            "Complete: reached max iters (want %u, got %u)" %
            (max_iters, max_iter))
        sys.exit(0)
    # Mark timeout if above timeout_iters
    if timeout_iters is not None and max_iter > timeout_iters:
        print("ERROR: timeout (max %u, got %u)" % (timeout_iters, max_iter))
        with open(timeout_fn, "w") as _f:
            pass
        sys.exit(1)
    # Check if zero entries criteria is not met.
    if zero_entries:
        filt = re.compile(zero_entries_filter)
        count = 0
        fn = "%s/%u_all.txt" % (todo_dir, max_iter)
        with open(fn, 'r') as f:
            for l in f:
                if filt.search(l):
                    count += 1
        if count > 0:
            print("%s: %s lines" % (fn, count))
            print(
                "Incomplete: need zero entries (used filter: {})".format(
                    repr(zero_entries_filter)))
            sys.exit(1)
        else:
            # If there are zero entries, check if min_progress criteria is in
            # affect. If so, that becomes the new termination condition.
            if min_progress is None:
                print(
                    "No unfiltered entries, done (used filter: {})!".format(
                        repr(zero_entries_filter)))
                sys.exit(0)
            else:
                # Even if there are 0 unfiltered entries, fuzzer may still be
                # making progress with filtered entries.
                print(
                    "No unfiltered entries (used filter: {}), checking if progress is being made"
                    .format(repr(zero_entries_filter)))
    # Check if minimum progress was achieved, continue iteration if so.
    if min_progress is not None and not check_made_progress(todo_dir, max_iter,
                                                            min_progress):
        sys.exit(0)
    print("No exit criteria met, keep going!")
    sys.exit(1)