# Path: model_card_toolkit/utils/validation.py
# _SCHEMA_FILE_NAME = 'model_card.schema.json'
# _SCHEMA_VERSIONS = frozenset(('0.0.1', '0.0.2',))
# _LATEST_SCHEMA_VERSION = max(_SCHEMA_VERSIONS, key=semantic_version.Version)
# SCHEMA_VERSION_STRING = 'schema_version'
# def validate_json_schema(
#     json_dict: Dict[str, Any],
#     schema_version: Optional[str] = None) -> Dict[str, Any]:
# def _find_json_schema(schema_version: Optional[str] = None) -> Dict[str, Any]:
# def get_latest_schema_version() -> str:


import abc
import dataclasses
import json as json_lib
from typing import Any, Dict
from model_card_toolkit.utils import validation
from google.protobuf import descriptor
from google.protobuf import message
            getattr(self, field_name).append(field)

        elif proto.HasField(field_name):
          getattr(self, field_name)._from_proto(getattr(proto, field_name))  # pylint: disable=protected-access

      # Process Non-Message type
      else:
        if field_descriptor.label == descriptor.FieldDescriptor.LABEL_REPEATED:
          setattr(self, field_name, getattr(proto, field_name)[:])
        elif proto.HasField(field_name):
          setattr(self, field_name, getattr(proto, field_name))

    return self

  def merge_from_proto(self, proto: message.Message) -> "BaseModelCardField":
    """Merges the contents of the model card proto into current object."""
    current = self.to_proto()
    current.MergeFrom(proto)
    self.clear()
    return self._from_proto(current)

  def copy_from_proto(self, proto: message.Message) -> "BaseModelCardField":
    """Copies the contents of the model card proto into current object."""
    self.clear()
    return self._from_proto(proto)

  def _from_json(self, json_dict: Dict[str, Any],
                 field: "BaseModelCardField") -> "BaseModelCardField":
    """Parses a JSON dictionary into the current object."""
    for subfield_key, subfield_json_value in json_dict.items():

# Path: model_card_toolkit/utils/validation.py
# _SCHEMA_FILE_NAME = 'model_card.schema.json'
# _SCHEMA_VERSIONS = frozenset(('0.0.1', '0.0.2',))
# _LATEST_SCHEMA_VERSION = max(_SCHEMA_VERSIONS, key=semantic_version.Version)
# SCHEMA_VERSION_STRING = 'schema_version'
# def validate_json_schema(
#     json_dict: Dict[str, Any],
#     schema_version: Optional[str] = None) -> Dict[str, Any]:
# def _find_json_schema(schema_version: Optional[str] = None) -> Dict[str, Any]:
# def get_latest_schema_version() -> str:


# Path: model_card_toolkit/base_model_card_field.py
import abc
import dataclasses
import json as json_lib
from typing import Any, Dict
from model_card_toolkit.utils import validation
from google.protobuf import descriptor
from google.protobuf import message

            getattr(self, field_name).append(field)

        elif proto.HasField(field_name):
          getattr(self, field_name)._from_proto(getattr(proto, field_name))  # pylint: disable=protected-access

      # Process Non-Message type
      else:
        if field_descriptor.label == descriptor.FieldDescriptor.LABEL_REPEATED:
          setattr(self, field_name, getattr(proto, field_name)[:])
        elif proto.HasField(field_name):
          setattr(self, field_name, getattr(proto, field_name))

    return self

  def merge_from_proto(self, proto: message.Message) -> "BaseModelCardField":
    """Merges the contents of the model card proto into current object."""
    current = self.to_proto()
    current.MergeFrom(proto)
    self.clear()
    return self._from_proto(current)

  def copy_from_proto(self, proto: message.Message) -> "BaseModelCardField":
    """Copies the contents of the model card proto into current object."""
    self.clear()
    return self._from_proto(proto)

  def _from_json(self, json_dict: Dict[str, Any],
                 field: "BaseModelCardField") -> "BaseModelCardField":
    """Parses a JSON dictionary into the current object."""
    for subfield_key, subfield_json_value in json_dict.items():

      if subfield_key.startswith(validation.SCHEMA_VERSION_STRING):