prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Demos -> Hardware -> testSoundLatency.py not working in v3.0.6
  Running Demo -> Hardware -> testSoundLatency.py results in the following error message:
  ```
  ##### Running: C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\demos\coder\hardware\testSoundLatency.py #####
  pygame 1.9.4
  Hello from the pygame community. https://www.pygame.org/contribute.html
  Traceback (most recent call last):
    File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\demos\coder\hardware\testSoundLatency.py", line 16, in <module>
      from labjack import u3
  ModuleNotFoundError: No module named 'labjack'
  ```
  Windows 7, 64 bit, PsychoPy 3.0.6 64 bit standalone
  
  </issue>
  <code>
  [start of psychopy/demos/coder/hardware/labjack_u3.py]
  1 #!/usr/bin/env python
  2 # -*- coding: utf-8 -*-
  3 
  4 """
  5 Demo for using labjack DAC devices
  6 
  7 See also
  8     http: //labjack.com/support/labjackpython
  9 but note that the version shipped with standalone PsychoPy
  10 has u3 (and others below an umbrella called labjack) so the import
  11 line is slightly different to the documentation on LabJack's website
  12 """
  13 
  14 from __future__ import absolute_import, division, print_function
  15 
  16 from builtins import range
  17 from psychopy import visual, core, event, sound
  18 from labjack import u3
  19 
  20 # sound.setAudioAPI('pyaudio')
  21 
  22 win = visual.Window([800, 800])
  23 stim = visual.GratingStim(win, color=-1, sf=0)
  24 snd = sound.Sound(880)
  25 print(snd)
  26 # setup labjack U3
  27 ports = u3.U3()
  28 FIO4 = 6004  # the address of line FIO4
  29 
  30 while True:
  31     # do this repeatedly for timing tests
  32     ports.writeRegister(FIO4, 0)  # start low
  33 
  34     # draw black square
  35     stim.draw()
  36     win.flip()
  37 
  38     # wait for a key press
  39     if 'q' in event.waitKeys():
  40         break
  41 
  42     # set to white, flip window and raise level port FIO4
  43     stim.setColor(1)
  44     stim.draw()
  45     win.flip()
  46     ports.writeRegister(FIO4, 1)
  47     snd.play()
  48     for frameN in range(4):
  49         stim.draw()
  50         win.flip()
  51 
  52     # set color back to black and set FIO4 to low again
  53     stim.setColor(-1)
  54     stim.draw()
  55     win.flip()
  56     ports.writeRegister(FIO4, 0)
  57 
  58 win.close()
  59 core.quit()
  60 
  61 # The contents of this file are in the public domain.
  62
  [end of psychopy/demos/coder/hardware/labjack_u3.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/demos/coder/hardware/labjack_u3.py b/psychopy/demos/coder/hardware/labjack_u3.py
  --- a/psychopy/demos/coder/hardware/labjack_u3.py
  +++ b/psychopy/demos/coder/hardware/labjack_u3.py
  @@ -15,7 +15,10 @@
   
   from builtins import range
   from psychopy import visual, core, event, sound
  -from labjack import u3
  +try:
  +    from labjack import u3
  +except ImportError:
  +    import u3
   
   # sound.setAudioAPI('pyaudio')
  
verification_info: {"golden_diff": "diff --git a/psychopy/demos/coder/hardware/labjack_u3.py b/psychopy/demos/coder/hardware/labjack_u3.py\n--- a/psychopy/demos/coder/hardware/labjack_u3.py\n+++ b/psychopy/demos/coder/hardware/labjack_u3.py\n@@ -15,7 +15,10 @@\n \n from builtins import range\n from psychopy import visual, core, event, sound\n-from labjack import u3\n+try:\n+    from labjack import u3\n+except ImportError:\n+    import u3\n \n # sound.setAudioAPI('pyaudio')\n", "issue": "Demos -> Hardware -> testSoundLatency.py not working in v3.0.6\nRunning Demo -> Hardware -> testSoundLatency.py results in the following error message:\r\n```\r\n##### Running: C:\\Program Files (x86)\\PsychoPy3\\lib\\site-packages\\psychopy\\demos\\coder\\hardware\\testSoundLatency.py #####\r\npygame 1.9.4\r\nHello from the pygame community. https://www.pygame.org/contribute.html\r\nTraceback (most recent call last):\r\n  File \"C:\\Program Files (x86)\\PsychoPy3\\lib\\site-packages\\psychopy\\demos\\coder\\hardware\\testSoundLatency.py\", line 16, in <module>\r\n    from labjack import u3\r\nModuleNotFoundError: No module named 'labjack'\r\n```\r\nWindows 7, 64 bit, PsychoPy 3.0.6 64 bit standalone\n", "before_files": [{"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nDemo for using labjack DAC devices\n\nSee also\n    http: //labjack.com/support/labjackpython\nbut note that the version shipped with standalone PsychoPy\nhas u3 (and others below an umbrella called labjack) so the import\nline is slightly different to the documentation on LabJack's website\n\"\"\"\n\nfrom __future__ import absolute_import, division, print_function\n\nfrom builtins import range\nfrom psychopy import visual, core, event, sound\nfrom labjack import u3\n\n# sound.setAudioAPI('pyaudio')\n\nwin = visual.Window([800, 800])\nstim = visual.GratingStim(win, color=-1, sf=0)\nsnd = sound.Sound(880)\nprint(snd)\n# setup labjack U3\nports = u3.U3()\nFIO4 = 6004  # the address of line FIO4\n\nwhile True:\n    # do this repeatedly for timing tests\n    ports.writeRegister(FIO4, 0)  # start low\n\n    # draw black square\n    stim.draw()\n    win.flip()\n\n    # wait for a key press\n    if 'q' in event.waitKeys():\n        break\n\n    # set to white, flip window and raise level port FIO4\n    stim.setColor(1)\n    stim.draw()\n    win.flip()\n    ports.writeRegister(FIO4, 1)\n    snd.play()\n    for frameN in range(4):\n        stim.draw()\n        win.flip()\n\n    # set color back to black and set FIO4 to low again\n    stim.setColor(-1)\n    stim.draw()\n    win.flip()\n    ports.writeRegister(FIO4, 0)\n\nwin.close()\ncore.quit()\n\n# The contents of this file are in the public domain.\n", "path": "psychopy/demos/coder/hardware/labjack_u3.py"}]}