




import unittest

from transformers import DonutProcessor


a      =							'naver-clova-ix/donut-base'






class       SCREAMING_SNAKE_CASE__					(					unittest.TestCase					):


						def   __lowercase (							self				:			str					):
										lowerCAmelCase  =				DonutProcessor.from_pretrained(__A					)




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

										lowerCAmelCase  =				(
										    """<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>"""
										)
										lowerCAmelCase  =				self.processor.tokenajson(__A					)

										self.assertDictEqual(__A						,						__A					)











"""simple docstring"""







import os
import string
import sys


a      =							1 << 8

a      =							{
    'tab': ord('\t'),
    'newline': ord('\r'),
    'esc': 2_7,
    'up': 6_5 + ARROW_KEY_FLAG,
    'down': 6_6 + ARROW_KEY_FLAG,
    'right': 6_7 + ARROW_KEY_FLAG,
    'left': 6_8 + ARROW_KEY_FLAG,
    'mod_int': 9_1,
    'undefined': sys.maxsize,
    'interrupt': 3,
    'insert': 5_0,
    'delete': 5_1,
    'pg_up': 5_3,
    'pg_down': 5_4,
}

a      =							KEYMAP['up']
a      =							KEYMAP['left']

if sys.platform == "win32":
		a      =							[]
		a      =							{
		    b'\xe0H': KEYMAP['up'] - ARROW_KEY_FLAG,
		    b'\x00H': KEYMAP['up'] - ARROW_KEY_FLAG,
		    b'\xe0P': KEYMAP['down'] - ARROW_KEY_FLAG,
		    b'\x00P': KEYMAP['down'] - ARROW_KEY_FLAG,
		    b'\xe0M': KEYMAP['right'] - ARROW_KEY_FLAG,
		    b'\x00M': KEYMAP['right'] - ARROW_KEY_FLAG,
		    b'\xe0K': KEYMAP['left'] - ARROW_KEY_FLAG,
		    b'\x00K': KEYMAP['left'] - ARROW_KEY_FLAG,
		}

for i in range(1_0):
		a      =							ord(str(i))





def 							lowercase					()     ->  str:


				'''simple docstring'''






				if os.name == "nt":
								import msvcrt

								lowerCAmelCase  =				"""mbcs"""
								# Flush the keyboard buffer
								while msvcrt.kbhit():
												msvcrt.getch()
								if len(snake_case__ ) == 0:
												# Read the keystroke
												lowerCAmelCase  =				msvcrt.getch()

												# If it is a prefix char, get second part
												if ch in (b"\x00", b"\xe0"):
																lowerCAmelCase  =				ch + msvcrt.getch()
																# Translate actual Win chars to bullet char types
																try:
																				lowerCAmelCase  =				chr(WIN_KEYMAP[cha] )
																				WIN_CH_BUFFER.append(chr(KEYMAP["""mod_int"""] ) )
																				WIN_CH_BUFFER.append(snake_case__ )
																				if ord(snake_case__ ) in (
																				    KEYMAP["insert"] - 1 << 9,
																				    KEYMAP["delete"] - 1 << 9,
																				    KEYMAP["pg_up"] - 1 << 9,
																				    KEYMAP["pg_down"] - 1 << 9,
																				):
																								WIN_CH_BUFFER.append(chr(126 ) )
																				lowerCAmelCase  =				chr(KEYMAP["""esc"""] )
																except KeyError:
																				lowerCAmelCase  =				cha[1]
												else:
																lowerCAmelCase  =				ch.decode(snake_case__ )
								else:
												lowerCAmelCase  =				WIN_CH_BUFFER.pop(0 )
				elif os.name == "posix":
								import termios
								import tty

								lowerCAmelCase  =				sys.stdin.fileno()
								lowerCAmelCase  =				termios.tcgetattr(snake_case__ )
								try:
												tty.setraw(snake_case__ )
												lowerCAmelCase  =				sys.stdin.read(1 )
								finally:
												termios.tcsetattr(snake_case__      ,       termios.TCSADRAIN      ,       snake_case__ )
				return ch






def 							lowercase					()     ->  List[str]:


				'''simple docstring'''






				lowerCAmelCase  =				get_raw_chars()
				if ord(snake_case__ ) in [KEYMAP["interrupt"], KEYMAP["newline"]]:
								return char

				elif ord(snake_case__ ) == KEYMAP["esc"]:
								lowerCAmelCase  =				get_raw_chars()
								if ord(snake_case__ ) == KEYMAP["mod_int"]:
												lowerCAmelCase  =				get_raw_chars()
												if ord(snake_case__ ) >= KEYMAP["arrow_begin"] - ARROW_KEY_FLAG and ord(snake_case__ ) <= KEYMAP["arrow_end"] - ARROW_KEY_FLAG:
																return chr(ord(snake_case__ ) + ARROW_KEY_FLAG )
												else:
																return KEYMAP["undefined"]
								else:
												return get_raw_chars()

				else:
								if char in string.printable:
												return char
								else:
												return KEYMAP["undefined"]





