




'''simple docstring'''







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

from ... import PreTrainedTokenizer, TensorType, is_torch_available
from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfigWithPast, PatchingSpec
from ...utils import logging


_lowerCamelCase				:		Any				      =    logging.get_logger(__name__)

_lowerCamelCase				:		List[str]				      =    {
    'gpt2': 'https://huggingface.co/gpt2/resolve/main/config.json',
    'gpt2-medium': 'https://huggingface.co/gpt2-medium/resolve/main/config.json',
    'gpt2-large': 'https://huggingface.co/gpt2-large/resolve/main/config.json',
    'gpt2-xl': 'https://huggingface.co/gpt2-xl/resolve/main/config.json',
    'distilgpt2': 'https://huggingface.co/distilgpt2/resolve/main/config.json',
}





class 	lowerCamelCase_				(			_lowercase				):




					'''simple docstring'''






					lowercase__       =					'''gpt2'''
					lowercase__       =					['''past_key_values''']
					lowercase__       =					{
					    '''hidden_size''': '''n_embd''',
					    '''max_position_embeddings''': '''n_positions''',
					    '''num_attention_heads''': '''n_head''',
					    '''num_hidden_layers''': '''n_layer''',
					}






					def __init__(       self,    __UpperCamelCase=50_257,    __UpperCamelCase=1_024,    __UpperCamelCase=768,    __UpperCamelCase=12,    __UpperCamelCase=12,    __UpperCamelCase=None,    __UpperCamelCase="gelu_new",    __UpperCamelCase=0.1,    __UpperCamelCase=0.1,    __UpperCamelCase=0.1,    __UpperCamelCase=1E-5,    __UpperCamelCase=0.02,    __UpperCamelCase="cls_index",    __UpperCamelCase=True,    __UpperCamelCase=None,    __UpperCamelCase=True,    __UpperCamelCase=0.1,    __UpperCamelCase=True,    __UpperCamelCase=True,    __UpperCamelCase=50_256,    __UpperCamelCase=50_256,    __UpperCamelCase=False,    __UpperCamelCase=False,    **__UpperCamelCase,    ):
							_snake_case      			=			vocab_size
							_snake_case      			=			n_positions
							_snake_case      			=			n_embd
							_snake_case      			=			n_layer
							_snake_case      			=			n_head
							_snake_case      			=			n_inner
							_snake_case      			=			activation_function
							_snake_case      			=			resid_pdrop
							_snake_case      			=			embd_pdrop
							_snake_case      			=			attn_pdrop
							_snake_case      			=			layer_norm_epsilon
							_snake_case      			=			initializer_range
							_snake_case      			=			summary_type
							_snake_case      			=			summary_use_proj
							_snake_case      			=			summary_activation
							_snake_case      			=			summary_first_dropout
							_snake_case      			=			summary_proj_to_labels
							_snake_case      			=			scale_attn_weights
							_snake_case      			=			use_cache
							_snake_case      			=			scale_attn_by_inverse_layer_idx
							_snake_case      			=			reorder_and_upcast_attn

							_snake_case      			=			bos_token_id
							_snake_case      			=			eos_token_id

							super().__init__(bos_token_id=_SCREAMING_SNAKE_CASE,    eos_token_id=_SCREAMING_SNAKE_CASE,    **_SCREAMING_SNAKE_CASE					)





