code: def test_complex(self):
      train_info = self._write_tfrecord("train", 5, "abcdefghijkl")
      test_info = self._write_tfrecord("test", 3, "mnopqrs")
      self.assertEqual(train_info.name, "train")
      self.assertEqual(test_info.name, "test")
      self.assertEqual(
          train_info.shard_lengths, [2, 3, 2, 3, 2]
      )  # 12 ex.
      self.assertEqual(test_info.shard_lengths, [2, 3, 2])  # 7 ex.
      split_info = [train_info, test_info]
      ds = self.reader.read(
          instructions="train[1:-1]+test[:-50%]",
          split_infos=split_info,
      )
      read_data = list(tfds.as_numpy(ds))
      self.assertEqual(
          read_data,
          [bytes(l, encoding="utf-8") for l in "bcdefghijkmno"],
      )
  
      if not _SKIP_CARDINALITY_TEST:
          # Check that the cardinality is correctly set.
          self.assertEqual(ds.cardinality().numpy(), len(read_data))
  
imports: import functools
  import itertools
  import os
  from unittest import mock
  import tensorflow
  import tensorflow_datasets
  from tensorflow_datasets import testing
  from tensorflow_datasets.core import example_parser
  from tensorflow_datasets.core import naming
  from tensorflow_datasets.core import reader
  from tensorflow_datasets.core import splits
  from tensorflow_datasets.core import writer
  from tensorflow_datasets.core.utils import read_config
  from tensorflow_datasets.core.utils import shard_utils
label_desc: Use image node_id 7 for calling the ReaderTest obj's underlying member method code with example usage: obj.test_complex() without return types