def my_hybrid_func():
do_some_stuff()
def do_some_stuff():
sleep(1)
print('done')
# this would take two seconds to complete
for _ in range(2):
my_hybrid_func()
# this would take 1 second to complete
tasks = [my_hybrid_func.run_async(), my_hybrid_func.run_async()]
asyncio.run(asyncio.gather(tasks))