def isgeneratorfunction(object):
    return bool((isfunction(object) or ismethod(object)) and
                object.func_code.co_flags & CO_GENERATOR)
Return true if the object is a user-defined generator function.
dataset/ETHPy150Open azoft-dev-team/imagrium/env/Lib/inspect.py/isgeneratorfunction