





'''simple docstring'''


import torch

from diffusers import DiffusionPipeline

class    lowerCAmelCase_		(		__magic_name__		):




 def __init__(	self			,     _lowerCAmelCase			,     _lowerCAmelCase		)    ->							int:
     super().__init__()

     self.register_modules(unet=_lowerCAmelCase			,     scheduler=_lowerCAmelCase		)





 def __call__(	self		)    ->							Any:
     _lowerCAmelCase				=      torch.randn(
         (1, self.unet.config.in_channels, self.unet.config.sample_size, self.unet.config.sample_size)			,     )
     _lowerCAmelCase				=      1

     _lowerCAmelCase				=      self.unet(_lowerCAmelCase			,     _lowerCAmelCase		).sample
     _lowerCAmelCase				=      self.scheduler.step(_lowerCAmelCase			,     _lowerCAmelCase			,     _lowerCAmelCase		).prev_sample

     _lowerCAmelCase				=      scheduler_output - scheduler_output + torch.ones_like(_lowerCAmelCase		)

     return result









'''simple docstring'''


def 	__a(SCREAMING_SNAKE_CASE_  :					int    ):



    '''simple docstring'''





    if not isinstance(SCREAMING_SNAKE_CASE_		,       SCREAMING_SNAKE_CASE_    ):
        raise ValueError("check_bouncy() accepts only integer arguments"    )
    _lowerCAmelCase				=      str(SCREAMING_SNAKE_CASE_    )
    _lowerCAmelCase				=      "".join(sorted(SCREAMING_SNAKE_CASE_    )    )
    return sorted_str_n != str_n and sorted_str_n[::-1] != str_n


def 	__a(SCREAMING_SNAKE_CASE_  :					float = 99    ):



    '''simple docstring'''





    if not 0 < percent < 100:
        raise ValueError("solution() only accepts values from 0 to 100"    )
    _lowerCAmelCase				=      0
    _lowerCAmelCase				=      1

    while True:
        if check_bouncy(SCREAMING_SNAKE_CASE_    ):
            bouncy_num += 1
        if (bouncy_num / num) * 100 >= percent:
            return num
        num += 1


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

       testmod()
       print(f'''{solution(99)}''')


