prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  [Bug]: Chichester District Council is not working
  ### I Have A Problem With:
  
  A specific source
  
  ### What's Your Problem
  
  The source has stopped working since Tuesday 13th February 2024. All the collection days no longer show on the calendar at all. The Chichester District Council website still shows me the days.
  
  ### Source (if relevant)
  
  chichester_gov_uk
  
  ### Logs
  
  ```Shell
  This error originated from a custom integration.
  
  Logger: waste_collection_schedule.source_shell
  Source: custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py:136
  Integration: waste_collection_schedule (documentation)
  First occurred: 11:36:47 (1 occurrences)
  Last logged: 11:36:47
  
  fetch failed for source Chichester District Council: Traceback (most recent call last): File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py", line 134, in fetch entries = self._source.fetch() ^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source/chichester_gov_uk.py", line 37, in fetch form_url = form["action"] ~~~~^^^^^^^^^^ TypeError: 'NoneType' object is not subscriptable
  ```
  
  
  ### Relevant Configuration
  
  ```YAML
  waste_collection_schedule:
    sources:
      - name: chichester_gov_uk
        args:
          uprn: 10002466648
  ```
  
  
  ### Checklist Source Error
  
  - [X] Use the example parameters for your source (often available in the documentation) (don't forget to restart Home Assistant after changing the configuration)
  - [X] Checked that the website of your service provider is still working
  - [X] Tested my attributes on the service provider website (if possible)
  - [X] I have tested with the latest version of the integration (master) (for HACS in the 3 dot menu of the integration click on "Redownload" and choose master as version)
  
  ### Checklist Sensor Error
  
  - [X] Checked in the Home Assistant Calendar tab if the event names match the types names (if types argument is used)
  
  ### Required
  
  - [X] I have searched past (closed AND opened) issues to see if this bug has already been reported, and it hasn't been.
  - [X] I understand that people give their precious time for free, and thus I've done my very best to make this problem as easy as possible to investigate.
  
  </issue>
  <code>
  [start of custom_components/waste_collection_schedule/waste_collection_schedule/source/chichester_gov_uk.py]
  1 from datetime import datetime
  2 
  3 import requests
  4 from bs4 import BeautifulSoup
  5 from waste_collection_schedule import Collection
  6 
  7 TITLE = "Chichester District Council"
  8 DESCRIPTION = "Source for chichester.gov.uk services for Chichester"
  9 URL = "chichester.gov.uk"
  10 
  11 TEST_CASES = {
  12     "Test_001": {"uprn": "010002476348"},
  13     "Test_002": {"uprn": "100062612654"},
  14     "Test_003": {"uprn": "100061745708"},
  15 }
  16 
  17 ICON_MAP = {
  18     "General Waste": "mdi:trash-can",
  19     "Recycling": "mdi:recycle",
  20     "Garden Recycling": "mdi:leaf",
  21 }
  22 
  23 
  24 class Source:
  25     def __init__(self, uprn):
  26         self._uprn = uprn
  27 
  28     def fetch(self):
  29         session = requests.Session()
  30         # Start a session
  31         r = session.get("https://www.chichester.gov.uk/checkyourbinday")
  32         r.raise_for_status()
  33         soup = BeautifulSoup(r.text, features="html.parser")
  34 
  35         # Extract form submission url
  36         form = soup.find("form", attrs={"id": "WASTECOLLECTIONCALENDARV2_FORM"})
  37         form_url = form["action"]
  38 
  39         # Submit form
  40         form_data = {
  41             "WASTECOLLECTIONCALENDARV2_FORMACTION_NEXT": "Submit",
  42             "WASTECOLLECTIONCALENDARV2_CALENDAR_UPRN": self._uprn,
  43         }
  44         r = session.post(form_url, data=form_data)
  45         r.raise_for_status()
  46 
  47         # Extract collection dates
  48         soup = BeautifulSoup(r.text, features="html.parser")
  49         entries = []
  50         data = soup.find_all("div", attrs={"class": "bin-days"})
  51         for bin in data:
  52             if "print-only" in bin["class"]:
  53                 continue
  54 
  55             type = bin.find("span").contents[0].replace("bin", "").strip().title()
  56             list_items = bin.find_all("li")
  57             if list_items:
  58                 for item in list_items:
  59                     date = datetime.strptime(item.text, "%d %B %Y").date()
  60                     entries.append(
  61                         Collection(
  62                             date=date,
  63                             t=type,
  64                             icon=ICON_MAP.get(type),
  65                         )
  66                     )
  67 
  68         return entries
  69
  [end of custom_components/waste_collection_schedule/waste_collection_schedule/source/chichester_gov_uk.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/source/chichester_gov_uk.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/chichester_gov_uk.py
  --- a/custom_components/waste_collection_schedule/waste_collection_schedule/source/chichester_gov_uk.py
  +++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/chichester_gov_uk.py
  @@ -33,13 +33,13 @@
           soup = BeautifulSoup(r.text, features="html.parser")
   
           # Extract form submission url
  -        form = soup.find("form", attrs={"id": "WASTECOLLECTIONCALENDARV2_FORM"})
  +        form = soup.find("form", attrs={"id": "WASTECOLLECTIONCALENDARV5_FORM"})
           form_url = form["action"]
   
           # Submit form
           form_data = {
  -            "WASTECOLLECTIONCALENDARV2_FORMACTION_NEXT": "Submit",
  -            "WASTECOLLECTIONCALENDARV2_CALENDAR_UPRN": self._uprn,
  +            "WASTECOLLECTIONCALENDARV5_FORMACTION_NEXT": "Submit",
  +            "WASTECOLLECTIONCALENDARV5_CALENDAR_UPRN": self._uprn,
           }
           r = session.post(form_url, data=form_data)
           r.raise_for_status()
  @@ -47,16 +47,18 @@
           # Extract collection dates
           soup = BeautifulSoup(r.text, features="html.parser")
           entries = []
  -        data = soup.find_all("div", attrs={"class": "bin-days"})
  -        for bin in data:
  -            if "print-only" in bin["class"]:
  -                continue
  -
  -            type = bin.find("span").contents[0].replace("bin", "").strip().title()
  -            list_items = bin.find_all("li")
  -            if list_items:
  -                for item in list_items:
  -                    date = datetime.strptime(item.text, "%d %B %Y").date()
  +        tables = soup.find_all("table", attrs={"class": "bin-collection-dates"})
  +        # Data is presented in two tables side-by-side
  +        for table in tables:
  +            # Each collection is a table row
  +            data = table.find_all("tr")
  +            for bin in data:
  +                cells = bin.find_all("td")
  +                # Ignore the header row
  +                if len(cells) == 2:
  +                    date = datetime.strptime(cells[0].text, "%d %B %Y").date()
  +                    # Maintain backwards compatibility - it used to be General Waste and now it is General waste
  +                    type = cells[1].text.title()
                       entries.append(
                           Collection(
                               date=date,
  
verification_info: {"golden_diff": "diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/source/chichester_gov_uk.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/chichester_gov_uk.py\n--- a/custom_components/waste_collection_schedule/waste_collection_schedule/source/chichester_gov_uk.py\n+++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/chichester_gov_uk.py\n@@ -33,13 +33,13 @@\n         soup = BeautifulSoup(r.text, features=\"html.parser\")\n \n         # Extract form submission url\n-        form = soup.find(\"form\", attrs={\"id\": \"WASTECOLLECTIONCALENDARV2_FORM\"})\n+        form = soup.find(\"form\", attrs={\"id\": \"WASTECOLLECTIONCALENDARV5_FORM\"})\n         form_url = form[\"action\"]\n \n         # Submit form\n         form_data = {\n-            \"WASTECOLLECTIONCALENDARV2_FORMACTION_NEXT\": \"Submit\",\n-            \"WASTECOLLECTIONCALENDARV2_CALENDAR_UPRN\": self._uprn,\n+            \"WASTECOLLECTIONCALENDARV5_FORMACTION_NEXT\": \"Submit\",\n+            \"WASTECOLLECTIONCALENDARV5_CALENDAR_UPRN\": self._uprn,\n         }\n         r = session.post(form_url, data=form_data)\n         r.raise_for_status()\n@@ -47,16 +47,18 @@\n         # Extract collection dates\n         soup = BeautifulSoup(r.text, features=\"html.parser\")\n         entries = []\n-        data = soup.find_all(\"div\", attrs={\"class\": \"bin-days\"})\n-        for bin in data:\n-            if \"print-only\" in bin[\"class\"]:\n-                continue\n-\n-            type = bin.find(\"span\").contents[0].replace(\"bin\", \"\").strip().title()\n-            list_items = bin.find_all(\"li\")\n-            if list_items:\n-                for item in list_items:\n-                    date = datetime.strptime(item.text, \"%d %B %Y\").date()\n+        tables = soup.find_all(\"table\", attrs={\"class\": \"bin-collection-dates\"})\n+        # Data is presented in two tables side-by-side\n+        for table in tables:\n+            # Each collection is a table row\n+            data = table.find_all(\"tr\")\n+            for bin in data:\n+                cells = bin.find_all(\"td\")\n+                # Ignore the header row\n+                if len(cells) == 2:\n+                    date = datetime.strptime(cells[0].text, \"%d %B %Y\").date()\n+                    # Maintain backwards compatibility - it used to be General Waste and now it is General waste\n+                    type = cells[1].text.title()\n                     entries.append(\n                         Collection(\n                             date=date,\n", "issue": "[Bug]: Chichester District Council is not working\n### I Have A Problem With:\n\nA specific source\n\n### What's Your Problem\n\nThe source has stopped working since Tuesday 13th February 2024. All the collection days no longer show on the calendar at all. The Chichester District Council website still shows me the days.\n\n### Source (if relevant)\n\nchichester_gov_uk\n\n### Logs\n\n```Shell\nThis error originated from a custom integration.\r\n\r\nLogger: waste_collection_schedule.source_shell\r\nSource: custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py:136\r\nIntegration: waste_collection_schedule (documentation)\r\nFirst occurred: 11:36:47 (1 occurrences)\r\nLast logged: 11:36:47\r\n\r\nfetch failed for source Chichester District Council: Traceback (most recent call last): File \"/config/custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py\", line 134, in fetch entries = self._source.fetch() ^^^^^^^^^^^^^^^^^^^^ File \"/config/custom_components/waste_collection_schedule/waste_collection_schedule/source/chichester_gov_uk.py\", line 37, in fetch form_url = form[\"action\"] ~~~~^^^^^^^^^^ TypeError: 'NoneType' object is not subscriptable\n```\n\n\n### Relevant Configuration\n\n```YAML\nwaste_collection_schedule:\r\n  sources:\r\n    - name: chichester_gov_uk\r\n      args:\r\n        uprn: 10002466648\n```\n\n\n### Checklist Source Error\n\n- [X] Use the example parameters for your source (often available in the documentation) (don't forget to restart Home Assistant after changing the configuration)\n- [X] Checked that the website of your service provider is still working\n- [X] Tested my attributes on the service provider website (if possible)\n- [X] I have tested with the latest version of the integration (master) (for HACS in the 3 dot menu of the integration click on \"Redownload\" and choose master as version)\n\n### Checklist Sensor Error\n\n- [X] Checked in the Home Assistant Calendar tab if the event names match the types names (if types argument is used)\n\n### Required\n\n- [X] I have searched past (closed AND opened) issues to see if this bug has already been reported, and it hasn't been.\n- [X] I understand that people give their precious time for free, and thus I've done my very best to make this problem as easy as possible to investigate.\n", "before_files": [{"content": "from datetime import datetime\n\nimport requests\nfrom bs4 import BeautifulSoup\nfrom waste_collection_schedule import Collection\n\nTITLE = \"Chichester District Council\"\nDESCRIPTION = \"Source for chichester.gov.uk services for Chichester\"\nURL = \"chichester.gov.uk\"\n\nTEST_CASES = {\n    \"Test_001\": {\"uprn\": \"010002476348\"},\n    \"Test_002\": {\"uprn\": \"100062612654\"},\n    \"Test_003\": {\"uprn\": \"100061745708\"},\n}\n\nICON_MAP = {\n    \"General Waste\": \"mdi:trash-can\",\n    \"Recycling\": \"mdi:recycle\",\n    \"Garden Recycling\": \"mdi:leaf\",\n}\n\n\nclass Source:\n    def __init__(self, uprn):\n        self._uprn = uprn\n\n    def fetch(self):\n        session = requests.Session()\n        # Start a session\n        r = session.get(\"https://www.chichester.gov.uk/checkyourbinday\")\n        r.raise_for_status()\n        soup = BeautifulSoup(r.text, features=\"html.parser\")\n\n        # Extract form submission url\n        form = soup.find(\"form\", attrs={\"id\": \"WASTECOLLECTIONCALENDARV2_FORM\"})\n        form_url = form[\"action\"]\n\n        # Submit form\n        form_data = {\n            \"WASTECOLLECTIONCALENDARV2_FORMACTION_NEXT\": \"Submit\",\n            \"WASTECOLLECTIONCALENDARV2_CALENDAR_UPRN\": self._uprn,\n        }\n        r = session.post(form_url, data=form_data)\n        r.raise_for_status()\n\n        # Extract collection dates\n        soup = BeautifulSoup(r.text, features=\"html.parser\")\n        entries = []\n        data = soup.find_all(\"div\", attrs={\"class\": \"bin-days\"})\n        for bin in data:\n            if \"print-only\" in bin[\"class\"]:\n                continue\n\n            type = bin.find(\"span\").contents[0].replace(\"bin\", \"\").strip().title()\n            list_items = bin.find_all(\"li\")\n            if list_items:\n                for item in list_items:\n                    date = datetime.strptime(item.text, \"%d %B %Y\").date()\n                    entries.append(\n                        Collection(\n                            date=date,\n                            t=type,\n                            icon=ICON_MAP.get(type),\n                        )\n                    )\n\n        return entries\n", "path": "custom_components/waste_collection_schedule/waste_collection_schedule/source/chichester_gov_uk.py"}]}