




from typing import List

import PIL
import torch
from PIL import Image

from ...configuration_utils import ConfigMixin
from ...models.modeling_utils import ModelMixin
from ...utils import PIL_INTERPOLATION


class 							__SCREAMING_SNAKE_CASE				(						lowerCamelCase  ,	lowerCamelCase    ):

					def __init__(							self   ):







						'''simple docstring'''




						super().__init__()

						self.register_buffer('watermark_image'					,			torch.zeros((62, 62, 4)   )   )
						lowerCamelCase_				:						Any				  =				None





					def       lowercase_				(							self					,			__lowercase					,			__lowercase=None   ):







						'''simple docstring'''




						lowerCamelCase_				:						Tuple				  =				images[0].height
						lowerCamelCase_				:						List[Any]				  =				images[0].width

						lowerCamelCase_				:						Tuple				  =				sample_size or h

						lowerCamelCase_				:						List[str]				  =				min(h / sample_size					,			w / sample_size   )
						lowerCamelCase_  ,     lowerCamelCase_				:						int				  =				(int(h / coef   ), int(w / coef   )) if coef < 1 else (h, w)

						lowerCamelCase_  ,     lowerCamelCase_				:						List[Any]				  =				1_024**2, img_w * img_h
						lowerCamelCase_				:						List[str]				  =				(Sa / Sa) ** 0.5
						lowerCamelCase_  ,     lowerCamelCase_  ,     lowerCamelCase_				:						str				  =				int(K * 62   ), img_w - int(14 * K   ), img_h - int(14 * K   )

						if self.watermark_image_as_pil is None:
							lowerCamelCase_				:						Dict				  =				self.watermark_image.to(torch.uinta   ).cpu().numpy()
							lowerCamelCase_				:						str				  =				Image.fromarray(__lowercase					,			mode='RGBA'   )
							lowerCamelCase_				:						Optional[Any]				  =				watermark_image

						lowerCamelCase_				:						Tuple				  =				self.watermark_image_as_pil.resize(
						    (wm_size, wm_size)					,			PIL_INTERPOLATION['bicubic']					,			reducing_gap=__lowercase   )

						for pil_img in images:
							pil_img.paste(__lowercase					,			box=(wm_x - wm_size, wm_y - wm_size, wm_x, wm_y)					,			mask=wm_img.split()[-1]   )

						return images






def    snake_case   (				A		,  A     )				->				int:




	'''simple docstring'''


	if a < b:
		return gcd(A		,  A     )
	if a % b == 0:
		return b
	return gcd(A		,  a % b     )






def    snake_case   (				A		,  A		,  A     )				->				int:




	'''simple docstring'''


	if y == 0:
		return 1
	lowerCamelCase_				:						int				  =				power(A		,  y // 2		,  A     ) % mod
	lowerCamelCase_				:						List[Any]				  =				(temp * temp) % mod
	if y % 2 == 1:
		lowerCamelCase_				:						str				  =				(temp * x) % mod
	return temp






def    snake_case   (				A     )				->				bool:




	'''simple docstring'''


	lowerCamelCase_				:						Union[str, Any]				  =				2
	while b < n:
		if gcd(A		,  A     ) == 1 and power(A		,  n - 1		,  A     ) != 1:
			return False
		b += 1
	return True


if __name__ == "__main__":
							UpperCamelCase__						=		int(input('Enter number: ').strip())
							if is_carmichael_number(number):
														print(F'{number} is a Carmichael Number.')
							else:
														print(F'{number} is not a Carmichael Number.')
