prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  feature request: develop a pylint rule-set
  pylint is a code analysis tool, and will err of the side of being super duper ultra nitpicky (which is great). You just then turn some things off to see the signal in the noise. For example, I've been bitten by mutable default values to a method / function, and it will catch this. It flags bare excepts -- lots of useful stuff.
  
  If anyone has experience with pylint, it would be great to have advice on what works well, and what is likely to work well for PsychoPy given its history and current conventions. If its counterproductive to start using pylint with a codebase this large, that would be helpful to know.
  
  I'm thinking that even if its never run as part of the build process, it might be nice to have a project-wide pylintrc file that makes explicit what style conventions are expected (long lines ok, variable name conventions, etc). This seems like a powerful way to communicate the conventions. 
  
  PsychoPy currently has lots of bare excepts, bad indentations, unused variables, redefined builtins, unused imports, and so on -- seemingly all good targets for clean-up work.
  
  
  </issue>
  <code>
  [start of psychopy/misc.py]
  1 #!/usr/bin/env python2
  2 
  3 # Part of the PsychoPy library
  4 # Copyright (C) 2014 Jonathan Peirce
  5 # Distributed under the terms of the GNU General Public License (GPL).
  6 
  7 '''Wrapper for all miscellaneous functions and classes from psychopy.tools'''
  8 
  9 from psychopy.tools.arraytools import (createXYs, extendArr, makeRadialMatrix,
  10                                        ratioRange, shuffleArray, val2array)
  11 
  12 from psychopy.tools.attributetools import attributeSetter, setWithOperation
  13 
  14 from psychopy.tools.colorspacetools import (dkl2rgb, dklCart2rgb,
  15                                             hsv2rgb, lms2rgb,
  16                                             rgb2dklCart, rgb2lms)
  17 
  18 from psychopy.tools.coordinatetools import (cart2pol, pol2cart,
  19                                             cart2sph, sph2cart)
  20 
  21 from psychopy.tools.fileerrortools import handleFileCollision
  22 
  23 from psychopy.tools.filetools import toFile, fromFile, mergeFolder
  24 
  25 from psychopy.tools.imagetools import array2image, image2array, makeImageAuto
  26 
  27 from psychopy.tools.monitorunittools import (cm2deg, deg2cm, cm2pix, pix2cm,
  28                                              deg2pix, pix2deg, convertToPix)
  29 
  30 from psychopy.tools.plottools import plotFrameIntervals
  31 
  32 from psychopy.tools.typetools import float_uint8, float_uint16, uint8_float
  33 
  34 from numpy import radians, degrees
  35
  [end of psychopy/misc.py]
  [start of psychopy/tools/unittools.py]
  1 #!/usr/bin/env python2
  2 
  3 # Part of the PsychoPy library
  4 # Copyright (C) 2014 Jonathan Peirce
  5 # Distributed under the terms of the GNU General Public License (GPL).
  6 
  7 '''Functions and classes related to unit conversion'''
  8 
  9 # This module is not used by psychopy; retained for backwards compatibility
  10 # for user-scripts.
  11 
  12 from numpy import radians, degrees
  13
  [end of psychopy/tools/unittools.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/psychopy/misc.py b/psychopy/misc.py
  --- a/psychopy/misc.py
  +++ b/psychopy/misc.py
  @@ -6,6 +6,9 @@
   
   '''Wrapper for all miscellaneous functions and classes from psychopy.tools'''
   
  +# pylint: disable=W0611
  +# W0611 = Unused import %s
  +
   from psychopy.tools.arraytools import (createXYs, extendArr, makeRadialMatrix,
                                          ratioRange, shuffleArray, val2array)
   
  diff --git a/psychopy/tools/unittools.py b/psychopy/tools/unittools.py
  --- a/psychopy/tools/unittools.py
  +++ b/psychopy/tools/unittools.py
  @@ -9,4 +9,7 @@
   # This module is not used by psychopy; retained for backwards compatibility
   # for user-scripts.
   
  +# pylint: disable=W0611
  +# W0611 = Unused import %s
  +
   from numpy import radians, degrees
  
verification_info: {"golden_diff": "diff --git a/psychopy/misc.py b/psychopy/misc.py\n--- a/psychopy/misc.py\n+++ b/psychopy/misc.py\n@@ -6,6 +6,9 @@\n \n '''Wrapper for all miscellaneous functions and classes from psychopy.tools'''\n \n+# pylint: disable=W0611\n+# W0611 = Unused import %s\n+\n from psychopy.tools.arraytools import (createXYs, extendArr, makeRadialMatrix,\n                                        ratioRange, shuffleArray, val2array)\n \ndiff --git a/psychopy/tools/unittools.py b/psychopy/tools/unittools.py\n--- a/psychopy/tools/unittools.py\n+++ b/psychopy/tools/unittools.py\n@@ -9,4 +9,7 @@\n # This module is not used by psychopy; retained for backwards compatibility\n # for user-scripts.\n \n+# pylint: disable=W0611\n+# W0611 = Unused import %s\n+\n from numpy import radians, degrees\n", "issue": "feature request: develop a pylint rule-set\npylint is a code analysis tool, and will err of the side of being super duper ultra nitpicky (which is great). You just then turn some things off to see the signal in the noise. For example, I've been bitten by mutable default values to a method / function, and it will catch this. It flags bare excepts -- lots of useful stuff.\n\nIf anyone has experience with pylint, it would be great to have advice on what works well, and what is likely to work well for PsychoPy given its history and current conventions. If its counterproductive to start using pylint with a codebase this large, that would be helpful to know.\n\nI'm thinking that even if its never run as part of the build process, it might be nice to have a project-wide pylintrc file that makes explicit what style conventions are expected (long lines ok, variable name conventions, etc). This seems like a powerful way to communicate the conventions. \n\nPsychoPy currently has lots of bare excepts, bad indentations, unused variables, redefined builtins, unused imports, and so on -- seemingly all good targets for clean-up work.\n\n", "before_files": [{"content": "#!/usr/bin/env python2\n\n# Part of the PsychoPy library\n# Copyright (C) 2014 Jonathan Peirce\n# Distributed under the terms of the GNU General Public License (GPL).\n\n'''Wrapper for all miscellaneous functions and classes from psychopy.tools'''\n\nfrom psychopy.tools.arraytools import (createXYs, extendArr, makeRadialMatrix,\n                                       ratioRange, shuffleArray, val2array)\n\nfrom psychopy.tools.attributetools import attributeSetter, setWithOperation\n\nfrom psychopy.tools.colorspacetools import (dkl2rgb, dklCart2rgb,\n                                            hsv2rgb, lms2rgb,\n                                            rgb2dklCart, rgb2lms)\n\nfrom psychopy.tools.coordinatetools import (cart2pol, pol2cart,\n                                            cart2sph, sph2cart)\n\nfrom psychopy.tools.fileerrortools import handleFileCollision\n\nfrom psychopy.tools.filetools import toFile, fromFile, mergeFolder\n\nfrom psychopy.tools.imagetools import array2image, image2array, makeImageAuto\n\nfrom psychopy.tools.monitorunittools import (cm2deg, deg2cm, cm2pix, pix2cm,\n                                             deg2pix, pix2deg, convertToPix)\n\nfrom psychopy.tools.plottools import plotFrameIntervals\n\nfrom psychopy.tools.typetools import float_uint8, float_uint16, uint8_float\n\nfrom numpy import radians, degrees\n", "path": "psychopy/misc.py"}, {"content": "#!/usr/bin/env python2\n\n# Part of the PsychoPy library\n# Copyright (C) 2014 Jonathan Peirce\n# Distributed under the terms of the GNU General Public License (GPL).\n\n'''Functions and classes related to unit conversion'''\n\n# This module is not used by psychopy; retained for backwards compatibility\n# for user-scripts.\n\nfrom numpy import radians, degrees\n", "path": "psychopy/tools/unittools.py"}]}