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/icon_manager.py | get_icon | def get_icon(name, default=None, resample=False):
"""Return image inside a QIcon object.
default: default image name or icon
resample: if True, manually resample icon pixmaps for usual sizes
(16, 24, 32, 48, 96, 128, 256). This is recommended for QMainWindow icons
created from SVG images on non-Win... | python | def get_icon(name, default=None, resample=False):
"""Return image inside a QIcon object.
default: default image name or icon
resample: if True, manually resample icon pixmaps for usual sizes
(16, 24, 32, 48, 96, 128, 256). This is recommended for QMainWindow icons
created from SVG images on non-Win... | [
"def",
"get_icon",
"(",
"name",
",",
"default",
"=",
"None",
",",
"resample",
"=",
"False",
")",
":",
"icon_path",
"=",
"get_image_path",
"(",
"name",
",",
"default",
"=",
"None",
")",
"if",
"icon_path",
"is",
"not",
"None",
":",
"icon",
"=",
"QIcon",
... | Return image inside a QIcon object.
default: default image name or icon
resample: if True, manually resample icon pixmaps for usual sizes
(16, 24, 32, 48, 96, 128, 256). This is recommended for QMainWindow icons
created from SVG images on non-Windows platforms due to a Qt bug (see
Issue 1314). | [
"Return",
"image",
"inside",
"a",
"QIcon",
"object",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/icon_manager.py#L358-L386 | train | Return image inside a QIcon object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/utils/icon_manager.py | get_icon_by_extension | def get_icon_by_extension(fname, scale_factor):
"""Return the icon depending on the file extension"""
application_icons = {}
application_icons.update(BIN_FILES)
application_icons.update(DOCUMENT_FILES)
if osp.isdir(fname):
return icon('DirOpenIcon', scale_factor)
else:
basename =... | python | def get_icon_by_extension(fname, scale_factor):
"""Return the icon depending on the file extension"""
application_icons = {}
application_icons.update(BIN_FILES)
application_icons.update(DOCUMENT_FILES)
if osp.isdir(fname):
return icon('DirOpenIcon', scale_factor)
else:
basename =... | [
"def",
"get_icon_by_extension",
"(",
"fname",
",",
"scale_factor",
")",
":",
"application_icons",
"=",
"{",
"}",
"application_icons",
".",
"update",
"(",
"BIN_FILES",
")",
"application_icons",
".",
"update",
"(",
"DOCUMENT_FILES",
")",
"if",
"osp",
".",
"isdir",... | Return the icon depending on the file extension | [
"Return",
"the",
"icon",
"depending",
"on",
"the",
"file",
"extension"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/icon_manager.py#L409-L459 | train | Return the icon depending on the file extension | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/editor/widgets/autosaveerror.py | AutosaveErrorDialog.accept | def accept(self):
"""
Update `show_errors` and hide dialog box.
Overrides method of `QDialogBox`.
"""
AutosaveErrorDialog.show_errors = not self.dismiss_box.isChecked()
return QDialog.accept(self) | python | def accept(self):
"""
Update `show_errors` and hide dialog box.
Overrides method of `QDialogBox`.
"""
AutosaveErrorDialog.show_errors = not self.dismiss_box.isChecked()
return QDialog.accept(self) | [
"def",
"accept",
"(",
"self",
")",
":",
"AutosaveErrorDialog",
".",
"show_errors",
"=",
"not",
"self",
".",
"dismiss_box",
".",
"isChecked",
"(",
")",
"return",
"QDialog",
".",
"accept",
"(",
"self",
")"
] | Update `show_errors` and hide dialog box.
Overrides method of `QDialogBox`. | [
"Update",
"show_errors",
"and",
"hide",
"dialog",
"box",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/widgets/autosaveerror.py#L78-L85 | train | Override QDialog. accept to update show_errors and hide dialog box. | 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/onecolumntree.py | OneColumnTree.setup_common_actions | def setup_common_actions(self):
"""Setup context menu common actions"""
self.collapse_all_action = create_action(self,
text=_('Collapse all'),
icon=ima.icon('collapse'),
triggered=self.col... | python | def setup_common_actions(self):
"""Setup context menu common actions"""
self.collapse_all_action = create_action(self,
text=_('Collapse all'),
icon=ima.icon('collapse'),
triggered=self.col... | [
"def",
"setup_common_actions",
"(",
"self",
")",
":",
"self",
".",
"collapse_all_action",
"=",
"create_action",
"(",
"self",
",",
"text",
"=",
"_",
"(",
"'Collapse all'",
")",
",",
"icon",
"=",
"ima",
".",
"icon",
"(",
"'collapse'",
")",
",",
"triggered",
... | Setup context menu common actions | [
"Setup",
"context",
"menu",
"common",
"actions"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/onecolumntree.py#L49-L74 | train | Setup common actions for the context menu | 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/onecolumntree.py | OneColumnTree.get_menu_actions | def get_menu_actions(self):
"""Returns a list of menu actions"""
items = self.selectedItems()
actions = self.get_actions_from_items(items)
if actions:
actions.append(None)
actions += self.common_actions
return actions | python | def get_menu_actions(self):
"""Returns a list of menu actions"""
items = self.selectedItems()
actions = self.get_actions_from_items(items)
if actions:
actions.append(None)
actions += self.common_actions
return actions | [
"def",
"get_menu_actions",
"(",
"self",
")",
":",
"items",
"=",
"self",
".",
"selectedItems",
"(",
")",
"actions",
"=",
"self",
".",
"get_actions_from_items",
"(",
"items",
")",
"if",
"actions",
":",
"actions",
".",
"append",
"(",
"None",
")",
"actions",
... | Returns a list of menu actions | [
"Returns",
"a",
"list",
"of",
"menu",
"actions"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/onecolumntree.py#L76-L83 | train | Returns a list of menu actions | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/widgets/onecolumntree.py | OneColumnTree.item_selection_changed | def item_selection_changed(self):
"""Item selection has changed"""
is_selection = len(self.selectedItems()) > 0
self.expand_selection_action.setEnabled(is_selection)
self.collapse_selection_action.setEnabled(is_selection) | python | def item_selection_changed(self):
"""Item selection has changed"""
is_selection = len(self.selectedItems()) > 0
self.expand_selection_action.setEnabled(is_selection)
self.collapse_selection_action.setEnabled(is_selection) | [
"def",
"item_selection_changed",
"(",
"self",
")",
":",
"is_selection",
"=",
"len",
"(",
"self",
".",
"selectedItems",
"(",
")",
")",
">",
"0",
"self",
".",
"expand_selection_action",
".",
"setEnabled",
"(",
"is_selection",
")",
"self",
".",
"collapse_selectio... | Item selection has changed | [
"Item",
"selection",
"has",
"changed"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/onecolumntree.py#L139-L143 | train | Item selection 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/widgets/onecolumntree.py | OneColumnTree.get_items | def get_items(self):
"""Return items (excluding top level items)"""
itemlist = []
def add_to_itemlist(item):
for index in range(item.childCount()):
citem = item.child(index)
itemlist.append(citem)
add_to_itemlist(citem)
... | python | def get_items(self):
"""Return items (excluding top level items)"""
itemlist = []
def add_to_itemlist(item):
for index in range(item.childCount()):
citem = item.child(index)
itemlist.append(citem)
add_to_itemlist(citem)
... | [
"def",
"get_items",
"(",
"self",
")",
":",
"itemlist",
"=",
"[",
"]",
"def",
"add_to_itemlist",
"(",
"item",
")",
":",
"for",
"index",
"in",
"range",
"(",
"item",
".",
"childCount",
"(",
")",
")",
":",
"citem",
"=",
"item",
".",
"child",
"(",
"inde... | Return items (excluding top level items) | [
"Return",
"items",
"(",
"excluding",
"top",
"level",
"items",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/onecolumntree.py#L149-L159 | train | Return items ( excluding top level items | 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/onecolumntree.py | OneColumnTree.save_expanded_state | def save_expanded_state(self):
"""Save all items expanded state"""
self.__expanded_state = {}
def add_to_state(item):
user_text = get_item_user_text(item)
self.__expanded_state[hash(user_text)] = item.isExpanded()
def browse_children(item):
add_... | python | def save_expanded_state(self):
"""Save all items expanded state"""
self.__expanded_state = {}
def add_to_state(item):
user_text = get_item_user_text(item)
self.__expanded_state[hash(user_text)] = item.isExpanded()
def browse_children(item):
add_... | [
"def",
"save_expanded_state",
"(",
"self",
")",
":",
"self",
".",
"__expanded_state",
"=",
"{",
"}",
"def",
"add_to_state",
"(",
"item",
")",
":",
"user_text",
"=",
"get_item_user_text",
"(",
"item",
")",
"self",
".",
"__expanded_state",
"[",
"hash",
"(",
... | Save all items expanded state | [
"Save",
"all",
"items",
"expanded",
"state"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/onecolumntree.py#L178-L192 | train | Save all items expanded state | 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/onecolumntree.py | OneColumnTree.restore_expanded_state | def restore_expanded_state(self):
"""Restore all items expanded state"""
if self.__expanded_state is None:
return
for item in self.get_items()+self.get_top_level_items():
user_text = get_item_user_text(item)
is_expanded = self.__expanded_state.get(hash(u... | python | def restore_expanded_state(self):
"""Restore all items expanded state"""
if self.__expanded_state is None:
return
for item in self.get_items()+self.get_top_level_items():
user_text = get_item_user_text(item)
is_expanded = self.__expanded_state.get(hash(u... | [
"def",
"restore_expanded_state",
"(",
"self",
")",
":",
"if",
"self",
".",
"__expanded_state",
"is",
"None",
":",
"return",
"for",
"item",
"in",
"self",
".",
"get_items",
"(",
")",
"+",
"self",
".",
"get_top_level_items",
"(",
")",
":",
"user_text",
"=",
... | Restore all items expanded state | [
"Restore",
"all",
"items",
"expanded",
"state"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/onecolumntree.py#L194-L202 | train | Restore all items expanded state | 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/onecolumntree.py | OneColumnTree.sort_top_level_items | def sort_top_level_items(self, key):
"""Sorting tree wrt top level items"""
self.save_expanded_state()
items = sorted([self.takeTopLevelItem(0)
for index in range(self.topLevelItemCount())], key=key)
for index, item in enumerate(items):
self.inse... | python | def sort_top_level_items(self, key):
"""Sorting tree wrt top level items"""
self.save_expanded_state()
items = sorted([self.takeTopLevelItem(0)
for index in range(self.topLevelItemCount())], key=key)
for index, item in enumerate(items):
self.inse... | [
"def",
"sort_top_level_items",
"(",
"self",
",",
"key",
")",
":",
"self",
".",
"save_expanded_state",
"(",
")",
"items",
"=",
"sorted",
"(",
"[",
"self",
".",
"takeTopLevelItem",
"(",
"0",
")",
"for",
"index",
"in",
"range",
"(",
"self",
".",
"topLevelIt... | Sorting tree wrt top level items | [
"Sorting",
"tree",
"wrt",
"top",
"level",
"items"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/onecolumntree.py#L204-L211 | train | Sort the tree wrt the top level items. | 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/onecolumntree.py | OneColumnTree.contextMenuEvent | def contextMenuEvent(self, event):
"""Override Qt method"""
self.update_menu()
self.menu.popup(event.globalPos()) | python | def contextMenuEvent(self, event):
"""Override Qt method"""
self.update_menu()
self.menu.popup(event.globalPos()) | [
"def",
"contextMenuEvent",
"(",
"self",
",",
"event",
")",
":",
"self",
".",
"update_menu",
"(",
")",
"self",
".",
"menu",
".",
"popup",
"(",
"event",
".",
"globalPos",
"(",
")",
")"
] | Override Qt method | [
"Override",
"Qt",
"method"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/onecolumntree.py#L213-L216 | train | Override Qt method to update the context menu | 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 | create_app.py | get_stdlib_modules | def get_stdlib_modules():
"""
Returns a list containing the names of all the modules available in the
standard library.
Based on the function get_root_modules from the IPython project.
Present in IPython.core.completerlib in v0.13.1
Copyright (C) 2010-2011 The IPython Development Team.... | python | def get_stdlib_modules():
"""
Returns a list containing the names of all the modules available in the
standard library.
Based on the function get_root_modules from the IPython project.
Present in IPython.core.completerlib in v0.13.1
Copyright (C) 2010-2011 The IPython Development Team.... | [
"def",
"get_stdlib_modules",
"(",
")",
":",
"modules",
"=",
"list",
"(",
"sys",
".",
"builtin_module_names",
")",
"for",
"path",
"in",
"sys",
".",
"path",
"[",
"1",
":",
"]",
":",
"if",
"'site-packages'",
"not",
"in",
"path",
":",
"modules",
"+=",
"mod... | Returns a list containing the names of all the modules available in the
standard library.
Based on the function get_root_modules from the IPython project.
Present in IPython.core.completerlib in v0.13.1
Copyright (C) 2010-2011 The IPython Development Team.
Distributed under the terms of th... | [
"Returns",
"a",
"list",
"containing",
"the",
"names",
"of",
"all",
"the",
"modules",
"available",
"in",
"the",
"standard",
"library",
".",
"Based",
"on",
"the",
"function",
"get_root_modules",
"from",
"the",
"IPython",
"project",
".",
"Present",
"in",
"IPython... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/create_app.py#L44-L64 | train | Returns a list containing the names of all the modules available in the IPython standard library. | 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/api/folding.py | print_tree | def print_tree(editor, file=sys.stdout, print_blocks=False, return_list=False):
"""
Prints the editor fold tree to stdout, for debugging purpose.
:param editor: CodeEditor instance.
:param file: file handle where the tree will be printed. Default is stdout.
:param print_blocks: True to print all bl... | python | def print_tree(editor, file=sys.stdout, print_blocks=False, return_list=False):
"""
Prints the editor fold tree to stdout, for debugging purpose.
:param editor: CodeEditor instance.
:param file: file handle where the tree will be printed. Default is stdout.
:param print_blocks: True to print all bl... | [
"def",
"print_tree",
"(",
"editor",
",",
"file",
"=",
"sys",
".",
"stdout",
",",
"print_blocks",
"=",
"False",
",",
"return_list",
"=",
"False",
")",
":",
"output_list",
"=",
"[",
"]",
"block",
"=",
"editor",
".",
"document",
"(",
")",
".",
"firstBlock... | Prints the editor fold tree to stdout, for debugging purpose.
:param editor: CodeEditor instance.
:param file: file handle where the tree will be printed. Default is stdout.
:param print_blocks: True to print all blocks, False to only print blocks
that are fold triggers | [
"Prints",
"the",
"editor",
"fold",
"tree",
"to",
"stdout",
"for",
"debugging",
"purpose",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/api/folding.py#L29-L63 | train | Prints the editor fold tree to stdout for debugging purpose. | 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/environ.py | envdict2listdict | def envdict2listdict(envdict):
"""Dict --> Dict of lists"""
sep = os.path.pathsep
for key in envdict:
if sep in envdict[key]:
envdict[key] = [path.strip() for path in envdict[key].split(sep)]
return envdict | python | def envdict2listdict(envdict):
"""Dict --> Dict of lists"""
sep = os.path.pathsep
for key in envdict:
if sep in envdict[key]:
envdict[key] = [path.strip() for path in envdict[key].split(sep)]
return envdict | [
"def",
"envdict2listdict",
"(",
"envdict",
")",
":",
"sep",
"=",
"os",
".",
"path",
".",
"pathsep",
"for",
"key",
"in",
"envdict",
":",
"if",
"sep",
"in",
"envdict",
"[",
"key",
"]",
":",
"envdict",
"[",
"key",
"]",
"=",
"[",
"path",
".",
"strip",
... | Dict --> Dict of lists | [
"Dict",
"--",
">",
"Dict",
"of",
"lists"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/environ.py#L24-L30 | train | Dict - > Dict of lists | 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/environ.py | listdict2envdict | def listdict2envdict(listdict):
"""Dict of lists --> Dict"""
for key in listdict:
if isinstance(listdict[key], list):
listdict[key] = os.path.pathsep.join(listdict[key])
return listdict | python | def listdict2envdict(listdict):
"""Dict of lists --> Dict"""
for key in listdict:
if isinstance(listdict[key], list):
listdict[key] = os.path.pathsep.join(listdict[key])
return listdict | [
"def",
"listdict2envdict",
"(",
"listdict",
")",
":",
"for",
"key",
"in",
"listdict",
":",
"if",
"isinstance",
"(",
"listdict",
"[",
"key",
"]",
",",
"list",
")",
":",
"listdict",
"[",
"key",
"]",
"=",
"os",
".",
"path",
".",
"pathsep",
".",
"join",
... | Dict of lists --> Dict | [
"Dict",
"of",
"lists",
"--",
">",
"Dict"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/environ.py#L33-L38 | train | Convert a list of lists into a dict of environment variables. | 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/environ.py | main | def main():
"""Run Windows environment variable editor"""
from spyder.utils.qthelpers import qapplication
app = qapplication()
if os.name == 'nt':
dialog = WinUserEnvDialog()
else:
dialog = EnvDialog()
dialog.show()
app.exec_() | python | def main():
"""Run Windows environment variable editor"""
from spyder.utils.qthelpers import qapplication
app = qapplication()
if os.name == 'nt':
dialog = WinUserEnvDialog()
else:
dialog = EnvDialog()
dialog.show()
app.exec_() | [
"def",
"main",
"(",
")",
":",
"from",
"spyder",
".",
"utils",
".",
"qthelpers",
"import",
"qapplication",
"app",
"=",
"qapplication",
"(",
")",
"if",
"os",
".",
"name",
"==",
"'nt'",
":",
"dialog",
"=",
"WinUserEnvDialog",
"(",
")",
"else",
":",
"dialo... | Run Windows environment variable editor | [
"Run",
"Windows",
"environment",
"variable",
"editor"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/environ.py#L141-L150 | train | Run Windows environment variable 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/widgets/arraybuilder.py | NumpyArrayInline.keyPressEvent | def keyPressEvent(self, event):
"""
Qt override.
"""
if event.key() in [Qt.Key_Enter, Qt.Key_Return]:
self._parent.process_text()
if self._parent.is_valid():
self._parent.keyPressEvent(event)
else:
QLineEdit.keyPressEve... | python | def keyPressEvent(self, event):
"""
Qt override.
"""
if event.key() in [Qt.Key_Enter, Qt.Key_Return]:
self._parent.process_text()
if self._parent.is_valid():
self._parent.keyPressEvent(event)
else:
QLineEdit.keyPressEve... | [
"def",
"keyPressEvent",
"(",
"self",
",",
"event",
")",
":",
"if",
"event",
".",
"key",
"(",
")",
"in",
"[",
"Qt",
".",
"Key_Enter",
",",
"Qt",
".",
"Key_Return",
"]",
":",
"self",
".",
"_parent",
".",
"process_text",
"(",
")",
"if",
"self",
".",
... | Qt override. | [
"Qt",
"override",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/arraybuilder.py#L47-L56 | train | Override Qt method to handle key press events. | 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/arraybuilder.py | NumpyArrayInline.event | def event(self, event):
"""
Qt override.
This is needed to be able to intercept the Tab key press event.
"""
if event.type() == QEvent.KeyPress:
if (event.key() == Qt.Key_Tab or event.key() == Qt.Key_Space):
text = self.text()
... | python | def event(self, event):
"""
Qt override.
This is needed to be able to intercept the Tab key press event.
"""
if event.type() == QEvent.KeyPress:
if (event.key() == Qt.Key_Tab or event.key() == Qt.Key_Space):
text = self.text()
... | [
"def",
"event",
"(",
"self",
",",
"event",
")",
":",
"if",
"event",
".",
"type",
"(",
")",
"==",
"QEvent",
".",
"KeyPress",
":",
"if",
"(",
"event",
".",
"key",
"(",
")",
"==",
"Qt",
".",
"Key_Tab",
"or",
"event",
".",
"key",
"(",
")",
"==",
... | Qt override.
This is needed to be able to intercept the Tab key press event. | [
"Qt",
"override",
".",
"This",
"is",
"needed",
"to",
"be",
"able",
"to",
"intercept",
"the",
"Tab",
"key",
"press",
"event",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/arraybuilder.py#L59-L79 | train | Override Qt method to modify the text of the current line with the event. | 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/arraybuilder.py | NumpyArrayTable.keyPressEvent | def keyPressEvent(self, event):
"""
Qt override.
"""
if event.key() in [Qt.Key_Enter, Qt.Key_Return]:
QTableWidget.keyPressEvent(self, event)
# To avoid having to enter one final tab
self.setDisabled(True)
self.setDisabled(False)
... | python | def keyPressEvent(self, event):
"""
Qt override.
"""
if event.key() in [Qt.Key_Enter, Qt.Key_Return]:
QTableWidget.keyPressEvent(self, event)
# To avoid having to enter one final tab
self.setDisabled(True)
self.setDisabled(False)
... | [
"def",
"keyPressEvent",
"(",
"self",
",",
"event",
")",
":",
"if",
"event",
".",
"key",
"(",
")",
"in",
"[",
"Qt",
".",
"Key_Enter",
",",
"Qt",
".",
"Key_Return",
"]",
":",
"QTableWidget",
".",
"keyPressEvent",
"(",
"self",
",",
"event",
")",
"# To a... | Qt override. | [
"Qt",
"override",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/arraybuilder.py#L93-L104 | train | Override. keyPressEvent to handle enter and return key events. | 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/arraybuilder.py | NumpyArrayTable.reset_headers | def reset_headers(self):
"""
Update the column and row numbering in the headers.
"""
rows = self.rowCount()
cols = self.columnCount()
for r in range(rows):
self.setVerticalHeaderItem(r, QTableWidgetItem(str(r)))
for c in range(cols):
... | python | def reset_headers(self):
"""
Update the column and row numbering in the headers.
"""
rows = self.rowCount()
cols = self.columnCount()
for r in range(rows):
self.setVerticalHeaderItem(r, QTableWidgetItem(str(r)))
for c in range(cols):
... | [
"def",
"reset_headers",
"(",
"self",
")",
":",
"rows",
"=",
"self",
".",
"rowCount",
"(",
")",
"cols",
"=",
"self",
".",
"columnCount",
"(",
")",
"for",
"r",
"in",
"range",
"(",
"rows",
")",
":",
"self",
".",
"setVerticalHeaderItem",
"(",
"r",
",",
... | Update the column and row numbering in the headers. | [
"Update",
"the",
"column",
"and",
"row",
"numbering",
"in",
"the",
"headers",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/arraybuilder.py#L124-L135 | train | Reset the column and row numbering in the headers. | 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/arraybuilder.py | NumpyArrayTable.text | def text(self):
"""
Return the entered array in a parseable form.
"""
text = []
rows = self.rowCount()
cols = self.columnCount()
# handle empty table case
if rows == 2 and cols == 2:
item = self.item(0, 0)
if item is Non... | python | def text(self):
"""
Return the entered array in a parseable form.
"""
text = []
rows = self.rowCount()
cols = self.columnCount()
# handle empty table case
if rows == 2 and cols == 2:
item = self.item(0, 0)
if item is Non... | [
"def",
"text",
"(",
"self",
")",
":",
"text",
"=",
"[",
"]",
"rows",
"=",
"self",
".",
"rowCount",
"(",
")",
"cols",
"=",
"self",
".",
"columnCount",
"(",
")",
"# handle empty table case\r",
"if",
"rows",
"==",
"2",
"and",
"cols",
"==",
"2",
":",
"... | Return the entered array in a parseable form. | [
"Return",
"the",
"entered",
"array",
"in",
"a",
"parseable",
"form",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/arraybuilder.py#L137-L166 | train | Return the entered array in a parseable form. | 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/arraybuilder.py | NumpyArrayDialog.keyPressEvent | def keyPressEvent(self, event):
"""
Qt override.
"""
QToolTip.hideText()
ctrl = event.modifiers() & Qt.ControlModifier
if event.key() in [Qt.Key_Enter, Qt.Key_Return]:
if ctrl:
self.process_text(array=False)
else:
... | python | def keyPressEvent(self, event):
"""
Qt override.
"""
QToolTip.hideText()
ctrl = event.modifiers() & Qt.ControlModifier
if event.key() in [Qt.Key_Enter, Qt.Key_Return]:
if ctrl:
self.process_text(array=False)
else:
... | [
"def",
"keyPressEvent",
"(",
"self",
",",
"event",
")",
":",
"QToolTip",
".",
"hideText",
"(",
")",
"ctrl",
"=",
"event",
".",
"modifiers",
"(",
")",
"&",
"Qt",
".",
"ControlModifier",
"if",
"event",
".",
"key",
"(",
")",
"in",
"[",
"Qt",
".",
"Key... | Qt override. | [
"Qt",
"override",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/arraybuilder.py#L271-L285 | train | Override Qt method to handle key press events. | 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/arraybuilder.py | NumpyArrayDialog.event | def event(self, event):
"""
Qt Override.
Usefull when in line edit mode.
"""
if event.type() == QEvent.KeyPress and event.key() == Qt.Key_Tab:
return False
return QWidget.event(self, event) | python | def event(self, event):
"""
Qt Override.
Usefull when in line edit mode.
"""
if event.type() == QEvent.KeyPress and event.key() == Qt.Key_Tab:
return False
return QWidget.event(self, event) | [
"def",
"event",
"(",
"self",
",",
"event",
")",
":",
"if",
"event",
".",
"type",
"(",
")",
"==",
"QEvent",
".",
"KeyPress",
"and",
"event",
".",
"key",
"(",
")",
"==",
"Qt",
".",
"Key_Tab",
":",
"return",
"False",
"return",
"QWidget",
".",
"event",... | Qt Override.
Usefull when in line edit mode. | [
"Qt",
"Override",
".",
"Usefull",
"when",
"in",
"line",
"edit",
"mode",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/arraybuilder.py#L287-L295 | train | Returns True if event is a tab 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/widgets/arraybuilder.py | NumpyArrayDialog.process_text | def process_text(self, array=True):
"""
Construct the text based on the entered content in the widget.
"""
if array:
prefix = 'np.array([['
else:
prefix = 'np.matrix([['
suffix = ']])'
values = self._widget.text().strip()
... | python | def process_text(self, array=True):
"""
Construct the text based on the entered content in the widget.
"""
if array:
prefix = 'np.array([['
else:
prefix = 'np.matrix([['
suffix = ']])'
values = self._widget.text().strip()
... | [
"def",
"process_text",
"(",
"self",
",",
"array",
"=",
"True",
")",
":",
"if",
"array",
":",
"prefix",
"=",
"'np.array([['",
"else",
":",
"prefix",
"=",
"'np.matrix([['",
"suffix",
"=",
"']])'",
"values",
"=",
"self",
".",
"_widget",
".",
"text",
"(",
... | Construct the text based on the entered content in the widget. | [
"Construct",
"the",
"text",
"based",
"on",
"the",
"entered",
"content",
"in",
"the",
"widget",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/arraybuilder.py#L297-L369 | train | Process the text 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/widgets/arraybuilder.py | NumpyArrayDialog.update_warning | def update_warning(self):
"""
Updates the icon and tip based on the validity of the array content.
"""
widget = self._button_warning
if not self.is_valid():
tip = _('Array dimensions not valid')
widget.setIcon(ima.icon('MessageBoxWarning'))
... | python | def update_warning(self):
"""
Updates the icon and tip based on the validity of the array content.
"""
widget = self._button_warning
if not self.is_valid():
tip = _('Array dimensions not valid')
widget.setIcon(ima.icon('MessageBoxWarning'))
... | [
"def",
"update_warning",
"(",
"self",
")",
":",
"widget",
"=",
"self",
".",
"_button_warning",
"if",
"not",
"self",
".",
"is_valid",
"(",
")",
":",
"tip",
"=",
"_",
"(",
"'Array dimensions not valid'",
")",
"widget",
".",
"setIcon",
"(",
"ima",
".",
"ico... | Updates the icon and tip based on the validity of the array content. | [
"Updates",
"the",
"icon",
"and",
"tip",
"based",
"on",
"the",
"validity",
"of",
"the",
"array",
"content",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/arraybuilder.py#L371-L382 | train | Updates the icon and tip based on the validity of the array content. | 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/general.py | MainConfigPage._save_lang | def _save_lang(self):
"""
Get selected language setting and save to language configuration file.
"""
for combobox, (option, _default) in list(self.comboboxes.items()):
if option == 'interface_language':
data = combobox.itemData(combobox.currentIndex())
... | python | def _save_lang(self):
"""
Get selected language setting and save to language configuration file.
"""
for combobox, (option, _default) in list(self.comboboxes.items()):
if option == 'interface_language':
data = combobox.itemData(combobox.currentIndex())
... | [
"def",
"_save_lang",
"(",
"self",
")",
":",
"for",
"combobox",
",",
"(",
"option",
",",
"_default",
")",
"in",
"list",
"(",
"self",
".",
"comboboxes",
".",
"items",
"(",
")",
")",
":",
"if",
"option",
"==",
"'interface_language'",
":",
"data",
"=",
"... | Get selected language setting and save to language configuration file. | [
"Get",
"selected",
"language",
"setting",
"and",
"save",
"to",
"language",
"configuration",
"file",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/general.py#L262-L281 | train | Save selected language setting and save to language 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/plugins/projects/widgets/projectdialog.py | is_writable | def is_writable(path):
"""Check if path has write access"""
try:
testfile = tempfile.TemporaryFile(dir=path)
testfile.close()
except OSError as e:
if e.errno == errno.EACCES: # 13
return False
return True | python | def is_writable(path):
"""Check if path has write access"""
try:
testfile = tempfile.TemporaryFile(dir=path)
testfile.close()
except OSError as e:
if e.errno == errno.EACCES: # 13
return False
return True | [
"def",
"is_writable",
"(",
"path",
")",
":",
"try",
":",
"testfile",
"=",
"tempfile",
".",
"TemporaryFile",
"(",
"dir",
"=",
"path",
")",
"testfile",
".",
"close",
"(",
")",
"except",
"OSError",
"as",
"e",
":",
"if",
"e",
".",
"errno",
"==",
"errno",... | Check if path has write access | [
"Check",
"if",
"path",
"has",
"write",
"access"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/projects/widgets/projectdialog.py#L35-L43 | train | Check if path has write access | 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/projects/widgets/projectdialog.py | ProjectDialog._get_project_types | def _get_project_types(self):
"""Get all available project types."""
project_types = get_available_project_types()
projects = []
for project in project_types:
projects.append(project.PROJECT_TYPE_NAME)
return projects | python | def _get_project_types(self):
"""Get all available project types."""
project_types = get_available_project_types()
projects = []
for project in project_types:
projects.append(project.PROJECT_TYPE_NAME)
return projects | [
"def",
"_get_project_types",
"(",
"self",
")",
":",
"project_types",
"=",
"get_available_project_types",
"(",
")",
"projects",
"=",
"[",
"]",
"for",
"project",
"in",
"project_types",
":",
"projects",
".",
"append",
"(",
"project",
".",
"PROJECT_TYPE_NAME",
")",
... | Get all available project types. | [
"Get",
"all",
"available",
"project",
"types",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/projects/widgets/projectdialog.py#L143-L151 | train | Get all available project types. | 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/projects/widgets/projectdialog.py | ProjectDialog.select_location | def select_location(self):
"""Select directory."""
location = osp.normpath(getexistingdirectory(self,
_("Select directory"),
self.location))
if location:
if is_writable(l... | python | def select_location(self):
"""Select directory."""
location = osp.normpath(getexistingdirectory(self,
_("Select directory"),
self.location))
if location:
if is_writable(l... | [
"def",
"select_location",
"(",
"self",
")",
":",
"location",
"=",
"osp",
".",
"normpath",
"(",
"getexistingdirectory",
"(",
"self",
",",
"_",
"(",
"\"Select directory\"",
")",
",",
"self",
".",
"location",
")",
")",
"if",
"location",
":",
"if",
"is_writabl... | Select directory. | [
"Select",
"directory",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/projects/widgets/projectdialog.py#L153-L162 | train | Select directory. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/projects/widgets/projectdialog.py | ProjectDialog.update_location | def update_location(self, text=''):
"""Update text of location."""
self.text_project_name.setEnabled(self.radio_new_dir.isChecked())
name = self.text_project_name.text().strip()
if name and self.radio_new_dir.isChecked():
path = osp.join(self.location, name)
... | python | def update_location(self, text=''):
"""Update text of location."""
self.text_project_name.setEnabled(self.radio_new_dir.isChecked())
name = self.text_project_name.text().strip()
if name and self.radio_new_dir.isChecked():
path = osp.join(self.location, name)
... | [
"def",
"update_location",
"(",
"self",
",",
"text",
"=",
"''",
")",
":",
"self",
".",
"text_project_name",
".",
"setEnabled",
"(",
"self",
".",
"radio_new_dir",
".",
"isChecked",
"(",
")",
")",
"name",
"=",
"self",
".",
"text_project_name",
".",
"text",
... | Update text of location. | [
"Update",
"text",
"of",
"location",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/projects/widgets/projectdialog.py#L164-L179 | train | Update text of location. | 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/projects/widgets/projectdialog.py | ProjectDialog.create_project | def create_project(self):
"""Create project."""
packages = ['python={0}'.format(self.combo_python_version.currentText())]
self.sig_project_creation_requested.emit(
self.text_location.text(),
self.combo_project_type.currentText(),
packages)
self.... | python | def create_project(self):
"""Create project."""
packages = ['python={0}'.format(self.combo_python_version.currentText())]
self.sig_project_creation_requested.emit(
self.text_location.text(),
self.combo_project_type.currentText(),
packages)
self.... | [
"def",
"create_project",
"(",
"self",
")",
":",
"packages",
"=",
"[",
"'python={0}'",
".",
"format",
"(",
"self",
".",
"combo_python_version",
".",
"currentText",
"(",
")",
")",
"]",
"self",
".",
"sig_project_creation_requested",
".",
"emit",
"(",
"self",
".... | Create project. | [
"Create",
"project",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/projects/widgets/projectdialog.py#L181-L188 | train | Create project. | 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/console/widgets/shell.py | ShellBaseWidget.set_font | def set_font(self, font):
"""Set shell styles font"""
self.setFont(font)
self.set_pythonshell_font(font)
cursor = self.textCursor()
cursor.select(QTextCursor.Document)
charformat = QTextCharFormat()
charformat.setFontFamily(font.family())
charforma... | python | def set_font(self, font):
"""Set shell styles font"""
self.setFont(font)
self.set_pythonshell_font(font)
cursor = self.textCursor()
cursor.select(QTextCursor.Document)
charformat = QTextCharFormat()
charformat.setFontFamily(font.family())
charforma... | [
"def",
"set_font",
"(",
"self",
",",
"font",
")",
":",
"self",
".",
"setFont",
"(",
"font",
")",
"self",
".",
"set_pythonshell_font",
"(",
"font",
")",
"cursor",
"=",
"self",
".",
"textCursor",
"(",
")",
"cursor",
".",
"select",
"(",
"QTextCursor",
"."... | Set shell styles font | [
"Set",
"shell",
"styles",
"font"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L108-L117 | train | Set shell styles font | 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/console/widgets/shell.py | ShellBaseWidget.setup_context_menu | def setup_context_menu(self):
"""Setup shell context menu"""
self.menu = QMenu(self)
self.cut_action = create_action(self, _("Cut"),
shortcut=keybinding('Cut'),
icon=ima.icon('editcut'),
... | python | def setup_context_menu(self):
"""Setup shell context menu"""
self.menu = QMenu(self)
self.cut_action = create_action(self, _("Cut"),
shortcut=keybinding('Cut'),
icon=ima.icon('editcut'),
... | [
"def",
"setup_context_menu",
"(",
"self",
")",
":",
"self",
".",
"menu",
"=",
"QMenu",
"(",
"self",
")",
"self",
".",
"cut_action",
"=",
"create_action",
"(",
"self",
",",
"_",
"(",
"\"Cut\"",
")",
",",
"shortcut",
"=",
"keybinding",
"(",
"'Cut'",
")",... | Setup shell context menu | [
"Setup",
"shell",
"context",
"menu"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L121-L151 | train | Setup shell context menu | 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/console/widgets/shell.py | ShellBaseWidget.contextMenuEvent | def contextMenuEvent(self, event):
"""Reimplement Qt method"""
state = self.has_selected_text()
self.copy_action.setEnabled(state)
self.cut_action.setEnabled(state)
self.delete_action.setEnabled(state)
self.menu.popup(event.globalPos())
event.accept() | python | def contextMenuEvent(self, event):
"""Reimplement Qt method"""
state = self.has_selected_text()
self.copy_action.setEnabled(state)
self.cut_action.setEnabled(state)
self.delete_action.setEnabled(state)
self.menu.popup(event.globalPos())
event.accept() | [
"def",
"contextMenuEvent",
"(",
"self",
",",
"event",
")",
":",
"state",
"=",
"self",
".",
"has_selected_text",
"(",
")",
"self",
".",
"copy_action",
".",
"setEnabled",
"(",
"state",
")",
"self",
".",
"cut_action",
".",
"setEnabled",
"(",
"state",
")",
"... | Reimplement Qt method | [
"Reimplement",
"Qt",
"method"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L153-L160 | train | Reimplement Qt 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/console/widgets/shell.py | ShellBaseWidget._select_input | def _select_input(self):
"""Select current line (without selecting console prompt)"""
line, index = self.get_position('eof')
if self.current_prompt_pos is None:
pline, pindex = line, index
else:
pline, pindex = self.current_prompt_pos
self.setSelect... | python | def _select_input(self):
"""Select current line (without selecting console prompt)"""
line, index = self.get_position('eof')
if self.current_prompt_pos is None:
pline, pindex = line, index
else:
pline, pindex = self.current_prompt_pos
self.setSelect... | [
"def",
"_select_input",
"(",
"self",
")",
":",
"line",
",",
"index",
"=",
"self",
".",
"get_position",
"(",
"'eof'",
")",
"if",
"self",
".",
"current_prompt_pos",
"is",
"None",
":",
"pline",
",",
"pindex",
"=",
"line",
",",
"index",
"else",
":",
"pline... | Select current line (without selecting console prompt) | [
"Select",
"current",
"line",
"(",
"without",
"selecting",
"console",
"prompt",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L167-L174 | train | Select current line without selecting console prompt | 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/console/widgets/shell.py | ShellBaseWidget._set_input_buffer | def _set_input_buffer(self, text):
"""Set input buffer"""
if self.current_prompt_pos is not None:
self.replace_text(self.current_prompt_pos, 'eol', text)
else:
self.insert(text)
self.set_cursor_position('eof') | python | def _set_input_buffer(self, text):
"""Set input buffer"""
if self.current_prompt_pos is not None:
self.replace_text(self.current_prompt_pos, 'eol', text)
else:
self.insert(text)
self.set_cursor_position('eof') | [
"def",
"_set_input_buffer",
"(",
"self",
",",
"text",
")",
":",
"if",
"self",
".",
"current_prompt_pos",
"is",
"not",
"None",
":",
"self",
".",
"replace_text",
"(",
"self",
".",
"current_prompt_pos",
",",
"'eol'",
",",
"text",
")",
"else",
":",
"self",
"... | Set input buffer | [
"Set",
"input",
"buffer"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L185-L191 | train | Set input buffer. | 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/console/widgets/shell.py | ShellBaseWidget._get_input_buffer | def _get_input_buffer(self):
"""Return input buffer"""
input_buffer = ''
if self.current_prompt_pos is not None:
input_buffer = self.get_text(self.current_prompt_pos, 'eol')
input_buffer = input_buffer.replace(os.linesep, '\n')
return input_buffer | python | def _get_input_buffer(self):
"""Return input buffer"""
input_buffer = ''
if self.current_prompt_pos is not None:
input_buffer = self.get_text(self.current_prompt_pos, 'eol')
input_buffer = input_buffer.replace(os.linesep, '\n')
return input_buffer | [
"def",
"_get_input_buffer",
"(",
"self",
")",
":",
"input_buffer",
"=",
"''",
"if",
"self",
".",
"current_prompt_pos",
"is",
"not",
"None",
":",
"input_buffer",
"=",
"self",
".",
"get_text",
"(",
"self",
".",
"current_prompt_pos",
",",
"'eol'",
")",
"input_b... | Return input buffer | [
"Return",
"input",
"buffer"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L193-L199 | train | Return the input buffer | 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/console/widgets/shell.py | ShellBaseWidget.new_prompt | def new_prompt(self, prompt):
"""
Print a new prompt and save its (line, index) position
"""
if self.get_cursor_line_column()[1] != 0:
self.write('\n')
self.write(prompt, prompt=True)
# now we update our cursor giving end of prompt
self.current... | python | def new_prompt(self, prompt):
"""
Print a new prompt and save its (line, index) position
"""
if self.get_cursor_line_column()[1] != 0:
self.write('\n')
self.write(prompt, prompt=True)
# now we update our cursor giving end of prompt
self.current... | [
"def",
"new_prompt",
"(",
"self",
",",
"prompt",
")",
":",
"if",
"self",
".",
"get_cursor_line_column",
"(",
")",
"[",
"1",
"]",
"!=",
"0",
":",
"self",
".",
"write",
"(",
"'\\n'",
")",
"self",
".",
"write",
"(",
"prompt",
",",
"prompt",
"=",
"True... | Print a new prompt and save its (line, index) position | [
"Print",
"a",
"new",
"prompt",
"and",
"save",
"its",
"(",
"line",
"index",
")",
"position"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L205-L215 | train | Print a new prompt and save its line 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/plugins/console/widgets/shell.py | ShellBaseWidget.check_selection | def check_selection(self):
"""
Check if selected text is r/w,
otherwise remove read-only parts of selection
"""
if self.current_prompt_pos is None:
self.set_cursor_position('eof')
else:
self.truncate_selection(self.current_prompt_pos) | python | def check_selection(self):
"""
Check if selected text is r/w,
otherwise remove read-only parts of selection
"""
if self.current_prompt_pos is None:
self.set_cursor_position('eof')
else:
self.truncate_selection(self.current_prompt_pos) | [
"def",
"check_selection",
"(",
"self",
")",
":",
"if",
"self",
".",
"current_prompt_pos",
"is",
"None",
":",
"self",
".",
"set_cursor_position",
"(",
"'eof'",
")",
"else",
":",
"self",
".",
"truncate_selection",
"(",
"self",
".",
"current_prompt_pos",
")"
] | Check if selected text is r/w,
otherwise remove read-only parts of selection | [
"Check",
"if",
"selected",
"text",
"is",
"r",
"/",
"w",
"otherwise",
"remove",
"read",
"-",
"only",
"parts",
"of",
"selection"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L217-L225 | train | Check if selected text is r or w remove read - only parts of selection | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/console/widgets/shell.py | ShellBaseWidget.copy | def copy(self):
"""Copy text to clipboard... or keyboard interrupt"""
if self.has_selected_text():
ConsoleBaseWidget.copy(self)
elif not sys.platform == 'darwin':
self.interrupt() | python | def copy(self):
"""Copy text to clipboard... or keyboard interrupt"""
if self.has_selected_text():
ConsoleBaseWidget.copy(self)
elif not sys.platform == 'darwin':
self.interrupt() | [
"def",
"copy",
"(",
"self",
")",
":",
"if",
"self",
".",
"has_selected_text",
"(",
")",
":",
"ConsoleBaseWidget",
".",
"copy",
"(",
"self",
")",
"elif",
"not",
"sys",
".",
"platform",
"==",
"'darwin'",
":",
"self",
".",
"interrupt",
"(",
")"
] | Copy text to clipboard... or keyboard interrupt | [
"Copy",
"text",
"to",
"clipboard",
"...",
"or",
"keyboard",
"interrupt"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L230-L235 | train | Copy text to clipboard... or keyboard interrupt | 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/console/widgets/shell.py | ShellBaseWidget.save_historylog | def save_historylog(self):
"""Save current history log (all text in console)"""
title = _("Save history log")
self.redirect_stdio.emit(False)
filename, _selfilter = getsavefilename(self, title,
self.historylog_filename, "%s (*.log)" % _("History logs"))
... | python | def save_historylog(self):
"""Save current history log (all text in console)"""
title = _("Save history log")
self.redirect_stdio.emit(False)
filename, _selfilter = getsavefilename(self, title,
self.historylog_filename, "%s (*.log)" % _("History logs"))
... | [
"def",
"save_historylog",
"(",
"self",
")",
":",
"title",
"=",
"_",
"(",
"\"Save history log\"",
")",
"self",
".",
"redirect_stdio",
".",
"emit",
"(",
"False",
")",
"filename",
",",
"_selfilter",
"=",
"getsavefilename",
"(",
"self",
",",
"title",
",",
"sel... | Save current history log (all text in console) | [
"Save",
"current",
"history",
"log",
"(",
"all",
"text",
"in",
"console",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L256-L271 | train | Save current history log | 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/console/widgets/shell.py | ShellBaseWidget.on_new_line | def on_new_line(self):
"""On new input line"""
self.set_cursor_position('eof')
self.current_prompt_pos = self.get_position('cursor')
self.new_input_line = False | python | def on_new_line(self):
"""On new input line"""
self.set_cursor_position('eof')
self.current_prompt_pos = self.get_position('cursor')
self.new_input_line = False | [
"def",
"on_new_line",
"(",
"self",
")",
":",
"self",
".",
"set_cursor_position",
"(",
"'eof'",
")",
"self",
".",
"current_prompt_pos",
"=",
"self",
".",
"get_position",
"(",
"'cursor'",
")",
"self",
".",
"new_input_line",
"=",
"False"
] | On new input line | [
"On",
"new",
"input",
"line"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L283-L287 | train | On new 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/console/widgets/shell.py | ShellBaseWidget.preprocess_keyevent | def preprocess_keyevent(self, event):
"""Pre-process keypress event:
return True if event is accepted, false otherwise"""
# Copy must be done first to be able to copy read-only text parts
# (otherwise, right below, we would remove selection
# if not on current line)
... | python | def preprocess_keyevent(self, event):
"""Pre-process keypress event:
return True if event is accepted, false otherwise"""
# Copy must be done first to be able to copy read-only text parts
# (otherwise, right below, we would remove selection
# if not on current line)
... | [
"def",
"preprocess_keyevent",
"(",
"self",
",",
"event",
")",
":",
"# Copy must be done first to be able to copy read-only text parts\r",
"# (otherwise, right below, we would remove selection\r",
"# if not on current line)\r",
"ctrl",
"=",
"event",
".",
"modifiers",
"(",
")",
"&... | Pre-process keypress event:
return True if event is accepted, false otherwise | [
"Pre",
"-",
"process",
"keypress",
"event",
":",
"return",
"True",
"if",
"event",
"is",
"accepted",
"false",
"otherwise"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L307-L328 | train | Pre - process a keypress event and return True if event is accepted False otherwise | 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/console/widgets/shell.py | ShellBaseWidget.postprocess_keyevent | def postprocess_keyevent(self, event):
"""Post-process keypress event:
in InternalShell, this is method is called when shell is ready"""
event, text, key, ctrl, shift = restore_keyevent(event)
# Is cursor on the last line? and after prompt?
if len(text):
... | python | def postprocess_keyevent(self, event):
"""Post-process keypress event:
in InternalShell, this is method is called when shell is ready"""
event, text, key, ctrl, shift = restore_keyevent(event)
# Is cursor on the last line? and after prompt?
if len(text):
... | [
"def",
"postprocess_keyevent",
"(",
"self",
",",
"event",
")",
":",
"event",
",",
"text",
",",
"key",
",",
"ctrl",
",",
"shift",
"=",
"restore_keyevent",
"(",
"event",
")",
"# Is cursor on the last line? and after prompt?\r",
"if",
"len",
"(",
"text",
")",
":"... | Post-process keypress event:
in InternalShell, this is method is called when shell is ready | [
"Post",
"-",
"process",
"keypress",
"event",
":",
"in",
"InternalShell",
"this",
"is",
"method",
"is",
"called",
"when",
"shell",
"is",
"ready"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L330-L457 | train | This method is called when the user has pressed a keypress event in InternalShell. | 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/console/widgets/shell.py | ShellBaseWidget.load_history | def load_history(self):
"""Load history from a .py file in user home directory"""
if osp.isfile(self.history_filename):
rawhistory, _ = encoding.readlines(self.history_filename)
rawhistory = [line.replace('\n', '') for line in rawhistory]
if rawhistory[1] != self... | python | def load_history(self):
"""Load history from a .py file in user home directory"""
if osp.isfile(self.history_filename):
rawhistory, _ = encoding.readlines(self.history_filename)
rawhistory = [line.replace('\n', '') for line in rawhistory]
if rawhistory[1] != self... | [
"def",
"load_history",
"(",
"self",
")",
":",
"if",
"osp",
".",
"isfile",
"(",
"self",
".",
"history_filename",
")",
":",
"rawhistory",
",",
"_",
"=",
"encoding",
".",
"readlines",
"(",
"self",
".",
"history_filename",
")",
"rawhistory",
"=",
"[",
"line"... | Load history from a .py file in user home directory | [
"Load",
"history",
"from",
"a",
".",
"py",
"file",
"in",
"user",
"home",
"directory"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L495-L520 | train | Load the history from a. py file in user home directory. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/console/widgets/shell.py | ShellBaseWidget.write_error | def write_error(self, text):
"""Simulate stderr"""
self.flush()
self.write(text, flush=True, error=True)
if get_debug_level():
STDERR.write(text) | python | def write_error(self, text):
"""Simulate stderr"""
self.flush()
self.write(text, flush=True, error=True)
if get_debug_level():
STDERR.write(text) | [
"def",
"write_error",
"(",
"self",
",",
"text",
")",
":",
"self",
".",
"flush",
"(",
")",
"self",
".",
"write",
"(",
"text",
",",
"flush",
"=",
"True",
",",
"error",
"=",
"True",
")",
"if",
"get_debug_level",
"(",
")",
":",
"STDERR",
".",
"write",
... | Simulate stderr | [
"Simulate",
"stderr"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L523-L528 | train | Simulate stderr | 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/console/widgets/shell.py | ShellBaseWidget.write | def write(self, text, flush=False, error=False, prompt=False):
"""Simulate stdout and stderr"""
if prompt:
self.flush()
if not is_string(text):
# This test is useful to discriminate QStrings from decoded str
text = to_text_string(text)
self.__bu... | python | def write(self, text, flush=False, error=False, prompt=False):
"""Simulate stdout and stderr"""
if prompt:
self.flush()
if not is_string(text):
# This test is useful to discriminate QStrings from decoded str
text = to_text_string(text)
self.__bu... | [
"def",
"write",
"(",
"self",
",",
"text",
",",
"flush",
"=",
"False",
",",
"error",
"=",
"False",
",",
"prompt",
"=",
"False",
")",
":",
"if",
"prompt",
":",
"self",
".",
"flush",
"(",
")",
"if",
"not",
"is_string",
"(",
"text",
")",
":",
"# This... | Simulate stdout and stderr | [
"Simulate",
"stdout",
"and",
"stderr"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L530-L545 | train | Write text to the output of the specified object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/console/widgets/shell.py | ShellBaseWidget.flush | def flush(self, error=False, prompt=False):
"""Flush buffer, write text to console"""
# Fix for Issue 2452
if PY3:
try:
text = "".join(self.__buffer)
except TypeError:
text = b"".join(self.__buffer)
try:
... | python | def flush(self, error=False, prompt=False):
"""Flush buffer, write text to console"""
# Fix for Issue 2452
if PY3:
try:
text = "".join(self.__buffer)
except TypeError:
text = b"".join(self.__buffer)
try:
... | [
"def",
"flush",
"(",
"self",
",",
"error",
"=",
"False",
",",
"prompt",
"=",
"False",
")",
":",
"# Fix for Issue 2452 \r",
"if",
"PY3",
":",
"try",
":",
"text",
"=",
"\"\"",
".",
"join",
"(",
"self",
".",
"__buffer",
")",
"except",
"TypeError",
":",
... | Flush buffer, write text to console | [
"Flush",
"buffer",
"write",
"text",
"to",
"console"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L547-L567 | train | Flush buffer write text to console | 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/console/widgets/shell.py | ShellBaseWidget.insert_text | def insert_text(self, text, at_end=False, error=False, prompt=False):
"""
Insert text at the current cursor position
or at the end of the command line
"""
if at_end:
# Insert text at the end of the command line
self.append_text_to_shell(text, error,... | python | def insert_text(self, text, at_end=False, error=False, prompt=False):
"""
Insert text at the current cursor position
or at the end of the command line
"""
if at_end:
# Insert text at the end of the command line
self.append_text_to_shell(text, error,... | [
"def",
"insert_text",
"(",
"self",
",",
"text",
",",
"at_end",
"=",
"False",
",",
"error",
"=",
"False",
",",
"prompt",
"=",
"False",
")",
":",
"if",
"at_end",
":",
"# Insert text at the end of the command line\r",
"self",
".",
"append_text_to_shell",
"(",
"te... | Insert text at the current cursor position
or at the end of the command line | [
"Insert",
"text",
"at",
"the",
"current",
"cursor",
"position",
"or",
"at",
"the",
"end",
"of",
"the",
"command",
"line"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L571-L581 | train | Insert text at the current cursor position at_end or at the end of the command 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/console/widgets/shell.py | ShellBaseWidget.dropEvent | def dropEvent(self, event):
"""Drag and Drop - Drop event"""
if (event.mimeData().hasFormat("text/plain")):
text = to_text_string(event.mimeData().text())
if self.new_input_line:
self.on_new_line()
self.insert_text(text, at_end=True)
... | python | def dropEvent(self, event):
"""Drag and Drop - Drop event"""
if (event.mimeData().hasFormat("text/plain")):
text = to_text_string(event.mimeData().text())
if self.new_input_line:
self.on_new_line()
self.insert_text(text, at_end=True)
... | [
"def",
"dropEvent",
"(",
"self",
",",
"event",
")",
":",
"if",
"(",
"event",
".",
"mimeData",
"(",
")",
".",
"hasFormat",
"(",
"\"text/plain\"",
")",
")",
":",
"text",
"=",
"to_text_string",
"(",
"event",
".",
"mimeData",
"(",
")",
".",
"text",
"(",
... | Drag and Drop - Drop event | [
"Drag",
"and",
"Drop",
"-",
"Drop",
"event"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L607-L618 | train | Drag and Drop - Drop event. | 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/console/widgets/shell.py | PythonShellWidget.setup_context_menu | def setup_context_menu(self):
"""Reimplements ShellBaseWidget method"""
ShellBaseWidget.setup_context_menu(self)
self.copy_without_prompts_action = create_action(self,
_("Copy without prompts"),
icon=ima.icon('copywop... | python | def setup_context_menu(self):
"""Reimplements ShellBaseWidget method"""
ShellBaseWidget.setup_context_menu(self)
self.copy_without_prompts_action = create_action(self,
_("Copy without prompts"),
icon=ima.icon('copywop... | [
"def",
"setup_context_menu",
"(",
"self",
")",
":",
"ShellBaseWidget",
".",
"setup_context_menu",
"(",
"self",
")",
"self",
".",
"copy_without_prompts_action",
"=",
"create_action",
"(",
"self",
",",
"_",
"(",
"\"Copy without prompts\"",
")",
",",
"icon",
"=",
"... | Reimplements ShellBaseWidget method | [
"Reimplements",
"ShellBaseWidget",
"method"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L672-L693 | train | Reimplement context menu setup 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/console/widgets/shell.py | PythonShellWidget.contextMenuEvent | def contextMenuEvent(self, event):
"""Reimplements ShellBaseWidget method"""
state = self.has_selected_text()
self.copy_without_prompts_action.setEnabled(state)
ShellBaseWidget.contextMenuEvent(self, event) | python | def contextMenuEvent(self, event):
"""Reimplements ShellBaseWidget method"""
state = self.has_selected_text()
self.copy_without_prompts_action.setEnabled(state)
ShellBaseWidget.contextMenuEvent(self, event) | [
"def",
"contextMenuEvent",
"(",
"self",
",",
"event",
")",
":",
"state",
"=",
"self",
".",
"has_selected_text",
"(",
")",
"self",
".",
"copy_without_prompts_action",
".",
"setEnabled",
"(",
"state",
")",
"ShellBaseWidget",
".",
"contextMenuEvent",
"(",
"self",
... | Reimplements ShellBaseWidget method | [
"Reimplements",
"ShellBaseWidget",
"method"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L695-L699 | train | Reimplement contextMenuEvent 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/console/widgets/shell.py | PythonShellWidget.copy_without_prompts | def copy_without_prompts(self):
"""Copy text to clipboard without prompts"""
text = self.get_selected_text()
lines = text.split(os.linesep)
for index, line in enumerate(lines):
if line.startswith('>>> ') or line.startswith('... '):
lines[index] = line[4:... | python | def copy_without_prompts(self):
"""Copy text to clipboard without prompts"""
text = self.get_selected_text()
lines = text.split(os.linesep)
for index, line in enumerate(lines):
if line.startswith('>>> ') or line.startswith('... '):
lines[index] = line[4:... | [
"def",
"copy_without_prompts",
"(",
"self",
")",
":",
"text",
"=",
"self",
".",
"get_selected_text",
"(",
")",
"lines",
"=",
"text",
".",
"split",
"(",
"os",
".",
"linesep",
")",
"for",
"index",
",",
"line",
"in",
"enumerate",
"(",
"lines",
")",
":",
... | Copy text to clipboard without prompts | [
"Copy",
"text",
"to",
"clipboard",
"without",
"prompts"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L702-L710 | train | Copy text to clipboard without prompts | 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/console/widgets/shell.py | PythonShellWidget.postprocess_keyevent | def postprocess_keyevent(self, event):
"""Process keypress event"""
ShellBaseWidget.postprocess_keyevent(self, event)
if QToolTip.isVisible():
_event, _text, key, _ctrl, _shift = restore_keyevent(event)
self.hide_tooltip_if_necessary(key) | python | def postprocess_keyevent(self, event):
"""Process keypress event"""
ShellBaseWidget.postprocess_keyevent(self, event)
if QToolTip.isVisible():
_event, _text, key, _ctrl, _shift = restore_keyevent(event)
self.hide_tooltip_if_necessary(key) | [
"def",
"postprocess_keyevent",
"(",
"self",
",",
"event",
")",
":",
"ShellBaseWidget",
".",
"postprocess_keyevent",
"(",
"self",
",",
"event",
")",
"if",
"QToolTip",
".",
"isVisible",
"(",
")",
":",
"_event",
",",
"_text",
",",
"key",
",",
"_ctrl",
",",
... | Process keypress event | [
"Process",
"keypress",
"event"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L714-L719 | train | Process keypress event. | 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/console/widgets/shell.py | PythonShellWidget._key_backspace | def _key_backspace(self, cursor_position):
"""Action for Backspace key"""
if self.has_selected_text():
self.check_selection()
self.remove_selected_text()
elif self.current_prompt_pos == cursor_position:
# Avoid deleting prompt
return
... | python | def _key_backspace(self, cursor_position):
"""Action for Backspace key"""
if self.has_selected_text():
self.check_selection()
self.remove_selected_text()
elif self.current_prompt_pos == cursor_position:
# Avoid deleting prompt
return
... | [
"def",
"_key_backspace",
"(",
"self",
",",
"cursor_position",
")",
":",
"if",
"self",
".",
"has_selected_text",
"(",
")",
":",
"self",
".",
"check_selection",
"(",
")",
"self",
".",
"remove_selected_text",
"(",
")",
"elif",
"self",
".",
"current_prompt_pos",
... | Action for Backspace key | [
"Action",
"for",
"Backspace",
"key"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L726-L739 | train | Action for Backspace 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/plugins/console/widgets/shell.py | PythonShellWidget._key_tab | def _key_tab(self):
"""Action for TAB key"""
if self.is_cursor_on_last_line():
empty_line = not self.get_current_line_to_cursor().strip()
if empty_line:
self.stdkey_tab()
else:
self.show_code_completion() | python | def _key_tab(self):
"""Action for TAB key"""
if self.is_cursor_on_last_line():
empty_line = not self.get_current_line_to_cursor().strip()
if empty_line:
self.stdkey_tab()
else:
self.show_code_completion() | [
"def",
"_key_tab",
"(",
"self",
")",
":",
"if",
"self",
".",
"is_cursor_on_last_line",
"(",
")",
":",
"empty_line",
"=",
"not",
"self",
".",
"get_current_line_to_cursor",
"(",
")",
".",
"strip",
"(",
")",
"if",
"empty_line",
":",
"self",
".",
"stdkey_tab",... | Action for TAB key | [
"Action",
"for",
"TAB",
"key"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L741-L748 | train | Action for TAB 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/plugins/console/widgets/shell.py | PythonShellWidget._key_question | def _key_question(self, text):
"""Action for '?'"""
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)
self.insert_text(text)
# In case calltip and com... | python | def _key_question(self, text):
"""Action for '?'"""
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)
self.insert_text(text)
# In case calltip and com... | [
"def",
"_key_question",
"(",
"self",
",",
"text",
")",
":",
"if",
"self",
".",
"get_current_line_to_cursor",
"(",
")",
":",
"last_obj",
"=",
"self",
".",
"get_last_obj",
"(",
")",
"if",
"last_obj",
"and",
"not",
"last_obj",
".",
"isdigit",
"(",
")",
":",... | Action for '? | [
"Action",
"for",
"?"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L768-L777 | train | Action for question | 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/console/widgets/shell.py | PythonShellWidget._key_parenleft | def _key_parenleft(self, text):
"""Action for '('"""
self.hide_completion_widget()
if self.get_current_line_to_cursor():
last_obj = self.get_last_obj()
if last_obj and not last_obj.isdigit():
self.insert_text(text)
self.show_object_i... | python | def _key_parenleft(self, text):
"""Action for '('"""
self.hide_completion_widget()
if self.get_current_line_to_cursor():
last_obj = self.get_last_obj()
if last_obj and not last_obj.isdigit():
self.insert_text(text)
self.show_object_i... | [
"def",
"_key_parenleft",
"(",
"self",
",",
"text",
")",
":",
"self",
".",
"hide_completion_widget",
"(",
")",
"if",
"self",
".",
"get_current_line_to_cursor",
"(",
")",
":",
"last_obj",
"=",
"self",
".",
"get_last_obj",
"(",
")",
"if",
"last_obj",
"and",
"... | Action for '( | [
"Action",
"for",
"("
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L779-L788 | 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/console/widgets/shell.py | PythonShellWidget._key_period | def _key_period(self, text):
"""Action for '.'"""
self.insert_text(text)
if self.codecompletion_auto:
# Enable auto-completion only if last token isn't a float
last_obj = self.get_last_obj()
if last_obj and not last_obj.isdigit():
self.s... | python | def _key_period(self, text):
"""Action for '.'"""
self.insert_text(text)
if self.codecompletion_auto:
# Enable auto-completion only if last token isn't a float
last_obj = self.get_last_obj()
if last_obj and not last_obj.isdigit():
self.s... | [
"def",
"_key_period",
"(",
"self",
",",
"text",
")",
":",
"self",
".",
"insert_text",
"(",
"text",
")",
"if",
"self",
".",
"codecompletion_auto",
":",
"# Enable auto-completion only if last token isn't a float\r",
"last_obj",
"=",
"self",
".",
"get_last_obj",
"(",
... | Action for '. | [
"Action",
"for",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L790-L797 | 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/console/widgets/shell.py | PythonShellWidget.paste | def paste(self):
"""Reimplemented slot to handle multiline paste action"""
text = to_text_string(QApplication.clipboard().text())
if len(text.splitlines()) > 1:
# Multiline paste
if self.new_input_line:
self.on_new_line()
self.remove_sel... | python | def paste(self):
"""Reimplemented slot to handle multiline paste action"""
text = to_text_string(QApplication.clipboard().text())
if len(text.splitlines()) > 1:
# Multiline paste
if self.new_input_line:
self.on_new_line()
self.remove_sel... | [
"def",
"paste",
"(",
"self",
")",
":",
"text",
"=",
"to_text_string",
"(",
"QApplication",
".",
"clipboard",
"(",
")",
".",
"text",
"(",
")",
")",
"if",
"len",
"(",
"text",
".",
"splitlines",
"(",
")",
")",
">",
"1",
":",
"# Multiline paste\r",
"if",... | Reimplemented slot to handle multiline paste action | [
"Reimplemented",
"slot",
"to",
"handle",
"multiline",
"paste",
"action"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L801-L816 | train | Reimplemented slot to handle multiline paste action | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/console/widgets/shell.py | PythonShellWidget.show_completion_list | def show_completion_list(self, completions, completion_text=""):
"""Display the possible completions"""
if not completions:
return
if not isinstance(completions[0], tuple):
completions = [(c, '') for c in completions]
if len(completions) == 1 and completions... | python | def show_completion_list(self, completions, completion_text=""):
"""Display the possible completions"""
if not completions:
return
if not isinstance(completions[0], tuple):
completions = [(c, '') for c in completions]
if len(completions) == 1 and completions... | [
"def",
"show_completion_list",
"(",
"self",
",",
"completions",
",",
"completion_text",
"=",
"\"\"",
")",
":",
"if",
"not",
"completions",
":",
"return",
"if",
"not",
"isinstance",
"(",
"completions",
"[",
"0",
"]",
",",
"tuple",
")",
":",
"completions",
"... | Display the possible completions | [
"Display",
"the",
"possible",
"completions"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L858-L875 | train | Display the possible completions | 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/console/widgets/shell.py | PythonShellWidget.show_code_completion | def show_code_completion(self):
"""Display a completion list based on the current line"""
# Note: unicode conversion is needed only for ExternalShellBase
text = to_text_string(self.get_current_line_to_cursor())
last_obj = self.get_last_obj()
if not text:
return
... | python | def show_code_completion(self):
"""Display a completion list based on the current line"""
# Note: unicode conversion is needed only for ExternalShellBase
text = to_text_string(self.get_current_line_to_cursor())
last_obj = self.get_last_obj()
if not text:
return
... | [
"def",
"show_code_completion",
"(",
"self",
")",
":",
"# Note: unicode conversion is needed only for ExternalShellBase\r",
"text",
"=",
"to_text_string",
"(",
"self",
".",
"get_current_line_to_cursor",
"(",
")",
")",
"last_obj",
"=",
"self",
".",
"get_last_obj",
"(",
")... | Display a completion list based on the current line | [
"Display",
"a",
"completion",
"list",
"based",
"on",
"the",
"current",
"line"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L877-L924 | train | Display a completion list based on the current line 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/console/widgets/shell.py | PythonShellWidget.drop_pathlist | def drop_pathlist(self, pathlist):
"""Drop path list"""
if pathlist:
files = ["r'%s'" % path for path in pathlist]
if len(files) == 1:
text = files[0]
else:
text = "[" + ", ".join(files) + "]"
if self.new_input_line:... | python | def drop_pathlist(self, pathlist):
"""Drop path list"""
if pathlist:
files = ["r'%s'" % path for path in pathlist]
if len(files) == 1:
text = files[0]
else:
text = "[" + ", ".join(files) + "]"
if self.new_input_line:... | [
"def",
"drop_pathlist",
"(",
"self",
",",
"pathlist",
")",
":",
"if",
"pathlist",
":",
"files",
"=",
"[",
"\"r'%s'\"",
"%",
"path",
"for",
"path",
"in",
"pathlist",
"]",
"if",
"len",
"(",
"files",
")",
"==",
"1",
":",
"text",
"=",
"files",
"[",
"0"... | Drop path list | [
"Drop",
"path",
"list"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/shell.py#L934-L945 | train | Drop path 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/ipythonconsole/utils/kernelspec.py | SpyderKernelSpec.argv | def argv(self):
"""Command to start kernels"""
# Python interpreter used to start kernels
if CONF.get('main_interpreter', 'default'):
pyexec = get_python_executable()
else:
# Avoid IPython adding the virtualenv on which Spyder is running
# to the kerne... | python | def argv(self):
"""Command to start kernels"""
# Python interpreter used to start kernels
if CONF.get('main_interpreter', 'default'):
pyexec = get_python_executable()
else:
# Avoid IPython adding the virtualenv on which Spyder is running
# to the kerne... | [
"def",
"argv",
"(",
"self",
")",
":",
"# Python interpreter used to start kernels",
"if",
"CONF",
".",
"get",
"(",
"'main_interpreter'",
",",
"'default'",
")",
":",
"pyexec",
"=",
"get_python_executable",
"(",
")",
"else",
":",
"# Avoid IPython adding the virtualenv o... | Command to start kernels | [
"Command",
"to",
"start",
"kernels"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/utils/kernelspec.py#L41-L73 | train | Command to start kernels | 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/kernelspec.py | SpyderKernelSpec.env | def env(self):
"""Env vars for kernels"""
# Add our PYTHONPATH to the kernel
pathlist = CONF.get('main', 'spyder_pythonpath', default=[])
default_interpreter = CONF.get('main_interpreter', 'default')
pypath = add_pathlist_to_PYTHONPATH([], pathlist, ipyconsole=True,
... | python | def env(self):
"""Env vars for kernels"""
# Add our PYTHONPATH to the kernel
pathlist = CONF.get('main', 'spyder_pythonpath', default=[])
default_interpreter = CONF.get('main_interpreter', 'default')
pypath = add_pathlist_to_PYTHONPATH([], pathlist, ipyconsole=True,
... | [
"def",
"env",
"(",
"self",
")",
":",
"# Add our PYTHONPATH to the kernel",
"pathlist",
"=",
"CONF",
".",
"get",
"(",
"'main'",
",",
"'spyder_pythonpath'",
",",
"default",
"=",
"[",
"]",
")",
"default_interpreter",
"=",
"CONF",
".",
"get",
"(",
"'main_interpret... | Env vars for kernels | [
"Env",
"vars",
"for",
"kernels"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/utils/kernelspec.py#L76-L166 | train | This function will add our kernels to the kernels environment variables and then call the interpreter s main function. | 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/projects/widgets/explorer.py | ExplorerTreeWidget.setup_common_actions | def setup_common_actions(self):
"""Setup context menu common actions"""
actions = FilteredDirView.setup_common_actions(self)
# Toggle horizontal scrollbar
hscrollbar_action = create_action(self, _("Show horizontal scrollbar"),
toggled=self... | python | def setup_common_actions(self):
"""Setup context menu common actions"""
actions = FilteredDirView.setup_common_actions(self)
# Toggle horizontal scrollbar
hscrollbar_action = create_action(self, _("Show horizontal scrollbar"),
toggled=self... | [
"def",
"setup_common_actions",
"(",
"self",
")",
":",
"actions",
"=",
"FilteredDirView",
".",
"setup_common_actions",
"(",
"self",
")",
"# Toggle horizontal scrollbar\r",
"hscrollbar_action",
"=",
"create_action",
"(",
"self",
",",
"_",
"(",
"\"Show horizontal scrollbar... | Setup context menu common actions | [
"Setup",
"context",
"menu",
"common",
"actions"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/projects/widgets/explorer.py#L46-L56 | train | Setup context menu common actions | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/projects/widgets/explorer.py | ExplorerTreeWidget.toggle_hscrollbar | def toggle_hscrollbar(self, checked):
"""Toggle horizontal scrollbar"""
self.parent_widget.sig_option_changed.emit('show_hscrollbar', checked)
self.show_hscrollbar = checked
self.header().setStretchLastSection(not checked)
self.header().setHorizontalScrollMode(QAbstractItemV... | python | def toggle_hscrollbar(self, checked):
"""Toggle horizontal scrollbar"""
self.parent_widget.sig_option_changed.emit('show_hscrollbar', checked)
self.show_hscrollbar = checked
self.header().setStretchLastSection(not checked)
self.header().setHorizontalScrollMode(QAbstractItemV... | [
"def",
"toggle_hscrollbar",
"(",
"self",
",",
"checked",
")",
":",
"self",
".",
"parent_widget",
".",
"sig_option_changed",
".",
"emit",
"(",
"'show_hscrollbar'",
",",
"checked",
")",
"self",
".",
"show_hscrollbar",
"=",
"checked",
"self",
".",
"header",
"(",
... | Toggle horizontal scrollbar | [
"Toggle",
"horizontal",
"scrollbar"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/projects/widgets/explorer.py#L60-L69 | train | Toggle horizontal scrollbar | 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/projects/widgets/explorer.py | ExplorerTreeWidget.dragMoveEvent | def dragMoveEvent(self, event):
"""Reimplement Qt method"""
index = self.indexAt(event.pos())
if index:
dst = self.get_filename(index)
if osp.isdir(dst):
event.acceptProposedAction()
else:
event.ignore()
else:
... | python | def dragMoveEvent(self, event):
"""Reimplement Qt method"""
index = self.indexAt(event.pos())
if index:
dst = self.get_filename(index)
if osp.isdir(dst):
event.acceptProposedAction()
else:
event.ignore()
else:
... | [
"def",
"dragMoveEvent",
"(",
"self",
",",
"event",
")",
":",
"index",
"=",
"self",
".",
"indexAt",
"(",
"event",
".",
"pos",
"(",
")",
")",
"if",
"index",
":",
"dst",
"=",
"self",
".",
"get_filename",
"(",
"index",
")",
"if",
"osp",
".",
"isdir",
... | Reimplement Qt method | [
"Reimplement",
"Qt",
"method"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/projects/widgets/explorer.py#L72-L82 | train | Reimplement Qt 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/projects/widgets/explorer.py | ExplorerTreeWidget.dropEvent | def dropEvent(self, event):
"""Reimplement Qt method"""
event.ignore()
action = event.dropAction()
if action not in (Qt.MoveAction, Qt.CopyAction):
return
# QTreeView must not remove the source items even in MoveAction mode:
# event.setDropAction(Qt.C... | python | def dropEvent(self, event):
"""Reimplement Qt method"""
event.ignore()
action = event.dropAction()
if action not in (Qt.MoveAction, Qt.CopyAction):
return
# QTreeView must not remove the source items even in MoveAction mode:
# event.setDropAction(Qt.C... | [
"def",
"dropEvent",
"(",
"self",
",",
"event",
")",
":",
"event",
".",
"ignore",
"(",
")",
"action",
"=",
"event",
".",
"dropAction",
"(",
")",
"if",
"action",
"not",
"in",
"(",
"Qt",
".",
"MoveAction",
",",
"Qt",
".",
"CopyAction",
")",
":",
"retu... | Reimplement Qt method | [
"Reimplement",
"Qt",
"method"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/projects/widgets/explorer.py#L84-L152 | train | Reimplement Qt method to remove items from the treeview. | 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/projects/widgets/explorer.py | ExplorerTreeWidget.delete | def delete(self, fnames=None):
"""Delete files"""
if fnames is None:
fnames = self.get_selected_filenames()
multiple = len(fnames) > 1
yes_to_all = None
for fname in fnames:
if fname == self.proxymodel.path_list[0]:
self.sig_delete_... | python | def delete(self, fnames=None):
"""Delete files"""
if fnames is None:
fnames = self.get_selected_filenames()
multiple = len(fnames) > 1
yes_to_all = None
for fname in fnames:
if fname == self.proxymodel.path_list[0]:
self.sig_delete_... | [
"def",
"delete",
"(",
"self",
",",
"fnames",
"=",
"None",
")",
":",
"if",
"fnames",
"is",
"None",
":",
"fnames",
"=",
"self",
".",
"get_selected_filenames",
"(",
")",
"multiple",
"=",
"len",
"(",
"fnames",
")",
">",
"1",
"yes_to_all",
"=",
"None",
"f... | Delete files | [
"Delete",
"files"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/projects/widgets/explorer.py#L154-L167 | train | Delete files in the selected directory. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/projects/widgets/explorer.py | ProjectExplorerWidget.set_project_dir | def set_project_dir(self, directory):
"""Set the project directory"""
if directory is not None:
self.treewidget.set_root_path(osp.dirname(directory))
self.treewidget.set_folder_names([osp.basename(directory)])
self.treewidget.setup_project_view()
try:
... | python | def set_project_dir(self, directory):
"""Set the project directory"""
if directory is not None:
self.treewidget.set_root_path(osp.dirname(directory))
self.treewidget.set_folder_names([osp.basename(directory)])
self.treewidget.setup_project_view()
try:
... | [
"def",
"set_project_dir",
"(",
"self",
",",
"directory",
")",
":",
"if",
"directory",
"is",
"not",
"None",
":",
"self",
".",
"treewidget",
".",
"set_root_path",
"(",
"osp",
".",
"dirname",
"(",
"directory",
")",
")",
"self",
".",
"treewidget",
".",
"set_... | Set the project directory | [
"Set",
"the",
"project",
"directory"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/projects/widgets/explorer.py#L208-L218 | train | Set the project directory | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/projects/widgets/explorer.py | ProjectExplorerWidget.setup_project | def setup_project(self, directory):
"""Setup project"""
self.emptywidget.hide()
self.treewidget.show()
# Setup the directory shown by the tree
self.set_project_dir(directory) | python | def setup_project(self, directory):
"""Setup project"""
self.emptywidget.hide()
self.treewidget.show()
# Setup the directory shown by the tree
self.set_project_dir(directory) | [
"def",
"setup_project",
"(",
"self",
",",
"directory",
")",
":",
"self",
".",
"emptywidget",
".",
"hide",
"(",
")",
"self",
".",
"treewidget",
".",
"show",
"(",
")",
"# Setup the directory shown by the tree\r",
"self",
".",
"set_project_dir",
"(",
"directory",
... | Setup project | [
"Setup",
"project"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/projects/widgets/explorer.py#L225-L231 | train | Setup the project | 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/console/widgets/internalshell.py | InternalShell.start_interpreter | def start_interpreter(self, namespace):
"""Start Python interpreter"""
self.clear()
if self.interpreter is not None:
self.interpreter.closing()
self.interpreter = Interpreter(namespace, self.exitfunc,
SysOutput, WidgetPro... | python | def start_interpreter(self, namespace):
"""Start Python interpreter"""
self.clear()
if self.interpreter is not None:
self.interpreter.closing()
self.interpreter = Interpreter(namespace, self.exitfunc,
SysOutput, WidgetPro... | [
"def",
"start_interpreter",
"(",
"self",
",",
"namespace",
")",
":",
"self",
".",
"clear",
"(",
")",
"if",
"self",
".",
"interpreter",
"is",
"not",
"None",
":",
"self",
".",
"interpreter",
".",
"closing",
"(",
")",
"self",
".",
"interpreter",
"=",
"Int... | Start Python interpreter | [
"Start",
"Python",
"interpreter"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/internalshell.py#L180-L210 | train | Start a new Python interpreter. | 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/console/widgets/internalshell.py | InternalShell.exit_interpreter | def exit_interpreter(self):
"""Exit interpreter"""
self.interpreter.exit_flag = True
if self.multithreaded:
self.interpreter.stdin_write.write(to_binary_string('\n'))
self.interpreter.restore_stds() | python | def exit_interpreter(self):
"""Exit interpreter"""
self.interpreter.exit_flag = True
if self.multithreaded:
self.interpreter.stdin_write.write(to_binary_string('\n'))
self.interpreter.restore_stds() | [
"def",
"exit_interpreter",
"(",
"self",
")",
":",
"self",
".",
"interpreter",
".",
"exit_flag",
"=",
"True",
"if",
"self",
".",
"multithreaded",
":",
"self",
".",
"interpreter",
".",
"stdin_write",
".",
"write",
"(",
"to_binary_string",
"(",
"'\\n'",
")",
... | Exit interpreter | [
"Exit",
"interpreter"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/internalshell.py#L212-L217 | train | Exit the interpreter. | 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/console/widgets/internalshell.py | InternalShell.stdout_avail | def stdout_avail(self):
"""Data is available in stdout, let's empty the queue and write it!"""
data = self.interpreter.stdout_write.empty_queue()
if data:
self.write(data) | python | def stdout_avail(self):
"""Data is available in stdout, let's empty the queue and write it!"""
data = self.interpreter.stdout_write.empty_queue()
if data:
self.write(data) | [
"def",
"stdout_avail",
"(",
"self",
")",
":",
"data",
"=",
"self",
".",
"interpreter",
".",
"stdout_write",
".",
"empty_queue",
"(",
")",
"if",
"data",
":",
"self",
".",
"write",
"(",
"data",
")"
] | Data is available in stdout, let's empty the queue and write it! | [
"Data",
"is",
"available",
"in",
"stdout",
"let",
"s",
"empty",
"the",
"queue",
"and",
"write",
"it!"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/internalshell.py#L226-L230 | train | Check if stdout is available in stdout and write 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/console/widgets/internalshell.py | InternalShell.stderr_avail | def stderr_avail(self):
"""Data is available in stderr, let's empty the queue and write it!"""
data = self.interpreter.stderr_write.empty_queue()
if data:
self.write(data, error=True)
self.flush(error=True) | python | def stderr_avail(self):
"""Data is available in stderr, let's empty the queue and write it!"""
data = self.interpreter.stderr_write.empty_queue()
if data:
self.write(data, error=True)
self.flush(error=True) | [
"def",
"stderr_avail",
"(",
"self",
")",
":",
"data",
"=",
"self",
".",
"interpreter",
".",
"stderr_write",
".",
"empty_queue",
"(",
")",
"if",
"data",
":",
"self",
".",
"write",
"(",
"data",
",",
"error",
"=",
"True",
")",
"self",
".",
"flush",
"(",... | Data is available in stderr, let's empty the queue and write it! | [
"Data",
"is",
"available",
"in",
"stderr",
"let",
"s",
"empty",
"the",
"queue",
"and",
"write",
"it!"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/internalshell.py#L232-L237 | train | Check if data is available in stderr and write it to the 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/console/widgets/internalshell.py | InternalShell.wait_input | def wait_input(self, prompt=''):
"""Wait for input (raw_input support)"""
self.new_prompt(prompt)
self.setFocus()
self.input_mode = True
self.input_loop = QEventLoop()
self.input_loop.exec_()
self.input_loop = None | python | def wait_input(self, prompt=''):
"""Wait for input (raw_input support)"""
self.new_prompt(prompt)
self.setFocus()
self.input_mode = True
self.input_loop = QEventLoop()
self.input_loop.exec_()
self.input_loop = None | [
"def",
"wait_input",
"(",
"self",
",",
"prompt",
"=",
"''",
")",
":",
"self",
".",
"new_prompt",
"(",
"prompt",
")",
"self",
".",
"setFocus",
"(",
")",
"self",
".",
"input_mode",
"=",
"True",
"self",
".",
"input_loop",
"=",
"QEventLoop",
"(",
")",
"s... | Wait for input (raw_input support) | [
"Wait",
"for",
"input",
"(",
"raw_input",
"support",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/internalshell.py#L241-L248 | train | Wait for input | 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/console/widgets/internalshell.py | InternalShell.end_input | def end_input(self, cmd):
"""End of wait_input mode"""
self.input_mode = False
self.input_loop.exit()
self.interpreter.widget_proxy.end_input(cmd) | python | def end_input(self, cmd):
"""End of wait_input mode"""
self.input_mode = False
self.input_loop.exit()
self.interpreter.widget_proxy.end_input(cmd) | [
"def",
"end_input",
"(",
"self",
",",
"cmd",
")",
":",
"self",
".",
"input_mode",
"=",
"False",
"self",
".",
"input_loop",
".",
"exit",
"(",
")",
"self",
".",
"interpreter",
".",
"widget_proxy",
".",
"end_input",
"(",
"cmd",
")"
] | End of wait_input mode | [
"End",
"of",
"wait_input",
"mode"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/internalshell.py#L250-L254 | train | End of wait_input 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/console/widgets/internalshell.py | InternalShell.setup_context_menu | def setup_context_menu(self):
"""Reimplement PythonShellWidget method"""
PythonShellWidget.setup_context_menu(self)
self.help_action = create_action(self, _("Help..."),
icon=ima.icon('DialogHelpButton'),
triggered=self.help)
sel... | python | def setup_context_menu(self):
"""Reimplement PythonShellWidget method"""
PythonShellWidget.setup_context_menu(self)
self.help_action = create_action(self, _("Help..."),
icon=ima.icon('DialogHelpButton'),
triggered=self.help)
sel... | [
"def",
"setup_context_menu",
"(",
"self",
")",
":",
"PythonShellWidget",
".",
"setup_context_menu",
"(",
"self",
")",
"self",
".",
"help_action",
"=",
"create_action",
"(",
"self",
",",
"_",
"(",
"\"Help...\"",
")",
",",
"icon",
"=",
"ima",
".",
"icon",
"(... | Reimplement PythonShellWidget method | [
"Reimplement",
"PythonShellWidget",
"method"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/internalshell.py#L258-L264 | train | Reimplement PythonShellWidget 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/console/widgets/internalshell.py | InternalShell.help | def help(self):
"""Help on Spyder console"""
QMessageBox.about(self, _("Help"),
"""<b>%s</b>
<p><i>%s</i><br> edit foobar.py
<p><i>%s</i><br> xedit foobar.py
<p><i>%s</i><br> run foobar... | python | def help(self):
"""Help on Spyder console"""
QMessageBox.about(self, _("Help"),
"""<b>%s</b>
<p><i>%s</i><br> edit foobar.py
<p><i>%s</i><br> xedit foobar.py
<p><i>%s</i><br> run foobar... | [
"def",
"help",
"(",
"self",
")",
":",
"QMessageBox",
".",
"about",
"(",
"self",
",",
"_",
"(",
"\"Help\"",
")",
",",
"\"\"\"<b>%s</b>\r\n <p><i>%s</i><br> edit foobar.py\r\n <p><i>%s</i><br> xedit foobar.py\r\n ... | Help on Spyder console | [
"Help",
"on",
"Spyder",
"console"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/internalshell.py#L267-L285 | train | Help on Spyder console | 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/console/widgets/internalshell.py | InternalShell.open_with_external_spyder | def open_with_external_spyder(self, text):
"""Load file in external Spyder's editor, if available
This method is used only for embedded consoles
(could also be useful if we ever implement the magic %edit command)"""
match = get_error_match(to_text_string(text))
if match:
... | python | def open_with_external_spyder(self, text):
"""Load file in external Spyder's editor, if available
This method is used only for embedded consoles
(could also be useful if we ever implement the magic %edit command)"""
match = get_error_match(to_text_string(text))
if match:
... | [
"def",
"open_with_external_spyder",
"(",
"self",
",",
"text",
")",
":",
"match",
"=",
"get_error_match",
"(",
"to_text_string",
"(",
"text",
")",
")",
"if",
"match",
":",
"fname",
",",
"lnb",
"=",
"match",
".",
"groups",
"(",
")",
"builtins",
".",
"open_... | Load file in external Spyder's editor, if available
This method is used only for embedded consoles
(could also be useful if we ever implement the magic %edit command) | [
"Load",
"file",
"in",
"external",
"Spyder",
"s",
"editor",
"if",
"available",
"This",
"method",
"is",
"used",
"only",
"for",
"embedded",
"consoles",
"(",
"could",
"also",
"be",
"useful",
"if",
"we",
"ever",
"implement",
"the",
"magic",
"%edit",
"command",
... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/internalshell.py#L289-L296 | train | Open file in external Spyder s editor if available | 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/console/widgets/internalshell.py | InternalShell.external_editor | def external_editor(self, filename, goto=-1):
"""Edit in an external editor
Recommended: SciTE (e.g. to go to line where an error did occur)"""
editor_path = CONF.get('internal_console', 'external_editor/path')
goto_option = CONF.get('internal_console', 'external_editor/gotoline')
... | python | def external_editor(self, filename, goto=-1):
"""Edit in an external editor
Recommended: SciTE (e.g. to go to line where an error did occur)"""
editor_path = CONF.get('internal_console', 'external_editor/path')
goto_option = CONF.get('internal_console', 'external_editor/gotoline')
... | [
"def",
"external_editor",
"(",
"self",
",",
"filename",
",",
"goto",
"=",
"-",
"1",
")",
":",
"editor_path",
"=",
"CONF",
".",
"get",
"(",
"'internal_console'",
",",
"'external_editor/path'",
")",
"goto_option",
"=",
"CONF",
".",
"get",
"(",
"'internal_conso... | Edit in an external editor
Recommended: SciTE (e.g. to go to line where an error did occur) | [
"Edit",
"in",
"an",
"external",
"editor",
"Recommended",
":",
"SciTE",
"(",
"e",
".",
"g",
".",
"to",
"go",
"to",
"line",
"where",
"an",
"error",
"did",
"occur",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/internalshell.py#L298-L310 | train | Edit in an external 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/console/widgets/internalshell.py | InternalShell.flush | def flush(self, error=False, prompt=False):
"""Reimplement ShellBaseWidget method"""
PythonShellWidget.flush(self, error=error, prompt=prompt)
if self.interrupted:
self.interrupted = False
raise KeyboardInterrupt | python | def flush(self, error=False, prompt=False):
"""Reimplement ShellBaseWidget method"""
PythonShellWidget.flush(self, error=error, prompt=prompt)
if self.interrupted:
self.interrupted = False
raise KeyboardInterrupt | [
"def",
"flush",
"(",
"self",
",",
"error",
"=",
"False",
",",
"prompt",
"=",
"False",
")",
":",
"PythonShellWidget",
".",
"flush",
"(",
"self",
",",
"error",
"=",
"error",
",",
"prompt",
"=",
"prompt",
")",
"if",
"self",
".",
"interrupted",
":",
"sel... | Reimplement ShellBaseWidget method | [
"Reimplement",
"ShellBaseWidget",
"method"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/internalshell.py#L314-L319 | train | Reimplement flush 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/console/widgets/internalshell.py | InternalShell.clear_terminal | def clear_terminal(self):
"""Reimplement ShellBaseWidget method"""
self.clear()
self.new_prompt(self.interpreter.p2 if self.interpreter.more else self.interpreter.p1) | python | def clear_terminal(self):
"""Reimplement ShellBaseWidget method"""
self.clear()
self.new_prompt(self.interpreter.p2 if self.interpreter.more else self.interpreter.p1) | [
"def",
"clear_terminal",
"(",
"self",
")",
":",
"self",
".",
"clear",
"(",
")",
"self",
".",
"new_prompt",
"(",
"self",
".",
"interpreter",
".",
"p2",
"if",
"self",
".",
"interpreter",
".",
"more",
"else",
"self",
".",
"interpreter",
".",
"p1",
")"
] | Reimplement ShellBaseWidget method | [
"Reimplement",
"ShellBaseWidget",
"method"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/internalshell.py#L323-L326 | train | Reimplement ShellBaseWidget method clear | 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/console/widgets/internalshell.py | InternalShell.on_enter | def on_enter(self, command):
"""on_enter"""
if self.profile:
# Simple profiling test
t0 = time()
for _ in range(10):
self.execute_command(command)
self.insert_text(u"\n<Δt>=%dms\n" % (1e2*(time()-t0)))
self.new_prompt(se... | python | def on_enter(self, command):
"""on_enter"""
if self.profile:
# Simple profiling test
t0 = time()
for _ in range(10):
self.execute_command(command)
self.insert_text(u"\n<Δt>=%dms\n" % (1e2*(time()-t0)))
self.new_prompt(se... | [
"def",
"on_enter",
"(",
"self",
",",
"command",
")",
":",
"if",
"self",
".",
"profile",
":",
"# Simple profiling test\r",
"t0",
"=",
"time",
"(",
")",
"for",
"_",
"in",
"range",
"(",
"10",
")",
":",
"self",
".",
"execute_command",
"(",
"command",
")",
... | on_enter | [
"on_enter"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/internalshell.py#L330-L341 | train | Execute a command and wait for the next entry. | 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/console/widgets/internalshell.py | InternalShell.__flush_eventqueue | def __flush_eventqueue(self):
"""Flush keyboard event queue"""
while self.eventqueue:
past_event = self.eventqueue.pop(0)
self.postprocess_keyevent(past_event) | python | def __flush_eventqueue(self):
"""Flush keyboard event queue"""
while self.eventqueue:
past_event = self.eventqueue.pop(0)
self.postprocess_keyevent(past_event) | [
"def",
"__flush_eventqueue",
"(",
"self",
")",
":",
"while",
"self",
".",
"eventqueue",
":",
"past_event",
"=",
"self",
".",
"eventqueue",
".",
"pop",
"(",
"0",
")",
"self",
".",
"postprocess_keyevent",
"(",
"past_event",
")"
] | Flush keyboard event queue | [
"Flush",
"keyboard",
"event",
"queue"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/internalshell.py#L353-L357 | train | Flushes the keyboard event queue. | 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/console/widgets/internalshell.py | InternalShell.keyboard_interrupt | def keyboard_interrupt(self):
"""Simulate keyboard interrupt"""
if self.multithreaded:
self.interpreter.raise_keyboard_interrupt()
else:
if self.interpreter.more:
self.write_error("\nKeyboardInterrupt\n")
self.interpreter.more = Fals... | python | def keyboard_interrupt(self):
"""Simulate keyboard interrupt"""
if self.multithreaded:
self.interpreter.raise_keyboard_interrupt()
else:
if self.interpreter.more:
self.write_error("\nKeyboardInterrupt\n")
self.interpreter.more = Fals... | [
"def",
"keyboard_interrupt",
"(",
"self",
")",
":",
"if",
"self",
".",
"multithreaded",
":",
"self",
".",
"interpreter",
".",
"raise_keyboard_interrupt",
"(",
")",
"else",
":",
"if",
"self",
".",
"interpreter",
".",
"more",
":",
"self",
".",
"write_error",
... | Simulate keyboard interrupt | [
"Simulate",
"keyboard",
"interrupt"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/internalshell.py#L360-L371 | train | Simulate keyboard interrupt | 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/console/widgets/internalshell.py | InternalShell.execute_lines | def execute_lines(self, lines):
"""
Execute a set of lines as multiple command
lines: multiple lines of text to be executed as single commands
"""
for line in lines.splitlines():
stripped_line = line.strip()
if stripped_line.startswith('#'):
... | python | def execute_lines(self, lines):
"""
Execute a set of lines as multiple command
lines: multiple lines of text to be executed as single commands
"""
for line in lines.splitlines():
stripped_line = line.strip()
if stripped_line.startswith('#'):
... | [
"def",
"execute_lines",
"(",
"self",
",",
"lines",
")",
":",
"for",
"line",
"in",
"lines",
".",
"splitlines",
"(",
")",
":",
"stripped_line",
"=",
"line",
".",
"strip",
"(",
")",
"if",
"stripped_line",
".",
"startswith",
"(",
"'#'",
")",
":",
"continue... | Execute a set of lines as multiple command
lines: multiple lines of text to be executed as single commands | [
"Execute",
"a",
"set",
"of",
"lines",
"as",
"multiple",
"command",
"lines",
":",
"multiple",
"lines",
"of",
"text",
"to",
"be",
"executed",
"as",
"single",
"commands"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/internalshell.py#L373-L384 | train | Execute a set of lines as single command | 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/console/widgets/internalshell.py | InternalShell.execute_command | def execute_command(self, cmd):
"""
Execute a command
cmd: one-line command only, with '\n' at the end
"""
if self.input_mode:
self.end_input(cmd)
return
if cmd.endswith('\n'):
cmd = cmd[:-1]
# cls command
if ... | python | def execute_command(self, cmd):
"""
Execute a command
cmd: one-line command only, with '\n' at the end
"""
if self.input_mode:
self.end_input(cmd)
return
if cmd.endswith('\n'):
cmd = cmd[:-1]
# cls command
if ... | [
"def",
"execute_command",
"(",
"self",
",",
"cmd",
")",
":",
"if",
"self",
".",
"input_mode",
":",
"self",
".",
"end_input",
"(",
"cmd",
")",
"return",
"if",
"cmd",
".",
"endswith",
"(",
"'\\n'",
")",
":",
"cmd",
"=",
"cmd",
"[",
":",
"-",
"1",
"... | Execute a command
cmd: one-line command only, with '\n' at the end | [
"Execute",
"a",
"command",
"cmd",
":",
"one",
"-",
"line",
"command",
"only",
"with",
"\\",
"n",
"at",
"the",
"end"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/internalshell.py#L386-L400 | train | Execute a command with no arguments. | 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/console/widgets/internalshell.py | InternalShell.run_command | def run_command(self, cmd, history=True, new_prompt=True):
"""Run command in interpreter"""
if not cmd:
cmd = ''
else:
if history:
self.add_to_history(cmd)
if not self.multithreaded:
if 'input' not in cmd:
self.... | python | def run_command(self, cmd, history=True, new_prompt=True):
"""Run command in interpreter"""
if not cmd:
cmd = ''
else:
if history:
self.add_to_history(cmd)
if not self.multithreaded:
if 'input' not in cmd:
self.... | [
"def",
"run_command",
"(",
"self",
",",
"cmd",
",",
"history",
"=",
"True",
",",
"new_prompt",
"=",
"True",
")",
":",
"if",
"not",
"cmd",
":",
"cmd",
"=",
"''",
"else",
":",
"if",
"history",
":",
"self",
".",
"add_to_history",
"(",
"cmd",
")",
"if"... | Run command in interpreter | [
"Run",
"command",
"in",
"interpreter"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/internalshell.py#L402-L421 | train | Run command in interpreter | 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/console/widgets/internalshell.py | InternalShell.get_dir | def get_dir(self, objtxt):
"""Return dir(object)"""
obj, valid = self._eval(objtxt)
if valid:
return getobjdir(obj) | python | def get_dir(self, objtxt):
"""Return dir(object)"""
obj, valid = self._eval(objtxt)
if valid:
return getobjdir(obj) | [
"def",
"get_dir",
"(",
"self",
",",
"objtxt",
")",
":",
"obj",
",",
"valid",
"=",
"self",
".",
"_eval",
"(",
"objtxt",
")",
"if",
"valid",
":",
"return",
"getobjdir",
"(",
"obj",
")"
] | Return dir(object) | [
"Return",
"dir",
"(",
"object",
")"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/internalshell.py#L429-L433 | train | Return dir for object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/plugins/console/widgets/internalshell.py | InternalShell.iscallable | def iscallable(self, objtxt):
"""Is object callable?"""
obj, valid = self._eval(objtxt)
if valid:
return callable(obj) | python | def iscallable(self, objtxt):
"""Is object callable?"""
obj, valid = self._eval(objtxt)
if valid:
return callable(obj) | [
"def",
"iscallable",
"(",
"self",
",",
"objtxt",
")",
":",
"obj",
",",
"valid",
"=",
"self",
".",
"_eval",
"(",
"objtxt",
")",
"if",
"valid",
":",
"return",
"callable",
"(",
"obj",
")"
] | Is object callable? | [
"Is",
"object",
"callable?"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/internalshell.py#L443-L447 | train | Is object callable? | 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/console/widgets/internalshell.py | InternalShell.get_arglist | def get_arglist(self, objtxt):
"""Get func/method argument list"""
obj, valid = self._eval(objtxt)
if valid:
return getargtxt(obj) | python | def get_arglist(self, objtxt):
"""Get func/method argument list"""
obj, valid = self._eval(objtxt)
if valid:
return getargtxt(obj) | [
"def",
"get_arglist",
"(",
"self",
",",
"objtxt",
")",
":",
"obj",
",",
"valid",
"=",
"self",
".",
"_eval",
"(",
"objtxt",
")",
"if",
"valid",
":",
"return",
"getargtxt",
"(",
"obj",
")"
] | Get func/method argument list | [
"Get",
"func",
"/",
"method",
"argument",
"list"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/internalshell.py#L449-L453 | train | Get func / method argument 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/console/widgets/internalshell.py | InternalShell.get_doc | def get_doc(self, objtxt):
"""Get object documentation dictionary"""
obj, valid = self._eval(objtxt)
if valid:
return getdoc(obj) | python | def get_doc(self, objtxt):
"""Get object documentation dictionary"""
obj, valid = self._eval(objtxt)
if valid:
return getdoc(obj) | [
"def",
"get_doc",
"(",
"self",
",",
"objtxt",
")",
":",
"obj",
",",
"valid",
"=",
"self",
".",
"_eval",
"(",
"objtxt",
")",
"if",
"valid",
":",
"return",
"getdoc",
"(",
"obj",
")"
] | Get object documentation dictionary | [
"Get",
"object",
"documentation",
"dictionary"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/internalshell.py#L461-L465 | train | Get object documentation dictionary | 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/console/widgets/internalshell.py | InternalShell.get_source | def get_source(self, objtxt):
"""Get object source"""
obj, valid = self._eval(objtxt)
if valid:
return getsource(obj) | python | def get_source(self, objtxt):
"""Get object source"""
obj, valid = self._eval(objtxt)
if valid:
return getsource(obj) | [
"def",
"get_source",
"(",
"self",
",",
"objtxt",
")",
":",
"obj",
",",
"valid",
"=",
"self",
".",
"_eval",
"(",
"objtxt",
")",
"if",
"valid",
":",
"return",
"getsource",
"(",
"obj",
")"
] | Get object source | [
"Get",
"object",
"source"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/internalshell.py#L467-L471 | train | Get object source | 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/console/widgets/internalshell.py | InternalShell.is_defined | def is_defined(self, objtxt, force_import=False):
"""Return True if object is defined"""
return self.interpreter.is_defined(objtxt, force_import) | python | def is_defined(self, objtxt, force_import=False):
"""Return True if object is defined"""
return self.interpreter.is_defined(objtxt, force_import) | [
"def",
"is_defined",
"(",
"self",
",",
"objtxt",
",",
"force_import",
"=",
"False",
")",
":",
"return",
"self",
".",
"interpreter",
".",
"is_defined",
"(",
"objtxt",
",",
"force_import",
")"
] | Return True if object is defined | [
"Return",
"True",
"if",
"object",
"is",
"defined"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/console/widgets/internalshell.py#L473-L475 | train | Return True if object is defined in the current interpreter | 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/panels/edgeline.py | EdgeLine.paintEvent | def paintEvent(self, event):
"""Override Qt method"""
painter = QPainter(self)
size = self.size()
color = QColor(self.color)
color.setAlphaF(.5)
painter.setPen(color)
for column in self.columns:
x = self.editor.fontMetrics().width(column * '9')
... | python | def paintEvent(self, event):
"""Override Qt method"""
painter = QPainter(self)
size = self.size()
color = QColor(self.color)
color.setAlphaF(.5)
painter.setPen(color)
for column in self.columns:
x = self.editor.fontMetrics().width(column * '9')
... | [
"def",
"paintEvent",
"(",
"self",
",",
"event",
")",
":",
"painter",
"=",
"QPainter",
"(",
"self",
")",
"size",
"=",
"self",
".",
"size",
"(",
")",
"color",
"=",
"QColor",
"(",
"self",
".",
"color",
")",
"color",
".",
"setAlphaF",
"(",
".5",
")",
... | Override Qt method | [
"Override",
"Qt",
"method"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/panels/edgeline.py#L28-L39 | train | Override Qt method. Draws the event to the QPainter. | 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/panels/edgeline.py | EdgeLine.set_columns | def set_columns(self, columns):
"""Set edge line columns values."""
if isinstance(columns, tuple):
self.columns = columns
elif is_text_string(columns):
self.columns = tuple(int(e) for e in columns.split(','))
self.update() | python | def set_columns(self, columns):
"""Set edge line columns values."""
if isinstance(columns, tuple):
self.columns = columns
elif is_text_string(columns):
self.columns = tuple(int(e) for e in columns.split(','))
self.update() | [
"def",
"set_columns",
"(",
"self",
",",
"columns",
")",
":",
"if",
"isinstance",
"(",
"columns",
",",
"tuple",
")",
":",
"self",
".",
"columns",
"=",
"columns",
"elif",
"is_text_string",
"(",
"columns",
")",
":",
"self",
".",
"columns",
"=",
"tuple",
"... | Set edge line columns values. | [
"Set",
"edge",
"line",
"columns",
"values",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/panels/edgeline.py#L49-L56 | train | Set edge line columns values. | 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/start.py | send_args_to_spyder | def send_args_to_spyder(args):
"""
Simple socket client used to send the args passed to the Spyder
executable to an already running instance.
Args can be Python scripts or files with these extensions: .spydata, .mat,
.npy, or .h5, which can be imported by the Variable Explorer.
"""
... | python | def send_args_to_spyder(args):
"""
Simple socket client used to send the args passed to the Spyder
executable to an already running instance.
Args can be Python scripts or files with these extensions: .spydata, .mat,
.npy, or .h5, which can be imported by the Variable Explorer.
"""
... | [
"def",
"send_args_to_spyder",
"(",
"args",
")",
":",
"port",
"=",
"CONF",
".",
"get",
"(",
"'main'",
",",
"'open_files_port'",
")",
"# Wait ~50 secs for the server to be up\r",
"# Taken from https://stackoverflow.com/a/4766598/438386\r",
"for",
"_x",
"in",
"range",
"(",
... | Simple socket client used to send the args passed to the Spyder
executable to an already running instance.
Args can be Python scripts or files with these extensions: .spydata, .mat,
.npy, or .h5, which can be imported by the Variable Explorer. | [
"Simple",
"socket",
"client",
"used",
"to",
"send",
"the",
"args",
"passed",
"to",
"the",
"Spyder",
"executable",
"to",
"an",
"already",
"running",
"instance",
".",
"Args",
"can",
"be",
"Python",
"scripts",
"or",
"files",
"with",
"these",
"extensions",
":",
... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/app/start.py#L39-L64 | train | Send the args passed to the Spyder executable to the current instance. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spyder-ide/spyder | spyder/app/start.py | main | def main():
"""
Start Spyder application.
If single instance mode is turned on (default behavior) and an instance of
Spyder is already running, this will just parse and send command line
options to the application.
"""
# Parse command line options
if running_under_pytest():
... | python | def main():
"""
Start Spyder application.
If single instance mode is turned on (default behavior) and an instance of
Spyder is already running, this will just parse and send command line
options to the application.
"""
# Parse command line options
if running_under_pytest():
... | [
"def",
"main",
"(",
")",
":",
"# Parse command line options\r",
"if",
"running_under_pytest",
"(",
")",
":",
"try",
":",
"from",
"unittest",
".",
"mock",
"import",
"Mock",
"except",
"ImportError",
":",
"from",
"mock",
"import",
"Mock",
"# Python 2\r",
"options",... | Start Spyder application.
If single instance mode is turned on (default behavior) and an instance of
Spyder is already running, this will just parse and send command line
options to the application. | [
"Start",
"Spyder",
"application",
".",
"If",
"single",
"instance",
"mode",
"is",
"turned",
"on",
"(",
"default",
"behavior",
")",
"and",
"an",
"instance",
"of",
"Spyder",
"is",
"already",
"running",
"this",
"will",
"just",
"parse",
"and",
"send",
"command",
... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/app/start.py#L67-L208 | train | The main method of the Spyder 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.