internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: spyder-ide/spyder

Issue:
Not working shortcut for copy figure in Plots Widget if there are multiple consoles.
<!--- **PLEASE READ:** When submitting here, please ensure you've completed the following checklist and checked the boxes to confirm. Issue reports without it may be closed. Thanks! --->

## Problem Description
Shortcuts of Plots Widget do not work if there are multiple consoles.

![short_cut_error](https://user-images.githubusercontent.com/22970578/50597484-e8a87100-0eea-11e9-9caf-6dd1b94d4ac7.gif)

I modified the code as shown below and it works normally.
(253 line of plugins/plots/widgets/figurebrower.py)

        def create_shortcuts(self):
        """Create shortcuts for this widget."""
            # Configurable
            copyfig = config_shortcut(self.copy_figure, context='plots',
                                      name='copy', parent=self)

![short_cut_fix](https://user-images.githubusercontent.com/22970578/50597630-62d8f580-0eeb-11e9-96ee-f4d43caee7ad.gif)

Is this the right way to modify it?

## Versions
<!--- You can get this information from Help > About Spyder...
or (if Spyder won't launch) the "conda list" command
from the Anaconda Prompt/Terminal/command line. --->

* Spyder version: 4.0.0.dev0 (lastest commit)
* Python version: 3.6.7
* Qt version: 5.9.4
* PyQt version: 5.9.2
* Operating System name/version: Linux 4.20.0-1-MANJARO

### Dependencies
<!--- Please go to the menu entry Help > Dependencies,
press the Copy to clipboard button and paste below --->

```
PASTE DEPENDENCIES HERE
```



Discussion:
> Is this the right way to modify it?

If it's working for you, then sure. Please submit a pull request to fix this, thanks!

Resolving patch:
diff --git a/spyder/plugins/plots/widgets/figurebrowser.py b/spyder/plugins/plots/widgets/figurebrowser.py
--- a/spyder/plugins/plots/widgets/figurebrowser.py
+++ b/spyder/plugins/plots/widgets/figurebrowser.py
@@ -92,7 +92,7 @@ def __init__(self, parent, options_button=None, plugin_actions=[],
 
         self.options_button = options_button
         self.plugin_actions = plugin_actions
-        self.shortcuts = self.create_shortcuts(parent)
+        self.shortcuts = self.create_shortcuts()
 
     def setup(self, mute_inline_plotting=None, show_plot_outline=None):
         """Setup the figure browser with provided settings."""
@@ -250,11 +250,11 @@ def setup_options_button(self):
         else:
             self.tools_layout.addWidget(self.options_button)
 
-    def create_shortcuts(self, parent):
+    def create_shortcuts(self):
         """Create shortcuts for this widget."""
         # Configurable
         copyfig = config_shortcut(self.copy_figure, context='plots',
-                                  name='copy', parent=parent)
+                                  name='copy', parent=self)
 
         return [copyfig]
 


Test patch:
Repository: spyder-ide/spyder

Issue:
Select the dark or light version of the Spyder icon in the "About Spyder" dialog window depending on the color of the window background
## Enhancement Description

The Spyder logo is not very visible in Windows 10 in the `About Spyder` dialog window due to the light color of the background.

I suggest using the dark or light version of the logo depending on the color of the background instead of using always the light colors version.

![image](https://user-images.githubusercontent.com/10170372/45180184-a09d6a00-b1e8-11e8-897c-f5528f925eac.png)



Discussion:
@dalthviz, please take care of this one along with your work on the dark theme.

Resolving patch:
diff --git a/spyder/app/mainwindow.py b/spyder/app/mainwindow.py
--- a/spyder/app/mainwindow.py
+++ b/spyder/app/mainwindow.py
@@ -2527,7 +2527,21 @@ def about(self):
         )
         msgBox.setWindowTitle(_("About %s") % "Spyder")
         msgBox.setStandardButtons(QMessageBox.Ok)
-        msgBox.setIconPixmap(APP_ICON.pixmap(QSize(64, 64)))
+
+        from spyder.config.gui import is_dark_interface
+        if PYQT5:
+            if is_dark_interface():
+                icon_filename = "spyder.svg"
+            else:
+                icon_filename = "spyder_dark.svg"
+        else:
+            if is_dark_interface():
+                icon_filename = "spyder.png"
+            else:
+                icon_filename = "spyder_dark.png"
+        app_icon = QIcon(get_image_path(icon_filename))
+        msgBox.setIconPixmap(app_icon.pixmap(QSize(64, 64)))
+
         msgBox.setTextInteractionFlags(
             Qt.LinksAccessibleByMouse | Qt.TextSelectableByMouse)
         msgBox.exec_()


Test patch:
Repository: spyder-ide/spyder

Issue:
Full Screen in dual monitor enviroment (windows)
<!--- **PLEASE READ:** When submitting here, please ensure you've completed the following checklist and checked the boxes to confirm. Issue reports without it may be closed. Thanks! --->

## Problem Description
In Linux, if the spyder is on the second monitor, the full screen is displayed on the second screen.
![full_linux-2019-01-10_22 29 19](https://user-images.githubusercontent.com/22970578/50977618-fd61b600-1535-11e9-832f-af7d9dba7d53.gif)




But in windows, if the spyder is on the second monitor, the full screen is displayed on the first screen.
![full_window_error](https://user-images.githubusercontent.com/22970578/50977636-05b9f100-1536-11e9-83b3-d9c4766d17b7.gif)


### What steps reproduce the problem?

1.  Move the spyder to second monitor
2.  Try the full screen mode

### What is the expected output? What do you see instead?



### Paste Traceback/Error Below (if applicable)
<!--- Copy from error dialog or View > Panes > Internal Console --->

```python-traceback

PASTE TRACEBACK HERE

```

## Versions
<!--- You can get this information from Help > About Spyder...
or (if Spyder won't launch) the "conda list" command
from the Anaconda Prompt/Terminal/command line. --->

* Spyder version: spyder 4.0.0dev
* Python version: 3.6.2
* Qt version: 5.9.7
* PyQt version: 5.9.2
* Operating System name/version: windows10

### Dependencies
<!--- Please go to the menu entry Help > Dependencies,
press the Copy to clipboard button and paste below --->

```
PASTE DEPENDENCIES HERE
```



Discussion:

Resolving patch:
diff --git a/spyder/app/mainwindow.py b/spyder/app/mainwindow.py
--- a/spyder/app/mainwindow.py
+++ b/spyder/app/mainwindow.py
@@ -84,7 +84,7 @@
 from qtpy.QtGui import QColor, QDesktopServices, QIcon, QKeySequence, QPixmap
 from qtpy.QtWidgets import (QAction, QApplication, QDockWidget, QMainWindow,
                             QMenu, QMessageBox, QShortcut, QSplashScreen,
-                            QStyleFactory, QTabWidget, QWidget)
+                            QStyleFactory, QTabWidget, QWidget, QDesktopWidget)
 
 # Avoid a "Cannot mix incompatible Qt library" error on Windows platforms
 from qtpy import QtSvg  # analysis:ignore
@@ -2433,7 +2433,12 @@ def toggle_fullscreen(self):
                 self.setWindowFlags(self.windowFlags()
                                     | Qt.FramelessWindowHint
                                     | Qt.WindowStaysOnTopHint)
-                r = QApplication.desktop().screenGeometry()
+
+                screen_number = QDesktopWidget().screenNumber(self)
+                if screen_number < 0:
+                    screen_number = 0
+
+                r = QApplication.desktop().screenGeometry(screen_number)
                 self.setGeometry(
                     r.left() - 1, r.top() - 1, r.width() + 2, r.height() + 2)
                 self.showNormal()


Test patch:
Repository: spyder-ide/spyder

Issue:
KeyError when closing dataframe editor
## Description

### What steps will reproduce the problem?

<!--- You can use Markdown here --->

I imported a hive dumped file which delimited by 0x01, it gives me a size of 1738181 * 1 dataframe, then I click the returned variable in variable explorer, after I click close button of right top conor, this bug report window poped up.

The import command is :
x = pd.read_csv('hive_dump_file.csv')

### Traceback
```python-traceback
  File "/usr/local/lib/python3.6/dist-packages/spyder/widgets/variableexplorer/collectionseditor.py", line 560, in <lambda>
    lambda eid=id(editor): self.editor_rejected(eid))
  File "/usr/local/lib/python3.6/dist-packages/spyder/widgets/variableexplorer/collectionseditor.py", line 585, in editor_rejected
    self._editors.pop(editor_id)
KeyError: 140299497471576
WARNING:spyder.widgets.github.backend:Failed to send bug report on Github. response={'code': 401, 'json': {'message': 'Bad credentials', 'documentation_url': 'https://developer.github.com/v3'}}
WARNING:spyder.widgets.github.backend:Failed to send bug report on Github. response={'code': 401, 'json': {'message': 'Bad credentials', 'documentation_url': 'https://developer.github.com/v3'}}
```

## Versions

* Spyder version: 3.3.2 
* Python version: 3.6.7
* Qt version: 5.9.3
* PyQt5 version: 5.9.2
* Operating System: Linux 4.15.0-43-generic

### Dependencies

```
pyflakes >=0.6.0  :  2.0.0 (OK)
pycodestyle >=2.3 :  2.4.0 (OK)
pygments >=2.0    :  2.2.0 (OK)
sphinx >=0.6.6    :  1.8.1 (OK)
rope >=0.9.4      :  0.11.0 (OK)
jedi >=0.9.0      :  0.13.1 (OK)
psutil >=0.3      :  5.4.7 (OK)
nbconvert >=4.0   :  5.4.0 (OK)
pandas >=0.13.1   :  0.23.4 (OK)
numpy >=1.7       :  1.15.4 (OK)
sympy >=0.7.3     :  1.1.1 (OK)
cython >=0.21     :  None (NOK)
qtconsole >=4.2.0 :  4.4.2 (OK)
IPython >=4.0     :  7.0.1 (OK)
matplotlib >=2.0.0:  3.0.2 (OK)
pylint >=0.25     :  2.1.1 (OK)
```



Discussion:
Thanks for reporting. We'll fix this in Spyder 4, because Spyder 3 is in critical maintenance mode.

Resolving patch:
diff --git a/spyder/plugins/variableexplorer/widgets/collectionseditor.py b/spyder/plugins/variableexplorer/widgets/collectionseditor.py
--- a/spyder/plugins/variableexplorer/widgets/collectionseditor.py
+++ b/spyder/plugins/variableexplorer/widgets/collectionseditor.py
@@ -592,11 +592,21 @@ def editor_accepted(self, editor_id):
             value = data['editor'].get_value()
             conv_func = data.get('conv', lambda v: v)
             self.set_value(index, conv_func(value))
-        self._editors.pop(editor_id)
+        # This is needed to avoid the problem reported on
+        # issue 8557
+        try:
+            self._editors.pop(editor_id)
+        except KeyError:
+            pass
         self.free_memory()
         
     def editor_rejected(self, editor_id):
-        self._editors.pop(editor_id)
+        # This is needed to avoid the problem reported on
+        # issue 8557
+        try:
+            self._editors.pop(editor_id)
+        except KeyError:
+            pass
         self.free_memory()
 
     def free_memory(self):


Test patch:
Repository: spyder-ide/spyder

Issue:
File names pasted in editor when copied from OS file manager
So I noticed that when copying a file from OS file manager and pasting it into the editor, its name will be pasted. A similar behaviour is solved with the commit `correct tests and remove text from copy file` in PR #8494 

![name_issue_copy_issue](https://user-images.githubusercontent.com/22060413/51087973-134bc280-1752-11e9-9bea-a84bffbe2da0.gif)


It is not considered a big issue.  But might be preferred to not allow this behaviour to happen.

Spyder: Master (currently under development) 
OS: windows: 10
Python version: 3.6


Discussion:
So what should be the expected behavior in this case?

Resolving patch:
diff --git a/spyder/plugins/editor/widgets/codeeditor.py b/spyder/plugins/editor/widgets/codeeditor.py
--- a/spyder/plugins/editor/widgets/codeeditor.py
+++ b/spyder/plugins/editor/widgets/codeeditor.py
@@ -1582,14 +1582,19 @@ def paste(self):
         text has 'CRLF' EOL chars
         """
         clipboard = QApplication.clipboard()
-        text = to_text_string(clipboard.text())
-        if len(text.splitlines()) > 1:
-            eol_chars = self.get_line_separator()
-            text = eol_chars.join((text + eol_chars).splitlines())
-            clipboard.setText(text)
-        # Standard paste
-        TextEditBaseWidget.paste(self)
-        self.document_did_change(text)
+        # This is here to prevent pasting mime data in the Editor.
+        # See issue 8566 for the details.
+        if clipboard.mimeData().hasUrls():
+            return
+        else:
+            text = to_text_string(clipboard.text())
+            if len(text.splitlines()) > 1:
+                eol_chars = self.get_line_separator()
+                text = eol_chars.join((text + eol_chars).splitlines())
+                clipboard.setText(text)
+            # Standard paste
+            TextEditBaseWidget.paste(self)
+            self.document_did_change(text)
 
     @Slot()
     def undo(self):


Test patch:
Repository: spyder-ide/spyder

Issue:
Enclose console warning about plots being rendered in the Plots plugin in horizontal bars
The current warning looks like this:

![seleccion_002](https://user-images.githubusercontent.com/365293/50697118-564dbd80-100f-11e9-99dc-859a44e93209.png)

This can clearly go overlooked because it doesn't have an `\n` at the beginning and also when users print some text and then create a plot.

My idea to improve this is to enclose the warning in top and bottom horizontal bars, like `Remove all variables ...` (which only has a bottom bar):

![seleccion_003](https://user-images.githubusercontent.com/365293/50697320-e7249900-100f-11e9-89ae-56ed16745473.png)

Besides, this warning only needs to be printed once per session (i.e. only in the first console a plot is generated) and not every time a plot is created for the first time in each console.


Discussion:

Resolving patch:
diff --git a/spyder/plugins/ipythonconsole/widgets/figurebrowser.py b/spyder/plugins/ipythonconsole/widgets/figurebrowser.py
--- a/spyder/plugins/ipythonconsole/widgets/figurebrowser.py
+++ b/spyder/plugins/ipythonconsole/widgets/figurebrowser.py
@@ -60,11 +60,12 @@ def _handle_display_data(self, msg):
             if (self.figurebrowser is not None and
                     self.figurebrowser.mute_inline_plotting):
                 if not self.sended_render_message:
-                    msg['content']['data']['text/plain'] = _(
-                        'Figures now render in the Plots pane by default. '
-                        'To make them also appear inline in the Console, '
-                        'uncheck "Mute Inline Plotting" under the Plots '
-                        'pane options menu.')
+                    msg['content']['data']['text/plain'] = self._append_html(
+                        _('<hr>'
+                          '\nFigures now render in the Plots pane by default. '
+                          'To make them also appear inline in the Console, '
+                          'uncheck "Mute Inline Plotting" under the Plots '
+                          'pane options menu. \n<hr>'))
                     self.sended_render_message = True
                 else:
                     msg['content']['data']['text/plain'] = ''


Test patch:
Repository: spyder-ide/spyder

Issue:
The command line does not appear in ipython console after the warning about rendering of plots is displayed.
<!--- **PLEASE READ:** When submitting here, please ensure you've completed the following checklist and checked the boxes to confirm. Issue reports without it may be closed. Thanks! --->

## Problem Description

If merging #8584, it seems that the command line does not appear in ipython console after "render_message" is displayed.

![error](https://user-images.githubusercontent.com/22970578/51442269-a1114a00-1d1e-11e9-9995-8caeed9061bd.png)


### What steps reproduce the problem?

1. Plot


### What is the expected output? What do you see instead?



### Paste Traceback/Error Below (if applicable)
<!--- Copy from error dialog or View > Panes > Internal Console --->

```python-traceback

PASTE TRACEBACK HERE

```

## Versions
<!--- You can get this information from Help > About Spyder...
or (if Spyder won't launch) the "conda list" command
from the Anaconda Prompt/Terminal/command line. --->

* Spyder version: 4.0.0dev (lastest commit)
* Python version: 3.6.7
* Qt version: 5.9.7
* PyQt version: 5.9.2
* Operating System name/version: 4.20.1-1-MANJARO

### Dependencies
<!--- Please go to the menu entry Help > Dependencies,
press the Copy to clipboard button and paste below --->

```
PASTE DEPENDENCIES HERE
```



Discussion:

Resolving patch:
diff --git a/spyder/plugins/ipythonconsole/widgets/figurebrowser.py b/spyder/plugins/ipythonconsole/widgets/figurebrowser.py
--- a/spyder/plugins/ipythonconsole/widgets/figurebrowser.py
+++ b/spyder/plugins/ipythonconsole/widgets/figurebrowser.py
@@ -60,12 +60,14 @@ def _handle_display_data(self, msg):
             if (self.figurebrowser is not None and
                     self.figurebrowser.mute_inline_plotting):
                 if not self.sended_render_message:
-                    msg['content']['data']['text/plain'] = self._append_html(
-                        _('<hr>'
+                    msg['content']['data']['text/plain'] = ''
+                    self._append_html(
+                        _('<br><hr>'
                           '\nFigures now render in the Plots pane by default. '
                           'To make them also appear inline in the Console, '
                           'uncheck "Mute Inline Plotting" under the Plots '
-                          'pane options menu. \n<hr>'))
+                          'pane options menu. \n'
+                          '<hr><br>'))
                     self.sended_render_message = True
                 else:
                     msg['content']['data']['text/plain'] = ''


Test patch:
Repository: spyder-ide/spyder

Issue:
Display warning about rendering of plots below the new IPython prompt
<!--- **PLEASE READ:** When submitting here, please ensure you've completed the following checklist and checked the boxes to confirm. Issue reports without it may be closed. Thanks! --->

### Issue Report Checklist

* [X] Searched the [issues page](https://github.com/spyder-ide/spyder/issues?q=is%3Aissue) for similar reports
* [X] Read the relevant sections of the [Spyder Troubleshooting Guide](https://github.com/spyder-ide/spyder/wiki/Troubleshooting-Guide-and-FAQ) and followed its advice
* [X] Reproduced the issue after updating with ``conda update spyder`` (or ``pip``, if not using Anaconda)
* [X] Could not reproduce inside ``jupyter qtconsole`` (if console-related)
* [X] Tried basic troubleshooting (if a bug/error)
    * [X] Restarted Spyder
    * [X] Reset preferences with ``spyder --reset``
    * [X] Reinstalled the latest version of [Anaconda](https://www.anaconda.com/download/)
    * [X] Tried the other applicable steps from the Troubleshooting Guide
* [X] Completed the **Problem Description**, **Steps to Reproduce** and **Version** sections below


## Problem Description
Display warning about rendering of plots below the new prompt

![error](https://user-images.githubusercontent.com/22970578/51610777-f50b7100-1f60-11e9-9fd0-2078b77a3850.png)



### What steps reproduce the problem?

1. plot big data

### Paste Traceback/Error Below (if applicable)
<!--- Copy from error dialog or View > Panes > Internal Console --->

```python-traceback

PASTE TRACEBACK HERE

```

## Versions
<!--- You can get this information from Help > About Spyder...
or (if Spyder won't launch) the "conda list" command
from the Anaconda Prompt/Terminal/command line. --->

* Spyder version: spyder 4.0 dev lastest master
* Python version: 3.6.7
* Qt version: 5.9.6
* PyQt version: 5.9.2
* Operating System name/version: 4.20.1-1-MANJARO

### Dependencies
<!--- Please go to the menu entry Help > Dependencies,
press the Copy to clipboard button and paste below --->

```
PASTE DEPENDENCIES HERE
```



Discussion:

Resolving patch:
diff --git a/spyder/plugins/ipythonconsole/widgets/figurebrowser.py b/spyder/plugins/ipythonconsole/widgets/figurebrowser.py
--- a/spyder/plugins/ipythonconsole/widgets/figurebrowser.py
+++ b/spyder/plugins/ipythonconsole/widgets/figurebrowser.py
@@ -67,7 +67,7 @@ def _handle_display_data(self, msg):
                           'To make them also appear inline in the Console, '
                           'uncheck "Mute Inline Plotting" under the Plots '
                           'pane options menu. \n'
-                          '<hr><br>'))
+                          '<hr><br>'), before_prompt=True)
                     self.sended_render_message = True
                 else:
                     msg['content']['data']['text/plain'] = ''


Test patch:
Repository: spyder-ide/spyder

Issue:
Assign a keyboard shortcut for "next figure" and "previous figure" of the Plots pane
I think it would be nice to add shortcuts for "next figure", "previous figure" of the Plots pane.
Thank you.


Discussion:
@ok97465, do you want to work on this one? Else we'll leave it for beta3.

Resolving patch:
diff --git a/spyder/config/main.py b/spyder/config/main.py
--- a/spyder/config/main.py
+++ b/spyder/config/main.py
@@ -458,6 +458,8 @@
               'variable_explorer/copy': 'Ctrl+C',
               # ---- In widgets/plots/figurebrowser.py ----
               'plots/copy': 'Ctrl+C',
+              'plots/previous figure': 'Ctrl+PgUp',
+              'plots/next figure': 'Ctrl+PgDown',
               # ---- In widgets/explorer ----
               'explorer/copy file': 'Ctrl+C',
               'explorer/paste file': 'Ctrl+V',
diff --git a/spyder/plugins/plots/widgets/figurebrowser.py b/spyder/plugins/plots/widgets/figurebrowser.py
--- a/spyder/plugins/plots/widgets/figurebrowser.py
+++ b/spyder/plugins/plots/widgets/figurebrowser.py
@@ -168,12 +168,14 @@ def setup_toolbar(self):
 
         goback_btn = create_toolbutton(
                 self, icon=ima.icon('ArrowBack'),
-                tip=_("Previous Figure"),
+                tip=_("Previous Figure ({})".format(
+                      get_shortcut('plots', 'previous figure'))),
                 triggered=self.go_previous_thumbnail)
 
         gonext_btn = create_toolbutton(
                 self, icon=ima.icon('ArrowForward'),
-                tip=_("Next Figure"),
+                tip=_("Next Figure ({})".format(
+                      get_shortcut('plots', 'next figure'))),
                 triggered=self.go_next_thumbnail)
 
         vsep2 = QFrame()
@@ -255,8 +257,12 @@ def create_shortcuts(self):
         # Configurable
         copyfig = config_shortcut(self.copy_figure, context='plots',
                                   name='copy', parent=self)
+        prevfig = config_shortcut(self.go_previous_thumbnail, context='plots',
+                                  name='previous figure', parent=self)
+        nextfig = config_shortcut(self.go_next_thumbnail, context='plots',
+                                  name='next figure', parent=self)
 
-        return [copyfig]
+        return [copyfig, prevfig, nextfig]
 
     def get_shortcut_data(self):
         """


Test patch: