# 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_legacy.py
# def should_set_generate_legacy_feature_spec(feature_spec):
# def set_generate_legacy_feature_spec(schema_proto, value):
# def get_generate_legacy_feature_spec(schema_proto):
# def check_for_unsupported_features(schema_proto):
# def get_deprecated(feature):


import typing
import tensorflow as tf
from typing import Dict, List, Mapping, Optional, Tuple
from tensorflow_transform import common_types
from tensorflow_transform.tf_metadata import schema_utils_legacy
from tfx_bsl.tfxio import tensor_representation_util
from tfx_bsl.types import tfx_namedtuple
from tensorflow_metadata.proto.v0 import path_pb2
from tensorflow_metadata.proto.v0 import schema_pb2
  for feature in schema_proto.sparse_feature:
    if _include_in_parsing_spec(feature):
      feature_spec[feature.name], domains[feature.name] = (
          _sparse_feature_as_feature_spec(feature, feature_by_name,
                                          string_domains))

  # Handle ragged `TensorRepresentation`s.
  tensor_representations = (
      tensor_representation_util.GetTensorRepresentationsFromSchema(
          schema_proto, TENSOR_REPRESENTATION_GROUP))
  if tensor_representations is not None:
    for name, tensor_representation in tensor_representations.items():
      if name in feature_by_name:
        raise ValueError(
            'Ragged TensorRepresentation name "{}" conflicts with a different '
            'feature in the same schema.'.format(name))
      (feature_spec[name], domains[name]) = (
          _ragged_tensor_representation_as_feature_spec(name,
                                                        tensor_representation,
                                                        feature_by_name,
                                                        string_domains))

  # Generate a `tf.FixedLenFeature` or `tf.VarLenFeature` for each element of
  # `schema_proto.feature` that was not referenced by a `SparseFeature` or a
  # ragged `TensorRepresentation`.
  for name, feature in feature_by_name.items():
    if _include_in_parsing_spec(feature):
      feature_spec[name], domains[name] = _feature_as_feature_spec(
          feature, string_domains)


# 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_legacy.py
# def should_set_generate_legacy_feature_spec(feature_spec):
# def set_generate_legacy_feature_spec(schema_proto, value):
# def get_generate_legacy_feature_spec(schema_proto):
# def check_for_unsupported_features(schema_proto):
# def get_deprecated(feature):


# Path: tensorflow_transform/tf_metadata/schema_utils.py
import typing
import tensorflow as tf
from typing import Dict, List, Mapping, Optional, Tuple
from tensorflow_transform import common_types
from tensorflow_transform.tf_metadata import schema_utils_legacy
from tfx_bsl.tfxio import tensor_representation_util
from tfx_bsl.types import tfx_namedtuple
from tensorflow_metadata.proto.v0 import path_pb2
from tensorflow_metadata.proto.v0 import schema_pb2

  for feature in schema_proto.sparse_feature:
    if _include_in_parsing_spec(feature):
      feature_spec[feature.name], domains[feature.name] = (
          _sparse_feature_as_feature_spec(feature, feature_by_name,
                                          string_domains))

  # Handle ragged `TensorRepresentation`s.
  tensor_representations = (
      tensor_representation_util.GetTensorRepresentationsFromSchema(
          schema_proto, TENSOR_REPRESENTATION_GROUP))
  if tensor_representations is not None:
    for name, tensor_representation in tensor_representations.items():
      if name in feature_by_name:
        raise ValueError(
            'Ragged TensorRepresentation name "{}" conflicts with a different '
            'feature in the same schema.'.format(name))
      (feature_spec[name], domains[name]) = (
          _ragged_tensor_representation_as_feature_spec(name,
                                                        tensor_representation,
                                                        feature_by_name,
                                                        string_domains))

  # Generate a `tf.FixedLenFeature` or `tf.VarLenFeature` for each element of
  # `schema_proto.feature` that was not referenced by a `SparseFeature` or a
  # ragged `TensorRepresentation`.
  for name, feature in feature_by_name.items():
    if _include_in_parsing_spec(feature):
      feature_spec[name], domains[name] = _feature_as_feature_spec(
          feature, string_domains)


  schema_utils_legacy.check_for_unsupported_features(schema_proto)