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

Issue:
Report window and clipboard
Can't copy form Reports

##### Orange version
<!-- From menu _Help→About→Version_ or code `Orange.version.full_version` -->
3.17.0.dev0+8f507ed

##### Expected behavior
If items are selected in the Report window it should be possible to copy to the clipboard for using it in a presentation or a document.


##### Actual behavior
Can't copy anything.




Discussion:

Resolving patch:
diff --git a/Orange/widgets/report/owreport.py b/Orange/widgets/report/owreport.py
--- a/Orange/widgets/report/owreport.py
+++ b/Orange/widgets/report/owreport.py
@@ -477,6 +477,9 @@ def get_canvas_instance(self):
                 return window
         return None
 
+    def copy_to_clipboard(self):
+        self.report_view.triggerPageAction(self.report_view.page().Copy)
+
 
 if __name__ == "__main__":
     import sys


Test patch:
Repository: biolab/orange3

Issue:
QWidget::setWindowModified: The window title does not contain a '[*]' placeholder
<!--
This is an issue template. Please fill in the relevant details in the
sections below.

Wrap code and verbatim terminal window output into triple backticks, see:
https://help.github.com/articles/basic-writing-and-formatting-syntax/#quoting-code

If you're raising an issue about an add-on (e.g. installed via
Options > Add-ons), raise an issue on the relevant add-on's issue
tracker instead. See: https://github.com/biolab?q=orange3
-->

##### Orange version
3.16.0


##### Expected behavior
Orange should launch with no errors / warnings


##### Actual behavior
I'm getting a QWidget::setWindowModified: The window title does not contain a '[*]' placeholder


##### Steps to reproduce the behavior

$ orange-canvas
libpng warning: iCCP: known incorrect sRGB profile
QWidget::setWindowModified: The window title does not contain a '[*]' placeholder


##### Additional info (worksheets, data, screenshots, ...)

Possibly relevant solution: https://forum.qt.io/topic/2070/solved-qwidget-setwindowmodified-the-window-title-does-not-contain-a-placeholder

Possibly related to bug https://github.com/biolab/orange3/issues/3259


Discussion:
@thocevar, can you replicate this? If so, can you check whether the proposed solution works?
Yes, I can (http://doc.qt.io/qt-5/qwidget.html#windowModified-prop). We should add this placeholder in OWWidget if it's not present in the window title.

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
@@ -230,7 +230,7 @@ def setup_ui(self):
         frame.setWidget(self.scheme_widget)
 
         # Window 'title'
-        self.setWindowFilePath(self.scheme_widget.path())
+        self.setWindowFilePath(self.scheme_widget.path() or " ")
         self.scheme_widget.pathChanged.connect(self.setWindowFilePath)
         self.scheme_widget.modificationChanged.connect(self.setWindowModified)
 


Test patch:
Repository: biolab/orange3

Issue:
Scatterplotgraph: Don't animate resizing when too many points
... because it's too slow. On my computer the limit is around 500 points, I believe.

It may be a good first issue, but don't forget to write tests.


Discussion:

Resolving patch:
diff --git a/Orange/widgets/visualize/owscatterplotgraph.py b/Orange/widgets/visualize/owscatterplotgraph.py
--- a/Orange/widgets/visualize/owscatterplotgraph.py
+++ b/Orange/widgets/visualize/owscatterplotgraph.py
@@ -37,6 +37,7 @@
 
 
 SELECTION_WIDTH = 5
+MAX_N_VALID_SIZE_ANIMATE = 1000
 
 
 class PaletteItemSample(ItemSample):
@@ -766,7 +767,8 @@ def __call__(self):
                     widget.scatterplot_item.setSize(size)
                     widget.scatterplot_item_sel.setSize(size + SELECTION_WIDTH)
 
-            if np.sum(current_size_data) / self.n_valid != -1 and np.sum(diff):
+            if self.n_valid <= MAX_N_VALID_SIZE_ANIMATE and \
+                    np.all(current_size_data > 0) and np.any(diff != 0):
                 # If encountered any strange behaviour when updating sizes,
                 # implement it with threads
                 self.timer = QTimer(self.scatterplot_item, interval=50)


Test patch:
diff --git a/Orange/widgets/visualize/tests/test_owscatterplotbase.py b/Orange/widgets/visualize/tests/test_owscatterplotbase.py
--- a/Orange/widgets/visualize/tests/test_owscatterplotbase.py
+++ b/Orange/widgets/visualize/tests/test_owscatterplotbase.py
@@ -455,6 +455,26 @@ def test_sizes_selection(self):
             - graph.scatterplot_item.data["size"],
             SELECTION_WIDTH)
 
