


from __future__ import annotations

from typing import Generic, TypeVar

A				:   Dict		= TypeVar("T")







class       _lowercase			(							lowercase__):


       """simple docstring"""




       pass







class       _lowercase			(							lowercase__):


       """simple docstring"""




       pass







class       _lowercase			(							Generic[T]):


       """simple docstring"""




       def __init__(       self							:      int ,				__lowerCamelCase							:      int = 10	):


             '''simple docstring'''



             lowerCamelCase__		:    list[T]   =  []
             lowerCamelCase__		:    Tuple   =  limit





       def __bool__(       self							:      Any	):


             '''simple docstring'''



             return bool(self.stack	)





       def __str__(       self							:      Optional[Any]	):


             '''simple docstring'''



             return str(self.stack	)





       def 						lowerCAmelCase					(       self							:      Tuple ,				__lowerCamelCase							:      T	):


             '''simple docstring'''



             if len(self.stack	) >= self.limit:
                   raise StackOverflowError
             self.stack.append(__lowerCamelCase	)





       def 						lowerCAmelCase					(       self							:      Union[str, Any]	):


             '''simple docstring'''



             if not self.stack:
                   raise StackUnderflowError
             return self.stack.pop()





       def 						lowerCAmelCase					(       self							:      List[Any]	):


             '''simple docstring'''



             if not self.stack:
                   raise StackUnderflowError
             return self.stack[-1]





       def 						lowerCAmelCase					(       self							:      Dict	):


             '''simple docstring'''



             return not bool(self.stack	)





       def 						lowerCAmelCase					(       self							:      Any	):


             '''simple docstring'''



             return self.size() == self.limit





       def 						lowerCAmelCase					(       self							:      List[Any]	):


             '''simple docstring'''



             return len(self.stack	)





       def __contains__(       self							:      List[Any] ,				__lowerCamelCase							:      T	):


             '''simple docstring'''



             return item in self.stack



def 				lowercase_		(		):

      """simple docstring"""




      lowerCamelCase__		:    Stack[int]   =  Stack(10						)
      assert bool(_A						) is False
      assert stack.is_empty() is True
      assert stack.is_full() is False
      assert str(_A						) == "[]"

      try:
            lowerCamelCase__		:    Any   =  stack.pop()
            raise AssertionError  # This should not happen
      except StackUnderflowError:
            assert True  # This should happen

      try:
            lowerCamelCase__		:    Optional[Any]   =  stack.peek()
            raise AssertionError  # This should not happen
      except StackUnderflowError:
            assert True  # This should happen

      for i in range(10						):
            assert stack.size() == i
            stack.push(_A						)

      assert bool(_A						)
      assert not stack.is_empty()
      assert stack.is_full()
      assert str(_A						) == str(list(range(10						)						)						)
      assert stack.pop() == 9
      assert stack.peek() == 8

      stack.push(100						)
      assert str(_A						) == str([0, 1, 2, 3, 4, 5, 6, 7, 8, 100]						)

      try:
            stack.push(200						)
            raise AssertionError  # This should not happen
      except StackOverflowError:
            assert True  # This should happen

      assert not stack.is_empty()
      assert stack.size() == 10

      assert 5 in stack
      assert 55 not in stack


if __name__ == "__main__":
    test_stack()






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}')


