class_docstr: Writes InputFeature to TF example file.
docstr: Write a InputFeature to the TFRecordWriter as a tf.train.Example.
docstr_tok: ["Write","a","InputFeature","to","the","TFRecordWriter","as","a","tf.train.Example","."]
code: def process_feature(self, feature):
      """Write a InputFeature to the TFRecordWriter as a tf.train.Example."""
      self.num_features += 1
  
      def create_int_feature(values):
          feature = tf.train.Feature(
              int64_list=tf.train.Int64List(value=list(values))
          )
          return feature
  
      features = collections.OrderedDict()
      features["unique_ids"] = create_int_feature([feature.unique_id])
      features["input_ids"] = create_int_feature(feature.input_ids)
      features["input_mask"] = create_int_feature(feature.input_mask)
      features["segment_ids"] = create_int_feature(feature.segment_ids)
  
      if self.is_training:
          features["start_positions"] = create_int_feature(
              [feature.start_position]
          )
          features["end_positions"] = create_int_feature(
              [feature.end_position]
          )
          impossible = 0
          if feature.is_impossible:
              impossible = 1
          features["is_impossible"] = create_int_feature([impossible])
  
      tf_example = tf.train.Example(
          features=tf.train.Features(feature=features)
      )
      self._writer.write(tf_example.SerializeToString())
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import json
  import math
  import os
  import random
  import mesh_tensorflow
  import mesh_tensorflow.bert.bert
  import mesh_tensorflow.bert.optimization
  import mesh_tensorflow.bert.tokenization
  import six
  from six.moves import range
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 2 for calling the FeatureWriter obj's underlying member method code with example usage: obj.process_feature(feature) and returns: feature