class_docstr: Text datasource, for reading and writing text files.
code: def _read_stream(
      self, f: "pyarrow.NativeFile", path: str
  ) -> Iterator[Block]:
      data = f.readall()
  
      builder = DelegatingBlockBuilder()
  
      lines = data.decode(self.encoding).split("\n")
      for line in lines:
          if self.drop_empty_lines and line.strip() == "":
              continue
          item = {self._COLUMN_NAME: line}
          builder.add(item)
  
      block = builder.build()
      yield block
  
file_path: ray/python/ray/data/datasource/text_datasource.py
imports: from typing import TYPE_CHECKING, Iterator, List
  from ray.data._internal.delegating_block_builder import DelegatingBlockBuilder
  from ray.data.block import Block
  from ray.data.datasource.file_based_datasource import FileBasedDatasource
  from ray.util.annotations import PublicAPI
label_desc: Use image node_id 2 for calling the TextDatasource obj's underlying member method code with example usage: obj._read_stream(f, path) without return types