repo stringlengths 7 54 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 20 28.4k | docstring stringlengths 1 46.3k | docstring_tokens listlengths 1 1.66k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value | summary stringlengths 4 350 | obf_code stringlengths 7.85k 764k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
spyder-ide/spyder | spyder/plugins/profiler/plugin.py | Profiler.register_plugin | def register_plugin(self):
"""Register plugin in Spyder's main window"""
self.profiler.datatree.sig_edit_goto.connect(self.main.editor.load)
self.profiler.redirect_stdio.connect(
self.main.redirect_internalshell_stdio)
self.main.add_dockwidget(self)
profiler_act = cr... | python | def register_plugin(self):
"""Register plugin in Spyder's main window"""
self.profiler.datatree.sig_edit_goto.connect(self.main.editor.load)
self.profiler.redirect_stdio.connect(
self.main.redirect_internalshell_stdio)
self.main.add_dockwidget(self)
profiler_act = cr... | [
"def",
"register_plugin",
"(",
"self",
")",
":",
"self",
".",
"profiler",
".",
"datatree",
".",
"sig_edit_goto",
".",
"connect",
"(",
"self",
".",
"main",
".",
"editor",
".",
"load",
")",
"self",
".",
"profiler",
".",
"redirect_stdio",
".",
"connect",
"(... | Register plugin in Spyder's main window | [
"Register",
"plugin",
"in",
"Spyder",
"s",
"main",
"window"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/profiler/plugin.py#L80-L95 | train | Register plugin in Spyder s main window | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/profiler/plugin.py | Profiler.run_profiler | def run_profiler(self):
"""Run profiler"""
if self.main.editor.save():
self.switch_to_plugin()
self.analyze(self.main.editor.get_current_filename()) | python | def run_profiler(self):
"""Run profiler"""
if self.main.editor.save():
self.switch_to_plugin()
self.analyze(self.main.editor.get_current_filename()) | [
"def",
"run_profiler",
"(",
"self",
")",
":",
"if",
"self",
".",
"main",
".",
"editor",
".",
"save",
"(",
")",
":",
"self",
".",
"switch_to_plugin",
"(",
")",
"self",
".",
"analyze",
"(",
"self",
".",
"main",
".",
"editor",
".",
"get_current_filename",... | Run profiler | [
"Run",
"profiler"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/profiler/plugin.py#L112-L116 | train | Run profiler | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/profiler/plugin.py | Profiler.analyze | def analyze(self, filename):
"""Reimplement analyze method"""
if self.dockwidget and not self.ismaximized:
self.dockwidget.setVisible(True)
self.dockwidget.setFocus()
self.dockwidget.raise_()
pythonpath = self.main.get_spyder_pythonpath()
runconf = get... | python | def analyze(self, filename):
"""Reimplement analyze method"""
if self.dockwidget and not self.ismaximized:
self.dockwidget.setVisible(True)
self.dockwidget.setFocus()
self.dockwidget.raise_()
pythonpath = self.main.get_spyder_pythonpath()
runconf = get... | [
"def",
"analyze",
"(",
"self",
",",
"filename",
")",
":",
"if",
"self",
".",
"dockwidget",
"and",
"not",
"self",
".",
"ismaximized",
":",
"self",
".",
"dockwidget",
".",
"setVisible",
"(",
"True",
")",
"self",
".",
"dockwidget",
".",
"setFocus",
"(",
"... | Reimplement analyze method | [
"Reimplement",
"analyze",
"method"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/profiler/plugin.py#L118-L133 | train | Reimplement analyze method | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/system.py | windows_memory_usage | def windows_memory_usage():
"""Return physical memory usage (float)
Works on Windows platforms only"""
from ctypes import windll, Structure, c_uint64, sizeof, byref
from ctypes.wintypes import DWORD
class MemoryStatus(Structure):
_fields_ = [('dwLength', DWORD),
('... | python | def windows_memory_usage():
"""Return physical memory usage (float)
Works on Windows platforms only"""
from ctypes import windll, Structure, c_uint64, sizeof, byref
from ctypes.wintypes import DWORD
class MemoryStatus(Structure):
_fields_ = [('dwLength', DWORD),
('... | [
"def",
"windows_memory_usage",
"(",
")",
":",
"from",
"ctypes",
"import",
"windll",
",",
"Structure",
",",
"c_uint64",
",",
"sizeof",
",",
"byref",
"from",
"ctypes",
".",
"wintypes",
"import",
"DWORD",
"class",
"MemoryStatus",
"(",
"Structure",
")",
":",
"_f... | Return physical memory usage (float)
Works on Windows platforms only | [
"Return",
"physical",
"memory",
"usage",
"(",
"float",
")",
"Works",
"on",
"Windows",
"platforms",
"only"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/system.py#L22-L43 | train | Returns the physical memory usage of a single page on Windows platforms only | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/system.py | psutil_phymem_usage | def psutil_phymem_usage():
"""
Return physical memory usage (float)
Requires the cross-platform psutil (>=v0.3) library
(https://github.com/giampaolo/psutil)
"""
import psutil
# This is needed to avoid a deprecation warning error with
# newer psutil versions
try:
pe... | python | def psutil_phymem_usage():
"""
Return physical memory usage (float)
Requires the cross-platform psutil (>=v0.3) library
(https://github.com/giampaolo/psutil)
"""
import psutil
# This is needed to avoid a deprecation warning error with
# newer psutil versions
try:
pe... | [
"def",
"psutil_phymem_usage",
"(",
")",
":",
"import",
"psutil",
"# This is needed to avoid a deprecation warning error with\r",
"# newer psutil versions\r",
"try",
":",
"percent",
"=",
"psutil",
".",
"virtual_memory",
"(",
")",
".",
"percent",
"except",
":",
"percent",
... | Return physical memory usage (float)
Requires the cross-platform psutil (>=v0.3) library
(https://github.com/giampaolo/psutil) | [
"Return",
"physical",
"memory",
"usage",
"(",
"float",
")",
"Requires",
"the",
"cross",
"-",
"platform",
"psutil",
"(",
">",
"=",
"v0",
".",
"3",
")",
"library",
"(",
"https",
":",
"//",
"github",
".",
"com",
"/",
"giampaolo",
"/",
"psutil",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/system.py#L45-L58 | train | Returns the physical memory usage of the given object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | drift_color | def drift_color(base_color, factor=110):
"""
Return color that is lighter or darker than the base color.
If base_color.lightness is higher than 128, the returned color is darker
otherwise is is lighter.
:param base_color: The base color to drift from
;:param factor: drift factor (%)
:retur... | python | def drift_color(base_color, factor=110):
"""
Return color that is lighter or darker than the base color.
If base_color.lightness is higher than 128, the returned color is darker
otherwise is is lighter.
:param base_color: The base color to drift from
;:param factor: drift factor (%)
:retur... | [
"def",
"drift_color",
"(",
"base_color",
",",
"factor",
"=",
"110",
")",
":",
"base_color",
"=",
"QColor",
"(",
"base_color",
")",
"if",
"base_color",
".",
"lightness",
"(",
")",
">",
"128",
":",
"return",
"base_color",
".",
"darker",
"(",
"factor",
")",... | Return color that is lighter or darker than the base color.
If base_color.lightness is higher than 128, the returned color is darker
otherwise is is lighter.
:param base_color: The base color to drift from
;:param factor: drift factor (%)
:return A lighter or darker color. | [
"Return",
"color",
"that",
"is",
"lighter",
"or",
"darker",
"than",
"the",
"base",
"color",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L33-L51 | train | Returns a color that is lighter or darker than the base color. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | get_block_symbol_data | def get_block_symbol_data(editor, block):
"""
Gets the list of ParenthesisInfo for specific text block.
:param editor: Code editor instance
:param block: block to parse
"""
def list_symbols(editor, block, character):
"""
Retuns a list of symbols found in the block text
... | python | def get_block_symbol_data(editor, block):
"""
Gets the list of ParenthesisInfo for specific text block.
:param editor: Code editor instance
:param block: block to parse
"""
def list_symbols(editor, block, character):
"""
Retuns a list of symbols found in the block text
... | [
"def",
"get_block_symbol_data",
"(",
"editor",
",",
"block",
")",
":",
"def",
"list_symbols",
"(",
"editor",
",",
"block",
",",
"character",
")",
":",
"\"\"\"\n Retuns a list of symbols found in the block text\n\n :param editor: code editor instance\n :param... | Gets the list of ParenthesisInfo for specific text block.
:param editor: Code editor instance
:param block: block to parse | [
"Gets",
"the",
"list",
"of",
"ParenthesisInfo",
"for",
"specific",
"text",
"block",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L1035-L1076 | train | Gets the list of ParenthesisInfo for specific text block. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | keep_tc_pos | def keep_tc_pos(func):
"""
Cache text cursor position and restore it when the wrapped
function exits.
This decorator can only be used on modes or panels.
:param func: wrapped function
"""
@functools.wraps(func)
def wrapper(editor, *args, **kwds):
""" Decorator """
sb = ... | python | def keep_tc_pos(func):
"""
Cache text cursor position and restore it when the wrapped
function exits.
This decorator can only be used on modes or panels.
:param func: wrapped function
"""
@functools.wraps(func)
def wrapper(editor, *args, **kwds):
""" Decorator """
sb = ... | [
"def",
"keep_tc_pos",
"(",
"func",
")",
":",
"@",
"functools",
".",
"wraps",
"(",
"func",
")",
"def",
"wrapper",
"(",
"editor",
",",
"*",
"args",
",",
"*",
"*",
"kwds",
")",
":",
"\"\"\" Decorator \"\"\"",
"sb",
"=",
"editor",
".",
"verticalScrollBar",
... | Cache text cursor position and restore it when the wrapped
function exits.
This decorator can only be used on modes or panels.
:param func: wrapped function | [
"Cache",
"text",
"cursor",
"position",
"and",
"restore",
"it",
"when",
"the",
"wrapped",
"function",
"exits",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L1079-L1100 | train | Decorator that keeps the text cursor position and restore it when the wrapped function exits. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | with_wait_cursor | def with_wait_cursor(func):
"""
Show a wait cursor while the wrapped function is running. The cursor is
restored as soon as the function exits.
:param func: wrapped function
"""
@functools.wraps(func)
def wrapper(*args, **kwargs):
QApplication.setOverrideCursor(
QCursor(... | python | def with_wait_cursor(func):
"""
Show a wait cursor while the wrapped function is running. The cursor is
restored as soon as the function exits.
:param func: wrapped function
"""
@functools.wraps(func)
def wrapper(*args, **kwargs):
QApplication.setOverrideCursor(
QCursor(... | [
"def",
"with_wait_cursor",
"(",
"func",
")",
":",
"@",
"functools",
".",
"wraps",
"(",
"func",
")",
"def",
"wrapper",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"QApplication",
".",
"setOverrideCursor",
"(",
"QCursor",
"(",
"Qt",
".",
"WaitCu... | Show a wait cursor while the wrapped function is running. The cursor is
restored as soon as the function exits.
:param func: wrapped function | [
"Show",
"a",
"wait",
"cursor",
"while",
"the",
"wrapped",
"function",
"is",
"running",
".",
"The",
"cursor",
"is",
"restored",
"as",
"soon",
"as",
"the",
"function",
"exits",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L1103-L1119 | train | A decorator that adds a wait cursor while the wrapped function is running. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | BlockUserData.is_empty | def is_empty(self):
"""Return whether the block of user data is empty."""
return (not self.breakpoint and not self.code_analysis
and not self.todo and not self.bookmarks) | python | def is_empty(self):
"""Return whether the block of user data is empty."""
return (not self.breakpoint and not self.code_analysis
and not self.todo and not self.bookmarks) | [
"def",
"is_empty",
"(",
"self",
")",
":",
"return",
"(",
"not",
"self",
".",
"breakpoint",
"and",
"not",
"self",
".",
"code_analysis",
"and",
"not",
"self",
".",
"todo",
"and",
"not",
"self",
".",
"bookmarks",
")"
] | Return whether the block of user data is empty. | [
"Return",
"whether",
"the",
"block",
"of",
"user",
"data",
"is",
"empty",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L67-L70 | train | Return whether the block of user data is empty. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | DelayJobRunner.request_job | def request_job(self, job, *args, **kwargs):
"""
Request a job execution.
The job will be executed after the delay specified in the
DelayJobRunner contructor elapsed if no other job is requested until
then.
:param job: job.
:type job: callable
:param arg... | python | def request_job(self, job, *args, **kwargs):
"""
Request a job execution.
The job will be executed after the delay specified in the
DelayJobRunner contructor elapsed if no other job is requested until
then.
:param job: job.
:type job: callable
:param arg... | [
"def",
"request_job",
"(",
"self",
",",
"job",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"cancel_requests",
"(",
")",
"self",
".",
"_job",
"=",
"job",
"self",
".",
"_args",
"=",
"args",
"self",
".",
"_kwargs",
"=",
"kwargs",... | Request a job execution.
The job will be executed after the delay specified in the
DelayJobRunner contructor elapsed if no other job is requested until
then.
:param job: job.
:type job: callable
:param args: job's position arguments
:param kwargs: job's keyworde... | [
"Request",
"a",
"job",
"execution",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L100-L117 | train | Request a job execution. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | DelayJobRunner.cancel_requests | def cancel_requests(self):
"""Cancels pending requests."""
self._timer.stop()
self._job = None
self._args = None
self._kwargs = None | python | def cancel_requests(self):
"""Cancels pending requests."""
self._timer.stop()
self._job = None
self._args = None
self._kwargs = None | [
"def",
"cancel_requests",
"(",
"self",
")",
":",
"self",
".",
"_timer",
".",
"stop",
"(",
")",
"self",
".",
"_job",
"=",
"None",
"self",
".",
"_args",
"=",
"None",
"self",
".",
"_kwargs",
"=",
"None"
] | Cancels pending requests. | [
"Cancels",
"pending",
"requests",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L119-L124 | train | Cancels pending requests. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | DelayJobRunner._exec_requested_job | def _exec_requested_job(self):
"""Execute the requested job after the timer has timeout."""
self._timer.stop()
self._job(*self._args, **self._kwargs) | python | def _exec_requested_job(self):
"""Execute the requested job after the timer has timeout."""
self._timer.stop()
self._job(*self._args, **self._kwargs) | [
"def",
"_exec_requested_job",
"(",
"self",
")",
":",
"self",
".",
"_timer",
".",
"stop",
"(",
")",
"self",
".",
"_job",
"(",
"*",
"self",
".",
"_args",
",",
"*",
"*",
"self",
".",
"_kwargs",
")"
] | Execute the requested job after the timer has timeout. | [
"Execute",
"the",
"requested",
"job",
"after",
"the",
"timer",
"has",
"timeout",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L126-L129 | train | Execute the requested job after the timer has timeout. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | TextHelper.goto_line | def goto_line(self, line, column=0, end_column=0, move=True, word=''):
"""
Moves the text cursor to the specified position.
:param line: Number of the line to go to (0 based)
:param column: Optional column number. Default is 0 (start of line).
:param move: True to move the curso... | python | def goto_line(self, line, column=0, end_column=0, move=True, word=''):
"""
Moves the text cursor to the specified position.
:param line: Number of the line to go to (0 based)
:param column: Optional column number. Default is 0 (start of line).
:param move: True to move the curso... | [
"def",
"goto_line",
"(",
"self",
",",
"line",
",",
"column",
"=",
"0",
",",
"end_column",
"=",
"0",
",",
"move",
"=",
"True",
",",
"word",
"=",
"''",
")",
":",
"line",
"=",
"min",
"(",
"line",
",",
"self",
".",
"line_count",
"(",
")",
")",
"tex... | Moves the text cursor to the specified position.
:param line: Number of the line to go to (0 based)
:param column: Optional column number. Default is 0 (start of line).
:param move: True to move the cursor. False will return the cursor
without setting it on the editor.
... | [
"Moves",
"the",
"text",
"cursor",
"to",
"the",
"specified",
"position",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L154-L186 | train | Moves the text cursor to the specified position. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | TextHelper.unfold_if_colapsed | def unfold_if_colapsed(self, block):
"""Unfold parent fold trigger if the block is collapsed.
:param block: Block to unfold.
"""
try:
folding_panel = self._editor.panels.get('FoldingPanel')
except KeyError:
pass
else:
from spyder.plugi... | python | def unfold_if_colapsed(self, block):
"""Unfold parent fold trigger if the block is collapsed.
:param block: Block to unfold.
"""
try:
folding_panel = self._editor.panels.get('FoldingPanel')
except KeyError:
pass
else:
from spyder.plugi... | [
"def",
"unfold_if_colapsed",
"(",
"self",
",",
"block",
")",
":",
"try",
":",
"folding_panel",
"=",
"self",
".",
"_editor",
".",
"panels",
".",
"get",
"(",
"'FoldingPanel'",
")",
"except",
"KeyError",
":",
"pass",
"else",
":",
"from",
"spyder",
".",
"plu... | Unfold parent fold trigger if the block is collapsed.
:param block: Block to unfold. | [
"Unfold",
"parent",
"fold",
"trigger",
"if",
"the",
"block",
"is",
"collapsed",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L188-L202 | train | Unfold parent fold trigger if the block is collapsed. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | TextHelper.word_under_cursor | def word_under_cursor(self, select_whole_word=False, text_cursor=None):
"""
Gets the word under cursor using the separators defined by
:attr:`spyder.plugins.editor.widgets.codeeditor.CodeEditor.word_separators`.
FIXME: This is not working because CodeEditor have no attribute
wor... | python | def word_under_cursor(self, select_whole_word=False, text_cursor=None):
"""
Gets the word under cursor using the separators defined by
:attr:`spyder.plugins.editor.widgets.codeeditor.CodeEditor.word_separators`.
FIXME: This is not working because CodeEditor have no attribute
wor... | [
"def",
"word_under_cursor",
"(",
"self",
",",
"select_whole_word",
"=",
"False",
",",
"text_cursor",
"=",
"None",
")",
":",
"editor",
"=",
"self",
".",
"_editor",
"if",
"not",
"text_cursor",
":",
"text_cursor",
"=",
"editor",
".",
"textCursor",
"(",
")",
"... | Gets the word under cursor using the separators defined by
:attr:`spyder.plugins.editor.widgets.codeeditor.CodeEditor.word_separators`.
FIXME: This is not working because CodeEditor have no attribute
word_separators
.. note: Instead of returning the word string, this function returns
... | [
"Gets",
"the",
"word",
"under",
"cursor",
"using",
"the",
"separators",
"defined",
"by",
":",
"attr",
":",
"spyder",
".",
"plugins",
".",
"editor",
".",
"widgets",
".",
"codeeditor",
".",
"CodeEditor",
".",
"word_separators",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L208-L265 | train | Gets the word under cursor. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | TextHelper.word_under_mouse_cursor | def word_under_mouse_cursor(self):
"""
Selects the word under the **mouse** cursor.
:return: A QTextCursor with the word under mouse cursor selected.
"""
editor = self._editor
text_cursor = editor.cursorForPosition(editor._last_mouse_pos)
text_cursor = self.word_... | python | def word_under_mouse_cursor(self):
"""
Selects the word under the **mouse** cursor.
:return: A QTextCursor with the word under mouse cursor selected.
"""
editor = self._editor
text_cursor = editor.cursorForPosition(editor._last_mouse_pos)
text_cursor = self.word_... | [
"def",
"word_under_mouse_cursor",
"(",
"self",
")",
":",
"editor",
"=",
"self",
".",
"_editor",
"text_cursor",
"=",
"editor",
".",
"cursorForPosition",
"(",
"editor",
".",
"_last_mouse_pos",
")",
"text_cursor",
"=",
"self",
".",
"word_under_cursor",
"(",
"True",... | Selects the word under the **mouse** cursor.
:return: A QTextCursor with the word under mouse cursor selected. | [
"Selects",
"the",
"word",
"under",
"the",
"**",
"mouse",
"**",
"cursor",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L267-L276 | train | Selects the word under the mouse cursor. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | TextHelper.cursor_position | def cursor_position(self):
"""
Returns the QTextCursor position. The position is a tuple made up of
the line number (0 based) and the column number (0 based).
:return: tuple(line, column)
"""
return (self._editor.textCursor().blockNumber(),
self._editor.t... | python | def cursor_position(self):
"""
Returns the QTextCursor position. The position is a tuple made up of
the line number (0 based) and the column number (0 based).
:return: tuple(line, column)
"""
return (self._editor.textCursor().blockNumber(),
self._editor.t... | [
"def",
"cursor_position",
"(",
"self",
")",
":",
"return",
"(",
"self",
".",
"_editor",
".",
"textCursor",
"(",
")",
".",
"blockNumber",
"(",
")",
",",
"self",
".",
"_editor",
".",
"textCursor",
"(",
")",
".",
"columnNumber",
"(",
")",
")"
] | Returns the QTextCursor position. The position is a tuple made up of
the line number (0 based) and the column number (0 based).
:return: tuple(line, column) | [
"Returns",
"the",
"QTextCursor",
"position",
".",
"The",
"position",
"is",
"a",
"tuple",
"made",
"up",
"of",
"the",
"line",
"number",
"(",
"0",
"based",
")",
"and",
"the",
"column",
"number",
"(",
"0",
"based",
")",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L278-L286 | train | Returns the QTextCursor position. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | TextHelper.line_text | def line_text(self, line_nbr):
"""
Gets the text of the specified line.
:param line_nbr: The line number of the text to get
:return: Entire line's text
:rtype: str
"""
doc = self._editor.document()
block = doc.findBlockByNumber(line_nbr)
return b... | python | def line_text(self, line_nbr):
"""
Gets the text of the specified line.
:param line_nbr: The line number of the text to get
:return: Entire line's text
:rtype: str
"""
doc = self._editor.document()
block = doc.findBlockByNumber(line_nbr)
return b... | [
"def",
"line_text",
"(",
"self",
",",
"line_nbr",
")",
":",
"doc",
"=",
"self",
".",
"_editor",
".",
"document",
"(",
")",
"block",
"=",
"doc",
".",
"findBlockByNumber",
"(",
"line_nbr",
")",
"return",
"block",
".",
"text",
"(",
")"
] | Gets the text of the specified line.
:param line_nbr: The line number of the text to get
:return: Entire line's text
:rtype: str | [
"Gets",
"the",
"text",
"of",
"the",
"specified",
"line",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L312-L323 | train | Gets the text of the specified line. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | TextHelper.set_line_text | def set_line_text(self, line_nbr, new_text):
"""
Replace an entire line with ``new_text``.
:param line_nbr: line number of the line to change.
:param new_text: The replacement text.
"""
editor = self._editor
text_cursor = self._move_cursor_to(line_nbr)
t... | python | def set_line_text(self, line_nbr, new_text):
"""
Replace an entire line with ``new_text``.
:param line_nbr: line number of the line to change.
:param new_text: The replacement text.
"""
editor = self._editor
text_cursor = self._move_cursor_to(line_nbr)
t... | [
"def",
"set_line_text",
"(",
"self",
",",
"line_nbr",
",",
"new_text",
")",
":",
"editor",
"=",
"self",
".",
"_editor",
"text_cursor",
"=",
"self",
".",
"_move_cursor_to",
"(",
"line_nbr",
")",
"text_cursor",
".",
"select",
"(",
"text_cursor",
".",
"LineUnde... | Replace an entire line with ``new_text``.
:param line_nbr: line number of the line to change.
:param new_text: The replacement text. | [
"Replace",
"an",
"entire",
"line",
"with",
"new_text",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L342-L354 | train | Replace an entire line with new_text. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | TextHelper.remove_last_line | def remove_last_line(self):
"""Removes the last line of the document."""
editor = self._editor
text_cursor = editor.textCursor()
text_cursor.movePosition(text_cursor.End, text_cursor.MoveAnchor)
text_cursor.select(text_cursor.LineUnderCursor)
text_cursor.removeSelectedTex... | python | def remove_last_line(self):
"""Removes the last line of the document."""
editor = self._editor
text_cursor = editor.textCursor()
text_cursor.movePosition(text_cursor.End, text_cursor.MoveAnchor)
text_cursor.select(text_cursor.LineUnderCursor)
text_cursor.removeSelectedTex... | [
"def",
"remove_last_line",
"(",
"self",
")",
":",
"editor",
"=",
"self",
".",
"_editor",
"text_cursor",
"=",
"editor",
".",
"textCursor",
"(",
")",
"text_cursor",
".",
"movePosition",
"(",
"text_cursor",
".",
"End",
",",
"text_cursor",
".",
"MoveAnchor",
")"... | Removes the last line of the document. | [
"Removes",
"the",
"last",
"line",
"of",
"the",
"document",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L356-L364 | train | Removes the last line of the document. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | TextHelper.clean_document | def clean_document(self):
"""
Removes trailing whitespaces and ensure one single blank line at the
end of the QTextDocument.
FIXME: It was deprecated in pyqode, maybe It should be deleted
"""
editor = self._editor
value = editor.verticalScrollBar().value()
... | python | def clean_document(self):
"""
Removes trailing whitespaces and ensure one single blank line at the
end of the QTextDocument.
FIXME: It was deprecated in pyqode, maybe It should be deleted
"""
editor = self._editor
value = editor.verticalScrollBar().value()
... | [
"def",
"clean_document",
"(",
"self",
")",
":",
"editor",
"=",
"self",
".",
"_editor",
"value",
"=",
"editor",
".",
"verticalScrollBar",
"(",
")",
".",
"value",
"(",
")",
"pos",
"=",
"self",
".",
"cursor_position",
"(",
")",
"editor",
".",
"textCursor",
... | Removes trailing whitespaces and ensure one single blank line at the
end of the QTextDocument.
FIXME: It was deprecated in pyqode, maybe It should be deleted | [
"Removes",
"trailing",
"whitespaces",
"and",
"ensure",
"one",
"single",
"blank",
"line",
"at",
"the",
"end",
"of",
"the",
"QTextDocument",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L366-L427 | train | Removes trailing whitespaces and ensure one single blank line at the end of the QTextDocument. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | TextHelper.select_whole_line | def select_whole_line(self, line=None, apply_selection=True):
"""
Selects an entire line.
:param line: Line to select. If None, the current line will be selected
:param apply_selection: True to apply selection on the text editor
widget, False to just return the text cursor w... | python | def select_whole_line(self, line=None, apply_selection=True):
"""
Selects an entire line.
:param line: Line to select. If None, the current line will be selected
:param apply_selection: True to apply selection on the text editor
widget, False to just return the text cursor w... | [
"def",
"select_whole_line",
"(",
"self",
",",
"line",
"=",
"None",
",",
"apply_selection",
"=",
"True",
")",
":",
"if",
"line",
"is",
"None",
":",
"line",
"=",
"self",
".",
"current_line_nbr",
"(",
")",
"return",
"self",
".",
"select_lines",
"(",
"line",... | Selects an entire line.
:param line: Line to select. If None, the current line will be selected
:param apply_selection: True to apply selection on the text editor
widget, False to just return the text cursor without setting it
on the editor.
:return: QTextCursor | [
"Selects",
"an",
"entire",
"line",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L429-L441 | train | Selects an entire line. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | TextHelper.selection_range | def selection_range(self):
"""
Returns the selected lines boundaries (start line, end line)
:return: tuple(int, int)
"""
editor = self._editor
doc = editor.document()
start = doc.findBlock(
editor.textCursor().selectionStart()).blockNumber()
e... | python | def selection_range(self):
"""
Returns the selected lines boundaries (start line, end line)
:return: tuple(int, int)
"""
editor = self._editor
doc = editor.document()
start = doc.findBlock(
editor.textCursor().selectionStart()).blockNumber()
e... | [
"def",
"selection_range",
"(",
"self",
")",
":",
"editor",
"=",
"self",
".",
"_editor",
"doc",
"=",
"editor",
".",
"document",
"(",
")",
"start",
"=",
"doc",
".",
"findBlock",
"(",
"editor",
".",
"textCursor",
"(",
")",
".",
"selectionStart",
"(",
")",... | Returns the selected lines boundaries (start line, end line)
:return: tuple(int, int) | [
"Returns",
"the",
"selected",
"lines",
"boundaries",
"(",
"start",
"line",
"end",
"line",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L492-L508 | train | Returns the selected lines boundaries start line end line | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | TextHelper.line_pos_from_number | def line_pos_from_number(self, line_number):
"""
Computes line position on Y-Axis (at the center of the line) from line
number.
:param line_number: The line number for which we want to know the
position in pixels.
:return: The center position of the l... | python | def line_pos_from_number(self, line_number):
"""
Computes line position on Y-Axis (at the center of the line) from line
number.
:param line_number: The line number for which we want to know the
position in pixels.
:return: The center position of the l... | [
"def",
"line_pos_from_number",
"(",
"self",
",",
"line_number",
")",
":",
"editor",
"=",
"self",
".",
"_editor",
"block",
"=",
"editor",
".",
"document",
"(",
")",
".",
"findBlockByNumber",
"(",
"line_number",
")",
"if",
"block",
".",
"isValid",
"(",
")",
... | Computes line position on Y-Axis (at the center of the line) from line
number.
:param line_number: The line number for which we want to know the
position in pixels.
:return: The center position of the line. | [
"Computes",
"line",
"position",
"on",
"Y",
"-",
"Axis",
"(",
"at",
"the",
"center",
"of",
"the",
"line",
")",
"from",
"line",
"number",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L510-L528 | train | Computes the line position on Y - Axis at the center of the line. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | TextHelper.line_nbr_from_position | def line_nbr_from_position(self, y_pos):
"""
Returns the line number from the y_pos.
:param y_pos: Y pos in the editor
:return: Line number (0 based), -1 if out of range
"""
editor = self._editor
height = editor.fontMetrics().height()
for top, line, block... | python | def line_nbr_from_position(self, y_pos):
"""
Returns the line number from the y_pos.
:param y_pos: Y pos in the editor
:return: Line number (0 based), -1 if out of range
"""
editor = self._editor
height = editor.fontMetrics().height()
for top, line, block... | [
"def",
"line_nbr_from_position",
"(",
"self",
",",
"y_pos",
")",
":",
"editor",
"=",
"self",
".",
"_editor",
"height",
"=",
"editor",
".",
"fontMetrics",
"(",
")",
".",
"height",
"(",
")",
"for",
"top",
",",
"line",
",",
"block",
"in",
"editor",
".",
... | Returns the line number from the y_pos.
:param y_pos: Y pos in the editor
:return: Line number (0 based), -1 if out of range | [
"Returns",
"the",
"line",
"number",
"from",
"the",
"y_pos",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L530-L542 | train | Returns the line number from the y_pos. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | TextHelper.mark_whole_doc_dirty | def mark_whole_doc_dirty(self):
"""
Marks the whole document as dirty to force a full refresh. **SLOW**
"""
text_cursor = self._editor.textCursor()
text_cursor.select(text_cursor.Document)
self._editor.document().markContentsDirty(text_cursor.selectionStart(),
... | python | def mark_whole_doc_dirty(self):
"""
Marks the whole document as dirty to force a full refresh. **SLOW**
"""
text_cursor = self._editor.textCursor()
text_cursor.select(text_cursor.Document)
self._editor.document().markContentsDirty(text_cursor.selectionStart(),
... | [
"def",
"mark_whole_doc_dirty",
"(",
"self",
")",
":",
"text_cursor",
"=",
"self",
".",
"_editor",
".",
"textCursor",
"(",
")",
"text_cursor",
".",
"select",
"(",
"text_cursor",
".",
"Document",
")",
"self",
".",
"_editor",
".",
"document",
"(",
")",
".",
... | Marks the whole document as dirty to force a full refresh. **SLOW** | [
"Marks",
"the",
"whole",
"document",
"as",
"dirty",
"to",
"force",
"a",
"full",
"refresh",
".",
"**",
"SLOW",
"**"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L544-L551 | train | Mark the whole document as dirty. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | TextHelper.get_right_character | def get_right_character(self, cursor=None):
"""
Gets the character that is on the right of the text cursor.
:param cursor: QTextCursor that defines the position where the search
will start.
"""
next_char = self.get_right_word(cursor=cursor)
if len(next_char):... | python | def get_right_character(self, cursor=None):
"""
Gets the character that is on the right of the text cursor.
:param cursor: QTextCursor that defines the position where the search
will start.
"""
next_char = self.get_right_word(cursor=cursor)
if len(next_char):... | [
"def",
"get_right_character",
"(",
"self",
",",
"cursor",
"=",
"None",
")",
":",
"next_char",
"=",
"self",
".",
"get_right_word",
"(",
"cursor",
"=",
"cursor",
")",
"if",
"len",
"(",
"next_char",
")",
":",
"next_char",
"=",
"next_char",
"[",
"0",
"]",
... | Gets the character that is on the right of the text cursor.
:param cursor: QTextCursor that defines the position where the search
will start. | [
"Gets",
"the",
"character",
"that",
"is",
"on",
"the",
"right",
"of",
"the",
"text",
"cursor",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L585-L597 | train | Gets the character that is on the right of the text cursor. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | TextHelper.insert_text | def insert_text(self, text, keep_position=True):
"""
Inserts text at the cursor position.
:param text: text to insert
:param keep_position: Flag that specifies if the cursor position must
be kept. Pass False for a regular insert (the cursor will be at
the end of ... | python | def insert_text(self, text, keep_position=True):
"""
Inserts text at the cursor position.
:param text: text to insert
:param keep_position: Flag that specifies if the cursor position must
be kept. Pass False for a regular insert (the cursor will be at
the end of ... | [
"def",
"insert_text",
"(",
"self",
",",
"text",
",",
"keep_position",
"=",
"True",
")",
":",
"text_cursor",
"=",
"self",
".",
"_editor",
".",
"textCursor",
"(",
")",
"if",
"keep_position",
":",
"s",
"=",
"text_cursor",
".",
"selectionStart",
"(",
")",
"e... | Inserts text at the cursor position.
:param text: text to insert
:param keep_position: Flag that specifies if the cursor position must
be kept. Pass False for a regular insert (the cursor will be at
the end of the inserted text). | [
"Inserts",
"text",
"at",
"the",
"cursor",
"position",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L599-L616 | train | Inserts text at the cursor position. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | TextHelper.clear_selection | def clear_selection(self):
"""Clears text cursor selection."""
text_cursor = self._editor.textCursor()
text_cursor.clearSelection()
self._editor.setTextCursor(text_cursor) | python | def clear_selection(self):
"""Clears text cursor selection."""
text_cursor = self._editor.textCursor()
text_cursor.clearSelection()
self._editor.setTextCursor(text_cursor) | [
"def",
"clear_selection",
"(",
"self",
")",
":",
"text_cursor",
"=",
"self",
".",
"_editor",
".",
"textCursor",
"(",
")",
"text_cursor",
".",
"clearSelection",
"(",
")",
"self",
".",
"_editor",
".",
"setTextCursor",
"(",
"text_cursor",
")"
] | Clears text cursor selection. | [
"Clears",
"text",
"cursor",
"selection",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L618-L622 | train | Clears text cursor selection. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | TextHelper.move_right | def move_right(self, keep_anchor=False, nb_chars=1):
"""
Moves the cursor on the right.
:param keep_anchor: True to keep anchor (to select text) or False to
move the anchor (no selection)
:param nb_chars: Number of characters to move.
"""
text_cursor = self._... | python | def move_right(self, keep_anchor=False, nb_chars=1):
"""
Moves the cursor on the right.
:param keep_anchor: True to keep anchor (to select text) or False to
move the anchor (no selection)
:param nb_chars: Number of characters to move.
"""
text_cursor = self._... | [
"def",
"move_right",
"(",
"self",
",",
"keep_anchor",
"=",
"False",
",",
"nb_chars",
"=",
"1",
")",
":",
"text_cursor",
"=",
"self",
".",
"_editor",
".",
"textCursor",
"(",
")",
"text_cursor",
".",
"movePosition",
"(",
"text_cursor",
".",
"Right",
",",
"... | Moves the cursor on the right.
:param keep_anchor: True to keep anchor (to select text) or False to
move the anchor (no selection)
:param nb_chars: Number of characters to move. | [
"Moves",
"the",
"cursor",
"on",
"the",
"right",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L624-L636 | train | Moves the cursor on the right. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | TextHelper.select_extended_word | def select_extended_word(self, continuation_chars=('.',)):
"""
Performs extended word selection. Extended selection consists in
selecting the word under cursor and any other words that are linked
by a ``continuation_chars``.
:param continuation_chars: the list of characters that... | python | def select_extended_word(self, continuation_chars=('.',)):
"""
Performs extended word selection. Extended selection consists in
selecting the word under cursor and any other words that are linked
by a ``continuation_chars``.
:param continuation_chars: the list of characters that... | [
"def",
"select_extended_word",
"(",
"self",
",",
"continuation_chars",
"=",
"(",
"'.'",
",",
")",
")",
":",
"cursor",
"=",
"self",
".",
"_editor",
".",
"textCursor",
"(",
")",
"original_pos",
"=",
"cursor",
".",
"position",
"(",
")",
"start_pos",
"=",
"N... | Performs extended word selection. Extended selection consists in
selecting the word under cursor and any other words that are linked
by a ``continuation_chars``.
:param continuation_chars: the list of characters that may extend a
word. | [
"Performs",
"extended",
"word",
"selection",
".",
"Extended",
"selection",
"consists",
"in",
"selecting",
"the",
"word",
"under",
"cursor",
"and",
"any",
"other",
"words",
"that",
"are",
"linked",
"by",
"a",
"continuation_chars",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L720-L765 | train | Selects the extended word under cursor. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | TextBlockHelper.set_state | def set_state(block, state):
"""
Sets the user state, generally used for syntax highlighting.
:param block: block to modify
:param state: new state value.
:return:
"""
if block is None:
return
user_state = block.userState()
if user_sta... | python | def set_state(block, state):
"""
Sets the user state, generally used for syntax highlighting.
:param block: block to modify
:param state: new state value.
:return:
"""
if block is None:
return
user_state = block.userState()
if user_sta... | [
"def",
"set_state",
"(",
"block",
",",
"state",
")",
":",
"if",
"block",
"is",
"None",
":",
"return",
"user_state",
"=",
"block",
".",
"userState",
"(",
")",
"if",
"user_state",
"==",
"-",
"1",
":",
"user_state",
"=",
"0",
"higher_part",
"=",
"user_sta... | Sets the user state, generally used for syntax highlighting.
:param block: block to modify
:param state: new state value.
:return: | [
"Sets",
"the",
"user",
"state",
"generally",
"used",
"for",
"syntax",
"highlighting",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L905-L921 | train | Sets the state of the user - related entry - set in the block. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | TextBlockHelper.set_fold_lvl | def set_fold_lvl(block, val):
"""
Sets the block fold level.
:param block: block to modify
:param val: The new fold level [0-7]
"""
if block is None:
return
state = block.userState()
if state == -1:
state = 0
if val >= 0x3F... | python | def set_fold_lvl(block, val):
"""
Sets the block fold level.
:param block: block to modify
:param val: The new fold level [0-7]
"""
if block is None:
return
state = block.userState()
if state == -1:
state = 0
if val >= 0x3F... | [
"def",
"set_fold_lvl",
"(",
"block",
",",
"val",
")",
":",
"if",
"block",
"is",
"None",
":",
"return",
"state",
"=",
"block",
".",
"userState",
"(",
")",
"if",
"state",
"==",
"-",
"1",
":",
"state",
"=",
"0",
"if",
"val",
">=",
"0x3FF",
":",
"val... | Sets the block fold level.
:param block: block to modify
:param val: The new fold level [0-7] | [
"Sets",
"the",
"block",
"fold",
"level",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L939-L955 | train | Sets the fold level of the current entry in the block. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | TextBlockHelper.is_fold_trigger | def is_fold_trigger(block):
"""
Checks if the block is a fold trigger.
:param block: block to check
:return: True if the block is a fold trigger (represented as a node in
the fold panel)
"""
if block is None:
return False
state = block.use... | python | def is_fold_trigger(block):
"""
Checks if the block is a fold trigger.
:param block: block to check
:return: True if the block is a fold trigger (represented as a node in
the fold panel)
"""
if block is None:
return False
state = block.use... | [
"def",
"is_fold_trigger",
"(",
"block",
")",
":",
"if",
"block",
"is",
"None",
":",
"return",
"False",
"state",
"=",
"block",
".",
"userState",
"(",
")",
"if",
"state",
"==",
"-",
"1",
":",
"state",
"=",
"0",
"return",
"bool",
"(",
"state",
"&",
"0... | Checks if the block is a fold trigger.
:param block: block to check
:return: True if the block is a fold trigger (represented as a node in
the fold panel) | [
"Checks",
"if",
"the",
"block",
"is",
"a",
"fold",
"trigger",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L958-L971 | train | Checks if the block is a fold trigger. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | TextBlockHelper.set_fold_trigger | def set_fold_trigger(block, val):
"""
Set the block fold trigger flag (True means the block is a fold
trigger).
:param block: block to set
:param val: value to set
"""
if block is None:
return
state = block.userState()
if state == -1:
... | python | def set_fold_trigger(block, val):
"""
Set the block fold trigger flag (True means the block is a fold
trigger).
:param block: block to set
:param val: value to set
"""
if block is None:
return
state = block.userState()
if state == -1:
... | [
"def",
"set_fold_trigger",
"(",
"block",
",",
"val",
")",
":",
"if",
"block",
"is",
"None",
":",
"return",
"state",
"=",
"block",
".",
"userState",
"(",
")",
"if",
"state",
"==",
"-",
"1",
":",
"state",
"=",
"0",
"state",
"&=",
"0x7BFFFFFF",
"state",... | Set the block fold trigger flag (True means the block is a fold
trigger).
:param block: block to set
:param val: value to set | [
"Set",
"the",
"block",
"fold",
"trigger",
"flag",
"(",
"True",
"means",
"the",
"block",
"is",
"a",
"fold",
"trigger",
")",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L974-L989 | train | Sets the fold trigger flag in a log entry block. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | TextBlockHelper.is_collapsed | def is_collapsed(block):
"""
Checks if the block is expanded or collased.
:param block: QTextBlock
:return: False for an open trigger, True for for closed trigger
"""
if block is None:
return False
state = block.userState()
if state == -1:
... | python | def is_collapsed(block):
"""
Checks if the block is expanded or collased.
:param block: QTextBlock
:return: False for an open trigger, True for for closed trigger
"""
if block is None:
return False
state = block.userState()
if state == -1:
... | [
"def",
"is_collapsed",
"(",
"block",
")",
":",
"if",
"block",
"is",
"None",
":",
"return",
"False",
"state",
"=",
"block",
".",
"userState",
"(",
")",
"if",
"state",
"==",
"-",
"1",
":",
"state",
"=",
"0",
"return",
"bool",
"(",
"state",
"&",
"0x08... | Checks if the block is expanded or collased.
:param block: QTextBlock
:return: False for an open trigger, True for for closed trigger | [
"Checks",
"if",
"the",
"block",
"is",
"expanded",
"or",
"collased",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L992-L1004 | train | Checks if the block is expanded or collased. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/utils/editor.py | TextBlockHelper.set_collapsed | def set_collapsed(block, val):
"""
Sets the fold trigger state (collapsed or expanded).
:param block: The block to modify
:param val: The new trigger state (True=collapsed, False=expanded)
"""
if block is None:
return
state = block.userState()
... | python | def set_collapsed(block, val):
"""
Sets the fold trigger state (collapsed or expanded).
:param block: The block to modify
:param val: The new trigger state (True=collapsed, False=expanded)
"""
if block is None:
return
state = block.userState()
... | [
"def",
"set_collapsed",
"(",
"block",
",",
"val",
")",
":",
"if",
"block",
"is",
"None",
":",
"return",
"state",
"=",
"block",
".",
"userState",
"(",
")",
"if",
"state",
"==",
"-",
"1",
":",
"state",
"=",
"0",
"state",
"&=",
"0x77FFFFFF",
"state",
... | Sets the fold trigger state (collapsed or expanded).
:param block: The block to modify
:param val: The new trigger state (True=collapsed, False=expanded) | [
"Sets",
"the",
"fold",
"trigger",
"state",
"(",
"collapsed",
"or",
"expanded",
")",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/editor.py#L1007-L1021 | train | Sets the fold trigger state collapsed or expanded. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/external/binaryornot/helpers.py | get_starting_chunk | def get_starting_chunk(filename, length=1024):
"""
:param filename: File to open and get the first little chunk of.
:param length: Number of bytes to read, default 1024.
:returns: Starting chunk of bytes.
"""
# Ensure we open the file in binary mode
with open(filename, 'rb') as f:
ch... | python | def get_starting_chunk(filename, length=1024):
"""
:param filename: File to open and get the first little chunk of.
:param length: Number of bytes to read, default 1024.
:returns: Starting chunk of bytes.
"""
# Ensure we open the file in binary mode
with open(filename, 'rb') as f:
ch... | [
"def",
"get_starting_chunk",
"(",
"filename",
",",
"length",
"=",
"1024",
")",
":",
"# Ensure we open the file in binary mode",
"with",
"open",
"(",
"filename",
",",
"'rb'",
")",
"as",
"f",
":",
"chunk",
"=",
"f",
".",
"read",
"(",
"length",
")",
"return",
... | :param filename: File to open and get the first little chunk of.
:param length: Number of bytes to read, default 1024.
:returns: Starting chunk of bytes. | [
":",
"param",
"filename",
":",
"File",
"to",
"open",
"and",
"get",
"the",
"first",
"little",
"chunk",
"of",
".",
":",
"param",
"length",
":",
"Number",
"of",
"bytes",
"to",
"read",
"default",
"1024",
".",
":",
"returns",
":",
"Starting",
"chunk",
"of",... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/external/binaryornot/helpers.py#L34-L43 | train | Reads the first little chunk of a file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/external/binaryornot/helpers.py | is_binary_string | def is_binary_string(bytes_to_check):
"""
Uses a simplified version of the Perl detection algorithm,
based roughly on Eli Bendersky's translation to Python:
https://eli.thegreenplace.net/2011/10/19/perls-guess-if-file-is-text-or-binary-implemented-in-python/
This is biased slightly more in favour o... | python | def is_binary_string(bytes_to_check):
"""
Uses a simplified version of the Perl detection algorithm,
based roughly on Eli Bendersky's translation to Python:
https://eli.thegreenplace.net/2011/10/19/perls-guess-if-file-is-text-or-binary-implemented-in-python/
This is biased slightly more in favour o... | [
"def",
"is_binary_string",
"(",
"bytes_to_check",
")",
":",
"# Empty files are considered text files",
"if",
"not",
"bytes_to_check",
":",
"return",
"False",
"# Now check for a high percentage of ASCII control characters",
"# Binary if control chars are > 30% of the string",
"low_chars... | Uses a simplified version of the Perl detection algorithm,
based roughly on Eli Bendersky's translation to Python:
https://eli.thegreenplace.net/2011/10/19/perls-guess-if-file-is-text-or-binary-implemented-in-python/
This is biased slightly more in favour of deeming files as text
files than the Perl al... | [
"Uses",
"a",
"simplified",
"version",
"of",
"the",
"Perl",
"detection",
"algorithm",
"based",
"roughly",
"on",
"Eli",
"Bendersky",
"s",
"translation",
"to",
"Python",
":",
"https",
":",
"//",
"eli",
".",
"thegreenplace",
".",
"net",
"/",
"2011",
"/",
"10",... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/external/binaryornot/helpers.py#L57-L138 | train | Checks if a chunk of bytes is a binary string. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/widgets/status.py | StatusBarWidget.set_value | def set_value(self, value):
"""Set formatted text value."""
self.value = value
if self.isVisible():
self.label_value.setText(value) | python | def set_value(self, value):
"""Set formatted text value."""
self.value = value
if self.isVisible():
self.label_value.setText(value) | [
"def",
"set_value",
"(",
"self",
",",
"value",
")",
":",
"self",
".",
"value",
"=",
"value",
"if",
"self",
".",
"isVisible",
"(",
")",
":",
"self",
".",
"label_value",
".",
"setText",
"(",
"value",
")"
] | Set formatted text value. | [
"Set",
"formatted",
"text",
"value",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/status.py#L74-L78 | train | Set formatted text value. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/widgets/status.py | BaseTimerStatus.setVisible | def setVisible(self, value):
"""Override Qt method to stops timers if widget is not visible."""
if self.timer is not None:
if value:
self.timer.start(self._interval)
else:
self.timer.stop()
super(BaseTimerStatus, self).setVisible(value) | python | def setVisible(self, value):
"""Override Qt method to stops timers if widget is not visible."""
if self.timer is not None:
if value:
self.timer.start(self._interval)
else:
self.timer.stop()
super(BaseTimerStatus, self).setVisible(value) | [
"def",
"setVisible",
"(",
"self",
",",
"value",
")",
":",
"if",
"self",
".",
"timer",
"is",
"not",
"None",
":",
"if",
"value",
":",
"self",
".",
"timer",
".",
"start",
"(",
"self",
".",
"_interval",
")",
"else",
":",
"self",
".",
"timer",
".",
"s... | Override Qt method to stops timers if widget is not visible. | [
"Override",
"Qt",
"method",
"to",
"stops",
"timers",
"if",
"widget",
"is",
"not",
"visible",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/status.py#L102-L109 | train | Override Qt method to starts timers if widget is not visible. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/widgets/status.py | BaseTimerStatus.set_interval | def set_interval(self, interval):
"""Set timer interval (ms)."""
self._interval = interval
if self.timer is not None:
self.timer.setInterval(interval) | python | def set_interval(self, interval):
"""Set timer interval (ms)."""
self._interval = interval
if self.timer is not None:
self.timer.setInterval(interval) | [
"def",
"set_interval",
"(",
"self",
",",
"interval",
")",
":",
"self",
".",
"_interval",
"=",
"interval",
"if",
"self",
".",
"timer",
"is",
"not",
"None",
":",
"self",
".",
"timer",
".",
"setInterval",
"(",
"interval",
")"
] | Set timer interval (ms). | [
"Set",
"timer",
"interval",
"(",
"ms",
")",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/status.py#L111-L115 | train | Set timer interval ( ms ). | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/widgets/status.py | MemoryStatus.get_value | def get_value(self):
"""Return memory usage."""
from spyder.utils.system import memory_usage
text = '%d%%' % memory_usage()
return 'Mem ' + text.rjust(3) | python | def get_value(self):
"""Return memory usage."""
from spyder.utils.system import memory_usage
text = '%d%%' % memory_usage()
return 'Mem ' + text.rjust(3) | [
"def",
"get_value",
"(",
"self",
")",
":",
"from",
"spyder",
".",
"utils",
".",
"system",
"import",
"memory_usage",
"text",
"=",
"'%d%%'",
"%",
"memory_usage",
"(",
")",
"return",
"'Mem '",
"+",
"text",
".",
"rjust",
"(",
"3",
")"
] | Return memory usage. | [
"Return",
"memory",
"usage",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/status.py#L150-L154 | train | Return memory usage. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/help/utils/sphinxify.py | warning | def warning(message, css_path=CSS_PATH):
"""Print a warning message on the rich text view"""
env = Environment()
env.loader = FileSystemLoader(osp.join(CONFDIR_PATH, 'templates'))
warning = env.get_template("warning.html")
return warning.render(css_path=css_path, text=message) | python | def warning(message, css_path=CSS_PATH):
"""Print a warning message on the rich text view"""
env = Environment()
env.loader = FileSystemLoader(osp.join(CONFDIR_PATH, 'templates'))
warning = env.get_template("warning.html")
return warning.render(css_path=css_path, text=message) | [
"def",
"warning",
"(",
"message",
",",
"css_path",
"=",
"CSS_PATH",
")",
":",
"env",
"=",
"Environment",
"(",
")",
"env",
".",
"loader",
"=",
"FileSystemLoader",
"(",
"osp",
".",
"join",
"(",
"CONFDIR_PATH",
",",
"'templates'",
")",
")",
"warning",
"=",
... | Print a warning message on the rich text view | [
"Print",
"a",
"warning",
"message",
"on",
"the",
"rich",
"text",
"view"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/utils/sphinxify.py#L77-L82 | train | Print a warning message on the rich text view | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/help/utils/sphinxify.py | usage | def usage(title, message, tutorial_message, tutorial, css_path=CSS_PATH):
"""Print a usage message on the rich text view"""
env = Environment()
env.loader = FileSystemLoader(osp.join(CONFDIR_PATH, 'templates'))
usage = env.get_template("usage.html")
return usage.render(css_path=css_path, title=title... | python | def usage(title, message, tutorial_message, tutorial, css_path=CSS_PATH):
"""Print a usage message on the rich text view"""
env = Environment()
env.loader = FileSystemLoader(osp.join(CONFDIR_PATH, 'templates'))
usage = env.get_template("usage.html")
return usage.render(css_path=css_path, title=title... | [
"def",
"usage",
"(",
"title",
",",
"message",
",",
"tutorial_message",
",",
"tutorial",
",",
"css_path",
"=",
"CSS_PATH",
")",
":",
"env",
"=",
"Environment",
"(",
")",
"env",
".",
"loader",
"=",
"FileSystemLoader",
"(",
"osp",
".",
"join",
"(",
"CONFDIR... | Print a usage message on the rich text view | [
"Print",
"a",
"usage",
"message",
"on",
"the",
"rich",
"text",
"view"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/utils/sphinxify.py#L85-L91 | train | Print a usage message on the rich text view | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/help/utils/sphinxify.py | generate_context | def generate_context(name='', argspec='', note='', math=False, collapse=False,
img_path='', css_path=CSS_PATH):
"""
Generate the html_context dictionary for our Sphinx conf file.
This is a set of variables to be passed to the Jinja template engine and
that are used to control h... | python | def generate_context(name='', argspec='', note='', math=False, collapse=False,
img_path='', css_path=CSS_PATH):
"""
Generate the html_context dictionary for our Sphinx conf file.
This is a set of variables to be passed to the Jinja template engine and
that are used to control h... | [
"def",
"generate_context",
"(",
"name",
"=",
"''",
",",
"argspec",
"=",
"''",
",",
"note",
"=",
"''",
",",
"math",
"=",
"False",
",",
"collapse",
"=",
"False",
",",
"img_path",
"=",
"''",
",",
"css_path",
"=",
"CSS_PATH",
")",
":",
"if",
"img_path",
... | Generate the html_context dictionary for our Sphinx conf file.
This is a set of variables to be passed to the Jinja template engine and
that are used to control how the webpage is rendered in connection with
Sphinx
Parameters
----------
name : str
Object's name.
note : str
... | [
"Generate",
"the",
"html_context",
"dictionary",
"for",
"our",
"Sphinx",
"conf",
"file",
".",
"This",
"is",
"a",
"set",
"of",
"variables",
"to",
"be",
"passed",
"to",
"the",
"Jinja",
"template",
"engine",
"and",
"that",
"are",
"used",
"to",
"control",
"how... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/utils/sphinxify.py#L94-L146 | train | Generate the html_context dictionary for our Sphinx conf file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/help/utils/sphinxify.py | sphinxify | def sphinxify(docstring, context, buildername='html'):
"""
Runs Sphinx on a docstring and outputs the processed documentation.
Parameters
----------
docstring : str
a ReST-formatted docstring
context : dict
Variables to be passed to the layout template to control how its
... | python | def sphinxify(docstring, context, buildername='html'):
"""
Runs Sphinx on a docstring and outputs the processed documentation.
Parameters
----------
docstring : str
a ReST-formatted docstring
context : dict
Variables to be passed to the layout template to control how its
... | [
"def",
"sphinxify",
"(",
"docstring",
",",
"context",
",",
"buildername",
"=",
"'html'",
")",
":",
"srcdir",
"=",
"mkdtemp",
"(",
")",
"srcdir",
"=",
"encoding",
".",
"to_unicode_from_fs",
"(",
"srcdir",
")",
"destdir",
"=",
"osp",
".",
"join",
"(",
"src... | Runs Sphinx on a docstring and outputs the processed documentation.
Parameters
----------
docstring : str
a ReST-formatted docstring
context : dict
Variables to be passed to the layout template to control how its
rendered (through the Sphinx variable *html_context*).
build... | [
"Runs",
"Sphinx",
"on",
"a",
"docstring",
"and",
"outputs",
"the",
"processed",
"documentation",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/utils/sphinxify.py#L149-L239 | train | Runs Sphinx on a docstring and outputs the processed documentation. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/help/utils/sphinxify.py | generate_configuration | def generate_configuration(directory):
"""
Generates a Sphinx configuration in `directory`.
Parameters
----------
directory : str
Base directory to use
"""
# conf.py file for Sphinx
conf = osp.join(get_module_source_path('spyder.plugins.help.utils'),
'co... | python | def generate_configuration(directory):
"""
Generates a Sphinx configuration in `directory`.
Parameters
----------
directory : str
Base directory to use
"""
# conf.py file for Sphinx
conf = osp.join(get_module_source_path('spyder.plugins.help.utils'),
'co... | [
"def",
"generate_configuration",
"(",
"directory",
")",
":",
"# conf.py file for Sphinx",
"conf",
"=",
"osp",
".",
"join",
"(",
"get_module_source_path",
"(",
"'spyder.plugins.help.utils'",
")",
",",
"'conf.py'",
")",
"# Docstring layout page (in Jinja):",
"layout",
"=",
... | Generates a Sphinx configuration in `directory`.
Parameters
----------
directory : str
Base directory to use | [
"Generates",
"a",
"Sphinx",
"configuration",
"in",
"directory",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/utils/sphinxify.py#L242-L264 | train | Generates a Sphinx configuration in directory. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/widgets/status.py | EOLStatus.update_eol | def update_eol(self, os_name):
"""Update end of line status."""
os_name = to_text_string(os_name)
value = {"nt": "CRLF", "posix": "LF"}.get(os_name, "CR")
self.set_value(value) | python | def update_eol(self, os_name):
"""Update end of line status."""
os_name = to_text_string(os_name)
value = {"nt": "CRLF", "posix": "LF"}.get(os_name, "CR")
self.set_value(value) | [
"def",
"update_eol",
"(",
"self",
",",
"os_name",
")",
":",
"os_name",
"=",
"to_text_string",
"(",
"os_name",
")",
"value",
"=",
"{",
"\"nt\"",
":",
"\"CRLF\"",
",",
"\"posix\"",
":",
"\"LF\"",
"}",
".",
"get",
"(",
"os_name",
",",
"\"CR\"",
")",
"self... | Update end of line status. | [
"Update",
"end",
"of",
"line",
"status",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/widgets/status.py#L34-L38 | train | Update the end of line status. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/widgets/status.py | EncodingStatus.update_encoding | def update_encoding(self, encoding):
"""Update encoding of current file."""
value = str(encoding).upper()
self.set_value(value) | python | def update_encoding(self, encoding):
"""Update encoding of current file."""
value = str(encoding).upper()
self.set_value(value) | [
"def",
"update_encoding",
"(",
"self",
",",
"encoding",
")",
":",
"value",
"=",
"str",
"(",
"encoding",
")",
".",
"upper",
"(",
")",
"self",
".",
"set_value",
"(",
"value",
")"
] | Update encoding of current file. | [
"Update",
"encoding",
"of",
"current",
"file",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/widgets/status.py#L45-L48 | train | Update encoding of current file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/widgets/status.py | CursorPositionStatus.update_cursor_position | def update_cursor_position(self, line, index):
"""Update cursor position."""
value = 'Line {}, Col {}'.format(line + 1, index + 1)
self.set_value(value) | python | def update_cursor_position(self, line, index):
"""Update cursor position."""
value = 'Line {}, Col {}'.format(line + 1, index + 1)
self.set_value(value) | [
"def",
"update_cursor_position",
"(",
"self",
",",
"line",
",",
"index",
")",
":",
"value",
"=",
"'Line {}, Col {}'",
".",
"format",
"(",
"line",
"+",
"1",
",",
"index",
"+",
"1",
")",
"self",
".",
"set_value",
"(",
"value",
")"
] | Update cursor position. | [
"Update",
"cursor",
"position",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/widgets/status.py#L55-L58 | train | Update cursor position. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/widgets/status.py | VCSStatus.update_vcs | def update_vcs(self, fname, index):
"""Update vcs status."""
fpath = os.path.dirname(fname)
branches, branch, files_modified = get_git_refs(fpath)
text = branch if branch else ''
if len(files_modified):
text = text + ' [{}]'.format(len(files_modified))
self.... | python | def update_vcs(self, fname, index):
"""Update vcs status."""
fpath = os.path.dirname(fname)
branches, branch, files_modified = get_git_refs(fpath)
text = branch if branch else ''
if len(files_modified):
text = text + ' [{}]'.format(len(files_modified))
self.... | [
"def",
"update_vcs",
"(",
"self",
",",
"fname",
",",
"index",
")",
":",
"fpath",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"fname",
")",
"branches",
",",
"branch",
",",
"files_modified",
"=",
"get_git_refs",
"(",
"fpath",
")",
"text",
"=",
"branch",... | Update vcs status. | [
"Update",
"vcs",
"status",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/widgets/status.py#L73-L83 | train | Update vcs status. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/variableexplorer/plugin.py | VariableExplorer.get_settings | def get_settings(self):
"""
Retrieve all Variable Explorer configuration settings.
Specifically, return the settings in CONF_SECTION with keys in
REMOTE_SETTINGS, and the setting 'dataframe_format'.
Returns:
dict: settings
"""
... | python | def get_settings(self):
"""
Retrieve all Variable Explorer configuration settings.
Specifically, return the settings in CONF_SECTION with keys in
REMOTE_SETTINGS, and the setting 'dataframe_format'.
Returns:
dict: settings
"""
... | [
"def",
"get_settings",
"(",
"self",
")",
":",
"settings",
"=",
"{",
"}",
"for",
"name",
"in",
"REMOTE_SETTINGS",
":",
"settings",
"[",
"name",
"]",
"=",
"self",
".",
"get_option",
"(",
"name",
")",
"# dataframe_format is stored without percent sign in config\r",
... | Retrieve all Variable Explorer configuration settings.
Specifically, return the settings in CONF_SECTION with keys in
REMOTE_SETTINGS, and the setting 'dataframe_format'.
Returns:
dict: settings | [
"Retrieve",
"all",
"Variable",
"Explorer",
"configuration",
"settings",
".",
"Specifically",
"return",
"the",
"settings",
"in",
"CONF_SECTION",
"with",
"keys",
"in",
"REMOTE_SETTINGS",
"and",
"the",
"setting",
"dataframe_format",
".",
"Returns",
":",
"dict",
":",
... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/plugin.py#L59-L77 | train | Retrieve all Variable Explorer configuration settings. Specifically return the settings in CONF_SECTION with keys in
AttributeNames REMOTE_SETTINGS and the setting dataframe_format. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/variableexplorer/plugin.py | VariableExplorer.change_option | def change_option(self, option_name, new_value):
"""
Change a config option.
This function is called if sig_option_changed is received. If the
option changed is the dataframe format, then the leading '%' character
is stripped (because it can't be stored in the user config)... | python | def change_option(self, option_name, new_value):
"""
Change a config option.
This function is called if sig_option_changed is received. If the
option changed is the dataframe format, then the leading '%' character
is stripped (because it can't be stored in the user config)... | [
"def",
"change_option",
"(",
"self",
",",
"option_name",
",",
"new_value",
")",
":",
"if",
"option_name",
"==",
"'dataframe_format'",
":",
"assert",
"new_value",
".",
"startswith",
"(",
"'%'",
")",
"new_value",
"=",
"new_value",
"[",
"1",
":",
"]",
"self",
... | Change a config option.
This function is called if sig_option_changed is received. If the
option changed is the dataframe format, then the leading '%' character
is stripped (because it can't be stored in the user config). Then,
the signal is emitted again, so that the new value is ... | [
"Change",
"a",
"config",
"option",
".",
"This",
"function",
"is",
"called",
"if",
"sig_option_changed",
"is",
"received",
".",
"If",
"the",
"option",
"changed",
"is",
"the",
"dataframe",
"format",
"then",
"the",
"leading",
"%",
"character",
"is",
"stripped",
... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/plugin.py#L80-L93 | train | Change a config option. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/variableexplorer/plugin.py | VariableExplorer.free_memory | def free_memory(self):
"""Free memory signal."""
self.main.free_memory()
QTimer.singleShot(self.INITIAL_FREE_MEMORY_TIME_TRIGGER,
lambda: self.main.free_memory())
QTimer.singleShot(self.SECONDARY_FREE_MEMORY_TIME_TRIGGER,
lambda: ... | python | def free_memory(self):
"""Free memory signal."""
self.main.free_memory()
QTimer.singleShot(self.INITIAL_FREE_MEMORY_TIME_TRIGGER,
lambda: self.main.free_memory())
QTimer.singleShot(self.SECONDARY_FREE_MEMORY_TIME_TRIGGER,
lambda: ... | [
"def",
"free_memory",
"(",
"self",
")",
":",
"self",
".",
"main",
".",
"free_memory",
"(",
")",
"QTimer",
".",
"singleShot",
"(",
"self",
".",
"INITIAL_FREE_MEMORY_TIME_TRIGGER",
",",
"lambda",
":",
"self",
".",
"main",
".",
"free_memory",
"(",
")",
")",
... | Free memory signal. | [
"Free",
"memory",
"signal",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/plugin.py#L96-L102 | train | Free memory signal. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/variableexplorer/plugin.py | VariableExplorer.add_shellwidget | def add_shellwidget(self, shellwidget):
"""
Register shell with variable explorer.
This function opens a new NamespaceBrowser for browsing the variables
in the shell.
"""
shellwidget_id = id(shellwidget)
if shellwidget_id not in self.shellwidgets:
... | python | def add_shellwidget(self, shellwidget):
"""
Register shell with variable explorer.
This function opens a new NamespaceBrowser for browsing the variables
in the shell.
"""
shellwidget_id = id(shellwidget)
if shellwidget_id not in self.shellwidgets:
... | [
"def",
"add_shellwidget",
"(",
"self",
",",
"shellwidget",
")",
":",
"shellwidget_id",
"=",
"id",
"(",
"shellwidget",
")",
"if",
"shellwidget_id",
"not",
"in",
"self",
".",
"shellwidgets",
":",
"self",
".",
"options_button",
".",
"setVisible",
"(",
"True",
"... | Register shell with variable explorer.
This function opens a new NamespaceBrowser for browsing the variables
in the shell. | [
"Register",
"shell",
"with",
"variable",
"explorer",
".",
"This",
"function",
"opens",
"a",
"new",
"NamespaceBrowser",
"for",
"browsing",
"the",
"variables",
"in",
"the",
"shell",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/plugin.py#L125-L143 | train | Add a new shell with variable explorer. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/variableexplorer/plugin.py | VariableExplorer.import_data | def import_data(self, fname):
"""Import data in current namespace"""
if self.count():
nsb = self.current_widget()
nsb.refresh_table()
nsb.import_data(filenames=fname)
if self.dockwidget and not self.ismaximized:
self.dockwidget.setVi... | python | def import_data(self, fname):
"""Import data in current namespace"""
if self.count():
nsb = self.current_widget()
nsb.refresh_table()
nsb.import_data(filenames=fname)
if self.dockwidget and not self.ismaximized:
self.dockwidget.setVi... | [
"def",
"import_data",
"(",
"self",
",",
"fname",
")",
":",
"if",
"self",
".",
"count",
"(",
")",
":",
"nsb",
"=",
"self",
".",
"current_widget",
"(",
")",
"nsb",
".",
"refresh_table",
"(",
")",
"nsb",
".",
"import_data",
"(",
"filenames",
"=",
"fname... | Import data in current namespace | [
"Import",
"data",
"in",
"current",
"namespace"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/variableexplorer/plugin.py#L158-L166 | train | Import data in current namespace | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/help/widgets.py | ObjectComboBox.is_valid | def is_valid(self, qstr=None):
"""Return True if string is valid"""
if not self.help.source_is_console():
return True
if qstr is None:
qstr = self.currentText()
if not re.search(r'^[a-zA-Z0-9_\.]*$', str(qstr), 0):
return False
objtxt = to_text... | python | def is_valid(self, qstr=None):
"""Return True if string is valid"""
if not self.help.source_is_console():
return True
if qstr is None:
qstr = self.currentText()
if not re.search(r'^[a-zA-Z0-9_\.]*$', str(qstr), 0):
return False
objtxt = to_text... | [
"def",
"is_valid",
"(",
"self",
",",
"qstr",
"=",
"None",
")",
":",
"if",
"not",
"self",
".",
"help",
".",
"source_is_console",
"(",
")",
":",
"return",
"True",
"if",
"qstr",
"is",
"None",
":",
"qstr",
"=",
"self",
".",
"currentText",
"(",
")",
"if... | Return True if string is valid | [
"Return",
"True",
"if",
"string",
"is",
"valid"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/widgets.py#L47-L73 | train | Return True if string is valid | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/help/widgets.py | ObjectComboBox.validate | def validate(self, qstr, editing=True):
"""Reimplemented to avoid formatting actions"""
valid = self.is_valid(qstr)
if self.hasFocus() and valid is not None:
if editing and not valid:
# Combo box text is being modified: invalidate the entry
self.show_t... | python | def validate(self, qstr, editing=True):
"""Reimplemented to avoid formatting actions"""
valid = self.is_valid(qstr)
if self.hasFocus() and valid is not None:
if editing and not valid:
# Combo box text is being modified: invalidate the entry
self.show_t... | [
"def",
"validate",
"(",
"self",
",",
"qstr",
",",
"editing",
"=",
"True",
")",
":",
"valid",
"=",
"self",
".",
"is_valid",
"(",
"qstr",
")",
"if",
"self",
".",
"hasFocus",
"(",
")",
"and",
"valid",
"is",
"not",
"None",
":",
"if",
"editing",
"and",
... | Reimplemented to avoid formatting actions | [
"Reimplemented",
"to",
"avoid",
"formatting",
"actions"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/widgets.py#L78-L91 | train | Reimplemented to avoid formatting actions | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/help/widgets.py | RichText.set_font | def set_font(self, font, fixed_font=None):
"""Set font"""
self.webview.set_font(font, fixed_font=fixed_font) | python | def set_font(self, font, fixed_font=None):
"""Set font"""
self.webview.set_font(font, fixed_font=fixed_font) | [
"def",
"set_font",
"(",
"self",
",",
"font",
",",
"fixed_font",
"=",
"None",
")",
":",
"self",
".",
"webview",
".",
"set_font",
"(",
"font",
",",
"fixed_font",
"=",
"fixed_font",
")"
] | Set font | [
"Set",
"font"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/widgets.py#L118-L120 | train | Set font for this object | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/help/widgets.py | PlainText.set_font | def set_font(self, font, color_scheme=None):
"""Set font"""
self.editor.set_font(font, color_scheme=color_scheme) | python | def set_font(self, font, color_scheme=None):
"""Set font"""
self.editor.set_font(font, color_scheme=color_scheme) | [
"def",
"set_font",
"(",
"self",
",",
"font",
",",
"color_scheme",
"=",
"None",
")",
":",
"self",
".",
"editor",
".",
"set_font",
"(",
"font",
",",
"color_scheme",
"=",
"color_scheme",
")"
] | Set font | [
"Set",
"font"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/help/widgets.py#L159-L161 | train | Set font in the editor | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/codeanalysis.py | find_tasks | def find_tasks(source_code):
"""Find tasks in source code (TODO, FIXME, XXX, ...)"""
results = []
for line, text in enumerate(source_code.splitlines()):
for todo in re.findall(TASKS_PATTERN, text):
todo_text = (todo[-1].strip(' :').capitalize() if todo[-1]
... | python | def find_tasks(source_code):
"""Find tasks in source code (TODO, FIXME, XXX, ...)"""
results = []
for line, text in enumerate(source_code.splitlines()):
for todo in re.findall(TASKS_PATTERN, text):
todo_text = (todo[-1].strip(' :').capitalize() if todo[-1]
... | [
"def",
"find_tasks",
"(",
"source_code",
")",
":",
"results",
"=",
"[",
"]",
"for",
"line",
",",
"text",
"in",
"enumerate",
"(",
"source_code",
".",
"splitlines",
"(",
")",
")",
":",
"for",
"todo",
"in",
"re",
".",
"findall",
"(",
"TASKS_PATTERN",
",",... | Find tasks in source code (TODO, FIXME, XXX, ...) | [
"Find",
"tasks",
"in",
"source",
"code",
"(",
"TODO",
"FIXME",
"XXX",
"...",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/codeanalysis.py#L30-L38 | train | Find tasks in source code. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/codeanalysis.py | check_with_pyflakes | def check_with_pyflakes(source_code, filename=None):
"""Check source code with pyflakes
Returns an empty list if pyflakes is not installed"""
try:
if filename is None:
filename = '<string>'
try:
source_code += '\n'
except TypeError:
# Pyth... | python | def check_with_pyflakes(source_code, filename=None):
"""Check source code with pyflakes
Returns an empty list if pyflakes is not installed"""
try:
if filename is None:
filename = '<string>'
try:
source_code += '\n'
except TypeError:
# Pyth... | [
"def",
"check_with_pyflakes",
"(",
"source_code",
",",
"filename",
"=",
"None",
")",
":",
"try",
":",
"if",
"filename",
"is",
"None",
":",
"filename",
"=",
"'<string>'",
"try",
":",
"source_code",
"+=",
"'\\n'",
"except",
"TypeError",
":",
"# Python 3\r",
"s... | Check source code with pyflakes
Returns an empty list if pyflakes is not installed | [
"Check",
"source",
"code",
"with",
"pyflakes",
"Returns",
"an",
"empty",
"list",
"if",
"pyflakes",
"is",
"not",
"installed"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/codeanalysis.py#L41-L88 | train | Check source code with pyflakes. Returns an empty list if pyflakes is not installed. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/codeanalysis.py | get_checker_executable | def get_checker_executable(name):
"""Return checker executable in the form of a list of arguments
for subprocess.Popen"""
if programs.is_program_installed(name):
# Checker is properly installed
return [name]
else:
path1 = programs.python_script_exists(package=None,
... | python | def get_checker_executable(name):
"""Return checker executable in the form of a list of arguments
for subprocess.Popen"""
if programs.is_program_installed(name):
# Checker is properly installed
return [name]
else:
path1 = programs.python_script_exists(package=None,
... | [
"def",
"get_checker_executable",
"(",
"name",
")",
":",
"if",
"programs",
".",
"is_program_installed",
"(",
"name",
")",
":",
"# Checker is properly installed\r",
"return",
"[",
"name",
"]",
"else",
":",
"path1",
"=",
"programs",
".",
"python_script_exists",
"(",
... | Return checker executable in the form of a list of arguments
for subprocess.Popen | [
"Return",
"checker",
"executable",
"in",
"the",
"form",
"of",
"a",
"list",
"of",
"arguments",
"for",
"subprocess",
".",
"Popen"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/codeanalysis.py#L96-L113 | train | Return checker executable in the form of a list of arguments
Taxonomy for subprocess. Popen | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/codeanalysis.py | check | def check(args, source_code, filename=None, options=None):
"""Check source code with checker defined with *args* (list)
Returns an empty list if checker is not installed"""
if args is None:
return []
if options is not None:
args += options
if any(['pyflakes' in arg for arg in ... | python | def check(args, source_code, filename=None, options=None):
"""Check source code with checker defined with *args* (list)
Returns an empty list if checker is not installed"""
if args is None:
return []
if options is not None:
args += options
if any(['pyflakes' in arg for arg in ... | [
"def",
"check",
"(",
"args",
",",
"source_code",
",",
"filename",
"=",
"None",
",",
"options",
"=",
"None",
")",
":",
"if",
"args",
"is",
"None",
":",
"return",
"[",
"]",
"if",
"options",
"is",
"not",
"None",
":",
"args",
"+=",
"options",
"if",
"an... | Check source code with checker defined with *args* (list)
Returns an empty list if checker is not installed | [
"Check",
"source",
"code",
"with",
"checker",
"defined",
"with",
"*",
"args",
"*",
"(",
"list",
")",
"Returns",
"an",
"empty",
"list",
"if",
"checker",
"is",
"not",
"installed"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/codeanalysis.py#L116-L161 | train | Check source code with checker defined with args * Returns an empty list if checker is not installed | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/codeanalysis.py | check_with_pep8 | def check_with_pep8(source_code, filename=None):
"""Check source code with pycodestyle"""
try:
args = get_checker_executable('pycodestyle')
results = check(args, source_code, filename=filename, options=['-r'])
except Exception:
# Never return None to avoid lock in spyder/widget... | python | def check_with_pep8(source_code, filename=None):
"""Check source code with pycodestyle"""
try:
args = get_checker_executable('pycodestyle')
results = check(args, source_code, filename=filename, options=['-r'])
except Exception:
# Never return None to avoid lock in spyder/widget... | [
"def",
"check_with_pep8",
"(",
"source_code",
",",
"filename",
"=",
"None",
")",
":",
"try",
":",
"args",
"=",
"get_checker_executable",
"(",
"'pycodestyle'",
")",
"results",
"=",
"check",
"(",
"args",
",",
"source_code",
",",
"filename",
"=",
"filename",
",... | Check source code with pycodestyle | [
"Check",
"source",
"code",
"with",
"pycodestyle"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/codeanalysis.py#L164-L175 | train | Check source code with pycodestyle | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/qthelpers.py | get_image_label | def get_image_label(name, default="not_found.png"):
"""Return image inside a QLabel object"""
label = QLabel()
label.setPixmap(QPixmap(get_image_path(name, default)))
return label | python | def get_image_label(name, default="not_found.png"):
"""Return image inside a QLabel object"""
label = QLabel()
label.setPixmap(QPixmap(get_image_path(name, default)))
return label | [
"def",
"get_image_label",
"(",
"name",
",",
"default",
"=",
"\"not_found.png\"",
")",
":",
"label",
"=",
"QLabel",
"(",
")",
"label",
".",
"setPixmap",
"(",
"QPixmap",
"(",
"get_image_path",
"(",
"name",
",",
"default",
")",
")",
")",
"return",
"label"
] | Return image inside a QLabel object | [
"Return",
"image",
"inside",
"a",
"QLabel",
"object"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/qthelpers.py#L44-L48 | train | Return image inside a QLabel object | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/qthelpers.py | qapplication | def qapplication(translate=True, test_time=3):
"""
Return QApplication instance
Creates it if it doesn't already exist
test_time: Time to maintain open the application when testing. It's given
in seconds
"""
if running_in_mac_app():
SpyderApplication = MacApplication
... | python | def qapplication(translate=True, test_time=3):
"""
Return QApplication instance
Creates it if it doesn't already exist
test_time: Time to maintain open the application when testing. It's given
in seconds
"""
if running_in_mac_app():
SpyderApplication = MacApplication
... | [
"def",
"qapplication",
"(",
"translate",
"=",
"True",
",",
"test_time",
"=",
"3",
")",
":",
"if",
"running_in_mac_app",
"(",
")",
":",
"SpyderApplication",
"=",
"MacApplication",
"else",
":",
"SpyderApplication",
"=",
"QApplication",
"app",
"=",
"SpyderApplicati... | Return QApplication instance
Creates it if it doesn't already exist
test_time: Time to maintain open the application when testing. It's given
in seconds | [
"Return",
"QApplication",
"instance",
"Creates",
"it",
"if",
"it",
"doesn",
"t",
"already",
"exist",
"test_time",
":",
"Time",
"to",
"maintain",
"open",
"the",
"application",
"when",
"testing",
".",
"It",
"s",
"given",
"in",
"seconds"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/qthelpers.py#L65-L94 | train | Returns a new QApplication instance if it doesn t already exist | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/qthelpers.py | file_uri | def file_uri(fname):
"""Select the right file uri scheme according to the operating system"""
if os.name == 'nt':
# Local file
if re.search(r'^[a-zA-Z]:', fname):
return 'file:///' + fname
# UNC based path
else:
return 'file://' + fname
else:
... | python | def file_uri(fname):
"""Select the right file uri scheme according to the operating system"""
if os.name == 'nt':
# Local file
if re.search(r'^[a-zA-Z]:', fname):
return 'file:///' + fname
# UNC based path
else:
return 'file://' + fname
else:
... | [
"def",
"file_uri",
"(",
"fname",
")",
":",
"if",
"os",
".",
"name",
"==",
"'nt'",
":",
"# Local file\r",
"if",
"re",
".",
"search",
"(",
"r'^[a-zA-Z]:'",
",",
"fname",
")",
":",
"return",
"'file:///'",
"+",
"fname",
"# UNC based path\r",
"else",
":",
"re... | Select the right file uri scheme according to the operating system | [
"Select",
"the",
"right",
"file",
"uri",
"scheme",
"according",
"to",
"the",
"operating",
"system"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/qthelpers.py#L97-L107 | train | Select the right file uri scheme according to the operating system | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/qthelpers.py | install_translator | def install_translator(qapp):
"""Install Qt translator to the QApplication instance"""
global QT_TRANSLATOR
if QT_TRANSLATOR is None:
qt_translator = QTranslator()
if qt_translator.load("qt_"+QLocale.system().name(),
QLibraryInfo.location(QLibraryInfo.Translations... | python | def install_translator(qapp):
"""Install Qt translator to the QApplication instance"""
global QT_TRANSLATOR
if QT_TRANSLATOR is None:
qt_translator = QTranslator()
if qt_translator.load("qt_"+QLocale.system().name(),
QLibraryInfo.location(QLibraryInfo.Translations... | [
"def",
"install_translator",
"(",
"qapp",
")",
":",
"global",
"QT_TRANSLATOR",
"if",
"QT_TRANSLATOR",
"is",
"None",
":",
"qt_translator",
"=",
"QTranslator",
"(",
")",
"if",
"qt_translator",
".",
"load",
"(",
"\"qt_\"",
"+",
"QLocale",
".",
"system",
"(",
")... | Install Qt translator to the QApplication instance | [
"Install",
"Qt",
"translator",
"to",
"the",
"QApplication",
"instance"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/qthelpers.py#L111-L120 | train | Install Qt translator to the QApplication instance | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/qthelpers.py | keybinding | def keybinding(attr):
"""Return keybinding"""
ks = getattr(QKeySequence, attr)
return from_qvariant(QKeySequence.keyBindings(ks)[0], str) | python | def keybinding(attr):
"""Return keybinding"""
ks = getattr(QKeySequence, attr)
return from_qvariant(QKeySequence.keyBindings(ks)[0], str) | [
"def",
"keybinding",
"(",
"attr",
")",
":",
"ks",
"=",
"getattr",
"(",
"QKeySequence",
",",
"attr",
")",
"return",
"from_qvariant",
"(",
"QKeySequence",
".",
"keyBindings",
"(",
"ks",
")",
"[",
"0",
"]",
",",
"str",
")"
] | Return keybinding | [
"Return",
"keybinding"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/qthelpers.py#L123-L126 | train | Return the first keybinding of the given attribute | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/qthelpers.py | mimedata2url | def mimedata2url(source, extlist=None):
"""
Extract url list from MIME data
extlist: for example ('.py', '.pyw')
"""
pathlist = []
if source.hasUrls():
for url in source.urls():
path = _process_mime_path(to_text_string(url.toString()), extlist)
if path is... | python | def mimedata2url(source, extlist=None):
"""
Extract url list from MIME data
extlist: for example ('.py', '.pyw')
"""
pathlist = []
if source.hasUrls():
for url in source.urls():
path = _process_mime_path(to_text_string(url.toString()), extlist)
if path is... | [
"def",
"mimedata2url",
"(",
"source",
",",
"extlist",
"=",
"None",
")",
":",
"pathlist",
"=",
"[",
"]",
"if",
"source",
".",
"hasUrls",
"(",
")",
":",
"for",
"url",
"in",
"source",
".",
"urls",
"(",
")",
":",
"path",
"=",
"_process_mime_path",
"(",
... | Extract url list from MIME data
extlist: for example ('.py', '.pyw') | [
"Extract",
"url",
"list",
"from",
"MIME",
"data",
"extlist",
":",
"for",
"example",
"(",
".",
"py",
".",
"pyw",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/qthelpers.py#L146-L163 | train | Extract url list from MIME data | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/qthelpers.py | keyevent2tuple | def keyevent2tuple(event):
"""Convert QKeyEvent instance into a tuple"""
return (event.type(), event.key(), event.modifiers(), event.text(),
event.isAutoRepeat(), event.count()) | python | def keyevent2tuple(event):
"""Convert QKeyEvent instance into a tuple"""
return (event.type(), event.key(), event.modifiers(), event.text(),
event.isAutoRepeat(), event.count()) | [
"def",
"keyevent2tuple",
"(",
"event",
")",
":",
"return",
"(",
"event",
".",
"type",
"(",
")",
",",
"event",
".",
"key",
"(",
")",
",",
"event",
".",
"modifiers",
"(",
")",
",",
"event",
".",
"text",
"(",
")",
",",
"event",
".",
"isAutoRepeat",
... | Convert QKeyEvent instance into a tuple | [
"Convert",
"QKeyEvent",
"instance",
"into",
"a",
"tuple"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/qthelpers.py#L166-L169 | train | Convert a QKeyEvent instance into a tuple | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/qthelpers.py | create_toolbutton | def create_toolbutton(parent, text=None, shortcut=None, icon=None, tip=None,
toggled=None, triggered=None,
autoraise=True, text_beside_icon=False):
"""Create a QToolButton"""
button = QToolButton(parent)
if text is not None:
button.setText(text)
... | python | def create_toolbutton(parent, text=None, shortcut=None, icon=None, tip=None,
toggled=None, triggered=None,
autoraise=True, text_beside_icon=False):
"""Create a QToolButton"""
button = QToolButton(parent)
if text is not None:
button.setText(text)
... | [
"def",
"create_toolbutton",
"(",
"parent",
",",
"text",
"=",
"None",
",",
"shortcut",
"=",
"None",
",",
"icon",
"=",
"None",
",",
"tip",
"=",
"None",
",",
"toggled",
"=",
"None",
",",
"triggered",
"=",
"None",
",",
"autoraise",
"=",
"True",
",",
"tex... | Create a QToolButton | [
"Create",
"a",
"QToolButton"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/qthelpers.py#L190-L213 | train | Create a new QToolButton with the given text icon and tip. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/qthelpers.py | action2button | def action2button(action, autoraise=True, text_beside_icon=False, parent=None):
"""Create a QToolButton directly from a QAction object"""
if parent is None:
parent = action.parent()
button = QToolButton(parent)
button.setDefaultAction(action)
button.setAutoRaise(autoraise)
if text... | python | def action2button(action, autoraise=True, text_beside_icon=False, parent=None):
"""Create a QToolButton directly from a QAction object"""
if parent is None:
parent = action.parent()
button = QToolButton(parent)
button.setDefaultAction(action)
button.setAutoRaise(autoraise)
if text... | [
"def",
"action2button",
"(",
"action",
",",
"autoraise",
"=",
"True",
",",
"text_beside_icon",
"=",
"False",
",",
"parent",
"=",
"None",
")",
":",
"if",
"parent",
"is",
"None",
":",
"parent",
"=",
"action",
".",
"parent",
"(",
")",
"button",
"=",
"QToo... | Create a QToolButton directly from a QAction object | [
"Create",
"a",
"QToolButton",
"directly",
"from",
"a",
"QAction",
"object"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/qthelpers.py#L216-L225 | train | Create a QToolButton directly from a QAction object | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/qthelpers.py | toggle_actions | def toggle_actions(actions, enable):
"""Enable/disable actions"""
if actions is not None:
for action in actions:
if action is not None:
action.setEnabled(enable) | python | def toggle_actions(actions, enable):
"""Enable/disable actions"""
if actions is not None:
for action in actions:
if action is not None:
action.setEnabled(enable) | [
"def",
"toggle_actions",
"(",
"actions",
",",
"enable",
")",
":",
"if",
"actions",
"is",
"not",
"None",
":",
"for",
"action",
"in",
"actions",
":",
"if",
"action",
"is",
"not",
"None",
":",
"action",
".",
"setEnabled",
"(",
"enable",
")"
] | Enable/disable actions | [
"Enable",
"/",
"disable",
"actions"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/qthelpers.py#L228-L233 | train | Enable or disable actions | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/qthelpers.py | create_action | def create_action(parent, text, shortcut=None, icon=None, tip=None,
toggled=None, triggered=None, data=None, menurole=None,
context=Qt.WindowShortcut):
"""Create a QAction"""
action = SpyderAction(text, parent)
if triggered is not None:
action.triggered.conn... | python | def create_action(parent, text, shortcut=None, icon=None, tip=None,
toggled=None, triggered=None, data=None, menurole=None,
context=Qt.WindowShortcut):
"""Create a QAction"""
action = SpyderAction(text, parent)
if triggered is not None:
action.triggered.conn... | [
"def",
"create_action",
"(",
"parent",
",",
"text",
",",
"shortcut",
"=",
"None",
",",
"icon",
"=",
"None",
",",
"tip",
"=",
"None",
",",
"toggled",
"=",
"None",
",",
"triggered",
"=",
"None",
",",
"data",
"=",
"None",
",",
"menurole",
"=",
"None",
... | Create a QAction | [
"Create",
"a",
"QAction"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/qthelpers.py#L236-L278 | train | Create a QAction object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/qthelpers.py | add_shortcut_to_tooltip | def add_shortcut_to_tooltip(action, context, name):
"""Add the shortcut associated with a given action to its tooltip"""
action.setToolTip(action.toolTip() + ' (%s)' %
get_shortcut(context=context, name=name)) | python | def add_shortcut_to_tooltip(action, context, name):
"""Add the shortcut associated with a given action to its tooltip"""
action.setToolTip(action.toolTip() + ' (%s)' %
get_shortcut(context=context, name=name)) | [
"def",
"add_shortcut_to_tooltip",
"(",
"action",
",",
"context",
",",
"name",
")",
":",
"action",
".",
"setToolTip",
"(",
"action",
".",
"toolTip",
"(",
")",
"+",
"' (%s)'",
"%",
"get_shortcut",
"(",
"context",
"=",
"context",
",",
"name",
"=",
"name",
"... | Add the shortcut associated with a given action to its tooltip | [
"Add",
"the",
"shortcut",
"associated",
"with",
"a",
"given",
"action",
"to",
"its",
"tooltip"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/qthelpers.py#L281-L284 | train | Add the shortcut associated with a given action to its tooltip | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/qthelpers.py | add_actions | def add_actions(target, actions, insert_before=None):
"""Add actions to a QMenu or a QToolBar."""
previous_action = None
target_actions = list(target.actions())
if target_actions:
previous_action = target_actions[-1]
if previous_action.isSeparator():
previous_action = ... | python | def add_actions(target, actions, insert_before=None):
"""Add actions to a QMenu or a QToolBar."""
previous_action = None
target_actions = list(target.actions())
if target_actions:
previous_action = target_actions[-1]
if previous_action.isSeparator():
previous_action = ... | [
"def",
"add_actions",
"(",
"target",
",",
"actions",
",",
"insert_before",
"=",
"None",
")",
":",
"previous_action",
"=",
"None",
"target_actions",
"=",
"list",
"(",
"target",
".",
"actions",
"(",
")",
")",
"if",
"target_actions",
":",
"previous_action",
"="... | Add actions to a QMenu or a QToolBar. | [
"Add",
"actions",
"to",
"a",
"QMenu",
"or",
"a",
"QToolBar",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/qthelpers.py#L287-L322 | train | Add actions to a QMenu or QToolBar. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/qthelpers.py | create_bookmark_action | def create_bookmark_action(parent, url, title, icon=None, shortcut=None):
"""Create bookmark action"""
@Slot()
def open_url():
return programs.start_file(url)
return create_action( parent, title, shortcut=shortcut, icon=icon,
triggered=open_url) | python | def create_bookmark_action(parent, url, title, icon=None, shortcut=None):
"""Create bookmark action"""
@Slot()
def open_url():
return programs.start_file(url)
return create_action( parent, title, shortcut=shortcut, icon=icon,
triggered=open_url) | [
"def",
"create_bookmark_action",
"(",
"parent",
",",
"url",
",",
"title",
",",
"icon",
"=",
"None",
",",
"shortcut",
"=",
"None",
")",
":",
"@",
"Slot",
"(",
")",
"def",
"open_url",
"(",
")",
":",
"return",
"programs",
".",
"start_file",
"(",
"url",
... | Create bookmark action | [
"Create",
"bookmark",
"action"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/qthelpers.py#L335-L343 | train | Create bookmark action. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/qthelpers.py | create_module_bookmark_actions | def create_module_bookmark_actions(parent, bookmarks):
"""
Create bookmark actions depending on module installation:
bookmarks = ((module_name, url, title), ...)
"""
actions = []
for key, url, title in bookmarks:
# Create actions for scientific distros only if Spyder is installed
... | python | def create_module_bookmark_actions(parent, bookmarks):
"""
Create bookmark actions depending on module installation:
bookmarks = ((module_name, url, title), ...)
"""
actions = []
for key, url, title in bookmarks:
# Create actions for scientific distros only if Spyder is installed
... | [
"def",
"create_module_bookmark_actions",
"(",
"parent",
",",
"bookmarks",
")",
":",
"actions",
"=",
"[",
"]",
"for",
"key",
",",
"url",
",",
"title",
"in",
"bookmarks",
":",
"# Create actions for scientific distros only if Spyder is installed\r",
"# under them\r",
"crea... | Create bookmark actions depending on module installation:
bookmarks = ((module_name, url, title), ...) | [
"Create",
"bookmark",
"actions",
"depending",
"on",
"module",
"installation",
":",
"bookmarks",
"=",
"((",
"module_name",
"url",
"title",
")",
"...",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/qthelpers.py#L346-L362 | train | Create bookmark actions depending on module installation | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/qthelpers.py | create_program_action | def create_program_action(parent, text, name, icon=None, nt_name=None):
"""Create action to run a program"""
if is_text_string(icon):
icon = get_icon(icon)
if os.name == 'nt' and nt_name is not None:
name = nt_name
path = programs.find_program(name)
if path is not None:
... | python | def create_program_action(parent, text, name, icon=None, nt_name=None):
"""Create action to run a program"""
if is_text_string(icon):
icon = get_icon(icon)
if os.name == 'nt' and nt_name is not None:
name = nt_name
path = programs.find_program(name)
if path is not None:
... | [
"def",
"create_program_action",
"(",
"parent",
",",
"text",
",",
"name",
",",
"icon",
"=",
"None",
",",
"nt_name",
"=",
"None",
")",
":",
"if",
"is_text_string",
"(",
"icon",
")",
":",
"icon",
"=",
"get_icon",
"(",
"icon",
")",
"if",
"os",
".",
"name... | Create action to run a program | [
"Create",
"action",
"to",
"run",
"a",
"program"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/qthelpers.py#L365-L374 | train | Create action to run a program | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/qthelpers.py | create_python_script_action | def create_python_script_action(parent, text, icon, package, module, args=[]):
"""Create action to run a GUI based Python script"""
if is_text_string(icon):
icon = get_icon(icon)
if programs.python_script_exists(package, module):
return create_action(parent, text, icon=icon,
... | python | def create_python_script_action(parent, text, icon, package, module, args=[]):
"""Create action to run a GUI based Python script"""
if is_text_string(icon):
icon = get_icon(icon)
if programs.python_script_exists(package, module):
return create_action(parent, text, icon=icon,
... | [
"def",
"create_python_script_action",
"(",
"parent",
",",
"text",
",",
"icon",
",",
"package",
",",
"module",
",",
"args",
"=",
"[",
"]",
")",
":",
"if",
"is_text_string",
"(",
"icon",
")",
":",
"icon",
"=",
"get_icon",
"(",
"icon",
")",
"if",
"program... | Create action to run a GUI based Python script | [
"Create",
"action",
"to",
"run",
"a",
"GUI",
"based",
"Python",
"script"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/qthelpers.py#L377-L384 | train | Create action to run a GUI based Python script | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/qthelpers.py | get_filetype_icon | def get_filetype_icon(fname):
"""Return file type icon"""
ext = osp.splitext(fname)[1]
if ext.startswith('.'):
ext = ext[1:]
return get_icon( "%s.png" % ext, ima.icon('FileIcon') ) | python | def get_filetype_icon(fname):
"""Return file type icon"""
ext = osp.splitext(fname)[1]
if ext.startswith('.'):
ext = ext[1:]
return get_icon( "%s.png" % ext, ima.icon('FileIcon') ) | [
"def",
"get_filetype_icon",
"(",
"fname",
")",
":",
"ext",
"=",
"osp",
".",
"splitext",
"(",
"fname",
")",
"[",
"1",
"]",
"if",
"ext",
".",
"startswith",
"(",
"'.'",
")",
":",
"ext",
"=",
"ext",
"[",
"1",
":",
"]",
"return",
"get_icon",
"(",
"\"%... | Return file type icon | [
"Return",
"file",
"type",
"icon"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/qthelpers.py#L423-L428 | train | Return file type icon | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/qthelpers.py | show_std_icons | def show_std_icons():
"""
Show all standard Icons
"""
app = qapplication()
dialog = ShowStdIcons(None)
dialog.show()
sys.exit(app.exec_()) | python | def show_std_icons():
"""
Show all standard Icons
"""
app = qapplication()
dialog = ShowStdIcons(None)
dialog.show()
sys.exit(app.exec_()) | [
"def",
"show_std_icons",
"(",
")",
":",
"app",
"=",
"qapplication",
"(",
")",
"dialog",
"=",
"ShowStdIcons",
"(",
"None",
")",
"dialog",
".",
"show",
"(",
")",
"sys",
".",
"exit",
"(",
"app",
".",
"exec_",
"(",
")",
")"
] | Show all standard Icons | [
"Show",
"all",
"standard",
"Icons"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/qthelpers.py#L501-L508 | train | Show all standard Icons
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/qthelpers.py | calc_tools_spacing | def calc_tools_spacing(tools_layout):
"""
Return a spacing (int) or None if we don't have the appropriate metrics
to calculate the spacing.
We're trying to adapt the spacing below the tools_layout spacing so that
the main_widget has the same vertical position as the editor widgets
(which... | python | def calc_tools_spacing(tools_layout):
"""
Return a spacing (int) or None if we don't have the appropriate metrics
to calculate the spacing.
We're trying to adapt the spacing below the tools_layout spacing so that
the main_widget has the same vertical position as the editor widgets
(which... | [
"def",
"calc_tools_spacing",
"(",
"tools_layout",
")",
":",
"metrics",
"=",
"{",
"# (tabbar_height, offset)\r",
"'nt.fusion'",
":",
"(",
"32",
",",
"0",
")",
",",
"'nt.windowsvista'",
":",
"(",
"21",
",",
"3",
")",
",",
"'nt.windowsxp'",
":",
"(",
"24",
",... | Return a spacing (int) or None if we don't have the appropriate metrics
to calculate the spacing.
We're trying to adapt the spacing below the tools_layout spacing so that
the main_widget has the same vertical position as the editor widgets
(which have tabs above).
The required spacing is
... | [
"Return",
"a",
"spacing",
"(",
"int",
")",
"or",
"None",
"if",
"we",
"don",
"t",
"have",
"the",
"appropriate",
"metrics",
"to",
"calculate",
"the",
"spacing",
".",
"We",
"re",
"trying",
"to",
"adapt",
"the",
"spacing",
"below",
"the",
"tools_layout",
"sp... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/qthelpers.py#L511-L548 | train | Calculates the spacing of the tools_layout. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/qthelpers.py | create_plugin_layout | def create_plugin_layout(tools_layout, main_widget=None):
"""
Returns a layout for a set of controls above a main widget. This is a
standard layout for many plugin panes (even though, it's currently
more often applied not to the pane itself but with in the one widget
contained in the pane.
... | python | def create_plugin_layout(tools_layout, main_widget=None):
"""
Returns a layout for a set of controls above a main widget. This is a
standard layout for many plugin panes (even though, it's currently
more often applied not to the pane itself but with in the one widget
contained in the pane.
... | [
"def",
"create_plugin_layout",
"(",
"tools_layout",
",",
"main_widget",
"=",
"None",
")",
":",
"layout",
"=",
"QVBoxLayout",
"(",
")",
"layout",
".",
"setContentsMargins",
"(",
"0",
",",
"0",
",",
"0",
",",
"0",
")",
"spacing",
"=",
"calc_tools_spacing",
"... | Returns a layout for a set of controls above a main widget. This is a
standard layout for many plugin panes (even though, it's currently
more often applied not to the pane itself but with in the one widget
contained in the pane.
tools_layout: a layout containing the top toolbar
main_widget: t... | [
"Returns",
"a",
"layout",
"for",
"a",
"set",
"of",
"controls",
"above",
"a",
"main",
"widget",
".",
"This",
"is",
"a",
"standard",
"layout",
"for",
"many",
"plugin",
"panes",
"(",
"even",
"though",
"it",
"s",
"currently",
"more",
"often",
"applied",
"not... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/qthelpers.py#L551-L571 | train | Create a layout for a set of controls above a main widget. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/qthelpers.py | DialogManager.show | def show(self, dialog):
"""Generic method to show a non-modal dialog and keep reference
to the Qt C++ object"""
for dlg in list(self.dialogs.values()):
if to_text_string(dlg.windowTitle()) \
== to_text_string(dialog.windowTitle()):
dlg.show()
... | python | def show(self, dialog):
"""Generic method to show a non-modal dialog and keep reference
to the Qt C++ object"""
for dlg in list(self.dialogs.values()):
if to_text_string(dlg.windowTitle()) \
== to_text_string(dialog.windowTitle()):
dlg.show()
... | [
"def",
"show",
"(",
"self",
",",
"dialog",
")",
":",
"for",
"dlg",
"in",
"list",
"(",
"self",
".",
"dialogs",
".",
"values",
"(",
")",
")",
":",
"if",
"to_text_string",
"(",
"dlg",
".",
"windowTitle",
"(",
")",
")",
"==",
"to_text_string",
"(",
"di... | Generic method to show a non-modal dialog and keep reference
to the Qt C++ object | [
"Generic",
"method",
"to",
"show",
"a",
"non",
"-",
"modal",
"dialog",
"and",
"keep",
"reference",
"to",
"the",
"Qt",
"C",
"++",
"object"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/qthelpers.py#L396-L411 | train | Generic method to show a non - modal dialog and keep reference to the Qt C ++ object | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/dependencies.py | add | def add(modname, features, required_version, installed_version=None,
optional=False):
"""Add Spyder dependency"""
global DEPENDENCIES
for dependency in DEPENDENCIES:
if dependency.modname == modname:
raise ValueError("Dependency has already been registered: %s"\
... | python | def add(modname, features, required_version, installed_version=None,
optional=False):
"""Add Spyder dependency"""
global DEPENDENCIES
for dependency in DEPENDENCIES:
if dependency.modname == modname:
raise ValueError("Dependency has already been registered: %s"\
... | [
"def",
"add",
"(",
"modname",
",",
"features",
",",
"required_version",
",",
"installed_version",
"=",
"None",
",",
"optional",
"=",
"False",
")",
":",
"global",
"DEPENDENCIES",
"for",
"dependency",
"in",
"DEPENDENCIES",
":",
"if",
"dependency",
".",
"modname"... | Add Spyder dependency | [
"Add",
"Spyder",
"dependency"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/dependencies.py#L66-L75 | train | Add a Spyder dependency to the list of dependencies. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/dependencies.py | check | def check(modname):
"""Check if required dependency is installed"""
for dependency in DEPENDENCIES:
if dependency.modname == modname:
return dependency.check()
else:
raise RuntimeError("Unkwown dependency %s" % modname) | python | def check(modname):
"""Check if required dependency is installed"""
for dependency in DEPENDENCIES:
if dependency.modname == modname:
return dependency.check()
else:
raise RuntimeError("Unkwown dependency %s" % modname) | [
"def",
"check",
"(",
"modname",
")",
":",
"for",
"dependency",
"in",
"DEPENDENCIES",
":",
"if",
"dependency",
".",
"modname",
"==",
"modname",
":",
"return",
"dependency",
".",
"check",
"(",
")",
"else",
":",
"raise",
"RuntimeError",
"(",
"\"Unkwown dependen... | Check if required dependency is installed | [
"Check",
"if",
"required",
"dependency",
"is",
"installed"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/dependencies.py#L78-L84 | train | Check if required dependency is installed | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/dependencies.py | status | def status(deps=DEPENDENCIES, linesep=os.linesep):
"""Return a status of dependencies"""
maxwidth = 0
col1 = []
col2 = []
for dependency in deps:
title1 = dependency.modname
title1 += ' ' + dependency.required_version
col1.append(title1)
maxwidth = max([maxwi... | python | def status(deps=DEPENDENCIES, linesep=os.linesep):
"""Return a status of dependencies"""
maxwidth = 0
col1 = []
col2 = []
for dependency in deps:
title1 = dependency.modname
title1 += ' ' + dependency.required_version
col1.append(title1)
maxwidth = max([maxwi... | [
"def",
"status",
"(",
"deps",
"=",
"DEPENDENCIES",
",",
"linesep",
"=",
"os",
".",
"linesep",
")",
":",
"maxwidth",
"=",
"0",
"col1",
"=",
"[",
"]",
"col2",
"=",
"[",
"]",
"for",
"dependency",
"in",
"deps",
":",
"title1",
"=",
"dependency",
".",
"m... | Return a status of dependencies | [
"Return",
"a",
"status",
"of",
"dependencies"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/dependencies.py#L87-L101 | train | Return a status of the dependencies | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/dependencies.py | missing_dependencies | def missing_dependencies():
"""Return the status of missing dependencies (if any)"""
missing_deps = []
for dependency in DEPENDENCIES:
if not dependency.check() and not dependency.optional:
missing_deps.append(dependency)
if missing_deps:
return status(deps=missing_dep... | python | def missing_dependencies():
"""Return the status of missing dependencies (if any)"""
missing_deps = []
for dependency in DEPENDENCIES:
if not dependency.check() and not dependency.optional:
missing_deps.append(dependency)
if missing_deps:
return status(deps=missing_dep... | [
"def",
"missing_dependencies",
"(",
")",
":",
"missing_deps",
"=",
"[",
"]",
"for",
"dependency",
"in",
"DEPENDENCIES",
":",
"if",
"not",
"dependency",
".",
"check",
"(",
")",
"and",
"not",
"dependency",
".",
"optional",
":",
"missing_deps",
".",
"append",
... | Return the status of missing dependencies (if any) | [
"Return",
"the",
"status",
"of",
"missing",
"dependencies",
"(",
"if",
"any",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/dependencies.py#L104-L113 | train | Return the status of missing dependencies. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/dependencies.py | Dependency.check | def check(self):
"""Check if dependency is installed"""
return programs.is_module_installed(self.modname,
self.required_version,
self.installed_version) | python | def check(self):
"""Check if dependency is installed"""
return programs.is_module_installed(self.modname,
self.required_version,
self.installed_version) | [
"def",
"check",
"(",
"self",
")",
":",
"return",
"programs",
".",
"is_module_installed",
"(",
"self",
".",
"modname",
",",
"self",
".",
"required_version",
",",
"self",
".",
"installed_version",
")"
] | Check if dependency is installed | [
"Check",
"if",
"dependency",
"is",
"installed"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/dependencies.py#L42-L46 | train | Check if dependency is installed | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/dependencies.py | Dependency.get_installed_version | def get_installed_version(self):
"""Return dependency status (string)"""
if self.check():
return '%s (%s)' % (self.installed_version, self.OK)
else:
return '%s (%s)' % (self.installed_version, self.NOK) | python | def get_installed_version(self):
"""Return dependency status (string)"""
if self.check():
return '%s (%s)' % (self.installed_version, self.OK)
else:
return '%s (%s)' % (self.installed_version, self.NOK) | [
"def",
"get_installed_version",
"(",
"self",
")",
":",
"if",
"self",
".",
"check",
"(",
")",
":",
"return",
"'%s (%s)'",
"%",
"(",
"self",
".",
"installed_version",
",",
"self",
".",
"OK",
")",
"else",
":",
"return",
"'%s (%s)'",
"%",
"(",
"self",
".",... | Return dependency status (string) | [
"Return",
"dependency",
"status",
"(",
"string",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/dependencies.py#L48-L53 | train | Return the installed version of the class. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/otherplugins.py | get_spyderplugins_mods | def get_spyderplugins_mods(io=False):
"""Import modules from plugins package and return the list"""
# Create user directory
user_plugin_path = osp.join(get_conf_path(), USER_PLUGIN_DIR)
if not osp.isdir(user_plugin_path):
os.makedirs(user_plugin_path)
modlist, modnames = [], []
... | python | def get_spyderplugins_mods(io=False):
"""Import modules from plugins package and return the list"""
# Create user directory
user_plugin_path = osp.join(get_conf_path(), USER_PLUGIN_DIR)
if not osp.isdir(user_plugin_path):
os.makedirs(user_plugin_path)
modlist, modnames = [], []
... | [
"def",
"get_spyderplugins_mods",
"(",
"io",
"=",
"False",
")",
":",
"# Create user directory\r",
"user_plugin_path",
"=",
"osp",
".",
"join",
"(",
"get_conf_path",
"(",
")",
",",
"USER_PLUGIN_DIR",
")",
"if",
"not",
"osp",
".",
"isdir",
"(",
"user_plugin_path",
... | Import modules from plugins package and return the list | [
"Import",
"modules",
"from",
"plugins",
"package",
"and",
"return",
"the",
"list"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/otherplugins.py#L31-L43 | train | Import modules from plugins package and return the list | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/otherplugins.py | _get_spyderplugins | def _get_spyderplugins(plugin_path, is_io, modnames, modlist):
"""Scan the directory `plugin_path` for plugin packages and loads them."""
if not osp.isdir(plugin_path):
return
for name in os.listdir(plugin_path):
# This is needed in order to register the spyder_io_hdf5 plugin.
... | python | def _get_spyderplugins(plugin_path, is_io, modnames, modlist):
"""Scan the directory `plugin_path` for plugin packages and loads them."""
if not osp.isdir(plugin_path):
return
for name in os.listdir(plugin_path):
# This is needed in order to register the spyder_io_hdf5 plugin.
... | [
"def",
"_get_spyderplugins",
"(",
"plugin_path",
",",
"is_io",
",",
"modnames",
",",
"modlist",
")",
":",
"if",
"not",
"osp",
".",
"isdir",
"(",
"plugin_path",
")",
":",
"return",
"for",
"name",
"in",
"os",
".",
"listdir",
"(",
"plugin_path",
")",
":",
... | Scan the directory `plugin_path` for plugin packages and loads them. | [
"Scan",
"the",
"directory",
"plugin_path",
"for",
"plugin",
"packages",
"and",
"loads",
"them",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/otherplugins.py#L46-L69 | train | Scan the directory plugin_path for plugin packages and loads them. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/otherplugins.py | _import_plugin | def _import_plugin(module_name, plugin_path, modnames, modlist):
"""Import the plugin `module_name` from `plugin_path`, add it to `modlist`
and adds its name to `modnames`.
"""
if module_name in modnames:
return
try:
# First add a mock module with the LOCALEPATH attribute so t... | python | def _import_plugin(module_name, plugin_path, modnames, modlist):
"""Import the plugin `module_name` from `plugin_path`, add it to `modlist`
and adds its name to `modnames`.
"""
if module_name in modnames:
return
try:
# First add a mock module with the LOCALEPATH attribute so t... | [
"def",
"_import_plugin",
"(",
"module_name",
",",
"plugin_path",
",",
"modnames",
",",
"modlist",
")",
":",
"if",
"module_name",
"in",
"modnames",
":",
"return",
"try",
":",
"# First add a mock module with the LOCALEPATH attribute so that the\r",
"# helper method can find t... | Import the plugin `module_name` from `plugin_path`, add it to `modlist`
and adds its name to `modnames`. | [
"Import",
"the",
"plugin",
"module_name",
"from",
"plugin_path",
"add",
"it",
"to",
"modlist",
"and",
"adds",
"its",
"name",
"to",
"modnames",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/otherplugins.py#L72-L98 | train | Import the plugin module_name from plugin_path add it to modlist and adds its name to modnames. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/otherplugins.py | _import_module_from_path | def _import_module_from_path(module_name, plugin_path):
"""Imports `module_name` from `plugin_path`.
Return None if no module is found.
"""
module = None
try:
if PY2:
info = imp.find_module(module_name, [plugin_path])
if info:
module = imp.l... | python | def _import_module_from_path(module_name, plugin_path):
"""Imports `module_name` from `plugin_path`.
Return None if no module is found.
"""
module = None
try:
if PY2:
info = imp.find_module(module_name, [plugin_path])
if info:
module = imp.l... | [
"def",
"_import_module_from_path",
"(",
"module_name",
",",
"plugin_path",
")",
":",
"module",
"=",
"None",
"try",
":",
"if",
"PY2",
":",
"info",
"=",
"imp",
".",
"find_module",
"(",
"module_name",
",",
"[",
"plugin_path",
"]",
")",
"if",
"info",
":",
"m... | Imports `module_name` from `plugin_path`.
Return None if no module is found. | [
"Imports",
"module_name",
"from",
"plugin_path",
".",
"Return",
"None",
"if",
"no",
"module",
"is",
"found",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/otherplugins.py#L101-L121 | train | Imports module_name from plugin_path. Returns None if no module is found. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/icon_manager.py | get_std_icon | def get_std_icon(name, size=None):
"""Get standard platform icon
Call 'show_std_icons()' for details"""
if not name.startswith('SP_'):
name = 'SP_' + name
icon = QWidget().style().standardIcon(getattr(QStyle, name))
if size is None:
return icon
else:
return QIcon(icon.pix... | python | def get_std_icon(name, size=None):
"""Get standard platform icon
Call 'show_std_icons()' for details"""
if not name.startswith('SP_'):
name = 'SP_' + name
icon = QWidget().style().standardIcon(getattr(QStyle, name))
if size is None:
return icon
else:
return QIcon(icon.pix... | [
"def",
"get_std_icon",
"(",
"name",
",",
"size",
"=",
"None",
")",
":",
"if",
"not",
"name",
".",
"startswith",
"(",
"'SP_'",
")",
":",
"name",
"=",
"'SP_'",
"+",
"name",
"icon",
"=",
"QWidget",
"(",
")",
".",
"style",
"(",
")",
".",
"standardIcon"... | Get standard platform icon
Call 'show_std_icons()' for details | [
"Get",
"standard",
"platform",
"icon",
"Call",
"show_std_icons",
"()",
"for",
"details"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/icon_manager.py#L346-L355 | train | Get standard platform icon | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.