prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Infra: Allow dismissing the historical note banner
  These notes take up more than a 1/3 of my screen and make it significantly harder to read the PEP. I can developer console it out of existence on my laptop, but not on my phone.
  
  </issue>
  <code>
  [start of pep_sphinx_extensions/pep_processor/parsing/pep_banner_directive.py]
  1 """Roles to insert custom admonitions pointing readers to canonical content."""
  2 
  3 from __future__ import annotations
  4 
  5 from docutils import nodes
  6 from docutils.parsers import rst
  7 
  8 PYPA_SPEC_BASE_URL = "https://packaging.python.org/en/latest/specifications/"
  9 
  10 
  11 class PEPBanner(rst.Directive):
  12     """Insert a special banner admonition in a PEP document."""
  13 
  14     has_content = True
  15     required_arguments = 0
  16     optional_arguments = 1
  17     final_argument_whitespace = True
  18     option_spec = {}
  19 
  20     admonition_pre_template = ""
  21     admonition_pre_text = ""
  22     admonition_post_text = ""
  23 
  24     admonition_class = nodes.important
  25     css_classes = []
  26 
  27 
  28     def run(self) -> list[nodes.admonition]:
  29 
  30         if self.arguments:
  31             link_content = self.arguments[0]
  32             pre_text = self.admonition_pre_template.format(
  33                 link_content=link_content)
  34         else:
  35             pre_text = self.admonition_pre_text
  36 
  37         pre_text_node = nodes.paragraph(pre_text)
  38         pre_text_node.line = self.lineno
  39         pre_node, pre_msg = self.state.inline_text(pre_text, self.lineno)
  40         pre_text_node.extend(pre_node + pre_msg)
  41 
  42         post_text = self.admonition_post_text
  43         post_text_node = nodes.paragraph(post_text)
  44         post_text_node.line = self.lineno
  45         post_node, post_msg = self.state.inline_text(post_text, self.lineno)
  46         post_text_node.extend(post_node + post_msg)
  47 
  48         source_lines = [pre_text] + list(self.content or []) + [post_text]
  49         admonition_node = self.admonition_class(
  50             "\n".join(source_lines), classes=["pep-banner"] + self.css_classes)
  51 
  52         admonition_node.append(pre_text_node)
  53         if self.content:
  54             self.state.nested_parse(
  55                 self.content, self.content_offset, admonition_node)
  56         admonition_node.append(post_text_node)
  57 
  58         return [admonition_node]
  59 
  60 
  61 class CanonicalDocBanner(PEPBanner):
  62     """Insert an admonition pointing readers to a PEP's canonical docs."""
  63 
  64     admonition_pre_template = (
  65         "This PEP is a historical document. "
  66         "The up-to-date, canonical documentation can now be found "
  67         "at {link_content}."
  68     )
  69     admonition_pre_text = (
  70         "This PEP is a historical document. "
  71         "The up-to-date, canonical documentation can now be found elsewhere."
  72     )
  73     admonition_post_text = (
  74         "See :pep:`1` for how to propose changes."
  75     )
  76 
  77     css_classes = ["canonical-doc", "sticky-banner"]
  78 
  79 
  80 
  81 class CanonicalPyPASpecBanner(PEPBanner):
  82     """Insert a specialized admonition for PyPA packaging specifications."""
  83 
  84     admonition_pre_template = (
  85         "This PEP is a historical document. "
  86         "The up-to-date, canonical spec, {link_content}, is maintained on "
  87         f"the `PyPA specs page <{PYPA_SPEC_BASE_URL}>`__."
  88     )
  89     admonition_pre_text = (
  90         "This PEP is a historical document. "
  91         "The up-to-date, canonical specifications are maintained on "
  92         f"the `PyPA specs page <{PYPA_SPEC_BASE_URL}>`__."
  93     )
  94     admonition_post_text = (
  95         "See the `PyPA specification update process "
  96         "<https://www.pypa.io/en/latest/specifications/#handling-fixes-and-other-minor-updates>`__ "
  97         "for how to propose changes."
  98     )
  99     admonition_class = nodes.attention
  100 
  101     css_classes = ["canonical-pypa-spec", "sticky-banner"]
  102
  [end of pep_sphinx_extensions/pep_processor/parsing/pep_banner_directive.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/pep_sphinx_extensions/pep_processor/parsing/pep_banner_directive.py b/pep_sphinx_extensions/pep_processor/parsing/pep_banner_directive.py
  --- a/pep_sphinx_extensions/pep_processor/parsing/pep_banner_directive.py
  +++ b/pep_sphinx_extensions/pep_processor/parsing/pep_banner_directive.py
  @@ -34,6 +34,9 @@
           else:
               pre_text = self.admonition_pre_text
   
  +        close_button_node = nodes.paragraph('', '', nodes.Text('×'), classes=['close-button'])
  +        close_button_node['classes'].append('close-button')
  +
           pre_text_node = nodes.paragraph(pre_text)
           pre_text_node.line = self.lineno
           pre_node, pre_msg = self.state.inline_text(pre_text, self.lineno)
  @@ -50,6 +53,7 @@
               "\n".join(source_lines), classes=["pep-banner"] + self.css_classes)
   
           admonition_node.append(pre_text_node)
  +        admonition_node.append(close_button_node)
           if self.content:
               self.state.nested_parse(
                   self.content, self.content_offset, admonition_node)
  
