def get_feature(example, feature_name):
  """Returns the type and value list of a `tf.Feature`."""
  feature = example.features.feature.get(feature_name)
  if not feature:
    return None, []
  kind = feature.WhichOneof('kind')
  if kind is None:
    return None, []
  return kind, getattr(feature, kind).value