



'''simple docstring'''




from collections import OrderedDict
from typing import TYPE_CHECKING, Any, Mapping, Optional

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...onnx.utils import compute_effective_axis_dimension
from ...utils import logging


if TYPE_CHECKING:
						from ...processing_utils import ProcessorMixin
						from ...utils import TensorType


lowerCamelCase							:List[Any]       = logging.get_logger(__name__)

lowerCamelCase							:Any       = {
    "microsoft/layoutlmv3-base": "https://huggingface.co/microsoft/layoutlmv3-base/resolve/main/config.json",
}







class      _lowerCAmelCase							(      SCREAMING_SNAKE_CASE__			):
	__SCREAMING_SNAKE_CASE       :		str		      = '''layoutlmv3'''


	def __init__(self	,				lowercase=50265	,				lowercase=768	,				lowercase=12	,				lowercase=12	,				lowercase=3072	,				lowercase="gelu"	,				lowercase=0.1	,				lowercase=0.1	,				lowercase=512	,				lowercase=2	,				lowercase=0.02	,				lowercase=1E-5	,				lowercase=1	,				lowercase=0	,				lowercase=2	,				lowercase=1024	,				lowercase=128	,				lowercase=128	,				lowercase=True	,				lowercase=32	,				lowercase=128	,				lowercase=64	,				lowercase=256	,				lowercase=True	,				lowercase=True	,				lowercase=True	,				lowercase=224	,				lowercase=3	,				lowercase=16	,				lowercase=None	,				**lowercase	,				):
				super().__init__(
				    vocab_size=A__	,				hidden_size=A__	,				num_hidden_layers=A__	,				num_attention_heads=A__	,				intermediate_size=A__	,				hidden_act=A__	,				hidden_dropout_prob=A__	,				attention_probs_dropout_prob=A__	,				max_position_embeddings=A__	,				type_vocab_size=A__	,				initializer_range=A__	,				layer_norm_eps=A__	,				pad_token_id=A__	,				bos_token_id=A__	,				eos_token_id=A__	,				**A__	,				)
				A_     :						Optional[Any]     =					max_ad_position_embeddings
				A_     :						Optional[int]     =					coordinate_size
				A_     :						List[str]     =					shape_size
				A_     :						Any     =					has_relative_attention_bias
				A_     :						List[Any]     =					rel_pos_bins
				A_     :						Optional[int]     =					max_rel_pos
				A_     :						List[Any]     =					has_spatial_attention_bias
				A_     :						int     =					rel_ad_pos_bins
				A_     :						List[str]     =					max_rel_ad_pos
				A_     :						Any     =					text_embed
				A_     :						Optional[Any]     =					visual_embed
				A_     :						int     =					input_size
				A_     :						List[str]     =					num_channels
				A_     :						str     =					patch_size
				A_     :						int     =					classifier_dropout







class      _lowerCAmelCase							(      SCREAMING_SNAKE_CASE__			):
	__SCREAMING_SNAKE_CASE       :		List[Any]		      = version.parse('1.12'			)


	@property
	def    _a     (self							):
				# The order of inputs is different for question answering and sequence classification
				if self.task in ["question-answering", "sequence-classification"]:
							return OrderedDict(
							    [
							        ("""input_ids""", {0: """batch""", 1: """sequence"""}),
							        ("""attention_mask""", {0: """batch""", 1: """sequence"""}),
							        ("""bbox""", {0: """batch""", 1: """sequence"""}),
							        ("""pixel_values""", {0: """batch""", 1: """num_channels""", 2: """height""", 3: """width"""}),
							    ]							)
				else:
							return OrderedDict(
							    [
							        ("""input_ids""", {0: """batch""", 1: """sequence"""}),
							        ("""bbox""", {0: """batch""", 1: """sequence"""}),
							        ("""attention_mask""", {0: """batch""", 1: """sequence"""}),
							        ("""pixel_values""", {0: """batch""", 1: """num_channels"""}),
							    ]							)


	@property
	def    _a     (self							):
				return 1E-5


	@property
	def    _a     (self							):
				return 12


	def    _a     (self	,				lowercase	,				lowercase = -1	,				lowercase = -1	,				lowercase = False	,				lowercase = None	,				lowercase = 3	,				lowercase = 40	,				lowercase = 40	,				):
				setattr(processor.image_processor	,				"""apply_ocr"""	,				A__							)

				# If dynamic axis (-1) we forward with a fixed dimension of 2 samples to avoid optimizations made by ONNX
				A_     :						Tuple     =					compute_effective_axis_dimension(
				    A__	,				fixed_dimension=OnnxConfig.default_fixed_batch	,				num_token_to_add=0							)
				# If dynamic axis (-1) we forward with a fixed dimension of 8 tokens to avoid optimizations made by ONNX
				A_     :						Union[str, Any]     =					processor.tokenizer.num_special_tokens_to_add(A__							)
				A_     :						Optional[int]     =					compute_effective_axis_dimension(
				    A__	,				fixed_dimension=OnnxConfig.default_fixed_sequence	,				num_token_to_add=A__							)
				# Generate dummy inputs according to compute batch and sequence
				A_     :						List[Any]     =					[[""" """.join([processor.tokenizer.unk_token]							) * seq_length]] * batch_size

				# Generate dummy bounding boxes
				A_     :						List[str]     =					[[[48, 84, 73, 128]]] * batch_size

				# If dynamic axis (-1) we forward with a fixed dimension of 2 samples to avoid optimizations made by ONNX
				# batch_size = compute_effective_axis_dimension(batch_size, fixed_dimension=OnnxConfig.default_fixed_batch)
				A_     :						Any     =					self._generate_dummy_images(A__	,				A__	,				A__	,				A__							)

				A_     :						List[Any]     =					dict(
				    processor(
				        A__	,				text=A__	,				boxes=A__	,				return_tensors=A__	,				)							)

				return inputs




'''simple docstring'''




def      a      (			):
			'''simple docstring'''





			A_     :						Optional[int]     =					[31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

			A_     :						Dict     =					6
			A_     :						List[Any]     =					1
			A_     :						Optional[Any]     =					19_01

			A_     :						Tuple     =					0

			while year < 20_01:
						day += 7

						if (year % 4 == 0 and year % 1_00 != 0) or (year % 4_00 == 0):
									if day > days_per_month[month - 1] and month != 2:
												month += 1
												A_     :						Optional[Any]     =					day - days_per_month[month - 2]
									elif day > 29 and month == 2:
												month += 1
												A_     :						str     =					day - 29
						else:
									if day > days_per_month[month - 1]:
												month += 1
												A_     :						List[str]     =					day - days_per_month[month - 2]

						if month > 12:
									year += 1
									A_     :						Tuple     =					1

						if year < 20_01 and day == 1:
									sundays += 1
			return sundays


if __name__ == "__main__":
						print(solution())