prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  export_csv example under 0.12.7dev11 doesn't resize table
  Running example export_csv from https://github.com/bokeh/bokeh/tree/master/examples/app/export_csv
  
  under 0.12.7dev11 the table doesn't resize and extra rows are filled with 'undefined', '$NaN'.
  The number of rows is 248 and doesn't change when moving the slider.
  The rows after 248 are not shown.
  
  Under 0.12.6 everything works perfect.
  
  </issue>
  <code>
  [start of examples/app/export_csv/main.py]
  1 from os.path import dirname, join
  2 
  3 import pandas as pd
  4 
  5 from bokeh.layouts import row, widgetbox
  6 from bokeh.models import ColumnDataSource, CustomJS
  7 from bokeh.models.widgets import Slider, Button, DataTable, TableColumn, NumberFormatter
  8 from bokeh.io import curdoc
  9 
  10 df = pd.read_csv(join(dirname(__file__), 'salary_data.csv'))
  11 
  12 source = ColumnDataSource(data=dict())
  13 
  14 def update():
  15     current = df[df['salary'] <= slider.value].dropna()
  16     source.data = {
  17         'name'             : current.name,
  18         'salary'           : current.salary,
  19         'years_experience' : current.years_experience,
  20     }
  21 
  22 slider = Slider(title="Max Salary", start=10000, end=250000, value=150000, step=1000)
  23 slider.on_change('value', lambda attr, old, new: update())
  24 
  25 button = Button(label="Download", button_type="success")
  26 button.callback = CustomJS(args=dict(source=source),
  27                            code=open(join(dirname(__file__), "download.js")).read())
  28 
  29 columns = [
  30     TableColumn(field="name", title="Employee Name"),
  31     TableColumn(field="salary", title="Income", formatter=NumberFormatter(format="$0,0.00")),
  32     TableColumn(field="years_experience", title="Experience (years)")
  33 ]
  34 
  35 data_table = DataTable(source=source, columns=columns, width=800)
  36 
  37 controls = widgetbox(slider, button)
  38 table = widgetbox(data_table)
  39 
  40 curdoc().add_root(row(controls, table))
  41 curdoc().title = "Export CSV"
  42 
  43 update()
  44
  [end of examples/app/export_csv/main.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/examples/app/export_csv/main.py b/examples/app/export_csv/main.py
  --- a/examples/app/export_csv/main.py
  +++ b/examples/app/export_csv/main.py
  @@ -4,7 +4,7 @@
   
   from bokeh.layouts import row, widgetbox
   from bokeh.models import ColumnDataSource, CustomJS
  -from bokeh.models.widgets import Slider, Button, DataTable, TableColumn, NumberFormatter
  +from bokeh.models.widgets import RangeSlider, Button, DataTable, TableColumn, NumberFormatter
   from bokeh.io import curdoc
   
   df = pd.read_csv(join(dirname(__file__), 'salary_data.csv'))
  @@ -12,14 +12,14 @@
   source = ColumnDataSource(data=dict())
   
   def update():
  -    current = df[df['salary'] <= slider.value].dropna()
  +    current = df[(df['salary'] >= slider.value[0]) & (df['salary'] <= slider.value[1])].dropna()
       source.data = {
           'name'             : current.name,
           'salary'           : current.salary,
           'years_experience' : current.years_experience,
       }
   
  -slider = Slider(title="Max Salary", start=10000, end=250000, value=150000, step=1000)
  +slider = RangeSlider(title="Max Salary", start=10000, end=110000, value=(10000, 50000), step=1000, format="0,0")
   slider.on_change('value', lambda attr, old, new: update())
   
   button = Button(label="Download", button_type="success")
  
verification_info: {"golden_diff": "diff --git a/examples/app/export_csv/main.py b/examples/app/export_csv/main.py\n--- a/examples/app/export_csv/main.py\n+++ b/examples/app/export_csv/main.py\n@@ -4,7 +4,7 @@\n \n from bokeh.layouts import row, widgetbox\n from bokeh.models import ColumnDataSource, CustomJS\n-from bokeh.models.widgets import Slider, Button, DataTable, TableColumn, NumberFormatter\n+from bokeh.models.widgets import RangeSlider, Button, DataTable, TableColumn, NumberFormatter\n from bokeh.io import curdoc\n \n df = pd.read_csv(join(dirname(__file__), 'salary_data.csv'))\n@@ -12,14 +12,14 @@\n source = ColumnDataSource(data=dict())\n \n def update():\n-    current = df[df['salary'] <= slider.value].dropna()\n+    current = df[(df['salary'] >= slider.value[0]) & (df['salary'] <= slider.value[1])].dropna()\n     source.data = {\n         'name'             : current.name,\n         'salary'           : current.salary,\n         'years_experience' : current.years_experience,\n     }\n \n-slider = Slider(title=\"Max Salary\", start=10000, end=250000, value=150000, step=1000)\n+slider = RangeSlider(title=\"Max Salary\", start=10000, end=110000, value=(10000, 50000), step=1000, format=\"0,0\")\n slider.on_change('value', lambda attr, old, new: update())\n \n button = Button(label=\"Download\", button_type=\"success\")\n", "issue": "export_csv example under 0.12.7dev11 doesn't resize table\nRunning example export_csv from https://github.com/bokeh/bokeh/tree/master/examples/app/export_csv\r\n\r\nunder 0.12.7dev11 the table doesn't resize and extra rows are filled with 'undefined', '$NaN'.\r\nThe number of rows is 248 and doesn't change when moving the slider.\r\nThe rows after 248 are not shown.\r\n\r\nUnder 0.12.6 everything works perfect.\n", "before_files": [{"content": "from os.path import dirname, join\n\nimport pandas as pd\n\nfrom bokeh.layouts import row, widgetbox\nfrom bokeh.models import ColumnDataSource, CustomJS\nfrom bokeh.models.widgets import Slider, Button, DataTable, TableColumn, NumberFormatter\nfrom bokeh.io import curdoc\n\ndf = pd.read_csv(join(dirname(__file__), 'salary_data.csv'))\n\nsource = ColumnDataSource(data=dict())\n\ndef update():\n    current = df[df['salary'] <= slider.value].dropna()\n    source.data = {\n        'name'             : current.name,\n        'salary'           : current.salary,\n        'years_experience' : current.years_experience,\n    }\n\nslider = Slider(title=\"Max Salary\", start=10000, end=250000, value=150000, step=1000)\nslider.on_change('value', lambda attr, old, new: update())\n\nbutton = Button(label=\"Download\", button_type=\"success\")\nbutton.callback = CustomJS(args=dict(source=source),\n                           code=open(join(dirname(__file__), \"download.js\")).read())\n\ncolumns = [\n    TableColumn(field=\"name\", title=\"Employee Name\"),\n    TableColumn(field=\"salary\", title=\"Income\", formatter=NumberFormatter(format=\"$0,0.00\")),\n    TableColumn(field=\"years_experience\", title=\"Experience (years)\")\n]\n\ndata_table = DataTable(source=source, columns=columns, width=800)\n\ncontrols = widgetbox(slider, button)\ntable = widgetbox(data_table)\n\ncurdoc().add_root(row(controls, table))\ncurdoc().title = \"Export CSV\"\n\nupdate()\n", "path": "examples/app/export_csv/main.py"}]}