

import unittest

from transformers import DonutProcessor


A_       : str         =			'naver-clova-ix/donut-base'



class     _a						(unittest.TestCase				):


					'''simple docstring'''






					def   __A			( self			):
						A__							:    Optional[Any]        =		DonutProcessor.from_pretrained(A__			)






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

						A__							:    Union[str, 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>"""
						)
						A__							:    Union[str, Any]        =		self.processor.tokenajson(A__			)

						self.assertDictEqual(A__    ,       A__			)






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


A_       : Optional[int]         =			{'configuration_ibert': ['IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'IBertConfig', 'IBertOnnxConfig']}

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	A_       : str         =			[
	    'IBERT_PRETRAINED_MODEL_ARCHIVE_LIST',
	    'IBertForMaskedLM',
	    'IBertForMultipleChoice',
	    'IBertForQuestionAnswering',
	    'IBertForSequenceClassification',
	    'IBertForTokenClassification',
	    'IBertModel',
	    'IBertPreTrainedModel',
	]

if TYPE_CHECKING:
	from .configuration_ibert import IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, IBertConfig, IBertOnnxConfig

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_ibert import (
		    IBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
		    IBertForMaskedLM,
		    IBertForMultipleChoice,
		    IBertForQuestionAnswering,
		    IBertForSequenceClassification,
		    IBertForTokenClassification,
		    IBertModel,
		    IBertPreTrainedModel,
		)

else:
	import sys

	A_       : Union[str, Any]         =			_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)



