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

Issue:
PyCBC Live error when starting with missing frame files
Ideally it could just carry on, or give a more meaningful error.
```
[...]
    self.update_cache()
  File "x/lib/python2.7/site-packages/pycbc/frame/frame.py", line 494, in update_cache
    self.update_cache()
  File "x/lib/python2.7/site-packages/pycbc/frame/frame.py", line 494, in update_cache
    cache = locations_to_cache(self.frame_src, latest=True)
  File "x/lib/python2.7/site-packages/pycbc/frame/frame.py", line 126, in locations_to_cache
    flist = [max(flist, key=relaxed_getctime)]
ValueError: max() arg is an empty sequence
```


Discussion:

Resolving patch:
diff --git a/pycbc/frame/frame.py b/pycbc/frame/frame.py
--- a/pycbc/frame/frame.py
+++ b/pycbc/frame/frame.py
@@ -102,8 +102,8 @@ def locations_to_cache(locations, latest=False):
     Parameters
     ----------
     locations : list
-        A list of strings containing files, globs, or cache files used to build
-    a combined lal cache file object.
+        A list of strings containing files, globs, or cache files used to
+        build a combined lal cache file object.
     latest : Optional, {False, Boolean}
         Only return a cache with the most recent frame in the locations.
         If false, all results are returned.
@@ -112,7 +112,7 @@ def locations_to_cache(locations, latest=False):
     -------
     cache : lal.Cache
         A cumulative lal cache object containing the files derived from the
