def getargspec(func, *, include_kwonlyargs=False):
    "Compat shim for getargspec deprecated in python 3.\n\n    The main difference from inspect.getargspec (and inspect.getfullargspec\n    for that matter) is that by using inspect.signature we are providing\n    correct args/defaults for functools.wraps'ed functions.\n\n    `include_kwonlyargs` option was added to centralize getting all args,\n    even the ones which are kwonly (follow the ``*,``).\n\n    For internal use and not advised for use in 3rd party code.\n    Please use inspect.signature directly.\n    "
    f_sign = inspect.signature(func)
    args4 = [[], None, None, {}]
    kwonlyargs = {}
    (args, defaults) = (args4[0], args4[3])
    P = inspect.Parameter
    for (p_name, p) in f_sign.parameters.items():
        if (p.kind in (P.POSITIONAL_ONLY, P.POSITIONAL_OR_KEYWORD)):
            assert (not kwonlyargs)
            args.append(p_name)
            if (p.default is not P.empty):
                defaults[p_name] = p.default
        elif (p.kind == P.VAR_POSITIONAL):
            args4[1] = p_name
        elif (p.kind == P.VAR_KEYWORD):
            args4[2] = p_name
        elif (p.kind == P.KEYWORD_ONLY):
            assert (p.default is not P.empty)
            kwonlyargs[p_name] = p.default
    if kwonlyargs:
        if (not include_kwonlyargs):
            raise ValueError('Function has keyword-only parameters or annotations, either use inspect.signature() API which can support them, or provide include_kwonlyargs=True to this function')
        else:
            args.extend(list(kwonlyargs))
            defaults.update(kwonlyargs)
    args4[3] = (None if (not defaults) else tuple(defaults.values()))
    return ArgSpecFake(*args4)
Compat shim for getargspec deprecated in python 3.

The main difference from inspect.getargspec (and inspect.getfullargspec
for that matter) is that by using inspect.signature we are providing
correct args/defaults for functools.wraps'ed functions.

`include_kwonlyargs` option was added to centralize getting all args,
even the ones which are kwonly (follow the ``*,``).

For internal use and not advised for use in 3rd party code.
Please use inspect.signature directly.
def getargspec(func, *, include_kwonlyargs=False):
    "Compat shim for getargspec deprecated in python 3.\n\n    The main difference from inspect.getargspec (and inspect.getfullargspec\n    for that matter) is that by using inspect.signature we are providing\n    correct args/defaults for functools.wraps'ed functions.\n\n    `include_kwonlyargs` option was added to centralize getting all args,\n    even the ones which are kwonly (follow the ``*,``).\n\n    For internal use and not advised for use in 3rd party code.\n    Please use inspect.signature directly.\n    "
    f_sign = inspect.signature(func)
    args4 = [[], None, None, {}]
    kwonlyargs = {}
    (args, defaults) = (args4[0], args4[3])
    P = inspect.Parameter
    for (p_name, p) in f_sign.parameters.items():
        if (p.kind in (P.POSITIONAL_ONLY, P.POSITIONAL_OR_KEYWORD)):
            assert (not kwonlyargs)
            args.append(p_name)
            if (p.default is not P.empty):
                defaults[p_name] = p.default
        elif (p.kind == P.VAR_POSITIONAL):
            args4[1] = p_name
        elif (p.kind == P.VAR_KEYWORD):
            args4[2] = p_name
        elif (p.kind == P.KEYWORD_ONLY):
            assert (p.default is not P.empty)
            kwonlyargs[p_name] = p.default
    if kwonlyargs:
        if (not include_kwonlyargs):
            raise ValueError('Function has keyword-only parameters or annotations, either use inspect.signature() API which can support them, or provide include_kwonlyargs=True to this function')
        else:
            args.extend(list(kwonlyargs))
            defaults.update(kwonlyargs)
    args4[3] = (None if (not defaults) else tuple(defaults.values()))
    return ArgSpecFake(*args4)