def is_coroutine(function):
 return ((function.__code__.co_flags & 128) or getattr(function, '_is_coroutine', False))

def is_coroutine ( function ) : return ( ( function . __code__ . co_flags & 128 ) or getattr ( function , '_is_coroutine' , False ) )
returns true if the passed in function is a coroutine .