code: def proto_value_for_feature(example, feature_name):
      """Get the value of a feature from Example regardless of feature type."""
      feature = get_example_features(example)[feature_name]
      if feature is None:
          raise ValueError(
              "Feature {} is not on example proto.".format(feature_name)
          )
      feature_type = feature.WhichOneof("kind")
      if feature_type is None:
          raise ValueError(
              "Feature {} on example proto has no declared type.".format(
                  feature_name
              )
          )
      return getattr(feature, feature_type).value
  
imports: from __future__ import division
  from __future__ import print_function
  import collections
  import copy
  import json
  import math
  from absl import logging
  import numpy
  import tensorflow
  from google.protobuf import json_format
  from six import binary_type, string_types, integer_types
  from six import iteritems
  from six.moves import zip
  from inspect import signature
  from utils import common_utils
  from utils import platform_utils
  from tensorflow_serving.apis import classification_pb2
  from tensorflow_serving.apis import inference_pb2
  from tensorflow_serving.apis import regression_pb2
label_desc: Use image node_id 2 for calling a global function with example usage: proto_value_for_feature(example, feature_name) and returns: getattr