

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


__A	:   Optional[Any]	=					logging.get_logger(__name__)

__A	:   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 			_SCREAMING_SNAKE_CASE      (  lowerCAmelCase__):
						_UpperCamelCase:Dict	=		"gpt2"
						_UpperCamelCase:Union[str, Any]	=		["past_key_values"]
						_UpperCamelCase:Optional[int]	=		{
						    "hidden_size": "n_embd",
						    "max_position_embeddings": "n_positions",
						    "num_attention_heads": "n_head",
						    "num_hidden_layers": "n_layer",
						}







						def __init__(			self     ,						_SCREAMING_SNAKE_CASE=5_0257     ,						_SCREAMING_SNAKE_CASE=1024     ,						_SCREAMING_SNAKE_CASE=768     ,						_SCREAMING_SNAKE_CASE=12     ,						_SCREAMING_SNAKE_CASE=12     ,						_SCREAMING_SNAKE_CASE=None     ,						_SCREAMING_SNAKE_CASE="gelu_new"     ,						_SCREAMING_SNAKE_CASE=0.1     ,						_SCREAMING_SNAKE_CASE=0.1     ,						_SCREAMING_SNAKE_CASE=0.1     ,						_SCREAMING_SNAKE_CASE=1E-5     ,						_SCREAMING_SNAKE_CASE=0.0_2     ,						_SCREAMING_SNAKE_CASE="cls_index"     ,						_SCREAMING_SNAKE_CASE=True     ,						_SCREAMING_SNAKE_CASE=None     ,						_SCREAMING_SNAKE_CASE=True     ,						_SCREAMING_SNAKE_CASE=0.1     ,						_SCREAMING_SNAKE_CASE=True     ,						_SCREAMING_SNAKE_CASE=True     ,						_SCREAMING_SNAKE_CASE=5_0256     ,						_SCREAMING_SNAKE_CASE=5_0256     ,						_SCREAMING_SNAKE_CASE=False     ,						_SCREAMING_SNAKE_CASE=False     ,						**_SCREAMING_SNAKE_CASE     ,						)->							Any:
													lowerCamelCase_								=vocab_size
													lowerCamelCase_								=n_positions
													lowerCamelCase_								=n_embd
													lowerCamelCase_								=n_layer
													lowerCamelCase_								=n_head
													lowerCamelCase_								=n_inner
													lowerCamelCase_								=activation_function
													lowerCamelCase_								=resid_pdrop
													lowerCamelCase_								=embd_pdrop
													lowerCamelCase_								=attn_pdrop
													lowerCamelCase_								=layer_norm_epsilon
													lowerCamelCase_								=initializer_range
													lowerCamelCase_								=summary_type
													lowerCamelCase_								=summary_use_proj
													lowerCamelCase_								=summary_activation
													lowerCamelCase_								=summary_first_dropout
													lowerCamelCase_								=summary_proj_to_labels
													lowerCamelCase_								=scale_attn_weights
													lowerCamelCase_								=use_cache
													lowerCamelCase_								=scale_attn_by_inverse_layer_idx
													lowerCamelCase_								=reorder_and_upcast_attn

													lowerCamelCase_								=bos_token_id
													lowerCamelCase_								=eos_token_id

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


class 			_SCREAMING_SNAKE_CASE      (  lowerCAmelCase__):







						def __init__(			self     ,						_SCREAMING_SNAKE_CASE     ,						_SCREAMING_SNAKE_CASE = "default"     ,						_SCREAMING_SNAKE_CASE = None     ,						_SCREAMING_SNAKE_CASE = False     ,						)->							str:
													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?
																				lowerCamelCase_								=0







						@property
						def        _snake_case				(			self							)->							Mapping[str, Mapping[int, str]]:
													lowerCamelCase_								=OrderedDict({"""input_ids""": {0: """batch""", 1: """sequence"""}}							)
													if self.use_past:
																				self.fill_with_past_key_values_(_SCREAMING_SNAKE_CASE     ,						direction="""inputs"""							)
																				lowerCamelCase_								={0: """batch""", 1: """past_sequence + sequence"""}
													else:
																				lowerCamelCase_								={0: """batch""", 1: """sequence"""}

													return common_inputs







						@property
						def        _snake_case				(			self							)->							int:
													return self._config.n_layer







						@property
						def        _snake_case				(			self							)->							int:
													return self._config.n_head







						def        _snake_case				(			self     ,						_SCREAMING_SNAKE_CASE     ,						_SCREAMING_SNAKE_CASE = -1     ,						_SCREAMING_SNAKE_CASE = -1     ,						_SCREAMING_SNAKE_CASE = False     ,						_SCREAMING_SNAKE_CASE = None     ,						)->							Mapping[str, Any]:
													lowerCamelCase_								=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()
													lowerCamelCase_								=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

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

													lowerCamelCase_								=common_inputs["""attention_mask"""]
													if self.use_past:
																				lowerCamelCase_								=ordered_inputs["""attention_mask"""].dtype
																				lowerCamelCase_								=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        _snake_case				(			self							)->							int:
													return 13



from math import factorial




def        __UpperCamelCase     (      _A					:							Union[str, Any]      ,  _A					:							Tuple		)				->Any:



							"""simple docstring"""
							return factorial(_A		) / (factorial(_A		) * factorial(n - r		))




def        __UpperCamelCase     (      )				->Any:



							"""simple docstring"""
							lowerCamelCase_								=0

							for i in range(1      ,  101		):
														for j in range(1      ,  i + 1		):
																					if combinations(_A      ,  _A		) > 1E6:
																												total += 1
							return total


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