prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Changing the default branch to `main`
  This is just a heads up, I'm planning to change the default branch on this repo to `main` this week, let's say Wednesday 26th. Github have a tool to change it over, and update PRs to target the new branch, but you might have to update it on local checkouts and forks. Shouldn't be a big issue though, this is what [Github say](https://github.com/github/renaming#renaming-existing-branches) about it:
  
  > Renaming a branch will:
  > 
  > - Re-target any open pull requests
  > - Update any draft releases based on the branch
  > - Move any branch protection rules that explicitly reference the old name
  > - Update the branch used to build GitHub Pages, if applicable
  > - Show a notice to repository contributors, maintainers, and admins on the repository homepage with instructions to update local copies of the repository
  > - Show a notice to contributors who git push to the old branch
  > - Redirect web requests for the old branch name to the new branch name
  > - Return a "Moved Permanently" response in API requests for the old branch name
  
  ---
  
  Checklist for the switch:
  
  - [x] Use the Github tool to change it over
  - [x] Find/replace `master` to `main` in CI configs, docs, scripts, example code, etc
  - [x] Change default branch on Readthedocs
  
  
  </issue>
  <code>
  [start of bin/make_dependency_update_pr.py]
  1 #!/usr/bin/env python3
  2 
  3 from __future__ import annotations
  4 
  5 import os
  6 import sys
  7 import textwrap
  8 import time
  9 from pathlib import Path
  10 from subprocess import run
  11 
  12 import click
  13 
  14 
  15 def shell(cmd, **kwargs):
  16     return run([cmd], shell=True, **kwargs)
  17 
  18 
  19 def git_repo_has_changes():
  20     unstaged_changes = shell("git diff-index --quiet HEAD --").returncode != 0
  21     staged_changes = shell("git diff-index --quiet --cached HEAD --").returncode != 0
  22     return unstaged_changes or staged_changes
  23 
  24 
  25 @click.command()
  26 def main():
  27     project_root = Path(__file__).parent / ".."
  28     os.chdir(project_root)
  29 
  30     if git_repo_has_changes():
  31         print("Your git repo has uncommitted changes. Commit or stash before continuing.")
  32         sys.exit(1)
  33 
  34     previous_branch = shell(
  35         "git rev-parse --abbrev-ref HEAD", check=True, capture_output=True, encoding="utf8"
  36     ).stdout.strip()
  37 
  38     shell("git fetch origin", check=True)
  39 
  40     timestamp = time.strftime("%Y-%m-%dT%H-%M-%S", time.gmtime())
  41     branch_name = f"update-constraints-{timestamp}"
  42 
  43     shell(f"git checkout -b {branch_name} origin/master", check=True)
  44 
  45     try:
  46         shell("bin/update_dependencies.py", check=True)
  47 
  48         if not git_repo_has_changes():
  49             print("Done: no constraint updates required.")
  50             return
  51 
  52         shell('git commit -a -m "Update dependencies"', check=True)
  53         body = textwrap.dedent(
  54             f"""
  55             Update the versions of our dependencies.
  56 
  57             PR generated by `{os.path.basename(__file__)}`.
  58             """
  59         )
  60         run(
  61             [
  62                 "gh",
  63                 "pr",
  64                 "create",
  65                 "--repo=pypa/cibuildwheel",
  66                 "--base=master",
  67                 "--title=Update dependencies",
  68                 f"--body='{body}'",
  69             ],
  70             check=True,
  71         )
  72 
  73         print("Done.")
  74     finally:
  75         # remove any local changes
  76         shell("git checkout -- .")
  77         shell(f"git checkout {previous_branch}", check=True)
  78         shell(f"git branch -D --force {branch_name}", check=True)
  79 
  80 
  81 if __name__ == "__main__":
  82     main.main(standalone_mode=True)
  83
  [end of bin/make_dependency_update_pr.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/bin/make_dependency_update_pr.py b/bin/make_dependency_update_pr.py
  --- a/bin/make_dependency_update_pr.py
  +++ b/bin/make_dependency_update_pr.py
  @@ -40,7 +40,7 @@
       timestamp = time.strftime("%Y-%m-%dT%H-%M-%S", time.gmtime())
       branch_name = f"update-constraints-{timestamp}"
   
  -    shell(f"git checkout -b {branch_name} origin/master", check=True)
  +    shell(f"git checkout -b {branch_name} origin/main", check=True)
   
       try:
           shell("bin/update_dependencies.py", check=True)
  @@ -63,7 +63,7 @@
                   "pr",
                   "create",
                   "--repo=pypa/cibuildwheel",
  -                "--base=master",
  +                "--base=main",
                   "--title=Update dependencies",
                   f"--body='{body}'",
               ],
  
