code: 
  
  
  
  
  
  
  """simple docstring"""
  
  
  
  
  
  
  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 						_UpperCamelCase			(  A    ,       A			):
  
     try:
        # Has user provided both inputs?
        if not drug_name or not zip_code:
           return None
  
        UpperCamelCase_     =BASE_URL.format(A    ,       A			)
        UpperCamelCase_     =get(A			)
  
        # 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(A			) > 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
      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}''')
  
style_context: 
  
  
  
  
  
  
  """simple docstring"""
  
  
  
  
  
  
  from datetime import date
  
  import requests
  
  A_			  =    "https://api.carbonintensity.org.uk/intensity"
  
  
  
  
  def 						_UpperCamelCase			(  ):
     UpperCamelCase_     =requests.get(A			).json()["data"][0]
     return last_half_hour["intensity"]["actual"]
  
  
  
  
  def 						_UpperCamelCase			(  A    ,       A			):
     return requests.get(f"""{BASE_URL}/{start}/{end}"""			).json()["data"]
  
  
  if __name__ == "__main__":
      for entry in fetch_from_to(start=date(2020, 10, 1), end=date(2020, 10, 3)):
          print("from {from} to {to}: {intensity[actual]}".format(**entry))
      print(f'''{fetch_last_half_hour() = }''')
  