# Path: tensorflow_transform/common_types.py
# def is_ragged_feature_available() -> bool:
# def is_ragged_feature(spec: FeatureSpecType) -> bool:
# 
# Path: tensorflow_transform/tf_metadata/schema_utils.py
# TENSOR_REPRESENTATION_GROUP = ''
# RAGGED_TENSOR_TAG = 'ragged_tensor'
# _DEPRECATED_LIFECYCLE_STAGES = [
#     schema_pb2.DEPRECATED, schema_pb2.DISABLED, schema_pb2.PLANNED,
#     schema_pb2.ALPHA, schema_pb2.DEBUG_ONLY
# ]
# _LEGACY_DEFAULT_VALUE_FOR_DTYPE = {tf.string: '', tf.int64: -1, tf.float32: -1}
# def schema_from_feature_spec(
#     feature_spec: Mapping[str, common_types.FeatureSpecType],
#     domains: Optional[Mapping[str, common_types.DomainType]] = None
# ) -> schema_pb2.Schema:
# def _ragged_tensor_representation_from_feature_spec(
#     spec: common_types.RaggedFeature, name: str,
#     domains: Dict[str, common_types.DomainType]
# ) -> Tuple[schema_pb2.Feature, List[schema_pb2.Feature],
# def _sparse_feature_from_feature_spec(spec, name, domains):
# def _feature_from_feature_spec(spec, name, domains):
# def _set_type(name, feature, dtype):
# def _set_domain(name, feature, domain):
# def schema_as_feature_spec(
#     schema_proto: schema_pb2.Schema) -> SchemaAsFeatureSpecResult:
# def _get_string_domains(schema):
# def _get_domain(feature, string_domains):
# def pop_ragged_source_columns(
#     name: str, tensor_representation: schema_pb2.TensorRepresentation,
#     feature_by_name: Dict[str, schema_pb2.Feature]) -> schema_pb2.Feature:
# def _ragged_tensor_representation_as_feature_spec(
#     name: str, tensor_representation: schema_pb2.TensorRepresentation,
#     feature_by_name: Dict[str, schema_pb2.Feature],
#     string_domains: Dict[str, common_types.DomainType]
# ) -> Tuple[common_types.RaggedFeature, Optional[common_types.DomainType]]:
# def _sparse_feature_as_feature_spec(feature, feature_by_name, string_domains):
# def _feature_as_feature_spec(feature, string_domains):
# def _feature_dtype(feature):
# def _fixed_shape_as_tf_shape(fixed_shape):
# def _include_in_parsing_spec(feature):
# def _legacy_schema_from_feature_spec(feature_spec, domains=None):
# def _legacy_schema_as_feature_spec(schema_proto):
# def _legacy_feature_as_feature_spec(feature):
# def _legacy_infer_default_value(feature_proto, dtype):


import numpy as np
import tensorflow as tf
from tensorflow_transform import common_types
from tensorflow_transform.tf_metadata import schema_utils
      casted = self._cast_fn(values)
      self._value.extend(casted)


class ExampleProtoCoder:
  """A coder between maybe-serialized TF Examples and tf.Transform datasets."""

  def __init__(self, schema, serialized=True):
    """Build an ExampleProtoCoder.

    Args:
      schema: A `Schema` proto.
      serialized: Whether to encode serialized Example protos (as opposed to
        in-memory Example protos).

    Raises:
      ValueError: If `schema` is invalid.
    """
    self._schema = schema
    self._serialized = serialized

    # Using pre-allocated tf.train.Example and FeatureHandler objects for
    # performance reasons.
    #
    # Since the output of "encode" is deep as opposed to shallow
    # transformations, and since the schema always fully defines the Example's
    # FeatureMap (ie all fields are always cleared/assigned or copied), the
    # optimization and implementation are correct and thread-compatible.
    self._encode_example_cache = tf.train.Example()
    self._feature_handlers = []

