

'''simple docstring'''





from __future__ import annotations


def 						__SCREAMING_SNAKE_CASE      (SCREAMING_SNAKE_CASE__						,	SCREAMING_SNAKE_CASE__						,	SCREAMING_SNAKE_CASE__ ):
						assert n > 1 and a > 0 and greatest_common_divisor(SCREAMING_SNAKE_CASE__						,	SCREAMING_SNAKE_CASE__ ) == 1
						((snake_case_),					(snake_case_),					(snake_case_))     =			extended_gcd(SCREAMING_SNAKE_CASE__						,	SCREAMING_SNAKE_CASE__ )  # Implemented below
						snake_case_     =			(b * s) % n
						return x


def 						__SCREAMING_SNAKE_CASE      (SCREAMING_SNAKE_CASE__						,	SCREAMING_SNAKE_CASE__ ):
						((snake_case_),					(snake_case_))     =			extended_euclid(SCREAMING_SNAKE_CASE__						,	SCREAMING_SNAKE_CASE__ )  # Implemented below
						if b < 0:
												snake_case_     =			(b % n + n) % n
						return b


def 						__SCREAMING_SNAKE_CASE      (SCREAMING_SNAKE_CASE__						,	SCREAMING_SNAKE_CASE__						,	SCREAMING_SNAKE_CASE__ ):
						snake_case_     =			invert_modulo(SCREAMING_SNAKE_CASE__						,	SCREAMING_SNAKE_CASE__ )
						snake_case_     =			(b * s) % n
						return x


def 						__SCREAMING_SNAKE_CASE      (SCREAMING_SNAKE_CASE__						,	SCREAMING_SNAKE_CASE__ ):
						assert a >= 0 and b >= 0

						if b == 0:
												snake_case_,					snake_case_,					snake_case_     =			a, 1, 0
						else:
												((snake_case_),					(snake_case_),					(snake_case_))     =			extended_gcd(SCREAMING_SNAKE_CASE__						,	a % b )
												snake_case_     =			q
												snake_case_     =			p - q * (a // b)

						assert a % d == 0 and b % d == 0
						assert d == a * x + b * y

						return (d, x, y)


def 						__SCREAMING_SNAKE_CASE      (SCREAMING_SNAKE_CASE__						,	SCREAMING_SNAKE_CASE__ ):
						if b == 0:
												return (1, 0)
						((snake_case_),					(snake_case_))     =			extended_euclid(SCREAMING_SNAKE_CASE__						,	a % b )
						snake_case_     =			a // b
						return (y, x - k * y)


def 						__SCREAMING_SNAKE_CASE      (SCREAMING_SNAKE_CASE__						,	SCREAMING_SNAKE_CASE__ ):
						if a < b:
												snake_case_,					snake_case_     =			b, a

						while a % b != 0:
												snake_case_,					snake_case_     =			b, a % b

						return b


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

					testmod(name='''modular_division''', verbose=True)
					testmod(name='''modular_division2''', verbose=True)
					testmod(name='''invert_modulo''', verbose=True)
					testmod(name='''extended_gcd''', verbose=True)
					testmod(name='''extended_euclid''', verbose=True)
					testmod(name='''greatest_common_divisor''', verbose=True)


import warnings

from .generation import GenerationMixin





class 			snake_case_     (	__A      ):







			'''simple docstring'''

			warnings.warn(
			    "Importing `GenerationMixin` from `src/transformers/generation_utils.py` is deprecated and will "
			    "be removed in Transformers v5. Import as `from transformers import GenerationMixin` instead."			, __A			, )