+    @patch("Orange.widgets.visualize.owscatterplotgraph"
+           ".MAX_N_VALID_SIZE_ANIMATE", 5)
+    def test_size_animation(self):
+        self._update_sizes_for_points(5)
+        self.assertEqual(self.graph.scatterplot_item.setSize.call_count, 6)
+        self._update_sizes_for_points(6)
+        self.graph.scatterplot_item.setSize.assert_called_once()
+
+    def _update_sizes_for_points(self, n: int):
+        arr = np.arange(n, dtype=float)
+        self.master.get_coordinates_data = lambda: (arr, arr)
+        self.master.get_size_data = lambda: arr
+        self.graph.reset_graph()
+        self.graph.scatterplot_item.setSize = Mock(
+            wraps=self.graph.scatterplot_item.setSize)
+        self.master.get_size_data = lambda: arr[::-1]
+        self.graph.update_sizes()
+        self.process_events(until=lambda: not (
+            self.graph.timer is not None and self.graph.timer.isActive()))
+
     def test_colors_discrete(self):
         self.master.is_continuous_color = lambda: False
         palette = self.master.get_palette()
Repository: biolab/orange3

Issue:
Q: Keyboard shortcuts for Align & Freeze/Unfreeze
Are there keyboard shortcuts for:
- Align widgets to a grid
- Freeze/Unfreeze signal propagation

Please let me know - thanks.

![orange-shortcuts-align-to-grid-freeze-propagation-annotated](https://user-images.githubusercontent.com/32625394/36999110-bbcae1cc-2084-11e8-96c9-3c550d0d06c4.png)




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
@@ -632,9 +632,10 @@ def setup_actions(self):
 
         self.freeze_action = \
             QAction(self.tr("Freeze"), self,
+                    shortcut=QKeySequence("Shift+F"),
                     objectName="signal-freeze-action",
                     checkable=True,
-                    toolTip=self.tr("Freeze signal propagation."),
+                    toolTip=self.tr("Freeze signal propagation (Shift+F)"),
                     toggled=self.set_signal_freeze,
                     icon=canvas_icons("Pause.svg")
                     )
diff --git a/Orange/canvas/document/schemeedit.py b/Orange/canvas/document/schemeedit.py
--- a/Orange/canvas/document/schemeedit.py
+++ b/Orange/canvas/document/schemeedit.py
@@ -185,7 +185,8 @@ def __setupActions(self):
         self.__cleanUpAction = \
             QAction(self.tr("Clean Up"), self,
                     objectName="cleanup-action",
-                    toolTip=self.tr("Align widgets to a grid."),
+                    shortcut=QKeySequence("Shift+A"),
+                    toolTip=self.tr("Align widgets to a grid (Shift+A)"),
                     triggered=self.alignToGrid,
                     )
 


Test patch:
Repository: biolab/orange3

Issue:
Need informative error if Orange does not find compiled libraries needed
Importing Orange should fail with a more informative error if its compiled parts can not be found. Now it just complains about not finding _variable, like in #3481 or #1838.

Even installation should fail with an error in such cases.


Discussion:
@markotoplak, so the idea could be that Orange imports all compiled libraries before importing anything else, and report an error if this fails?

And that installation also ends by importing those libraries and reporting an error if needed?
@janezd, yes. Maybe even importing one could suffice.

Resolving patch:
diff --git a/Orange/__init__.py b/Orange/__init__.py
--- a/Orange/__init__.py
+++ b/Orange/__init__.py
@@ -1,6 +1,13 @@
 # This module is a mixture of imports and code, so we allow import anywhere
 # pylint: disable=wrong-import-position,wrong-import-order
 
+try:
+    from Orange.data import _variable
+except ImportError:
+    raise ImportError("Compiled libraries cannot be found.\n"
+                      "Try reinstalling the package with:\n"
+                      "pip install --no-binary Orange3") from None
+
 from Orange import data
 
 from .misc.lazy_module import _LazyModule


Test patch:
Repository: biolab/orange3

Issue:
Test & Score: AUC is not computed if some class value in missing in the test set
##### Orange version
master

##### Steps to reproduce the behavior
Take iris data set, Logistic Regression, build the classifier on the whole data set and only use some instances for testing in Test&Score. Even if samples with two different class values are present in the test set, AUC is not computed.

I understand that AUC can not be computed with a test set with only a single class value, but two class values should be enough.



Discussion:

Resolving patch:
diff --git a/Orange/widgets/evaluate/owtestlearners.py b/Orange/widgets/evaluate/owtestlearners.py
--- a/Orange/widgets/evaluate/owtestlearners.py
+++ b/Orange/widgets/evaluate/owtestlearners.py
@@ -525,6 +525,8 @@ def _update_shown_columns(self):
         for section in range(1, model.columnCount()):
             col_name = model.horizontalHeaderItem(section).data(Qt.DisplayRole)
             header.setSectionHidden(section, col_name not in self.shown_scores)
+        self.view.resizeColumnsToContents()
+        self._update_stats_model()  # updates warnings for displayed columns
 
     def _update_stats_model(self):
         # Update the results_model with up to date scores.
@@ -583,13 +585,14 @@ def _update_stats_model(self):
                 stats = slot.stats
 
             if stats is not None:
-                for stat in stats:
+                for stat, scorer in zip(stats, self.scorers):
                     item = QStandardItem()
                     if stat.success:
                         item.setText("{:.3f}".format(stat.value[0]))
                     else:
                         item.setToolTip(str(stat.exception))
-                        has_missing_scores = True
+                        if scorer.name in self.shown_scores:
+                            has_missing_scores = True
                     row.append(item)
 
             model.appendRow(row)


Test patch:
Repository: biolab/orange3

Issue:
Scatter Plot data updates
<!--
This is an issue template. Please fill in the relevant details in the
sections below.

Wrap code and verbatim terminal window output into triple backticks, see:
https://help.github.com/articles/basic-writing-and-formatting-syntax/#quoting-code

If you're raising an issue about an add-on (e.g. installed via
Options > Add-ons), raise an issue on the relevant add-on's issue
tracker instead. See: https://github.com/biolab?q=orange3
-->

