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
PmagPy/PmagPy
dialogs/grid_frame3.py
GridFrame.onCopySelection
def onCopySelection(self, event): """ Copies self.df_slice to the Clipboard if slice exists """ if self.df_slice is not None: pd.DataFrame.to_clipboard(self.df_slice, header=False, index=False) self.grid.ClearSelection() self.df_slice = None ...
python
def onCopySelection(self, event): """ Copies self.df_slice to the Clipboard if slice exists """ if self.df_slice is not None: pd.DataFrame.to_clipboard(self.df_slice, header=False, index=False) self.grid.ClearSelection() self.df_slice = None ...
[ "def", "onCopySelection", "(", "self", ",", "event", ")", ":", "if", "self", ".", "df_slice", "is", "not", "None", ":", "pd", ".", "DataFrame", ".", "to_clipboard", "(", "self", ".", "df_slice", ",", "header", "=", "False", ",", "index", "=", "False", ...
Copies self.df_slice to the Clipboard if slice exists
[ "Copies", "self", ".", "df_slice", "to", "the", "Clipboard", "if", "slice", "exists" ]
c7984f8809bf40fe112e53dcc311a33293b62d0b
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/grid_frame3.py#L884-L894
train
Copy selection to the Clipboard
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
PmagPy/PmagPy
dialogs/grid_frame3.py
GridBuilder.make_grid
def make_grid(self): """ return grid """ changes = None # if there is a MagicDataFrame, extract data from it if isinstance(self.magic_dataframe, cb.MagicDataFrame): # get columns and reorder slightly col_labels = list(self.magic_dataframe.df.column...
python
def make_grid(self): """ return grid """ changes = None # if there is a MagicDataFrame, extract data from it if isinstance(self.magic_dataframe, cb.MagicDataFrame): # get columns and reorder slightly col_labels = list(self.magic_dataframe.df.column...
[ "def", "make_grid", "(", "self", ")", ":", "changes", "=", "None", "# if there is a MagicDataFrame, extract data from it", "if", "isinstance", "(", "self", ".", "magic_dataframe", ",", "cb", ".", "MagicDataFrame", ")", ":", "# get columns and reorder slightly", "col_lab...
return grid
[ "return", "grid" ]
c7984f8809bf40fe112e53dcc311a33293b62d0b
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/grid_frame3.py#L948-L1028
train
make a grid of the magic data
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
PmagPy/PmagPy
dialogs/grid_frame3.py
GridBuilder.add_age_defaults
def add_age_defaults(self): """ Add columns as needed: age, age_unit, specimen, sample, site, location. """ if isinstance(self.magic_dataframe, cb.MagicDataFrame): for col in ['age', 'age_unit']: if col not in self.grid.col_labels: ...
python
def add_age_defaults(self): """ Add columns as needed: age, age_unit, specimen, sample, site, location. """ if isinstance(self.magic_dataframe, cb.MagicDataFrame): for col in ['age', 'age_unit']: if col not in self.grid.col_labels: ...
[ "def", "add_age_defaults", "(", "self", ")", ":", "if", "isinstance", "(", "self", ".", "magic_dataframe", ",", "cb", ".", "MagicDataFrame", ")", ":", "for", "col", "in", "[", "'age'", ",", "'age_unit'", "]", ":", "if", "col", "not", "in", "self", ".",...
Add columns as needed: age, age_unit, specimen, sample, site, location.
[ "Add", "columns", "as", "needed", ":", "age", "age_unit", "specimen", "sample", "site", "location", "." ]
c7984f8809bf40fe112e53dcc311a33293b62d0b
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/grid_frame3.py#L1054-L1066
train
Add columns as needed for age and age_unit.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
PmagPy/PmagPy
dialogs/grid_frame3.py
GridBuilder.current_grid_empty
def current_grid_empty(self): """ Check to see if grid is empty except for default values """ empty = True # df IS empty if there are no rows if not any(self.magic_dataframe.df.index): empty = True # df is NOT empty if there are at least two rows ...
python
def current_grid_empty(self): """ Check to see if grid is empty except for default values """ empty = True # df IS empty if there are no rows if not any(self.magic_dataframe.df.index): empty = True # df is NOT empty if there are at least two rows ...
[ "def", "current_grid_empty", "(", "self", ")", ":", "empty", "=", "True", "# df IS empty if there are no rows", "if", "not", "any", "(", "self", ".", "magic_dataframe", ".", "df", ".", "index", ")", ":", "empty", "=", "True", "# df is NOT empty if there are at lea...
Check to see if grid is empty except for default values
[ "Check", "to", "see", "if", "grid", "is", "empty", "except", "for", "default", "values" ]
c7984f8809bf40fe112e53dcc311a33293b62d0b
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/grid_frame3.py#L1068-L1091
train
Check to see if the current grid is empty except for default values
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
PmagPy/PmagPy
dialogs/grid_frame3.py
GridBuilder.save_grid_data
def save_grid_data(self): """ Save grid data in the data object """ if not self.grid.changes: print('-I- No changes to save') return starred_cols = self.grid.remove_starred_labels() # locks in value in cell currently edited self.grid.SaveE...
python
def save_grid_data(self): """ Save grid data in the data object """ if not self.grid.changes: print('-I- No changes to save') return starred_cols = self.grid.remove_starred_labels() # locks in value in cell currently edited self.grid.SaveE...
[ "def", "save_grid_data", "(", "self", ")", ":", "if", "not", "self", ".", "grid", ".", "changes", ":", "print", "(", "'-I- No changes to save'", ")", "return", "starred_cols", "=", "self", ".", "grid", ".", "remove_starred_labels", "(", ")", "# locks in value ...
Save grid data in the data object
[ "Save", "grid", "data", "in", "the", "data", "object" ]
c7984f8809bf40fe112e53dcc311a33293b62d0b
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/grid_frame3.py#L1094-L1138
train
Save the grid data in the object self. grid.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
PmagPy/PmagPy
dialogs/grid_frame3.py
GridBuilder.fill_defaults
def fill_defaults(self): """ Fill in self.grid with default values in certain columns. Only fill in new values if grid is missing those values. """ defaults = {'result_quality': 'g', 'result_type': 'i', 'orientation_quality': 'g', ...
python
def fill_defaults(self): """ Fill in self.grid with default values in certain columns. Only fill in new values if grid is missing those values. """ defaults = {'result_quality': 'g', 'result_type': 'i', 'orientation_quality': 'g', ...
[ "def", "fill_defaults", "(", "self", ")", ":", "defaults", "=", "{", "'result_quality'", ":", "'g'", ",", "'result_type'", ":", "'i'", ",", "'orientation_quality'", ":", "'g'", ",", "'citations'", ":", "'This study'", "}", "for", "col_name", "in", "defaults", ...
Fill in self.grid with default values in certain columns. Only fill in new values if grid is missing those values.
[ "Fill", "in", "self", ".", "grid", "with", "default", "values", "in", "certain", "columns", ".", "Only", "fill", "in", "new", "values", "if", "grid", "is", "missing", "those", "values", "." ]
c7984f8809bf40fe112e53dcc311a33293b62d0b
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/grid_frame3.py#L1140-L1177
train
Fill in self. grid with default values in certain columns.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
PmagPy/PmagPy
dialogs/grid_frame3.py
GridBuilder.get_result_children
def get_result_children(self, result_data): """ takes in dict in form of {'er_specimen_names': 'name1:name2:name3'} and so forth. returns lists of specimens, samples, sites, and locations """ specimens, samples, sites, locations = "", "", "", "" children = {'speci...
python
def get_result_children(self, result_data): """ takes in dict in form of {'er_specimen_names': 'name1:name2:name3'} and so forth. returns lists of specimens, samples, sites, and locations """ specimens, samples, sites, locations = "", "", "", "" children = {'speci...
[ "def", "get_result_children", "(", "self", ",", "result_data", ")", ":", "specimens", ",", "samples", ",", "sites", ",", "locations", "=", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", "children", "=", "{", "'specimen'", ":", "specimens", ",", "'sample'",...
takes in dict in form of {'er_specimen_names': 'name1:name2:name3'} and so forth. returns lists of specimens, samples, sites, and locations
[ "takes", "in", "dict", "in", "form", "of", "{", "er_specimen_names", ":", "name1", ":", "name2", ":", "name3", "}", "and", "so", "forth", ".", "returns", "lists", "of", "specimens", "samples", "sites", "and", "locations" ]
c7984f8809bf40fe112e53dcc311a33293b62d0b
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/grid_frame3.py#L1179-L1195
train
returns a list of the children of the result_data
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
PmagPy/PmagPy
programs/deprecated/specimens_results_magic.py
main
def main(): """ NAME specimens_results_magic.py DESCRIPTION combines pmag_specimens.txt file with age, location, acceptance criteria and outputs pmag_results table along with other MagIC tables necessary for uploading to the database SYNTAX specimens_results_magic.py [command line opti...
python
def main(): """ NAME specimens_results_magic.py DESCRIPTION combines pmag_specimens.txt file with age, location, acceptance criteria and outputs pmag_results table along with other MagIC tables necessary for uploading to the database SYNTAX specimens_results_magic.py [command line opti...
[ "def", "main", "(", ")", ":", "# set defaults", "Comps", "=", "[", "]", "# list of components", "version_num", "=", "pmag", ".", "get_version", "(", ")", "args", "=", "sys", ".", "argv", "DefaultAge", "=", "[", "\"none\"", "]", "skipdirs", ",", "coord", ...
NAME specimens_results_magic.py DESCRIPTION combines pmag_specimens.txt file with age, location, acceptance criteria and outputs pmag_results table along with other MagIC tables necessary for uploading to the database SYNTAX specimens_results_magic.py [command line options] OPTIONS -h...
[ "NAME", "specimens_results_magic", ".", "py" ]
c7984f8809bf40fe112e53dcc311a33293b62d0b
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/deprecated/specimens_results_magic.py#L8-L660
train
main function for pmag_specimens_results_magic. py
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
PmagPy/PmagPy
programs/eqarea_magic.py
main
def main(): """ NAME eqarea_magic.py DESCRIPTION makes equal area projections from declination/inclination data SYNTAX eqarea_magic.py [command line options] INPUT takes magic formatted sites, samples, specimens, or measurements OPTIONS -h prints help me...
python
def main(): """ NAME eqarea_magic.py DESCRIPTION makes equal area projections from declination/inclination data SYNTAX eqarea_magic.py [command line options] INPUT takes magic formatted sites, samples, specimens, or measurements OPTIONS -h prints help me...
[ "def", "main", "(", ")", ":", "# extract arguments from sys.argv", "if", "'-h'", "in", "sys", ".", "argv", ":", "print", "(", "main", ".", "__doc__", ")", "sys", ".", "exit", "(", ")", "dir_path", "=", "pmag", ".", "get_named_arg", "(", "\"-WD\"", ",", ...
NAME eqarea_magic.py DESCRIPTION makes equal area projections from declination/inclination data SYNTAX eqarea_magic.py [command line options] INPUT takes magic formatted sites, samples, specimens, or measurements OPTIONS -h prints help message and quits ...
[ "NAME", "eqarea_magic", ".", "py" ]
c7984f8809bf40fe112e53dcc311a33293b62d0b
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/eqarea_magic.py#L18-L98
train
NAME eqarea_magic. py
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
PmagPy/PmagPy
dialogs/grid_frame2.py
GridFrame.InitUI
def InitUI(self): """ initialize window """ self.main_sizer = wx.BoxSizer(wx.VERTICAL) self.init_grid_headers() self.grid_builder = GridBuilder(self.er_magic, self.grid_type, self.grid_headers, self.panel, self.parent_type) ...
python
def InitUI(self): """ initialize window """ self.main_sizer = wx.BoxSizer(wx.VERTICAL) self.init_grid_headers() self.grid_builder = GridBuilder(self.er_magic, self.grid_type, self.grid_headers, self.panel, self.parent_type) ...
[ "def", "InitUI", "(", "self", ")", ":", "self", ".", "main_sizer", "=", "wx", ".", "BoxSizer", "(", "wx", ".", "VERTICAL", ")", "self", ".", "init_grid_headers", "(", ")", "self", ".", "grid_builder", "=", "GridBuilder", "(", "self", ".", "er_magic", "...
initialize window
[ "initialize", "window" ]
c7984f8809bf40fe112e53dcc311a33293b62d0b
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/grid_frame2.py#L66-L257
train
Initialize the main UI for the current resource class
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
PmagPy/PmagPy
dialogs/grid_frame2.py
GridFrame.do_fit
def do_fit(self, event): """ Re-fit the window to the size of the content. """ #self.grid.ShowScrollbars(wx.SHOW_SB_NEVER, wx.SHOW_SB_NEVER) if event: event.Skip() self.main_sizer.Fit(self) disp_size = wx.GetDisplaySize() actual_size = self.Get...
python
def do_fit(self, event): """ Re-fit the window to the size of the content. """ #self.grid.ShowScrollbars(wx.SHOW_SB_NEVER, wx.SHOW_SB_NEVER) if event: event.Skip() self.main_sizer.Fit(self) disp_size = wx.GetDisplaySize() actual_size = self.Get...
[ "def", "do_fit", "(", "self", ",", "event", ")", ":", "#self.grid.ShowScrollbars(wx.SHOW_SB_NEVER, wx.SHOW_SB_NEVER)", "if", "event", ":", "event", ".", "Skip", "(", ")", "self", ".", "main_sizer", ".", "Fit", "(", "self", ")", "disp_size", "=", "wx", ".", "...
Re-fit the window to the size of the content.
[ "Re", "-", "fit", "the", "window", "to", "the", "size", "of", "the", "content", "." ]
c7984f8809bf40fe112e53dcc311a33293b62d0b
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/grid_frame2.py#L269-L284
train
Re - fit the window to the size of the content.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
PmagPy/PmagPy
dialogs/grid_frame2.py
GridFrame.toggle_ages
def toggle_ages(self, event): """ Switch the type of grid between site/sample (Users may add ages at either level) """ if self.grid.changes: self.onSave(None) label = event.GetEventObject().Label self.er_magic.age_type = label self.grid.Destr...
python
def toggle_ages(self, event): """ Switch the type of grid between site/sample (Users may add ages at either level) """ if self.grid.changes: self.onSave(None) label = event.GetEventObject().Label self.er_magic.age_type = label self.grid.Destr...
[ "def", "toggle_ages", "(", "self", ",", "event", ")", ":", "if", "self", ".", "grid", ".", "changes", ":", "self", ".", "onSave", "(", "None", ")", "label", "=", "event", ".", "GetEventObject", "(", ")", ".", "Label", "self", ".", "er_magic", ".", ...
Switch the type of grid between site/sample (Users may add ages at either level)
[ "Switch", "the", "type", "of", "grid", "between", "site", "/", "sample", "(", "Users", "may", "add", "ages", "at", "either", "level", ")" ]
c7984f8809bf40fe112e53dcc311a33293b62d0b
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/grid_frame2.py#L318-L357
train
Switch the type of grid between site and sample ages
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
PmagPy/PmagPy
dialogs/grid_frame2.py
GridFrame.remove_col_label
def remove_col_label(self, event):#, include_pmag=True): """ check to see if column is required if it is not, delete it from grid """ er_possible_headers = self.grid_headers[self.grid_type]['er'][2] pmag_possible_headers = self.grid_headers[self.grid_type]['pmag'][2] ...
python
def remove_col_label(self, event):#, include_pmag=True): """ check to see if column is required if it is not, delete it from grid """ er_possible_headers = self.grid_headers[self.grid_type]['er'][2] pmag_possible_headers = self.grid_headers[self.grid_type]['pmag'][2] ...
[ "def", "remove_col_label", "(", "self", ",", "event", ")", ":", "#, include_pmag=True):", "er_possible_headers", "=", "self", ".", "grid_headers", "[", "self", ".", "grid_type", "]", "[", "'er'", "]", "[", "2", "]", "pmag_possible_headers", "=", "self", ".", ...
check to see if column is required if it is not, delete it from grid
[ "check", "to", "see", "if", "column", "is", "required", "if", "it", "is", "not", "delete", "it", "from", "grid" ]
c7984f8809bf40fe112e53dcc311a33293b62d0b
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/grid_frame2.py#L364-L399
train
remove a column from the grid
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
PmagPy/PmagPy
dialogs/grid_frame2.py
GridFrame.on_add_cols
def on_add_cols(self, event): """ Show simple dialog that allows user to add a new column name """ col_labels = self.grid.col_labels # do not list headers that are already column labels in the grid er_items = [head for head in self.grid_headers[self.grid_type]['er'][2] if...
python
def on_add_cols(self, event): """ Show simple dialog that allows user to add a new column name """ col_labels = self.grid.col_labels # do not list headers that are already column labels in the grid er_items = [head for head in self.grid_headers[self.grid_type]['er'][2] if...
[ "def", "on_add_cols", "(", "self", ",", "event", ")", ":", "col_labels", "=", "self", ".", "grid", ".", "col_labels", "# do not list headers that are already column labels in the grid", "er_items", "=", "[", "head", "for", "head", "in", "self", ".", "grid_headers", ...
Show simple dialog that allows user to add a new column name
[ "Show", "simple", "dialog", "that", "allows", "user", "to", "add", "a", "new", "column", "name" ]
c7984f8809bf40fe112e53dcc311a33293b62d0b
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/grid_frame2.py#L401-L442
train
Show simple dialog that allows user to add a new column name
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
PmagPy/PmagPy
dialogs/grid_frame2.py
GridFrame.add_new_grid_headers
def add_new_grid_headers(self, new_headers, er_items, pmag_items): """ Add in all user-added headers. If those new headers depend on other headers, add the other headers too. """ def add_pmag_reqd_headers(): if self.grid_type == 'result': return [] ...
python
def add_new_grid_headers(self, new_headers, er_items, pmag_items): """ Add in all user-added headers. If those new headers depend on other headers, add the other headers too. """ def add_pmag_reqd_headers(): if self.grid_type == 'result': return [] ...
[ "def", "add_new_grid_headers", "(", "self", ",", "new_headers", ",", "er_items", ",", "pmag_items", ")", ":", "def", "add_pmag_reqd_headers", "(", ")", ":", "if", "self", ".", "grid_type", "==", "'result'", ":", "return", "[", "]", "add_in", "=", "[", "]",...
Add in all user-added headers. If those new headers depend on other headers, add the other headers too.
[ "Add", "in", "all", "user", "-", "added", "headers", ".", "If", "those", "new", "headers", "depend", "on", "other", "headers", "add", "the", "other", "headers", "too", "." ]
c7984f8809bf40fe112e53dcc311a33293b62d0b
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/grid_frame2.py#L444-L493
train
Add in all user - added headers.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
PmagPy/PmagPy
dialogs/grid_frame2.py
GridFrame.on_remove_cols
def on_remove_cols(self, event): """ enter 'remove columns' mode """ # open the help message self.toggle_help(event=None, mode='open') # first unselect any selected cols/cells self.remove_cols_mode = True self.grid.ClearSelection() self.remove_cols...
python
def on_remove_cols(self, event): """ enter 'remove columns' mode """ # open the help message self.toggle_help(event=None, mode='open') # first unselect any selected cols/cells self.remove_cols_mode = True self.grid.ClearSelection() self.remove_cols...
[ "def", "on_remove_cols", "(", "self", ",", "event", ")", ":", "# open the help message", "self", ".", "toggle_help", "(", "event", "=", "None", ",", "mode", "=", "'open'", ")", "# first unselect any selected cols/cells", "self", ".", "remove_cols_mode", "=", "True...
enter 'remove columns' mode
[ "enter", "remove", "columns", "mode" ]
c7984f8809bf40fe112e53dcc311a33293b62d0b
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/grid_frame2.py#L495-L519
train
enter remove columns mode
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
PmagPy/PmagPy
dialogs/grid_frame2.py
GridFrame.on_remove_row
def on_remove_row(self, event, row_num=-1): """ Remove specified grid row. If no row number is given, remove the last row. """ if row_num == -1: default = (255, 255, 255, 255) # unhighlight any selected rows: for row in self.selected_rows: ...
python
def on_remove_row(self, event, row_num=-1): """ Remove specified grid row. If no row number is given, remove the last row. """ if row_num == -1: default = (255, 255, 255, 255) # unhighlight any selected rows: for row in self.selected_rows: ...
[ "def", "on_remove_row", "(", "self", ",", "event", ",", "row_num", "=", "-", "1", ")", ":", "if", "row_num", "==", "-", "1", ":", "default", "=", "(", "255", ",", "255", ",", "255", ",", "255", ")", "# unhighlight any selected rows:", "for", "row", "...
Remove specified grid row. If no row number is given, remove the last row.
[ "Remove", "specified", "grid", "row", ".", "If", "no", "row", "number", "is", "given", "remove", "the", "last", "row", "." ]
c7984f8809bf40fe112e53dcc311a33293b62d0b
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/grid_frame2.py#L535-L573
train
Remove specified grid row.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
PmagPy/PmagPy
dialogs/grid_frame2.py
GridFrame.exit_col_remove_mode
def exit_col_remove_mode(self, event): """ go back from 'remove cols' mode to normal """ # close help messge self.toggle_help(event=None, mode='close') # update mode self.remove_cols_mode = False # re-enable all buttons for btn in [self.add_cols_bu...
python
def exit_col_remove_mode(self, event): """ go back from 'remove cols' mode to normal """ # close help messge self.toggle_help(event=None, mode='close') # update mode self.remove_cols_mode = False # re-enable all buttons for btn in [self.add_cols_bu...
[ "def", "exit_col_remove_mode", "(", "self", ",", "event", ")", ":", "# close help messge", "self", ".", "toggle_help", "(", "event", "=", "None", ",", "mode", "=", "'close'", ")", "# update mode", "self", ".", "remove_cols_mode", "=", "False", "# re-enable all b...
go back from 'remove cols' mode to normal
[ "go", "back", "from", "remove", "cols", "mode", "to", "normal" ]
c7984f8809bf40fe112e53dcc311a33293b62d0b
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/grid_frame2.py#L575-L597
train
exit col remove mode
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
PmagPy/PmagPy
dialogs/grid_frame2.py
GridBuilder.make_grid
def make_grid(self, incl_pmag=True): """ return grid """ if incl_pmag and self.grid_type in self.er_magic.incl_pmag_data: incl_pmag = True else: incl_pmag = False er_header = self.grid_headers[self.grid_type]['er'][0] if incl_pmag: ...
python
def make_grid(self, incl_pmag=True): """ return grid """ if incl_pmag and self.grid_type in self.er_magic.incl_pmag_data: incl_pmag = True else: incl_pmag = False er_header = self.grid_headers[self.grid_type]['er'][0] if incl_pmag: ...
[ "def", "make_grid", "(", "self", ",", "incl_pmag", "=", "True", ")", ":", "if", "incl_pmag", "and", "self", ".", "grid_type", "in", "self", ".", "er_magic", ".", "incl_pmag_data", ":", "incl_pmag", "=", "True", "else", ":", "incl_pmag", "=", "False", "er...
return grid
[ "return", "grid" ]
c7984f8809bf40fe112e53dcc311a33293b62d0b
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/grid_frame2.py#L765-L837
train
make a new grid of pmag_magic_data
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
PmagPy/PmagPy
dialogs/grid_frame2.py
GridBuilder.save_grid_data
def save_grid_data(self): """ Save grid data in the data object """ if not self.grid.changes: print('-I- No changes to save') return if self.grid_type == 'age': age_data_type = self.er_magic.age_type self.er_magic.write_ages = True...
python
def save_grid_data(self): """ Save grid data in the data object """ if not self.grid.changes: print('-I- No changes to save') return if self.grid_type == 'age': age_data_type = self.er_magic.age_type self.er_magic.write_ages = True...
[ "def", "save_grid_data", "(", "self", ")", ":", "if", "not", "self", ".", "grid", ".", "changes", ":", "print", "(", "'-I- No changes to save'", ")", "return", "if", "self", ".", "grid_type", "==", "'age'", ":", "age_data_type", "=", "self", ".", "er_magic...
Save grid data in the data object
[ "Save", "grid", "data", "in", "the", "data", "object" ]
c7984f8809bf40fe112e53dcc311a33293b62d0b
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/grid_frame2.py#L890-L1000
train
Save the grid data in the data object
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
PmagPy/PmagPy
programs/hysteresis_magic2.py
main
def main(): """ NAME hysteresis_magic.py DESCRIPTION calculates hystereis parameters and saves them in rmag_hystereis format file makes plots if option selected SYNTAX hysteresis_magic.py [command line options] OPTIONS -h prints help message and quits ...
python
def main(): """ NAME hysteresis_magic.py DESCRIPTION calculates hystereis parameters and saves them in rmag_hystereis format file makes plots if option selected SYNTAX hysteresis_magic.py [command line options] OPTIONS -h prints help message and quits ...
[ "def", "main", "(", ")", ":", "args", "=", "sys", ".", "argv", "PLT", "=", "1", "plots", "=", "0", "user", ",", "meas_file", ",", "rmag_out", ",", "rmag_file", "=", "\"\"", ",", "\"agm_measurements.txt\"", ",", "\"rmag_hysteresis.txt\"", ",", "\"\"", "pl...
NAME hysteresis_magic.py DESCRIPTION calculates hystereis parameters and saves them in rmag_hystereis format file makes plots if option selected SYNTAX hysteresis_magic.py [command line options] OPTIONS -h prints help message and quits -usr USER: identify...
[ "NAME", "hysteresis_magic", ".", "py" ]
c7984f8809bf40fe112e53dcc311a33293b62d0b
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/hysteresis_magic2.py#L11-L332
train
NAME get_hysteresis_magic. py
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
PmagPy/PmagPy
programs/mst_magic.py
main
def main(): """ NAME mst_magic.py DESCRIPTION converts MsT data (T,M) to measurements format files SYNTAX mst_magic.py [command line options] OPTIONS -h: prints the help message and quits. -usr USER: identify user, default is "" -f FILE: specify T...
python
def main(): """ NAME mst_magic.py DESCRIPTION converts MsT data (T,M) to measurements format files SYNTAX mst_magic.py [command line options] OPTIONS -h: prints the help message and quits. -usr USER: identify user, default is "" -f FILE: specify T...
[ "def", "main", "(", ")", ":", "#", "# get command line arguments", "#", "args", "=", "sys", ".", "argv", "if", "\"-h\"", "in", "args", ":", "print", "(", "main", ".", "__doc__", ")", "sys", ".", "exit", "(", ")", "dir_path", "=", "pmag", ".", "get_na...
NAME mst_magic.py DESCRIPTION converts MsT data (T,M) to measurements format files SYNTAX mst_magic.py [command line options] OPTIONS -h: prints the help message and quits. -usr USER: identify user, default is "" -f FILE: specify T,M format input file, r...
[ "NAME", "mst_magic", ".", "py" ]
c7984f8809bf40fe112e53dcc311a33293b62d0b
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/mst_magic.py#L7-L78
train
This function is the main entry point for the magic command line tool. It is used to convert MsT data to measurements format files and print help message and quits.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
PmagPy/PmagPy
programs/deprecated/parse_measurements.py
main
def main(): """ NAME parse_measurements.py DESCRIPTION takes measurments file and creates specimen and instrument files SYNTAX parse_measurements.py [command line options] OPTIONS -h prints help message and quits -f FILE magic_measurements input file, defau...
python
def main(): """ NAME parse_measurements.py DESCRIPTION takes measurments file and creates specimen and instrument files SYNTAX parse_measurements.py [command line options] OPTIONS -h prints help message and quits -f FILE magic_measurements input file, defau...
[ "def", "main", "(", ")", ":", "infile", "=", "'magic_measurements.txt'", "sitefile", "=", "\"\"", "specout", "=", "\"er_specimens.txt\"", "instout", "=", "\"magic_instruments.txt\"", "# get command line stuff", "if", "\"-h\"", "in", "sys", ".", "argv", ":", "print",...
NAME parse_measurements.py DESCRIPTION takes measurments file and creates specimen and instrument files SYNTAX parse_measurements.py [command line options] OPTIONS -h prints help message and quits -f FILE magic_measurements input file, default is "magic_measurement...
[ "NAME", "parse_measurements", ".", "py" ]
c7984f8809bf40fe112e53dcc311a33293b62d0b
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/deprecated/parse_measurements.py#L9-L59
train
parse_measurements. py is the entry point for the pmag. ParseMeasFile function. It takes measurments file and creates specimen and instrument files and creates specimen and instrument files for the current specimen and instrument.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
PmagPy/PmagPy
programs/conversion_scripts2/utrecht_magic2.py
main
def main(command_line=True, **kwargs): """ NAME utrecht_magic.py DESCRIPTION converts Utrecht magnetometer data files to magic_measurements files SYNTAX utrecht_magic.py [command line options] OPTIONS -h: prints the help message and quits. -f FILE: specify ...
python
def main(command_line=True, **kwargs): """ NAME utrecht_magic.py DESCRIPTION converts Utrecht magnetometer data files to magic_measurements files SYNTAX utrecht_magic.py [command line options] OPTIONS -h: prints the help message and quits. -f FILE: specify ...
[ "def", "main", "(", "command_line", "=", "True", ",", "*", "*", "kwargs", ")", ":", "# initialize some stuff", "sample_lat", "=", "0.0", "sample_lon", "=", "0.0", "noave", "=", "0", "er_location_name", "=", "\"unknown\"", "args", "=", "sys", ".", "argv", "...
NAME utrecht_magic.py DESCRIPTION converts Utrecht magnetometer data files to magic_measurements files SYNTAX utrecht_magic.py [command line options] OPTIONS -h: prints the help message and quits. -f FILE: specify input file, or -F FILE: specify output fil...
[ "NAME", "utrecht_magic", ".", "py" ]
c7984f8809bf40fe112e53dcc311a33293b62d0b
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/conversion_scripts2/utrecht_magic2.py#L12-L397
train
This function is the main entry point for the utrecht_magic. py script.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
PmagPy/PmagPy
dialogs/pmag_gui_dialogs2.py
convert_HUJI_files_to_MagIC.on_okButton
def on_okButton(self, event): """ grab user input values, format them, and run huji_magic.py with the appropriate flags """ os.chdir(self.WD) options = {} HUJI_file = self.bSizer0.return_value() if not HUJI_file: pw.simple_warning("You must select a HU...
python
def on_okButton(self, event): """ grab user input values, format them, and run huji_magic.py with the appropriate flags """ os.chdir(self.WD) options = {} HUJI_file = self.bSizer0.return_value() if not HUJI_file: pw.simple_warning("You must select a HU...
[ "def", "on_okButton", "(", "self", ",", "event", ")", ":", "os", ".", "chdir", "(", "self", ".", "WD", ")", "options", "=", "{", "}", "HUJI_file", "=", "self", ".", "bSizer0", ".", "return_value", "(", ")", "if", "not", "HUJI_file", ":", "pw", ".",...
grab user input values, format them, and run huji_magic.py with the appropriate flags
[ "grab", "user", "input", "values", "format", "them", "and", "run", "huji_magic", ".", "py", "with", "the", "appropriate", "flags" ]
c7984f8809bf40fe112e53dcc311a33293b62d0b
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/pmag_gui_dialogs2.py#L1158-L1231
train
This method is called when the user selects a new entry in the HUJI file and runs huji_magic. py with the appropriate flags.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
PmagPy/PmagPy
dialogs/pmag_gui_dialogs2.py
convert_Utrecht_files_to_MagIC.on_okButton
def on_okButton(self, event): """ Complies information input in GUI into a kwargs dictionary which can be passed into the utrecht_magic script and run to output magic files """ os.chdir(self.WD) options_dict = {} wd = self.WD options_dict['dir_path'] = wd ...
python
def on_okButton(self, event): """ Complies information input in GUI into a kwargs dictionary which can be passed into the utrecht_magic script and run to output magic files """ os.chdir(self.WD) options_dict = {} wd = self.WD options_dict['dir_path'] = wd ...
[ "def", "on_okButton", "(", "self", ",", "event", ")", ":", "os", ".", "chdir", "(", "self", ".", "WD", ")", "options_dict", "=", "{", "}", "wd", "=", "self", ".", "WD", "options_dict", "[", "'dir_path'", "]", "=", "wd", "full_file", "=", "self", "....
Complies information input in GUI into a kwargs dictionary which can be passed into the utrecht_magic script and run to output magic files
[ "Complies", "information", "input", "in", "GUI", "into", "a", "kwargs", "dictionary", "which", "can", "be", "passed", "into", "the", "utrecht_magic", "script", "and", "run", "to", "output", "magic", "files" ]
c7984f8809bf40fe112e53dcc311a33293b62d0b
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/pmag_gui_dialogs2.py#L2275-L2345
train
Function that is called when the user selects a new entry in the utrecht_magic script and runs the appropriate command line options.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
PmagPy/PmagPy
dialogs/pmag_gui_dialogs2.py
OrientFrameGrid3.on_m_calc_orient
def on_m_calc_orient(self,event): ''' This fucntion does exactly what the 'import orientation' fuction does in MagIC.py after some dialog boxes the function calls orientation_magic.py ''' # first see if demag_orient.txt self.on_m_save_file(None) orient_convention_...
python
def on_m_calc_orient(self,event): ''' This fucntion does exactly what the 'import orientation' fuction does in MagIC.py after some dialog boxes the function calls orientation_magic.py ''' # first see if demag_orient.txt self.on_m_save_file(None) orient_convention_...
[ "def", "on_m_calc_orient", "(", "self", ",", "event", ")", ":", "# first see if demag_orient.txt", "self", ".", "on_m_save_file", "(", "None", ")", "orient_convention_dia", "=", "orient_convention", "(", "None", ")", "orient_convention_dia", ".", "Center", "(", ")",...
This fucntion does exactly what the 'import orientation' fuction does in MagIC.py after some dialog boxes the function calls orientation_magic.py
[ "This", "fucntion", "does", "exactly", "what", "the", "import", "orientation", "fuction", "does", "in", "MagIC", ".", "py", "after", "some", "dialog", "boxes", "the", "function", "calls", "orientation_magic", ".", "py" ]
c7984f8809bf40fe112e53dcc311a33293b62d0b
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/pmag_gui_dialogs2.py#L2697-L2782
train
This function is called when the user hits the orientation_magic. txt file.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
PmagPy/PmagPy
programs/eigs_s.py
main
def main(): """ NAME eigs_s.py DESCRIPTION converts eigenparamters format data to s format SYNTAX eigs_s.py [-h][-i][command line options][<filename] OPTIONS -h prints help message and quits -i allows interactive file name entry -f FILE, specifies input file name ...
python
def main(): """ NAME eigs_s.py DESCRIPTION converts eigenparamters format data to s format SYNTAX eigs_s.py [-h][-i][command line options][<filename] OPTIONS -h prints help message and quits -i allows interactive file name entry -f FILE, specifies input file name ...
[ "def", "main", "(", ")", ":", "file", "=", "\"\"", "if", "'-h'", "in", "sys", ".", "argv", ":", "print", "(", "main", ".", "__doc__", ")", "sys", ".", "exit", "(", ")", "elif", "'-i'", "in", "sys", ".", "argv", ":", "file", "=", "input", "(", ...
NAME eigs_s.py DESCRIPTION converts eigenparamters format data to s format SYNTAX eigs_s.py [-h][-i][command line options][<filename] OPTIONS -h prints help message and quits -i allows interactive file name entry -f FILE, specifies input file name -F FILE, specifies...
[ "NAME", "eigs_s", ".", "py" ]
c7984f8809bf40fe112e53dcc311a33293b62d0b
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/eigs_s.py#L8-L66
train
A function that takes input file and converts it to s format and prints out a string of the output file.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
PmagPy/PmagPy
programs/ani_depthplot.py
main
def main(): """ NAME ani_depthplot.py DESCRIPTION plots tau, V3_inc, V1_dec, P and chi versus core_depth SYNTAX ani_depthplot.py [command line optins] # or, for Anaconda users: ani_depthplot_anaconda [command line options] OPTIONS -h prints help me...
python
def main(): """ NAME ani_depthplot.py DESCRIPTION plots tau, V3_inc, V1_dec, P and chi versus core_depth SYNTAX ani_depthplot.py [command line optins] # or, for Anaconda users: ani_depthplot_anaconda [command line options] OPTIONS -h prints help me...
[ "def", "main", "(", ")", ":", "args", "=", "sys", ".", "argv", "if", "'-h'", "in", "args", ":", "print", "(", "main", ".", "__doc__", ")", "sys", ".", "exit", "(", ")", "dataframe", "=", "extractor", ".", "command_line_dataframe", "(", "[", "[", "'...
NAME ani_depthplot.py DESCRIPTION plots tau, V3_inc, V1_dec, P and chi versus core_depth SYNTAX ani_depthplot.py [command line optins] # or, for Anaconda users: ani_depthplot_anaconda [command line options] OPTIONS -h prints help message and quits ...
[ "NAME", "ani_depthplot", ".", "py" ]
c7984f8809bf40fe112e53dcc311a33293b62d0b
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/ani_depthplot.py#L16-L119
train
This function is the main entry point for the animal depth plot. It is the main function for the animal depth plot.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/nsview.py
address
def address(obj): """Return object address as a string: '<classname @ address>'""" return "<%s @ %s>" % (obj.__class__.__name__, hex(id(obj)).upper().replace('X', 'x'))
python
def address(obj): """Return object address as a string: '<classname @ address>'""" return "<%s @ %s>" % (obj.__class__.__name__, hex(id(obj)).upper().replace('X', 'x'))
[ "def", "address", "(", "obj", ")", ":", "return", "\"<%s @ %s>\"", "%", "(", "obj", ".", "__class__", ".", "__name__", ",", "hex", "(", "id", "(", "obj", ")", ")", ".", "upper", "(", ")", ".", "replace", "(", "'X'", ",", "'x'", ")", ")" ]
Return object address as a string: '<classname @ address>
[ "Return", "object", "address", "as", "a", "string", ":", "<classname" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/nsview.py#L102-L105
train
Return object address as a string
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/nsview.py
get_size
def get_size(item): """Return size of an item of arbitrary type""" if isinstance(item, (list, set, tuple, dict)): return len(item) elif isinstance(item, (ndarray, MaskedArray)): return item.shape elif isinstance(item, Image): return item.size if isinstance(item, (DataFrame, I...
python
def get_size(item): """Return size of an item of arbitrary type""" if isinstance(item, (list, set, tuple, dict)): return len(item) elif isinstance(item, (ndarray, MaskedArray)): return item.shape elif isinstance(item, Image): return item.size if isinstance(item, (DataFrame, I...
[ "def", "get_size", "(", "item", ")", ":", "if", "isinstance", "(", "item", ",", "(", "list", ",", "set", ",", "tuple", ",", "dict", ")", ")", ":", "return", "len", "(", "item", ")", "elif", "isinstance", "(", "item", ",", "(", "ndarray", ",", "Ma...
Return size of an item of arbitrary type
[ "Return", "size", "of", "an", "item", "of", "arbitrary", "type" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/nsview.py#L116-L127
train
Return the size of an arbitrary type of item
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/nsview.py
get_object_attrs
def get_object_attrs(obj): """ Get the attributes of an object using dir. This filters protected attributes """ attrs = [k for k in dir(obj) if not k.startswith('__')] if not attrs: attrs = dir(obj) return attrs
python
def get_object_attrs(obj): """ Get the attributes of an object using dir. This filters protected attributes """ attrs = [k for k in dir(obj) if not k.startswith('__')] if not attrs: attrs = dir(obj) return attrs
[ "def", "get_object_attrs", "(", "obj", ")", ":", "attrs", "=", "[", "k", "for", "k", "in", "dir", "(", "obj", ")", "if", "not", "k", ".", "startswith", "(", "'__'", ")", "]", "if", "not", "attrs", ":", "attrs", "=", "dir", "(", "obj", ")", "ret...
Get the attributes of an object using dir. This filters protected attributes
[ "Get", "the", "attributes", "of", "an", "object", "using", "dir", "." ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/nsview.py#L130-L139
train
Get the attributes of an object using dir.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/nsview.py
str_to_timedelta
def str_to_timedelta(value): """Convert a string to a datetime.timedelta value. The following strings are accepted: - 'datetime.timedelta(1, 5, 12345)' - 'timedelta(1, 5, 12345)' - '(1, 5, 12345)' - '1, 5, 12345' - '1' if there are less then three parameters, the m...
python
def str_to_timedelta(value): """Convert a string to a datetime.timedelta value. The following strings are accepted: - 'datetime.timedelta(1, 5, 12345)' - 'timedelta(1, 5, 12345)' - '(1, 5, 12345)' - '1, 5, 12345' - '1' if there are less then three parameters, the m...
[ "def", "str_to_timedelta", "(", "value", ")", ":", "m", "=", "re", ".", "match", "(", "r'^(?:(?:datetime\\.)?timedelta)?'", "r'\\(?'", "r'([^)]*)'", "r'\\)?$'", ",", "value", ")", "if", "not", "m", ":", "raise", "ValueError", "(", "'Invalid string for datetime.tim...
Convert a string to a datetime.timedelta value. The following strings are accepted: - 'datetime.timedelta(1, 5, 12345)' - 'timedelta(1, 5, 12345)' - '(1, 5, 12345)' - '1, 5, 12345' - '1' if there are less then three parameters, the missing parameters are assumed to...
[ "Convert", "a", "string", "to", "a", "datetime", ".", "timedelta", "value", "." ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/nsview.py#L163-L188
train
Convert a string to a datetime. timedelta value.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/nsview.py
get_color_name
def get_color_name(value): """Return color name depending on value type""" if not is_known_type(value): return CUSTOM_TYPE_COLOR for typ, name in list(COLORS.items()): if isinstance(value, typ): return name else: np_dtype = get_numpy_dtype(value) if np_dtype i...
python
def get_color_name(value): """Return color name depending on value type""" if not is_known_type(value): return CUSTOM_TYPE_COLOR for typ, name in list(COLORS.items()): if isinstance(value, typ): return name else: np_dtype = get_numpy_dtype(value) if np_dtype i...
[ "def", "get_color_name", "(", "value", ")", ":", "if", "not", "is_known_type", "(", "value", ")", ":", "return", "CUSTOM_TYPE_COLOR", "for", "typ", ",", "name", "in", "list", "(", "COLORS", ".", "items", "(", ")", ")", ":", "if", "isinstance", "(", "va...
Return color name depending on value type
[ "Return", "color", "name", "depending", "on", "value", "type" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/nsview.py#L217-L231
train
Return color name depending on value type
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/nsview.py
sort_against
def sort_against(list1, list2, reverse=False): """ Arrange items of list1 in the same order as sorted(list2). In other words, apply to list1 the permutation which takes list2 to sorted(list2, reverse). """ try: return [item for _, item in sorted(zip(list2, list1), key=...
python
def sort_against(list1, list2, reverse=False): """ Arrange items of list1 in the same order as sorted(list2). In other words, apply to list1 the permutation which takes list2 to sorted(list2, reverse). """ try: return [item for _, item in sorted(zip(list2, list1), key=...
[ "def", "sort_against", "(", "list1", ",", "list2", ",", "reverse", "=", "False", ")", ":", "try", ":", "return", "[", "item", "for", "_", ",", "item", "in", "sorted", "(", "zip", "(", "list2", ",", "list1", ")", ",", "key", "=", "lambda", "x", ":...
Arrange items of list1 in the same order as sorted(list2). In other words, apply to list1 the permutation which takes list2 to sorted(list2, reverse).
[ "Arrange", "items", "of", "list1", "in", "the", "same", "order", "as", "sorted", "(", "list2", ")", "." ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/nsview.py#L243-L254
train
Sorts list1 by list2 by permutation which takes list2 to sorted list1.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/nsview.py
default_display
def default_display(value, with_module=True): """Default display for unknown objects.""" object_type = type(value) try: name = object_type.__name__ module = object_type.__module__ if with_module: return name + ' object of ' + module + ' module' else: r...
python
def default_display(value, with_module=True): """Default display for unknown objects.""" object_type = type(value) try: name = object_type.__name__ module = object_type.__module__ if with_module: return name + ' object of ' + module + ' module' else: r...
[ "def", "default_display", "(", "value", ",", "with_module", "=", "True", ")", ":", "object_type", "=", "type", "(", "value", ")", "try", ":", "name", "=", "object_type", ".", "__name__", "module", "=", "object_type", ".", "__module__", "if", "with_module", ...
Default display for unknown objects.
[ "Default", "display", "for", "unknown", "objects", "." ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/nsview.py#L265-L277
train
Default display for unknown objects.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/nsview.py
collections_display
def collections_display(value, level): """Display for collections (i.e. list, set, tuple and dict).""" is_dict = isinstance(value, dict) is_set = isinstance(value, set) # Get elements if is_dict: elements = iteritems(value) else: elements = value # Truncate values trunc...
python
def collections_display(value, level): """Display for collections (i.e. list, set, tuple and dict).""" is_dict = isinstance(value, dict) is_set = isinstance(value, set) # Get elements if is_dict: elements = iteritems(value) else: elements = value # Truncate values trunc...
[ "def", "collections_display", "(", "value", ",", "level", ")", ":", "is_dict", "=", "isinstance", "(", "value", ",", "dict", ")", "is_set", "=", "isinstance", "(", "value", ",", "set", ")", "# Get elements", "if", "is_dict", ":", "elements", "=", "iteritem...
Display for collections (i.e. list, set, tuple and dict).
[ "Display", "for", "collections", "(", "i", ".", "e", ".", "list", "set", "tuple", "and", "dict", ")", "." ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/nsview.py#L280-L325
train
Display for collections i. e. list set tuple and dict.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/nsview.py
value_to_display
def value_to_display(value, minmax=False, level=0): """Convert value for display purpose""" # To save current Numpy printoptions np_printoptions = FakeObject try: numeric_numpy_types = (int64, int32, int16, int8, uint64, uint32, uint16, uint8, ...
python
def value_to_display(value, minmax=False, level=0): """Convert value for display purpose""" # To save current Numpy printoptions np_printoptions = FakeObject try: numeric_numpy_types = (int64, int32, int16, int8, uint64, uint32, uint16, uint8, ...
[ "def", "value_to_display", "(", "value", ",", "minmax", "=", "False", ",", "level", "=", "0", ")", ":", "# To save current Numpy printoptions", "np_printoptions", "=", "FakeObject", "try", ":", "numeric_numpy_types", "=", "(", "int64", ",", "int32", ",", "int16"...
Convert value for display purpose
[ "Convert", "value", "for", "display", "purpose" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/nsview.py#L328-L458
train
Convert a value to a string for display purpose
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/nsview.py
display_to_value
def display_to_value(value, default_value, ignore_errors=True): """Convert back to value""" from qtpy.compat import from_qvariant value = from_qvariant(value, to_text_string) try: np_dtype = get_numpy_dtype(default_value) if isinstance(default_value, bool): # We must test for...
python
def display_to_value(value, default_value, ignore_errors=True): """Convert back to value""" from qtpy.compat import from_qvariant value = from_qvariant(value, to_text_string) try: np_dtype = get_numpy_dtype(default_value) if isinstance(default_value, bool): # We must test for...
[ "def", "display_to_value", "(", "value", ",", "default_value", ",", "ignore_errors", "=", "True", ")", ":", "from", "qtpy", ".", "compat", "import", "from_qvariant", "value", "=", "from_qvariant", "(", "value", ",", "to_text_string", ")", "try", ":", "np_dtype...
Convert back to value
[ "Convert", "back", "to", "value" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/nsview.py#L461-L507
train
Convert value to value
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/nsview.py
get_type_string
def get_type_string(item): """Return type string of an object.""" if isinstance(item, DataFrame): return "DataFrame" if isinstance(item, Index): return type(item).__name__ if isinstance(item, Series): return "Series" found = re.findall(r"<(?:type|class) '(\S*)'>", ...
python
def get_type_string(item): """Return type string of an object.""" if isinstance(item, DataFrame): return "DataFrame" if isinstance(item, Index): return type(item).__name__ if isinstance(item, Series): return "Series" found = re.findall(r"<(?:type|class) '(\S*)'>", ...
[ "def", "get_type_string", "(", "item", ")", ":", "if", "isinstance", "(", "item", ",", "DataFrame", ")", ":", "return", "\"DataFrame\"", "if", "isinstance", "(", "item", ",", "Index", ")", ":", "return", "type", "(", "item", ")", ".", "__name__", "if", ...
Return type string of an object.
[ "Return", "type", "string", "of", "an", "object", "." ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/nsview.py#L513-L524
train
Return type string of an object.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/nsview.py
get_human_readable_type
def get_human_readable_type(item): """Return human-readable type string of an item""" if isinstance(item, (ndarray, MaskedArray)): return item.dtype.name elif isinstance(item, Image): return "Image" else: text = get_type_string(item) if text is None: text = to...
python
def get_human_readable_type(item): """Return human-readable type string of an item""" if isinstance(item, (ndarray, MaskedArray)): return item.dtype.name elif isinstance(item, Image): return "Image" else: text = get_type_string(item) if text is None: text = to...
[ "def", "get_human_readable_type", "(", "item", ")", ":", "if", "isinstance", "(", "item", ",", "(", "ndarray", ",", "MaskedArray", ")", ")", ":", "return", "item", ".", "dtype", ".", "name", "elif", "isinstance", "(", "item", ",", "Image", ")", ":", "r...
Return human-readable type string of an item
[ "Return", "human", "-", "readable", "type", "string", "of", "an", "item" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/nsview.py#L533-L544
train
Return human - readable type string of an item
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/nsview.py
is_supported
def is_supported(value, check_all=False, filters=None, iterate=False): """Return True if the value is supported, False otherwise""" assert filters is not None if value is None: return True if not is_editable_type(value): return False elif not isinstance(value, filters): retur...
python
def is_supported(value, check_all=False, filters=None, iterate=False): """Return True if the value is supported, False otherwise""" assert filters is not None if value is None: return True if not is_editable_type(value): return False elif not isinstance(value, filters): retur...
[ "def", "is_supported", "(", "value", ",", "check_all", "=", "False", ",", "filters", "=", "None", ",", "iterate", "=", "False", ")", ":", "assert", "filters", "is", "not", "None", "if", "value", "is", "None", ":", "return", "True", "if", "not", "is_edi...
Return True if the value is supported, False otherwise
[ "Return", "True", "if", "the", "value", "is", "supported", "False", "otherwise" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/nsview.py#L551-L577
train
Return True if the value is supported False otherwise
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/nsview.py
globalsfilter
def globalsfilter(input_dict, check_all=False, filters=None, exclude_private=None, exclude_capitalized=None, exclude_uppercase=None, exclude_unsupported=None, excluded_names=None): """Keep only objects that can be pickled""" output_dict = {} for key, val...
python
def globalsfilter(input_dict, check_all=False, filters=None, exclude_private=None, exclude_capitalized=None, exclude_uppercase=None, exclude_unsupported=None, excluded_names=None): """Keep only objects that can be pickled""" output_dict = {} for key, val...
[ "def", "globalsfilter", "(", "input_dict", ",", "check_all", "=", "False", ",", "filters", "=", "None", ",", "exclude_private", "=", "None", ",", "exclude_capitalized", "=", "None", ",", "exclude_uppercase", "=", "None", ",", "exclude_unsupported", "=", "None", ...
Keep only objects that can be pickled
[ "Keep", "only", "objects", "that", "can", "be", "pickled" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/nsview.py#L580-L597
train
Keep only objects that can be pickled
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/nsview.py
get_supported_types
def get_supported_types(): """ Return a dictionnary containing types lists supported by the namespace browser. Note: If you update this list, don't forget to update variablexplorer.rst in spyder-docs """ from datetime import date, timedelta editable_types = [int, float, complex, lis...
python
def get_supported_types(): """ Return a dictionnary containing types lists supported by the namespace browser. Note: If you update this list, don't forget to update variablexplorer.rst in spyder-docs """ from datetime import date, timedelta editable_types = [int, float, complex, lis...
[ "def", "get_supported_types", "(", ")", ":", "from", "datetime", "import", "date", ",", "timedelta", "editable_types", "=", "[", "int", ",", "float", ",", "complex", ",", "list", ",", "set", ",", "dict", ",", "tuple", ",", "date", ",", "timedelta", "]", ...
Return a dictionnary containing types lists supported by the namespace browser. Note: If you update this list, don't forget to update variablexplorer.rst in spyder-docs
[ "Return", "a", "dictionnary", "containing", "types", "lists", "supported", "by", "the", "namespace", "browser", "." ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/nsview.py#L608-L636
train
Returns a dictionnary containing types lists supported by the namespace browser.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/nsview.py
get_remote_data
def get_remote_data(data, settings, mode, more_excluded_names=None): """ Return globals according to filter described in *settings*: * data: data to be filtered (dictionary) * settings: variable explorer settings (dictionary) * mode (string): 'editable' or 'picklable' * more_excl...
python
def get_remote_data(data, settings, mode, more_excluded_names=None): """ Return globals according to filter described in *settings*: * data: data to be filtered (dictionary) * settings: variable explorer settings (dictionary) * mode (string): 'editable' or 'picklable' * more_excl...
[ "def", "get_remote_data", "(", "data", ",", "settings", ",", "mode", ",", "more_excluded_names", "=", "None", ")", ":", "supported_types", "=", "get_supported_types", "(", ")", "assert", "mode", "in", "list", "(", "supported_types", ".", "keys", "(", ")", ")...
Return globals according to filter described in *settings*: * data: data to be filtered (dictionary) * settings: variable explorer settings (dictionary) * mode (string): 'editable' or 'picklable' * more_excluded_names: additional excluded names (list)
[ "Return", "globals", "according", "to", "filter", "described", "in", "*", "settings", "*", ":", "*", "data", ":", "data", "to", "be", "filtered", "(", "dictionary", ")", "*", "settings", ":", "variable", "explorer", "settings", "(", "dictionary", ")", "*",...
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/nsview.py#L639-L658
train
Get the data from the remote data file.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/nsview.py
make_remote_view
def make_remote_view(data, settings, more_excluded_names=None): """ Make a remote view of dictionary *data* -> globals explorer """ data = get_remote_data(data, settings, mode='editable', more_excluded_names=more_excluded_names) remote = {} for key, value in list(d...
python
def make_remote_view(data, settings, more_excluded_names=None): """ Make a remote view of dictionary *data* -> globals explorer """ data = get_remote_data(data, settings, mode='editable', more_excluded_names=more_excluded_names) remote = {} for key, value in list(d...
[ "def", "make_remote_view", "(", "data", ",", "settings", ",", "more_excluded_names", "=", "None", ")", ":", "data", "=", "get_remote_data", "(", "data", ",", "settings", ",", "mode", "=", "'editable'", ",", "more_excluded_names", "=", "more_excluded_names", ")",...
Make a remote view of dictionary *data* -> globals explorer
[ "Make", "a", "remote", "view", "of", "dictionary", "*", "data", "*", "-", ">", "globals", "explorer" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/nsview.py#L661-L675
train
Make a remote view of dictionary data
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/console/kernel.py
SpyderKernel._pdb_frame
def _pdb_frame(self): """Return current Pdb frame if there is any""" if self._pdb_obj is not None and self._pdb_obj.curframe is not None: return self._pdb_obj.curframe
python
def _pdb_frame(self): """Return current Pdb frame if there is any""" if self._pdb_obj is not None and self._pdb_obj.curframe is not None: return self._pdb_obj.curframe
[ "def", "_pdb_frame", "(", "self", ")", ":", "if", "self", ".", "_pdb_obj", "is", "not", "None", "and", "self", ".", "_pdb_obj", ".", "curframe", "is", "not", "None", ":", "return", "self", ".", "_pdb_obj", ".", "curframe" ]
Return current Pdb frame if there is any
[ "Return", "current", "Pdb", "frame", "if", "there", "is", "any" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/console/kernel.py#L47-L50
train
Return the current Pdb frame if there is any
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/console/kernel.py
SpyderKernel.get_namespace_view
def get_namespace_view(self): """ Return the namespace view This is a dictionary with the following structure {'a': {'color': '#800000', 'size': 1, 'type': 'str', 'view': '1'}} Here: * 'a' is the variable name * 'color' is the color used to show it * 's...
python
def get_namespace_view(self): """ Return the namespace view This is a dictionary with the following structure {'a': {'color': '#800000', 'size': 1, 'type': 'str', 'view': '1'}} Here: * 'a' is the variable name * 'color' is the color used to show it * 's...
[ "def", "get_namespace_view", "(", "self", ")", ":", "from", "spyder_kernels", ".", "utils", ".", "nsview", "import", "make_remote_view", "settings", "=", "self", ".", "namespace_view_settings", "if", "settings", ":", "ns", "=", "self", ".", "_get_current_namespace...
Return the namespace view This is a dictionary with the following structure {'a': {'color': '#800000', 'size': 1, 'type': 'str', 'view': '1'}} Here: * 'a' is the variable name * 'color' is the color used to show it * 'size' and 'type' are self-evident * and'vie...
[ "Return", "the", "namespace", "view" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/console/kernel.py#L65-L87
train
Return the namespace view
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/console/kernel.py
SpyderKernel.get_var_properties
def get_var_properties(self): """ Get some properties of the variables in the current namespace """ from spyder_kernels.utils.nsview import get_remote_data settings = self.namespace_view_settings if settings: ns = self._get_current_namespace() ...
python
def get_var_properties(self): """ Get some properties of the variables in the current namespace """ from spyder_kernels.utils.nsview import get_remote_data settings = self.namespace_view_settings if settings: ns = self._get_current_namespace() ...
[ "def", "get_var_properties", "(", "self", ")", ":", "from", "spyder_kernels", ".", "utils", ".", "nsview", "import", "get_remote_data", "settings", "=", "self", ".", "namespace_view_settings", "if", "settings", ":", "ns", "=", "self", ".", "_get_current_namespace"...
Get some properties of the variables in the current namespace
[ "Get", "some", "properties", "of", "the", "variables", "in", "the", "current", "namespace" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/console/kernel.py#L89-L119
train
Get some properties of the variables in the current namespace
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/console/kernel.py
SpyderKernel.send_spyder_msg
def send_spyder_msg(self, spyder_msg_type, content=None, data=None): """ Publish custom messages to the Spyder frontend. Parameters ---------- spyder_msg_type: str The spyder message type content: dict The (JSONable) content of the message ...
python
def send_spyder_msg(self, spyder_msg_type, content=None, data=None): """ Publish custom messages to the Spyder frontend. Parameters ---------- spyder_msg_type: str The spyder message type content: dict The (JSONable) content of the message ...
[ "def", "send_spyder_msg", "(", "self", ",", "spyder_msg_type", ",", "content", "=", "None", ",", "data", "=", "None", ")", ":", "import", "cloudpickle", "if", "content", "is", "None", ":", "content", "=", "{", "}", "content", "[", "'spyder_msg_type'", "]",...
Publish custom messages to the Spyder frontend. Parameters ---------- spyder_msg_type: str The spyder message type content: dict The (JSONable) content of the message data: any Any object that is serializable by cloudpickle (should be most ...
[ "Publish", "custom", "messages", "to", "the", "Spyder", "frontend", "." ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/console/kernel.py#L121-L148
train
Send a custom message to the Spyder frontend.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/console/kernel.py
SpyderKernel.get_value
def get_value(self, name): """Get the value of a variable""" ns = self._get_current_namespace() value = ns[name] try: self.send_spyder_msg('data', data=value) except: # * There is no need to inform users about # these errors. # * ...
python
def get_value(self, name): """Get the value of a variable""" ns = self._get_current_namespace() value = ns[name] try: self.send_spyder_msg('data', data=value) except: # * There is no need to inform users about # these errors. # * ...
[ "def", "get_value", "(", "self", ",", "name", ")", ":", "ns", "=", "self", ".", "_get_current_namespace", "(", ")", "value", "=", "ns", "[", "name", "]", "try", ":", "self", ".", "send_spyder_msg", "(", "'data'", ",", "data", "=", "value", ")", "exce...
Get the value of a variable
[ "Get", "the", "value", "of", "a", "variable" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/console/kernel.py#L150-L162
train
Get the value of a variable
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/console/kernel.py
SpyderKernel.set_value
def set_value(self, name, value, PY2_frontend): """Set the value of a variable""" import cloudpickle ns = self._get_reference_namespace(name) # We send serialized values in a list of one element # from Spyder to the kernel, to be able to send them # at all in Python 2 ...
python
def set_value(self, name, value, PY2_frontend): """Set the value of a variable""" import cloudpickle ns = self._get_reference_namespace(name) # We send serialized values in a list of one element # from Spyder to the kernel, to be able to send them # at all in Python 2 ...
[ "def", "set_value", "(", "self", ",", "name", ",", "value", ",", "PY2_frontend", ")", ":", "import", "cloudpickle", "ns", "=", "self", ".", "_get_reference_namespace", "(", "name", ")", "# We send serialized values in a list of one element", "# from Spyder to the kernel...
Set the value of a variable
[ "Set", "the", "value", "of", "a", "variable" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/console/kernel.py#L164-L182
train
Set the value of a variable in the namespace
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/console/kernel.py
SpyderKernel.remove_value
def remove_value(self, name): """Remove a variable""" ns = self._get_reference_namespace(name) ns.pop(name)
python
def remove_value(self, name): """Remove a variable""" ns = self._get_reference_namespace(name) ns.pop(name)
[ "def", "remove_value", "(", "self", ",", "name", ")", ":", "ns", "=", "self", ".", "_get_reference_namespace", "(", "name", ")", "ns", ".", "pop", "(", "name", ")" ]
Remove a variable
[ "Remove", "a", "variable" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/console/kernel.py#L184-L187
train
Remove a variable from the reference namespace
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/console/kernel.py
SpyderKernel.copy_value
def copy_value(self, orig_name, new_name): """Copy a variable""" ns = self._get_reference_namespace(orig_name) ns[new_name] = ns[orig_name]
python
def copy_value(self, orig_name, new_name): """Copy a variable""" ns = self._get_reference_namespace(orig_name) ns[new_name] = ns[orig_name]
[ "def", "copy_value", "(", "self", ",", "orig_name", ",", "new_name", ")", ":", "ns", "=", "self", ".", "_get_reference_namespace", "(", "orig_name", ")", "ns", "[", "new_name", "]", "=", "ns", "[", "orig_name", "]" ]
Copy a variable
[ "Copy", "a", "variable" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/console/kernel.py#L189-L192
train
Copy a variable from the reference namespace to the new name.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/console/kernel.py
SpyderKernel.load_data
def load_data(self, filename, ext): """Load data from filename""" from spyder_kernels.utils.iofuncs import iofunctions from spyder_kernels.utils.misc import fix_reference_name glbs = self._mglobals() load_func = iofunctions.load_funcs[ext] data, error_message = load_fun...
python
def load_data(self, filename, ext): """Load data from filename""" from spyder_kernels.utils.iofuncs import iofunctions from spyder_kernels.utils.misc import fix_reference_name glbs = self._mglobals() load_func = iofunctions.load_funcs[ext] data, error_message = load_fun...
[ "def", "load_data", "(", "self", ",", "filename", ",", "ext", ")", ":", "from", "spyder_kernels", ".", "utils", ".", "iofuncs", "import", "iofunctions", "from", "spyder_kernels", ".", "utils", ".", "misc", "import", "fix_reference_name", "glbs", "=", "self", ...
Load data from filename
[ "Load", "data", "from", "filename" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/console/kernel.py#L194-L217
train
Load data from filename and update the local cache
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/console/kernel.py
SpyderKernel.save_namespace
def save_namespace(self, filename): """Save namespace into filename""" from spyder_kernels.utils.nsview import get_remote_data from spyder_kernels.utils.iofuncs import iofunctions ns = self._get_current_namespace() settings = self.namespace_view_settings data = get_remot...
python
def save_namespace(self, filename): """Save namespace into filename""" from spyder_kernels.utils.nsview import get_remote_data from spyder_kernels.utils.iofuncs import iofunctions ns = self._get_current_namespace() settings = self.namespace_view_settings data = get_remot...
[ "def", "save_namespace", "(", "self", ",", "filename", ")", ":", "from", "spyder_kernels", ".", "utils", ".", "nsview", "import", "get_remote_data", "from", "spyder_kernels", ".", "utils", ".", "iofuncs", "import", "iofunctions", "ns", "=", "self", ".", "_get_...
Save namespace into filename
[ "Save", "namespace", "into", "filename" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/console/kernel.py#L219-L228
train
Save the current namespace into filename
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/console/kernel.py
SpyderKernel.publish_pdb_state
def publish_pdb_state(self): """ Publish Variable Explorer state and Pdb step through send_spyder_msg. """ if self._pdb_obj and self._do_publish_pdb_state: state = dict(namespace_view = self.get_namespace_view(), var_properties = self.get_var_...
python
def publish_pdb_state(self): """ Publish Variable Explorer state and Pdb step through send_spyder_msg. """ if self._pdb_obj and self._do_publish_pdb_state: state = dict(namespace_view = self.get_namespace_view(), var_properties = self.get_var_...
[ "def", "publish_pdb_state", "(", "self", ")", ":", "if", "self", ".", "_pdb_obj", "and", "self", ".", "_do_publish_pdb_state", ":", "state", "=", "dict", "(", "namespace_view", "=", "self", ".", "get_namespace_view", "(", ")", ",", "var_properties", "=", "se...
Publish Variable Explorer state and Pdb step through send_spyder_msg.
[ "Publish", "Variable", "Explorer", "state", "and", "Pdb", "step", "through", "send_spyder_msg", "." ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/console/kernel.py#L231-L241
train
Publish Variable Explorer state and Pdb step through send_spyder_msg.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/console/kernel.py
SpyderKernel.is_defined
def is_defined(self, obj, force_import=False): """Return True if object is defined in current namespace""" from spyder_kernels.utils.dochelpers import isdefined ns = self._get_current_namespace(with_magics=True) return isdefined(obj, force_import=force_import, namespace=ns)
python
def is_defined(self, obj, force_import=False): """Return True if object is defined in current namespace""" from spyder_kernels.utils.dochelpers import isdefined ns = self._get_current_namespace(with_magics=True) return isdefined(obj, force_import=force_import, namespace=ns)
[ "def", "is_defined", "(", "self", ",", "obj", ",", "force_import", "=", "False", ")", ":", "from", "spyder_kernels", ".", "utils", ".", "dochelpers", "import", "isdefined", "ns", "=", "self", ".", "_get_current_namespace", "(", "with_magics", "=", "True", ")...
Return True if object is defined in current namespace
[ "Return", "True", "if", "object", "is", "defined", "in", "current", "namespace" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/console/kernel.py#L254-L259
train
Return True if object is defined in current namespace
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/console/kernel.py
SpyderKernel.get_doc
def get_doc(self, objtxt): """Get object documentation dictionary""" try: import matplotlib matplotlib.rcParams['docstring.hardcopy'] = True except: pass from spyder_kernels.utils.dochelpers import getdoc obj, valid = self._eval(objtxt) ...
python
def get_doc(self, objtxt): """Get object documentation dictionary""" try: import matplotlib matplotlib.rcParams['docstring.hardcopy'] = True except: pass from spyder_kernels.utils.dochelpers import getdoc obj, valid = self._eval(objtxt) ...
[ "def", "get_doc", "(", "self", ",", "objtxt", ")", ":", "try", ":", "import", "matplotlib", "matplotlib", ".", "rcParams", "[", "'docstring.hardcopy'", "]", "=", "True", "except", ":", "pass", "from", "spyder_kernels", ".", "utils", ".", "dochelpers", "impor...
Get object documentation dictionary
[ "Get", "object", "documentation", "dictionary" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/console/kernel.py#L261-L272
train
Get object documentation dictionary
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/console/kernel.py
SpyderKernel.get_source
def get_source(self, objtxt): """Get object source""" from spyder_kernels.utils.dochelpers import getsource obj, valid = self._eval(objtxt) if valid: return getsource(obj)
python
def get_source(self, objtxt): """Get object source""" from spyder_kernels.utils.dochelpers import getsource obj, valid = self._eval(objtxt) if valid: return getsource(obj)
[ "def", "get_source", "(", "self", ",", "objtxt", ")", ":", "from", "spyder_kernels", ".", "utils", ".", "dochelpers", "import", "getsource", "obj", ",", "valid", "=", "self", ".", "_eval", "(", "objtxt", ")", "if", "valid", ":", "return", "getsource", "(...
Get object source
[ "Get", "object", "source" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/console/kernel.py#L274-L280
train
Get object source from object text
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/console/kernel.py
SpyderKernel._get_current_namespace
def _get_current_namespace(self, with_magics=False): """ Return current namespace This is globals() if not debugging, or a dictionary containing both locals() and globals() for current frame when debugging """ ns = {} glbs = self._mglobals() if self._pdb...
python
def _get_current_namespace(self, with_magics=False): """ Return current namespace This is globals() if not debugging, or a dictionary containing both locals() and globals() for current frame when debugging """ ns = {} glbs = self._mglobals() if self._pdb...
[ "def", "_get_current_namespace", "(", "self", ",", "with_magics", "=", "False", ")", ":", "ns", "=", "{", "}", "glbs", "=", "self", ".", "_mglobals", "(", ")", "if", "self", ".", "_pdb_frame", "is", "None", ":", "ns", ".", "update", "(", "glbs", ")",...
Return current namespace This is globals() if not debugging, or a dictionary containing both locals() and globals() for current frame when debugging
[ "Return", "current", "namespace" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/console/kernel.py#L310-L334
train
Return the current namespace
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/console/kernel.py
SpyderKernel._get_reference_namespace
def _get_reference_namespace(self, name): """ Return namespace where reference name is defined It returns the globals() if reference has not yet been defined """ glbs = self._mglobals() if self._pdb_frame is None: return glbs else: lcls = ...
python
def _get_reference_namespace(self, name): """ Return namespace where reference name is defined It returns the globals() if reference has not yet been defined """ glbs = self._mglobals() if self._pdb_frame is None: return glbs else: lcls = ...
[ "def", "_get_reference_namespace", "(", "self", ",", "name", ")", ":", "glbs", "=", "self", ".", "_mglobals", "(", ")", "if", "self", ".", "_pdb_frame", "is", "None", ":", "return", "glbs", "else", ":", "lcls", "=", "self", ".", "_pdb_locals", "if", "n...
Return namespace where reference name is defined It returns the globals() if reference has not yet been defined
[ "Return", "namespace", "where", "reference", "name", "is", "defined" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/console/kernel.py#L336-L350
train
Returns the namespace where the reference name is defined.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/console/kernel.py
SpyderKernel._mglobals
def _mglobals(self): """Return current globals -- handles Pdb frames""" if self._pdb_frame is not None: return self._pdb_frame.f_globals else: return self.shell.user_ns
python
def _mglobals(self): """Return current globals -- handles Pdb frames""" if self._pdb_frame is not None: return self._pdb_frame.f_globals else: return self.shell.user_ns
[ "def", "_mglobals", "(", "self", ")", ":", "if", "self", ".", "_pdb_frame", "is", "not", "None", ":", "return", "self", ".", "_pdb_frame", ".", "f_globals", "else", ":", "return", "self", ".", "shell", ".", "user_ns" ]
Return current globals -- handles Pdb frames
[ "Return", "current", "globals", "--", "handles", "Pdb", "frames" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/console/kernel.py#L352-L357
train
Return current globals
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/console/kernel.py
SpyderKernel._is_image
def _is_image(self, var): """Return True if variable is a PIL.Image image""" try: from PIL import Image return isinstance(var, Image.Image) except: return False
python
def _is_image(self, var): """Return True if variable is a PIL.Image image""" try: from PIL import Image return isinstance(var, Image.Image) except: return False
[ "def", "_is_image", "(", "self", ",", "var", ")", ":", "try", ":", "from", "PIL", "import", "Image", "return", "isinstance", "(", "var", ",", "Image", ".", "Image", ")", "except", ":", "return", "False" ]
Return True if variable is a PIL.Image image
[ "Return", "True", "if", "variable", "is", "a", "PIL", ".", "Image", "image" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/console/kernel.py#L374-L380
train
Return True if variable is a PIL. Image image
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/console/kernel.py
SpyderKernel._set_spyder_breakpoints
def _set_spyder_breakpoints(self, breakpoints): """Set all Spyder breakpoints in an active pdb session""" if not self._pdb_obj: return # Breakpoints come serialized from Spyder. We send them # in a list of one element to be able to send them at all # in Python 2 ...
python
def _set_spyder_breakpoints(self, breakpoints): """Set all Spyder breakpoints in an active pdb session""" if not self._pdb_obj: return # Breakpoints come serialized from Spyder. We send them # in a list of one element to be able to send them at all # in Python 2 ...
[ "def", "_set_spyder_breakpoints", "(", "self", ",", "breakpoints", ")", ":", "if", "not", "self", ".", "_pdb_obj", ":", "return", "# Breakpoints come serialized from Spyder. We send them", "# in a list of one element to be able to send them at all", "# in Python 2", "serialized_b...
Set all Spyder breakpoints in an active pdb session
[ "Set", "all", "Spyder", "breakpoints", "in", "an", "active", "pdb", "session" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/console/kernel.py#L423-L434
train
Set all Spyder breakpoints in an active pdb session
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/console/kernel.py
SpyderKernel._eval
def _eval(self, text): """ Evaluate text and return (obj, valid) where *obj* is the object represented by *text* and *valid* is True if object evaluation did not raise any exception """ from spyder_kernels.py3compat import is_text_string assert is_text_string(tex...
python
def _eval(self, text): """ Evaluate text and return (obj, valid) where *obj* is the object represented by *text* and *valid* is True if object evaluation did not raise any exception """ from spyder_kernels.py3compat import is_text_string assert is_text_string(tex...
[ "def", "_eval", "(", "self", ",", "text", ")", ":", "from", "spyder_kernels", ".", "py3compat", "import", "is_text_string", "assert", "is_text_string", "(", "text", ")", "ns", "=", "self", ".", "_get_current_namespace", "(", "with_magics", "=", "True", ")", ...
Evaluate text and return (obj, valid) where *obj* is the object represented by *text* and *valid* is True if object evaluation did not raise any exception
[ "Evaluate", "text", "and", "return", "(", "obj", "valid", ")", "where", "*", "obj", "*", "is", "the", "object", "represented", "by", "*", "text", "*", "and", "*", "valid", "*", "is", "True", "if", "object", "evaluation", "did", "not", "raise", "any", ...
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/console/kernel.py#L441-L454
train
Evaluate text and return obj valid
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/console/kernel.py
SpyderKernel._set_mpl_backend
def _set_mpl_backend(self, backend, pylab=False): """ Set a backend for Matplotlib. backend: A parameter that can be passed to %matplotlib (e.g. 'inline' or 'tk'). """ import traceback from IPython.core.getipython import get_ipython generic_erro...
python
def _set_mpl_backend(self, backend, pylab=False): """ Set a backend for Matplotlib. backend: A parameter that can be passed to %matplotlib (e.g. 'inline' or 'tk'). """ import traceback from IPython.core.getipython import get_ipython generic_erro...
[ "def", "_set_mpl_backend", "(", "self", ",", "backend", ",", "pylab", "=", "False", ")", ":", "import", "traceback", "from", "IPython", ".", "core", ".", "getipython", "import", "get_ipython", "generic_error", "=", "(", "\"\\n\"", "+", "\"=\"", "*", "73", ...
Set a backend for Matplotlib. backend: A parameter that can be passed to %matplotlib (e.g. 'inline' or 'tk').
[ "Set", "a", "backend", "for", "Matplotlib", "." ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/console/kernel.py#L457-L503
train
Set a Matplotlib backend for Matplotlib.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/console/kernel.py
SpyderKernel._load_autoreload_magic
def _load_autoreload_magic(self): """Load %autoreload magic.""" from IPython.core.getipython import get_ipython try: get_ipython().run_line_magic('reload_ext', 'autoreload') get_ipython().run_line_magic('autoreload', '2') except Exception: pass
python
def _load_autoreload_magic(self): """Load %autoreload magic.""" from IPython.core.getipython import get_ipython try: get_ipython().run_line_magic('reload_ext', 'autoreload') get_ipython().run_line_magic('autoreload', '2') except Exception: pass
[ "def", "_load_autoreload_magic", "(", "self", ")", ":", "from", "IPython", ".", "core", ".", "getipython", "import", "get_ipython", "try", ":", "get_ipython", "(", ")", ".", "run_line_magic", "(", "'reload_ext'", ",", "'autoreload'", ")", "get_ipython", "(", "...
Load %autoreload magic.
[ "Load", "%autoreload", "magic", "." ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/console/kernel.py#L511-L518
train
Load %autoreload magic.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/console/kernel.py
SpyderKernel._load_wurlitzer
def _load_wurlitzer(self): """Load wurlitzer extension.""" # Wurlitzer has no effect on Windows if not os.name == 'nt': from IPython.core.getipython import get_ipython # Enclose this in a try/except because if it fails the # console will be totally unusable. ...
python
def _load_wurlitzer(self): """Load wurlitzer extension.""" # Wurlitzer has no effect on Windows if not os.name == 'nt': from IPython.core.getipython import get_ipython # Enclose this in a try/except because if it fails the # console will be totally unusable. ...
[ "def", "_load_wurlitzer", "(", "self", ")", ":", "# Wurlitzer has no effect on Windows", "if", "not", "os", ".", "name", "==", "'nt'", ":", "from", "IPython", ".", "core", ".", "getipython", "import", "get_ipython", "# Enclose this in a try/except because if it fails th...
Load wurlitzer extension.
[ "Load", "wurlitzer", "extension", "." ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/console/kernel.py#L520-L531
train
Load wurlitzer extension.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/console/start.py
import_spydercustomize
def import_spydercustomize(): """Import our customizations into the kernel.""" here = osp.dirname(__file__) parent = osp.dirname(here) customize_dir = osp.join(parent, 'customize') # Remove current directory from sys.path to prevent kernel # crashes when people name Python files or modules with...
python
def import_spydercustomize(): """Import our customizations into the kernel.""" here = osp.dirname(__file__) parent = osp.dirname(here) customize_dir = osp.join(parent, 'customize') # Remove current directory from sys.path to prevent kernel # crashes when people name Python files or modules with...
[ "def", "import_spydercustomize", "(", ")", ":", "here", "=", "osp", ".", "dirname", "(", "__file__", ")", "parent", "=", "osp", ".", "dirname", "(", "here", ")", "customize_dir", "=", "osp", ".", "join", "(", "parent", ",", "'customize'", ")", "# Remove ...
Import our customizations into the kernel.
[ "Import", "our", "customizations", "into", "the", "kernel", "." ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/console/start.py#L24-L45
train
Import our customizations into the kernel.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/console/start.py
kernel_config
def kernel_config(): """Create a config object with IPython kernel options.""" import ipykernel from IPython.core.application import get_ipython_dir from traitlets.config.loader import Config, load_pyconfig_files # ---- IPython config ---- try: profile_path = osp.join(get_ipython_dir(),...
python
def kernel_config(): """Create a config object with IPython kernel options.""" import ipykernel from IPython.core.application import get_ipython_dir from traitlets.config.loader import Config, load_pyconfig_files # ---- IPython config ---- try: profile_path = osp.join(get_ipython_dir(),...
[ "def", "kernel_config", "(", ")", ":", "import", "ipykernel", "from", "IPython", ".", "core", ".", "application", "import", "get_ipython_dir", "from", "traitlets", ".", "config", ".", "loader", "import", "Config", ",", "load_pyconfig_files", "# ---- IPython config -...
Create a config object with IPython kernel options.
[ "Create", "a", "config", "object", "with", "IPython", "kernel", "options", "." ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/console/start.py#L78-L250
train
Create a config object with IPython kernel options.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/console/start.py
varexp
def varexp(line): """ Spyder's variable explorer magic Used to generate plots, histograms and images of the variables displayed on it. """ ip = get_ipython() #analysis:ignore funcname, name = line.split() try: import guiqwt.pyplot as pyplot except: import matpl...
python
def varexp(line): """ Spyder's variable explorer magic Used to generate plots, histograms and images of the variables displayed on it. """ ip = get_ipython() #analysis:ignore funcname, name = line.split() try: import guiqwt.pyplot as pyplot except: import matpl...
[ "def", "varexp", "(", "line", ")", ":", "ip", "=", "get_ipython", "(", ")", "#analysis:ignore", "funcname", ",", "name", "=", "line", ".", "split", "(", ")", "try", ":", "import", "guiqwt", ".", "pyplot", "as", "pyplot", "except", ":", "import", "matpl...
Spyder's variable explorer magic Used to generate plots, histograms and images of the variables displayed on it.
[ "Spyder", "s", "variable", "explorer", "magic" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/console/start.py#L253-L269
train
Magic magic Spyder s variable explorer magic Used to generate plots histograms and images of the variables displayed on it.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/misc.py
fix_reference_name
def fix_reference_name(name, blacklist=None): """Return a syntax-valid Python reference name from an arbitrary name""" name = "".join(re.split(r'[^0-9a-zA-Z_]', name)) while name and not re.match(r'([a-zA-Z]+[0-9a-zA-Z_]*)$', name): if not re.match(r'[a-zA-Z]', name[0]): name = name[1:] ...
python
def fix_reference_name(name, blacklist=None): """Return a syntax-valid Python reference name from an arbitrary name""" name = "".join(re.split(r'[^0-9a-zA-Z_]', name)) while name and not re.match(r'([a-zA-Z]+[0-9a-zA-Z_]*)$', name): if not re.match(r'[a-zA-Z]', name[0]): name = name[1:] ...
[ "def", "fix_reference_name", "(", "name", ",", "blacklist", "=", "None", ")", ":", "name", "=", "\"\"", ".", "join", "(", "re", ".", "split", "(", "r'[^0-9a-zA-Z_]'", ",", "name", ")", ")", "while", "name", "and", "not", "re", ".", "match", "(", "r'(...
Return a syntax-valid Python reference name from an arbitrary name
[ "Return", "a", "syntax", "-", "valid", "Python", "reference", "name", "from", "an", "arbitrary", "name" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/misc.py#L13-L29
train
Return a syntax - valid Python reference name from an arbitrary name
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/customize/spydercustomize.py
user_return
def user_return(self, frame, return_value): """This function is called when a return trap is set here.""" # This is useful when debugging in an active interpreter (otherwise, # the debugger will stop before reaching the target file) if self._wait_for_mainpyfile: if (self.mainpyfile != self.canon...
python
def user_return(self, frame, return_value): """This function is called when a return trap is set here.""" # This is useful when debugging in an active interpreter (otherwise, # the debugger will stop before reaching the target file) if self._wait_for_mainpyfile: if (self.mainpyfile != self.canon...
[ "def", "user_return", "(", "self", ",", "frame", ",", "return_value", ")", ":", "# This is useful when debugging in an active interpreter (otherwise,", "# the debugger will stop before reaching the target file)", "if", "self", ".", "_wait_for_mainpyfile", ":", "if", "(", "self"...
This function is called when a return trap is set here.
[ "This", "function", "is", "called", "when", "a", "return", "trap", "is", "set", "here", "." ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/customize/spydercustomize.py#L424-L433
train
This function is called when a user return trap is set here.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/customize/spydercustomize.py
post_mortem_excepthook
def post_mortem_excepthook(type, value, tb): """ For post mortem exception handling, print a banner and enable post mortem debugging. """ clear_post_mortem() ipython_shell = get_ipython() ipython_shell.showtraceback((type, value, tb)) p = pdb.Pdb(ipython_shell.colors) if not type ==...
python
def post_mortem_excepthook(type, value, tb): """ For post mortem exception handling, print a banner and enable post mortem debugging. """ clear_post_mortem() ipython_shell = get_ipython() ipython_shell.showtraceback((type, value, tb)) p = pdb.Pdb(ipython_shell.colors) if not type ==...
[ "def", "post_mortem_excepthook", "(", "type", ",", "value", ",", "tb", ")", ":", "clear_post_mortem", "(", ")", "ipython_shell", "=", "get_ipython", "(", ")", "ipython_shell", ".", "showtraceback", "(", "(", "type", ",", "value", ",", "tb", ")", ")", "p", ...
For post mortem exception handling, print a banner and enable post mortem debugging.
[ "For", "post", "mortem", "exception", "handling", "print", "a", "banner", "and", "enable", "post", "mortem", "debugging", "." ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/customize/spydercustomize.py#L731-L758
train
This function is used to add a post mortem exception handler to the internal stack.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/customize/spydercustomize.py
set_post_mortem
def set_post_mortem(): """ Enable the post mortem debugging excepthook. """ def ipython_post_mortem_debug(shell, etype, evalue, tb, tb_offset=None): post_mortem_excepthook(etype, evalue, tb) ipython_shell = get_ipython() ipython_shell.set_custom_exc((Exception,), ipython_p...
python
def set_post_mortem(): """ Enable the post mortem debugging excepthook. """ def ipython_post_mortem_debug(shell, etype, evalue, tb, tb_offset=None): post_mortem_excepthook(etype, evalue, tb) ipython_shell = get_ipython() ipython_shell.set_custom_exc((Exception,), ipython_p...
[ "def", "set_post_mortem", "(", ")", ":", "def", "ipython_post_mortem_debug", "(", "shell", ",", "etype", ",", "evalue", ",", "tb", ",", "tb_offset", "=", "None", ")", ":", "post_mortem_excepthook", "(", "etype", ",", "evalue", ",", "tb", ")", "ipython_shell"...
Enable the post mortem debugging excepthook.
[ "Enable", "the", "post", "mortem", "debugging", "excepthook", "." ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/customize/spydercustomize.py#L761-L769
train
Enable the post mortem debugging excepthook.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/customize/spydercustomize.py
runfile
def runfile(filename, args=None, wdir=None, namespace=None, post_mortem=False): """ Run filename args: command line arguments (string) wdir: working directory post_mortem: boolean, whether to enter post-mortem mode on error """ try: filename = filename.decode('utf-8') except (Uni...
python
def runfile(filename, args=None, wdir=None, namespace=None, post_mortem=False): """ Run filename args: command line arguments (string) wdir: working directory post_mortem: boolean, whether to enter post-mortem mode on error """ try: filename = filename.decode('utf-8') except (Uni...
[ "def", "runfile", "(", "filename", ",", "args", "=", "None", ",", "wdir", "=", "None", ",", "namespace", "=", "None", ",", "post_mortem", "=", "False", ")", ":", "try", ":", "filename", "=", "filename", ".", "decode", "(", "'utf-8'", ")", "except", "...
Run filename args: command line arguments (string) wdir: working directory post_mortem: boolean, whether to enter post-mortem mode on error
[ "Run", "filename", "args", ":", "command", "line", "arguments", "(", "string", ")", "wdir", ":", "working", "directory", "post_mortem", ":", "boolean", "whether", "to", "enter", "post", "-", "mortem", "mode", "on", "error" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/customize/spydercustomize.py#L786-L836
train
Run a file and return a dictionary of the result.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/customize/spydercustomize.py
runcell
def runcell(cellname, filename): """ Run a code cell from an editor as a file. Currently looks for code in an `ipython` property called `cell_code`. This property must be set by the editor prior to calling this function. This function deletes the contents of `cell_code` upon completion. Parame...
python
def runcell(cellname, filename): """ Run a code cell from an editor as a file. Currently looks for code in an `ipython` property called `cell_code`. This property must be set by the editor prior to calling this function. This function deletes the contents of `cell_code` upon completion. Parame...
[ "def", "runcell", "(", "cellname", ",", "filename", ")", ":", "try", ":", "filename", "=", "filename", ".", "decode", "(", "'utf-8'", ")", "except", "(", "UnicodeError", ",", "TypeError", ",", "AttributeError", ")", ":", "# UnicodeError, TypeError --> eventually...
Run a code cell from an editor as a file. Currently looks for code in an `ipython` property called `cell_code`. This property must be set by the editor prior to calling this function. This function deletes the contents of `cell_code` upon completion. Parameters ---------- cellname : str ...
[ "Run", "a", "code", "cell", "from", "an", "editor", "as", "a", "file", "." ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/customize/spydercustomize.py#L842-L881
train
Runs a code cell from an editor as a file.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/customize/spydercustomize.py
debugfile
def debugfile(filename, args=None, wdir=None, post_mortem=False): """ Debug filename args: command line arguments (string) wdir: working directory post_mortem: boolean, included for compatiblity with runfile """ debugger = pdb.Pdb() filename = debugger.canonic(filename) debugger._wai...
python
def debugfile(filename, args=None, wdir=None, post_mortem=False): """ Debug filename args: command line arguments (string) wdir: working directory post_mortem: boolean, included for compatiblity with runfile """ debugger = pdb.Pdb() filename = debugger.canonic(filename) debugger._wai...
[ "def", "debugfile", "(", "filename", ",", "args", "=", "None", ",", "wdir", "=", "None", ",", "post_mortem", "=", "False", ")", ":", "debugger", "=", "pdb", ".", "Pdb", "(", ")", "filename", "=", "debugger", ".", "canonic", "(", "filename", ")", "deb...
Debug filename args: command line arguments (string) wdir: working directory post_mortem: boolean, included for compatiblity with runfile
[ "Debug", "filename", "args", ":", "command", "line", "arguments", "(", "string", ")", "wdir", ":", "working", "directory", "post_mortem", ":", "boolean", "included", "for", "compatiblity", "with", "runfile" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/customize/spydercustomize.py#L887-L901
train
Debug file.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/customize/spydercustomize.py
UserModuleReloader.create_pathlist
def create_pathlist(self, initial_pathlist): """ Add to pathlist Python library paths to be skipped from module reloading. """ # Get standard installation paths try: paths = sysconfig.get_paths() standard_paths = [paths['stdlib'], ...
python
def create_pathlist(self, initial_pathlist): """ Add to pathlist Python library paths to be skipped from module reloading. """ # Get standard installation paths try: paths = sysconfig.get_paths() standard_paths = [paths['stdlib'], ...
[ "def", "create_pathlist", "(", "self", ",", "initial_pathlist", ")", ":", "# Get standard installation paths", "try", ":", "paths", "=", "sysconfig", ".", "get_paths", "(", ")", "standard_paths", "=", "[", "paths", "[", "'stdlib'", "]", ",", "paths", "[", "'pu...
Add to pathlist Python library paths to be skipped from module reloading.
[ "Add", "to", "pathlist", "Python", "library", "paths", "to", "be", "skipped", "from", "module", "reloading", "." ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/customize/spydercustomize.py#L573-L605
train
Create a list of paths to be skipped from module AttributeNames reloading.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/customize/spydercustomize.py
UserModuleReloader.is_module_reloadable
def is_module_reloadable(self, module, modname): """Decide if a module is reloadable or not.""" if self.has_cython: # Don't return cached inline compiled .PYX files return False else: if (self.is_module_in_pathlist(module) or self.is_module...
python
def is_module_reloadable(self, module, modname): """Decide if a module is reloadable or not.""" if self.has_cython: # Don't return cached inline compiled .PYX files return False else: if (self.is_module_in_pathlist(module) or self.is_module...
[ "def", "is_module_reloadable", "(", "self", ",", "module", ",", "modname", ")", ":", "if", "self", ".", "has_cython", ":", "# Don't return cached inline compiled .PYX files", "return", "False", "else", ":", "if", "(", "self", ".", "is_module_in_pathlist", "(", "mo...
Decide if a module is reloadable or not.
[ "Decide", "if", "a", "module", "is", "reloadable", "or", "not", "." ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/customize/spydercustomize.py#L607-L617
train
Decide if a module is reloadable or not.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/customize/spydercustomize.py
UserModuleReloader.is_module_in_pathlist
def is_module_in_pathlist(self, module): """Decide if a module can be reloaded or not according to its path.""" modpath = getattr(module, '__file__', None) # Skip module according to different criteria if modpath is None: # *module* is a C module that is statically linked in...
python
def is_module_in_pathlist(self, module): """Decide if a module can be reloaded or not according to its path.""" modpath = getattr(module, '__file__', None) # Skip module according to different criteria if modpath is None: # *module* is a C module that is statically linked in...
[ "def", "is_module_in_pathlist", "(", "self", ",", "module", ")", ":", "modpath", "=", "getattr", "(", "module", ",", "'__file__'", ",", "None", ")", "# Skip module according to different criteria", "if", "modpath", "is", "None", ":", "# *module* is a C module that is ...
Decide if a module can be reloaded or not according to its path.
[ "Decide", "if", "a", "module", "can", "be", "reloaded", "or", "not", "according", "to", "its", "path", "." ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/customize/spydercustomize.py#L623-L656
train
Decide if a module can be reloaded or not according to its pathlist.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/customize/spydercustomize.py
UserModuleReloader.activate_cython
def activate_cython(self): """ Activate Cython support. We need to run this here because if the support is active, we don't to run the UMR at all. """ run_cython = os.environ.get("SPY_RUN_CYTHON") == "True" if run_cython: try: __impor...
python
def activate_cython(self): """ Activate Cython support. We need to run this here because if the support is active, we don't to run the UMR at all. """ run_cython = os.environ.get("SPY_RUN_CYTHON") == "True" if run_cython: try: __impor...
[ "def", "activate_cython", "(", "self", ")", ":", "run_cython", "=", "os", ".", "environ", ".", "get", "(", "\"SPY_RUN_CYTHON\"", ")", "==", "\"True\"", "if", "run_cython", ":", "try", ":", "__import__", "(", "'Cython'", ")", "self", ".", "has_cython", "=",...
Activate Cython support. We need to run this here because if the support is active, we don't to run the UMR at all.
[ "Activate", "Cython", "support", "." ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/customize/spydercustomize.py#L658-L689
train
Activate Cython support.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/customize/spydercustomize.py
UserModuleReloader.run
def run(self): """ Delete user modules to force Python to deeply reload them Do not del modules which are considered as system modules, i.e. modules installed in subdirectories of Python interpreter's binary Do not del C modules """ self.modnames_to_reload = [] ...
python
def run(self): """ Delete user modules to force Python to deeply reload them Do not del modules which are considered as system modules, i.e. modules installed in subdirectories of Python interpreter's binary Do not del C modules """ self.modnames_to_reload = [] ...
[ "def", "run", "(", "self", ")", ":", "self", ".", "modnames_to_reload", "=", "[", "]", "for", "modname", ",", "module", "in", "list", "(", "sys", ".", "modules", ".", "items", "(", ")", ")", ":", "if", "modname", "not", "in", "self", ".", "previous...
Delete user modules to force Python to deeply reload them Do not del modules which are considered as system modules, i.e. modules installed in subdirectories of Python interpreter's binary Do not del C modules
[ "Delete", "user", "modules", "to", "force", "Python", "to", "deeply", "reload", "them" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/customize/spydercustomize.py#L691-L713
train
Delete user modules which are not considered as system modules and which are not in previous_modules and if they are reloadable then reload them.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/iofuncs.py
get_matlab_value
def get_matlab_value(val): """ Extract a value from a Matlab file From the oct2py project, see https://pythonhosted.org/oct2py/conversions.html """ import numpy as np # Extract each item of a list. if isinstance(val, list): return [get_matlab_value(v) for v in val] # Ignor...
python
def get_matlab_value(val): """ Extract a value from a Matlab file From the oct2py project, see https://pythonhosted.org/oct2py/conversions.html """ import numpy as np # Extract each item of a list. if isinstance(val, list): return [get_matlab_value(v) for v in val] # Ignor...
[ "def", "get_matlab_value", "(", "val", ")", ":", "import", "numpy", "as", "np", "# Extract each item of a list.", "if", "isinstance", "(", "val", ",", "list", ")", ":", "return", "[", "get_matlab_value", "(", "v", ")", "for", "v", "in", "val", "]", "# Igno...
Extract a value from a Matlab file From the oct2py project, see https://pythonhosted.org/oct2py/conversions.html
[ "Extract", "a", "value", "from", "a", "Matlab", "file" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/iofuncs.py#L106-L156
train
Extract a value from a Matlab file and return it as a list of dicts.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/iofuncs.py
load_pickle
def load_pickle(filename): """Load a pickle file as a dictionary""" try: if pd: return pd.read_pickle(filename), None else: with open(filename, 'rb') as fid: data = pickle.load(fid) return data, None except Exception as err: return ...
python
def load_pickle(filename): """Load a pickle file as a dictionary""" try: if pd: return pd.read_pickle(filename), None else: with open(filename, 'rb') as fid: data = pickle.load(fid) return data, None except Exception as err: return ...
[ "def", "load_pickle", "(", "filename", ")", ":", "try", ":", "if", "pd", ":", "return", "pd", ".", "read_pickle", "(", "filename", ")", ",", "None", "else", ":", "with", "open", "(", "filename", ",", "'rb'", ")", "as", "fid", ":", "data", "=", "pic...
Load a pickle file as a dictionary
[ "Load", "a", "pickle", "file", "as", "a", "dictionary" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/iofuncs.py#L260-L270
train
Load a pickle file as a dictionary
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/iofuncs.py
load_json
def load_json(filename): """Load a json file as a dictionary""" try: if PY2: args = 'rb' else: args = 'r' with open(filename, args) as fid: data = json.load(fid) return data, None except Exception as err: return None, str(err)
python
def load_json(filename): """Load a json file as a dictionary""" try: if PY2: args = 'rb' else: args = 'r' with open(filename, args) as fid: data = json.load(fid) return data, None except Exception as err: return None, str(err)
[ "def", "load_json", "(", "filename", ")", ":", "try", ":", "if", "PY2", ":", "args", "=", "'rb'", "else", ":", "args", "=", "'r'", "with", "open", "(", "filename", ",", "args", ")", "as", "fid", ":", "data", "=", "json", ".", "load", "(", "fid", ...
Load a json file as a dictionary
[ "Load", "a", "json", "file", "as", "a", "dictionary" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/iofuncs.py#L273-L284
train
Load a json file as a dictionary
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/iofuncs.py
save_dictionary
def save_dictionary(data, filename): """Save dictionary in a single file .spydata file""" filename = osp.abspath(filename) old_cwd = getcwd() os.chdir(osp.dirname(filename)) error_message = None skipped_keys = [] data_copy = {} try: # Copy dictionary before modifying it to fix #...
python
def save_dictionary(data, filename): """Save dictionary in a single file .spydata file""" filename = osp.abspath(filename) old_cwd = getcwd() os.chdir(osp.dirname(filename)) error_message = None skipped_keys = [] data_copy = {} try: # Copy dictionary before modifying it to fix #...
[ "def", "save_dictionary", "(", "data", ",", "filename", ")", ":", "filename", "=", "osp", ".", "abspath", "(", "filename", ")", "old_cwd", "=", "getcwd", "(", ")", "os", ".", "chdir", "(", "osp", ".", "dirname", "(", "filename", ")", ")", "error_messag...
Save dictionary in a single file .spydata file
[ "Save", "dictionary", "in", "a", "single", "file", ".", "spydata", "file" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/iofuncs.py#L287-L389
train
Save dictionary to a single file.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/iofuncs.py
load_dictionary
def load_dictionary(filename): """Load dictionary from .spydata file""" filename = osp.abspath(filename) old_cwd = getcwd() tmp_folder = tempfile.mkdtemp() os.chdir(tmp_folder) data = None error_message = None try: with tarfile.open(filename, "r") as tar: tar.extracta...
python
def load_dictionary(filename): """Load dictionary from .spydata file""" filename = osp.abspath(filename) old_cwd = getcwd() tmp_folder = tempfile.mkdtemp() os.chdir(tmp_folder) data = None error_message = None try: with tarfile.open(filename, "r") as tar: tar.extracta...
[ "def", "load_dictionary", "(", "filename", ")", ":", "filename", "=", "osp", ".", "abspath", "(", "filename", ")", "old_cwd", "=", "getcwd", "(", ")", "tmp_folder", "=", "tempfile", ".", "mkdtemp", "(", ")", "os", ".", "chdir", "(", "tmp_folder", ")", ...
Load dictionary from .spydata file
[ "Load", "dictionary", "from", ".", "spydata", "file" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/iofuncs.py#L392-L432
train
Load a dictionary from a. spydata file
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/dochelpers.py
getobj
def getobj(txt, last=False): """Return the last valid object name in string""" txt_end = "" for startchar, endchar in ["[]", "()"]: if txt.endswith(endchar): pos = txt.rfind(startchar) if pos: txt_end = txt[pos:] txt = txt[:pos] tokens = re...
python
def getobj(txt, last=False): """Return the last valid object name in string""" txt_end = "" for startchar, endchar in ["[]", "()"]: if txt.endswith(endchar): pos = txt.rfind(startchar) if pos: txt_end = txt[pos:] txt = txt[:pos] tokens = re...
[ "def", "getobj", "(", "txt", ",", "last", "=", "False", ")", ":", "txt_end", "=", "\"\"", "for", "startchar", ",", "endchar", "in", "[", "\"[]\"", ",", "\"()\"", "]", ":", "if", "txt", ".", "endswith", "(", "endchar", ")", ":", "pos", "=", "txt", ...
Return the last valid object name in string
[ "Return", "the", "last", "valid", "object", "name", "in", "string" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/dochelpers.py#L25-L51
train
Return the last valid object name in string
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/dochelpers.py
getdoc
def getdoc(obj): """ Return text documentation from an object. This comes in a form of dictionary with four keys: name: The name of the inspected object argspec: It's argspec note: A phrase describing the type of object (function or method) we are inspecting, and the mod...
python
def getdoc(obj): """ Return text documentation from an object. This comes in a form of dictionary with four keys: name: The name of the inspected object argspec: It's argspec note: A phrase describing the type of object (function or method) we are inspecting, and the mod...
[ "def", "getdoc", "(", "obj", ")", ":", "docstring", "=", "inspect", ".", "getdoc", "(", "obj", ")", "or", "inspect", ".", "getcomments", "(", "obj", ")", "or", "''", "# Most of the time doc will only contain ascii characters, but there are", "# some docstrings that co...
Return text documentation from an object. This comes in a form of dictionary with four keys: name: The name of the inspected object argspec: It's argspec note: A phrase describing the type of object (function or method) we are inspecting, and the module it belongs to. docstr...
[ "Return", "text", "documentation", "from", "an", "object", ".", "This", "comes", "in", "a", "form", "of", "dictionary", "with", "four", "keys", ":" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/dochelpers.py#L63-L157
train
Get the text documentation from an object.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/dochelpers.py
getsource
def getsource(obj): """Wrapper around inspect.getsource""" try: try: src = to_text_string(inspect.getsource(obj)) except TypeError: if hasattr(obj, '__class__'): src = to_text_string(inspect.getsource(obj.__class__)) else: # Bin...
python
def getsource(obj): """Wrapper around inspect.getsource""" try: try: src = to_text_string(inspect.getsource(obj)) except TypeError: if hasattr(obj, '__class__'): src = to_text_string(inspect.getsource(obj.__class__)) else: # Bin...
[ "def", "getsource", "(", "obj", ")", ":", "try", ":", "try", ":", "src", "=", "to_text_string", "(", "inspect", ".", "getsource", "(", "obj", ")", ")", "except", "TypeError", ":", "if", "hasattr", "(", "obj", ",", "'__class__'", ")", ":", "src", "=",...
Wrapper around inspect.getsource
[ "Wrapper", "around", "inspect", ".", "getsource" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/dochelpers.py#L160-L173
train
Wrapper around inspect. getSource
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/dochelpers.py
getsignaturefromtext
def getsignaturefromtext(text, objname): """Get object signatures from text (object documentation) Return a list containing a single string in most cases Example of multiple signatures: PyQt5 objects""" if isinstance(text, dict): text = text.get('docstring', '') # Regexps oneline_re = ob...
python
def getsignaturefromtext(text, objname): """Get object signatures from text (object documentation) Return a list containing a single string in most cases Example of multiple signatures: PyQt5 objects""" if isinstance(text, dict): text = text.get('docstring', '') # Regexps oneline_re = ob...
[ "def", "getsignaturefromtext", "(", "text", ",", "objname", ")", ":", "if", "isinstance", "(", "text", ",", "dict", ")", ":", "text", "=", "text", ".", "get", "(", "'docstring'", ",", "''", ")", "# Regexps", "oneline_re", "=", "objname", "+", "r'\\([^\\)...
Get object signatures from text (object documentation) Return a list containing a single string in most cases Example of multiple signatures: PyQt5 objects
[ "Get", "object", "signatures", "from", "text", "(", "object", "documentation", ")", "Return", "a", "list", "containing", "a", "single", "string", "in", "most", "cases", "Example", "of", "multiple", "signatures", ":", "PyQt5", "objects" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/dochelpers.py#L176-L197
train
Get object signatures from text
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/dochelpers.py
getargspecfromtext
def getargspecfromtext(text): """ Try to get the formatted argspec of a callable from the first block of its docstring This will return something like '(foo, bar, k=1)' """ blocks = text.split("\n\n") first_block = blocks[0].strip() return getsignaturefromtext(first_block, '')
python
def getargspecfromtext(text): """ Try to get the formatted argspec of a callable from the first block of its docstring This will return something like '(foo, bar, k=1)' """ blocks = text.split("\n\n") first_block = blocks[0].strip() return getsignaturefromtext(first_block, '')
[ "def", "getargspecfromtext", "(", "text", ")", ":", "blocks", "=", "text", ".", "split", "(", "\"\\n\\n\"", ")", "first_block", "=", "blocks", "[", "0", "]", ".", "strip", "(", ")", "return", "getsignaturefromtext", "(", "first_block", ",", "''", ")" ]
Try to get the formatted argspec of a callable from the first block of its docstring This will return something like '(foo, bar, k=1)'
[ "Try", "to", "get", "the", "formatted", "argspec", "of", "a", "callable", "from", "the", "first", "block", "of", "its", "docstring", "This", "will", "return", "something", "like", "(", "foo", "bar", "k", "=", "1", ")" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/dochelpers.py#L204-L214
train
Try to get the formatted argspec of a callable from the first block of the text.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/dochelpers.py
getargsfromtext
def getargsfromtext(text, objname): """Get arguments from text (object documentation)""" signature = getsignaturefromtext(text, objname) if signature: argtxt = signature[signature.find('(')+1:-1] return argtxt.split(',')
python
def getargsfromtext(text, objname): """Get arguments from text (object documentation)""" signature = getsignaturefromtext(text, objname) if signature: argtxt = signature[signature.find('(')+1:-1] return argtxt.split(',')
[ "def", "getargsfromtext", "(", "text", ",", "objname", ")", ":", "signature", "=", "getsignaturefromtext", "(", "text", ",", "objname", ")", "if", "signature", ":", "argtxt", "=", "signature", "[", "signature", ".", "find", "(", "'('", ")", "+", "1", ":"...
Get arguments from text (object documentation)
[ "Get", "arguments", "from", "text", "(", "object", "documentation", ")" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/dochelpers.py#L217-L222
train
Get arguments from text.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/dochelpers.py
getargs
def getargs(obj): """Get the names and default values of a function's arguments""" if inspect.isfunction(obj) or inspect.isbuiltin(obj): func_obj = obj elif inspect.ismethod(obj): func_obj = get_meth_func(obj) elif inspect.isclass(obj) and hasattr(obj, '__init__'): func_obj = get...
python
def getargs(obj): """Get the names and default values of a function's arguments""" if inspect.isfunction(obj) or inspect.isbuiltin(obj): func_obj = obj elif inspect.ismethod(obj): func_obj = get_meth_func(obj) elif inspect.isclass(obj) and hasattr(obj, '__init__'): func_obj = get...
[ "def", "getargs", "(", "obj", ")", ":", "if", "inspect", ".", "isfunction", "(", "obj", ")", "or", "inspect", ".", "isbuiltin", "(", "obj", ")", ":", "func_obj", "=", "obj", "elif", "inspect", ".", "ismethod", "(", "obj", ")", ":", "func_obj", "=", ...
Get the names and default values of a function's arguments
[ "Get", "the", "names", "and", "default", "values", "of", "a", "function", "s", "arguments" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/dochelpers.py#L231-L267
train
Get the names and default values of a function s arguments
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/dochelpers.py
getargtxt
def getargtxt(obj, one_arg_per_line=True): """ Get the names and default values of a function's arguments Return list with separators (', ') formatted for calltips """ args = getargs(obj) if args: sep = ', ' textlist = None for i_arg, arg in enumerate(args): i...
python
def getargtxt(obj, one_arg_per_line=True): """ Get the names and default values of a function's arguments Return list with separators (', ') formatted for calltips """ args = getargs(obj) if args: sep = ', ' textlist = None for i_arg, arg in enumerate(args): i...
[ "def", "getargtxt", "(", "obj", ",", "one_arg_per_line", "=", "True", ")", ":", "args", "=", "getargs", "(", "obj", ")", "if", "args", ":", "sep", "=", "', '", "textlist", "=", "None", "for", "i_arg", ",", "arg", "in", "enumerate", "(", "args", ")", ...
Get the names and default values of a function's arguments Return list with separators (', ') formatted for calltips
[ "Get", "the", "names", "and", "default", "values", "of", "a", "function", "s", "arguments", "Return", "list", "with", "separators", "(", ")", "formatted", "for", "calltips" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/dochelpers.py#L270-L292
train
Get the names and default values of a function s arguments Return list with separators ( ', ) formatted for calltips
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
spyder-ide/spyder-kernels
spyder_kernels/utils/dochelpers.py
isdefined
def isdefined(obj, force_import=False, namespace=None): """Return True if object is defined in namespace If namespace is None --> namespace = locals()""" if namespace is None: namespace = locals() attr_list = obj.split('.') base = attr_list.pop(0) if len(base) == 0: return False ...
python
def isdefined(obj, force_import=False, namespace=None): """Return True if object is defined in namespace If namespace is None --> namespace = locals()""" if namespace is None: namespace = locals() attr_list = obj.split('.') base = attr_list.pop(0) if len(base) == 0: return False ...
[ "def", "isdefined", "(", "obj", ",", "force_import", "=", "False", ",", "namespace", "=", "None", ")", ":", "if", "namespace", "is", "None", ":", "namespace", "=", "locals", "(", ")", "attr_list", "=", "obj", ".", "split", "(", "'.'", ")", "base", "=...
Return True if object is defined in namespace If namespace is None --> namespace = locals()
[ "Return", "True", "if", "object", "is", "defined", "in", "namespace", "If", "namespace", "is", "None", "--", ">", "namespace", "=", "locals", "()" ]
2c5b36cdb797b8aba77bc406ca96f5e079c4aaca
https://github.com/spyder-ide/spyder-kernels/blob/2c5b36cdb797b8aba77bc406ca96f5e079c4aaca/spyder_kernels/utils/dochelpers.py#L295-L329
train
Return True if object is defined in namespace
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
swift-nav/libsbp
python/sbp/client/drivers/file_driver.py
FileDriver.read
def read(self, size): """ Read wrapper. Parameters ---------- size : int Number of bytes to read. """ return_val = self.handle.read(size) if not return_val: raise IOError else: return return_val
python
def read(self, size): """ Read wrapper. Parameters ---------- size : int Number of bytes to read. """ return_val = self.handle.read(size) if not return_val: raise IOError else: return return_val
[ "def", "read", "(", "self", ",", "size", ")", ":", "return_val", "=", "self", ".", "handle", ".", "read", "(", "size", ")", "if", "not", "return_val", ":", "raise", "IOError", "else", ":", "return", "return_val" ]
Read wrapper. Parameters ---------- size : int Number of bytes to read.
[ "Read", "wrapper", "." ]
5a950608506b23e31b73ef7065da905b646055c1
https://github.com/swift-nav/libsbp/blob/5a950608506b23e31b73ef7065da905b646055c1/python/sbp/client/drivers/file_driver.py#L25-L38
train
Reads the n bytes from the file and returns it.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
swift-nav/libsbp
generator/sbpg/targets/latex.py
escape_tex
def escape_tex(value): """ Make text tex safe """ newval = value for pattern, replacement in LATEX_SUBS: newval = pattern.sub(replacement, newval) return newval
python
def escape_tex(value): """ Make text tex safe """ newval = value for pattern, replacement in LATEX_SUBS: newval = pattern.sub(replacement, newval) return newval
[ "def", "escape_tex", "(", "value", ")", ":", "newval", "=", "value", "for", "pattern", ",", "replacement", "in", "LATEX_SUBS", ":", "newval", "=", "pattern", ".", "sub", "(", "replacement", ",", "newval", ")", "return", "newval" ]
Make text tex safe
[ "Make", "text", "tex", "safe" ]
5a950608506b23e31b73ef7065da905b646055c1
https://github.com/swift-nav/libsbp/blob/5a950608506b23e31b73ef7065da905b646055c1/generator/sbpg/targets/latex.py#L55-L62
train
Escape a text tex safe value.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...