verification_info: {"golden_diff": "diff --git a/pep_sphinx_extensions/pep_processor/parsing/pep_banner_directive.py b/pep_sphinx_extensions/pep_processor/parsing/pep_banner_directive.py\n--- a/pep_sphinx_extensions/pep_processor/parsing/pep_banner_directive.py\n+++ b/pep_sphinx_extensions/pep_processor/parsing/pep_banner_directive.py\n@@ -34,6 +34,9 @@\n         else:\n             pre_text = self.admonition_pre_text\n \n+        close_button_node = nodes.paragraph('', '', nodes.Text('\u00d7'), classes=['close-button'])\n+        close_button_node['classes'].append('close-button')\n+\n         pre_text_node = nodes.paragraph(pre_text)\n         pre_text_node.line = self.lineno\n         pre_node, pre_msg = self.state.inline_text(pre_text, self.lineno)\n@@ -50,6 +53,7 @@\n             \"\\n\".join(source_lines), classes=[\"pep-banner\"] + self.css_classes)\n \n         admonition_node.append(pre_text_node)\n+        admonition_node.append(close_button_node)\n         if self.content:\n             self.state.nested_parse(\n                 self.content, self.content_offset, admonition_node)\n", "issue": "Infra: Allow dismissing the historical note banner\nThese notes take up more than a 1/3 of my screen and make it significantly harder to read the PEP. I can developer console it out of existence on my laptop, but not on my phone.\n", "before_files": [{"content": "\"\"\"Roles to insert custom admonitions pointing readers to canonical content.\"\"\"\n\nfrom __future__ import annotations\n\nfrom docutils import nodes\nfrom docutils.parsers import rst\n\nPYPA_SPEC_BASE_URL = \"https://packaging.python.org/en/latest/specifications/\"\n\n\nclass PEPBanner(rst.Directive):\n    \"\"\"Insert a special banner admonition in a PEP document.\"\"\"\n\n    has_content = True\n    required_arguments = 0\n    optional_arguments = 1\n    final_argument_whitespace = True\n    option_spec = {}\n\n    admonition_pre_template = \"\"\n    admonition_pre_text = \"\"\n    admonition_post_text = \"\"\n\n    admonition_class = nodes.important\n    css_classes = []\n\n\n    def run(self) -> list[nodes.admonition]:\n\n        if self.arguments:\n            link_content = self.arguments[0]\n            pre_text = self.admonition_pre_template.format(\n                link_content=link_content)\n        else:\n            pre_text = self.admonition_pre_text\n\n        pre_text_node = nodes.paragraph(pre_text)\n        pre_text_node.line = self.lineno\n        pre_node, pre_msg = self.state.inline_text(pre_text, self.lineno)\n        pre_text_node.extend(pre_node + pre_msg)\n\n        post_text = self.admonition_post_text\n        post_text_node = nodes.paragraph(post_text)\n        post_text_node.line = self.lineno\n        post_node, post_msg = self.state.inline_text(post_text, self.lineno)\n        post_text_node.extend(post_node + post_msg)\n\n        source_lines = [pre_text] + list(self.content or []) + [post_text]\n        admonition_node = self.admonition_class(\n            \"\\n\".join(source_lines), classes=[\"pep-banner\"] + self.css_classes)\n\n        admonition_node.append(pre_text_node)\n        if self.content:\n            self.state.nested_parse(\n                self.content, self.content_offset, admonition_node)\n        admonition_node.append(post_text_node)\n\n        return [admonition_node]\n\n\nclass CanonicalDocBanner(PEPBanner):\n    \"\"\"Insert an admonition pointing readers to a PEP's canonical docs.\"\"\"\n\n    admonition_pre_template = (\n        \"This PEP is a historical document. \"\n        \"The up-to-date, canonical documentation can now be found \"\n        \"at {link_content}.\"\n    )\n    admonition_pre_text = (\n        \"This PEP is a historical document. \"\n        \"The up-to-date, canonical documentation can now be found elsewhere.\"\n    )\n    admonition_post_text = (\n        \"See :pep:`1` for how to propose changes.\"\n    )\n\n    css_classes = [\"canonical-doc\", \"sticky-banner\"]\n\n\n\nclass CanonicalPyPASpecBanner(PEPBanner):\n    \"\"\"Insert a specialized admonition for PyPA packaging specifications.\"\"\"\n\n    admonition_pre_template = (\n        \"This PEP is a historical document. \"\n        \"The up-to-date, canonical spec, {link_content}, is maintained on \"\n        f\"the `PyPA specs page <{PYPA_SPEC_BASE_URL}>`__.\"\n    )\n    admonition_pre_text = (\n        \"This PEP is a historical document. \"\n        \"The up-to-date, canonical specifications are maintained on \"\n        f\"the `PyPA specs page <{PYPA_SPEC_BASE_URL}>`__.\"\n    )\n    admonition_post_text = (\n        \"See the `PyPA specification update process \"\n        \"<https://www.pypa.io/en/latest/specifications/#handling-fixes-and-other-minor-updates>`__ \"\n        \"for how to propose changes.\"\n    )\n    admonition_class = nodes.attention\n\n    css_classes = [\"canonical-pypa-spec\", \"sticky-banner\"]\n", "path": "pep_sphinx_extensions/pep_processor/parsing/pep_banner_directive.py"}]}