-    list of locations
+        list of locations.
     """
     cum_cache = lal.Cache()
     for source in locations:
@@ -126,6 +126,8 @@ def relaxed_getctime(fn):
                     return os.path.getctime(fn)
                 except OSError:
                     return 0
+            if not flist:
+                raise ValueError('no frame or cache files found in ' + source)
             flist = [max(flist, key=relaxed_getctime)]
 
         for file_path in flist:


Test patch:
Repository: biolab/orange3

Issue:
owrank: Fix a TypeError on selection
Due to b8cbd688c82fe5c11d681f897dfc2916a477e832 (gh-795) the `gui.auto_commit`
replacement `commit` function has a changed signature (`*args, **kwargs`)
and as a result has different call semantics when used as a target of a
PyQt4 connection.

In this case it would be called with two arguments (selected and
deselected QItemSelection), throwing an error when calling the real
shadowed `commit`, while before both arguments would be dropped by
Qt/PyQt.



Discussion:

Resolving patch:
diff --git a/Orange/widgets/gui.py b/Orange/widgets/gui.py
--- a/Orange/widgets/gui.py
+++ b/Orange/widgets/gui.py
@@ -2294,17 +2294,17 @@ def checkbox_toggled():
         if callback:
             callback()
 
-    def unconditional_commit(*args, **kwargs):
+    def unconditional_commit():
         nonlocal dirty
         if getattr(master, value):
-            do_commit(*args, **kwargs)
+            do_commit()
         else:
             dirty = True
 
-    def do_commit(*args, **kwargs):
+    def do_commit():
         nonlocal dirty
         QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
-        commit(*args, **kwargs)
+        commit()
         QApplication.restoreOverrideCursor()
         dirty = False
 


Test patch:
Repository: biolab/orange3

Issue:
Meta attributes in Sieve and Mosaic
Sieve and Mosaic do not let the user choose meta attributes. Add them to the combo.



Discussion:
> Sieve's layout (on master, I haven't tried other branches yet) currently looks significantly different compared to other tools, and its look defined in the orange docs . Is this intended, and are the meta attributes also supposed to be laid out in a similar fashion?

Meta attributes are supposed to be added to the same combo within the existing layout - not in a new combo. The layout does not matter (in principle, though the changes should of course be applied to the new layout, not the old one).


Resolving patch:
diff --git a/Orange/widgets/visualize/owmosaic.py b/Orange/widgets/visualize/owmosaic.py
--- a/Orange/widgets/visualize/owmosaic.py
+++ b/Orange/widgets/visualize/owmosaic.py
@@ -2,7 +2,7 @@
 import sys
 from collections import defaultdict
 from functools import reduce
-from itertools import product
+from itertools import product, chain
 from math import sqrt
 
 import numpy
@@ -294,7 +294,7 @@ def initCombos(self, data):
         self.attr3Combo.addItem("(None)")
         self.attr4Combo.addItem("(None)")
 
-        for attr in data.domain:
+        for attr in chain(data.domain.attributes, data.domain.metas):
             if attr.is_discrete:
                 for combo in [self.attr1Combo, self.attr2Combo, self.attr3Combo, self.attr4Combo]:
                     combo.addItem(self.icons[attr], attr.name)
diff --git a/Orange/widgets/visualize/owsieve.py b/Orange/widgets/visualize/owsieve.py
--- a/Orange/widgets/visualize/owsieve.py
+++ b/Orange/widgets/visualize/owsieve.py
@@ -1,5 +1,5 @@
 from collections import defaultdict
-from itertools import product
+from itertools import product, chain
 from math import sqrt, floor, ceil
 
 from PyQt4.QtCore import Qt, QSize
@@ -97,7 +97,11 @@ def set_data(self, data):
         if self.data is None:
             self.attrs[:] = []
         else:
-            self.attrs[:] = [var for var in self.data.domain if var.is_discrete]
+            self.attrs[:] = [
+                var for var in chain(self.data.domain.attributes,
+                                     self.data.domain.metas)
+                if var.is_discrete
+            ]
         if self.attrs:
             self.attrX = self.attrs[0].name
             self.attrY = self.attrs[len(self.attrs) > 1].name


Test patch:
Repository: biolab/orange3

Issue:
Crash on color tool
I have 100 rows, 124 fields, text and numeric.
When I try to load colors the widget crashes.



Discussion:
Can you share the data file?

[Data.xlsx](https://github.com/biolab/orange3/files/161307/Data.xlsx)

I found that if I filter out a few columns then there's no problem.  The problem is that the widget dialogue tries to color all of the columns at once, so it goes crazy slow and in the worst case, stops responding.  Maybe if you had to choose the columns that you wanted to color instead of coloring them all by default?


Resolving patch:
diff --git a/Orange/widgets/data/owcolor.py b/Orange/widgets/data/owcolor.py
--- a/Orange/widgets/data/owcolor.py
+++ b/Orange/widgets/data/owcolor.py
@@ -159,7 +159,6 @@ def __init__(self, model):
         self.setShowGrid(False)
         self.setSelectionMode(QTableView.NoSelection)
         self.setItemDelegate(HorizontalGridDelegate())
-        self.horizontalHeader().setResizeMode(QHeaderView.ResizeToContents)
         self.setModel(model)
 
     def mouseReleaseEvent(self, ev):
@@ -244,16 +243,18 @@ def __init__(self):
         box = gui.widgetBox(self.controlArea, "Discrete variables",
                             orientation="horizontal")
         self.disc_model = DiscColorTableModel()
-        self.disc_view = DiscreteTable(self.disc_model)
+        disc_view = self.disc_view = DiscreteTable(self.disc_model)
+        disc_view.horizontalHeader().setResizeMode(QHeaderView.ResizeToContents)
         self.disc_model.dataChanged.connect(self._on_data_changed)
-        box.layout().addWidget(self.disc_view)
+        box.layout().addWidget(disc_view)
 
         box = gui.widgetBox(self.controlArea, "Numeric variables",
                             orientation="horizontal")
         self.cont_model = ContColorTableModel()
-        self.cont_view = ContinuousTable(self, self.cont_model)
+        cont_view = self.cont_view = ContinuousTable(self, self.cont_model)
+        cont_view.setColumnWidth(1, 256)
         self.cont_model.dataChanged.connect(self._on_data_changed)
-        box.layout().addWidget(self.cont_view)
+        box.layout().addWidget(cont_view)
 
         box = gui.auto_commit(self.controlArea, self, "auto_apply", "Send data",
                               orientation="horizontal",


Test patch:
Repository: biolab/orange3

Issue:
Report button on Distances widget
Implement Report button function in Distances widget as is in other widgets (see Scatter Plot widget). Report on the used parameters.



Discussion:
There is no report button on Scatter Plot Widget. So, do we have to add that?

There is report on scatter plot. You meant scatter map? Scatter map will be removed, so no point in improving it.

i have added it to distance transformation widget.


Resolving patch:
diff --git a/Orange/widgets/unsupervised/owdistancetransformation.py b/Orange/widgets/unsupervised/owdistancetransformation.py
--- a/Orange/widgets/unsupervised/owdistancetransformation.py
+++ b/Orange/widgets/unsupervised/owdistancetransformation.py
@@ -50,8 +50,11 @@ def __init__(self):
                          btnLabels=[x[0] for x in self.inversion_options],
                          callback=self._invalidate)
 
-        gui.auto_commit(self.controlArea, self, "autocommit", "Apply",
-                        checkbox_label="Apply on any change")
+        box = gui.widgetBox(self.controlArea, True, orientation="vertical")
+        box = gui.auto_commit(self.controlArea, self, "autocommit", "Apply",
+                              checkbox_label="Apply on any change")
+        gui.separator(box, 20)
+        box.layout().addWidget(self.report_button)
 
     def set_data(self, data):
         self.data = data
@@ -69,5 +72,17 @@ def commit(self):
             distances = inv(distances)
         self.send("Distances", distances)
 
+    def send_report(self):
+        norm, normopt = self.normalization_method, self.normalization_options
+        inv, invopt = self.inversion_method, self.inversion_options
+        parts = []
+        if inv:
+            parts.append('inversion ({})'.format(invopt[inv][0]))
+        if norm:
+            parts.append('normalization ({})'.format(normopt[norm][0]))
+        self.report_items(
+            'Model parameters',
+            {'Transformation': ', '.join(parts).capitalize() or 'None'})
+
     def _invalidate(self):
         self.commit()


Test patch:
Repository: biolab/orange3

Issue:
Setting Handler: doesn't overwrite super class settings.
Settings from subclass are replaced by super class ones.
##### Steps to reproduce the behavior

Create Regression Tree (or SVM Regression) widget and check it default name. 



Discussion:
@s-alexey  its default name is "SVM Regression". can you explain a little bit more?

It's probably my fault. As I have figured it out settings were pickled (.local/Orange/widges/) with wrong names (but I don't know why). So default values were taken from pickle file. 

> As I have figured it out settings were pickled (.local/Orange/widges/) with wrong names (but I don't know why).

Possibly something to do with https://github.com/biolab/orange3/pull/1072?

@kernc, probably not. It's actually a bug.

**Steps to reproduce the behavior:**
- Remove `Orange.widgets.classify.owclassificationtree.OWClassificationTree.pickle` from `~/.local/share/Orange/*/widgets/`
- Create Classification Tree widget.
- Select gini method.
- Delete widget (save settings)
- Create Regression Tree widget.


Resolving patch:
diff --git a/Orange/widgets/settings.py b/Orange/widgets/settings.py
--- a/Orange/widgets/settings.py
+++ b/Orange/widgets/settings.py
@@ -300,6 +300,7 @@ def create(widget_class, template=None):
             template = SettingsHandler()
 
         setting_handler = copy.copy(template)
+        setting_handler.defaults = {}
         setting_handler.bind(widget_class)
         return setting_handler
 
diff --git a/Orange/widgets/utils/owlearnerwidget.py b/Orange/widgets/utils/owlearnerwidget.py
--- a/Orange/widgets/utils/owlearnerwidget.py
+++ b/Orange/widgets/utils/owlearnerwidget.py
@@ -1,4 +1,5 @@
 import numpy as np
+from PyQt4.QtCore import QTimer
 
 from Orange.classification.base_classification import LearnerClassification
 from Orange.data import Table
@@ -120,7 +121,7 @@ def __init__(self):
         self.preprocessors = None
         self.outdated_settings = False
         self.setup_layout()
-        self.apply()
+        QTimer.singleShot(0, self.apply)
 
     def create_learner(self):
         """Creates a learner with current configuration.


Test patch:
Repository: biolab/orange3

Issue:
There is a desktop file missing in a Linux version
##### Orange version

3.3.1.dev0
##### Expected bahavior

/usr/share/applications directory is populated with a orange.desktop file providing a desktop icon on Linux machines.
##### Actual behavior

That doesn't happen - the /usr/share/applications/orange.desktop file is missing.
##### Steps to reproduce the behavior

Install Orange on a Linux machine.



Discussion:
This is an example desktop file working on Arch Linux system:

```
[Desktop Entry]
Version=1.0
Type=Application
Name=Orange
Exec=orange-canvas
Terminal=false
Icon=/usr/lib/python3.5/site-packages/Orange/canvas/icons/orange-canvas.svg
Categories=Development;
```


Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -216,6 +216,38 @@ def run(self):
         ''', shell=True, cwd=os.path.dirname(os.path.abspath(__file__))))
 
 
+# Install desktop file and icon on GNU/Linux/BSD
+DATA_FILES = []
+if any(sys.platform.startswith(platform)
+       for platform in ('linux', 'freebsd')):
+    # Patch desktop file executable to work with virtualenv
+    try:
+        sys.real_prefix
+    except AttributeError:
+        pass  # Not in virtualenv
+    else:
+        with open(os.path.join(os.path.dirname(__file__),
+                               'distribute',
+                               'orange-canvas.desktop'), 'r+') as desktop:
+            spec = []
+            for line in desktop:
+                if line.startswith('Exec='):
+                    line = 'Exec="{}" -m Orange.canvas\n'.format(sys.executable)
+                spec.append(line)
+            desktop.seek(0)
+            desktop.truncate(0)
+            desktop.writelines(spec)
+
+    usr_share = os.path.join(sys.prefix, "share")
+    if not usr_share.startswith('/usr/') or not os.access(usr_share, os.W_OK):
+        usr_share = os.environ.get('XDG_DATA_HOME',
+                                   os.path.expanduser('~/.local/share'))
+    DATA_FILES += [
+        (os.path.join(usr_share, 'applications'),
+         ['distribute/orange-canvas.desktop']),
+        (os.path.join(usr_share, 'icons', 'hicolor', 'scalable', 'apps'),
+         ['distribute/orange-canvas.svg'])
+    ]
 
 
 def setup_package():
@@ -235,6 +267,7 @@ def setup_package():
         package_data=PACKAGE_DATA,
         install_requires=INSTALL_REQUIRES,
         entry_points=ENTRY_POINTS,
+        data_files=DATA_FILES,
         zip_safe=False,
         test_suite='Orange.tests.test_suite',
         cmdclass={


Test patch:
Repository: biolab/orange3

Issue:
Filter in add-on dialogue doesn't work
If you filter the packages and select one of them, you get

```
AttributeError                                
Traceback (most recent call last):
  File "/Users/janez/Desktop/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/Orange/canvas/application/addons.py", line 344, in __data_changed
    actionitem = self.__model.item(modelitem.row(), 3)
AttributeError: 'NoneType' object has no attribute 'row'
```



Discussion:

Resolving patch:
diff --git a/Orange/canvas/application/addons.py b/Orange/canvas/application/addons.py
--- a/Orange/canvas/application/addons.py
+++ b/Orange/canvas/application/addons.py
@@ -335,14 +335,10 @@ def set_install_projects(self, names):
 
     def __data_changed(self, topleft, bottomright):
         rows = range(topleft.row(), bottomright.row() + 1)
-        proxy = self.__view.model()
-        map_to_source = proxy.mapToSource
-
         for i in rows:
-            sourceind = map_to_source(proxy.index(i, 0))
-            modelitem = self.__model.itemFromIndex(sourceind)
-            actionitem = self.__model.item(modelitem.row(), 3)
-            item = self.__items[modelitem.row()]
+            modelitem = self.__model.item(i, 0)
+            actionitem = self.__model.item(i, 3)
+            item = self.__items[i]
 
             state = modelitem.checkState()
             flags = modelitem.flags()


Test patch:
Repository: biolab/orange3

Issue:
50:50 mixing in linear regression
Snap the slider to 50:50 when close to 50:50. This can only be done by somebody who can replicate the problem, hence ... assigning to @lanzagar. :)



Discussion:

Resolving patch:
diff --git a/Orange/widgets/regression/owlinearregression.py b/Orange/widgets/regression/owlinearregression.py
--- a/Orange/widgets/regression/owlinearregression.py
+++ b/Orange/widgets/regression/owlinearregression.py
@@ -66,8 +66,8 @@ def add_main_layout(self):
         box5 = gui.hBox(box4)
         gui.widgetLabel(box5, "L1")
         self.l1_ratio_slider = gui.hSlider(
-            box5, self, "l1_ratio", minValue=0.01, maxValue=1,
-            intOnly=False, ticks=0.1, createLabel=False,
+            box5, self, "l1_ratio", minValue=0.01, maxValue=0.99,
+            intOnly=False, ticks=0.1, createLabel=False, width=120,
             step=0.01, callback=self._l1_ratio_changed)
         gui.widgetLabel(box5, "L2")
         self.l1_ratio_label = gui.widgetLabel(


Test patch:
Repository: biolab/orange3

Issue:
Symbol size and Opacity have disappeared from Scatter Plot
##### Orange version

3.3.8 candidate
##### Expected behavior

Scatter Plot allowed to set Symbol size and Opacity in Points box (see [screenshots](http://orange.biolab.si/screenshots/).
##### Actual behavior

In 3.3.8 candidate Symbol size and Opacity are missing. They are very useful when teaching with Orange or working with data sets of various number of instances.



Discussion:

Resolving patch:
diff --git a/Orange/widgets/visualize/owscatterplot.py b/Orange/widgets/visualize/owscatterplot.py
--- a/Orange/widgets/visualize/owscatterplot.py
+++ b/Orange/widgets/visualize/owscatterplot.py
@@ -197,6 +197,7 @@ def __init__(self):
             **common_options)
 
         g = self.graph.gui
+        g.point_properties_box(self.controlArea, box)
         box = gui.vBox(self.controlArea, "Plot Properties")
         g.add_widgets([g.ShowLegend, g.ShowGridLines], box)
         gui.checkBox(


Test patch:
Repository: biolab/orange3

Issue:
Worksheet save silently fails if worksheet name has illegal character
##### Orange version

3.3.7, Windows
##### Expected behavior
- Set worksheet name to "My cool data: part II"
- Save worksheet
- Save window pops up with illegal character replaced with `-` or similar
##### Actual behavior
- Nothing happens when you try to save.
##### Steps to reproduce the behavior
- Open Orange
- Select New worksheet
- Name as above ("My cool data: part II")
- Try to save (File/Save, File/Save as, etc)



Discussion:

Resolving patch:
diff --git a/Orange/canvas/application/canvasmain.py b/Orange/canvas/application/canvasmain.py
--- a/Orange/canvas/application/canvasmain.py
+++ b/Orange/canvas/application/canvasmain.py
@@ -1170,6 +1170,8 @@ def save_scheme_as(self):
         document = self.current_document()
         curr_scheme = document.scheme()
         title = curr_scheme.title or "untitled"
+        for illegal in r'<>:"\/|?*\0':
+            title = title.replace(illegal, '_')
 
         if document.path():
             start_dir = document.path()


Test patch:
Repository: biolab/orange3

Issue:
progress bar shows percentage in thousands
##### Orange version

3.3.7
##### Expected bahavior

progress should be between 0 and 100
##### Actual behavior

progress in the window bar of Score Plots goes to thousands, say to 12300%
##### Steps to reproduce the behavior

Open fresh Orange, in File read the data from http://bit.ly/1EEB4FX, connect Scatter Plot, click Score Plots and then Start. It is interesting that the wrong scoring appears only the first time this function is used (pressing Pause and then Continue would display the correct counting).



Discussion:
When I try this on master, or say on geo-gds360 data set, I get:

``` text
--------------------------------------------------------------------------------
TypeError                                     Traceback (most recent call last):
  File "/home/user/orange3/Orange/widgets/visualize/utils/__init__.py", line 209, in toggle
    self.run()
  File "/home/user/orange3/Orange/widgets/visualize/utils/__init__.py", line 187, in run
    for state in self.iterate_states(self.saved_state):
  File "/home/user/orange3/Orange/widgets/visualize/owscatterplot.py", line 59, in iterate_states
    self.attrs = self.score_heuristic()
  File "/home/user/orange3/Orange/widgets/visualize/owscatterplot.py", line 89, in score_heuristic
    attrs = sorted(zip(weights, mdomain.attributes), reverse=True)
TypeError: unorderable types: ContinuousVariable() < ContinuousVariable()
```

#1535 fixes that.


Resolving patch:
diff --git a/Orange/widgets/visualize/owscatterplot.py b/Orange/widgets/visualize/owscatterplot.py
--- a/Orange/widgets/visualize/owscatterplot.py
+++ b/Orange/widgets/visualize/owscatterplot.py
@@ -305,6 +305,7 @@ def set_data(self, data):
         if not same_domain:
             self.init_attr_values()
         self.vizrank.initialize()
+        self.vizrank.attrs = self.data.domain.attributes if self.data is not None else []
         self.vizrank_button.setEnabled(
             self.data is not None and self.data.domain.class_var is not None
             and len(self.data.domain.attributes) > 1 and len(self.data) > 1)


Test patch:
Repository: biolab/orange3

Issue:
CN2 Viewer doesn't output filtered data
Documentation says:
Selecting a rule outputs filtered data instances. These can be viewed in a :doc:`Data Table <../data/datatable>`.
Also there'a a signal called _filtered data_.

Upon selecting any rule in CN2 Rule Viewer, no data is sent to the output.



Discussion:
We knew this when we were merging, but decided to fix this later.

It's not a bug, it's intentional: the widget has a separate input for the data, so you can use it to filter other, independent data instances. This is nice and we should add it to the tree widget as well, but it has to fall back to the training data by default.

Perhaps a use-case then in the docs?


Resolving patch:
diff --git a/Orange/widgets/visualize/owruleviewer.py b/Orange/widgets/visualize/owruleviewer.py
--- a/Orange/widgets/visualize/owruleviewer.py
+++ b/Orange/widgets/visualize/owruleviewer.py
@@ -137,19 +137,19 @@ def commit(self):
         data_output = None
         self._save_selected(actual=True)
 
+        data = self.data or self.classifier and self.classifier.instances
         if (self.selected is not None and
-                self.data is not None and
+                data is not None and
                 self.classifier is not None and
-                self.data.domain.attributes ==
+                data.domain.attributes ==
                 self.classifier.original_domain.attributes):
 
-            status = np.ones(self.data.X.shape[0], dtype=bool)
+            status = np.ones(data.X.shape[0], dtype=bool)
             for i in self.selected:
                 rule = self.classifier.rule_list[i]
-                status &= rule.evaluate_data(self.data.X)
+                status &= rule.evaluate_data(data.X)
 
-            data_output = self.data.from_table_rows(
-                self.data, status.nonzero()[0])
+            data_output = data.from_table_rows(data, status.nonzero()[0])
 
         self.send(OWRuleViewer.data_output_identifier, data_output)
 


Test patch:
diff --git a/Orange/widgets/visualize/tests/test_owruleviewer.py b/Orange/widgets/visualize/tests/test_owruleviewer.py
--- a/Orange/widgets/visualize/tests/test_owruleviewer.py
+++ b/Orange/widgets/visualize/tests/test_owruleviewer.py
@@ -14,6 +14,9 @@ def setUp(self):
         self.titanic = Table('titanic')
         self.learner = CN2Learner()
         self.classifier = self.learner(self.titanic)
+        # CN2Learner does not add `instances` attribute to the model, but
+        # the Rules widget does. We simulate the model we get from the widget.
+        self.classifier.instances = self.titanic
         self.widget = self.create_widget(OWRuleViewer)
 
     def test_set_data(self):