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

Issue:
Add support for Django's redirect app to wafer
It's useful to be able to add a redirect if a page is moved to a different point in the hierachy.

Django's already got support for this, so we should leverage that.

The potentially problematic part is how this iteracts with the static site generation, as django-medusa's handling of redirects is far from ideal.



Discussion:

Resolving patch:
diff --git a/wafer/settings.py b/wafer/settings.py
--- a/wafer/settings.py
+++ b/wafer/settings.py
@@ -107,6 +107,7 @@
     'django.middleware.csrf.CsrfViewMiddleware',
     'django.contrib.auth.middleware.AuthenticationMiddleware',
     'django.contrib.messages.middleware.MessageMiddleware',
+    'django.contrib.redirects.middleware.RedirectFallbackMiddleware',
     # Uncomment the next line for simple clickjacking protection:
     # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 )
@@ -143,6 +144,7 @@
     'django.contrib.sites',
     'django.contrib.messages',
     'django.contrib.staticfiles',
+    'django.contrib.redirects',
     'reversion',
     'django_medusa',
     'crispy_forms',


Test patch:
Repository: CTPUG/wafer

Issue:
Schedule Editor does not clear extra fields on existing items
When replacing an existing item in the schedule editor, the notes, css_class and details fields are not replaced or cleared.

While this can be useful to leave css_class untouched, it is surprising behaviour and usually the wrong thing to do for notes  and details. 

I think we must clear notes and details when this happens.

We should probably clear all extra fields when replacing an item, for the sake of predictablity,



Discussion:

Resolving patch:
diff --git a/wafer/schedule/serializers.py b/wafer/schedule/serializers.py
--- a/wafer/schedule/serializers.py
+++ b/wafer/schedule/serializers.py
@@ -34,6 +34,12 @@ def create(self, validated_data):
             existing_schedule_item.talk = talk
             existing_schedule_item.page = page
             existing_schedule_item.slots = slots
+            # Clear any existing details that aren't editable by the
+            # schedule edit view
+            existing_schedule_item.details = ''
+            existing_schedule_item.notes = ''
+            existing_schedule_item.css_class = ''
+            existing_schedule_item.expand = False
             existing_schedule_item.save()
             return existing_schedule_item
         return super(ScheduleItemSerializer, self).create(validated_data)


Test patch:
Repository: CTPUG/wafer