##### Orange version
<!-- From menu _Help→About→Version_ or code `Orange.version.full_version` -->
3.21-dev (master on 2019-03-19) : 9e0d4eb0

##### Expected behavior
Scatter Plot shows correct data


##### Actual behavior
Scatter Plot does not update and shows old data after a categorical variable changed in the input data.


##### Steps to reproduce the behavior
File (heart-disease) -> Edit Domain -> Scatter Plot
First connect all 3 widgets without any changes. SP shows blue and red points colored by diameter narrowing, legend says 0/1.
Then rename the values in ED, e.g. 0->foo and 1->bar. Click Apply which sends new data. SP still shows old data in legend, tooltip etc. Making changes does not help. After disconnecting and connecting the signal to SP it updates.

##### Additional info (worksheets, data, screenshots, ...)
Other visualization widgets should be checked too. Maybe @janezd or @VesnaT can take a look?




Discussion:
Removing these two lines should fix it: https://github.com/biolab/orange3/blob/master/Orange/widgets/visualize/owscatterplot.py#L317.

At around the same time when Moses and Israelites crossed the Red sea (or not much later), Orange had no context settings and some widgets (including Scatter plot) used this trick to not reset (like setting x and y to defaults) every time they received the same data for any reason. I this test no longer serves any purpose.

<img width="747" alt="Screenshot 2019-03-19 at 19 12 32" src="https://user-images.githubusercontent.com/2387315/54630815-fd70bb80-4a7a-11e9-8854-22e59905e233.png">


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
@@ -314,8 +314,6 @@ def _vizrank_color_change(self):
         self.vizrank_button.setToolTip(text)
 
     def set_data(self, data):
-        if self.data and data and self.data.checksum() == data.checksum():
-            return
         super().set_data(data)
 
         def findvar(name, iterable):


Test patch:
Repository: biolab/orange3

Issue:
OWTable crashes when loading a missing file with selected data
##### Orange version
<!-- From menyu _Help→About→Version_ or code `Orange.version.full_version` -->
master

##### Issue
A similar issue to what is described in #3449. Loading a workflow where the source data file can no longer be found causes crashes. One would expect that in this case, `None` would be sent to inputs (just like removeing a widget signal on canvas), however it seems that this is not the case?

I've gone through most of the widgets in the Data and Visualize section and haven't been able to reproduce this bug, but it might be hiding in other widgets as well.

```
Traceback (most recent call last):
  File "/home/pavlin/dev/orange3/Orange/canvas/scheme/widgetsscheme.py", line 1073, in process_signals_for_widget
    handler(*args)
  File "/home/pavlin/dev/orange3/Orange/widgets/data/owtable.py", line 535, in set_dataset
    self.set_selection()
  File "/home/pavlin/dev/orange3/Orange/widgets/data/owtable.py", line 775, in set_selection
    model = view.model()
AttributeError: 'NoneType' object has no attribute 'model'

```


