



from urllib.error import HTTPError

from bsa import BeautifulSoup
from requests import exceptions, get

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

def 	a						(				_UpperCAmelCase							: Tuple			,       _UpperCAmelCase							: Optional[int]						):







		'''simple docstring'''





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

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

				# Is the response ok?
				response.raise_for_status()

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

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

				# Fetch all the grids that contains the items.
				__UpperCAmelCase   :					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.
								__UpperCAmelCase   :					Tuple													=     grid.find('''p'''			,       {'''class''': '''list-title'''}						).text

								# Get price of the drug.
								__UpperCAmelCase   :					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
				__A             =input("Enter drug name: ").strip()
				__A             =input("Enter zip code: ").strip()

				__A             =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             =pharmacy_price["pharmacy_name"]
												__A             =pharmacy_price["price"]

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










import unittest
import warnings
from dataclasses import dataclass

from transformers.convert_slow_tokenizer import SpmConverter
from transformers.testing_utils import get_tests_dir

@dataclass
class 		UpperCAmelCase__      :




			'''simple docstring'''






			UpperCamelCase      						=	42

class 		UpperCAmelCase__      (      unittest.TestCase       ):




			'''simple docstring'''






			def 			snake_case__					(       self							:			Any			):
					'''simple docstring'''





					__UpperCAmelCase   :					Optional[int]													=     get_tests_dir('''fixtures/test_sentencepiece.model'''			)
					__UpperCAmelCase   :					Union[str, Any]													=     get_tests_dir('''fixtures/test_sentencepiece_with_bytefallback.model'''			)

					__UpperCAmelCase   :					List[str]													=     FakeOriginalTokenizer(vocab_file=a_			)

					with warnings.catch_warnings(record=a_			) as w:
							__UpperCAmelCase   :					Optional[int]													=     SpmConverter(a_			)
					self.assertEqual(len(a_			)	,	0			)

					__UpperCAmelCase   :					Optional[int]													=     FakeOriginalTokenizer(vocab_file=a_			)

					with warnings.catch_warnings(record=a_			) as w:
							__UpperCAmelCase   :					Dict													=     SpmConverter(a_			)
					self.assertEqual(len(a_			)	,	1			)

					self.assertIn(
					    '''The sentencepiece tokenizer that you are converting to a fast tokenizer uses the byte fallback option'''
					    ''' which is not implemented in the fast tokenizers.'''	,	str(w[0].message			)	,	)





