

def   __SCREAMING_SNAKE_CASE					(SCREAMING_SNAKE_CASE__  ,		SCREAMING_SNAKE_CASE__  ,		SCREAMING_SNAKE_CASE__       ):

						if exponent == 1:
												return base
						if exponent % 2 == 0:
												snake_case_   =	_modexpt(SCREAMING_SNAKE_CASE__  ,		exponent // 2  ,		SCREAMING_SNAKE_CASE__       ) % modulo_value
												return (x * x) % modulo_value
						else:
												return (base * _modexpt(SCREAMING_SNAKE_CASE__  ,		exponent - 1  ,		SCREAMING_SNAKE_CASE__       )) % modulo_value


def   __SCREAMING_SNAKE_CASE					(SCREAMING_SNAKE_CASE__ = 1777  ,		SCREAMING_SNAKE_CASE__ = 1855  ,		SCREAMING_SNAKE_CASE__ = 8       ):
						snake_case_   =	base
						for _ in range(1  ,		SCREAMING_SNAKE_CASE__       ):
												snake_case_   =	_modexpt(SCREAMING_SNAKE_CASE__  ,		SCREAMING_SNAKE_CASE__  ,		10**digits       )

						return result


if __name__ == "__main__":
					print(f"""{solution() = }""")



"""simple docstring"""







import unittest

import numpy as np
import torch

from diffusers import VersatileDiffusionImageVariationPipeline
from diffusers.utils.testing_utils import load_image, require_torch_gpu, slow, torch_device


a__				:							Tuple						=     False




class  UpperCamelCase_	( unittest.TestCase):

	"""simple docstring"""





	pass




@slow
@require_torch_gpu
class  UpperCamelCase_	( unittest.TestCase):

	"""simple docstring"""





	def   UpperCAmelCase_      ( self			:				int   )       ->	int:
						__SCREAMING_SNAKE_CASE						   =				VersatileDiffusionImageVariationPipeline.from_pretrained("shi-labs/versatile-diffusion"   )
						pipe.to(UpperCAmelCase__   )
						pipe.set_progress_bar_config(disable=UpperCAmelCase__   )

						__SCREAMING_SNAKE_CASE						   =				load_image(
						    "https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/versatile_diffusion/benz.jpg"   )
						__SCREAMING_SNAKE_CASE						   =				torch.manual_seed(0   )
						__SCREAMING_SNAKE_CASE						   =				pipe(
						    image=UpperCAmelCase__			,			generator=UpperCAmelCase__			,			guidance_scale=7.5			,			num_inference_steps=5_0			,			output_type="numpy"			,			).images

						__SCREAMING_SNAKE_CASE						   =				image[0, 2_5_3:2_5_6, 2_5_3:2_5_6, -1]

						assert image.shape == (1, 5_1_2, 5_1_2, 3)
						__SCREAMING_SNAKE_CASE						   =				np.array([0.0_441, 0.0_469, 0.0_507, 0.0_575, 0.0_632, 0.0_650, 0.0_865, 0.0_909, 0.0_945]   )

						assert np.abs(image_slice.flatten() - expected_slice   ).max() < 1E-2
