code: def tf_example_to_feature_description(
      example: Union[tf.Tensor, bytes],
      num_timesteps=DEFAULT_NUM_TIMESTEPS,
  ):
      """Takes a string tensor encoding an tf example and returns its features."""
      if isinstance(example, tf.Tensor):
          if not tf.executing_eagerly():
              raise AssertionError(
                  "tf_example_to_feature_description() only works under eager mode."
              )
          example = example.numpy()  # pytype: disable=attribute-error
      example = tf.train.Example.FromString(example)
  
      ret = {}
      for k, v in example.features.feature.items():
          l = len(v.float_list.value)
          if l % num_timesteps:
              raise ValueError(
                  "Unexpected feature length %d. It should be divisible "
                  "by num_timesteps: %d" % (l, num_timesteps)
              )
          size = l // num_timesteps
          ret[k] = tf.io.FixedLenFeature(
              [num_timesteps, size], tf.float32
          )
      return ret
  
imports: from __future__ import annotations
  import collections
  import dataclasses
  import functools
  import os
  from typing import Any, Dict, Generator, Optional, Sequence, Text, Tuple, Union
  import numpy
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  import tensorflow_datasets.public_api
  from tensorflow_datasets.rl_unplugged import rlu_common
label_desc: Use image node_id 3 for calling a global function with example usage: tf_example_to_feature_description(example, num_timesteps) and returns: ret