prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Deal with update.sh
  update.sh is out of date. We can either
  - remove it
  - update it
  - replace it with something else
  
  having a script would be pretty cool to document what needs to be done when updating a production server.
  
  maybe this can go into a management command.
  
  an idea for additional automation would be a git post-commit-hook that checks out the release branch and updates everything when someone pushes to the production server via ssh. logs of the update could be sent via email to the admins.
  
  Deal with update.sh
  update.sh is out of date. We can either
  - remove it
  - update it
  - replace it with something else
  
  having a script would be pretty cool to document what needs to be done when updating a production server.
  
  maybe this can go into a management command.
  
  an idea for additional automation would be a git post-commit-hook that checks out the release branch and updates everything when someone pushes to the production server via ssh. logs of the update could be sent via email to the admins.
  
  
  </issue>
  <code>
  [start of evap/evaluation/management/commands/refresh_results_cache.py]
  1 from django.core.management.base import BaseCommand
  2 from django.core.cache import cache
  3 
  4 from evap.evaluation.models import Course
  5 from evap.evaluation.tools import calculate_results
  6 
  7 
  8 class Command(BaseCommand):
  9     args = ''
  10     help = 'Clears the cache and pre-warms it with the results of all courses'
  11 
  12     def handle(self, *args, **options):
  13         self.stdout.write("Clearing cache...")
  14         cache.clear()
  15 
  16         self.stdout.write("Calculating results for all courses...")
  17         for course in Course.objects.all():
  18             calculate_results(course)
  19 
  20         self.stdout.write("Done with updating cache.")
  21
  [end of evap/evaluation/management/commands/refresh_results_cache.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/evap/evaluation/management/commands/refresh_results_cache.py b/evap/evaluation/management/commands/refresh_results_cache.py
  --- a/evap/evaluation/management/commands/refresh_results_cache.py
  +++ b/evap/evaluation/management/commands/refresh_results_cache.py
  @@ -1,4 +1,5 @@
   from django.core.management.base import BaseCommand
  +from django.core.serializers.base import ProgressBar
   from django.core.cache import cache
   
   from evap.evaluation.models import Course
  @@ -12,9 +13,15 @@
       def handle(self, *args, **options):
           self.stdout.write("Clearing cache...")
           cache.clear()
  +        total_count = Course.objects.count()
   
           self.stdout.write("Calculating results for all courses...")
  -        for course in Course.objects.all():
  +
  +        self.stdout.ending = None
  +        progress_bar = ProgressBar(self.stdout, total_count)
  +
  +        for counter, course in enumerate(Course.objects.all()):
  +            progress_bar.update(counter + 1)
               calculate_results(course)
   
  -        self.stdout.write("Done with updating cache.")
  +        self.stdout.write("Done with updating cache.\n")
  
verification_info: {"golden_diff": "diff --git a/evap/evaluation/management/commands/refresh_results_cache.py b/evap/evaluation/management/commands/refresh_results_cache.py\n--- a/evap/evaluation/management/commands/refresh_results_cache.py\n+++ b/evap/evaluation/management/commands/refresh_results_cache.py\n@@ -1,4 +1,5 @@\n from django.core.management.base import BaseCommand\n+from django.core.serializers.base import ProgressBar\n from django.core.cache import cache\n \n from evap.evaluation.models import Course\n@@ -12,9 +13,15 @@\n     def handle(self, *args, **options):\n         self.stdout.write(\"Clearing cache...\")\n         cache.clear()\n+        total_count = Course.objects.count()\n \n         self.stdout.write(\"Calculating results for all courses...\")\n-        for course in Course.objects.all():\n+\n+        self.stdout.ending = None\n+        progress_bar = ProgressBar(self.stdout, total_count)\n+\n+        for counter, course in enumerate(Course.objects.all()):\n+            progress_bar.update(counter + 1)\n             calculate_results(course)\n \n-        self.stdout.write(\"Done with updating cache.\")\n+        self.stdout.write(\"Done with updating cache.\\n\")\n", "issue": "Deal with update.sh\nupdate.sh is out of date. We can either\n- remove it\n- update it\n- replace it with something else\n\nhaving a script would be pretty cool to document what needs to be done when updating a production server.\n\nmaybe this can go into a management command.\n\nan idea for additional automation would be a git post-commit-hook that checks out the release branch and updates everything when someone pushes to the production server via ssh. logs of the update could be sent via email to the admins.\n\nDeal with update.sh\nupdate.sh is out of date. We can either\n- remove it\n- update it\n- replace it with something else\n\nhaving a script would be pretty cool to document what needs to be done when updating a production server.\n\nmaybe this can go into a management command.\n\nan idea for additional automation would be a git post-commit-hook that checks out the release branch and updates everything when someone pushes to the production server via ssh. logs of the update could be sent via email to the admins.\n\n", "before_files": [{"content": "from django.core.management.base import BaseCommand\nfrom django.core.cache import cache\n\nfrom evap.evaluation.models import Course\nfrom evap.evaluation.tools import calculate_results\n\n\nclass Command(BaseCommand):\n    args = ''\n    help = 'Clears the cache and pre-warms it with the results of all courses'\n\n    def handle(self, *args, **options):\n        self.stdout.write(\"Clearing cache...\")\n        cache.clear()\n\n        self.stdout.write(\"Calculating results for all courses...\")\n        for course in Course.objects.all():\n            calculate_results(course)\n\n        self.stdout.write(\"Done with updating cache.\")\n", "path": "evap/evaluation/management/commands/refresh_results_cache.py"}]}