code: def add_data_dir(data_dir):
      """Registers a new default `data_dir` to search for datasets.
  
      When a `tfds.core.DatasetBuilder` is created with `data_dir=None`, TFDS
      will look in all registered `data_dir` (including the default one) to
      load existing datasets.
  
      * An error is raised if a dataset can be loaded from more than 1 registered
        data_dir.
      * This only affects reading datasets. Generation always uses the
        `data_dir` kwargs when specified or `tfds.core.constant.DATA_DIR` otherwise.
  
      Args:
        data_dir: New data_dir to register.
      """
      # Remove trailing / to avoid same directory being included twice in the set
      # with and without a final slash.
      data_dir = data_dir.rstrip("/")
      _registered_data_dir.add(data_dir)
  
imports: import collections
  import functools
  import os
  import re
  import time
  from typing import Iterator, List, Optional
  from absl import logging
  from etils import epath
  from tensorflow_datasets.core import constants
  from tensorflow_datasets.core import naming
  from tensorflow_datasets.core.utils import docs
  from tensorflow_datasets.core.utils import py_utils
  from tensorflow_datasets.core.utils import read_config
  from tensorflow_datasets.core.utils import type_utils
  from tensorflow_datasets.core.utils import version
label_desc: Use image node_id 2 for calling a global function with example usage: add_data_dir(data_dir) without return types