prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  PyPy performance on test_image_point is awful
  Hoisted from #476, test_image_point.py takes ~ 2 minutes to run, vs < 1 sec for cpython.
  
  
  </issue>
  <code>
  [start of profile-installed.py]
  1 #!/usr/bin/env python
  2 import nose
  3 import os
  4 import sys
  5 import glob
  6 
  7 import profile
  8 
  9 # monkey with the path, removing the local directory but adding the Tests/
  10 # directory for helper.py and the other local imports there.
  11 
  12 del(sys.path[0])
  13 sys.path.insert(0, os.path.abspath('./Tests'))
  14 
  15 # if there's no test selected (mostly) choose a working default.
  16 # Something is required, because if we import the tests from the local
  17 # directory, once again, we've got the non-installed PIL in the way
  18 if len(sys.argv) == 1:
  19     sys.argv.extend(glob.glob('Tests/test*.py'))
  20 
  21 # Make sure that nose doesn't muck with our paths.
  22 if ('--no-path-adjustment' not in sys.argv) and ('-P' not in sys.argv):
  23     sys.argv.insert(1, '--no-path-adjustment')
  24 
  25 if 'NOSE_PROCESSES' not in os.environ:
  26     for arg in sys.argv:
  27         if '--processes' in arg:
  28             break
  29     else: #  for
  30         sys.argv.insert(1, '--processes=-1') # -1 == number of cores
  31         sys.argv.insert(1, '--process-timeout=30') 
  32     
  33 if __name__ == '__main__':
  34     profile.run("nose.main()", sort=2)
  35
  [end of profile-installed.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/profile-installed.py b/profile-installed.py
  --- a/profile-installed.py
  +++ b/profile-installed.py
  @@ -21,14 +21,6 @@
   # Make sure that nose doesn't muck with our paths.
   if ('--no-path-adjustment' not in sys.argv) and ('-P' not in sys.argv):
       sys.argv.insert(1, '--no-path-adjustment')
  -
  -if 'NOSE_PROCESSES' not in os.environ:
  -    for arg in sys.argv:
  -        if '--processes' in arg:
  -            break
  -    else: #  for
  -        sys.argv.insert(1, '--processes=-1') # -1 == number of cores
  -        sys.argv.insert(1, '--process-timeout=30') 
       
   if __name__ == '__main__':
       profile.run("nose.main()", sort=2)
  
verification_info: {"golden_diff": "diff --git a/profile-installed.py b/profile-installed.py\n--- a/profile-installed.py\n+++ b/profile-installed.py\n@@ -21,14 +21,6 @@\n # Make sure that nose doesn't muck with our paths.\n if ('--no-path-adjustment' not in sys.argv) and ('-P' not in sys.argv):\n     sys.argv.insert(1, '--no-path-adjustment')\n-\n-if 'NOSE_PROCESSES' not in os.environ:\n-    for arg in sys.argv:\n-        if '--processes' in arg:\n-            break\n-    else: #  for\n-        sys.argv.insert(1, '--processes=-1') # -1 == number of cores\n-        sys.argv.insert(1, '--process-timeout=30') \n     \n if __name__ == '__main__':\n     profile.run(\"nose.main()\", sort=2)\n", "issue": "PyPy performance on test_image_point is awful\nHoisted from #476, test_image_point.py takes ~ 2 minutes to run, vs < 1 sec for cpython.\n\n", "before_files": [{"content": "#!/usr/bin/env python\nimport nose\nimport os\nimport sys\nimport glob\n\nimport profile\n\n# monkey with the path, removing the local directory but adding the Tests/\n# directory for helper.py and the other local imports there.\n\ndel(sys.path[0])\nsys.path.insert(0, os.path.abspath('./Tests'))\n\n# if there's no test selected (mostly) choose a working default.\n# Something is required, because if we import the tests from the local\n# directory, once again, we've got the non-installed PIL in the way\nif len(sys.argv) == 1:\n    sys.argv.extend(glob.glob('Tests/test*.py'))\n\n# Make sure that nose doesn't muck with our paths.\nif ('--no-path-adjustment' not in sys.argv) and ('-P' not in sys.argv):\n    sys.argv.insert(1, '--no-path-adjustment')\n\nif 'NOSE_PROCESSES' not in os.environ:\n    for arg in sys.argv:\n        if '--processes' in arg:\n            break\n    else: #  for\n        sys.argv.insert(1, '--processes=-1') # -1 == number of cores\n        sys.argv.insert(1, '--process-timeout=30') \n    \nif __name__ == '__main__':\n    profile.run(\"nose.main()\", sort=2)\n", "path": "profile-installed.py"}]}