code: def _decode_with_id(
      id_ex: _IdExample,
      decode_fn: DecodeFn,
  ) -> TreeDict[Tensor]:
      """Add the `'tfds_id': ...` to the decoded example `dict`."""
      if not isinstance(id_ex, _IdExample):
          raise TypeError(
              f"Reader should return _IdExample when `add_tfds_id=True`. Got: {id_ex}"
          )
      decoded_ex = decode_fn(id_ex.example)
      if not isinstance(decoded_ex, dict):
          raise TypeError(
              f"Features should be `dict` when `add_tfds_id=True`. Got: {decoded_ex}"
          )
      decoded_ex["tfds_id"] = id_ex.id
      return decoded_ex
  
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 4 for calling a global function with example usage: _decode_with_id(id_ex, decode_fn) and returns: decoded_ex