



"""simple docstring"""

from collections import OrderedDict
from typing import Mapping

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


A_	:						Dict				=			logging.get_logger(__name__)

A_	:						Any				=			{
    'mnaylor/mega-base-wikitext': 'https://huggingface.co/mnaylor/mega-base-wikitext/resolve/main/config.json',
}
class 						lowerCAmelCase__	(  _lowerCamelCase   ):


	'''simple docstring'''







	_SCREAMING_SNAKE_CASE  :		List[Any]     	=   '''mega'''





	def __init__(			self							:					int    ,					_SCREAMING_SNAKE_CASE							:					Tuple=30_522    ,					_SCREAMING_SNAKE_CASE							:					Optional[Any]=128    ,					_SCREAMING_SNAKE_CASE							:					Tuple=4    ,					_SCREAMING_SNAKE_CASE							:					Union[str, Any]=256    ,					_SCREAMING_SNAKE_CASE							:					Optional[int]=16    ,					_SCREAMING_SNAKE_CASE							:					List[Any]=True    ,					_SCREAMING_SNAKE_CASE							:					Tuple=64    ,					_SCREAMING_SNAKE_CASE							:					str=False    ,					_SCREAMING_SNAKE_CASE							:					List[str]=-1    ,					_SCREAMING_SNAKE_CASE							:					List[Any]=None    ,					_SCREAMING_SNAKE_CASE							:					Optional[int]=True    ,					_SCREAMING_SNAKE_CASE							:					Dict="scalenorm"    ,					_SCREAMING_SNAKE_CASE							:					List[Any]=True    ,					_SCREAMING_SNAKE_CASE							:					Optional[Any]="silu"    ,					_SCREAMING_SNAKE_CASE							:					List[str]="softmax"    ,					_SCREAMING_SNAKE_CASE							:					Optional[int]=0.1    ,					_SCREAMING_SNAKE_CASE							:					Optional[Any]=0.1    ,					_SCREAMING_SNAKE_CASE							:					Union[str, Any]=0.1    ,					_SCREAMING_SNAKE_CASE							:					List[Any]=False    ,					_SCREAMING_SNAKE_CASE							:					str=True    ,					_SCREAMING_SNAKE_CASE							:					str=256    ,					_SCREAMING_SNAKE_CASE							:					List[Any]=True    ,					_SCREAMING_SNAKE_CASE							:					List[Any]=0.1    ,					_SCREAMING_SNAKE_CASE							:					str=2_048    ,					_SCREAMING_SNAKE_CASE							:					List[Any]=False    ,					_SCREAMING_SNAKE_CASE							:					Dict=2    ,					_SCREAMING_SNAKE_CASE							:					Optional[Any]=0.0_2    ,					_SCREAMING_SNAKE_CASE							:					List[Any]=0.2    ,					_SCREAMING_SNAKE_CASE							:					Union[str, Any]=0.0_2    ,					_SCREAMING_SNAKE_CASE							:					int=1.0    ,					_SCREAMING_SNAKE_CASE							:					Optional[int]=1    ,					_SCREAMING_SNAKE_CASE							:					Any=0    ,					_SCREAMING_SNAKE_CASE							:					Optional[int]=2    ,					_SCREAMING_SNAKE_CASE							:					Optional[Any]="rotary"    ,					_SCREAMING_SNAKE_CASE							:					Any=None    ,					_SCREAMING_SNAKE_CASE							:					int=True    ,					_SCREAMING_SNAKE_CASE							:					List[Any]=True    ,					**_SCREAMING_SNAKE_CASE							:					Optional[Any]    ,					)	->  Dict:





					"""simple docstring"""


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

					SCREAMING_SNAKE_CASE	:       List[Any] 							=    vocab_size
					SCREAMING_SNAKE_CASE	:       Optional[int] 							=    hidden_size
					SCREAMING_SNAKE_CASE	:       List[Any] 							=    num_hidden_layers
					SCREAMING_SNAKE_CASE	:       Any 							=    activation
					SCREAMING_SNAKE_CASE	:       Dict 							=    attention_activation
					SCREAMING_SNAKE_CASE	:       Optional[Any] 							=    intermediate_size
					SCREAMING_SNAKE_CASE	:       Dict 							=    ema_projection_size
					SCREAMING_SNAKE_CASE	:       Union[str, Any] 							=    bidirectional
					SCREAMING_SNAKE_CASE	:       Optional[Any] 							=    shared_representation_size
					SCREAMING_SNAKE_CASE	:       Optional[Any] 							=    use_chunking
					SCREAMING_SNAKE_CASE	:       Any 							=    chunk_size
					SCREAMING_SNAKE_CASE	:       Dict 							=    truncation
					SCREAMING_SNAKE_CASE	:       Optional[Any] 							=    normalize_before_mega
					SCREAMING_SNAKE_CASE	:       Union[str, Any] 							=    normalization_type
					SCREAMING_SNAKE_CASE	:       str 							=    norm_affine
					SCREAMING_SNAKE_CASE	:       Optional[int] 							=    dropout_prob
					SCREAMING_SNAKE_CASE	:       int 							=    hidden_dropout_prob
					SCREAMING_SNAKE_CASE	:       Dict 							=    attention_probs_dropout_prob
					SCREAMING_SNAKE_CASE	:       Tuple 							=    use_feature_dropout
					SCREAMING_SNAKE_CASE	:       int 							=    use_normalized_ffn
					SCREAMING_SNAKE_CASE	:       Dict 							=    nffn_hidden_size
					SCREAMING_SNAKE_CASE	:       Tuple 							=    normalize_before_ffn
					SCREAMING_SNAKE_CASE	:       List[Any] 							=    nffn_activation_dropout_prob
					SCREAMING_SNAKE_CASE	:       List[Any] 							=    max_positions
					SCREAMING_SNAKE_CASE	:       str 							=    add_token_type_embeddings
					SCREAMING_SNAKE_CASE	:       Dict 							=    type_vocab_size
					SCREAMING_SNAKE_CASE	:       Dict 							=    initializer_range
					SCREAMING_SNAKE_CASE	:       Any 							=    ema_delta_alpha_range
					SCREAMING_SNAKE_CASE	:       int 							=    ema_beta_range
					SCREAMING_SNAKE_CASE	:       Any 							=    ema_gamma_omega_range
					SCREAMING_SNAKE_CASE	:       List[Any] 							=    relative_positional_bias
					SCREAMING_SNAKE_CASE	:       List[str] 							=    use_cache
					SCREAMING_SNAKE_CASE	:       Optional[Any] 							=    classifier_dropout
					SCREAMING_SNAKE_CASE	:       List[str] 							=    add_lm_hidden_dense_layer
					SCREAMING_SNAKE_CASE	:       Tuple 							=    1  # not used but required by Hugging Face




class 						lowerCAmelCase__	(  _lowerCamelCase   ):


	'''simple docstring'''







	@property
	def  _lowerCAmelCase    (			self							:					Optional[int]						)	->  Mapping[str, Mapping[int, str]]:





					"""simple docstring"""


					if self.task == "multiple-choice":
									SCREAMING_SNAKE_CASE	:       Optional[Any] 							=    {0: 'batch', 1: 'choice', 2: 'sequence'}
					else:
									SCREAMING_SNAKE_CASE	:       Tuple 							=    {0: 'batch', 1: 'sequence'}
					return OrderedDict(
					    [
					        ('input_ids', dynamic_axis),
					        ('attention_mask', dynamic_axis),
					    ]						)










"""simple docstring"""

def    __snake_case       (  __A			:	str       ,		__A			:	str    )    ->					int:






				'''simple docstring'''
				# The longer word should come first
				if len(__A    ) < len(__A    ):
								return levenshtein_distance(__A       ,		__A    )

				if len(__A    ) == 0:
								return len(__A    )

				SCREAMING_SNAKE_CASE	:       List[Any] 							=    list(range(len(__A    ) + 1    )    )

				for i, ca in enumerate(__A    ):
								SCREAMING_SNAKE_CASE	:       Union[str, Any] 							=    [i + 1]

								for j, ca in enumerate(__A    ):
												# Calculate insertions, deletions and substitutions
												SCREAMING_SNAKE_CASE	:       str 							=    previous_row[j + 1] + 1
												SCREAMING_SNAKE_CASE	:       List[str] 							=    current_row[j] + 1
												SCREAMING_SNAKE_CASE	:       Any 							=    previous_row[j] + (ca != ca)

												# Get the minimum to append to the current row
												current_row.append(min(__A       ,		__A       ,		__A    )    )

								# Store the previous row
								SCREAMING_SNAKE_CASE	:       Tuple 							=    current_row

				# Returns the last element (distance)
				return previous_row[-1]


if __name__ == "__main__":
							A_	:						Optional[int]				=			input('Enter the first word:\n').strip()
							A_	:						Optional[Any]				=			input('Enter the second word:\n').strip()

							A_	:						str				=			levenshtein_distance(first_word, second_word)
							print(f'''Levenshtein distance between {first_word} and {second_word} is {result}''')





