



from __future__ import annotations






def        a( A			:       int					,	A			:       int					,	A			:       int			)						->			int:
					"""simple docstring"""





					assert n > 1 and a > 0 and greatest_common_divisor(A					,	A			) == 1
					((a)	,							(a)	,							(a))   	=  extended_gcd(A					,	A			)  # Implemented below
					a   	=  (b * s) % n
					return x






def        a( A			:       int					,	A			:       int			)						->			int:
					"""simple docstring"""





					((a)	,							(a))   	=  extended_euclid(A					,	A			)  # Implemented below
					if b < 0:
										a   	=  (b % n + n) % n
					return b






def        a( A			:       int					,	A			:       int					,	A			:       int			)						->			int:
					"""simple docstring"""





					a   	=  invert_modulo(A					,	A			)
					a   	=  (b * s) % n
					return x






def        a( A			:       int					,	A			:       int			)						->			tuple[int, int, int]:
					"""simple docstring"""





					assert a >= 0 and b >= 0

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

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

					return (d, x, y)






def        a( A			:       int					,	A			:       int			)						->			tuple[int, int]:
					"""simple docstring"""





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






def        a( A			:       int					,	A			:       int			)						->			int:
					"""simple docstring"""





					if a < b:
										a	,							a   	=  b, a

					while a % b != 0:
										a	,							a   	=  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)





from .pipeline_kandinskya_a import KandinskyVaaPipeline
from .pipeline_kandinsky2_2_controlnet import KandinskyVaaControlnetPipeline
from .pipeline_kandinsky2_2_controlnet_img2img import KandinskyVaaControlnetImgaImgPipeline
from .pipeline_kandinsky2_2_img2img import KandinskyVaaImgaImgPipeline
from .pipeline_kandinsky2_2_inpainting import KandinskyVaaInpaintPipeline
from .pipeline_kandinsky2_2_prior import KandinskyVaaPriorPipeline
from .pipeline_kandinsky2_2_prior_emb2emb import KandinskyVaaPriorEmbaEmbPipeline
