code: def _observe_dnn_model(output_dict: Dict[str, Any]):
      """Observe feature and feature metadata from DNN models.
  
      We do this by monkey-patching the appropriate input feature layers and
      Keras model objects.
  
      Args:
        output_dict: Dictionary to write observed information to.
  
      Yields:
        Nothing.
      """
  
      dense_feature_module = _get_dense_features_module()
      old_dense_features_call = dense_feature_module.DenseFeatures.call
      dense_feature_module.DenseFeatures.call = (
          _make_observing_layer_call(
              old_dense_features_call, "dnn_model", output_dict
          )
      )
  
      old_dnn_model_call = (
          dnn._DNNModel.call
      )  # pylint: disable=protected-access
      dnn._DNNModel.call = _make_observing_model_call(  # pylint: disable=protected-access
          old_dnn_model_call, "dnn_model", output_dict
      )
  
      old_dnn_model_v2_call = (
          dnn._DNNModelV2.call
      )  # pylint: disable=protected-access
      dnn._DNNModelV2.call = _make_observing_model_call(  # pylint: disable=protected-access
          old_dnn_model_v2_call, "dnn_model", output_dict
      )
  
      # This is a contextmanager, meant to be used in a with statement like
      # with _observe_dnn_model(output_dict):
      #   ...
      # The code before the yield will execute when the with statement is executed,
      # and the code after the yield will execute on exiting the with block.
      yield
  
      dnn._DNNModel.call = (
          old_dnn_model_call  # pylint: disable=protected-access
      )
      dnn._DNNModelV2.call = (
          old_dnn_model_v2_call  # pylint: disable=protected-access
      )
      dense_feature_module.DenseFeatures.call = old_dense_features_call
  
imports: import contextlib
  import inspect
  import os
  import pickle
  from typing import Any, Callable, Dict, Optional
  import six
  import tensorflow
  from tensorflow import estimator
  import tensorflow_model_analysis
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.utils import util
  from tensorflow.python.feature_column import feature_column_v2
  from tensorflow_estimator.python.estimator.canned import dnn
label_desc: Use image node_id 4 for calling a global function with example usage: _observe_dnn_model(output_dict) without return types