def _check_peptide_lengths(self, peptide_lengths=None):
if not peptide_lengths:<EOL><INDENT>peptide_lengths = self.default_peptide_lengths<EOL><DEDENT>if not peptide_lengths:<EOL><INDENT>raise ValueError(<EOL>("<STR_LIT>"<EOL>"<STR_LIT>"))<EOL><DEDENT>if isinstance(peptide_lengths, int):<EOL><INDENT>peptide_lengths = [peptide_lengths]<EOL><DEDENT>require_iterable_of(peptide_lengths, int)<EOL>for peptide_length in peptide_lengths:<EOL><INDENT>if (self.min_peptide_length is not None and<EOL>peptide_length < self.min_peptide_length):<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>" % (<EOL>peptide_length,<EOL>self.min_peptide_length))<EOL><DEDENT>elif (self.max_peptide_length is not None and<EOL>peptide_length > self.max_peptide_length):<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>" % (<EOL>peptide_length,<EOL>self.max_peptide_length))<EOL><DEDENT><DEDENT>return peptide_lengths<EOL>
If peptide lengths not specified, then try using the default
lengths associated with this predictor object. If those aren't
a valid non-empty sequence of integers, then raise an exception.
Otherwise return the peptide lengths.