def METHOD_NAME():
    start_time = time.time()
    while True:
        try:
            yield next(fun)
        except Exception as e:
            print(e)
            break
        if time.time() - start_time > gene_time:
            print("time up")
            break