code: def _get_extra_dirs(
      data_dir: pathlib.Path,
      current_full_names: List[str],
  ) -> Tuple[List[pathlib.Path], List[pathlib.Path]]:
      """Returns a tuple of installed datasets and extra dirs to delete.
  
      Args: data_dir : The path to the data directory current_full_names : Names of
      the latest datasets supported in TFDS
  
      Returns:
        dirs_to_keep: List of directory to keep (existing supported versions)
        dirs_to_delete: List of directory to delete
      """
      # Normalize paths for windows
      current_full_names = [
          os.path.normpath(name) for name in current_full_names
      ]
  
      full_names_tree = _split_full_names(current_full_names)
  
      # Parse all existing dirs.
      with concurrent.futures.ThreadPoolExecutor(
          max_workers=10
      ) as executor:
          future = executor.submit(
              _extract_dirs_to_delete,
              executor=executor,
              curr_dir=data_dir,
              curr_tree=full_names_tree,
          )
  
          dirs_to_keep = []
          dirs_to_delete = []
          _extract_dirs_from_future(
              dirs_to_keep=dirs_to_keep,
              dirs_to_delete=dirs_to_delete,
              future=future,
          )
      return sorted(dirs_to_keep), sorted(dirs_to_delete)
  
file_path: datasets/tensorflow_datasets/scripts/cleanup/delete_old_versions.py
imports: import collections
  import concurrent.futures
  import dataclasses
  import os
  import pathlib
  from typing import Dict, Iterable, List, Tuple
  from absl import app
  from absl import flags
  import tensorflow_datasets
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  import termcolor
label_desc: Use image node_id 5 for calling a global function with example usage: _get_extra_dirs(data_dir, current_full_names) and returns: sorted,  sorted