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 | FoldingPanel._highlight_caret_scope | Highlight the scope of the current caret position.
This get called only if :attr:`
spyder.widgets.panels.FoldingPanel.highlight_care_scope` is True. | spyder/plugins/editor/panels/codefolding.py | def _highlight_caret_scope(self):
"""
Highlight the scope of the current caret position.
This get called only if :attr:`
spyder.widgets.panels.FoldingPanel.highlight_care_scope` is True.
"""
cursor = self.editor.textCursor()
block_nbr = cursor.blockNumber()
... | def _highlight_caret_scope(self):
"""
Highlight the scope of the current caret position.
This get called only if :attr:`
spyder.widgets.panels.FoldingPanel.highlight_care_scope` is True.
"""
cursor = self.editor.textCursor()
block_nbr = cursor.blockNumber()
... | [
"Highlight",
"the",
"scope",
"of",
"the",
"current",
"caret",
"position",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/panels/codefolding.py#L657-L677 | [
"def",
"_highlight_caret_scope",
"(",
"self",
")",
":",
"cursor",
"=",
"self",
".",
"editor",
".",
"textCursor",
"(",
")",
"block_nbr",
"=",
"cursor",
".",
"blockNumber",
"(",
")",
"if",
"self",
".",
"_block_nbr",
"!=",
"block_nbr",
":",
"block",
"=",
"F... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | History.set_menu_actions | Add options to corner menu. | spyder/plugins/history/widgets.py | def set_menu_actions(self, menu_actions):
"""Add options to corner menu."""
if self.menu_actions is not None:
add_actions(self.menu, self.menu_actions) | def set_menu_actions(self, menu_actions):
"""Add options to corner menu."""
if self.menu_actions is not None:
add_actions(self.menu, self.menu_actions) | [
"Add",
"options",
"to",
"corner",
"menu",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/history/widgets.py#L76-L79 | [
"def",
"set_menu_actions",
"(",
"self",
",",
"menu_actions",
")",
":",
"if",
"self",
".",
"menu_actions",
"is",
"not",
"None",
":",
"add_actions",
"(",
"self",
".",
"menu",
",",
"self",
".",
"menu_actions",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | History.refresh | Refresh tabwidget. | spyder/plugins/history/widgets.py | def refresh(self):
"""Refresh tabwidget."""
if self.tabwidget.count():
editor = self.tabwidget.currentWidget()
else:
editor = None
self.find_widget.set_editor(editor) | def refresh(self):
"""Refresh tabwidget."""
if self.tabwidget.count():
editor = self.tabwidget.currentWidget()
else:
editor = None
self.find_widget.set_editor(editor) | [
"Refresh",
"tabwidget",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/history/widgets.py#L81-L87 | [
"def",
"refresh",
"(",
"self",
")",
":",
"if",
"self",
".",
"tabwidget",
".",
"count",
"(",
")",
":",
"editor",
"=",
"self",
".",
"tabwidget",
".",
"currentWidget",
"(",
")",
"else",
":",
"editor",
"=",
"None",
"self",
".",
"find_widget",
".",
"set_e... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | History.move_tab | Move tab.
(tabs themselves have already been moved by the history.tabwidget) | spyder/plugins/history/widgets.py | def move_tab(self, index_from, index_to):
"""
Move tab.
(tabs themselves have already been moved by the history.tabwidget)
"""
filename = self.filenames.pop(index_from)
editor = self.editors.pop(index_from)
self.filenames.insert(index_to, filename)
self.... | def move_tab(self, index_from, index_to):
"""
Move tab.
(tabs themselves have already been moved by the history.tabwidget)
"""
filename = self.filenames.pop(index_from)
editor = self.editors.pop(index_from)
self.filenames.insert(index_to, filename)
self.... | [
"Move",
"tab",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/history/widgets.py#L89-L99 | [
"def",
"move_tab",
"(",
"self",
",",
"index_from",
",",
"index_to",
")",
":",
"filename",
"=",
"self",
".",
"filenames",
".",
"pop",
"(",
"index_from",
")",
"editor",
"=",
"self",
".",
"editors",
".",
"pop",
"(",
"index_from",
")",
"self",
".",
"filena... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | History.add_history | Add new history tab.
Args:
filename (str): file to be loaded in a new tab. | spyder/plugins/history/widgets.py | def add_history(self, filename, color_scheme, font, wrap):
"""
Add new history tab.
Args:
filename (str): file to be loaded in a new tab.
"""
filename = encoding.to_unicode_from_fs(filename)
if filename in self.filenames:
return
editor = c... | def add_history(self, filename, color_scheme, font, wrap):
"""
Add new history tab.
Args:
filename (str): file to be loaded in a new tab.
"""
filename = encoding.to_unicode_from_fs(filename)
if filename in self.filenames:
return
editor = c... | [
"Add",
"new",
"history",
"tab",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/history/widgets.py#L101-L135 | [
"def",
"add_history",
"(",
"self",
",",
"filename",
",",
"color_scheme",
",",
"font",
",",
"wrap",
")",
":",
"filename",
"=",
"encoding",
".",
"to_unicode_from_fs",
"(",
"filename",
")",
"if",
"filename",
"in",
"self",
".",
"filenames",
":",
"return",
"edi... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | History.append_to_history | Append an entry to history filename.
Args:
filename (str): file to be updated in a new tab.
command (str): line to be added.
go_to_eof (bool): scroll to the end of file. | spyder/plugins/history/widgets.py | def append_to_history(self, filename, command, go_to_eof):
"""
Append an entry to history filename.
Args:
filename (str): file to be updated in a new tab.
command (str): line to be added.
go_to_eof (bool): scroll to the end of file.
"""
if not... | def append_to_history(self, filename, command, go_to_eof):
"""
Append an entry to history filename.
Args:
filename (str): file to be updated in a new tab.
command (str): line to be added.
go_to_eof (bool): scroll to the end of file.
"""
if not... | [
"Append",
"an",
"entry",
"to",
"history",
"filename",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/history/widgets.py#L137-L153 | [
"def",
"append_to_history",
"(",
"self",
",",
"filename",
",",
"command",
",",
"go_to_eof",
")",
":",
"if",
"not",
"is_text_string",
"(",
"filename",
")",
":",
"# filename is a QString",
"filename",
"=",
"to_text_string",
"(",
"filename",
".",
"toUtf8",
"(",
"... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | request | Call function req and then emit its results to the LSP server. | spyder/plugins/editor/utils/lsp.py | def request(req=None, method=None, requires_response=True):
"""Call function req and then emit its results to the LSP server."""
if req is None:
return functools.partial(request, method=method,
requires_response=requires_response)
@functools.wraps(req)
def wrapp... | def request(req=None, method=None, requires_response=True):
"""Call function req and then emit its results to the LSP server."""
if req is None:
return functools.partial(request, method=method,
requires_response=requires_response)
@functools.wraps(req)
def wrapp... | [
"Call",
"function",
"req",
"and",
"then",
"emit",
"its",
"results",
"to",
"the",
"LSP",
"server",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/lsp.py#L12-L24 | [
"def",
"request",
"(",
"req",
"=",
"None",
",",
"method",
"=",
"None",
",",
"requires_response",
"=",
"True",
")",
":",
"if",
"req",
"is",
"None",
":",
"return",
"functools",
".",
"partial",
"(",
"request",
",",
"method",
"=",
"method",
",",
"requires_... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | class_register | Class decorator that allows to map LSP method names to class methods. | spyder/plugins/editor/utils/lsp.py | def class_register(cls):
"""Class decorator that allows to map LSP method names to class methods."""
cls.handler_registry = {}
for method_name in dir(cls):
method = getattr(cls, method_name)
if hasattr(method, '_handle'):
cls.handler_registry.update({method._handle: method_name})... | def class_register(cls):
"""Class decorator that allows to map LSP method names to class methods."""
cls.handler_registry = {}
for method_name in dir(cls):
method = getattr(cls, method_name)
if hasattr(method, '_handle'):
cls.handler_registry.update({method._handle: method_name})... | [
"Class",
"decorator",
"that",
"allows",
"to",
"map",
"LSP",
"method",
"names",
"to",
"class",
"methods",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/lsp.py#L27-L34 | [
"def",
"class_register",
"(",
"cls",
")",
":",
"cls",
".",
"handler_registry",
"=",
"{",
"}",
"for",
"method_name",
"in",
"dir",
"(",
"cls",
")",
":",
"method",
"=",
"getattr",
"(",
"cls",
",",
"method_name",
")",
"if",
"hasattr",
"(",
"method",
",",
... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.update_font | Update font from Preferences | spyder/plugins/ipythonconsole/plugin.py | def update_font(self):
"""Update font from Preferences"""
font = self.get_plugin_font()
for client in self.clients:
client.set_font(font) | def update_font(self):
"""Update font from Preferences"""
font = self.get_plugin_font()
for client in self.clients:
client.set_font(font) | [
"Update",
"font",
"from",
"Preferences"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L185-L189 | [
"def",
"update_font",
"(",
"self",
")",
":",
"font",
"=",
"self",
".",
"get_plugin_font",
"(",
")",
"for",
"client",
"in",
"self",
".",
"clients",
":",
"client",
".",
"set_font",
"(",
"font",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.apply_plugin_settings | Apply configuration file's plugin settings | spyder/plugins/ipythonconsole/plugin.py | def apply_plugin_settings(self, options):
"""Apply configuration file's plugin settings"""
font_n = 'plugin_font'
font_o = self.get_plugin_font()
help_n = 'connect_to_oi'
help_o = CONF.get('help', 'connect/ipython_console')
color_scheme_n = 'color_scheme_name'
... | def apply_plugin_settings(self, options):
"""Apply configuration file's plugin settings"""
font_n = 'plugin_font'
font_o = self.get_plugin_font()
help_n = 'connect_to_oi'
help_o = CONF.get('help', 'connect/ipython_console')
color_scheme_n = 'color_scheme_name'
... | [
"Apply",
"configuration",
"file",
"s",
"plugin",
"settings"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L191-L219 | [
"def",
"apply_plugin_settings",
"(",
"self",
",",
"options",
")",
":",
"font_n",
"=",
"'plugin_font'",
"font_o",
"=",
"self",
".",
"get_plugin_font",
"(",
")",
"help_n",
"=",
"'connect_to_oi'",
"help_o",
"=",
"CONF",
".",
"get",
"(",
"'help'",
",",
"'connect... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.toggle_view | Toggle view | spyder/plugins/ipythonconsole/plugin.py | def toggle_view(self, checked):
"""Toggle view"""
if checked:
self.dockwidget.show()
self.dockwidget.raise_()
# Start a client in case there are none shown
if not self.clients:
if self.main.is_setting_up:
self.cr... | def toggle_view(self, checked):
"""Toggle view"""
if checked:
self.dockwidget.show()
self.dockwidget.raise_()
# Start a client in case there are none shown
if not self.clients:
if self.main.is_setting_up:
self.cr... | [
"Toggle",
"view"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L221-L233 | [
"def",
"toggle_view",
"(",
"self",
",",
"checked",
")",
":",
"if",
"checked",
":",
"self",
".",
"dockwidget",
".",
"show",
"(",
")",
"self",
".",
"dockwidget",
".",
"raise_",
"(",
")",
"# Start a client in case there are none shown\r",
"if",
"not",
"self",
"... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.closing_plugin | Perform actions before parent main window is closed | spyder/plugins/ipythonconsole/plugin.py | def closing_plugin(self, cancelable=False):
"""Perform actions before parent main window is closed"""
self.mainwindow_close = True
for client in self.clients:
client.shutdown()
client.remove_stderr_file()
client.dialog_manager.close_all()
cl... | def closing_plugin(self, cancelable=False):
"""Perform actions before parent main window is closed"""
self.mainwindow_close = True
for client in self.clients:
client.shutdown()
client.remove_stderr_file()
client.dialog_manager.close_all()
cl... | [
"Perform",
"actions",
"before",
"parent",
"main",
"window",
"is",
"closed"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L253-L261 | [
"def",
"closing_plugin",
"(",
"self",
",",
"cancelable",
"=",
"False",
")",
":",
"self",
".",
"mainwindow_close",
"=",
"True",
"for",
"client",
"in",
"self",
".",
"clients",
":",
"client",
".",
"shutdown",
"(",
")",
"client",
".",
"remove_stderr_file",
"("... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.refresh_plugin | Refresh tabwidget | spyder/plugins/ipythonconsole/plugin.py | def refresh_plugin(self):
"""Refresh tabwidget"""
client = None
if self.tabwidget.count():
client = self.tabwidget.currentWidget()
# Decide what to show for each client
if client.info_page != client.blank_page:
# Show info_page if it h... | def refresh_plugin(self):
"""Refresh tabwidget"""
client = None
if self.tabwidget.count():
client = self.tabwidget.currentWidget()
# Decide what to show for each client
if client.info_page != client.blank_page:
# Show info_page if it h... | [
"Refresh",
"tabwidget"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L263-L299 | [
"def",
"refresh_plugin",
"(",
"self",
")",
":",
"client",
"=",
"None",
"if",
"self",
".",
"tabwidget",
".",
"count",
"(",
")",
":",
"client",
"=",
"self",
".",
"tabwidget",
".",
"currentWidget",
"(",
")",
"# Decide what to show for each client\r",
"if",
"cli... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.get_plugin_actions | Return a list of actions related to plugin. | spyder/plugins/ipythonconsole/plugin.py | def get_plugin_actions(self):
"""Return a list of actions related to plugin."""
create_client_action = create_action(
self,
_("New console (default settings)"),
icon=ima.icon('ipython_console'),... | def get_plugin_actions(self):
"""Return a list of actions related to plugin."""
create_client_action = create_action(
self,
_("New console (default settings)"),
icon=ima.icon('ipython_console'),... | [
"Return",
"a",
"list",
"of",
"actions",
"related",
"to",
"plugin",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L301-L390 | [
"def",
"get_plugin_actions",
"(",
"self",
")",
":",
"create_client_action",
"=",
"create_action",
"(",
"self",
",",
"_",
"(",
"\"New console (default settings)\"",
")",
",",
"icon",
"=",
"ima",
".",
"icon",
"(",
"'ipython_console'",
")",
",",
"triggered",
"=",
... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.register_plugin | Register plugin in Spyder's main window | spyder/plugins/ipythonconsole/plugin.py | def register_plugin(self):
"""Register plugin in Spyder's main window"""
self.main.add_dockwidget(self)
self.focus_changed.connect(self.main.plugin_focus_changed)
self.edit_goto.connect(self.main.editor.load)
self.edit_goto[str, int, str, bool].connect(
... | def register_plugin(self):
"""Register plugin in Spyder's main window"""
self.main.add_dockwidget(self)
self.focus_changed.connect(self.main.plugin_focus_changed)
self.edit_goto.connect(self.main.editor.load)
self.edit_goto[str, int, str, bool].connect(
... | [
"Register",
"plugin",
"in",
"Spyder",
"s",
"main",
"window"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L392-L410 | [
"def",
"register_plugin",
"(",
"self",
")",
":",
"self",
".",
"main",
".",
"add_dockwidget",
"(",
"self",
")",
"self",
".",
"focus_changed",
".",
"connect",
"(",
"self",
".",
"main",
".",
"plugin_focus_changed",
")",
"self",
".",
"edit_goto",
".",
"connect... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.get_focus_client | Return current client with focus, if any | spyder/plugins/ipythonconsole/plugin.py | def get_focus_client(self):
"""Return current client with focus, if any"""
widget = QApplication.focusWidget()
for client in self.get_clients():
if widget is client or widget is client.get_control():
return client | def get_focus_client(self):
"""Return current client with focus, if any"""
widget = QApplication.focusWidget()
for client in self.get_clients():
if widget is client or widget is client.get_control():
return client | [
"Return",
"current",
"client",
"with",
"focus",
"if",
"any"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L417-L422 | [
"def",
"get_focus_client",
"(",
"self",
")",
":",
"widget",
"=",
"QApplication",
".",
"focusWidget",
"(",
")",
"for",
"client",
"in",
"self",
".",
"get_clients",
"(",
")",
":",
"if",
"widget",
"is",
"client",
"or",
"widget",
"is",
"client",
".",
"get_con... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.run_script | Run script in current or dedicated client | spyder/plugins/ipythonconsole/plugin.py | def run_script(self, filename, wdir, args, debug, post_mortem,
current_client, clear_variables):
"""Run script in current or dedicated client"""
norm = lambda text: remove_backslashes(to_text_string(text))
# Run Cython files in a dedicated console
is_cython = os... | def run_script(self, filename, wdir, args, debug, post_mortem,
current_client, clear_variables):
"""Run script in current or dedicated client"""
norm = lambda text: remove_backslashes(to_text_string(text))
# Run Cython files in a dedicated console
is_cython = os... | [
"Run",
"script",
"in",
"current",
"or",
"dedicated",
"client"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L436-L507 | [
"def",
"run_script",
"(",
"self",
",",
"filename",
",",
"wdir",
",",
"args",
",",
"debug",
",",
"post_mortem",
",",
"current_client",
",",
"clear_variables",
")",
":",
"norm",
"=",
"lambda",
"text",
":",
"remove_backslashes",
"(",
"to_text_string",
"(",
"tex... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.run_cell | Run cell in current or dedicated client. | spyder/plugins/ipythonconsole/plugin.py | def run_cell(self, code, cell_name, filename, run_cell_copy):
"""Run cell in current or dedicated client."""
def norm(text):
return remove_backslashes(to_text_string(text))
self.run_cell_filename = filename
# Select client to execute code on it
client = se... | def run_cell(self, code, cell_name, filename, run_cell_copy):
"""Run cell in current or dedicated client."""
def norm(text):
return remove_backslashes(to_text_string(text))
self.run_cell_filename = filename
# Select client to execute code on it
client = se... | [
"Run",
"cell",
"in",
"current",
"or",
"dedicated",
"client",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L509-L569 | [
"def",
"run_cell",
"(",
"self",
",",
"code",
",",
"cell_name",
",",
"filename",
",",
"run_cell_copy",
")",
":",
"def",
"norm",
"(",
"text",
")",
":",
"return",
"remove_backslashes",
"(",
"to_text_string",
"(",
"text",
")",
")",
"self",
".",
"run_cell_filen... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.set_current_client_working_directory | Set current client working directory. | spyder/plugins/ipythonconsole/plugin.py | def set_current_client_working_directory(self, directory):
"""Set current client working directory."""
shellwidget = self.get_current_shellwidget()
if shellwidget is not None:
shellwidget.set_cwd(directory) | def set_current_client_working_directory(self, directory):
"""Set current client working directory."""
shellwidget = self.get_current_shellwidget()
if shellwidget is not None:
shellwidget.set_cwd(directory) | [
"Set",
"current",
"client",
"working",
"directory",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L571-L575 | [
"def",
"set_current_client_working_directory",
"(",
"self",
",",
"directory",
")",
":",
"shellwidget",
"=",
"self",
".",
"get_current_shellwidget",
"(",
")",
"if",
"shellwidget",
"is",
"not",
"None",
":",
"shellwidget",
".",
"set_cwd",
"(",
"directory",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.set_working_directory | Set current working directory.
In the workingdirectory and explorer plugins. | spyder/plugins/ipythonconsole/plugin.py | def set_working_directory(self, dirname):
"""Set current working directory.
In the workingdirectory and explorer plugins.
"""
if dirname:
self.main.workingdirectory.chdir(dirname, refresh_explorer=True,
refresh_console=False) | def set_working_directory(self, dirname):
"""Set current working directory.
In the workingdirectory and explorer plugins.
"""
if dirname:
self.main.workingdirectory.chdir(dirname, refresh_explorer=True,
refresh_console=False) | [
"Set",
"current",
"working",
"directory",
".",
"In",
"the",
"workingdirectory",
"and",
"explorer",
"plugins",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L577-L583 | [
"def",
"set_working_directory",
"(",
"self",
",",
"dirname",
")",
":",
"if",
"dirname",
":",
"self",
".",
"main",
".",
"workingdirectory",
".",
"chdir",
"(",
"dirname",
",",
"refresh_explorer",
"=",
"True",
",",
"refresh_console",
"=",
"False",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.execute_code | Execute code instructions. | spyder/plugins/ipythonconsole/plugin.py | def execute_code(self, lines, current_client=True, clear_variables=False):
"""Execute code instructions."""
sw = self.get_current_shellwidget()
if sw is not None:
if sw._reading:
pass
else:
if not current_client:
... | def execute_code(self, lines, current_client=True, clear_variables=False):
"""Execute code instructions."""
sw = self.get_current_shellwidget()
if sw is not None:
if sw._reading:
pass
else:
if not current_client:
... | [
"Execute",
"code",
"instructions",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L591-L616 | [
"def",
"execute_code",
"(",
"self",
",",
"lines",
",",
"current_client",
"=",
"True",
",",
"clear_variables",
"=",
"False",
")",
":",
"sw",
"=",
"self",
".",
"get_current_shellwidget",
"(",
")",
"if",
"sw",
"is",
"not",
"None",
":",
"if",
"sw",
".",
"_... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.create_new_client | Create a new client | spyder/plugins/ipythonconsole/plugin.py | def create_new_client(self, give_focus=True, filename='', is_cython=False,
is_pylab=False, is_sympy=False, given_name=None):
"""Create a new client"""
self.master_clients += 1
client_id = dict(int_id=to_text_string(self.master_clients),
str... | def create_new_client(self, give_focus=True, filename='', is_cython=False,
is_pylab=False, is_sympy=False, given_name=None):
"""Create a new client"""
self.master_clients += 1
client_id = dict(int_id=to_text_string(self.master_clients),
str... | [
"Create",
"a",
"new",
"client"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L634-L697 | [
"def",
"create_new_client",
"(",
"self",
",",
"give_focus",
"=",
"True",
",",
"filename",
"=",
"''",
",",
"is_cython",
"=",
"False",
",",
"is_pylab",
"=",
"False",
",",
"is_sympy",
"=",
"False",
",",
"given_name",
"=",
"None",
")",
":",
"self",
".",
"m... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.create_client_for_kernel | Create a client connected to an existing kernel | spyder/plugins/ipythonconsole/plugin.py | def create_client_for_kernel(self):
"""Create a client connected to an existing kernel"""
connect_output = KernelConnectionDialog.get_connection_parameters(self)
(connection_file, hostname, sshkey, password, ok) = connect_output
if not ok:
return
else:
... | def create_client_for_kernel(self):
"""Create a client connected to an existing kernel"""
connect_output = KernelConnectionDialog.get_connection_parameters(self)
(connection_file, hostname, sshkey, password, ok) = connect_output
if not ok:
return
else:
... | [
"Create",
"a",
"client",
"connected",
"to",
"an",
"existing",
"kernel"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L712-L720 | [
"def",
"create_client_for_kernel",
"(",
"self",
")",
":",
"connect_output",
"=",
"KernelConnectionDialog",
".",
"get_connection_parameters",
"(",
"self",
")",
"(",
"connection_file",
",",
"hostname",
",",
"sshkey",
",",
"password",
",",
"ok",
")",
"=",
"connect_ou... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.connect_client_to_kernel | Connect a client to its kernel | spyder/plugins/ipythonconsole/plugin.py | def connect_client_to_kernel(self, client, is_cython=False,
is_pylab=False, is_sympy=False):
"""Connect a client to its kernel"""
connection_file = client.connection_file
stderr_handle = None if self.test_no_stderr else client.stderr_handle
km, kc = ... | def connect_client_to_kernel(self, client, is_cython=False,
is_pylab=False, is_sympy=False):
"""Connect a client to its kernel"""
connection_file = client.connection_file
stderr_handle = None if self.test_no_stderr else client.stderr_handle
km, kc = ... | [
"Connect",
"a",
"client",
"to",
"its",
"kernel"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L722-L751 | [
"def",
"connect_client_to_kernel",
"(",
"self",
",",
"client",
",",
"is_cython",
"=",
"False",
",",
"is_pylab",
"=",
"False",
",",
"is_sympy",
"=",
"False",
")",
":",
"connection_file",
"=",
"client",
".",
"connection_file",
"stderr_handle",
"=",
"None",
"if",... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.edit_file | Handle %edit magic petitions. | spyder/plugins/ipythonconsole/plugin.py | def edit_file(self, filename, line):
"""Handle %edit magic petitions."""
if encoding.is_text_file(filename):
# The default line number sent by ipykernel is always the last
# one, but we prefer to use the first.
self.edit_goto.emit(filename, 1, '') | def edit_file(self, filename, line):
"""Handle %edit magic petitions."""
if encoding.is_text_file(filename):
# The default line number sent by ipykernel is always the last
# one, but we prefer to use the first.
self.edit_goto.emit(filename, 1, '') | [
"Handle",
"%edit",
"magic",
"petitions",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L754-L759 | [
"def",
"edit_file",
"(",
"self",
",",
"filename",
",",
"line",
")",
":",
"if",
"encoding",
".",
"is_text_file",
"(",
"filename",
")",
":",
"# The default line number sent by ipykernel is always the last\r",
"# one, but we prefer to use the first.\r",
"self",
".",
"edit_go... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.config_options | Generate a Trailets Config instance for shell widgets using our
config system
This lets us create each widget with its own config | spyder/plugins/ipythonconsole/plugin.py | def config_options(self):
"""
Generate a Trailets Config instance for shell widgets using our
config system
This lets us create each widget with its own config
"""
# ---- Jupyter config ----
try:
full_cfg = load_pyconfig_files(['jupyter_qtcon... | def config_options(self):
"""
Generate a Trailets Config instance for shell widgets using our
config system
This lets us create each widget with its own config
"""
# ---- Jupyter config ----
try:
full_cfg = load_pyconfig_files(['jupyter_qtcon... | [
"Generate",
"a",
"Trailets",
"Config",
"instance",
"for",
"shell",
"widgets",
"using",
"our",
"config",
"system",
"This",
"lets",
"us",
"create",
"each",
"widget",
"with",
"its",
"own",
"config"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L761-L822 | [
"def",
"config_options",
"(",
"self",
")",
":",
"# ---- Jupyter config ----\r",
"try",
":",
"full_cfg",
"=",
"load_pyconfig_files",
"(",
"[",
"'jupyter_qtconsole_config.py'",
"]",
",",
"jupyter_config_dir",
"(",
")",
")",
"# From the full config we only select the JupyterWi... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.interpreter_versions | Python and IPython versions used by clients | spyder/plugins/ipythonconsole/plugin.py | def interpreter_versions(self):
"""Python and IPython versions used by clients"""
if CONF.get('main_interpreter', 'default'):
from IPython.core import release
versions = dict(
python_version = sys.version.split("\n")[0].strip(),
ipython_versi... | def interpreter_versions(self):
"""Python and IPython versions used by clients"""
if CONF.get('main_interpreter', 'default'):
from IPython.core import release
versions = dict(
python_version = sys.version.split("\n")[0].strip(),
ipython_versi... | [
"Python",
"and",
"IPython",
"versions",
"used",
"by",
"clients"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L824-L852 | [
"def",
"interpreter_versions",
"(",
"self",
")",
":",
"if",
"CONF",
".",
"get",
"(",
"'main_interpreter'",
",",
"'default'",
")",
":",
"from",
"IPython",
".",
"core",
"import",
"release",
"versions",
"=",
"dict",
"(",
"python_version",
"=",
"sys",
".",
"ve... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.additional_options | Additional options for shell widgets that are not defined
in JupyterWidget config options | spyder/plugins/ipythonconsole/plugin.py | def additional_options(self, is_pylab=False, is_sympy=False):
"""
Additional options for shell widgets that are not defined
in JupyterWidget config options
"""
options = dict(
pylab=self.get_option('pylab'),
autoload_pylab=self.get_option('pylab/aut... | def additional_options(self, is_pylab=False, is_sympy=False):
"""
Additional options for shell widgets that are not defined
in JupyterWidget config options
"""
options = dict(
pylab=self.get_option('pylab'),
autoload_pylab=self.get_option('pylab/aut... | [
"Additional",
"options",
"for",
"shell",
"widgets",
"that",
"are",
"not",
"defined",
"in",
"JupyterWidget",
"config",
"options"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L854-L873 | [
"def",
"additional_options",
"(",
"self",
",",
"is_pylab",
"=",
"False",
",",
"is_sympy",
"=",
"False",
")",
":",
"options",
"=",
"dict",
"(",
"pylab",
"=",
"self",
".",
"get_option",
"(",
"'pylab'",
")",
",",
"autoload_pylab",
"=",
"self",
".",
"get_opt... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.register_client | Register new client | spyder/plugins/ipythonconsole/plugin.py | def register_client(self, client, give_focus=True):
"""Register new client"""
client.configure_shellwidget(give_focus=give_focus)
# Local vars
shellwidget = client.shellwidget
control = shellwidget._control
page_control = shellwidget._page_control
# Cre... | def register_client(self, client, give_focus=True):
"""Register new client"""
client.configure_shellwidget(give_focus=give_focus)
# Local vars
shellwidget = client.shellwidget
control = shellwidget._control
page_control = shellwidget._page_control
# Cre... | [
"Register",
"new",
"client"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L875-L939 | [
"def",
"register_client",
"(",
"self",
",",
"client",
",",
"give_focus",
"=",
"True",
")",
":",
"client",
".",
"configure_shellwidget",
"(",
"give_focus",
"=",
"give_focus",
")",
"# Local vars\r",
"shellwidget",
"=",
"client",
".",
"shellwidget",
"control",
"=",... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.close_client | Close client tab from index or widget (or close current tab) | spyder/plugins/ipythonconsole/plugin.py | def close_client(self, index=None, client=None, force=False):
"""Close client tab from index or widget (or close current tab)"""
if not self.tabwidget.count():
return
if client is not None:
index = self.tabwidget.indexOf(client)
# if index is not found i... | def close_client(self, index=None, client=None, force=False):
"""Close client tab from index or widget (or close current tab)"""
if not self.tabwidget.count():
return
if client is not None:
index = self.tabwidget.indexOf(client)
# if index is not found i... | [
"Close",
"client",
"tab",
"from",
"index",
"or",
"widget",
"(",
"or",
"close",
"current",
"tab",
")"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L941-L1014 | [
"def",
"close_client",
"(",
"self",
",",
"index",
"=",
"None",
",",
"client",
"=",
"None",
",",
"force",
"=",
"False",
")",
":",
"if",
"not",
"self",
".",
"tabwidget",
".",
"count",
"(",
")",
":",
"return",
"if",
"client",
"is",
"not",
"None",
":",... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.get_client_index_from_id | Return client index from id | spyder/plugins/ipythonconsole/plugin.py | def get_client_index_from_id(self, client_id):
"""Return client index from id"""
for index, client in enumerate(self.clients):
if id(client) == client_id:
return index | def get_client_index_from_id(self, client_id):
"""Return client index from id"""
for index, client in enumerate(self.clients):
if id(client) == client_id:
return index | [
"Return",
"client",
"index",
"from",
"id"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1016-L1020 | [
"def",
"get_client_index_from_id",
"(",
"self",
",",
"client_id",
")",
":",
"for",
"index",
",",
"client",
"in",
"enumerate",
"(",
"self",
".",
"clients",
")",
":",
"if",
"id",
"(",
"client",
")",
"==",
"client_id",
":",
"return",
"index"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.get_related_clients | Get all other clients that are connected to the same kernel as `client` | spyder/plugins/ipythonconsole/plugin.py | def get_related_clients(self, client):
"""
Get all other clients that are connected to the same kernel as `client`
"""
related_clients = []
for cl in self.get_clients():
if cl.connection_file == client.connection_file and \
cl is not client:
... | def get_related_clients(self, client):
"""
Get all other clients that are connected to the same kernel as `client`
"""
related_clients = []
for cl in self.get_clients():
if cl.connection_file == client.connection_file and \
cl is not client:
... | [
"Get",
"all",
"other",
"clients",
"that",
"are",
"connected",
"to",
"the",
"same",
"kernel",
"as",
"client"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1022-L1031 | [
"def",
"get_related_clients",
"(",
"self",
",",
"client",
")",
":",
"related_clients",
"=",
"[",
"]",
"for",
"cl",
"in",
"self",
".",
"get_clients",
"(",
")",
":",
"if",
"cl",
".",
"connection_file",
"==",
"client",
".",
"connection_file",
"and",
"cl",
"... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.close_related_clients | Close all clients related to *client*, except itself | spyder/plugins/ipythonconsole/plugin.py | def close_related_clients(self, client):
"""Close all clients related to *client*, except itself"""
related_clients = self.get_related_clients(client)
for cl in related_clients:
self.close_client(client=cl, force=True) | def close_related_clients(self, client):
"""Close all clients related to *client*, except itself"""
related_clients = self.get_related_clients(client)
for cl in related_clients:
self.close_client(client=cl, force=True) | [
"Close",
"all",
"clients",
"related",
"to",
"*",
"client",
"*",
"except",
"itself"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1033-L1037 | [
"def",
"close_related_clients",
"(",
"self",
",",
"client",
")",
":",
"related_clients",
"=",
"self",
".",
"get_related_clients",
"(",
"client",
")",
"for",
"cl",
"in",
"related_clients",
":",
"self",
".",
"close_client",
"(",
"client",
"=",
"cl",
",",
"forc... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.restart | Restart the console
This is needed when we switch projects to update PYTHONPATH
and the selected interpreter | spyder/plugins/ipythonconsole/plugin.py | def restart(self):
"""
Restart the console
This is needed when we switch projects to update PYTHONPATH
and the selected interpreter
"""
self.master_clients = 0
self.create_new_client_if_empty = False
for i in range(len(self.clients)):
... | def restart(self):
"""
Restart the console
This is needed when we switch projects to update PYTHONPATH
and the selected interpreter
"""
self.master_clients = 0
self.create_new_client_if_empty = False
for i in range(len(self.clients)):
... | [
"Restart",
"the",
"console",
"This",
"is",
"needed",
"when",
"we",
"switch",
"projects",
"to",
"update",
"PYTHONPATH",
"and",
"the",
"selected",
"interpreter"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1039-L1059 | [
"def",
"restart",
"(",
"self",
")",
":",
"self",
".",
"master_clients",
"=",
"0",
"self",
".",
"create_new_client_if_empty",
"=",
"False",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"clients",
")",
")",
":",
"client",
"=",
"self",
".",
... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.pdb_has_stopped | Python debugger has just stopped at frame (fname, lineno) | spyder/plugins/ipythonconsole/plugin.py | def pdb_has_stopped(self, fname, lineno, shellwidget):
"""Python debugger has just stopped at frame (fname, lineno)"""
# This is a unique form of the edit_goto signal that is intended to
# prevent keyboard input from accidentally entering the editor
# during repeated, rapid entry of ... | def pdb_has_stopped(self, fname, lineno, shellwidget):
"""Python debugger has just stopped at frame (fname, lineno)"""
# This is a unique form of the edit_goto signal that is intended to
# prevent keyboard input from accidentally entering the editor
# during repeated, rapid entry of ... | [
"Python",
"debugger",
"has",
"just",
"stopped",
"at",
"frame",
"(",
"fname",
"lineno",
")"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1061-L1068 | [
"def",
"pdb_has_stopped",
"(",
"self",
",",
"fname",
",",
"lineno",
",",
"shellwidget",
")",
":",
"# This is a unique form of the edit_goto signal that is intended to\r",
"# prevent keyboard input from accidentally entering the editor\r",
"# during repeated, rapid entry of debugging comm... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.create_client_from_path | Create a client with its cwd pointing to path. | spyder/plugins/ipythonconsole/plugin.py | def create_client_from_path(self, path):
"""Create a client with its cwd pointing to path."""
self.create_new_client()
sw = self.get_current_shellwidget()
sw.set_cwd(path) | def create_client_from_path(self, path):
"""Create a client with its cwd pointing to path."""
self.create_new_client()
sw = self.get_current_shellwidget()
sw.set_cwd(path) | [
"Create",
"a",
"client",
"with",
"its",
"cwd",
"pointing",
"to",
"path",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1076-L1080 | [
"def",
"create_client_from_path",
"(",
"self",
",",
"path",
")",
":",
"self",
".",
"create_new_client",
"(",
")",
"sw",
"=",
"self",
".",
"get_current_shellwidget",
"(",
")",
"sw",
".",
"set_cwd",
"(",
"path",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.create_client_for_file | Create a client to execute code related to a file. | spyder/plugins/ipythonconsole/plugin.py | def create_client_for_file(self, filename, is_cython=False):
"""Create a client to execute code related to a file."""
# Create client
self.create_new_client(filename=filename, is_cython=is_cython)
# Don't increase the count of master clients
self.master_clients -= 1
... | def create_client_for_file(self, filename, is_cython=False):
"""Create a client to execute code related to a file."""
# Create client
self.create_new_client(filename=filename, is_cython=is_cython)
# Don't increase the count of master clients
self.master_clients -= 1
... | [
"Create",
"a",
"client",
"to",
"execute",
"code",
"related",
"to",
"a",
"file",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1082-L1094 | [
"def",
"create_client_for_file",
"(",
"self",
",",
"filename",
",",
"is_cython",
"=",
"False",
")",
":",
"# Create client\r",
"self",
".",
"create_new_client",
"(",
"filename",
"=",
"filename",
",",
"is_cython",
"=",
"is_cython",
")",
"# Don't increase the count of ... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.get_client_for_file | Get client associated with a given file. | spyder/plugins/ipythonconsole/plugin.py | def get_client_for_file(self, filename):
"""Get client associated with a given file."""
client = None
for idx, cl in enumerate(self.get_clients()):
if self.filenames[idx] == filename:
self.tabwidget.setCurrentIndex(idx)
client = cl
... | def get_client_for_file(self, filename):
"""Get client associated with a given file."""
client = None
for idx, cl in enumerate(self.get_clients()):
if self.filenames[idx] == filename:
self.tabwidget.setCurrentIndex(idx)
client = cl
... | [
"Get",
"client",
"associated",
"with",
"a",
"given",
"file",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1096-L1104 | [
"def",
"get_client_for_file",
"(",
"self",
",",
"filename",
")",
":",
"client",
"=",
"None",
"for",
"idx",
",",
"cl",
"in",
"enumerate",
"(",
"self",
".",
"get_clients",
"(",
")",
")",
":",
"if",
"self",
".",
"filenames",
"[",
"idx",
"]",
"==",
"file... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.set_elapsed_time | Set elapsed time for slave clients. | spyder/plugins/ipythonconsole/plugin.py | def set_elapsed_time(self, client):
"""Set elapsed time for slave clients."""
related_clients = self.get_related_clients(client)
for cl in related_clients:
if cl.timer is not None:
client.create_time_label()
client.t0 = cl.t0
cli... | def set_elapsed_time(self, client):
"""Set elapsed time for slave clients."""
related_clients = self.get_related_clients(client)
for cl in related_clients:
if cl.timer is not None:
client.create_time_label()
client.t0 = cl.t0
cli... | [
"Set",
"elapsed",
"time",
"for",
"slave",
"clients",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1106-L1115 | [
"def",
"set_elapsed_time",
"(",
"self",
",",
"client",
")",
":",
"related_clients",
"=",
"self",
".",
"get_related_clients",
"(",
"client",
")",
"for",
"cl",
"in",
"related_clients",
":",
"if",
"cl",
".",
"timer",
"is",
"not",
"None",
":",
"client",
".",
... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.tunnel_to_kernel | Tunnel connections to a kernel via ssh.
Remote ports are specified in the connection info ci. | spyder/plugins/ipythonconsole/plugin.py | def tunnel_to_kernel(self, connection_info, hostname, sshkey=None,
password=None, timeout=10):
"""
Tunnel connections to a kernel via ssh.
Remote ports are specified in the connection info ci.
"""
lports = zmqtunnel.select_random_ports(4)
... | def tunnel_to_kernel(self, connection_info, hostname, sshkey=None,
password=None, timeout=10):
"""
Tunnel connections to a kernel via ssh.
Remote ports are specified in the connection info ci.
"""
lports = zmqtunnel.select_random_ports(4)
... | [
"Tunnel",
"connections",
"to",
"a",
"kernel",
"via",
"ssh",
".",
"Remote",
"ports",
"are",
"specified",
"in",
"the",
"connection",
"info",
"ci",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1129-L1143 | [
"def",
"tunnel_to_kernel",
"(",
"self",
",",
"connection_info",
",",
"hostname",
",",
"sshkey",
"=",
"None",
",",
"password",
"=",
"None",
",",
"timeout",
"=",
"10",
")",
":",
"lports",
"=",
"zmqtunnel",
".",
"select_random_ports",
"(",
"4",
")",
"rports",... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.create_kernel_spec | Create a kernel spec for our own kernels | spyder/plugins/ipythonconsole/plugin.py | def create_kernel_spec(self, is_cython=False,
is_pylab=False, is_sympy=False):
"""Create a kernel spec for our own kernels"""
# Before creating our kernel spec, we always need to
# set this value in spyder.ini
CONF.set('main', 'spyder_pythonpath',
... | def create_kernel_spec(self, is_cython=False,
is_pylab=False, is_sympy=False):
"""Create a kernel spec for our own kernels"""
# Before creating our kernel spec, we always need to
# set this value in spyder.ini
CONF.set('main', 'spyder_pythonpath',
... | [
"Create",
"a",
"kernel",
"spec",
"for",
"our",
"own",
"kernels"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1145-L1154 | [
"def",
"create_kernel_spec",
"(",
"self",
",",
"is_cython",
"=",
"False",
",",
"is_pylab",
"=",
"False",
",",
"is_sympy",
"=",
"False",
")",
":",
"# Before creating our kernel spec, we always need to\r",
"# set this value in spyder.ini\r",
"CONF",
".",
"set",
"(",
"'m... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.create_kernel_manager_and_kernel_client | Create kernel manager and client. | spyder/plugins/ipythonconsole/plugin.py | def create_kernel_manager_and_kernel_client(self, connection_file,
stderr_handle,
is_cython=False,
is_pylab=False,
is_sympy=... | def create_kernel_manager_and_kernel_client(self, connection_file,
stderr_handle,
is_cython=False,
is_pylab=False,
is_sympy=... | [
"Create",
"kernel",
"manager",
"and",
"client",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1156-L1199 | [
"def",
"create_kernel_manager_and_kernel_client",
"(",
"self",
",",
"connection_file",
",",
"stderr_handle",
",",
"is_cython",
"=",
"False",
",",
"is_pylab",
"=",
"False",
",",
"is_sympy",
"=",
"False",
")",
":",
"# Kernel spec\r",
"kernel_spec",
"=",
"self",
".",... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.restart_kernel | Restart kernel of current client. | spyder/plugins/ipythonconsole/plugin.py | def restart_kernel(self):
"""Restart kernel of current client."""
client = self.get_current_client()
if client is not None:
self.switch_to_plugin()
client.restart_kernel() | def restart_kernel(self):
"""Restart kernel of current client."""
client = self.get_current_client()
if client is not None:
self.switch_to_plugin()
client.restart_kernel() | [
"Restart",
"kernel",
"of",
"current",
"client",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1201-L1206 | [
"def",
"restart_kernel",
"(",
"self",
")",
":",
"client",
"=",
"self",
".",
"get_current_client",
"(",
")",
"if",
"client",
"is",
"not",
"None",
":",
"self",
".",
"switch_to_plugin",
"(",
")",
"client",
".",
"restart_kernel",
"(",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.reset_kernel | Reset kernel of current client. | spyder/plugins/ipythonconsole/plugin.py | def reset_kernel(self):
"""Reset kernel of current client."""
client = self.get_current_client()
if client is not None:
self.switch_to_plugin()
client.reset_namespace() | def reset_kernel(self):
"""Reset kernel of current client."""
client = self.get_current_client()
if client is not None:
self.switch_to_plugin()
client.reset_namespace() | [
"Reset",
"kernel",
"of",
"current",
"client",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1208-L1213 | [
"def",
"reset_kernel",
"(",
"self",
")",
":",
"client",
"=",
"self",
".",
"get_current_client",
"(",
")",
"if",
"client",
"is",
"not",
"None",
":",
"self",
".",
"switch_to_plugin",
"(",
")",
"client",
".",
"reset_namespace",
"(",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.interrupt_kernel | Interrupt kernel of current client. | spyder/plugins/ipythonconsole/plugin.py | def interrupt_kernel(self):
"""Interrupt kernel of current client."""
client = self.get_current_client()
if client is not None:
self.switch_to_plugin()
client.stop_button_click_handler() | def interrupt_kernel(self):
"""Interrupt kernel of current client."""
client = self.get_current_client()
if client is not None:
self.switch_to_plugin()
client.stop_button_click_handler() | [
"Interrupt",
"kernel",
"of",
"current",
"client",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1215-L1220 | [
"def",
"interrupt_kernel",
"(",
"self",
")",
":",
"client",
"=",
"self",
".",
"get_current_client",
"(",
")",
"if",
"client",
"is",
"not",
"None",
":",
"self",
".",
"switch_to_plugin",
"(",
")",
"client",
".",
"stop_button_click_handler",
"(",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.update_execution_state_kernel | Update actions following the execution state of the kernel. | spyder/plugins/ipythonconsole/plugin.py | def update_execution_state_kernel(self):
"""Update actions following the execution state of the kernel."""
client = self.get_current_client()
if client is not None:
executing = client.stop_button.isEnabled()
self.interrupt_action.setEnabled(executing) | def update_execution_state_kernel(self):
"""Update actions following the execution state of the kernel."""
client = self.get_current_client()
if client is not None:
executing = client.stop_button.isEnabled()
self.interrupt_action.setEnabled(executing) | [
"Update",
"actions",
"following",
"the",
"execution",
"state",
"of",
"the",
"kernel",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1222-L1227 | [
"def",
"update_execution_state_kernel",
"(",
"self",
")",
":",
"client",
"=",
"self",
".",
"get_current_client",
"(",
")",
"if",
"client",
"is",
"not",
"None",
":",
"executing",
"=",
"client",
".",
"stop_button",
".",
"isEnabled",
"(",
")",
"self",
".",
"i... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.connect_external_kernel | Connect an external kernel to the Variable Explorer and Help, if
it is a Spyder kernel. | spyder/plugins/ipythonconsole/plugin.py | def connect_external_kernel(self, shellwidget):
"""
Connect an external kernel to the Variable Explorer and Help, if
it is a Spyder kernel.
"""
sw = shellwidget
kc = shellwidget.kernel_client
if self.main.help is not None:
self.main.help.set_sh... | def connect_external_kernel(self, shellwidget):
"""
Connect an external kernel to the Variable Explorer and Help, if
it is a Spyder kernel.
"""
sw = shellwidget
kc = shellwidget.kernel_client
if self.main.help is not None:
self.main.help.set_sh... | [
"Connect",
"an",
"external",
"kernel",
"to",
"the",
"Variable",
"Explorer",
"and",
"Help",
"if",
"it",
"is",
"a",
"Spyder",
"kernel",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1229-L1243 | [
"def",
"connect_external_kernel",
"(",
"self",
",",
"shellwidget",
")",
":",
"sw",
"=",
"shellwidget",
"kc",
"=",
"shellwidget",
".",
"kernel_client",
"if",
"self",
".",
"main",
".",
"help",
"is",
"not",
"None",
":",
"self",
".",
"main",
".",
"help",
"."... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.add_tab | Add tab | spyder/plugins/ipythonconsole/plugin.py | def add_tab(self, widget, name, filename=''):
"""Add tab"""
self.clients.append(widget)
index = self.tabwidget.addTab(widget, name)
self.filenames.insert(index, filename)
self.tabwidget.setCurrentIndex(index)
if self.dockwidget and not self.main.is_setting_up:
... | def add_tab(self, widget, name, filename=''):
"""Add tab"""
self.clients.append(widget)
index = self.tabwidget.addTab(widget, name)
self.filenames.insert(index, filename)
self.tabwidget.setCurrentIndex(index)
if self.dockwidget and not self.main.is_setting_up:
... | [
"Add",
"tab"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1246-L1256 | [
"def",
"add_tab",
"(",
"self",
",",
"widget",
",",
"name",
",",
"filename",
"=",
"''",
")",
":",
"self",
".",
"clients",
".",
"append",
"(",
"widget",
")",
"index",
"=",
"self",
".",
"tabwidget",
".",
"addTab",
"(",
"widget",
",",
"name",
")",
"sel... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.move_tab | Move tab (tabs themselves have already been moved by the tabwidget) | spyder/plugins/ipythonconsole/plugin.py | def move_tab(self, index_from, index_to):
"""
Move tab (tabs themselves have already been moved by the tabwidget)
"""
filename = self.filenames.pop(index_from)
client = self.clients.pop(index_from)
self.filenames.insert(index_to, filename)
self.clients.inse... | def move_tab(self, index_from, index_to):
"""
Move tab (tabs themselves have already been moved by the tabwidget)
"""
filename = self.filenames.pop(index_from)
client = self.clients.pop(index_from)
self.filenames.insert(index_to, filename)
self.clients.inse... | [
"Move",
"tab",
"(",
"tabs",
"themselves",
"have",
"already",
"been",
"moved",
"by",
"the",
"tabwidget",
")"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1258-L1267 | [
"def",
"move_tab",
"(",
"self",
",",
"index_from",
",",
"index_to",
")",
":",
"filename",
"=",
"self",
".",
"filenames",
".",
"pop",
"(",
"index_from",
")",
"client",
"=",
"self",
".",
"clients",
".",
"pop",
"(",
"index_from",
")",
"self",
".",
"filena... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.disambiguate_fname | Generate a file name without ambiguation. | spyder/plugins/ipythonconsole/plugin.py | def disambiguate_fname(self, fname):
"""Generate a file name without ambiguation."""
files_path_list = [filename for filename in self.filenames
if filename]
return sourcecode.disambiguate_fname(files_path_list, fname) | def disambiguate_fname(self, fname):
"""Generate a file name without ambiguation."""
files_path_list = [filename for filename in self.filenames
if filename]
return sourcecode.disambiguate_fname(files_path_list, fname) | [
"Generate",
"a",
"file",
"name",
"without",
"ambiguation",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1269-L1273 | [
"def",
"disambiguate_fname",
"(",
"self",
",",
"fname",
")",
":",
"files_path_list",
"=",
"[",
"filename",
"for",
"filename",
"in",
"self",
".",
"filenames",
"if",
"filename",
"]",
"return",
"sourcecode",
".",
"disambiguate_fname",
"(",
"files_path_list",
",",
... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.update_tabs_text | Update the text from the tabs. | spyder/plugins/ipythonconsole/plugin.py | def update_tabs_text(self):
"""Update the text from the tabs."""
# This is needed to prevent that hanged consoles make reference
# to an index that doesn't exist. See issue 4881
try:
for index, fname in enumerate(self.filenames):
client = self.clients[in... | def update_tabs_text(self):
"""Update the text from the tabs."""
# This is needed to prevent that hanged consoles make reference
# to an index that doesn't exist. See issue 4881
try:
for index, fname in enumerate(self.filenames):
client = self.clients[in... | [
"Update",
"the",
"text",
"from",
"the",
"tabs",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1275-L1288 | [
"def",
"update_tabs_text",
"(",
"self",
")",
":",
"# This is needed to prevent that hanged consoles make reference\r",
"# to an index that doesn't exist. See issue 4881\r",
"try",
":",
"for",
"index",
",",
"fname",
"in",
"enumerate",
"(",
"self",
".",
"filenames",
")",
":",... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.rename_client_tab | Rename client's tab | spyder/plugins/ipythonconsole/plugin.py | def rename_client_tab(self, client, given_name):
"""Rename client's tab"""
index = self.get_client_index_from_id(id(client))
if given_name is not None:
client.given_name = given_name
self.tabwidget.setTabText(index, client.get_name()) | def rename_client_tab(self, client, given_name):
"""Rename client's tab"""
index = self.get_client_index_from_id(id(client))
if given_name is not None:
client.given_name = given_name
self.tabwidget.setTabText(index, client.get_name()) | [
"Rename",
"client",
"s",
"tab"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1290-L1296 | [
"def",
"rename_client_tab",
"(",
"self",
",",
"client",
",",
"given_name",
")",
":",
"index",
"=",
"self",
".",
"get_client_index_from_id",
"(",
"id",
"(",
"client",
")",
")",
"if",
"given_name",
"is",
"not",
"None",
":",
"client",
".",
"given_name",
"=",
... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.rename_tabs_after_change | Rename tabs after a change in name. | spyder/plugins/ipythonconsole/plugin.py | def rename_tabs_after_change(self, given_name):
"""Rename tabs after a change in name."""
client = self.get_current_client()
# Prevent renames that want to assign the same name of
# a previous tab
repeated = False
for cl in self.get_clients():
if id(c... | def rename_tabs_after_change(self, given_name):
"""Rename tabs after a change in name."""
client = self.get_current_client()
# Prevent renames that want to assign the same name of
# a previous tab
repeated = False
for cl in self.get_clients():
if id(c... | [
"Rename",
"tabs",
"after",
"a",
"change",
"in",
"name",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1298-L1319 | [
"def",
"rename_tabs_after_change",
"(",
"self",
",",
"given_name",
")",
":",
"client",
"=",
"self",
".",
"get_current_client",
"(",
")",
"# Prevent renames that want to assign the same name of\r",
"# a previous tab\r",
"repeated",
"=",
"False",
"for",
"cl",
"in",
"self"... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.tab_name_editor | Trigger the tab name editor. | spyder/plugins/ipythonconsole/plugin.py | def tab_name_editor(self):
"""Trigger the tab name editor."""
index = self.tabwidget.currentIndex()
self.tabwidget.tabBar().tab_name_editor.edit_tab(index) | def tab_name_editor(self):
"""Trigger the tab name editor."""
index = self.tabwidget.currentIndex()
self.tabwidget.tabBar().tab_name_editor.edit_tab(index) | [
"Trigger",
"the",
"tab",
"name",
"editor",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1321-L1324 | [
"def",
"tab_name_editor",
"(",
"self",
")",
":",
"index",
"=",
"self",
".",
"tabwidget",
".",
"currentIndex",
"(",
")",
"self",
".",
"tabwidget",
".",
"tabBar",
"(",
")",
".",
"tab_name_editor",
".",
"edit_tab",
"(",
"index",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.go_to_error | Go to error if relevant | spyder/plugins/ipythonconsole/plugin.py | def go_to_error(self, text):
"""Go to error if relevant"""
match = get_error_match(to_text_string(text))
if match:
fname, lnb = match.groups()
if ("<ipython-input-" in fname and
self.run_cell_filename is not None):
fname = self.r... | def go_to_error(self, text):
"""Go to error if relevant"""
match = get_error_match(to_text_string(text))
if match:
fname, lnb = match.groups()
if ("<ipython-input-" in fname and
self.run_cell_filename is not None):
fname = self.r... | [
"Go",
"to",
"error",
"if",
"relevant"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1327-L1335 | [
"def",
"go_to_error",
"(",
"self",
",",
"text",
")",
":",
"match",
"=",
"get_error_match",
"(",
"to_text_string",
"(",
"text",
")",
")",
"if",
"match",
":",
"fname",
",",
"lnb",
"=",
"match",
".",
"groups",
"(",
")",
"if",
"(",
"\"<ipython-input-\"",
"... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.show_intro | Show intro to IPython help | spyder/plugins/ipythonconsole/plugin.py | def show_intro(self):
"""Show intro to IPython help"""
from IPython.core.usage import interactive_usage
self.main.help.show_rich_text(interactive_usage) | def show_intro(self):
"""Show intro to IPython help"""
from IPython.core.usage import interactive_usage
self.main.help.show_rich_text(interactive_usage) | [
"Show",
"intro",
"to",
"IPython",
"help"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1338-L1341 | [
"def",
"show_intro",
"(",
"self",
")",
":",
"from",
"IPython",
".",
"core",
".",
"usage",
"import",
"interactive_usage",
"self",
".",
"main",
".",
"help",
".",
"show_rich_text",
"(",
"interactive_usage",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.show_guiref | Show qtconsole help | spyder/plugins/ipythonconsole/plugin.py | def show_guiref(self):
"""Show qtconsole help"""
from qtconsole.usage import gui_reference
self.main.help.show_rich_text(gui_reference, collapse=True) | def show_guiref(self):
"""Show qtconsole help"""
from qtconsole.usage import gui_reference
self.main.help.show_rich_text(gui_reference, collapse=True) | [
"Show",
"qtconsole",
"help"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1344-L1347 | [
"def",
"show_guiref",
"(",
"self",
")",
":",
"from",
"qtconsole",
".",
"usage",
"import",
"gui_reference",
"self",
".",
"main",
".",
"help",
".",
"show_rich_text",
"(",
"gui_reference",
",",
"collapse",
"=",
"True",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole.show_quickref | Show IPython Cheat Sheet | spyder/plugins/ipythonconsole/plugin.py | def show_quickref(self):
"""Show IPython Cheat Sheet"""
from IPython.core.usage import quick_reference
self.main.help.show_plain_text(quick_reference) | def show_quickref(self):
"""Show IPython Cheat Sheet"""
from IPython.core.usage import quick_reference
self.main.help.show_plain_text(quick_reference) | [
"Show",
"IPython",
"Cheat",
"Sheet"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1350-L1353 | [
"def",
"show_quickref",
"(",
"self",
")",
":",
"from",
"IPython",
".",
"core",
".",
"usage",
"import",
"quick_reference",
"self",
".",
"main",
".",
"help",
".",
"show_plain_text",
"(",
"quick_reference",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole._new_connection_file | Generate a new connection file
Taken from jupyter_client/console_app.py
Licensed under the BSD license | spyder/plugins/ipythonconsole/plugin.py | def _new_connection_file(self):
"""
Generate a new connection file
Taken from jupyter_client/console_app.py
Licensed under the BSD license
"""
# Check if jupyter_runtime_dir exists (Spyder addition)
if not osp.isdir(jupyter_runtime_dir()):
tr... | def _new_connection_file(self):
"""
Generate a new connection file
Taken from jupyter_client/console_app.py
Licensed under the BSD license
"""
# Check if jupyter_runtime_dir exists (Spyder addition)
if not osp.isdir(jupyter_runtime_dir()):
tr... | [
"Generate",
"a",
"new",
"connection",
"file",
"Taken",
"from",
"jupyter_client",
"/",
"console_app",
".",
"py",
"Licensed",
"under",
"the",
"BSD",
"license"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1356-L1374 | [
"def",
"_new_connection_file",
"(",
"self",
")",
":",
"# Check if jupyter_runtime_dir exists (Spyder addition)\r",
"if",
"not",
"osp",
".",
"isdir",
"(",
"jupyter_runtime_dir",
"(",
")",
")",
":",
"try",
":",
"os",
".",
"makedirs",
"(",
"jupyter_runtime_dir",
"(",
... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IPythonConsole._remove_old_stderr_files | Remove stderr files left by previous Spyder instances.
This is only required on Windows because we can't
clean up stderr files while Spyder is running on it. | spyder/plugins/ipythonconsole/plugin.py | def _remove_old_stderr_files(self):
"""
Remove stderr files left by previous Spyder instances.
This is only required on Windows because we can't
clean up stderr files while Spyder is running on it.
"""
if os.name == 'nt':
tmpdir = get_temp_dir()
... | def _remove_old_stderr_files(self):
"""
Remove stderr files left by previous Spyder instances.
This is only required on Windows because we can't
clean up stderr files while Spyder is running on it.
"""
if os.name == 'nt':
tmpdir = get_temp_dir()
... | [
"Remove",
"stderr",
"files",
"left",
"by",
"previous",
"Spyder",
"instances",
".",
"This",
"is",
"only",
"required",
"on",
"Windows",
"because",
"we",
"can",
"t",
"clean",
"up",
"stderr",
"files",
"while",
"Spyder",
"is",
"running",
"on",
"it",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1504-L1518 | [
"def",
"_remove_old_stderr_files",
"(",
"self",
")",
":",
"if",
"os",
".",
"name",
"==",
"'nt'",
":",
"tmpdir",
"=",
"get_temp_dir",
"(",
")",
"for",
"fname",
"in",
"os",
".",
"listdir",
"(",
"tmpdir",
")",
":",
"if",
"osp",
".",
"splitext",
"(",
"fn... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | KillRing.rotate | Rotate the kill ring, then yank back the new top.
Returns
-------
A text string or None. | spyder/plugins/editor/utils/kill_ring.py | def rotate(self):
""" Rotate the kill ring, then yank back the new top.
Returns
-------
A text string or None.
"""
self._index -= 1
if self._index >= 0:
return self._ring[self._index]
return None | def rotate(self):
""" Rotate the kill ring, then yank back the new top.
Returns
-------
A text string or None.
"""
self._index -= 1
if self._index >= 0:
return self._ring[self._index]
return None | [
"Rotate",
"the",
"kill",
"ring",
"then",
"yank",
"back",
"the",
"new",
"top",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/kill_ring.py#L55-L65 | [
"def",
"rotate",
"(",
"self",
")",
":",
"self",
".",
"_index",
"-=",
"1",
"if",
"self",
".",
"_index",
">=",
"0",
":",
"return",
"self",
".",
"_ring",
"[",
"self",
".",
"_index",
"]",
"return",
"None"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | QtKillRing.kill_cursor | Kills the text selected by the give cursor. | spyder/plugins/editor/utils/kill_ring.py | def kill_cursor(self, cursor):
""" Kills the text selected by the give cursor.
"""
text = cursor.selectedText()
if text:
cursor.removeSelectedText()
self.kill(text) | def kill_cursor(self, cursor):
""" Kills the text selected by the give cursor.
"""
text = cursor.selectedText()
if text:
cursor.removeSelectedText()
self.kill(text) | [
"Kills",
"the",
"text",
"selected",
"by",
"the",
"give",
"cursor",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/kill_ring.py#L100-L106 | [
"def",
"kill_cursor",
"(",
"self",
",",
"cursor",
")",
":",
"text",
"=",
"cursor",
".",
"selectedText",
"(",
")",
"if",
"text",
":",
"cursor",
".",
"removeSelectedText",
"(",
")",
"self",
".",
"kill",
"(",
"text",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | QtKillRing.yank | Yank back the most recently killed text. | spyder/plugins/editor/utils/kill_ring.py | def yank(self):
""" Yank back the most recently killed text.
"""
text = self._ring.yank()
if text:
self._skip_cursor = True
cursor = self._text_edit.textCursor()
cursor.insertText(text)
self._prev_yank = text | def yank(self):
""" Yank back the most recently killed text.
"""
text = self._ring.yank()
if text:
self._skip_cursor = True
cursor = self._text_edit.textCursor()
cursor.insertText(text)
self._prev_yank = text | [
"Yank",
"back",
"the",
"most",
"recently",
"killed",
"text",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/kill_ring.py#L108-L116 | [
"def",
"yank",
"(",
"self",
")",
":",
"text",
"=",
"self",
".",
"_ring",
".",
"yank",
"(",
")",
"if",
"text",
":",
"self",
".",
"_skip_cursor",
"=",
"True",
"cursor",
"=",
"self",
".",
"_text_edit",
".",
"textCursor",
"(",
")",
"cursor",
".",
"inse... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | show_in_external_file_explorer | Show files in external file explorer
Args:
fnames (list): Names of files to show. | spyder/plugins/explorer/widgets.py | def show_in_external_file_explorer(fnames=None):
"""Show files in external file explorer
Args:
fnames (list): Names of files to show.
"""
if not isinstance(fnames, (tuple, list)):
fnames = [fnames]
for fname in fnames:
open_file_in_external_explorer(fname) | def show_in_external_file_explorer(fnames=None):
"""Show files in external file explorer
Args:
fnames (list): Names of files to show.
"""
if not isinstance(fnames, (tuple, list)):
fnames = [fnames]
for fname in fnames:
open_file_in_external_explorer(fname) | [
"Show",
"files",
"in",
"external",
"file",
"explorer",
"Args",
":",
"fnames",
"(",
"list",
")",
":",
"Names",
"of",
"files",
"to",
"show",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L60-L69 | [
"def",
"show_in_external_file_explorer",
"(",
"fnames",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"fnames",
",",
"(",
"tuple",
",",
"list",
")",
")",
":",
"fnames",
"=",
"[",
"fnames",
"]",
"for",
"fname",
"in",
"fnames",
":",
"open_file_in_... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | fixpath | Normalize path fixing case, making absolute and removing symlinks | spyder/plugins/explorer/widgets.py | def fixpath(path):
"""Normalize path fixing case, making absolute and removing symlinks"""
norm = osp.normcase if os.name == 'nt' else osp.normpath
return norm(osp.abspath(osp.realpath(path))) | def fixpath(path):
"""Normalize path fixing case, making absolute and removing symlinks"""
norm = osp.normcase if os.name == 'nt' else osp.normpath
return norm(osp.abspath(osp.realpath(path))) | [
"Normalize",
"path",
"fixing",
"case",
"making",
"absolute",
"and",
"removing",
"symlinks"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L71-L74 | [
"def",
"fixpath",
"(",
"path",
")",
":",
"norm",
"=",
"osp",
".",
"normcase",
"if",
"os",
".",
"name",
"==",
"'nt'",
"else",
"osp",
".",
"normpath",
"return",
"norm",
"(",
"osp",
".",
"abspath",
"(",
"osp",
".",
"realpath",
"(",
"path",
")",
")",
... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | create_script | Create a new Python script | spyder/plugins/explorer/widgets.py | def create_script(fname):
"""Create a new Python script"""
text = os.linesep.join(["# -*- coding: utf-8 -*-", "", ""])
try:
encoding.write(to_text_string(text), fname, 'utf-8')
except EnvironmentError as error:
QMessageBox.critical(_("Save Error"),
_("... | def create_script(fname):
"""Create a new Python script"""
text = os.linesep.join(["# -*- coding: utf-8 -*-", "", ""])
try:
encoding.write(to_text_string(text), fname, 'utf-8')
except EnvironmentError as error:
QMessageBox.critical(_("Save Error"),
_("... | [
"Create",
"a",
"new",
"Python",
"script"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L77-L86 | [
"def",
"create_script",
"(",
"fname",
")",
":",
"text",
"=",
"os",
".",
"linesep",
".",
"join",
"(",
"[",
"\"# -*- coding: utf-8 -*-\"",
",",
"\"\"",
",",
"\"\"",
"]",
")",
"try",
":",
"encoding",
".",
"write",
"(",
"to_text_string",
"(",
"text",
")",
... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | listdir | List files and directories | spyder/plugins/explorer/widgets.py | def listdir(path, include=r'.', exclude=r'\.pyc$|^\.', show_all=False,
folders_only=False):
"""List files and directories"""
namelist = []
dirlist = [to_text_string(osp.pardir)]
for item in os.listdir(to_text_string(path)):
if re.search(exclude, item) and not show_all:
... | def listdir(path, include=r'.', exclude=r'\.pyc$|^\.', show_all=False,
folders_only=False):
"""List files and directories"""
namelist = []
dirlist = [to_text_string(osp.pardir)]
for item in os.listdir(to_text_string(path)):
if re.search(exclude, item) and not show_all:
... | [
"List",
"files",
"and",
"directories"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L88-L103 | [
"def",
"listdir",
"(",
"path",
",",
"include",
"=",
"r'.'",
",",
"exclude",
"=",
"r'\\.pyc$|^\\.'",
",",
"show_all",
"=",
"False",
",",
"folders_only",
"=",
"False",
")",
":",
"namelist",
"=",
"[",
"]",
"dirlist",
"=",
"[",
"to_text_string",
"(",
"osp",
... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | has_subdirectories | Return True if path has subdirectories | spyder/plugins/explorer/widgets.py | def has_subdirectories(path, include, exclude, show_all):
"""Return True if path has subdirectories"""
try:
# > 1 because of '..'
return len( listdir(path, include, exclude,
show_all, folders_only=True) ) > 1
except (IOError, OSError):
return False | def has_subdirectories(path, include, exclude, show_all):
"""Return True if path has subdirectories"""
try:
# > 1 because of '..'
return len( listdir(path, include, exclude,
show_all, folders_only=True) ) > 1
except (IOError, OSError):
return False | [
"Return",
"True",
"if",
"path",
"has",
"subdirectories"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L106-L113 | [
"def",
"has_subdirectories",
"(",
"path",
",",
"include",
",",
"exclude",
",",
"show_all",
")",
":",
"try",
":",
"# > 1 because of '..'\r",
"return",
"len",
"(",
"listdir",
"(",
"path",
",",
"include",
",",
"exclude",
",",
"show_all",
",",
"folders_only",
"=... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | IconProvider.icon | Reimplement Qt method | spyder/plugins/explorer/widgets.py | def icon(self, icontype_or_qfileinfo):
"""Reimplement Qt method"""
if isinstance(icontype_or_qfileinfo, QFileIconProvider.IconType):
return super(IconProvider, self).icon(icontype_or_qfileinfo)
else:
qfileinfo = icontype_or_qfileinfo
fname = osp.normpath... | def icon(self, icontype_or_qfileinfo):
"""Reimplement Qt method"""
if isinstance(icontype_or_qfileinfo, QFileIconProvider.IconType):
return super(IconProvider, self).icon(icontype_or_qfileinfo)
else:
qfileinfo = icontype_or_qfileinfo
fname = osp.normpath... | [
"Reimplement",
"Qt",
"method"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L125-L132 | [
"def",
"icon",
"(",
"self",
",",
"icontype_or_qfileinfo",
")",
":",
"if",
"isinstance",
"(",
"icontype_or_qfileinfo",
",",
"QFileIconProvider",
".",
"IconType",
")",
":",
"return",
"super",
"(",
"IconProvider",
",",
"self",
")",
".",
"icon",
"(",
"icontype_or_... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | DirView.setup_fs_model | Setup filesystem model | spyder/plugins/explorer/widgets.py | def setup_fs_model(self):
"""Setup filesystem model"""
filters = QDir.AllDirs | QDir.Files | QDir.Drives | QDir.NoDotAndDotDot
self.fsmodel = QFileSystemModel(self)
self.fsmodel.setFilter(filters)
self.fsmodel.setNameFilterDisables(False) | def setup_fs_model(self):
"""Setup filesystem model"""
filters = QDir.AllDirs | QDir.Files | QDir.Drives | QDir.NoDotAndDotDot
self.fsmodel = QFileSystemModel(self)
self.fsmodel.setFilter(filters)
self.fsmodel.setNameFilterDisables(False) | [
"Setup",
"filesystem",
"model"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L167-L172 | [
"def",
"setup_fs_model",
"(",
"self",
")",
":",
"filters",
"=",
"QDir",
".",
"AllDirs",
"|",
"QDir",
".",
"Files",
"|",
"QDir",
".",
"Drives",
"|",
"QDir",
".",
"NoDotAndDotDot",
"self",
".",
"fsmodel",
"=",
"QFileSystemModel",
"(",
"self",
")",
"self",
... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | DirView.setup_view | Setup view | spyder/plugins/explorer/widgets.py | def setup_view(self):
"""Setup view"""
self.install_model()
self.fsmodel.directoryLoaded.connect(
lambda: self.resizeColumnToContents(0))
self.setAnimated(False)
self.setSortingEnabled(True)
self.sortByColumn(0, Qt.AscendingOrder)
self.fsmodel.... | def setup_view(self):
"""Setup view"""
self.install_model()
self.fsmodel.directoryLoaded.connect(
lambda: self.resizeColumnToContents(0))
self.setAnimated(False)
self.setSortingEnabled(True)
self.sortByColumn(0, Qt.AscendingOrder)
self.fsmodel.... | [
"Setup",
"view"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L178-L189 | [
"def",
"setup_view",
"(",
"self",
")",
":",
"self",
".",
"install_model",
"(",
")",
"self",
".",
"fsmodel",
".",
"directoryLoaded",
".",
"connect",
"(",
"lambda",
":",
"self",
".",
"resizeColumnToContents",
"(",
"0",
")",
")",
"self",
".",
"setAnimated",
... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | DirView.set_single_click_to_open | Set single click to open items. | spyder/plugins/explorer/widgets.py | def set_single_click_to_open(self, value):
"""Set single click to open items."""
self.single_click_to_open = value
self.parent_widget.sig_option_changed.emit('single_click_to_open',
value) | def set_single_click_to_open(self, value):
"""Set single click to open items."""
self.single_click_to_open = value
self.parent_widget.sig_option_changed.emit('single_click_to_open',
value) | [
"Set",
"single",
"click",
"to",
"open",
"items",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L191-L195 | [
"def",
"set_single_click_to_open",
"(",
"self",
",",
"value",
")",
":",
"self",
".",
"single_click_to_open",
"=",
"value",
"self",
".",
"parent_widget",
".",
"sig_option_changed",
".",
"emit",
"(",
"'single_click_to_open'",
",",
"value",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | DirView.set_name_filters | Set name filters | spyder/plugins/explorer/widgets.py | def set_name_filters(self, name_filters):
"""Set name filters"""
self.name_filters = name_filters
self.fsmodel.setNameFilters(name_filters) | def set_name_filters(self, name_filters):
"""Set name filters"""
self.name_filters = name_filters
self.fsmodel.setNameFilters(name_filters) | [
"Set",
"name",
"filters"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L197-L200 | [
"def",
"set_name_filters",
"(",
"self",
",",
"name_filters",
")",
":",
"self",
".",
"name_filters",
"=",
"name_filters",
"self",
".",
"fsmodel",
".",
"setNameFilters",
"(",
"name_filters",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | DirView.set_show_all | Toggle 'show all files' state | spyder/plugins/explorer/widgets.py | def set_show_all(self, state):
"""Toggle 'show all files' state"""
if state:
self.fsmodel.setNameFilters([])
else:
self.fsmodel.setNameFilters(self.name_filters) | def set_show_all(self, state):
"""Toggle 'show all files' state"""
if state:
self.fsmodel.setNameFilters([])
else:
self.fsmodel.setNameFilters(self.name_filters) | [
"Toggle",
"show",
"all",
"files",
"state"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L202-L207 | [
"def",
"set_show_all",
"(",
"self",
",",
"state",
")",
":",
"if",
"state",
":",
"self",
".",
"fsmodel",
".",
"setNameFilters",
"(",
"[",
"]",
")",
"else",
":",
"self",
".",
"fsmodel",
".",
"setNameFilters",
"(",
"self",
".",
"name_filters",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | DirView.get_filename | Return filename associated with *index* | spyder/plugins/explorer/widgets.py | def get_filename(self, index):
"""Return filename associated with *index*"""
if index:
return osp.normpath(to_text_string(self.fsmodel.filePath(index))) | def get_filename(self, index):
"""Return filename associated with *index*"""
if index:
return osp.normpath(to_text_string(self.fsmodel.filePath(index))) | [
"Return",
"filename",
"associated",
"with",
"*",
"index",
"*"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L209-L212 | [
"def",
"get_filename",
"(",
"self",
",",
"index",
")",
":",
"if",
"index",
":",
"return",
"osp",
".",
"normpath",
"(",
"to_text_string",
"(",
"self",
".",
"fsmodel",
".",
"filePath",
"(",
"index",
")",
")",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | DirView.get_selected_filenames | Return selected filenames | spyder/plugins/explorer/widgets.py | def get_selected_filenames(self):
"""Return selected filenames"""
if self.selectionMode() == self.ExtendedSelection:
if self.selectionModel() is None:
return []
return [self.get_filename(idx) for idx in
self.selectionModel().selectedRows... | def get_selected_filenames(self):
"""Return selected filenames"""
if self.selectionMode() == self.ExtendedSelection:
if self.selectionModel() is None:
return []
return [self.get_filename(idx) for idx in
self.selectionModel().selectedRows... | [
"Return",
"selected",
"filenames"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L218-L226 | [
"def",
"get_selected_filenames",
"(",
"self",
")",
":",
"if",
"self",
".",
"selectionMode",
"(",
")",
"==",
"self",
".",
"ExtendedSelection",
":",
"if",
"self",
".",
"selectionModel",
"(",
")",
"is",
"None",
":",
"return",
"[",
"]",
"return",
"[",
"self"... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | DirView.get_dirname | Return dirname associated with *index* | spyder/plugins/explorer/widgets.py | def get_dirname(self, index):
"""Return dirname associated with *index*"""
fname = self.get_filename(index)
if fname:
if osp.isdir(fname):
return fname
else:
return osp.dirname(fname) | def get_dirname(self, index):
"""Return dirname associated with *index*"""
fname = self.get_filename(index)
if fname:
if osp.isdir(fname):
return fname
else:
return osp.dirname(fname) | [
"Return",
"dirname",
"associated",
"with",
"*",
"index",
"*"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L228-L235 | [
"def",
"get_dirname",
"(",
"self",
",",
"index",
")",
":",
"fname",
"=",
"self",
".",
"get_filename",
"(",
"index",
")",
"if",
"fname",
":",
"if",
"osp",
".",
"isdir",
"(",
"fname",
")",
":",
"return",
"fname",
"else",
":",
"return",
"osp",
".",
"d... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | DirView.setup | Setup tree widget | spyder/plugins/explorer/widgets.py | def setup(self, name_filters=['*.py', '*.pyw'], show_all=False,
single_click_to_open=False):
"""Setup tree widget"""
self.setup_view()
self.set_name_filters(name_filters)
self.show_all = show_all
self.single_click_to_open = single_click_to_open
... | def setup(self, name_filters=['*.py', '*.pyw'], show_all=False,
single_click_to_open=False):
"""Setup tree widget"""
self.setup_view()
self.set_name_filters(name_filters)
self.show_all = show_all
self.single_click_to_open = single_click_to_open
... | [
"Setup",
"tree",
"widget"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L238-L249 | [
"def",
"setup",
"(",
"self",
",",
"name_filters",
"=",
"[",
"'*.py'",
",",
"'*.pyw'",
"]",
",",
"show_all",
"=",
"False",
",",
"single_click_to_open",
"=",
"False",
")",
":",
"self",
".",
"setup_view",
"(",
")",
"self",
".",
"set_name_filters",
"(",
"nam... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | DirView.setup_common_actions | Setup context menu common actions | spyder/plugins/explorer/widgets.py | def setup_common_actions(self):
"""Setup context menu common actions"""
# Filters
filters_action = create_action(self, _("Edit filename filters..."),
None, ima.icon('filter'),
triggered=self.edit_filter)
... | def setup_common_actions(self):
"""Setup context menu common actions"""
# Filters
filters_action = create_action(self, _("Edit filename filters..."),
None, ima.icon('filter'),
triggered=self.edit_filter)
... | [
"Setup",
"context",
"menu",
"common",
"actions"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L257-L276 | [
"def",
"setup_common_actions",
"(",
"self",
")",
":",
"# Filters\r",
"filters_action",
"=",
"create_action",
"(",
"self",
",",
"_",
"(",
"\"Edit filename filters...\"",
")",
",",
"None",
",",
"ima",
".",
"icon",
"(",
"'filter'",
")",
",",
"triggered",
"=",
"... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | DirView.edit_filter | Edit name filters | spyder/plugins/explorer/widgets.py | def edit_filter(self):
"""Edit name filters"""
filters, valid = QInputDialog.getText(self, _('Edit filename filters'),
_('Name filters:'),
QLineEdit.Normal,
", "... | def edit_filter(self):
"""Edit name filters"""
filters, valid = QInputDialog.getText(self, _('Edit filename filters'),
_('Name filters:'),
QLineEdit.Normal,
", "... | [
"Edit",
"name",
"filters"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L279-L288 | [
"def",
"edit_filter",
"(",
"self",
")",
":",
"filters",
",",
"valid",
"=",
"QInputDialog",
".",
"getText",
"(",
"self",
",",
"_",
"(",
"'Edit filename filters'",
")",
",",
"_",
"(",
"'Name filters:'",
")",
",",
"QLineEdit",
".",
"Normal",
",",
"\", \"",
... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | DirView.toggle_all | Toggle all files mode | spyder/plugins/explorer/widgets.py | def toggle_all(self, checked):
"""Toggle all files mode"""
self.parent_widget.sig_option_changed.emit('show_all', checked)
self.show_all = checked
self.set_show_all(checked) | def toggle_all(self, checked):
"""Toggle all files mode"""
self.parent_widget.sig_option_changed.emit('show_all', checked)
self.show_all = checked
self.set_show_all(checked) | [
"Toggle",
"all",
"files",
"mode"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L291-L295 | [
"def",
"toggle_all",
"(",
"self",
",",
"checked",
")",
":",
"self",
".",
"parent_widget",
".",
"sig_option_changed",
".",
"emit",
"(",
"'show_all'",
",",
"checked",
")",
"self",
".",
"show_all",
"=",
"checked",
"self",
".",
"set_show_all",
"(",
"checked",
... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | DirView.create_file_new_actions | Return actions for submenu 'New... | spyder/plugins/explorer/widgets.py | def create_file_new_actions(self, fnames):
"""Return actions for submenu 'New...'"""
if not fnames:
return []
new_file_act = create_action(self, _("File..."),
icon=ima.icon('filenew'),
triggered=lambda:
... | def create_file_new_actions(self, fnames):
"""Return actions for submenu 'New...'"""
if not fnames:
return []
new_file_act = create_action(self, _("File..."),
icon=ima.icon('filenew'),
triggered=lambda:
... | [
"Return",
"actions",
"for",
"submenu",
"New",
"..."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L297-L318 | [
"def",
"create_file_new_actions",
"(",
"self",
",",
"fnames",
")",
":",
"if",
"not",
"fnames",
":",
"return",
"[",
"]",
"new_file_act",
"=",
"create_action",
"(",
"self",
",",
"_",
"(",
"\"File...\"",
")",
",",
"icon",
"=",
"ima",
".",
"icon",
"(",
"'f... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | DirView.create_file_manage_actions | Return file management actions | spyder/plugins/explorer/widgets.py | def create_file_manage_actions(self, fnames):
"""Return file management actions"""
only_files = all([osp.isfile(_fn) for _fn in fnames])
only_modules = all([osp.splitext(_fn)[1] in ('.py', '.pyw', '.ipy')
for _fn in fnames])
only_notebooks = all([osp.spli... | def create_file_manage_actions(self, fnames):
"""Return file management actions"""
only_files = all([osp.isfile(_fn) for _fn in fnames])
only_modules = all([osp.splitext(_fn)[1] in ('.py', '.pyw', '.ipy')
for _fn in fnames])
only_notebooks = all([osp.spli... | [
"Return",
"file",
"management",
"actions"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L324-L412 | [
"def",
"create_file_manage_actions",
"(",
"self",
",",
"fnames",
")",
":",
"only_files",
"=",
"all",
"(",
"[",
"osp",
".",
"isfile",
"(",
"_fn",
")",
"for",
"_fn",
"in",
"fnames",
"]",
")",
"only_modules",
"=",
"all",
"(",
"[",
"osp",
".",
"splitext",
... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | DirView.create_folder_manage_actions | Return folder management actions | spyder/plugins/explorer/widgets.py | def create_folder_manage_actions(self, fnames):
"""Return folder management actions"""
actions = []
if os.name == 'nt':
_title = _("Open command prompt here")
else:
_title = _("Open terminal here")
_title = _("Open IPython console here")
ac... | def create_folder_manage_actions(self, fnames):
"""Return folder management actions"""
actions = []
if os.name == 'nt':
_title = _("Open command prompt here")
else:
_title = _("Open terminal here")
_title = _("Open IPython console here")
ac... | [
"Return",
"folder",
"management",
"actions"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L414-L426 | [
"def",
"create_folder_manage_actions",
"(",
"self",
",",
"fnames",
")",
":",
"actions",
"=",
"[",
"]",
"if",
"os",
".",
"name",
"==",
"'nt'",
":",
"_title",
"=",
"_",
"(",
"\"Open command prompt here\"",
")",
"else",
":",
"_title",
"=",
"_",
"(",
"\"Open... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | DirView.create_context_menu_actions | Create context menu actions | spyder/plugins/explorer/widgets.py | def create_context_menu_actions(self):
"""Create context menu actions"""
actions = []
fnames = self.get_selected_filenames()
new_actions = self.create_file_new_actions(fnames)
if len(new_actions) > 1:
# Creating a submenu only if there is more than one entry
... | def create_context_menu_actions(self):
"""Create context menu actions"""
actions = []
fnames = self.get_selected_filenames()
new_actions = self.create_file_new_actions(fnames)
if len(new_actions) > 1:
# Creating a submenu only if there is more than one entry
... | [
"Create",
"context",
"menu",
"actions"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L428-L456 | [
"def",
"create_context_menu_actions",
"(",
"self",
")",
":",
"actions",
"=",
"[",
"]",
"fnames",
"=",
"self",
".",
"get_selected_filenames",
"(",
")",
"new_actions",
"=",
"self",
".",
"create_file_new_actions",
"(",
"fnames",
")",
"if",
"len",
"(",
"new_action... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | DirView.update_menu | Update context menu | spyder/plugins/explorer/widgets.py | def update_menu(self):
"""Update context menu"""
self.menu.clear()
add_actions(self.menu, self.create_context_menu_actions()) | def update_menu(self):
"""Update context menu"""
self.menu.clear()
add_actions(self.menu, self.create_context_menu_actions()) | [
"Update",
"context",
"menu"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L458-L461 | [
"def",
"update_menu",
"(",
"self",
")",
":",
"self",
".",
"menu",
".",
"clear",
"(",
")",
"add_actions",
"(",
"self",
".",
"menu",
",",
"self",
".",
"create_context_menu_actions",
"(",
")",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | DirView.keyPressEvent | Reimplement Qt method | spyder/plugins/explorer/widgets.py | def keyPressEvent(self, event):
"""Reimplement Qt method"""
if event.key() in (Qt.Key_Enter, Qt.Key_Return):
self.clicked()
elif event.key() == Qt.Key_F2:
self.rename()
elif event.key() == Qt.Key_Delete:
self.delete()
elif event.key() =... | def keyPressEvent(self, event):
"""Reimplement Qt method"""
if event.key() in (Qt.Key_Enter, Qt.Key_Return):
self.clicked()
elif event.key() == Qt.Key_F2:
self.rename()
elif event.key() == Qt.Key_Delete:
self.delete()
elif event.key() =... | [
"Reimplement",
"Qt",
"method"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L490-L501 | [
"def",
"keyPressEvent",
"(",
"self",
",",
"event",
")",
":",
"if",
"event",
".",
"key",
"(",
")",
"in",
"(",
"Qt",
".",
"Key_Enter",
",",
"Qt",
".",
"Key_Return",
")",
":",
"self",
".",
"clicked",
"(",
")",
"elif",
"event",
".",
"key",
"(",
")",
... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | DirView.mouseReleaseEvent | Reimplement Qt method. | spyder/plugins/explorer/widgets.py | def mouseReleaseEvent(self, event):
"""Reimplement Qt method."""
QTreeView.mouseReleaseEvent(self, event)
if self.single_click_to_open:
self.clicked() | def mouseReleaseEvent(self, event):
"""Reimplement Qt method."""
QTreeView.mouseReleaseEvent(self, event)
if self.single_click_to_open:
self.clicked() | [
"Reimplement",
"Qt",
"method",
"."
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L508-L512 | [
"def",
"mouseReleaseEvent",
"(",
"self",
",",
"event",
")",
":",
"QTreeView",
".",
"mouseReleaseEvent",
"(",
"self",
",",
"event",
")",
"if",
"self",
".",
"single_click_to_open",
":",
"self",
".",
"clicked",
"(",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | DirView.clicked | Selected item was double-clicked or enter/return was pressed | spyder/plugins/explorer/widgets.py | def clicked(self):
"""Selected item was double-clicked or enter/return was pressed"""
fnames = self.get_selected_filenames()
for fname in fnames:
if osp.isdir(fname):
self.directory_clicked(fname)
else:
self.open([fname]) | def clicked(self):
"""Selected item was double-clicked or enter/return was pressed"""
fnames = self.get_selected_filenames()
for fname in fnames:
if osp.isdir(fname):
self.directory_clicked(fname)
else:
self.open([fname]) | [
"Selected",
"item",
"was",
"double",
"-",
"clicked",
"or",
"enter",
"/",
"return",
"was",
"pressed"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L515-L522 | [
"def",
"clicked",
"(",
"self",
")",
":",
"fnames",
"=",
"self",
".",
"get_selected_filenames",
"(",
")",
"for",
"fname",
"in",
"fnames",
":",
"if",
"osp",
".",
"isdir",
"(",
"fname",
")",
":",
"self",
".",
"directory_clicked",
"(",
"fname",
")",
"else"... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | DirView.dragMoveEvent | Drag and Drop - Move event | spyder/plugins/explorer/widgets.py | def dragMoveEvent(self, event):
"""Drag and Drop - Move event"""
if (event.mimeData().hasFormat("text/plain")):
event.setDropAction(Qt.MoveAction)
event.accept()
else:
event.ignore() | def dragMoveEvent(self, event):
"""Drag and Drop - Move event"""
if (event.mimeData().hasFormat("text/plain")):
event.setDropAction(Qt.MoveAction)
event.accept()
else:
event.ignore() | [
"Drag",
"and",
"Drop",
"-",
"Move",
"event"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L533-L539 | [
"def",
"dragMoveEvent",
"(",
"self",
",",
"event",
")",
":",
"if",
"(",
"event",
".",
"mimeData",
"(",
")",
".",
"hasFormat",
"(",
"\"text/plain\"",
")",
")",
":",
"event",
".",
"setDropAction",
"(",
"Qt",
".",
"MoveAction",
")",
"event",
".",
"accept"... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | DirView.startDrag | Reimplement Qt Method - handle drag event | spyder/plugins/explorer/widgets.py | def startDrag(self, dropActions):
"""Reimplement Qt Method - handle drag event"""
data = QMimeData()
data.setUrls([QUrl(fname) for fname in self.get_selected_filenames()])
drag = QDrag(self)
drag.setMimeData(data)
drag.exec_() | def startDrag(self, dropActions):
"""Reimplement Qt Method - handle drag event"""
data = QMimeData()
data.setUrls([QUrl(fname) for fname in self.get_selected_filenames()])
drag = QDrag(self)
drag.setMimeData(data)
drag.exec_() | [
"Reimplement",
"Qt",
"Method",
"-",
"handle",
"drag",
"event"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L541-L547 | [
"def",
"startDrag",
"(",
"self",
",",
"dropActions",
")",
":",
"data",
"=",
"QMimeData",
"(",
")",
"data",
".",
"setUrls",
"(",
"[",
"QUrl",
"(",
"fname",
")",
"for",
"fname",
"in",
"self",
".",
"get_selected_filenames",
"(",
")",
"]",
")",
"drag",
"... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | DirView.open | Open files with the appropriate application | spyder/plugins/explorer/widgets.py | def open(self, fnames=None):
"""Open files with the appropriate application"""
if fnames is None:
fnames = self.get_selected_filenames()
for fname in fnames:
if osp.isfile(fname) and encoding.is_text_file(fname):
self.parent_widget.sig_open_file.emit... | def open(self, fnames=None):
"""Open files with the appropriate application"""
if fnames is None:
fnames = self.get_selected_filenames()
for fname in fnames:
if osp.isfile(fname) and encoding.is_text_file(fname):
self.parent_widget.sig_open_file.emit... | [
"Open",
"files",
"with",
"the",
"appropriate",
"application"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L551-L559 | [
"def",
"open",
"(",
"self",
",",
"fnames",
"=",
"None",
")",
":",
"if",
"fnames",
"is",
"None",
":",
"fnames",
"=",
"self",
".",
"get_selected_filenames",
"(",
")",
"for",
"fname",
"in",
"fnames",
":",
"if",
"osp",
".",
"isfile",
"(",
"fname",
")",
... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | DirView.open_external | Open files with default application | spyder/plugins/explorer/widgets.py | def open_external(self, fnames=None):
"""Open files with default application"""
if fnames is None:
fnames = self.get_selected_filenames()
for fname in fnames:
self.open_outside_spyder([fname]) | def open_external(self, fnames=None):
"""Open files with default application"""
if fnames is None:
fnames = self.get_selected_filenames()
for fname in fnames:
self.open_outside_spyder([fname]) | [
"Open",
"files",
"with",
"default",
"application"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L562-L567 | [
"def",
"open_external",
"(",
"self",
",",
"fnames",
"=",
"None",
")",
":",
"if",
"fnames",
"is",
"None",
":",
"fnames",
"=",
"self",
".",
"get_selected_filenames",
"(",
")",
"for",
"fname",
"in",
"fnames",
":",
"self",
".",
"open_outside_spyder",
"(",
"[... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | DirView.open_outside_spyder | Open file outside Spyder with the appropriate application
If this does not work, opening unknown file in Spyder, as text file | spyder/plugins/explorer/widgets.py | def open_outside_spyder(self, fnames):
"""Open file outside Spyder with the appropriate application
If this does not work, opening unknown file in Spyder, as text file"""
for path in sorted(fnames):
path = file_uri(path)
ok = programs.start_file(path)
if... | def open_outside_spyder(self, fnames):
"""Open file outside Spyder with the appropriate application
If this does not work, opening unknown file in Spyder, as text file"""
for path in sorted(fnames):
path = file_uri(path)
ok = programs.start_file(path)
if... | [
"Open",
"file",
"outside",
"Spyder",
"with",
"the",
"appropriate",
"application",
"If",
"this",
"does",
"not",
"work",
"opening",
"unknown",
"file",
"in",
"Spyder",
"as",
"text",
"file"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L569-L576 | [
"def",
"open_outside_spyder",
"(",
"self",
",",
"fnames",
")",
":",
"for",
"path",
"in",
"sorted",
"(",
"fnames",
")",
":",
"path",
"=",
"file_uri",
"(",
"path",
")",
"ok",
"=",
"programs",
".",
"start_file",
"(",
"path",
")",
"if",
"not",
"ok",
":",... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | DirView.open_interpreter | Open interpreter | spyder/plugins/explorer/widgets.py | def open_interpreter(self, fnames):
"""Open interpreter"""
for path in sorted(fnames):
self.sig_open_interpreter.emit(path) | def open_interpreter(self, fnames):
"""Open interpreter"""
for path in sorted(fnames):
self.sig_open_interpreter.emit(path) | [
"Open",
"interpreter"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L578-L581 | [
"def",
"open_interpreter",
"(",
"self",
",",
"fnames",
")",
":",
"for",
"path",
"in",
"sorted",
"(",
"fnames",
")",
":",
"self",
".",
"sig_open_interpreter",
".",
"emit",
"(",
"path",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | DirView.run | Run Python scripts | spyder/plugins/explorer/widgets.py | def run(self, fnames=None):
"""Run Python scripts"""
if fnames is None:
fnames = self.get_selected_filenames()
for fname in fnames:
self.sig_run.emit(fname) | def run(self, fnames=None):
"""Run Python scripts"""
if fnames is None:
fnames = self.get_selected_filenames()
for fname in fnames:
self.sig_run.emit(fname) | [
"Run",
"Python",
"scripts"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L584-L589 | [
"def",
"run",
"(",
"self",
",",
"fnames",
"=",
"None",
")",
":",
"if",
"fnames",
"is",
"None",
":",
"fnames",
"=",
"self",
".",
"get_selected_filenames",
"(",
")",
"for",
"fname",
"in",
"fnames",
":",
"self",
".",
"sig_run",
".",
"emit",
"(",
"fname"... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | DirView.remove_tree | Remove whole directory tree
Reimplemented in project explorer widget | spyder/plugins/explorer/widgets.py | def remove_tree(self, dirname):
"""Remove whole directory tree
Reimplemented in project explorer widget"""
while osp.exists(dirname):
try:
shutil.rmtree(dirname, onerror=misc.onerror)
except Exception as e:
# This handles a Windows p... | def remove_tree(self, dirname):
"""Remove whole directory tree
Reimplemented in project explorer widget"""
while osp.exists(dirname):
try:
shutil.rmtree(dirname, onerror=misc.onerror)
except Exception as e:
# This handles a Windows p... | [
"Remove",
"whole",
"directory",
"tree",
"Reimplemented",
"in",
"project",
"explorer",
"widget"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L591-L602 | [
"def",
"remove_tree",
"(",
"self",
",",
"dirname",
")",
":",
"while",
"osp",
".",
"exists",
"(",
"dirname",
")",
":",
"try",
":",
"shutil",
".",
"rmtree",
"(",
"dirname",
",",
"onerror",
"=",
"misc",
".",
"onerror",
")",
"except",
"Exception",
"as",
... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | DirView.delete_file | Delete file | spyder/plugins/explorer/widgets.py | def delete_file(self, fname, multiple, yes_to_all):
"""Delete file"""
if multiple:
buttons = QMessageBox.Yes|QMessageBox.YesToAll| \
QMessageBox.No|QMessageBox.Cancel
else:
buttons = QMessageBox.Yes|QMessageBox.No
if yes_to_all is None... | def delete_file(self, fname, multiple, yes_to_all):
"""Delete file"""
if multiple:
buttons = QMessageBox.Yes|QMessageBox.YesToAll| \
QMessageBox.No|QMessageBox.Cancel
else:
buttons = QMessageBox.Yes|QMessageBox.No
if yes_to_all is None... | [
"Delete",
"file"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L604-L636 | [
"def",
"delete_file",
"(",
"self",
",",
"fname",
",",
"multiple",
",",
"yes_to_all",
")",
":",
"if",
"multiple",
":",
"buttons",
"=",
"QMessageBox",
".",
"Yes",
"|",
"QMessageBox",
".",
"YesToAll",
"|",
"QMessageBox",
".",
"No",
"|",
"QMessageBox",
".",
... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | DirView.delete | Delete files | spyder/plugins/explorer/widgets.py | def delete(self, fnames=None):
"""Delete files"""
if fnames is None:
fnames = self.get_selected_filenames()
multiple = len(fnames) > 1
yes_to_all = None
for fname in fnames:
spyproject_path = osp.join(fname,'.spyproject')
if osp.isdir(f... | def delete(self, fnames=None):
"""Delete files"""
if fnames is None:
fnames = self.get_selected_filenames()
multiple = len(fnames) > 1
yes_to_all = None
for fname in fnames:
spyproject_path = osp.join(fname,'.spyproject')
if osp.isdir(f... | [
"Delete",
"files"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L639-L659 | [
"def",
"delete",
"(",
"self",
",",
"fnames",
"=",
"None",
")",
":",
"if",
"fnames",
"is",
"None",
":",
"fnames",
"=",
"self",
".",
"get_selected_filenames",
"(",
")",
"multiple",
"=",
"len",
"(",
"fnames",
")",
">",
"1",
"yes_to_all",
"=",
"None",
"f... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
train | DirView.convert_notebook | Convert an IPython notebook to a Python script in editor | spyder/plugins/explorer/widgets.py | def convert_notebook(self, fname):
"""Convert an IPython notebook to a Python script in editor"""
try:
script = nbexporter().from_filename(fname)[0]
except Exception as e:
QMessageBox.critical(self, _('Conversion error'),
_("It was... | def convert_notebook(self, fname):
"""Convert an IPython notebook to a Python script in editor"""
try:
script = nbexporter().from_filename(fname)[0]
except Exception as e:
QMessageBox.critical(self, _('Conversion error'),
_("It was... | [
"Convert",
"an",
"IPython",
"notebook",
"to",
"a",
"Python",
"script",
"in",
"editor"
] | spyder-ide/spyder | python | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L661-L671 | [
"def",
"convert_notebook",
"(",
"self",
",",
"fname",
")",
":",
"try",
":",
"script",
"=",
"nbexporter",
"(",
")",
".",
"from_filename",
"(",
"fname",
")",
"[",
"0",
"]",
"except",
"Exception",
"as",
"e",
":",
"QMessageBox",
".",
"critical",
"(",
"self... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.