code: def _get_split_language_examples(
      root_dir: str,
  ) -> Tuple[SplitExampleDict, List[str]]:
      """Extract all split names and associated text data.
  
      Args:
        root_dir: The folder where the `lang.split.txt` are located
  
      Returns:
        split_examples: Mapping split_names -> language -> List[text_data]
        languages: The list of languages
      """
      split_examples = collections.defaultdict(dict)
      languages = set()
      files = tf.io.gfile.listdir(root_dir)
      for file in files:
          lang, split_name, _ = file.split(".")
          split_examples[split_name][lang] = _list_examples(
              os.path.join(root_dir, file)
          )
          languages.add(lang)
  
      # One-to-One translation
      for split, examples in split_examples.items():
          num_examples = {
              lang: len(ex) for lang, ex in examples.items()
          }
          if len(set(num_examples.values())) != 1:
              raise ValueError(
                  "Num examples for split {} do not match: {}".format(
                      split, num_examples
                  )
              )
  
      return split_examples, sorted(languages)
  
imports: from __future__ import annotations
  import collections
  import os
  from typing import Dict, List, Tuple
  from etils import epath
  from tensorflow_datasets.core import dataset_builder
  from tensorflow_datasets.core import dataset_info
  from tensorflow_datasets.core import features
  from tensorflow_datasets.core import splits
  from tensorflow_datasets.core.utils import version
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: _get_split_language_examples(root_dir) and returns: split_examples,  sorted