


from manim import *







class       _lowercase			(							lowercase__):


       """simple docstring"""




       def 						lowerCAmelCase					(       self							:      Optional[int]	):


             '''simple docstring'''



             lowerCamelCase__		:    Optional[Any]   =  Rectangle(height=0.5 ,				width=0.5	)
             lowerCamelCase__		:    Any   =  Rectangle(height=0.4_6 ,				width=0.4_6	).set_stroke(width=0	)
             lowerCamelCase__		:    str   =  Rectangle(height=0.2_5 ,				width=0.2_5	)

             lowerCamelCase__		:    Union[str, Any]   =  [mem.copy() for i in range(6	)]
             lowerCamelCase__		:    int   =  [mem.copy() for i in range(6	)]
             lowerCamelCase__		:    Tuple   =  VGroup(*__lowerCamelCase	).arrange(__lowerCamelCase ,				buff=0	)
             lowerCamelCase__		:    Tuple   =  VGroup(*__lowerCamelCase	).arrange(__lowerCamelCase ,				buff=0	)
             lowerCamelCase__		:    Union[str, Any]   =  VGroup(__lowerCamelCase ,				__lowerCamelCase	).arrange(__lowerCamelCase ,				buff=0	)
             lowerCamelCase__		:    int   =  Text("CPU" ,				font_size=24	)
             lowerCamelCase__		:    Tuple   =  Group(__lowerCamelCase ,				__lowerCamelCase	).arrange(__lowerCamelCase ,				buff=0.5 ,				aligned_edge=__lowerCamelCase	)
             cpu.move_to([-2.5, -0.5, 0]	)
             self.add(__lowerCamelCase	)

             lowerCamelCase__		:    Union[str, Any]   =  [mem.copy() for i in range(4	)]
             lowerCamelCase__		:    Dict   =  VGroup(*__lowerCamelCase	).arrange(__lowerCamelCase ,				buff=0	)
             lowerCamelCase__		:    Optional[int]   =  Text("GPU" ,				font_size=24	)
             lowerCamelCase__		:    Optional[int]   =  Group(__lowerCamelCase ,				__lowerCamelCase	).arrange(__lowerCamelCase ,				buff=0.5 ,				aligned_edge=__lowerCamelCase	)
             gpu.move_to([-1, -1, 0]	)
             self.add(__lowerCamelCase	)

             lowerCamelCase__		:    List[Any]   =  [mem.copy() for i in range(6	)]
             lowerCamelCase__		:    List[str]   =  VGroup(*__lowerCamelCase	).arrange(__lowerCamelCase ,				buff=0	)

             lowerCamelCase__		:    Any   =  Text("Model" ,				font_size=24	)
             lowerCamelCase__		:    Union[str, Any]   =  Group(__lowerCamelCase ,				__lowerCamelCase	).arrange(__lowerCamelCase ,				buff=0.5 ,				aligned_edge=__lowerCamelCase	)
             model.move_to([3, -1.0, 0]	)
             self.add(__lowerCamelCase	)

             lowerCamelCase__		:    str   =  []
             lowerCamelCase__		:    Dict   =  []

             for i, rect in enumerate(__lowerCamelCase	):
                   rect.set_stroke(__lowerCamelCase	)

                   lowerCamelCase__		:    Any   =  Rectangle(height=0.4_6 / 4 ,				width=0.4_6 / 3	).set_stroke(width=0.0	).set_fill(__lowerCamelCase ,				opacity=0.7	)

                   if i == 0:
                         cpu_target.next_to(cpu_left_col_base[0].get_corner(DOWN + LEFT	) ,				buff=0.0_2 ,				direction=__lowerCamelCase	)
                         cpu_target.set_x(cpu_target.get_x() + 0.1	)
                   elif i == 3:
                         cpu_target.next_to(model_cpu_arr[0] ,				direction=__lowerCamelCase ,				buff=0.0	)
                   else:
                         cpu_target.next_to(model_cpu_arr[i - 1] ,				direction=__lowerCamelCase ,				buff=0.0	)
                   self.add(__lowerCamelCase	)
                   model_cpu_arr.append(__lowerCamelCase	)

             self.add(*__lowerCamelCase ,				*__lowerCamelCase	)

             lowerCamelCase__		:    Tuple   =  [meta_mem.copy() for i in range(6	)]
             lowerCamelCase__		:    str   =  [meta_mem.copy() for i in range(6	)]
             lowerCamelCase__		:    List[str]   =  VGroup(*__lowerCamelCase	).arrange(__lowerCamelCase ,				buff=0	)
             lowerCamelCase__		:    Union[str, Any]   =  VGroup(*__lowerCamelCase	).arrange(__lowerCamelCase ,				buff=0	)
             lowerCamelCase__		:    Optional[Any]   =  VGroup(__lowerCamelCase ,				__lowerCamelCase	).arrange(__lowerCamelCase ,				buff=0	)
             lowerCamelCase__		:    Optional[Any]   =  Text("Disk" ,				font_size=24	)
             lowerCamelCase__		:    Dict   =  Group(__lowerCamelCase ,				__lowerCamelCase	).arrange(__lowerCamelCase ,				buff=0.5 ,				aligned_edge=__lowerCamelCase	)
             disk.move_to([-4.0, -1.2_5, 0]	)
             self.add(__lowerCamelCase ,				__lowerCamelCase	)

             lowerCamelCase__		:    List[str]   =  []

             for i in range(6	):
                   lowerCamelCase__		:    int   =  fill.copy().set_fill(__lowerCamelCase ,				opacity=0.8	)
                   target.move_to(disk_left_col_base[i]	).scale(0.5	)
                   cpu_disk_arr.append(__lowerCamelCase	)

             self.add(*__lowerCamelCase	)

             lowerCamelCase__		:    Optional[Any]   =  Square(side_length=2.2	)
             key.move_to([-5, 2, 0]	)

             lowerCamelCase__		:    Union[str, Any]   =  MarkupText(
                 f"<b>Key:</b>\n\n<span fgcolor='{YELLOW}'>●</span> Empty Model" ,				font_size=18 ,				)

             key_text.move_to([-5, 2.4, 0]	)

             self.add(__lowerCamelCase ,				__lowerCamelCase	)

             lowerCamelCase__		:    Tuple   =  MarkupText(
                 f"<span fgcolor='{BLUE}'>●</span> Checkpoint" ,				font_size=18 ,				)

             blue_text.next_to(__lowerCamelCase ,				DOWN * 2.4 ,				aligned_edge=key_text.get_left()	)
             self.add(__lowerCamelCase	)

             lowerCamelCase__		:    Dict   =  MarkupText(f"The offloaded weights are all sent to the CPU." ,				font_size=24	)
             step_a.move_to([2, 2, 0]	)

             self.play(Write(__lowerCamelCase ,				run_time=3	)	)

             for i in range(6	):
                   lowerCamelCase__		:    List[Any]   =  cpu_disk_arr[i]
                   lowerCamelCase__		:    Optional[Any]   =  rect.copy().set_fill(__lowerCamelCase ,				opacity=0.8	).scale(2.0	)
                   cpa.generate_target()
                   cpa.target.move_to(model_base[i]	)

                   if i == 0:
                         rect.set_fill(__lowerCamelCase ,				opacity=0.8	)
                         rect.generate_target()
                         rect.target.move_to(cpu_left_col_base[0]	).scale(2.0	)

                         self.remove(
                             *__lowerCamelCase ,				*__lowerCamelCase ,				)

                   else:
                         rect.generate_target()
                         rect.target.move_to(cpu_left_col_base[i]	).scale(2.0	)
                   self.play(MoveToTarget(__lowerCamelCase	) ,				MoveToTarget(__lowerCamelCase	) ,				model_base[i].animate.set_stroke(__lowerCamelCase	)	)
             self.play(FadeOut(__lowerCamelCase	)	)

             lowerCamelCase__		:    List[Any]   =  MarkupText(
                 f"Finally, hooks are added to each weight in the model\nto transfer the weights from CPU to GPU\n\t\tand back when needed." ,				font_size=24 ,				)
             step_a.move_to([2, 2, 0]	)

             self.play(Write(__lowerCamelCase ,				run_time=3	)	)

             lowerCamelCase__		:    Tuple   =  []
             lowerCamelCase__		:    Optional[int]   =  []
             for i in range(6	):
                   lowerCamelCase__		:    List[Any]   =  Arrow(start=__lowerCamelCase ,				end=__lowerCamelCase ,				color=__lowerCamelCase ,				buff=0.5	)
                   a.next_to(model_base[i].get_left() ,				__lowerCamelCase ,				buff=0.2	)
                   arrows.append(__lowerCamelCase	)
                   animations.append(Write(__lowerCamelCase	)	)
             self.play(*__lowerCamelCase	)
             self.wait()






