code: def _get_tfds_id_prefixes(
      file_instructions: Sequence[shard_utils.FileInstruction],
  ) -> dict[str, str]:
      """Returns the tfds id prefix per filename.
  
      If the file instructions are for files in different directories, then the TFDS
      id prefix includes part of the folder. This is to avoid duplicate TFDS ids
      when different directories contain the same filenames. For example, if the
      file instructions contain file paths `['/a/b/c', '/x/y/c']`, then this returns
      `{'/a/b/c': 'b/c', '/x/y/c': 'y/c'}`.
  
      Arguments:
        file_instructions: the file instructions for which to get TFDS id prefixes.
  
      Returns:
        the TFDS id prefix per filename.
      """
      dirnames = set(i.dirname() for i in file_instructions)
      reversed_dirnames = [d[::-1] for d in dirnames]
      common_suffix = os.path.commonprefix(reversed_dirnames)[::-1]
  
      def get_tfds_id(instruction: shard_utils.FileInstruction) -> str:
          # Return the file name when all files are in the same directory.
          if len(dirnames) == 1:
              return instruction.basename()
          # Otherwise, return the relative path starting from the deepest folder that
          # differs.
          return re.sub(
              rf".*\/([^/]+{common_suffix}/[^/]+)",
              r"\1",
              instruction.filename,
          )
  
      return {fi.filename: get_tfds_id(fi) for fi in file_instructions}
  
imports: from __future__ import annotations
  import functools
  import os
  import re
  from typing import Any, Callable, List, NamedTuple, Optional, Sequence
  from absl import logging
  import numpy
  from tensorflow_datasets.core import example_parser
  from tensorflow_datasets.core import file_adapters
  from tensorflow_datasets.core import splits
  from tensorflow_datasets.core import tf_compat
  from tensorflow_datasets.core import utils
  from tensorflow_datasets.core.utils import file_utils
  from tensorflow_datasets.core.utils import read_config
  from tensorflow_datasets.core.utils import shard_utils
  from tensorflow_datasets.core.utils import tree_utils
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
label_desc: Use image node_id 5 for calling a global function with example usage: _get_tfds_id_prefixes(file_instructions) and returns: unknown, re, instruction