@classmethod<EOL><INDENT>def validate_args(cls, tag_name, *args, **kwargs):<DEDENT>
if cls.min_args is not None and len(args) < cls.min_args:<EOL><INDENT>if cls.min_args == <NUM_LIT:1>:<EOL><INDENT>raise TemplateSyntaxError("<STR_LIT>".format(tag_name, cls.min_args))<EOL><DEDENT>else:<EOL><INDENT>raise TemplateSyntaxError("<STR_LIT>".format(tag_name, cls.min_args))<EOL><DEDENT><DEDENT>if cls.max_args is not None and len(args) > cls.max_args:<EOL><INDENT>if cls.max_args == <NUM_LIT:0>:<EOL><INDENT>if cls.allowed_kwargs:<EOL><INDENT>raise TemplateSyntaxError("<STR_LIT>".format(tag_name, cls.allowed_kwargs[<NUM_LIT:0>]))<EOL><DEDENT>else:<EOL><INDENT>raise TemplateSyntaxError("<STR_LIT>".format(tag_name))<EOL><DEDENT><DEDENT>elif cls.max_args == <NUM_LIT:1>:<EOL><INDENT>raise TemplateSyntaxError("<STR_LIT>".format(tag_name, cls.max_args))<EOL><DEDENT>else:<EOL><INDENT>raise TemplateSyntaxError("<STR_LIT>".format(tag_name, cls.max_args))<EOL><DEDENT><DEDENT>
Validate the syntax of the template tag.