# Path: tensorflow_transform/common_types.py
# def is_ragged_feature_available() -> bool:
# def is_ragged_feature(spec: FeatureSpecType) -> bool:
# 
# Path: tensorflow_transform/tf_metadata/schema_utils.py
# TENSOR_REPRESENTATION_GROUP = ''
# RAGGED_TENSOR_TAG = 'ragged_tensor'
# _DEPRECATED_LIFECYCLE_STAGES = [
#     schema_pb2.DEPRECATED, schema_pb2.DISABLED, schema_pb2.PLANNED,
#     schema_pb2.ALPHA, schema_pb2.DEBUG_ONLY
# ]
# _LEGACY_DEFAULT_VALUE_FOR_DTYPE = {tf.string: '', tf.int64: -1, tf.float32: -1}
# def schema_from_feature_spec(
#     feature_spec: Mapping[str, common_types.FeatureSpecType],
#     domains: Optional[Mapping[str, common_types.DomainType]] = None
# ) -> schema_pb2.Schema:
# def _ragged_tensor_representation_from_feature_spec(
#     spec: common_types.RaggedFeature, name: str,
#     domains: Dict[str, common_types.DomainType]
# ) -> Tuple[schema_pb2.Feature, List[schema_pb2.Feature],
# def _sparse_feature_from_feature_spec(spec, name, domains):
# def _feature_from_feature_spec(spec, name, domains):
# def _set_type(name, feature, dtype):
# def _set_domain(name, feature, domain):
# def schema_as_feature_spec(
#     schema_proto: schema_pb2.Schema) -> SchemaAsFeatureSpecResult:
# def _get_string_domains(schema):
# def _get_domain(feature, string_domains):
# def pop_ragged_source_columns(
#     name: str, tensor_representation: schema_pb2.TensorRepresentation,
#     feature_by_name: Dict[str, schema_pb2.Feature]) -> schema_pb2.Feature:
# def _ragged_tensor_representation_as_feature_spec(
#     name: str, tensor_representation: schema_pb2.TensorRepresentation,
#     feature_by_name: Dict[str, schema_pb2.Feature],
#     string_domains: Dict[str, common_types.DomainType]
# ) -> Tuple[common_types.RaggedFeature, Optional[common_types.DomainType]]:
# def _sparse_feature_as_feature_spec(feature, feature_by_name, string_domains):
# def _feature_as_feature_spec(feature, string_domains):
# def _feature_dtype(feature):
# def _fixed_shape_as_tf_shape(fixed_shape):
# def _include_in_parsing_spec(feature):
# def _legacy_schema_from_feature_spec(feature_spec, domains=None):
# def _legacy_schema_as_feature_spec(schema_proto):
# def _legacy_feature_as_feature_spec(feature):
# def _legacy_infer_default_value(feature_proto, dtype):


# Path: tensorflow_transform/coders/example_proto_coder.py
import numpy as np
import tensorflow as tf
from tensorflow_transform import common_types
from tensorflow_transform.tf_metadata import schema_utils

      casted = self._cast_fn(values)
      self._value.extend(casted)


class ExampleProtoCoder:
  """A coder between maybe-serialized TF Examples and tf.Transform datasets."""

  def __init__(self, schema, serialized=True):
    """Build an ExampleProtoCoder.

    Args:
      schema: A `Schema` proto.
      serialized: Whether to encode serialized Example protos (as opposed to
        in-memory Example protos).

    Raises:
      ValueError: If `schema` is invalid.
    """
    self._schema = schema
    self._serialized = serialized

    # Using pre-allocated tf.train.Example and FeatureHandler objects for
    # performance reasons.
    #
    # Since the output of "encode" is deep as opposed to shallow
    # transformations, and since the schema always fully defines the Example's
    # FeatureMap (ie all fields are always cleared/assigned or copied), the
    # optimization and implementation are correct and thread-compatible.
    self._encode_example_cache = tf.train.Example()
    self._feature_handlers = []

    for name, feature_spec in schema_utils.schema_as_feature_spec(