def AuthorValidator(data):
if not isinstance(data, list):<EOL><INDENT>data = [data]<EOL><DEDENT>for author in data:<EOL><INDENT>if '<STR_LIT>' not in author:<EOL><INDENT>raise ValidationError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT:type>' in author and not isinstance(author['<STR_LIT:type>'], basestring):<EOL><INDENT>raise ValidationError('<STR_LIT>')<EOL><DEDENT><DEDENT>
Raise a ValidationError if data does not match the author format.