from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_sentencepiece_available


A_      =      {}

try:
						if not is_sentencepiece_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						A_      =      ["GPTSw3Tokenizer"]


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

else:
						import sys

						A_      =      _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)






def        __UpperCAmelCase    (       UpperCAmelCase,		UpperCAmelCase       )->       int:



			"""simple docstring"""







			while a != 0:
						lowercase		,lowercase							=		b % a, a
			return b






def        __UpperCAmelCase    (       UpperCAmelCase,		UpperCAmelCase       )->       int:



			"""simple docstring"""







			if gcd(UpperCAmelCase,		UpperCAmelCase       ) != 1:
						lowercase							=		f'mod inverse of {a!r} and {m!r} does not exist'
						raise ValueError(UpperCAmelCase       )
			lowercase		,lowercase		,lowercase							=		1, 0, a
			lowercase		,lowercase		,lowercase							=		0, 1, m
			while va != 0:
						lowercase							=		ua // va
						lowercase		,lowercase		,lowercase		,lowercase		,lowercase		,lowercase							=		(ua - q * va), (ua - q * va), (ua - q * va), va, va, va
			return ua % m





