





from __future__ import annotations




def      a__			(       lowercase__	,     lowercase__	):






   '''simple docstring'''






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




def      a__			(       lowercase__	,     lowercase__	,     lowercase__	,     lowercase__	):






   '''simple docstring'''






   ((UpperCAmelCase_)    ,							(UpperCAmelCase_))           =extended_euclid(lowercase__	,     lowercase__	)
   UpperCAmelCase_           =na * na
   UpperCAmelCase_           =ra * x * na + ra * y * na
   return (n % m + m) % m




def      a__			(       lowercase__	,     lowercase__	):






   '''simple docstring'''






   ((UpperCAmelCase_)    ,							(UpperCAmelCase_))           =extended_euclid(lowercase__	,     lowercase__	)
   if b < 0:
      UpperCAmelCase_           =(b % n + n) % n
   return b




def      a__			(       lowercase__	,     lowercase__	,     lowercase__	,     lowercase__	):






   '''simple docstring'''






   UpperCAmelCase_    ,							UpperCAmelCase_           =invert_modulo(lowercase__	,     lowercase__	), invert_modulo(lowercase__	,     lowercase__	)
   UpperCAmelCase_           =na * na
   UpperCAmelCase_           =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_sentencepiece_available,
    is_tokenizers_available,
    is_torch_available,
)


UpperCamelCase_       :    Dict						      =			{'''configuration_plbart''': ['''PLBART_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''PLBartConfig''']}

try:
		if not is_sentencepiece_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		UpperCamelCase_       :    int						      =			['''PLBartTokenizer''']

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		UpperCamelCase_       :    Optional[int]						      =			[
		    '''PLBART_PRETRAINED_MODEL_ARCHIVE_LIST''',
		    '''PLBartForCausalLM''',
		    '''PLBartForConditionalGeneration''',
		    '''PLBartForSequenceClassification''',
		    '''PLBartModel''',
		    '''PLBartPreTrainedModel''',
		]


if TYPE_CHECKING:
		from .configuration_plbart import PLBART_PRETRAINED_CONFIG_ARCHIVE_MAP, PLBartConfig

		try:
				if not is_sentencepiece_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .tokenization_plbart import PLBartTokenizer

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_plbart import (
				    PLBART_PRETRAINED_MODEL_ARCHIVE_LIST,
				    PLBartForCausalLM,
				    PLBartForConditionalGeneration,
				    PLBartForSequenceClassification,
				    PLBartModel,
				    PLBartPreTrainedModel,
				)


else:
		import sys

		UpperCamelCase_       :    Optional[int]						      =			_LazyModule(__name__, globals()['''__file__'''], _import_structure)




