def chained(func):
 def wrapper(*args, **kwargs):
  for xs in func(*args, **kwargs):
   for x in xs:
    (yield x)
 return wrapper

def chained ( func ) : def wrapper ( * args , ** kwargs ) : for xs in func ( * args , ** kwargs ) : for x in xs : ( yield x ) return wrapper
chained a decorator chaining the results of func .