def _check_arg_length(fname, args, max_fname_arg_count, compat_args):
if max_fname_arg_count < <NUM_LIT:0>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if len(args) > len(compat_args):<EOL><INDENT>max_arg_count = len(compat_args) + max_fname_arg_count<EOL>actual_arg_count = len(args) + max_fname_arg_count<EOL>argument = '<STR_LIT>' if max_arg_count == <NUM_LIT:1> else '<STR_LIT>'<EOL>raise TypeError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(<EOL>fname=fname, max_arg=max_arg_count,<EOL>argument=argument, given_arg=actual_arg_count))<EOL><DEDENT>
Checks whether 'args' has length of at most 'compat_args'. Raises
a TypeError if that is not the case, similar to in Python when a
function is called with too many arguments.