partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
NamespaceBrowser.setup_options_button
Add the cog menu button to the toolbar.
spyder/plugins/variableexplorer/widgets/namespacebrowser.py
def setup_options_button(self): """Add the cog menu button to the toolbar.""" if not self.options_button: self.options_button = create_toolbutton( self, text=_('Options'), icon=ima.icon('tooloptions')) actions = self.actions + [MENU_SEPARATOR] + self.plugin...
def setup_options_button(self): """Add the cog menu button to the toolbar.""" if not self.options_button: self.options_button = create_toolbutton( self, text=_('Options'), icon=ima.icon('tooloptions')) actions = self.actions + [MENU_SEPARATOR] + self.plugin...
[ "Add", "the", "cog", "menu", "button", "to", "the", "toolbar", "." ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/namespacebrowser.py#L217-L232
[ "def", "setup_options_button", "(", "self", ")", ":", "if", "not", "self", ".", "options_button", ":", "self", ".", "options_button", "=", "create_toolbutton", "(", "self", ",", "text", "=", "_", "(", "'Options'", ")", ",", "icon", "=", "ima", ".", "icon...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
NamespaceBrowser.option_changed
Option has changed
spyder/plugins/variableexplorer/widgets/namespacebrowser.py
def option_changed(self, option, value): """Option has changed""" setattr(self, to_text_string(option), value) self.shellwidget.set_namespace_view_settings() self.refresh_table()
def option_changed(self, option, value): """Option has changed""" setattr(self, to_text_string(option), value) self.shellwidget.set_namespace_view_settings() self.refresh_table()
[ "Option", "has", "changed" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/namespacebrowser.py#L234-L238
[ "def", "option_changed", "(", "self", ",", "option", ",", "value", ")", ":", "setattr", "(", "self", ",", "to_text_string", "(", "option", ")", ",", "value", ")", "self", ".", "shellwidget", ".", "set_namespace_view_settings", "(", ")", "self", ".", "refre...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
NamespaceBrowser.get_view_settings
Return dict editor view settings
spyder/plugins/variableexplorer/widgets/namespacebrowser.py
def get_view_settings(self): """Return dict editor view settings""" settings = {} for name in REMOTE_SETTINGS: settings[name] = getattr(self, name) return settings
def get_view_settings(self): """Return dict editor view settings""" settings = {} for name in REMOTE_SETTINGS: settings[name] = getattr(self, name) return settings
[ "Return", "dict", "editor", "view", "settings" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/namespacebrowser.py#L240-L245
[ "def", "get_view_settings", "(", "self", ")", ":", "settings", "=", "{", "}", "for", "name", "in", "REMOTE_SETTINGS", ":", "settings", "[", "name", "]", "=", "getattr", "(", "self", ",", "name", ")", "return", "settings" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
NamespaceBrowser.refresh_table
Refresh variable table
spyder/plugins/variableexplorer/widgets/namespacebrowser.py
def refresh_table(self): """Refresh variable table""" if self.is_visible and self.isVisible(): self.shellwidget.refresh_namespacebrowser() try: self.editor.resizeRowToContents() except TypeError: pass
def refresh_table(self): """Refresh variable table""" if self.is_visible and self.isVisible(): self.shellwidget.refresh_namespacebrowser() try: self.editor.resizeRowToContents() except TypeError: pass
[ "Refresh", "variable", "table" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/namespacebrowser.py#L247-L254
[ "def", "refresh_table", "(", "self", ")", ":", "if", "self", ".", "is_visible", "and", "self", ".", "isVisible", "(", ")", ":", "self", ".", "shellwidget", ".", "refresh_namespacebrowser", "(", ")", "try", ":", "self", ".", "editor", ".", "resizeRowToConte...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
NamespaceBrowser.set_data
Set data.
spyder/plugins/variableexplorer/widgets/namespacebrowser.py
def set_data(self, data): """Set data.""" if data != self.editor.model.get_data(): self.editor.set_data(data) self.editor.adjust_columns()
def set_data(self, data): """Set data.""" if data != self.editor.model.get_data(): self.editor.set_data(data) self.editor.adjust_columns()
[ "Set", "data", "." ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/namespacebrowser.py#L266-L270
[ "def", "set_data", "(", "self", ",", "data", ")", ":", "if", "data", "!=", "self", ".", "editor", ".", "model", ".", "get_data", "(", ")", ":", "self", ".", "editor", ".", "set_data", "(", "data", ")", "self", ".", "editor", ".", "adjust_columns", ...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
NamespaceBrowser.import_data
Import data from text file.
spyder/plugins/variableexplorer/widgets/namespacebrowser.py
def import_data(self, filenames=None): """Import data from text file.""" title = _("Import data") if filenames is None: if self.filename is None: basedir = getcwd_or_home() else: basedir = osp.dirname(self.filename) file...
def import_data(self, filenames=None): """Import data from text file.""" title = _("Import data") if filenames is None: if self.filename is None: basedir = getcwd_or_home() else: basedir = osp.dirname(self.filename) file...
[ "Import", "data", "from", "text", "file", "." ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/namespacebrowser.py#L278-L344
[ "def", "import_data", "(", "self", ",", "filenames", "=", "None", ")", ":", "title", "=", "_", "(", "\"Import data\"", ")", "if", "filenames", "is", "None", ":", "if", "self", ".", "filename", "is", "None", ":", "basedir", "=", "getcwd_or_home", "(", "...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
NamespaceBrowser.save_data
Save data
spyder/plugins/variableexplorer/widgets/namespacebrowser.py
def save_data(self, filename=None): """Save data""" if filename is None: filename = self.filename if filename is None: filename = getcwd_or_home() filename, _selfilter = getsavefilename(self, _("Save data"), ...
def save_data(self, filename=None): """Save data""" if filename is None: filename = self.filename if filename is None: filename = getcwd_or_home() filename, _selfilter = getsavefilename(self, _("Save data"), ...
[ "Save", "data" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/namespacebrowser.py#L353-L385
[ "def", "save_data", "(", "self", ",", "filename", "=", "None", ")", ":", "if", "filename", "is", "None", ":", "filename", "=", "self", ".", "filename", "if", "filename", "is", "None", ":", "filename", "=", "getcwd_or_home", "(", ")", "filename", ",", "...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
ConfigPage.apply_changes
Apply changes callback
spyder/preferences/configdialog.py
def apply_changes(self): """Apply changes callback""" if self.is_modified: self.save_to_conf() if self.apply_callback is not None: self.apply_callback() # Since the language cannot be retrieved by CONF and the language # is needed ...
def apply_changes(self): """Apply changes callback""" if self.is_modified: self.save_to_conf() if self.apply_callback is not None: self.apply_callback() # Since the language cannot be retrieved by CONF and the language # is needed ...
[ "Apply", "changes", "callback" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/configdialog.py#L92-L111
[ "def", "apply_changes", "(", "self", ")", ":", "if", "self", ".", "is_modified", ":", "self", ".", "save_to_conf", "(", ")", "if", "self", ".", "apply_callback", "is", "not", "None", ":", "self", ".", "apply_callback", "(", ")", "# Since the language cannot ...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
ConfigDialog.get_page
Return page widget
spyder/preferences/configdialog.py
def get_page(self, index=None): """Return page widget""" if index is None: widget = self.pages_widget.currentWidget() else: widget = self.pages_widget.widget(index) return widget.widget()
def get_page(self, index=None): """Return page widget""" if index is None: widget = self.pages_widget.currentWidget() else: widget = self.pages_widget.widget(index) return widget.widget()
[ "Return", "page", "widget" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/configdialog.py#L197-L203
[ "def", "get_page", "(", "self", ",", "index", "=", "None", ")", ":", "if", "index", "is", "None", ":", "widget", "=", "self", ".", "pages_widget", ".", "currentWidget", "(", ")", "else", ":", "widget", "=", "self", ".", "pages_widget", ".", "widget", ...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
ConfigDialog.accept
Reimplement Qt method
spyder/preferences/configdialog.py
def accept(self): """Reimplement Qt method""" for index in range(self.pages_widget.count()): configpage = self.get_page(index) if not configpage.is_valid(): return configpage.apply_changes() QDialog.accept(self)
def accept(self): """Reimplement Qt method""" for index in range(self.pages_widget.count()): configpage = self.get_page(index) if not configpage.is_valid(): return configpage.apply_changes() QDialog.accept(self)
[ "Reimplement", "Qt", "method" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/configdialog.py#L206-L213
[ "def", "accept", "(", "self", ")", ":", "for", "index", "in", "range", "(", "self", ".", "pages_widget", ".", "count", "(", ")", ")", ":", "configpage", "=", "self", ".", "get_page", "(", "index", ")", "if", "not", "configpage", ".", "is_valid", "(",...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
ConfigDialog.resizeEvent
Reimplement Qt method to be able to save the widget's size from the main application
spyder/preferences/configdialog.py
def resizeEvent(self, event): """ Reimplement Qt method to be able to save the widget's size from the main application """ QDialog.resizeEvent(self, event) self.size_change.emit(self.size())
def resizeEvent(self, event): """ Reimplement Qt method to be able to save the widget's size from the main application """ QDialog.resizeEvent(self, event) self.size_change.emit(self.size())
[ "Reimplement", "Qt", "method", "to", "be", "able", "to", "save", "the", "widget", "s", "size", "from", "the", "main", "application" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/configdialog.py#L251-L257
[ "def", "resizeEvent", "(", "self", ",", "event", ")", ":", "QDialog", ".", "resizeEvent", "(", "self", ",", "event", ")", "self", ".", "size_change", ".", "emit", "(", "self", ".", "size", "(", ")", ")" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
SpyderConfigPage.is_valid
Return True if all widget contents are valid
spyder/preferences/configdialog.py
def is_valid(self): """Return True if all widget contents are valid""" for lineedit in self.lineedits: if lineedit in self.validate_data and lineedit.isEnabled(): validator, invalid_msg = self.validate_data[lineedit] text = to_text_string(lineedit.text())...
def is_valid(self): """Return True if all widget contents are valid""" for lineedit in self.lineedits: if lineedit in self.validate_data and lineedit.isEnabled(): validator, invalid_msg = self.validate_data[lineedit] text = to_text_string(lineedit.text())...
[ "Return", "True", "if", "all", "widget", "contents", "are", "valid" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/configdialog.py#L295-L306
[ "def", "is_valid", "(", "self", ")", ":", "for", "lineedit", "in", "self", ".", "lineedits", ":", "if", "lineedit", "in", "self", ".", "validate_data", "and", "lineedit", ".", "isEnabled", "(", ")", ":", "validator", ",", "invalid_msg", "=", "self", ".",...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
SpyderConfigPage.load_from_conf
Load settings from configuration file
spyder/preferences/configdialog.py
def load_from_conf(self): """Load settings from configuration file""" for checkbox, (option, default) in list(self.checkboxes.items()): checkbox.setChecked(self.get_option(option, default)) # QAbstractButton works differently for PySide and PyQt if not API == 'py...
def load_from_conf(self): """Load settings from configuration file""" for checkbox, (option, default) in list(self.checkboxes.items()): checkbox.setChecked(self.get_option(option, default)) # QAbstractButton works differently for PySide and PyQt if not API == 'py...
[ "Load", "settings", "from", "configuration", "file" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/configdialog.py#L308-L410
[ "def", "load_from_conf", "(", "self", ")", ":", "for", "checkbox", ",", "(", "option", ",", "default", ")", "in", "list", "(", "self", ".", "checkboxes", ".", "items", "(", ")", ")", ":", "checkbox", ".", "setChecked", "(", "self", ".", "get_option", ...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
SpyderConfigPage.save_to_conf
Save settings to configuration file
spyder/preferences/configdialog.py
def save_to_conf(self): """Save settings to configuration file""" for checkbox, (option, _default) in list(self.checkboxes.items()): self.set_option(option, checkbox.isChecked()) for radiobutton, (option, _default) in list(self.radiobuttons.items()): self.set_option(...
def save_to_conf(self): """Save settings to configuration file""" for checkbox, (option, _default) in list(self.checkboxes.items()): self.set_option(option, checkbox.isChecked()) for radiobutton, (option, _default) in list(self.radiobuttons.items()): self.set_option(...
[ "Save", "settings", "to", "configuration", "file" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/configdialog.py#L412-L437
[ "def", "save_to_conf", "(", "self", ")", ":", "for", "checkbox", ",", "(", "option", ",", "_default", ")", "in", "list", "(", "self", ".", "checkboxes", ".", "items", "(", ")", ")", ":", "self", ".", "set_option", "(", "option", ",", "checkbox", ".",...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
SpyderConfigPage.select_directory
Select directory
spyder/preferences/configdialog.py
def select_directory(self, edit): """Select directory""" basedir = to_text_string(edit.text()) if not osp.isdir(basedir): basedir = getcwd_or_home() title = _("Select directory") directory = getexistingdirectory(self, title, basedir) if directory: ...
def select_directory(self, edit): """Select directory""" basedir = to_text_string(edit.text()) if not osp.isdir(basedir): basedir = getcwd_or_home() title = _("Select directory") directory = getexistingdirectory(self, title, basedir) if directory: ...
[ "Select", "directory" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/configdialog.py#L555-L563
[ "def", "select_directory", "(", "self", ",", "edit", ")", ":", "basedir", "=", "to_text_string", "(", "edit", ".", "text", "(", ")", ")", "if", "not", "osp", ".", "isdir", "(", "basedir", ")", ":", "basedir", "=", "getcwd_or_home", "(", ")", "title", ...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
SpyderConfigPage.select_file
Select File
spyder/preferences/configdialog.py
def select_file(self, edit, filters=None): """Select File""" basedir = osp.dirname(to_text_string(edit.text())) if not osp.isdir(basedir): basedir = getcwd_or_home() if filters is None: filters = _("All files (*)") title = _("Select file") ...
def select_file(self, edit, filters=None): """Select File""" basedir = osp.dirname(to_text_string(edit.text())) if not osp.isdir(basedir): basedir = getcwd_or_home() if filters is None: filters = _("All files (*)") title = _("Select file") ...
[ "Select", "File" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/configdialog.py#L585-L595
[ "def", "select_file", "(", "self", ",", "edit", ",", "filters", "=", "None", ")", ":", "basedir", "=", "osp", ".", "dirname", "(", "to_text_string", "(", "edit", ".", "text", "(", ")", ")", ")", "if", "not", "osp", ".", "isdir", "(", "basedir", ")"...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
SpyderConfigPage.create_combobox
choices: couples (name, key)
spyder/preferences/configdialog.py
def create_combobox(self, text, choices, option, default=NoDefault, tip=None, restart=False): """choices: couples (name, key)""" label = QLabel(text) combobox = QComboBox() if tip is not None: combobox.setToolTip(tip) for name, key in ch...
def create_combobox(self, text, choices, option, default=NoDefault, tip=None, restart=False): """choices: couples (name, key)""" label = QLabel(text) combobox = QComboBox() if tip is not None: combobox.setToolTip(tip) for name, key in ch...
[ "choices", ":", "couples", "(", "name", "key", ")" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/configdialog.py#L683-L712
[ "def", "create_combobox", "(", "self", ",", "text", ",", "choices", ",", "option", ",", "default", "=", "NoDefault", ",", "tip", "=", "None", ",", "restart", "=", "False", ")", ":", "label", "=", "QLabel", "(", "text", ")", "combobox", "=", "QComboBox"...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
SpyderConfigPage.create_file_combobox
choices: couples (name, key)
spyder/preferences/configdialog.py
def create_file_combobox(self, text, choices, option, default=NoDefault, tip=None, restart=False, filters=None, adjust_to_contents=False, default_line_edit=False): """choices: couples (name, key)""" combobox = Fi...
def create_file_combobox(self, text, choices, option, default=NoDefault, tip=None, restart=False, filters=None, adjust_to_contents=False, default_line_edit=False): """choices: couples (name, key)""" combobox = Fi...
[ "choices", ":", "couples", "(", "name", "key", ")" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/configdialog.py#L714-L747
[ "def", "create_file_combobox", "(", "self", ",", "text", ",", "choices", ",", "option", ",", "default", "=", "NoDefault", ",", "tip", "=", "None", ",", "restart", "=", "False", ",", "filters", "=", "None", ",", "adjust_to_contents", "=", "False", ",", "d...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
SpyderConfigPage.create_fontgroup
Option=None -> setting plugin font
spyder/preferences/configdialog.py
def create_fontgroup(self, option=None, text=None, title=None, tip=None, fontfilters=None, without_group=False): """Option=None -> setting plugin font""" if title: fontlabel = QLabel(title) else: fontlabel = QLabel(_("Font")) font...
def create_fontgroup(self, option=None, text=None, title=None, tip=None, fontfilters=None, without_group=False): """Option=None -> setting plugin font""" if title: fontlabel = QLabel(title) else: fontlabel = QLabel(_("Font")) font...
[ "Option", "=", "None", "-", ">", "setting", "plugin", "font" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/configdialog.py#L749-L791
[ "def", "create_fontgroup", "(", "self", ",", "option", "=", "None", ",", "text", "=", "None", ",", "title", "=", "None", ",", "tip", "=", "None", ",", "fontfilters", "=", "None", ",", "without_group", "=", "False", ")", ":", "if", "title", ":", "font...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
SpyderConfigPage.create_tab
Create simple tab widget page: widgets added in a vertical layout
spyder/preferences/configdialog.py
def create_tab(self, *widgets): """Create simple tab widget page: widgets added in a vertical layout""" widget = QWidget() layout = QVBoxLayout() for widg in widgets: layout.addWidget(widg) layout.addStretch(1) widget.setLayout(layout) return w...
def create_tab(self, *widgets): """Create simple tab widget page: widgets added in a vertical layout""" widget = QWidget() layout = QVBoxLayout() for widg in widgets: layout.addWidget(widg) layout.addStretch(1) widget.setLayout(layout) return w...
[ "Create", "simple", "tab", "widget", "page", ":", "widgets", "added", "in", "a", "vertical", "layout" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/configdialog.py#L799-L807
[ "def", "create_tab", "(", "self", ",", "*", "widgets", ")", ":", "widget", "=", "QWidget", "(", ")", "layout", "=", "QVBoxLayout", "(", ")", "for", "widg", "in", "widgets", ":", "layout", ".", "addWidget", "(", "widg", ")", "layout", ".", "addStretch",...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
GeneralConfigPage.prompt_restart_required
Prompt the user with a request to restart.
spyder/preferences/configdialog.py
def prompt_restart_required(self): """Prompt the user with a request to restart.""" restart_opts = self.restart_options changed_opts = self.changed_options options = [restart_opts[o] for o in changed_opts if o in restart_opts] if len(options) == 1: msg_start =...
def prompt_restart_required(self): """Prompt the user with a request to restart.""" restart_opts = self.restart_options changed_opts = self.changed_options options = [restart_opts[o] for o in changed_opts if o in restart_opts] if len(options) == 1: msg_start =...
[ "Prompt", "the", "user", "with", "a", "request", "to", "restart", "." ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/configdialog.py#L834-L857
[ "def", "prompt_restart_required", "(", "self", ")", ":", "restart_opts", "=", "self", ".", "restart_options", "changed_opts", "=", "self", ".", "changed_options", "options", "=", "[", "restart_opts", "[", "o", "]", "for", "o", "in", "changed_opts", "if", "o", ...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
IconLineEdit._refresh
After an application style change, the paintEvent updates the custom defined stylesheet.
spyder/widgets/helperwidgets.py
def _refresh(self): """After an application style change, the paintEvent updates the custom defined stylesheet. """ padding = self.height() css_base = """QLineEdit {{ border: none; padding-right: {padding}px; ...
def _refresh(self): """After an application style change, the paintEvent updates the custom defined stylesheet. """ padding = self.height() css_base = """QLineEdit {{ border: none; padding-right: {padding}px; ...
[ "After", "an", "application", "style", "change", "the", "paintEvent", "updates", "the", "custom", "defined", "stylesheet", "." ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/helperwidgets.py#L212-L234
[ "def", "_refresh", "(", "self", ")", ":", "padding", "=", "self", ".", "height", "(", ")", "css_base", "=", "\"\"\"QLineEdit {{\n border: none;\n padding-right: {padding}px;\n }}\n ...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
IconLineEdit.update_status
Update the status and set_status to update the icons to display.
spyder/widgets/helperwidgets.py
def update_status(self, value, value_set): """Update the status and set_status to update the icons to display.""" self._status = value self._status_set = value_set self.repaint() self.update()
def update_status(self, value, value_set): """Update the status and set_status to update the icons to display.""" self._status = value self._status_set = value_set self.repaint() self.update()
[ "Update", "the", "status", "and", "set_status", "to", "update", "the", "icons", "to", "display", "." ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/helperwidgets.py#L248-L253
[ "def", "update_status", "(", "self", ",", "value", ",", "value_set", ")", ":", "self", ".", "_status", "=", "value", "self", ".", "_status_set", "=", "value_set", "self", ".", "repaint", "(", ")", "self", ".", "update", "(", ")" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
IconLineEdit.paintEvent
Qt Override. Include a validation icon to the left of the line edit.
spyder/widgets/helperwidgets.py
def paintEvent(self, event): """Qt Override. Include a validation icon to the left of the line edit. """ super(IconLineEdit, self).paintEvent(event) painter = QPainter(self) rect = self.geometry() space = int((rect.height())/6) h = rect.height() - space ...
def paintEvent(self, event): """Qt Override. Include a validation icon to the left of the line edit. """ super(IconLineEdit, self).paintEvent(event) painter = QPainter(self) rect = self.geometry() space = int((rect.height())/6) h = rect.height() - space ...
[ "Qt", "Override", "." ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/helperwidgets.py#L255-L286
[ "def", "paintEvent", "(", "self", ",", "event", ")", ":", "super", "(", "IconLineEdit", ",", "self", ")", ".", "paintEvent", "(", "event", ")", "painter", "=", "QPainter", "(", "self", ")", "rect", "=", "self", ".", "geometry", "(", ")", "space", "="...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
OutlineExplorer.register_plugin
Register plugin in Spyder's main window
spyder/plugins/outlineexplorer/plugin.py
def register_plugin(self): """Register plugin in Spyder's main window""" self.main.restore_scrollbar_position.connect( self.restore_scrollbar_position) self.main.add_dockwidget(self)
def register_plugin(self): """Register plugin in Spyder's main window""" self.main.restore_scrollbar_position.connect( self.restore_scrollbar_position) self.main.add_dockwidget(self)
[ "Register", "plugin", "in", "Spyder", "s", "main", "window" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/outlineexplorer/plugin.py#L79-L83
[ "def", "register_plugin", "(", "self", ")", ":", "self", ".", "main", ".", "restore_scrollbar_position", ".", "connect", "(", "self", ".", "restore_scrollbar_position", ")", "self", ".", "main", ".", "add_dockwidget", "(", "self", ")" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
OutlineExplorer.visibility_changed
DockWidget visibility has changed
spyder/plugins/outlineexplorer/plugin.py
def visibility_changed(self, enable): """DockWidget visibility has changed""" super(SpyderPluginWidget, self).visibility_changed(enable) if enable: self.explorer.is_visible.emit()
def visibility_changed(self, enable): """DockWidget visibility has changed""" super(SpyderPluginWidget, self).visibility_changed(enable) if enable: self.explorer.is_visible.emit()
[ "DockWidget", "visibility", "has", "changed" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/outlineexplorer/plugin.py#L95-L99
[ "def", "visibility_changed", "(", "self", ",", "enable", ")", ":", "super", "(", "SpyderPluginWidget", ",", "self", ")", ".", "visibility_changed", "(", "enable", ")", "if", "enable", ":", "self", ".", "explorer", ".", "is_visible", ".", "emit", "(", ")" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
OutlineExplorer.restore_scrollbar_position
Restoring scrollbar position after main window is visible
spyder/plugins/outlineexplorer/plugin.py
def restore_scrollbar_position(self): """Restoring scrollbar position after main window is visible""" scrollbar_pos = self.get_option('scrollbar_position', None) if scrollbar_pos is not None: self.explorer.treewidget.set_scrollbar_position(scrollbar_pos)
def restore_scrollbar_position(self): """Restoring scrollbar position after main window is visible""" scrollbar_pos = self.get_option('scrollbar_position', None) if scrollbar_pos is not None: self.explorer.treewidget.set_scrollbar_position(scrollbar_pos)
[ "Restoring", "scrollbar", "position", "after", "main", "window", "is", "visible" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/outlineexplorer/plugin.py#L102-L106
[ "def", "restore_scrollbar_position", "(", "self", ")", ":", "scrollbar_pos", "=", "self", ".", "get_option", "(", "'scrollbar_position'", ",", "None", ")", "if", "scrollbar_pos", "is", "not", "None", ":", "self", ".", "explorer", ".", "treewidget", ".", "set_s...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
OutlineExplorer.save_config
Save configuration: tree widget state
spyder/plugins/outlineexplorer/plugin.py
def save_config(self): """Save configuration: tree widget state""" for option, value in list(self.explorer.get_options().items()): self.set_option(option, value) self.set_option('expanded_state', self.explorer.treewidget.get_expanded_state()) sel...
def save_config(self): """Save configuration: tree widget state""" for option, value in list(self.explorer.get_options().items()): self.set_option(option, value) self.set_option('expanded_state', self.explorer.treewidget.get_expanded_state()) sel...
[ "Save", "configuration", ":", "tree", "widget", "state" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/outlineexplorer/plugin.py#L108-L115
[ "def", "save_config", "(", "self", ")", ":", "for", "option", ",", "value", "in", "list", "(", "self", ".", "explorer", ".", "get_options", "(", ")", ".", "items", "(", ")", ")", ":", "self", ".", "set_option", "(", "option", ",", "value", ")", "se...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
OutlineExplorer.load_config
Load configuration: tree widget state
spyder/plugins/outlineexplorer/plugin.py
def load_config(self): """Load configuration: tree widget state""" expanded_state = self.get_option('expanded_state', None) # Sometimes the expanded state option may be truncated in .ini file # (for an unknown reason), in this case it would be converted to a # string by 'use...
def load_config(self): """Load configuration: tree widget state""" expanded_state = self.get_option('expanded_state', None) # Sometimes the expanded state option may be truncated in .ini file # (for an unknown reason), in this case it would be converted to a # string by 'use...
[ "Load", "configuration", ":", "tree", "widget", "state" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/outlineexplorer/plugin.py#L117-L126
[ "def", "load_config", "(", "self", ")", ":", "expanded_state", "=", "self", ".", "get_option", "(", "'expanded_state'", ",", "None", ")", "# Sometimes the expanded state option may be truncated in .ini file\r", "# (for an unknown reason), in this case it would be converted to a\r",...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
ResultsTree.activated
Double-click event
spyder/plugins/pylint/widgets/pylintgui.py
def activated(self, item): """Double-click event""" data = self.data.get(id(item)) if data is not None: fname, lineno = data self.sig_edit_goto.emit(fname, lineno, '')
def activated(self, item): """Double-click event""" data = self.data.get(id(item)) if data is not None: fname, lineno = data self.sig_edit_goto.emit(fname, lineno, '')
[ "Double", "-", "click", "event" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/pylint/widgets/pylintgui.py#L67-L72
[ "def", "activated", "(", "self", ",", "item", ")", ":", "data", "=", "self", ".", "data", ".", "get", "(", "id", "(", "item", ")", ")", "if", "data", "is", "not", "None", ":", "fname", ",", "lineno", "=", "data", "self", ".", "sig_edit_goto", "."...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
PylintWidget.remove_obsolete_items
Removing obsolete items
spyder/plugins/pylint/widgets/pylintgui.py
def remove_obsolete_items(self): """Removing obsolete items""" self.rdata = [(filename, data) for filename, data in self.rdata if is_module_or_package(filename)]
def remove_obsolete_items(self): """Removing obsolete items""" self.rdata = [(filename, data) for filename, data in self.rdata if is_module_or_package(filename)]
[ "Removing", "obsolete", "items" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/pylint/widgets/pylintgui.py#L257-L260
[ "def", "remove_obsolete_items", "(", "self", ")", ":", "self", ".", "rdata", "=", "[", "(", "filename", ",", "data", ")", "for", "filename", ",", "data", "in", "self", ".", "rdata", "if", "is_module_or_package", "(", "filename", ")", "]" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
WorkerUpdates.check_update_available
Checks if there is an update available. It takes as parameters the current version of Spyder and a list of valid cleaned releases in chronological order. Example: ['2.3.2', '2.3.3' ...] or with github ['2.3.4', '2.3.3' ...]
spyder/workers/updates.py
def check_update_available(self): """Checks if there is an update available. It takes as parameters the current version of Spyder and a list of valid cleaned releases in chronological order. Example: ['2.3.2', '2.3.3' ...] or with github ['2.3.4', '2.3.3' ...] """ # Don'...
def check_update_available(self): """Checks if there is an update available. It takes as parameters the current version of Spyder and a list of valid cleaned releases in chronological order. Example: ['2.3.2', '2.3.3' ...] or with github ['2.3.4', '2.3.3' ...] """ # Don'...
[ "Checks", "if", "there", "is", "an", "update", "available", "." ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/workers/updates.py#L54-L75
[ "def", "check_update_available", "(", "self", ")", ":", "# Don't perform any check for development versions", "if", "'dev'", "in", "self", ".", "version", ":", "return", "(", "False", ",", "latest_release", ")", "# Filter releases", "if", "is_stable_version", "(", "se...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
WorkerUpdates.start
Main method of the WorkerUpdates worker
spyder/workers/updates.py
def start(self): """Main method of the WorkerUpdates worker""" if is_anaconda(): self.url = 'https://repo.anaconda.com/pkgs/main' if os.name == 'nt': self.url += '/win-64/repodata.json' elif sys.platform == 'darwin': self.url += '/osx-6...
def start(self): """Main method of the WorkerUpdates worker""" if is_anaconda(): self.url = 'https://repo.anaconda.com/pkgs/main' if os.name == 'nt': self.url += '/win-64/repodata.json' elif sys.platform == 'darwin': self.url += '/osx-6...
[ "Main", "method", "of", "the", "WorkerUpdates", "worker" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/workers/updates.py#L77-L140
[ "def", "start", "(", "self", ")", ":", "if", "is_anaconda", "(", ")", ":", "self", ".", "url", "=", "'https://repo.anaconda.com/pkgs/main'", "if", "os", ".", "name", "==", "'nt'", ":", "self", ".", "url", "+=", "'/win-64/repodata.json'", "elif", "sys", "."...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
FindReplace.eventFilter
Event filter for search_text widget. Emits signals when presing Enter and Shift+Enter. This signals are used for search forward and backward. Also, a crude hack to get tab working in the Find/Replace boxes.
spyder/widgets/findreplace.py
def eventFilter(self, widget, event): """Event filter for search_text widget. Emits signals when presing Enter and Shift+Enter. This signals are used for search forward and backward. Also, a crude hack to get tab working in the Find/Replace boxes. """ if event.typ...
def eventFilter(self, widget, event): """Event filter for search_text widget. Emits signals when presing Enter and Shift+Enter. This signals are used for search forward and backward. Also, a crude hack to get tab working in the Find/Replace boxes. """ if event.typ...
[ "Event", "filter", "for", "search_text", "widget", ".", "Emits", "signals", "when", "presing", "Enter", "and", "Shift", "+", "Enter", ".", "This", "signals", "are", "used", "for", "search", "forward", "and", "backward", ".", "Also", "a", "crude", "hack", "...
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L182-L205
[ "def", "eventFilter", "(", "self", ",", "widget", ",", "event", ")", ":", "if", "event", ".", "type", "(", ")", "==", "QEvent", ".", "KeyPress", ":", "key", "=", "event", ".", "key", "(", ")", "shift", "=", "event", ".", "modifiers", "(", ")", "&...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
FindReplace.create_shortcuts
Create shortcuts for this widget
spyder/widgets/findreplace.py
def create_shortcuts(self, parent): """Create shortcuts for this widget""" # Configurable findnext = config_shortcut(self.find_next, context='_', name='Find next', parent=parent) findprev = config_shortcut(self.find_previous, context='_', ...
def create_shortcuts(self, parent): """Create shortcuts for this widget""" # Configurable findnext = config_shortcut(self.find_next, context='_', name='Find next', parent=parent) findprev = config_shortcut(self.find_previous, context='_', ...
[ "Create", "shortcuts", "for", "this", "widget" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L207-L222
[ "def", "create_shortcuts", "(", "self", ",", "parent", ")", ":", "# Configurable\r", "findnext", "=", "config_shortcut", "(", "self", ".", "find_next", ",", "context", "=", "'_'", ",", "name", "=", "'Find next'", ",", "parent", "=", "parent", ")", "findprev"...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
FindReplace.toggle_highlighting
Toggle the 'highlight all results' feature
spyder/widgets/findreplace.py
def toggle_highlighting(self, state): """Toggle the 'highlight all results' feature""" if self.editor is not None: if state: self.highlight_matches() else: self.clear_matches()
def toggle_highlighting(self, state): """Toggle the 'highlight all results' feature""" if self.editor is not None: if state: self.highlight_matches() else: self.clear_matches()
[ "Toggle", "the", "highlight", "all", "results", "feature" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L251-L257
[ "def", "toggle_highlighting", "(", "self", ",", "state", ")", ":", "if", "self", ".", "editor", "is", "not", "None", ":", "if", "state", ":", "self", ".", "highlight_matches", "(", ")", "else", ":", "self", ".", "clear_matches", "(", ")" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
FindReplace.show
Overrides Qt Method
spyder/widgets/findreplace.py
def show(self, hide_replace=True): """Overrides Qt Method""" QWidget.show(self) self.visibility_changed.emit(True) self.change_number_matches() if self.editor is not None: if hide_replace: if self.replace_widgets[0].isVisible(): ...
def show(self, hide_replace=True): """Overrides Qt Method""" QWidget.show(self) self.visibility_changed.emit(True) self.change_number_matches() if self.editor is not None: if hide_replace: if self.replace_widgets[0].isVisible(): ...
[ "Overrides", "Qt", "Method" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L259-L292
[ "def", "show", "(", "self", ",", "hide_replace", "=", "True", ")", ":", "QWidget", ".", "show", "(", "self", ")", "self", ".", "visibility_changed", ".", "emit", "(", "True", ")", "self", ".", "change_number_matches", "(", ")", "if", "self", ".", "edit...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
FindReplace.hide
Overrides Qt Method
spyder/widgets/findreplace.py
def hide(self): """Overrides Qt Method""" for widget in self.replace_widgets: widget.hide() QWidget.hide(self) self.visibility_changed.emit(False) if self.editor is not None: self.editor.setFocus() self.clear_matches()
def hide(self): """Overrides Qt Method""" for widget in self.replace_widgets: widget.hide() QWidget.hide(self) self.visibility_changed.emit(False) if self.editor is not None: self.editor.setFocus() self.clear_matches()
[ "Overrides", "Qt", "Method" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L295-L303
[ "def", "hide", "(", "self", ")", ":", "for", "widget", "in", "self", ".", "replace_widgets", ":", "widget", ".", "hide", "(", ")", "QWidget", ".", "hide", "(", "self", ")", "self", ".", "visibility_changed", ".", "emit", "(", "False", ")", "if", "sel...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
FindReplace.show_replace
Show replace widgets
spyder/widgets/findreplace.py
def show_replace(self): """Show replace widgets""" self.show(hide_replace=False) for widget in self.replace_widgets: widget.show()
def show_replace(self): """Show replace widgets""" self.show(hide_replace=False) for widget in self.replace_widgets: widget.show()
[ "Show", "replace", "widgets" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L305-L309
[ "def", "show_replace", "(", "self", ")", ":", "self", ".", "show", "(", "hide_replace", "=", "False", ")", "for", "widget", "in", "self", ".", "replace_widgets", ":", "widget", ".", "show", "(", ")" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
FindReplace.refresh
Refresh widget
spyder/widgets/findreplace.py
def refresh(self): """Refresh widget""" if self.isHidden(): if self.editor is not None: self.clear_matches() return state = self.editor is not None for widget in self.widgets: widget.setEnabled(state) if state: ...
def refresh(self): """Refresh widget""" if self.isHidden(): if self.editor is not None: self.clear_matches() return state = self.editor is not None for widget in self.widgets: widget.setEnabled(state) if state: ...
[ "Refresh", "widget" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L316-L326
[ "def", "refresh", "(", "self", ")", ":", "if", "self", ".", "isHidden", "(", ")", ":", "if", "self", ".", "editor", "is", "not", "None", ":", "self", ".", "clear_matches", "(", ")", "return", "state", "=", "self", ".", "editor", "is", "not", "None"...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
FindReplace.set_editor
Set associated editor/web page: codeeditor.base.TextEditBaseWidget browser.WebView
spyder/widgets/findreplace.py
def set_editor(self, editor, refresh=True): """ Set associated editor/web page: codeeditor.base.TextEditBaseWidget browser.WebView """ self.editor = editor # Note: This is necessary to test widgets/editor.py # in Qt builds that don't have w...
def set_editor(self, editor, refresh=True): """ Set associated editor/web page: codeeditor.base.TextEditBaseWidget browser.WebView """ self.editor = editor # Note: This is necessary to test widgets/editor.py # in Qt builds that don't have w...
[ "Set", "associated", "editor", "/", "web", "page", ":", "codeeditor", ".", "base", ".", "TextEditBaseWidget", "browser", ".", "WebView" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L328-L349
[ "def", "set_editor", "(", "self", ",", "editor", ",", "refresh", "=", "True", ")", ":", "self", ".", "editor", "=", "editor", "# Note: This is necessary to test widgets/editor.py\r", "# in Qt builds that don't have web widgets\r", "try", ":", "from", "qtpy", ".", "QtW...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
FindReplace.find_next
Find next occurrence
spyder/widgets/findreplace.py
def find_next(self): """Find next occurrence""" state = self.find(changed=False, forward=True, rehighlight=False, multiline_replace_check=False) self.editor.setFocus() self.search_text.add_current_text() return state
def find_next(self): """Find next occurrence""" state = self.find(changed=False, forward=True, rehighlight=False, multiline_replace_check=False) self.editor.setFocus() self.search_text.add_current_text() return state
[ "Find", "next", "occurrence" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L352-L358
[ "def", "find_next", "(", "self", ")", ":", "state", "=", "self", ".", "find", "(", "changed", "=", "False", ",", "forward", "=", "True", ",", "rehighlight", "=", "False", ",", "multiline_replace_check", "=", "False", ")", "self", ".", "editor", ".", "s...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
FindReplace.find_previous
Find previous occurrence
spyder/widgets/findreplace.py
def find_previous(self): """Find previous occurrence""" state = self.find(changed=False, forward=False, rehighlight=False, multiline_replace_check=False) self.editor.setFocus() return state
def find_previous(self): """Find previous occurrence""" state = self.find(changed=False, forward=False, rehighlight=False, multiline_replace_check=False) self.editor.setFocus() return state
[ "Find", "previous", "occurrence" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L361-L366
[ "def", "find_previous", "(", "self", ")", ":", "state", "=", "self", ".", "find", "(", "changed", "=", "False", ",", "forward", "=", "False", ",", "rehighlight", "=", "False", ",", "multiline_replace_check", "=", "False", ")", "self", ".", "editor", ".",...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
FindReplace.text_has_been_edited
Find text has been edited (this slot won't be triggered when setting the search pattern combo box text programmatically)
spyder/widgets/findreplace.py
def text_has_been_edited(self, text): """Find text has been edited (this slot won't be triggered when setting the search pattern combo box text programmatically)""" self.find(changed=True, forward=True, start_highlight_timer=True)
def text_has_been_edited(self, text): """Find text has been edited (this slot won't be triggered when setting the search pattern combo box text programmatically)""" self.find(changed=True, forward=True, start_highlight_timer=True)
[ "Find", "text", "has", "been", "edited", "(", "this", "slot", "won", "t", "be", "triggered", "when", "setting", "the", "search", "pattern", "combo", "box", "text", "programmatically", ")" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L368-L371
[ "def", "text_has_been_edited", "(", "self", ",", "text", ")", ":", "self", ".", "find", "(", "changed", "=", "True", ",", "forward", "=", "True", ",", "start_highlight_timer", "=", "True", ")" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
FindReplace.highlight_matches
Highlight found results
spyder/widgets/findreplace.py
def highlight_matches(self): """Highlight found results""" if self.is_code_editor and self.highlight_button.isChecked(): text = self.search_text.currentText() words = self.words_button.isChecked() regexp = self.re_button.isChecked() self.editor.highl...
def highlight_matches(self): """Highlight found results""" if self.is_code_editor and self.highlight_button.isChecked(): text = self.search_text.currentText() words = self.words_button.isChecked() regexp = self.re_button.isChecked() self.editor.highl...
[ "Highlight", "found", "results" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L373-L380
[ "def", "highlight_matches", "(", "self", ")", ":", "if", "self", ".", "is_code_editor", "and", "self", ".", "highlight_button", ".", "isChecked", "(", ")", ":", "text", "=", "self", ".", "search_text", ".", "currentText", "(", ")", "words", "=", "self", ...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
FindReplace.find
Call the find function
spyder/widgets/findreplace.py
def find(self, changed=True, forward=True, rehighlight=True, start_highlight_timer=False, multiline_replace_check=True): """Call the find function""" # When several lines are selected in the editor and replace box is activated, # dynamic search is deactivated to prevent changin...
def find(self, changed=True, forward=True, rehighlight=True, start_highlight_timer=False, multiline_replace_check=True): """Call the find function""" # When several lines are selected in the editor and replace box is activated, # dynamic search is deactivated to prevent changin...
[ "Call", "the", "find", "function" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L387-L443
[ "def", "find", "(", "self", ",", "changed", "=", "True", ",", "forward", "=", "True", ",", "rehighlight", "=", "True", ",", "start_highlight_timer", "=", "False", ",", "multiline_replace_check", "=", "True", ")", ":", "# When several lines are selected in the edit...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
FindReplace.replace_find
Replace and find
spyder/widgets/findreplace.py
def replace_find(self, focus_replace_text=False, replace_all=False): """Replace and find""" if (self.editor is not None): replace_text = to_text_string(self.replace_text.currentText()) search_text = to_text_string(self.search_text.currentText()) re_pattern = None...
def replace_find(self, focus_replace_text=False, replace_all=False): """Replace and find""" if (self.editor is not None): replace_text = to_text_string(self.replace_text.currentText()) search_text = to_text_string(self.search_text.currentText()) re_pattern = None...
[ "Replace", "and", "find" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L446-L533
[ "def", "replace_find", "(", "self", ",", "focus_replace_text", "=", "False", ",", "replace_all", "=", "False", ")", ":", "if", "(", "self", ".", "editor", "is", "not", "None", ")", ":", "replace_text", "=", "to_text_string", "(", "self", ".", "replace_text...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
FindReplace.replace_find_selection
Replace and find in the current selection
spyder/widgets/findreplace.py
def replace_find_selection(self, focus_replace_text=False): """Replace and find in the current selection""" if self.editor is not None: replace_text = to_text_string(self.replace_text.currentText()) search_text = to_text_string(self.search_text.currentText()) cas...
def replace_find_selection(self, focus_replace_text=False): """Replace and find in the current selection""" if self.editor is not None: replace_text = to_text_string(self.replace_text.currentText()) search_text = to_text_string(self.search_text.currentText()) cas...
[ "Replace", "and", "find", "in", "the", "current", "selection" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L542-L583
[ "def", "replace_find_selection", "(", "self", ",", "focus_replace_text", "=", "False", ")", ":", "if", "self", ".", "editor", "is", "not", "None", ":", "replace_text", "=", "to_text_string", "(", "self", ".", "replace_text", ".", "currentText", "(", ")", ")"...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
FindReplace.change_number_matches
Change number of match and total matches.
spyder/widgets/findreplace.py
def change_number_matches(self, current_match=0, total_matches=0): """Change number of match and total matches.""" if current_match and total_matches: matches_string = u"{} {} {}".format(current_match, _(u"of"), total_matches) s...
def change_number_matches(self, current_match=0, total_matches=0): """Change number of match and total matches.""" if current_match and total_matches: matches_string = u"{} {} {}".format(current_match, _(u"of"), total_matches) s...
[ "Change", "number", "of", "match", "and", "total", "matches", "." ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L585-L595
[ "def", "change_number_matches", "(", "self", ",", "current_match", "=", "0", ",", "total_matches", "=", "0", ")", ":", "if", "current_match", "and", "total_matches", ":", "matches_string", "=", "u\"{} {} {}\"", ".", "format", "(", "current_match", ",", "_", "(...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
apply
Monkey patching rope See [1], [2], [3], [4] and [5] in module docstring.
spyder/utils/introspection/rope_patch.py
def apply(): """Monkey patching rope See [1], [2], [3], [4] and [5] in module docstring.""" from spyder.utils.programs import is_module_installed if is_module_installed('rope', '<0.9.4'): import rope raise ImportError("rope %s can't be patched" % rope.VERSION) # [1] Patchi...
def apply(): """Monkey patching rope See [1], [2], [3], [4] and [5] in module docstring.""" from spyder.utils.programs import is_module_installed if is_module_installed('rope', '<0.9.4'): import rope raise ImportError("rope %s can't be patched" % rope.VERSION) # [1] Patchi...
[ "Monkey", "patching", "rope", "See", "[", "1", "]", "[", "2", "]", "[", "3", "]", "[", "4", "]", "and", "[", "5", "]", "in", "module", "docstring", "." ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/introspection/rope_patch.py#L30-L211
[ "def", "apply", "(", ")", ":", "from", "spyder", ".", "utils", ".", "programs", "import", "is_module_installed", "if", "is_module_installed", "(", "'rope'", ",", "'<0.9.4'", ")", ":", "import", "rope", "raise", "ImportError", "(", "\"rope %s can't be patched\"", ...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
IndentationGuide.paintEvent
Override Qt method.
spyder/plugins/editor/panels/indentationguides.py
def paintEvent(self, event): """Override Qt method.""" painter = QPainter(self) color = QColor(self.color) color.setAlphaF(.5) painter.setPen(color) offset = self.editor.document().documentMargin() + \ self.editor.contentOffset().x() for _, line_numb...
def paintEvent(self, event): """Override Qt method.""" painter = QPainter(self) color = QColor(self.color) color.setAlphaF(.5) painter.setPen(color) offset = self.editor.document().documentMargin() + \ self.editor.contentOffset().x() for _, line_numb...
[ "Override", "Qt", "method", "." ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/panels/indentationguides.py#L32-L80
[ "def", "paintEvent", "(", "self", ",", "event", ")", ":", "painter", "=", "QPainter", "(", "self", ")", "color", "=", "QColor", "(", "self", ".", "color", ")", "color", ".", "setAlphaF", "(", ".5", ")", "painter", ".", "setPen", "(", "color", ")", ...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
Help.get_plugin_actions
Return a list of actions related to plugin
spyder/plugins/help/plugin.py
def get_plugin_actions(self): """Return a list of actions related to plugin""" return [self.rich_text_action, self.plain_text_action, self.show_source_action, MENU_SEPARATOR, self.auto_import_action]
def get_plugin_actions(self): """Return a list of actions related to plugin""" return [self.rich_text_action, self.plain_text_action, self.show_source_action, MENU_SEPARATOR, self.auto_import_action]
[ "Return", "a", "list", "of", "actions", "related", "to", "plugin" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L212-L216
[ "def", "get_plugin_actions", "(", "self", ")", ":", "return", "[", "self", ".", "rich_text_action", ",", "self", ".", "plain_text_action", ",", "self", ".", "show_source_action", ",", "MENU_SEPARATOR", ",", "self", ".", "auto_import_action", "]" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
Help.register_plugin
Register plugin in Spyder's main window
spyder/plugins/help/plugin.py
def register_plugin(self): """Register plugin in Spyder's main window""" self.focus_changed.connect(self.main.plugin_focus_changed) self.main.add_dockwidget(self) self.main.console.set_help(self) self.internal_shell = self.main.console.shell self.console = self.ma...
def register_plugin(self): """Register plugin in Spyder's main window""" self.focus_changed.connect(self.main.plugin_focus_changed) self.main.add_dockwidget(self) self.main.console.set_help(self) self.internal_shell = self.main.console.shell self.console = self.ma...
[ "Register", "plugin", "in", "Spyder", "s", "main", "window" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L218-L225
[ "def", "register_plugin", "(", "self", ")", ":", "self", ".", "focus_changed", ".", "connect", "(", "self", ".", "main", ".", "plugin_focus_changed", ")", "self", ".", "main", ".", "add_dockwidget", "(", "self", ")", "self", ".", "main", ".", "console", ...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
Help.refresh_plugin
Refresh widget
spyder/plugins/help/plugin.py
def refresh_plugin(self): """Refresh widget""" if self._starting_up: self._starting_up = False self.switch_to_rich_text() self.show_intro_message()
def refresh_plugin(self): """Refresh widget""" if self._starting_up: self._starting_up = False self.switch_to_rich_text() self.show_intro_message()
[ "Refresh", "widget" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L231-L236
[ "def", "refresh_plugin", "(", "self", ")", ":", "if", "self", ".", "_starting_up", ":", "self", ".", "_starting_up", "=", "False", "self", ".", "switch_to_rich_text", "(", ")", "self", ".", "show_intro_message", "(", ")" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
Help.update_font
Update font from Preferences
spyder/plugins/help/plugin.py
def update_font(self): """Update font from Preferences""" color_scheme = self.get_color_scheme() font = self.get_plugin_font() rich_font = self.get_plugin_font(rich_text=True) self.set_plain_text_font(font, color_scheme=color_scheme) self.set_rich_text_font(rich_f...
def update_font(self): """Update font from Preferences""" color_scheme = self.get_color_scheme() font = self.get_plugin_font() rich_font = self.get_plugin_font(rich_text=True) self.set_plain_text_font(font, color_scheme=color_scheme) self.set_rich_text_font(rich_f...
[ "Update", "font", "from", "Preferences" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L238-L245
[ "def", "update_font", "(", "self", ")", ":", "color_scheme", "=", "self", ".", "get_color_scheme", "(", ")", "font", "=", "self", ".", "get_plugin_font", "(", ")", "rich_font", "=", "self", ".", "get_plugin_font", "(", "rich_text", "=", "True", ")", "self"...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
Help.apply_plugin_settings
Apply configuration file's plugin settings
spyder/plugins/help/plugin.py
def apply_plugin_settings(self, options): """Apply configuration file's plugin settings""" color_scheme_n = 'color_scheme_name' color_scheme_o = self.get_color_scheme() connect_n = 'connect_to_oi' wrap_n = 'wrap' wrap_o = self.get_option(wrap_n) self.wrap_a...
def apply_plugin_settings(self, options): """Apply configuration file's plugin settings""" color_scheme_n = 'color_scheme_name' color_scheme_o = self.get_color_scheme() connect_n = 'connect_to_oi' wrap_n = 'wrap' wrap_o = self.get_option(wrap_n) self.wrap_a...
[ "Apply", "configuration", "file", "s", "plugin", "settings" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L247-L267
[ "def", "apply_plugin_settings", "(", "self", ",", "options", ")", ":", "color_scheme_n", "=", "'color_scheme_name'", "color_scheme_o", "=", "self", ".", "get_color_scheme", "(", ")", "connect_n", "=", "'connect_to_oi'", "wrap_n", "=", "'wrap'", "wrap_o", "=", "sel...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
Help.set_rich_text_font
Set rich text mode font
spyder/plugins/help/plugin.py
def set_rich_text_font(self, font): """Set rich text mode font""" self.rich_text.set_font(font, fixed_font=self.get_plugin_font())
def set_rich_text_font(self, font): """Set rich text mode font""" self.rich_text.set_font(font, fixed_font=self.get_plugin_font())
[ "Set", "rich", "text", "mode", "font" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L328-L330
[ "def", "set_rich_text_font", "(", "self", ",", "font", ")", ":", "self", ".", "rich_text", ".", "set_font", "(", "font", ",", "fixed_font", "=", "self", ".", "get_plugin_font", "(", ")", ")" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
Help.set_plain_text_font
Set plain text mode font
spyder/plugins/help/plugin.py
def set_plain_text_font(self, font, color_scheme=None): """Set plain text mode font""" self.plain_text.set_font(font, color_scheme=color_scheme)
def set_plain_text_font(self, font, color_scheme=None): """Set plain text mode font""" self.plain_text.set_font(font, color_scheme=color_scheme)
[ "Set", "plain", "text", "mode", "font" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L332-L334
[ "def", "set_plain_text_font", "(", "self", ",", "font", ",", "color_scheme", "=", "None", ")", ":", "self", ".", "plain_text", ".", "set_font", "(", "font", ",", "color_scheme", "=", "color_scheme", ")" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
Help.toggle_wrap_mode
Toggle wrap mode
spyder/plugins/help/plugin.py
def toggle_wrap_mode(self, checked): """Toggle wrap mode""" self.plain_text.editor.toggle_wrap_mode(checked) self.set_option('wrap', checked)
def toggle_wrap_mode(self, checked): """Toggle wrap mode""" self.plain_text.editor.toggle_wrap_mode(checked) self.set_option('wrap', checked)
[ "Toggle", "wrap", "mode" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L341-L344
[ "def", "toggle_wrap_mode", "(", "self", ",", "checked", ")", ":", "self", ".", "plain_text", ".", "editor", ".", "toggle_wrap_mode", "(", "checked", ")", "self", ".", "set_option", "(", "'wrap'", ",", "checked", ")" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
Help.switch_to_plain_text
Switch to plain text mode
spyder/plugins/help/plugin.py
def switch_to_plain_text(self): """Switch to plain text mode""" self.rich_help = False self.plain_text.show() self.rich_text.hide() self.plain_text_action.setChecked(True)
def switch_to_plain_text(self): """Switch to plain text mode""" self.rich_help = False self.plain_text.show() self.rich_text.hide() self.plain_text_action.setChecked(True)
[ "Switch", "to", "plain", "text", "mode" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L358-L363
[ "def", "switch_to_plain_text", "(", "self", ")", ":", "self", ".", "rich_help", "=", "False", "self", ".", "plain_text", ".", "show", "(", ")", "self", ".", "rich_text", ".", "hide", "(", ")", "self", ".", "plain_text_action", ".", "setChecked", "(", "Tr...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
Help.switch_to_rich_text
Switch to rich text mode
spyder/plugins/help/plugin.py
def switch_to_rich_text(self): """Switch to rich text mode""" self.rich_help = True self.plain_text.hide() self.rich_text.show() self.rich_text_action.setChecked(True) self.show_source_action.setChecked(False)
def switch_to_rich_text(self): """Switch to rich text mode""" self.rich_help = True self.plain_text.hide() self.rich_text.show() self.rich_text_action.setChecked(True) self.show_source_action.setChecked(False)
[ "Switch", "to", "rich", "text", "mode" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L365-L371
[ "def", "switch_to_rich_text", "(", "self", ")", ":", "self", ".", "rich_help", "=", "True", "self", ".", "plain_text", ".", "hide", "(", ")", "self", ".", "rich_text", ".", "show", "(", ")", "self", ".", "rich_text_action", ".", "setChecked", "(", "True"...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
Help.set_plain_text
Set plain text docs
spyder/plugins/help/plugin.py
def set_plain_text(self, text, is_code): """Set plain text docs""" # text is coming from utils.dochelpers.getdoc if type(text) is dict: name = text['name'] if name: rst_title = ''.join(['='*len(name), '\n', name, '\n', ...
def set_plain_text(self, text, is_code): """Set plain text docs""" # text is coming from utils.dochelpers.getdoc if type(text) is dict: name = text['name'] if name: rst_title = ''.join(['='*len(name), '\n', name, '\n', ...
[ "Set", "plain", "text", "docs" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L373-L402
[ "def", "set_plain_text", "(", "self", ",", "text", ",", "is_code", ")", ":", "# text is coming from utils.dochelpers.getdoc\r", "if", "type", "(", "text", ")", "is", "dict", ":", "name", "=", "text", "[", "'name'", "]", "if", "name", ":", "rst_title", "=", ...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
Help.set_rich_text_html
Set rich text
spyder/plugins/help/plugin.py
def set_rich_text_html(self, html_text, base_url): """Set rich text""" self.rich_text.set_html(html_text, base_url) self.save_text([self.rich_text.set_html, html_text, base_url])
def set_rich_text_html(self, html_text, base_url): """Set rich text""" self.rich_text.set_html(html_text, base_url) self.save_text([self.rich_text.set_html, html_text, base_url])
[ "Set", "rich", "text" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L404-L407
[ "def", "set_rich_text_html", "(", "self", ",", "html_text", ",", "base_url", ")", ":", "self", ".", "rich_text", ".", "set_html", "(", "html_text", ",", "base_url", ")", "self", ".", "save_text", "(", "[", "self", ".", "rich_text", ".", "set_html", ",", ...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
Help.show_rich_text
Show text in rich mode
spyder/plugins/help/plugin.py
def show_rich_text(self, text, collapse=False, img_path=''): """Show text in rich mode""" self.switch_to_plugin() self.switch_to_rich_text() context = generate_context(collapse=collapse, img_path=img_path, css_path=self.css_path) self.rend...
def show_rich_text(self, text, collapse=False, img_path=''): """Show text in rich mode""" self.switch_to_plugin() self.switch_to_rich_text() context = generate_context(collapse=collapse, img_path=img_path, css_path=self.css_path) self.rend...
[ "Show", "text", "in", "rich", "mode" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L440-L446
[ "def", "show_rich_text", "(", "self", ",", "text", ",", "collapse", "=", "False", ",", "img_path", "=", "''", ")", ":", "self", ".", "switch_to_plugin", "(", ")", "self", ".", "switch_to_rich_text", "(", ")", "context", "=", "generate_context", "(", "colla...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
Help.show_plain_text
Show text in plain mode
spyder/plugins/help/plugin.py
def show_plain_text(self, text): """Show text in plain mode""" self.switch_to_plugin() self.switch_to_plain_text() self.set_plain_text(text, is_code=False)
def show_plain_text(self, text): """Show text in plain mode""" self.switch_to_plugin() self.switch_to_plain_text() self.set_plain_text(text, is_code=False)
[ "Show", "text", "in", "plain", "mode" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L448-L452
[ "def", "show_plain_text", "(", "self", ",", "text", ")", ":", "self", ".", "switch_to_plugin", "(", ")", "self", ".", "switch_to_plain_text", "(", ")", "self", ".", "set_plain_text", "(", "text", ",", "is_code", "=", "False", ")" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
Help.show_tutorial
Show the Spyder tutorial in the Help plugin, opening it if needed
spyder/plugins/help/plugin.py
def show_tutorial(self): """Show the Spyder tutorial in the Help plugin, opening it if needed""" self.switch_to_plugin() tutorial_path = get_module_source_path('spyder.plugins.help.utils') tutorial = osp.join(tutorial_path, 'tutorial.rst') text = open(tutorial).read() ...
def show_tutorial(self): """Show the Spyder tutorial in the Help plugin, opening it if needed""" self.switch_to_plugin() tutorial_path = get_module_source_path('spyder.plugins.help.utils') tutorial = osp.join(tutorial_path, 'tutorial.rst') text = open(tutorial).read() ...
[ "Show", "the", "Spyder", "tutorial", "in", "the", "Help", "plugin", "opening", "it", "if", "needed" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L455-L461
[ "def", "show_tutorial", "(", "self", ")", ":", "self", ".", "switch_to_plugin", "(", ")", "tutorial_path", "=", "get_module_source_path", "(", "'spyder.plugins.help.utils'", ")", "tutorial", "=", "osp", ".", "join", "(", "tutorial_path", ",", "'tutorial.rst'", ")"...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
Help.set_object_text
Set object analyzed by Help
spyder/plugins/help/plugin.py
def set_object_text(self, text, force_refresh=False, ignore_unknown=False): """Set object analyzed by Help""" if (self.locked and not force_refresh): return self.switch_to_console_source() add_to_combo = True if text is None: text = to_text_string...
def set_object_text(self, text, force_refresh=False, ignore_unknown=False): """Set object analyzed by Help""" if (self.locked and not force_refresh): return self.switch_to_console_source() add_to_combo = True if text is None: text = to_text_string...
[ "Set", "object", "analyzed", "by", "Help" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L483-L507
[ "def", "set_object_text", "(", "self", ",", "text", ",", "force_refresh", "=", "False", ",", "ignore_unknown", "=", "False", ")", ":", "if", "(", "self", ".", "locked", "and", "not", "force_refresh", ")", ":", "return", "self", ".", "switch_to_console_source...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
Help.set_editor_doc
Use the help plugin to show docstring dictionary computed with introspection plugin from the Editor plugin
spyder/plugins/help/plugin.py
def set_editor_doc(self, doc, force_refresh=False): """ Use the help plugin to show docstring dictionary computed with introspection plugin from the Editor plugin """ if (self.locked and not force_refresh): return self.switch_to_editor_source() ...
def set_editor_doc(self, doc, force_refresh=False): """ Use the help plugin to show docstring dictionary computed with introspection plugin from the Editor plugin """ if (self.locked and not force_refresh): return self.switch_to_editor_source() ...
[ "Use", "the", "help", "plugin", "to", "show", "docstring", "dictionary", "computed", "with", "introspection", "plugin", "from", "the", "Editor", "plugin" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L509-L529
[ "def", "set_editor_doc", "(", "self", ",", "doc", ",", "force_refresh", "=", "False", ")", ":", "if", "(", "self", ".", "locked", "and", "not", "force_refresh", ")", ":", "return", "self", ".", "switch_to_editor_source", "(", ")", "self", ".", "_last_edito...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
Help.load_history
Load history from a text file in user home directory
spyder/plugins/help/plugin.py
def load_history(self, obj=None): """Load history from a text file in user home directory""" if osp.isfile(self.LOG_PATH): history = [line.replace('\n', '') for line in open(self.LOG_PATH, 'r').readlines()] else: history = [] return h...
def load_history(self, obj=None): """Load history from a text file in user home directory""" if osp.isfile(self.LOG_PATH): history = [line.replace('\n', '') for line in open(self.LOG_PATH, 'r').readlines()] else: history = [] return h...
[ "Load", "history", "from", "a", "text", "file", "in", "user", "home", "directory" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L545-L552
[ "def", "load_history", "(", "self", ",", "obj", "=", "None", ")", ":", "if", "osp", ".", "isfile", "(", "self", ".", "LOG_PATH", ")", ":", "history", "=", "[", "line", ".", "replace", "(", "'\\n'", ",", "''", ")", "for", "line", "in", "open", "("...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
Help.save_history
Save history to a text file in user home directory
spyder/plugins/help/plugin.py
def save_history(self): """Save history to a text file in user home directory""" # Don't fail when saving search history to disk # See issues 8878 and 6864 try: search_history = [to_text_string(self.combo.itemText(index)) for index in range...
def save_history(self): """Save history to a text file in user home directory""" # Don't fail when saving search history to disk # See issues 8878 and 6864 try: search_history = [to_text_string(self.combo.itemText(index)) for index in range...
[ "Save", "history", "to", "a", "text", "file", "in", "user", "home", "directory" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L554-L564
[ "def", "save_history", "(", "self", ")", ":", "# Don't fail when saving search history to disk\r", "# See issues 8878 and 6864\r", "try", ":", "search_history", "=", "[", "to_text_string", "(", "self", ".", "combo", ".", "itemText", "(", "index", ")", ")", "for", "i...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
Help.toggle_plain_text
Toggle plain text docstring
spyder/plugins/help/plugin.py
def toggle_plain_text(self, checked): """Toggle plain text docstring""" if checked: self.docstring = checked self.switch_to_plain_text() self.force_refresh() self.set_option('rich_mode', not checked)
def toggle_plain_text(self, checked): """Toggle plain text docstring""" if checked: self.docstring = checked self.switch_to_plain_text() self.force_refresh() self.set_option('rich_mode', not checked)
[ "Toggle", "plain", "text", "docstring" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L567-L573
[ "def", "toggle_plain_text", "(", "self", ",", "checked", ")", ":", "if", "checked", ":", "self", ".", "docstring", "=", "checked", "self", ".", "switch_to_plain_text", "(", ")", "self", ".", "force_refresh", "(", ")", "self", ".", "set_option", "(", "'rich...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
Help.toggle_show_source
Toggle show source code
spyder/plugins/help/plugin.py
def toggle_show_source(self, checked): """Toggle show source code""" if checked: self.switch_to_plain_text() self.docstring = not checked self.force_refresh() self.set_option('rich_mode', not checked)
def toggle_show_source(self, checked): """Toggle show source code""" if checked: self.switch_to_plain_text() self.docstring = not checked self.force_refresh() self.set_option('rich_mode', not checked)
[ "Toggle", "show", "source", "code" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L576-L582
[ "def", "toggle_show_source", "(", "self", ",", "checked", ")", ":", "if", "checked", ":", "self", ".", "switch_to_plain_text", "(", ")", "self", ".", "docstring", "=", "not", "checked", "self", ".", "force_refresh", "(", ")", "self", ".", "set_option", "("...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
Help.toggle_rich_text
Toggle between sphinxified docstrings or plain ones
spyder/plugins/help/plugin.py
def toggle_rich_text(self, checked): """Toggle between sphinxified docstrings or plain ones""" if checked: self.docstring = not checked self.switch_to_rich_text() self.set_option('rich_mode', checked)
def toggle_rich_text(self, checked): """Toggle between sphinxified docstrings or plain ones""" if checked: self.docstring = not checked self.switch_to_rich_text() self.set_option('rich_mode', checked)
[ "Toggle", "between", "sphinxified", "docstrings", "or", "plain", "ones" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L585-L590
[ "def", "toggle_rich_text", "(", "self", ",", "checked", ")", ":", "if", "checked", ":", "self", ".", "docstring", "=", "not", "checked", "self", ".", "switch_to_rich_text", "(", ")", "self", ".", "set_option", "(", "'rich_mode'", ",", "checked", ")" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
Help.toggle_auto_import
Toggle automatic import feature
spyder/plugins/help/plugin.py
def toggle_auto_import(self, checked): """Toggle automatic import feature""" self.combo.validate_current_text() self.set_option('automatic_import', checked) self.force_refresh()
def toggle_auto_import(self, checked): """Toggle automatic import feature""" self.combo.validate_current_text() self.set_option('automatic_import', checked) self.force_refresh()
[ "Toggle", "automatic", "import", "feature" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L593-L597
[ "def", "toggle_auto_import", "(", "self", ",", "checked", ")", ":", "self", ".", "combo", ".", "validate_current_text", "(", ")", "self", ".", "set_option", "(", "'automatic_import'", ",", "checked", ")", "self", ".", "force_refresh", "(", ")" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
Help._update_lock_icon
Update locked state icon
spyder/plugins/help/plugin.py
def _update_lock_icon(self): """Update locked state icon""" icon = ima.icon('lock') if self.locked else ima.icon('lock_open') self.locked_button.setIcon(icon) tip = _("Unlock") if self.locked else _("Lock") self.locked_button.setToolTip(tip)
def _update_lock_icon(self): """Update locked state icon""" icon = ima.icon('lock') if self.locked else ima.icon('lock_open') self.locked_button.setIcon(icon) tip = _("Unlock") if self.locked else _("Lock") self.locked_button.setToolTip(tip)
[ "Update", "locked", "state", "icon" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L608-L613
[ "def", "_update_lock_icon", "(", "self", ")", ":", "icon", "=", "ima", ".", "icon", "(", "'lock'", ")", "if", "self", ".", "locked", "else", "ima", ".", "icon", "(", "'lock_open'", ")", "self", ".", "locked_button", ".", "setIcon", "(", "icon", ")", ...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
Help.get_shell
Return shell which is currently bound to Help, or another running shell if it has been terminated
spyder/plugins/help/plugin.py
def get_shell(self): """ Return shell which is currently bound to Help, or another running shell if it has been terminated """ if (not hasattr(self.shell, 'get_doc') or (hasattr(self.shell, 'is_running') and not self.shell.is_running())): ...
def get_shell(self): """ Return shell which is currently bound to Help, or another running shell if it has been terminated """ if (not hasattr(self.shell, 'get_doc') or (hasattr(self.shell, 'is_running') and not self.shell.is_running())): ...
[ "Return", "shell", "which", "is", "currently", "bound", "to", "Help", "or", "another", "running", "shell", "if", "it", "has", "been", "terminated" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L619-L634
[ "def", "get_shell", "(", "self", ")", ":", "if", "(", "not", "hasattr", "(", "self", ".", "shell", ",", "'get_doc'", ")", "or", "(", "hasattr", "(", "self", ".", "shell", ",", "'is_running'", ")", "and", "not", "self", ".", "shell", ".", "is_running"...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
Help.render_sphinx_doc
Transform doc string dictionary to HTML and show it
spyder/plugins/help/plugin.py
def render_sphinx_doc(self, doc, context=None, css_path=CSS_PATH): """Transform doc string dictionary to HTML and show it""" # Math rendering option could have changed if self.main.editor is not None: fname = self.main.editor.get_current_filename() dname = osp.dirnam...
def render_sphinx_doc(self, doc, context=None, css_path=CSS_PATH): """Transform doc string dictionary to HTML and show it""" # Math rendering option could have changed if self.main.editor is not None: fname = self.main.editor.get_current_filename() dname = osp.dirnam...
[ "Transform", "doc", "string", "dictionary", "to", "HTML", "and", "show", "it" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L636-L645
[ "def", "render_sphinx_doc", "(", "self", ",", "doc", ",", "context", "=", "None", ",", "css_path", "=", "CSS_PATH", ")", ":", "# Math rendering option could have changed\r", "if", "self", ".", "main", ".", "editor", "is", "not", "None", ":", "fname", "=", "s...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
Help._on_sphinx_thread_html_ready
Set our sphinx documentation based on thread result
spyder/plugins/help/plugin.py
def _on_sphinx_thread_html_ready(self, html_text): """Set our sphinx documentation based on thread result""" self._sphinx_thread.wait() self.set_rich_text_html(html_text, QUrl.fromLocalFile(self.css_path))
def _on_sphinx_thread_html_ready(self, html_text): """Set our sphinx documentation based on thread result""" self._sphinx_thread.wait() self.set_rich_text_html(html_text, QUrl.fromLocalFile(self.css_path))
[ "Set", "our", "sphinx", "documentation", "based", "on", "thread", "result" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L647-L650
[ "def", "_on_sphinx_thread_html_ready", "(", "self", ",", "html_text", ")", ":", "self", ".", "_sphinx_thread", ".", "wait", "(", ")", "self", ".", "set_rich_text_html", "(", "html_text", ",", "QUrl", ".", "fromLocalFile", "(", "self", ".", "css_path", ")", "...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
Help._on_sphinx_thread_error_msg
Display error message on Sphinx rich text failure
spyder/plugins/help/plugin.py
def _on_sphinx_thread_error_msg(self, error_msg): """ Display error message on Sphinx rich text failure""" self._sphinx_thread.wait() self.plain_text_action.setChecked(True) sphinx_ver = programs.get_module_version('sphinx') QMessageBox.critical(self, _(...
def _on_sphinx_thread_error_msg(self, error_msg): """ Display error message on Sphinx rich text failure""" self._sphinx_thread.wait() self.plain_text_action.setChecked(True) sphinx_ver = programs.get_module_version('sphinx') QMessageBox.critical(self, _(...
[ "Display", "error", "message", "on", "Sphinx", "rich", "text", "failure" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L652-L663
[ "def", "_on_sphinx_thread_error_msg", "(", "self", ",", "error_msg", ")", ":", "self", ".", "_sphinx_thread", ".", "wait", "(", ")", "self", ".", "plain_text_action", ".", "setChecked", "(", "True", ")", "sphinx_ver", "=", "programs", ".", "get_module_version", ...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
Help.show_help
Show help
spyder/plugins/help/plugin.py
def show_help(self, obj_text, ignore_unknown=False): """Show help""" shell = self.get_shell() if shell is None: return obj_text = to_text_string(obj_text) if not shell.is_defined(obj_text): if self.get_option('automatic_import') and \ ...
def show_help(self, obj_text, ignore_unknown=False): """Show help""" shell = self.get_shell() if shell is None: return obj_text = to_text_string(obj_text) if not shell.is_defined(obj_text): if self.get_option('automatic_import') and \ ...
[ "Show", "help" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L665-L709
[ "def", "show_help", "(", "self", ",", "obj_text", ",", "ignore_unknown", "=", "False", ")", ":", "shell", "=", "self", ".", "get_shell", "(", ")", "if", "shell", "is", "None", ":", "return", "obj_text", "=", "to_text_string", "(", "obj_text", ")", "if", ...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
TextDecoration.contains_cursor
Checks if the textCursor is in the decoration. :param cursor: The text cursor to test :type cursor: QtGui.QTextCursor :returns: True if the cursor is over the selection
spyder/plugins/editor/api/decoration.py
def contains_cursor(self, cursor): """ Checks if the textCursor is in the decoration. :param cursor: The text cursor to test :type cursor: QtGui.QTextCursor :returns: True if the cursor is over the selection """ start = self.cursor.selectionStart() end =...
def contains_cursor(self, cursor): """ Checks if the textCursor is in the decoration. :param cursor: The text cursor to test :type cursor: QtGui.QTextCursor :returns: True if the cursor is over the selection """ start = self.cursor.selectionStart() end =...
[ "Checks", "if", "the", "textCursor", "is", "in", "the", "decoration", "." ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/api/decoration.py#L117-L130
[ "def", "contains_cursor", "(", "self", ",", "cursor", ")", ":", "start", "=", "self", ".", "cursor", ".", "selectionStart", "(", ")", "end", "=", "self", ".", "cursor", ".", "selectionEnd", "(", ")", "if", "cursor", ".", "atBlockEnd", "(", ")", ":", ...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
TextDecoration.select_line
Select the entire line but starts at the first non whitespace character and stops at the non-whitespace character. :return:
spyder/plugins/editor/api/decoration.py
def select_line(self): """ Select the entire line but starts at the first non whitespace character and stops at the non-whitespace character. :return: """ self.cursor.movePosition(self.cursor.StartOfBlock) text = self.cursor.block().text() lindent = len(te...
def select_line(self): """ Select the entire line but starts at the first non whitespace character and stops at the non-whitespace character. :return: """ self.cursor.movePosition(self.cursor.StartOfBlock) text = self.cursor.block().text() lindent = len(te...
[ "Select", "the", "entire", "line", "but", "starts", "at", "the", "first", "non", "whitespace", "character", "and", "stops", "at", "the", "non", "-", "whitespace", "character", ".", ":", "return", ":" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/api/decoration.py#L162-L173
[ "def", "select_line", "(", "self", ")", ":", "self", ".", "cursor", ".", "movePosition", "(", "self", ".", "cursor", ".", "StartOfBlock", ")", "text", "=", "self", ".", "cursor", ".", "block", "(", ")", ".", "text", "(", ")", "lindent", "=", "len", ...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
TextDecoration.set_as_underlined
Underlines the text. :param color: underline color.
spyder/plugins/editor/api/decoration.py
def set_as_underlined(self, color=Qt.blue): """ Underlines the text. :param color: underline color. """ self.format.setUnderlineStyle( QTextCharFormat.SingleUnderline) self.format.setUnderlineColor(color)
def set_as_underlined(self, color=Qt.blue): """ Underlines the text. :param color: underline color. """ self.format.setUnderlineStyle( QTextCharFormat.SingleUnderline) self.format.setUnderlineColor(color)
[ "Underlines", "the", "text", "." ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/api/decoration.py#L190-L198
[ "def", "set_as_underlined", "(", "self", ",", "color", "=", "Qt", ".", "blue", ")", ":", "self", ".", "format", ".", "setUnderlineStyle", "(", "QTextCharFormat", ".", "SingleUnderline", ")", "self", ".", "format", ".", "setUnderlineColor", "(", "color", ")" ...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
TextDecoration.set_as_spell_check
Underlines text as a spellcheck error. :param color: Underline color :type color: QtGui.QColor
spyder/plugins/editor/api/decoration.py
def set_as_spell_check(self, color=Qt.blue): """ Underlines text as a spellcheck error. :param color: Underline color :type color: QtGui.QColor """ self.format.setUnderlineStyle( QTextCharFormat.SpellCheckUnderline) self.format.setUnderlineColor(color...
def set_as_spell_check(self, color=Qt.blue): """ Underlines text as a spellcheck error. :param color: Underline color :type color: QtGui.QColor """ self.format.setUnderlineStyle( QTextCharFormat.SpellCheckUnderline) self.format.setUnderlineColor(color...
[ "Underlines", "text", "as", "a", "spellcheck", "error", "." ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/api/decoration.py#L200-L209
[ "def", "set_as_spell_check", "(", "self", ",", "color", "=", "Qt", ".", "blue", ")", ":", "self", ".", "format", ".", "setUnderlineStyle", "(", "QTextCharFormat", ".", "SpellCheckUnderline", ")", "self", ".", "format", ".", "setUnderlineColor", "(", "color", ...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
TextDecoration.set_as_error
Highlights text as a syntax error. :param color: Underline color :type color: QtGui.QColor
spyder/plugins/editor/api/decoration.py
def set_as_error(self, color=Qt.red): """ Highlights text as a syntax error. :param color: Underline color :type color: QtGui.QColor """ self.format.setUnderlineStyle( QTextCharFormat.WaveUnderline) self.format.setUnderlineColor(color)
def set_as_error(self, color=Qt.red): """ Highlights text as a syntax error. :param color: Underline color :type color: QtGui.QColor """ self.format.setUnderlineStyle( QTextCharFormat.WaveUnderline) self.format.setUnderlineColor(color)
[ "Highlights", "text", "as", "a", "syntax", "error", "." ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/api/decoration.py#L211-L220
[ "def", "set_as_error", "(", "self", ",", "color", "=", "Qt", ".", "red", ")", ":", "self", ".", "format", ".", "setUnderlineStyle", "(", "QTextCharFormat", ".", "WaveUnderline", ")", "self", ".", "format", ".", "setUnderlineColor", "(", "color", ")" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
TextDecoration.set_as_warning
Highlights text as a syntax warning. :param color: Underline color :type color: QtGui.QColor
spyder/plugins/editor/api/decoration.py
def set_as_warning(self, color=QColor("orange")): """ Highlights text as a syntax warning. :param color: Underline color :type color: QtGui.QColor """ self.format.setUnderlineStyle( QTextCharFormat.WaveUnderline) self.format.setUnderlineColor(color)
def set_as_warning(self, color=QColor("orange")): """ Highlights text as a syntax warning. :param color: Underline color :type color: QtGui.QColor """ self.format.setUnderlineStyle( QTextCharFormat.WaveUnderline) self.format.setUnderlineColor(color)
[ "Highlights", "text", "as", "a", "syntax", "warning", "." ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/api/decoration.py#L222-L231
[ "def", "set_as_warning", "(", "self", ",", "color", "=", "QColor", "(", "\"orange\"", ")", ")", ":", "self", ".", "format", ".", "setUnderlineStyle", "(", "QTextCharFormat", ".", "WaveUnderline", ")", "self", ".", "format", ".", "setUnderlineColor", "(", "co...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
AnalysisThread.run
Run analysis
spyder/plugins/editor/widgets/editor.py
def run(self): """Run analysis""" try: self.results = self.checker(self.source_code) except Exception as e: logger.error(e, exc_info=True)
def run(self): """Run analysis""" try: self.results = self.checker(self.source_code) except Exception as e: logger.error(e, exc_info=True)
[ "Run", "analysis" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/widgets/editor.py#L76-L81
[ "def", "run", "(", "self", ")", ":", "try", ":", "self", ".", "results", "=", "self", ".", "checker", "(", "self", ".", "source_code", ")", "except", "Exception", "as", "e", ":", "logger", ".", "error", "(", "e", ",", "exc_info", "=", "True", ")" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
ThreadManager.close_threads
Close threads associated to parent_id
spyder/plugins/editor/widgets/editor.py
def close_threads(self, parent): """Close threads associated to parent_id""" logger.debug("Call ThreadManager's 'close_threads'") if parent is None: # Closing all threads self.pending_threads = [] threadlist = [] for threads in list(self.sta...
def close_threads(self, parent): """Close threads associated to parent_id""" logger.debug("Call ThreadManager's 'close_threads'") if parent is None: # Closing all threads self.pending_threads = [] threadlist = [] for threads in list(self.sta...
[ "Close", "threads", "associated", "to", "parent_id" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/widgets/editor.py#L93-L112
[ "def", "close_threads", "(", "self", ",", "parent", ")", ":", "logger", ".", "debug", "(", "\"Call ThreadManager's 'close_threads'\"", ")", "if", "parent", "is", "None", ":", "# Closing all threads\r", "self", ".", "pending_threads", "=", "[", "]", "threadlist", ...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
ThreadManager.add_thread
Add thread to queue
spyder/plugins/editor/widgets/editor.py
def add_thread(self, checker, end_callback, source_code, parent): """Add thread to queue""" parent_id = id(parent) thread = AnalysisThread(self, checker, source_code) self.end_callbacks[id(thread)] = end_callback self.pending_threads.append((thread, parent_id)) logg...
def add_thread(self, checker, end_callback, source_code, parent): """Add thread to queue""" parent_id = id(parent) thread = AnalysisThread(self, checker, source_code) self.end_callbacks[id(thread)] = end_callback self.pending_threads.append((thread, parent_id)) logg...
[ "Add", "thread", "to", "queue" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/widgets/editor.py#L119-L126
[ "def", "add_thread", "(", "self", ",", "checker", ",", "end_callback", ",", "source_code", ",", "parent", ")", ":", "parent_id", "=", "id", "(", "parent", ")", "thread", "=", "AnalysisThread", "(", "self", ",", "checker", ",", "source_code", ")", "self", ...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
ThreadManager.update_queue
Update queue
spyder/plugins/editor/widgets/editor.py
def update_queue(self): """Update queue""" started = 0 for parent_id, threadlist in list(self.started_threads.items()): still_running = [] for thread in threadlist: if thread.isFinished(): end_callback = self.end_callbacks.pop(id...
def update_queue(self): """Update queue""" started = 0 for parent_id, threadlist in list(self.started_threads.items()): still_running = [] for thread in threadlist: if thread.isFinished(): end_callback = self.end_callbacks.pop(id...
[ "Update", "queue" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/widgets/editor.py#L128-L158
[ "def", "update_queue", "(", "self", ")", ":", "started", "=", "0", "for", "parent_id", ",", "threadlist", "in", "list", "(", "self", ".", "started_threads", ".", "items", "(", ")", ")", ":", "still_running", "=", "[", "]", "for", "thread", "in", "threa...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
FileInfo.text_changed
Editor's text has changed
spyder/plugins/editor/widgets/editor.py
def text_changed(self): """Editor's text has changed""" self.default = False self.editor.document().changed_since_autosave = True self.text_changed_at.emit(self.filename, self.editor.get_position('cursor'))
def text_changed(self): """Editor's text has changed""" self.default = False self.editor.document().changed_since_autosave = True self.text_changed_at.emit(self.filename, self.editor.get_position('cursor'))
[ "Editor", "s", "text", "has", "changed" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/widgets/editor.py#L197-L202
[ "def", "text_changed", "(", "self", ")", ":", "self", ".", "default", "=", "False", "self", ".", "editor", ".", "document", "(", ")", ".", "changed_since_autosave", "=", "True", "self", ".", "text_changed_at", ".", "emit", "(", "self", ".", "filename", "...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
FileInfo.run_todo_finder
Run TODO finder
spyder/plugins/editor/widgets/editor.py
def run_todo_finder(self): """Run TODO finder""" if self.editor.is_python(): self.threadmanager.add_thread(codeanalysis.find_tasks, self.todo_finished, self.get_source_code(), self)
def run_todo_finder(self): """Run TODO finder""" if self.editor.is_python(): self.threadmanager.add_thread(codeanalysis.find_tasks, self.todo_finished, self.get_source_code(), self)
[ "Run", "TODO", "finder" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/widgets/editor.py#L208-L213
[ "def", "run_todo_finder", "(", "self", ")", ":", "if", "self", ".", "editor", ".", "is_python", "(", ")", ":", "self", ".", "threadmanager", ".", "add_thread", "(", "codeanalysis", ".", "find_tasks", ",", "self", ".", "todo_finished", ",", "self", ".", "...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
FileInfo.set_todo_results
Set TODO results and update markers in editor
spyder/plugins/editor/widgets/editor.py
def set_todo_results(self, results): """Set TODO results and update markers in editor""" self.todo_results = results self.editor.process_todo(results)
def set_todo_results(self, results): """Set TODO results and update markers in editor""" self.todo_results = results self.editor.process_todo(results)
[ "Set", "TODO", "results", "and", "update", "markers", "in", "editor" ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/widgets/editor.py#L220-L223
[ "def", "set_todo_results", "(", "self", ",", "results", ")", ":", "self", ".", "todo_results", "=", "results", "self", ".", "editor", ".", "process_todo", "(", "results", ")" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
FileInfo.bookmarks_changed
Bookmarks list has changed.
spyder/plugins/editor/widgets/editor.py
def bookmarks_changed(self): """Bookmarks list has changed.""" bookmarks = self.editor.get_bookmarks() if self.editor.bookmarks != bookmarks: self.editor.bookmarks = bookmarks self.sig_save_bookmarks.emit(self.filename, repr(bookmarks))
def bookmarks_changed(self): """Bookmarks list has changed.""" bookmarks = self.editor.get_bookmarks() if self.editor.bookmarks != bookmarks: self.editor.bookmarks = bookmarks self.sig_save_bookmarks.emit(self.filename, repr(bookmarks))
[ "Bookmarks", "list", "has", "changed", "." ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/widgets/editor.py#L229-L234
[ "def", "bookmarks_changed", "(", "self", ")", ":", "bookmarks", "=", "self", ".", "editor", ".", "get_bookmarks", "(", ")", "if", "self", ".", "editor", ".", "bookmarks", "!=", "bookmarks", ":", "self", ".", "editor", ".", "bookmarks", "=", "bookmarks", ...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
StackHistory._update_id_list
Update list of corresponpding ids and tabs.
spyder/plugins/editor/widgets/editor.py
def _update_id_list(self): """Update list of corresponpding ids and tabs.""" self.id_list = [id(self.editor.tabs.widget(_i)) for _i in range(self.editor.tabs.count())]
def _update_id_list(self): """Update list of corresponpding ids and tabs.""" self.id_list = [id(self.editor.tabs.widget(_i)) for _i in range(self.editor.tabs.count())]
[ "Update", "list", "of", "corresponpding", "ids", "and", "tabs", "." ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/widgets/editor.py#L249-L252
[ "def", "_update_id_list", "(", "self", ")", ":", "self", ".", "id_list", "=", "[", "id", "(", "self", ".", "editor", ".", "tabs", ".", "widget", "(", "_i", ")", ")", "for", "_i", "in", "range", "(", "self", ".", "editor", ".", "tabs", ".", "count...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
StackHistory.refresh
Remove editors that are not longer open.
spyder/plugins/editor/widgets/editor.py
def refresh(self): """Remove editors that are not longer open.""" self._update_id_list() for _id in self.history[:]: if _id not in self.id_list: self.history.remove(_id)
def refresh(self): """Remove editors that are not longer open.""" self._update_id_list() for _id in self.history[:]: if _id not in self.id_list: self.history.remove(_id)
[ "Remove", "editors", "that", "are", "not", "longer", "open", "." ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/widgets/editor.py#L254-L259
[ "def", "refresh", "(", "self", ")", ":", "self", ".", "_update_id_list", "(", ")", "for", "_id", "in", "self", ".", "history", "[", ":", "]", ":", "if", "_id", "not", "in", "self", ".", "id_list", ":", "self", ".", "history", ".", "remove", "(", ...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
StackHistory.insert
Insert the widget (at tab index) in the position i (index).
spyder/plugins/editor/widgets/editor.py
def insert(self, i, tab_index): """Insert the widget (at tab index) in the position i (index).""" _id = id(self.editor.tabs.widget(tab_index)) self.history.insert(i, _id)
def insert(self, i, tab_index): """Insert the widget (at tab index) in the position i (index).""" _id = id(self.editor.tabs.widget(tab_index)) self.history.insert(i, _id)
[ "Insert", "the", "widget", "(", "at", "tab", "index", ")", "in", "the", "position", "i", "(", "index", ")", "." ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/widgets/editor.py#L282-L285
[ "def", "insert", "(", "self", ",", "i", ",", "tab_index", ")", ":", "_id", "=", "id", "(", "self", ".", "editor", ".", "tabs", ".", "widget", "(", "tab_index", ")", ")", "self", ".", "history", ".", "insert", "(", "i", ",", "_id", ")" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
StackHistory.remove
Remove the widget at the corresponding tab_index.
spyder/plugins/editor/widgets/editor.py
def remove(self, tab_index): """Remove the widget at the corresponding tab_index.""" _id = id(self.editor.tabs.widget(tab_index)) if _id in self.history: self.history.remove(_id)
def remove(self, tab_index): """Remove the widget at the corresponding tab_index.""" _id = id(self.editor.tabs.widget(tab_index)) if _id in self.history: self.history.remove(_id)
[ "Remove", "the", "widget", "at", "the", "corresponding", "tab_index", "." ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/widgets/editor.py#L287-L291
[ "def", "remove", "(", "self", ",", "tab_index", ")", ":", "_id", "=", "id", "(", "self", ".", "editor", ".", "tabs", ".", "widget", "(", "tab_index", ")", ")", "if", "_id", "in", "self", ".", "history", ":", "self", ".", "history", ".", "remove", ...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
StackHistory.remove_and_append
Remove previous entrances of a tab, and add it as the latest.
spyder/plugins/editor/widgets/editor.py
def remove_and_append(self, index): """Remove previous entrances of a tab, and add it as the latest.""" while index in self: self.remove(index) self.append(index)
def remove_and_append(self, index): """Remove previous entrances of a tab, and add it as the latest.""" while index in self: self.remove(index) self.append(index)
[ "Remove", "previous", "entrances", "of", "a", "tab", "and", "add", "it", "as", "the", "latest", "." ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/widgets/editor.py#L293-L297
[ "def", "remove_and_append", "(", "self", ",", "index", ")", ":", "while", "index", "in", "self", ":", "self", ".", "remove", "(", "index", ")", "self", ".", "append", "(", "index", ")" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
train
TabSwitcherWidget.load_data
Fill ListWidget with the tabs texts. Add elements in inverse order of stack_history.
spyder/plugins/editor/widgets/editor.py
def load_data(self): """Fill ListWidget with the tabs texts. Add elements in inverse order of stack_history. """ for index in reversed(self.stack_history): text = self.tabs.tabText(index) text = text.replace('&', '') item = QListWidgetItem(i...
def load_data(self): """Fill ListWidget with the tabs texts. Add elements in inverse order of stack_history. """ for index in reversed(self.stack_history): text = self.tabs.tabText(index) text = text.replace('&', '') item = QListWidgetItem(i...
[ "Fill", "ListWidget", "with", "the", "tabs", "texts", ".", "Add", "elements", "in", "inverse", "order", "of", "stack_history", "." ]
spyder-ide/spyder
python
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/widgets/editor.py#L326-L336
[ "def", "load_data", "(", "self", ")", ":", "for", "index", "in", "reversed", "(", "self", ".", "stack_history", ")", ":", "text", "=", "self", ".", "tabs", ".", "tabText", "(", "index", ")", "text", "=", "text", ".", "replace", "(", "'&'", ",", "''...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0