@tasklets.tasklet
def fibonacci(n):
  if n <= 1:
    raise tasklets.Return(n)
  a = yield fibonacci(n - 1)
  b = yield fibonacci(n - 2)
  raise tasklets.Return(a + b)
A recursive Fibonacci to exercise task switching.
dataset/ETHPy150Open GoogleCloudPlatform/datastore-ndb-python/tests/mttest.py/fibonacci