



from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available


UpperCAmelCase							=       {
    """configuration_esm""": ["""ESM_PRETRAINED_CONFIG_ARCHIVE_MAP""", """EsmConfig"""],
    """tokenization_esm""": ["""EsmTokenizer"""],
}

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	UpperCAmelCase							=       [
	    """ESM_PRETRAINED_MODEL_ARCHIVE_LIST""",
	    """EsmForMaskedLM""",
	    """EsmForSequenceClassification""",
	    """EsmForTokenClassification""",
	    """EsmModel""",
	    """EsmPreTrainedModel""",
	]
	UpperCAmelCase							=       ["""EsmForProteinFolding""", """EsmFoldPreTrainedModel"""]

try:
	if not is_tf_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	UpperCAmelCase							=       [
	    """TF_ESM_PRETRAINED_MODEL_ARCHIVE_LIST""",
	    """TFEsmForMaskedLM""",
	    """TFEsmForSequenceClassification""",
	    """TFEsmForTokenClassification""",
	    """TFEsmModel""",
	    """TFEsmPreTrainedModel""",
	]

if TYPE_CHECKING:
	from .configuration_esm import ESM_PRETRAINED_CONFIG_ARCHIVE_MAP, EsmConfig
	from .tokenization_esm import EsmTokenizer

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_esm import (
		    ESM_PRETRAINED_MODEL_ARCHIVE_LIST,
		    EsmForMaskedLM,
		    EsmForSequenceClassification,
		    EsmForTokenClassification,
		    EsmModel,
		    EsmPreTrainedModel,
		)
		from .modeling_esmfold import EsmFoldPreTrainedModel, EsmForProteinFolding

	try:
		if not is_tf_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_tf_esm import (
		    TF_ESM_PRETRAINED_MODEL_ARCHIVE_LIST,
		    TFEsmForMaskedLM,
		    TFEsmForSequenceClassification,
		    TFEsmForTokenClassification,
		    TFEsmModel,
		    TFEsmPreTrainedModel,
		)


else:
	import sys

	UpperCAmelCase							=       _LazyModule(__name__, globals()["""__file__"""], _import_structure)








"""simple docstring"""


def 				a__      (	_UpperCAmelCase						,  _UpperCAmelCase						)     ->	int:

 '''simple docstring'''






 if len(_UpperCAmelCase						) < len(_UpperCAmelCase						):
  return levenshtein_distance(_UpperCAmelCase						,  _UpperCAmelCase						)

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

 snake_case__     				=					list(range(len(_UpperCAmelCase						) + 1						)						)

 for i, ca in enumerate(_UpperCAmelCase						):
  snake_case__     				=					[i + 1]

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

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

  # Store the previous row
  snake_case__     				=					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__       :  int       		=					input("""Enter the second word:\n""").strip()

   a__       :  Union[str, Any]       		=					levenshtein_distance(first_word, second_word)
   print(f'''Levenshtein distance between {first_word} and {second_word} is {result}''')