class 	lowerCamelCase_				(			_lowercase				):




					'''simple docstring'''






					def __init__(       self,    __UpperCamelCase,    __UpperCamelCase = "default",    __UpperCamelCase = None,    __UpperCamelCase = False,    ):
							super().__init__(_SCREAMING_SNAKE_CASE,    task=_SCREAMING_SNAKE_CASE,    patching_specs=_SCREAMING_SNAKE_CASE,    use_past=_SCREAMING_SNAKE_CASE					)
							if not getattr(self._config,    "pad_token_id",    _SCREAMING_SNAKE_CASE					):
									# TODO: how to do that better?
									_snake_case      			=			0






					@property
					def 							__SCREAMING_SNAKE_CASE      (       self					):
							_snake_case      			=			OrderedDict({"input_ids": {0: "batch", 1: "sequence"}}					)
							if self.use_past:
									self.fill_with_past_key_values_(_SCREAMING_SNAKE_CASE,    direction="inputs"					)
									_snake_case      			=			{0: '''batch''', 1: '''past_sequence + sequence'''}
							else:
									_snake_case      			=			{0: '''batch''', 1: '''sequence'''}

							return common_inputs






					@property
					def 							__SCREAMING_SNAKE_CASE      (       self					):
							return self._config.n_layer






					@property
					def 							__SCREAMING_SNAKE_CASE      (       self					):
							return self._config.n_head






					def 							__SCREAMING_SNAKE_CASE      (       self,    __UpperCamelCase,    __UpperCamelCase = -1,    __UpperCamelCase = -1,    __UpperCamelCase = False,    __UpperCamelCase = None,    ):
							_snake_case      			=			super(_SCREAMING_SNAKE_CASE,    self					).generate_dummy_inputs(
							    _SCREAMING_SNAKE_CASE,    batch_size=_SCREAMING_SNAKE_CASE,    seq_length=_SCREAMING_SNAKE_CASE,    is_pair=_SCREAMING_SNAKE_CASE,    framework=_SCREAMING_SNAKE_CASE					)

							# We need to order the input in the way they appears in the forward()
							_snake_case      			=			OrderedDict({"input_ids": common_inputs["input_ids"]}					)

							# Need to add the past_keys
							if self.use_past:
									if not is_torch_available():
											raise ValueError("Cannot generate dummy past_keys inputs without PyTorch installed."					)
									else:
											import torch

											_snake_case      			=			common_inputs['''input_ids'''].shape
											# Not using the same length for past_key_values
											_snake_case      			=			seqlen + 2
											_snake_case      			=			(
											    batch,
											    self.num_attention_heads,
											    past_key_values_length,
											    self._config.hidden_size // self.num_attention_heads,
											)
											_snake_case      			=			[
											    (torch.zeros(_SCREAMING_SNAKE_CASE					), torch.zeros(_SCREAMING_SNAKE_CASE					)) for _ in range(self.num_layers					)
											]

							_snake_case      			=			common_inputs['''attention_mask''']
							if self.use_past:
									_snake_case      			=			ordered_inputs['''attention_mask'''].dtype
									_snake_case      			=			torch.cat(
									    [ordered_inputs["attention_mask"], torch.ones(_SCREAMING_SNAKE_CASE,    _SCREAMING_SNAKE_CASE,    dtype=_SCREAMING_SNAKE_CASE					)],    dim=1					)

							return ordered_inputs






					@property
					def 							__SCREAMING_SNAKE_CASE      (       self					):
							return 13









from itertools import combinations_with_replacement






def 	lowerCamelCase_       (			_a = 100			):




		"""simple docstring"""






		lowerCAmelCase__  :     list[int]       	=   [*list(range(1      ,  21			)			), 25]
		lowerCAmelCase__  :     list[int]       	=   [2 * x for x in range(1      ,  21			)] + [50]
		lowerCAmelCase__  :     list[int]       	=   [3 * x for x in range(1      ,  21			)]
		lowerCAmelCase__  :     list[int]       	=   singles + doubles + triples + [0]

		lowerCAmelCase__  :     int       	=   0
		lowerCAmelCase__  :     int
		lowerCAmelCase__  :     int
		lowerCAmelCase__  :     int
		lowerCAmelCase__  :     int

		for double in doubles:
				for throwa, throwa in combinations_with_replacement(_a      ,  2			):
						lowerCAmelCase__  :     Dict       	=   double + throwa + throwa
						if checkout_total < limit:
								num_checkouts += 1

		return num_checkouts


if __name__ == "__main__":
		print(f'''{solution() = }''')




