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

Issue:
Add VBar and HBar glyphs to charts




Discussion:

Resolving patch:
diff --git a/bokeh/charts/chart.py b/bokeh/charts/chart.py
--- a/bokeh/charts/chart.py
+++ b/bokeh/charts/chart.py
@@ -336,6 +336,8 @@ def make_grid(self, dimension, ticker):
 
     ellipse = _glyph_function(glyphs.Ellipse)
 
+    hbar = _glyph_function(glyphs.HBar)
+
     image = _glyph_function(glyphs.Image)
 
     image_rgba = _glyph_function(glyphs.ImageRGBA)
@@ -374,6 +376,8 @@ def make_grid(self, dimension, ticker):
 
     triangle = _glyph_function(markers.Triangle)
 
+    vbar = _glyph_function(glyphs.VBar)
+
     wedge = _glyph_function(glyphs.Wedge)
 
     x = _glyph_function(markers.X)


Test patch:
Repository: bokeh/bokeh

Issue:
Overlapping bins in Bokeh charts Histogram example
```
import pandas as pd
import numpy as np
from bokeh.io import output_file, show

# build some distributions
mu, sigma = 0, 0.5
normal = pd.DataFrame({'value': np.random.normal(mu, sigma, 1000), 'type': 'normal'})
lognormal = pd.DataFrame({'value': np.random.lognormal(mu, sigma, 1000), 'type': 'lognormal'})

# create a pandas data frame
df = pd.concat([normal, lognormal])
df[995:1005]

from bokeh.charts import Histogram
hist = Histogram(df, values='value', color='type', bins=50, legend=True)
show(hist)
```

![image](https://cloud.githubusercontent.com/assets/512293/11726004/9ab53784-9f4a-11e5-8183-cd79e9d87727.png)



Discussion:
There's also bad spacing in a couple of other places.

Histogram seems to be trying to use the Bar machinery and forcing the center to a string so that it can be used as a categorical. 

The issue is probably at:
bokeh/charts/stats.py line 377  centers = centers.astype(str)

The chunk of json that is troubling, looks like this:  
         "x": [
                "2.0"

The whole print out is here:
https://gist.github.com/jsignell/7122693eda4ead043af0c569078cd574


Resolving patch:
diff --git a/bokeh/charts/stats.py b/bokeh/charts/stats.py
--- a/bokeh/charts/stats.py
+++ b/bokeh/charts/stats.py
@@ -434,9 +434,9 @@ def calculate(self):
         for i, b in enumerate(binned):
             width = bin_bounds[i+1] - bin_bounds[i]
             if i == 0:
-                lbl = "[%.1f, %.1f]" % (bin_bounds[i], bin_bounds[i+1])
+                lbl = "[%f, %f]" % (bin_bounds[i], bin_bounds[i+1])
             else:
-                lbl = "(%.1f, %.1f]" % (bin_bounds[i], bin_bounds[i+1])
+                lbl = "(%f, %f]" % (bin_bounds[i], bin_bounds[i+1])
             self.bins.append(Bin(bin_label=lbl, values=[binned[i]], stat=Max(),
                 width=width))
 


Test patch:
diff --git a/bokeh/charts/tests/test_stats.py b/bokeh/charts/tests/test_stats.py
--- a/bokeh/charts/tests/test_stats.py
+++ b/bokeh/charts/tests/test_stats.py
@@ -37,7 +37,7 @@ def test_histogram_wo_density():
     h = Histogram(values=values, bins=3)
 
     assert len(h.bins) == 3
-    assert [b.label[0] for b in h.bins] == ['[0.0, 3.0]', '(3.0, 6.0]', '(6.0, 9.0]']
+    assert [b.label[0] for b in h.bins] == ['[0.000000, 3.000000]', '(3.000000, 6.000000]', '(6.000000, 9.000000]']
     assert [b.values[0] for b in h.bins] == [3, 3, 4]
 
 
@@ -46,7 +46,7 @@ def test_histogram_w_density():
     h = Histogram(values=values, bins=3, density=True)
 
     assert len(h.bins) == 3
-    assert [b.label[0] for b in h.bins] == ['[0.0, 3.0]', '(3.0, 6.0]', '(6.0, 9.0]']
+    assert [b.label[0] for b in h.bins] == ['[0.000000, 3.000000]', '(3.000000, 6.000000]', '(6.000000, 9.000000]']
     assert [b.values[0] for b in h.bins] == [0.1, 0.1, 0.13333333333333333]
Repository: bokeh/bokeh

Issue:
Bokeh server reports "None" port when there is a port conflict. 
When starting a bokeh server on the default port when another server is already running, the port number is incorrectly reported in the error message:
```
$ ../../bin/bokeh serve --show spectrogram
2016-12-28 13:57:32,400 Starting Bokeh server version 0.12.4dev10-77-g450e64c-dirty
2016-12-28 13:57:32,401 Cannot start Bokeh server, port None is already in use
```


Discussion:
@bryevdv I am interested in working on the issue. How do I start?
HI @souravsingh that's great! 

The actual message is printed here in a `report_server_init_errors` context manager:

https://github.com/bokeh/bokeh/blob/master/bokeh/command/util.py#L118

and that context manager is used here:

https://github.com/bokeh/bokeh/blob/master/bokeh/command/subcommands/serve.py#L563

The issue seem to be that the default for `--port` starts out as `None`, which is not set to the real default until inside `Server` (which is inside `report_server_init_errors`, which is the problem):

https://github.com/bokeh/bokeh/blob/master/bokeh/server/server.py#L112

So an idea might be to *also* set the `DEFAULT_SERVER_PORT` inside `serve.py` in that `server_kwargs` dict, before the context manager is used. 

Let me know if I can answer any more questions!

Resolving patch:
diff --git a/bokeh/command/subcommands/serve.py b/bokeh/command/subcommands/serve.py
--- a/bokeh/command/subcommands/serve.py
+++ b/bokeh/command/subcommands/serve.py
@@ -352,7 +352,7 @@
         metavar = 'PORT',
         type    = int,
         help    = "Port to listen on",
-        default = None
+        default = DEFAULT_SERVER_PORT
     )),
 
     ('--address', dict(
@@ -532,7 +532,7 @@ def invoke(self, args):
                                                               'check_unused_sessions_milliseconds',
                                                               'unused_session_lifetime_milliseconds',
                                                               'stats_log_frequency_milliseconds',
-                                                              'use_xheaders',
+                                                              'use_xheaders'
                                                             ]
                           if getattr(args, key, None) is not None }
 