##### Steps to reproduce the behavior
1. Open a workflow and connect File with some data to a Table, select some rows and save the workflow
2. Remove/rename the data file in question so that the File widget can no longer find it
3. Re-open the workflow in Orange → crash






Discussion:

Resolving patch:
diff --git a/Orange/widgets/data/owtable.py b/Orange/widgets/data/owtable.py
--- a/Orange/widgets/data/owtable.py
+++ b/Orange/widgets/data/owtable.py
@@ -516,6 +516,9 @@ def update(f):
             current = self.tabs.currentWidget()
             if current is not None:
                 self.set_info(current._input_slot.summary)
+        else:
+            self.__pending_selected_rows = None
+            self.__pending_selected_cols = None
 
         self.tabs.tabBar().setVisible(self.tabs.count() > 1)
         self.openContext(data)


Test patch:
Repository: biolab/orange3

Issue:
Save Data extension changes
<!--
This is an issue template. Please fill in the relevant details in the
sections below.

Wrap code and verbatim terminal window output into triple backticks, see:
https://help.github.com/articles/basic-writing-and-formatting-syntax/#quoting-code

If you're raising an issue about an add-on (e.g. installed via
Options > Add-ons), raise an issue on the relevant add-on's issue
tracker instead. See: https://github.com/biolab?q=orange3
-->

##### Orange version
<!-- From menu _Help→About→Version_ or code `Orange.version.full_version` -->
master 2019-03-12: 0fb063d92

##### Expected behavior
Changing from tab to tab.gz format changes filename from "iris.tab" to "iris.tab.gz"


##### Actual behavior
Changing from tab to tab.gz format changes filename from "iris.tab" to "iris.gz.tab.gz"


##### Steps to reproduce the behavior
Linux
File (iris) -> Save Data -> change from default tab format to any compressed format (double ext)






Discussion:

Resolving patch:
diff --git a/Orange/widgets/data/owsave.py b/Orange/widgets/data/owsave.py
--- a/Orange/widgets/data/owsave.py
+++ b/Orange/widgets/data/owsave.py
@@ -185,11 +185,23 @@ def _initial_start_dir(self):
 
     @staticmethod
     def _replace_extension(filename, extension):
-        known_extensions = map(OWSave._extension_from_filter, OWSave.filters)
-        for known_ext in sorted(known_extensions, key=len, reverse=True):
-            if filename.endswith(known_ext):
-                filename = filename[:-len(known_ext)]
+        """
+        Remove all extensions that appear in any filter.
+
+        Double extensions are broken in different weird ways across all systems,
+        including omitting some, like turning iris.tab.gz to iris.gz. This
+        function removes anything that can appear anywhere.
+        """
+        known_extensions = set()
+        for filt in OWSave.filters:
+            known_extensions |= \
+                set(OWSave._extension_from_filter(filt).split("."))
+        known_extensions.remove("")
+        while True:
+            base, ext = os.path.splitext(filename)
+            if ext[1:] not in known_extensions:
                 break
+            filename = base
         return filename + extension
 
     @staticmethod


Test patch:
diff --git a/Orange/widgets/data/tests/test_owsave.py b/Orange/widgets/data/tests/test_owsave.py
--- a/Orange/widgets/data/tests/test_owsave.py
+++ b/Orange/widgets/data/tests/test_owsave.py
@@ -431,6 +431,9 @@ def test_save_file_dialog_enforces_extension_linux(self):
         dialog.selectFile("high.tab.gz")
         self.assertTrue(dialog.selectedFiles()[0].endswith("/high.csv"))
 
+        dialog.selectFile("high.tab.gz.tab.tab.gz")
+        self.assertTrue(dialog.selectedFiles()[0].endswith("/high.csv"))
+
     def test_save_file_dialog_uses_valid_filters_linux(self):
         widget = self.widget
         widget._valid_filters = lambda: ["a (*.a)", "b (*.b)"]
Repository: biolab/orange3

Issue:
Orange.statistics.util.py: improper computation of missing meta values
1. Metas are always read as dtype=object. Try to read them as float64 if possible (numeric, categorical, datetime).
2. If dtype=object (at least one string meta variable), compute better statistics for primitive variables.

Example no1:
Datasets (Forest Fires) - Data Table.
One meta column has TRUE/FALSE values, which are read as bool. I don't this FALSE should be treated as missing.
Also - strange things happen. If I remove a random attribute with Select Columns, not touching the metas at all, Data Table correctly reports there are no missing values in metas.

