code: def test_text_dataset_from_directory_validation_split(self):
      directory = self._prepare_directory(num_classes=2, count=10)
      dataset = text_dataset_utils.text_dataset_from_directory(
          directory,
          batch_size=10,
          validation_split=0.2,
          subset="training",
          seed=1337,
      )
      batch = next(iter(dataset))
      self.assertLen(batch, 2)
      self.assertEqual(batch[0].shape, (8,))
      dataset = text_dataset_utils.text_dataset_from_directory(
          directory,
          batch_size=10,
          validation_split=0.2,
          subset="validation",
          seed=1337,
      )
      batch = next(iter(dataset))
      self.assertLen(batch, 2)
      self.assertEqual(batch[0].shape, (2,))
  
      (
          train_dataset,
          val_dataset,
      ) = text_dataset_utils.text_dataset_from_directory(
          directory,
          batch_size=10,
          validation_split=0.2,
          subset="both",
          seed=1337,
      )
      batch = next(iter(train_dataset))
      self.assertLen(batch, 2)
      self.assertEqual(batch[0].shape, (8,))
      batch = next(iter(val_dataset))
      self.assertLen(batch, 2)
      self.assertEqual(batch[0].shape, (2,))
  
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 6 for calling the TextDatasetFromDirectoryTest obj's underlying member method code with example usage: obj.test_text_dataset_from_directory_validation_split() without return types