code: def test_text_dataset_from_directory_standalone(self):
      # Test retrieving txt files without labels from a directory and its
      # subdirs. Save a few extra files in the parent directory.
      directory = self._prepare_directory(count=7, num_classes=2)
      for i in range(3):
          filename = f"text_{i}.txt"
          with open(os.path.join(directory, filename), "w") as f:
              text = "".join(
                  [random.choice(string.printable) for _ in range(20)]
              )
              f.write(text)
  
      dataset = text_dataset_utils.text_dataset_from_directory(
          directory, batch_size=5, label_mode=None, max_length=10
      )
      batch = next(iter(dataset))
      # We just return the texts, no labels
      self.assertEqual(batch.shape, (5,))
      self.assertEqual(batch.dtype.name, "string")
      # Count samples
      batch_count = 0
      sample_count = 0
      for batch in dataset:
          batch_count += 1
          sample_count += batch.shape[0]
      self.assertEqual(batch_count, 2)
      self.assertEqual(sample_count, 10)
  
file_path: keras/keras/utils/text_dataset_utils_test.py
imports: import os
  import random
  import string
  from keras import testing
  from keras.utils import text_dataset_utils
label_desc: Use image node_id 2 for calling the TextDatasetFromDirectoryTest obj's underlying member method code with example usage: obj.test_text_dataset_from_directory_standalone() without return types