We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Fix Carnival date of the "Portugal" calendar
Currently, the package incorrectly indicates that the Carnival "holiday" is on the Monday before the actual date, which in 2024 is 2024/02/13 (YYYY/MM/DD).
It's clear from the method name `_add_carnival_monday()`.

This seems to be the problematic area.
<img width="504" alt="Captura de ecrã 2024-02-16, às 17 56 57" src="https://github.com/vacanza/python-holidays/assets/16542680/bf1ac118-c246-43f3-ae53-535af6742cf6">

I'm more than happy to open a PR.

Thank you for the excellent work 🚀!

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `holidays/countries/portugal.py`
Content:
```
1 #  python-holidays
2 #  ---------------
3 #  A fast, efficient Python library for generating country, province and state
4 #  specific sets of holidays on the fly. It aims to make determining whether a
5 #  specific date is a holiday as fast and flexible as possible.
6 #
7 #  Authors: dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023
8 #           ryanss <ryanssdev@icloud.com> (c) 2014-2017
9 #  Website: https://github.com/dr-prodigy/python-holidays
10 #  License: MIT (see LICENSE file)
11 
12 from datetime import timedelta as td
13 from gettext import gettext as tr
14 
15 from holidays.constants import OPTIONAL, PUBLIC
16 from holidays.groups import ChristianHolidays, InternationalHolidays
17 from holidays.holiday_base import HolidayBase
18 
19 
20 class Portugal(HolidayBase, ChristianHolidays, InternationalHolidays):
21     """
22     A subclass of :py:class:`HolidayBase` representing public holidays
23     in Portugal.
24 
25     References:
26         - https://en.wikipedia.org/wiki/Public_holidays_in_Portugal
27         - `Labour Day <https://www.e-konomista.pt/dia-do-trabalhador/>`_
28         - Portugal Day - Decreto 17.171
29         - Restoration of Independence Day - Gazeta de Lisboa, 8 de Dezembro
30           de 1823 (n.º 290), pp. 1789 e 1790
31         - Azores
32             - https://files.dre.pt/1s/1980/08/19200/23052305.pdf
33         - Madeira
34             - https://files.dre.pt/1s/1979/11/25900/28782878.pdf
35             - https://files.dre.pt/1s/1989/02/02800/04360436.pdf
36             - https://files.dre.pt/1s/2002/11/258a00/71837183.pdf
37     """
38 
39     country = "PT"
40     default_language = "pt_PT"
41     supported_categories = (OPTIONAL, PUBLIC)
42 
43     # https://en.wikipedia.org/wiki/ISO_3166-2:PT
44     subdivisions = (
45         "01",
46         "02",
47         "03",
48         "04",
49         "05",
50         "06",
51         "07",
52         "08",
53         "09",
54         "10",
55         "11",
56         "12",
57         "13",
58         "14",
59         "15",
60         "16",
61         "17",
62         "18",
63         "20",
64         "30",
65     )
66     _deprecated_subdivisions = ("Ext",)
67     supported_languages = ("en_US", "pt_PT", "uk")
68 
69     def __init__(self, *args, **kwargs) -> None:
70         ChristianHolidays.__init__(self)
71         InternationalHolidays.__init__(self)
72         super().__init__(*args, **kwargs)
73 
74     def _populate_public_holidays(self):
75         # New Year's Day.
76         self._add_new_years_day(tr("Ano Novo"))
77 
78         # Carnival is no longer a holiday, but some companies let workers off.
79         # TODO: recollect the years in which it was a public holiday.
80 
81         # Good Friday.
82         self._add_good_friday(tr("Sexta-feira Santa"))
83 
84         # Easter Sunday.
85         self._add_easter_sunday(tr("Páscoa"))
86 
87         # Revoked holidays in 2013–2015.
88         if self._year <= 2012 or self._year >= 2016:
89             # Corpus Christi.
90             self._add_corpus_christi_day(tr("Corpo de Deus"))
91 
92             if self._year >= 1910:
93                 # Republic Day.
94                 self._add_holiday_oct_5(tr("Implantação da República"))
95 
96             # All Saints' Day.
97             self._add_all_saints_day(tr("Dia de Todos os Santos"))
98 
99             if self._year >= 1823:
100                 # Restoration of Independence Day.
101                 self._add_holiday_dec_1(tr("Restauração da Independência"))
102 
103         if self._year >= 1974:
104             # Freedom Day.
105             self._add_holiday_apr_25(tr("Dia da Liberdade"))
106 
107             # Labor Day.
108             self._add_labor_day(tr("Dia do Trabalhador"))
109 
110         if self._year >= 1911:
111             if 1933 <= self._year <= 1973:
112                 # Day of Camões, Portugal, and the Portuguese Race.
113                 self._add_holiday_jun_10(tr("Dia de Camões, de Portugal e da Raça"))
114             elif self._year >= 1978:
115                 self._add_holiday_jun_10(
116                     # Day of Portugal, Camões, and the Portuguese Communities.
117                     tr("Dia de Portugal, de Camões e das Comunidades Portuguesas")
118                 )
119             else:
120                 # Portugal Day.
121                 self._add_holiday_jun_10(tr("Dia de Portugal"))
122 
123         # Assumption Day.
124         self._add_assumption_of_mary_day(tr("Assunção de Nossa Senhora"))
125 
126         # Immaculate Conception.
127         self._add_immaculate_conception_day(tr("Imaculada Conceição"))
128 
129         # Christmas Day.
130         self._add_christmas_day(tr("Dia de Natal"))
131 
132     def _populate_optional_holidays(self):
133         """
134         Adds extended days that most people have as a bonus from their
135         companies:
136 
137         - Carnival
138         - the day before and after xmas
139         - the day before the new year
140         - Lisbon's city holiday
141         """
142 
143         # TODO: add bridging days:
144         # - get Holidays that occur on Tuesday  and add Monday (-1 day)
145         # - get Holidays that occur on Thursday and add Friday (+1 day)
146 
147         # Carnival.
148         self._add_carnival_monday(tr("Carnaval"))
149 
150         # St. Anthony's Day.
151         self._add_holiday_jun_13(tr("Dia de Santo António"))
152 
153         # Christmas Eve.
154         self._add_christmas_eve(tr("Véspera de Natal"))
155 
156         # Second Day of Christmas.
157         self._add_christmas_day_two(tr("26 de Dezembro"))
158 
159         # New Year's Eve.
160         self._add_new_years_eve(tr("Véspera de Ano Novo"))
161 
162     def _populate_subdiv_holidays(self):
163         if self._year >= 1911:
164             super()._populate_subdiv_holidays()
165 
166         if self.subdiv == "Ext":
167             self._populate_optional_holidays()
168 
169     def _populate_subdiv_01_public_holidays(self):
170         # St. Joanna's Day.
171         self._add_holiday_may_12(tr("Dia de Santa Joana"))
172 
173     def _populate_subdiv_02_public_holidays(self):
174         # Ascension Day.
175         self._add_ascension_thursday(tr("Quinta-feira da Ascensão"))
176 
177     def _populate_subdiv_03_public_holidays(self):
178         # St. John's Day.
179         self._add_saint_johns_day(tr("Dia de São João"))
180 
181     def _populate_subdiv_04_public_holidays(self):
182         # Feast of Our Lady of Graces.
183         self._add_holiday_aug_22(tr("Dia de Nossa Senhora das Graças"))
184 
185     def _populate_subdiv_05_public_holidays(self):
186         self._add_holiday(
187             # Feast of Our Lady of Mércoles.
188             tr("Dia de Nossa Senhora de Mércoles"),
189             self._easter_sunday + td(days=+16),
190         )
191 
192     def _populate_subdiv_06_public_holidays(self):
193         # St. Elizabeth's Day.
194         self._add_holiday_jul_4(tr("Dia de Santa Isabel"))
195 
196     def _populate_subdiv_07_public_holidays(self):
197         # St. Peter's Day.
198         self._add_saints_peter_and_paul_day(tr("Dia de São Pedro"))
199 
200     def _populate_subdiv_08_public_holidays(self):
201         # Municipal Holiday of Faro.
202         self._add_holiday_sep_7(tr("Dia do Município de Faro"))
203 
204     def _populate_subdiv_09_public_holidays(self):
205         # Municipal Holiday of Guarda.
206         self._add_holiday_nov_27(tr("Dia do Município da Guarda"))
207 
208     def _populate_subdiv_10_public_holidays(self):
209         # Municipal Holiday of Leiria.
210         self._add_holiday_may_22(tr("Dia do Município de Leiria"))
211 
212     def _populate_subdiv_11_public_holidays(self):
213         self._add_holiday_jun_13(tr("Dia de Santo António"))
214 
215     def _populate_subdiv_12_public_holidays(self):
216         # Municipal Holiday of Portalegre.
217         self._add_holiday_may_23(tr("Dia do Município de Portalegre"))
218 
219     def _populate_subdiv_13_public_holidays(self):
220         self._add_saint_johns_day(tr("Dia de São João"))
221 
222     def _populate_subdiv_14_public_holidays(self):
223         # St. Joseph's Day.
224         self._add_saint_josephs_day(tr("Dia de São José"))
225 
226     def _populate_subdiv_15_public_holidays(self):
227         # Bocage Day.
228         self._add_holiday_sep_15(tr("Dia de Bocage"))
229 
230     def _populate_subdiv_16_public_holidays(self):
231         # Feast of Our Lady of Sorrows.
232         self._add_holiday_aug_20(tr("Dia de Nossa Senhora da Agonia"))
233 
234     def _populate_subdiv_17_public_holidays(self):
235         self._add_holiday_jun_13(tr("Dia de Santo António"))
236 
237     def _populate_subdiv_18_public_holidays(self):
238         # St. Matthew's Day.
239         self._add_holiday_sep_21(tr("Dia de São Mateus"))
240 
241     def _populate_subdiv_20_public_holidays(self):
242         if self._year >= 1981:
243             # Day of the Autonomous Region of the Azores.
244             self._add_whit_monday(tr("Dia da Região Autónoma dos Açores"))
245 
246     def _populate_subdiv_30_public_holidays(self):
247         if self._year >= 1979:
248             self._add_holiday_jul_1(
249                 # Day of the Autonomous Region of Madeira and the Madeiran Communities.
250                 tr("Dia da Região Autónoma da Madeira e das Comunidades Madeirenses")
251                 if self._year >= 1989
252                 # Day of the Autonomous Region of Madeira.
253                 else tr("Dia da Região Autónoma da Madeira")
254             )
255 
256         if self._year >= 2002:
257             # 1st Octave.
258             self._add_christmas_day_two(tr("Primeira Oitava"))
259 
260 
261 class PT(Portugal):
262     pass
263 
264 
265 class PRT(Portugal):
266     pass
267
```
--- 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()

```

diff --git a/holidays/countries/portugal.py b/holidays/countries/portugal.py
--- a/holidays/countries/portugal.py
+++ b/holidays/countries/portugal.py
@@ -145,7 +145,7 @@
         # - get Holidays that occur on Thursday and add Friday (+1 day)
 
         # Carnival.
-        self._add_carnival_monday(tr("Carnaval"))
+        self._add_carnival_tuesday(tr("Carnaval"))
 
         # St. Anthony's Day.
         self._add_holiday_jun_13(tr("Dia de Santo António"))

{"golden_diff": "diff --git a/holidays/countries/portugal.py b/holidays/countries/portugal.py\n--- a/holidays/countries/portugal.py\n+++ b/holidays/countries/portugal.py\n@@ -145,7 +145,7 @@\n         # - get Holidays that occur on Thursday and add Friday (+1 day)\n \n         # Carnival.\n-        self._add_carnival_monday(tr(\"Carnaval\"))\n+        self._add_carnival_tuesday(tr(\"Carnaval\"))\n \n         # St. Anthony's Day.\n         self._add_holiday_jun_13(tr(\"Dia de Santo Ant\u00f3nio\"))\n", "issue": "Fix Carnival date of the \"Portugal\" calendar\nCurrently, the package incorrectly indicates that the Carnival \"holiday\" is on the Monday before the actual date, which in 2024 is 2024/02/13 (YYYY/MM/DD).\r\nIt's clear from the method name `_add_carnival_monday()`.\r\n\r\nThis seems to be the problematic area.\r\n<img width=\"504\" alt=\"Captura de ecra\u0303 2024-02-16, a\u0300s 17 56 57\" src=\"https://github.com/vacanza/python-holidays/assets/16542680/bf1ac118-c246-43f3-ae53-535af6742cf6\">\r\n\r\nI'm more than happy to open a PR.\r\n\r\nThank you for the excellent work \ud83d\ude80!\n", "before_files": [{"content": "#  python-holidays\n#  ---------------\n#  A fast, efficient Python library for generating country, province and state\n#  specific sets of holidays on the fly. It aims to make determining whether a\n#  specific date is a holiday as fast and flexible as possible.\n#\n#  Authors: dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023\n#           ryanss <ryanssdev@icloud.com> (c) 2014-2017\n#  Website: https://github.com/dr-prodigy/python-holidays\n#  License: MIT (see LICENSE file)\n\nfrom datetime import timedelta as td\nfrom gettext import gettext as tr\n\nfrom holidays.constants import OPTIONAL, PUBLIC\nfrom holidays.groups import ChristianHolidays, InternationalHolidays\nfrom holidays.holiday_base import HolidayBase\n\n\nclass Portugal(HolidayBase, ChristianHolidays, InternationalHolidays):\n    \"\"\"\n    A subclass of :py:class:`HolidayBase` representing public holidays\n    in Portugal.\n\n    References:\n        - https://en.wikipedia.org/wiki/Public_holidays_in_Portugal\n        - `Labour Day <https://www.e-konomista.pt/dia-do-trabalhador/>`_\n        - Portugal Day - Decreto 17.171\n        - Restoration of Independence Day - Gazeta de Lisboa, 8 de Dezembro\n          de 1823 (n.\u00ba 290), pp. 1789 e 1790\n        - Azores\n            - https://files.dre.pt/1s/1980/08/19200/23052305.pdf\n        - Madeira\n            - https://files.dre.pt/1s/1979/11/25900/28782878.pdf\n            - https://files.dre.pt/1s/1989/02/02800/04360436.pdf\n            - https://files.dre.pt/1s/2002/11/258a00/71837183.pdf\n    \"\"\"\n\n    country = \"PT\"\n    default_language = \"pt_PT\"\n    supported_categories = (OPTIONAL, PUBLIC)\n\n    # https://en.wikipedia.org/wiki/ISO_3166-2:PT\n    subdivisions = (\n        \"01\",\n        \"02\",\n        \"03\",\n        \"04\",\n        \"05\",\n        \"06\",\n        \"07\",\n        \"08\",\n        \"09\",\n        \"10\",\n        \"11\",\n        \"12\",\n        \"13\",\n        \"14\",\n        \"15\",\n        \"16\",\n        \"17\",\n        \"18\",\n        \"20\",\n        \"30\",\n    )\n    _deprecated_subdivisions = (\"Ext\",)\n    supported_languages = (\"en_US\", \"pt_PT\", \"uk\")\n\n    def __init__(self, *args, **kwargs) -> None:\n        ChristianHolidays.__init__(self)\n        InternationalHolidays.__init__(self)\n        super().__init__(*args, **kwargs)\n\n    def _populate_public_holidays(self):\n        # New Year's Day.\n        self._add_new_years_day(tr(\"Ano Novo\"))\n\n        # Carnival is no longer a holiday, but some companies let workers off.\n        # TODO: recollect the years in which it was a public holiday.\n\n        # Good Friday.\n        self._add_good_friday(tr(\"Sexta-feira Santa\"))\n\n        # Easter Sunday.\n        self._add_easter_sunday(tr(\"P\u00e1scoa\"))\n\n        # Revoked holidays in 2013\u20132015.\n        if self._year <= 2012 or self._year >= 2016:\n            # Corpus Christi.\n            self._add_corpus_christi_day(tr(\"Corpo de Deus\"))\n\n            if self._year >= 1910:\n                # Republic Day.\n                self._add_holiday_oct_5(tr(\"Implanta\u00e7\u00e3o da Rep\u00fablica\"))\n\n            # All Saints' Day.\n            self._add_all_saints_day(tr(\"Dia de Todos os Santos\"))\n\n            if self._year >= 1823:\n                # Restoration of Independence Day.\n                self._add_holiday_dec_1(tr(\"Restaura\u00e7\u00e3o da Independ\u00eancia\"))\n\n        if self._year >= 1974:\n            # Freedom Day.\n            self._add_holiday_apr_25(tr(\"Dia da Liberdade\"))\n\n            # Labor Day.\n            self._add_labor_day(tr(\"Dia do Trabalhador\"))\n\n        if self._year >= 1911:\n            if 1933 <= self._year <= 1973:\n                # Day of Cam\u00f5es, Portugal, and the Portuguese Race.\n                self._add_holiday_jun_10(tr(\"Dia de Cam\u00f5es, de Portugal e da Ra\u00e7a\"))\n            elif self._year >= 1978:\n                self._add_holiday_jun_10(\n                    # Day of Portugal, Cam\u00f5es, and the Portuguese Communities.\n                    tr(\"Dia de Portugal, de Cam\u00f5es e das Comunidades Portuguesas\")\n                )\n            else:\n                # Portugal Day.\n                self._add_holiday_jun_10(tr(\"Dia de Portugal\"))\n\n        # Assumption Day.\n        self._add_assumption_of_mary_day(tr(\"Assun\u00e7\u00e3o de Nossa Senhora\"))\n\n        # Immaculate Conception.\n        self._add_immaculate_conception_day(tr(\"Imaculada Concei\u00e7\u00e3o\"))\n\n        # Christmas Day.\n        self._add_christmas_day(tr(\"Dia de Natal\"))\n\n    def _populate_optional_holidays(self):\n        \"\"\"\n        Adds extended days that most people have as a bonus from their\n        companies:\n\n        - Carnival\n        - the day before and after xmas\n        - the day before the new year\n        - Lisbon's city holiday\n        \"\"\"\n\n        # TODO: add bridging days:\n        # - get Holidays that occur on Tuesday  and add Monday (-1 day)\n        # - get Holidays that occur on Thursday and add Friday (+1 day)\n\n        # Carnival.\n        self._add_carnival_monday(tr(\"Carnaval\"))\n\n        # St. Anthony's Day.\n        self._add_holiday_jun_13(tr(\"Dia de Santo Ant\u00f3nio\"))\n\n        # Christmas Eve.\n        self._add_christmas_eve(tr(\"V\u00e9spera de Natal\"))\n\n        # Second Day of Christmas.\n        self._add_christmas_day_two(tr(\"26 de Dezembro\"))\n\n        # New Year's Eve.\n        self._add_new_years_eve(tr(\"V\u00e9spera de Ano Novo\"))\n\n    def _populate_subdiv_holidays(self):\n        if self._year >= 1911:\n            super()._populate_subdiv_holidays()\n\n        if self.subdiv == \"Ext\":\n            self._populate_optional_holidays()\n\n    def _populate_subdiv_01_public_holidays(self):\n        # St. Joanna's Day.\n        self._add_holiday_may_12(tr(\"Dia de Santa Joana\"))\n\n    def _populate_subdiv_02_public_holidays(self):\n        # Ascension Day.\n        self._add_ascension_thursday(tr(\"Quinta-feira da Ascens\u00e3o\"))\n\n    def _populate_subdiv_03_public_holidays(self):\n        # St. John's Day.\n        self._add_saint_johns_day(tr(\"Dia de S\u00e3o Jo\u00e3o\"))\n\n    def _populate_subdiv_04_public_holidays(self):\n        # Feast of Our Lady of Graces.\n        self._add_holiday_aug_22(tr(\"Dia de Nossa Senhora das Gra\u00e7as\"))\n\n    def _populate_subdiv_05_public_holidays(self):\n        self._add_holiday(\n            # Feast of Our Lady of M\u00e9rcoles.\n            tr(\"Dia de Nossa Senhora de M\u00e9rcoles\"),\n            self._easter_sunday + td(days=+16),\n        )\n\n    def _populate_subdiv_06_public_holidays(self):\n        # St. Elizabeth's Day.\n        self._add_holiday_jul_4(tr(\"Dia de Santa Isabel\"))\n\n    def _populate_subdiv_07_public_holidays(self):\n        # St. Peter's Day.\n        self._add_saints_peter_and_paul_day(tr(\"Dia de S\u00e3o Pedro\"))\n\n    def _populate_subdiv_08_public_holidays(self):\n        # Municipal Holiday of Faro.\n        self._add_holiday_sep_7(tr(\"Dia do Munic\u00edpio de Faro\"))\n\n    def _populate_subdiv_09_public_holidays(self):\n        # Municipal Holiday of Guarda.\n        self._add_holiday_nov_27(tr(\"Dia do Munic\u00edpio da Guarda\"))\n\n    def _populate_subdiv_10_public_holidays(self):\n        # Municipal Holiday of Leiria.\n        self._add_holiday_may_22(tr(\"Dia do Munic\u00edpio de Leiria\"))\n\n    def _populate_subdiv_11_public_holidays(self):\n        self._add_holiday_jun_13(tr(\"Dia de Santo Ant\u00f3nio\"))\n\n    def _populate_subdiv_12_public_holidays(self):\n        # Municipal Holiday of Portalegre.\n        self._add_holiday_may_23(tr(\"Dia do Munic\u00edpio de Portalegre\"))\n\n    def _populate_subdiv_13_public_holidays(self):\n        self._add_saint_johns_day(tr(\"Dia de S\u00e3o Jo\u00e3o\"))\n\n    def _populate_subdiv_14_public_holidays(self):\n        # St. Joseph's Day.\n        self._add_saint_josephs_day(tr(\"Dia de S\u00e3o Jos\u00e9\"))\n\n    def _populate_subdiv_15_public_holidays(self):\n        # Bocage Day.\n        self._add_holiday_sep_15(tr(\"Dia de Bocage\"))\n\n    def _populate_subdiv_16_public_holidays(self):\n        # Feast of Our Lady of Sorrows.\n        self._add_holiday_aug_20(tr(\"Dia de Nossa Senhora da Agonia\"))\n\n    def _populate_subdiv_17_public_holidays(self):\n        self._add_holiday_jun_13(tr(\"Dia de Santo Ant\u00f3nio\"))\n\n    def _populate_subdiv_18_public_holidays(self):\n        # St. Matthew's Day.\n        self._add_holiday_sep_21(tr(\"Dia de S\u00e3o Mateus\"))\n\n    def _populate_subdiv_20_public_holidays(self):\n        if self._year >= 1981:\n            # Day of the Autonomous Region of the Azores.\n            self._add_whit_monday(tr(\"Dia da Regi\u00e3o Aut\u00f3noma dos A\u00e7ores\"))\n\n    def _populate_subdiv_30_public_holidays(self):\n        if self._year >= 1979:\n            self._add_holiday_jul_1(\n                # Day of the Autonomous Region of Madeira and the Madeiran Communities.\n                tr(\"Dia da Regi\u00e3o Aut\u00f3noma da Madeira e das Comunidades Madeirenses\")\n                if self._year >= 1989\n                # Day of the Autonomous Region of Madeira.\n                else tr(\"Dia da Regi\u00e3o Aut\u00f3noma da Madeira\")\n            )\n\n        if self._year >= 2002:\n            # 1st Octave.\n            self._add_christmas_day_two(tr(\"Primeira Oitava\"))\n\n\nclass PT(Portugal):\n    pass\n\n\nclass PRT(Portugal):\n    pass\n", "path": "holidays/countries/portugal.py"}], "after_files": [{"content": "#  python-holidays\n#  ---------------\n#  A fast, efficient Python library for generating country, province and state\n#  specific sets of holidays on the fly. It aims to make determining whether a\n#  specific date is a holiday as fast and flexible as possible.\n#\n#  Authors: dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023\n#           ryanss <ryanssdev@icloud.com> (c) 2014-2017\n#  Website: https://github.com/dr-prodigy/python-holidays\n#  License: MIT (see LICENSE file)\n\nfrom datetime import timedelta as td\nfrom gettext import gettext as tr\n\nfrom holidays.constants import OPTIONAL, PUBLIC\nfrom holidays.groups import ChristianHolidays, InternationalHolidays\nfrom holidays.holiday_base import HolidayBase\n\n\nclass Portugal(HolidayBase, ChristianHolidays, InternationalHolidays):\n    \"\"\"\n    A subclass of :py:class:`HolidayBase` representing public holidays\n    in Portugal.\n\n    References:\n        - https://en.wikipedia.org/wiki/Public_holidays_in_Portugal\n        - `Labour Day <https://www.e-konomista.pt/dia-do-trabalhador/>`_\n        - Portugal Day - Decreto 17.171\n        - Restoration of Independence Day - Gazeta de Lisboa, 8 de Dezembro\n          de 1823 (n.\u00ba 290), pp. 1789 e 1790\n        - Azores\n            - https://files.dre.pt/1s/1980/08/19200/23052305.pdf\n        - Madeira\n            - https://files.dre.pt/1s/1979/11/25900/28782878.pdf\n            - https://files.dre.pt/1s/1989/02/02800/04360436.pdf\n            - https://files.dre.pt/1s/2002/11/258a00/71837183.pdf\n    \"\"\"\n\n    country = \"PT\"\n    default_language = \"pt_PT\"\n    supported_categories = (OPTIONAL, PUBLIC)\n\n    # https://en.wikipedia.org/wiki/ISO_3166-2:PT\n    subdivisions = (\n        \"01\",\n        \"02\",\n        \"03\",\n        \"04\",\n        \"05\",\n        \"06\",\n        \"07\",\n        \"08\",\n        \"09\",\n        \"10\",\n        \"11\",\n        \"12\",\n        \"13\",\n        \"14\",\n        \"15\",\n        \"16\",\n        \"17\",\n        \"18\",\n        \"20\",\n        \"30\",\n    )\n    _deprecated_subdivisions = (\"Ext\",)\n    supported_languages = (\"en_US\", \"pt_PT\", \"uk\")\n\n    def __init__(self, *args, **kwargs) -> None:\n        ChristianHolidays.__init__(self)\n        InternationalHolidays.__init__(self)\n        super().__init__(*args, **kwargs)\n\n    def _populate_public_holidays(self):\n        # New Year's Day.\n        self._add_new_years_day(tr(\"Ano Novo\"))\n\n        # Carnival is no longer a holiday, but some companies let workers off.\n        # TODO: recollect the years in which it was a public holiday.\n\n        # Good Friday.\n        self._add_good_friday(tr(\"Sexta-feira Santa\"))\n\n        # Easter Sunday.\n        self._add_easter_sunday(tr(\"P\u00e1scoa\"))\n\n        # Revoked holidays in 2013\u20132015.\n        if self._year <= 2012 or self._year >= 2016:\n            # Corpus Christi.\n            self._add_corpus_christi_day(tr(\"Corpo de Deus\"))\n\n            if self._year >= 1910:\n                # Republic Day.\n                self._add_holiday_oct_5(tr(\"Implanta\u00e7\u00e3o da Rep\u00fablica\"))\n\n            # All Saints' Day.\n            self._add_all_saints_day(tr(\"Dia de Todos os Santos\"))\n\n            if self._year >= 1823:\n                # Restoration of Independence Day.\n                self._add_holiday_dec_1(tr(\"Restaura\u00e7\u00e3o da Independ\u00eancia\"))\n\n        if self._year >= 1974:\n            # Freedom Day.\n            self._add_holiday_apr_25(tr(\"Dia da Liberdade\"))\n\n            # Labor Day.\n            self._add_labor_day(tr(\"Dia do Trabalhador\"))\n\n        if self._year >= 1911:\n            if 1933 <= self._year <= 1973:\n                # Day of Cam\u00f5es, Portugal, and the Portuguese Race.\n                self._add_holiday_jun_10(tr(\"Dia de Cam\u00f5es, de Portugal e da Ra\u00e7a\"))\n            elif self._year >= 1978:\n                self._add_holiday_jun_10(\n                    # Day of Portugal, Cam\u00f5es, and the Portuguese Communities.\n                    tr(\"Dia de Portugal, de Cam\u00f5es e das Comunidades Portuguesas\")\n                )\n            else:\n                # Portugal Day.\n                self._add_holiday_jun_10(tr(\"Dia de Portugal\"))\n\n        # Assumption Day.\n        self._add_assumption_of_mary_day(tr(\"Assun\u00e7\u00e3o de Nossa Senhora\"))\n\n        # Immaculate Conception.\n        self._add_immaculate_conception_day(tr(\"Imaculada Concei\u00e7\u00e3o\"))\n\n        # Christmas Day.\n        self._add_christmas_day(tr(\"Dia de Natal\"))\n\n    def _populate_optional_holidays(self):\n        \"\"\"\n        Adds extended days that most people have as a bonus from their\n        companies:\n\n        - Carnival\n        - the day before and after xmas\n        - the day before the new year\n        - Lisbon's city holiday\n        \"\"\"\n\n        # TODO: add bridging days:\n        # - get Holidays that occur on Tuesday  and add Monday (-1 day)\n        # - get Holidays that occur on Thursday and add Friday (+1 day)\n\n        # Carnival.\n        self._add_carnival_tuesday(tr(\"Carnaval\"))\n\n        # St. Anthony's Day.\n        self._add_holiday_jun_13(tr(\"Dia de Santo Ant\u00f3nio\"))\n\n        # Christmas Eve.\n        self._add_christmas_eve(tr(\"V\u00e9spera de Natal\"))\n\n        # Second Day of Christmas.\n        self._add_christmas_day_two(tr(\"26 de Dezembro\"))\n\n        # New Year's Eve.\n        self._add_new_years_eve(tr(\"V\u00e9spera de Ano Novo\"))\n\n    def _populate_subdiv_holidays(self):\n        if self._year >= 1911:\n            super()._populate_subdiv_holidays()\n\n        if self.subdiv == \"Ext\":\n            self._populate_optional_holidays()\n\n    def _populate_subdiv_01_public_holidays(self):\n        # St. Joanna's Day.\n        self._add_holiday_may_12(tr(\"Dia de Santa Joana\"))\n\n    def _populate_subdiv_02_public_holidays(self):\n        # Ascension Day.\n        self._add_ascension_thursday(tr(\"Quinta-feira da Ascens\u00e3o\"))\n\n    def _populate_subdiv_03_public_holidays(self):\n        # St. John's Day.\n        self._add_saint_johns_day(tr(\"Dia de S\u00e3o Jo\u00e3o\"))\n\n    def _populate_subdiv_04_public_holidays(self):\n        # Feast of Our Lady of Graces.\n        self._add_holiday_aug_22(tr(\"Dia de Nossa Senhora das Gra\u00e7as\"))\n\n    def _populate_subdiv_05_public_holidays(self):\n        self._add_holiday(\n            # Feast of Our Lady of M\u00e9rcoles.\n            tr(\"Dia de Nossa Senhora de M\u00e9rcoles\"),\n            self._easter_sunday + td(days=+16),\n        )\n\n    def _populate_subdiv_06_public_holidays(self):\n        # St. Elizabeth's Day.\n        self._add_holiday_jul_4(tr(\"Dia de Santa Isabel\"))\n\n    def _populate_subdiv_07_public_holidays(self):\n        # St. Peter's Day.\n        self._add_saints_peter_and_paul_day(tr(\"Dia de S\u00e3o Pedro\"))\n\n    def _populate_subdiv_08_public_holidays(self):\n        # Municipal Holiday of Faro.\n        self._add_holiday_sep_7(tr(\"Dia do Munic\u00edpio de Faro\"))\n\n    def _populate_subdiv_09_public_holidays(self):\n        # Municipal Holiday of Guarda.\n        self._add_holiday_nov_27(tr(\"Dia do Munic\u00edpio da Guarda\"))\n\n    def _populate_subdiv_10_public_holidays(self):\n        # Municipal Holiday of Leiria.\n        self._add_holiday_may_22(tr(\"Dia do Munic\u00edpio de Leiria\"))\n\n    def _populate_subdiv_11_public_holidays(self):\n        self._add_holiday_jun_13(tr(\"Dia de Santo Ant\u00f3nio\"))\n\n    def _populate_subdiv_12_public_holidays(self):\n        # Municipal Holiday of Portalegre.\n        self._add_holiday_may_23(tr(\"Dia do Munic\u00edpio de Portalegre\"))\n\n    def _populate_subdiv_13_public_holidays(self):\n        self._add_saint_johns_day(tr(\"Dia de S\u00e3o Jo\u00e3o\"))\n\n    def _populate_subdiv_14_public_holidays(self):\n        # St. Joseph's Day.\n        self._add_saint_josephs_day(tr(\"Dia de S\u00e3o Jos\u00e9\"))\n\n    def _populate_subdiv_15_public_holidays(self):\n        # Bocage Day.\n        self._add_holiday_sep_15(tr(\"Dia de Bocage\"))\n\n    def _populate_subdiv_16_public_holidays(self):\n        # Feast of Our Lady of Sorrows.\n        self._add_holiday_aug_20(tr(\"Dia de Nossa Senhora da Agonia\"))\n\n    def _populate_subdiv_17_public_holidays(self):\n        self._add_holiday_jun_13(tr(\"Dia de Santo Ant\u00f3nio\"))\n\n    def _populate_subdiv_18_public_holidays(self):\n        # St. Matthew's Day.\n        self._add_holiday_sep_21(tr(\"Dia de S\u00e3o Mateus\"))\n\n    def _populate_subdiv_20_public_holidays(self):\n        if self._year >= 1981:\n            # Day of the Autonomous Region of the Azores.\n            self._add_whit_monday(tr(\"Dia da Regi\u00e3o Aut\u00f3noma dos A\u00e7ores\"))\n\n    def _populate_subdiv_30_public_holidays(self):\n        if self._year >= 1979:\n            self._add_holiday_jul_1(\n                # Day of the Autonomous Region of Madeira and the Madeiran Communities.\n                tr(\"Dia da Regi\u00e3o Aut\u00f3noma da Madeira e das Comunidades Madeirenses\")\n                if self._year >= 1989\n                # Day of the Autonomous Region of Madeira.\n                else tr(\"Dia da Regi\u00e3o Aut\u00f3noma da Madeira\")\n            )\n\n        if self._year >= 2002:\n            # 1st Octave.\n            self._add_christmas_day_two(tr(\"Primeira Oitava\"))\n\n\nclass PT(Portugal):\n    pass\n\n\nclass PRT(Portugal):\n    pass\n", "path": "holidays/countries/portugal.py"}]}