def takes_kwargs(function):
    return bool(function.__code__.co_flags & 0x08)
Returns True if the supplied function takes keyword arguments
dataset/ETHPy150Open timothycrosley/hug/hug/introspect.py/takes_kwargs