






'''simple docstring'''
from __future__ import annotations




def 						__SCREAMING_SNAKE_CASE   (					_UpperCamelCase  ,						_UpperCamelCase							):


   """simple docstring"""




   lowercase_		:      Optional[Any]          =       0
   lowercase_		:      List[Any]          =       len(_UpperCamelCase							) - 1
   while left <= right:
      lowercase_		:      Optional[int]          =       (left + right) // 2
      if left == right:
         if sorted_list[middle] < item:
            lowercase_		:      Any          =       middle + 1
         break
      elif sorted_list[middle] < item:
         lowercase_		:      Tuple          =       middle + 1
      else:
         lowercase_		:      List[str]          =       middle - 1
   sorted_list.insert(_UpperCamelCase  ,						_UpperCamelCase							)
   return sorted_list




def 						__SCREAMING_SNAKE_CASE   (					_UpperCamelCase  ,						_UpperCamelCase							):


   """simple docstring"""




   lowercase_		:      Optional[int]          =       []
   while left and right:
      if left[0][0] < right[0][0]:
         result.append(left.pop(0							)							)
      else:
         result.append(right.pop(0							)							)
   return result + left + right




def 						__SCREAMING_SNAKE_CASE   (					_UpperCamelCase							):


   """simple docstring"""




   lowercase_		:      int          =       len(_UpperCamelCase							)
   if length <= 1:
      return list_ad
   lowercase_		:      int          =       length // 2
   return merge(sortlist_ad(list_ad[:middle]							)  ,						sortlist_ad(list_ad[middle:]							)							)




def 						__SCREAMING_SNAKE_CASE   (					_UpperCamelCase							):


   """simple docstring"""




   if len(_UpperCamelCase							) <= 1:
      return collection
   lowercase_		:      int          =       []
   lowercase_		:      Union[str, Any]          =       False
   for i in range(0  ,						len(_UpperCamelCase							)  ,						2							):
      if i == len(_UpperCamelCase							) - 1:
         lowercase_		:      Optional[Any]          =       True
      else:
         if collection[i] < collection[i + 1]:
            two_paired_list.append([collection[i], collection[i + 1]]							)
         else:
            two_paired_list.append([collection[i + 1], collection[i]]							)
   lowercase_		:      List[str]          =       sortlist_ad(_UpperCamelCase							)
   lowercase_		:      Dict          =       [i[0] for i in sorted_list_ad]
   result.append(sorted_list_ad[-1][1]							)
   if has_last_odd_item:
      lowercase_		:      Optional[int]          =       collection[-1]
      lowercase_		:      Tuple          =       binary_search_insertion(_UpperCamelCase  ,						_UpperCamelCase							)
   lowercase_		:      Any          =       False
   for i in range(len(_UpperCamelCase							) - 1							):
      if result[i] == collection[-1] and has_last_odd_item:
         lowercase_		:      Tuple          =       True
      lowercase_		:      Optional[int]          =       sorted_list_ad[i][1]
      # If last_odd_item is inserted before the item's index,
      # you should forward index one more.
      if is_last_odd_item_inserted_before_this_index:
         lowercase_		:      str          =       result[: i + 2] + binary_search_insertion(result[i + 2 :]  ,						_UpperCamelCase							)
      else:
         lowercase_		:      Any          =       result[: i + 1] + binary_search_insertion(result[i + 1 :]  ,						_UpperCamelCase							)

   return result


if __name__ == "__main__":
 UpperCamelCase__	=     input('Enter numbers separated by a comma:\n').strip()
 UpperCamelCase__	=     [int(item) for item in user_input.split(',')]
 print(merge_insertion_sort(unsorted))












'''simple docstring'''
from urllib.error import HTTPError

from bsa import BeautifulSoup
from requests import exceptions, get

UpperCamelCase__	=     'https://www.wellrx.com/prescriptions/{0}/{1}/?freshSearch=true'




def 						__SCREAMING_SNAKE_CASE   (					_UpperCamelCase  ,						_UpperCamelCase							):


   """simple docstring"""




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

      lowercase_		:      List[str]          =       BASE_URL.format(_UpperCamelCase  ,						_UpperCamelCase							)
      lowercase_		:      Union[str, Any]          =       get(_UpperCamelCase							)

      # Is the response ok?
      response.raise_for_status()

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

      # This list will store the name and price.
      lowercase_		:      List[str]          =       []

      # Fetch all the grids that contains the items.
      lowercase_		:      Tuple          =       soup.find_all("div"  ,						{"class": "grid-x pharmCard"}							)
      if grid_list and len(_UpperCamelCase							) > 0:
         for grid in grid_list:
            # Get the pharmacy price.
            lowercase_		:      Tuple          =       grid.find("p"  ,						{"class": "list-title"}							).text

            # Get price of the drug.
            lowercase_		:      List[str]          =       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
 UpperCamelCase__	=     input('Enter drug name: ').strip()
 UpperCamelCase__	=     input('Enter zip code: ').strip()

 UpperCamelCase__	=     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:
   UpperCamelCase__	=     pharmacy_price['pharmacy_name']
   UpperCamelCase__	=     pharmacy_price['price']

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




