class_docstr: Serializes the proto if needed.
class_docstr_tok: ["Serializes","the","proto","if","needed","."]
code: def process(
      self, e: Union[tf.train.Example, tf.train.SequenceExample, bytes]
  ):
      self._num_instances.inc(1)
      if isinstance(e, (tf.train.Example, tf.train.SequenceExample)):
          yield e.SerializeToString()  # pytype: disable=attribute-error
      else:
          yield e
  
file_path: tfx/tfx/components/example_gen/write_split.py
imports: import os
  from typing import Optional, Any, Dict, Union
  import apache_beam
  import tensorflow
  from tfx.proto import example_gen_pb2
  from tfx.types import standard_component_specs
  from tfx.utils import deprecation_utils
  from tfx_bsl.telemetry import util
label_desc: Use image node_id 2 for calling the MaybeSerialize obj's underlying member method code with example usage: obj.process(e) without return types