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

Issue:
Allow maximum selection for Tabulator again
In Panel <0.12.0 it was allowed to set the selectable parameter to an integer to limit the maximum of allowed selected rows.
With the tabulator widget in 0.12.0 this is no longer more possible.
Its also not possible to overwrite it via the configuration option.



Discussion:
We'll call that a regression and get it fixed for 0.12.1.

Resolving patch:
diff --git a/panel/widgets/tables.py b/panel/widgets/tables.py
--- a/panel/widgets/tables.py
+++ b/panel/widgets/tables.py
@@ -724,16 +724,16 @@ class Tabulator(BaseTable):
                                       objects=['local', 'remote'])
 
     page = param.Integer(default=1, doc="""
-        Currently selected page (indexed starting at 1).""")
+        Currently selected page (indexed starting at 1), if pagination is enabled.""")
 
     page_size = param.Integer(default=20, bounds=(1, None), doc="""
-        Number of rows to render per page.""")
+        Number of rows to render per page, if pagination is enabled.""")
 
     row_height = param.Integer(default=30, doc="""
         The height of each table row.""")
 
-    selectable = param.ObjectSelector(
-        default=True, objects=[True, False, 'checkbox', 'checkbox-single', 'toggle'], doc="""
+    selectable = param.ClassSelector(
+        default=True, class_=(bool, str, int), doc="""
         Defines the selection mode of the Tabulator.
 
           - True
@@ -747,6 +747,8 @@ class Tabulator(BaseTable):
               Same as 'checkbox' but header does not alllow select/deselect all
           - 'toggle'
               Selection toggles when clicked
+          - int
+              The maximum number of selectable rows.
         """)
 
     selectable_rows = param.Callable(default=None, doc="""


Test patch:
Repository: holoviz/panel

Issue:
Add light to list of button types
Bokeh now supports a `light` button. Please add this to the list of `button_type`.

![image](https://user-images.githubusercontent.com/42288570/137075388-5919d21a-0257-4957-af60-2ea03caccc1f.png)



Discussion:

Resolving patch:
diff --git a/panel/widgets/misc.py b/panel/widgets/misc.py
--- a/panel/widgets/misc.py
+++ b/panel/widgets/misc.py
@@ -54,7 +54,7 @@ class FileDownload(Widget):
         right-click save as.""")
 
     button_type = param.ObjectSelector(default='default', objects=[
-        'default', 'primary', 'success', 'warning', 'danger'])
+        'default', 'primary', 'success', 'warning', 'danger', 'light'])
 
     callback = param.Callable(default=None, doc="""
         A callable that returns the file path or file-like object.""")


Test patch:
Repository: holoviz/panel

Issue:
option_limit of MultiChoice widget doesn't work when typing initials
The option_limit allows specifying how many items to display in the MultiChoice widget. When setting it > 4, it works when nothing is in the input widget: 

<img width="311" alt="image" src="https://user-images.githubusercontent.com/3037080/130988155-5007ce2f-b9b6-426e-948c-435ab02548c7.png">

However, when any string is used to search item initials, only 4 items will be displayed.
<img width="308" alt="image" src="https://user-images.githubusercontent.com/3037080/130988252-c35eee8b-0868-4c85-a8a5-c8948d5d2c2c.png">

Is it possible to allow option_limit to work when searching from the choices?



Discussion:
Thanks for pointing out. I was about to post the same issue. 
Also without setting option_limit it would be helpful, to be able to scroll through all proposed list items after filtering with search string. 
Edit:
This seems to be a standard setting (searchResultLimit:4) from the choices.js that is used for this widget, coming from bokeh;
https://github.com/bokeh/bokeh/issues/10525#issuecomment-809627423
Unfortunately I am a total noob regarding JS, so I couldn´t find out a workaround (for example modify the multichoice.js file in "Lib\site-packages\bokeh\server\static\js\lib\models\widgets\MultiChoice.js" and reset the option. I guess the JS code is compiled at some point, I don´t know).

Edit2:
 As a workaround (ugly, I know), I replaced the standard value for "searchResultLimit" in
"\Lib\site-packages\bokeh\server\static\js\bokeh-widgets.min.js" from 4 to the desired value (for example 100) and it worked.



Resolving patch:
diff --git a/panel/widgets/select.py b/panel/widgets/select.py
--- a/panel/widgets/select.py
+++ b/panel/widgets/select.py
@@ -196,7 +196,10 @@ class MultiChoice(_MultiSelectBase):
 
     option_limit = param.Integer(default=None, bounds=(1, None), doc="""
         Maximum number of options to display at once.""")
-
+    
+    search_option_limit = param.Integer(default=None, bounds=(1, None), doc="""
+        Maximum number of options to display at once if search string is entered.""")
+    
     placeholder = param.String(default='', doc="""
         String displayed when no selection has been made.""")
 


Test patch:
Repository: holoviz/panel

Issue:
panel examples gives UnboundLocalError
#### ALL software version info
panel 0.12.4

#### Description of expected behavior and the observed behavior
`$ panel examples` doesn't raise an error

#### Complete, minimal, self-contained example code that reproduces the issue

Was taking a look at https://panel.holoviz.org/#id1

```
panel examples
```

#### Stack traceback and/or browser JavaScript console output

#### Screenshots or screencasts of the bug in action

<img width="846" alt="Screen Shot 2021-11-04 at 9 23 56 PM" src="https://user-images.githubusercontent.com/17162724/140442696-82e6c5c2-4cd6-40f6-821d-47c87f5e1541.png">




Discussion:

Resolving patch:
diff --git a/panel/command/__init__.py b/panel/command/__init__.py
--- a/panel/command/__init__.py
+++ b/panel/command/__init__.py
@@ -102,6 +102,7 @@ def main(args=None):
             print("install pyct to enable this command (e.g. `conda install -c pyviz pyct` or `pip install pyct[cmd]`)")
             sys.exit(1)
         pyct.cmd.substitute_main('panel', cmds=pyct_commands, args=args)
+        sys.exit()
     else:
         parser.parse_args(sys.argv[1:])
         sys.exit(1)


Test patch:
Repository: holoviz/panel

Issue:
HoloViews Colorbar not styled for dark themed template
Panel: 0.12.4

The ColorBar is unreadable when using the `FastListTemplate` with the `dark` theme.

I would like this to work for an example I am contributing to the `scikit-image` docs.

![image](https://user-images.githubusercontent.com/42288570/140877887-22a08468-97dc-422b-bc5b-0e02496a07a9.png)

```python
import holoviews as hv
import panel as pn
from skimage import data, filters

image = data.coins()
edges = filters.sobel(image)*256
bounds = (-1, -1, 1, 1)

after_img = hv.Image(edges, bounds=bounds).apply.opts(
    cmap="binary_r", responsive=True, title="After", active_tools=["box_zoom"], tools=["hover"], colorbar=True
)

layout=pn.panel(after_img, height=800, aspect_ratio=1)

pn.template.FastListTemplate(
    site="Panel and Scikit-Image",
    main=[layout],
    header_background="#292929",
    theme="dark",
).servable()
```

## How do I fix this?

I would like to contribute a PR. I assume I would have to update the Bokeh Theme generation here https://github.com/holoviz/panel/blob/396ce2f37473a047e4721a1431e6795374686533/panel/template/fast/theme.py#L62.

I can now see that I need to change to

![image](https://user-images.githubusercontent.com/42288570/140878649-40f2f03f-cbf1-4520-83b0-5b0ffacadc12.png)

![image](https://user-images.githubusercontent.com/42288570/140878711-8f380e61-f8da-448b-b2c2-151a017568a4.png)



Discussion:

Resolving patch:
diff --git a/panel/template/fast/theme.py b/panel/template/fast/theme.py
--- a/panel/template/fast/theme.py
+++ b/panel/template/fast/theme.py
@@ -100,6 +100,7 @@ def create_bokeh_theme(self):
                     "background_fill_color": self.neutral_fill_card_rest,
                 },
                 "ColorBar": {
+                    "background_fill_color": self.background_color,
                     "title_text_color": self.neutral_foreground_rest,
                     "title_text_font": self.font,
                     "title_text_font_size": "1.025em",
@@ -107,7 +108,6 @@ def create_bokeh_theme(self):
                     "major_label_text_color": self.neutral_foreground_rest,
                     "major_label_text_font": self.font,
                     "major_label_text_font_size": "1.025em",
-                    # "background_fill_color": FAST_DARK_75,
                     "major_tick_line_alpha": 0,
                     "bar_line_alpha": 0,
                 },


Test patch:
Repository: holoviz/panel

Issue:
TQDM removes text color set by user via style parameter
See https://discourse.holoviz.org/t/tdqm-text-color-change/3193

I will put in a fix now.
TQDM removes text color set by user via style parameter
See https://discourse.holoviz.org/t/tdqm-text-color-change/3193

I will put in a fix now.


Discussion:

Resolving patch:
diff --git a/panel/widgets/indicators.py b/panel/widgets/indicators.py
--- a/panel/widgets/indicators.py
+++ b/panel/widgets/indicators.py
@@ -714,8 +714,9 @@ def __init__(self, *args, **kwargs):
     def display(self, msg=None, pos=None, bar_style=None):
         super().display(msg, pos)
         style = self._indicator.text_pane.style or {}
-        color = self.colour or 'black'
-        self._indicator.text_pane.style = dict(style, color=color)
+        if not "color" in style:
+            color = self.colour or 'black'
+            self._indicator.text_pane.style = dict(style, color=color)
         if self.total is not None and self.n is not None:
             self._indicator.max = int(self.total) # Can be numpy.int64
             self._indicator.value = int(self.n)


Test patch:
diff --git a/panel/tests/widgets/test_indicators.py b/panel/tests/widgets/test_indicators.py
--- a/panel/tests/widgets/test_indicators.py
+++ b/panel/tests/widgets/test_indicators.py
@@ -1,6 +1,6 @@
 import pytest
 
-from panel.widgets.indicators import Dial, Gauge, Number
+from panel.widgets.indicators import Dial, Gauge, Number, Tqdm
 
 def test_number_none(document, comm):
     number = Number(value=None, name='Value')
@@ -98,3 +98,10 @@ def test_gauge_bounds():
 
     with pytest.raises(ValueError):
         dial.value = 100
+
+def test_tqdm_color():
+    tqdm = Tqdm()
+    tqdm.text_pane.style={'color': 'green'}
+    for _ in tqdm(range(0,2)):
+        pass
+    assert tqdm.text_pane.style["color"]=="green"
Repository: holoviz/panel

Issue:
Custom theme is not not applied
#### ALL software version info
Version 0.12.6. Problem can also be reproed using latest code available in the repo.

#### Description of expected behavior and the observed behavior
When using a css theme that is not located the BUNDLE_DIR, the BasicTemplate ignores the provided value, and uses the base_css instead.

#### Complete, minimal, self-contained example code that reproduces the issue

This is closely following the example from https://panel.holoviz.org/user_guide/Templates.html:
``` python
import param
import pathlib
from panel.template import BootstrapTemplate
from panel.template.theme import DefaultTheme, Theme

class BootstrapAcfTheme(DefaultTheme):
     # To repro the issue, the css provided here should not be in the BUNDLE_DIR
    css = param.Filename(default=pathlib.Path(__file__).parent / 'bootstrap-acf.css')
    _template = BootstrapTemplate

#Providing my own theme to the BootstrapTemplate
bootstrap_theme = BootstrapTemplate(title='Autocorrelation function', theme=BootstrapAcfTheme)
bootstrap_theme.show()
```
Upon rendering the page, the `{{ raw_css }}` tag from the template is replaced by the base_css instead of the content of `bootstrap-acf.css`. The served web page contains the following snippet, which comes from `\panel\template\theme\default.css`
```css
...
<style type="text/css">
#header {
  background-color: #00aa41;
}
</style>
```

#### Code
This issue seems to be due to a cut and paste error. Line 620 uses `theme.base_css`, I am quite certain that it should use `theme.css` instead. Line 620 is an exact copy of line 613. 
https://github.com/holoviz/panel/blob/007475dbb7de30373fe7111348d4fa020d446ac9/panel/template/base.py#L615-L621

I'll provide a PR that corrects this.



Discussion:

Resolving patch:
diff --git a/panel/template/base.py b/panel/template/base.py
--- a/panel/template/base.py
+++ b/panel/template/base.py
@@ -617,7 +617,7 @@ def _template_resources(self):
                     if (BUNDLE_DIR / name / basename).is_file():
                         css_files['theme'] = dist_path + f'bundled/{name}/{basename}'
                     else:
-                        with open(theme.base_css, encoding='utf-8') as f:
+                        with open(theme.css, encoding='utf-8') as f:
                             raw_css.append(f.read())
 
         return {


Test patch:
Repository: holoviz/panel

Issue:
Django autoload_handle broken
#### ALL software version info
Panel =  0.13.0a25
Bokeh  = 2.4.2
Django = 2.2.14

When loading a Panel app embedded in Django, the `AutoloadJsConsumer` call just hangs. After stepping through the code it 
appears there is an error, which causes it to enter an eternal loop:

```python
> /Users/rditlsc9/miniconda/envs/tethys-vtime/lib/python3.7/site-packages/panel/io/django.py(37)autoload_handle()
-> js = autoload_js_script(resources, session.token, element_id, app_path, absolute_url)

TypeError: autoload_js_script() missing 1 required positional argument: 'absolute_url'
```

It appears that #2919 changed the signature of `autoload_js_script`, but the call to it in `panel/io/django.py:autoload_handle` wasn't updated accordingly.


As a side note - is there a better way to get this type of error to log? I wasn't able to see any indication of an error until I stepped through the code in a debugger.



Discussion:

Resolving patch:
diff --git a/panel/io/django.py b/panel/io/django.py
--- a/panel/io/django.py
+++ b/panel/io/django.py
@@ -34,7 +34,7 @@ async def autoload_handle(self, body):
         server_url = None
 
     resources = self.resources(server_url)
-    js = autoload_js_script(resources, session.token, element_id, app_path, absolute_url)
+    js = autoload_js_script(session.document, resources, session.token, element_id, app_path, absolute_url)
 
     headers = [
         (b"Access-Control-Allow-Headers", b"*"),


Test patch:
Repository: holoviz/panel

Issue:
Add files to `__init__` for autocomplete in VS Code
When writing in vs code the autocomplete only works for modules imported in an `__init__.py` file, e.g. `pn.widgets.IntSlider` work but `pn.viewable.Viewer` does not.  See here:

https://user-images.githubusercontent.com/19758978/150685703-a235b219-6052-4e6e-b1f5-b121dc1f1558.mp4

The solution is pretty easy as `.viewable` only needs to be added to the `__init__`.

https://user-images.githubusercontent.com/19758978/150685758-3b1e5468-bcbe-4337-a62a-f3a4da8d9caf.mp4

I don't know if #3132 will fix this. When you have time @MarcSkovMadsen can you check this? 


Discussion:
I don't expect #3132 to fix it.

Resolving patch:
diff --git a/panel/__init__.py b/panel/__init__.py
--- a/panel/__init__.py
+++ b/panel/__init__.py
@@ -3,6 +3,8 @@
 from . import pane # noqa
 from . import param # noqa
 from . import pipeline # noqa
+from . import reactive # noqa
+from . import viewable # noqa
 from . import widgets # noqa
 
 from .config import config, panel_extension as extension, __version__ # noqa


Test patch:
Repository: holoviz/panel

Issue:
Updating BooleanStatus color doesn't work
```
import panel as pn
pn.extension()
true_status = pn.indicators.BooleanStatus(value=True)
true_status
```

In another cell
```

true_status.color = "danger"
```


Discussion:

Resolving patch:
diff --git a/panel/widgets/indicators.py b/panel/widgets/indicators.py
--- a/panel/widgets/indicators.py
+++ b/panel/widgets/indicators.py
@@ -64,18 +64,19 @@ class BooleanStatus(BooleanIndicator):
     value = param.Boolean(default=False, doc="""
         Whether the indicator is active or not.""")
 
-    _rename = {'color': None}
+    _rename = {}
 
-    _source_transforms = {'value': None}
+    _source_transforms = {'value': None, 'color': None}
 
     _widget_type = HTML
 
     def _process_param_change(self, msg):
         msg = super()._process_param_change(msg)
         value = msg.pop('value', None)
-        if value is None:
+        color = msg.pop('color', None)
+        if value is None and not color:
             return msg
-        msg['css_classes'] = ['dot-filled', self.color] if value else ['dot']
+        msg['css_classes'] = ['dot-filled', self.color] if self.value else ['dot']
         return msg
 
 
@@ -96,19 +97,21 @@ class LoadingSpinner(BooleanIndicator):
     value = param.Boolean(default=False, doc="""
         Whether the indicator is active or not.""")
 
-    _rename = {'color': None, 'bgcolor': None}
+    _rename = {}
 
-    _source_transforms = {'value': None}
+    _source_transforms = {'value': None, 'color': None, 'bgcolor': None}
 
     _widget_type = HTML
 
     def _process_param_change(self, msg):
         msg = super()._process_param_change(msg)
         value = msg.pop('value', None)
-        if value is None:
+        color = msg.pop('color', None)
+        bgcolor = msg.pop('bgcolor', None)
+        if value is None and not (color or bgcolor):
             return msg
         color_cls = f'{self.color}-{self.bgcolor}'
-        msg['css_classes'] = ['loader', 'spin', color_cls] if value else ['loader', self.bgcolor]
+        msg['css_classes'] = ['loader', 'spin', color_cls] if self.value else ['loader', self.bgcolor]
         return msg
 
 


Test patch:
Repository: holoviz/panel

Issue:
CrossSelector does not respect disabled=True
#### ALL software version info
panel = "0.13.0a46"

#### Description of expected behavior and the observed behavior

When setting `disabled=True`, the CrossSelector widget remains editable.

The expected behavior should be readonly.

#### Complete, minimal, self-contained example code that reproduces the issue

```
import panel as pn

pn.extension()

cross_selector = pn.widgets.CrossSelector(
    name="Fruits",
    value=["Apple", "Pear"],
    options=["Apple", "Banana", "Pear", "Strawberry"],
    disabled=True,
)


pn.Row(cross_selector).show()


```




Discussion:

Resolving patch:
diff --git a/panel/widgets/select.py b/panel/widgets/select.py
--- a/panel/widgets/select.py
+++ b/panel/widgets/select.py
@@ -636,6 +636,8 @@ def __init__(self, **params):
         self._selections = {False: [], True: []}
         self._query = {False: '', True: ''}
 
+        self._update_disabled()
+
     @param.depends('size', watch=True)
     def _update_size(self):
         self._lists[False].size = self.size


Test patch:
Repository: holoviz/panel

Issue:
FileInput broken in panel v0.13.1
The .save function of the FileInput widget only takes the first character passed. This can be reproduced with the code from the documentation;

```
file_input = pn.widgets.FileInput()
file_input #print widget and upload any file, for example a simple image
file_input.save("test.png")
```
This will create a file simply called "t" without any extension. It appears only the first character, rather than the whole string, is passed. 

For now the workaround would be to use io.BytesIO, but this makes things needlessly complicated when the goal is to simply upload a file. 


Discussion:

Resolving patch:
diff --git a/panel/widgets/input.py b/panel/widgets/input.py
--- a/panel/widgets/input.py
+++ b/panel/widgets/input.py
@@ -168,9 +168,9 @@ def save(self, filename):
                 "filenames was given. Please provide a single filename "
                 "or file-like object."
             )
-        elif not isinstance(value, list):
+        if not isinstance(value, list):
             value = [self.value]
-        elif not isinstance(filename, list):
+        if not isinstance(filename, list):
             filename = [filename]
 
         for val, fn in zip(value, filename):
diff --git a/panel/widgets/player.py b/panel/widgets/player.py
--- a/panel/widgets/player.py
+++ b/panel/widgets/player.py
@@ -12,7 +12,7 @@
 class PlayerBase(Widget):
 
     interval = param.Integer(default=500, doc="""
-        Interval between updates, in milliseconds. Default is 500, i.e. 
+        Interval between updates, in milliseconds. Default is 500, i.e.
         two updates per second.""")
 
     loop_policy = param.ObjectSelector(default='once',


Test patch:
diff --git a/panel/tests/widgets/test_input.py b/panel/tests/widgets/test_input.py
--- a/panel/tests/widgets/test_input.py
+++ b/panel/tests/widgets/test_input.py
@@ -1,4 +1,5 @@
 from datetime import date, datetime
+from pathlib import Path
 
 import numpy as np
 import pytest
@@ -346,3 +347,20 @@ def test_array_input(document, comm):
     array_input.value = np.array([1, 2, 3])
     assert not widget.disabled
     assert not array_input._auto_disabled
+
+
+def test_file_input_save_one_file(document, comm, tmpdir):
+    file_input = FileInput(accept='.txt')
+
+    widget = file_input.get_root(document, comm=comm)
+
+    assert isinstance(widget, BkFileInput)
+
+    file_input._process_events({'mime_type': 'text/plain', 'value': 'U29tZSB0ZXh0Cg==', 'filename': 'testfile'})
+
+    fpath = Path(tmpdir) / 'out.txt'
+    file_input.save(str(fpath))
+
+    assert fpath.exists()
+    content = fpath.read_text()
+    assert content == 'Some text\n'
Repository: holoviz/panel

Issue:
PANEL_OAUTH_PROVIDER not used

#### ALL software version info
Panel 0.13.1

#### Description of expected behavior and the observed behavior

Setting PANEL_OAUTH_PROVIDER is ignored, authentication is only used when passing --oauth-provider to panel serve. The authentication user guide suggests otherwise
"the `oauth_provider` can be set on the commandline using the `--oauth-provider` CLI argument to `panel serve` or the `PANEL_OAUTH_PROVIDER` environment variable"



Discussion:

Resolving patch:
diff --git a/panel/command/serve.py b/panel/command/serve.py
--- a/panel/command/serve.py
+++ b/panel/command/serve.py
@@ -351,8 +351,14 @@ def customize_kwargs(self, args, server_kwargs):
                 )
             config.nthreads = args.num_threads
 
+        if args.oauth_provider and config.oauth_provider:
+                raise ValueError(
+                    "Supply OAuth provider either using environment variable "
+                    "or via explicit argument, not both."
+                )
         if args.oauth_provider:
             config.oauth_provider = args.oauth_provider
+        if config.oauth_provider:
             config.oauth_expiry = args.oauth_expiry_days
             if config.oauth_key and args.oauth_key:
                 raise ValueError(


Test patch: