internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: bokeh/bokeh

Issue:
Update/refresh installation guide and quick start
Many parts are out of date or confusing. 



Discussion:

Resolving patch:
diff --git a/bokeh/sphinxext/bokeh_plot.py b/bokeh/sphinxext/bokeh_plot.py
--- a/bokeh/sphinxext/bokeh_plot.py
+++ b/bokeh/sphinxext/bokeh_plot.py
@@ -92,7 +92,7 @@
 from sphinx.util.compat import Directive
 
 from .utils import out_of_date
-from .. import plotting
+from .. import charts, io, plotting
 from ..document import Document
 from ..embed import autoload_static
 from ..resources import CDN
@@ -232,6 +232,10 @@ def _show(obj=None):
         plotting._obj = obj
 
 webbrowser.open = _noop
+charts.save = _noop
+charts.show = _show
+io.save = _noop
+io.show = _show
 plotting.save = _noop
 plotting.show = _show
 


Test patch:
Repository: bokeh/bokeh

Issue:
Charts xlabel and yabel defaults
With introduction of ChartOptions xlabel and ylabel now defaults to 'x_label' and 'y_label'. Thus users need to explicitly pass xlabel='' or ylabel='' for not show anything. IIRC blank was the default in previous versions and I think it makes sense...



Discussion:
@Maggie-M is about to push a PR to fix this. 

Edit: changing to `xlabel` though I think, please coordinate with her. 

Great! 

> changing to xlabel though I think

You mean changing to 'xlabel' as default?

ping @bryevdv @Maggie-M . default values now are 'x-axis' and 'y-axis'. Should we go ahead and use "" as default? Otherwise we should close this issue...

I am +1 on having the empty string as the default. 


Resolving patch:
diff --git a/bokeh/charts/_chart_options.py b/bokeh/charts/_chart_options.py
--- a/bokeh/charts/_chart_options.py
+++ b/bokeh/charts/_chart_options.py
@@ -44,12 +44,12 @@ class ChartOptions(HasProps):
     Whether to draw an y-grid.
     """)
 
-    xlabel = String("x-axis", help="""
-    A label for the (default) x-axis.
+    xlabel = String(None, help="""
+    A label for the x-axis. (default: None)
     """)
 
-    ylabel = String("y-axis", help="""
-    A label for the (default) y-axis.
+    ylabel = String(None, help="""
+    A label for the y-axis. (default: None)
     """)
 
     xscale = Either(Auto, Enum(Scale), help="""


Test patch:
Repository: bokeh/bokeh

Issue:
Two instances of autoload_server??
Hi, is it intentional to have two versions of autoload_server in embed.py? If so, they need different names, as the second one is currently overwriting the first:

https://github.com/bokeh/bokeh/blob/master/bokeh/embed.py#L176

``` python
def autoload_server(plot_object, session):
    ''' Return a script tag that can be used to embed Bokeh Plots from
        a Bokeh Server....'''
```

https://github.com/bokeh/bokeh/blob/master/bokeh/embed.py#L206

``` python
def autoload_server(plot_object, session, public=False):
    ''' Return a script tag that can be used to embed Bokeh Plots from a Bokeh Server.
        The data for the plot is stored on the Bokeh Server. ....'''
```



Discussion:
Looks like a merge conflict resolution error. 

The second one (with the `public` arg) is the correct one, although it needs its docstring improved. 

Thanks for spotting this, @birdsarah 


Resolving patch:
diff --git a/bokeh/embed.py b/bokeh/embed.py
--- a/bokeh/embed.py
+++ b/bokeh/embed.py
@@ -175,36 +175,6 @@ def autoload_static(plot_object, resources, script_path):
     return encode_utf8(js), encode_utf8(tag)
 
 
-def autoload_server(plot_object, session):
-    ''' Return a script tag that can be used to embed Bokeh Plots from
-    a Bokeh Server.
-
-    The data for the plot is stored on the Bokeh Server.
-
-    Args:
-        plot_object (PlotObject) :
-        session (session) :
-
-    Returns:
-        tag :
-            a ``<script>`` tag that will execute an autoload script
-            loaded from the Bokeh Server
-
-    '''
-    elementid = str(uuid.uuid4())
-    resources = Resources(root_url=session.root_url, mode="server")
-    tag = AUTOLOAD_SERVER.render(
-        src_path = resources._autoload_path(elementid),
-        elementid = elementid,
-        modelid = plot_object._id,
-        root_url = resources.root_url,
-        docid =  session.docid,
-        docapikey = session.apikey,
-        loglevel = resources.log_level,
-    )
-
-    return encode_utf8(tag)
-
 def autoload_server(plot_object, session, public=False):
     ''' Return a script tag that can be used to embed Bokeh Plots from
     a Bokeh Server.


Test patch:
Repository: bokeh/bokeh

Issue:
decimal.Decimal cannot be sent across session
When trying to give data of type decimal.Decimal as data sources to plots, the BokehJSONEncoder does tries to serialise the Decimal object with the standard built-in JSON encoder. This causes an exception "Decimal('...') not JSON serializable". The solution is to edit BokehJSONEncoder.trasnform_python_types to account for this possibility. I have tested the solution and it works.



Discussion:
If you could submit a PR with your updated code that would be very appreciated. 


Resolving patch:
diff --git a/bokeh/protocol.py b/bokeh/protocol.py
--- a/bokeh/protocol.py
+++ b/bokeh/protocol.py
@@ -5,6 +5,7 @@
 import time
 import datetime as dt
 import calendar
+import decimal
 
 import numpy as np
 from six.moves import cPickle as pickle
@@ -94,6 +95,9 @@ def transform_python_types(self, obj):
         elif is_dateutil and isinstance(obj, relativedelta):
             return dict(years=obj.years, months=obj.months, days=obj.days, hours=obj.hours,
                 minutes=obj.minutes, seconds=obj.seconds, microseconds=obj.microseconds)
+        # Decimal
+        elif isinstance(obj, decimal.Decimal):
+            return float(obj)
         else:
             return super(BokehJSONEncoder, self).default(obj)
 


Test patch:
Repository: bokeh/bokeh

Issue:
Setup.py build message improvements
- Only show BokehJS build output on errors
- report build artifact sizes



Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -200,8 +200,34 @@ def remove_bokeh_pth(path_file):
         return True
     return False
 
+BUILD_EXEC_FAIL_MSG = """ Failed.
+
+ERROR: subprocess.Popen(%r) failed to execute:
+
+    %s
+
+Have you run `npm install` from the bokehjs subdirectory?
+For more information, see the Dev Guide:
+
+    http://bokeh.pydata.org/en/latest/docs/dev_guide.html
+"""
+
+BUILD_FAIL_MSG = """ Failed.
+
+ERROR: 'grunt deploy' returned error message:
+
+%s
+"""
+
+BUILD_SIZE_FAIL_MSG = """
+ERROR: could not determine sizes:
+
+    %s
+"""
+
 def build_js():
-    print("Building BokehJS...")
+    print("Building BokehJS... ", end="")
+    sys.stdout.flush()
     os.chdir('bokehjs')
 
     if sys.platform != "win32":
@@ -210,22 +236,34 @@ def build_js():
         cmd = [join('node_modules', '.bin', 'grunt.cmd'), 'deploy']
 
     try:
-        proc = subprocess.Popen(cmd)
-    except OSError:
-        print("""
-Failed to build BokehJS.
-
-Have you run `npm install` from the bokehjs subdirectory?
-  Dev Guide: http://bokeh.pydata.org/docs/dev_guide.html#bokehjs.
-""")
+        proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
+    except OSError as e:
+        print(BUILD_EXEC_FAIL_MSG % (cmd, e))
         sys.exit(1)
     finally:
         os.chdir('..')
 
     if proc.wait() != 0:
-        print("ERROR: could not build BokehJS")
+        msg = proc.stdout.read()
+        print(BUILD_FAIL_MSG % msg.decode('ascii'))
         sys.exit(1)
 
+    print("Success!")
+    print()
+    print("Build artifact sizes:")
+    try:
+        blddir = join("bokehjs", "build")
+        bkjs_size = os.stat(join(blddir, "js", "bokeh.js")).st_size / 2**10
+        bkjs_min_size = os.stat(join(blddir, "js", "bokeh.min.js")).st_size / 2**10
+        bkcss_size = os.stat(join(blddir, "css", "bokeh.css")).st_size / 2**10
+        bkcss_min_size = os.stat(join(blddir, "css", "bokeh.min.css")).st_size / 2**10
+        print("  - bokeh.js      : %0.1f kB" % bkjs_size)
+        print("  - bokeh.css     : %0.1f KB" % bkcss_size)
+        print("  - bokeh.min.js  : %0.1f KB" % bkjs_min_size)
+        print("  - bokeh.min.css : %0.1f KB" % bkcss_min_size)
+    except Exception as e:
+        print(BUILD_SIZE_FAIL_MSG % e)
+
 def install_js():
     target_jsdir = join(SERVER, 'static', 'js')
     target_cssdir = join(SERVER, 'static', 'css')


Test patch:
Repository: bokeh/bokeh

Issue:
simpleapp broken
```
2015-03-30 16:30:29,043:WARNING:tornado.access:404 GET /bokeh/airports/ (127.0.0.1) 1.69ms
2015-03-30 16:30:33,408:ERROR:bokeh.server:Exception on /bokeh/stocks/ [GET]
Traceback (most recent call last):
  File "/Users/fpliger/anaconda/envs/pybk27/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/fpliger/anaconda/envs/pybk27/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/fpliger/anaconda/envs/pybk27/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/fpliger/anaconda/envs/pybk27/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/fpliger/anaconda/envs/pybk27/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Users/fpliger/dev/repos/bokeh/bokeh/server/utils/plugins.py", line 57, in wrapper
    obj = func(*args, **kwargs)
  File "/Users/fpliger/dev/repos/bokeh/bokeh/simpleapp.py", line 50, in gen
    app = SimpleApp.create(self.name, [x.clone() for x in self.widgets])
  File "/Users/fpliger/dev/repos/bokeh/bokeh/models/widgets/layouts.py", line 93, in create
    obj.set_output()
  File "/Users/fpliger/dev/repos/bokeh/bokeh/models/widgets/layouts.py", line 191, in set_output
    args = self.args_for_func(func)
  File "/Users/fpliger/dev/repos/bokeh/bokeh/models/widgets/layouts.py", line 186, in args_for_func
    args = arg_filter(func, args)
  File "/Users/fpliger/dev/repos/bokeh/bokeh/util/functions.py", line 24, in arg_filter
    arg_names, vararg_name, keyword_name, defaults = inspect.getargspec(func)
NameError: global name 'inspect' is not defined
2015-03-30 16:30:33,412:ERROR:tornado.access:500 GET /bokeh/stocks/ (127.0.0.1) 39.30ms
```



Discussion:
sorry - I think when I was merging I moved some stuff around to respond to where utils was - I must have forgotten to test after.   I can fix this tonight

thanks @hhuuggoo. It's a simple one line fix (if I'm not overseeing other more complex things). I'll be doing it in a few minutes. 


Resolving patch:
diff --git a/bokeh/util/functions.py b/bokeh/util/functions.py
--- a/bokeh/util/functions.py
+++ b/bokeh/util/functions.py
@@ -1,6 +1,7 @@
 """
 utilities for working with functions
 """
+import inspect
 
 class cached_property(object):
     """ A property that is only computed once per instance and then replaces


Test patch:
Repository: bokeh/bokeh

Issue:
Simpleapp stock demo histograms not updating on selection
Happens both with /stocks/ and /stocks2/ in simpleapp stocks example.



Discussion:

Resolving patch:
diff --git a/examples/app/stock_applet/stock_app_simple.py b/examples/app/stock_applet/stock_app_simple.py
--- a/examples/app/stock_applet/stock_app_simple.py
+++ b/examples/app/stock_applet/stock_app_simple.py
@@ -110,11 +110,14 @@ def stock2_update_selection(ticker1, ticker2, app):
         selected_df = df.iloc[source.selected, :]
     else:
         selected_df = df
-    hist1 = hist_plot(df, ticker1, selected_df=selected_df)
-    hist2 = hist_plot(df, ticker2, selected_df=selected_df)
-    app.objects['hist1'] = hist1
-    app.objects['hist2'] = hist2
-    app.objects['statstext'].text = str(selected_df.describe())
+
+    stats_text = app.objects['statstext']
+    stats_text.text = str(selected_df.describe())
+    return {
+        'hist1': hist_plot(df, ticker1, selected_df=selected_df),
+        'hist2': hist_plot(df, ticker2, selected_df=selected_df),
+        'statstext': stats_text,
+    }
 
 stock2.route("/bokeh/stocks2/")
 


Test patch:
Repository: bokeh/bokeh

Issue:
Add simple LOD downsampling on the client side
Allow tools that will update ranges to hint that they are in the middle of an interactive update. Then renderers can (optionally) use this information together with some heuristics about the number of data points to reduce the number of points actually drawn during the operation. 



Discussion:
This can be done piecemeal on whatever renderers have the highest need for this. 


Resolving patch:
diff --git a/bokeh/models/plots.py b/bokeh/models/plots.py
--- a/bokeh/models/plots.py
+++ b/bokeh/models/plots.py
@@ -415,6 +415,28 @@ def add_glyph(self, source_or_glyph, glyph=None, **kw):
     be made equal (the top or bottom padding amount, whichever is larger).
     """)
 
+    lod_factor = Int(10, help="""
+    Decimation factor to use when applying level-of-detail decimation.
+    """)
+
+    lod_threshold = Int(2000, help="""
+    A number of data points, above which level-of-detail downsampling may
+    be performed by glyph renderers. Set to ``None`` to disable any
+    level-of-detail downsampling.
+    """)
+
+    lod_interval = Int(300, help="""
+    Interval (in ms) during which an interactive tool event will enable
+    level-of-detail downsampling.
+    """)
+
+    lod_timeout = Int(500, help="""
+    Timeout (in ms) for checking whether interactive tool events are still
+    occurring. Once level-of-detail mode is enabled, a check is made every
+    ``lod_timeout`` ms. If no interactive tool events have happened,
+    level-of-detail mode is disabled.
+    """)
+
 class GridPlot(Plot):
     """ A 2D grid of plots rendered on separate canvases in an HTML table.
 


Test patch:
Repository: bokeh/bokeh

Issue:
angle property not working for square glyph
I can't rotate square glyphs. It would be great if angle was supported for triangle glyphs as well!



Discussion:

Resolving patch:
diff --git a/bokeh/models/markers.py b/bokeh/models/markers.py
--- a/bokeh/models/markers.py
+++ b/bokeh/models/markers.py
@@ -35,6 +35,10 @@ class Marker(Glyph):
     "screen space" units by default.
     """)
 
+    angle = NumberSpec("angle", help="""
+    The angles to rotate the markers.
+    """)
+
     line_props = Include(LineProps, use_prefix=False, help="""
     The %s values for the markers.
     """)
@@ -188,10 +192,6 @@ class Square(Marker):
 
     """
 
-    angle = NumberSpec("angle", help="""
-    The angles (in radians) to rotate square markers.
-    """)
-
 class SquareCross(Marker):
     """ Render square markers with a '+' cross through the center.
 


Test patch:
diff --git a/bokeh/models/tests/test_glyphs.py b/bokeh/models/tests/test_glyphs.py
--- a/bokeh/models/tests/test_glyphs.py
+++ b/bokeh/models/tests/test_glyphs.py
@@ -57,7 +57,7 @@
 
 PROPS = ["session", "name", "tags"]
 GLYPH = ["visible"]
-MARKER = ["x", "y", "size"]
+MARKER = ["x", "y", "size", "angle"]
 
 def check_props(glyph, *props):
     expected = set(sum((PROPS, GLYPH) + props, []))
@@ -519,11 +519,10 @@ def test_InvertedTriangle():
 
 def test_Square():
     marker = Square()
-    assert marker.angle == "angle"
     yield check_marker, marker
     yield check_fill, marker
     yield check_line, marker
-    yield check_props, marker, ["angle"], MARKER, FILL, LINE
+    yield check_props, marker, MARKER, FILL, LINE
 
 def test_SquareCross():
     marker = SquareCross()
Repository: bokeh/bokeh

Issue:
Allow users to specify a desired number of ticks
Expose `desired_num_ticks` on on the ticker base class, and expose it to python models. Note, this value is a _suggestion_ and tickers may ignore it, if it is not applicable (i.e., or single interval tickers), or use it merely as a soft goal (e.g. adaptive ticker)



Discussion:

Resolving patch:
diff --git a/bokeh/models/tickers.py b/bokeh/models/tickers.py
--- a/bokeh/models/tickers.py
+++ b/bokeh/models/tickers.py
@@ -18,6 +18,16 @@ class Ticker(PlotObject):
     adjacent major tick values.
     """)
 
+    desired_num_ticks = Int(6, help="""
+    A desired target number of major tick positions to generate across
+    the plot range.
+
+    .. note:
+        This value is a suggestion, and ticker subclasses may ignore
+        it entirely, or use it only as an ideal goal to approach as well
+        as can be, in the context of a specific ticking strategy.
+    """)
+
 class AdaptiveTicker(Ticker):
     """ Generate "nice" round ticks at any magnitude.
 
diff --git a/examples/plotting/file/line.py b/examples/plotting/file/line.py
--- a/examples/plotting/file/line.py
+++ b/examples/plotting/file/line.py
@@ -10,4 +10,6 @@
 p = figure(title="simple line example")
 p.line(x,y, color="#2222aa", line_width=2)
 
+p.ygrid[0].ticker.desired_num_ticks = 20
+
 show(p)


Test patch:
Repository: bokeh/bokeh

Issue:
Make a script to check for dev and docs dependencies
I've started working on this, and will make a PR for it soon.



Discussion:

Resolving patch:
diff --git a/scripts/devdeps.py b/scripts/devdeps.py
new file mode 100644
--- /dev/null
+++ b/scripts/devdeps.py
@@ -0,0 +1,69 @@
+from __future__ import print_function
+from os import path
+
+try:
+    import colorama
+    def blue(text): return "%s%s%s" % (colorama.Fore.BLUE, text, colorama.Style.RESET_ALL)
+    def red(text): return "%s%s%s" % (colorama.Fore.RED, text, colorama.Style.RESET_ALL)
+except ImportError:
+    def blue(text) : return text
+    def red(text) : return text
+
+npm_missing = """
+npm packages do not appear to be installed.
+Please navigate to the bokehjs directory and type 'npm install'\n
+"""
+
+def npm_check():
+    """Check that the bokehjs/node_modules directory exists, as its absence
+    is the best indication that npm is not installed."""
+
+
+    if not path.exists('../bokehjs/node_modules'):
+        print(red(npm_missing))
+
+
+def depend_check(deps_name, *args):
+    """Check for missing dependencies"""
+
+    missing = []
+
+    for dependency in args:
+        try:
+            __import__(dependency)
+        except ImportError:
+            missing.append(dependency)
+            found = False
+
+    print('-'*80)
+    if len(missing):
+        print(red("You are missing the following %s dependencies:") % deps_name)
+
+        for dep in missing:
+            name = pkg_info_dict.get(dep, dep)
+            print(" * ", name)
+        print()
+        return False
+    else:
+        print(blue("All %s dependencies installed!  You are good to go!\n") % deps_name)
+        return True
+
+if __name__ == '__main__':
+
+    npm_check()
+
+    #Dictionary maps module names to package names
+    pkg_info_dict =  {'bs4'           : 'beautiful-soup',
+                      'websocket'         : 'websocket-client',
+                      'sphinx_bootstrap_theme'   : 'sphinx-bootstrap-theme',
+                      'sphinxcontrib.httpdomain' : 'sphinxcontrib-httpdomain',
+                      'pdiffer'                    : 'pdiff'
+                     }
+
+    dev_deps = ['bs4', 'colorama', 'pdiffer', 'boto', 'nose', 'mock', 'coverage',
+                'websocket']
+    depend_check('Dev', *dev_deps)
+
+    docs_deps = ['graphviz', 'sphinx', 'pygments', 'sphinx_bootstrap_theme',
+                 'sphinxcontrib.httpdomain']
+    depend_check('Docs', *docs_deps)


Test patch:
diff --git a/scripts/test_matrix.py b/scripts/test_matrix.py
--- a/scripts/test_matrix.py
+++ b/scripts/test_matrix.py
@@ -4,7 +4,6 @@
 import os
 import shutil
 import subprocess
-import sys
 import textwrap
 
 OPTIONS = {
Repository: bokeh/bokeh

Issue:
VBoxForm broken
Added a `float:left` to fix `sliders.py` which broke stock app example worse. 



Discussion:

Resolving patch:
diff --git a/examples/plotting/file/slider.py b/examples/plotting/file/slider.py
--- a/examples/plotting/file/slider.py
+++ b/examples/plotting/file/slider.py
@@ -42,8 +42,8 @@
 callback.args["offset"] = offset_slider
 
 layout = hplot(
+    plot,
     vform(amp_slider, freq_slider, phase_slider, offset_slider),
-    plot
 )
 
 output_file("slider.html")


Test patch:
Repository: bokeh/bokeh

Issue:
Obsolete protocole sslv3
[Obsolete protocole sslv3 has been removed in debian 8](https://www.debian.org/releases/jessie/armhf/release-notes/ch-whats-new.en.html)
To install module Bokeh on python 2.7 on Debian 8 I had to edit : 

`/usr/local/lib/python2.7/dist-packages/gevent/ssl.py`

this way : 

**(line 386)**
`#def get_server_certificate(addr,ssl_version=PROTOCOL_SSLv3,ca_certs=None):`
`def get_server_certificate(addr,ssl_version='',ca_certs=None):`

otherwise, you got below error during compil : 

`NameError : name 'PROTOCL_SSLv3' is not defined`



Discussion:
@guillaumeinnov24 what version?

@bokeh/dev why and where is gevent still listed as a dependency?

Here: https://github.com/bokeh/bokeh/blob/master/setup.py#L511

I think this should have been removed a long time ago?

When `tornado` was introduced, `gevent` was left optional... but I guess when `gevent` was finally removed, we completely forgot about this references. All the other `gevent` ocurrences: https://github.com/bokeh/bokeh/search?utf8=%E2%9C%93&q=gevent


Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -510,9 +510,7 @@ def parse_jsargs():
 
 if sys.version_info[0] != 3 and platform.python_implementation() != "PyPy":
     REQUIRES.extend([
-        'websocket>=0.2.1',
-        'gevent>=1.0',
-        'gevent-websocket>=0.9.2',
+        'websocket>=0.2.1'
     ])
 
 # if sys.platform != "win32":


Test patch: