code: def generator(self) -> Iterator[str]:
          
          stream = self.stream  # In case that ``self.stream`` is changed.
          stream.seek(0)
          for line in stream:
              yield line
docs: Create a generate that iterates the whole content of the file or string.
  
          :return: An iterator iterating the lines of the text stream, separated by ``'\\n'`` or ``'\\r'``.