from urllib.error import HTTPError

from bsa import BeautifulSoup
from requests import exceptions, get

A				:   List[str]		= "https://www.wellrx.com/prescriptions/{0}/{1}/?freshSearch=true"

def 				lowercase_		(		_A      :   str   , _A      :   str						):

      """simple docstring"""




      try:
            # Has user provided both inputs?
            if not drug_name or not zip_code:
                  return None

            lowerCamelCase__		:    List[str]   =  BASE_URL.format(_A   , _A						)
            lowerCamelCase__		:    int   =  get(_A						)

            # Is the response ok?
            response.raise_for_status()

            # Scrape the data using bs4
            lowerCamelCase__		:    Dict   =  BeautifulSoup(response.text   , "html.parser"						)

            # This list will store the name and price.
            lowerCamelCase__		:    int   =  []

            # Fetch all the grids that contains the items.
            lowerCamelCase__		:    List[str]   =  soup.find_all("div"   , {"class": "grid-x pharmCard"}						)
            if grid_list and len(_A						) > 0:
                  for grid in grid_list:
                        # Get the pharmacy price.
                        lowerCamelCase__		:    Optional[int]   =  grid.find("p"   , {"class": "list-title"}						).text

                        # Get price of the drug.
                        lowerCamelCase__		:    Union[str, Any]   =  grid.find("span"   , {"p", "price price-large"}						).text

                        pharmacy_price_list.append(
                            {
                                "pharmacy_name": pharmacy_name,
                                "price": price,
                            }						)

            return pharmacy_price_list

      except (HTTPError, exceptions.RequestException, ValueError):
            return None


if __name__ == "__main__":
    # Enter a drug name and a zip code
    A				:   Any		= input("Enter drug name: ").strip()
    A				:   Union[str, Any]		= input("Enter zip code: ").strip()

    A				:   list | None		= fetch_pharmacy_and_price_list(
        drug_name, zip_code
    )

    if pharmacy_price_list:
        print(f'\nSearch results for {drug_name} at location {zip_code}:')
        for pharmacy_price in pharmacy_price_list:
            A				:   Dict		= pharmacy_price["pharmacy_name"]
            A				:   Optional[int]		= pharmacy_price["price"]

            print(f'Pharmacy: {name} Price: {price}')
    else:
        print(f'No results found for {drug_name}')


