internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: wemake-services/wemake-django-template

Issue:
Enable `django_checks` check from `django-test-migrations`
https://github.com/wemake-services/django-test-migrations/blob/master/django_test_migrations/contrib/django_checks.py#L47

@skarzi are you interested in helping me out?


Discussion:
sure! I can prepare the initial PR for this issue on the weekend
Awesome, thanks!
I have tested `django-test-migrations` from `master` branch with `wemake-django-template` on my fork [`issue-1384` branch](https://github.com/skarzi/wemake-django-template/tree/issue-1384).

Things to do/discuss:

1. `DatabaseConfiguration` checks should be mainly run before deployment (connected to production DB), so we can check that the production database is properly configured, but this will require defining `django-test-migration` as the main dependency. Personally, I dislike putting dependencies with `test` in their names to main ones, what do you think about it? Do you have any other ideas?
2. We need to release a new version of `django-test-migrations`, but it's necessary to fix `MySQL` support - check https://github.com/wemake-services/django-test-migrations/issues/122 for more details
> DatabaseConfiguration checks should be mainly run before deployment (connected to production DB), so we can check that the production database is properly configured, but this will require defining django-test-migration as the main dependency. Personally, I dislike putting dependencies with test in their names to main ones, what do you think about it? Do you have any other ideas?

Currently it lives in development only 🤔 
https://github.com/wemake-services/wemake-django-template/blob/master/%7B%7Bcookiecutter.project_name%7D%7D/server/settings/environments/development.py#L33

I guess that adding all `django-test-migrations` to prod dependencies just because of this one feature is not a good idea for our template.

It might be useful for some people, but in this case it is up to them to decide.
I will add a short doc comment about it.

Resolving patch:
diff --git a/{{cookiecutter.project_name}}/server/settings/environments/development.py b/{{cookiecutter.project_name}}/server/settings/environments/development.py
--- a/{{cookiecutter.project_name}}/server/settings/environments/development.py
+++ b/{{cookiecutter.project_name}}/server/settings/environments/development.py
@@ -26,11 +26,23 @@
 # Installed apps for development only:
 
 INSTALLED_APPS += (
+    # Better debug:
     'debug_toolbar',
     'nplusone.ext.django',
+
+    # Linting migrations:
     'django_migration_linter',
+
+    # django-test-migrations:
     'django_test_migrations.contrib.django_checks.AutoNames',
+    # This check might be useful in production as well,
+    # so it might be a good idea to move `django-test-migrations`
+    # to prod dependencies and use this check in the main `settings.py`.
+    # This will check that your database is configured properly,
+    # when you run `python manage.py check` before deploy.
     'django_test_migrations.contrib.django_checks.DatabaseConfiguration',
+
+    # django-extra-checks:
     'extra_checks',
 )
 


Test patch:
Repository: holoviz/panel

Issue:
ToggleButtons values can't be empty except at initialisation
![togglegroupbug](https://user-images.githubusercontent.com/18531147/50425433-21ef3a00-0876-11e9-9328-6a49d1461310.gif)

I made this correction in widgets.py line 446 :
replace
```
if msg.get('active', []):
    msg['value'] = [list(self.options.values())[a] for a in msg.pop('active')]
```
by:
```
if 'active' in msg:
    msg['value'] = [list(self.options.values())[a] for a in msg.pop('active')]
```
Sorry, I can't make a PR with this computer.



Discussion:

Resolving patch:
diff --git a/panel/widgets.py b/panel/widgets.py
--- a/panel/widgets.py
+++ b/panel/widgets.py
@@ -385,7 +385,7 @@ def _process_property_change(self, msg):
     def _process_param_change(self, msg):
         msg = super(Checkbox, self)._process_param_change(msg)
         if 'value' in msg:
-             msg['active'] = [0] if msg.pop('value', None) else []
+            msg['active'] = [0] if msg.pop('value', None) else []
         if 'title' in msg:
             msg['labels'] = [msg.pop('title')]
         return msg
@@ -443,7 +443,7 @@ def _process_param_change(self, msg):
 
     def _process_property_change(self, msg):
         msg = super(Select, self)._process_property_change(msg)
-        if msg.get('active', []):
+        if 'active' in msg:
             msg['value'] = [list(self.options.values())[a] for a in msg.pop('active')]
         return msg
 


Test patch:
diff --git a/panel/tests/test_widgets.py b/panel/tests/test_widgets.py
--- a/panel/tests/test_widgets.py
+++ b/panel/tests/test_widgets.py
@@ -347,6 +347,9 @@ def test_toggle_buttons(document, comm):
     select.value = [object, 'A']
     assert widget.active == [2, 0]
 
+    widget.active = []
+    select._comm_change({'active': []})
+    assert select.value == []
 
 def test_radio_buttons(document, comm):
     select = RadioButtons(options=OrderedDict([('A', 'A'), ('1', 1), ('C', object)]),
Repository: holoviz/panel

Issue:
visual changes to subway map
With the current subway map its not apparent where we are on the map. Suggestions to improve the visual effect include making the horizontal line thinner and/or the 'gray' location indicator to something more obvious like red or blue. 


Discussion:
Now that I'm thinking about it, red or blue may clash with users color scheme. Unless the ability to change it is exposed to the user.   
  
That said, the previous/next buttons are set as green. So... maybe green like them? 

Resolving patch:
diff --git a/panel/pipeline.py b/panel/pipeline.py
--- a/panel/pipeline.py
+++ b/panel/pipeline.py
@@ -187,12 +187,12 @@ def _make_progress(self):
         import holoviews.plotting.bokeh # noqa
         stages = len(self._stages)
         line = hv.Path([[(0, 0), (stages-1, 0)]]).options(
-            line_width=10, color='black', backend='bokeh'
+            line_width=6, color='black', backend='bokeh'
         )
         vals = np.arange(stages)
         active = [1 if v == self._stage else 0 for v in vals]
         points = hv.Points((vals, np.zeros(stages), active), vdims=['active']).options(
-            color_index='active', line_color='black', cmap={0: 'white', 1: 'gray'},
+            color_index='active', line_color='black', cmap={0: 'white', 1: '#5cb85c'},
             show_legend=False, size=20, default_tools=[], tools=['tap'],
             nonselection_alpha=1, backend='bokeh'
         )


Test patch:
Repository: holoviz/panel

Issue:
Replacing periodic.period doesn't change period
```
import panel as pn
pn.extension()

test = pn.widgets.Toggle(name='Test')

def toggle():
    test.value = not test.value

periodic = test.add_periodic_callback(toggle, period=1000)
test
```

```
periodic.period = 20000  #this doesnt update the periodic milliseconds
```


Discussion:
Right, we should either make it constant or setting it would have to remove the previous callback and replace it with a different one with the new period.

Resolving patch:
diff --git a/panel/callbacks.py b/panel/callbacks.py
--- a/panel/callbacks.py
+++ b/panel/callbacks.py
@@ -55,6 +55,12 @@ def start(self):
             self._cb = PeriodicCallback(self._periodic_callback, self.period)
             self._cb.start()
 
+    @param.depends('period', watch=True)
+    def _update_period(self):
+        if self._cb:
+            self.stop()
+            self.start()
+
     def _periodic_callback(self):
         self.callback()
         self._counter += 1


Test patch:
Repository: holoviz/panel

Issue:
[CONDA] Require minimum numpy version
[This line](https://github.com/pyviz/panel/blob/72e6fb47c53afc606fe7a96e4da6a3513f5c16c6/panel/layout.py#L818) does not work when using older versions of numpy.

Can be added [here](https://github.com/pyviz/panel/blob/72e6fb47c53afc606fe7a96e4da6a3513f5c16c6/setup.py#L87-L91).

Otherwise, add `dtype=object` arg.


Discussion:

Resolving patch:
diff --git a/panel/layout.py b/panel/layout.py
--- a/panel/layout.py
+++ b/panel/layout.py
@@ -807,7 +807,7 @@ def _yoffset(self):
 
     @property
     def _object_grid(self):
-        grid = np.full((self.nrows, self.ncols), None)
+        grid = np.full((self.nrows, self.ncols), None, dtype=object)
         for i, ((y0, x0, y1, x1), obj) in enumerate(self.objects.items()):
             l = 0 if x0 is None else x0
             r = self.ncols if x1 is None else x1


Test patch:
Repository: holoviz/panel

Issue:
Panel transforms plotly timestamps to numbers
Create a plotly time series curve:
```python
import numpy as np
import pandas as pd
import panel as pn
import plotly.offline as py
import plotly.graph_objs as go

pn.extension("plotly")
py.init_notebook_mode()

index = pd.date_range(start="2019-01-01", end="2019-02-01", freq="1D")
data = np.random.randn(index.size)
traces = [go.Scatter(x=index, y=data)]
```
`py.iplot(traces)` correctly displays it:
![newplot](https://user-images.githubusercontent.com/22977572/56109036-1d4ab080-5f4f-11e9-8784-1d27bbb63dd8.png)
`pn.panel(traces)` converts the timestamps to numbers:
![newplot2](https://user-images.githubusercontent.com/22977572/56109062-34899e00-5f4f-11e9-968c-8c09489b0eb7.png)

Tested with panel 0.5.1 and plotly 3.7.1


Discussion:
Suspect it has something to do with the serialization. Panel uses bokeh's JSON transforms, which are probably casting the datetimes to an integer representation not recognized by Plotly, should be a reasonably straightforward fix I hope.
I confirm the issue is still present with panel 0.6.0 and plotly 3.10.0

Resolving patch:
diff --git a/panel/pane/plotly.py b/panel/pane/plotly.py
--- a/panel/pane/plotly.py
+++ b/panel/pane/plotly.py
@@ -13,6 +13,7 @@
 import param
 
 from .base import PaneBase
+from ..util import isdatetime
 
 
 class Plotly(PaneBase):
@@ -153,6 +154,21 @@ def _update_data_sources(self, cds, trace):
 
         return update_sources
 
+    @staticmethod
+    def _plotly_json_wrapper(fig):
+        """Wraps around to_plotly_json and applies necessary fixes.
+
+        For #382: Map datetime elements to strings.
+        """
+        json = fig.to_plotly_json()
+        data = json['data']
+
+        for idx in range(len(data)):
+            for key in data[idx]:
+                if isdatetime(data[idx][key]):
+                    data[idx][key].astype(str)
+        return json
+
     def _get_model(self, doc, root=None, parent=None, comm=None):
         """
         Should return the bokeh model to be rendered.
@@ -172,7 +188,7 @@ def _get_model(self, doc, root=None, parent=None, comm=None):
             json, sources = {}, []
         else:
             fig = self._to_figure(self.object)
-            json = fig.to_plotly_json()
+            json = self._plotly_json_wrapper(fig)
             sources = Plotly._get_sources(json)
         model = PlotlyPlot(data=json.get('data', []),
                            layout=json.get('layout', {}),
@@ -209,7 +225,7 @@ def _update(self, model):
             return
 
         fig = self._to_figure(self.object)
-        json = fig.to_plotly_json()
+        json = self._plotly_json_wrapper(fig)
 
         traces = json['data']
         new_sources = []


Test patch:
Repository: holoviz/panel

Issue:
Kill all running `.show()` instances?
I'm using a slightly wacky setup (jupyter-mode in `emacs`) and I end up calling `Pane.show()` a lot. Is there an easy way to kill all previously-created `show()` servers without killing the whole process?


Discussion:

Resolving patch:
diff --git a/panel/io/server.py b/panel/io/server.py
--- a/panel/io/server.py
+++ b/panel/io/server.py
@@ -5,6 +5,7 @@
 
 import signal
 import threading
+import uuid
 
 from functools import partial
 
@@ -77,10 +78,9 @@ def get_server(panel, port=0, websocket_origin=None, loop=None,
             websocket_origin = [websocket_origin]
         opts['allow_websocket_origin'] = websocket_origin
 
-    server_id = kwargs.pop('server_id', None)
+    server_id = kwargs.pop('server_id', uuid.uuid4().hex)
     server = Server({'/': partial(panel._modify_doc, server_id)}, port=port, **opts)
-    if server_id:
-        state._servers[server_id] = (server, panel, [])
+    state._servers[server_id] = (server, panel, [])
 
     if show:
         def show_callback():
diff --git a/panel/io/state.py b/panel/io/state.py
--- a/panel/io/state.py
+++ b/panel/io/state.py
@@ -36,9 +36,23 @@ class _state(param.Parameterized):
     # An index of all currently active views
     _views = {}
 
-    # An index of all curently active servers
+    # An index of all currently active servers
     _servers = {}
 
+    def __repr__(self):
+        server_info = []
+        for server, panel, docs in self._servers.values():
+            server_info.append("{}:{:d} - {!r}".format(
+                server.address or "localhost", server.port, panel)
+            )
+        return "state(servers=\n  {}\n)".format(",\n  ".join(server_info))
+
+    def kill_all_servers(self):
+        """Stop all servers and clear them from the current state."""
+        for server_id in self._servers:
+            self._servers[server_id][0].stop()
+        self._servers = {}
+
     def _unblocked(self, doc):
         thread = threading.current_thread()
         thread_id = thread.ident if thread else None


Test patch:
Repository: holoviz/panel

Issue:
Python3.8 compatibility
python3.8 comes with a number of smaller API breaks that we need to account for, lest they become bugs as soon as people try running panel with the new version.


Discussion:

Resolving patch:
diff --git a/panel/util.py b/panel/util.py
--- a/panel/util.py
+++ b/panel/util.py
@@ -9,9 +9,13 @@
 import numbers
 import datetime as dt
 
-from collections import defaultdict, MutableSequence, MutableMapping, OrderedDict
 from datetime import datetime
 from six import string_types
+from collections import defaultdict, OrderedDict
+try:
+    from collections.abc import MutableSequence, MutableMapping
+except ImportError:  # support for python>3.8
+    from collections import MutableSequence, MutableMapping
 
 import param
 import numpy as np
@@ -77,7 +81,7 @@ def param_name(name):
     """
     Removes the integer id from a Parameterized class name.
     """
-    match = re.match('(.)+(\d){5}', name)
+    match = re.match(r'(.)+(\d){5}', name)
     return name[:-5] if match else name
 
 
diff --git a/panel/viewable.py b/panel/viewable.py
--- a/panel/viewable.py
+++ b/panel/viewable.py
@@ -740,7 +740,7 @@ def _cleanup(self, root):
             return
 
         customjs = model.select({'type': CustomJS})
-        pattern = "data\['comm_id'\] = \"(.*)\""
+        pattern = r"data\['comm_id'\] = \"(.*)\""
         for js in customjs:
             comm_ids = list(re.findall(pattern, js.code))
             if not comm_ids:


Test patch:
diff --git a/panel/_testing/fixtures.py b/panel/_testing/fixtures.py
--- a/panel/_testing/fixtures.py
+++ b/panel/_testing/fixtures.py
@@ -45,7 +45,7 @@ def hv_mpl():
 @pytest.yield_fixture
 def tmpdir(request, tmpdir_factory):
     name = request.node.name
-    name = re.sub("[\W]", "_", name)
+    name = re.sub(r"[\W]", "_", name)
     MAXVAL = 30
     if len(name) > MAXVAL:
         name = name[:MAXVAL]
Repository: holoviz/panel

Issue:
Broken image link in Django user guide
The link https://panel.pyviz.org/apps/django2/sliders.png in https://panel.pyviz.org/user_guide/Django_Apps.html doesn't seem to go anywhere; was that meant to point to https://parambokeh.pyviz.org/assets/sliders.png ?
Broken image link in Django user guide
The link https://panel.pyviz.org/apps/django2/sliders.png in https://panel.pyviz.org/user_guide/Django_Apps.html doesn't seem to go anywhere; was that meant to point to https://parambokeh.pyviz.org/assets/sliders.png ?


Discussion:
I'm trying to fix it, but building the docs proves to be a little tricky.
Ha, turns out the reason why I couldn't check if my fix was working was because my browser cached the broken link location, how utterly nice of it. Next time I try to fix something in a browser [I should blame caching](https://shouldiblamecaching.com/) from the beginning =/
@jbednar I don't see a anything `sliders.png` on that site though, I fixed the only link that I could find on that page, which happened to be broken too. Could you post a screenshot of what you mean?  
I'm trying to fix it, but building the docs proves to be a little tricky.
Ha, turns out the reason why I couldn't check if my fix was working was because my browser cached the broken link location, how utterly nice of it. Next time I try to fix something in a browser [I should blame caching](https://shouldiblamecaching.com/) from the beginning =/
@jbednar I don't see a anything `sliders.png` on that site though, I fixed the only link that I could find on that page, which happened to be broken too. Could you post a screenshot of what you mean?  

Resolving patch:
diff --git a/doc/conf.py b/doc/conf.py
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -69,7 +69,7 @@
     'deployment_url': 'https://panel-gallery.pyviz.demo.anaconda.com/'
 }
 
-_NAV =  (
+_NAV = (
     ('Getting started', 'getting_started/index'),
     ('User Guide', 'user_guide/index'),
     ('Gallery', 'gallery/index'),
@@ -88,7 +88,6 @@
     'VERSION': version,
     'WEBSITE_URL': 'https://panel.pyviz.org',
     'WEBSITE_SERVER': 'https://panel.pyviz.org',
-    'VERSION': version,
     'NAV': _NAV,
     'LINKS': _NAV,
     'SOCIAL': (
diff --git a/panel/util.py b/panel/util.py
--- a/panel/util.py
+++ b/panel/util.py
@@ -12,9 +12,9 @@
 from datetime import datetime
 from six import string_types
 from collections import defaultdict, OrderedDict
-try:
+try:  # python >= 3.3
     from collections.abc import MutableSequence, MutableMapping
-except ImportError:  # support for python>3.8
+except ImportError:
     from collections import MutableSequence, MutableMapping
 
 import param


Test patch:
Repository: holoviz/panel

Issue:
Scipy now required dependency?
The latest dev build of panel (panel-0.7.0a15-py_0) looks like it is trying to import scipy, but scipy is not among the required dependencies that are automatically installed through conda.

```
$ conda create -n panel -c pyviz/label/dev panel
...
$ conda activate panel
(panel) $ python
Python 3.7.4 (default, Aug 13 2019, 15:17:50) 
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import panel
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/rditlsc9/miniconda/envs/panel/lib/python3.7/site-packages/panel/__init__.py", line 6, in <module>
    from . import links # noqa
  File "/Users/rditlsc9/miniconda/envs/panel/lib/python3.7/site-packages/panel/links.py", line 12, in <module>
    from .pane.holoviews import HoloViews, generate_panel_bokeh_map, is_bokeh_element_plot
  File "/Users/rditlsc9/miniconda/envs/panel/lib/python3.7/site-packages/panel/pane/__init__.py", line 13, in <module>
    from .holoviews import HoloViews # noqa
  File "/Users/rditlsc9/miniconda/envs/panel/lib/python3.7/site-packages/panel/pane/holoviews.py", line 20, in <module>
    from ..widgets import Player
  File "/Users/rditlsc9/miniconda/envs/panel/lib/python3.7/site-packages/panel/widgets/__init__.py", line 12, in <module>
    from .misc import Audio, VideoStream # noqa
  File "/Users/rditlsc9/miniconda/envs/panel/lib/python3.7/site-packages/panel/widgets/misc.py", line 14, in <module>
    from scipy.io import wavfile
ModuleNotFoundError: No module named 'scipy'
```


Discussion:
That's poor review from me, this should not be imported at the top-level. I'll push a fix shortly.

Resolving patch:
diff --git a/panel/widgets/misc.py b/panel/widgets/misc.py
--- a/panel/widgets/misc.py
+++ b/panel/widgets/misc.py
@@ -11,7 +11,6 @@
 
 import param
 import numpy as np
-from scipy.io import wavfile
 
 from ..io.notebook import push
 from ..io.state import state
@@ -48,6 +47,7 @@ class Audio(Widget):
     _rename = {'name': None, 'sample_rate': None}
 
     def _from_numpy(self, data):
+        from scipy.io import wavfile
         buffer = BytesIO()
         wavfile.write(buffer, self.sample_rate, data)
         return buffer


Test patch:
Repository: holoviz/panel

Issue:
GridSpec objects attribute violates Panel interface contract
The `Panel` class provides an `objects` attribute that is expected to contain a list of child objects:

```python
class Panel(Reactive):
   ...
    objects = param.Parameter(default=[], doc="""
        The list of child objects that make up the layout.""")
```

but `GridSpec` overrides this with a dictionary:

```python
class GridSpec(Panel):
   ...
    objects = param.Dict(default={}, doc="""
        The dictionary of child objects that make up the grid.""")
```

Consequently any code that is meant to operate on a `Panel .object` list is likely to break when applied to a `GridSpec`. In particular, the `Panel._cleanup`, which is inherited by `GridSpec` will fail because iterating over the objects will return tuples instead of the actual child objects.

For this case, you could probably fix this by overriding `_cleanup` in `GridSpec` but it would not fix the underlying issue.

Observed using Panel 0.6.0.



Discussion:
Thanks, most of the code in ``Panel`` should probably just move to ``ListPanel``.
Seems like this is might not be a `good first issue` if it involves a significant API change.

Resolving patch:
diff --git a/panel/layout.py b/panel/layout.py
--- a/panel/layout.py
+++ b/panel/layout.py
@@ -24,9 +24,6 @@ class Panel(Reactive):
     Abstract baseclass for a layout of Viewables.
     """
 
-    objects = param.Parameter(default=[], doc="""
-        The list of child objects that make up the layout.""")
-
     _bokeh_model = None
 
     __abstract = True


Test patch:
Repository: holoviz/panel

Issue:
panel/examples/apps/django2/ example doesn't work
The django2 example doesn't work at least for Django 2.2. The interactive plot doesn't show up and there are no clear error messages either. However, the same example provided by ParamBokeh works fine. But I prefer Panel if this problem can be solved. 


Discussion:

Resolving patch:
diff --git a/examples/apps/django2/sliders/bk_sliders.py b/examples/apps/django2/sliders/bk_sliders.py
--- a/examples/apps/django2/sliders/bk_sliders.py
+++ b/examples/apps/django2/sliders/bk_sliders.py
@@ -5,4 +5,4 @@
 def app(doc):
     sw = SineWave()
     row = pn.Row(sw.param, sw.plot)
-    row._get_root(doc)
+    row.server_doc(doc)


Test patch:
Repository: holoviz/panel

Issue:
Typo in DataFrame example page
I'm trying out `pn.widget.DataFrame`. I noticed a typo on the example page `https://github.com/pyviz/panel/blob/45177aa5fa30c89ea26a942385bd7878e60dd323/examples/reference/widgets/DataFrame.ipynb`.    
   
Under the list of Core options, `fit_column` should be `fit_columns`.    
   
Side note: The explanation of fit_columns threw me off at first. I was thinking/hoping it would fit to minimum width based on column contents, but instead it expanded to total widget width. I see I can mostly get what I want via a `width` dict so I'll go that route, just wanted to point out it was slightly confusing.   


Discussion:

Resolving patch:
diff --git a/panel/widgets/tables.py b/panel/widgets/tables.py
--- a/panel/widgets/tables.py
+++ b/panel/widgets/tables.py
@@ -25,7 +25,7 @@ class DataFrame(Widget):
       (overrides the default chosen based on the type).""")
 
     fit_columns = param.Boolean(default=True, doc="""
-      Whether columns should be fit to the available width.
+      Whether columns should expand to the available width.
       This results in no horizontal scrollbar showing up, but data
       can get unreadable if there is no enough space available.""")
 


Test patch: