



'''simple docstring'''





from collections import OrderedDict
from typing import Mapping

from packaging import version

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


_UpperCamelCase							    =						logging.get_logger(__name__)

_UpperCamelCase							    =						{
    'apple/mobilevit-small': 'https://huggingface.co/apple/mobilevit-small/resolve/main/config.json',
    'apple/mobilevit-x-small': 'https://huggingface.co/apple/mobilevit-x-small/resolve/main/config.json',
    'apple/mobilevit-xx-small': 'https://huggingface.co/apple/mobilevit-xx-small/resolve/main/config.json',
    'apple/deeplabv3-mobilevit-small': (
        'https://huggingface.co/apple/deeplabv3-mobilevit-small/resolve/main/config.json'
    ),
    'apple/deeplabv3-mobilevit-x-small': (
        'https://huggingface.co/apple/deeplabv3-mobilevit-x-small/resolve/main/config.json'
    ),
    'apple/deeplabv3-mobilevit-xx-small': (
        'https://huggingface.co/apple/deeplabv3-mobilevit-xx-small/resolve/main/config.json'
    ),
    # See all MobileViT models at https://huggingface.co/models?filter=mobilevit
}






class  lowerCamelCase_   (    SCREAMING_SNAKE_CASE_					):
  """simple docstring"""




  a_							 ="""mobilevit"""




  def __init__(			self				:     List[Any]      ,     _a				:     str=3      ,     _a				:     List[str]=256      ,     _a				:     str=2      ,     _a				:     Optional[int]=[144, 192, 240]      ,     _a				:     Optional[Any]=[16, 32, 64, 96, 128, 160, 640]      ,     _a				:     Optional[int]=4      ,     _a				:     List[str]=2.0      ,     _a				:     Optional[int]=4.0      ,     _a				:     Dict="silu"      ,     _a				:     Optional[int]=3      ,     _a				:     List[Any]=32      ,     _a				:     Any=0.1      ,     _a				:     Tuple=0.0      ,     _a				:     Any=0.1      ,     _a				:     Any=0.02      ,     _a				:     Union[str, Any]=1e-5      ,     _a				:     List[str]=True      ,     _a				:     Union[str, Any]=256      ,     _a				:     int=[6, 12, 18]      ,     _a				:     Dict=0.1      ,     _a				:     Tuple=255      ,     **_a				:     Optional[int]      ,     ) -> Optional[int]:
    super().__init__(**_a       )

    __lowerCamelCase	:	Dict   	=			num_channels
    __lowerCamelCase	:	Any   	=			image_size
    __lowerCamelCase	:	Dict   	=			patch_size
    __lowerCamelCase	:	int   	=			hidden_sizes
    __lowerCamelCase	:	Dict   	=			neck_hidden_sizes
    __lowerCamelCase	:	int   	=			num_attention_heads
    __lowerCamelCase	:	List[Any]   	=			mlp_ratio
    __lowerCamelCase	:	Optional[int]   	=			expand_ratio
    __lowerCamelCase	:	Optional[int]   	=			hidden_act
    __lowerCamelCase	:	List[str]   	=			conv_kernel_size
    __lowerCamelCase	:	Union[str, Any]   	=			output_stride
    __lowerCamelCase	:	List[Any]   	=			hidden_dropout_prob
    __lowerCamelCase	:	Optional[Any]   	=			attention_probs_dropout_prob
    __lowerCamelCase	:	List[Any]   	=			classifier_dropout_prob
    __lowerCamelCase	:	Any   	=			initializer_range
    __lowerCamelCase	:	List[str]   	=			layer_norm_eps
    __lowerCamelCase	:	List[str]   	=			qkv_bias

    # decode head attributes for semantic segmentation
    __lowerCamelCase	:	Optional[int]   	=			aspp_out_channels
    __lowerCamelCase	:	Tuple   	=			atrous_rates
    __lowerCamelCase	:	Optional[Any]   	=			aspp_dropout_prob
    __lowerCamelCase	:	Any   	=			semantic_loss_ignore_index






class  lowerCamelCase_   (    SCREAMING_SNAKE_CASE_					):
  """simple docstring"""




  a_							 =version.parse("""1.11"""					)




  @property
  def 						_lowercase					(			self				:     List[Any]       ) -> Mapping[str, Mapping[int, str]]:
    return OrderedDict([('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'})]       )




  @property
  def 						_lowercase					(			self				:     str       ) -> Mapping[str, Mapping[int, str]]:
    if self.task == "image-classification":
      return OrderedDict([('logits', {0: 'batch'})]       )
    else:
      return OrderedDict([('last_hidden_state', {0: 'batch'}), ('pooler_output', {0: 'batch'})]       )




  @property
  def 						_lowercase					(			self				:     Optional[int]       ) -> float:
    return 1e-4











'''simple docstring'''





def 	a_					(							_lowerCAmelCase	,_lowerCAmelCase	)				->				int:
  # The longer word should come first
  if len(_lowerCAmelCase	) < len(_lowerCAmelCase	):
    return levenshtein_distance(_lowerCAmelCase	,_lowerCAmelCase	)

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

  __lowerCamelCase	:	int   	=			list(range(len(_lowerCAmelCase	) + 1	)	)

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

    for j, ca in enumerate(_lowerCAmelCase	):
      # Calculate insertions, deletions and substitutions
      __lowerCamelCase	:	Any   	=			previous_row[j + 1] + 1
      __lowerCamelCase	:	int   	=			current_row[j] + 1
      __lowerCamelCase	:	Any   	=			previous_row[j] + (ca != ca)

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

    # Store the previous row
    __lowerCamelCase	:	Optional[int]   	=			current_row

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


if __name__ == "__main__":
   _UpperCamelCase							    =						input('Enter the first word:\n').strip()
   _UpperCamelCase							    =						input('Enter the second word:\n').strip()

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






