code: def _extract_metadata_versions(metadata_dir: str) -> List[str]:
      """Get all metadata directory versions paths.
  
      It only extracts the paths like 'dataset_name/version'
      or 'dataset_name/config/versions' in metadata dir.
  
      Args:
        metadata_dir: Path to metadata directory (testing/metadata).
  
      Returns:
        Existing metadata full names.
      """
      existing_names = []
      for root, _, _ in tf.io.gfile.walk(metadata_dir):
          full_name = root[len(metadata_dir) + 1 :]
          if tfds.core.load.is_full_name(full_name):
              existing_names.append(full_name)
      return existing_names
  
file_path: datasets/tensorflow_datasets/scripts/cleanup/metadata_cleanup.py
imports: import os
  from typing import List
  from absl import app
  from absl import flags
  import tensorflow_datasets
  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: _extract_metadata_versions(metadata_dir) and returns: existing_names