import ast


def _non_kw_only_args_of(args: ast.arguments) -> list[ast.arg]:
    """Return a list containing the pos-only args and pos-or-kwd args of `args`"""
    # pos-only args don't exist on 3.7
    pos_only_args: list[ast.arg] = getattr(args, "posonlyargs", [])
    return pos_only_args + args.args