verification_info: {"golden_diff": "diff --git a/bin/make_dependency_update_pr.py b/bin/make_dependency_update_pr.py\n--- a/bin/make_dependency_update_pr.py\n+++ b/bin/make_dependency_update_pr.py\n@@ -40,7 +40,7 @@\n     timestamp = time.strftime(\"%Y-%m-%dT%H-%M-%S\", time.gmtime())\n     branch_name = f\"update-constraints-{timestamp}\"\n \n-    shell(f\"git checkout -b {branch_name} origin/master\", check=True)\n+    shell(f\"git checkout -b {branch_name} origin/main\", check=True)\n \n     try:\n         shell(\"bin/update_dependencies.py\", check=True)\n@@ -63,7 +63,7 @@\n                 \"pr\",\n                 \"create\",\n                 \"--repo=pypa/cibuildwheel\",\n-                \"--base=master\",\n+                \"--base=main\",\n                 \"--title=Update dependencies\",\n                 f\"--body='{body}'\",\n             ],\n", "issue": "Changing the default branch to `main`\nThis is just a heads up, I'm planning to change the default branch on this repo to `main` this week, let's say Wednesday 26th. Github have a tool to change it over, and update PRs to target the new branch, but you might have to update it on local checkouts and forks. Shouldn't be a big issue though, this is what [Github say](https://github.com/github/renaming#renaming-existing-branches) about it:\r\n\r\n> Renaming a branch will:\r\n> \r\n> - Re-target any open pull requests\r\n> - Update any draft releases based on the branch\r\n> - Move any branch protection rules that explicitly reference the old name\r\n> - Update the branch used to build GitHub Pages, if applicable\r\n> - Show a notice to repository contributors, maintainers, and admins on the repository homepage with instructions to update local copies of the repository\r\n> - Show a notice to contributors who git push to the old branch\r\n> - Redirect web requests for the old branch name to the new branch name\r\n> - Return a \"Moved Permanently\" response in API requests for the old branch name\r\n\r\n---\r\n\r\nChecklist for the switch:\r\n\r\n- [x] Use the Github tool to change it over\r\n- [x] Find/replace `master` to `main` in CI configs, docs, scripts, example code, etc\r\n- [x] Change default branch on Readthedocs\r\n\n", "before_files": [{"content": "#!/usr/bin/env python3\n\nfrom __future__ import annotations\n\nimport os\nimport sys\nimport textwrap\nimport time\nfrom pathlib import Path\nfrom subprocess import run\n\nimport click\n\n\ndef shell(cmd, **kwargs):\n    return run([cmd], shell=True, **kwargs)\n\n\ndef git_repo_has_changes():\n    unstaged_changes = shell(\"git diff-index --quiet HEAD --\").returncode != 0\n    staged_changes = shell(\"git diff-index --quiet --cached HEAD --\").returncode != 0\n    return unstaged_changes or staged_changes\n\n\n@click.command()\ndef main():\n    project_root = Path(__file__).parent / \"..\"\n    os.chdir(project_root)\n\n    if git_repo_has_changes():\n        print(\"Your git repo has uncommitted changes. Commit or stash before continuing.\")\n        sys.exit(1)\n\n    previous_branch = shell(\n        \"git rev-parse --abbrev-ref HEAD\", check=True, capture_output=True, encoding=\"utf8\"\n    ).stdout.strip()\n\n    shell(\"git fetch origin\", check=True)\n\n    timestamp = time.strftime(\"%Y-%m-%dT%H-%M-%S\", time.gmtime())\n    branch_name = f\"update-constraints-{timestamp}\"\n\n    shell(f\"git checkout -b {branch_name} origin/master\", check=True)\n\n    try:\n        shell(\"bin/update_dependencies.py\", check=True)\n\n        if not git_repo_has_changes():\n            print(\"Done: no constraint updates required.\")\n            return\n\n        shell('git commit -a -m \"Update dependencies\"', check=True)\n        body = textwrap.dedent(\n            f\"\"\"\n            Update the versions of our dependencies.\n\n            PR generated by `{os.path.basename(__file__)}`.\n            \"\"\"\n        )\n        run(\n            [\n                \"gh\",\n                \"pr\",\n                \"create\",\n                \"--repo=pypa/cibuildwheel\",\n                \"--base=master\",\n                \"--title=Update dependencies\",\n                f\"--body='{body}'\",\n            ],\n            check=True,\n        )\n\n        print(\"Done.\")\n    finally:\n        # remove any local changes\n        shell(\"git checkout -- .\")\n        shell(f\"git checkout {previous_branch}\", check=True)\n        shell(f\"git branch -D --force {branch_name}\", check=True)\n\n\nif __name__ == \"__main__\":\n    main.main(standalone_mode=True)\n", "path": "bin/make_dependency_update_pr.py"}]}