code: def _format_example_as_numpy_dict(example, feature_shape_dict):
      result = example_coder.ExampleToNumpyDict(example)
      for key, value in result.items():
          shape = feature_shape_dict[key]
          value = value.reshape(shape)
          if not shape:
              value = value.squeeze(0)
          result[key] = value
      return result
  
imports: import os
  import tempfile
  from typing import Dict, Iterable, List, Optional, Tuple
  from absl import logging
  import apache_beam
  import pyarrow
  import tensorflow
  import tensorflow_transform
  import tensorflow_transform.beam
  from tensorflow_transform.beam.tft_beam_io import transform_fn_io
  from tensorflow_transform import test_case
  from tensorflow_transform.beam import test_helpers
  from tensorflow_transform.tf_metadata import dataset_metadata
  from tfx_bsl.coders import example_coder
  import unittest
  from tensorflow.python.util.protobuf import compare
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 3 for calling a global function with example usage: _format_example_as_numpy_dict(example, feature_shape_dict) and returns: result