code: def test_read_text(ray_start_regular_shared, tmp_path):
      path = os.path.join(tmp_path, "test_text")
      os.mkdir(path)
      with open(os.path.join(path, "file1.txt"), "w") as f:
          f.write("hello\n")
          f.write("world")
      with open(os.path.join(path, "file2.txt"), "w") as f:
          f.write("goodbye")
      with open(os.path.join(path, "file3.txt"), "w") as f:
          f.write("ray\n")
      ds = ray.data.read_text(path)
      assert sorted(_to_lines(ds.take())) == [
          "goodbye",
          "hello",
          "ray",
          "world",
      ]
      ds = ray.data.read_text(path, drop_empty_lines=False)
      assert ds.count() == 5
  
file_path: ray/python/ray/data/tests/test_text.py
imports: import os
  import pandas
  import pytest
  import ray
  from ray.data.datasource import BaseFileMetadataProvider, FastFileMetadataProvider, Partitioning, PartitionStyle, PathPartitionFilter
  from ray.data.tests.conftest import *
  from ray.data.tests.mock_http_server import *
  from ray.data.tests.test_partitioning import PathPartitionEncoder
  from ray.data.tests.util import Counter
  from ray.tests.conftest import *
label_desc: Use image node_id 4 for calling a global function with example usage: test_read_text(ray_start_regular_shared, tmp_path) without return types