





import unittest

from transformers import DonutProcessor


__UpperCAmelCase       :   Union[str, Any]				       =							"naver-clova-ix/donut-base"







class     __snake_case       (							unittest.TestCase			):





       '''simple docstring'''







       def 							UpperCAmelCase__ (  self :    List[str]		):
         __snake_case:						List[str]   =						DonutProcessor.from_pretrained(A		)






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

         __snake_case:						Tuple   =						(
             """<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>"""
         )
         __snake_case:						Dict   =						self.processor.tokenajson(A		)

         self.assertDictEqual(A							,				A		)













from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_sentencepiece_available


__UpperCAmelCase       :   Union[str, Any]				       =							{}

try:
      if not is_sentencepiece_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      __UpperCAmelCase       :   str				       =							["BartphoTokenizer"]

if TYPE_CHECKING:
      try:
            if not is_sentencepiece_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .tokenization_bartpho import BartphoTokenizer

else:
      import sys

      __UpperCAmelCase       :   Optional[Any]				       =							_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)






