"""simple docstring"""






from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


__lowerCAmelCase       :			Any   	={
    """configuration_funnel""": ["""FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP""", """FunnelConfig"""],
    """convert_funnel_original_tf_checkpoint_to_pytorch""": [],
    """tokenization_funnel""": ["""FunnelTokenizer"""],
}

try:
       if not is_tokenizers_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       __lowerCAmelCase       :			Union[str, Any]   	=["""FunnelTokenizerFast"""]

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       __lowerCAmelCase       :			Any   	=[
           """FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST""",
           """FunnelBaseModel""",
           """FunnelForMaskedLM""",
           """FunnelForMultipleChoice""",
           """FunnelForPreTraining""",
           """FunnelForQuestionAnswering""",
           """FunnelForSequenceClassification""",
           """FunnelForTokenClassification""",
           """FunnelModel""",
           """FunnelPreTrainedModel""",
           """load_tf_weights_in_funnel""",
       ]

try:
       if not is_tf_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       __lowerCAmelCase       :			Any   	=[
           """TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST""",
           """TFFunnelBaseModel""",
           """TFFunnelForMaskedLM""",
           """TFFunnelForMultipleChoice""",
           """TFFunnelForPreTraining""",
           """TFFunnelForQuestionAnswering""",
           """TFFunnelForSequenceClassification""",
           """TFFunnelForTokenClassification""",
           """TFFunnelModel""",
           """TFFunnelPreTrainedModel""",
       ]


if TYPE_CHECKING:
       from .configuration_funnel import FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP, FunnelConfig
       from .tokenization_funnel import FunnelTokenizer

       try:
              if not is_tokenizers_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .tokenization_funnel_fast import FunnelTokenizerFast

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_funnel import (
                  FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST,
                  FunnelBaseModel,
                  FunnelForMaskedLM,
                  FunnelForMultipleChoice,
                  FunnelForPreTraining,
                  FunnelForQuestionAnswering,
                  FunnelForSequenceClassification,
                  FunnelForTokenClassification,
                  FunnelModel,
                  FunnelPreTrainedModel,
                  load_tf_weights_in_funnel,
              )

       try:
              if not is_tf_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_tf_funnel import (
                  TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST,
                  TFFunnelBaseModel,
                  TFFunnelForMaskedLM,
                  TFFunnelForMultipleChoice,
                  TFFunnelForPreTraining,
                  TFFunnelForQuestionAnswering,
                  TFFunnelForSequenceClassification,
                  TFFunnelForTokenClassification,
                  TFFunnelModel,
                  TFFunnelPreTrainedModel,
              )

else:
       import sys

       __lowerCAmelCase       :			List[Any]   	=_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)










"""simple docstring"""






import functools






def      lowercase__ (					lowerCAmelCase__   :			str							,			lowerCAmelCase__   :			str			)    ->			int:



			'''simple docstring'''
			a__  :	Any		 =			len(lowerCAmelCase__			)
			a__  :	Optional[int]		 =			len(lowerCAmelCase__			)

			@functools.cache
			def min_distance(lowerCAmelCase__   :			int							,			lowerCAmelCase__   :			int			) -> int:
						# if first word index is overflow - delete all from the second word
						if indexa >= len_worda:
									return len_worda - indexa
						# if second word index is overflow - delete all from the first word
						if indexa >= len_worda:
									return len_worda - indexa
						a__  :	List[Any]		 =			int(worda[indexa] != worda[indexa]			)  # current letters not identical
						return min(
						    1 + min_distance(indexa + 1							,			lowerCAmelCase__			)							,			1 + min_distance(lowerCAmelCase__							,			indexa + 1			)							,			diff + min_distance(indexa + 1							,			indexa + 1			)							,			)

			return min_distance(0							,			0			)


if __name__ == "__main__":
		import doctest

		doctest.testmod()