class_docstr: Represents how to handle external state during serialization.
  
  See the `tf.data.Options.experimental_external_state_policy` documentation
  for more information.
class_docstr_tok: ["Represents","how","to","handle","external","state","during","serialization",".","See","the","`","tf.data.Options.experimental_external_state_policy","`","documentation","for","more","information","."]
docstr: Convert enum to proto.
docstr_tok: ["Convert","enum","to","proto","."]
code: def _to_proto(cls, obj):
      """Convert enum to proto."""
      if obj == cls.IGNORE:
          return dataset_options_pb2.ExternalStatePolicy.POLICY_IGNORE
      if obj == cls.FAIL:
          return dataset_options_pb2.ExternalStatePolicy.POLICY_FAIL
      if obj == cls.WARN:
          return dataset_options_pb2.ExternalStatePolicy.POLICY_WARN
      raise ValueError(
          f"Invalid `obj.` Supported values include `POLICY_IGNORE`,"
          f"`POLICY_FAIL`, `POLICY_WARN`. Got {obj.name}."
      )
  
imports: import enum
  import platform
  from absl import logging
  from tensorflow.core.framework import dataset_options_pb2
  from tensorflow.core.framework import model_pb2
  from tensorflow.python.data.ops import test_mode
  from tensorflow.python.data.util import options
  from tensorflow.python.util import deprecation
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 1 for calling the ExternalStatePolicy obj's underlying member method code with example usage: obj._to_proto(cls, obj) and returns: dataset_options_pb2, dataset_options_pb2, dataset_options_pb2