




'''simple docstring'''



from dataclasses import dataclass
from enum import Enum
from typing import List, Optional, Union

import numpy as np
import PIL
from PIL import Image

from ...utils import BaseOutput, is_torch_available, is_transformers_available







@dataclass
class 	lowercase_					(				A     ):


   """simple docstring"""

   lowerCamelCase_       						=		{
       '''sld_warmup_steps''': 15,
       '''sld_guidance_scale''': 20,
       '''sld_threshold''': 0.0,
       '''sld_momentum_scale''': 0.0,
       '''sld_mom_beta''': 0.0,
   }
   lowerCamelCase_       						=		{
       '''sld_warmup_steps''': 10,
       '''sld_guidance_scale''': 1000,
       '''sld_threshold''': 0.01,
       '''sld_momentum_scale''': 0.3,
       '''sld_mom_beta''': 0.4,
   }
   lowerCamelCase_       						=		{
       '''sld_warmup_steps''': 7,
       '''sld_guidance_scale''': 2000,
       '''sld_threshold''': 0.025,
       '''sld_momentum_scale''': 0.5,
       '''sld_mom_beta''': 0.7,
   }
   lowerCamelCase_       						=		{
       '''sld_warmup_steps''': 0,
       '''sld_guidance_scale''': 5000,
       '''sld_threshold''': 1.0,
       '''sld_momentum_scale''': 0.5,
       '''sld_mom_beta''': 0.7,
   }







@dataclass
class 	lowercase_					(				A     ):


   """simple docstring"""

   lowerCamelCase_       						=		42
   lowerCamelCase_       						=		42
   lowerCamelCase_       						=		42
   lowerCamelCase_       						=		42


if is_transformers_available() and is_torch_available():
 from .pipeline_stable_diffusion_safe import StableDiffusionPipelineSafe
 from .safety_checker import SafeStableDiffusionSafetyChecker







'''simple docstring'''



lowerCamelCase_	 =		(1, 1_53, 3_70, 3_71, 16_34, 24_67_80_51, 1_15_13_22_19_01_87_63_99_25_65_09_55_97_97_39_71_52_24_01)
lowerCamelCase_	 =		(-1_53, -1, 0, 1.2, 2_00, "A", [], {}, None)
def 				SCREAMING_SNAKE_CASE_				(							__A       :				int						)				->				bool:
   if not isinstance(__A ,  __A						) or n < 1:
      return False

   # Initialization of sum and number of digits.
   _SCREAMING_SNAKE_CASE =   0
   _SCREAMING_SNAKE_CASE =   0
   _SCREAMING_SNAKE_CASE =   n
   # Calculation of digits of the number
   while temp > 0:
      number_of_digits += 1
      temp //= 10
   # Dividing number into separate digits and find Armstrong number
   _SCREAMING_SNAKE_CASE =   n
   while temp > 0:
      _SCREAMING_SNAKE_CASE =   temp % 10
      total += rem**number_of_digits
      temp //= 10
   return n == total
def 				SCREAMING_SNAKE_CASE_				(							__A       :				int						)				->				bool:
   if not isinstance(__A ,  __A						) or n < 1:
      return False

   # Init a "histogram" of the digits
   _SCREAMING_SNAKE_CASE =   [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
   _SCREAMING_SNAKE_CASE =   0
   _SCREAMING_SNAKE_CASE =   0
   _SCREAMING_SNAKE_CASE =   n
   while temp > 0:
      _SCREAMING_SNAKE_CASE, _SCREAMING_SNAKE_CASE =   divmod(__A ,  10						)
      digit_histogram[rem] += 1
      digit_total += 1

   for cnt, i in zip(__A ,  range(len(__A						)						)						):
      total += cnt * i**digit_total

   return n == total
def 				SCREAMING_SNAKE_CASE_				(							__A       :				int						)				->				bool:
   if not isinstance(__A ,  __A						) or n < 1:
      return False
   _SCREAMING_SNAKE_CASE =   len(str(__A						)						)  # the power that all digits will be raised to
   # check if sum of each digit multiplied expo times is equal to number
   return n == sum(int(__A						) ** expo for i in str(__A						)						)
def 				SCREAMING_SNAKE_CASE_				(							)				->				Optional[Any]:
   _SCREAMING_SNAKE_CASE =   int(input("Enter an integer to see if it is an Armstrong number: "						).strip()						)
   print(f"""{num} is {"" if armstrong_number(__A						) else "not "}an Armstrong number."""						)
   print(f"""{num} is {"" if narcissistic_number(__A						) else "not "}an Armstrong number."""						)
   print(f"""{num} is {"" if pluperfect_number(__A						) else "not "}an Armstrong number."""						)


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 main()

