id int32 0 252k | repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 |
|---|---|---|---|---|---|---|---|---|---|---|---|
30,600 | spyder-ide/spyder | spyder/plugins/variableexplorer/widgets/importwizard.py | PreviewTable.process_data | def process_data(self, text, colsep=u"\t", rowsep=u"\n",
transpose=False, skiprows=0, comments='#'):
"""Put data into table model"""
data = self._shape_text(text, colsep, rowsep, transpose, skiprows,
comments)
self._model = PreviewTableMo... | python | def process_data(self, text, colsep=u"\t", rowsep=u"\n",
transpose=False, skiprows=0, comments='#'):
"""Put data into table model"""
data = self._shape_text(text, colsep, rowsep, transpose, skiprows,
comments)
self._model = PreviewTableMo... | [
"def",
"process_data",
"(",
"self",
",",
"text",
",",
"colsep",
"=",
"u\"\\t\"",
",",
"rowsep",
"=",
"u\"\\n\"",
",",
"transpose",
"=",
"False",
",",
"skiprows",
"=",
"0",
",",
"comments",
"=",
"'#'",
")",
":",
"data",
"=",
"self",
".",
"_shape_text",
... | Put data into table model | [
"Put",
"data",
"into",
"table",
"model"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/importwizard.py#L407-L413 |
30,601 | spyder-ide/spyder | spyder/plugins/variableexplorer/widgets/importwizard.py | PreviewTable.parse_to_type | def parse_to_type(self,**kwargs):
"""Parse to a given type"""
indexes = self.selectedIndexes()
if not indexes: return
for index in indexes:
self.model().parse_data_type(index, **kwargs) | python | def parse_to_type(self,**kwargs):
"""Parse to a given type"""
indexes = self.selectedIndexes()
if not indexes: return
for index in indexes:
self.model().parse_data_type(index, **kwargs) | [
"def",
"parse_to_type",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"indexes",
"=",
"self",
".",
"selectedIndexes",
"(",
")",
"if",
"not",
"indexes",
":",
"return",
"for",
"index",
"in",
"indexes",
":",
"self",
".",
"model",
"(",
")",
".",
"parse... | Parse to a given type | [
"Parse",
"to",
"a",
"given",
"type"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/importwizard.py#L416-L421 |
30,602 | spyder-ide/spyder | spyder/plugins/variableexplorer/widgets/importwizard.py | PreviewWidget.open_data | def open_data(self, text, colsep=u"\t", rowsep=u"\n",
transpose=False, skiprows=0, comments='#'):
"""Open clipboard text as table"""
if pd:
self.pd_text = text
self.pd_info = dict(sep=colsep, lineterminator=rowsep,
skiprows=skiprows, commen... | python | def open_data(self, text, colsep=u"\t", rowsep=u"\n",
transpose=False, skiprows=0, comments='#'):
"""Open clipboard text as table"""
if pd:
self.pd_text = text
self.pd_info = dict(sep=colsep, lineterminator=rowsep,
skiprows=skiprows, commen... | [
"def",
"open_data",
"(",
"self",
",",
"text",
",",
"colsep",
"=",
"u\"\\t\"",
",",
"rowsep",
"=",
"u\"\\n\"",
",",
"transpose",
"=",
"False",
",",
"skiprows",
"=",
"0",
",",
"comments",
"=",
"'#'",
")",
":",
"if",
"pd",
":",
"self",
".",
"pd_text",
... | Open clipboard text as table | [
"Open",
"clipboard",
"text",
"as",
"table"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/importwizard.py#L467-L478 |
30,603 | spyder-ide/spyder | spyder/plugins/variableexplorer/widgets/importwizard.py | ImportWizard._focus_tab | def _focus_tab(self, tab_idx):
"""Change tab focus"""
for i in range(self.tab_widget.count()):
self.tab_widget.setTabEnabled(i, False)
self.tab_widget.setTabEnabled(tab_idx, True)
self.tab_widget.setCurrentIndex(tab_idx) | python | def _focus_tab(self, tab_idx):
"""Change tab focus"""
for i in range(self.tab_widget.count()):
self.tab_widget.setTabEnabled(i, False)
self.tab_widget.setTabEnabled(tab_idx, True)
self.tab_widget.setCurrentIndex(tab_idx) | [
"def",
"_focus_tab",
"(",
"self",
",",
"tab_idx",
")",
":",
"for",
"i",
"in",
"range",
"(",
"self",
".",
"tab_widget",
".",
"count",
"(",
")",
")",
":",
"self",
".",
"tab_widget",
".",
"setTabEnabled",
"(",
"i",
",",
"False",
")",
"self",
".",
"tab... | Change tab focus | [
"Change",
"tab",
"focus"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/importwizard.py#L558-L563 |
30,604 | spyder-ide/spyder | spyder/plugins/variableexplorer/widgets/importwizard.py | ImportWizard._set_step | def _set_step(self, step):
"""Proceed to a given step"""
new_tab = self.tab_widget.currentIndex() + step
assert new_tab < self.tab_widget.count() and new_tab >= 0
if new_tab == self.tab_widget.count()-1:
try:
self.table_widget.open_data(self._get_plain_t... | python | def _set_step(self, step):
"""Proceed to a given step"""
new_tab = self.tab_widget.currentIndex() + step
assert new_tab < self.tab_widget.count() and new_tab >= 0
if new_tab == self.tab_widget.count()-1:
try:
self.table_widget.open_data(self._get_plain_t... | [
"def",
"_set_step",
"(",
"self",
",",
"step",
")",
":",
"new_tab",
"=",
"self",
".",
"tab_widget",
".",
"currentIndex",
"(",
")",
"+",
"step",
"assert",
"new_tab",
"<",
"self",
".",
"tab_widget",
".",
"count",
"(",
")",
"and",
"new_tab",
">=",
"0",
"... | Proceed to a given step | [
"Proceed",
"to",
"a",
"given",
"step"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/importwizard.py#L565-L591 |
30,605 | spyder-ide/spyder | spyder/plugins/variableexplorer/widgets/importwizard.py | ImportWizard._simplify_shape | def _simplify_shape(self, alist, rec=0):
"""Reduce the alist dimension if needed"""
if rec != 0:
if len(alist) == 1:
return alist[-1]
return alist
if len(alist) == 1:
return self._simplify_shape(alist[-1], 1)
return [self._simpl... | python | def _simplify_shape(self, alist, rec=0):
"""Reduce the alist dimension if needed"""
if rec != 0:
if len(alist) == 1:
return alist[-1]
return alist
if len(alist) == 1:
return self._simplify_shape(alist[-1], 1)
return [self._simpl... | [
"def",
"_simplify_shape",
"(",
"self",
",",
"alist",
",",
"rec",
"=",
"0",
")",
":",
"if",
"rec",
"!=",
"0",
":",
"if",
"len",
"(",
"alist",
")",
"==",
"1",
":",
"return",
"alist",
"[",
"-",
"1",
"]",
"return",
"alist",
"if",
"len",
"(",
"alist... | Reduce the alist dimension if needed | [
"Reduce",
"the",
"alist",
"dimension",
"if",
"needed"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/importwizard.py#L599-L607 |
30,606 | spyder-ide/spyder | spyder/plugins/variableexplorer/widgets/importwizard.py | ImportWizard._get_table_data | def _get_table_data(self):
"""Return clipboard processed as data"""
data = self._simplify_shape(
self.table_widget.get_data())
if self.table_widget.array_btn.isChecked():
return array(data)
elif pd and self.table_widget.df_btn.isChecked():
i... | python | def _get_table_data(self):
"""Return clipboard processed as data"""
data = self._simplify_shape(
self.table_widget.get_data())
if self.table_widget.array_btn.isChecked():
return array(data)
elif pd and self.table_widget.df_btn.isChecked():
i... | [
"def",
"_get_table_data",
"(",
"self",
")",
":",
"data",
"=",
"self",
".",
"_simplify_shape",
"(",
"self",
".",
"table_widget",
".",
"get_data",
"(",
")",
")",
"if",
"self",
".",
"table_widget",
".",
"array_btn",
".",
"isChecked",
"(",
")",
":",
"return"... | Return clipboard processed as data | [
"Return",
"clipboard",
"processed",
"as",
"data"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/importwizard.py#L609-L619 |
30,607 | spyder-ide/spyder | spyder/plugins/variableexplorer/widgets/importwizard.py | ImportWizard.process | def process(self):
"""Process the data from clipboard"""
var_name = self.name_edt.text()
try:
self.var_name = str(var_name)
except UnicodeEncodeError:
self.var_name = to_text_string(var_name)
if self.text_widget.get_as_data():
self.clip... | python | def process(self):
"""Process the data from clipboard"""
var_name = self.name_edt.text()
try:
self.var_name = str(var_name)
except UnicodeEncodeError:
self.var_name = to_text_string(var_name)
if self.text_widget.get_as_data():
self.clip... | [
"def",
"process",
"(",
"self",
")",
":",
"var_name",
"=",
"self",
".",
"name_edt",
".",
"text",
"(",
")",
"try",
":",
"self",
".",
"var_name",
"=",
"str",
"(",
"var_name",
")",
"except",
"UnicodeEncodeError",
":",
"self",
".",
"var_name",
"=",
"to_text... | Process the data from clipboard | [
"Process",
"the",
"data",
"from",
"clipboard"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/importwizard.py#L626-L640 |
30,608 | spyder-ide/spyder | spyder/plugins/ipythonconsole/widgets/debugging.py | DebuggingWidget.set_spyder_breakpoints | def set_spyder_breakpoints(self, force=False):
"""Set Spyder breakpoints into a debugging session"""
if self._reading or force:
breakpoints_dict = CONF.get('run', 'breakpoints', {})
# We need to enclose pickled values in a list to be able to
# send them to the kernel... | python | def set_spyder_breakpoints(self, force=False):
"""Set Spyder breakpoints into a debugging session"""
if self._reading or force:
breakpoints_dict = CONF.get('run', 'breakpoints', {})
# We need to enclose pickled values in a list to be able to
# send them to the kernel... | [
"def",
"set_spyder_breakpoints",
"(",
"self",
",",
"force",
"=",
"False",
")",
":",
"if",
"self",
".",
"_reading",
"or",
"force",
":",
"breakpoints_dict",
"=",
"CONF",
".",
"get",
"(",
"'run'",
",",
"'breakpoints'",
",",
"{",
"}",
")",
"# We need to enclos... | Set Spyder breakpoints into a debugging session | [
"Set",
"Spyder",
"breakpoints",
"into",
"a",
"debugging",
"session"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/widgets/debugging.py#L36-L48 |
30,609 | spyder-ide/spyder | spyder/plugins/ipythonconsole/widgets/debugging.py | DebuggingWidget.dbg_exec_magic | def dbg_exec_magic(self, magic, args=''):
"""Run an IPython magic while debugging."""
code = "!get_ipython().kernel.shell.run_line_magic('{}', '{}')".format(
magic, args)
self.kernel_client.input(code) | python | def dbg_exec_magic(self, magic, args=''):
"""Run an IPython magic while debugging."""
code = "!get_ipython().kernel.shell.run_line_magic('{}', '{}')".format(
magic, args)
self.kernel_client.input(code) | [
"def",
"dbg_exec_magic",
"(",
"self",
",",
"magic",
",",
"args",
"=",
"''",
")",
":",
"code",
"=",
"\"!get_ipython().kernel.shell.run_line_magic('{}', '{}')\"",
".",
"format",
"(",
"magic",
",",
"args",
")",
"self",
".",
"kernel_client",
".",
"input",
"(",
"co... | Run an IPython magic while debugging. | [
"Run",
"an",
"IPython",
"magic",
"while",
"debugging",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/widgets/debugging.py#L50-L54 |
30,610 | spyder-ide/spyder | spyder/plugins/ipythonconsole/widgets/debugging.py | DebuggingWidget.refresh_from_pdb | def refresh_from_pdb(self, pdb_state):
"""
Refresh Variable Explorer and Editor from a Pdb session,
after running any pdb command.
See publish_pdb_state and notify_spyder in spyder_kernels
"""
if 'step' in pdb_state and 'fname' in pdb_state['step']:
fname = p... | python | def refresh_from_pdb(self, pdb_state):
"""
Refresh Variable Explorer and Editor from a Pdb session,
after running any pdb command.
See publish_pdb_state and notify_spyder in spyder_kernels
"""
if 'step' in pdb_state and 'fname' in pdb_state['step']:
fname = p... | [
"def",
"refresh_from_pdb",
"(",
"self",
",",
"pdb_state",
")",
":",
"if",
"'step'",
"in",
"pdb_state",
"and",
"'fname'",
"in",
"pdb_state",
"[",
"'step'",
"]",
":",
"fname",
"=",
"pdb_state",
"[",
"'step'",
"]",
"[",
"'fname'",
"]",
"lineno",
"=",
"pdb_s... | Refresh Variable Explorer and Editor from a Pdb session,
after running any pdb command.
See publish_pdb_state and notify_spyder in spyder_kernels | [
"Refresh",
"Variable",
"Explorer",
"and",
"Editor",
"from",
"a",
"Pdb",
"session",
"after",
"running",
"any",
"pdb",
"command",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/widgets/debugging.py#L56-L74 |
30,611 | spyder-ide/spyder | spyder/plugins/ipythonconsole/widgets/debugging.py | DebuggingWidget._handle_input_request | def _handle_input_request(self, msg):
"""Save history and add a %plot magic."""
if self._hidden:
raise RuntimeError('Request for raw input during hidden execution.')
# Make sure that all output from the SUB channel has been processed
# before entering readline mode.
... | python | def _handle_input_request(self, msg):
"""Save history and add a %plot magic."""
if self._hidden:
raise RuntimeError('Request for raw input during hidden execution.')
# Make sure that all output from the SUB channel has been processed
# before entering readline mode.
... | [
"def",
"_handle_input_request",
"(",
"self",
",",
"msg",
")",
":",
"if",
"self",
".",
"_hidden",
":",
"raise",
"RuntimeError",
"(",
"'Request for raw input during hidden execution.'",
")",
"# Make sure that all output from the SUB channel has been processed",
"# before entering... | Save history and add a %plot magic. | [
"Save",
"history",
"and",
"add",
"a",
"%plot",
"magic",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/widgets/debugging.py#L77-L106 |
30,612 | spyder-ide/spyder | spyder/plugins/variableexplorer/widgets/dataframeeditor.py | global_max | def global_max(col_vals, index):
"""Returns the global maximum and minimum."""
col_vals_without_None = [x for x in col_vals if x is not None]
max_col, min_col = zip(*col_vals_without_None)
return max(max_col), min(min_col) | python | def global_max(col_vals, index):
"""Returns the global maximum and minimum."""
col_vals_without_None = [x for x in col_vals if x is not None]
max_col, min_col = zip(*col_vals_without_None)
return max(max_col), min(min_col) | [
"def",
"global_max",
"(",
"col_vals",
",",
"index",
")",
":",
"col_vals_without_None",
"=",
"[",
"x",
"for",
"x",
"in",
"col_vals",
"if",
"x",
"is",
"not",
"None",
"]",
"max_col",
",",
"min_col",
"=",
"zip",
"(",
"*",
"col_vals_without_None",
")",
"retur... | Returns the global maximum and minimum. | [
"Returns",
"the",
"global",
"maximum",
"and",
"minimum",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L105-L109 |
30,613 | spyder-ide/spyder | spyder/plugins/variableexplorer/widgets/dataframeeditor.py | DataFrameModel.header | def header(self, axis, x, level=0):
"""
Return the values of the labels for the header of columns or rows.
The value corresponds to the header of column or row x in the
given level.
"""
ax = self._axis(axis)
return ax.values[x] if not hasattr(ax, 'levels'... | python | def header(self, axis, x, level=0):
"""
Return the values of the labels for the header of columns or rows.
The value corresponds to the header of column or row x in the
given level.
"""
ax = self._axis(axis)
return ax.values[x] if not hasattr(ax, 'levels'... | [
"def",
"header",
"(",
"self",
",",
"axis",
",",
"x",
",",
"level",
"=",
"0",
")",
":",
"ax",
"=",
"self",
".",
"_axis",
"(",
"axis",
")",
"return",
"ax",
".",
"values",
"[",
"x",
"]",
"if",
"not",
"hasattr",
"(",
"ax",
",",
"'levels'",
")",
"... | Return the values of the labels for the header of columns or rows.
The value corresponds to the header of column or row x in the
given level. | [
"Return",
"the",
"values",
"of",
"the",
"labels",
"for",
"the",
"header",
"of",
"columns",
"or",
"rows",
".",
"The",
"value",
"corresponds",
"to",
"the",
"header",
"of",
"column",
"or",
"row",
"x",
"in",
"the",
"given",
"level",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L194-L203 |
30,614 | spyder-ide/spyder | spyder/plugins/variableexplorer/widgets/dataframeeditor.py | DataFrameModel.get_bgcolor | def get_bgcolor(self, index):
"""Background color depending on value."""
column = index.column()
if not self.bgcolor_enabled:
return
value = self.get_value(index.row(), column)
if self.max_min_col[column] is None or isna(value):
color = QColor(BACKG... | python | def get_bgcolor(self, index):
"""Background color depending on value."""
column = index.column()
if not self.bgcolor_enabled:
return
value = self.get_value(index.row(), column)
if self.max_min_col[column] is None or isna(value):
color = QColor(BACKG... | [
"def",
"get_bgcolor",
"(",
"self",
",",
"index",
")",
":",
"column",
"=",
"index",
".",
"column",
"(",
")",
"if",
"not",
"self",
".",
"bgcolor_enabled",
":",
"return",
"value",
"=",
"self",
".",
"get_value",
"(",
"index",
".",
"row",
"(",
")",
",",
... | Background color depending on value. | [
"Background",
"color",
"depending",
"on",
"value",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L269-L295 |
30,615 | spyder-ide/spyder | spyder/plugins/variableexplorer/widgets/dataframeeditor.py | DataFrameModel.get_value | def get_value(self, row, column):
"""Return the value of the DataFrame."""
# To increase the performance iat is used but that requires error
# handling, so fallback uses iloc
try:
value = self.df.iat[row, column]
except OutOfBoundsDatetime:
value = ... | python | def get_value(self, row, column):
"""Return the value of the DataFrame."""
# To increase the performance iat is used but that requires error
# handling, so fallback uses iloc
try:
value = self.df.iat[row, column]
except OutOfBoundsDatetime:
value = ... | [
"def",
"get_value",
"(",
"self",
",",
"row",
",",
"column",
")",
":",
"# To increase the performance iat is used but that requires error\r",
"# handling, so fallback uses iloc\r",
"try",
":",
"value",
"=",
"self",
".",
"df",
".",
"iat",
"[",
"row",
",",
"column",
"]... | Return the value of the DataFrame. | [
"Return",
"the",
"value",
"of",
"the",
"DataFrame",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L297-L307 |
30,616 | spyder-ide/spyder | spyder/plugins/variableexplorer/widgets/dataframeeditor.py | DataFrameView.load_more_data | def load_more_data(self, value, rows=False, columns=False):
"""Load more rows and columns to display."""
try:
if rows and value == self.verticalScrollBar().maximum():
self.model().fetch_more(rows=rows)
self.sig_fetch_more_rows.emit()
if colum... | python | def load_more_data(self, value, rows=False, columns=False):
"""Load more rows and columns to display."""
try:
if rows and value == self.verticalScrollBar().maximum():
self.model().fetch_more(rows=rows)
self.sig_fetch_more_rows.emit()
if colum... | [
"def",
"load_more_data",
"(",
"self",
",",
"value",
",",
"rows",
"=",
"False",
",",
"columns",
"=",
"False",
")",
":",
"try",
":",
"if",
"rows",
"and",
"value",
"==",
"self",
".",
"verticalScrollBar",
"(",
")",
".",
"maximum",
"(",
")",
":",
"self",
... | Load more rows and columns to display. | [
"Load",
"more",
"rows",
"and",
"columns",
"to",
"display",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L524-L537 |
30,617 | spyder-ide/spyder | spyder/plugins/variableexplorer/widgets/dataframeeditor.py | DataFrameView.sortByColumn | def sortByColumn(self, index):
"""Implement a column sort."""
if self.sort_old == [None]:
self.header_class.setSortIndicatorShown(True)
sort_order = self.header_class.sortIndicatorOrder()
self.sig_sort_by_column.emit()
if not self.model().sort(index, sort_order)... | python | def sortByColumn(self, index):
"""Implement a column sort."""
if self.sort_old == [None]:
self.header_class.setSortIndicatorShown(True)
sort_order = self.header_class.sortIndicatorOrder()
self.sig_sort_by_column.emit()
if not self.model().sort(index, sort_order)... | [
"def",
"sortByColumn",
"(",
"self",
",",
"index",
")",
":",
"if",
"self",
".",
"sort_old",
"==",
"[",
"None",
"]",
":",
"self",
".",
"header_class",
".",
"setSortIndicatorShown",
"(",
"True",
")",
"sort_order",
"=",
"self",
".",
"header_class",
".",
"sor... | Implement a column sort. | [
"Implement",
"a",
"column",
"sort",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L539-L552 |
30,618 | spyder-ide/spyder | spyder/plugins/variableexplorer/widgets/dataframeeditor.py | DataFrameView.setup_menu | def setup_menu(self):
"""Setup context menu."""
copy_action = create_action(self, _('Copy'),
shortcut=keybinding('Copy'),
icon=ima.icon('editcopy'),
triggered=self.copy,
... | python | def setup_menu(self):
"""Setup context menu."""
copy_action = create_action(self, _('Copy'),
shortcut=keybinding('Copy'),
icon=ima.icon('editcopy'),
triggered=self.copy,
... | [
"def",
"setup_menu",
"(",
"self",
")",
":",
"copy_action",
"=",
"create_action",
"(",
"self",
",",
"_",
"(",
"'Copy'",
")",
",",
"shortcut",
"=",
"keybinding",
"(",
"'Copy'",
")",
",",
"icon",
"=",
"ima",
".",
"icon",
"(",
"'editcopy'",
")",
",",
"tr... | Setup context menu. | [
"Setup",
"context",
"menu",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L559-L577 |
30,619 | spyder-ide/spyder | spyder/plugins/variableexplorer/widgets/dataframeeditor.py | DataFrameView.change_type | def change_type(self, func):
"""A function that changes types of cells."""
model = self.model()
index_list = self.selectedIndexes()
[model.setData(i, '', change_type=func) for i in index_list] | python | def change_type(self, func):
"""A function that changes types of cells."""
model = self.model()
index_list = self.selectedIndexes()
[model.setData(i, '', change_type=func) for i in index_list] | [
"def",
"change_type",
"(",
"self",
",",
"func",
")",
":",
"model",
"=",
"self",
".",
"model",
"(",
")",
"index_list",
"=",
"self",
".",
"selectedIndexes",
"(",
")",
"[",
"model",
".",
"setData",
"(",
"i",
",",
"''",
",",
"change_type",
"=",
"func",
... | A function that changes types of cells. | [
"A",
"function",
"that",
"changes",
"types",
"of",
"cells",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L579-L583 |
30,620 | spyder-ide/spyder | spyder/plugins/variableexplorer/widgets/dataframeeditor.py | DataFrameHeaderModel.rowCount | def rowCount(self, index=None):
"""Get number of rows in the header."""
if self.axis == 0:
return max(1, self._shape[0])
else:
if self.total_rows <= self.rows_loaded:
return self.total_rows
else:
return self.rows_loaded | python | def rowCount(self, index=None):
"""Get number of rows in the header."""
if self.axis == 0:
return max(1, self._shape[0])
else:
if self.total_rows <= self.rows_loaded:
return self.total_rows
else:
return self.rows_loaded | [
"def",
"rowCount",
"(",
"self",
",",
"index",
"=",
"None",
")",
":",
"if",
"self",
".",
"axis",
"==",
"0",
":",
"return",
"max",
"(",
"1",
",",
"self",
".",
"_shape",
"[",
"0",
"]",
")",
"else",
":",
"if",
"self",
".",
"total_rows",
"<=",
"self... | Get number of rows in the header. | [
"Get",
"number",
"of",
"rows",
"in",
"the",
"header",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L645-L653 |
30,621 | spyder-ide/spyder | spyder/plugins/variableexplorer/widgets/dataframeeditor.py | DataFrameHeaderModel.sort | def sort(self, column, order=Qt.AscendingOrder):
"""Overriding sort method."""
ascending = order == Qt.AscendingOrder
self.model.sort(self.COLUMN_INDEX, order=ascending)
return True | python | def sort(self, column, order=Qt.AscendingOrder):
"""Overriding sort method."""
ascending = order == Qt.AscendingOrder
self.model.sort(self.COLUMN_INDEX, order=ascending)
return True | [
"def",
"sort",
"(",
"self",
",",
"column",
",",
"order",
"=",
"Qt",
".",
"AscendingOrder",
")",
":",
"ascending",
"=",
"order",
"==",
"Qt",
".",
"AscendingOrder",
"self",
".",
"model",
".",
"sort",
"(",
"self",
".",
"COLUMN_INDEX",
",",
"order",
"=",
... | Overriding sort method. | [
"Overriding",
"sort",
"method",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L682-L686 |
30,622 | spyder-ide/spyder | spyder/plugins/variableexplorer/widgets/dataframeeditor.py | DataFrameHeaderModel.headerData | def headerData(self, section, orientation, role):
"""Get the information to put in the header."""
if role == Qt.TextAlignmentRole:
if orientation == Qt.Horizontal:
return Qt.AlignCenter | Qt.AlignBottom
else:
return Qt.AlignRight | Qt.AlignVC... | python | def headerData(self, section, orientation, role):
"""Get the information to put in the header."""
if role == Qt.TextAlignmentRole:
if orientation == Qt.Horizontal:
return Qt.AlignCenter | Qt.AlignBottom
else:
return Qt.AlignRight | Qt.AlignVC... | [
"def",
"headerData",
"(",
"self",
",",
"section",
",",
"orientation",
",",
"role",
")",
":",
"if",
"role",
"==",
"Qt",
".",
"TextAlignmentRole",
":",
"if",
"orientation",
"==",
"Qt",
".",
"Horizontal",
":",
"return",
"Qt",
".",
"AlignCenter",
"|",
"Qt",
... | Get the information to put in the header. | [
"Get",
"the",
"information",
"to",
"put",
"in",
"the",
"header",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L688-L712 |
30,623 | spyder-ide/spyder | spyder/plugins/variableexplorer/widgets/dataframeeditor.py | DataFrameHeaderModel.data | def data(self, index, role):
"""
Get the data for the header.
This is used when a header has levels.
"""
if not index.isValid() or \
index.row() >= self._shape[0] or \
index.column() >= self._shape[1]:
return None
row, col = ((... | python | def data(self, index, role):
"""
Get the data for the header.
This is used when a header has levels.
"""
if not index.isValid() or \
index.row() >= self._shape[0] or \
index.column() >= self._shape[1]:
return None
row, col = ((... | [
"def",
"data",
"(",
"self",
",",
"index",
",",
"role",
")",
":",
"if",
"not",
"index",
".",
"isValid",
"(",
")",
"or",
"index",
".",
"row",
"(",
")",
">=",
"self",
".",
"_shape",
"[",
"0",
"]",
"or",
"index",
".",
"column",
"(",
")",
">=",
"s... | Get the data for the header.
This is used when a header has levels. | [
"Get",
"the",
"data",
"for",
"the",
"header",
".",
"This",
"is",
"used",
"when",
"a",
"header",
"has",
"levels",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L714-L740 |
30,624 | spyder-ide/spyder | spyder/plugins/variableexplorer/widgets/dataframeeditor.py | DataFrameLevelModel.headerData | def headerData(self, section, orientation, role):
"""
Get the text to put in the header of the levels of the indexes.
By default it returns 'Index i', where i is the section in the index
"""
if role == Qt.TextAlignmentRole:
if orientation == Qt.Horizontal:
... | python | def headerData(self, section, orientation, role):
"""
Get the text to put in the header of the levels of the indexes.
By default it returns 'Index i', where i is the section in the index
"""
if role == Qt.TextAlignmentRole:
if orientation == Qt.Horizontal:
... | [
"def",
"headerData",
"(",
"self",
",",
"section",
",",
"orientation",
",",
"role",
")",
":",
"if",
"role",
"==",
"Qt",
".",
"TextAlignmentRole",
":",
"if",
"orientation",
"==",
"Qt",
".",
"Horizontal",
":",
"return",
"Qt",
".",
"AlignCenter",
"|",
"Qt",
... | Get the text to put in the header of the levels of the indexes.
By default it returns 'Index i', where i is the section in the index | [
"Get",
"the",
"text",
"to",
"put",
"in",
"the",
"header",
"of",
"the",
"levels",
"of",
"the",
"indexes",
".",
"By",
"default",
"it",
"returns",
"Index",
"i",
"where",
"i",
"is",
"the",
"section",
"in",
"the",
"index"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L776-L797 |
30,625 | spyder-ide/spyder | spyder/plugins/variableexplorer/widgets/dataframeeditor.py | DataFrameLevelModel.data | def data(self, index, role):
"""Get the information of the levels."""
if not index.isValid():
return None
if role == Qt.FontRole:
return self._font
label = ''
if index.column() == self.model.header_shape[1] - 1:
label = str(self.model.n... | python | def data(self, index, role):
"""Get the information of the levels."""
if not index.isValid():
return None
if role == Qt.FontRole:
return self._font
label = ''
if index.column() == self.model.header_shape[1] - 1:
label = str(self.model.n... | [
"def",
"data",
"(",
"self",
",",
"index",
",",
"role",
")",
":",
"if",
"not",
"index",
".",
"isValid",
"(",
")",
":",
"return",
"None",
"if",
"role",
"==",
"Qt",
".",
"FontRole",
":",
"return",
"self",
".",
"_font",
"label",
"=",
"''",
"if",
"ind... | Get the information of the levels. | [
"Get",
"the",
"information",
"of",
"the",
"levels",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/widgets/dataframeeditor.py#L799-L818 |
30,626 | 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 |
30,627 | 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 |
30,628 | 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 |
30,629 | 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 |
30,630 | 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 |
30,631 | 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 |
30,632 | 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 |
30,633 | 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 |
30,634 | 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 |
30,635 | 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 |
30,636 | 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 |
30,637 | 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 |
30,638 | 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 |
30,639 | 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 |
30,640 | 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 |
30,641 | 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 |
30,642 | 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 |
30,643 | 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 |
30,644 | 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 |
30,645 | 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 |
30,646 | 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 |
30,647 | 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 |
30,648 | 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 |
30,649 | 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 |
30,650 | 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 |
30,651 | 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 |
30,652 | 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 |
30,653 | 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 |
30,654 | 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 |
30,655 | 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 |
30,656 | 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 |
30,657 | 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 |
30,658 | 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 |
30,659 | 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 |
30,660 | 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 |
30,661 | 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 |
30,662 | 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 |
30,663 | 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 |
30,664 | 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 |
30,665 | 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 |
30,666 | 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 |
30,667 | 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 |
30,668 | 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 |
30,669 | 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 |
30,670 | 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 |
30,671 | 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 |
30,672 | 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 |
30,673 | 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 |
30,674 | 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 |
30,675 | 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 |
30,676 | 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 |
30,677 | 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 |
30,678 | 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 |
30,679 | 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 |
30,680 | 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 |
30,681 | 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 |
30,682 | 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 |
30,683 | 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 |
30,684 | 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 |
30,685 | 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 |
30,686 | 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 |
30,687 | 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 |
30,688 | spyder-ide/spyder | spyder/plugins/help/plugin.py | Help.render_sphinx_doc | def render_sphinx_doc(self, doc, context=None, css_path=CSS_PATH):
"""Transform doc string dictionary to HTML and show it"""
# Math rendering option could have changed
if self.main.editor is not None:
fname = self.main.editor.get_current_filename()
dname = osp.dirnam... | python | def render_sphinx_doc(self, doc, context=None, css_path=CSS_PATH):
"""Transform doc string dictionary to HTML and show it"""
# Math rendering option could have changed
if self.main.editor is not None:
fname = self.main.editor.get_current_filename()
dname = osp.dirnam... | [
"def",
"render_sphinx_doc",
"(",
"self",
",",
"doc",
",",
"context",
"=",
"None",
",",
"css_path",
"=",
"CSS_PATH",
")",
":",
"# Math rendering option could have changed\r",
"if",
"self",
".",
"main",
".",
"editor",
"is",
"not",
"None",
":",
"fname",
"=",
"s... | Transform doc string dictionary to HTML and show it | [
"Transform",
"doc",
"string",
"dictionary",
"to",
"HTML",
"and",
"show",
"it"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L636-L645 |
30,689 | spyder-ide/spyder | spyder/plugins/help/plugin.py | Help._on_sphinx_thread_html_ready | def _on_sphinx_thread_html_ready(self, html_text):
"""Set our sphinx documentation based on thread result"""
self._sphinx_thread.wait()
self.set_rich_text_html(html_text, QUrl.fromLocalFile(self.css_path)) | python | def _on_sphinx_thread_html_ready(self, html_text):
"""Set our sphinx documentation based on thread result"""
self._sphinx_thread.wait()
self.set_rich_text_html(html_text, QUrl.fromLocalFile(self.css_path)) | [
"def",
"_on_sphinx_thread_html_ready",
"(",
"self",
",",
"html_text",
")",
":",
"self",
".",
"_sphinx_thread",
".",
"wait",
"(",
")",
"self",
".",
"set_rich_text_html",
"(",
"html_text",
",",
"QUrl",
".",
"fromLocalFile",
"(",
"self",
".",
"css_path",
")",
"... | Set our sphinx documentation based on thread result | [
"Set",
"our",
"sphinx",
"documentation",
"based",
"on",
"thread",
"result"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L647-L650 |
30,690 | spyder-ide/spyder | spyder/plugins/help/plugin.py | Help._on_sphinx_thread_error_msg | def _on_sphinx_thread_error_msg(self, error_msg):
""" Display error message on Sphinx rich text failure"""
self._sphinx_thread.wait()
self.plain_text_action.setChecked(True)
sphinx_ver = programs.get_module_version('sphinx')
QMessageBox.critical(self,
_(... | python | def _on_sphinx_thread_error_msg(self, error_msg):
""" Display error message on Sphinx rich text failure"""
self._sphinx_thread.wait()
self.plain_text_action.setChecked(True)
sphinx_ver = programs.get_module_version('sphinx')
QMessageBox.critical(self,
_(... | [
"def",
"_on_sphinx_thread_error_msg",
"(",
"self",
",",
"error_msg",
")",
":",
"self",
".",
"_sphinx_thread",
".",
"wait",
"(",
")",
"self",
".",
"plain_text_action",
".",
"setChecked",
"(",
"True",
")",
"sphinx_ver",
"=",
"programs",
".",
"get_module_version",
... | Display error message on Sphinx rich text failure | [
"Display",
"error",
"message",
"on",
"Sphinx",
"rich",
"text",
"failure"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/plugin.py#L652-L663 |
30,691 | spyder-ide/spyder | spyder/plugins/editor/api/decoration.py | TextDecoration.contains_cursor | def contains_cursor(self, cursor):
"""
Checks if the textCursor is in the decoration.
:param cursor: The text cursor to test
:type cursor: QtGui.QTextCursor
:returns: True if the cursor is over the selection
"""
start = self.cursor.selectionStart()
end =... | python | def contains_cursor(self, cursor):
"""
Checks if the textCursor is in the decoration.
:param cursor: The text cursor to test
:type cursor: QtGui.QTextCursor
:returns: True if the cursor is over the selection
"""
start = self.cursor.selectionStart()
end =... | [
"def",
"contains_cursor",
"(",
"self",
",",
"cursor",
")",
":",
"start",
"=",
"self",
".",
"cursor",
".",
"selectionStart",
"(",
")",
"end",
"=",
"self",
".",
"cursor",
".",
"selectionEnd",
"(",
")",
"if",
"cursor",
".",
"atBlockEnd",
"(",
")",
":",
... | Checks if the textCursor is in the decoration.
:param cursor: The text cursor to test
:type cursor: QtGui.QTextCursor
:returns: True if the cursor is over the selection | [
"Checks",
"if",
"the",
"textCursor",
"is",
"in",
"the",
"decoration",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/api/decoration.py#L117-L130 |
30,692 | spyder-ide/spyder | spyder/plugins/editor/api/decoration.py | TextDecoration.set_as_underlined | def set_as_underlined(self, color=Qt.blue):
"""
Underlines the text.
:param color: underline color.
"""
self.format.setUnderlineStyle(
QTextCharFormat.SingleUnderline)
self.format.setUnderlineColor(color) | python | def set_as_underlined(self, color=Qt.blue):
"""
Underlines the text.
:param color: underline color.
"""
self.format.setUnderlineStyle(
QTextCharFormat.SingleUnderline)
self.format.setUnderlineColor(color) | [
"def",
"set_as_underlined",
"(",
"self",
",",
"color",
"=",
"Qt",
".",
"blue",
")",
":",
"self",
".",
"format",
".",
"setUnderlineStyle",
"(",
"QTextCharFormat",
".",
"SingleUnderline",
")",
"self",
".",
"format",
".",
"setUnderlineColor",
"(",
"color",
")"
... | Underlines the text.
:param color: underline color. | [
"Underlines",
"the",
"text",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/api/decoration.py#L190-L198 |
30,693 | spyder-ide/spyder | spyder/plugins/editor/api/decoration.py | TextDecoration.set_as_spell_check | def set_as_spell_check(self, color=Qt.blue):
"""
Underlines text as a spellcheck error.
:param color: Underline color
:type color: QtGui.QColor
"""
self.format.setUnderlineStyle(
QTextCharFormat.SpellCheckUnderline)
self.format.setUnderlineColor(color... | python | def set_as_spell_check(self, color=Qt.blue):
"""
Underlines text as a spellcheck error.
:param color: Underline color
:type color: QtGui.QColor
"""
self.format.setUnderlineStyle(
QTextCharFormat.SpellCheckUnderline)
self.format.setUnderlineColor(color... | [
"def",
"set_as_spell_check",
"(",
"self",
",",
"color",
"=",
"Qt",
".",
"blue",
")",
":",
"self",
".",
"format",
".",
"setUnderlineStyle",
"(",
"QTextCharFormat",
".",
"SpellCheckUnderline",
")",
"self",
".",
"format",
".",
"setUnderlineColor",
"(",
"color",
... | Underlines text as a spellcheck error.
:param color: Underline color
:type color: QtGui.QColor | [
"Underlines",
"text",
"as",
"a",
"spellcheck",
"error",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/api/decoration.py#L200-L209 |
30,694 | spyder-ide/spyder | spyder/plugins/editor/api/decoration.py | TextDecoration.set_as_error | def set_as_error(self, color=Qt.red):
"""
Highlights text as a syntax error.
:param color: Underline color
:type color: QtGui.QColor
"""
self.format.setUnderlineStyle(
QTextCharFormat.WaveUnderline)
self.format.setUnderlineColor(color) | python | def set_as_error(self, color=Qt.red):
"""
Highlights text as a syntax error.
:param color: Underline color
:type color: QtGui.QColor
"""
self.format.setUnderlineStyle(
QTextCharFormat.WaveUnderline)
self.format.setUnderlineColor(color) | [
"def",
"set_as_error",
"(",
"self",
",",
"color",
"=",
"Qt",
".",
"red",
")",
":",
"self",
".",
"format",
".",
"setUnderlineStyle",
"(",
"QTextCharFormat",
".",
"WaveUnderline",
")",
"self",
".",
"format",
".",
"setUnderlineColor",
"(",
"color",
")"
] | Highlights text as a syntax error.
:param color: Underline color
:type color: QtGui.QColor | [
"Highlights",
"text",
"as",
"a",
"syntax",
"error",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/api/decoration.py#L211-L220 |
30,695 | spyder-ide/spyder | spyder/plugins/editor/api/decoration.py | TextDecoration.set_as_warning | def set_as_warning(self, color=QColor("orange")):
"""
Highlights text as a syntax warning.
:param color: Underline color
:type color: QtGui.QColor
"""
self.format.setUnderlineStyle(
QTextCharFormat.WaveUnderline)
self.format.setUnderlineColor(color) | python | def set_as_warning(self, color=QColor("orange")):
"""
Highlights text as a syntax warning.
:param color: Underline color
:type color: QtGui.QColor
"""
self.format.setUnderlineStyle(
QTextCharFormat.WaveUnderline)
self.format.setUnderlineColor(color) | [
"def",
"set_as_warning",
"(",
"self",
",",
"color",
"=",
"QColor",
"(",
"\"orange\"",
")",
")",
":",
"self",
".",
"format",
".",
"setUnderlineStyle",
"(",
"QTextCharFormat",
".",
"WaveUnderline",
")",
"self",
".",
"format",
".",
"setUnderlineColor",
"(",
"co... | Highlights text as a syntax warning.
:param color: Underline color
:type color: QtGui.QColor | [
"Highlights",
"text",
"as",
"a",
"syntax",
"warning",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/api/decoration.py#L222-L231 |
30,696 | spyder-ide/spyder | spyder/plugins/editor/widgets/editor.py | ThreadManager.close_threads | def close_threads(self, parent):
"""Close threads associated to parent_id"""
logger.debug("Call ThreadManager's 'close_threads'")
if parent is None:
# Closing all threads
self.pending_threads = []
threadlist = []
for threads in list(self.sta... | python | def close_threads(self, parent):
"""Close threads associated to parent_id"""
logger.debug("Call ThreadManager's 'close_threads'")
if parent is None:
# Closing all threads
self.pending_threads = []
threadlist = []
for threads in list(self.sta... | [
"def",
"close_threads",
"(",
"self",
",",
"parent",
")",
":",
"logger",
".",
"debug",
"(",
"\"Call ThreadManager's 'close_threads'\"",
")",
"if",
"parent",
"is",
"None",
":",
"# Closing all threads\r",
"self",
".",
"pending_threads",
"=",
"[",
"]",
"threadlist",
... | Close threads associated to parent_id | [
"Close",
"threads",
"associated",
"to",
"parent_id"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/widgets/editor.py#L93-L112 |
30,697 | spyder-ide/spyder | spyder/plugins/editor/widgets/editor.py | ThreadManager.add_thread | def add_thread(self, checker, end_callback, source_code, parent):
"""Add thread to queue"""
parent_id = id(parent)
thread = AnalysisThread(self, checker, source_code)
self.end_callbacks[id(thread)] = end_callback
self.pending_threads.append((thread, parent_id))
logg... | python | def add_thread(self, checker, end_callback, source_code, parent):
"""Add thread to queue"""
parent_id = id(parent)
thread = AnalysisThread(self, checker, source_code)
self.end_callbacks[id(thread)] = end_callback
self.pending_threads.append((thread, parent_id))
logg... | [
"def",
"add_thread",
"(",
"self",
",",
"checker",
",",
"end_callback",
",",
"source_code",
",",
"parent",
")",
":",
"parent_id",
"=",
"id",
"(",
"parent",
")",
"thread",
"=",
"AnalysisThread",
"(",
"self",
",",
"checker",
",",
"source_code",
")",
"self",
... | Add thread to queue | [
"Add",
"thread",
"to",
"queue"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/widgets/editor.py#L119-L126 |
30,698 | spyder-ide/spyder | spyder/plugins/editor/widgets/editor.py | FileInfo.text_changed | def text_changed(self):
"""Editor's text has changed"""
self.default = False
self.editor.document().changed_since_autosave = True
self.text_changed_at.emit(self.filename,
self.editor.get_position('cursor')) | python | def text_changed(self):
"""Editor's text has changed"""
self.default = False
self.editor.document().changed_since_autosave = True
self.text_changed_at.emit(self.filename,
self.editor.get_position('cursor')) | [
"def",
"text_changed",
"(",
"self",
")",
":",
"self",
".",
"default",
"=",
"False",
"self",
".",
"editor",
".",
"document",
"(",
")",
".",
"changed_since_autosave",
"=",
"True",
"self",
".",
"text_changed_at",
".",
"emit",
"(",
"self",
".",
"filename",
"... | Editor's text has changed | [
"Editor",
"s",
"text",
"has",
"changed"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/widgets/editor.py#L197-L202 |
30,699 | spyder-ide/spyder | spyder/plugins/editor/widgets/editor.py | FileInfo.bookmarks_changed | def bookmarks_changed(self):
"""Bookmarks list has changed."""
bookmarks = self.editor.get_bookmarks()
if self.editor.bookmarks != bookmarks:
self.editor.bookmarks = bookmarks
self.sig_save_bookmarks.emit(self.filename, repr(bookmarks)) | python | def bookmarks_changed(self):
"""Bookmarks list has changed."""
bookmarks = self.editor.get_bookmarks()
if self.editor.bookmarks != bookmarks:
self.editor.bookmarks = bookmarks
self.sig_save_bookmarks.emit(self.filename, repr(bookmarks)) | [
"def",
"bookmarks_changed",
"(",
"self",
")",
":",
"bookmarks",
"=",
"self",
".",
"editor",
".",
"get_bookmarks",
"(",
")",
"if",
"self",
".",
"editor",
".",
"bookmarks",
"!=",
"bookmarks",
":",
"self",
".",
"editor",
".",
"bookmarks",
"=",
"bookmarks",
... | Bookmarks list has changed. | [
"Bookmarks",
"list",
"has",
"changed",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/widgets/editor.py#L229-L234 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.