
from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


__lowerCAmelCase     :	Dict       			=  {
    """configuration_nezha""": ["""NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP""", """NezhaConfig"""],
}

try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    __lowerCAmelCase     :	Optional[int]       			=  [
        """NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST""",
        """NezhaForNextSentencePrediction""",
        """NezhaForMaskedLM""",
        """NezhaForPreTraining""",
        """NezhaForMultipleChoice""",
        """NezhaForQuestionAnswering""",
        """NezhaForSequenceClassification""",
        """NezhaForTokenClassification""",
        """NezhaModel""",
        """NezhaPreTrainedModel""",
    ]


if TYPE_CHECKING:
    from .configuration_nezha import NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP, NezhaConfig

    try:
        if not is_torch_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_nezha import (
            NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST,
            NezhaForMaskedLM,
            NezhaForMultipleChoice,
            NezhaForNextSentencePrediction,
            NezhaForPreTraining,
            NezhaForQuestionAnswering,
            NezhaForSequenceClassification,
            NezhaForTokenClassification,
            NezhaModel,
            NezhaPreTrainedModel,
        )


else:
    import sys

    __lowerCAmelCase     :	Optional[int]       			=  _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)




import unittest

from transformers import DonutProcessor


_lowerCAmelCase  :      str			 ="""naver-clova-ix/donut-base"""

class __UpperCamelCase     (				unittest.TestCase		):






					'''simple docstring'''



					def    _UpperCAmelCase    (				self						):
						UpperCAmelCase__:	Any									= DonutProcessor.from_pretrained(lowerCamelCase__						)





					def    _UpperCAmelCase    (				self						):
						UpperCAmelCase__:	Any									= {
						    "name": "John Doe",
						    "age": "99",
						    "city": "Atlanta",
						    "state": "GA",
						    "zip": "30301",
						    "phone": "123-4567",
						    "nicknames": [{"nickname": "Johnny"}, {"nickname": "JD"}],
						}

						UpperCAmelCase__:	Optional[Any]									= (
						    "<s_name>John Doe</s_name><s_age>99</s_age><s_city>Atlanta</s_city>"
						    "<s_state>GA</s_state><s_zip>30301</s_zip><s_phone>123-4567</s_phone>"
						    "<s_nicknames><s_nickname>Johnny</s_nickname>"
						    "<sep/><s_nickname>JD</s_nickname></s_nicknames>"
						)
						UpperCAmelCase__:	str									= self.processor.tokenajson(lowerCamelCase__						)

						self.assertDictEqual(lowerCamelCase__				,      lowerCamelCase__						)