




"""simple docstring"""







from __future__ import annotations





def 							lowercase					(snake_case__   : int      ,       snake_case__   : int )     ->  tuple[int, int]:


				'''simple docstring'''






				if b == 0:
								return (1, 0)
				((lowerCAmelCase) ,						(lowerCAmelCase))  =				extended_euclid(snake_case__      ,       a % b )
				lowerCAmelCase  =				a // b
				return (y, x - k * y)





def 							lowercase					(snake_case__   : int      ,       snake_case__   : int      ,       snake_case__   : int      ,       snake_case__   : int )     ->  int:


				'''simple docstring'''






				((lowerCAmelCase) ,						(lowerCAmelCase))  =				extended_euclid(snake_case__      ,       snake_case__ )
				lowerCAmelCase  =				na * na
				lowerCAmelCase  =				ra * x * na + ra * y * na
				return (n % m + m) % m





def 							lowercase					(snake_case__   : int      ,       snake_case__   : int )     ->  int:


				'''simple docstring'''






				((lowerCAmelCase) ,						(lowerCAmelCase))  =				extended_euclid(snake_case__      ,       snake_case__ )
				if b < 0:
								lowerCAmelCase  =				(b % n + n) % n
				return b





def 							lowercase					(snake_case__   : int      ,       snake_case__   : int      ,       snake_case__   : int      ,       snake_case__   : int )     ->  int:


				'''simple docstring'''






				lowerCAmelCase ,						lowerCAmelCase  =				invert_modulo(snake_case__      ,       snake_case__ ), invert_modulo(snake_case__      ,       snake_case__ )
				lowerCAmelCase  =				na * na
				lowerCAmelCase  =				ra * x * na + ra * y * na
				return (n % m + m) % m


if __name__ == "__main__":
		from doctest import testmod

		testmod(name='chinese_remainder_theorem', verbose=True)
		testmod(name='chinese_remainder_theorem2', verbose=True)
		testmod(name='invert_modulo', verbose=True)
		testmod(name='extended_euclid', verbose=True)











"""simple docstring"""







from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


a      =							{
    'configuration_time_series_transformer': [
        'TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'TimeSeriesTransformerConfig',
    ],
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		a      =							[
		    'TIME_SERIES_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'TimeSeriesTransformerForPrediction',
		    'TimeSeriesTransformerModel',
		    'TimeSeriesTransformerPreTrainedModel',
		]


if TYPE_CHECKING:
		from .configuration_time_series_transformer import (
		    TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
		    TimeSeriesTransformerConfig,
		)

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_time_series_transformer import (
				    TIME_SERIES_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
				    TimeSeriesTransformerForPrediction,
				    TimeSeriesTransformerModel,
				    TimeSeriesTransformerPreTrainedModel,
				)

else:
		import sys

		a      =							_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)





