code: def _get_existing_dataset_packages(
      datasets_dir: Text,
  ) -> Dict[Text, Tuple[epath.Path, Text]]:
      """Returns existing datasets.
  
      Args:
        datasets_dir: directory path, relative to tensorflow_datasets srcs root,
          where are defined the dataset packages. This directory must only contain
          valid dataset packages.
  
      Returns:
        {ds_name: (pkg_path, builder_module)}.
        For example: {'mnist': ('/lib/tensorflow_datasets/datasets/mnist',
                                'tensorflow_datasets.datasets.mnist.builder')}
      """
      datasets = {}
      try:
          datasets_dir_path = resource_utils.tfds_path(datasets_dir)
      except OSError:
          # Raised when datasets_dir does not exist, for example in tests when data
          # does not contain the directory (when running with bazel).
          return datasets
      if not datasets_dir_path.exists():
          return datasets
      ds_dir_pkg = ".".join(
          ["tensorflow_datasets"] + datasets_dir.split(os.path.sep)
      )
      for child in datasets_dir_path.iterdir():
          # Except for a few exceptions, all children of datasets/ directory are
          # packages of datasets, no needs to check child is a directory and contains
          # a `builder.py` module.
          exceptions = [
              "__init__.py",
          ]
          if child.name not in exceptions:
              pkg_path = epath.Path(datasets_dir_path) / child.name
              builder_module = f"{ds_dir_pkg}.{child.name}.{child.name}{_BUILDER_MODULE_SUFFIX}"
              datasets[child.name] = (pkg_path, builder_module)
      return datasets
  
imports: import abc
  import collections
  import contextlib
  import functools
  import importlib
  import inspect
  import os.path
  from typing import ClassVar, Dict, Iterator, List, Type, Text, Tuple
  from etils import epath
  from tensorflow_datasets.core import constants
  from tensorflow_datasets.core import naming
  from tensorflow_datasets.core import visibility
  from tensorflow_datasets.core.utils import py_utils
  from tensorflow_datasets.core.utils import resource_utils
label_desc: Use image node_id 7 for calling a global function with example usage: _get_existing_dataset_packages(datasets_dir) and returns: datasets, datasets, datasets