def sleep_with_countdown(log, sleeptime):
    if sleeptime == 0:
        return

    print >> log, "Sleeping...",
    log.flush()

    for i in xrange(sleeptime, 0, -1):
        print >> log, " %d..." % i,
        log.flush()
        time.sleep(1)

    print >> log, ""
dataset/ETHPy150Open reddit/push/push/cli.py/sleep_with_countdown/original