def METHOD_NAME(stream, log_every=1000):
    i = 0
    then = time.time()
    for item in stream:
        yield item
        i += 1
        if not i % log_every:
            now = time.time()
            delta = now - then
            then = now
            rate = round(log_every / delta)
            log.info("indexed %ik annotations, rate=%s/s", i // 1000, rate)