def validate_word_size(word_size, BLAST_SETS):
blast_min_int_word_size = BLAST_SETS.min_word_size<EOL>blast_max_int_word_size = BLAST_SETS.max_word_size<EOL>blast_word_size_error = BLAST_SETS.get_word_size_error()<EOL>try:<EOL><INDENT>if len(word_size) <= <NUM_LIT:0>:<EOL><INDENT>raise forms.ValidationError(blast_word_size_error)<EOL><DEDENT>int_word_size = int(word_size)<EOL>if int_word_size < blast_min_int_word_size:<EOL><INDENT>raise forms.ValidationError(blast_word_size_error)<EOL><DEDENT>if int_word_size >= blast_max_int_word_size:<EOL><INDENT>raise forms.ValidationError(blast_word_size_error)<EOL><DEDENT><DEDENT>except:<EOL><INDENT>raise forms.ValidationError(blast_word_size_error)<EOL><DEDENT>return int_word_size<EOL>
Validate word size in blast/tblastn form.