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/utils/stringmatching.py
get_search_regex
def get_search_regex(query, ignore_case=True): """Returns a compiled regex pattern to search for query letters in order. Parameters ---------- query : str String to search in another string (in order of character occurrence). ignore_case : True Optional value perform a case insensit...
python
def get_search_regex(query, ignore_case=True): """Returns a compiled regex pattern to search for query letters in order. Parameters ---------- query : str String to search in another string (in order of character occurrence). ignore_case : True Optional value perform a case insensit...
[ "def", "get_search_regex", "(", "query", ",", "ignore_case", "=", "True", ")", ":", "regex_text", "=", "[", "char", "for", "char", "in", "query", "if", "char", "!=", "' '", "]", "regex_text", "=", "'.*'", ".", "join", "(", "regex_text", ")", "regex", "...
Returns a compiled regex pattern to search for query letters in order. Parameters ---------- query : str String to search in another string (in order of character occurrence). ignore_case : True Optional value perform a case insensitive search (True by default). Returns -------...
[ "Returns", "a", "compiled", "regex", "pattern", "to", "search", "for", "query", "letters", "in", "order", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/stringmatching.py#L18-L47
train
Returns a compiled regex pattern to search for query letters in order.
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/stringmatching.py
get_search_score
def get_search_score(query, choice, ignore_case=True, apply_regex=True, template='{}'): """Returns a tuple with the enriched text (if a template is provided) and a score for the match. Parameters ---------- query : str String with letters to search in choice (in order o...
python
def get_search_score(query, choice, ignore_case=True, apply_regex=True, template='{}'): """Returns a tuple with the enriched text (if a template is provided) and a score for the match. Parameters ---------- query : str String with letters to search in choice (in order o...
[ "def", "get_search_score", "(", "query", ",", "choice", ",", "ignore_case", "=", "True", ",", "apply_regex", "=", "True", ",", "template", "=", "'{}'", ")", ":", "original_choice", "=", "choice", "result", "=", "(", "original_choice", ",", "NOT_FOUND_SCORE", ...
Returns a tuple with the enriched text (if a template is provided) and a score for the match. Parameters ---------- query : str String with letters to search in choice (in order of appearance). choice : str Sentence/words in which to search for the 'query' letters. ignore_case :...
[ "Returns", "a", "tuple", "with", "the", "enriched", "text", "(", "if", "a", "template", "is", "provided", ")", "and", "a", "score", "for", "the", "match", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/stringmatching.py#L50-L176
train
Returns a tuple with the enriched text and the score for the match.
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/stringmatching.py
get_search_scores
def get_search_scores(query, choices, ignore_case=True, template='{}', valid_only=False, sort=False): """Search for query inside choices and return a list of tuples. Returns a list of tuples of text with the enriched text (if a template is provided) and a score for the match. Lower sc...
python
def get_search_scores(query, choices, ignore_case=True, template='{}', valid_only=False, sort=False): """Search for query inside choices and return a list of tuples. Returns a list of tuples of text with the enriched text (if a template is provided) and a score for the match. Lower sc...
[ "def", "get_search_scores", "(", "query", ",", "choices", ",", "ignore_case", "=", "True", ",", "template", "=", "'{}'", ",", "valid_only", "=", "False", ",", "sort", "=", "False", ")", ":", "# First remove spaces from query", "query", "=", "query", ".", "re...
Search for query inside choices and return a list of tuples. Returns a list of tuples of text with the enriched text (if a template is provided) and a score for the match. Lower scores imply a better match. Parameters ---------- query : str String with letters to search in each choice (in ...
[ "Search", "for", "query", "inside", "choices", "and", "return", "a", "list", "of", "tuples", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/stringmatching.py#L179-L230
train
Search for query inside choices and return a list of tuples where the first item is the enriched text and the score is a better match.
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/extensions/docstring.py
is_start_of_function
def is_start_of_function(text): """Return True if text is the beginning of the function definition.""" if isinstance(text, str) or isinstance(text, unicode): function_prefix = ['def', 'async def'] text = text.lstrip() for prefix in function_prefix: if text.startswith(...
python
def is_start_of_function(text): """Return True if text is the beginning of the function definition.""" if isinstance(text, str) or isinstance(text, unicode): function_prefix = ['def', 'async def'] text = text.lstrip() for prefix in function_prefix: if text.startswith(...
[ "def", "is_start_of_function", "(", "text", ")", ":", "if", "isinstance", "(", "text", ",", "str", ")", "or", "isinstance", "(", "text", ",", "unicode", ")", ":", "function_prefix", "=", "[", "'def'", ",", "'async def'", "]", "text", "=", "text", ".", ...
Return True if text is the beginning of the function definition.
[ "Return", "True", "if", "text", "is", "the", "beginning", "of", "the", "function", "definition", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/extensions/docstring.py#L23-L33
train
Return True if text is the beginning of the function definition.
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/extensions/docstring.py
get_indent
def get_indent(text): """Get indent of text. https://stackoverflow.com/questions/2268532/grab-a-lines-whitespace- indention-with-python """ indent = '' ret = re.match(r'(\s*)', text) if ret: indent = ret.group(1) return indent
python
def get_indent(text): """Get indent of text. https://stackoverflow.com/questions/2268532/grab-a-lines-whitespace- indention-with-python """ indent = '' ret = re.match(r'(\s*)', text) if ret: indent = ret.group(1) return indent
[ "def", "get_indent", "(", "text", ")", ":", "indent", "=", "''", "ret", "=", "re", ".", "match", "(", "r'(\\s*)'", ",", "text", ")", "if", "ret", ":", "indent", "=", "ret", ".", "group", "(", "1", ")", "return", "indent" ]
Get indent of text. https://stackoverflow.com/questions/2268532/grab-a-lines-whitespace- indention-with-python
[ "Get", "indent", "of", "text", ".", "https", ":", "//", "stackoverflow", ".", "com", "/", "questions", "/", "2268532", "/", "grab", "-", "a", "-", "lines", "-", "whitespace", "-", "indention", "-", "with", "-", "python" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/extensions/docstring.py#L36-L48
train
Get indent of 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/extensions/docstring.py
DocstringWriterExtension.get_function_definition_from_first_line
def get_function_definition_from_first_line(self): """Get func def when the cursor is located on the first def line.""" document = self.code_editor.document() cursor = QTextCursor( document.findBlockByLineNumber(self.line_number_cursor - 1)) func_text = '' fun...
python
def get_function_definition_from_first_line(self): """Get func def when the cursor is located on the first def line.""" document = self.code_editor.document() cursor = QTextCursor( document.findBlockByLineNumber(self.line_number_cursor - 1)) func_text = '' fun...
[ "def", "get_function_definition_from_first_line", "(", "self", ")", ":", "document", "=", "self", ".", "code_editor", ".", "document", "(", ")", "cursor", "=", "QTextCursor", "(", "document", ".", "findBlockByLineNumber", "(", "self", ".", "line_number_cursor", "-...
Get func def when the cursor is located on the first def line.
[ "Get", "func", "def", "when", "the", "cursor", "is", "located", "on", "the", "first", "def", "line", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/extensions/docstring.py#L70-L115
train
Get function definition when the cursor is located on the first def 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/extensions/docstring.py
DocstringWriterExtension.get_function_definition_from_below_last_line
def get_function_definition_from_below_last_line(self): """Get func def when the cursor is located below the last def line.""" cursor = self.code_editor.textCursor() func_text = '' is_first_line = True line_number = cursor.blockNumber() + 1 number_of_lines_of_functi...
python
def get_function_definition_from_below_last_line(self): """Get func def when the cursor is located below the last def line.""" cursor = self.code_editor.textCursor() func_text = '' is_first_line = True line_number = cursor.blockNumber() + 1 number_of_lines_of_functi...
[ "def", "get_function_definition_from_below_last_line", "(", "self", ")", ":", "cursor", "=", "self", ".", "code_editor", ".", "textCursor", "(", ")", "func_text", "=", "''", "is_first_line", "=", "True", "line_number", "=", "cursor", ".", "blockNumber", "(", ")"...
Get func def when the cursor is located below the last def line.
[ "Get", "func", "def", "when", "the", "cursor", "is", "located", "below", "the", "last", "def", "line", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/extensions/docstring.py#L117-L148
train
Get func def when the cursor is located below the last 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/extensions/docstring.py
DocstringWriterExtension.get_function_body
def get_function_body(self, func_indent): """Get the function body text.""" cursor = self.code_editor.textCursor() line_number = cursor.blockNumber() + 1 number_of_lines = self.code_editor.blockCount() body_list = [] for idx in range(number_of_lines - line_number ...
python
def get_function_body(self, func_indent): """Get the function body text.""" cursor = self.code_editor.textCursor() line_number = cursor.blockNumber() + 1 number_of_lines = self.code_editor.blockCount() body_list = [] for idx in range(number_of_lines - line_number ...
[ "def", "get_function_body", "(", "self", ",", "func_indent", ")", ":", "cursor", "=", "self", ".", "code_editor", ".", "textCursor", "(", ")", "line_number", "=", "cursor", ".", "blockNumber", "(", ")", "+", "1", "number_of_lines", "=", "self", ".", "code_...
Get the function body text.
[ "Get", "the", "function", "body", "text", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/extensions/docstring.py#L150-L170
train
Get the function body 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/extensions/docstring.py
DocstringWriterExtension.write_docstring
def write_docstring(self): """Write docstring to editor.""" line_to_cursor = self.code_editor.get_text('sol', 'cursor') if self.is_beginning_triple_quotes(line_to_cursor): cursor = self.code_editor.textCursor() prev_pos = cursor.position() quote = line...
python
def write_docstring(self): """Write docstring to editor.""" line_to_cursor = self.code_editor.get_text('sol', 'cursor') if self.is_beginning_triple_quotes(line_to_cursor): cursor = self.code_editor.textCursor() prev_pos = cursor.position() quote = line...
[ "def", "write_docstring", "(", "self", ")", ":", "line_to_cursor", "=", "self", ".", "code_editor", ".", "get_text", "(", "'sol'", ",", "'cursor'", ")", "if", "self", ".", "is_beginning_triple_quotes", "(", "line_to_cursor", ")", ":", "cursor", "=", "self", ...
Write docstring to editor.
[ "Write", "docstring", "to", "editor", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/extensions/docstring.py#L172-L195
train
Write docstring to 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/plugins/editor/extensions/docstring.py
DocstringWriterExtension.write_docstring_at_first_line_of_function
def write_docstring_at_first_line_of_function(self): """Write docstring to editor at mouse position.""" result = self.get_function_definition_from_first_line() editor = self.code_editor if result: func_text, number_of_line_func = result line_number_function ...
python
def write_docstring_at_first_line_of_function(self): """Write docstring to editor at mouse position.""" result = self.get_function_definition_from_first_line() editor = self.code_editor if result: func_text, number_of_line_func = result line_number_function ...
[ "def", "write_docstring_at_first_line_of_function", "(", "self", ")", ":", "result", "=", "self", ".", "get_function_definition_from_first_line", "(", ")", "editor", "=", "self", ".", "code_editor", "if", "result", ":", "func_text", ",", "number_of_line_func", "=", ...
Write docstring to editor at mouse position.
[ "Write", "docstring", "to", "editor", "at", "mouse", "position", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/extensions/docstring.py#L197-L220
train
Write docstring to editor at mouse 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/extensions/docstring.py
DocstringWriterExtension.write_docstring_for_shortcut
def write_docstring_for_shortcut(self): """Write docstring to editor by shortcut of code editor.""" # cursor placed below function definition result = self.get_function_definition_from_below_last_line() if result is not None: __, number_of_lines_of_function = result ...
python
def write_docstring_for_shortcut(self): """Write docstring to editor by shortcut of code editor.""" # cursor placed below function definition result = self.get_function_definition_from_below_last_line() if result is not None: __, number_of_lines_of_function = result ...
[ "def", "write_docstring_for_shortcut", "(", "self", ")", ":", "# cursor placed below function definition\r", "result", "=", "self", ".", "get_function_definition_from_below_last_line", "(", ")", "if", "result", "is", "not", "None", ":", "__", ",", "number_of_lines_of_func...
Write docstring to editor by shortcut of code editor.
[ "Write", "docstring", "to", "editor", "by", "shortcut", "of", "code", "editor", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/extensions/docstring.py#L222-L237
train
Write docstring to editor by shortcut of code 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/plugins/editor/extensions/docstring.py
DocstringWriterExtension._generate_docstring
def _generate_docstring(self, doc_type, quote): """Generate docstring.""" docstring = None self.quote3 = quote * 3 if quote == '"': self.quote3_other = "'''" else: self.quote3_other = '"""' result = self.get_function_definition_from_bel...
python
def _generate_docstring(self, doc_type, quote): """Generate docstring.""" docstring = None self.quote3 = quote * 3 if quote == '"': self.quote3_other = "'''" else: self.quote3_other = '"""' result = self.get_function_definition_from_bel...
[ "def", "_generate_docstring", "(", "self", ",", "doc_type", ",", "quote", ")", ":", "docstring", "=", "None", "self", ".", "quote3", "=", "quote", "*", "3", "if", "quote", "==", "'\"'", ":", "self", ".", "quote3_other", "=", "\"'''\"", "else", ":", "se...
Generate docstring.
[ "Generate", "docstring", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/extensions/docstring.py#L239-L266
train
Generate docstring.
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/extensions/docstring.py
DocstringWriterExtension._generate_numpy_doc
def _generate_numpy_doc(self, func_info): """Generate a docstring of numpy type.""" numpy_doc = '' arg_names = func_info.arg_name_list arg_types = func_info.arg_type_list arg_values = func_info.arg_value_list if len(arg_names) > 0 and arg_names[0] == 'self': ...
python
def _generate_numpy_doc(self, func_info): """Generate a docstring of numpy type.""" numpy_doc = '' arg_names = func_info.arg_name_list arg_types = func_info.arg_type_list arg_values = func_info.arg_value_list if len(arg_names) > 0 and arg_names[0] == 'self': ...
[ "def", "_generate_numpy_doc", "(", "self", ",", "func_info", ")", ":", "numpy_doc", "=", "''", "arg_names", "=", "func_info", ".", "arg_name_list", "arg_types", "=", "func_info", ".", "arg_type_list", "arg_values", "=", "func_info", ".", "arg_value_list", "if", ...
Generate a docstring of numpy type.
[ "Generate", "a", "docstring", "of", "numpy", "type", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/extensions/docstring.py#L268-L349
train
Generate a docstring of numpy type.
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/extensions/docstring.py
DocstringWriterExtension.find_top_level_bracket_locations
def find_top_level_bracket_locations(string_toparse): """Get the locations of top-level brackets in a string.""" bracket_stack = [] replace_args_list = [] bracket_type = None literal_type = '' brackets = {'(': ')', '[': ']', '{': '}'} for idx, character in ...
python
def find_top_level_bracket_locations(string_toparse): """Get the locations of top-level brackets in a string.""" bracket_stack = [] replace_args_list = [] bracket_type = None literal_type = '' brackets = {'(': ')', '[': ']', '{': '}'} for idx, character in ...
[ "def", "find_top_level_bracket_locations", "(", "string_toparse", ")", ":", "bracket_stack", "=", "[", "]", "replace_args_list", "=", "[", "]", "bracket_type", "=", "None", "literal_type", "=", "''", "brackets", "=", "{", "'('", ":", "')'", ",", "'['", ":", ...
Get the locations of top-level brackets in a string.
[ "Get", "the", "locations", "of", "top", "-", "level", "brackets", "in", "a", "string", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/extensions/docstring.py#L434-L476
train
Get the locations of top - level brackets in a 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/plugins/editor/extensions/docstring.py
DocstringWriterExtension.parse_return_elements
def parse_return_elements(return_vals_group, return_element_name, return_element_type, placeholder): """Return the appropriate text for a group of return elements.""" all_eq = (return_vals_group.count(return_vals_group[0]) == len(return_vals_group)) ...
python
def parse_return_elements(return_vals_group, return_element_name, return_element_type, placeholder): """Return the appropriate text for a group of return elements.""" all_eq = (return_vals_group.count(return_vals_group[0]) == len(return_vals_group)) ...
[ "def", "parse_return_elements", "(", "return_vals_group", ",", "return_element_name", ",", "return_element_type", ",", "placeholder", ")", ":", "all_eq", "=", "(", "return_vals_group", ".", "count", "(", "return_vals_group", "[", "0", "]", ")", "==", "len", "(", ...
Return the appropriate text for a group of return elements.
[ "Return", "the", "appropriate", "text", "for", "a", "group", "of", "return", "elements", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/extensions/docstring.py#L479-L524
train
Parse a group of return elements into a 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/plugins/editor/extensions/docstring.py
DocstringWriterExtension._generate_docstring_return_section
def _generate_docstring_return_section(self, return_vals, header, return_element_name, return_element_type, placeholder, indent): """Generate the Returns section of a function/met...
python
def _generate_docstring_return_section(self, return_vals, header, return_element_name, return_element_type, placeholder, indent): """Generate the Returns section of a function/met...
[ "def", "_generate_docstring_return_section", "(", "self", ",", "return_vals", ",", "header", ",", "return_element_name", ",", "return_element_type", ",", "placeholder", ",", "indent", ")", ":", "# If all return values are None, return none\r", "non_none_vals", "=", "[", "...
Generate the Returns section of a function/method docstring.
[ "Generate", "the", "Returns", "section", "of", "a", "function", "/", "method", "docstring", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/extensions/docstring.py#L526-L589
train
Generate the docstring for a function or method returns section.
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/extensions/docstring.py
FunctionInfo.is_char_in_pairs
def is_char_in_pairs(pos_char, pairs): """Return True if the charactor is in pairs of brackets or quotes.""" for pos_left, pos_right in pairs.items(): if pos_left < pos_char < pos_right: return True return False
python
def is_char_in_pairs(pos_char, pairs): """Return True if the charactor is in pairs of brackets or quotes.""" for pos_left, pos_right in pairs.items(): if pos_left < pos_char < pos_right: return True return False
[ "def", "is_char_in_pairs", "(", "pos_char", ",", "pairs", ")", ":", "for", "pos_left", ",", "pos_right", "in", "pairs", ".", "items", "(", ")", ":", "if", "pos_left", "<", "pos_char", "<", "pos_right", ":", "return", "True", "return", "False" ]
Return True if the charactor is in pairs of brackets or quotes.
[ "Return", "True", "if", "the", "charactor", "is", "in", "pairs", "of", "brackets", "or", "quotes", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/extensions/docstring.py#L610-L616
train
Return True if the charactor is in pairs of brackets or quotes.
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/extensions/docstring.py
FunctionInfo._find_quote_position
def _find_quote_position(text): """Return the start and end position of pairs of quotes.""" pos = {} is_found_left_quote = False for idx, character in enumerate(text): if is_found_left_quote is False: if character == "'" or character == '"': ...
python
def _find_quote_position(text): """Return the start and end position of pairs of quotes.""" pos = {} is_found_left_quote = False for idx, character in enumerate(text): if is_found_left_quote is False: if character == "'" or character == '"': ...
[ "def", "_find_quote_position", "(", "text", ")", ":", "pos", "=", "{", "}", "is_found_left_quote", "=", "False", "for", "idx", ",", "character", "in", "enumerate", "(", "text", ")", ":", "if", "is_found_left_quote", "is", "False", ":", "if", "character", "...
Return the start and end position of pairs of quotes.
[ "Return", "the", "start", "and", "end", "position", "of", "pairs", "of", "quotes", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/extensions/docstring.py#L619-L638
train
Find the start and end position of pairs of quotes.
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/extensions/docstring.py
FunctionInfo._find_bracket_position
def _find_bracket_position(self, text, bracket_left, bracket_right, pos_quote): """Return the start and end position of pairs of brackets. https://stackoverflow.com/questions/29991917/ indices-of-matching-parentheses-in-python """ pos = {} ...
python
def _find_bracket_position(self, text, bracket_left, bracket_right, pos_quote): """Return the start and end position of pairs of brackets. https://stackoverflow.com/questions/29991917/ indices-of-matching-parentheses-in-python """ pos = {} ...
[ "def", "_find_bracket_position", "(", "self", ",", "text", ",", "bracket_left", ",", "bracket_right", ",", "pos_quote", ")", ":", "pos", "=", "{", "}", "pstack", "=", "[", "]", "for", "idx", ",", "character", "in", "enumerate", "(", "text", ")", ":", "...
Return the start and end position of pairs of brackets. https://stackoverflow.com/questions/29991917/ indices-of-matching-parentheses-in-python
[ "Return", "the", "start", "and", "end", "position", "of", "pairs", "of", "brackets", ".", "https", ":", "//", "stackoverflow", ".", "com", "/", "questions", "/", "29991917", "/", "indices", "-", "of", "-", "matching", "-", "parentheses", "-", "in", "-", ...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/extensions/docstring.py#L640-L665
train
Find the start and end position of pairs of brackets.
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/extensions/docstring.py
FunctionInfo.split_arg_to_name_type_value
def split_arg_to_name_type_value(self, args_list): """Split argument text to name, type, value.""" for arg in args_list: arg_type = None arg_value = None has_type = False has_value = False pos_colon = arg.find(':') pos_e...
python
def split_arg_to_name_type_value(self, args_list): """Split argument text to name, type, value.""" for arg in args_list: arg_type = None arg_value = None has_type = False has_value = False pos_colon = arg.find(':') pos_e...
[ "def", "split_arg_to_name_type_value", "(", "self", ",", "args_list", ")", ":", "for", "arg", "in", "args_list", ":", "arg_type", "=", "None", "arg_value", "=", "None", "has_type", "=", "False", "has_value", "=", "False", "pos_colon", "=", "arg", ".", "find"...
Split argument text to name, type, value.
[ "Split", "argument", "text", "to", "name", "type", "value", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/extensions/docstring.py#L667-L703
train
Split argument text to name type 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/plugins/editor/extensions/docstring.py
FunctionInfo.split_args_text_to_list
def split_args_text_to_list(self, args_text): """Split the text including multiple arguments to list. This function uses a comma to separate arguments and ignores a comma in brackets ans quotes. """ args_list = [] idx_find_start = 0 idx_arg_start = 0 ...
python
def split_args_text_to_list(self, args_text): """Split the text including multiple arguments to list. This function uses a comma to separate arguments and ignores a comma in brackets ans quotes. """ args_list = [] idx_find_start = 0 idx_arg_start = 0 ...
[ "def", "split_args_text_to_list", "(", "self", ",", "args_text", ")", ":", "args_list", "=", "[", "]", "idx_find_start", "=", "0", "idx_arg_start", "=", "0", "try", ":", "pos_quote", "=", "self", ".", "_find_quote_position", "(", "args_text", ")", "pos_round",...
Split the text including multiple arguments to list. This function uses a comma to separate arguments and ignores a comma in brackets ans quotes.
[ "Split", "the", "text", "including", "multiple", "arguments", "to", "list", ".", "This", "function", "uses", "a", "comma", "to", "separate", "arguments", "and", "ignores", "a", "comma", "in", "brackets", "ans", "quotes", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/extensions/docstring.py#L705-L746
train
Split the text including multiple arguments to 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/plugins/editor/extensions/docstring.py
FunctionInfo.parse_def
def parse_def(self, text): """Parse the function definition text.""" self.__init__() if not is_start_of_function(text): return self.func_indent = get_indent(text) text = text.strip() text = text.replace('\r\n', '') text = text.replace('\n...
python
def parse_def(self, text): """Parse the function definition text.""" self.__init__() if not is_start_of_function(text): return self.func_indent = get_indent(text) text = text.strip() text = text.replace('\r\n', '') text = text.replace('\n...
[ "def", "parse_def", "(", "self", ",", "text", ")", ":", "self", ".", "__init__", "(", ")", "if", "not", "is_start_of_function", "(", "text", ")", ":", "return", "self", ".", "func_indent", "=", "get_indent", "(", "text", ")", "text", "=", "text", ".", ...
Parse the function definition text.
[ "Parse", "the", "function", "definition", "text", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/extensions/docstring.py#L748-L777
train
Parse the function definition 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/extensions/docstring.py
FunctionInfo.parse_body
def parse_body(self, text): """Parse the function body text.""" re_raise = re.findall(r'[ \t]raise ([a-zA-Z0-9_]*)', text) if len(re_raise) > 0: self.raise_list = [x.strip() for x in re_raise] # remove duplicates from list while keeping it in the order #...
python
def parse_body(self, text): """Parse the function body text.""" re_raise = re.findall(r'[ \t]raise ([a-zA-Z0-9_]*)', text) if len(re_raise) > 0: self.raise_list = [x.strip() for x in re_raise] # remove duplicates from list while keeping it in the order #...
[ "def", "parse_body", "(", "self", ",", "text", ")", ":", "re_raise", "=", "re", ".", "findall", "(", "r'[ \\t]raise ([a-zA-Z0-9_]*)'", ",", "text", ")", "if", "len", "(", "re_raise", ")", ">", "0", ":", "self", ".", "raise_list", "=", "[", "x", ".", ...
Parse the function body text.
[ "Parse", "the", "function", "body", "text", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/extensions/docstring.py#L779-L829
train
Parse the function body 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/extensions/docstring.py
QMenuOnlyForEnter.keyPressEvent
def keyPressEvent(self, event): """Close the instance if key is not enter key.""" key = event.key() if key not in (Qt.Key_Enter, Qt.Key_Return): self.code_editor.keyPressEvent(event) self.close() else: super(QMenuOnlyForEnter, self).keyPressEven...
python
def keyPressEvent(self, event): """Close the instance if key is not enter key.""" key = event.key() if key not in (Qt.Key_Enter, Qt.Key_Return): self.code_editor.keyPressEvent(event) self.close() else: super(QMenuOnlyForEnter, self).keyPressEven...
[ "def", "keyPressEvent", "(", "self", ",", "event", ")", ":", "key", "=", "event", ".", "key", "(", ")", "if", "key", "not", "in", "(", "Qt", ".", "Key_Enter", ",", "Qt", ".", "Key_Return", ")", ":", "self", ".", "code_editor", ".", "keyPressEvent", ...
Close the instance if key is not enter key.
[ "Close", "the", "instance", "if", "key", "is", "not", "enter", "key", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/extensions/docstring.py#L844-L851
train
Close the instance if key is not enter key.
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/app/restart.py
_is_pid_running_on_windows
def _is_pid_running_on_windows(pid): """Check if a process is running on windows systems based on the pid.""" pid = str(pid) # Hide flashing command prompt startupinfo = subprocess.STARTUPINFO() startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW process = subprocess.Popen(r'tasklis...
python
def _is_pid_running_on_windows(pid): """Check if a process is running on windows systems based on the pid.""" pid = str(pid) # Hide flashing command prompt startupinfo = subprocess.STARTUPINFO() startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW process = subprocess.Popen(r'tasklis...
[ "def", "_is_pid_running_on_windows", "(", "pid", ")", ":", "pid", "=", "str", "(", "pid", ")", "# Hide flashing command prompt\r", "startupinfo", "=", "subprocess", ".", "STARTUPINFO", "(", ")", "startupinfo", ".", "dwFlags", "|=", "subprocess", ".", "STARTF_USESH...
Check if a process is running on windows systems based on the pid.
[ "Check", "if", "a", "process", "is", "running", "on", "windows", "systems", "based", "on", "the", "pid", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/app/restart.py#L42-L59
train
Check if a process is running on windows systems based on the pid.
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/app/restart.py
Restarter._show_message
def _show_message(self, text): """Show message on splash screen.""" self.splash.showMessage(text, Qt.AlignBottom | Qt.AlignCenter | Qt.AlignAbsolute, QColor(Qt.white))
python
def _show_message(self, text): """Show message on splash screen.""" self.splash.showMessage(text, Qt.AlignBottom | Qt.AlignCenter | Qt.AlignAbsolute, QColor(Qt.white))
[ "def", "_show_message", "(", "self", ",", "text", ")", ":", "self", ".", "splash", ".", "showMessage", "(", "text", ",", "Qt", ".", "AlignBottom", "|", "Qt", ".", "AlignCenter", "|", "Qt", ".", "AlignAbsolute", ",", "QColor", "(", "Qt", ".", "white", ...
Show message on splash screen.
[ "Show", "message", "on", "splash", "screen", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/app/restart.py#L106-L109
train
Show message on splash screen.
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/app/restart.py
Restarter.animate_ellipsis
def animate_ellipsis(self): """Animate dots at the end of the splash screen message.""" ellipsis = self.ellipsis.pop(0) text = ' '*len(ellipsis) + self.splash_text + ellipsis self.ellipsis.append(ellipsis) self._show_message(text)
python
def animate_ellipsis(self): """Animate dots at the end of the splash screen message.""" ellipsis = self.ellipsis.pop(0) text = ' '*len(ellipsis) + self.splash_text + ellipsis self.ellipsis.append(ellipsis) self._show_message(text)
[ "def", "animate_ellipsis", "(", "self", ")", ":", "ellipsis", "=", "self", ".", "ellipsis", ".", "pop", "(", "0", ")", "text", "=", "' '", "*", "len", "(", "ellipsis", ")", "+", "self", ".", "splash_text", "+", "ellipsis", "self", ".", "ellipsis", "....
Animate dots at the end of the splash screen message.
[ "Animate", "dots", "at", "the", "end", "of", "the", "splash", "screen", "message", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/app/restart.py#L111-L116
train
Animate dots at the end of the splash screen message.
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/app/restart.py
Restarter.set_splash_message
def set_splash_message(self, text): """Sets the text in the bottom of the Splash screen.""" self.splash_text = text self._show_message(text) self.timer_ellipsis.start(500)
python
def set_splash_message(self, text): """Sets the text in the bottom of the Splash screen.""" self.splash_text = text self._show_message(text) self.timer_ellipsis.start(500)
[ "def", "set_splash_message", "(", "self", ",", "text", ")", ":", "self", ".", "splash_text", "=", "text", "self", ".", "_show_message", "(", "text", ")", "self", ".", "timer_ellipsis", ".", "start", "(", "500", ")" ]
Sets the text in the bottom of the Splash screen.
[ "Sets", "the", "text", "in", "the", "bottom", "of", "the", "Splash", "screen", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/app/restart.py#L118-L122
train
Sets the text in the bottom of the Splash screen.
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/app/restart.py
Restarter.launch_error_message
def launch_error_message(self, error_type, error=None): """Launch a message box with a predefined error message. Parameters ---------- error_type : int [CLOSE_ERROR, RESET_ERROR, RESTART_ERROR] Possible error codes when restarting/reseting spyder. error : Exce...
python
def launch_error_message(self, error_type, error=None): """Launch a message box with a predefined error message. Parameters ---------- error_type : int [CLOSE_ERROR, RESET_ERROR, RESTART_ERROR] Possible error codes when restarting/reseting spyder. error : Exce...
[ "def", "launch_error_message", "(", "self", ",", "error_type", ",", "error", "=", "None", ")", ":", "messages", "=", "{", "CLOSE_ERROR", ":", "_", "(", "\"It was not possible to close the previous \"", "\"Spyder instance.\\nRestart aborted.\"", ")", ",", "RESET_ERROR", ...
Launch a message box with a predefined error message. Parameters ---------- error_type : int [CLOSE_ERROR, RESET_ERROR, RESTART_ERROR] Possible error codes when restarting/reseting spyder. error : Exception Actual Python exception error caught.
[ "Launch", "a", "message", "box", "with", "a", "predefined", "error", "message", ".", "Parameters", "----------", "error_type", ":", "int", "[", "CLOSE_ERROR", "RESET_ERROR", "RESTART_ERROR", "]", "Possible", "error", "codes", "when", "restarting", "/", "reseting",...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/app/restart.py#L124-L153
train
Launch a message box with a predefined error message.
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/history/plugin.py
HistoryLog.refresh_plugin
def refresh_plugin(self): """Refresh tabwidget""" if self.tabwidget.count(): editor = self.tabwidget.currentWidget() else: editor = None self.find_widget.set_editor(editor)
python
def refresh_plugin(self): """Refresh tabwidget""" if self.tabwidget.count(): editor = self.tabwidget.currentWidget() else: editor = None self.find_widget.set_editor(editor)
[ "def", "refresh_plugin", "(", "self", ")", ":", "if", "self", ".", "tabwidget", ".", "count", "(", ")", ":", "editor", "=", "self", ".", "tabwidget", ".", "currentWidget", "(", ")", "else", ":", "editor", "=", "None", "self", ".", "find_widget", ".", ...
Refresh tabwidget
[ "Refresh", "tabwidget" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/history/plugin.py#L104-L110
train
Refresh the plugin
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/history/plugin.py
HistoryLog.get_plugin_actions
def get_plugin_actions(self): """Return a list of actions related to plugin""" self.history_action = create_action(self, _("History..."), None, ima.icon('history'), _("Set history maximum entries"), ...
python
def get_plugin_actions(self): """Return a list of actions related to plugin""" self.history_action = create_action(self, _("History..."), None, ima.icon('history'), _("Set history maximum entries"), ...
[ "def", "get_plugin_actions", "(", "self", ")", ":", "self", ".", "history_action", "=", "create_action", "(", "self", ",", "_", "(", "\"History...\"", ")", ",", "None", ",", "ima", ".", "icon", "(", "'history'", ")", ",", "_", "(", "\"Set history maximum e...
Return a list of actions related to plugin
[ "Return", "a", "list", "of", "actions", "related", "to", "plugin" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/history/plugin.py#L112-L127
train
Return a list of actions related to the plugin
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/history/plugin.py
HistoryLog.register_plugin
def register_plugin(self): """Register plugin in Spyder's main window""" self.focus_changed.connect(self.main.plugin_focus_changed) self.main.add_dockwidget(self) # self.main.console.set_historylog(self) self.main.console.shell.refresh.connect(self.refresh_plugin)
python
def register_plugin(self): """Register plugin in Spyder's main window""" self.focus_changed.connect(self.main.plugin_focus_changed) self.main.add_dockwidget(self) # self.main.console.set_historylog(self) self.main.console.shell.refresh.connect(self.refresh_plugin)
[ "def", "register_plugin", "(", "self", ")", ":", "self", ".", "focus_changed", ".", "connect", "(", "self", ".", "main", ".", "plugin_focus_changed", ")", "self", ".", "main", ".", "add_dockwidget", "(", "self", ")", "# self.main.console.set_historylog(self...
Register plugin in Spyder's main window
[ "Register", "plugin", "in", "Spyder", "s", "main", "window" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/history/plugin.py#L133-L138
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/history/plugin.py
HistoryLog.update_font
def update_font(self): """Update font from Preferences""" color_scheme = self.get_color_scheme() font = self.get_plugin_font() for editor in self.editors: editor.set_font(font, color_scheme)
python
def update_font(self): """Update font from Preferences""" color_scheme = self.get_color_scheme() font = self.get_plugin_font() for editor in self.editors: editor.set_font(font, color_scheme)
[ "def", "update_font", "(", "self", ")", ":", "color_scheme", "=", "self", ".", "get_color_scheme", "(", ")", "font", "=", "self", ".", "get_plugin_font", "(", ")", "for", "editor", "in", "self", ".", "editors", ":", "editor", ".", "set_font", "(", "font"...
Update font from Preferences
[ "Update", "font", "from", "Preferences" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/history/plugin.py#L140-L145
train
Update font from preferences
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/history/plugin.py
HistoryLog.apply_plugin_settings
def apply_plugin_settings(self, options): """Apply configuration file's plugin settings""" color_scheme_n = 'color_scheme_name' color_scheme_o = self.get_color_scheme() font_n = 'plugin_font' font_o = self.get_plugin_font() wrap_n = 'wrap' wrap_o = self.get...
python
def apply_plugin_settings(self, options): """Apply configuration file's plugin settings""" color_scheme_n = 'color_scheme_name' color_scheme_o = self.get_color_scheme() font_n = 'plugin_font' font_o = self.get_plugin_font() wrap_n = 'wrap' wrap_o = self.get...
[ "def", "apply_plugin_settings", "(", "self", ",", "options", ")", ":", "color_scheme_n", "=", "'color_scheme_name'", "color_scheme_o", "=", "self", ".", "get_color_scheme", "(", ")", "font_n", "=", "'plugin_font'", "font_o", "=", "self", ".", "get_plugin_font", "(...
Apply configuration file's plugin settings
[ "Apply", "configuration", "file", "s", "plugin", "settings" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/history/plugin.py#L147-L167
train
Applies configuration file s plugin settings to the current configuration file s editor settings.
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/history/plugin.py
HistoryLog.add_history
def add_history(self, filename): """ Add new history tab Slot for add_history signal emitted by shell instance """ filename = encoding.to_unicode_from_fs(filename) if filename in self.filenames: return editor = codeeditor.CodeEditor(self) ...
python
def add_history(self, filename): """ Add new history tab Slot for add_history signal emitted by shell instance """ filename = encoding.to_unicode_from_fs(filename) if filename in self.filenames: return editor = codeeditor.CodeEditor(self) ...
[ "def", "add_history", "(", "self", ",", "filename", ")", ":", "filename", "=", "encoding", ".", "to_unicode_from_fs", "(", "filename", ")", "if", "filename", "in", "self", ".", "filenames", ":", "return", "editor", "=", "codeeditor", ".", "CodeEditor", "(", ...
Add new history tab Slot for add_history signal emitted by shell instance
[ "Add", "new", "history", "tab", "Slot", "for", "add_history", "signal", "emitted", "by", "shell", "instance" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/history/plugin.py#L181-L228
train
Add new history tab
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/history/plugin.py
HistoryLog.toggle_wrap_mode
def toggle_wrap_mode(self, checked): """Toggle wrap mode""" if self.tabwidget is None: return for editor in self.editors: editor.toggle_wrap_mode(checked) self.set_option('wrap', checked)
python
def toggle_wrap_mode(self, checked): """Toggle wrap mode""" if self.tabwidget is None: return for editor in self.editors: editor.toggle_wrap_mode(checked) self.set_option('wrap', checked)
[ "def", "toggle_wrap_mode", "(", "self", ",", "checked", ")", ":", "if", "self", ".", "tabwidget", "is", "None", ":", "return", "for", "editor", "in", "self", ".", "editors", ":", "editor", ".", "toggle_wrap_mode", "(", "checked", ")", "self", ".", "set_o...
Toggle wrap mode
[ "Toggle", "wrap", "mode" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/history/plugin.py#L256-L262
train
Toggle wrap mode
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/history/plugin.py
HistoryLog.toggle_line_numbers
def toggle_line_numbers(self, checked): """Toggle line numbers.""" if self.tabwidget is None: return for editor in self.editors: editor.toggle_line_numbers(linenumbers=checked, markers=False) self.set_option('line_numbers', checked)
python
def toggle_line_numbers(self, checked): """Toggle line numbers.""" if self.tabwidget is None: return for editor in self.editors: editor.toggle_line_numbers(linenumbers=checked, markers=False) self.set_option('line_numbers', checked)
[ "def", "toggle_line_numbers", "(", "self", ",", "checked", ")", ":", "if", "self", ".", "tabwidget", "is", "None", ":", "return", "for", "editor", "in", "self", ".", "editors", ":", "editor", ".", "toggle_line_numbers", "(", "linenumbers", "=", "checked", ...
Toggle line numbers.
[ "Toggle", "line", "numbers", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/history/plugin.py#L265-L271
train
Toggle line numbers.
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/lsp/providers/document.py
DocumentProvider.document_did_save_notification
def document_did_save_notification(self, params): """ Handle the textDocument/didSave message received from an LSP server. """ text = None if 'text' in params: text = params['text'] params = { 'textDocument': { 'uri': path_as_uri(pa...
python
def document_did_save_notification(self, params): """ Handle the textDocument/didSave message received from an LSP server. """ text = None if 'text' in params: text = params['text'] params = { 'textDocument': { 'uri': path_as_uri(pa...
[ "def", "document_did_save_notification", "(", "self", ",", "params", ")", ":", "text", "=", "None", "if", "'text'", "in", "params", ":", "text", "=", "params", "[", "'text'", "]", "params", "=", "{", "'textDocument'", ":", "{", "'uri'", ":", "path_as_uri",...
Handle the textDocument/didSave message received from an LSP server.
[ "Handle", "the", "textDocument", "/", "didSave", "message", "received", "from", "an", "LSP", "server", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/lsp/providers/document.py#L216-L230
train
Handle the textDocument / didSave notification received from an LSP server.
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/browser.py
WebPage.acceptNavigationRequest
def acceptNavigationRequest(self, url, navigation_type, isMainFrame): """ Overloaded method to handle links ourselves """ if navigation_type == QWebEnginePage.NavigationTypeLinkClicked: self.linkClicked.emit(url) return False return True
python
def acceptNavigationRequest(self, url, navigation_type, isMainFrame): """ Overloaded method to handle links ourselves """ if navigation_type == QWebEnginePage.NavigationTypeLinkClicked: self.linkClicked.emit(url) return False return True
[ "def", "acceptNavigationRequest", "(", "self", ",", "url", ",", "navigation_type", ",", "isMainFrame", ")", ":", "if", "navigation_type", "==", "QWebEnginePage", ".", "NavigationTypeLinkClicked", ":", "self", ".", "linkClicked", ".", "emit", "(", "url", ")", "re...
Overloaded method to handle links ourselves
[ "Overloaded", "method", "to", "handle", "links", "ourselves" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/browser.py#L43-L50
train
Overloaded method to handle links ourselves
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/browser.py
WebView.find_text
def find_text(self, text, changed=True, forward=True, case=False, words=False, regexp=False): """Find text""" if not WEBENGINE: findflag = QWebEnginePage.FindWrapsAroundDocument else: findflag = 0 if not forward: ...
python
def find_text(self, text, changed=True, forward=True, case=False, words=False, regexp=False): """Find text""" if not WEBENGINE: findflag = QWebEnginePage.FindWrapsAroundDocument else: findflag = 0 if not forward: ...
[ "def", "find_text", "(", "self", ",", "text", ",", "changed", "=", "True", ",", "forward", "=", "True", ",", "case", "=", "False", ",", "words", "=", "False", ",", "regexp", "=", "False", ")", ":", "if", "not", "WEBENGINE", ":", "findflag", "=", "Q...
Find text
[ "Find", "text" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/browser.py#L69-L83
train
Find text in the page.
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/browser.py
WebView.apply_zoom_factor
def apply_zoom_factor(self): """Apply zoom factor""" if hasattr(self, 'setZoomFactor'): # Assuming Qt >=v4.5 self.setZoomFactor(self.zoom_factor) else: # Qt v4.4 self.setTextSizeMultiplier(self.zoom_factor)
python
def apply_zoom_factor(self): """Apply zoom factor""" if hasattr(self, 'setZoomFactor'): # Assuming Qt >=v4.5 self.setZoomFactor(self.zoom_factor) else: # Qt v4.4 self.setTextSizeMultiplier(self.zoom_factor)
[ "def", "apply_zoom_factor", "(", "self", ")", ":", "if", "hasattr", "(", "self", ",", "'setZoomFactor'", ")", ":", "# Assuming Qt >=v4.5\r", "self", ".", "setZoomFactor", "(", "self", ".", "zoom_factor", ")", "else", ":", "# Qt v4.4\r", "self", ".", "setTextSi...
Apply zoom factor
[ "Apply", "zoom", "factor" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/browser.py#L135-L142
train
Apply zoom factor to the related 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/widgets/browser.py
WebView.setHtml
def setHtml(self, html, baseUrl=QUrl()): """ Reimplement Qt method to prevent WebEngine to steal focus when setting html on the page Solution taken from https://bugreports.qt.io/browse/QTBUG-52999 """ if WEBENGINE: self.setEnabled(False) ...
python
def setHtml(self, html, baseUrl=QUrl()): """ Reimplement Qt method to prevent WebEngine to steal focus when setting html on the page Solution taken from https://bugreports.qt.io/browse/QTBUG-52999 """ if WEBENGINE: self.setEnabled(False) ...
[ "def", "setHtml", "(", "self", ",", "html", ",", "baseUrl", "=", "QUrl", "(", ")", ")", ":", "if", "WEBENGINE", ":", "self", ".", "setEnabled", "(", "False", ")", "super", "(", "WebView", ",", "self", ")", ".", "setHtml", "(", "html", ",", "baseUrl...
Reimplement Qt method to prevent WebEngine to steal focus when setting html on the page Solution taken from https://bugreports.qt.io/browse/QTBUG-52999
[ "Reimplement", "Qt", "method", "to", "prevent", "WebEngine", "to", "steal", "focus", "when", "setting", "html", "on", "the", "page", "Solution", "taken", "from", "https", ":", "//", "bugreports", ".", "qt", ".", "io", "/", "browse", "/", "QTBUG", "-", "5...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/browser.py#L185-L198
train
Override Qt method to set html on the WebView.
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/browser.py
WebBrowser.go_to
def go_to(self, url_or_text): """Go to page *address*""" if is_text_string(url_or_text): url = QUrl(url_or_text) else: url = url_or_text self.webview.load(url)
python
def go_to(self, url_or_text): """Go to page *address*""" if is_text_string(url_or_text): url = QUrl(url_or_text) else: url = url_or_text self.webview.load(url)
[ "def", "go_to", "(", "self", ",", "url_or_text", ")", ":", "if", "is_text_string", "(", "url_or_text", ")", ":", "url", "=", "QUrl", "(", "url_or_text", ")", "else", ":", "url", "=", "url_or_text", "self", ".", "webview", ".", "load", "(", "url", ")" ]
Go to page *address*
[ "Go", "to", "page", "*", "address", "*" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/browser.py#L283-L289
train
Go to page address or 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/widgets/browser.py
WebBrowser.url_combo_activated
def url_combo_activated(self, valid): """Load URL from combo box first item""" text = to_text_string(self.url_combo.currentText()) self.go_to(self.text_to_url(text))
python
def url_combo_activated(self, valid): """Load URL from combo box first item""" text = to_text_string(self.url_combo.currentText()) self.go_to(self.text_to_url(text))
[ "def", "url_combo_activated", "(", "self", ",", "valid", ")", ":", "text", "=", "to_text_string", "(", "self", ".", "url_combo", ".", "currentText", "(", ")", ")", "self", ".", "go_to", "(", "self", ".", "text_to_url", "(", "text", ")", ")" ]
Load URL from combo box first item
[ "Load", "URL", "from", "combo", "box", "first", "item" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/browser.py#L301-L304
train
Load URL from combo box first item
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/api/plugins.py
PluginWidget.initialize_plugin
def initialize_plugin(self): """ Initialize plugin: connect signals, setup actions, etc. It must be run at the end of __init__ """ self.create_toggle_view_action() self.plugin_actions = self.get_plugin_actions() + [MENU_SEPARATOR, ...
python
def initialize_plugin(self): """ Initialize plugin: connect signals, setup actions, etc. It must be run at the end of __init__ """ self.create_toggle_view_action() self.plugin_actions = self.get_plugin_actions() + [MENU_SEPARATOR, ...
[ "def", "initialize_plugin", "(", "self", ")", ":", "self", ".", "create_toggle_view_action", "(", ")", "self", ".", "plugin_actions", "=", "self", ".", "get_plugin_actions", "(", ")", "+", "[", "MENU_SEPARATOR", ",", "self", ".", "undock_action", "]", "add_act...
Initialize plugin: connect signals, setup actions, etc. It must be run at the end of __init__
[ "Initialize", "plugin", ":", "connect", "signals", "setup", "actions", "etc", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/api/plugins.py#L102-L119
train
Initialize the plugin
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/api/plugins.py
PluginWidget.register_shortcut
def register_shortcut(self, qaction_or_qshortcut, context, name, add_sc_to_tip=False): """ Register QAction or QShortcut to Spyder main application. if add_sc_to_tip is True, the shortcut is added to the action's tooltip """ self.main.register_s...
python
def register_shortcut(self, qaction_or_qshortcut, context, name, add_sc_to_tip=False): """ Register QAction or QShortcut to Spyder main application. if add_sc_to_tip is True, the shortcut is added to the action's tooltip """ self.main.register_s...
[ "def", "register_shortcut", "(", "self", ",", "qaction_or_qshortcut", ",", "context", ",", "name", ",", "add_sc_to_tip", "=", "False", ")", ":", "self", ".", "main", ".", "register_shortcut", "(", "qaction_or_qshortcut", ",", "context", ",", "name", ",", "add_...
Register QAction or QShortcut to Spyder main application. if add_sc_to_tip is True, the shortcut is added to the action's tooltip
[ "Register", "QAction", "or", "QShortcut", "to", "Spyder", "main", "application", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/api/plugins.py#L121-L130
train
Register QAction or QShortcut to Spyder main application.
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/api/plugins.py
PluginWidget.register_widget_shortcuts
def register_widget_shortcuts(self, widget): """ Register widget shortcuts. Widget interface must have a method called 'get_shortcut_data' """ for qshortcut, context, name in widget.get_shortcut_data(): self.register_shortcut(qshortcut, context, name)
python
def register_widget_shortcuts(self, widget): """ Register widget shortcuts. Widget interface must have a method called 'get_shortcut_data' """ for qshortcut, context, name in widget.get_shortcut_data(): self.register_shortcut(qshortcut, context, name)
[ "def", "register_widget_shortcuts", "(", "self", ",", "widget", ")", ":", "for", "qshortcut", ",", "context", ",", "name", "in", "widget", ".", "get_shortcut_data", "(", ")", ":", "self", ".", "register_shortcut", "(", "qshortcut", ",", "context", ",", "name...
Register widget shortcuts. Widget interface must have a method called 'get_shortcut_data'
[ "Register", "widget", "shortcuts", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/api/plugins.py#L132-L139
train
Register widget shortcuts.
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/api/plugins.py
PluginWidget.visibility_changed
def visibility_changed(self, enable): """ Dock widget visibility has changed. """ if self.dockwidget is None: return if enable: self.dockwidget.raise_() widget = self.get_focus_widget() if widget is not None and self.undocked_window...
python
def visibility_changed(self, enable): """ Dock widget visibility has changed. """ if self.dockwidget is None: return if enable: self.dockwidget.raise_() widget = self.get_focus_widget() if widget is not None and self.undocked_window...
[ "def", "visibility_changed", "(", "self", ",", "enable", ")", ":", "if", "self", ".", "dockwidget", "is", "None", ":", "return", "if", "enable", ":", "self", ".", "dockwidget", ".", "raise_", "(", ")", "widget", "=", "self", ".", "get_focus_widget", "(",...
Dock widget visibility has changed.
[ "Dock", "widget", "visibility", "has", "changed", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/api/plugins.py#L141-L157
train
Check if the visibility of the dock widget has changed.
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/api/plugins.py
PluginWidget.set_option
def set_option(self, option, value): """ Set a plugin option in configuration file. Note: Use sig_option_changed to call it from widgets of the same or another plugin. """ CONF.set(self.CONF_SECTION, str(option), value)
python
def set_option(self, option, value): """ Set a plugin option in configuration file. Note: Use sig_option_changed to call it from widgets of the same or another plugin. """ CONF.set(self.CONF_SECTION, str(option), value)
[ "def", "set_option", "(", "self", ",", "option", ",", "value", ")", ":", "CONF", ".", "set", "(", "self", ".", "CONF_SECTION", ",", "str", "(", "option", ")", ",", "value", ")" ]
Set a plugin option in configuration file. Note: Use sig_option_changed to call it from widgets of the same or another plugin.
[ "Set", "a", "plugin", "option", "in", "configuration", "file", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/api/plugins.py#L159-L166
train
Set a plugin option in configuration 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/api/plugins.py
PluginWidget.starting_long_process
def starting_long_process(self, message): """ Showing message in main window's status bar. This also changes mouse cursor to Qt.WaitCursor """ self.show_message(message) QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) QApplication.processEvents()
python
def starting_long_process(self, message): """ Showing message in main window's status bar. This also changes mouse cursor to Qt.WaitCursor """ self.show_message(message) QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) QApplication.processEvents()
[ "def", "starting_long_process", "(", "self", ",", "message", ")", ":", "self", ".", "show_message", "(", "message", ")", "QApplication", ".", "setOverrideCursor", "(", "QCursor", "(", "Qt", ".", "WaitCursor", ")", ")", "QApplication", ".", "processEvents", "("...
Showing message in main window's status bar. This also changes mouse cursor to Qt.WaitCursor
[ "Showing", "message", "in", "main", "window", "s", "status", "bar", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/api/plugins.py#L174-L182
train
Show message in main window s status bar.
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/api/plugins.py
PluginWidget.ending_long_process
def ending_long_process(self, message=""): """ Clear main window's status bar and restore mouse cursor. """ QApplication.restoreOverrideCursor() self.show_message(message, timeout=2000) QApplication.processEvents()
python
def ending_long_process(self, message=""): """ Clear main window's status bar and restore mouse cursor. """ QApplication.restoreOverrideCursor() self.show_message(message, timeout=2000) QApplication.processEvents()
[ "def", "ending_long_process", "(", "self", ",", "message", "=", "\"\"", ")", ":", "QApplication", ".", "restoreOverrideCursor", "(", ")", "self", ".", "show_message", "(", "message", ",", "timeout", "=", "2000", ")", "QApplication", ".", "processEvents", "(", ...
Clear main window's status bar and restore mouse cursor.
[ "Clear", "main", "window", "s", "status", "bar", "and", "restore", "mouse", "cursor", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/api/plugins.py#L184-L190
train
This method is called when the main window is ending long process.
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/api/plugins.py
PluginWidget.show_compatibility_message
def show_compatibility_message(self, message): """ Show compatibility message. """ messageBox = QMessageBox(self) messageBox.setWindowModality(Qt.NonModal) messageBox.setAttribute(Qt.WA_DeleteOnClose) messageBox.setWindowTitle('Compatibility Check') messag...
python
def show_compatibility_message(self, message): """ Show compatibility message. """ messageBox = QMessageBox(self) messageBox.setWindowModality(Qt.NonModal) messageBox.setAttribute(Qt.WA_DeleteOnClose) messageBox.setWindowTitle('Compatibility Check') messag...
[ "def", "show_compatibility_message", "(", "self", ",", "message", ")", ":", "messageBox", "=", "QMessageBox", "(", "self", ")", "messageBox", ".", "setWindowModality", "(", "Qt", ".", "NonModal", ")", "messageBox", ".", "setAttribute", "(", "Qt", ".", "WA_Dele...
Show compatibility message.
[ "Show", "compatibility", "message", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/api/plugins.py#L198-L208
train
Show compatibility message.
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/api/plugins.py
PluginWidget.refresh_actions
def refresh_actions(self): """ Create options menu. """ self.options_menu.clear() # Decide what additional actions to show if self.undocked_window is None: additional_actions = [MENU_SEPARATOR, self.undock_action, ...
python
def refresh_actions(self): """ Create options menu. """ self.options_menu.clear() # Decide what additional actions to show if self.undocked_window is None: additional_actions = [MENU_SEPARATOR, self.undock_action, ...
[ "def", "refresh_actions", "(", "self", ")", ":", "self", ".", "options_menu", ".", "clear", "(", ")", "# Decide what additional actions to show", "if", "self", ".", "undocked_window", "is", "None", ":", "additional_actions", "=", "[", "MENU_SEPARATOR", ",", "self"...
Create options menu.
[ "Create", "options", "menu", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/api/plugins.py#L210-L227
train
Refresh the actions list for the current instance 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/plugins/ipythonconsole/widgets/control.py
ControlWidget._key_paren_left
def _key_paren_left(self, text): """ Action for '(' """ self.current_prompt_pos = self.parentWidget()._prompt_pos if self.get_current_line_to_cursor(): last_obj = self.get_last_obj() if last_obj and not last_obj.isdigit(): self.show_object_info(last_obj) ...
python
def _key_paren_left(self, text): """ Action for '(' """ self.current_prompt_pos = self.parentWidget()._prompt_pos if self.get_current_line_to_cursor(): last_obj = self.get_last_obj() if last_obj and not last_obj.isdigit(): self.show_object_info(last_obj) ...
[ "def", "_key_paren_left", "(", "self", ",", "text", ")", ":", "self", ".", "current_prompt_pos", "=", "self", ".", "parentWidget", "(", ")", ".", "_prompt_pos", "if", "self", ".", "get_current_line_to_cursor", "(", ")", ":", "last_obj", "=", "self", ".", "...
Action for '('
[ "Action", "for", "(" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/widgets/control.py#L47-L54
train
Action for ')'
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/ipythonconsole/widgets/control.py
ControlWidget.keyPressEvent
def keyPressEvent(self, event): """Reimplement Qt Method - Basic keypress event handler""" event, text, key, ctrl, shift = restore_keyevent(event) if key == Qt.Key_ParenLeft and not self.has_selected_text() \ and self.help_enabled and not self.parent()._reading: self._key_p...
python
def keyPressEvent(self, event): """Reimplement Qt Method - Basic keypress event handler""" event, text, key, ctrl, shift = restore_keyevent(event) if key == Qt.Key_ParenLeft and not self.has_selected_text() \ and self.help_enabled and not self.parent()._reading: self._key_p...
[ "def", "keyPressEvent", "(", "self", ",", "event", ")", ":", "event", ",", "text", ",", "key", ",", "ctrl", ",", "shift", "=", "restore_keyevent", "(", "event", ")", "if", "key", "==", "Qt", ".", "Key_ParenLeft", "and", "not", "self", ".", "has_selecte...
Reimplement Qt Method - Basic keypress event handler
[ "Reimplement", "Qt", "Method", "-", "Basic", "keypress", "event", "handler" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/widgets/control.py#L56-L64
train
Reimplement Qt Method - Basic keypress event handler
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/ipythonconsole/widgets/control.py
ControlWidget.focusInEvent
def focusInEvent(self, event): """Reimplement Qt method to send focus change notification""" self.focus_changed.emit() return super(ControlWidget, self).focusInEvent(event)
python
def focusInEvent(self, event): """Reimplement Qt method to send focus change notification""" self.focus_changed.emit() return super(ControlWidget, self).focusInEvent(event)
[ "def", "focusInEvent", "(", "self", ",", "event", ")", ":", "self", ".", "focus_changed", ".", "emit", "(", ")", "return", "super", "(", "ControlWidget", ",", "self", ")", ".", "focusInEvent", "(", "event", ")" ]
Reimplement Qt method to send focus change notification
[ "Reimplement", "Qt", "method", "to", "send", "focus", "change", "notification" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/widgets/control.py#L66-L69
train
Reimplement Qt method to send focus change notification
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/ipythonconsole/widgets/control.py
ControlWidget.focusOutEvent
def focusOutEvent(self, event): """Reimplement Qt method to send focus change notification""" self.focus_changed.emit() return super(ControlWidget, self).focusOutEvent(event)
python
def focusOutEvent(self, event): """Reimplement Qt method to send focus change notification""" self.focus_changed.emit() return super(ControlWidget, self).focusOutEvent(event)
[ "def", "focusOutEvent", "(", "self", ",", "event", ")", ":", "self", ".", "focus_changed", ".", "emit", "(", ")", "return", "super", "(", "ControlWidget", ",", "self", ")", ".", "focusOutEvent", "(", "event", ")" ]
Reimplement Qt method to send focus change notification
[ "Reimplement", "Qt", "method", "to", "send", "focus", "change", "notification" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/widgets/control.py#L71-L74
train
Reimplement Qt method to send focus change notification
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/ipythonconsole/widgets/control.py
PageControlWidget.keyPressEvent
def keyPressEvent(self, event): """Reimplement Qt Method - Basic keypress event handler""" event, text, key, ctrl, shift = restore_keyevent(event) if key == Qt.Key_Slash and self.isVisible(): self.show_find_widget.emit()
python
def keyPressEvent(self, event): """Reimplement Qt Method - Basic keypress event handler""" event, text, key, ctrl, shift = restore_keyevent(event) if key == Qt.Key_Slash and self.isVisible(): self.show_find_widget.emit()
[ "def", "keyPressEvent", "(", "self", ",", "event", ")", ":", "event", ",", "text", ",", "key", ",", "ctrl", ",", "shift", "=", "restore_keyevent", "(", "event", ")", "if", "key", "==", "Qt", ".", "Key_Slash", "and", "self", ".", "isVisible", "(", ")"...
Reimplement Qt Method - Basic keypress event handler
[ "Reimplement", "Qt", "Method", "-", "Basic", "keypress", "event", "handler" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/widgets/control.py#L96-L101
train
Reimplement Qt Method - Basic keypress event handler
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/ipythonconsole/widgets/control.py
PageControlWidget.focusInEvent
def focusInEvent(self, event): """Reimplement Qt method to send focus change notification""" self.focus_changed.emit() return super(PageControlWidget, self).focusInEvent(event)
python
def focusInEvent(self, event): """Reimplement Qt method to send focus change notification""" self.focus_changed.emit() return super(PageControlWidget, self).focusInEvent(event)
[ "def", "focusInEvent", "(", "self", ",", "event", ")", ":", "self", ".", "focus_changed", ".", "emit", "(", ")", "return", "super", "(", "PageControlWidget", ",", "self", ")", ".", "focusInEvent", "(", "event", ")" ]
Reimplement Qt method to send focus change notification
[ "Reimplement", "Qt", "method", "to", "send", "focus", "change", "notification" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/widgets/control.py#L103-L106
train
Reimplement Qt method to send focus change notification
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/ipythonconsole/widgets/control.py
PageControlWidget.focusOutEvent
def focusOutEvent(self, event): """Reimplement Qt method to send focus change notification""" self.focus_changed.emit() return super(PageControlWidget, self).focusOutEvent(event)
python
def focusOutEvent(self, event): """Reimplement Qt method to send focus change notification""" self.focus_changed.emit() return super(PageControlWidget, self).focusOutEvent(event)
[ "def", "focusOutEvent", "(", "self", ",", "event", ")", ":", "self", ".", "focus_changed", ".", "emit", "(", ")", "return", "super", "(", "PageControlWidget", ",", "self", ")", ".", "focusOutEvent", "(", "event", ")" ]
Reimplement Qt method to send focus change notification
[ "Reimplement", "Qt", "method", "to", "send", "focus", "change", "notification" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/widgets/control.py#L108-L111
train
Reimplement Qt method to send focus change notification
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/shortcutssummary.py
ShortcutsSummaryDialog.get_screen_resolution
def get_screen_resolution(self): """Return the screen resolution of the primary screen.""" widget = QDesktopWidget() geometry = widget.availableGeometry(widget.primaryScreen()) return geometry.width(), geometry.height()
python
def get_screen_resolution(self): """Return the screen resolution of the primary screen.""" widget = QDesktopWidget() geometry = widget.availableGeometry(widget.primaryScreen()) return geometry.width(), geometry.height()
[ "def", "get_screen_resolution", "(", "self", ")", ":", "widget", "=", "QDesktopWidget", "(", ")", "geometry", "=", "widget", ".", "availableGeometry", "(", "widget", ".", "primaryScreen", "(", ")", ")", "return", "geometry", ".", "width", "(", ")", ",", "g...
Return the screen resolution of the primary screen.
[ "Return", "the", "screen", "resolution", "of", "the", "primary", "screen", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/shortcutssummary.py#L147-L151
train
Return the screen resolution of the primary screen.
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/plots/plugin.py
Plots.set_current_widget
def set_current_widget(self, fig_browser): """ Set the currently visible fig_browser in the stack widget, refresh the actions of the cog menu button and move it to the layout of the new fig_browser. """ self.stack.setCurrentWidget(fig_browser) # We update the acti...
python
def set_current_widget(self, fig_browser): """ Set the currently visible fig_browser in the stack widget, refresh the actions of the cog menu button and move it to the layout of the new fig_browser. """ self.stack.setCurrentWidget(fig_browser) # We update the acti...
[ "def", "set_current_widget", "(", "self", ",", "fig_browser", ")", ":", "self", ".", "stack", ".", "setCurrentWidget", "(", "fig_browser", ")", "# We update the actions of the options button (cog menu) and", "# we move it to the layout of the current widget.", "self", ".", "r...
Set the currently visible fig_browser in the stack widget, refresh the actions of the cog menu button and move it to the layout of the new fig_browser.
[ "Set", "the", "currently", "visible", "fig_browser", "in", "the", "stack", "widget", "refresh", "the", "actions", "of", "the", "cog", "menu", "button", "and", "move", "it", "to", "the", "layout", "of", "the", "new", "fig_browser", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/plots/plugin.py#L53-L63
train
Set the currently visible fig_browser in the stack widget and refresh the actions of the cog menu button and move it to the layout of the current 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/plugins/plots/plugin.py
Plots.add_shellwidget
def add_shellwidget(self, shellwidget): """ Register shell with figure explorer. This function opens a new FigureBrowser for browsing the figures in the shell. """ shellwidget_id = id(shellwidget) if shellwidget_id not in self.shellwidgets: self.optio...
python
def add_shellwidget(self, shellwidget): """ Register shell with figure explorer. This function opens a new FigureBrowser for browsing the figures in the shell. """ shellwidget_id = id(shellwidget) if shellwidget_id not in self.shellwidgets: self.optio...
[ "def", "add_shellwidget", "(", "self", ",", "shellwidget", ")", ":", "shellwidget_id", "=", "id", "(", "shellwidget", ")", "if", "shellwidget_id", "not", "in", "self", ".", "shellwidgets", ":", "self", ".", "options_button", ".", "setVisible", "(", "True", "...
Register shell with figure explorer. This function opens a new FigureBrowser for browsing the figures in the shell.
[ "Register", "shell", "with", "figure", "explorer", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/plots/plugin.py#L78-L101
train
This function adds a shellwidget to the figure 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/plots/plugin.py
Plots.apply_plugin_settings
def apply_plugin_settings(self, options): """Apply configuration file's plugin settings""" for fig_browser in list(self.shellwidgets.values()): fig_browser.setup(**self.get_settings())
python
def apply_plugin_settings(self, options): """Apply configuration file's plugin settings""" for fig_browser in list(self.shellwidgets.values()): fig_browser.setup(**self.get_settings())
[ "def", "apply_plugin_settings", "(", "self", ",", "options", ")", ":", "for", "fig_browser", "in", "list", "(", "self", ".", "shellwidgets", ".", "values", "(", ")", ")", ":", "fig_browser", ".", "setup", "(", "*", "*", "self", ".", "get_settings", "(", ...
Apply configuration file's plugin settings
[ "Apply", "configuration", "file", "s", "plugin", "settings" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/plots/plugin.py#L148-L151
train
Apply configuration file s plugin settings
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/preferences/layoutdialog.py
LayoutModel.flags
def flags(self, index): """Override Qt method""" if not index.isValid(): return Qt.ItemIsEnabled column = index.column() if column in [0]: return Qt.ItemFlags(Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsUserCheckable | ...
python
def flags(self, index): """Override Qt method""" if not index.isValid(): return Qt.ItemIsEnabled column = index.column() if column in [0]: return Qt.ItemFlags(Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsUserCheckable | ...
[ "def", "flags", "(", "self", ",", "index", ")", ":", "if", "not", "index", ".", "isValid", "(", ")", ":", "return", "Qt", ".", "ItemIsEnabled", "column", "=", "index", ".", "column", "(", ")", "if", "column", "in", "[", "0", "]", ":", "return", "...
Override Qt method
[ "Override", "Qt", "method" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/layoutdialog.py#L48-L57
train
Override Qt method to return the flags of the item with the given index
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/preferences/layoutdialog.py
LayoutModel.data
def data(self, index, role=Qt.DisplayRole): """Override Qt method""" if not index.isValid() or not 0 <= index.row() < len(self._rows): return to_qvariant() row = index.row() column = index.column() name, state = self.row(row) if role == Qt.DisplayRo...
python
def data(self, index, role=Qt.DisplayRole): """Override Qt method""" if not index.isValid() or not 0 <= index.row() < len(self._rows): return to_qvariant() row = index.row() column = index.column() name, state = self.row(row) if role == Qt.DisplayRo...
[ "def", "data", "(", "self", ",", "index", ",", "role", "=", "Qt", ".", "DisplayRole", ")", ":", "if", "not", "index", ".", "isValid", "(", ")", "or", "not", "0", "<=", "index", ".", "row", "(", ")", "<", "len", "(", "self", ".", "_rows", ")", ...
Override Qt method
[ "Override", "Qt", "method" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/layoutdialog.py#L59-L79
train
Override Qt method to return the data in the given role
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/preferences/layoutdialog.py
LayoutModel.setData
def setData(self, index, value, role): """Override Qt method""" row = index.row() name, state = self.row(row) if role == Qt.CheckStateRole: self.set_row(row, [name, not state]) self._parent.setCurrentIndex(index) self._parent.setFocus() ...
python
def setData(self, index, value, role): """Override Qt method""" row = index.row() name, state = self.row(row) if role == Qt.CheckStateRole: self.set_row(row, [name, not state]) self._parent.setCurrentIndex(index) self._parent.setFocus() ...
[ "def", "setData", "(", "self", ",", "index", ",", "value", ",", "role", ")", ":", "row", "=", "index", ".", "row", "(", ")", "name", ",", "state", "=", "self", ".", "row", "(", "row", ")", "if", "role", "==", "Qt", ".", "CheckStateRole", ":", "...
Override Qt method
[ "Override", "Qt", "method" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/layoutdialog.py#L81-L96
train
Override Qt method to set the data for the related 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/preferences/layoutdialog.py
LayoutSaveDialog.check_text
def check_text(self, text): """Disable empty layout name possibility""" if to_text_string(text) == u'': self.button_ok.setEnabled(False) else: self.button_ok.setEnabled(True)
python
def check_text(self, text): """Disable empty layout name possibility""" if to_text_string(text) == u'': self.button_ok.setEnabled(False) else: self.button_ok.setEnabled(True)
[ "def", "check_text", "(", "self", ",", "text", ")", ":", "if", "to_text_string", "(", "text", ")", "==", "u''", ":", "self", ".", "button_ok", ".", "setEnabled", "(", "False", ")", "else", ":", "self", ".", "button_ok", ".", "setEnabled", "(", "True", ...
Disable empty layout name possibility
[ "Disable", "empty", "layout", "name", "possibility" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/layoutdialog.py#L156-L161
train
Disable empty layout name possibility
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/bsdsocket.py
temp_fail_retry
def temp_fail_retry(error, fun, *args): """Retry to execute function, ignoring EINTR error (interruptions)""" while 1: try: return fun(*args) except error as e: eintr = errno.WSAEINTR if os.name == 'nt' else errno.EINTR if e.args[0] == eintr: ...
python
def temp_fail_retry(error, fun, *args): """Retry to execute function, ignoring EINTR error (interruptions)""" while 1: try: return fun(*args) except error as e: eintr = errno.WSAEINTR if os.name == 'nt' else errno.EINTR if e.args[0] == eintr: ...
[ "def", "temp_fail_retry", "(", "error", ",", "fun", ",", "*", "args", ")", ":", "while", "1", ":", "try", ":", "return", "fun", "(", "*", "args", ")", "except", "error", "as", "e", ":", "eintr", "=", "errno", ".", "WSAEINTR", "if", "os", ".", "na...
Retry to execute function, ignoring EINTR error (interruptions)
[ "Retry", "to", "execute", "function", "ignoring", "EINTR", "error", "(", "interruptions", ")" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/bsdsocket.py#L27-L36
train
Retry to execute a function ignoring EINTR error.
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/bsdsocket.py
write_packet
def write_packet(sock, data, already_pickled=False): """Write *data* to socket *sock*""" if already_pickled: sent_data = data else: sent_data = pickle.dumps(data, PICKLE_HIGHEST_PROTOCOL) sent_data = struct.pack("l", len(sent_data)) + sent_data nsend = len(sent_data) whil...
python
def write_packet(sock, data, already_pickled=False): """Write *data* to socket *sock*""" if already_pickled: sent_data = data else: sent_data = pickle.dumps(data, PICKLE_HIGHEST_PROTOCOL) sent_data = struct.pack("l", len(sent_data)) + sent_data nsend = len(sent_data) whil...
[ "def", "write_packet", "(", "sock", ",", "data", ",", "already_pickled", "=", "False", ")", ":", "if", "already_pickled", ":", "sent_data", "=", "data", "else", ":", "sent_data", "=", "pickle", ".", "dumps", "(", "data", ",", "PICKLE_HIGHEST_PROTOCOL", ")", ...
Write *data* to socket *sock*
[ "Write", "*", "data", "*", "to", "socket", "*", "sock", "*" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/bsdsocket.py#L42-L51
train
Write data to socket sock.
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/bsdsocket.py
read_packet
def read_packet(sock, timeout=None): """ Read data from socket *sock* Returns None if something went wrong """ sock.settimeout(timeout) dlen, data = None, None try: if os.name == 'nt': # Windows implementation datalen = sock.recv(SZ) dl...
python
def read_packet(sock, timeout=None): """ Read data from socket *sock* Returns None if something went wrong """ sock.settimeout(timeout) dlen, data = None, None try: if os.name == 'nt': # Windows implementation datalen = sock.recv(SZ) dl...
[ "def", "read_packet", "(", "sock", ",", "timeout", "=", "None", ")", ":", "sock", ".", "settimeout", "(", "timeout", ")", "dlen", ",", "data", "=", "None", ",", "None", "try", ":", "if", "os", ".", "name", "==", "'nt'", ":", "# Windows implementation\...
Read data from socket *sock* Returns None if something went wrong
[ "Read", "data", "from", "socket", "*", "sock", "*", "Returns", "None", "if", "something", "went", "wrong" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/bsdsocket.py#L54-L92
train
Reads a packet from socket sock and returns it as a dict.
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/bsdsocket.py
communicate
def communicate(sock, command, settings=[]): """Communicate with monitor""" try: COMMUNICATE_LOCK.acquire() write_packet(sock, command) for option in settings: write_packet(sock, option) return read_packet(sock) finally: COMMUNICATE_LOCK.release()
python
def communicate(sock, command, settings=[]): """Communicate with monitor""" try: COMMUNICATE_LOCK.acquire() write_packet(sock, command) for option in settings: write_packet(sock, option) return read_packet(sock) finally: COMMUNICATE_LOCK.release()
[ "def", "communicate", "(", "sock", ",", "command", ",", "settings", "=", "[", "]", ")", ":", "try", ":", "COMMUNICATE_LOCK", ".", "acquire", "(", ")", "write_packet", "(", "sock", ",", "command", ")", "for", "option", "in", "settings", ":", "write_packet...
Communicate with monitor
[ "Communicate", "with", "monitor" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/bsdsocket.py#L100-L109
train
Communicate with monitor
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/widgets/profilergui.py
gettime_s
def gettime_s(text): """ Parse text and return a time in seconds. The text is of the format 0h : 0.min:0.0s:0 ms:0us:0 ns. Spaces are not taken into account and any of the specifiers can be ignored. """ pattern = r'([+-]?\d+\.?\d*) ?([munsecinh]+)' matches = re.findall(pattern, text...
python
def gettime_s(text): """ Parse text and return a time in seconds. The text is of the format 0h : 0.min:0.0s:0 ms:0us:0 ns. Spaces are not taken into account and any of the specifiers can be ignored. """ pattern = r'([+-]?\d+\.?\d*) ?([munsecinh]+)' matches = re.findall(pattern, text...
[ "def", "gettime_s", "(", "text", ")", ":", "pattern", "=", "r'([+-]?\\d+\\.?\\d*) ?([munsecinh]+)'", "matches", "=", "re", ".", "findall", "(", "pattern", ",", "text", ")", "if", "len", "(", "matches", ")", "==", "0", ":", "return", "None", "time", "=", ...
Parse text and return a time in seconds. The text is of the format 0h : 0.min:0.0s:0 ms:0us:0 ns. Spaces are not taken into account and any of the specifiers can be ignored.
[ "Parse", "text", "and", "return", "a", "time", "in", "seconds", ".", "The", "text", "is", "of", "the", "format", "0h", ":", "0", ".", "min", ":", "0", ".", "0s", ":", "0", "ms", ":", "0us", ":", "0", "ns", ".", "Spaces", "are", "not", "taken", ...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/profiler/widgets/profilergui.py#L378-L403
train
Parse a string and return a time in seconds.
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/widgets/profilergui.py
primes
def primes(n): """ Simple test function Taken from http://www.huyng.com/posts/python-performance-analysis/ """ if n==2: return [2] elif n<2: return [] s=list(range(3,n+1,2)) mroot = n ** 0.5 half=(n+1)//2-1 i=0 m=3 while m <= mroot: ...
python
def primes(n): """ Simple test function Taken from http://www.huyng.com/posts/python-performance-analysis/ """ if n==2: return [2] elif n<2: return [] s=list(range(3,n+1,2)) mroot = n ** 0.5 half=(n+1)//2-1 i=0 m=3 while m <= mroot: ...
[ "def", "primes", "(", "n", ")", ":", "if", "n", "==", "2", ":", "return", "[", "2", "]", "elif", "n", "<", "2", ":", "return", "[", "]", "s", "=", "list", "(", "range", "(", "3", ",", "n", "+", "1", ",", "2", ")", ")", "mroot", "=", "n"...
Simple test function Taken from http://www.huyng.com/posts/python-performance-analysis/
[ "Simple", "test", "function", "Taken", "from", "http", ":", "//", "www", ".", "huyng", ".", "com", "/", "posts", "/", "python", "-", "performance", "-", "analysis", "/" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/profiler/widgets/profilergui.py#L758-L781
train
Returns a list of tuples where the first element is the number of words in the sequence n.
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/widgets/profilergui.py
ProfilerWidget.save_data
def save_data(self): """Save data""" title = _( "Save profiler result") filename, _selfilter = getsavefilename( self, title, getcwd_or_home(), _("Profiler result")+" (*.Result)") if filename: self.datatree.save_data(filename)
python
def save_data(self): """Save data""" title = _( "Save profiler result") filename, _selfilter = getsavefilename( self, title, getcwd_or_home(), _("Profiler result")+" (*.Result)") if filename: self.datatree.save_data(filename)
[ "def", "save_data", "(", "self", ")", ":", "title", "=", "_", "(", "\"Save profiler result\"", ")", "filename", ",", "_selfilter", "=", "getsavefilename", "(", "self", ",", "title", ",", "getcwd_or_home", "(", ")", ",", "_", "(", "\"Profiler result\"", ")", ...
Save data
[ "Save", "data" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/profiler/widgets/profilergui.py#L186-L193
train
Save data to 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/plugins/profiler/widgets/profilergui.py
ProfilerDataTree.set_item_data
def set_item_data(self, item, filename, line_number): """Set tree item user data: filename (string) and line_number (int)""" set_item_user_text(item, '%s%s%d' % (filename, self.SEP, line_number))
python
def set_item_data(self, item, filename, line_number): """Set tree item user data: filename (string) and line_number (int)""" set_item_user_text(item, '%s%s%d' % (filename, self.SEP, line_number))
[ "def", "set_item_data", "(", "self", ",", "item", ",", "filename", ",", "line_number", ")", ":", "set_item_user_text", "(", "item", ",", "'%s%s%d'", "%", "(", "filename", ",", "self", ".", "SEP", ",", "line_number", ")", ")" ]
Set tree item user data: filename (string) and line_number (int)
[ "Set", "tree", "item", "user", "data", ":", "filename", "(", "string", ")", "and", "line_number", "(", "int", ")" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/profiler/widgets/profilergui.py#L468-L470
train
Set tree item user data filename and line number
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/widgets/profilergui.py
ProfilerDataTree.get_item_data
def get_item_data(self, item): """Get tree item user data: (filename, line_number)""" filename, line_number_str = get_item_user_text(item).split(self.SEP) return filename, int(line_number_str)
python
def get_item_data(self, item): """Get tree item user data: (filename, line_number)""" filename, line_number_str = get_item_user_text(item).split(self.SEP) return filename, int(line_number_str)
[ "def", "get_item_data", "(", "self", ",", "item", ")", ":", "filename", ",", "line_number_str", "=", "get_item_user_text", "(", "item", ")", ".", "split", "(", "self", ".", "SEP", ")", "return", "filename", ",", "int", "(", "line_number_str", ")" ]
Get tree item user data: (filename, line_number)
[ "Get", "tree", "item", "user", "data", ":", "(", "filename", "line_number", ")" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/profiler/widgets/profilergui.py#L472-L475
train
Get tree item user 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/plugins/profiler/widgets/profilergui.py
ProfilerDataTree.initialize_view
def initialize_view(self): """Clean the tree and view parameters""" self.clear() self.item_depth = 0 # To be use for collapsing/expanding one level self.item_list = [] # To be use for collapsing/expanding one level self.items_to_be_shown = {} self.current_view_de...
python
def initialize_view(self): """Clean the tree and view parameters""" self.clear() self.item_depth = 0 # To be use for collapsing/expanding one level self.item_list = [] # To be use for collapsing/expanding one level self.items_to_be_shown = {} self.current_view_de...
[ "def", "initialize_view", "(", "self", ")", ":", "self", ".", "clear", "(", ")", "self", ".", "item_depth", "=", "0", "# To be use for collapsing/expanding one level\r", "self", ".", "item_list", "=", "[", "]", "# To be use for collapsing/expanding one level\r", "self...
Clean the tree and view parameters
[ "Clean", "the", "tree", "and", "view", "parameters" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/profiler/widgets/profilergui.py#L477-L483
train
Clean the tree and view parameters
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/widgets/profilergui.py
ProfilerDataTree.load_data
def load_data(self, profdatafile): """Load profiler data saved by profile/cProfile module""" import pstats try: stats_indi = [pstats.Stats(profdatafile), ] except (OSError, IOError): return self.profdata = stats_indi[0] if self.co...
python
def load_data(self, profdatafile): """Load profiler data saved by profile/cProfile module""" import pstats try: stats_indi = [pstats.Stats(profdatafile), ] except (OSError, IOError): return self.profdata = stats_indi[0] if self.co...
[ "def", "load_data", "(", "self", ",", "profdatafile", ")", ":", "import", "pstats", "try", ":", "stats_indi", "=", "[", "pstats", ".", "Stats", "(", "profdatafile", ")", ",", "]", "except", "(", "OSError", ",", "IOError", ")", ":", "return", "self", "....
Load profiler data saved by profile/cProfile module
[ "Load", "profiler", "data", "saved", "by", "profile", "/", "cProfile", "module" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/profiler/widgets/profilergui.py#L485-L506
train
Load profiler data saved by profile module
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/widgets/profilergui.py
ProfilerDataTree.find_root
def find_root(self): """Find a function without a caller""" self.profdata.sort_stats("cumulative") for func in self.profdata.fcn_list: if ('~', 0) != func[0:2] and not func[2].startswith( '<built-in method exec>'): # This skips the profiler f...
python
def find_root(self): """Find a function without a caller""" self.profdata.sort_stats("cumulative") for func in self.profdata.fcn_list: if ('~', 0) != func[0:2] and not func[2].startswith( '<built-in method exec>'): # This skips the profiler f...
[ "def", "find_root", "(", "self", ")", ":", "self", ".", "profdata", ".", "sort_stats", "(", "\"cumulative\"", ")", "for", "func", "in", "self", ".", "profdata", ".", "fcn_list", ":", "if", "(", "'~'", ",", "0", ")", "!=", "func", "[", "0", ":", "2"...
Find a function without a caller
[ "Find", "a", "function", "without", "a", "caller" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/profiler/widgets/profilergui.py#L520-L528
train
Find a function without a caller
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/widgets/profilergui.py
ProfilerDataTree.show_tree
def show_tree(self): """Populate the tree with profiler data and display it.""" self.initialize_view() # Clear before re-populating self.setItemsExpandable(True) self.setSortingEnabled(False) rootkey = self.find_root() # This root contains profiler overhead if root...
python
def show_tree(self): """Populate the tree with profiler data and display it.""" self.initialize_view() # Clear before re-populating self.setItemsExpandable(True) self.setSortingEnabled(False) rootkey = self.find_root() # This root contains profiler overhead if root...
[ "def", "show_tree", "(", "self", ")", ":", "self", ".", "initialize_view", "(", ")", "# Clear before re-populating\r", "self", ".", "setItemsExpandable", "(", "True", ")", "self", ".", "setSortingEnabled", "(", "False", ")", "rootkey", "=", "self", ".", "find_...
Populate the tree with profiler data and display it.
[ "Populate", "the", "tree", "with", "profiler", "data", "and", "display", "it", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/profiler/widgets/profilergui.py#L536-L547
train
Populate the tree with profiler data and display it.
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/widgets/profilergui.py
ProfilerDataTree.function_info
def function_info(self, functionKey): """Returns processed information about the function's name and file.""" node_type = 'function' filename, line_number, function_name = functionKey if function_name == '<module>': modulePath, moduleName = osp.split(filename) ...
python
def function_info(self, functionKey): """Returns processed information about the function's name and file.""" node_type = 'function' filename, line_number, function_name = functionKey if function_name == '<module>': modulePath, moduleName = osp.split(filename) ...
[ "def", "function_info", "(", "self", ",", "functionKey", ")", ":", "node_type", "=", "'function'", "filename", ",", "line_number", ",", "function_name", "=", "functionKey", "if", "function_name", "==", "'<module>'", ":", "modulePath", ",", "moduleName", "=", "os...
Returns processed information about the function's name and file.
[ "Returns", "processed", "information", "about", "the", "function", "s", "name", "and", "file", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/profiler/widgets/profilergui.py#L549-L566
train
Returns processed information about the function s name and 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/profiler/widgets/profilergui.py
ProfilerDataTree.format_measure
def format_measure(measure): """Get format and units for data coming from profiler task.""" # Convert to a positive value. measure = abs(measure) # For number of calls if isinstance(measure, int): return to_text_string(measure) # For time measuremen...
python
def format_measure(measure): """Get format and units for data coming from profiler task.""" # Convert to a positive value. measure = abs(measure) # For number of calls if isinstance(measure, int): return to_text_string(measure) # For time measuremen...
[ "def", "format_measure", "(", "measure", ")", ":", "# Convert to a positive value.\r", "measure", "=", "abs", "(", "measure", ")", "# For number of calls\r", "if", "isinstance", "(", "measure", ",", "int", ")", ":", "return", "to_text_string", "(", "measure", ")",...
Get format and units for data coming from profiler task.
[ "Get", "format", "and", "units", "for", "data", "coming", "from", "profiler", "task", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/profiler/widgets/profilergui.py#L569-L598
train
Get format and units for data coming from profiler task.
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/widgets/profilergui.py
ProfilerDataTree.color_string
def color_string(self, x): """Return a string formatted delta for the values in x. Args: x: 2-item list of integers (representing number of calls) or 2-item list of floats (representing seconds of runtime). Returns: A list with [formatted x[0], [c...
python
def color_string(self, x): """Return a string formatted delta for the values in x. Args: x: 2-item list of integers (representing number of calls) or 2-item list of floats (representing seconds of runtime). Returns: A list with [formatted x[0], [c...
[ "def", "color_string", "(", "self", ",", "x", ")", ":", "diff_str", "=", "\"\"", "color", "=", "\"black\"", "if", "len", "(", "x", ")", "==", "2", "and", "self", ".", "compare_file", "is", "not", "None", ":", "difference", "=", "x", "[", "0", "]", ...
Return a string formatted delta for the values in x. Args: x: 2-item list of integers (representing number of calls) or 2-item list of floats (representing seconds of runtime). Returns: A list with [formatted x[0], [color, formatted delta]], where ...
[ "Return", "a", "string", "formatted", "delta", "for", "the", "values", "in", "x", ".", "Args", ":", "x", ":", "2", "-", "item", "list", "of", "integers", "(", "representing", "number", "of", "calls", ")", "or", "2", "-", "item", "list", "of", "floats...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/profiler/widgets/profilergui.py#L600-L620
train
Return a string formatted delta for the values in x.
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/widgets/profilergui.py
ProfilerDataTree.format_output
def format_output(self, child_key): """ Formats the data. self.stats1 contains a list of one or two pstat.Stats() instances, with the first being the current run and the second, the saved run, if it exists. Each Stats instance is a dictionary mapping a function to 5 data ...
python
def format_output(self, child_key): """ Formats the data. self.stats1 contains a list of one or two pstat.Stats() instances, with the first being the current run and the second, the saved run, if it exists. Each Stats instance is a dictionary mapping a function to 5 data ...
[ "def", "format_output", "(", "self", ",", "child_key", ")", ":", "data", "=", "[", "x", ".", "stats", ".", "get", "(", "child_key", ",", "[", "0", ",", "0", ",", "0", ",", "0", ",", "{", "}", "]", ")", "for", "x", "in", "self", ".", "stats1",...
Formats the data. self.stats1 contains a list of one or two pstat.Stats() instances, with the first being the current run and the second, the saved run, if it exists. Each Stats instance is a dictionary mapping a function to 5 data points - cumulative calls, number of calls, total...
[ "Formats", "the", "data", ".", "self", ".", "stats1", "contains", "a", "list", "of", "one", "or", "two", "pstat", ".", "Stats", "()", "instances", "with", "the", "first", "being", "the", "current", "run", "and", "the", "second", "the", "saved", "run", ...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/profiler/widgets/profilergui.py#L622-L635
train
Formats the output of the format_output 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/plugins/profiler/widgets/profilergui.py
ProfilerDataTree.populate_tree
def populate_tree(self, parentItem, children_list): """Recursive method to create each item (and associated data) in the tree.""" for child_key in children_list: self.item_depth += 1 (filename, line_number, function_name, file_and_line, node_type ) = self.functi...
python
def populate_tree(self, parentItem, children_list): """Recursive method to create each item (and associated data) in the tree.""" for child_key in children_list: self.item_depth += 1 (filename, line_number, function_name, file_and_line, node_type ) = self.functi...
[ "def", "populate_tree", "(", "self", ",", "parentItem", ",", "children_list", ")", ":", "for", "child_key", "in", "children_list", ":", "self", ".", "item_depth", "+=", "1", "(", "filename", ",", "line_number", ",", "function_name", ",", "file_and_line", ",", ...
Recursive method to create each item (and associated data) in the tree.
[ "Recursive", "method", "to", "create", "each", "item", "(", "and", "associated", "data", ")", "in", "the", "tree", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/profiler/widgets/profilergui.py#L637-L699
train
Recursive method to create each item in the tree.
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/widgets/profilergui.py
ProfilerDataTree.is_recursive
def is_recursive(self, child_item): """Returns True is a function is a descendant of itself.""" ancestor = child_item.parent() # FIXME: indexes to data should be defined by a dictionary on init while ancestor: if (child_item.data(0, Qt.DisplayRole ...
python
def is_recursive(self, child_item): """Returns True is a function is a descendant of itself.""" ancestor = child_item.parent() # FIXME: indexes to data should be defined by a dictionary on init while ancestor: if (child_item.data(0, Qt.DisplayRole ...
[ "def", "is_recursive", "(", "self", ",", "child_item", ")", ":", "ancestor", "=", "child_item", ".", "parent", "(", ")", "# FIXME: indexes to data should be defined by a dictionary on init\r", "while", "ancestor", ":", "if", "(", "child_item", ".", "data", "(", "0",...
Returns True is a function is a descendant of itself.
[ "Returns", "True", "is", "a", "function", "is", "a", "descendant", "of", "itself", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/profiler/widgets/profilergui.py#L710-L722
train
Returns True is a function is a descendant of itself.
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/widgets/profilergui.py
ProfilerDataTree.get_items
def get_items(self, maxlevel): """Return all items with a level <= `maxlevel`""" itemlist = [] def add_to_itemlist(item, maxlevel, level=1): level += 1 for index in range(item.childCount()): citem = item.child(index) itemlist.append(...
python
def get_items(self, maxlevel): """Return all items with a level <= `maxlevel`""" itemlist = [] def add_to_itemlist(item, maxlevel, level=1): level += 1 for index in range(item.childCount()): citem = item.child(index) itemlist.append(...
[ "def", "get_items", "(", "self", ",", "maxlevel", ")", ":", "itemlist", "=", "[", "]", "def", "add_to_itemlist", "(", "item", ",", "maxlevel", ",", "level", "=", "1", ")", ":", "level", "+=", "1", "for", "index", "in", "range", "(", "item", ".", "c...
Return all items with a level <= `maxlevel`
[ "Return", "all", "items", "with", "a", "level", "<", "=", "maxlevel" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/profiler/widgets/profilergui.py#L728-L742
train
Return all items with a level > = maxlevel
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/widgets/profilergui.py
ProfilerDataTree.change_view
def change_view(self, change_in_depth): """Change the view depth by expand or collapsing all same-level nodes""" self.current_view_depth += change_in_depth if self.current_view_depth < 0: self.current_view_depth = 0 self.collapseAll() if self.current_view_depth ...
python
def change_view(self, change_in_depth): """Change the view depth by expand or collapsing all same-level nodes""" self.current_view_depth += change_in_depth if self.current_view_depth < 0: self.current_view_depth = 0 self.collapseAll() if self.current_view_depth ...
[ "def", "change_view", "(", "self", ",", "change_in_depth", ")", ":", "self", ".", "current_view_depth", "+=", "change_in_depth", "if", "self", ".", "current_view_depth", "<", "0", ":", "self", ".", "current_view_depth", "=", "0", "self", ".", "collapseAll", "(...
Change the view depth by expand or collapsing all same-level nodes
[ "Change", "the", "view", "depth", "by", "expand", "or", "collapsing", "all", "same", "-", "level", "nodes" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/profiler/widgets/profilergui.py#L744-L752
train
Change the view depth by expand or collapsing all same - level nodes
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/ipythonconsole/utils/style.py
create_qss_style
def create_qss_style(color_scheme): """Returns a QSS stylesheet with Spyder color scheme settings. The stylesheet can contain classes for: Qt: QPlainTextEdit, QFrame, QWidget, etc Pygments: .c, .k, .o, etc. (see PygmentsHighlighter) IPython: .error, .in-prompt, .out-prompt, etc """ ...
python
def create_qss_style(color_scheme): """Returns a QSS stylesheet with Spyder color scheme settings. The stylesheet can contain classes for: Qt: QPlainTextEdit, QFrame, QWidget, etc Pygments: .c, .k, .o, etc. (see PygmentsHighlighter) IPython: .error, .in-prompt, .out-prompt, etc """ ...
[ "def", "create_qss_style", "(", "color_scheme", ")", ":", "def", "give_font_weight", "(", "is_bold", ")", ":", "if", "is_bold", ":", "return", "'bold'", "else", ":", "return", "'normal'", "def", "give_font_style", "(", "is_italic", ")", ":", "if", "is_italic",...
Returns a QSS stylesheet with Spyder color scheme settings. The stylesheet can contain classes for: Qt: QPlainTextEdit, QFrame, QWidget, etc Pygments: .c, .k, .o, etc. (see PygmentsHighlighter) IPython: .error, .in-prompt, .out-prompt, etc
[ "Returns", "a", "QSS", "stylesheet", "with", "Spyder", "color", "scheme", "settings", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/utils/style.py#L22-L80
train
Creates a QSS stylesheet with the given color scheme settings.
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/ipythonconsole/utils/style.py
create_pygments_dict
def create_pygments_dict(color_scheme_name): """ Create a dictionary that saves the given color scheme as a Pygments style. """ def give_font_weight(is_bold): if is_bold: return 'bold' else: return '' def give_font_style(is_italic): if is_italic:...
python
def create_pygments_dict(color_scheme_name): """ Create a dictionary that saves the given color scheme as a Pygments style. """ def give_font_weight(is_bold): if is_bold: return 'bold' else: return '' def give_font_style(is_italic): if is_italic:...
[ "def", "create_pygments_dict", "(", "color_scheme_name", ")", ":", "def", "give_font_weight", "(", "is_bold", ")", ":", "if", "is_bold", ":", "return", "'bold'", "else", ":", "return", "''", "def", "give_font_style", "(", "is_italic", ")", ":", "if", "is_itali...
Create a dictionary that saves the given color scheme as a Pygments style.
[ "Create", "a", "dictionary", "that", "saves", "the", "given", "color", "scheme", "as", "a", "Pygments", "style", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/utils/style.py#L83-L165
train
Create a dictionary that saves the given color scheme as a Pygments style.
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/misc.py
__remove_pyc_pyo
def __remove_pyc_pyo(fname): """Eventually remove .pyc and .pyo files associated to a Python script""" if osp.splitext(fname)[1] == '.py': for ending in ('c', 'o'): if osp.exists(fname+ending): os.remove(fname+ending)
python
def __remove_pyc_pyo(fname): """Eventually remove .pyc and .pyo files associated to a Python script""" if osp.splitext(fname)[1] == '.py': for ending in ('c', 'o'): if osp.exists(fname+ending): os.remove(fname+ending)
[ "def", "__remove_pyc_pyo", "(", "fname", ")", ":", "if", "osp", ".", "splitext", "(", "fname", ")", "[", "1", "]", "==", "'.py'", ":", "for", "ending", "in", "(", "'c'", ",", "'o'", ")", ":", "if", "osp", ".", "exists", "(", "fname", "+", "ending...
Eventually remove .pyc and .pyo files associated to a Python script
[ "Eventually", "remove", ".", "pyc", "and", ".", "pyo", "files", "associated", "to", "a", "Python", "script" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/misc.py#L24-L29
train
Eventually remove. pyc and. pyo files associated to a 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/misc.py
move_file
def move_file(source, dest): """ Move file from *source* to *dest* If file is a Python script, also rename .pyc and .pyo files if any """ import shutil shutil.copy(source, dest) remove_file(source)
python
def move_file(source, dest): """ Move file from *source* to *dest* If file is a Python script, also rename .pyc and .pyo files if any """ import shutil shutil.copy(source, dest) remove_file(source)
[ "def", "move_file", "(", "source", ",", "dest", ")", ":", "import", "shutil", "shutil", ".", "copy", "(", "source", ",", "dest", ")", "remove_file", "(", "source", ")" ]
Move file from *source* to *dest* If file is a Python script, also rename .pyc and .pyo files if any
[ "Move", "file", "from", "*", "source", "*", "to", "*", "dest", "*", "If", "file", "is", "a", "Python", "script", "also", "rename", ".", "pyc", "and", ".", "pyo", "files", "if", "any" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/misc.py#L50-L57
train
Move file from source to dest.
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/misc.py
onerror
def onerror(function, path, excinfo): """Error handler for `shutil.rmtree`. If the error is due to an access error (read-only file), it attempts to add write permission and then retries. If the error is for another reason, it re-raises the error. Usage: `shutil.rmtree(path, onerror=onerror)...
python
def onerror(function, path, excinfo): """Error handler for `shutil.rmtree`. If the error is due to an access error (read-only file), it attempts to add write permission and then retries. If the error is for another reason, it re-raises the error. Usage: `shutil.rmtree(path, onerror=onerror)...
[ "def", "onerror", "(", "function", ",", "path", ",", "excinfo", ")", ":", "if", "not", "os", ".", "access", "(", "path", ",", "os", ".", "W_OK", ")", ":", "# Is the error an access error?\r", "os", ".", "chmod", "(", "path", ",", "stat", ".", "S_IWUSR"...
Error handler for `shutil.rmtree`. If the error is due to an access error (read-only file), it attempts to add write permission and then retries. If the error is for another reason, it re-raises the error. Usage: `shutil.rmtree(path, onerror=onerror)
[ "Error", "handler", "for", "shutil", ".", "rmtree", ".", "If", "the", "error", "is", "due", "to", "an", "access", "error", "(", "read", "-", "only", "file", ")", "it", "attempts", "to", "add", "write", "permission", "and", "then", "retries", ".", "If",...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/misc.py#L60-L73
train
Error handler for .
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/misc.py
select_port
def select_port(default_port=20128): """Find and return a non used port""" import socket while True: try: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP) # sock.setsockopt(so...
python
def select_port(default_port=20128): """Find and return a non used port""" import socket while True: try: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP) # sock.setsockopt(so...
[ "def", "select_port", "(", "default_port", "=", "20128", ")", ":", "import", "socket", "while", "True", ":", "try", ":", "sock", "=", "socket", ".", "socket", "(", "socket", ".", "AF_INET", ",", "socket", ".", "SOCK_STREAM", ",", "socket", ".", "IPPROTO_...
Find and return a non used port
[ "Find", "and", "return", "a", "non", "used", "port" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/misc.py#L76-L93
train
Find and return a non used port
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/misc.py
count_lines
def count_lines(path, extensions=None, excluded_dirnames=None): """Return number of source code lines for all filenames in subdirectories of *path* with names ending with *extensions* Directory names *excluded_dirnames* will be ignored""" if extensions is None: extensions = ['.py', '.pyw', ...
python
def count_lines(path, extensions=None, excluded_dirnames=None): """Return number of source code lines for all filenames in subdirectories of *path* with names ending with *extensions* Directory names *excluded_dirnames* will be ignored""" if extensions is None: extensions = ['.py', '.pyw', ...
[ "def", "count_lines", "(", "path", ",", "extensions", "=", "None", ",", "excluded_dirnames", "=", "None", ")", ":", "if", "extensions", "is", "None", ":", "extensions", "=", "[", "'.py'", ",", "'.pyw'", ",", "'.ipy'", ",", "'.enaml'", ",", "'.c'", ",", ...
Return number of source code lines for all filenames in subdirectories of *path* with names ending with *extensions* Directory names *excluded_dirnames* will be ignored
[ "Return", "number", "of", "source", "code", "lines", "for", "all", "filenames", "in", "subdirectories", "of", "*", "path", "*", "with", "names", "ending", "with", "*", "extensions", "*", "Directory", "names", "*", "excluded_dirnames", "*", "will", "be", "ign...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/misc.py#L96-L131
train
Return number of source code lines for all files in path ending with extensions and excluded_dirnames.
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/misc.py
remove_backslashes
def remove_backslashes(path): """Remove backslashes in *path* For Windows platforms only. Returns the path unchanged on other platforms. This is especially useful when formatting path strings on Windows platforms for which folder paths may contain backslashes and provoke unicode decodi...
python
def remove_backslashes(path): """Remove backslashes in *path* For Windows platforms only. Returns the path unchanged on other platforms. This is especially useful when formatting path strings on Windows platforms for which folder paths may contain backslashes and provoke unicode decodi...
[ "def", "remove_backslashes", "(", "path", ")", ":", "if", "os", ".", "name", "==", "'nt'", ":", "# Removing trailing single backslash\r", "if", "path", ".", "endswith", "(", "'\\\\'", ")", "and", "not", "path", ".", "endswith", "(", "'\\\\\\\\'", ")", ":", ...
Remove backslashes in *path* For Windows platforms only. Returns the path unchanged on other platforms. This is especially useful when formatting path strings on Windows platforms for which folder paths may contain backslashes and provoke unicode decoding errors in Python 3 (or in Python 2 ...
[ "Remove", "backslashes", "in", "*", "path", "*", "For", "Windows", "platforms", "only", ".", "Returns", "the", "path", "unchanged", "on", "other", "platforms", ".", "This", "is", "especially", "useful", "when", "formatting", "path", "strings", "on", "Windows",...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/misc.py#L134-L151
train
Remove backslashes in path
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/misc.py
monkeypatch_method
def monkeypatch_method(cls, patch_name): # This function's code was inspired from the following thread: # "[Python-Dev] Monkeypatching idioms -- elegant or ugly?" # by Robert Brewer <fumanchu at aminus.org> # (Tue Jan 15 19:13:25 CET 2008) """ Add the decorated method to the given class; r...
python
def monkeypatch_method(cls, patch_name): # This function's code was inspired from the following thread: # "[Python-Dev] Monkeypatching idioms -- elegant or ugly?" # by Robert Brewer <fumanchu at aminus.org> # (Tue Jan 15 19:13:25 CET 2008) """ Add the decorated method to the given class; r...
[ "def", "monkeypatch_method", "(", "cls", ",", "patch_name", ")", ":", "# This function's code was inspired from the following thread:\r", "# \"[Python-Dev] Monkeypatching idioms -- elegant or ugly?\"\r", "# by Robert Brewer <fumanchu at aminus.org>\r", "# (Tue Jan 15 19:13:25 CET 2008)\r", "...
Add the decorated method to the given class; replace as needed. If the named method already exists on the given class, it will be replaced, and a reference to the old method is created as cls._old<patch_name><name>. If the "_old_<patch_name>_<name>" attribute already exists, KeyError is raised.
[ "Add", "the", "decorated", "method", "to", "the", "given", "class", ";", "replace", "as", "needed", ".", "If", "the", "named", "method", "already", "exists", "on", "the", "given", "class", "it", "will", "be", "replaced", "and", "a", "reference", "to", "t...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/misc.py#L169-L197
train
Monkeypatch the named method on the given 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/utils/misc.py
get_common_path
def get_common_path(pathlist): """Return common path for all paths in pathlist""" common = osp.normpath(osp.commonprefix(pathlist)) if len(common) > 1: if not osp.isdir(common): return abspardir(common) else: for path in pathlist: if not osp.is...
python
def get_common_path(pathlist): """Return common path for all paths in pathlist""" common = osp.normpath(osp.commonprefix(pathlist)) if len(common) > 1: if not osp.isdir(common): return abspardir(common) else: for path in pathlist: if not osp.is...
[ "def", "get_common_path", "(", "pathlist", ")", ":", "common", "=", "osp", ".", "normpath", "(", "osp", ".", "commonprefix", "(", "pathlist", ")", ")", "if", "len", "(", "common", ")", ">", "1", ":", "if", "not", "osp", ".", "isdir", "(", "common", ...
Return common path for all paths in pathlist
[ "Return", "common", "path", "for", "all", "paths", "in", "pathlist" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/misc.py#L210-L222
train
Return the common path for all paths in pathlist
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/misc.py
memoize
def memoize(obj): """ Memoize objects to trade memory for execution speed Use a limited size cache to store the value, which takes into account The calling args and kwargs See https://wiki.python.org/moin/PythonDecoratorLibrary#Memoize """ cache = obj.cache = {} @functools....
python
def memoize(obj): """ Memoize objects to trade memory for execution speed Use a limited size cache to store the value, which takes into account The calling args and kwargs See https://wiki.python.org/moin/PythonDecoratorLibrary#Memoize """ cache = obj.cache = {} @functools....
[ "def", "memoize", "(", "obj", ")", ":", "cache", "=", "obj", ".", "cache", "=", "{", "}", "@", "functools", ".", "wraps", "(", "obj", ")", "def", "memoizer", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "key", "=", "str", "(", "args", ...
Memoize objects to trade memory for execution speed Use a limited size cache to store the value, which takes into account The calling args and kwargs See https://wiki.python.org/moin/PythonDecoratorLibrary#Memoize
[ "Memoize", "objects", "to", "trade", "memory", "for", "execution", "speed", "Use", "a", "limited", "size", "cache", "to", "store", "the", "value", "which", "takes", "into", "account", "The", "calling", "args", "and", "kwargs", "See", "https", ":", "//", "w...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/misc.py#L252-L272
train
Memoize objects to trade memory for execution speed
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...