prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  [Feature]: paper dates are not in the complete date-file
  ### I propose a feature for:
  
  Sources
  
  ### Describe your wanted feature
  
  Hi,
  right now I saw that the homepage "https://www.geoport-nwm.de/de/abfuhrtermine-geoportal.html" describes 3 ics files for paper-dates: 
  Please can you add them to the integrsation, because I need to add them manually now.
  
  Kalenderdatei AltpapiertonneGER Umweltschutz GmbH | downloaden (ICS)
  Kalenderdatei AltpapiertonneGollan Recycling GmbH | downloaden (ICS)
  Kalenderdatei AltpapiertonneVeolia Umweltservice Nord GmbH | downloaden (ICS)
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `custom_components/waste_collection_schedule/waste_collection_schedule/source/geoport_nwm_de.py`
  Content:
  ```
  1 import datetime
  2 import urllib
  3 
  4 import requests
  5 from waste_collection_schedule import Collection  # type: ignore[attr-defined]
  6 from waste_collection_schedule.service.ICS import ICS
  7 
  8 TITLE = "Landkreis Nordwestmecklenburg"
  9 DESCRIPTION = "Source for Landkreis Nordwestmecklenburg"
  10 URL = "https://www.geoport-nwm.de"
  11 TEST_CASES = {
  12     "Rüting": {"district": "Rüting"},
  13     "Grevenstein u. ...": {"district": "Grevenstein u. Ausbau"},
  14     "Seefeld": {"district": "Seefeld/ Testorf- Steinfort"},
  15     "1100l": {"district": "Groß Stieten (1.100 l Behälter)"},
  16     "kl. Bünsdorf": {"district": "Klein Bünsdorf"},
  17 }
  18 
  19 
  20 class Source:
  21     def __init__(self, district):
  22         self._district = district
  23         self._ics = ICS()
  24 
  25     def fetch(self):
  26         today = datetime.date.today()
  27         dates = []
  28         if today.month == 12:
  29             # On Dec 27 2022, the 2022 schedule was no longer available for test case "Seefeld", all others worked
  30             try:
  31                 dates = self.fetch_year(today.year)
  32             except Exception:
  33                 pass
  34             try:
  35                 dates.extend(self.fetch_year(today.year + 1))
  36             except Exception:
  37                 pass
  38         else:
  39             dates = self.fetch_year(today.year)
  40 
  41         entries = []
  42         for d in dates:
  43             entries.append(Collection(d[0], d[1]))
  44         return entries
  45 
  46     def fetch_year(self, year):
  47         arg = convert_to_arg(self._district)
  48         r = requests.get(
  49             f"https://www.geoport-nwm.de/nwm-download/Abfuhrtermine/ICS/{year}/{arg}.ics"
  50         )
  51         r.raise_for_status()
  52         return self._ics.convert(r.text)
  53 
  54 
  55 def convert_to_arg(district):
  56     district = district.replace("(1.100 l Behälter)", "1100_l")
  57     district = district.replace("ü", "ue")
  58     district = district.replace("ö", "oe")
  59     district = district.replace("ä", "ae")
  60     district = district.replace("ß", "ss")
  61     district = district.replace("/", "")
  62     district = district.replace("- ", "-")
  63     district = district.replace(".", "")
  64     district = district.replace(" ", "_")
  65     arg = urllib.parse.quote("Ortsteil_" + district)
  66     return arg
  67
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/source/geoport_nwm_de.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/geoport_nwm_de.py
  --- a/custom_components/waste_collection_schedule/waste_collection_schedule/source/geoport_nwm_de.py
  +++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/geoport_nwm_de.py
  @@ -16,6 +16,8 @@
       "kl. Bünsdorf": {"district": "Klein Bünsdorf"},
   }
   
  +API_URL = "https://www.geoport-nwm.de/nwm-download/Abfuhrtermine/ICS/{year}/{arg}.ics"
  +
   
   class Source:
       def __init__(self, district):
  @@ -45,22 +47,35 @@
   
       def fetch_year(self, year):
           arg = convert_to_arg(self._district)
  -        r = requests.get(
  -            f"https://www.geoport-nwm.de/nwm-download/Abfuhrtermine/ICS/{year}/{arg}.ics"
  -        )
  +        r = requests.get(API_URL.format(year=year, arg=arg))
           r.raise_for_status()
  -        return self._ics.convert(r.text)
  +        entries = self._ics.convert(r.text)
  +        for prefix in (
  +            "Schadstoffmobil",
  +            "Papiertonne_GER",
  +            "Papiertonne_Gollan",
  +            "Papiertonne_Veolia",
  +        ):
  +            try:
  +                r = requests.get(API_URL.format(year=year, arg=f"{prefix}_{arg}"))
  +                r.raise_for_status()
  +                new_entries = self._ics.convert(r.text)
  +                entries.extend(new_entries)
  +            except (ValueError, requests.exceptions.HTTPError):
  +                pass
  +        return entries
   
   
  -def convert_to_arg(district):
  +def convert_to_arg(district, prefix=""):
       district = district.replace("(1.100 l Behälter)", "1100_l")
       district = district.replace("ü", "ue")
       district = district.replace("ö", "oe")
       district = district.replace("ä", "ae")
       district = district.replace("ß", "ss")
       district = district.replace("/", "")
  -    district = district.replace("- ", "-")
  +    # district = district.replace("- ", "-") failed with Seefeld/ Testorf- Steinfort
       district = district.replace(".", "")
       district = district.replace(" ", "_")
  -    arg = urllib.parse.quote("Ortsteil_" + district)
  +    prefix = prefix + "_" if prefix else ""
  +    arg = urllib.parse.quote(f"{prefix}Ortsteil_{district}")
       return arg
  
verification_info: {"golden_diff": "diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/source/geoport_nwm_de.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/geoport_nwm_de.py\n--- a/custom_components/waste_collection_schedule/waste_collection_schedule/source/geoport_nwm_de.py\n+++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/geoport_nwm_de.py\n@@ -16,6 +16,8 @@\n     \"kl. B\u00fcnsdorf\": {\"district\": \"Klein B\u00fcnsdorf\"},\n }\n \n+API_URL = \"https://www.geoport-nwm.de/nwm-download/Abfuhrtermine/ICS/{year}/{arg}.ics\"\n+\n \n class Source:\n     def __init__(self, district):\n@@ -45,22 +47,35 @@\n \n     def fetch_year(self, year):\n         arg = convert_to_arg(self._district)\n-        r = requests.get(\n-            f\"https://www.geoport-nwm.de/nwm-download/Abfuhrtermine/ICS/{year}/{arg}.ics\"\n-        )\n+        r = requests.get(API_URL.format(year=year, arg=arg))\n         r.raise_for_status()\n-        return self._ics.convert(r.text)\n+        entries = self._ics.convert(r.text)\n+        for prefix in (\n+            \"Schadstoffmobil\",\n+            \"Papiertonne_GER\",\n+            \"Papiertonne_Gollan\",\n+            \"Papiertonne_Veolia\",\n+        ):\n+            try:\n+                r = requests.get(API_URL.format(year=year, arg=f\"{prefix}_{arg}\"))\n+                r.raise_for_status()\n+                new_entries = self._ics.convert(r.text)\n+                entries.extend(new_entries)\n+            except (ValueError, requests.exceptions.HTTPError):\n+                pass\n+        return entries\n \n \n-def convert_to_arg(district):\n+def convert_to_arg(district, prefix=\"\"):\n     district = district.replace(\"(1.100 l Beh\u00e4lter)\", \"1100_l\")\n     district = district.replace(\"\u00fc\", \"ue\")\n     district = district.replace(\"\u00f6\", \"oe\")\n     district = district.replace(\"\u00e4\", \"ae\")\n     district = district.replace(\"\u00df\", \"ss\")\n     district = district.replace(\"/\", \"\")\n-    district = district.replace(\"- \", \"-\")\n+    # district = district.replace(\"- \", \"-\") failed with Seefeld/ Testorf- Steinfort\n     district = district.replace(\".\", \"\")\n     district = district.replace(\" \", \"_\")\n-    arg = urllib.parse.quote(\"Ortsteil_\" + district)\n+    prefix = prefix + \"_\" if prefix else \"\"\n+    arg = urllib.parse.quote(f\"{prefix}Ortsteil_{district}\")\n     return arg\n", "issue": "[Feature]: paper dates are not in the complete date-file\n### I propose a feature for:\r\n\r\nSources\r\n\r\n### Describe your wanted feature\r\n\r\nHi,\r\nright now I saw that the homepage \"https://www.geoport-nwm.de/de/abfuhrtermine-geoportal.html\" describes 3 ics files for paper-dates: \r\nPlease can you add them to the integrsation, because I need to add them manually now.\r\n\r\nKalenderdatei AltpapiertonneGER Umweltschutz GmbH | downloaden (ICS)\r\nKalenderdatei AltpapiertonneGollan Recycling GmbH | downloaden (ICS)\r\nKalenderdatei AltpapiertonneVeolia Umweltservice Nord GmbH | downloaden (ICS)\r\n\n", "before_files": [{"content": "import datetime\nimport urllib\n\nimport requests\nfrom waste_collection_schedule import Collection  # type: ignore[attr-defined]\nfrom waste_collection_schedule.service.ICS import ICS\n\nTITLE = \"Landkreis Nordwestmecklenburg\"\nDESCRIPTION = \"Source for Landkreis Nordwestmecklenburg\"\nURL = \"https://www.geoport-nwm.de\"\nTEST_CASES = {\n    \"R\u00fcting\": {\"district\": \"R\u00fcting\"},\n    \"Grevenstein u. ...\": {\"district\": \"Grevenstein u. Ausbau\"},\n    \"Seefeld\": {\"district\": \"Seefeld/ Testorf- Steinfort\"},\n    \"1100l\": {\"district\": \"Gro\u00df Stieten (1.100 l Beh\u00e4lter)\"},\n    \"kl. B\u00fcnsdorf\": {\"district\": \"Klein B\u00fcnsdorf\"},\n}\n\n\nclass Source:\n    def __init__(self, district):\n        self._district = district\n        self._ics = ICS()\n\n    def fetch(self):\n        today = datetime.date.today()\n        dates = []\n        if today.month == 12:\n            # On Dec 27 2022, the 2022 schedule was no longer available for test case \"Seefeld\", all others worked\n            try:\n                dates = self.fetch_year(today.year)\n            except Exception:\n                pass\n            try:\n                dates.extend(self.fetch_year(today.year + 1))\n            except Exception:\n                pass\n        else:\n            dates = self.fetch_year(today.year)\n\n        entries = []\n        for d in dates:\n            entries.append(Collection(d[0], d[1]))\n        return entries\n\n    def fetch_year(self, year):\n        arg = convert_to_arg(self._district)\n        r = requests.get(\n            f\"https://www.geoport-nwm.de/nwm-download/Abfuhrtermine/ICS/{year}/{arg}.ics\"\n        )\n        r.raise_for_status()\n        return self._ics.convert(r.text)\n\n\ndef convert_to_arg(district):\n    district = district.replace(\"(1.100 l Beh\u00e4lter)\", \"1100_l\")\n    district = district.replace(\"\u00fc\", \"ue\")\n    district = district.replace(\"\u00f6\", \"oe\")\n    district = district.replace(\"\u00e4\", \"ae\")\n    district = district.replace(\"\u00df\", \"ss\")\n    district = district.replace(\"/\", \"\")\n    district = district.replace(\"- \", \"-\")\n    district = district.replace(\".\", \"\")\n    district = district.replace(\" \", \"_\")\n    arg = urllib.parse.quote(\"Ortsteil_\" + district)\n    return arg\n", "path": "custom_components/waste_collection_schedule/waste_collection_schedule/source/geoport_nwm_de.py"}], "after_files": [{"content": "import datetime\nimport urllib\n\nimport requests\nfrom waste_collection_schedule import Collection  # type: ignore[attr-defined]\nfrom waste_collection_schedule.service.ICS import ICS\n\nTITLE = \"Landkreis Nordwestmecklenburg\"\nDESCRIPTION = \"Source for Landkreis Nordwestmecklenburg\"\nURL = \"https://www.geoport-nwm.de\"\nTEST_CASES = {\n    \"R\u00fcting\": {\"district\": \"R\u00fcting\"},\n    \"Grevenstein u. ...\": {\"district\": \"Grevenstein u. Ausbau\"},\n    \"Seefeld\": {\"district\": \"Seefeld/ Testorf- Steinfort\"},\n    \"1100l\": {\"district\": \"Gro\u00df Stieten (1.100 l Beh\u00e4lter)\"},\n    \"kl. B\u00fcnsdorf\": {\"district\": \"Klein B\u00fcnsdorf\"},\n}\n\nAPI_URL = \"https://www.geoport-nwm.de/nwm-download/Abfuhrtermine/ICS/{year}/{arg}.ics\"\n\n\nclass Source:\n    def __init__(self, district):\n        self._district = district\n        self._ics = ICS()\n\n    def fetch(self):\n        today = datetime.date.today()\n        dates = []\n        if today.month == 12:\n            # On Dec 27 2022, the 2022 schedule was no longer available for test case \"Seefeld\", all others worked\n            try:\n                dates = self.fetch_year(today.year)\n            except Exception:\n                pass\n            try:\n                dates.extend(self.fetch_year(today.year + 1))\n            except Exception:\n                pass\n        else:\n            dates = self.fetch_year(today.year)\n\n        entries = []\n        for d in dates:\n            entries.append(Collection(d[0], d[1]))\n        return entries\n\n    def fetch_year(self, year):\n        arg = convert_to_arg(self._district)\n        r = requests.get(API_URL.format(year=year, arg=arg))\n        r.raise_for_status()\n        entries = self._ics.convert(r.text)\n        for prefix in (\n            \"Schadstoffmobil\",\n            \"Papiertonne_GER\",\n            \"Papiertonne_Gollan\",\n            \"Papiertonne_Veolia\",\n        ):\n            try:\n                r = requests.get(API_URL.format(year=year, arg=f\"{prefix}_{arg}\"))\n                r.raise_for_status()\n                new_entries = self._ics.convert(r.text)\n                entries.extend(new_entries)\n            except (ValueError, requests.exceptions.HTTPError):\n                pass\n        return entries\n\n\ndef convert_to_arg(district, prefix=\"\"):\n    district = district.replace(\"(1.100 l Beh\u00e4lter)\", \"1100_l\")\n    district = district.replace(\"\u00fc\", \"ue\")\n    district = district.replace(\"\u00f6\", \"oe\")\n    district = district.replace(\"\u00e4\", \"ae\")\n    district = district.replace(\"\u00df\", \"ss\")\n    district = district.replace(\"/\", \"\")\n    # district = district.replace(\"- \", \"-\") failed with Seefeld/ Testorf- Steinfort\n    district = district.replace(\".\", \"\")\n    district = district.replace(\" \", \"_\")\n    prefix = prefix + \"_\" if prefix else \"\"\n    arg = urllib.parse.quote(f\"{prefix}Ortsteil_{district}\")\n    return arg\n", "path": "custom_components/waste_collection_schedule/waste_collection_schedule/source/geoport_nwm_de.py"}]}