prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Updating Slack "Staff PRs" notifications to be more specific
  <!-- IMPORTANT: Before posting, be sure to redact or remove sensitive data, such as passwords, secret keys, session cookies, etc. -->
  
  When our daily slack bot runs to tell us of new staff PRs we want to ignore: 
  - `needs:submitter`
  - `draft`
  - `blocked`
  
  <!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
  
  ### Describe the problem that you'd like solved
  <!-- A clear and concise description of what you want to happen. -->
  
  ### Proposal & Constraints
  <!-- What is the proposed solution / implementation? Is there a precedent of this approach succeeding elsewhere? -->
  
  <!-- Which suggestions or requirements should be considered for how feature needs to appear or be implemented? -->
  
  ### Additional context
  <!-- Add any other context or screenshots about the feature request here. -->
  
  ### Stakeholders
  <!-- @ tag stakeholders of this bug -->
  
  
  
  
  </issue>
  <code>
  [start of scripts/pr_slack_digest.py]
  1 from datetime import datetime
  2 import requests
  3 import os
  4 
  5 
  6 def send_slack_message(message: str):
  7     response = requests.post(
  8         'https://slack.com/api/chat.postMessage',
  9         headers={
  10             'Authorization': f"Bearer {os.environ.get('SLACK_TOKEN')}",
  11             'Content-Type': 'application/json;  charset=utf-8',
  12         },
  13         json={
  14             'channel': '#team-abc-plus',
  15             'text': message,
  16         },
  17     )
  18     if response.status_code != 200:
  19         print(f"Failed to send message to Slack. Status code: {response.status_code}")
  20     else:
  21         print("Message sent to Slack successfully!")
  22         print(response.content)
  23 
  24 
  25 if __name__ == "__main__":
  26     GH_LOGIN_TO_SLACK = {
  27         'cdrini': '<@cdrini>',
  28         'jimchamp': '<@U01ARTHG9EV>',
  29         'mekarpeles': '<@mek>',
  30         'scottbarnes': '<@U03MNR6T7FH>',
  31     }
  32     LABEL_EMOJI = {
  33         'Priority: 0': '🚨 ',
  34         'Priority: 1': '❗️ ',
  35     }
  36     # apparently `author` acts like an OR in this API and only this API -_-
  37     query = "repo:internetarchive/openlibrary is:open is:pr author:cdrini author:jimchamp author:mekarpeles author:scottbarnes -is:draft"
  38     prs = requests.get(
  39         "https://api.github.com/search/issues",
  40         params={
  41             "q": query,
  42         },
  43     ).json()["items"]
  44 
  45     message = f"{len(prs)} open staff PRs:\n\n"
  46     for pr in prs:
  47         pr_url = pr['html_url']
  48         pr_age_days = (
  49             datetime.now() - datetime.strptime(pr['created_at'], '%Y-%m-%dT%H:%M:%SZ')
  50         ).days
  51         message += f"<{pr_url}|*#{pr['number']}* | {pr['title']}>\n"
  52         message += ' | '.join(
  53             [
  54                 f"by {pr['user']['login']} {pr_age_days} days ago",
  55                 f"Assigned: {GH_LOGIN_TO_SLACK[pr['assignee']['login']] if pr['assignee'] else '⚠️ None'}",
  56                 f"{', '.join(LABEL_EMOJI.get(label['name'], '') + label['name'] for label in pr['labels'])}\n\n",
  57             ]
  58         )
  59 
  60     send_slack_message(message)
  61
  [end of scripts/pr_slack_digest.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/scripts/pr_slack_digest.py b/scripts/pr_slack_digest.py
  --- a/scripts/pr_slack_digest.py
  +++ b/scripts/pr_slack_digest.py
  @@ -33,8 +33,18 @@
           'Priority: 0': '🚨 ',
           'Priority: 1': '❗️ ',
       }
  +
  +    INCLUDE_AUTHORS = ['mekarpeles', 'cdrini', 'scottbarnes', 'jimchamp']
  +    EXCLUDE_LABELS = [
  +        'Needs: Submitter Input',
  +        'State: Blocked',
  +    ]
  +    query = 'repo:internetarchive/openlibrary is:open is:pr -is:draft'
       # apparently `author` acts like an OR in this API and only this API -_-
  -    query = "repo:internetarchive/openlibrary is:open is:pr author:cdrini author:jimchamp author:mekarpeles author:scottbarnes -is:draft"
  +    included_authors = " ".join([f"author:{author}" for author in INCLUDE_AUTHORS])
  +    excluded_labels = " ".join([f'-label:"{label}"' for label in EXCLUDE_LABELS])
  +    query = f'{query} {included_authors} {excluded_labels}'
  +
       prs = requests.get(
           "https://api.github.com/search/issues",
           params={
  
verification_info: {"golden_diff": "diff --git a/scripts/pr_slack_digest.py b/scripts/pr_slack_digest.py\n--- a/scripts/pr_slack_digest.py\n+++ b/scripts/pr_slack_digest.py\n@@ -33,8 +33,18 @@\n         'Priority: 0': '\ud83d\udea8 ',\n         'Priority: 1': '\u2757\ufe0f ',\n     }\n+\n+    INCLUDE_AUTHORS = ['mekarpeles', 'cdrini', 'scottbarnes', 'jimchamp']\n+    EXCLUDE_LABELS = [\n+        'Needs: Submitter Input',\n+        'State: Blocked',\n+    ]\n+    query = 'repo:internetarchive/openlibrary is:open is:pr -is:draft'\n     # apparently `author` acts like an OR in this API and only this API -_-\n-    query = \"repo:internetarchive/openlibrary is:open is:pr author:cdrini author:jimchamp author:mekarpeles author:scottbarnes -is:draft\"\n+    included_authors = \" \".join([f\"author:{author}\" for author in INCLUDE_AUTHORS])\n+    excluded_labels = \" \".join([f'-label:\"{label}\"' for label in EXCLUDE_LABELS])\n+    query = f'{query} {included_authors} {excluded_labels}'\n+\n     prs = requests.get(\n         \"https://api.github.com/search/issues\",\n         params={\n", "issue": "Updating Slack \"Staff PRs\" notifications to be more specific\n<!-- IMPORTANT: Before posting, be sure to redact or remove sensitive data, such as passwords, secret keys, session cookies, etc. -->\r\n\r\nWhen our daily slack bot runs to tell us of new staff PRs we want to ignore: \r\n- `needs:submitter`\r\n- `draft`\r\n- `blocked`\r\n\r\n<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->\r\n\r\n### Describe the problem that you'd like solved\r\n<!-- A clear and concise description of what you want to happen. -->\r\n\r\n### Proposal & Constraints\r\n<!-- What is the proposed solution / implementation? Is there a precedent of this approach succeeding elsewhere? -->\r\n\r\n<!-- Which suggestions or requirements should be considered for how feature needs to appear or be implemented? -->\r\n\r\n### Additional context\r\n<!-- Add any other context or screenshots about the feature request here. -->\r\n\r\n### Stakeholders\r\n<!-- @ tag stakeholders of this bug -->\r\n\r\n\r\n\n", "before_files": [{"content": "from datetime import datetime\nimport requests\nimport os\n\n\ndef send_slack_message(message: str):\n    response = requests.post(\n        'https://slack.com/api/chat.postMessage',\n        headers={\n            'Authorization': f\"Bearer {os.environ.get('SLACK_TOKEN')}\",\n            'Content-Type': 'application/json;  charset=utf-8',\n        },\n        json={\n            'channel': '#team-abc-plus',\n            'text': message,\n        },\n    )\n    if response.status_code != 200:\n        print(f\"Failed to send message to Slack. Status code: {response.status_code}\")\n    else:\n        print(\"Message sent to Slack successfully!\")\n        print(response.content)\n\n\nif __name__ == \"__main__\":\n    GH_LOGIN_TO_SLACK = {\n        'cdrini': '<@cdrini>',\n        'jimchamp': '<@U01ARTHG9EV>',\n        'mekarpeles': '<@mek>',\n        'scottbarnes': '<@U03MNR6T7FH>',\n    }\n    LABEL_EMOJI = {\n        'Priority: 0': '\ud83d\udea8 ',\n        'Priority: 1': '\u2757\ufe0f ',\n    }\n    # apparently `author` acts like an OR in this API and only this API -_-\n    query = \"repo:internetarchive/openlibrary is:open is:pr author:cdrini author:jimchamp author:mekarpeles author:scottbarnes -is:draft\"\n    prs = requests.get(\n        \"https://api.github.com/search/issues\",\n        params={\n            \"q\": query,\n        },\n    ).json()[\"items\"]\n\n    message = f\"{len(prs)} open staff PRs:\\n\\n\"\n    for pr in prs:\n        pr_url = pr['html_url']\n        pr_age_days = (\n            datetime.now() - datetime.strptime(pr['created_at'], '%Y-%m-%dT%H:%M:%SZ')\n        ).days\n        message += f\"<{pr_url}|*#{pr['number']}* | {pr['title']}>\\n\"\n        message += ' | '.join(\n            [\n                f\"by {pr['user']['login']} {pr_age_days} days ago\",\n                f\"Assigned: {GH_LOGIN_TO_SLACK[pr['assignee']['login']] if pr['assignee'] else '\u26a0\ufe0f None'}\",\n                f\"{', '.join(LABEL_EMOJI.get(label['name'], '') + label['name'] for label in pr['labels'])}\\n\\n\",\n            ]\n        )\n\n    send_slack_message(message)\n", "path": "scripts/pr_slack_digest.py"}]}