



"""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
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


__SCREAMING_SNAKE_CASE     :  Tuple										=					logging.get_logger(__name__)

__SCREAMING_SNAKE_CASE     :  int										=					{
    '''facebook/convnext-tiny-224''': '''https://huggingface.co/facebook/convnext-tiny-224/resolve/main/config.json''',
    # See all ConvNeXT models at https://huggingface.co/models?filter=convnext
}


class 							lowerCamelCase_(      A__, A__			):





					'''simple docstring'''



					lowercase__      :				Any        =       'convnext'

					def __init__(			self ,				lowerCamelCase__=3 ,				lowerCamelCase__=4 ,				lowerCamelCase__=4 ,				lowerCamelCase__=None ,				lowerCamelCase__=None ,				lowerCamelCase__="gelu" ,				lowerCamelCase__=0.0_2 ,				lowerCamelCase__=1e-12 ,				lowerCamelCase__=1e-6 ,				lowerCamelCase__=0.0 ,				lowerCamelCase__=2_2_4 ,				lowerCamelCase__=None ,				lowerCamelCase__=None ,				**lowerCamelCase__ ,				):
									super().__init__(**lowerCamelCase__      )

									_lowerCamelCase					     = num_channels
									_lowerCamelCase					     = patch_size
									_lowerCamelCase					     = num_stages
									_lowerCamelCase					     = [9_6, 1_9_2, 3_8_4, 7_6_8] if hidden_sizes is None else hidden_sizes
									_lowerCamelCase					     = [3, 3, 9, 3] if depths is None else depths
									_lowerCamelCase					     = hidden_act
									_lowerCamelCase					     = initializer_range
									_lowerCamelCase					     = layer_norm_eps
									_lowerCamelCase					     = layer_scale_init_value
									_lowerCamelCase					     = drop_path_rate
									_lowerCamelCase					     = image_size
									_lowerCamelCase					     = ['''stem'''] + [F"""stage{idx}""" for idx in range(1 ,				len(self.depths      ) + 1      )]
									_lowerCamelCase     ,   _lowerCamelCase					     = get_aligned_output_features_output_indices(
									    out_features=lowerCamelCase__ ,				out_indices=lowerCamelCase__ ,				stage_names=self.stage_names      )


class 							lowerCamelCase_(      A__			):





					'''simple docstring'''



					lowercase__      :				Optional[Any]        =       version.parse('1.11'			)

					@property
					def 	snake_case__					(			self      ):
									return OrderedDict(
									    [
									        ('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''}),
									    ]      )





					@property
					def 	snake_case__					(			self      ):
									return 1e-5





"""simple docstring"""
def 				lowerCAmelCase_(      lowercase_   :							str  ,      lowercase_   :							str							)		->				int:
				# The longer word should come first
				if len(lowercase_							) < len(lowercase_							):
								return levenshtein_distance(lowercase_  ,      lowercase_							)

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

				_lowerCamelCase					     = list(range(len(lowercase_							) + 1							)							)

				for i, ca in enumerate(lowercase_							):
								_lowerCamelCase					     = [i + 1]

								for j, ca in enumerate(lowercase_							):
												# Calculate insertions, deletions and substitutions
												_lowerCamelCase					     = previous_row[j + 1] + 1
												_lowerCamelCase					     = current_row[j] + 1
												_lowerCamelCase					     = previous_row[j] + (ca != ca)

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

								# Store the previous row
								_lowerCamelCase					     = current_row

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


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

			__SCREAMING_SNAKE_CASE     :  Optional[Any]										=					levenshtein_distance(first_word, second_word)
			print(F"""Levenshtein distance between {first_word} and {second_word} is {result}""")
