def copy_arguments_to_annotations(args, type_comment, *, is_method=False):
if isinstance(type_comment, ast3.Ellipsis):<EOL><INDENT>return<EOL><DEDENT>expected = len(args.args)<EOL>if args.vararg:<EOL><INDENT>expected += <NUM_LIT:1><EOL><DEDENT>expected += len(args.kwonlyargs)<EOL>if args.kwarg:<EOL><INDENT>expected += <NUM_LIT:1><EOL><DEDENT>actual = len(type_comment) if isinstance(type_comment, list) else <NUM_LIT:1><EOL>if expected != actual:<EOL><INDENT>if is_method and expected - actual == <NUM_LIT:1>:<EOL><INDENT>pass  <EOL><DEDENT>else:<EOL><INDENT>raise ValueError(<EOL>f"<STR_LIT>" +<EOL>f"<STR_LIT>"<EOL>)<EOL><DEDENT><DEDENT>if isinstance(type_comment, list):<EOL><INDENT>next_value = type_comment.pop<EOL><DEDENT>else:<EOL><INDENT>_tc = type_comment<EOL>def next_value(index: int = <NUM_LIT:0>) -> ast3.expr:<EOL><INDENT>return _tc<EOL><DEDENT><DEDENT>for arg in args.args[expected - actual:]:<EOL><INDENT>ensure_no_annotation(arg.annotation)<EOL>arg.annotation = next_value(<NUM_LIT:0>)<EOL><DEDENT>if args.vararg:<EOL><INDENT>ensure_no_annotation(args.vararg.annotation)<EOL>args.vararg.annotation = next_value(<NUM_LIT:0>)<EOL><DEDENT>for arg in args.kwonlyargs:<EOL><INDENT>ensure_no_annotation(arg.annotation)<EOL>arg.annotation = next_value(<NUM_LIT:0>)<EOL><DEDENT>if args.kwarg:<EOL><INDENT>ensure_no_annotation(args.kwarg.annotation)<EOL>args.kwarg.annotation = next_value(<NUM_LIT:0>)<EOL><DEDENT>
Copies AST nodes from `type_comment` into the ast3.arguments in `args`.

    Does validaation of argument count (allowing for untyped self/cls)
    and type (vararg and kwarg).