code: def proto_value_for_feature(example, feature_name):
    
    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
docs: Get the value of a feature from Example regardless of feature type.