def _arg_kind(arg):
    """Helper function to determine kind for a given argument.

    This method will help `inspect_function` to determine the correct
    kind for arguments when using python3.

    Parameters
    ----------
    arg : object like inspect.Parameter
        The argument we will determine the type of.

    Returns
    -------
    out : string
        A string we use for determine the kind.
    """
    kind = None
    if arg.kind == arg.POSITIONAL_OR_KEYWORD:
        if arg.default is arg.empty:
            kind = 'args'
        else:
            kind = 'kwargs'
    elif arg.kind == arg.VAR_POSITIONAL:
        kind = 'varargs'
    elif arg.kind == arg.VAR_KEYWORD:
        kind = 'keywords'
    elif arg.kind == arg.KEYWORD_ONLY:
        kind = 'kwargs'
    return kind
