partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
test
InteractiveShell.register_post_execute
Register a function for calling after code execution.
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def register_post_execute(self, func): """Register a function for calling after code execution. """ if not callable(func): raise ValueError('argument %s must be callable' % func) self._post_execute[func] = True
def register_post_execute(self, func): """Register a function for calling after code execution. """ if not callable(func): raise ValueError('argument %s must be callable' % func) self._post_execute[func] = True
[ "Register", "a", "function", "for", "calling", "after", "code", "execution", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L786-L791
[ "def", "register_post_execute", "(", "self", ",", "func", ")", ":", "if", "not", "callable", "(", "func", ")", ":", "raise", "ValueError", "(", "'argument %s must be callable'", "%", "func", ")", "self", ".", "_post_execute", "[", "func", "]", "=", "True" ]
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.new_main_mod
Return a new 'main' module object for user code execution.
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def new_main_mod(self,ns=None): """Return a new 'main' module object for user code execution. """ main_mod = self._user_main_module init_fakemod_dict(main_mod,ns) return main_mod
def new_main_mod(self,ns=None): """Return a new 'main' module object for user code execution. """ main_mod = self._user_main_module init_fakemod_dict(main_mod,ns) return main_mod
[ "Return", "a", "new", "main", "module", "object", "for", "user", "code", "execution", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L797-L802
[ "def", "new_main_mod", "(", "self", ",", "ns", "=", "None", ")", ":", "main_mod", "=", "self", ".", "_user_main_module", "init_fakemod_dict", "(", "main_mod", ",", "ns", ")", "return", "main_mod" ]
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.cache_main_mod
Cache a main module's namespace. When scripts are executed via %run, we must keep a reference to the namespace of their __main__ module (a FakeModule instance) around so that Python doesn't clear it, rendering objects defined therein useless. This method keeps said reference in...
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def cache_main_mod(self,ns,fname): """Cache a main module's namespace. When scripts are executed via %run, we must keep a reference to the namespace of their __main__ module (a FakeModule instance) around so that Python doesn't clear it, rendering objects defined therein useless...
def cache_main_mod(self,ns,fname): """Cache a main module's namespace. When scripts are executed via %run, we must keep a reference to the namespace of their __main__ module (a FakeModule instance) around so that Python doesn't clear it, rendering objects defined therein useless...
[ "Cache", "a", "main", "module", "s", "namespace", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L804-L843
[ "def", "cache_main_mod", "(", "self", ",", "ns", ",", "fname", ")", ":", "self", ".", "_main_ns_cache", "[", "os", ".", "path", ".", "abspath", "(", "fname", ")", "]", "=", "ns", ".", "copy", "(", ")" ]
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.debugger
Call the pydb/pdb debugger. Keywords: - force(False): by default, this routine checks the instance call_pdb flag and does not actually invoke the debugger if the flag is false. The 'force' option forces the debugger to activate even if the flag is false.
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def debugger(self,force=False): """Call the pydb/pdb debugger. Keywords: - force(False): by default, this routine checks the instance call_pdb flag and does not actually invoke the debugger if the flag is false. The 'force' option forces the debugger to activate even if t...
def debugger(self,force=False): """Call the pydb/pdb debugger. Keywords: - force(False): by default, this routine checks the instance call_pdb flag and does not actually invoke the debugger if the flag is false. The 'force' option forces the debugger to activate even if t...
[ "Call", "the", "pydb", "/", "pdb", "debugger", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L893-L919
[ "def", "debugger", "(", "self", ",", "force", "=", "False", ")", ":", "if", "not", "(", "force", "or", "self", ".", "call_pdb", ")", ":", "return", "if", "not", "hasattr", "(", "sys", ",", "'last_traceback'", ")", ":", "error", "(", "'No traceback has ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.prepare_user_module
Prepare the module and namespace in which user code will be run. When IPython is started normally, both parameters are None: a new module is created automatically, and its __dict__ used as the namespace. If only user_module is provided, its __dict__ is used as the namespace. ...
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def prepare_user_module(self, user_module=None, user_ns=None): """Prepare the module and namespace in which user code will be run. When IPython is started normally, both parameters are None: a new module is created automatically, and its __dict__ used as the namespace. ...
def prepare_user_module(self, user_module=None, user_ns=None): """Prepare the module and namespace in which user code will be run. When IPython is started normally, both parameters are None: a new module is created automatically, and its __dict__ used as the namespace. ...
[ "Prepare", "the", "module", "and", "namespace", "in", "which", "user", "code", "will", "be", "run", ".", "When", "IPython", "is", "started", "normally", "both", "parameters", "are", "None", ":", "a", "new", "module", "is", "created", "automatically", "and", ...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L1011-L1056
[ "def", "prepare_user_module", "(", "self", ",", "user_module", "=", "None", ",", "user_ns", "=", "None", ")", ":", "if", "user_module", "is", "None", "and", "user_ns", "is", "not", "None", ":", "user_ns", ".", "setdefault", "(", "\"__name__\"", ",", "\"__m...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.init_user_ns
Initialize all user-visible namespaces to their minimum defaults. Certain history lists are also initialized here, as they effectively act as user namespaces. Notes ----- All data structures here are only filled in, they are NOT reset by this method. If they were not e...
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def init_user_ns(self): """Initialize all user-visible namespaces to their minimum defaults. Certain history lists are also initialized here, as they effectively act as user namespaces. Notes ----- All data structures here are only filled in, they are NOT reset by this ...
def init_user_ns(self): """Initialize all user-visible namespaces to their minimum defaults. Certain history lists are also initialized here, as they effectively act as user namespaces. Notes ----- All data structures here are only filled in, they are NOT reset by this ...
[ "Initialize", "all", "user", "-", "visible", "namespaces", "to", "their", "minimum", "defaults", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L1078-L1143
[ "def", "init_user_ns", "(", "self", ")", ":", "# This function works in two parts: first we put a few things in", "# user_ns, and we sync that contents into user_ns_hidden so that these", "# initial variables aren't shown by %who. After the sync, we add the", "# rest of what we *do* want the user...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.all_ns_refs
Get a list of references to all the namespace dictionaries in which IPython might store a user-created object. Note that this does not include the displayhook, which also caches objects from the output.
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def all_ns_refs(self): """Get a list of references to all the namespace dictionaries in which IPython might store a user-created object. Note that this does not include the displayhook, which also caches objects from the output.""" return [self.user_ns, self.user_global_...
def all_ns_refs(self): """Get a list of references to all the namespace dictionaries in which IPython might store a user-created object. Note that this does not include the displayhook, which also caches objects from the output.""" return [self.user_ns, self.user_global_...
[ "Get", "a", "list", "of", "references", "to", "all", "the", "namespace", "dictionaries", "in", "which", "IPython", "might", "store", "a", "user", "-", "created", "object", ".", "Note", "that", "this", "does", "not", "include", "the", "displayhook", "which", ...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L1146-L1153
[ "def", "all_ns_refs", "(", "self", ")", ":", "return", "[", "self", ".", "user_ns", ",", "self", ".", "user_global_ns", ",", "self", ".", "_user_main_module", ".", "__dict__", "]", "+", "self", ".", "_main_ns_cache", ".", "values", "(", ")" ]
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.reset
Clear all internal namespaces, and attempt to release references to user objects. If new_session is True, a new history session will be opened.
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def reset(self, new_session=True): """Clear all internal namespaces, and attempt to release references to user objects. If new_session is True, a new history session will be opened. """ # Clear histories self.history_manager.reset(new_session) # Reset counter use...
def reset(self, new_session=True): """Clear all internal namespaces, and attempt to release references to user objects. If new_session is True, a new history session will be opened. """ # Clear histories self.history_manager.reset(new_session) # Reset counter use...
[ "Clear", "all", "internal", "namespaces", "and", "attempt", "to", "release", "references", "to", "user", "objects", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L1155-L1198
[ "def", "reset", "(", "self", ",", "new_session", "=", "True", ")", ":", "# Clear histories", "self", ".", "history_manager", ".", "reset", "(", "new_session", ")", "# Reset counter used to index all histories", "if", "new_session", ":", "self", ".", "execution_count...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.del_var
Delete a variable from the various namespaces, so that, as far as possible, we're not keeping any hidden references to it. Parameters ---------- varname : str The name of the variable to delete. by_name : bool If True, delete variables with the given name...
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def del_var(self, varname, by_name=False): """Delete a variable from the various namespaces, so that, as far as possible, we're not keeping any hidden references to it. Parameters ---------- varname : str The name of the variable to delete. by_name : bool ...
def del_var(self, varname, by_name=False): """Delete a variable from the various namespaces, so that, as far as possible, we're not keeping any hidden references to it. Parameters ---------- varname : str The name of the variable to delete. by_name : bool ...
[ "Delete", "a", "variable", "from", "the", "various", "namespaces", "so", "that", "as", "far", "as", "possible", "we", "re", "not", "keeping", "any", "hidden", "references", "to", "it", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L1200-L1239
[ "def", "del_var", "(", "self", ",", "varname", ",", "by_name", "=", "False", ")", ":", "if", "varname", "in", "(", "'__builtin__'", ",", "'__builtins__'", ")", ":", "raise", "ValueError", "(", "\"Refusing to delete %s\"", "%", "varname", ")", "ns_refs", "=",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.reset_selective
Clear selective variables from internal namespaces based on a specified regular expression. Parameters ---------- regex : string or compiled pattern, optional A regular expression pattern that will be used in searching variable names in the users namespaces.
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def reset_selective(self, regex=None): """Clear selective variables from internal namespaces based on a specified regular expression. Parameters ---------- regex : string or compiled pattern, optional A regular expression pattern that will be used in searching ...
def reset_selective(self, regex=None): """Clear selective variables from internal namespaces based on a specified regular expression. Parameters ---------- regex : string or compiled pattern, optional A regular expression pattern that will be used in searching ...
[ "Clear", "selective", "variables", "from", "internal", "namespaces", "based", "on", "a", "specified", "regular", "expression", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L1241-L1261
[ "def", "reset_selective", "(", "self", ",", "regex", "=", "None", ")", ":", "if", "regex", "is", "not", "None", ":", "try", ":", "m", "=", "re", ".", "compile", "(", "regex", ")", "except", "TypeError", ":", "raise", "TypeError", "(", "'regex must be a...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.push
Inject a group of variables into the IPython user namespace. Parameters ---------- variables : dict, str or list/tuple of str The variables to inject into the user's namespace. If a dict, a simple update is done. If a str, the string is assumed to have vari...
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def push(self, variables, interactive=True): """Inject a group of variables into the IPython user namespace. Parameters ---------- variables : dict, str or list/tuple of str The variables to inject into the user's namespace. If a dict, a simple update is done. ...
def push(self, variables, interactive=True): """Inject a group of variables into the IPython user namespace. Parameters ---------- variables : dict, str or list/tuple of str The variables to inject into the user's namespace. If a dict, a simple update is done. ...
[ "Inject", "a", "group", "of", "variables", "into", "the", "IPython", "user", "namespace", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L1263-L1308
[ "def", "push", "(", "self", ",", "variables", ",", "interactive", "=", "True", ")", ":", "vdict", "=", "None", "# We need a dict of name/value pairs to do namespace updates.", "if", "isinstance", "(", "variables", ",", "dict", ")", ":", "vdict", "=", "variables", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.drop_by_id
Remove a dict of variables from the user namespace, if they are the same as the values in the dictionary. This is intended for use by extensions: variables that they've added can be taken back out if they are unloaded, without removing any that the user has overwritten. ...
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def drop_by_id(self, variables): """Remove a dict of variables from the user namespace, if they are the same as the values in the dictionary. This is intended for use by extensions: variables that they've added can be taken back out if they are unloaded, without removing any tha...
def drop_by_id(self, variables): """Remove a dict of variables from the user namespace, if they are the same as the values in the dictionary. This is intended for use by extensions: variables that they've added can be taken back out if they are unloaded, without removing any tha...
[ "Remove", "a", "dict", "of", "variables", "from", "the", "user", "namespace", "if", "they", "are", "the", "same", "as", "the", "values", "in", "the", "dictionary", ".", "This", "is", "intended", "for", "use", "by", "extensions", ":", "variables", "that", ...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L1310-L1326
[ "def", "drop_by_id", "(", "self", ",", "variables", ")", ":", "for", "name", ",", "obj", "in", "variables", ".", "iteritems", "(", ")", ":", "if", "name", "in", "self", ".", "user_ns", "and", "self", ".", "user_ns", "[", "name", "]", "is", "obj", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell._ofind
Find an object in the available namespaces. self._ofind(oname) -> dict with keys: found,obj,ospace,ismagic Has special code to detect magic functions.
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def _ofind(self, oname, namespaces=None): """Find an object in the available namespaces. self._ofind(oname) -> dict with keys: found,obj,ospace,ismagic Has special code to detect magic functions. """ oname = oname.strip() #print '1- oname: <%r>' % oname # dbg i...
def _ofind(self, oname, namespaces=None): """Find an object in the available namespaces. self._ofind(oname) -> dict with keys: found,obj,ospace,ismagic Has special code to detect magic functions. """ oname = oname.strip() #print '1- oname: <%r>' % oname # dbg i...
[ "Find", "an", "object", "in", "the", "available", "namespaces", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L1332-L1425
[ "def", "_ofind", "(", "self", ",", "oname", ",", "namespaces", "=", "None", ")", ":", "oname", "=", "oname", ".", "strip", "(", ")", "#print '1- oname: <%r>' % oname # dbg", "if", "not", "oname", ".", "startswith", "(", "ESC_MAGIC", ")", "and", "not", "on...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell._ofind_property
Second part of object finding, to look for property details.
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def _ofind_property(self, oname, info): """Second part of object finding, to look for property details.""" if info.found: # Get the docstring of the class property if it exists. path = oname.split('.') root = '.'.join(path[:-1]) if info.parent is not None:...
def _ofind_property(self, oname, info): """Second part of object finding, to look for property details.""" if info.found: # Get the docstring of the class property if it exists. path = oname.split('.') root = '.'.join(path[:-1]) if info.parent is not None:...
[ "Second", "part", "of", "object", "finding", "to", "look", "for", "property", "details", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L1427-L1448
[ "def", "_ofind_property", "(", "self", ",", "oname", ",", "info", ")", ":", "if", "info", ".", "found", ":", "# Get the docstring of the class property if it exists.", "path", "=", "oname", ".", "split", "(", "'.'", ")", "root", "=", "'.'", ".", "join", "(",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell._object_find
Find an object and return a struct with info about it.
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def _object_find(self, oname, namespaces=None): """Find an object and return a struct with info about it.""" inf = Struct(self._ofind(oname, namespaces)) return Struct(self._ofind_property(oname, inf))
def _object_find(self, oname, namespaces=None): """Find an object and return a struct with info about it.""" inf = Struct(self._ofind(oname, namespaces)) return Struct(self._ofind_property(oname, inf))
[ "Find", "an", "object", "and", "return", "a", "struct", "with", "info", "about", "it", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L1450-L1453
[ "def", "_object_find", "(", "self", ",", "oname", ",", "namespaces", "=", "None", ")", ":", "inf", "=", "Struct", "(", "self", ".", "_ofind", "(", "oname", ",", "namespaces", ")", ")", "return", "Struct", "(", "self", ".", "_ofind_property", "(", "onam...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell._inspect
Generic interface to the inspector system. This function is meant to be called by pdef, pdoc & friends.
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def _inspect(self, meth, oname, namespaces=None, **kw): """Generic interface to the inspector system. This function is meant to be called by pdef, pdoc & friends.""" info = self._object_find(oname, namespaces) if info.found: pmethod = getattr(self.inspector, meth) ...
def _inspect(self, meth, oname, namespaces=None, **kw): """Generic interface to the inspector system. This function is meant to be called by pdef, pdoc & friends.""" info = self._object_find(oname, namespaces) if info.found: pmethod = getattr(self.inspector, meth) ...
[ "Generic", "interface", "to", "the", "inspector", "system", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L1455-L1471
[ "def", "_inspect", "(", "self", ",", "meth", ",", "oname", ",", "namespaces", "=", "None", ",", "*", "*", "kw", ")", ":", "info", "=", "self", ".", "_object_find", "(", "oname", ",", "namespaces", ")", "if", "info", ".", "found", ":", "pmethod", "=...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.init_history
Sets up the command history, and starts regular autosaves.
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def init_history(self): """Sets up the command history, and starts regular autosaves.""" self.history_manager = HistoryManager(shell=self, config=self.config) self.configurables.append(self.history_manager)
def init_history(self): """Sets up the command history, and starts regular autosaves.""" self.history_manager = HistoryManager(shell=self, config=self.config) self.configurables.append(self.history_manager)
[ "Sets", "up", "the", "command", "history", "and", "starts", "regular", "autosaves", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L1487-L1490
[ "def", "init_history", "(", "self", ")", ":", "self", ".", "history_manager", "=", "HistoryManager", "(", "shell", "=", "self", ",", "config", "=", "self", ".", "config", ")", "self", ".", "configurables", ".", "append", "(", "self", ".", "history_manager"...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.set_custom_exc
set_custom_exc(exc_tuple,handler) Set a custom exception handler, which will be called if any of the exceptions in exc_tuple occur in the mainloop (specifically, in the run_code() method). Parameters ---------- exc_tuple : tuple of exception classes A *tupl...
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def set_custom_exc(self, exc_tuple, handler): """set_custom_exc(exc_tuple,handler) Set a custom exception handler, which will be called if any of the exceptions in exc_tuple occur in the mainloop (specifically, in the run_code() method). Parameters ---------- e...
def set_custom_exc(self, exc_tuple, handler): """set_custom_exc(exc_tuple,handler) Set a custom exception handler, which will be called if any of the exceptions in exc_tuple occur in the mainloop (specifically, in the run_code() method). Parameters ---------- e...
[ "set_custom_exc", "(", "exc_tuple", "handler", ")" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L1519-L1619
[ "def", "set_custom_exc", "(", "self", ",", "exc_tuple", ",", "handler", ")", ":", "assert", "type", "(", "exc_tuple", ")", "==", "type", "(", "(", ")", ")", ",", "\"The custom exceptions must be given AS A TUPLE.\"", "def", "dummy_handler", "(", "self", ",", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.excepthook
One more defense for GUI apps that call sys.excepthook. GUI frameworks like wxPython trap exceptions and call sys.excepthook themselves. I guess this is a feature that enables them to keep running after exceptions that would otherwise kill their mainloop. This is a bother for IPython whi...
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def excepthook(self, etype, value, tb): """One more defense for GUI apps that call sys.excepthook. GUI frameworks like wxPython trap exceptions and call sys.excepthook themselves. I guess this is a feature that enables them to keep running after exceptions that would otherwise kill their...
def excepthook(self, etype, value, tb): """One more defense for GUI apps that call sys.excepthook. GUI frameworks like wxPython trap exceptions and call sys.excepthook themselves. I guess this is a feature that enables them to keep running after exceptions that would otherwise kill their...
[ "One", "more", "defense", "for", "GUI", "apps", "that", "call", "sys", ".", "excepthook", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L1621-L1643
[ "def", "excepthook", "(", "self", ",", "etype", ",", "value", ",", "tb", ")", ":", "self", ".", "showtraceback", "(", "(", "etype", ",", "value", ",", "tb", ")", ",", "tb_offset", "=", "0", ")" ]
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell._get_exc_info
get exc_info from a given tuple, sys.exc_info() or sys.last_type etc. Ensures sys.last_type,value,traceback hold the exc_info we found, from whichever source. raises ValueError if none of these contain any information
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def _get_exc_info(self, exc_tuple=None): """get exc_info from a given tuple, sys.exc_info() or sys.last_type etc. Ensures sys.last_type,value,traceback hold the exc_info we found, from whichever source. raises ValueError if none of these contain any information ...
def _get_exc_info(self, exc_tuple=None): """get exc_info from a given tuple, sys.exc_info() or sys.last_type etc. Ensures sys.last_type,value,traceback hold the exc_info we found, from whichever source. raises ValueError if none of these contain any information ...
[ "get", "exc_info", "from", "a", "given", "tuple", "sys", ".", "exc_info", "()", "or", "sys", ".", "last_type", "etc", ".", "Ensures", "sys", ".", "last_type", "value", "traceback", "hold", "the", "exc_info", "we", "found", "from", "whichever", "source", "....
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L1645-L1675
[ "def", "_get_exc_info", "(", "self", ",", "exc_tuple", "=", "None", ")", ":", "if", "exc_tuple", "is", "None", ":", "etype", ",", "value", ",", "tb", "=", "sys", ".", "exc_info", "(", ")", "else", ":", "etype", ",", "value", ",", "tb", "=", "exc_tu...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.showtraceback
Display the exception that just occurred. If nothing is known about the exception, this is the method which should be used throughout the code for presenting user tracebacks, rather than directly invoking the InteractiveTB object. A specific showsyntaxerror() also exists, but this meth...
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None, exception_only=False): """Display the exception that just occurred. If nothing is known about the exception, this is the method which should be used throughout the code for presenting user tracebacks, ...
def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None, exception_only=False): """Display the exception that just occurred. If nothing is known about the exception, this is the method which should be used throughout the code for presenting user tracebacks, ...
[ "Display", "the", "exception", "that", "just", "occurred", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L1678-L1730
[ "def", "showtraceback", "(", "self", ",", "exc_tuple", "=", "None", ",", "filename", "=", "None", ",", "tb_offset", "=", "None", ",", "exception_only", "=", "False", ")", ":", "try", ":", "try", ":", "etype", ",", "value", ",", "tb", "=", "self", "."...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell._showtraceback
Actually show a traceback. Subclasses may override this method to put the traceback on a different place, like a side channel.
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def _showtraceback(self, etype, evalue, stb): """Actually show a traceback. Subclasses may override this method to put the traceback on a different place, like a side channel. """ print >> io.stdout, self.InteractiveTB.stb2text(stb)
def _showtraceback(self, etype, evalue, stb): """Actually show a traceback. Subclasses may override this method to put the traceback on a different place, like a side channel. """ print >> io.stdout, self.InteractiveTB.stb2text(stb)
[ "Actually", "show", "a", "traceback", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L1732-L1738
[ "def", "_showtraceback", "(", "self", ",", "etype", ",", "evalue", ",", "stb", ")", ":", "print", ">>", "io", ".", "stdout", ",", "self", ".", "InteractiveTB", ".", "stb2text", "(", "stb", ")" ]
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.showsyntaxerror
Display the syntax error that just occurred. This doesn't display a stack trace because there isn't one. If a filename is given, it is stuffed in the exception instead of what was there before (because Python's parser always uses "<string>" when reading from a string).
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def showsyntaxerror(self, filename=None): """Display the syntax error that just occurred. This doesn't display a stack trace because there isn't one. If a filename is given, it is stuffed in the exception instead of what was there before (because Python's parser always uses "<s...
def showsyntaxerror(self, filename=None): """Display the syntax error that just occurred. This doesn't display a stack trace because there isn't one. If a filename is given, it is stuffed in the exception instead of what was there before (because Python's parser always uses "<s...
[ "Display", "the", "syntax", "error", "that", "just", "occurred", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L1740-L1759
[ "def", "showsyntaxerror", "(", "self", ",", "filename", "=", "None", ")", ":", "etype", ",", "value", ",", "last_traceback", "=", "self", ".", "_get_exc_info", "(", ")", "if", "filename", "and", "etype", "is", "SyntaxError", ":", "try", ":", "value", "."...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.init_readline
Command history completion/saving/reloading.
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def init_readline(self): """Command history completion/saving/reloading.""" if self.readline_use: import IPython.utils.rlineimpl as readline self.rl_next_input = None self.rl_do_indent = False if not self.readline_use or not readline.have_readline: self...
def init_readline(self): """Command history completion/saving/reloading.""" if self.readline_use: import IPython.utils.rlineimpl as readline self.rl_next_input = None self.rl_do_indent = False if not self.readline_use or not readline.have_readline: self...
[ "Command", "history", "completion", "/", "saving", "/", "reloading", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L1775-L1847
[ "def", "init_readline", "(", "self", ")", ":", "if", "self", ".", "readline_use", ":", "import", "IPython", ".", "utils", ".", "rlineimpl", "as", "readline", "self", ".", "rl_next_input", "=", "None", "self", ".", "rl_do_indent", "=", "False", "if", "not",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.pre_readline
readline hook to be used at the start of each line. Currently it handles auto-indent only.
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def pre_readline(self): """readline hook to be used at the start of each line. Currently it handles auto-indent only.""" if self.rl_do_indent: self.readline.insert_text(self._indent_current_str()) if self.rl_next_input is not None: self.readline.insert_text(self...
def pre_readline(self): """readline hook to be used at the start of each line. Currently it handles auto-indent only.""" if self.rl_do_indent: self.readline.insert_text(self._indent_current_str()) if self.rl_next_input is not None: self.readline.insert_text(self...
[ "readline", "hook", "to", "be", "used", "at", "the", "start", "of", "each", "line", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L1881-L1890
[ "def", "pre_readline", "(", "self", ")", ":", "if", "self", ".", "rl_do_indent", ":", "self", ".", "readline", ".", "insert_text", "(", "self", ".", "_indent_current_str", "(", ")", ")", "if", "self", ".", "rl_next_input", "is", "not", "None", ":", "self...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.init_completer
Initialize the completion machinery. This creates completion machinery that can be used by client code, either interactively in-process (typically triggered by the readline library), programatically (such as in test suites) or out-of-prcess (typically over the network by remote frontend...
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def init_completer(self): """Initialize the completion machinery. This creates completion machinery that can be used by client code, either interactively in-process (typically triggered by the readline library), programatically (such as in test suites) or out-of-prcess (typicall...
def init_completer(self): """Initialize the completion machinery. This creates completion machinery that can be used by client code, either interactively in-process (typically triggered by the readline library), programatically (such as in test suites) or out-of-prcess (typicall...
[ "Initialize", "the", "completion", "machinery", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L1900-L1936
[ "def", "init_completer", "(", "self", ")", ":", "from", "IPython", ".", "core", ".", "completer", "import", "IPCompleter", "from", "IPython", ".", "core", ".", "completerlib", "import", "(", "module_completer", ",", "magic_run_completer", ",", "cd_completer", ",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.complete
Return the completed text and a list of completions. Parameters ---------- text : string A string of text to be completed on. It can be given as empty and instead a line/position pair are given. In this case, the completer itself will split the line ...
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def complete(self, text, line=None, cursor_pos=None): """Return the completed text and a list of completions. Parameters ---------- text : string A string of text to be completed on. It can be given as empty and instead a line/position pair are given. In ...
def complete(self, text, line=None, cursor_pos=None): """Return the completed text and a list of completions. Parameters ---------- text : string A string of text to be completed on. It can be given as empty and instead a line/position pair are given. In ...
[ "Return", "the", "completed", "text", "and", "a", "list", "of", "completions", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L1938-L1981
[ "def", "complete", "(", "self", ",", "text", ",", "line", "=", "None", ",", "cursor_pos", "=", "None", ")", ":", "# Inject names into __builtin__ so we can complete on the added names.", "with", "self", ".", "builtin_trap", ":", "return", "self", ".", "Completer", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.set_custom_completer
Adds a new custom completer function. The position argument (defaults to 0) is the index in the completers list where you want the completer to be inserted.
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def set_custom_completer(self, completer, pos=0): """Adds a new custom completer function. The position argument (defaults to 0) is the index in the completers list where you want the completer to be inserted.""" newcomp = types.MethodType(completer,self.Completer) self.Complet...
def set_custom_completer(self, completer, pos=0): """Adds a new custom completer function. The position argument (defaults to 0) is the index in the completers list where you want the completer to be inserted.""" newcomp = types.MethodType(completer,self.Completer) self.Complet...
[ "Adds", "a", "new", "custom", "completer", "function", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L1983-L1990
[ "def", "set_custom_completer", "(", "self", ",", "completer", ",", "pos", "=", "0", ")", ":", "newcomp", "=", "types", ".", "MethodType", "(", "completer", ",", "self", ".", "Completer", ")", "self", ".", "Completer", ".", "matchers", ".", "insert", "(",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.set_completer_frame
Set the frame of the completer.
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def set_completer_frame(self, frame=None): """Set the frame of the completer.""" if frame: self.Completer.namespace = frame.f_locals self.Completer.global_namespace = frame.f_globals else: self.Completer.namespace = self.user_ns self.Completer.glob...
def set_completer_frame(self, frame=None): """Set the frame of the completer.""" if frame: self.Completer.namespace = frame.f_locals self.Completer.global_namespace = frame.f_globals else: self.Completer.namespace = self.user_ns self.Completer.glob...
[ "Set", "the", "frame", "of", "the", "completer", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L1996-L2003
[ "def", "set_completer_frame", "(", "self", ",", "frame", "=", "None", ")", ":", "if", "frame", ":", "self", ".", "Completer", ".", "namespace", "=", "frame", ".", "f_locals", "self", ".", "Completer", ".", "global_namespace", "=", "frame", ".", "f_globals"...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.run_line_magic
Execute the given line magic. Parameters ---------- magic_name : str Name of the desired magic function, without '%' prefix. line : str The rest of the input line as a single string.
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def run_line_magic(self, magic_name, line): """Execute the given line magic. Parameters ---------- magic_name : str Name of the desired magic function, without '%' prefix. line : str The rest of the input line as a single string. """ fn = sel...
def run_line_magic(self, magic_name, line): """Execute the given line magic. Parameters ---------- magic_name : str Name of the desired magic function, without '%' prefix. line : str The rest of the input line as a single string. """ fn = sel...
[ "Execute", "the", "given", "line", "magic", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L2032-L2063
[ "def", "run_line_magic", "(", "self", ",", "magic_name", ",", "line", ")", ":", "fn", "=", "self", ".", "find_line_magic", "(", "magic_name", ")", "if", "fn", "is", "None", ":", "cm", "=", "self", ".", "find_cell_magic", "(", "magic_name", ")", "etpl", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.run_cell_magic
Execute the given cell magic. Parameters ---------- magic_name : str Name of the desired magic function, without '%' prefix. line : str The rest of the first input line as a single string. cell : str The body of the cell as a (possibly mul...
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def run_cell_magic(self, magic_name, line, cell): """Execute the given cell magic. Parameters ---------- magic_name : str Name of the desired magic function, without '%' prefix. line : str The rest of the first input line as a single string. ...
def run_cell_magic(self, magic_name, line, cell): """Execute the given cell magic. Parameters ---------- magic_name : str Name of the desired magic function, without '%' prefix. line : str The rest of the first input line as a single string. ...
[ "Execute", "the", "given", "cell", "magic", ".", "Parameters", "----------", "magic_name", ":", "str", "Name", "of", "the", "desired", "magic", "function", "without", "%", "prefix", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L2065-L2094
[ "def", "run_cell_magic", "(", "self", ",", "magic_name", ",", "line", ",", "cell", ")", ":", "fn", "=", "self", ".", "find_cell_magic", "(", "magic_name", ")", "if", "fn", "is", "None", ":", "lm", "=", "self", ".", "find_line_magic", "(", "magic_name", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.find_magic
Find and return a magic of the given type by name. Returns None if the magic isn't found.
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def find_magic(self, magic_name, magic_kind='line'): """Find and return a magic of the given type by name. Returns None if the magic isn't found.""" return self.magics_manager.magics[magic_kind].get(magic_name)
def find_magic(self, magic_name, magic_kind='line'): """Find and return a magic of the given type by name. Returns None if the magic isn't found.""" return self.magics_manager.magics[magic_kind].get(magic_name)
[ "Find", "and", "return", "a", "magic", "of", "the", "given", "type", "by", "name", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L2108-L2112
[ "def", "find_magic", "(", "self", ",", "magic_name", ",", "magic_kind", "=", "'line'", ")", ":", "return", "self", ".", "magics_manager", ".", "magics", "[", "magic_kind", "]", ".", "get", "(", "magic_name", ")" ]
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.magic
DEPRECATED. Use run_line_magic() instead. Call a magic function by name. Input: a string containing the name of the magic function to call and any additional arguments to be passed to the magic. magic('name -opt foo bar') is equivalent to typing at the ipython prompt: ...
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def magic(self, arg_s): """DEPRECATED. Use run_line_magic() instead. Call a magic function by name. Input: a string containing the name of the magic function to call and any additional arguments to be passed to the magic. magic('name -opt foo bar') is equivalent to typing at t...
def magic(self, arg_s): """DEPRECATED. Use run_line_magic() instead. Call a magic function by name. Input: a string containing the name of the magic function to call and any additional arguments to be passed to the magic. magic('name -opt foo bar') is equivalent to typing at t...
[ "DEPRECATED", ".", "Use", "run_line_magic", "()", "instead", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L2114-L2136
[ "def", "magic", "(", "self", ",", "arg_s", ")", ":", "# TODO: should we issue a loud deprecation warning here?", "magic_name", ",", "_", ",", "magic_arg_s", "=", "arg_s", ".", "partition", "(", "' '", ")", "magic_name", "=", "magic_name", ".", "lstrip", "(", "pr...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.define_macro
Define a new macro Parameters ---------- name : str The name of the macro. themacro : str or Macro The action to do upon invoking the macro. If a string, a new Macro object is created by passing the string to it.
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def define_macro(self, name, themacro): """Define a new macro Parameters ---------- name : str The name of the macro. themacro : str or Macro The action to do upon invoking the macro. If a string, a new Macro object is created by passing the ...
def define_macro(self, name, themacro): """Define a new macro Parameters ---------- name : str The name of the macro. themacro : str or Macro The action to do upon invoking the macro. If a string, a new Macro object is created by passing the ...
[ "Define", "a", "new", "macro" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L2142-L2160
[ "def", "define_macro", "(", "self", ",", "name", ",", "themacro", ")", ":", "from", "IPython", ".", "core", "import", "macro", "if", "isinstance", "(", "themacro", ",", "basestring", ")", ":", "themacro", "=", "macro", ".", "Macro", "(", "themacro", ")",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.system_raw
Call the given cmd in a subprocess using os.system Parameters ---------- cmd : str Command to execute.
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def system_raw(self, cmd): """Call the given cmd in a subprocess using os.system Parameters ---------- cmd : str Command to execute. """ cmd = self.var_expand(cmd, depth=1) # protect os.system from UNC paths on Windows, which it can't handle: if...
def system_raw(self, cmd): """Call the given cmd in a subprocess using os.system Parameters ---------- cmd : str Command to execute. """ cmd = self.var_expand(cmd, depth=1) # protect os.system from UNC paths on Windows, which it can't handle: if...
[ "Call", "the", "given", "cmd", "in", "a", "subprocess", "using", "os", ".", "system" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L2189-L2213
[ "def", "system_raw", "(", "self", ",", "cmd", ")", ":", "cmd", "=", "self", ".", "var_expand", "(", "cmd", ",", "depth", "=", "1", ")", "# protect os.system from UNC paths on Windows, which it can't handle:", "if", "sys", ".", "platform", "==", "'win32'", ":", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.getoutput
Get output (possibly including stderr) from a subprocess. Parameters ---------- cmd : str Command to execute (can not end in '&', as background processes are not supported. split : bool, optional If True, split the output into an IPython SList. Otherwise, ...
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def getoutput(self, cmd, split=True, depth=0): """Get output (possibly including stderr) from a subprocess. Parameters ---------- cmd : str Command to execute (can not end in '&', as background processes are not supported. split : bool, optional If ...
def getoutput(self, cmd, split=True, depth=0): """Get output (possibly including stderr) from a subprocess. Parameters ---------- cmd : str Command to execute (can not end in '&', as background processes are not supported. split : bool, optional If ...
[ "Get", "output", "(", "possibly", "including", "stderr", ")", "from", "a", "subprocess", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L2218-L2245
[ "def", "getoutput", "(", "self", ",", "cmd", ",", "split", "=", "True", ",", "depth", "=", "0", ")", ":", "if", "cmd", ".", "rstrip", "(", ")", ".", "endswith", "(", "'&'", ")", ":", "# this is *far* from a rigorous test", "raise", "OSError", "(", "\"B...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.auto_rewrite_input
Print to the screen the rewritten form of the user's command. This shows visual feedback by rewriting input lines that cause automatic calling to kick in, like:: /f x into:: ------> f(x) after the user's input prompt. This helps the user understand that the ...
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def auto_rewrite_input(self, cmd): """Print to the screen the rewritten form of the user's command. This shows visual feedback by rewriting input lines that cause automatic calling to kick in, like:: /f x into:: ------> f(x) after the user's input prompt....
def auto_rewrite_input(self, cmd): """Print to the screen the rewritten form of the user's command. This shows visual feedback by rewriting input lines that cause automatic calling to kick in, like:: /f x into:: ------> f(x) after the user's input prompt....
[ "Print", "to", "the", "screen", "the", "rewritten", "form", "of", "the", "user", "s", "command", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L2289-L2315
[ "def", "auto_rewrite_input", "(", "self", ",", "cmd", ")", ":", "if", "not", "self", ".", "show_rewritten_input", ":", "return", "rw", "=", "self", ".", "prompt_manager", ".", "render", "(", "'rewrite'", ")", "+", "cmd", "try", ":", "# plain ascii works bett...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.user_variables
Get a list of variable names from the user's namespace. Parameters ---------- names : list of strings A list of names of variables to be read from the user namespace. Returns ------- A dict, keyed by the input names and with the repr() of each value.
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def user_variables(self, names): """Get a list of variable names from the user's namespace. Parameters ---------- names : list of strings A list of names of variables to be read from the user namespace. Returns ------- A dict, keyed by the input names ...
def user_variables(self, names): """Get a list of variable names from the user's namespace. Parameters ---------- names : list of strings A list of names of variables to be read from the user namespace. Returns ------- A dict, keyed by the input names ...
[ "Get", "a", "list", "of", "variable", "names", "from", "the", "user", "s", "namespace", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L2325-L2345
[ "def", "user_variables", "(", "self", ",", "names", ")", ":", "out", "=", "{", "}", "user_ns", "=", "self", ".", "user_ns", "for", "varname", "in", "names", ":", "try", ":", "value", "=", "repr", "(", "user_ns", "[", "varname", "]", ")", "except", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.user_expressions
Evaluate a dict of expressions in the user's namespace. Parameters ---------- expressions : dict A dict with string keys and string values. The expression values should be valid Python expressions, each of which will be evaluated in the user namespace. Re...
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def user_expressions(self, expressions): """Evaluate a dict of expressions in the user's namespace. Parameters ---------- expressions : dict A dict with string keys and string values. The expression values should be valid Python expressions, each of which will be ev...
def user_expressions(self, expressions): """Evaluate a dict of expressions in the user's namespace. Parameters ---------- expressions : dict A dict with string keys and string values. The expression values should be valid Python expressions, each of which will be ev...
[ "Evaluate", "a", "dict", "of", "expressions", "in", "the", "user", "s", "namespace", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L2347-L2371
[ "def", "user_expressions", "(", "self", ",", "expressions", ")", ":", "out", "=", "{", "}", "user_ns", "=", "self", ".", "user_ns", "global_ns", "=", "self", ".", "user_global_ns", "for", "key", ",", "expr", "in", "expressions", ".", "iteritems", "(", ")...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.ex
Execute a normal python statement in user namespace.
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def ex(self, cmd): """Execute a normal python statement in user namespace.""" with self.builtin_trap: exec cmd in self.user_global_ns, self.user_ns
def ex(self, cmd): """Execute a normal python statement in user namespace.""" with self.builtin_trap: exec cmd in self.user_global_ns, self.user_ns
[ "Execute", "a", "normal", "python", "statement", "in", "user", "namespace", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L2377-L2380
[ "def", "ex", "(", "self", ",", "cmd", ")", ":", "with", "self", ".", "builtin_trap", ":", "exec", "cmd", "in", "self", ".", "user_global_ns", ",", "self", ".", "user_ns" ]
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.ev
Evaluate python expression expr in user namespace. Returns the result of evaluation
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def ev(self, expr): """Evaluate python expression expr in user namespace. Returns the result of evaluation """ with self.builtin_trap: return eval(expr, self.user_global_ns, self.user_ns)
def ev(self, expr): """Evaluate python expression expr in user namespace. Returns the result of evaluation """ with self.builtin_trap: return eval(expr, self.user_global_ns, self.user_ns)
[ "Evaluate", "python", "expression", "expr", "in", "user", "namespace", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L2382-L2388
[ "def", "ev", "(", "self", ",", "expr", ")", ":", "with", "self", ".", "builtin_trap", ":", "return", "eval", "(", "expr", ",", "self", ".", "user_global_ns", ",", "self", ".", "user_ns", ")" ]
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.safe_execfile
A safe version of the builtin execfile(). This version will never throw an exception, but instead print helpful error messages to the screen. This only works on pure Python files with the .py extension. Parameters ---------- fname : string The name of the f...
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def safe_execfile(self, fname, *where, **kw): """A safe version of the builtin execfile(). This version will never throw an exception, but instead print helpful error messages to the screen. This only works on pure Python files with the .py extension. Parameters ------...
def safe_execfile(self, fname, *where, **kw): """A safe version of the builtin execfile(). This version will never throw an exception, but instead print helpful error messages to the screen. This only works on pure Python files with the .py extension. Parameters ------...
[ "A", "safe", "version", "of", "the", "builtin", "execfile", "()", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L2390-L2449
[ "def", "safe_execfile", "(", "self", ",", "fname", ",", "*", "where", ",", "*", "*", "kw", ")", ":", "kw", ".", "setdefault", "(", "'exit_ignore'", ",", "False", ")", "kw", ".", "setdefault", "(", "'raise_exceptions'", ",", "False", ")", "fname", "=", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.safe_execfile_ipy
Like safe_execfile, but for .ipy files with IPython syntax. Parameters ---------- fname : str The name of the file to execute. The filename must have a .ipy extension.
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def safe_execfile_ipy(self, fname): """Like safe_execfile, but for .ipy files with IPython syntax. Parameters ---------- fname : str The name of the file to execute. The filename must have a .ipy extension. """ fname = os.path.abspath(os.path.exp...
def safe_execfile_ipy(self, fname): """Like safe_execfile, but for .ipy files with IPython syntax. Parameters ---------- fname : str The name of the file to execute. The filename must have a .ipy extension. """ fname = os.path.abspath(os.path.exp...
[ "Like", "safe_execfile", "but", "for", ".", "ipy", "files", "with", "IPython", "syntax", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L2451-L2485
[ "def", "safe_execfile_ipy", "(", "self", ",", "fname", ")", ":", "fname", "=", "os", ".", "path", ".", "abspath", "(", "os", ".", "path", ".", "expanduser", "(", "fname", ")", ")", "# Make sure we can open the file", "try", ":", "with", "open", "(", "fna...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.safe_run_module
A safe version of runpy.run_module(). This version will never throw an exception, but instead print helpful error messages to the screen. Parameters ---------- mod_name : string The name of the module to be executed. where : dict The globals name...
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def safe_run_module(self, mod_name, where): """A safe version of runpy.run_module(). This version will never throw an exception, but instead print helpful error messages to the screen. Parameters ---------- mod_name : string The name of the module to be exec...
def safe_run_module(self, mod_name, where): """A safe version of runpy.run_module(). This version will never throw an exception, but instead print helpful error messages to the screen. Parameters ---------- mod_name : string The name of the module to be exec...
[ "A", "safe", "version", "of", "runpy", ".", "run_module", "()", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L2487-L2507
[ "def", "safe_run_module", "(", "self", ",", "mod_name", ",", "where", ")", ":", "try", ":", "where", ".", "update", "(", "runpy", ".", "run_module", "(", "str", "(", "mod_name", ")", ",", "run_name", "=", "\"__main__\"", ",", "alter_sys", "=", "True", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell._run_cached_cell_magic
Special method to call a cell magic with the data stored in self.
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def _run_cached_cell_magic(self, magic_name, line): """Special method to call a cell magic with the data stored in self. """ cell = self._current_cell_magic_body self._current_cell_magic_body = None return self.run_cell_magic(magic_name, line, cell)
def _run_cached_cell_magic(self, magic_name, line): """Special method to call a cell magic with the data stored in self. """ cell = self._current_cell_magic_body self._current_cell_magic_body = None return self.run_cell_magic(magic_name, line, cell)
[ "Special", "method", "to", "call", "a", "cell", "magic", "with", "the", "data", "stored", "in", "self", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L2509-L2514
[ "def", "_run_cached_cell_magic", "(", "self", ",", "magic_name", ",", "line", ")", ":", "cell", "=", "self", ".", "_current_cell_magic_body", "self", ".", "_current_cell_magic_body", "=", "None", "return", "self", ".", "run_cell_magic", "(", "magic_name", ",", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.run_cell
Run a complete IPython cell. Parameters ---------- raw_cell : str The code (including IPython code such as %magic functions) to run. store_history : bool If True, the raw and translated cell will be stored in IPython's history. For user code calling back in...
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def run_cell(self, raw_cell, store_history=False, silent=False): """Run a complete IPython cell. Parameters ---------- raw_cell : str The code (including IPython code such as %magic functions) to run. store_history : bool If True, the raw and translated cell ...
def run_cell(self, raw_cell, store_history=False, silent=False): """Run a complete IPython cell. Parameters ---------- raw_cell : str The code (including IPython code such as %magic functions) to run. store_history : bool If True, the raw and translated cell ...
[ "Run", "a", "complete", "IPython", "cell", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L2516-L2621
[ "def", "run_cell", "(", "self", ",", "raw_cell", ",", "store_history", "=", "False", ",", "silent", "=", "False", ")", ":", "if", "(", "not", "raw_cell", ")", "or", "raw_cell", ".", "isspace", "(", ")", ":", "return", "if", "silent", ":", "store_histor...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.run_ast_nodes
Run a sequence of AST nodes. The execution mode depends on the interactivity parameter. Parameters ---------- nodelist : list A sequence of AST nodes to run. cell_name : str Will be passed to the compiler as the filename of the cell. Typically the v...
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def run_ast_nodes(self, nodelist, cell_name, interactivity='last_expr'): """Run a sequence of AST nodes. The execution mode depends on the interactivity parameter. Parameters ---------- nodelist : list A sequence of AST nodes to run. cell_name : str W...
def run_ast_nodes(self, nodelist, cell_name, interactivity='last_expr'): """Run a sequence of AST nodes. The execution mode depends on the interactivity parameter. Parameters ---------- nodelist : list A sequence of AST nodes to run. cell_name : str W...
[ "Run", "a", "sequence", "of", "AST", "nodes", ".", "The", "execution", "mode", "depends", "on", "the", "interactivity", "parameter", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L2623-L2690
[ "def", "run_ast_nodes", "(", "self", ",", "nodelist", ",", "cell_name", ",", "interactivity", "=", "'last_expr'", ")", ":", "if", "not", "nodelist", ":", "return", "if", "interactivity", "==", "'last_expr'", ":", "if", "isinstance", "(", "nodelist", "[", "-"...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.run_code
Execute a code object. When an exception occurs, self.showtraceback() is called to display a traceback. Parameters ---------- code_obj : code object A compiled code object, to be executed Returns ------- False : successful execution. T...
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def run_code(self, code_obj): """Execute a code object. When an exception occurs, self.showtraceback() is called to display a traceback. Parameters ---------- code_obj : code object A compiled code object, to be executed Returns ------- ...
def run_code(self, code_obj): """Execute a code object. When an exception occurs, self.showtraceback() is called to display a traceback. Parameters ---------- code_obj : code object A compiled code object, to be executed Returns ------- ...
[ "Execute", "a", "code", "object", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L2692-L2735
[ "def", "run_code", "(", "self", ",", "code_obj", ")", ":", "# Set our own excepthook in case the user code tries to call it", "# directly, so that the IPython crash handler doesn't get triggered", "old_excepthook", ",", "sys", ".", "excepthook", "=", "sys", ".", "excepthook", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.enable_pylab
Activate pylab support at runtime. This turns on support for matplotlib, preloads into the interactive namespace all of numpy and pylab, and configures IPython to correctly interact with the GUI event loop. The GUI backend to be used can be optionally selected with the optional :param:...
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def enable_pylab(self, gui=None, import_all=True): """Activate pylab support at runtime. This turns on support for matplotlib, preloads into the interactive namespace all of numpy and pylab, and configures IPython to correctly interact with the GUI event loop. The GUI backend to be use...
def enable_pylab(self, gui=None, import_all=True): """Activate pylab support at runtime. This turns on support for matplotlib, preloads into the interactive namespace all of numpy and pylab, and configures IPython to correctly interact with the GUI event loop. The GUI backend to be use...
[ "Activate", "pylab", "support", "at", "runtime", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L2747-L2784
[ "def", "enable_pylab", "(", "self", ",", "gui", "=", "None", ",", "import_all", "=", "True", ")", ":", "from", "IPython", ".", "core", ".", "pylabtools", "import", "mpl_runner", "# We want to prevent the loading of pylab to pollute the user's", "# namespace as shown by ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.var_expand
Expand python variables in a string. The depth argument indicates how many frames above the caller should be walked to look for the local namespace where to expand variables. The global namespace for expansion is always the user's interactive namespace.
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def var_expand(self, cmd, depth=0, formatter=DollarFormatter()): """Expand python variables in a string. The depth argument indicates how many frames above the caller should be walked to look for the local namespace where to expand variables. The global namespace for expansion is alway...
def var_expand(self, cmd, depth=0, formatter=DollarFormatter()): """Expand python variables in a string. The depth argument indicates how many frames above the caller should be walked to look for the local namespace where to expand variables. The global namespace for expansion is alway...
[ "Expand", "python", "variables", "in", "a", "string", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L2790-L2807
[ "def", "var_expand", "(", "self", ",", "cmd", ",", "depth", "=", "0", ",", "formatter", "=", "DollarFormatter", "(", ")", ")", ":", "ns", "=", "self", ".", "user_ns", ".", "copy", "(", ")", "ns", ".", "update", "(", "sys", ".", "_getframe", "(", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.mktempfile
Make a new tempfile and return its filename. This makes a call to tempfile.mktemp, but it registers the created filename internally so ipython cleans it up at exit time. Optional inputs: - data(None): if data is given, it gets written out to the temp file immediately, and ...
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def mktempfile(self, data=None, prefix='ipython_edit_'): """Make a new tempfile and return its filename. This makes a call to tempfile.mktemp, but it registers the created filename internally so ipython cleans it up at exit time. Optional inputs: - data(None): if data is giv...
def mktempfile(self, data=None, prefix='ipython_edit_'): """Make a new tempfile and return its filename. This makes a call to tempfile.mktemp, but it registers the created filename internally so ipython cleans it up at exit time. Optional inputs: - data(None): if data is giv...
[ "Make", "a", "new", "tempfile", "and", "return", "its", "filename", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L2809-L2827
[ "def", "mktempfile", "(", "self", ",", "data", "=", "None", ",", "prefix", "=", "'ipython_edit_'", ")", ":", "filename", "=", "tempfile", ".", "mktemp", "(", "'.py'", ",", "prefix", ")", "self", ".", "tempfiles", ".", "append", "(", "filename", ")", "i...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.extract_input_lines
Return as a string a set of input history slices. Parameters ---------- range_str : string The set of slices is given as a string, like "~5/6-~4/2 4:8 9", since this function is for use by magic functions which get their arguments as strings. The number befor...
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def extract_input_lines(self, range_str, raw=False): """Return as a string a set of input history slices. Parameters ---------- range_str : string The set of slices is given as a string, like "~5/6-~4/2 4:8 9", since this function is for use by magic functions wh...
def extract_input_lines(self, range_str, raw=False): """Return as a string a set of input history slices. Parameters ---------- range_str : string The set of slices is given as a string, like "~5/6-~4/2 4:8 9", since this function is for use by magic functions wh...
[ "Return", "as", "a", "string", "a", "set", "of", "input", "history", "slices", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L2848-L2869
[ "def", "extract_input_lines", "(", "self", ",", "range_str", ",", "raw", "=", "False", ")", ":", "lines", "=", "self", ".", "history_manager", ".", "get_range_by_str", "(", "range_str", ",", "raw", "=", "raw", ")", "return", "\"\\n\"", ".", "join", "(", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.find_user_code
Get a code string from history, file, url, or a string or macro. This is mainly used by magic functions. Parameters ---------- target : str A string specifying code to retrieve. This will be tried respectively as: ranges of input history (see %history for syntax),...
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def find_user_code(self, target, raw=True, py_only=False): """Get a code string from history, file, url, or a string or macro. This is mainly used by magic functions. Parameters ---------- target : str A string specifying code to retrieve. This will be tried respect...
def find_user_code(self, target, raw=True, py_only=False): """Get a code string from history, file, url, or a string or macro. This is mainly used by magic functions. Parameters ---------- target : str A string specifying code to retrieve. This will be tried respect...
[ "Get", "a", "code", "string", "from", "history", "file", "url", "or", "a", "string", "or", "macro", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L2871-L2942
[ "def", "find_user_code", "(", "self", ",", "target", ",", "raw", "=", "True", ",", "py_only", "=", "False", ")", ":", "code", "=", "self", ".", "extract_input_lines", "(", "target", ",", "raw", "=", "raw", ")", "# Grab history", "if", "code", ":", "ret...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InteractiveShell.atexit_operations
This will be executed at the time of exit. Cleanup operations and saving of persistent data that is done unconditionally by IPython should be performed here. For things that may depend on startup flags or platform specifics (such as having readline or not), register a separate atexit f...
environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py
def atexit_operations(self): """This will be executed at the time of exit. Cleanup operations and saving of persistent data that is done unconditionally by IPython should be performed here. For things that may depend on startup flags or platform specifics (such as having readli...
def atexit_operations(self): """This will be executed at the time of exit. Cleanup operations and saving of persistent data that is done unconditionally by IPython should be performed here. For things that may depend on startup flags or platform specifics (such as having readli...
[ "This", "will", "be", "executed", "at", "the", "time", "of", "exit", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/interactiveshell.py#L2947-L2974
[ "def", "atexit_operations", "(", "self", ")", ":", "# Close the history session (this stores the end time and line count)", "# this must be *before* the tempfile cleanup, in case of temporary", "# history db", "self", ".", "history_manager", ".", "end_session", "(", ")", "# Cleanup a...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
broadcast
broadcast a message from one engine to all others.
environment/share/doc/ipython/examples/parallel/interengine/interengine.py
def broadcast(client, sender, msg_name, dest_name=None, block=None): """broadcast a message from one engine to all others.""" dest_name = msg_name if dest_name is None else dest_name client[sender].execute('com.publish(%s)'%msg_name, block=None) targets = client.ids targets.remove(sender) return...
def broadcast(client, sender, msg_name, dest_name=None, block=None): """broadcast a message from one engine to all others.""" dest_name = msg_name if dest_name is None else dest_name client[sender].execute('com.publish(%s)'%msg_name, block=None) targets = client.ids targets.remove(sender) return...
[ "broadcast", "a", "message", "from", "one", "engine", "to", "all", "others", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/share/doc/ipython/examples/parallel/interengine/interengine.py#L22-L28
[ "def", "broadcast", "(", "client", ",", "sender", ",", "msg_name", ",", "dest_name", "=", "None", ",", "block", "=", "None", ")", ":", "dest_name", "=", "msg_name", "if", "dest_name", "is", "None", "else", "dest_name", "client", "[", "sender", "]", ".", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
send
send a message from one to one-or-more engines.
environment/share/doc/ipython/examples/parallel/interengine/interengine.py
def send(client, sender, targets, msg_name, dest_name=None, block=None): """send a message from one to one-or-more engines.""" dest_name = msg_name if dest_name is None else dest_name def _send(targets, m_name): msg = globals()[m_name] return com.send(targets, msg) client[sender...
def send(client, sender, targets, msg_name, dest_name=None, block=None): """send a message from one to one-or-more engines.""" dest_name = msg_name if dest_name is None else dest_name def _send(targets, m_name): msg = globals()[m_name] return com.send(targets, msg) client[sender...
[ "send", "a", "message", "from", "one", "to", "one", "-", "or", "-", "more", "engines", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/share/doc/ipython/examples/parallel/interengine/interengine.py#L30-L39
[ "def", "send", "(", "client", ",", "sender", ",", "targets", ",", "msg_name", ",", "dest_name", "=", "None", ",", "block", "=", "None", ")", ":", "dest_name", "=", "msg_name", "if", "dest_name", "is", "None", "else", "dest_name", "def", "_send", "(", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
skipif
Make function raise SkipTest exception if a given condition is true. If the condition is a callable, it is used at runtime to dynamically make the decision. This is useful for tests that may require costly imports, to delay the cost until the test suite is actually executed. Parameters ---------- ...
environment/lib/python2.7/site-packages/IPython/external/decorators/_decorators.py
def skipif(skip_condition, msg=None): """ Make function raise SkipTest exception if a given condition is true. If the condition is a callable, it is used at runtime to dynamically make the decision. This is useful for tests that may require costly imports, to delay the cost until the test suite is ...
def skipif(skip_condition, msg=None): """ Make function raise SkipTest exception if a given condition is true. If the condition is a callable, it is used at runtime to dynamically make the decision. This is useful for tests that may require costly imports, to delay the cost until the test suite is ...
[ "Make", "function", "raise", "SkipTest", "exception", "if", "a", "given", "condition", "is", "true", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/decorators/_decorators.py#L99-L173
[ "def", "skipif", "(", "skip_condition", ",", "msg", "=", "None", ")", ":", "def", "skip_decorator", "(", "f", ")", ":", "# Local import to avoid a hard nose dependency and only incur the", "# import time overhead at actual test-time.", "import", "nose", "# Allow for both bool...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
knownfailureif
Make function raise KnownFailureTest exception if given condition is true. If the condition is a callable, it is used at runtime to dynamically make the decision. This is useful for tests that may require costly imports, to delay the cost until the test suite is actually executed. Parameters -----...
environment/lib/python2.7/site-packages/IPython/external/decorators/_decorators.py
def knownfailureif(fail_condition, msg=None): """ Make function raise KnownFailureTest exception if given condition is true. If the condition is a callable, it is used at runtime to dynamically make the decision. This is useful for tests that may require costly imports, to delay the cost until the ...
def knownfailureif(fail_condition, msg=None): """ Make function raise KnownFailureTest exception if given condition is true. If the condition is a callable, it is used at runtime to dynamically make the decision. This is useful for tests that may require costly imports, to delay the cost until the ...
[ "Make", "function", "raise", "KnownFailureTest", "exception", "if", "given", "condition", "is", "true", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/decorators/_decorators.py#L175-L225
[ "def", "knownfailureif", "(", "fail_condition", ",", "msg", "=", "None", ")", ":", "if", "msg", "is", "None", ":", "msg", "=", "'Test skipped due to known failure'", "# Allow for both boolean or callable known failure conditions.", "if", "callable", "(", "fail_condition",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
deprecated
Filter deprecation warnings while running the test suite. This decorator can be used to filter DeprecationWarning's, to avoid printing them during the test suite run, while checking that the test actually raises a DeprecationWarning. Parameters ---------- conditional : bool or callable, option...
environment/lib/python2.7/site-packages/IPython/external/decorators/_decorators.py
def deprecated(conditional=True): """ Filter deprecation warnings while running the test suite. This decorator can be used to filter DeprecationWarning's, to avoid printing them during the test suite run, while checking that the test actually raises a DeprecationWarning. Parameters -------...
def deprecated(conditional=True): """ Filter deprecation warnings while running the test suite. This decorator can be used to filter DeprecationWarning's, to avoid printing them during the test suite run, while checking that the test actually raises a DeprecationWarning. Parameters -------...
[ "Filter", "deprecation", "warnings", "while", "running", "the", "test", "suite", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/decorators/_decorators.py#L227-L281
[ "def", "deprecated", "(", "conditional", "=", "True", ")", ":", "def", "deprecate_decorator", "(", "f", ")", ":", "# Local import to avoid a hard nose dependency and only incur the", "# import time overhead at actual test-time.", "import", "nose", "def", "_deprecated_imp", "(...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
list_profiles_in
list profiles in a given root directory
environment/lib/python2.7/site-packages/IPython/core/profileapp.py
def list_profiles_in(path): """list profiles in a given root directory""" files = os.listdir(path) profiles = [] for f in files: full_path = os.path.join(path, f) if os.path.isdir(full_path) and f.startswith('profile_'): profiles.append(f.split('_',1)[-1]) return profiles
def list_profiles_in(path): """list profiles in a given root directory""" files = os.listdir(path) profiles = [] for f in files: full_path = os.path.join(path, f) if os.path.isdir(full_path) and f.startswith('profile_'): profiles.append(f.split('_',1)[-1]) return profiles
[ "list", "profiles", "in", "a", "given", "root", "directory" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/profileapp.py#L97-L105
[ "def", "list_profiles_in", "(", "path", ")", ":", "files", "=", "os", ".", "listdir", "(", "path", ")", "profiles", "=", "[", "]", "for", "f", "in", "files", ":", "full_path", "=", "os", ".", "path", ".", "join", "(", "path", ",", "f", ")", "if",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
list_bundled_profiles
list profiles that are bundled with IPython.
environment/lib/python2.7/site-packages/IPython/core/profileapp.py
def list_bundled_profiles(): """list profiles that are bundled with IPython.""" path = os.path.join(get_ipython_package_dir(), u'config', u'profile') files = os.listdir(path) profiles = [] for profile in files: full_path = os.path.join(path, profile) if os.path.isdir(full_path) and p...
def list_bundled_profiles(): """list profiles that are bundled with IPython.""" path = os.path.join(get_ipython_package_dir(), u'config', u'profile') files = os.listdir(path) profiles = [] for profile in files: full_path = os.path.join(path, profile) if os.path.isdir(full_path) and p...
[ "list", "profiles", "that", "are", "bundled", "with", "IPython", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/profileapp.py#L108-L117
[ "def", "list_bundled_profiles", "(", ")", ":", "path", "=", "os", ".", "path", ".", "join", "(", "get_ipython_package_dir", "(", ")", ",", "u'config'", ",", "u'profile'", ")", "files", "=", "os", ".", "listdir", "(", "path", ")", "profiles", "=", "[", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
_bypass_ensure_directory
Sandbox-bypassing version of ensure_directory()
virtualEnvironment/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py
def _bypass_ensure_directory(path, mode=0o777): """Sandbox-bypassing version of ensure_directory()""" if not WRITE_SUPPORT: raise IOError('"os.mkdir" not supported on this platform.') dirname, filename = split(path) if dirname and filename and not isdir(dirname): _bypass_ensure_directory...
def _bypass_ensure_directory(path, mode=0o777): """Sandbox-bypassing version of ensure_directory()""" if not WRITE_SUPPORT: raise IOError('"os.mkdir" not supported on this platform.') dirname, filename = split(path) if dirname and filename and not isdir(dirname): _bypass_ensure_directory...
[ "Sandbox", "-", "bypassing", "version", "of", "ensure_directory", "()" ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py#L2902-L2909
[ "def", "_bypass_ensure_directory", "(", "path", ",", "mode", "=", "0o777", ")", ":", "if", "not", "WRITE_SUPPORT", ":", "raise", "IOError", "(", "'\"os.mkdir\" not supported on this platform.'", ")", "dirname", ",", "filename", "=", "split", "(", "path", ")", "i...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
WorkingSet.find
Find a distribution matching requirement `req` If there is an active distribution for the requested project, this returns it as long as it meets the version requirement specified by `req`. But, if there is an active distribution for the project and it does *not* meet the `req` requirem...
virtualEnvironment/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py
def find(self, req): """Find a distribution matching requirement `req` If there is an active distribution for the requested project, this returns it as long as it meets the version requirement specified by `req`. But, if there is an active distribution for the project and it do...
def find(self, req): """Find a distribution matching requirement `req` If there is an active distribution for the requested project, this returns it as long as it meets the version requirement specified by `req`. But, if there is an active distribution for the project and it do...
[ "Find", "a", "distribution", "matching", "requirement", "req" ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py#L608-L623
[ "def", "find", "(", "self", ",", "req", ")", ":", "dist", "=", "self", ".", "by_key", ".", "get", "(", "req", ".", "key", ")", "if", "dist", "is", "not", "None", "and", "dist", "not", "in", "req", ":", "# XXX add more info", "raise", "VersionConflict...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
WorkingSet.resolve
List all distributions needed to (recursively) meet `requirements` `requirements` must be a sequence of ``Requirement`` objects. `env`, if supplied, should be an ``Environment`` instance. If not supplied, it defaults to all distributions available within any entry or distribution in t...
virtualEnvironment/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py
def resolve(self, requirements, env=None, installer=None, replace_conflicting=False): """List all distributions needed to (recursively) meet `requirements` `requirements` must be a sequence of ``Requirement`` objects. `env`, if supplied, should be an ``Environment`` instance. If ...
def resolve(self, requirements, env=None, installer=None, replace_conflicting=False): """List all distributions needed to (recursively) meet `requirements` `requirements` must be a sequence of ``Requirement`` objects. `env`, if supplied, should be an ``Environment`` instance. If ...
[ "List", "all", "distributions", "needed", "to", "(", "recursively", ")", "meet", "requirements" ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py#L695-L774
[ "def", "resolve", "(", "self", ",", "requirements", ",", "env", "=", "None", ",", "installer", "=", "None", ",", "replace_conflicting", "=", "False", ")", ":", "# set up the stack", "requirements", "=", "list", "(", "requirements", ")", "[", ":", ":", "-",...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
MarkerEvaluation.is_invalid_marker
Validate text as a PEP 426 environment marker; return an exception if invalid or False otherwise.
virtualEnvironment/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py
def is_invalid_marker(cls, text): """ Validate text as a PEP 426 environment marker; return an exception if invalid or False otherwise. """ try: cls.evaluate_marker(text) except SyntaxError: return cls.normalize_exception(sys.exc_info()[1]) ...
def is_invalid_marker(cls, text): """ Validate text as a PEP 426 environment marker; return an exception if invalid or False otherwise. """ try: cls.evaluate_marker(text) except SyntaxError: return cls.normalize_exception(sys.exc_info()[1]) ...
[ "Validate", "text", "as", "a", "PEP", "426", "environment", "marker", ";", "return", "an", "exception", "if", "invalid", "or", "False", "otherwise", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py#L1328-L1337
[ "def", "is_invalid_marker", "(", "cls", ",", "text", ")", ":", "try", ":", "cls", ".", "evaluate_marker", "(", "text", ")", "except", "SyntaxError", ":", "return", "cls", ".", "normalize_exception", "(", "sys", ".", "exc_info", "(", ")", "[", "1", "]", ...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
run
This function runs the given command; waits for it to finish; then returns all output as a string. STDERR is included in output. If the full path to the command is not given then the path is searched. Note that lines are terminated by CR/LF (\\r\\n) combination even on UNIX-like systems because this is...
environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py
def run (command, timeout=-1, withexitstatus=False, events=None, extra_args=None, logfile=None, cwd=None, env=None, encoding='utf-8'): """ This function runs the given command; waits for it to finish; then returns all output as a string. STDERR is included in output. If the full path to the co...
def run (command, timeout=-1, withexitstatus=False, events=None, extra_args=None, logfile=None, cwd=None, env=None, encoding='utf-8'): """ This function runs the given command; waits for it to finish; then returns all output as a string. STDERR is included in output. If the full path to the co...
[ "This", "function", "runs", "the", "given", "command", ";", "waits", "for", "it", "to", "finish", ";", "then", "returns", "all", "output", "as", "a", "string", ".", "STDERR", "is", "included", "in", "output", ".", "If", "the", "full", "path", "to", "th...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py#L160-L279
[ "def", "run", "(", "command", ",", "timeout", "=", "-", "1", ",", "withexitstatus", "=", "False", ",", "events", "=", "None", ",", "extra_args", "=", "None", ",", "logfile", "=", "None", ",", "cwd", "=", "None", ",", "env", "=", "None", ",", "encod...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
which
This takes a given filename; tries to find it in the environment path; then checks if it is executable. This returns the full path to the filename if found and executable. Otherwise this returns None.
environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py
def which (filename): """This takes a given filename; tries to find it in the environment path; then checks if it is executable. This returns the full path to the filename if found and executable. Otherwise this returns None.""" # Special case where filename already contains a path. if os.path.dir...
def which (filename): """This takes a given filename; tries to find it in the environment path; then checks if it is executable. This returns the full path to the filename if found and executable. Otherwise this returns None.""" # Special case where filename already contains a path. if os.path.dir...
[ "This", "takes", "a", "given", "filename", ";", "tries", "to", "find", "it", "in", "the", "environment", "path", ";", "then", "checks", "if", "it", "is", "executable", ".", "This", "returns", "the", "full", "path", "to", "the", "filename", "if", "found",...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py#L1821-L1843
[ "def", "which", "(", "filename", ")", ":", "# Special case where filename already contains a path.", "if", "os", ".", "path", ".", "dirname", "(", "filename", ")", "!=", "''", ":", "if", "os", ".", "access", "(", "filename", ",", "os", ".", "X_OK", ")", ":...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
spawnb._spawn
This starts the given command in a child process. This does all the fork/exec type of stuff for a pty. This is called by __init__. If args is empty then command will be parsed (split on spaces) and args will be set to parsed arguments.
environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py
def _spawn(self,command,args=[]): """This starts the given command in a child process. This does all the fork/exec type of stuff for a pty. This is called by __init__. If args is empty then command will be parsed (split on spaces) and args will be set to parsed arguments. """ #...
def _spawn(self,command,args=[]): """This starts the given command in a child process. This does all the fork/exec type of stuff for a pty. This is called by __init__. If args is empty then command will be parsed (split on spaces) and args will be set to parsed arguments. """ #...
[ "This", "starts", "the", "given", "command", "in", "a", "child", "process", ".", "This", "does", "all", "the", "fork", "/", "exec", "type", "of", "stuff", "for", "a", "pty", ".", "This", "is", "called", "by", "__init__", ".", "If", "args", "is", "emp...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py#L510-L592
[ "def", "_spawn", "(", "self", ",", "command", ",", "args", "=", "[", "]", ")", ":", "# The pid and child_fd of this object get set by this method.", "# Note that it is difficult for this method to fail.", "# You cannot detect if the child process cannot start.", "# So the only way yo...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
spawnb.__fork_pty
This implements a substitute for the forkpty system call. This should be more portable than the pty.fork() function. Specifically, this should work on Solaris. Modified 10.06.05 by Geoff Marshall: Implemented __fork_pty() method to resolve the issue with Python's pty.fork() not supporti...
environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py
def __fork_pty(self): """This implements a substitute for the forkpty system call. This should be more portable than the pty.fork() function. Specifically, this should work on Solaris. Modified 10.06.05 by Geoff Marshall: Implemented __fork_pty() method to resolve the issue wit...
def __fork_pty(self): """This implements a substitute for the forkpty system call. This should be more portable than the pty.fork() function. Specifically, this should work on Solaris. Modified 10.06.05 by Geoff Marshall: Implemented __fork_pty() method to resolve the issue wit...
[ "This", "implements", "a", "substitute", "for", "the", "forkpty", "system", "call", ".", "This", "should", "be", "more", "portable", "than", "the", "pty", ".", "fork", "()", "function", ".", "Specifically", "this", "should", "work", "on", "Solaris", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py#L594-L631
[ "def", "__fork_pty", "(", "self", ")", ":", "parent_fd", ",", "child_fd", "=", "os", ".", "openpty", "(", ")", "if", "parent_fd", "<", "0", "or", "child_fd", "<", "0", ":", "raise", "ExceptionPexpect", ",", "\"Error! Could not open pty with os.openpty().\"", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
spawnb.__pty_make_controlling_tty
This makes the pseudo-terminal the controlling tty. This should be more portable than the pty.fork() function. Specifically, this should work on Solaris.
environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py
def __pty_make_controlling_tty(self, tty_fd): """This makes the pseudo-terminal the controlling tty. This should be more portable than the pty.fork() function. Specifically, this should work on Solaris. """ child_name = os.ttyname(tty_fd) # Disconnect from controlling tty. Har...
def __pty_make_controlling_tty(self, tty_fd): """This makes the pseudo-terminal the controlling tty. This should be more portable than the pty.fork() function. Specifically, this should work on Solaris. """ child_name = os.ttyname(tty_fd) # Disconnect from controlling tty. Har...
[ "This", "makes", "the", "pseudo", "-", "terminal", "the", "controlling", "tty", ".", "This", "should", "be", "more", "portable", "than", "the", "pty", ".", "fork", "()", "function", ".", "Specifically", "this", "should", "work", "on", "Solaris", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py#L633-L675
[ "def", "__pty_make_controlling_tty", "(", "self", ",", "tty_fd", ")", ":", "child_name", "=", "os", ".", "ttyname", "(", "tty_fd", ")", "# Disconnect from controlling tty. Harmless if not already connected.", "try", ":", "fd", "=", "os", ".", "open", "(", "\"/dev/tt...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
spawnb.close
This closes the connection with the child application. Note that calling close() more than once is valid. This emulates standard Python behavior with files. Set force to True if you want to make sure that the child is terminated (SIGKILL is sent if the child ignores SIGHUP and SIGINT).
environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py
def close (self, force=True): # File-like object. """This closes the connection with the child application. Note that calling close() more than once is valid. This emulates standard Python behavior with files. Set force to True if you want to make sure that the child is terminated (SI...
def close (self, force=True): # File-like object. """This closes the connection with the child application. Note that calling close() more than once is valid. This emulates standard Python behavior with files. Set force to True if you want to make sure that the child is terminated (SI...
[ "This", "closes", "the", "connection", "with", "the", "child", "application", ".", "Note", "that", "calling", "close", "()", "more", "than", "once", "is", "valid", ".", "This", "emulates", "standard", "Python", "behavior", "with", "files", ".", "Set", "force...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py#L684-L700
[ "def", "close", "(", "self", ",", "force", "=", "True", ")", ":", "# File-like object.", "if", "not", "self", ".", "closed", ":", "self", ".", "flush", "(", ")", "os", ".", "close", "(", "self", ".", "child_fd", ")", "time", ".", "sleep", "(", "sel...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
spawnb.getecho
This returns the terminal echo mode. This returns True if echo is on or False if echo is off. Child applications that are expecting you to enter a password often set ECHO False. See waitnoecho().
environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py
def getecho (self): """This returns the terminal echo mode. This returns True if echo is on or False if echo is off. Child applications that are expecting you to enter a password often set ECHO False. See waitnoecho(). """ attr = termios.tcgetattr(self.child_fd) if attr[3] & te...
def getecho (self): """This returns the terminal echo mode. This returns True if echo is on or False if echo is off. Child applications that are expecting you to enter a password often set ECHO False. See waitnoecho(). """ attr = termios.tcgetattr(self.child_fd) if attr[3] & te...
[ "This", "returns", "the", "terminal", "echo", "mode", ".", "This", "returns", "True", "if", "echo", "is", "on", "or", "False", "if", "echo", "is", "off", ".", "Child", "applications", "that", "are", "expecting", "you", "to", "enter", "a", "password", "of...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py#L748-L757
[ "def", "getecho", "(", "self", ")", ":", "attr", "=", "termios", ".", "tcgetattr", "(", "self", ".", "child_fd", ")", "if", "attr", "[", "3", "]", "&", "termios", ".", "ECHO", ":", "return", "True", "return", "False" ]
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
spawnb.setecho
This sets the terminal echo mode on or off. Note that anything the child sent before the echo will be lost, so you should be sure that your input buffer is empty before you call setecho(). For example, the following will work as expected:: p = pexpect.spawn('cat') p.send...
environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py
def setecho (self, state): """This sets the terminal echo mode on or off. Note that anything the child sent before the echo will be lost, so you should be sure that your input buffer is empty before you call setecho(). For example, the following will work as expected:: p = ...
def setecho (self, state): """This sets the terminal echo mode on or off. Note that anything the child sent before the echo will be lost, so you should be sure that your input buffer is empty before you call setecho(). For example, the following will work as expected:: p = ...
[ "This", "sets", "the", "terminal", "echo", "mode", "on", "or", "off", ".", "Note", "that", "anything", "the", "child", "sent", "before", "the", "echo", "will", "be", "lost", "so", "you", "should", "be", "sure", "that", "your", "input", "buffer", "is", ...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py#L759-L798
[ "def", "setecho", "(", "self", ",", "state", ")", ":", "self", ".", "child_fd", "attr", "=", "termios", ".", "tcgetattr", "(", "self", ".", "child_fd", ")", "if", "state", ":", "attr", "[", "3", "]", "=", "attr", "[", "3", "]", "|", "termios", "....
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
spawnb.read_nonblocking
This reads at most size bytes from the child application. It includes a timeout. If the read does not complete within the timeout period then a TIMEOUT exception is raised. If the end of file is read then an EOF exception will be raised. If a log file was set using setlog() then all data...
environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py
def read_nonblocking (self, size = 1, timeout = -1): """This reads at most size bytes from the child application. It includes a timeout. If the read does not complete within the timeout period then a TIMEOUT exception is raised. If the end of file is read then an EOF exception will be r...
def read_nonblocking (self, size = 1, timeout = -1): """This reads at most size bytes from the child application. It includes a timeout. If the read does not complete within the timeout period then a TIMEOUT exception is raised. If the end of file is read then an EOF exception will be r...
[ "This", "reads", "at", "most", "size", "bytes", "from", "the", "child", "application", ".", "It", "includes", "a", "timeout", ".", "If", "the", "read", "does", "not", "complete", "within", "the", "timeout", "period", "then", "a", "TIMEOUT", "exception", "i...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py#L800-L877
[ "def", "read_nonblocking", "(", "self", ",", "size", "=", "1", ",", "timeout", "=", "-", "1", ")", ":", "if", "self", ".", "closed", ":", "raise", "ValueError", "(", "'I/O operation on closed file in read_nonblocking().'", ")", "if", "timeout", "==", "-", "1...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
spawnb.read
This reads at most "size" bytes from the file (less if the read hits EOF before obtaining size bytes). If the size argument is negative or omitted, read all data until EOF is reached. The bytes are returned as a string object. An empty string is returned when EOF is encountered immediate...
environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py
def read (self, size = -1): # File-like object. """This reads at most "size" bytes from the file (less if the read hits EOF before obtaining size bytes). If the size argument is negative or omitted, read all data until EOF is reached. The bytes are returned as a string object. An...
def read (self, size = -1): # File-like object. """This reads at most "size" bytes from the file (less if the read hits EOF before obtaining size bytes). If the size argument is negative or omitted, read all data until EOF is reached. The bytes are returned as a string object. An...
[ "This", "reads", "at", "most", "size", "bytes", "from", "the", "file", "(", "less", "if", "the", "read", "hits", "EOF", "before", "obtaining", "size", "bytes", ")", ".", "If", "the", "size", "argument", "is", "negative", "or", "omitted", "read", "all", ...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py#L879-L907
[ "def", "read", "(", "self", ",", "size", "=", "-", "1", ")", ":", "# File-like object.", "if", "size", "==", "0", ":", "return", "self", ".", "_empty_buffer", "if", "size", "<", "0", ":", "self", ".", "expect", "(", "self", ".", "delimiter", ")", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
spawnb.readline
This reads and returns one entire line. A trailing newline is kept in the string, but may be absent when a file ends with an incomplete line. Note: This readline() looks for a \\r\\n pair even on UNIX because this is what the pseudo tty device returns. So contrary to what you may expect ...
environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py
def readline(self, size = -1): """This reads and returns one entire line. A trailing newline is kept in the string, but may be absent when a file ends with an incomplete line. Note: This readline() looks for a \\r\\n pair even on UNIX because this is what the pseudo tty device returns. S...
def readline(self, size = -1): """This reads and returns one entire line. A trailing newline is kept in the string, but may be absent when a file ends with an incomplete line. Note: This readline() looks for a \\r\\n pair even on UNIX because this is what the pseudo tty device returns. S...
[ "This", "reads", "and", "returns", "one", "entire", "line", ".", "A", "trailing", "newline", "is", "kept", "in", "the", "string", "but", "may", "be", "absent", "when", "a", "file", "ends", "with", "an", "incomplete", "line", ".", "Note", ":", "This", "...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py#L909-L924
[ "def", "readline", "(", "self", ",", "size", "=", "-", "1", ")", ":", "if", "size", "==", "0", ":", "return", "self", ".", "_empty_buffer", "index", "=", "self", ".", "expect", "(", "[", "self", ".", "_pty_newline", ",", "self", ".", "delimiter", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
spawnb.next
This is to support iterators over a file-like object.
environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py
def next (self): # File-like object. """This is to support iterators over a file-like object. """ result = self.readline() if result == self._empty_buffer: raise StopIteration return result
def next (self): # File-like object. """This is to support iterators over a file-like object. """ result = self.readline() if result == self._empty_buffer: raise StopIteration return result
[ "This", "is", "to", "support", "iterators", "over", "a", "file", "-", "like", "object", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py#L933-L941
[ "def", "next", "(", "self", ")", ":", "# File-like object.", "result", "=", "self", ".", "readline", "(", ")", "if", "result", "==", "self", ".", "_empty_buffer", ":", "raise", "StopIteration", "return", "result" ]
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
spawnb.send
This sends a string to the child process. This returns the number of bytes written. If a log file was set then the data is also written to the log.
environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py
def send(self, s): """This sends a string to the child process. This returns the number of bytes written. If a log file was set then the data is also written to the log. """ time.sleep(self.delaybeforesend) s2 = self._cast_buffer_type(s) if self.logfile is not ...
def send(self, s): """This sends a string to the child process. This returns the number of bytes written. If a log file was set then the data is also written to the log. """ time.sleep(self.delaybeforesend) s2 = self._cast_buffer_type(s) if self.logfile is not ...
[ "This", "sends", "a", "string", "to", "the", "child", "process", ".", "This", "returns", "the", "number", "of", "bytes", "written", ".", "If", "a", "log", "file", "was", "set", "then", "the", "data", "is", "also", "written", "to", "the", "log", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py#L973-L989
[ "def", "send", "(", "self", ",", "s", ")", ":", "time", ".", "sleep", "(", "self", ".", "delaybeforesend", ")", "s2", "=", "self", ".", "_cast_buffer_type", "(", "s", ")", "if", "self", ".", "logfile", "is", "not", "None", ":", "self", ".", "logfil...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
spawnb.sendcontrol
This sends a control character to the child such as Ctrl-C or Ctrl-D. For example, to send a Ctrl-G (ASCII 7):: child.sendcontrol('g') See also, sendintr() and sendeof().
environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py
def sendcontrol(self, char): """This sends a control character to the child such as Ctrl-C or Ctrl-D. For example, to send a Ctrl-G (ASCII 7):: child.sendcontrol('g') See also, sendintr() and sendeof(). """ char = char.lower() a = ord(char) if a>=9...
def sendcontrol(self, char): """This sends a control character to the child such as Ctrl-C or Ctrl-D. For example, to send a Ctrl-G (ASCII 7):: child.sendcontrol('g') See also, sendintr() and sendeof(). """ char = char.lower() a = ord(char) if a>=9...
[ "This", "sends", "a", "control", "character", "to", "the", "child", "such", "as", "Ctrl", "-", "C", "or", "Ctrl", "-", "D", ".", "For", "example", "to", "send", "a", "Ctrl", "-", "G", "(", "ASCII", "7", ")", "::" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py#L1000-L1024
[ "def", "sendcontrol", "(", "self", ",", "char", ")", ":", "char", "=", "char", ".", "lower", "(", ")", "a", "=", "ord", "(", "char", ")", "if", "a", ">=", "97", "and", "a", "<=", "122", ":", "a", "=", "a", "-", "ord", "(", "'a'", ")", "+", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
spawnb.sendeof
This sends an EOF to the child. This sends a character which causes the pending parent output buffer to be sent to the waiting child program without waiting for end-of-line. If it is the first character of the line, the read() in the user program returns 0, which signifies end-of-file. T...
environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py
def sendeof(self): """This sends an EOF to the child. This sends a character which causes the pending parent output buffer to be sent to the waiting child program without waiting for end-of-line. If it is the first character of the line, the read() in the user program returns 0, which s...
def sendeof(self): """This sends an EOF to the child. This sends a character which causes the pending parent output buffer to be sent to the waiting child program without waiting for end-of-line. If it is the first character of the line, the read() in the user program returns 0, which s...
[ "This", "sends", "an", "EOF", "to", "the", "child", ".", "This", "sends", "a", "character", "which", "causes", "the", "pending", "parent", "output", "buffer", "to", "be", "sent", "to", "the", "waiting", "child", "program", "without", "waiting", "for", "end...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py#L1026-L1058
[ "def", "sendeof", "(", "self", ")", ":", "### Hmmm... how do I send an EOF?", "###C if ((m = write(pty, *buf, p - *buf)) < 0)", "###C return (errno == EWOULDBLOCK) ? n : -1;", "#fd = sys.stdin.fileno()", "#old = termios.tcgetattr(fd) # remember current state", "#attr = termios.tcgetattr(...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
spawnb.sendintr
This sends a SIGINT to the child. It does not require the SIGINT to be the first character on a line.
environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py
def sendintr(self): """This sends a SIGINT to the child. It does not require the SIGINT to be the first character on a line. """ if hasattr(termios, 'VINTR'): char = termios.tcgetattr(self.child_fd)[6][termios.VINTR] else: # platform does not define VINTR so ass...
def sendintr(self): """This sends a SIGINT to the child. It does not require the SIGINT to be the first character on a line. """ if hasattr(termios, 'VINTR'): char = termios.tcgetattr(self.child_fd)[6][termios.VINTR] else: # platform does not define VINTR so ass...
[ "This", "sends", "a", "SIGINT", "to", "the", "child", ".", "It", "does", "not", "require", "the", "SIGINT", "to", "be", "the", "first", "character", "on", "a", "line", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py#L1060-L1070
[ "def", "sendintr", "(", "self", ")", ":", "if", "hasattr", "(", "termios", ",", "'VINTR'", ")", ":", "char", "=", "termios", ".", "tcgetattr", "(", "self", ".", "child_fd", ")", "[", "6", "]", "[", "termios", ".", "VINTR", "]", "else", ":", "# plat...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
spawnb.compile_pattern_list
This compiles a pattern-string or a list of pattern-strings. Patterns must be a StringType, EOF, TIMEOUT, SRE_Pattern, or a list of those. Patterns may also be None which results in an empty list (you might do this if waiting for an EOF or TIMEOUT condition without expecting any pattern)...
environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py
def compile_pattern_list(self, patterns): """This compiles a pattern-string or a list of pattern-strings. Patterns must be a StringType, EOF, TIMEOUT, SRE_Pattern, or a list of those. Patterns may also be None which results in an empty list (you might do this if waiting for an EOF or TI...
def compile_pattern_list(self, patterns): """This compiles a pattern-string or a list of pattern-strings. Patterns must be a StringType, EOF, TIMEOUT, SRE_Pattern, or a list of those. Patterns may also be None which results in an empty list (you might do this if waiting for an EOF or TI...
[ "This", "compiles", "a", "pattern", "-", "string", "or", "a", "list", "of", "pattern", "-", "strings", ".", "Patterns", "must", "be", "a", "StringType", "EOF", "TIMEOUT", "SRE_Pattern", "or", "a", "list", "of", "those", ".", "Patterns", "may", "also", "b...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py#L1220-L1268
[ "def", "compile_pattern_list", "(", "self", ",", "patterns", ")", ":", "if", "patterns", "is", "None", ":", "return", "[", "]", "if", "not", "isinstance", "(", "patterns", ",", "list", ")", ":", "patterns", "=", "[", "patterns", "]", "compile_flags", "="...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
spawnb._prepare_regex_pattern
Recompile unicode regexes as bytes regexes. Overridden in subclass.
environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py
def _prepare_regex_pattern(self, p): "Recompile unicode regexes as bytes regexes. Overridden in subclass." if isinstance(p.pattern, unicode): p = re.compile(p.pattern.encode('utf-8'), p.flags &~ re.UNICODE) return p
def _prepare_regex_pattern(self, p): "Recompile unicode regexes as bytes regexes. Overridden in subclass." if isinstance(p.pattern, unicode): p = re.compile(p.pattern.encode('utf-8'), p.flags &~ re.UNICODE) return p
[ "Recompile", "unicode", "regexes", "as", "bytes", "regexes", ".", "Overridden", "in", "subclass", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py#L1270-L1274
[ "def", "_prepare_regex_pattern", "(", "self", ",", "p", ")", ":", "if", "isinstance", "(", "p", ".", "pattern", ",", "unicode", ")", ":", "p", "=", "re", ".", "compile", "(", "p", ".", "pattern", ".", "encode", "(", "'utf-8'", ")", ",", "p", ".", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
spawnb.expect
This seeks through the stream until a pattern is matched. The pattern is overloaded and may take several types. The pattern can be a StringType, EOF, a compiled re, or a list of any of those types. Strings will be compiled to re types. This returns the index into the pattern list. If the...
environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py
def expect(self, pattern, timeout = -1, searchwindowsize=-1): """This seeks through the stream until a pattern is matched. The pattern is overloaded and may take several types. The pattern can be a StringType, EOF, a compiled re, or a list of any of those types. Strings will be compiled...
def expect(self, pattern, timeout = -1, searchwindowsize=-1): """This seeks through the stream until a pattern is matched. The pattern is overloaded and may take several types. The pattern can be a StringType, EOF, a compiled re, or a list of any of those types. Strings will be compiled...
[ "This", "seeks", "through", "the", "stream", "until", "a", "pattern", "is", "matched", ".", "The", "pattern", "is", "overloaded", "and", "may", "take", "several", "types", ".", "The", "pattern", "can", "be", "a", "StringType", "EOF", "a", "compiled", "re",...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py#L1276-L1354
[ "def", "expect", "(", "self", ",", "pattern", ",", "timeout", "=", "-", "1", ",", "searchwindowsize", "=", "-", "1", ")", ":", "compiled_pattern_list", "=", "self", ".", "compile_pattern_list", "(", "pattern", ")", "return", "self", ".", "expect_list", "("...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
spawnb.expect_list
This takes a list of compiled regular expressions and returns the index into the pattern_list that matched the child output. The list may also contain EOF or TIMEOUT (which are not compiled regular expressions). This method is similar to the expect() method except that expect_list() does...
environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py
def expect_list(self, pattern_list, timeout = -1, searchwindowsize = -1): """This takes a list of compiled regular expressions and returns the index into the pattern_list that matched the child output. The list may also contain EOF or TIMEOUT (which are not compiled regular expressions)...
def expect_list(self, pattern_list, timeout = -1, searchwindowsize = -1): """This takes a list of compiled regular expressions and returns the index into the pattern_list that matched the child output. The list may also contain EOF or TIMEOUT (which are not compiled regular expressions)...
[ "This", "takes", "a", "list", "of", "compiled", "regular", "expressions", "and", "returns", "the", "index", "into", "the", "pattern_list", "that", "matched", "the", "child", "output", ".", "The", "list", "may", "also", "contain", "EOF", "or", "TIMEOUT", "(",...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py#L1356-L1368
[ "def", "expect_list", "(", "self", ",", "pattern_list", ",", "timeout", "=", "-", "1", ",", "searchwindowsize", "=", "-", "1", ")", ":", "return", "self", ".", "expect_loop", "(", "searcher_re", "(", "pattern_list", ")", ",", "timeout", ",", "searchwindows...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
spawnb.expect_exact
This is similar to expect(), but uses plain string matching instead of compiled regular expressions in 'pattern_list'. The 'pattern_list' may be a string; a list or other sequence of strings; or TIMEOUT and EOF. This call might be faster than expect() for two reasons: string sea...
environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py
def expect_exact(self, pattern_list, timeout = -1, searchwindowsize = -1): """This is similar to expect(), but uses plain string matching instead of compiled regular expressions in 'pattern_list'. The 'pattern_list' may be a string; a list or other sequence of strings; or TIMEOUT and EO...
def expect_exact(self, pattern_list, timeout = -1, searchwindowsize = -1): """This is similar to expect(), but uses plain string matching instead of compiled regular expressions in 'pattern_list'. The 'pattern_list' may be a string; a list or other sequence of strings; or TIMEOUT and EO...
[ "This", "is", "similar", "to", "expect", "()", "but", "uses", "plain", "string", "matching", "instead", "of", "compiled", "regular", "expressions", "in", "pattern_list", ".", "The", "pattern_list", "may", "be", "a", "string", ";", "a", "list", "or", "other",...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py#L1370-L1386
[ "def", "expect_exact", "(", "self", ",", "pattern_list", ",", "timeout", "=", "-", "1", ",", "searchwindowsize", "=", "-", "1", ")", ":", "if", "isinstance", "(", "pattern_list", ",", "(", "bytes", ",", "unicode", ")", ")", "or", "pattern_list", "in", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
spawnb.expect_loop
This is the common loop used inside expect. The 'searcher' should be an instance of searcher_re or searcher_string, which describes how and what to search for in the input. See expect() for other arguments, return value and exceptions.
environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py
def expect_loop(self, searcher, timeout = -1, searchwindowsize = -1): """This is the common loop used inside expect. The 'searcher' should be an instance of searcher_re or searcher_string, which describes how and what to search for in the input. See expect() for other arguments, return...
def expect_loop(self, searcher, timeout = -1, searchwindowsize = -1): """This is the common loop used inside expect. The 'searcher' should be an instance of searcher_re or searcher_string, which describes how and what to search for in the input. See expect() for other arguments, return...
[ "This", "is", "the", "common", "loop", "used", "inside", "expect", ".", "The", "searcher", "should", "be", "an", "instance", "of", "searcher_re", "or", "searcher_string", "which", "describes", "how", "and", "what", "to", "search", "for", "in", "the", "input"...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py#L1388-L1458
[ "def", "expect_loop", "(", "self", ",", "searcher", ",", "timeout", "=", "-", "1", ",", "searchwindowsize", "=", "-", "1", ")", ":", "self", ".", "searcher", "=", "searcher", "if", "timeout", "==", "-", "1", ":", "timeout", "=", "self", ".", "timeout...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
spawnb.getwinsize
This returns the terminal window size of the child tty. The return value is a tuple of (rows, cols).
environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py
def getwinsize(self): """This returns the terminal window size of the child tty. The return value is a tuple of (rows, cols). """ TIOCGWINSZ = getattr(termios, 'TIOCGWINSZ', 1074295912L) s = struct.pack('HHHH', 0, 0, 0, 0) x = fcntl.ioctl(self.fileno(), TIOCGWINSZ, s) r...
def getwinsize(self): """This returns the terminal window size of the child tty. The return value is a tuple of (rows, cols). """ TIOCGWINSZ = getattr(termios, 'TIOCGWINSZ', 1074295912L) s = struct.pack('HHHH', 0, 0, 0, 0) x = fcntl.ioctl(self.fileno(), TIOCGWINSZ, s) r...
[ "This", "returns", "the", "terminal", "window", "size", "of", "the", "child", "tty", ".", "The", "return", "value", "is", "a", "tuple", "of", "(", "rows", "cols", ")", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py#L1460-L1468
[ "def", "getwinsize", "(", "self", ")", ":", "TIOCGWINSZ", "=", "getattr", "(", "termios", ",", "'TIOCGWINSZ'", ",", "1074295912L", ")", "s", "=", "struct", ".", "pack", "(", "'HHHH'", ",", "0", ",", "0", ",", "0", ",", "0", ")", "x", "=", "fcntl", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
spawnb.setwinsize
This sets the terminal window size of the child tty. This will cause a SIGWINCH signal to be sent to the child. This does not change the physical window size. It changes the size reported to TTY-aware applications like vi or curses -- applications that respond to the SIGWINCH signal.
environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py
def setwinsize(self, r, c): """This sets the terminal window size of the child tty. This will cause a SIGWINCH signal to be sent to the child. This does not change the physical window size. It changes the size reported to TTY-aware applications like vi or curses -- applications that res...
def setwinsize(self, r, c): """This sets the terminal window size of the child tty. This will cause a SIGWINCH signal to be sent to the child. This does not change the physical window size. It changes the size reported to TTY-aware applications like vi or curses -- applications that res...
[ "This", "sets", "the", "terminal", "window", "size", "of", "the", "child", "tty", ".", "This", "will", "cause", "a", "SIGWINCH", "signal", "to", "be", "sent", "to", "the", "child", ".", "This", "does", "not", "change", "the", "physical", "window", "size"...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py#L1470-L1491
[ "def", "setwinsize", "(", "self", ",", "r", ",", "c", ")", ":", "# Check for buggy platforms. Some Python versions on some platforms", "# (notably OSF1 Alpha and RedHat 7.1) truncate the value for", "# termios.TIOCSWINSZ. It is not clear why this happens.", "# These platforms don't seem to...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
spawnb.interact
This gives control of the child process to the interactive user (the human at the keyboard). Keystrokes are sent to the child process, and the stdout and stderr output of the child process is printed. This simply echos the child stdout and child stderr to the real stdout and it echos the...
environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py
def interact(self, escape_character = b'\x1d', input_filter = None, output_filter = None): """This gives control of the child process to the interactive user (the human at the keyboard). Keystrokes are sent to the child process, and the stdout and stderr output of the child process is printed. ...
def interact(self, escape_character = b'\x1d', input_filter = None, output_filter = None): """This gives control of the child process to the interactive user (the human at the keyboard). Keystrokes are sent to the child process, and the stdout and stderr output of the child process is printed. ...
[ "This", "gives", "control", "of", "the", "child", "process", "to", "the", "interactive", "user", "(", "the", "human", "at", "the", "keyboard", ")", ".", "Keystrokes", "are", "sent", "to", "the", "child", "process", "and", "the", "stdout", "and", "stderr", ...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py#L1493-L1538
[ "def", "interact", "(", "self", ",", "escape_character", "=", "b'\\x1d'", ",", "input_filter", "=", "None", ",", "output_filter", "=", "None", ")", ":", "# Flush the buffer.", "if", "PY3", ":", "self", ".", "stdout", ".", "write", "(", "_cast_unicode", "(", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
spawnb.__interact_copy
This is used by the interact() method.
environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py
def __interact_copy(self, escape_character = None, input_filter = None, output_filter = None): """This is used by the interact() method. """ while self.isalive(): r,w,e = self.__select([self.child_fd, self.STDIN_FILENO], [], []) if self.child_fd in r: da...
def __interact_copy(self, escape_character = None, input_filter = None, output_filter = None): """This is used by the interact() method. """ while self.isalive(): r,w,e = self.__select([self.child_fd, self.STDIN_FILENO], [], []) if self.child_fd in r: da...
[ "This", "is", "used", "by", "the", "interact", "()", "method", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py#L1556-L1578
[ "def", "__interact_copy", "(", "self", ",", "escape_character", "=", "None", ",", "input_filter", "=", "None", ",", "output_filter", "=", "None", ")", ":", "while", "self", ".", "isalive", "(", ")", ":", "r", ",", "w", ",", "e", "=", "self", ".", "__...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
spawnb.__select
This is a wrapper around select.select() that ignores signals. If select.select raises a select.error exception and errno is an EINTR error then it is ignored. Mainly this is used to ignore sigwinch (terminal resize).
environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py
def __select (self, iwtd, owtd, ewtd, timeout=None): """This is a wrapper around select.select() that ignores signals. If select.select raises a select.error exception and errno is an EINTR error then it is ignored. Mainly this is used to ignore sigwinch (terminal resize). """ ...
def __select (self, iwtd, owtd, ewtd, timeout=None): """This is a wrapper around select.select() that ignores signals. If select.select raises a select.error exception and errno is an EINTR error then it is ignored. Mainly this is used to ignore sigwinch (terminal resize). """ ...
[ "This", "is", "a", "wrapper", "around", "select", ".", "select", "()", "that", "ignores", "signals", ".", "If", "select", ".", "select", "raises", "a", "select", ".", "error", "exception", "and", "errno", "is", "an", "EINTR", "error", "then", "it", "is",...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py#L1580-L1602
[ "def", "__select", "(", "self", ",", "iwtd", ",", "owtd", ",", "ewtd", ",", "timeout", "=", "None", ")", ":", "# if select() is interrupted by a signal (errno==EINTR) then", "# we loop back and enter the select() again.", "if", "timeout", "is", "not", "None", ":", "en...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
spawn._prepare_regex_pattern
Recompile bytes regexes as unicode regexes.
environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py
def _prepare_regex_pattern(self, p): "Recompile bytes regexes as unicode regexes." if isinstance(p.pattern, bytes): p = re.compile(p.pattern.decode(self.encoding), p.flags) return p
def _prepare_regex_pattern(self, p): "Recompile bytes regexes as unicode regexes." if isinstance(p.pattern, bytes): p = re.compile(p.pattern.decode(self.encoding), p.flags) return p
[ "Recompile", "bytes", "regexes", "as", "unicode", "regexes", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py#L1620-L1624
[ "def", "_prepare_regex_pattern", "(", "self", ",", "p", ")", ":", "if", "isinstance", "(", "p", ".", "pattern", ",", "bytes", ")", ":", "p", "=", "re", ".", "compile", "(", "p", ".", "pattern", ".", "decode", "(", "self", ".", "encoding", ")", ",",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
searcher_string.search
This searches 'buffer' for the first occurence of one of the search strings. 'freshlen' must indicate the number of bytes at the end of 'buffer' which have not been searched before. It helps to avoid searching the same, possibly big, buffer over and over again. See class spawn for the ...
environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py
def search(self, buffer, freshlen, searchwindowsize=None): """This searches 'buffer' for the first occurence of one of the search strings. 'freshlen' must indicate the number of bytes at the end of 'buffer' which have not been searched before. It helps to avoid searching the same, poss...
def search(self, buffer, freshlen, searchwindowsize=None): """This searches 'buffer' for the first occurence of one of the search strings. 'freshlen' must indicate the number of bytes at the end of 'buffer' which have not been searched before. It helps to avoid searching the same, poss...
[ "This", "searches", "buffer", "for", "the", "first", "occurence", "of", "one", "of", "the", "search", "strings", ".", "freshlen", "must", "indicate", "the", "number", "of", "bytes", "at", "the", "end", "of", "buffer", "which", "have", "not", "been", "searc...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py#L1688-L1732
[ "def", "search", "(", "self", ",", "buffer", ",", "freshlen", ",", "searchwindowsize", "=", "None", ")", ":", "absurd_match", "=", "len", "(", "buffer", ")", "first_match", "=", "absurd_match", "# 'freshlen' helps a lot here. Further optimizations could", "# possibly ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
searcher_re.search
This searches 'buffer' for the first occurence of one of the regular expressions. 'freshlen' must indicate the number of bytes at the end of 'buffer' which have not been searched before. See class spawn for the 'searchwindowsize' argument. If there is a match this returns the index of ...
environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py
def search(self, buffer, freshlen, searchwindowsize=None): """This searches 'buffer' for the first occurence of one of the regular expressions. 'freshlen' must indicate the number of bytes at the end of 'buffer' which have not been searched before. See class spawn for the 'searchwindow...
def search(self, buffer, freshlen, searchwindowsize=None): """This searches 'buffer' for the first occurence of one of the regular expressions. 'freshlen' must indicate the number of bytes at the end of 'buffer' which have not been searched before. See class spawn for the 'searchwindow...
[ "This", "searches", "buffer", "for", "the", "first", "occurence", "of", "one", "of", "the", "regular", "expressions", ".", "freshlen", "must", "indicate", "the", "number", "of", "bytes", "at", "the", "end", "of", "buffer", "which", "have", "not", "been", "...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py#L1786-L1819
[ "def", "search", "(", "self", ",", "buffer", ",", "freshlen", ",", "searchwindowsize", "=", "None", ")", ":", "absurd_match", "=", "len", "(", "buffer", ")", "first_match", "=", "absurd_match", "# 'freshlen' doesn't help here -- we cannot predict the", "# length of a ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
ZMQShellDisplayHook.finish_displayhook
Finish up all displayhook activities.
environment/lib/python2.7/site-packages/IPython/zmq/displayhook.py
def finish_displayhook(self): """Finish up all displayhook activities.""" sys.stdout.flush() sys.stderr.flush() self.session.send(self.pub_socket, self.msg, ident=self.topic) self.msg = None
def finish_displayhook(self): """Finish up all displayhook activities.""" sys.stdout.flush() sys.stderr.flush() self.session.send(self.pub_socket, self.msg, ident=self.topic) self.msg = None
[ "Finish", "up", "all", "displayhook", "activities", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/displayhook.py#L57-L62
[ "def", "finish_displayhook", "(", "self", ")", ":", "sys", ".", "stdout", ".", "flush", "(", ")", "sys", ".", "stderr", ".", "flush", "(", ")", "self", ".", "session", ".", "send", "(", "self", ".", "pub_socket", ",", "self", ".", "msg", ",", "iden...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
log_listener
Progress Monitor listener that logs all updates to the given logger
progressmonitor/listener.py
def log_listener(log:logging.Logger=None, level=logging.INFO): """Progress Monitor listener that logs all updates to the given logger""" if log is None: log = logging.getLogger("ProgressMonitor") def listen(monitor): name = "{}: ".format(monitor.name) if monitor.name is not None else "" ...
def log_listener(log:logging.Logger=None, level=logging.INFO): """Progress Monitor listener that logs all updates to the given logger""" if log is None: log = logging.getLogger("ProgressMonitor") def listen(monitor): name = "{}: ".format(monitor.name) if monitor.name is not None else "" ...
[ "Progress", "Monitor", "listener", "that", "logs", "all", "updates", "to", "the", "given", "logger" ]
amcat/progressmonitor
python
https://github.com/amcat/progressmonitor/blob/d4cabebc95bfd1447120f601c094b20bee954285/progressmonitor/listener.py#L13-L22
[ "def", "log_listener", "(", "log", ":", "logging", ".", "Logger", "=", "None", ",", "level", "=", "logging", ".", "INFO", ")", ":", "if", "log", "is", "None", ":", "log", "=", "logging", ".", "getLogger", "(", "\"ProgressMonitor\"", ")", "def", "listen...
d4cabebc95bfd1447120f601c094b20bee954285
test
unpack_directory
Unpack" a directory, using the same interface as for archives Raises ``UnrecognizedFormat`` if `filename` is not a directory
environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/setuptools/archive_util.py
def unpack_directory(filename, extract_dir, progress_filter=default_filter): """"Unpack" a directory, using the same interface as for archives Raises ``UnrecognizedFormat`` if `filename` is not a directory """ if not os.path.isdir(filename): raise UnrecognizedFormat("%s is not a directory" % (f...
def unpack_directory(filename, extract_dir, progress_filter=default_filter): """"Unpack" a directory, using the same interface as for archives Raises ``UnrecognizedFormat`` if `filename` is not a directory """ if not os.path.isdir(filename): raise UnrecognizedFormat("%s is not a directory" % (f...
[ "Unpack", "a", "directory", "using", "the", "same", "interface", "as", "for", "archives" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/setuptools/archive_util.py#L83-L105
[ "def", "unpack_directory", "(", "filename", ",", "extract_dir", ",", "progress_filter", "=", "default_filter", ")", ":", "if", "not", "os", ".", "path", ".", "isdir", "(", "filename", ")", ":", "raise", "UnrecognizedFormat", "(", "\"%s is not a directory\"", "%"...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
unpack_tarfile
Unpack tar/tar.gz/tar.bz2 `filename` to `extract_dir` Raises ``UnrecognizedFormat`` if `filename` is not a tarfile (as determined by ``tarfile.open()``). See ``unpack_archive()`` for an explanation of the `progress_filter` argument.
environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/setuptools/archive_util.py
def unpack_tarfile(filename, extract_dir, progress_filter=default_filter): """Unpack tar/tar.gz/tar.bz2 `filename` to `extract_dir` Raises ``UnrecognizedFormat`` if `filename` is not a tarfile (as determined by ``tarfile.open()``). See ``unpack_archive()`` for an explanation of the `progress_filter` a...
def unpack_tarfile(filename, extract_dir, progress_filter=default_filter): """Unpack tar/tar.gz/tar.bz2 `filename` to `extract_dir` Raises ``UnrecognizedFormat`` if `filename` is not a tarfile (as determined by ``tarfile.open()``). See ``unpack_archive()`` for an explanation of the `progress_filter` a...
[ "Unpack", "tar", "/", "tar", ".", "gz", "/", "tar", ".", "bz2", "filename", "to", "extract_dir" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/setuptools/archive_util.py#L168-L204
[ "def", "unpack_tarfile", "(", "filename", ",", "extract_dir", ",", "progress_filter", "=", "default_filter", ")", ":", "try", ":", "tarobj", "=", "tarfile", ".", "open", "(", "filename", ")", "except", "tarfile", ".", "TarError", ":", "raise", "UnrecognizedFor...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Context.emit
Emit a message to the user. :param msg: The message to emit. If ``debug`` is ``True``, the message will be emitted to ``stderr`` only if the ``debug`` attribute is ``True``. If ``debug`` is ``False``, the message will be emitted to ...
timid/context.py
def emit(self, msg, level=1, debug=False): """ Emit a message to the user. :param msg: The message to emit. If ``debug`` is ``True``, the message will be emitted to ``stderr`` only if the ``debug`` attribute is ``True``. If ``debug`` ...
def emit(self, msg, level=1, debug=False): """ Emit a message to the user. :param msg: The message to emit. If ``debug`` is ``True``, the message will be emitted to ``stderr`` only if the ``debug`` attribute is ``True``. If ``debug`` ...
[ "Emit", "a", "message", "to", "the", "user", "." ]
rackerlabs/timid
python
https://github.com/rackerlabs/timid/blob/b1c6aa159ab380a033740f4aa392cf0d125e0ac6/timid/context.py#L55-L88
[ "def", "emit", "(", "self", ",", "msg", ",", "level", "=", "1", ",", "debug", "=", "False", ")", ":", "# Is it a debug message?", "if", "debug", ":", "if", "not", "self", ".", "debug", ":", "# Debugging not enabled, don't emit the message", "return", "stream",...
b1c6aa159ab380a033740f4aa392cf0d125e0ac6