Test patch:
diff --git a/bokeh/command/subcommands/tests/test_serve.py b/bokeh/command/subcommands/tests/test_serve.py
--- a/bokeh/command/subcommands/tests/test_serve.py
+++ b/bokeh/command/subcommands/tests/test_serve.py
@@ -12,6 +12,9 @@
 
 import bokeh.command.subcommands.serve as scserve
 
+from bokeh.resources import DEFAULT_SERVER_PORT
+
+
 
 def test_create():
     import argparse
@@ -37,7 +40,7 @@ def test_args():
             metavar = 'PORT',
             type    = int,
             help    = "Port to listen on",
-            default = None
+            default = DEFAULT_SERVER_PORT
         )),
 
         ('--address', dict(
Repository: bokeh/bokeh

Issue:
Remove Invalid PyPI classifier
`0.12.4` PyPI upload failed with this error:

```
Registering bokeh to https://pypi.python.org/pypi
Server response (400): Invalid classifier "License :: OSI Approved :: BSD License :: 3 Clause New or Revised"
```

This classifier is invalid and needs to be removed from `setup.py`

---

For now, checked out `0.12.4` tag, built and uploaded manually with the "bad" classifier removed. 



Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -607,7 +607,6 @@ def package_tree(pkgroot):
         "Intended Audience :: Science/Research",
         "License :: Freely Distributable",
         "License :: OSI Approved",
-        "License :: OSI Approved :: BSD License :: 3 Clause New or Revised",
         "Topic :: Office/Business",
         "Topic :: Office/Business :: Financial",
         "Topic :: Scientific/Engineering",


Test patch:
Repository: bokeh/bokeh

Issue:
Deploy script does not commit changelog on full release
Oversight discovered on first usage with full `0.12.4` release


Discussion:

Resolving patch:
diff --git a/scripts/deploy.py b/scripts/deploy.py
--- a/scripts/deploy.py
+++ b/scripts/deploy.py
@@ -341,12 +341,13 @@ def update_docs_versions():
         failed("Could not write new version to file %r" % filename, str(e).split("\n"))
     else:
         passed("Appended version %r to %r" % (CONFIG.new_version, filename))
-        commit(filename, new_version)
+        commit(filename, CONFIG.new_version)
 
 def update_changelog():
     try:
         out = run("python issues.py -p %s -r %s" % (CONFIG.last_full_version, CONFIG.new_version))
         passed("Updated CHANGELOG with new closed issues")
+        commit("CHANGELOG", CONFIG.new_version)
     except CalledProcessError as e:
         out = e.output.decode('utf-8')
         if "HTTP Error 403: Forbidden" in out:


Test patch:
Repository: bokeh/bokeh

Issue:
Typo in palettes docs
`Grey256` in https://github.com/bokeh/bokeh/blob/master/bokeh/palettes.py#L137 should be `Greys256`



Discussion:

Resolving patch:
diff --git a/bokeh/palettes.py b/bokeh/palettes.py
--- a/bokeh/palettes.py
+++ b/bokeh/palettes.py
@@ -134,7 +134,7 @@
 ``small_palettes`` attribute, the ``bokeh.palettes`` module also has some
 larger palettes with 256 colors. These are shown below:
 
-:Grey256: :bokeh-palette:`grey(256)` (brewer)
+:Greys256: :bokeh-palette:`grey(256)` (brewer)
 
 :Inferno256: :bokeh-palette:`inferno(256)` (mpl)
 


Test patch:
Repository: bokeh/bokeh

Issue:
use [non]selection_glyph="auto" to generate automatically, not None 
reference: http://stackoverflow.com/questions/30915580/how-can-i-configure-the-taptool-so-it-does-not-hide-other-data-points-when-click

Should require `selection_glyph="auto"` and `non selection_glyph="auto"` to create the standard default highlighting (these values should be the new defaults). Setting to `None` should be reserved for "no highlighting". 



Discussion:

Resolving patch:
diff --git a/bokeh/models/renderers.py b/bokeh/models/renderers.py
--- a/bokeh/models/renderers.py
+++ b/bokeh/models/renderers.py
@@ -10,7 +10,7 @@
 from ..model import Model
 from ..core.enums import RenderLevel
 from ..core.properties import abstract
-from ..core.properties import String, Enum, Instance, Float, Bool, Override
+from ..core.properties import Auto, Bool, Either, Enum, Float, Instance, Override, String
 from ..core import validation
 from ..core.validation.errors import BAD_COLUMN_NAME, MISSING_GLYPH, NO_SOURCE_FOR_GLYPH
 
@@ -131,14 +131,20 @@ def _check_bad_column_name(self):
     and ranges.
     """)
 
-    selection_glyph = Instance(Glyph, help="""
+    selection_glyph = Either(Auto, Instance(Glyph), default="auto", help="""
     An optional glyph used for selected points.
+
+    If set to "auto" then the standard glyph will be used for selected
+    points.
     """)
 
-    nonselection_glyph = Instance(Glyph, help="""
+    nonselection_glyph = Either(Auto, Instance(Glyph), default="auto", help="""
     An optional glyph used for explicitly non-selected points
     (i.e., non-selected when there are other points that are selected,
     but not when no points at all are selected.)
+
+    If set to "auto" then a glyph with a low alpha value (0.1) will
+    be used for non-selected points.
     """)
 
     hover_glyph = Instance(Glyph, help="""


Test patch:
Repository: bokeh/bokeh

Issue:
not necessary loop in weather example? 
see the update plot method below in the [main.py](**url**)
```
def update_plot(attrname, old, new):
    city = city_select.value
    plot.title.text = "Weather data for " + cities[city]['title']

    src = get_dataset(df, cities[city]['airport'], distribution_select.value)
    for key in STATISTICS + ['left', 'right']:
        source.data.update(src.data)
```

Why do we need the for loop over key ?
Isn't a single `source.data.update(src.data)` enough?


Discussion:
I think it was just an accident. I am guessing the original code looped and updated individual keys, which is usually discouraged. Probably someone updated to use `update` in a hurry but forgot to remove the loop. Would you like to make a Pull Request to update the example?

Resolving patch:
diff --git a/examples/app/weather/main.py b/examples/app/weather/main.py
--- a/examples/app/weather/main.py
+++ b/examples/app/weather/main.py
@@ -53,8 +53,7 @@ def update_plot(attrname, old, new):
     plot.title.text = "Weather data for " + cities[city]['title']
 
     src = get_dataset(df, cities[city]['airport'], distribution_select.value)
-    for key in STATISTICS + ['left', 'right']:
-        source.data.update(src.data)
+    source.data.update(src.data)
 
 city = 'Austin'
 distribution = 'Discrete'


Test patch:
Repository: bokeh/bokeh

Issue:
Fix a typo in LayoutDOM
`bokeh` `0.12.4`
https://github.com/bokeh/bokeh/blob/master/bokeh/models/layouts.py#L64
reads 
```
``"scale_both"`` elements will responsively resize to fir both the width and height available,
```

Expected:
```
``"scale_both"`` elements will responsively resize to for both the width and height available,
```




Discussion:

Resolving patch:
diff --git a/bokeh/models/layouts.py b/bokeh/models/layouts.py
--- a/bokeh/models/layouts.py
+++ b/bokeh/models/layouts.py
@@ -61,7 +61,7 @@ class LayoutDOM(Model):
     ``plot_width/plot_height`` is maintained. A plot with ``"scale_height"`` mode needs
     to be wrapped in a ``Row`` or ``Column`` to be responsive.
 
-    ``"scale_both"`` elements will responsively resize to fir both the width and height available,
+    ``"scale_both"`` elements will responsively resize to for both the width and height available,
     *while maintaining the original aspect ratio*.
 
     """)


Test patch:
Repository: bokeh/bokeh

Issue:
Bad formatting in selected docstring
Ends up rendering like this

<img width="680" alt="screen shot 2017-01-13 at 10 38 03 am" src="https://cloud.githubusercontent.com/assets/1796208/21937294/71c87792-d97c-11e6-929f-ebf03c695e8a.png">

Guessing bad use of bullets is causing some text to be bold and the whole thing to be unclear.

While there the wording in this docstring could be a lot clearer.


Discussion:
For reference the docstring is here:

https://github.com/bokeh/bokeh/blob/master/bokeh/models/sources.py#L16

A better approach is probably a `code-block:: python`` that just gives the dict in "exploded" form, which comments inline describing each key.

Resolving patch:
diff --git a/bokeh/models/sources.py b/bokeh/models/sources.py
--- a/bokeh/models/sources.py
+++ b/bokeh/models/sources.py
@@ -25,21 +25,29 @@ class DataSource(Model):
     }, help="""
     A dict to indicate selected indices on different dimensions on this DataSource. Keys are:
 
-    - 0d: indicates whether a Line or Patch glyphs have been hit. Value is a
-            dict with the following keys:
+    .. code-block:: python
 
-            - flag (boolean): true if glyph was with false otherwise
-            - indices (list): indices hit (if applicable)
+        # selection information for line and patch glyphs
+        '0d' : {
+          # the glyph that was selected
+          'glyph': None
 
-    - 1d: indicates whether any of all other glyph (except [multi]line or
-            patches) was hit:
+          # array with the [smallest] index of the segment of the line that was hit
+          'indices': []
+        }
 
-            - indices (list): indices that were hit/selected
+        # selection for most (point-like) glyphs, except lines and patches
+        '1d': {
+          # indices of the points included in the selection
+          indices: []
+        }
 
-    - 2d: indicates whether a [multi]line or patches) were hit:
+        # selection information for multiline and patches glyphs
+        '2d': {
+          # mapping of indices of the multiglyph to array of glyph indices that were hit
+          # e.g. {3: [5, 6], 4, [5]}
+        }
 
-            - indices (list(list)): indices of the lines/patches that were
-                hit/selected
     """)
 
     callback = Instance(Callback, help="""


Test patch:
Repository: bokeh/bokeh

Issue:
Add scale control to GMaps
Currently there are many configurable options that are not exposed in `GMapOptions`, such as the ability to add a scale bar. 

The various GMap options are described here:

https://developers.google.com/maps/documentation/javascript/controls

ref: http://stackoverflow.com/questions/40423735/python-bokeh-google-maps-plot-show-1km-distance-based-on-zoom-on-bottom-right



Discussion:
referred to wrong issue in PR, still open

Resolving patch:
diff --git a/bokeh/models/map_plots.py b/bokeh/models/map_plots.py
--- a/bokeh/models/map_plots.py
+++ b/bokeh/models/map_plots.py
@@ -5,7 +5,7 @@
 
 from ..core.enums import MapType
 from ..core.has_props import abstract
-from ..core.properties import Enum, Float, Instance, Int, JSON, Override, String
+from ..core.properties import Bool, Enum, Float, Instance, Int, JSON, Override, String
 from ..core.validation import error, warning
 from ..core.validation.warnings import MISSING_RENDERERS, NO_DATA_RENDERERS
 from ..core.validation.errors import REQUIRED_RANGE, MISSING_GOOGLE_API_KEY
@@ -48,6 +48,10 @@ class GMapOptions(MapOptions):
 
     """)
 
+    scale_control = Bool(default=False, help="""
+    Whether the Google map should display its distance scale control.
+    """)
+
     styles = JSON(help="""
     A JSON array of `map styles`_ to use for the GMapPlot. Many example styles can
     `be found here`_.


Test patch:
Repository: bokeh/bokeh

Issue:
Give feedback on bokeh server docs
This is just a ticket so that I can open a PR with some revisions I'd like to suggest to the docs after reading through the User and Dev guide pages for Bokeh server.


Discussion:

Resolving patch:
diff --git a/bokeh/command/subcommands/serve.py b/bokeh/command/subcommands/serve.py
--- a/bokeh/command/subcommands/serve.py
+++ b/bokeh/command/subcommands/serve.py
@@ -169,6 +169,10 @@
     It is not advised to set this option on a Bokeh server directly facing
     the Internet.
 
+
+
+.. _userguide_cli_serve_session_id_options:
+
 Session ID Options
 ~~~~~~~~~~~~~~~~~~
 


Test patch:
Repository: bokeh/bokeh

Issue:
sphinxext.bokeh_plot missing linenos option implementation
According to the [docs](http://bokeh.pydata.org/en/latest/docs/reference/sphinxext.html#module-bokeh.sphinxext.bokeh_plot) for sphinxext.bokeh_plot, there's a linenos option. However, this appears to be missing, as building
```
.. bokeh-plot::
   :linenos:

    from bokeh.plotting import figure, output_file, show

    output_file("example.html")

    x = [1, 2, 3, 4, 5]
    y = [6, 7, 6, 4, 5]

    p = figure(title="example", plot_width=300, plot_height=300)
    p.line(x, y, line_width=2)
    p.circle(x, y, size=10, fill_color="white")

    show(p)
```
results in the following sphinx error: `ERROR: Error in "bokeh-plot" directive:
unknown option: "linenos".`

Version Info:

Python version : 3.6.0 | packaged by conda-forge | (default, Jan 14 2017, 03:13:00)
IPython version : 5.1.0
Bokeh version : 0.12.4
BokehJS static path : /Users/Atom/.anaconda/envs/py3/lib/python3.6/site-packages/bokeh/server/static
node.js version : v6.3.1
npm version : 3.10.3
jupyter --version : 4.2.1
jupyter notebook --version : 4.3.1
os version : macOS 10.12.3
browser verision: Google Chrome Version 56.0.2924.87 (64-bit)
sphinx version: 1.5.3

This is a really awesome sphinx extension!


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
@@ -36,7 +36,7 @@
     Where to locate the the block of formatted source
     code (if anywhere).
 
-linenos : bool
+linenos : flag
     Whether to display line numbers along with the source.
 
 Examples
@@ -70,7 +70,7 @@
 
 from docutils import nodes
 from docutils.parsers.rst import Directive, Parser
-from docutils.parsers.rst.directives import choice
+from docutils.parsers.rst.directives import choice, flag
 
 from sphinx.errors import SphinxError
 from sphinx.util import console, copyfile, ensuredir
@@ -182,6 +182,7 @@ class BokehPlotDirective(Directive):
 
     option_spec = {
         'source-position': lambda x: choice(x, ('below', 'above', 'none')),
+        'linenos': lambda x: True if flag(x) is None else False,
     }
 
     def run(self):
@@ -232,7 +233,8 @@ def run(self):
         target = nodes.target('', '', ids=[target_id])
         result = [target]
 
-        code = nodes.literal_block(source, source, language="python", linenos=False, classes=[])
+        linenos = self.options.get('linenos', False)
+        code = nodes.literal_block(source, source, language="python", linenos=linenos, classes=[])
         set_source_info(self, code)
 
         source_position = self.options.get('source-position', 'below')


Test patch:
Repository: bokeh/bokeh

Issue:
LaTeX Label example is broken in dev docs
Currently at [dev docs](http://bokeh.pydata.org/en/dev/docs/user_guide/extensions_gallery/latex.html#userguide-extensions-examples-latex):

<img width="1189" alt="screen shot 2017-03-05 at 15 22 58" src="https://cloud.githubusercontent.com/assets/1078448/23591555/a38ce5de-01b7-11e7-9670-97ab083b817a.png">



Discussion:
"Wrapping a JavaScript Library" also broken:

http://bokeh.pydata.org/en/dev/docs/user_guide/extensions_gallery/wrapping.html#userguide-extensions-examples-wrapping

<img width="843" alt="screen shot 2017-03-05 at 15 25 38" src="https://cloud.githubusercontent.com/assets/1078448/23591582/02e9f166-01b8-11e7-8f37-cdcda77e3705.png">

`examples/app/surface3d` and `examples/models/external_resources.py` do work, though, so hopefully this is just some small thing that did not get updated recently. Need to note any migration notes that are necessary if they haven't been already. 
In general, the issue of handling text vs. HTML is a mess across bokeh (especially in annotations).

Resolving patch:
diff --git a/sphinx/source/docs/user_guide/examples/extensions_example_latex.py b/sphinx/source/docs/user_guide/examples/extensions_example_latex.py
--- a/sphinx/source/docs/user_guide/examples/extensions_example_latex.py
+++ b/sphinx/source/docs/user_guide/examples/extensions_example_latex.py
@@ -40,13 +40,13 @@
 
     #--- End of copied section from ``Label.render`` implementation
 
-    # ``katex`` is loaded into the global window at runtime
-    # katex.renderToString returns a html ``span`` element
-    latex = katex.renderToString(@model.text, {displayMode: true})
-
     # Must render as superpositioned div (not on canvas) so that KaTex
     # css can properly style the text
-    @_css_text(ctx, latex, sx + @model.x_offset, sy - @model.y_offset, angle)
+    @_css_text(ctx, "", sx + @model.x_offset, sy - @model.y_offset, angle)
+
+    # ``katex`` is loaded into the global window at runtime
+    # katex.renderToString returns a html ``span`` element
+    katex.render(@model.text, @el, {displayMode: true})
 
 export class LatexLabel extends Label
   type: 'LatexLabel'
diff --git a/sphinx/source/docs/user_guide/examples/extensions_example_wrapping.py b/sphinx/source/docs/user_guide/examples/extensions_example_wrapping.py
--- a/sphinx/source/docs/user_guide/examples/extensions_example_wrapping.py
+++ b/sphinx/source/docs/user_guide/examples/extensions_example_wrapping.py
@@ -57,7 +57,7 @@
     script = document.createElement('script')
     script.src = url
     script.async = false
-    script.onreadystatechange = s.onload = () => @_init()
+    script.onreadystatechange = script.onload = () => @_init()
     document.querySelector("head").appendChild(script)
 
   _init: () ->


Test patch: