prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  no documentation for trialHandler.data.addDataType
  The TrialHandler.py demo uses the function addDataType:
  
  ```
  trials.data.addDataType('choice')  # this will help store things with the stimuli
  trials.data.addDataType('RT')  # add as many types as you like
  ```
  
  But I haven't been able to find any documentation for addDataType in the psychopy.data page (http://www.psychopy.org/api/data.html).  (I'd like to know what it does)
  
  </issue>
  <code>
  [start of psychopy/demos/coder/experiment control/TrialHandler.py]
  1 #!/usr/bin/env python
  2 # -*- coding: utf-8 -*-
  3 
  4 """
  5 Demo of TrialHandler
  6 """
  7 
  8 from __future__ import division
  9 from __future__ import print_function
  10 
  11 from builtins import range
  12 from random import random
  13 from psychopy import data
  14 
  15 # create your list of stimuli
  16 # NB as of version 1.62 you could simply import an excel spreadsheet with this
  17 # using data.importConditions('someFile.xlsx')
  18 stimList = []
  19 for ori in range(90, 180, 30):
  20     for sf in [0.5, 1.0, 2.0]:
  21         # append a python 'dictionary' to the list
  22         stimList.append({'sf':sf, 'ori':ori})
  23 
  24 # organize them with the trial handler
  25 trials = data.TrialHandler(stimList, 10, extraInfo= {'participant':"Nobody", 'session':1})
  26 trials.data.addDataType('choice')  # this will help store things with the stimuli
  27 trials.data.addDataType('RT')  # add as many types as you like
  28 
  29 # run the experiment
  30 nDone = 0
  31 for thisTrial in trials:  # handler can act like a for loop
  32     # simulate some data
  33     thisReactionTime = random() + float(thisTrial['sf']) / 2.0
  34     thisChoice = round(random())
  35     trials.data.add('RT', thisReactionTime)  # add the data to our set
  36     trials.data.add('choice', thisChoice)
  37     nDone += 1  # just for a quick reference
  38 
  39     msg = 'trial %i had position %s in the list (sf=%.1f)'
  40     print(msg % (nDone, trials.thisIndex, thisTrial['sf']))
  41 
  42 # after the experiment
  43 print('\n')
  44 trials.printAsText(stimOut=['sf', 'ori'],  # write summary data to screen
  45                   dataOut=['RT_mean', 'RT_std', 'choice_raw'])
  46 trials.saveAsText(fileName='testData',  # also write summary data to a text file
  47                   stimOut=['sf', 'ori'],
  48                   dataOut=['RT_mean', 'RT_std', 'choice_raw'])
  49 trials.saveAsExcel(fileName='testData',  # ...or an xlsx file (which supports sheets)
  50                   sheetName = 'rawData',
  51                   stimOut=['sf', 'ori'],
  52                   dataOut=['RT_mean', 'RT_std', 'choice_raw'])
  53 trials.saveAsPickle(fileName = 'testData')  # this saves a copy of the whole object
  54 df = trials.saveAsWideText("testDataWide.txt")  # wide is useful for analysis with R or SPSS. Also returns dataframe df
  55 
  56 # The contents of this file are in the public domain.
  57
  [end of psychopy/demos/coder/experiment control/TrialHandler.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/experiment control/TrialHandler.py b/psychopy/demos/coder/experiment control/TrialHandler.py
  --- a/psychopy/demos/coder/experiment control/TrialHandler.py	
  +++ b/psychopy/demos/coder/experiment control/TrialHandler.py	
  @@ -3,6 +3,9 @@
   
   """
   Demo of TrialHandler
  +
  +The contents of this file are in the public domain.
  +
   """
   
   from __future__ import division
  @@ -10,6 +13,7 @@
   
   from builtins import range
   from random import random
  +
   from psychopy import data
   
   # create your list of stimuli
  @@ -19,12 +23,11 @@
   for ori in range(90, 180, 30):
       for sf in [0.5, 1.0, 2.0]:
           # append a python 'dictionary' to the list
  -        stimList.append({'sf':sf, 'ori':ori})
  +        stimList.append({'sf': sf, 'ori': ori})
   
   # organize them with the trial handler
  -trials = data.TrialHandler(stimList, 10, extraInfo= {'participant':"Nobody", 'session':1})
  -trials.data.addDataType('choice')  # this will help store things with the stimuli
  -trials.data.addDataType('RT')  # add as many types as you like
  +trials = data.TrialHandler(stimList, 10,
  +                           extraInfo={'participant': "Nobody", 'session': 1})
   
   # run the experiment
   nDone = 0
  @@ -39,18 +42,27 @@
       msg = 'trial %i had position %s in the list (sf=%.1f)'
       print(msg % (nDone, trials.thisIndex, thisTrial['sf']))
   
  -# after the experiment
  +# After the experiment, print a new line
   print('\n')
  -trials.printAsText(stimOut=['sf', 'ori'],  # write summary data to screen
  -                  dataOut=['RT_mean', 'RT_std', 'choice_raw'])
  -trials.saveAsText(fileName='testData',  # also write summary data to a text file
  -                  stimOut=['sf', 'ori'],
  -                  dataOut=['RT_mean', 'RT_std', 'choice_raw'])
  -trials.saveAsExcel(fileName='testData',  # ...or an xlsx file (which supports sheets)
  -                  sheetName = 'rawData',
  +
  +# Write summary data to screen
  +trials.printAsText(stimOut=['sf', 'ori'],
  +                   dataOut=['RT_mean', 'RT_std', 'choice_raw'])
  +
  +# Write summary data to a text file ...
  +trials.saveAsText(fileName='testData',
                     stimOut=['sf', 'ori'],
                     dataOut=['RT_mean', 'RT_std', 'choice_raw'])
  -trials.saveAsPickle(fileName = 'testData')  # this saves a copy of the whole object
  -df = trials.saveAsWideText("testDataWide.txt")  # wide is useful for analysis with R or SPSS. Also returns dataframe df
   
  -# The contents of this file are in the public domain.
  +# ... or an xlsx file (which supports sheets)
  +trials.saveAsExcel(fileName='testData',
  +                   sheetName='rawData',
  +                   stimOut=['sf', 'ori'],
  +                   dataOut=['RT_mean', 'RT_std', 'choice_raw'])
  +
  +# Save a copy of the whole TrialHandler object, which can be reloaded later to
  +# re-create the experiment.
  +trials.saveAsPickle(fileName='testData')
  +
  +# Wide format is useful for analysis with R or SPSS.
  +df = trials.saveAsWideText('testDataWide.txt')
  
verification_info: {"golden_diff": "diff --git a/psychopy/demos/coder/experiment control/TrialHandler.py b/psychopy/demos/coder/experiment control/TrialHandler.py\n--- a/psychopy/demos/coder/experiment control/TrialHandler.py\t\n+++ b/psychopy/demos/coder/experiment control/TrialHandler.py\t\n@@ -3,6 +3,9 @@\n \n \"\"\"\n Demo of TrialHandler\n+\n+The contents of this file are in the public domain.\n+\n \"\"\"\n \n from __future__ import division\n@@ -10,6 +13,7 @@\n \n from builtins import range\n from random import random\n+\n from psychopy import data\n \n # create your list of stimuli\n@@ -19,12 +23,11 @@\n for ori in range(90, 180, 30):\n     for sf in [0.5, 1.0, 2.0]:\n         # append a python 'dictionary' to the list\n-        stimList.append({'sf':sf, 'ori':ori})\n+        stimList.append({'sf': sf, 'ori': ori})\n \n # organize them with the trial handler\n-trials = data.TrialHandler(stimList, 10, extraInfo= {'participant':\"Nobody\", 'session':1})\n-trials.data.addDataType('choice')  # this will help store things with the stimuli\n-trials.data.addDataType('RT')  # add as many types as you like\n+trials = data.TrialHandler(stimList, 10,\n+                           extraInfo={'participant': \"Nobody\", 'session': 1})\n \n # run the experiment\n nDone = 0\n@@ -39,18 +42,27 @@\n     msg = 'trial %i had position %s in the list (sf=%.1f)'\n     print(msg % (nDone, trials.thisIndex, thisTrial['sf']))\n \n-# after the experiment\n+# After the experiment, print a new line\n print('\\n')\n-trials.printAsText(stimOut=['sf', 'ori'],  # write summary data to screen\n-                  dataOut=['RT_mean', 'RT_std', 'choice_raw'])\n-trials.saveAsText(fileName='testData',  # also write summary data to a text file\n-                  stimOut=['sf', 'ori'],\n-                  dataOut=['RT_mean', 'RT_std', 'choice_raw'])\n-trials.saveAsExcel(fileName='testData',  # ...or an xlsx file (which supports sheets)\n-                  sheetName = 'rawData',\n+\n+# Write summary data to screen\n+trials.printAsText(stimOut=['sf', 'ori'],\n+                   dataOut=['RT_mean', 'RT_std', 'choice_raw'])\n+\n+# Write summary data to a text file ...\n+trials.saveAsText(fileName='testData',\n                   stimOut=['sf', 'ori'],\n                   dataOut=['RT_mean', 'RT_std', 'choice_raw'])\n-trials.saveAsPickle(fileName = 'testData')  # this saves a copy of the whole object\n-df = trials.saveAsWideText(\"testDataWide.txt\")  # wide is useful for analysis with R or SPSS. Also returns dataframe df\n \n-# The contents of this file are in the public domain.\n+# ... or an xlsx file (which supports sheets)\n+trials.saveAsExcel(fileName='testData',\n+                   sheetName='rawData',\n+                   stimOut=['sf', 'ori'],\n+                   dataOut=['RT_mean', 'RT_std', 'choice_raw'])\n+\n+# Save a copy of the whole TrialHandler object, which can be reloaded later to\n+# re-create the experiment.\n+trials.saveAsPickle(fileName='testData')\n+\n+# Wide format is useful for analysis with R or SPSS.\n+df = trials.saveAsWideText('testDataWide.txt')\n", "issue": "no documentation for trialHandler.data.addDataType\nThe TrialHandler.py demo uses the function addDataType:\r\n\r\n```\r\ntrials.data.addDataType('choice')  # this will help store things with the stimuli\r\ntrials.data.addDataType('RT')  # add as many types as you like\r\n```\r\n\r\nBut I haven't been able to find any documentation for addDataType in the psychopy.data page (http://www.psychopy.org/api/data.html).  (I'd like to know what it does)\n", "before_files": [{"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nDemo of TrialHandler\n\"\"\"\n\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom builtins import range\nfrom random import random\nfrom psychopy import data\n\n# create your list of stimuli\n# NB as of version 1.62 you could simply import an excel spreadsheet with this\n# using data.importConditions('someFile.xlsx')\nstimList = []\nfor ori in range(90, 180, 30):\n    for sf in [0.5, 1.0, 2.0]:\n        # append a python 'dictionary' to the list\n        stimList.append({'sf':sf, 'ori':ori})\n\n# organize them with the trial handler\ntrials = data.TrialHandler(stimList, 10, extraInfo= {'participant':\"Nobody\", 'session':1})\ntrials.data.addDataType('choice')  # this will help store things with the stimuli\ntrials.data.addDataType('RT')  # add as many types as you like\n\n# run the experiment\nnDone = 0\nfor thisTrial in trials:  # handler can act like a for loop\n    # simulate some data\n    thisReactionTime = random() + float(thisTrial['sf']) / 2.0\n    thisChoice = round(random())\n    trials.data.add('RT', thisReactionTime)  # add the data to our set\n    trials.data.add('choice', thisChoice)\n    nDone += 1  # just for a quick reference\n\n    msg = 'trial %i had position %s in the list (sf=%.1f)'\n    print(msg % (nDone, trials.thisIndex, thisTrial['sf']))\n\n# after the experiment\nprint('\\n')\ntrials.printAsText(stimOut=['sf', 'ori'],  # write summary data to screen\n                  dataOut=['RT_mean', 'RT_std', 'choice_raw'])\ntrials.saveAsText(fileName='testData',  # also write summary data to a text file\n                  stimOut=['sf', 'ori'],\n                  dataOut=['RT_mean', 'RT_std', 'choice_raw'])\ntrials.saveAsExcel(fileName='testData',  # ...or an xlsx file (which supports sheets)\n                  sheetName = 'rawData',\n                  stimOut=['sf', 'ori'],\n                  dataOut=['RT_mean', 'RT_std', 'choice_raw'])\ntrials.saveAsPickle(fileName = 'testData')  # this saves a copy of the whole object\ndf = trials.saveAsWideText(\"testDataWide.txt\")  # wide is useful for analysis with R or SPSS. Also returns dataframe df\n\n# The contents of this file are in the public domain.\n", "path": "psychopy/demos/coder/experiment control/TrialHandler.py"}]}