# 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):


from typing import Mapping, Optional, Type, TypeVar
from tensorflow_transform import common_types
from tensorflow_transform.tf_metadata import schema_utils
from tensorflow_metadata.proto.v0 import schema_pb2
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""In-memory representation of all metadata associated with a dataset."""



_DatasetMetadataType = TypeVar('_DatasetMetadataType', bound='DatasetMetadata')


class DatasetMetadata:
  """A collection of metadata about a dataset.

  This is an in-memory representation that may be serialized and deserialized to
  and from a variety of disk representations.
  """

  def __init__(self, schema: schema_pb2.Schema):
    self._schema = schema

  @classmethod
  def from_feature_spec(
      cls: Type[_DatasetMetadataType],
      feature_spec: Mapping[str, common_types.FeatureSpecType],

# 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/tf_metadata/dataset_metadata.py
from typing import Mapping, Optional, Type, TypeVar
from tensorflow_transform import common_types
from tensorflow_transform.tf_metadata import schema_utils
from tensorflow_metadata.proto.v0 import schema_pb2

# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""In-memory representation of all metadata associated with a dataset."""



_DatasetMetadataType = TypeVar('_DatasetMetadataType', bound='DatasetMetadata')


class DatasetMetadata:
  """A collection of metadata about a dataset.

  This is an in-memory representation that may be serialized and deserialized to
  and from a variety of disk representations.
  """

  def __init__(self, schema: schema_pb2.Schema):
    self._schema = schema

  @classmethod
  def from_feature_spec(
      cls: Type[_DatasetMetadataType],
      feature_spec: Mapping[str, common_types.FeatureSpecType],

      domains: Optional[Mapping[str, common_types.DomainType]] = None