prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Pyvisa no longer support ask, replace with query
  In resources.py
  `idn = res.ask('*idn?')[:-1]`
  Should be:
  `idn = res.query('*idn?')[:-1]`
  
  </issue>
  <code>
  [start of pymeasure/instruments/resources.py]
  1 #
  2 # This file is part of the PyMeasure package.
  3 #
  4 # Copyright (c) 2013-2021 PyMeasure Developers
  5 #
  6 # Permission is hereby granted, free of charge, to any person obtaining a copy
  7 # of this software and associated documentation files (the "Software"), to deal
  8 # in the Software without restriction, including without limitation the rights
  9 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10 # copies of the Software, and to permit persons to whom the Software is
  11 # furnished to do so, subject to the following conditions:
  12 #
  13 # The above copyright notice and this permission notice shall be included in
  14 # all copies or substantial portions of the Software.
  15 #
  16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22 # THE SOFTWARE.
  23 #
  24 
  25 import pyvisa
  26 
  27 
  28 def list_resources():
  29     """
  30     Prints the available resources, and returns a list of VISA resource names
  31     
  32     .. code-block:: python
  33 
  34         resources = list_resources()
  35         #prints (e.g.)
  36             #0 : GPIB0::22::INSTR : Agilent Technologies,34410A,******
  37             #1 : GPIB0::26::INSTR : Keithley Instruments Inc., Model 2612, *****
  38         dmm = Agilent34410(resources[0])
  39     
  40     """
  41     rm = pyvisa.ResourceManager()
  42     instrs = rm.list_resources()
  43     for n, instr in enumerate(instrs):
  44         # trying to catch errors in comunication
  45         try:
  46             res = rm.open_resource(instr)
  47             # try to avoid errors from *idn?
  48             try:
  49                 # noinspection PyUnresolvedReferences
  50                 idn = res.ask('*idn?')[:-1]
  51             except pyvisa.Error:
  52                 idn = "Not known"
  53             finally:
  54                 res.close()
  55                 print(n, ":", instr, ":", idn)
  56         except pyvisa.VisaIOError as e:
  57             print(n, ":", instr, ":", "Visa IO Error: check connections")
  58             print(e)
  59     rm.close()
  60     return instrs
  61
  [end of pymeasure/instruments/resources.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/pymeasure/instruments/resources.py b/pymeasure/instruments/resources.py
  --- a/pymeasure/instruments/resources.py
  +++ b/pymeasure/instruments/resources.py
  @@ -47,7 +47,7 @@
               # try to avoid errors from *idn?
               try:
                   # noinspection PyUnresolvedReferences
  -                idn = res.ask('*idn?')[:-1]
  +                idn = res.query('*idn?')[:-1]
               except pyvisa.Error:
                   idn = "Not known"
               finally:
  
verification_info: {"golden_diff": "diff --git a/pymeasure/instruments/resources.py b/pymeasure/instruments/resources.py\n--- a/pymeasure/instruments/resources.py\n+++ b/pymeasure/instruments/resources.py\n@@ -47,7 +47,7 @@\n             # try to avoid errors from *idn?\n             try:\n                 # noinspection PyUnresolvedReferences\n-                idn = res.ask('*idn?')[:-1]\n+                idn = res.query('*idn?')[:-1]\n             except pyvisa.Error:\n                 idn = \"Not known\"\n             finally:\n", "issue": "Pyvisa no longer support ask, replace with query\nIn resources.py\r\n`idn = res.ask('*idn?')[:-1]`\r\nShould be:\r\n`idn = res.query('*idn?')[:-1]`\n", "before_files": [{"content": "#\n# This file is part of the PyMeasure package.\n#\n# Copyright (c) 2013-2021 PyMeasure Developers\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n#\n\nimport pyvisa\n\n\ndef list_resources():\n    \"\"\"\n    Prints the available resources, and returns a list of VISA resource names\n    \n    .. code-block:: python\n\n        resources = list_resources()\n        #prints (e.g.)\n            #0 : GPIB0::22::INSTR : Agilent Technologies,34410A,******\n            #1 : GPIB0::26::INSTR : Keithley Instruments Inc., Model 2612, *****\n        dmm = Agilent34410(resources[0])\n    \n    \"\"\"\n    rm = pyvisa.ResourceManager()\n    instrs = rm.list_resources()\n    for n, instr in enumerate(instrs):\n        # trying to catch errors in comunication\n        try:\n            res = rm.open_resource(instr)\n            # try to avoid errors from *idn?\n            try:\n                # noinspection PyUnresolvedReferences\n                idn = res.ask('*idn?')[:-1]\n            except pyvisa.Error:\n                idn = \"Not known\"\n            finally:\n                res.close()\n                print(n, \":\", instr, \":\", idn)\n        except pyvisa.VisaIOError as e:\n            print(n, \":\", instr, \":\", \"Visa IO Error: check connections\")\n            print(e)\n    rm.close()\n    return instrs\n", "path": "pymeasure/instruments/resources.py"}]}