class_docstr: Handler for `VarLenFeature` values.
  
  `VarLenFeature` values will be parsed as an array of the corresponding dtype.
class_docstr_tok: ["Handler","for","`","VarLenFeature","`","values",".","`","VarLenFeature","`","values","will","be","parsed","as","an","array","of","the","corresponding","dtype","."]
docstr: Encode values as tf.train.Feature.
docstr_tok: ["Encode","values","as","tf.train.Feature","."]
code: def encode_value(self, values):
      """Encode values as tf.train.Feature."""
      if values is None:
          self._feature.Clear()
          # Note after Clear(), self._value no longer points to a submessage of
          # self._feature so we need to reset it.
          self._value = self._value_fn(self._feature)
      else:
          del self._value[:]
  
          # Scalar must be length 1 array.
          values = (
              values
              if isinstance(values, (list, np.ndarray))
              else [values]
          )
          casted = self._cast_fn(values)
          self._value.extend(casted)
  
file_path: transform/tensorflow_transform/coders/example_proto_coder.py
imports: import numpy
  import tensorflow
  from tensorflow_transform.tf_metadata import schema_utils
label_desc: Use image node_id 4 for calling the _VarLenFeatureHandler obj's underlying member method code with example usage: obj.encode_value(values) without return types