




from ...configuration_utils import PretrainedConfig
from ...utils import logging


UpperCamelCase__         =      logging.get_logger(__name__)

UpperCamelCase__         =      {
    """naver-clova-ix/donut-base""": """https://huggingface.co/naver-clova-ix/donut-base/resolve/main/config.json""",
    # See all Donut models at https://huggingface.co/models?filter=donut-swin
}
class       a__   ( snake_case__				):
						_a							:   Tuple =   """donut-swin"""

						_a							:   Optional[int] =   {
						    """num_attention_heads""": """num_heads""",
						    """num_hidden_layers""": """num_layers""",
						}






						def __init__(       self		,      _A=2_2_4		,      _A=4		,      _A=3		,      _A=9_6		,      _A=[2, 2, 6, 2]		,      _A=[3, 6, 1_2, 2_4]		,      _A=7		,      _A=4.0		,      _A=True		,      _A=0.0		,      _A=0.0		,      _A=0.1		,      _A="gelu"		,      _A=False		,      _A=0.02		,      _A=1E-5		,      **_A		,      ):




											"""simple docstring"""



											super().__init__(**_A      )

											__lowerCAmelCase           =	image_size
											__lowerCAmelCase           =	patch_size
											__lowerCAmelCase           =	num_channels
											__lowerCAmelCase           =	embed_dim
											__lowerCAmelCase           =	depths
											__lowerCAmelCase           =	len(_A      )
											__lowerCAmelCase           =	num_heads
											__lowerCAmelCase           =	window_size
											__lowerCAmelCase           =	mlp_ratio
											__lowerCAmelCase           =	qkv_bias
											__lowerCAmelCase           =	hidden_dropout_prob
											__lowerCAmelCase           =	attention_probs_dropout_prob
											__lowerCAmelCase           =	drop_path_rate
											__lowerCAmelCase           =	hidden_act
											__lowerCAmelCase           =	use_absolute_embeddings
											__lowerCAmelCase           =	layer_norm_eps
											__lowerCAmelCase           =	initializer_range
											# we set the hidden_size attribute in order to make Swin work with VisionEncoderDecoderModel
											# this indicates the channel dimension after the last stage of the model
											__lowerCAmelCase           =	int(embed_dim * 2 ** (len(_A      ) - 1)      )










import enum
import shutil
import sys


UpperCamelCase__      ,     UpperCamelCase__         =      shutil.get_terminal_size()

UpperCamelCase__         =      {"""UP""": """A""", """DOWN""": """B""", """RIGHT""": """C""", """LEFT""": """D"""}
class       a__   ( enum.Enum				):
						_a							:   Any =   0
						_a							:   Dict =   1







def      _a				(						SCREAMING_SNAKE_CASE_							:    Tuple				,				SCREAMING_SNAKE_CASE_							:    Dict=""					):
					sys.stdout.write(str(SCREAMING_SNAKE_CASE_					) + end					)
					sys.stdout.flush()







def      _a				(						SCREAMING_SNAKE_CASE_							:    Any				,				SCREAMING_SNAKE_CASE_							:    Union[str, Any]				,				SCREAMING_SNAKE_CASE_							:    str=""					):
					forceWrite(F"""\u001b[{color}m{content}\u001b[0m"""				,				SCREAMING_SNAKE_CASE_					)







def      _a				(						):
					forceWrite("\r"					)







def      _a				(						SCREAMING_SNAKE_CASE_							:    int				,				SCREAMING_SNAKE_CASE_							:    str					):
					forceWrite(F"""\033[{num_lines}{CURSOR_TO_CHAR[direction.upper()]}"""					)







def      _a				(						):
					forceWrite(" " * TERMINAL_WIDTH					)
					reset_cursor()







def      _a				(						):
					reset_cursor()
					forceWrite("-" * TERMINAL_WIDTH					)




