Get the names and default values of a function's arguments.

    Args:
        fn (function): a function

    Returns:
        `inspect.ArgSpec`:  A collections.namedtuple with the following attributes:

            * Args:
                args (list): a list of the argument names (it may contain nested lists).
                varargs (str): name of the * argument or None.
                keywords (str): names of the ** argument or None.
                defaults (tuple): an n-tuple of the default values of the last n arguments.

def getargspec(fn):  # type: (Callable) -> inspect.ArgSpec
    """Get the names and default values of a function's arguments.

    Args:
        fn (function): a function

    Returns:
        `inspect.ArgSpec`:  A collections.namedtuple with the following attributes:

            * Args:
                args (list): a list of the argument names (it may contain nested lists).
                varargs (str): name of the * argument or None.
                keywords (str): names of the ** argument or None.
                defaults (tuple): an n-tuple of the default values of the last n arguments.
    """
    if six.PY2:
        return inspect.getargspec(fn)
    elif six.PY3:
        full_arg_spec = inspect.getfullargspec(fn)
        return inspect.ArgSpec(full_arg_spec.args, full_arg_spec.varargs, full_arg_spec.varkw, full_arg_spec.defaults)