repo
stringclasses
85 values
path
stringlengths
8
121
func_name
stringlengths
1
82
original_string
stringlengths
112
65.5k
language
stringclasses
1 value
code
stringlengths
112
65.5k
code_tokens
listlengths
20
4.09k
docstring
stringlengths
3
46.3k
docstring_tokens
listlengths
1
564
sha
stringclasses
85 values
url
stringlengths
93
218
partition
stringclasses
1 value
spyder-ide/spyder
spyder/plugins/variableexplorer/widgets/dataframeeditor.py
DataFrameEditor.create_table_level
def create_table_level(self): """Create the QTableView that will hold the level model.""" self.table_level = QTableView() self.table_level.setEditTriggers(QTableWidget.NoEditTriggers) self.table_level.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.table_level.setVe...
python
def create_table_level(self): """Create the QTableView that will hold the level model.""" self.table_level = QTableView() self.table_level.setEditTriggers(QTableWidget.NoEditTriggers) self.table_level.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.table_level.setVe...
[ "def", "create_table_level", "(", "self", ")", ":", "self", ".", "table_level", "=", "QTableView", "(", ")", "self", ".", "table_level", ".", "setEditTriggers", "(", "QTableWidget", ".", "NoEditTriggers", ")", "self", ".", "table_level", ".", "setHorizontalScrol...
Create the QTableView that will hold the level model.
[ "Create", "the", "QTableView", "that", "will", "hold", "the", "level", "model", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L956-L971
train
spyder-ide/spyder
spyder/plugins/variableexplorer/widgets/dataframeeditor.py
DataFrameEditor.create_table_header
def create_table_header(self): """Create the QTableView that will hold the header model.""" self.table_header = QTableView() self.table_header.verticalHeader().hide() self.table_header.setEditTriggers(QTableWidget.NoEditTriggers) self.table_header.setHorizontalScrollBarPolic...
python
def create_table_header(self): """Create the QTableView that will hold the header model.""" self.table_header = QTableView() self.table_header.verticalHeader().hide() self.table_header.setEditTriggers(QTableWidget.NoEditTriggers) self.table_header.setHorizontalScrollBarPolic...
[ "def", "create_table_header", "(", "self", ")", ":", "self", ".", "table_header", "=", "QTableView", "(", ")", "self", ".", "table_header", ".", "verticalHeader", "(", ")", ".", "hide", "(", ")", "self", ".", "table_header", ".", "setEditTriggers", "(", "Q...
Create the QTableView that will hold the header model.
[ "Create", "the", "QTableView", "that", "will", "hold", "the", "header", "model", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L973-L986
train
spyder-ide/spyder
spyder/plugins/variableexplorer/widgets/dataframeeditor.py
DataFrameEditor.create_table_index
def create_table_index(self): """Create the QTableView that will hold the index model.""" self.table_index = QTableView() self.table_index.horizontalHeader().hide() self.table_index.setEditTriggers(QTableWidget.NoEditTriggers) self.table_index.setHorizontalScrollBarPolicy(Qt...
python
def create_table_index(self): """Create the QTableView that will hold the index model.""" self.table_index = QTableView() self.table_index.horizontalHeader().hide() self.table_index.setEditTriggers(QTableWidget.NoEditTriggers) self.table_index.setHorizontalScrollBarPolicy(Qt...
[ "def", "create_table_index", "(", "self", ")", ":", "self", ".", "table_index", "=", "QTableView", "(", ")", "self", ".", "table_index", ".", "horizontalHeader", "(", ")", ".", "hide", "(", ")", "self", ".", "table_index", ".", "setEditTriggers", "(", "QTa...
Create the QTableView that will hold the index model.
[ "Create", "the", "QTableView", "that", "will", "hold", "the", "index", "model", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L988-L1002
train
spyder-ide/spyder
spyder/plugins/variableexplorer/widgets/dataframeeditor.py
DataFrameEditor.create_data_table
def create_data_table(self): """Create the QTableView that will hold the data model.""" self.dataTable = DataFrameView(self, self.dataModel, self.table_header.horizontalHeader(), self.hscroll, self.vscroll) self.d...
python
def create_data_table(self): """Create the QTableView that will hold the data model.""" self.dataTable = DataFrameView(self, self.dataModel, self.table_header.horizontalHeader(), self.hscroll, self.vscroll) self.d...
[ "def", "create_data_table", "(", "self", ")", ":", "self", ".", "dataTable", "=", "DataFrameView", "(", "self", ",", "self", ".", "dataModel", ",", "self", ".", "table_header", ".", "horizontalHeader", "(", ")", ",", "self", ".", "hscroll", ",", "self", ...
Create the QTableView that will hold the data model.
[ "Create", "the", "QTableView", "that", "will", "hold", "the", "data", "model", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L1004-L1021
train
spyder-ide/spyder
spyder/plugins/variableexplorer/widgets/dataframeeditor.py
DataFrameEditor.sortByIndex
def sortByIndex(self, index): """Implement a Index sort.""" self.table_level.horizontalHeader().setSortIndicatorShown(True) sort_order = self.table_level.horizontalHeader().sortIndicatorOrder() self.table_index.model().sort(index, sort_order) self._sort_update()
python
def sortByIndex(self, index): """Implement a Index sort.""" self.table_level.horizontalHeader().setSortIndicatorShown(True) sort_order = self.table_level.horizontalHeader().sortIndicatorOrder() self.table_index.model().sort(index, sort_order) self._sort_update()
[ "def", "sortByIndex", "(", "self", ",", "index", ")", ":", "self", ".", "table_level", ".", "horizontalHeader", "(", ")", ".", "setSortIndicatorShown", "(", "True", ")", "sort_order", "=", "self", ".", "table_level", ".", "horizontalHeader", "(", ")", ".", ...
Implement a Index sort.
[ "Implement", "a", "Index", "sort", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L1023-L1028
train
spyder-ide/spyder
spyder/plugins/variableexplorer/widgets/dataframeeditor.py
DataFrameEditor._column_resized
def _column_resized(self, col, old_width, new_width): """Update the column width.""" self.dataTable.setColumnWidth(col, new_width) self._update_layout()
python
def _column_resized(self, col, old_width, new_width): """Update the column width.""" self.dataTable.setColumnWidth(col, new_width) self._update_layout()
[ "def", "_column_resized", "(", "self", ",", "col", ",", "old_width", ",", "new_width", ")", ":", "self", ".", "dataTable", ".", "setColumnWidth", "(", "col", ",", "new_width", ")", "self", ".", "_update_layout", "(", ")" ]
Update the column width.
[ "Update", "the", "column", "width", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L1034-L1037
train
spyder-ide/spyder
spyder/plugins/variableexplorer/widgets/dataframeeditor.py
DataFrameEditor._row_resized
def _row_resized(self, row, old_height, new_height): """Update the row height.""" self.dataTable.setRowHeight(row, new_height) self._update_layout()
python
def _row_resized(self, row, old_height, new_height): """Update the row height.""" self.dataTable.setRowHeight(row, new_height) self._update_layout()
[ "def", "_row_resized", "(", "self", ",", "row", ",", "old_height", ",", "new_height", ")", ":", "self", ".", "dataTable", ".", "setRowHeight", "(", "row", ",", "new_height", ")", "self", ".", "_update_layout", "(", ")" ]
Update the row height.
[ "Update", "the", "row", "height", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L1039-L1042
train
spyder-ide/spyder
spyder/plugins/variableexplorer/widgets/dataframeeditor.py
DataFrameEditor._index_resized
def _index_resized(self, col, old_width, new_width): """Resize the corresponding column of the index section selected.""" self.table_index.setColumnWidth(col, new_width) self._update_layout()
python
def _index_resized(self, col, old_width, new_width): """Resize the corresponding column of the index section selected.""" self.table_index.setColumnWidth(col, new_width) self._update_layout()
[ "def", "_index_resized", "(", "self", ",", "col", ",", "old_width", ",", "new_width", ")", ":", "self", ".", "table_index", ".", "setColumnWidth", "(", "col", ",", "new_width", ")", "self", ".", "_update_layout", "(", ")" ]
Resize the corresponding column of the index section selected.
[ "Resize", "the", "corresponding", "column", "of", "the", "index", "section", "selected", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L1044-L1047
train
spyder-ide/spyder
spyder/plugins/variableexplorer/widgets/dataframeeditor.py
DataFrameEditor._header_resized
def _header_resized(self, row, old_height, new_height): """Resize the corresponding row of the header section selected.""" self.table_header.setRowHeight(row, new_height) self._update_layout()
python
def _header_resized(self, row, old_height, new_height): """Resize the corresponding row of the header section selected.""" self.table_header.setRowHeight(row, new_height) self._update_layout()
[ "def", "_header_resized", "(", "self", ",", "row", ",", "old_height", ",", "new_height", ")", ":", "self", ".", "table_header", ".", "setRowHeight", "(", "row", ",", "new_height", ")", "self", ".", "_update_layout", "(", ")" ]
Resize the corresponding row of the header section selected.
[ "Resize", "the", "corresponding", "row", "of", "the", "header", "section", "selected", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L1049-L1052
train
spyder-ide/spyder
spyder/plugins/variableexplorer/widgets/dataframeeditor.py
DataFrameEditor._reset_model
def _reset_model(self, table, model): """Set the model in the given table.""" old_sel_model = table.selectionModel() table.setModel(model) if old_sel_model: del old_sel_model
python
def _reset_model(self, table, model): """Set the model in the given table.""" old_sel_model = table.selectionModel() table.setModel(model) if old_sel_model: del old_sel_model
[ "def", "_reset_model", "(", "self", ",", "table", ",", "model", ")", ":", "old_sel_model", "=", "table", ".", "selectionModel", "(", ")", "table", ".", "setModel", "(", "model", ")", "if", "old_sel_model", ":", "del", "old_sel_model" ]
Set the model in the given table.
[ "Set", "the", "model", "in", "the", "given", "table", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L1087-L1092
train
spyder-ide/spyder
spyder/plugins/variableexplorer/widgets/dataframeeditor.py
DataFrameEditor.setModel
def setModel(self, model, relayout=True): """Set the model for the data, header/index and level views.""" self._model = model sel_model = self.dataTable.selectionModel() sel_model.currentColumnChanged.connect( self._resizeCurrentColumnToContents) # Asociat...
python
def setModel(self, model, relayout=True): """Set the model for the data, header/index and level views.""" self._model = model sel_model = self.dataTable.selectionModel() sel_model.currentColumnChanged.connect( self._resizeCurrentColumnToContents) # Asociat...
[ "def", "setModel", "(", "self", ",", "model", ",", "relayout", "=", "True", ")", ":", "self", ".", "_model", "=", "model", "sel_model", "=", "self", ".", "dataTable", ".", "selectionModel", "(", ")", "sel_model", ".", "currentColumnChanged", ".", "connect"...
Set the model for the data, header/index and level views.
[ "Set", "the", "model", "for", "the", "data", "header", "/", "index", "and", "level", "views", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L1098-L1121
train
spyder-ide/spyder
spyder/plugins/variableexplorer/widgets/dataframeeditor.py
DataFrameEditor.setCurrentIndex
def setCurrentIndex(self, y, x): """Set current selection.""" self.dataTable.selectionModel().setCurrentIndex( self.dataTable.model().index(y, x), QItemSelectionModel.ClearAndSelect)
python
def setCurrentIndex(self, y, x): """Set current selection.""" self.dataTable.selectionModel().setCurrentIndex( self.dataTable.model().index(y, x), QItemSelectionModel.ClearAndSelect)
[ "def", "setCurrentIndex", "(", "self", ",", "y", ",", "x", ")", ":", "self", ".", "dataTable", ".", "selectionModel", "(", ")", ".", "setCurrentIndex", "(", "self", ".", "dataTable", ".", "model", "(", ")", ".", "index", "(", "y", ",", "x", ")", ",...
Set current selection.
[ "Set", "current", "selection", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L1123-L1127
train
spyder-ide/spyder
spyder/plugins/variableexplorer/widgets/dataframeeditor.py
DataFrameEditor._resizeColumnToContents
def _resizeColumnToContents(self, header, data, col, limit_ms): """Resize a column by its contents.""" hdr_width = self._sizeHintForColumn(header, col, limit_ms) data_width = self._sizeHintForColumn(data, col, limit_ms) if data_width > hdr_width: width = min(self.max_wid...
python
def _resizeColumnToContents(self, header, data, col, limit_ms): """Resize a column by its contents.""" hdr_width = self._sizeHintForColumn(header, col, limit_ms) data_width = self._sizeHintForColumn(data, col, limit_ms) if data_width > hdr_width: width = min(self.max_wid...
[ "def", "_resizeColumnToContents", "(", "self", ",", "header", ",", "data", ",", "col", ",", "limit_ms", ")", ":", "hdr_width", "=", "self", ".", "_sizeHintForColumn", "(", "header", ",", "col", ",", "limit_ms", ")", "data_width", "=", "self", ".", "_sizeHi...
Resize a column by its contents.
[ "Resize", "a", "column", "by", "its", "contents", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L1146-L1157
train
spyder-ide/spyder
spyder/plugins/variableexplorer/widgets/dataframeeditor.py
DataFrameEditor._resizeColumnsToContents
def _resizeColumnsToContents(self, header, data, limit_ms): """Resize all the colummns to its contents.""" max_col = data.model().columnCount() if limit_ms is None: max_col_ms = None else: max_col_ms = limit_ms / max(1, max_col) for col in range(max...
python
def _resizeColumnsToContents(self, header, data, limit_ms): """Resize all the colummns to its contents.""" max_col = data.model().columnCount() if limit_ms is None: max_col_ms = None else: max_col_ms = limit_ms / max(1, max_col) for col in range(max...
[ "def", "_resizeColumnsToContents", "(", "self", ",", "header", ",", "data", ",", "limit_ms", ")", ":", "max_col", "=", "data", ".", "model", "(", ")", ".", "columnCount", "(", ")", "if", "limit_ms", "is", "None", ":", "max_col_ms", "=", "None", "else", ...
Resize all the colummns to its contents.
[ "Resize", "all", "the", "colummns", "to", "its", "contents", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L1159-L1167
train
spyder-ide/spyder
spyder/plugins/variableexplorer/widgets/dataframeeditor.py
DataFrameEditor.eventFilter
def eventFilter(self, obj, event): """Override eventFilter to catch resize event.""" if obj == self.dataTable and event.type() == QEvent.Resize: self._resizeVisibleColumnsToContents() return False
python
def eventFilter(self, obj, event): """Override eventFilter to catch resize event.""" if obj == self.dataTable and event.type() == QEvent.Resize: self._resizeVisibleColumnsToContents() return False
[ "def", "eventFilter", "(", "self", ",", "obj", ",", "event", ")", ":", "if", "obj", "==", "self", ".", "dataTable", "and", "event", ".", "type", "(", ")", "==", "QEvent", ".", "Resize", ":", "self", ".", "_resizeVisibleColumnsToContents", "(", ")", "re...
Override eventFilter to catch resize event.
[ "Override", "eventFilter", "to", "catch", "resize", "event", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L1169-L1173
train
spyder-ide/spyder
spyder/plugins/variableexplorer/widgets/dataframeeditor.py
DataFrameEditor._resizeCurrentColumnToContents
def _resizeCurrentColumnToContents(self, new_index, old_index): """Resize the current column to its contents.""" if new_index.column() not in self._autosized_cols: # Ensure the requested column is fully into view after resizing self._resizeVisibleColumnsToContents() ...
python
def _resizeCurrentColumnToContents(self, new_index, old_index): """Resize the current column to its contents.""" if new_index.column() not in self._autosized_cols: # Ensure the requested column is fully into view after resizing self._resizeVisibleColumnsToContents() ...
[ "def", "_resizeCurrentColumnToContents", "(", "self", ",", "new_index", ",", "old_index", ")", ":", "if", "new_index", ".", "column", "(", ")", "not", "in", "self", ".", "_autosized_cols", ":", "# Ensure the requested column is fully into view after resizing\r", "self",...
Resize the current column to its contents.
[ "Resize", "the", "current", "column", "to", "its", "contents", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L1202-L1207
train
spyder-ide/spyder
spyder/plugins/variableexplorer/widgets/dataframeeditor.py
DataFrameEditor.resizeColumnsToContents
def resizeColumnsToContents(self): """Resize the columns to its contents.""" self._autosized_cols = set() self._resizeColumnsToContents(self.table_level, self.table_index, self._max_autosize_ms) self._update_layout()
python
def resizeColumnsToContents(self): """Resize the columns to its contents.""" self._autosized_cols = set() self._resizeColumnsToContents(self.table_level, self.table_index, self._max_autosize_ms) self._update_layout()
[ "def", "resizeColumnsToContents", "(", "self", ")", ":", "self", ".", "_autosized_cols", "=", "set", "(", ")", "self", ".", "_resizeColumnsToContents", "(", "self", ".", "table_level", ",", "self", ".", "table_index", ",", "self", ".", "_max_autosize_ms", ")",...
Resize the columns to its contents.
[ "Resize", "the", "columns", "to", "its", "contents", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L1209-L1214
train
spyder-ide/spyder
spyder/plugins/variableexplorer/widgets/dataframeeditor.py
DataFrameEditor.change_bgcolor_enable
def change_bgcolor_enable(self, state): """ This is implementet so column min/max is only active when bgcolor is """ self.dataModel.bgcolor(state) self.bgcolor_global.setEnabled(not self.is_series and state > 0)
python
def change_bgcolor_enable(self, state): """ This is implementet so column min/max is only active when bgcolor is """ self.dataModel.bgcolor(state) self.bgcolor_global.setEnabled(not self.is_series and state > 0)
[ "def", "change_bgcolor_enable", "(", "self", ",", "state", ")", ":", "self", ".", "dataModel", ".", "bgcolor", "(", "state", ")", "self", ".", "bgcolor_global", ".", "setEnabled", "(", "not", "self", ".", "is_series", "and", "state", ">", "0", ")" ]
This is implementet so column min/max is only active when bgcolor is
[ "This", "is", "implementet", "so", "column", "min", "/", "max", "is", "only", "active", "when", "bgcolor", "is" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L1216-L1221
train
spyder-ide/spyder
spyder/plugins/variableexplorer/widgets/dataframeeditor.py
DataFrameEditor.change_format
def change_format(self): """ Ask user for display format for floats and use it. This function also checks whether the format is valid and emits `sig_option_changed`. """ format, valid = QInputDialog.getText(self, _('Format'), ...
python
def change_format(self): """ Ask user for display format for floats and use it. This function also checks whether the format is valid and emits `sig_option_changed`. """ format, valid = QInputDialog.getText(self, _('Format'), ...
[ "def", "change_format", "(", "self", ")", ":", "format", ",", "valid", "=", "QInputDialog", ".", "getText", "(", "self", ",", "_", "(", "'Format'", ")", ",", "_", "(", "\"Float formatting\"", ")", ",", "QLineEdit", ".", "Normal", ",", "self", ".", "dat...
Ask user for display format for floats and use it. This function also checks whether the format is valid and emits `sig_option_changed`.
[ "Ask", "user", "for", "display", "format", "for", "floats", "and", "use", "it", ".", "This", "function", "also", "checks", "whether", "the", "format", "is", "valid", "and", "emits", "sig_option_changed", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L1223-L1247
train
spyder-ide/spyder
spyder/plugins/variableexplorer/widgets/dataframeeditor.py
DataFrameEditor.get_value
def get_value(self): """Return modified Dataframe -- this is *not* a copy""" # It is import to avoid accessing Qt C++ object as it has probably # already been destroyed, due to the Qt.WA_DeleteOnClose attribute df = self.dataModel.get_data() if self.is_series: r...
python
def get_value(self): """Return modified Dataframe -- this is *not* a copy""" # It is import to avoid accessing Qt C++ object as it has probably # already been destroyed, due to the Qt.WA_DeleteOnClose attribute df = self.dataModel.get_data() if self.is_series: r...
[ "def", "get_value", "(", "self", ")", ":", "# It is import to avoid accessing Qt C++ object as it has probably\r", "# already been destroyed, due to the Qt.WA_DeleteOnClose attribute\r", "df", "=", "self", ".", "dataModel", ".", "get_data", "(", ")", "if", "self", ".", "is_se...
Return modified Dataframe -- this is *not* a copy
[ "Return", "modified", "Dataframe", "--", "this", "is", "*", "not", "*", "a", "copy" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L1249-L1257
train
spyder-ide/spyder
spyder/plugins/variableexplorer/widgets/dataframeeditor.py
DataFrameEditor._update_header_size
def _update_header_size(self): """Update the column width of the header.""" column_count = self.table_header.model().columnCount() for index in range(0, column_count): if index < column_count: column_width = self.dataTable.columnWidth(index) self...
python
def _update_header_size(self): """Update the column width of the header.""" column_count = self.table_header.model().columnCount() for index in range(0, column_count): if index < column_count: column_width = self.dataTable.columnWidth(index) self...
[ "def", "_update_header_size", "(", "self", ")", ":", "column_count", "=", "self", ".", "table_header", ".", "model", "(", ")", ".", "columnCount", "(", ")", "for", "index", "in", "range", "(", "0", ",", "column_count", ")", ":", "if", "index", "<", "co...
Update the column width of the header.
[ "Update", "the", "column", "width", "of", "the", "header", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L1259-L1267
train
spyder-ide/spyder
spyder/plugins/variableexplorer/widgets/namespacebrowser.py
NamespaceBrowser.setup
def setup(self, check_all=None, exclude_private=None, exclude_uppercase=None, exclude_capitalized=None, exclude_unsupported=None, excluded_names=None, minmax=None, dataframe_format=None): """ Setup the namespace browser with provided settings. Ar...
python
def setup(self, check_all=None, exclude_private=None, exclude_uppercase=None, exclude_capitalized=None, exclude_unsupported=None, excluded_names=None, minmax=None, dataframe_format=None): """ Setup the namespace browser with provided settings. Ar...
[ "def", "setup", "(", "self", ",", "check_all", "=", "None", ",", "exclude_private", "=", "None", ",", "exclude_uppercase", "=", "None", ",", "exclude_capitalized", "=", "None", ",", "exclude_unsupported", "=", "None", ",", "excluded_names", "=", "None", ",", ...
Setup the namespace browser with provided settings. Args: dataframe_format (string): default floating-point format for DataFrame editor
[ "Setup", "the", "namespace", "browser", "with", "provided", "settings", ".", "Args", ":", "dataframe_format", "(", "string", ")", ":", "default", "floating", "-", "point", "format", "for", "DataFrame", "editor" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/namespacebrowser.py#L82-L142
train
spyder-ide/spyder
spyder/plugins/variableexplorer/widgets/namespacebrowser.py
NamespaceBrowser.setup_toolbar
def setup_toolbar(self): """Setup toolbar""" load_button = create_toolbutton(self, text=_('Import data'), icon=ima.icon('fileimport'), triggered=lambda: self.import_data()) self.save_button = create_toolbutton(s...
python
def setup_toolbar(self): """Setup toolbar""" load_button = create_toolbutton(self, text=_('Import data'), icon=ima.icon('fileimport'), triggered=lambda: self.import_data()) self.save_button = create_toolbutton(s...
[ "def", "setup_toolbar", "(", "self", ")", ":", "load_button", "=", "create_toolbutton", "(", "self", ",", "text", "=", "_", "(", "'Import data'", ")", ",", "icon", "=", "ima", ".", "icon", "(", "'fileimport'", ")", ",", "triggered", "=", "lambda", ":", ...
Setup toolbar
[ "Setup", "toolbar" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/namespacebrowser.py#L153-L171
train
spyder-ide/spyder
spyder/plugins/variableexplorer/widgets/namespacebrowser.py
NamespaceBrowser.setup_option_actions
def setup_option_actions(self, exclude_private, exclude_uppercase, exclude_capitalized, exclude_unsupported): """Setup the actions to show in the cog menu.""" self.setup_in_progress = True self.exclude_private_action = create_action(self, _("Ex...
python
def setup_option_actions(self, exclude_private, exclude_uppercase, exclude_capitalized, exclude_unsupported): """Setup the actions to show in the cog menu.""" self.setup_in_progress = True self.exclude_private_action = create_action(self, _("Ex...
[ "def", "setup_option_actions", "(", "self", ",", "exclude_private", ",", "exclude_uppercase", ",", "exclude_capitalized", ",", "exclude_unsupported", ")", ":", "self", ".", "setup_in_progress", "=", "True", "self", ".", "exclude_private_action", "=", "create_action", ...
Setup the actions to show in the cog menu.
[ "Setup", "the", "actions", "to", "show", "in", "the", "cog", "menu", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/namespacebrowser.py#L173-L215
train
spyder-ide/spyder
spyder/plugins/variableexplorer/widgets/namespacebrowser.py
NamespaceBrowser.setup_options_button
def setup_options_button(self): """Add the cog menu button to the toolbar.""" if not self.options_button: self.options_button = create_toolbutton( self, text=_('Options'), icon=ima.icon('tooloptions')) actions = self.actions + [MENU_SEPARATOR] + self.plugin...
python
def setup_options_button(self): """Add the cog menu button to the toolbar.""" if not self.options_button: self.options_button = create_toolbutton( self, text=_('Options'), icon=ima.icon('tooloptions')) actions = self.actions + [MENU_SEPARATOR] + self.plugin...
[ "def", "setup_options_button", "(", "self", ")", ":", "if", "not", "self", ".", "options_button", ":", "self", ".", "options_button", "=", "create_toolbutton", "(", "self", ",", "text", "=", "_", "(", "'Options'", ")", ",", "icon", "=", "ima", ".", "icon...
Add the cog menu button to the toolbar.
[ "Add", "the", "cog", "menu", "button", "to", "the", "toolbar", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/namespacebrowser.py#L217-L232
train
spyder-ide/spyder
spyder/plugins/variableexplorer/widgets/namespacebrowser.py
NamespaceBrowser.option_changed
def option_changed(self, option, value): """Option has changed""" setattr(self, to_text_string(option), value) self.shellwidget.set_namespace_view_settings() self.refresh_table()
python
def option_changed(self, option, value): """Option has changed""" setattr(self, to_text_string(option), value) self.shellwidget.set_namespace_view_settings() self.refresh_table()
[ "def", "option_changed", "(", "self", ",", "option", ",", "value", ")", ":", "setattr", "(", "self", ",", "to_text_string", "(", "option", ")", ",", "value", ")", "self", ".", "shellwidget", ".", "set_namespace_view_settings", "(", ")", "self", ".", "refre...
Option has changed
[ "Option", "has", "changed" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/namespacebrowser.py#L234-L238
train
spyder-ide/spyder
spyder/plugins/variableexplorer/widgets/namespacebrowser.py
NamespaceBrowser.get_view_settings
def get_view_settings(self): """Return dict editor view settings""" settings = {} for name in REMOTE_SETTINGS: settings[name] = getattr(self, name) return settings
python
def get_view_settings(self): """Return dict editor view settings""" settings = {} for name in REMOTE_SETTINGS: settings[name] = getattr(self, name) return settings
[ "def", "get_view_settings", "(", "self", ")", ":", "settings", "=", "{", "}", "for", "name", "in", "REMOTE_SETTINGS", ":", "settings", "[", "name", "]", "=", "getattr", "(", "self", ",", "name", ")", "return", "settings" ]
Return dict editor view settings
[ "Return", "dict", "editor", "view", "settings" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/namespacebrowser.py#L240-L245
train
spyder-ide/spyder
spyder/plugins/variableexplorer/widgets/namespacebrowser.py
NamespaceBrowser.refresh_table
def refresh_table(self): """Refresh variable table""" if self.is_visible and self.isVisible(): self.shellwidget.refresh_namespacebrowser() try: self.editor.resizeRowToContents() except TypeError: pass
python
def refresh_table(self): """Refresh variable table""" if self.is_visible and self.isVisible(): self.shellwidget.refresh_namespacebrowser() try: self.editor.resizeRowToContents() except TypeError: pass
[ "def", "refresh_table", "(", "self", ")", ":", "if", "self", ".", "is_visible", "and", "self", ".", "isVisible", "(", ")", ":", "self", ".", "shellwidget", ".", "refresh_namespacebrowser", "(", ")", "try", ":", "self", ".", "editor", ".", "resizeRowToConte...
Refresh variable table
[ "Refresh", "variable", "table" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/namespacebrowser.py#L247-L254
train
spyder-ide/spyder
spyder/plugins/variableexplorer/widgets/namespacebrowser.py
NamespaceBrowser.set_data
def set_data(self, data): """Set data.""" if data != self.editor.model.get_data(): self.editor.set_data(data) self.editor.adjust_columns()
python
def set_data(self, data): """Set data.""" if data != self.editor.model.get_data(): self.editor.set_data(data) self.editor.adjust_columns()
[ "def", "set_data", "(", "self", ",", "data", ")", ":", "if", "data", "!=", "self", ".", "editor", ".", "model", ".", "get_data", "(", ")", ":", "self", ".", "editor", ".", "set_data", "(", "data", ")", "self", ".", "editor", ".", "adjust_columns", ...
Set data.
[ "Set", "data", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/namespacebrowser.py#L266-L270
train
spyder-ide/spyder
spyder/plugins/variableexplorer/widgets/namespacebrowser.py
NamespaceBrowser.import_data
def import_data(self, filenames=None): """Import data from text file.""" title = _("Import data") if filenames is None: if self.filename is None: basedir = getcwd_or_home() else: basedir = osp.dirname(self.filename) file...
python
def import_data(self, filenames=None): """Import data from text file.""" title = _("Import data") if filenames is None: if self.filename is None: basedir = getcwd_or_home() else: basedir = osp.dirname(self.filename) file...
[ "def", "import_data", "(", "self", ",", "filenames", "=", "None", ")", ":", "title", "=", "_", "(", "\"Import data\"", ")", "if", "filenames", "is", "None", ":", "if", "self", ".", "filename", "is", "None", ":", "basedir", "=", "getcwd_or_home", "(", "...
Import data from text file.
[ "Import", "data", "from", "text", "file", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/namespacebrowser.py#L278-L344
train
spyder-ide/spyder
spyder/plugins/variableexplorer/widgets/namespacebrowser.py
NamespaceBrowser.save_data
def save_data(self, filename=None): """Save data""" if filename is None: filename = self.filename if filename is None: filename = getcwd_or_home() filename, _selfilter = getsavefilename(self, _("Save data"), ...
python
def save_data(self, filename=None): """Save data""" if filename is None: filename = self.filename if filename is None: filename = getcwd_or_home() filename, _selfilter = getsavefilename(self, _("Save data"), ...
[ "def", "save_data", "(", "self", ",", "filename", "=", "None", ")", ":", "if", "filename", "is", "None", ":", "filename", "=", "self", ".", "filename", "if", "filename", "is", "None", ":", "filename", "=", "getcwd_or_home", "(", ")", "filename", ",", "...
Save data
[ "Save", "data" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/namespacebrowser.py#L353-L385
train
spyder-ide/spyder
spyder/preferences/configdialog.py
ConfigPage.apply_changes
def apply_changes(self): """Apply changes callback""" if self.is_modified: self.save_to_conf() if self.apply_callback is not None: self.apply_callback() # Since the language cannot be retrieved by CONF and the language # is needed ...
python
def apply_changes(self): """Apply changes callback""" if self.is_modified: self.save_to_conf() if self.apply_callback is not None: self.apply_callback() # Since the language cannot be retrieved by CONF and the language # is needed ...
[ "def", "apply_changes", "(", "self", ")", ":", "if", "self", ".", "is_modified", ":", "self", ".", "save_to_conf", "(", ")", "if", "self", ".", "apply_callback", "is", "not", "None", ":", "self", ".", "apply_callback", "(", ")", "# Since the language cannot ...
Apply changes callback
[ "Apply", "changes", "callback" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/configdialog.py#L92-L111
train
spyder-ide/spyder
spyder/preferences/configdialog.py
ConfigDialog.get_page
def get_page(self, index=None): """Return page widget""" if index is None: widget = self.pages_widget.currentWidget() else: widget = self.pages_widget.widget(index) return widget.widget()
python
def get_page(self, index=None): """Return page widget""" if index is None: widget = self.pages_widget.currentWidget() else: widget = self.pages_widget.widget(index) return widget.widget()
[ "def", "get_page", "(", "self", ",", "index", "=", "None", ")", ":", "if", "index", "is", "None", ":", "widget", "=", "self", ".", "pages_widget", ".", "currentWidget", "(", ")", "else", ":", "widget", "=", "self", ".", "pages_widget", ".", "widget", ...
Return page widget
[ "Return", "page", "widget" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/configdialog.py#L197-L203
train
spyder-ide/spyder
spyder/preferences/configdialog.py
ConfigDialog.accept
def accept(self): """Reimplement Qt method""" for index in range(self.pages_widget.count()): configpage = self.get_page(index) if not configpage.is_valid(): return configpage.apply_changes() QDialog.accept(self)
python
def accept(self): """Reimplement Qt method""" for index in range(self.pages_widget.count()): configpage = self.get_page(index) if not configpage.is_valid(): return configpage.apply_changes() QDialog.accept(self)
[ "def", "accept", "(", "self", ")", ":", "for", "index", "in", "range", "(", "self", ".", "pages_widget", ".", "count", "(", ")", ")", ":", "configpage", "=", "self", ".", "get_page", "(", "index", ")", "if", "not", "configpage", ".", "is_valid", "(",...
Reimplement Qt method
[ "Reimplement", "Qt", "method" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/configdialog.py#L206-L213
train
spyder-ide/spyder
spyder/preferences/configdialog.py
ConfigDialog.resizeEvent
def resizeEvent(self, event): """ Reimplement Qt method to be able to save the widget's size from the main application """ QDialog.resizeEvent(self, event) self.size_change.emit(self.size())
python
def resizeEvent(self, event): """ Reimplement Qt method to be able to save the widget's size from the main application """ QDialog.resizeEvent(self, event) self.size_change.emit(self.size())
[ "def", "resizeEvent", "(", "self", ",", "event", ")", ":", "QDialog", ".", "resizeEvent", "(", "self", ",", "event", ")", "self", ".", "size_change", ".", "emit", "(", "self", ".", "size", "(", ")", ")" ]
Reimplement Qt method to be able to save the widget's size from the main application
[ "Reimplement", "Qt", "method", "to", "be", "able", "to", "save", "the", "widget", "s", "size", "from", "the", "main", "application" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/configdialog.py#L251-L257
train
spyder-ide/spyder
spyder/preferences/configdialog.py
SpyderConfigPage.is_valid
def is_valid(self): """Return True if all widget contents are valid""" for lineedit in self.lineedits: if lineedit in self.validate_data and lineedit.isEnabled(): validator, invalid_msg = self.validate_data[lineedit] text = to_text_string(lineedit.text())...
python
def is_valid(self): """Return True if all widget contents are valid""" for lineedit in self.lineedits: if lineedit in self.validate_data and lineedit.isEnabled(): validator, invalid_msg = self.validate_data[lineedit] text = to_text_string(lineedit.text())...
[ "def", "is_valid", "(", "self", ")", ":", "for", "lineedit", "in", "self", ".", "lineedits", ":", "if", "lineedit", "in", "self", ".", "validate_data", "and", "lineedit", ".", "isEnabled", "(", ")", ":", "validator", ",", "invalid_msg", "=", "self", ".",...
Return True if all widget contents are valid
[ "Return", "True", "if", "all", "widget", "contents", "are", "valid" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/configdialog.py#L295-L306
train
spyder-ide/spyder
spyder/preferences/configdialog.py
SpyderConfigPage.load_from_conf
def load_from_conf(self): """Load settings from configuration file""" for checkbox, (option, default) in list(self.checkboxes.items()): checkbox.setChecked(self.get_option(option, default)) # QAbstractButton works differently for PySide and PyQt if not API == 'py...
python
def load_from_conf(self): """Load settings from configuration file""" for checkbox, (option, default) in list(self.checkboxes.items()): checkbox.setChecked(self.get_option(option, default)) # QAbstractButton works differently for PySide and PyQt if not API == 'py...
[ "def", "load_from_conf", "(", "self", ")", ":", "for", "checkbox", ",", "(", "option", ",", "default", ")", "in", "list", "(", "self", ".", "checkboxes", ".", "items", "(", ")", ")", ":", "checkbox", ".", "setChecked", "(", "self", ".", "get_option", ...
Load settings from configuration file
[ "Load", "settings", "from", "configuration", "file" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/configdialog.py#L308-L410
train
spyder-ide/spyder
spyder/preferences/configdialog.py
SpyderConfigPage.save_to_conf
def save_to_conf(self): """Save settings to configuration file""" for checkbox, (option, _default) in list(self.checkboxes.items()): self.set_option(option, checkbox.isChecked()) for radiobutton, (option, _default) in list(self.radiobuttons.items()): self.set_option(...
python
def save_to_conf(self): """Save settings to configuration file""" for checkbox, (option, _default) in list(self.checkboxes.items()): self.set_option(option, checkbox.isChecked()) for radiobutton, (option, _default) in list(self.radiobuttons.items()): self.set_option(...
[ "def", "save_to_conf", "(", "self", ")", ":", "for", "checkbox", ",", "(", "option", ",", "_default", ")", "in", "list", "(", "self", ".", "checkboxes", ".", "items", "(", ")", ")", ":", "self", ".", "set_option", "(", "option", ",", "checkbox", ".",...
Save settings to configuration file
[ "Save", "settings", "to", "configuration", "file" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/configdialog.py#L412-L437
train
spyder-ide/spyder
spyder/preferences/configdialog.py
SpyderConfigPage.select_directory
def select_directory(self, edit): """Select directory""" basedir = to_text_string(edit.text()) if not osp.isdir(basedir): basedir = getcwd_or_home() title = _("Select directory") directory = getexistingdirectory(self, title, basedir) if directory: ...
python
def select_directory(self, edit): """Select directory""" basedir = to_text_string(edit.text()) if not osp.isdir(basedir): basedir = getcwd_or_home() title = _("Select directory") directory = getexistingdirectory(self, title, basedir) if directory: ...
[ "def", "select_directory", "(", "self", ",", "edit", ")", ":", "basedir", "=", "to_text_string", "(", "edit", ".", "text", "(", ")", ")", "if", "not", "osp", ".", "isdir", "(", "basedir", ")", ":", "basedir", "=", "getcwd_or_home", "(", ")", "title", ...
Select directory
[ "Select", "directory" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/configdialog.py#L555-L563
train
spyder-ide/spyder
spyder/preferences/configdialog.py
SpyderConfigPage.select_file
def select_file(self, edit, filters=None): """Select File""" basedir = osp.dirname(to_text_string(edit.text())) if not osp.isdir(basedir): basedir = getcwd_or_home() if filters is None: filters = _("All files (*)") title = _("Select file") ...
python
def select_file(self, edit, filters=None): """Select File""" basedir = osp.dirname(to_text_string(edit.text())) if not osp.isdir(basedir): basedir = getcwd_or_home() if filters is None: filters = _("All files (*)") title = _("Select file") ...
[ "def", "select_file", "(", "self", ",", "edit", ",", "filters", "=", "None", ")", ":", "basedir", "=", "osp", ".", "dirname", "(", "to_text_string", "(", "edit", ".", "text", "(", ")", ")", ")", "if", "not", "osp", ".", "isdir", "(", "basedir", ")"...
Select File
[ "Select", "File" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/configdialog.py#L585-L595
train
spyder-ide/spyder
spyder/preferences/configdialog.py
SpyderConfigPage.create_combobox
def create_combobox(self, text, choices, option, default=NoDefault, tip=None, restart=False): """choices: couples (name, key)""" label = QLabel(text) combobox = QComboBox() if tip is not None: combobox.setToolTip(tip) for name, key in ch...
python
def create_combobox(self, text, choices, option, default=NoDefault, tip=None, restart=False): """choices: couples (name, key)""" label = QLabel(text) combobox = QComboBox() if tip is not None: combobox.setToolTip(tip) for name, key in ch...
[ "def", "create_combobox", "(", "self", ",", "text", ",", "choices", ",", "option", ",", "default", "=", "NoDefault", ",", "tip", "=", "None", ",", "restart", "=", "False", ")", ":", "label", "=", "QLabel", "(", "text", ")", "combobox", "=", "QComboBox"...
choices: couples (name, key)
[ "choices", ":", "couples", "(", "name", "key", ")" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/configdialog.py#L683-L712
train
spyder-ide/spyder
spyder/preferences/configdialog.py
SpyderConfigPage.create_file_combobox
def create_file_combobox(self, text, choices, option, default=NoDefault, tip=None, restart=False, filters=None, adjust_to_contents=False, default_line_edit=False): """choices: couples (name, key)""" combobox = Fi...
python
def create_file_combobox(self, text, choices, option, default=NoDefault, tip=None, restart=False, filters=None, adjust_to_contents=False, default_line_edit=False): """choices: couples (name, key)""" combobox = Fi...
[ "def", "create_file_combobox", "(", "self", ",", "text", ",", "choices", ",", "option", ",", "default", "=", "NoDefault", ",", "tip", "=", "None", ",", "restart", "=", "False", ",", "filters", "=", "None", ",", "adjust_to_contents", "=", "False", ",", "d...
choices: couples (name, key)
[ "choices", ":", "couples", "(", "name", "key", ")" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/configdialog.py#L714-L747
train
spyder-ide/spyder
spyder/preferences/configdialog.py
SpyderConfigPage.create_fontgroup
def create_fontgroup(self, option=None, text=None, title=None, tip=None, fontfilters=None, without_group=False): """Option=None -> setting plugin font""" if title: fontlabel = QLabel(title) else: fontlabel = QLabel(_("Font")) font...
python
def create_fontgroup(self, option=None, text=None, title=None, tip=None, fontfilters=None, without_group=False): """Option=None -> setting plugin font""" if title: fontlabel = QLabel(title) else: fontlabel = QLabel(_("Font")) font...
[ "def", "create_fontgroup", "(", "self", ",", "option", "=", "None", ",", "text", "=", "None", ",", "title", "=", "None", ",", "tip", "=", "None", ",", "fontfilters", "=", "None", ",", "without_group", "=", "False", ")", ":", "if", "title", ":", "font...
Option=None -> setting plugin font
[ "Option", "=", "None", "-", ">", "setting", "plugin", "font" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/configdialog.py#L749-L791
train
spyder-ide/spyder
spyder/preferences/configdialog.py
SpyderConfigPage.create_tab
def create_tab(self, *widgets): """Create simple tab widget page: widgets added in a vertical layout""" widget = QWidget() layout = QVBoxLayout() for widg in widgets: layout.addWidget(widg) layout.addStretch(1) widget.setLayout(layout) return w...
python
def create_tab(self, *widgets): """Create simple tab widget page: widgets added in a vertical layout""" widget = QWidget() layout = QVBoxLayout() for widg in widgets: layout.addWidget(widg) layout.addStretch(1) widget.setLayout(layout) return w...
[ "def", "create_tab", "(", "self", ",", "*", "widgets", ")", ":", "widget", "=", "QWidget", "(", ")", "layout", "=", "QVBoxLayout", "(", ")", "for", "widg", "in", "widgets", ":", "layout", ".", "addWidget", "(", "widg", ")", "layout", ".", "addStretch",...
Create simple tab widget page: widgets added in a vertical layout
[ "Create", "simple", "tab", "widget", "page", ":", "widgets", "added", "in", "a", "vertical", "layout" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/configdialog.py#L799-L807
train
spyder-ide/spyder
spyder/preferences/configdialog.py
GeneralConfigPage.prompt_restart_required
def prompt_restart_required(self): """Prompt the user with a request to restart.""" restart_opts = self.restart_options changed_opts = self.changed_options options = [restart_opts[o] for o in changed_opts if o in restart_opts] if len(options) == 1: msg_start =...
python
def prompt_restart_required(self): """Prompt the user with a request to restart.""" restart_opts = self.restart_options changed_opts = self.changed_options options = [restart_opts[o] for o in changed_opts if o in restart_opts] if len(options) == 1: msg_start =...
[ "def", "prompt_restart_required", "(", "self", ")", ":", "restart_opts", "=", "self", ".", "restart_options", "changed_opts", "=", "self", ".", "changed_options", "options", "=", "[", "restart_opts", "[", "o", "]", "for", "o", "in", "changed_opts", "if", "o", ...
Prompt the user with a request to restart.
[ "Prompt", "the", "user", "with", "a", "request", "to", "restart", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/configdialog.py#L834-L857
train
spyder-ide/spyder
spyder/widgets/helperwidgets.py
IconLineEdit._refresh
def _refresh(self): """After an application style change, the paintEvent updates the custom defined stylesheet. """ padding = self.height() css_base = """QLineEdit {{ border: none; padding-right: {padding}px; ...
python
def _refresh(self): """After an application style change, the paintEvent updates the custom defined stylesheet. """ padding = self.height() css_base = """QLineEdit {{ border: none; padding-right: {padding}px; ...
[ "def", "_refresh", "(", "self", ")", ":", "padding", "=", "self", ".", "height", "(", ")", "css_base", "=", "\"\"\"QLineEdit {{\n border: none;\n padding-right: {padding}px;\n }}\n ...
After an application style change, the paintEvent updates the custom defined stylesheet.
[ "After", "an", "application", "style", "change", "the", "paintEvent", "updates", "the", "custom", "defined", "stylesheet", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/helperwidgets.py#L212-L234
train
spyder-ide/spyder
spyder/widgets/helperwidgets.py
IconLineEdit.update_status
def update_status(self, value, value_set): """Update the status and set_status to update the icons to display.""" self._status = value self._status_set = value_set self.repaint() self.update()
python
def update_status(self, value, value_set): """Update the status and set_status to update the icons to display.""" self._status = value self._status_set = value_set self.repaint() self.update()
[ "def", "update_status", "(", "self", ",", "value", ",", "value_set", ")", ":", "self", ".", "_status", "=", "value", "self", ".", "_status_set", "=", "value_set", "self", ".", "repaint", "(", ")", "self", ".", "update", "(", ")" ]
Update the status and set_status to update the icons to display.
[ "Update", "the", "status", "and", "set_status", "to", "update", "the", "icons", "to", "display", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/helperwidgets.py#L248-L253
train
spyder-ide/spyder
spyder/widgets/helperwidgets.py
IconLineEdit.paintEvent
def paintEvent(self, event): """Qt Override. Include a validation icon to the left of the line edit. """ super(IconLineEdit, self).paintEvent(event) painter = QPainter(self) rect = self.geometry() space = int((rect.height())/6) h = rect.height() - space ...
python
def paintEvent(self, event): """Qt Override. Include a validation icon to the left of the line edit. """ super(IconLineEdit, self).paintEvent(event) painter = QPainter(self) rect = self.geometry() space = int((rect.height())/6) h = rect.height() - space ...
[ "def", "paintEvent", "(", "self", ",", "event", ")", ":", "super", "(", "IconLineEdit", ",", "self", ")", ".", "paintEvent", "(", "event", ")", "painter", "=", "QPainter", "(", "self", ")", "rect", "=", "self", ".", "geometry", "(", ")", "space", "="...
Qt Override. Include a validation icon to the left of the line edit.
[ "Qt", "Override", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/helperwidgets.py#L255-L286
train
spyder-ide/spyder
spyder/plugins/outlineexplorer/plugin.py
OutlineExplorer.register_plugin
def register_plugin(self): """Register plugin in Spyder's main window""" self.main.restore_scrollbar_position.connect( self.restore_scrollbar_position) self.main.add_dockwidget(self)
python
def register_plugin(self): """Register plugin in Spyder's main window""" self.main.restore_scrollbar_position.connect( self.restore_scrollbar_position) self.main.add_dockwidget(self)
[ "def", "register_plugin", "(", "self", ")", ":", "self", ".", "main", ".", "restore_scrollbar_position", ".", "connect", "(", "self", ".", "restore_scrollbar_position", ")", "self", ".", "main", ".", "add_dockwidget", "(", "self", ")" ]
Register plugin in Spyder's main window
[ "Register", "plugin", "in", "Spyder", "s", "main", "window" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/outlineexplorer/plugin.py#L79-L83
train
spyder-ide/spyder
spyder/plugins/outlineexplorer/plugin.py
OutlineExplorer.visibility_changed
def visibility_changed(self, enable): """DockWidget visibility has changed""" super(SpyderPluginWidget, self).visibility_changed(enable) if enable: self.explorer.is_visible.emit()
python
def visibility_changed(self, enable): """DockWidget visibility has changed""" super(SpyderPluginWidget, self).visibility_changed(enable) if enable: self.explorer.is_visible.emit()
[ "def", "visibility_changed", "(", "self", ",", "enable", ")", ":", "super", "(", "SpyderPluginWidget", ",", "self", ")", ".", "visibility_changed", "(", "enable", ")", "if", "enable", ":", "self", ".", "explorer", ".", "is_visible", ".", "emit", "(", ")" ]
DockWidget visibility has changed
[ "DockWidget", "visibility", "has", "changed" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/outlineexplorer/plugin.py#L95-L99
train
spyder-ide/spyder
spyder/plugins/outlineexplorer/plugin.py
OutlineExplorer.restore_scrollbar_position
def restore_scrollbar_position(self): """Restoring scrollbar position after main window is visible""" scrollbar_pos = self.get_option('scrollbar_position', None) if scrollbar_pos is not None: self.explorer.treewidget.set_scrollbar_position(scrollbar_pos)
python
def restore_scrollbar_position(self): """Restoring scrollbar position after main window is visible""" scrollbar_pos = self.get_option('scrollbar_position', None) if scrollbar_pos is not None: self.explorer.treewidget.set_scrollbar_position(scrollbar_pos)
[ "def", "restore_scrollbar_position", "(", "self", ")", ":", "scrollbar_pos", "=", "self", ".", "get_option", "(", "'scrollbar_position'", ",", "None", ")", "if", "scrollbar_pos", "is", "not", "None", ":", "self", ".", "explorer", ".", "treewidget", ".", "set_s...
Restoring scrollbar position after main window is visible
[ "Restoring", "scrollbar", "position", "after", "main", "window", "is", "visible" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/outlineexplorer/plugin.py#L102-L106
train
spyder-ide/spyder
spyder/plugins/outlineexplorer/plugin.py
OutlineExplorer.save_config
def save_config(self): """Save configuration: tree widget state""" for option, value in list(self.explorer.get_options().items()): self.set_option(option, value) self.set_option('expanded_state', self.explorer.treewidget.get_expanded_state()) sel...
python
def save_config(self): """Save configuration: tree widget state""" for option, value in list(self.explorer.get_options().items()): self.set_option(option, value) self.set_option('expanded_state', self.explorer.treewidget.get_expanded_state()) sel...
[ "def", "save_config", "(", "self", ")", ":", "for", "option", ",", "value", "in", "list", "(", "self", ".", "explorer", ".", "get_options", "(", ")", ".", "items", "(", ")", ")", ":", "self", ".", "set_option", "(", "option", ",", "value", ")", "se...
Save configuration: tree widget state
[ "Save", "configuration", ":", "tree", "widget", "state" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/outlineexplorer/plugin.py#L108-L115
train
spyder-ide/spyder
spyder/plugins/outlineexplorer/plugin.py
OutlineExplorer.load_config
def load_config(self): """Load configuration: tree widget state""" expanded_state = self.get_option('expanded_state', None) # Sometimes the expanded state option may be truncated in .ini file # (for an unknown reason), in this case it would be converted to a # string by 'use...
python
def load_config(self): """Load configuration: tree widget state""" expanded_state = self.get_option('expanded_state', None) # Sometimes the expanded state option may be truncated in .ini file # (for an unknown reason), in this case it would be converted to a # string by 'use...
[ "def", "load_config", "(", "self", ")", ":", "expanded_state", "=", "self", ".", "get_option", "(", "'expanded_state'", ",", "None", ")", "# Sometimes the expanded state option may be truncated in .ini file\r", "# (for an unknown reason), in this case it would be converted to a\r",...
Load configuration: tree widget state
[ "Load", "configuration", ":", "tree", "widget", "state" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/outlineexplorer/plugin.py#L117-L126
train
spyder-ide/spyder
spyder/plugins/pylint/widgets/pylintgui.py
ResultsTree.activated
def activated(self, item): """Double-click event""" data = self.data.get(id(item)) if data is not None: fname, lineno = data self.sig_edit_goto.emit(fname, lineno, '')
python
def activated(self, item): """Double-click event""" data = self.data.get(id(item)) if data is not None: fname, lineno = data self.sig_edit_goto.emit(fname, lineno, '')
[ "def", "activated", "(", "self", ",", "item", ")", ":", "data", "=", "self", ".", "data", ".", "get", "(", "id", "(", "item", ")", ")", "if", "data", "is", "not", "None", ":", "fname", ",", "lineno", "=", "data", "self", ".", "sig_edit_goto", "."...
Double-click event
[ "Double", "-", "click", "event" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/pylint/widgets/pylintgui.py#L67-L72
train
spyder-ide/spyder
spyder/plugins/pylint/widgets/pylintgui.py
PylintWidget.remove_obsolete_items
def remove_obsolete_items(self): """Removing obsolete items""" self.rdata = [(filename, data) for filename, data in self.rdata if is_module_or_package(filename)]
python
def remove_obsolete_items(self): """Removing obsolete items""" self.rdata = [(filename, data) for filename, data in self.rdata if is_module_or_package(filename)]
[ "def", "remove_obsolete_items", "(", "self", ")", ":", "self", ".", "rdata", "=", "[", "(", "filename", ",", "data", ")", "for", "filename", ",", "data", "in", "self", ".", "rdata", "if", "is_module_or_package", "(", "filename", ")", "]" ]
Removing obsolete items
[ "Removing", "obsolete", "items" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/pylint/widgets/pylintgui.py#L257-L260
train
spyder-ide/spyder
spyder/workers/updates.py
WorkerUpdates.check_update_available
def check_update_available(self): """Checks if there is an update available. It takes as parameters the current version of Spyder and a list of valid cleaned releases in chronological order. Example: ['2.3.2', '2.3.3' ...] or with github ['2.3.4', '2.3.3' ...] """ # Don'...
python
def check_update_available(self): """Checks if there is an update available. It takes as parameters the current version of Spyder and a list of valid cleaned releases in chronological order. Example: ['2.3.2', '2.3.3' ...] or with github ['2.3.4', '2.3.3' ...] """ # Don'...
[ "def", "check_update_available", "(", "self", ")", ":", "# Don't perform any check for development versions", "if", "'dev'", "in", "self", ".", "version", ":", "return", "(", "False", ",", "latest_release", ")", "# Filter releases", "if", "is_stable_version", "(", "se...
Checks if there is an update available. It takes as parameters the current version of Spyder and a list of valid cleaned releases in chronological order. Example: ['2.3.2', '2.3.3' ...] or with github ['2.3.4', '2.3.3' ...]
[ "Checks", "if", "there", "is", "an", "update", "available", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/workers/updates.py#L54-L75
train
spyder-ide/spyder
spyder/workers/updates.py
WorkerUpdates.start
def start(self): """Main method of the WorkerUpdates worker""" if is_anaconda(): self.url = 'https://repo.anaconda.com/pkgs/main' if os.name == 'nt': self.url += '/win-64/repodata.json' elif sys.platform == 'darwin': self.url += '/osx-6...
python
def start(self): """Main method of the WorkerUpdates worker""" if is_anaconda(): self.url = 'https://repo.anaconda.com/pkgs/main' if os.name == 'nt': self.url += '/win-64/repodata.json' elif sys.platform == 'darwin': self.url += '/osx-6...
[ "def", "start", "(", "self", ")", ":", "if", "is_anaconda", "(", ")", ":", "self", ".", "url", "=", "'https://repo.anaconda.com/pkgs/main'", "if", "os", ".", "name", "==", "'nt'", ":", "self", ".", "url", "+=", "'/win-64/repodata.json'", "elif", "sys", "."...
Main method of the WorkerUpdates worker
[ "Main", "method", "of", "the", "WorkerUpdates", "worker" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/workers/updates.py#L77-L140
train
spyder-ide/spyder
spyder/widgets/findreplace.py
FindReplace.eventFilter
def eventFilter(self, widget, event): """Event filter for search_text widget. Emits signals when presing Enter and Shift+Enter. This signals are used for search forward and backward. Also, a crude hack to get tab working in the Find/Replace boxes. """ if event.typ...
python
def eventFilter(self, widget, event): """Event filter for search_text widget. Emits signals when presing Enter and Shift+Enter. This signals are used for search forward and backward. Also, a crude hack to get tab working in the Find/Replace boxes. """ if event.typ...
[ "def", "eventFilter", "(", "self", ",", "widget", ",", "event", ")", ":", "if", "event", ".", "type", "(", ")", "==", "QEvent", ".", "KeyPress", ":", "key", "=", "event", ".", "key", "(", ")", "shift", "=", "event", ".", "modifiers", "(", ")", "&...
Event filter for search_text widget. Emits signals when presing Enter and Shift+Enter. This signals are used for search forward and backward. Also, a crude hack to get tab working in the Find/Replace boxes.
[ "Event", "filter", "for", "search_text", "widget", ".", "Emits", "signals", "when", "presing", "Enter", "and", "Shift", "+", "Enter", ".", "This", "signals", "are", "used", "for", "search", "forward", "and", "backward", ".", "Also", "a", "crude", "hack", "...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L182-L205
train
spyder-ide/spyder
spyder/widgets/findreplace.py
FindReplace.create_shortcuts
def create_shortcuts(self, parent): """Create shortcuts for this widget""" # Configurable findnext = config_shortcut(self.find_next, context='_', name='Find next', parent=parent) findprev = config_shortcut(self.find_previous, context='_', ...
python
def create_shortcuts(self, parent): """Create shortcuts for this widget""" # Configurable findnext = config_shortcut(self.find_next, context='_', name='Find next', parent=parent) findprev = config_shortcut(self.find_previous, context='_', ...
[ "def", "create_shortcuts", "(", "self", ",", "parent", ")", ":", "# Configurable\r", "findnext", "=", "config_shortcut", "(", "self", ".", "find_next", ",", "context", "=", "'_'", ",", "name", "=", "'Find next'", ",", "parent", "=", "parent", ")", "findprev"...
Create shortcuts for this widget
[ "Create", "shortcuts", "for", "this", "widget" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L207-L222
train
spyder-ide/spyder
spyder/widgets/findreplace.py
FindReplace.toggle_highlighting
def toggle_highlighting(self, state): """Toggle the 'highlight all results' feature""" if self.editor is not None: if state: self.highlight_matches() else: self.clear_matches()
python
def toggle_highlighting(self, state): """Toggle the 'highlight all results' feature""" if self.editor is not None: if state: self.highlight_matches() else: self.clear_matches()
[ "def", "toggle_highlighting", "(", "self", ",", "state", ")", ":", "if", "self", ".", "editor", "is", "not", "None", ":", "if", "state", ":", "self", ".", "highlight_matches", "(", ")", "else", ":", "self", ".", "clear_matches", "(", ")" ]
Toggle the 'highlight all results' feature
[ "Toggle", "the", "highlight", "all", "results", "feature" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L251-L257
train
spyder-ide/spyder
spyder/widgets/findreplace.py
FindReplace.show
def show(self, hide_replace=True): """Overrides Qt Method""" QWidget.show(self) self.visibility_changed.emit(True) self.change_number_matches() if self.editor is not None: if hide_replace: if self.replace_widgets[0].isVisible(): ...
python
def show(self, hide_replace=True): """Overrides Qt Method""" QWidget.show(self) self.visibility_changed.emit(True) self.change_number_matches() if self.editor is not None: if hide_replace: if self.replace_widgets[0].isVisible(): ...
[ "def", "show", "(", "self", ",", "hide_replace", "=", "True", ")", ":", "QWidget", ".", "show", "(", "self", ")", "self", ".", "visibility_changed", ".", "emit", "(", "True", ")", "self", ".", "change_number_matches", "(", ")", "if", "self", ".", "edit...
Overrides Qt Method
[ "Overrides", "Qt", "Method" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L259-L292
train
spyder-ide/spyder
spyder/widgets/findreplace.py
FindReplace.hide
def hide(self): """Overrides Qt Method""" for widget in self.replace_widgets: widget.hide() QWidget.hide(self) self.visibility_changed.emit(False) if self.editor is not None: self.editor.setFocus() self.clear_matches()
python
def hide(self): """Overrides Qt Method""" for widget in self.replace_widgets: widget.hide() QWidget.hide(self) self.visibility_changed.emit(False) if self.editor is not None: self.editor.setFocus() self.clear_matches()
[ "def", "hide", "(", "self", ")", ":", "for", "widget", "in", "self", ".", "replace_widgets", ":", "widget", ".", "hide", "(", ")", "QWidget", ".", "hide", "(", "self", ")", "self", ".", "visibility_changed", ".", "emit", "(", "False", ")", "if", "sel...
Overrides Qt Method
[ "Overrides", "Qt", "Method" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L295-L303
train
spyder-ide/spyder
spyder/widgets/findreplace.py
FindReplace.show_replace
def show_replace(self): """Show replace widgets""" self.show(hide_replace=False) for widget in self.replace_widgets: widget.show()
python
def show_replace(self): """Show replace widgets""" self.show(hide_replace=False) for widget in self.replace_widgets: widget.show()
[ "def", "show_replace", "(", "self", ")", ":", "self", ".", "show", "(", "hide_replace", "=", "False", ")", "for", "widget", "in", "self", ".", "replace_widgets", ":", "widget", ".", "show", "(", ")" ]
Show replace widgets
[ "Show", "replace", "widgets" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L305-L309
train
spyder-ide/spyder
spyder/widgets/findreplace.py
FindReplace.refresh
def refresh(self): """Refresh widget""" if self.isHidden(): if self.editor is not None: self.clear_matches() return state = self.editor is not None for widget in self.widgets: widget.setEnabled(state) if state: ...
python
def refresh(self): """Refresh widget""" if self.isHidden(): if self.editor is not None: self.clear_matches() return state = self.editor is not None for widget in self.widgets: widget.setEnabled(state) if state: ...
[ "def", "refresh", "(", "self", ")", ":", "if", "self", ".", "isHidden", "(", ")", ":", "if", "self", ".", "editor", "is", "not", "None", ":", "self", ".", "clear_matches", "(", ")", "return", "state", "=", "self", ".", "editor", "is", "not", "None"...
Refresh widget
[ "Refresh", "widget" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L316-L326
train
spyder-ide/spyder
spyder/widgets/findreplace.py
FindReplace.set_editor
def set_editor(self, editor, refresh=True): """ Set associated editor/web page: codeeditor.base.TextEditBaseWidget browser.WebView """ self.editor = editor # Note: This is necessary to test widgets/editor.py # in Qt builds that don't have w...
python
def set_editor(self, editor, refresh=True): """ Set associated editor/web page: codeeditor.base.TextEditBaseWidget browser.WebView """ self.editor = editor # Note: This is necessary to test widgets/editor.py # in Qt builds that don't have w...
[ "def", "set_editor", "(", "self", ",", "editor", ",", "refresh", "=", "True", ")", ":", "self", ".", "editor", "=", "editor", "# Note: This is necessary to test widgets/editor.py\r", "# in Qt builds that don't have web widgets\r", "try", ":", "from", "qtpy", ".", "QtW...
Set associated editor/web page: codeeditor.base.TextEditBaseWidget browser.WebView
[ "Set", "associated", "editor", "/", "web", "page", ":", "codeeditor", ".", "base", ".", "TextEditBaseWidget", "browser", ".", "WebView" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L328-L349
train
spyder-ide/spyder
spyder/widgets/findreplace.py
FindReplace.find_next
def find_next(self): """Find next occurrence""" state = self.find(changed=False, forward=True, rehighlight=False, multiline_replace_check=False) self.editor.setFocus() self.search_text.add_current_text() return state
python
def find_next(self): """Find next occurrence""" state = self.find(changed=False, forward=True, rehighlight=False, multiline_replace_check=False) self.editor.setFocus() self.search_text.add_current_text() return state
[ "def", "find_next", "(", "self", ")", ":", "state", "=", "self", ".", "find", "(", "changed", "=", "False", ",", "forward", "=", "True", ",", "rehighlight", "=", "False", ",", "multiline_replace_check", "=", "False", ")", "self", ".", "editor", ".", "s...
Find next occurrence
[ "Find", "next", "occurrence" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L352-L358
train
spyder-ide/spyder
spyder/widgets/findreplace.py
FindReplace.find_previous
def find_previous(self): """Find previous occurrence""" state = self.find(changed=False, forward=False, rehighlight=False, multiline_replace_check=False) self.editor.setFocus() return state
python
def find_previous(self): """Find previous occurrence""" state = self.find(changed=False, forward=False, rehighlight=False, multiline_replace_check=False) self.editor.setFocus() return state
[ "def", "find_previous", "(", "self", ")", ":", "state", "=", "self", ".", "find", "(", "changed", "=", "False", ",", "forward", "=", "False", ",", "rehighlight", "=", "False", ",", "multiline_replace_check", "=", "False", ")", "self", ".", "editor", ".",...
Find previous occurrence
[ "Find", "previous", "occurrence" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L361-L366
train
spyder-ide/spyder
spyder/widgets/findreplace.py
FindReplace.text_has_been_edited
def text_has_been_edited(self, text): """Find text has been edited (this slot won't be triggered when setting the search pattern combo box text programmatically)""" self.find(changed=True, forward=True, start_highlight_timer=True)
python
def text_has_been_edited(self, text): """Find text has been edited (this slot won't be triggered when setting the search pattern combo box text programmatically)""" self.find(changed=True, forward=True, start_highlight_timer=True)
[ "def", "text_has_been_edited", "(", "self", ",", "text", ")", ":", "self", ".", "find", "(", "changed", "=", "True", ",", "forward", "=", "True", ",", "start_highlight_timer", "=", "True", ")" ]
Find text has been edited (this slot won't be triggered when setting the search pattern combo box text programmatically)
[ "Find", "text", "has", "been", "edited", "(", "this", "slot", "won", "t", "be", "triggered", "when", "setting", "the", "search", "pattern", "combo", "box", "text", "programmatically", ")" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L368-L371
train
spyder-ide/spyder
spyder/widgets/findreplace.py
FindReplace.highlight_matches
def highlight_matches(self): """Highlight found results""" if self.is_code_editor and self.highlight_button.isChecked(): text = self.search_text.currentText() words = self.words_button.isChecked() regexp = self.re_button.isChecked() self.editor.highl...
python
def highlight_matches(self): """Highlight found results""" if self.is_code_editor and self.highlight_button.isChecked(): text = self.search_text.currentText() words = self.words_button.isChecked() regexp = self.re_button.isChecked() self.editor.highl...
[ "def", "highlight_matches", "(", "self", ")", ":", "if", "self", ".", "is_code_editor", "and", "self", ".", "highlight_button", ".", "isChecked", "(", ")", ":", "text", "=", "self", ".", "search_text", ".", "currentText", "(", ")", "words", "=", "self", ...
Highlight found results
[ "Highlight", "found", "results" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L373-L380
train
spyder-ide/spyder
spyder/widgets/findreplace.py
FindReplace.find
def find(self, changed=True, forward=True, rehighlight=True, start_highlight_timer=False, multiline_replace_check=True): """Call the find function""" # When several lines are selected in the editor and replace box is activated, # dynamic search is deactivated to prevent changin...
python
def find(self, changed=True, forward=True, rehighlight=True, start_highlight_timer=False, multiline_replace_check=True): """Call the find function""" # When several lines are selected in the editor and replace box is activated, # dynamic search is deactivated to prevent changin...
[ "def", "find", "(", "self", ",", "changed", "=", "True", ",", "forward", "=", "True", ",", "rehighlight", "=", "True", ",", "start_highlight_timer", "=", "False", ",", "multiline_replace_check", "=", "True", ")", ":", "# When several lines are selected in the edit...
Call the find function
[ "Call", "the", "find", "function" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L387-L443
train
spyder-ide/spyder
spyder/widgets/findreplace.py
FindReplace.replace_find
def replace_find(self, focus_replace_text=False, replace_all=False): """Replace and find""" if (self.editor is not None): replace_text = to_text_string(self.replace_text.currentText()) search_text = to_text_string(self.search_text.currentText()) re_pattern = None...
python
def replace_find(self, focus_replace_text=False, replace_all=False): """Replace and find""" if (self.editor is not None): replace_text = to_text_string(self.replace_text.currentText()) search_text = to_text_string(self.search_text.currentText()) re_pattern = None...
[ "def", "replace_find", "(", "self", ",", "focus_replace_text", "=", "False", ",", "replace_all", "=", "False", ")", ":", "if", "(", "self", ".", "editor", "is", "not", "None", ")", ":", "replace_text", "=", "to_text_string", "(", "self", ".", "replace_text...
Replace and find
[ "Replace", "and", "find" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L446-L533
train
spyder-ide/spyder
spyder/widgets/findreplace.py
FindReplace.replace_find_selection
def replace_find_selection(self, focus_replace_text=False): """Replace and find in the current selection""" if self.editor is not None: replace_text = to_text_string(self.replace_text.currentText()) search_text = to_text_string(self.search_text.currentText()) cas...
python
def replace_find_selection(self, focus_replace_text=False): """Replace and find in the current selection""" if self.editor is not None: replace_text = to_text_string(self.replace_text.currentText()) search_text = to_text_string(self.search_text.currentText()) cas...
[ "def", "replace_find_selection", "(", "self", ",", "focus_replace_text", "=", "False", ")", ":", "if", "self", ".", "editor", "is", "not", "None", ":", "replace_text", "=", "to_text_string", "(", "self", ".", "replace_text", ".", "currentText", "(", ")", ")"...
Replace and find in the current selection
[ "Replace", "and", "find", "in", "the", "current", "selection" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L542-L583
train
spyder-ide/spyder
spyder/widgets/findreplace.py
FindReplace.change_number_matches
def change_number_matches(self, current_match=0, total_matches=0): """Change number of match and total matches.""" if current_match and total_matches: matches_string = u"{} {} {}".format(current_match, _(u"of"), total_matches) s...
python
def change_number_matches(self, current_match=0, total_matches=0): """Change number of match and total matches.""" if current_match and total_matches: matches_string = u"{} {} {}".format(current_match, _(u"of"), total_matches) s...
[ "def", "change_number_matches", "(", "self", ",", "current_match", "=", "0", ",", "total_matches", "=", "0", ")", ":", "if", "current_match", "and", "total_matches", ":", "matches_string", "=", "u\"{} {} {}\"", ".", "format", "(", "current_match", ",", "_", "(...
Change number of match and total matches.
[ "Change", "number", "of", "match", "and", "total", "matches", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/findreplace.py#L585-L595
train
spyder-ide/spyder
spyder/utils/introspection/rope_patch.py
apply
def apply(): """Monkey patching rope See [1], [2], [3], [4] and [5] in module docstring.""" from spyder.utils.programs import is_module_installed if is_module_installed('rope', '<0.9.4'): import rope raise ImportError("rope %s can't be patched" % rope.VERSION) # [1] Patchi...
python
def apply(): """Monkey patching rope See [1], [2], [3], [4] and [5] in module docstring.""" from spyder.utils.programs import is_module_installed if is_module_installed('rope', '<0.9.4'): import rope raise ImportError("rope %s can't be patched" % rope.VERSION) # [1] Patchi...
[ "def", "apply", "(", ")", ":", "from", "spyder", ".", "utils", ".", "programs", "import", "is_module_installed", "if", "is_module_installed", "(", "'rope'", ",", "'<0.9.4'", ")", ":", "import", "rope", "raise", "ImportError", "(", "\"rope %s can't be patched\"", ...
Monkey patching rope See [1], [2], [3], [4] and [5] in module docstring.
[ "Monkey", "patching", "rope", "See", "[", "1", "]", "[", "2", "]", "[", "3", "]", "[", "4", "]", "and", "[", "5", "]", "in", "module", "docstring", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/introspection/rope_patch.py#L30-L211
train
spyder-ide/spyder
spyder/plugins/editor/panels/indentationguides.py
IndentationGuide.paintEvent
def paintEvent(self, event): """Override Qt method.""" painter = QPainter(self) color = QColor(self.color) color.setAlphaF(.5) painter.setPen(color) offset = self.editor.document().documentMargin() + \ self.editor.contentOffset().x() for _, line_numb...
python
def paintEvent(self, event): """Override Qt method.""" painter = QPainter(self) color = QColor(self.color) color.setAlphaF(.5) painter.setPen(color) offset = self.editor.document().documentMargin() + \ self.editor.contentOffset().x() for _, line_numb...
[ "def", "paintEvent", "(", "self", ",", "event", ")", ":", "painter", "=", "QPainter", "(", "self", ")", "color", "=", "QColor", "(", "self", ".", "color", ")", "color", ".", "setAlphaF", "(", ".5", ")", "painter", ".", "setPen", "(", "color", ")", ...
Override Qt method.
[ "Override", "Qt", "method", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/panels/indentationguides.py#L32-L80
train
spyder-ide/spyder
spyder/plugins/help/plugin.py
Help.get_plugin_actions
def get_plugin_actions(self): """Return a list of actions related to plugin""" return [self.rich_text_action, self.plain_text_action, self.show_source_action, MENU_SEPARATOR, self.auto_import_action]
python
def get_plugin_actions(self): """Return a list of actions related to plugin""" return [self.rich_text_action, self.plain_text_action, self.show_source_action, MENU_SEPARATOR, self.auto_import_action]
[ "def", "get_plugin_actions", "(", "self", ")", ":", "return", "[", "self", ".", "rich_text_action", ",", "self", ".", "plain_text_action", ",", "self", ".", "show_source_action", ",", "MENU_SEPARATOR", ",", "self", ".", "auto_import_action", "]" ]
Return a list of actions related to plugin
[ "Return", "a", "list", "of", "actions", "related", "to", "plugin" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L212-L216
train
spyder-ide/spyder
spyder/plugins/help/plugin.py
Help.register_plugin
def register_plugin(self): """Register plugin in Spyder's main window""" self.focus_changed.connect(self.main.plugin_focus_changed) self.main.add_dockwidget(self) self.main.console.set_help(self) self.internal_shell = self.main.console.shell self.console = self.ma...
python
def register_plugin(self): """Register plugin in Spyder's main window""" self.focus_changed.connect(self.main.plugin_focus_changed) self.main.add_dockwidget(self) self.main.console.set_help(self) self.internal_shell = self.main.console.shell self.console = self.ma...
[ "def", "register_plugin", "(", "self", ")", ":", "self", ".", "focus_changed", ".", "connect", "(", "self", ".", "main", ".", "plugin_focus_changed", ")", "self", ".", "main", ".", "add_dockwidget", "(", "self", ")", "self", ".", "main", ".", "console", ...
Register plugin in Spyder's main window
[ "Register", "plugin", "in", "Spyder", "s", "main", "window" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L218-L225
train
spyder-ide/spyder
spyder/plugins/help/plugin.py
Help.refresh_plugin
def refresh_plugin(self): """Refresh widget""" if self._starting_up: self._starting_up = False self.switch_to_rich_text() self.show_intro_message()
python
def refresh_plugin(self): """Refresh widget""" if self._starting_up: self._starting_up = False self.switch_to_rich_text() self.show_intro_message()
[ "def", "refresh_plugin", "(", "self", ")", ":", "if", "self", ".", "_starting_up", ":", "self", ".", "_starting_up", "=", "False", "self", ".", "switch_to_rich_text", "(", ")", "self", ".", "show_intro_message", "(", ")" ]
Refresh widget
[ "Refresh", "widget" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L231-L236
train
spyder-ide/spyder
spyder/plugins/help/plugin.py
Help.update_font
def update_font(self): """Update font from Preferences""" color_scheme = self.get_color_scheme() font = self.get_plugin_font() rich_font = self.get_plugin_font(rich_text=True) self.set_plain_text_font(font, color_scheme=color_scheme) self.set_rich_text_font(rich_f...
python
def update_font(self): """Update font from Preferences""" color_scheme = self.get_color_scheme() font = self.get_plugin_font() rich_font = self.get_plugin_font(rich_text=True) self.set_plain_text_font(font, color_scheme=color_scheme) self.set_rich_text_font(rich_f...
[ "def", "update_font", "(", "self", ")", ":", "color_scheme", "=", "self", ".", "get_color_scheme", "(", ")", "font", "=", "self", ".", "get_plugin_font", "(", ")", "rich_font", "=", "self", ".", "get_plugin_font", "(", "rich_text", "=", "True", ")", "self"...
Update font from Preferences
[ "Update", "font", "from", "Preferences" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L238-L245
train
spyder-ide/spyder
spyder/plugins/help/plugin.py
Help.apply_plugin_settings
def apply_plugin_settings(self, options): """Apply configuration file's plugin settings""" color_scheme_n = 'color_scheme_name' color_scheme_o = self.get_color_scheme() connect_n = 'connect_to_oi' wrap_n = 'wrap' wrap_o = self.get_option(wrap_n) self.wrap_a...
python
def apply_plugin_settings(self, options): """Apply configuration file's plugin settings""" color_scheme_n = 'color_scheme_name' color_scheme_o = self.get_color_scheme() connect_n = 'connect_to_oi' wrap_n = 'wrap' wrap_o = self.get_option(wrap_n) self.wrap_a...
[ "def", "apply_plugin_settings", "(", "self", ",", "options", ")", ":", "color_scheme_n", "=", "'color_scheme_name'", "color_scheme_o", "=", "self", ".", "get_color_scheme", "(", ")", "connect_n", "=", "'connect_to_oi'", "wrap_n", "=", "'wrap'", "wrap_o", "=", "sel...
Apply configuration file's plugin settings
[ "Apply", "configuration", "file", "s", "plugin", "settings" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L247-L267
train
spyder-ide/spyder
spyder/plugins/help/plugin.py
Help.set_rich_text_font
def set_rich_text_font(self, font): """Set rich text mode font""" self.rich_text.set_font(font, fixed_font=self.get_plugin_font())
python
def set_rich_text_font(self, font): """Set rich text mode font""" self.rich_text.set_font(font, fixed_font=self.get_plugin_font())
[ "def", "set_rich_text_font", "(", "self", ",", "font", ")", ":", "self", ".", "rich_text", ".", "set_font", "(", "font", ",", "fixed_font", "=", "self", ".", "get_plugin_font", "(", ")", ")" ]
Set rich text mode font
[ "Set", "rich", "text", "mode", "font" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L328-L330
train
spyder-ide/spyder
spyder/plugins/help/plugin.py
Help.set_plain_text_font
def set_plain_text_font(self, font, color_scheme=None): """Set plain text mode font""" self.plain_text.set_font(font, color_scheme=color_scheme)
python
def set_plain_text_font(self, font, color_scheme=None): """Set plain text mode font""" self.plain_text.set_font(font, color_scheme=color_scheme)
[ "def", "set_plain_text_font", "(", "self", ",", "font", ",", "color_scheme", "=", "None", ")", ":", "self", ".", "plain_text", ".", "set_font", "(", "font", ",", "color_scheme", "=", "color_scheme", ")" ]
Set plain text mode font
[ "Set", "plain", "text", "mode", "font" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L332-L334
train
spyder-ide/spyder
spyder/plugins/help/plugin.py
Help.toggle_wrap_mode
def toggle_wrap_mode(self, checked): """Toggle wrap mode""" self.plain_text.editor.toggle_wrap_mode(checked) self.set_option('wrap', checked)
python
def toggle_wrap_mode(self, checked): """Toggle wrap mode""" self.plain_text.editor.toggle_wrap_mode(checked) self.set_option('wrap', checked)
[ "def", "toggle_wrap_mode", "(", "self", ",", "checked", ")", ":", "self", ".", "plain_text", ".", "editor", ".", "toggle_wrap_mode", "(", "checked", ")", "self", ".", "set_option", "(", "'wrap'", ",", "checked", ")" ]
Toggle wrap mode
[ "Toggle", "wrap", "mode" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L341-L344
train
spyder-ide/spyder
spyder/plugins/help/plugin.py
Help.switch_to_plain_text
def switch_to_plain_text(self): """Switch to plain text mode""" self.rich_help = False self.plain_text.show() self.rich_text.hide() self.plain_text_action.setChecked(True)
python
def switch_to_plain_text(self): """Switch to plain text mode""" self.rich_help = False self.plain_text.show() self.rich_text.hide() self.plain_text_action.setChecked(True)
[ "def", "switch_to_plain_text", "(", "self", ")", ":", "self", ".", "rich_help", "=", "False", "self", ".", "plain_text", ".", "show", "(", ")", "self", ".", "rich_text", ".", "hide", "(", ")", "self", ".", "plain_text_action", ".", "setChecked", "(", "Tr...
Switch to plain text mode
[ "Switch", "to", "plain", "text", "mode" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L358-L363
train
spyder-ide/spyder
spyder/plugins/help/plugin.py
Help.switch_to_rich_text
def switch_to_rich_text(self): """Switch to rich text mode""" self.rich_help = True self.plain_text.hide() self.rich_text.show() self.rich_text_action.setChecked(True) self.show_source_action.setChecked(False)
python
def switch_to_rich_text(self): """Switch to rich text mode""" self.rich_help = True self.plain_text.hide() self.rich_text.show() self.rich_text_action.setChecked(True) self.show_source_action.setChecked(False)
[ "def", "switch_to_rich_text", "(", "self", ")", ":", "self", ".", "rich_help", "=", "True", "self", ".", "plain_text", ".", "hide", "(", ")", "self", ".", "rich_text", ".", "show", "(", ")", "self", ".", "rich_text_action", ".", "setChecked", "(", "True"...
Switch to rich text mode
[ "Switch", "to", "rich", "text", "mode" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L365-L371
train
spyder-ide/spyder
spyder/plugins/help/plugin.py
Help.set_plain_text
def set_plain_text(self, text, is_code): """Set plain text docs""" # text is coming from utils.dochelpers.getdoc if type(text) is dict: name = text['name'] if name: rst_title = ''.join(['='*len(name), '\n', name, '\n', ...
python
def set_plain_text(self, text, is_code): """Set plain text docs""" # text is coming from utils.dochelpers.getdoc if type(text) is dict: name = text['name'] if name: rst_title = ''.join(['='*len(name), '\n', name, '\n', ...
[ "def", "set_plain_text", "(", "self", ",", "text", ",", "is_code", ")", ":", "# text is coming from utils.dochelpers.getdoc\r", "if", "type", "(", "text", ")", "is", "dict", ":", "name", "=", "text", "[", "'name'", "]", "if", "name", ":", "rst_title", "=", ...
Set plain text docs
[ "Set", "plain", "text", "docs" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L373-L402
train
spyder-ide/spyder
spyder/plugins/help/plugin.py
Help.set_rich_text_html
def set_rich_text_html(self, html_text, base_url): """Set rich text""" self.rich_text.set_html(html_text, base_url) self.save_text([self.rich_text.set_html, html_text, base_url])
python
def set_rich_text_html(self, html_text, base_url): """Set rich text""" self.rich_text.set_html(html_text, base_url) self.save_text([self.rich_text.set_html, html_text, base_url])
[ "def", "set_rich_text_html", "(", "self", ",", "html_text", ",", "base_url", ")", ":", "self", ".", "rich_text", ".", "set_html", "(", "html_text", ",", "base_url", ")", "self", ".", "save_text", "(", "[", "self", ".", "rich_text", ".", "set_html", ",", ...
Set rich text
[ "Set", "rich", "text" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L404-L407
train
spyder-ide/spyder
spyder/plugins/help/plugin.py
Help.show_rich_text
def show_rich_text(self, text, collapse=False, img_path=''): """Show text in rich mode""" self.switch_to_plugin() self.switch_to_rich_text() context = generate_context(collapse=collapse, img_path=img_path, css_path=self.css_path) self.rend...
python
def show_rich_text(self, text, collapse=False, img_path=''): """Show text in rich mode""" self.switch_to_plugin() self.switch_to_rich_text() context = generate_context(collapse=collapse, img_path=img_path, css_path=self.css_path) self.rend...
[ "def", "show_rich_text", "(", "self", ",", "text", ",", "collapse", "=", "False", ",", "img_path", "=", "''", ")", ":", "self", ".", "switch_to_plugin", "(", ")", "self", ".", "switch_to_rich_text", "(", ")", "context", "=", "generate_context", "(", "colla...
Show text in rich mode
[ "Show", "text", "in", "rich", "mode" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L440-L446
train
spyder-ide/spyder
spyder/plugins/help/plugin.py
Help.show_plain_text
def show_plain_text(self, text): """Show text in plain mode""" self.switch_to_plugin() self.switch_to_plain_text() self.set_plain_text(text, is_code=False)
python
def show_plain_text(self, text): """Show text in plain mode""" self.switch_to_plugin() self.switch_to_plain_text() self.set_plain_text(text, is_code=False)
[ "def", "show_plain_text", "(", "self", ",", "text", ")", ":", "self", ".", "switch_to_plugin", "(", ")", "self", ".", "switch_to_plain_text", "(", ")", "self", ".", "set_plain_text", "(", "text", ",", "is_code", "=", "False", ")" ]
Show text in plain mode
[ "Show", "text", "in", "plain", "mode" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L448-L452
train
spyder-ide/spyder
spyder/plugins/help/plugin.py
Help.show_tutorial
def show_tutorial(self): """Show the Spyder tutorial in the Help plugin, opening it if needed""" self.switch_to_plugin() tutorial_path = get_module_source_path('spyder.plugins.help.utils') tutorial = osp.join(tutorial_path, 'tutorial.rst') text = open(tutorial).read() ...
python
def show_tutorial(self): """Show the Spyder tutorial in the Help plugin, opening it if needed""" self.switch_to_plugin() tutorial_path = get_module_source_path('spyder.plugins.help.utils') tutorial = osp.join(tutorial_path, 'tutorial.rst') text = open(tutorial).read() ...
[ "def", "show_tutorial", "(", "self", ")", ":", "self", ".", "switch_to_plugin", "(", ")", "tutorial_path", "=", "get_module_source_path", "(", "'spyder.plugins.help.utils'", ")", "tutorial", "=", "osp", ".", "join", "(", "tutorial_path", ",", "'tutorial.rst'", ")"...
Show the Spyder tutorial in the Help plugin, opening it if needed
[ "Show", "the", "Spyder", "tutorial", "in", "the", "Help", "plugin", "opening", "it", "if", "needed" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L455-L461
train
spyder-ide/spyder
spyder/plugins/help/plugin.py
Help.set_object_text
def set_object_text(self, text, force_refresh=False, ignore_unknown=False): """Set object analyzed by Help""" if (self.locked and not force_refresh): return self.switch_to_console_source() add_to_combo = True if text is None: text = to_text_string...
python
def set_object_text(self, text, force_refresh=False, ignore_unknown=False): """Set object analyzed by Help""" if (self.locked and not force_refresh): return self.switch_to_console_source() add_to_combo = True if text is None: text = to_text_string...
[ "def", "set_object_text", "(", "self", ",", "text", ",", "force_refresh", "=", "False", ",", "ignore_unknown", "=", "False", ")", ":", "if", "(", "self", ".", "locked", "and", "not", "force_refresh", ")", ":", "return", "self", ".", "switch_to_console_source...
Set object analyzed by Help
[ "Set", "object", "analyzed", "by", "Help" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L483-L507
train
spyder-ide/spyder
spyder/plugins/help/plugin.py
Help.set_editor_doc
def set_editor_doc(self, doc, force_refresh=False): """ Use the help plugin to show docstring dictionary computed with introspection plugin from the Editor plugin """ if (self.locked and not force_refresh): return self.switch_to_editor_source() ...
python
def set_editor_doc(self, doc, force_refresh=False): """ Use the help plugin to show docstring dictionary computed with introspection plugin from the Editor plugin """ if (self.locked and not force_refresh): return self.switch_to_editor_source() ...
[ "def", "set_editor_doc", "(", "self", ",", "doc", ",", "force_refresh", "=", "False", ")", ":", "if", "(", "self", ".", "locked", "and", "not", "force_refresh", ")", ":", "return", "self", ".", "switch_to_editor_source", "(", ")", "self", ".", "_last_edito...
Use the help plugin to show docstring dictionary computed with introspection plugin from the Editor plugin
[ "Use", "the", "help", "plugin", "to", "show", "docstring", "dictionary", "computed", "with", "introspection", "plugin", "from", "the", "Editor", "plugin" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L509-L529
train
spyder-ide/spyder
spyder/plugins/help/plugin.py
Help.load_history
def load_history(self, obj=None): """Load history from a text file in user home directory""" if osp.isfile(self.LOG_PATH): history = [line.replace('\n', '') for line in open(self.LOG_PATH, 'r').readlines()] else: history = [] return h...
python
def load_history(self, obj=None): """Load history from a text file in user home directory""" if osp.isfile(self.LOG_PATH): history = [line.replace('\n', '') for line in open(self.LOG_PATH, 'r').readlines()] else: history = [] return h...
[ "def", "load_history", "(", "self", ",", "obj", "=", "None", ")", ":", "if", "osp", ".", "isfile", "(", "self", ".", "LOG_PATH", ")", ":", "history", "=", "[", "line", ".", "replace", "(", "'\\n'", ",", "''", ")", "for", "line", "in", "open", "("...
Load history from a text file in user home directory
[ "Load", "history", "from", "a", "text", "file", "in", "user", "home", "directory" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L545-L552
train
spyder-ide/spyder
spyder/plugins/help/plugin.py
Help.save_history
def save_history(self): """Save history to a text file in user home directory""" # Don't fail when saving search history to disk # See issues 8878 and 6864 try: search_history = [to_text_string(self.combo.itemText(index)) for index in range...
python
def save_history(self): """Save history to a text file in user home directory""" # Don't fail when saving search history to disk # See issues 8878 and 6864 try: search_history = [to_text_string(self.combo.itemText(index)) for index in range...
[ "def", "save_history", "(", "self", ")", ":", "# Don't fail when saving search history to disk\r", "# See issues 8878 and 6864\r", "try", ":", "search_history", "=", "[", "to_text_string", "(", "self", ".", "combo", ".", "itemText", "(", "index", ")", ")", "for", "i...
Save history to a text file in user home directory
[ "Save", "history", "to", "a", "text", "file", "in", "user", "home", "directory" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L554-L564
train
spyder-ide/spyder
spyder/plugins/help/plugin.py
Help.toggle_plain_text
def toggle_plain_text(self, checked): """Toggle plain text docstring""" if checked: self.docstring = checked self.switch_to_plain_text() self.force_refresh() self.set_option('rich_mode', not checked)
python
def toggle_plain_text(self, checked): """Toggle plain text docstring""" if checked: self.docstring = checked self.switch_to_plain_text() self.force_refresh() self.set_option('rich_mode', not checked)
[ "def", "toggle_plain_text", "(", "self", ",", "checked", ")", ":", "if", "checked", ":", "self", ".", "docstring", "=", "checked", "self", ".", "switch_to_plain_text", "(", ")", "self", ".", "force_refresh", "(", ")", "self", ".", "set_option", "(", "'rich...
Toggle plain text docstring
[ "Toggle", "plain", "text", "docstring" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L567-L573
train
spyder-ide/spyder
spyder/plugins/help/plugin.py
Help.toggle_show_source
def toggle_show_source(self, checked): """Toggle show source code""" if checked: self.switch_to_plain_text() self.docstring = not checked self.force_refresh() self.set_option('rich_mode', not checked)
python
def toggle_show_source(self, checked): """Toggle show source code""" if checked: self.switch_to_plain_text() self.docstring = not checked self.force_refresh() self.set_option('rich_mode', not checked)
[ "def", "toggle_show_source", "(", "self", ",", "checked", ")", ":", "if", "checked", ":", "self", ".", "switch_to_plain_text", "(", ")", "self", ".", "docstring", "=", "not", "checked", "self", ".", "force_refresh", "(", ")", "self", ".", "set_option", "("...
Toggle show source code
[ "Toggle", "show", "source", "code" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L576-L582
train
spyder-ide/spyder
spyder/plugins/help/plugin.py
Help.toggle_rich_text
def toggle_rich_text(self, checked): """Toggle between sphinxified docstrings or plain ones""" if checked: self.docstring = not checked self.switch_to_rich_text() self.set_option('rich_mode', checked)
python
def toggle_rich_text(self, checked): """Toggle between sphinxified docstrings or plain ones""" if checked: self.docstring = not checked self.switch_to_rich_text() self.set_option('rich_mode', checked)
[ "def", "toggle_rich_text", "(", "self", ",", "checked", ")", ":", "if", "checked", ":", "self", ".", "docstring", "=", "not", "checked", "self", ".", "switch_to_rich_text", "(", ")", "self", ".", "set_option", "(", "'rich_mode'", ",", "checked", ")" ]
Toggle between sphinxified docstrings or plain ones
[ "Toggle", "between", "sphinxified", "docstrings", "or", "plain", "ones" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L585-L590
train
spyder-ide/spyder
spyder/plugins/help/plugin.py
Help.toggle_auto_import
def toggle_auto_import(self, checked): """Toggle automatic import feature""" self.combo.validate_current_text() self.set_option('automatic_import', checked) self.force_refresh()
python
def toggle_auto_import(self, checked): """Toggle automatic import feature""" self.combo.validate_current_text() self.set_option('automatic_import', checked) self.force_refresh()
[ "def", "toggle_auto_import", "(", "self", ",", "checked", ")", ":", "self", ".", "combo", ".", "validate_current_text", "(", ")", "self", ".", "set_option", "(", "'automatic_import'", ",", "checked", ")", "self", ".", "force_refresh", "(", ")" ]
Toggle automatic import feature
[ "Toggle", "automatic", "import", "feature" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L593-L597
train
spyder-ide/spyder
spyder/plugins/help/plugin.py
Help._update_lock_icon
def _update_lock_icon(self): """Update locked state icon""" icon = ima.icon('lock') if self.locked else ima.icon('lock_open') self.locked_button.setIcon(icon) tip = _("Unlock") if self.locked else _("Lock") self.locked_button.setToolTip(tip)
python
def _update_lock_icon(self): """Update locked state icon""" icon = ima.icon('lock') if self.locked else ima.icon('lock_open') self.locked_button.setIcon(icon) tip = _("Unlock") if self.locked else _("Lock") self.locked_button.setToolTip(tip)
[ "def", "_update_lock_icon", "(", "self", ")", ":", "icon", "=", "ima", ".", "icon", "(", "'lock'", ")", "if", "self", ".", "locked", "else", "ima", ".", "icon", "(", "'lock_open'", ")", "self", ".", "locked_button", ".", "setIcon", "(", "icon", ")", ...
Update locked state icon
[ "Update", "locked", "state", "icon" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L608-L613
train
spyder-ide/spyder
spyder/plugins/help/plugin.py
Help.get_shell
def get_shell(self): """ Return shell which is currently bound to Help, or another running shell if it has been terminated """ if (not hasattr(self.shell, 'get_doc') or (hasattr(self.shell, 'is_running') and not self.shell.is_running())): ...
python
def get_shell(self): """ Return shell which is currently bound to Help, or another running shell if it has been terminated """ if (not hasattr(self.shell, 'get_doc') or (hasattr(self.shell, 'is_running') and not self.shell.is_running())): ...
[ "def", "get_shell", "(", "self", ")", ":", "if", "(", "not", "hasattr", "(", "self", ".", "shell", ",", "'get_doc'", ")", "or", "(", "hasattr", "(", "self", ".", "shell", ",", "'is_running'", ")", "and", "not", "self", ".", "shell", ".", "is_running"...
Return shell which is currently bound to Help, or another running shell if it has been terminated
[ "Return", "shell", "which", "is", "currently", "bound", "to", "Help", "or", "another", "running", "shell", "if", "it", "has", "been", "terminated" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L619-L634
train