code: def get_base_dirs_and_prefixes(code_url_prefix):
      """Returns the base_dirs and code_prefixes for OSS TensorFlow api gen."""
      base_dir = pathlib.Path(tf.__file__).parent
  
      if "dev" in tf.__version__:
          keras_url_prefix = (
              "https://github.com/keras-team/keras/tree/master/keras"
          )
      else:
          keras_url_prefix = f"https://github.com/keras-team/keras/tree/v{keras.__version__}/keras"
  
      if version.parse(tf.__version__) >= version.parse("2.13"):
          # First match takes precedence.
          # Objects are dropped if they have no match.
          base_dirs = [
              # The real keras source files are now in `site-packages/keras/src/...`
              pathlib.Path(keras.__file__).parent / "src",
              # The generated module files in tensorflow are in keras
              # under `site-packages/keras/api/_v2/keras/...`.
              pathlib.Path(tf.keras.__file__).parent,
              # The generated api-module files are now in `site-packages/keras/...`
              pathlib.Path(keras.__file__).parent,
              pathlib.Path(tensorboard.__file__).parent,
              pathlib.Path(tensorflow_estimator.__file__).parent,
              # The tensorflow base dir goes last because `tf.keras``
              base_dir,
          ]
  
          code_url_prefixes = (
              keras_url_prefix,
              # None -> don't link to the generated keras api-module files.
              None,
              None,
              f"https://github.com/tensorflow/tensorboard/tree/{tensorboard.__version__}/tensorboard",
              "https://github.com/tensorflow/estimator/tree/master/tensorflow_estimator",
              code_url_prefix,
          )
      elif version.parse(tf.__version__) >= version.parse("2.9"):
          base_dirs = [
              base_dir,
              pathlib.Path(keras.__file__).parent,
              pathlib.Path(tensorboard.__file__).parent,
              pathlib.Path(tensorflow_estimator.__file__).parent,
          ]
          code_url_prefixes = (
              code_url_prefix,
              keras_url_prefix,
              f"https://github.com/tensorflow/tensorboard/tree/{tensorboard.__version__}/tensorboard",
              "https://github.com/tensorflow/estimator/tree/master/tensorflow_estimator",
          )
      else:
          raise ValueError("Unsupported: version < 2.9")
  
      return base_dirs, code_url_prefixes
  
file_path: tensorflow-upstream/tensorflow/tools/docs/base_dir.py
imports: import pathlib
  import keras
  from packaging import version
  import tensorboard
  import tensorflow
  from tensorflow_docs.api_generator import public_api
  import tensorflow_estimator
label_desc: Use image node_id 1 for calling a global function with example usage: get_base_dirs_and_prefixes(code_url_prefix) and returns: base_dirs,  code_url_prefixes