



"""simple docstring"""





from urllib.error import HTTPError

from bsa import BeautifulSoup
from requests import exceptions, get

lowerCamelCase          =						'https://www.wellrx.com/prescriptions/{0}/{1}/?freshSearch=true'
def    a__	(      lowerCAmelCase__	,			lowerCAmelCase__      ):



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

            UpperCAmelCase_			 =							BASE_URL.format(__lowercase	,			__lowercase      )
            UpperCAmelCase_			 =							get(__lowercase      )

            # Is the response ok?
            response.raise_for_status()

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

            # This list will store the name and price.
            UpperCAmelCase_			 =							[]

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

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

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

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





import unittest

import numpy as np

from transformers import is_tf_available
from transformers.testing_utils import require_tf


if is_tf_available():
				import tensorflow as tf

				from transformers.activations_tf import get_tf_activation



@require_tf
class    lowercase_    (     unittest.TestCase		):



							def        UpperCamelCase       (						self				):
													_snake_case						:     int				=    tf.constant([-100, -1.0, -0.1, 0, 0.1, 1.0, 100.0]				)
													_snake_case						:     List[Any]				=    get_tf_activation("gelu"				)
													_snake_case						:     Any				=    get_tf_activation("gelu_10"				)

													_snake_case						:     Dict				=    gelu(lowercase_				)
													_snake_case						:     Optional[int]				=    geluaa(lowercase_				)

													_snake_case						:     Tuple				=    tf.where(y_gelu_aa < 10.0      ,				1.0      ,				0.0				)

													self.assertEqual(tf.math.reduce_max(lowercase_				).numpy().item()      ,				10.0				)
													self.assertTrue(np.allclose(y_gelu * clipped_mask      ,				y_gelu_aa * clipped_mask				)				)



							def        UpperCamelCase       (						self				):
													get_tf_activation("gelu"				)
													get_tf_activation("gelu_10"				)
													get_tf_activation("gelu_fast"				)
													get_tf_activation("gelu_new"				)
													get_tf_activation("glu"				)
													get_tf_activation("mish"				)
													get_tf_activation("quick_gelu"				)
													get_tf_activation("relu"				)
													get_tf_activation("sigmoid"				)
													get_tf_activation("silu"				)
													get_tf_activation("swish"				)
													get_tf_activation("tanh"				)
													with self.assertRaises(lowercase_				):
																			get_tf_activation("bogus"				)
													with self.assertRaises(lowercase_				):
																			get_tf_activation(lowercase_				)