def METHOD_NAME(self, stream):
    try:
        line = next(stream)
    except StopIteration:
        raise ValueError("Empty file.") from None
    words = line.split()
    if len(words) == 2:
        try:
            self._number_of_seqs = int(words[0])
            self._length_of_seqs = int(words[1])
            return
        except ValueError:
            pass
    raise ValueError(
        "Expected two integers in the first line, received '%s'" % line
    )