


import unittest

import torch

from diffusers import DDIMScheduler, TextToVideoZeroPipeline
from diffusers.utils import load_pt, require_torch_gpu, slow

from ..test_pipelines_common import assert_mean_pixel_difference


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






  """simple docstring"""





  def    lowerCAmelCase__					(       self    :    Tuple					)				->	Union[str, Any]:




     """simple docstring"""
     snake_case_         =   "runwayml/stable-diffusion-v1-5"
     snake_case_         =   TextToVideoZeroPipeline.from_pretrained(snake_case__      ,			torch_dtype=torch.floataa					).to("cuda"					)
     snake_case_         =   DDIMScheduler.from_config(pipe.scheduler.config					)
     snake_case_         =   torch.Generator(device="cuda"					).manual_seed(0					)

     snake_case_         =   "A bear is playing a guitar on Times Square"
     snake_case_         =   pipe(prompt=snake_case__      ,			generator=snake_case__					).images

     snake_case_         =   load_pt(
         "https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/text-to-video/A bear is playing a guitar on Times Square.pt"					)

     assert_mean_pixel_difference(snake_case__      ,			snake_case__					)








def      _lowerCAmelCase  (							lowerCAmelCase_							:Dict						,  lowerCAmelCase_							:Optional[int]						,  lowerCAmelCase_							:Tuple							)->Optional[Any]:
   '''simple docstring'''






   assert b != 0, "This cannot accept modulo that is == 0"
   if n == 0:
      return 1

   if n % 2 == 1:
      return (bin_exp_mod(lowerCAmelCase_						,  n - 1						,  lowerCAmelCase_							) * a) % b

   snake_case_         =   bin_exp_mod(lowerCAmelCase_						,  n / 2						,  lowerCAmelCase_							)
   return (r * r) % b


if __name__ == "__main__":
   try:
      SCREAMING_SNAKE_CASE		:str											=       int(input('''Enter Base : ''').strip())
      SCREAMING_SNAKE_CASE		:List[Any]											=       int(input('''Enter Power : ''').strip())
      SCREAMING_SNAKE_CASE		:Dict											=       int(input('''Enter Modulo : ''').strip())
   except ValueError:
      print('''Invalid literal for integer''')

   print(bin_exp_mod(BASE, POWER, MODULO))