Issue:
Add support for Django 4.0
Currently failing tests (See #632)


Discussion:
Given the status of django-nose, it looks like supporting django 4 will require changing to a different test runner.
Looking at our dependencies, a blocking issue is https://github.com/palewire/django-bakery/issues/160

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -8,7 +8,7 @@
     'bleach',
     'bleach-allowlist',
     'diff-match-patch',
-    'django-bakery>=0.12.0',
+    'django-bakery>=0.13.0',
     'django-crispy-forms',
     'django-markitup>=4.0.0',
     'django-registration-redux',


Test patch:
Repository: CTPUG/wafer

Issue:
icalendar 5.0 breaks the tests
With icalendar 5.0, the test_ics_view test fails with
```
File "/home/runner/work/wafer/wafer/wafer/schedule/tests/test_views.py", line 1526, in test_ics_view
20
    self.assertEqual(event['dtstart'].params['value'], 'DATE-TIME')
21
  File "/opt/hostedtoolcache/Python/3.7.15/x64/lib/python3.7/site-packages/icalendar/caselessdict.py", line 40, in __getitem__
22
    return super().__getitem__(key.upper())
23
KeyError: 'VALUE'
```

but it works fine with 4.1

There's nothing obvious in the icalendar changelog about this behaviour change, so more investriagtion is needed.



Discussion:
Odd. What is in `event['dtstart'].params`?
It's contains some metadata about the ical record - the test uses as part of the test that times are exported correctly.

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -16,7 +16,7 @@
     'django-select2',
     'djangorestframework',
     'drf-extensions>=0.5.0',
-    'icalendar>=4.0,<5.0',
+    'icalendar>=4.0',
     'jsonfield',
     'markdown>=2.5',
     'pillow',


Test patch:
diff --git a/wafer/schedule/tests/test_views.py b/wafer/schedule/tests/test_views.py
--- a/wafer/schedule/tests/test_views.py
+++ b/wafer/schedule/tests/test_views.py
@@ -1523,7 +1523,6 @@ def test_ics_view(self):
         self.assertEqual(len(calendar.walk(name='VEVENT')), 9)
         # Check we have the right time in places
         event = calendar.walk(name='VEVENT')[0]
-        self.assertEqual(event['dtstart'].params['value'], 'DATE-TIME')
         self.assertEqual(event['dtstart'].dt, D.datetime(2013, 9, 22, 10, 0, 0, tzinfo=D.timezone.utc))
         # Check that we have the page slug in the ical event
         self.assertTrue('/test0/' in event['url'])
Repository: biolab/orange3-text

Issue:
Maps not properly sized in some cases
Some users get

![geomap](https://cloud.githubusercontent.com/assets/684364/8672710/4290e938-2a31-11e5-88ed-aac5fd26a36c.png)
![geomap](https://cloud.githubusercontent.com/assets/684364/8672721/5ae99bec-2a31-11e5-9441-5166337bc06b.png)

> pognal owgeomap.py file: pokaze svet raztegnjen cez celo sirino okna (visina ni cela), ce zamenjam na europe dobim majhno slikico, po resize-u okna se malo izboljsa (slika 2).

Qt\* version likely not culprit.

cc: @BlazZupan @lanzagar

Maps not properly sized in some cases
Some users get

![geomap](https://cloud.githubusercontent.com/assets/684364/8672710/4290e938-2a31-11e5-88ed-aac5fd26a36c.png)
![geomap](https://cloud.githubusercontent.com/assets/684364/8672721/5ae99bec-2a31-11e5-9441-5166337bc06b.png)

> pognal owgeomap.py file: pokaze svet raztegnjen cez celo sirino okna (visina ni cela), ce zamenjam na europe dobim majhno slikico, po resize-u okna se malo izboljsa (slika 2).

Qt\* version likely not culprit.

cc: @BlazZupan @lanzagar



Discussion:

Resolving patch:
diff --git a/orangecontrib/text/widgets/owgeomap.py b/orangecontrib/text/widgets/owgeomap.py
--- a/orangecontrib/text/widgets/owgeomap.py
+++ b/orangecontrib/text/widgets/owgeomap.py
@@ -73,17 +73,18 @@ def _create_layout(self):
 <html>
 <head>
 <meta charset="utf-8">
+<base href="file://{}/"/>
 <style>
-html, body, #map {margin:0px;padding:0px;width:100%;height:100%;}
+html, body, #map {{margin:0px;padding:0px;width:100%;height:100%;}}
 </style>
 <link  href="resources/jquery-jvectormap-2.0.2.css" rel="stylesheet">
 </head>
 <body>
 <div id="map"></div>
 </body>
-</html>'''
+</html>'''.format(path.abspath(path.dirname(__file__)))
         self.webview = gui.WebviewWidget(self.controlArea, self, debug=True)
-        self.webview.setHtml(html, 'file://{}/'.format(path.dirname(__file__)))
+        self.webview.setHtml(html)
         for script in ('jquery-2.1.4.min.js',
                        'jquery-jvectormap-2.0.2.min.js',
                        'jquery-jvectormap-world-mill-en.js',


Test patch:
Repository: biolab/orange3-text

Issue:
Preprocessor: Pressing Enter Turns ON/OFF Other Preprocessors' Modules
Clicking `Enter` with focus either inside the Regexp tokenizer's Pattern (lineEdit) or any where else in the widget causes strange behaviour of toggling either Transformation or Normalization widgets' ON/OFF buttons. I suspect the problem is in how we handle `keyPressEvent` signals.

Preprocessor: Pressing Enter Turns ON/OFF Other Preprocessors' Modules
Clicking `Enter` with focus either inside the Regexp tokenizer's Pattern (lineEdit) or any where else in the widget causes strange behaviour of toggling either Transformation or Normalization widgets' ON/OFF buttons. I suspect the problem is in how we handle `keyPressEvent` signals.



Discussion:

Resolving patch:
diff --git a/orangecontrib/text/widgets/owpreprocess.py b/orangecontrib/text/widgets/owpreprocess.py
--- a/orangecontrib/text/widgets/owpreprocess.py
+++ b/orangecontrib/text/widgets/owpreprocess.py
@@ -36,6 +36,7 @@ def __init__(self, enabled=True, on_button='on_button.png', off_button='off_butt
         super().__init__(*__args)
         self.on_icon = QtGui.QIcon(_i(on_button))
         self.off_icon = QtGui.QIcon(_i(off_button))
+        self.setAutoDefault(False)      # do not toggle on Enter
         self.setFlat(True)
         self.setIconSize(QtCore.QSize(*size))
         self.setStyleSheet('border:none')


Test patch:
Repository: biolab/orange3-text

Issue:
Preprocessor: Toggling ON/OFF Runs Preprocessing Twice
When enabling/disabling preprocessor modules whole preprocessing is run twice whereas it should be run only once.

Preprocessor: Toggling ON/OFF Runs Preprocessing Twice
When enabling/disabling preprocessor modules whole preprocessing is run twice whereas it should be run only once.



Discussion:

Resolving patch:
diff --git a/orangecontrib/text/widgets/owpreprocess.py b/orangecontrib/text/widgets/owpreprocess.py
--- a/orangecontrib/text/widgets/owpreprocess.py
+++ b/orangecontrib/text/widgets/owpreprocess.py
@@ -147,7 +147,6 @@ def on_toggle(self):
         # Activated when the widget is enabled/disabled.
         self.enabled = not self.enabled
         self.display_widget()
-        self.change_signal.emit()
 
     def display_widget(self):
         if self.enabled:


Test patch:
Repository: biolab/orange3-text

Issue:
GeoMap counting doesn't eliminate duplicates inside documents
With `Locations` attribute for NY Times sometimes you get a result: `Ljubljana (Slovenia), Slovenia, Europe (Slovenia),` which would count Slovenia 3 times instead of once. For a specific county a given document should not increment the count for more than one.


Discussion:

Resolving patch:
diff --git a/orangecontrib/text/widgets/owgeomap.py b/orangecontrib/text/widgets/owgeomap.py
--- a/orangecontrib/text/widgets/owgeomap.py
+++ b/orangecontrib/text/widgets/owgeomap.py
@@ -127,13 +127,14 @@ def on_map_change(self, map_code=''):
 
         inv_cc_map, cc_map = {Map.USA: (INV_CC_USA, CC_USA),
                               Map.WORLD: (INV_CC_WORLD, CC_WORLD),
-                              Map.EUROPE: (INV_CC_EUROPE, CC_EUROPE)} [map_code]
-        # Set country counts in JS
+                              Map.EUROPE: (INV_CC_EUROPE, CC_EUROPE)}[map_code]
+        # Set country counts for JS
         data = defaultdict(int)
-        for cc in getattr(self, 'cc_counts', ()):
-            key = inv_cc_map.get(cc, cc)
-            if key in cc_map:
-                data[key] += self.cc_counts[cc]
+        for locations in self._iter_locations():
+            keys = set(inv_cc_map.get(loc, loc) for loc in locations)
+            for key in keys:
+                if key in cc_map:
+                    data[key] += 1
         # Draw the new map
         self.webview.evalJS('DATA = {};'
                             'MAP_CODE = "{}";'
@@ -145,12 +146,8 @@ def on_map_change(self, map_code=''):
     def on_attr_change(self):
         if not self.selected_attr:
             return
-        attr = self.data.domain[self.selected_attr]
-        self.cc_counts = Counter(chain.from_iterable(
-            set(name.strip() for name in CC_NAMES.findall(i.lower())) if len(i) > 3 else (i,)
-            for i in self.data.get_column_view(self.data.domain.index(attr))[0]))
+        values = set(chain.from_iterable(self._iter_locations()))
         # Auto-select region map
-        values = set(self.cc_counts)
         if 0 == len(values - SET_CC_USA):
             map_code = Map.USA
         elif 0 == len(values - SET_CC_EUROPE):
@@ -159,6 +156,16 @@ def on_attr_change(self):
             map_code = Map.WORLD
         self.on_map_change(map_code)
 
+    def _iter_locations(self):
+        """ Iterator that yields an iterable per documents with all its's
+        locations. """
+        attr = self.data.domain[self.selected_attr]
+        for i in self.data.get_column_view(self.data.domain.index(attr))[0]:
+            if len(i) > 3:
+                yield map(lambda x: x.strip(), CC_NAMES.findall(i.lower()))
+            else:
+                yield (i, )
+
 
 def main():
     from Orange.data import Table, Domain, StringVariable


Test patch:
Repository: biolab/orange3-text

Issue:
Chardet fails on Slovenian characters
Preprocess Text fails with Slovenian stopword list. Seems like a chardet issue.


Discussion:

Resolving patch:
diff --git a/orangecontrib/text/preprocess/filter.py b/orangecontrib/text/preprocess/filter.py
--- a/orangecontrib/text/preprocess/filter.py
+++ b/orangecontrib/text/preprocess/filter.py
@@ -1,6 +1,7 @@
 import os
-
 import re
+
+from Orange.data.io import detect_encoding
 from gensim import corpora
 from nltk.corpus import stopwords
 
@@ -45,7 +46,8 @@ def from_file(self, path):
         if not path:
             self.word_list = []
         else:
-            with open(path) as f:
+            enc = detect_encoding(path)
+            with open(path, encoding=enc) as f:
                 self.word_list = set([line.strip() for line in f])
 
 


Test patch:
Repository: biolab/orange3-text

Issue:
SharedComputValues Don't have Variable Property
<!--
This is an issue template. Please fill in the relevant details in the
sections below.
-->

##### Text version
<!-- From menu _Options→Add-ons→Orange3-Text_ or code `orangecontrib.text.version.full_version` -->
0.2.4.dev

##### Orange version
<!-- From menu _Help→About→Version_ or code `Orange.version.full_version` -->
3.5.dev

##### Expected behavior
SharedComputeValue has a reference to the original variable the same way as other ComputeValues have it.


##### Actual behavior
SharedComputeValue doesn't have a reference to the original variable. Hence when working with bag of words data in nomogram on logistic regression fails with `AttributeError: 'BoWComputeValue' object has no attribute 'variable'`


##### Steps to reproduce the behavior
Pass logistic regression trained on BoW data to nomogram.

##### Additional info (worksheets, data, screenshots, ...)
![screen shot 2017-03-31 at 17 03 30](https://cloud.githubusercontent.com/assets/713026/24556235/fd8ae4ec-1633-11e7-84a1-1d15cfecaa2f.png)



Discussion:

Resolving patch:
diff --git a/orangecontrib/text/corpus.py b/orangecontrib/text/corpus.py
--- a/orangecontrib/text/corpus.py
+++ b/orangecontrib/text/corpus.py
@@ -164,6 +164,8 @@ def extend_attributes(self, X, feature_names, feature_values=None,
                 var = DiscreteVariable(f, values=values, compute_value=cv)
             else:
                 var = ContinuousVariable(f, compute_value=cv)
+            if cv is not None:  # set original variable for cv
+                cv.variable = var
             if isinstance(var_attrs, dict):
                 var.attributes.update(var_attrs)
             new_attr += (var, )


Test patch:
Repository: biolab/orange3-text

Issue:
Preprocess Text: empty Tagger (Stanford) results in segfault 
Corpus (bookexcerpts) - Preprocess Text - turn on POS Tagger - select Tagger (window opens) - don't select any tagger, just use cancel).

Procedure results in segfault.

Perhaps disable Tagger if Model empty or otherwise prevent segfaulting.


Discussion:
Can you step through it to see where it crashes? Can't reproduce on Linux, PyQt5.8.

Resolving patch:
diff --git a/orangecontrib/text/widgets/utils/widgets.py b/orangecontrib/text/widgets/utils/widgets.py
--- a/orangecontrib/text/widgets/utils/widgets.py
+++ b/orangecontrib/text/widgets/utils/widgets.py
@@ -293,7 +293,8 @@ def browse(self, start_dir=None):
             self.recent_files.insert(0, path)
             self.update_combo()
 
-        self.open_file(path)
+        if path:
+            self.open_file(path)
 
     def select(self, n):
         name = self.file_combo.currentText()


Test patch:
Repository: biolab/orange3-text

Issue:
Corpus Viewer: wrong settings
Corpus Viewer shouldn't store the document selection so rigidly.

For example, I select a subset of documents. Then I select the 8th document in the subset.
If I change the subset, the 8th document of the new subset will be selected. If my subset has less than 8 documents, no documents will be selected and none will be displayed in Corpus Viewer.

This is quite unpractical for browsing, I think, but I'm not sure how to formalize it.
If a subset changes, clear the selection?
Would this make sense?
Perhaps a discussion with @jerneju and @nikicc? 



Discussion:

Resolving patch:
diff --git a/orangecontrib/text/widgets/owcorpusviewer.py b/orangecontrib/text/widgets/owcorpusviewer.py
--- a/orangecontrib/text/widgets/owcorpusviewer.py
+++ b/orangecontrib/text/widgets/owcorpusviewer.py
@@ -41,7 +41,7 @@ class OWCorpusViewer(OWWidget):
     display_features = ContextSetting([], exclude_metas=False)
     regexp_filter = ContextSetting("")
 
-    selection = Setting([0], schema_only=True)
+    selection = [0]  # TODO: DataHashContextHandler
 
     show_tokens = Setting(False)
     autocommit = Setting(True)
@@ -139,6 +139,7 @@ def set_data(self, data=None):
             self.display_features = list(filter_visible(chain(domain.variables, domain.metas)))
             self.search_indices = list(range(len(self.search_features)))
             self.display_indices = list(range(len(self.display_features)))
+            self.selection = [0]
             self.openContext(self.corpus)
             self.display_list_indices = self.display_indices
             self.regenerate_docs()


Test patch:
Repository: biolab/orange3-text

Issue:
Preprocess Text: Filtering bug
<!--
This is an issue template. Please fill in the relevant details in the
sections below.
-->

##### Text version
<!-- From menu _Options→Add-ons→Orange3-Text_ or code `orangecontrib.text.version.full_version` -->
0.2.4


##### Orange version
<!-- From menu _Help→About→Version_ or code `Orange.version.full_version` -->
3.4.3

##### Expected behavior
Most frequent tokens: 100 should result in 100 tokens, when Doc. freq. is unchecked.


##### Actual behavior
Enabling Most freq. tokens also uses Doc.freq. - even when disabled!
Resulting in less tokens.


##### Steps to reproduce the behavior
Set doc. freq. so it results in <100 tokens. Enable Most freq. tokens (100). Disable Doc. freq.


##### Additional info (worksheets, data, screenshots, ...)





Discussion:

Resolving patch:
diff --git a/orangecontrib/text/widgets/owpreprocess.py b/orangecontrib/text/widgets/owpreprocess.py
--- a/orangecontrib/text/widgets/owpreprocess.py
+++ b/orangecontrib/text/widgets/owpreprocess.py
@@ -396,11 +396,13 @@ def get_value(self):
         if self.FREQUENCY in self.checked:
             self.frequency_filter.min_df = self.min_df
             self.frequency_filter.max_df = self.max_df
+        else:
+            checked.append(self.FREQUENCY)
+            self.frequency_filter.min_df = 0
+            self.frequency_filter.max_df = 1.0
 
         if self.KEEP_N in checked:
             checked.pop(checked.index(self.KEEP_N))
-            if self.FREQUENCY not in self.checked:
-                checked.append(self.FREQUENCY)
             self.frequency_filter.keep_n = self.keep_n
         else:
             self.frequency_filter.keep_n = None


Test patch:
diff --git a/orangecontrib/text/widgets/tests/test_owpreprocess.py b/orangecontrib/text/widgets/tests/test_owpreprocess.py
new file mode 100644
--- /dev/null
+++ b/orangecontrib/text/widgets/tests/test_owpreprocess.py
@@ -0,0 +1,15 @@
+from Orange.widgets.tests.base import WidgetTest
+from orangecontrib.text.corpus import Corpus
+from orangecontrib.text.widgets.owpreprocess import OWPreprocess
+
+
+class TestConcordanceWidget(WidgetTest):
+    def setUp(self):
+        self.widget = self.create_widget(OWPreprocess)
+        self.corpus = Corpus.from_file('deerwester')
+
+    def test_set_corpus(self):
+        """
+        Just basic test.
+        """
+        self.send_signal("Corpus", self.corpus)
Repository: biolab/orange3-text

Issue:
Concordance: Index Error
<!--
This is an issue template. Please fill in the relevant details in the
sections below.
-->

##### Text version
<!-- From menu _Options→Add-ons→Orange3-Text_ or code `orangecontrib.text.version.full_version` -->
0.3.0

##### Orange version
<!-- From menu _Help→About→Version_ or code `Orange.version.full_version` -->
3.15.dev

##### Expected behavior
No crash.


##### Actual behavior
Concordance crashes when a document is selected and the user removes query.


##### Steps to reproduce the behavior
Corpus (bookexcertps) - query for word - select a document from the visualization - remove the word (delete a character).


##### Additional info (worksheets, data, screenshots, ...)





Discussion:

Resolving patch:
diff --git a/orangecontrib/text/widgets/owconcordance.py b/orangecontrib/text/widgets/owconcordance.py
--- a/orangecontrib/text/widgets/owconcordance.py
+++ b/orangecontrib/text/widgets/owconcordance.py
@@ -277,6 +277,7 @@ def set_word_from_input(self, topic):
             self.set_word()
 
     def set_word(self):
+        self.selected_rows = []
         self.model.set_word(self.word)
         self.update_widget()
         self.commit()


Test patch:
diff --git a/orangecontrib/text/widgets/tests/test_concordances.py b/orangecontrib/text/widgets/tests/test_concordances.py
--- a/orangecontrib/text/widgets/tests/test_concordances.py
+++ b/orangecontrib/text/widgets/tests/test_concordances.py
@@ -1,9 +1,8 @@
 import unittest
-from unittest.mock import Mock, patch
+from unittest.mock import Mock
 
 from AnyQt.QtCore import QModelIndex, QItemSelection, Qt
 from AnyQt.QtGui import QBrush, QColor
-from Orange.data import Table
 
 from Orange.widgets.tests.base import WidgetTest
 from orangecontrib.text.corpus import Corpus
@@ -200,6 +199,12 @@ def test_selection(self):
         selection_model.select(ind_10, selection_model.Select)
         self.assertIsNone(self.get_output("Selected Documents"))
 
+        # Selected rows emptied after word change
+        view.selectRow(3)
+        self.assertTrue(view.selectedIndexes())
+        widget.controls.word.setText("o")
+        self.assertFalse(view.selectedIndexes())
+
     def test_signal_to_none(self):
         self.send_signal("Corpus", self.corpus)
         widget = self.widget