Example no2:
Datasets (Poker Hand) - Data Table.
The single meta column has values train/test, which are read as categorical. The value that gets assigned a 0 is treated as missing.



Discussion:

Resolving patch:
diff --git a/Orange/statistics/util.py b/Orange/statistics/util.py
--- a/Orange/statistics/util.py
+++ b/Orange/statistics/util.py
@@ -361,7 +361,9 @@ def weighted_mean():
             X.shape[0] - non_zero,
             non_zero))
     else:
-        nans = (~X.astype(bool)).sum(axis=0) if X.size else np.zeros(X.shape[1])
+        X_str = X.astype(str)
+        nans = ((X_str == "nan") | (X_str == "")).sum(axis=0) \
+            if X.size else np.zeros(X.shape[1])
         return np.column_stack((
             np.tile(np.inf, X.shape[1]),
             np.tile(-np.inf, X.shape[1]),


Test patch:
diff --git a/Orange/tests/test_statistics.py b/Orange/tests/test_statistics.py
--- a/Orange/tests/test_statistics.py
+++ b/Orange/tests/test_statistics.py
@@ -118,13 +118,14 @@ def test_stats_weights_sparse(self):
 
     def test_stats_non_numeric(self):
         X = np.array([
-            ['', 'a', 'b'],
-            ['a', '', 'b'],
-            ['a', 'b', ''],
+            ["", "a", np.nan, 0],
+            ["a", "", np.nan, 1],
+            ["a", "b", 0, 0],
         ], dtype=object)
         np.testing.assert_equal(stats(X), [[np.inf, -np.inf, 0, 0, 1, 2],
                                            [np.inf, -np.inf, 0, 0, 1, 2],
-                                           [np.inf, -np.inf, 0, 0, 1, 2]])
+                                           [np.inf, -np.inf, 0, 0, 2, 1],
+                                           [np.inf, -np.inf, 0, 0, 0, 3]])
 
     def test_nanmin_nanmax(self):
         warnings.filterwarnings("ignore", r".*All-NaN slice encountered.*")
Repository: biolab/orange3

Issue:
Rank widget crashes when receive data
<!--
This is an issue template. Please fill in the relevant details in the
sections below.

Wrap code and verbatim terminal window output into triple backticks, see:
https://help.github.com/articles/basic-writing-and-formatting-syntax/#quoting-code

If you're raising an issue about an add-on (e.g. installed via
Options > Add-ons), raise an issue on the relevant add-on's issue
tracker instead. See: https://github.com/biolab?q=orange3
-->

##### Orange version
<!-- From menu _Help→About→Version_ or code `Orange.version.full_version` -->
3.21

##### Expected behavior

The rank widget should not crash


##### Actual behavior

Rank widget crashes when data connected. `Running` label under the widget does not disappear after a crash. 

##### Steps to reproduce the behavior

Use `File` widget. Open Iris or Titanic dataset. Connect data to `Rank` widget. 

##### Additional info (worksheets, data, screenshots, ...)

![Screenshot 2019-04-19 11 24 40](https://user-images.githubusercontent.com/6421558/56417934-beaa6d00-6295-11e9-837f-75fa4dc5e6a2.png)





Discussion:

Resolving patch:
diff --git a/Orange/widgets/data/owrank.py b/Orange/widgets/data/owrank.py
--- a/Orange/widgets/data/owrank.py
+++ b/Orange/widgets/data/owrank.py
@@ -494,7 +494,7 @@ def autoSelection(self):
             )
         else:
             selection = QItemSelection()
-            if self.selected_rows:
+            if self.selected_rows is not None:
                 for row in model.mapFromSourceRows(self.selected_rows):
                     selection.append(QItemSelectionRange(
                         model.index(row, 0), model.index(row, columnCount - 1)))


Test patch:
diff --git a/Orange/widgets/data/tests/test_owrank.py b/Orange/widgets/data/tests/test_owrank.py
--- a/Orange/widgets/data/tests/test_owrank.py
+++ b/Orange/widgets/data/tests/test_owrank.py
@@ -375,3 +375,13 @@ def test_dataset(self):
                                     UserWarning)
             for ds in datasets.datasets():
                 self.send_signal(self.widget.Inputs.data, ds)
+
+    def test_selected_rows(self):
+        w = self.widget
+        self.send_signal(w.Inputs.data, self.iris)
+
+        # select first and second row
+        w.selected_rows = np.array([1, 2])
+        output = self.get_output(w.Outputs.reduced_data)
+
+        self.assertEqual(len(output), len(self.iris))