


'''simple docstring'''



def      UpperCAmelCase__   (      UpperCAmelCase_       :							str ,       UpperCAmelCase_       :							str				)	->						str:





     if not (isinstance(__snake_case ,       __snake_case				) and isinstance(__snake_case ,       __snake_case				)):
          raise ValueError('longest_common_substring() takes two strings for inputs'				)

     __lowerCamelCase  :      Tuple														=						len(__snake_case				)
     __lowerCamelCase  :      Any														=						len(__snake_case				)

     __lowerCamelCase  :      str														=						[[0] * (texta_length + 1) for _ in range(texta_length + 1				)]
     __lowerCamelCase  :      Optional[Any]														=						0
     __lowerCamelCase  :      int														=						0

     for i in range(1 ,       texta_length + 1				):
          for j in range(1 ,       texta_length + 1				):
               if texta[i - 1] == texta[j - 1]:
                    __lowerCamelCase  :      List[Any]														=						1 + dp[i - 1][j - 1]
                    if dp[i][j] > ans_length:
                         __lowerCamelCase  :      str														=						i
                         __lowerCamelCase  :      List[Any]														=						dp[i][j]

     return texta[ans_index - ans_length : ans_index]


if __name__ == "__main__":
      import doctest

      doctest.testmod()














"""simple docstring"""
from typing import TYPE_CHECKING

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


snake_case : int     		=		{}

try:
 if not is_sentencepiece_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 snake_case : str     		=		["""NllbTokenizer"""]

try:
 if not is_tokenizers_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 snake_case : Dict     		=		["""NllbTokenizerFast"""]


if TYPE_CHECKING:
 try:
  if not is_sentencepiece_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .tokenization_nllb import NllbTokenizer

 try:
  if not is_tokenizers_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .tokenization_nllb_fast import NllbTokenizerFast

else:
 import sys

 snake_case : Dict     		=		_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)