

'''simple docstring'''





import requests
from bsa import BeautifulSoup







def     A_   (					_UpperCAmelCase       ,			_UpperCAmelCase					):
						SCREAMING_SNAKE_CASE_:				Optional[Any]							= (
						    "https://www.horoscope.com/us/horoscopes/general/"
						    f"horoscope-general-daily-{day}.aspx?sign={zodiac_sign}"
						)
						SCREAMING_SNAKE_CASE_:				Any							= BeautifulSoup(requests.get(UpperCamelCase__					).content       ,			"html.parser"					)
						return soup.find("div"       ,			class_="main-horoscope"					).p.text


if __name__ == "__main__":
						print("""Daily Horoscope. \n""")
						print(
						    """enter your Zodiac sign number:\n""",
						    """1. Aries\n""",
						    """2. Taurus\n""",
						    """3. Gemini\n""",
						    """4. Cancer\n""",
						    """5. Leo\n""",
						    """6. Virgo\n""",
						    """7. Libra\n""",
						    """8. Scorpio\n""",
						    """9. Sagittarius\n""",
						    """10. Capricorn\n""",
						    """11. Aquarius\n""",
						    """12. Pisces\n""",
						)
						lowerCAmelCase							:						Any     			=		int(input("""number> """).strip())
						print("""choose some day:\n""", """yesterday\n""", """today\n""", """tomorrow\n""")
						lowerCAmelCase							:						int     			=		input("""enter the day> """)
						lowerCAmelCase							:						Union[str, Any]     			=		horoscope(zodiac_sign, day)
						print(horoscope_text)









from typing import List, Optional, Tuple, Union

import torch

from ...models import UNetaDModel
from ...schedulers import PNDMScheduler
from ...utils import randn_tensor
from ..pipeline_utils import DiffusionPipeline, ImagePipelineOutput



class 						__lowercase       (				UpperCAmelCase_			):




			"""simple docstring"""







			_UpperCAmelCase     :							UNetaDModel
			_UpperCAmelCase     :							PNDMScheduler



			def __init__(				self						:  Optional[int]     ,		lowerCAmelCase__						:  UNetaDModel     ,		lowerCAmelCase__						:  PNDMScheduler):
									super().__init__()

									SCREAMING_SNAKE_CASE_:				Dict							= PNDMScheduler.from_config(scheduler.config)

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




			@torch.no_grad()
			def __call__(				self						:  int     ,		lowerCAmelCase__						:  int = 1     ,		lowerCAmelCase__						:  int = 50     ,		lowerCAmelCase__						:  Optional[Union[torch.Generator, List[torch.Generator]]] = None     ,		lowerCAmelCase__						:  Optional[str] = "pil"     ,		lowerCAmelCase__						:  bool = True     ,		**lowerCAmelCase__						:  str     ,		):
									SCREAMING_SNAKE_CASE_:				Dict							= randn_tensor(
									    (batch_size, self.unet.config.in_channels, self.unet.config.sample_size, self.unet.config.sample_size)     ,		generator=lowerCAmelCase__     ,		device=self.device     ,		)

									self.scheduler.set_timesteps(lowerCAmelCase__)
									for t in self.progress_bar(self.scheduler.timesteps):
															SCREAMING_SNAKE_CASE_:				Union[str, Any]							= self.unet(lowerCAmelCase__     ,		lowerCAmelCase__).sample

															SCREAMING_SNAKE_CASE_:				Any							= self.scheduler.step(lowerCAmelCase__     ,		lowerCAmelCase__     ,		lowerCAmelCase__).prev_sample

									SCREAMING_SNAKE_CASE_:				Optional[Any]							= (image / 2 + 0.5).clamp(0     ,		1)
									SCREAMING_SNAKE_CASE_:				Dict							= image.cpu().permute(0     ,		2     ,		3     ,		1).numpy()
									if output_type == "pil":
															SCREAMING_SNAKE_CASE_:				Any							= self.numpy_to_pil(lowerCAmelCase__)

									if not return_dict:
															return (image,)

									return ImagePipelineOutput(images=lowerCAmelCase__)






