def is_generator(f):
    isgen = (f.func_code.co_flags & CO_GENERATOR) != 0 
    return isgen

# FIXME: refactor this stuff so that both LineProfiler and ContextualProfile can
# use the same implementation.
# Code to exec inside of ContextualProfile.__call__ to support PEP-342-style
# generators in Python 2.5+.
Return True if a function is a generator.
dataset/ETHPy150Open certik/line_profiler/kernprof.py/is_generator