

def       __lowerCAmelCase      (						A       ,     A    ):

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

	UpperCAmelCase_       				=			len(A    )
	UpperCAmelCase_       				=			len(A    )

	UpperCAmelCase_       				=			[[0] * (texta_length + 1) for _ in range(texta_length + 1    )]
	UpperCAmelCase_       				=			0
	UpperCAmelCase_       				=			0

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

	return texta[ans_index - ans_length : ans_index]


if __name__ == "__main__":
				import doctest

				doctest.testmod()


from .imports import is_tqdm_available


if is_tqdm_available():
				from tqdm.auto import tqdm as _tqdm

from ..state import PartialState



def       __lowerCAmelCase      (						A = True       ,     *A       ,     **A    ):
	if not is_tqdm_available():
		raise ImportError("Accelerate's `tqdm` module requires `tqdm` to be installed. Please run `pip install tqdm`."    )
	UpperCAmelCase_       				=			False
	if main_process_only:
		UpperCAmelCase_       				=			PartialState().local_process_index == 0
	return _tqdm(*A       ,     **A       ,     disable=A    )