# 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
          tensor_representation))
  missing_column_error_format = (
      'Ragged feature "{}" referred to value feature "{}" which did not exist '
      'in the schema or was referred to as an index or value multiple times.')

  assert source_columns
  assert len(source_columns[0].steps()) == 1, (name, source_columns[0].steps())
  try:
    value_feature = feature_by_name.pop(source_columns[0].steps()[0])
  except KeyError:
    raise ValueError(
        missing_column_error_format.format(name, source_columns[0].steps()[0]))
  for column_path in source_columns[1:]:
    assert len(column_path.steps()) == 1, (name, column_path.steps())
    try:
      row_length_feature = feature_by_name.pop(column_path.steps()[0])
    except KeyError:
      raise ValueError(
          missing_column_error_format.format(name,
                                             column_path.steps()[0]))
    if row_length_feature.type != schema_pb2.FeatureType.INT:
      raise ValueError(
          'Row length feature "{}" is not an integer feature.'.format(
              row_length_feature.name))
  return value_feature


def _ragged_tensor_representation_as_feature_spec(
    name: str, tensor_representation: schema_pb2.TensorRepresentation,
    feature_by_name: Dict[str, schema_pb2.Feature],

# 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

          tensor_representation))
  missing_column_error_format = (
      'Ragged feature "{}" referred to value feature "{}" which did not exist '
      'in the schema or was referred to as an index or value multiple times.')

  assert source_columns
  assert len(source_columns[0].steps()) == 1, (name, source_columns[0].steps())
  try:
    value_feature = feature_by_name.pop(source_columns[0].steps()[0])
  except KeyError:
    raise ValueError(
        missing_column_error_format.format(name, source_columns[0].steps()[0]))
  for column_path in source_columns[1:]:
    assert len(column_path.steps()) == 1, (name, column_path.steps())
    try:
      row_length_feature = feature_by_name.pop(column_path.steps()[0])
    except KeyError:
      raise ValueError(
          missing_column_error_format.format(name,
                                             column_path.steps()[0]))
    if row_length_feature.type != schema_pb2.FeatureType.INT:
      raise ValueError(
          'Row length feature "{}" is not an integer feature.'.format(
              row_length_feature.name))
  return value_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]