Return a Python 3-like argspec object.

    Note:
        args contains varargs and varkw if they exist. This behavior differs
        from getargspec and getfullargspec.

    Args:
        func: The function to inspect.

    Returns:
        A named tuple with three parameters:
            args: All named arguments, including varargs and varkw if they are
                not None.
            varargs: The name of the *args variable. May be None.
            varkw: The name of the **kwargs variable. May be None.

def _getargspec(func):
    """Return a Python 3-like argspec object.

    Note:
        args contains varargs and varkw if they exist. This behavior differs
        from getargspec and getfullargspec.

    Args:
        func: The function to inspect.

    Returns:
        A named tuple with three parameters:
            args: All named arguments, including varargs and varkw if they are
                not None.
            varargs: The name of the *args variable. May be None.
            varkw: The name of the **kwargs variable. May be None.
    """
    argspec = _getspec(func)
    args = list(argspec.args)
    if argspec.varargs:
        args += [argspec.varargs]
    if argspec[2]:  # "keywords" in PY2 and "varkw" in PY3
        args += [argspec[2]]
    return _ArgSpec(args, argspec.varargs, argspec[2])