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
EngineCommunicator.connect
connect to peers. `peers` will be a 3-tuples, of the form: (location, north_addr, east_addr) as produced by
environment/share/doc/ipython/examples/parallel/wave2D/communicator.py
def connect(self, south_peer=None, west_peer=None): """connect to peers. `peers` will be a 3-tuples, of the form: (location, north_addr, east_addr) as produced by """ if south_peer is not None: location, url, _ = south_peer self.south.connect(disambiguate...
def connect(self, south_peer=None, west_peer=None): """connect to peers. `peers` will be a 3-tuples, of the form: (location, north_addr, east_addr) as produced by """ if south_peer is not None: location, url, _ = south_peer self.south.connect(disambiguate...
[ "connect", "to", "peers", ".", "peers", "will", "be", "a", "3", "-", "tuples", "of", "the", "form", ":", "(", "location", "north_addr", "east_addr", ")", "as", "produced", "by" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/share/doc/ipython/examples/parallel/wave2D/communicator.py#L47-L57
[ "def", "connect", "(", "self", ",", "south_peer", "=", "None", ",", "west_peer", "=", "None", ")", ":", "if", "south_peer", "is", "not", "None", ":", "location", ",", "url", ",", "_", "=", "south_peer", "self", ".", "south", ".", "connect", "(", "dis...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Extension._convert_pyx_sources_to_c
convert .pyx extensions to .c
environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/setuptools/extension.py
def _convert_pyx_sources_to_c(self): "convert .pyx extensions to .c" def pyx_to_c(source): if source.endswith('.pyx'): source = source[:-4] + '.c' return source self.sources = map(pyx_to_c, self.sources)
def _convert_pyx_sources_to_c(self): "convert .pyx extensions to .c" def pyx_to_c(source): if source.endswith('.pyx'): source = source[:-4] + '.c' return source self.sources = map(pyx_to_c, self.sources)
[ "convert", ".", "pyx", "extensions", "to", ".", "c" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/setuptools/extension.py#L32-L38
[ "def", "_convert_pyx_sources_to_c", "(", "self", ")", ":", "def", "pyx_to_c", "(", "source", ")", ":", "if", "source", ".", "endswith", "(", "'.pyx'", ")", ":", "source", "=", "source", "[", ":", "-", "4", "]", "+", "'.c'", "return", "source", "self", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
main
watch iopub channel, and print messages
environment/share/doc/ipython/examples/parallel/iopubwatcher.py
def main(connection_file): """watch iopub channel, and print messages""" ctx = zmq.Context.instance() with open(connection_file) as f: cfg = json.loads(f.read()) location = cfg['location'] reg_url = cfg['url'] session = Session(key=str_to_bytes(cfg['exec_key'])) q...
def main(connection_file): """watch iopub channel, and print messages""" ctx = zmq.Context.instance() with open(connection_file) as f: cfg = json.loads(f.read()) location = cfg['location'] reg_url = cfg['url'] session = Session(key=str_to_bytes(cfg['exec_key'])) q...
[ "watch", "iopub", "channel", "and", "print", "messages" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/share/doc/ipython/examples/parallel/iopubwatcher.py#L27-L75
[ "def", "main", "(", "connection_file", ")", ":", "ctx", "=", "zmq", ".", "Context", ".", "instance", "(", ")", "with", "open", "(", "connection_file", ")", "as", "f", ":", "cfg", "=", "json", ".", "loads", "(", "f", ".", "read", "(", ")", ")", "l...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
decorator
decorator(caller) converts a caller function into a decorator; decorator(caller, func) decorates a function using a caller.
environment/lib/python2.7/site-packages/IPython/external/decorator/_decorator.py
def decorator(caller, func=None): """ decorator(caller) converts a caller function into a decorator; decorator(caller, func) decorates a function using a caller. """ if func is not None: # returns a decorated function evaldict = func.func_globals.copy() evaldict['_call_'] = caller ...
def decorator(caller, func=None): """ decorator(caller) converts a caller function into a decorator; decorator(caller, func) decorates a function using a caller. """ if func is not None: # returns a decorated function evaldict = func.func_globals.copy() evaldict['_call_'] = caller ...
[ "decorator", "(", "caller", ")", "converts", "a", "caller", "function", "into", "a", "decorator", ";", "decorator", "(", "caller", "func", ")", "decorates", "a", "function", "using", "a", "caller", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/external/decorator/_decorator.py#L196-L220
[ "def", "decorator", "(", "caller", ",", "func", "=", "None", ")", ":", "if", "func", "is", "not", "None", ":", "# returns a decorated function", "evaldict", "=", "func", ".", "func_globals", ".", "copy", "(", ")", "evaldict", "[", "'_call_'", "]", "=", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
InstallCommand._build_package_finder
Create a package finder appropriate to this install command. This method is meant to be overridden by subclasses, not called directly.
virtualEnvironment/lib/python2.7/site-packages/pip/commands/install.py
def _build_package_finder(self, options, index_urls, session): """ Create a package finder appropriate to this install command. This method is meant to be overridden by subclasses, not called directly. """ return PackageFinder( find_links=options.find_links, ...
def _build_package_finder(self, options, index_urls, session): """ Create a package finder appropriate to this install command. This method is meant to be overridden by subclasses, not called directly. """ return PackageFinder( find_links=options.find_links, ...
[ "Create", "a", "package", "finder", "appropriate", "to", "this", "install", "command", ".", "This", "method", "is", "meant", "to", "be", "overridden", "by", "subclasses", "not", "called", "directly", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/pip/commands/install.py#L181-L198
[ "def", "_build_package_finder", "(", "self", ",", "options", ",", "index_urls", ",", "session", ")", ":", "return", "PackageFinder", "(", "find_links", "=", "options", ".", "find_links", ",", "index_urls", "=", "index_urls", ",", "use_wheel", "=", "options", "...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
catch_config_error
Method decorator for catching invalid config (Trait/ArgumentErrors) during init. On a TraitError (generally caused by bad config), this will print the trait's message, and exit the app. For use on init methods, to prevent invoking excepthook on invalid input.
environment/lib/python2.7/site-packages/IPython/config/application.py
def catch_config_error(method, app, *args, **kwargs): """Method decorator for catching invalid config (Trait/ArgumentErrors) during init. On a TraitError (generally caused by bad config), this will print the trait's message, and exit the app. For use on init methods, to prevent invoking excepthook...
def catch_config_error(method, app, *args, **kwargs): """Method decorator for catching invalid config (Trait/ArgumentErrors) during init. On a TraitError (generally caused by bad config), this will print the trait's message, and exit the app. For use on init methods, to prevent invoking excepthook...
[ "Method", "decorator", "for", "catching", "invalid", "config", "(", "Trait", "/", "ArgumentErrors", ")", "during", "init", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/config/application.py#L75-L92
[ "def", "catch_config_error", "(", "method", ",", "app", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "try", ":", "return", "method", "(", "app", ",", "*", "args", ",", "*", "*", "kwargs", ")", "except", "(", "TraitError", ",", "ArgumentError"...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
boolean_flag
Helper for building basic --trait, --no-trait flags. Parameters ---------- name : str The name of the flag. configurable : str The 'Class.trait' string of the trait to be set/unset with the flag set_help : unicode help string for --name flag unset_help : unicode ...
environment/lib/python2.7/site-packages/IPython/config/application.py
def boolean_flag(name, configurable, set_help='', unset_help=''): """Helper for building basic --trait, --no-trait flags. Parameters ---------- name : str The name of the flag. configurable : str The 'Class.trait' string of the trait to be set/unset with the flag set_help : uni...
def boolean_flag(name, configurable, set_help='', unset_help=''): """Helper for building basic --trait, --no-trait flags. Parameters ---------- name : str The name of the flag. configurable : str The 'Class.trait' string of the trait to be set/unset with the flag set_help : uni...
[ "Helper", "for", "building", "basic", "--", "trait", "--", "no", "-", "trait", "flags", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/config/application.py#L480-L510
[ "def", "boolean_flag", "(", "name", ",", "configurable", ",", "set_help", "=", "''", ",", "unset_help", "=", "''", ")", ":", "# default helpstrings", "set_help", "=", "set_help", "or", "\"set %s=True\"", "%", "configurable", "unset_help", "=", "unset_help", "or"...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Application._log_level_changed
Adjust the log level when log_level is set.
environment/lib/python2.7/site-packages/IPython/config/application.py
def _log_level_changed(self, name, old, new): """Adjust the log level when log_level is set.""" if isinstance(new, basestring): new = getattr(logging, new) self.log_level = new self.log.setLevel(new)
def _log_level_changed(self, name, old, new): """Adjust the log level when log_level is set.""" if isinstance(new, basestring): new = getattr(logging, new) self.log_level = new self.log.setLevel(new)
[ "Adjust", "the", "log", "level", "when", "log_level", "is", "set", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/config/application.py#L129-L134
[ "def", "_log_level_changed", "(", "self", ",", "name", ",", "old", ",", "new", ")", ":", "if", "isinstance", "(", "new", ",", "basestring", ")", ":", "new", "=", "getattr", "(", "logging", ",", "new", ")", "self", ".", "log_level", "=", "new", "self"...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Application._log_default
Start logging for this application. The default is to log to stdout using a StreaHandler. The log level starts at loggin.WARN, but this can be adjusted by setting the ``log_level`` attribute.
environment/lib/python2.7/site-packages/IPython/config/application.py
def _log_default(self): """Start logging for this application. The default is to log to stdout using a StreaHandler. The log level starts at loggin.WARN, but this can be adjusted by setting the ``log_level`` attribute. """ log = logging.getLogger(self.__class__.__name__)...
def _log_default(self): """Start logging for this application. The default is to log to stdout using a StreaHandler. The log level starts at loggin.WARN, but this can be adjusted by setting the ``log_level`` attribute. """ log = logging.getLogger(self.__class__.__name__)...
[ "Start", "logging", "for", "this", "application", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/config/application.py#L140-L158
[ "def", "_log_default", "(", "self", ")", ":", "log", "=", "logging", ".", "getLogger", "(", "self", ".", "__class__", ".", "__name__", ")", "log", ".", "setLevel", "(", "self", ".", "log_level", ")", "if", "sys", ".", "executable", ".", "endswith", "("...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Application._flags_changed
ensure flags dict is valid
environment/lib/python2.7/site-packages/IPython/config/application.py
def _flags_changed(self, name, old, new): """ensure flags dict is valid""" for key,value in new.iteritems(): assert len(value) == 2, "Bad flag: %r:%s"%(key,value) assert isinstance(value[0], (dict, Config)), "Bad flag: %r:%s"%(key,value) assert isinstance(value[1], ba...
def _flags_changed(self, name, old, new): """ensure flags dict is valid""" for key,value in new.iteritems(): assert len(value) == 2, "Bad flag: %r:%s"%(key,value) assert isinstance(value[0], (dict, Config)), "Bad flag: %r:%s"%(key,value) assert isinstance(value[1], ba...
[ "ensure", "flags", "dict", "is", "valid" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/config/application.py#L168-L173
[ "def", "_flags_changed", "(", "self", ",", "name", ",", "old", ",", "new", ")", ":", "for", "key", ",", "value", "in", "new", ".", "iteritems", "(", ")", ":", "assert", "len", "(", "value", ")", "==", "2", ",", "\"Bad flag: %r:%s\"", "%", "(", "key...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Application.print_alias_help
Print the alias part of the help.
environment/lib/python2.7/site-packages/IPython/config/application.py
def print_alias_help(self): """Print the alias part of the help.""" if not self.aliases: return lines = [] classdict = {} for cls in self.classes: # include all parents (up to, but excluding Configurable) in available names for c in cls.mro()[...
def print_alias_help(self): """Print the alias part of the help.""" if not self.aliases: return lines = [] classdict = {} for cls in self.classes: # include all parents (up to, but excluding Configurable) in available names for c in cls.mro()[...
[ "Print", "the", "alias", "part", "of", "the", "help", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/config/application.py#L218-L242
[ "def", "print_alias_help", "(", "self", ")", ":", "if", "not", "self", ".", "aliases", ":", "return", "lines", "=", "[", "]", "classdict", "=", "{", "}", "for", "cls", "in", "self", ".", "classes", ":", "# include all parents (up to, but excluding Configurable...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Application.print_flag_help
Print the flag part of the help.
environment/lib/python2.7/site-packages/IPython/config/application.py
def print_flag_help(self): """Print the flag part of the help.""" if not self.flags: return lines = [] for m, (cfg,help) in self.flags.iteritems(): prefix = '--' if len(m) > 1 else '-' lines.append(prefix+m) lines.append(indent(dedent(help...
def print_flag_help(self): """Print the flag part of the help.""" if not self.flags: return lines = [] for m, (cfg,help) in self.flags.iteritems(): prefix = '--' if len(m) > 1 else '-' lines.append(prefix+m) lines.append(indent(dedent(help...
[ "Print", "the", "flag", "part", "of", "the", "help", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/config/application.py#L244-L255
[ "def", "print_flag_help", "(", "self", ")", ":", "if", "not", "self", ".", "flags", ":", "return", "lines", "=", "[", "]", "for", "m", ",", "(", "cfg", ",", "help", ")", "in", "self", ".", "flags", ".", "iteritems", "(", ")", ":", "prefix", "=", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Application.print_subcommands
Print the subcommand part of the help.
environment/lib/python2.7/site-packages/IPython/config/application.py
def print_subcommands(self): """Print the subcommand part of the help.""" if not self.subcommands: return lines = ["Subcommands"] lines.append('-'*len(lines[0])) lines.append('') for p in wrap_paragraphs(self.subcommand_description): lines.append(...
def print_subcommands(self): """Print the subcommand part of the help.""" if not self.subcommands: return lines = ["Subcommands"] lines.append('-'*len(lines[0])) lines.append('') for p in wrap_paragraphs(self.subcommand_description): lines.append(...
[ "Print", "the", "subcommand", "part", "of", "the", "help", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/config/application.py#L271-L287
[ "def", "print_subcommands", "(", "self", ")", ":", "if", "not", "self", ".", "subcommands", ":", "return", "lines", "=", "[", "\"Subcommands\"", "]", "lines", ".", "append", "(", "'-'", "*", "len", "(", "lines", "[", "0", "]", ")", ")", "lines", ".",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Application.print_help
Print the help for each Configurable class in self.classes. If classes=False (the default), only flags and aliases are printed.
environment/lib/python2.7/site-packages/IPython/config/application.py
def print_help(self, classes=False): """Print the help for each Configurable class in self.classes. If classes=False (the default), only flags and aliases are printed. """ self.print_subcommands() self.print_options() if classes: if self.classes: ...
def print_help(self, classes=False): """Print the help for each Configurable class in self.classes. If classes=False (the default), only flags and aliases are printed. """ self.print_subcommands() self.print_options() if classes: if self.classes: ...
[ "Print", "the", "help", "for", "each", "Configurable", "class", "in", "self", ".", "classes", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/config/application.py#L289-L311
[ "def", "print_help", "(", "self", ",", "classes", "=", "False", ")", ":", "self", ".", "print_subcommands", "(", ")", "self", ".", "print_options", "(", ")", "if", "classes", ":", "if", "self", ".", "classes", ":", "print", "\"Class parameters\"", "print",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Application.print_examples
Print usage and examples. This usage string goes at the end of the command line help string and should contain examples of the application's usage.
environment/lib/python2.7/site-packages/IPython/config/application.py
def print_examples(self): """Print usage and examples. This usage string goes at the end of the command line help string and should contain examples of the application's usage. """ if self.examples: print "Examples" print "--------" print ...
def print_examples(self): """Print usage and examples. This usage string goes at the end of the command line help string and should contain examples of the application's usage. """ if self.examples: print "Examples" print "--------" print ...
[ "Print", "usage", "and", "examples", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/config/application.py#L319-L330
[ "def", "print_examples", "(", "self", ")", ":", "if", "self", ".", "examples", ":", "print", "\"Examples\"", "print", "\"--------\"", "print", "print", "indent", "(", "dedent", "(", "self", ".", "examples", ".", "strip", "(", ")", ")", ")", "print" ]
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Application.update_config
Fire the traits events when the config is updated.
environment/lib/python2.7/site-packages/IPython/config/application.py
def update_config(self, config): """Fire the traits events when the config is updated.""" # Save a copy of the current config. newconfig = deepcopy(self.config) # Merge the new config into the current one. newconfig._merge(config) # Save the combined config as self.config...
def update_config(self, config): """Fire the traits events when the config is updated.""" # Save a copy of the current config. newconfig = deepcopy(self.config) # Merge the new config into the current one. newconfig._merge(config) # Save the combined config as self.config...
[ "Fire", "the", "traits", "events", "when", "the", "config", "is", "updated", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/config/application.py#L336-L344
[ "def", "update_config", "(", "self", ",", "config", ")", ":", "# Save a copy of the current config.", "newconfig", "=", "deepcopy", "(", "self", ".", "config", ")", "# Merge the new config into the current one.", "newconfig", ".", "_merge", "(", "config", ")", "# Save...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Application.initialize_subcommand
Initialize a subcommand with argv.
environment/lib/python2.7/site-packages/IPython/config/application.py
def initialize_subcommand(self, subc, argv=None): """Initialize a subcommand with argv.""" subapp,help = self.subcommands.get(subc) if isinstance(subapp, basestring): subapp = import_item(subapp) # clear existing instances self.__class__.clear_instance() # i...
def initialize_subcommand(self, subc, argv=None): """Initialize a subcommand with argv.""" subapp,help = self.subcommands.get(subc) if isinstance(subapp, basestring): subapp = import_item(subapp) # clear existing instances self.__class__.clear_instance() # i...
[ "Initialize", "a", "subcommand", "with", "argv", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/config/application.py#L347-L359
[ "def", "initialize_subcommand", "(", "self", ",", "subc", ",", "argv", "=", "None", ")", ":", "subapp", ",", "help", "=", "self", ".", "subcommands", ".", "get", "(", "subc", ")", "if", "isinstance", "(", "subapp", ",", "basestring", ")", ":", "subapp"...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Application.flatten_flags
flatten flags and aliases, so cl-args override as expected. This prevents issues such as an alias pointing to InteractiveShell, but a config file setting the same trait in TerminalInteraciveShell getting inappropriate priority over the command-line arg. Only aliases with exactl...
environment/lib/python2.7/site-packages/IPython/config/application.py
def flatten_flags(self): """flatten flags and aliases, so cl-args override as expected. This prevents issues such as an alias pointing to InteractiveShell, but a config file setting the same trait in TerminalInteraciveShell getting inappropriate priority over the command-line ar...
def flatten_flags(self): """flatten flags and aliases, so cl-args override as expected. This prevents issues such as an alias pointing to InteractiveShell, but a config file setting the same trait in TerminalInteraciveShell getting inappropriate priority over the command-line ar...
[ "flatten", "flags", "and", "aliases", "so", "cl", "-", "args", "override", "as", "expected", ".", "This", "prevents", "issues", "such", "as", "an", "alias", "pointing", "to", "InteractiveShell", "but", "a", "config", "file", "setting", "the", "same", "trait"...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/config/application.py#L361-L404
[ "def", "flatten_flags", "(", "self", ")", ":", "# build a tree of classes in our list that inherit from a particular", "# it will be a dict by parent classname of classes in our list", "# that are descendents", "mro_tree", "=", "defaultdict", "(", "list", ")", "for", "cls", "in", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Application.parse_command_line
Parse the command line arguments.
environment/lib/python2.7/site-packages/IPython/config/application.py
def parse_command_line(self, argv=None): """Parse the command line arguments.""" argv = sys.argv[1:] if argv is None else argv if argv and argv[0] == 'help': # turn `ipython help notebook` into `ipython notebook -h` argv = argv[1:] + ['-h'] if self.subco...
def parse_command_line(self, argv=None): """Parse the command line arguments.""" argv = sys.argv[1:] if argv is None else argv if argv and argv[0] == 'help': # turn `ipython help notebook` into `ipython notebook -h` argv = argv[1:] + ['-h'] if self.subco...
[ "Parse", "the", "command", "line", "arguments", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/config/application.py#L407-L440
[ "def", "parse_command_line", "(", "self", ",", "argv", "=", "None", ")", ":", "argv", "=", "sys", ".", "argv", "[", "1", ":", "]", "if", "argv", "is", "None", "else", "argv", "if", "argv", "and", "argv", "[", "0", "]", "==", "'help'", ":", "# tur...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Application.load_config_file
Load a .py based config file by filename and path.
environment/lib/python2.7/site-packages/IPython/config/application.py
def load_config_file(self, filename, path=None): """Load a .py based config file by filename and path.""" loader = PyFileConfigLoader(filename, path=path) try: config = loader.load_config() except ConfigFileNotFound: # problem finding the file, raise r...
def load_config_file(self, filename, path=None): """Load a .py based config file by filename and path.""" loader = PyFileConfigLoader(filename, path=path) try: config = loader.load_config() except ConfigFileNotFound: # problem finding the file, raise r...
[ "Load", "a", ".", "py", "based", "config", "file", "by", "filename", "and", "path", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/config/application.py#L443-L460
[ "def", "load_config_file", "(", "self", ",", "filename", ",", "path", "=", "None", ")", ":", "loader", "=", "PyFileConfigLoader", "(", "filename", ",", "path", "=", "path", ")", "try", ":", "config", "=", "loader", ".", "load_config", "(", ")", "except",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Application.generate_config_file
generate default config file from Configurables
environment/lib/python2.7/site-packages/IPython/config/application.py
def generate_config_file(self): """generate default config file from Configurables""" lines = ["# Configuration file for %s."%self.name] lines.append('') lines.append('c = get_config()') lines.append('') for cls in self.classes: lines.append(cls.class_config_s...
def generate_config_file(self): """generate default config file from Configurables""" lines = ["# Configuration file for %s."%self.name] lines.append('') lines.append('c = get_config()') lines.append('') for cls in self.classes: lines.append(cls.class_config_s...
[ "generate", "default", "config", "file", "from", "Configurables" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/config/application.py#L462-L470
[ "def", "generate_config_file", "(", "self", ")", ":", "lines", "=", "[", "\"# Configuration file for %s.\"", "%", "self", ".", "name", "]", "lines", ".", "append", "(", "''", ")", "lines", ".", "append", "(", "'c = get_config()'", ")", "lines", ".", "append"...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
downsample
Choose k random elements of array.
environment/share/doc/ipython/examples/parallel/plotting/plotting_backend.py
def downsample(array, k): """Choose k random elements of array.""" length = array.shape[0] indices = random.sample(xrange(length), k) return array[indices]
def downsample(array, k): """Choose k random elements of array.""" length = array.shape[0] indices = random.sample(xrange(length), k) return array[indices]
[ "Choose", "k", "random", "elements", "of", "array", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/share/doc/ipython/examples/parallel/plotting/plotting_backend.py#L35-L39
[ "def", "downsample", "(", "array", ",", "k", ")", ":", "length", "=", "array", ".", "shape", "[", "0", "]", "indices", "=", "random", ".", "sample", "(", "xrange", "(", "length", ")", ",", "k", ")", "return", "array", "[", "indices", "]" ]
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
info_formatter
Produce a sequence of formatted lines from info. `info` is a sequence of pairs (label, data). The produced lines are nicely formatted, ready to print.
virtualEnvironment/lib/python2.7/site-packages/coverage/debug.py
def info_formatter(info): """Produce a sequence of formatted lines from info. `info` is a sequence of pairs (label, data). The produced lines are nicely formatted, ready to print. """ label_len = max([len(l) for l, _d in info]) for label, data in info: if data == []: data ...
def info_formatter(info): """Produce a sequence of formatted lines from info. `info` is a sequence of pairs (label, data). The produced lines are nicely formatted, ready to print. """ label_len = max([len(l) for l, _d in info]) for label, data in info: if data == []: data ...
[ "Produce", "a", "sequence", "of", "formatted", "lines", "from", "info", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/debug.py#L37-L54
[ "def", "info_formatter", "(", "info", ")", ":", "label_len", "=", "max", "(", "[", "len", "(", "l", ")", "for", "l", ",", "_d", "in", "info", "]", ")", "for", "label", ",", "data", "in", "info", ":", "if", "data", "==", "[", "]", ":", "data", ...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
DebugControl.write
Write a line of debug output.
virtualEnvironment/lib/python2.7/site-packages/coverage/debug.py
def write(self, msg): """Write a line of debug output.""" if self.should('pid'): msg = "pid %5d: %s" % (os.getpid(), msg) self.output.write(msg+"\n") self.output.flush()
def write(self, msg): """Write a line of debug output.""" if self.should('pid'): msg = "pid %5d: %s" % (os.getpid(), msg) self.output.write(msg+"\n") self.output.flush()
[ "Write", "a", "line", "of", "debug", "output", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/debug.py#L24-L29
[ "def", "write", "(", "self", ",", "msg", ")", ":", "if", "self", ".", "should", "(", "'pid'", ")", ":", "msg", "=", "\"pid %5d: %s\"", "%", "(", "os", ".", "getpid", "(", ")", ",", "msg", ")", "self", ".", "output", ".", "write", "(", "msg", "+...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
Configurable._config_changed
Update all the class traits having ``config=True`` as metadata. For any class trait with a ``config`` metadata attribute that is ``True``, we update the trait with the value of the corresponding config entry.
environment/lib/python2.7/site-packages/IPython/config/configurable.py
def _config_changed(self, name, old, new): """Update all the class traits having ``config=True`` as metadata. For any class trait with a ``config`` metadata attribute that is ``True``, we update the trait with the value of the corresponding config entry. """ # Get all tr...
def _config_changed(self, name, old, new): """Update all the class traits having ``config=True`` as metadata. For any class trait with a ``config`` metadata attribute that is ``True``, we update the trait with the value of the corresponding config entry. """ # Get all tr...
[ "Update", "all", "the", "class", "traits", "having", "config", "=", "True", "as", "metadata", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/config/configurable.py#L94-L139
[ "def", "_config_changed", "(", "self", ",", "name", ",", "old", ",", "new", ")", ":", "# Get all traits with a config metadata entry that is True", "traits", "=", "self", ".", "traits", "(", "config", "=", "True", ")", "# We auto-load config section for this class as we...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Configurable.class_get_help
Get the help string for this class in ReST format. If `inst` is given, it's current trait values will be used in place of class defaults.
environment/lib/python2.7/site-packages/IPython/config/configurable.py
def class_get_help(cls, inst=None): """Get the help string for this class in ReST format. If `inst` is given, it's current trait values will be used in place of class defaults. """ assert inst is None or isinstance(inst, cls) cls_traits = cls.class_traits(config=...
def class_get_help(cls, inst=None): """Get the help string for this class in ReST format. If `inst` is given, it's current trait values will be used in place of class defaults. """ assert inst is None or isinstance(inst, cls) cls_traits = cls.class_traits(config=...
[ "Get", "the", "help", "string", "for", "this", "class", "in", "ReST", "format", ".", "If", "inst", "is", "given", "it", "s", "current", "trait", "values", "will", "be", "used", "in", "place", "of", "class", "defaults", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/config/configurable.py#L152-L166
[ "def", "class_get_help", "(", "cls", ",", "inst", "=", "None", ")", ":", "assert", "inst", "is", "None", "or", "isinstance", "(", "inst", ",", "cls", ")", "cls_traits", "=", "cls", ".", "class_traits", "(", "config", "=", "True", ")", "final_help", "="...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Configurable.class_get_trait_help
Get the help string for a single trait. If `inst` is given, it's current trait values will be used in place of the class default.
environment/lib/python2.7/site-packages/IPython/config/configurable.py
def class_get_trait_help(cls, trait, inst=None): """Get the help string for a single trait. If `inst` is given, it's current trait values will be used in place of the class default. """ assert inst is None or isinstance(inst, cls) lines = [] header = "--%...
def class_get_trait_help(cls, trait, inst=None): """Get the help string for a single trait. If `inst` is given, it's current trait values will be used in place of the class default. """ assert inst is None or isinstance(inst, cls) lines = [] header = "--%...
[ "Get", "the", "help", "string", "for", "a", "single", "trait", ".", "If", "inst", "is", "given", "it", "s", "current", "trait", "values", "will", "be", "used", "in", "place", "of", "the", "class", "default", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/config/configurable.py#L169-L198
[ "def", "class_get_trait_help", "(", "cls", ",", "trait", ",", "inst", "=", "None", ")", ":", "assert", "inst", "is", "None", "or", "isinstance", "(", "inst", ",", "cls", ")", "lines", "=", "[", "]", "header", "=", "\"--%s.%s=<%s>\"", "%", "(", "cls", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Configurable.class_config_section
Get the config class config section
environment/lib/python2.7/site-packages/IPython/config/configurable.py
def class_config_section(cls): """Get the config class config section""" def c(s): """return a commented, wrapped block.""" s = '\n\n'.join(wrap_paragraphs(s, 78)) return '# ' + s.replace('\n', '\n# ') # section header breaker = '#' + '-'*78 ...
def class_config_section(cls): """Get the config class config section""" def c(s): """return a commented, wrapped block.""" s = '\n\n'.join(wrap_paragraphs(s, 78)) return '# ' + s.replace('\n', '\n# ') # section header breaker = '#' + '-'*78 ...
[ "Get", "the", "config", "class", "config", "section" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/config/configurable.py#L206-L248
[ "def", "class_config_section", "(", "cls", ")", ":", "def", "c", "(", "s", ")", ":", "\"\"\"return a commented, wrapped block.\"\"\"", "s", "=", "'\\n\\n'", ".", "join", "(", "wrap_paragraphs", "(", "s", ",", "78", ")", ")", "return", "'# '", "+", "s", "."...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
SingletonConfigurable._walk_mro
Walk the cls.mro() for parent classes that are also singletons For use in instance()
environment/lib/python2.7/site-packages/IPython/config/configurable.py
def _walk_mro(cls): """Walk the cls.mro() for parent classes that are also singletons For use in instance() """ for subclass in cls.mro(): if issubclass(cls, subclass) and \ issubclass(subclass, SingletonConfigurable) and \ subclass !...
def _walk_mro(cls): """Walk the cls.mro() for parent classes that are also singletons For use in instance() """ for subclass in cls.mro(): if issubclass(cls, subclass) and \ issubclass(subclass, SingletonConfigurable) and \ subclass !...
[ "Walk", "the", "cls", ".", "mro", "()", "for", "parent", "classes", "that", "are", "also", "singletons" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/config/configurable.py#L263-L273
[ "def", "_walk_mro", "(", "cls", ")", ":", "for", "subclass", "in", "cls", ".", "mro", "(", ")", ":", "if", "issubclass", "(", "cls", ",", "subclass", ")", "and", "issubclass", "(", "subclass", ",", "SingletonConfigurable", ")", "and", "subclass", "!=", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
SingletonConfigurable.clear_instance
unset _instance for this class and singleton parents.
environment/lib/python2.7/site-packages/IPython/config/configurable.py
def clear_instance(cls): """unset _instance for this class and singleton parents. """ if not cls.initialized(): return for subclass in cls._walk_mro(): if isinstance(subclass._instance, cls): # only clear instances that are instances ...
def clear_instance(cls): """unset _instance for this class and singleton parents. """ if not cls.initialized(): return for subclass in cls._walk_mro(): if isinstance(subclass._instance, cls): # only clear instances that are instances ...
[ "unset", "_instance", "for", "this", "class", "and", "singleton", "parents", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/config/configurable.py#L276-L285
[ "def", "clear_instance", "(", "cls", ")", ":", "if", "not", "cls", ".", "initialized", "(", ")", ":", "return", "for", "subclass", "in", "cls", ".", "_walk_mro", "(", ")", ":", "if", "isinstance", "(", "subclass", ".", "_instance", ",", "cls", ")", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
SingletonConfigurable.instance
Returns a global instance of this class. This method create a new instance if none have previously been created and returns a previously created instance is one already exists. The arguments and keyword arguments passed to this method are passed on to the :meth:`__init__` method of the...
environment/lib/python2.7/site-packages/IPython/config/configurable.py
def instance(cls, *args, **kwargs): """Returns a global instance of this class. This method create a new instance if none have previously been created and returns a previously created instance is one already exists. The arguments and keyword arguments passed to this method are passed ...
def instance(cls, *args, **kwargs): """Returns a global instance of this class. This method create a new instance if none have previously been created and returns a previously created instance is one already exists. The arguments and keyword arguments passed to this method are passed ...
[ "Returns", "a", "global", "instance", "of", "this", "class", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/config/configurable.py#L288-L330
[ "def", "instance", "(", "cls", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# Create and save the instance", "if", "cls", ".", "_instance", "is", "None", ":", "inst", "=", "cls", "(", "*", "args", ",", "*", "*", "kwargs", ")", "# Now make sure...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
FailureDetail.configure
Configure plugin.
environment/lib/python2.7/site-packages/nose/plugins/failuredetail.py
def configure(self, options, conf): """Configure plugin. """ if not self.can_configure: return self.enabled = options.detailedErrors self.conf = conf
def configure(self, options, conf): """Configure plugin. """ if not self.can_configure: return self.enabled = options.detailedErrors self.conf = conf
[ "Configure", "plugin", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/plugins/failuredetail.py#L29-L35
[ "def", "configure", "(", "self", ",", "options", ",", "conf", ")", ":", "if", "not", "self", ".", "can_configure", ":", "return", "self", ".", "enabled", "=", "options", ".", "detailedErrors", "self", ".", "conf", "=", "conf" ]
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
FailureDetail.formatFailure
Add detail from traceback inspection to error message of a failure.
environment/lib/python2.7/site-packages/nose/plugins/failuredetail.py
def formatFailure(self, test, err): """Add detail from traceback inspection to error message of a failure. """ ec, ev, tb = err tbinfo = inspect_traceback(tb) test.tbinfo = tbinfo return (ec, '\n'.join([str(ev), tbinfo]), tb)
def formatFailure(self, test, err): """Add detail from traceback inspection to error message of a failure. """ ec, ev, tb = err tbinfo = inspect_traceback(tb) test.tbinfo = tbinfo return (ec, '\n'.join([str(ev), tbinfo]), tb)
[ "Add", "detail", "from", "traceback", "inspection", "to", "error", "message", "of", "a", "failure", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/plugins/failuredetail.py#L37-L43
[ "def", "formatFailure", "(", "self", ",", "test", ",", "err", ")", ":", "ec", ",", "ev", ",", "tb", "=", "err", "tbinfo", "=", "inspect_traceback", "(", "tb", ")", "test", ".", "tbinfo", "=", "tbinfo", "return", "(", "ec", ",", "'\\n'", ".", "join"...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
crash_handler_lite
a light excepthook, adding a small message to the usual traceback
environment/lib/python2.7/site-packages/IPython/core/crashhandler.py
def crash_handler_lite(etype, evalue, tb): """a light excepthook, adding a small message to the usual traceback""" traceback.print_exception(etype, evalue, tb) from IPython.core.interactiveshell import InteractiveShell if InteractiveShell.initialized(): # we are in a Shell environment, give...
def crash_handler_lite(etype, evalue, tb): """a light excepthook, adding a small message to the usual traceback""" traceback.print_exception(etype, evalue, tb) from IPython.core.interactiveshell import InteractiveShell if InteractiveShell.initialized(): # we are in a Shell environment, give...
[ "a", "light", "excepthook", "adding", "a", "small", "message", "to", "the", "usual", "traceback" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/crashhandler.py#L202-L213
[ "def", "crash_handler_lite", "(", "etype", ",", "evalue", ",", "tb", ")", ":", "traceback", ".", "print_exception", "(", "etype", ",", "evalue", ",", "tb", ")", "from", "IPython", ".", "core", ".", "interactiveshell", "import", "InteractiveShell", "if", "Int...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
CrashHandler.make_report
Return a string containing a crash report.
environment/lib/python2.7/site-packages/IPython/core/crashhandler.py
def make_report(self,traceback): """Return a string containing a crash report.""" sec_sep = self.section_sep report = ['*'*75+'\n\n'+'IPython post-mortem report\n\n'] rpt_add = report.append rpt_add(sys_info()) try: config = pformat(self.app.config) ...
def make_report(self,traceback): """Return a string containing a crash report.""" sec_sep = self.section_sep report = ['*'*75+'\n\n'+'IPython post-mortem report\n\n'] rpt_add = report.append rpt_add(sys_info()) try: config = pformat(self.app.config) ...
[ "Return", "a", "string", "containing", "a", "crash", "report", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/crashhandler.py#L180-L199
[ "def", "make_report", "(", "self", ",", "traceback", ")", ":", "sec_sep", "=", "self", ".", "section_sep", "report", "=", "[", "'*'", "*", "75", "+", "'\\n\\n'", "+", "'IPython post-mortem report\\n\\n'", "]", "rpt_add", "=", "report", ".", "append", "rpt_ad...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
setvar
{% setvar <var_name> to <var_value> %}
toolware/templatetags/variable.py
def setvar(parser, token): """ {% setvar <var_name> to <var_value> %} """ try: setvar, var_name, to_, var_value = token.split_contents() except ValueError: raise template.TemplateSyntaxError('Invalid arguments for %r' % token.split_contents()[0]) return SetVarNode(var_name, var_value)
def setvar(parser, token): """ {% setvar <var_name> to <var_value> %} """ try: setvar, var_name, to_, var_value = token.split_contents() except ValueError: raise template.TemplateSyntaxError('Invalid arguments for %r' % token.split_contents()[0]) return SetVarNode(var_name, var_value)
[ "{", "%", "setvar", "<var_name", ">", "to", "<var_value", ">", "%", "}" ]
un33k/django-toolware
python
https://github.com/un33k/django-toolware/blob/973f3e003dc38b812897dab88455bee37dcaf931/toolware/templatetags/variable.py#L23-L31
[ "def", "setvar", "(", "parser", ",", "token", ")", ":", "try", ":", "setvar", ",", "var_name", ",", "to_", ",", "var_value", "=", "token", ".", "split_contents", "(", ")", "except", "ValueError", ":", "raise", "template", ".", "TemplateSyntaxError", "(", ...
973f3e003dc38b812897dab88455bee37dcaf931
test
QtShellSocketChannel.call_handlers
Reimplemented to emit signals instead of making callbacks.
environment/lib/python2.7/site-packages/IPython/frontend/qt/kernelmanager.py
def call_handlers(self, msg): """ Reimplemented to emit signals instead of making callbacks. """ # Emit the generic signal. self.message_received.emit(msg) # Emit signals for specialized message types. msg_type = msg['header']['msg_type'] signal = getattr(self, m...
def call_handlers(self, msg): """ Reimplemented to emit signals instead of making callbacks. """ # Emit the generic signal. self.message_received.emit(msg) # Emit signals for specialized message types. msg_type = msg['header']['msg_type'] signal = getattr(self, m...
[ "Reimplemented", "to", "emit", "signals", "instead", "of", "making", "callbacks", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/kernelmanager.py#L62-L76
[ "def", "call_handlers", "(", "self", ",", "msg", ")", ":", "# Emit the generic signal.", "self", ".", "message_received", ".", "emit", "(", "msg", ")", "# Emit signals for specialized message types.", "msg_type", "=", "msg", "[", "'header'", "]", "[", "'msg_type'", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
QtSubSocketChannel.call_handlers
Reimplemented to emit signals instead of making callbacks.
environment/lib/python2.7/site-packages/IPython/frontend/qt/kernelmanager.py
def call_handlers(self, msg): """ Reimplemented to emit signals instead of making callbacks. """ # Emit the generic signal. self.message_received.emit(msg) # Emit signals for specialized message types. msg_type = msg['header']['msg_type'] signal = getattr(self, ms...
def call_handlers(self, msg): """ Reimplemented to emit signals instead of making callbacks. """ # Emit the generic signal. self.message_received.emit(msg) # Emit signals for specialized message types. msg_type = msg['header']['msg_type'] signal = getattr(self, ms...
[ "Reimplemented", "to", "emit", "signals", "instead", "of", "making", "callbacks", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/kernelmanager.py#L119-L130
[ "def", "call_handlers", "(", "self", ",", "msg", ")", ":", "# Emit the generic signal.", "self", ".", "message_received", ".", "emit", "(", "msg", ")", "# Emit signals for specialized message types.", "msg_type", "=", "msg", "[", "'header'", "]", "[", "'msg_type'", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
QtSubSocketChannel.flush
Reimplemented to ensure that signals are dispatched immediately.
environment/lib/python2.7/site-packages/IPython/frontend/qt/kernelmanager.py
def flush(self): """ Reimplemented to ensure that signals are dispatched immediately. """ super(QtSubSocketChannel, self).flush() QtCore.QCoreApplication.instance().processEvents()
def flush(self): """ Reimplemented to ensure that signals are dispatched immediately. """ super(QtSubSocketChannel, self).flush() QtCore.QCoreApplication.instance().processEvents()
[ "Reimplemented", "to", "ensure", "that", "signals", "are", "dispatched", "immediately", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/kernelmanager.py#L132-L136
[ "def", "flush", "(", "self", ")", ":", "super", "(", "QtSubSocketChannel", ",", "self", ")", ".", "flush", "(", ")", "QtCore", ".", "QCoreApplication", ".", "instance", "(", ")", ".", "processEvents", "(", ")" ]
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
QtStdInSocketChannel.call_handlers
Reimplemented to emit signals instead of making callbacks.
environment/lib/python2.7/site-packages/IPython/frontend/qt/kernelmanager.py
def call_handlers(self, msg): """ Reimplemented to emit signals instead of making callbacks. """ # Emit the generic signal. self.message_received.emit(msg) # Emit signals for specialized message types. msg_type = msg['header']['msg_type'] if msg_type == 'input_re...
def call_handlers(self, msg): """ Reimplemented to emit signals instead of making callbacks. """ # Emit the generic signal. self.message_received.emit(msg) # Emit signals for specialized message types. msg_type = msg['header']['msg_type'] if msg_type == 'input_re...
[ "Reimplemented", "to", "emit", "signals", "instead", "of", "making", "callbacks", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/kernelmanager.py#L151-L160
[ "def", "call_handlers", "(", "self", ",", "msg", ")", ":", "# Emit the generic signal.", "self", ".", "message_received", ".", "emit", "(", "msg", ")", "# Emit signals for specialized message types.", "msg_type", "=", "msg", "[", "'header'", "]", "[", "'msg_type'", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
QtKernelManager.start_kernel
Reimplemented for proper heartbeat management.
environment/lib/python2.7/site-packages/IPython/frontend/qt/kernelmanager.py
def start_kernel(self, *args, **kw): """ Reimplemented for proper heartbeat management. """ if self._shell_channel is not None: self._shell_channel.reset_first_reply() super(QtKernelManager, self).start_kernel(*args, **kw) self.started_kernel.emit()
def start_kernel(self, *args, **kw): """ Reimplemented for proper heartbeat management. """ if self._shell_channel is not None: self._shell_channel.reset_first_reply() super(QtKernelManager, self).start_kernel(*args, **kw) self.started_kernel.emit()
[ "Reimplemented", "for", "proper", "heartbeat", "management", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/kernelmanager.py#L206-L212
[ "def", "start_kernel", "(", "self", ",", "*", "args", ",", "*", "*", "kw", ")", ":", "if", "self", ".", "_shell_channel", "is", "not", "None", ":", "self", ".", "_shell_channel", ".", "reset_first_reply", "(", ")", "super", "(", "QtKernelManager", ",", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
QtKernelManager.start_channels
Reimplemented to emit signal.
environment/lib/python2.7/site-packages/IPython/frontend/qt/kernelmanager.py
def start_channels(self, *args, **kw): """ Reimplemented to emit signal. """ super(QtKernelManager, self).start_channels(*args, **kw) self.started_channels.emit()
def start_channels(self, *args, **kw): """ Reimplemented to emit signal. """ super(QtKernelManager, self).start_channels(*args, **kw) self.started_channels.emit()
[ "Reimplemented", "to", "emit", "signal", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/kernelmanager.py#L216-L220
[ "def", "start_channels", "(", "self", ",", "*", "args", ",", "*", "*", "kw", ")", ":", "super", "(", "QtKernelManager", ",", "self", ")", ".", "start_channels", "(", "*", "args", ",", "*", "*", "kw", ")", "self", ".", "started_channels", ".", "emit",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
QtKernelManager.shell_channel
Reimplemented for proper heartbeat management.
environment/lib/python2.7/site-packages/IPython/frontend/qt/kernelmanager.py
def shell_channel(self): """ Reimplemented for proper heartbeat management. """ if self._shell_channel is None: self._shell_channel = super(QtKernelManager, self).shell_channel self._shell_channel.first_reply.connect(self._first_reply) return self._shell_channel
def shell_channel(self): """ Reimplemented for proper heartbeat management. """ if self._shell_channel is None: self._shell_channel = super(QtKernelManager, self).shell_channel self._shell_channel.first_reply.connect(self._first_reply) return self._shell_channel
[ "Reimplemented", "for", "proper", "heartbeat", "management", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/kernelmanager.py#L229-L235
[ "def", "shell_channel", "(", "self", ")", ":", "if", "self", ".", "_shell_channel", "is", "None", ":", "self", ".", "_shell_channel", "=", "super", "(", "QtKernelManager", ",", "self", ")", ".", "shell_channel", "self", ".", "_shell_channel", ".", "first_rep...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
restore_bytes
Restore bytes of image data from unicode-only formats. Base64 encoding is handled elsewhere. Bytes objects in the notebook are always b64-encoded. We DO NOT encode/decode around file formats.
environment/lib/python2.7/site-packages/IPython/nbformat/v3/rwbase.py
def restore_bytes(nb): """Restore bytes of image data from unicode-only formats. Base64 encoding is handled elsewhere. Bytes objects in the notebook are always b64-encoded. We DO NOT encode/decode around file formats. """ for ws in nb.worksheets: for cell in ws.cells: if ce...
def restore_bytes(nb): """Restore bytes of image data from unicode-only formats. Base64 encoding is handled elsewhere. Bytes objects in the notebook are always b64-encoded. We DO NOT encode/decode around file formats. """ for ws in nb.worksheets: for cell in ws.cells: if ce...
[ "Restore", "bytes", "of", "image", "data", "from", "unicode", "-", "only", "formats", ".", "Base64", "encoding", "is", "handled", "elsewhere", ".", "Bytes", "objects", "in", "the", "notebook", "are", "always", "b64", "-", "encoded", ".", "We", "DO", "NOT",...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/nbformat/v3/rwbase.py#L30-L44
[ "def", "restore_bytes", "(", "nb", ")", ":", "for", "ws", "in", "nb", ".", "worksheets", ":", "for", "cell", "in", "ws", ".", "cells", ":", "if", "cell", ".", "cell_type", "==", "'code'", ":", "for", "output", "in", "cell", ".", "outputs", ":", "if...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
_join_lines
join lines that have been written by splitlines() Has logic to protect against `splitlines()`, which should have been `splitlines(True)`
environment/lib/python2.7/site-packages/IPython/nbformat/v3/rwbase.py
def _join_lines(lines): """join lines that have been written by splitlines() Has logic to protect against `splitlines()`, which should have been `splitlines(True)` """ if lines and lines[0].endswith(('\n', '\r')): # created by splitlines(True) return u''.join(lines) else: ...
def _join_lines(lines): """join lines that have been written by splitlines() Has logic to protect against `splitlines()`, which should have been `splitlines(True)` """ if lines and lines[0].endswith(('\n', '\r')): # created by splitlines(True) return u''.join(lines) else: ...
[ "join", "lines", "that", "have", "been", "written", "by", "splitlines", "()", "Has", "logic", "to", "protect", "against", "splitlines", "()", "which", "should", "have", "been", "splitlines", "(", "True", ")" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/nbformat/v3/rwbase.py#L51-L62
[ "def", "_join_lines", "(", "lines", ")", ":", "if", "lines", "and", "lines", "[", "0", "]", ".", "endswith", "(", "(", "'\\n'", ",", "'\\r'", ")", ")", ":", "# created by splitlines(True)", "return", "u''", ".", "join", "(", "lines", ")", "else", ":", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
rejoin_lines
rejoin multiline text into strings For reversing effects of ``split_lines(nb)``. This only rejoins lines that have been split, so if text objects were not split they will pass through unchanged. Used when reading JSON files that may have been passed through split_lines.
environment/lib/python2.7/site-packages/IPython/nbformat/v3/rwbase.py
def rejoin_lines(nb): """rejoin multiline text into strings For reversing effects of ``split_lines(nb)``. This only rejoins lines that have been split, so if text objects were not split they will pass through unchanged. Used when reading JSON files that may have been passed through sp...
def rejoin_lines(nb): """rejoin multiline text into strings For reversing effects of ``split_lines(nb)``. This only rejoins lines that have been split, so if text objects were not split they will pass through unchanged. Used when reading JSON files that may have been passed through sp...
[ "rejoin", "multiline", "text", "into", "strings", "For", "reversing", "effects", "of", "split_lines", "(", "nb", ")", ".", "This", "only", "rejoins", "lines", "that", "have", "been", "split", "so", "if", "text", "objects", "were", "not", "split", "they", "...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/nbformat/v3/rwbase.py#L65-L90
[ "def", "rejoin_lines", "(", "nb", ")", ":", "for", "ws", "in", "nb", ".", "worksheets", ":", "for", "cell", "in", "ws", ".", "cells", ":", "if", "cell", ".", "cell_type", "==", "'code'", ":", "if", "'input'", "in", "cell", "and", "isinstance", "(", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
base64_decode
Restore all bytes objects in the notebook from base64-encoded strings. Note: This is never used
environment/lib/python2.7/site-packages/IPython/nbformat/v3/rwbase.py
def base64_decode(nb): """Restore all bytes objects in the notebook from base64-encoded strings. Note: This is never used """ for ws in nb.worksheets: for cell in ws.cells: if cell.cell_type == 'code': for output in cell.outputs: if 'png' in o...
def base64_decode(nb): """Restore all bytes objects in the notebook from base64-encoded strings. Note: This is never used """ for ws in nb.worksheets: for cell in ws.cells: if cell.cell_type == 'code': for output in cell.outputs: if 'png' in o...
[ "Restore", "all", "bytes", "objects", "in", "the", "notebook", "from", "base64", "-", "encoded", "strings", ".", "Note", ":", "This", "is", "never", "used" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/nbformat/v3/rwbase.py#L121-L138
[ "def", "base64_decode", "(", "nb", ")", ":", "for", "ws", "in", "nb", ".", "worksheets", ":", "for", "cell", "in", "ws", ".", "cells", ":", "if", "cell", ".", "cell_type", "==", "'code'", ":", "for", "output", "in", "cell", ".", "outputs", ":", "if...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
base64_encode
Base64 encode all bytes objects in the notebook. These will be b64-encoded unicode strings Note: This is never used
environment/lib/python2.7/site-packages/IPython/nbformat/v3/rwbase.py
def base64_encode(nb): """Base64 encode all bytes objects in the notebook. These will be b64-encoded unicode strings Note: This is never used """ for ws in nb.worksheets: for cell in ws.cells: if cell.cell_type == 'code': for output in cell.outputs: ...
def base64_encode(nb): """Base64 encode all bytes objects in the notebook. These will be b64-encoded unicode strings Note: This is never used """ for ws in nb.worksheets: for cell in ws.cells: if cell.cell_type == 'code': for output in cell.outputs: ...
[ "Base64", "encode", "all", "bytes", "objects", "in", "the", "notebook", ".", "These", "will", "be", "b64", "-", "encoded", "unicode", "strings", "Note", ":", "This", "is", "never", "used" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/nbformat/v3/rwbase.py#L141-L156
[ "def", "base64_encode", "(", "nb", ")", ":", "for", "ws", "in", "nb", ".", "worksheets", ":", "for", "cell", "in", "ws", ".", "cells", ":", "if", "cell", ".", "cell_type", "==", "'code'", ":", "for", "output", "in", "cell", ".", "outputs", ":", "if...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
NotebookReader.read
Read a notebook from a file like object
environment/lib/python2.7/site-packages/IPython/nbformat/v3/rwbase.py
def read(self, fp, **kwargs): """Read a notebook from a file like object""" nbs = fp.read() if not py3compat.PY3 and not isinstance(nbs, unicode): nbs = py3compat.str_to_unicode(nbs) return self.reads(nbs, **kwargs)
def read(self, fp, **kwargs): """Read a notebook from a file like object""" nbs = fp.read() if not py3compat.PY3 and not isinstance(nbs, unicode): nbs = py3compat.str_to_unicode(nbs) return self.reads(nbs, **kwargs)
[ "Read", "a", "notebook", "from", "a", "file", "like", "object" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/nbformat/v3/rwbase.py#L166-L171
[ "def", "read", "(", "self", ",", "fp", ",", "*", "*", "kwargs", ")", ":", "nbs", "=", "fp", ".", "read", "(", ")", "if", "not", "py3compat", ".", "PY3", "and", "not", "isinstance", "(", "nbs", ",", "unicode", ")", ":", "nbs", "=", "py3compat", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
NotebookWriter.write
Write a notebook to a file like object
environment/lib/python2.7/site-packages/IPython/nbformat/v3/rwbase.py
def write(self, nb, fp, **kwargs): """Write a notebook to a file like object""" nbs = self.writes(nb,**kwargs) if not py3compat.PY3 and not isinstance(nbs, unicode): # this branch is likely only taken for JSON on Python 2 nbs = py3compat.str_to_unicode(nbs) return...
def write(self, nb, fp, **kwargs): """Write a notebook to a file like object""" nbs = self.writes(nb,**kwargs) if not py3compat.PY3 and not isinstance(nbs, unicode): # this branch is likely only taken for JSON on Python 2 nbs = py3compat.str_to_unicode(nbs) return...
[ "Write", "a", "notebook", "to", "a", "file", "like", "object" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/nbformat/v3/rwbase.py#L181-L187
[ "def", "write", "(", "self", ",", "nb", ",", "fp", ",", "*", "*", "kwargs", ")", ":", "nbs", "=", "self", ".", "writes", "(", "nb", ",", "*", "*", "kwargs", ")", "if", "not", "py3compat", ".", "PY3", "and", "not", "isinstance", "(", "nbs", ",",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
get_mirrors
Return the list of mirrors from the last record found on the DNS entry:: >>> from pip.index import get_mirrors >>> get_mirrors() ['a.pypi.python.org', 'b.pypi.python.org', 'c.pypi.python.org', 'd.pypi.python.org'] Originally written for the distutils2 project by Alexis Metaireau.
environment/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg/pip/index.py
def get_mirrors(hostname=None): """Return the list of mirrors from the last record found on the DNS entry:: >>> from pip.index import get_mirrors >>> get_mirrors() ['a.pypi.python.org', 'b.pypi.python.org', 'c.pypi.python.org', 'd.pypi.python.org'] Originally written for the distutils2 pro...
def get_mirrors(hostname=None): """Return the list of mirrors from the last record found on the DNS entry:: >>> from pip.index import get_mirrors >>> get_mirrors() ['a.pypi.python.org', 'b.pypi.python.org', 'c.pypi.python.org', 'd.pypi.python.org'] Originally written for the distutils2 pro...
[ "Return", "the", "list", "of", "mirrors", "from", "the", "last", "record", "found", "on", "the", "DNS", "entry", "::" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg/pip/index.py#L678-L703
[ "def", "get_mirrors", "(", "hostname", "=", "None", ")", ":", "if", "hostname", "is", "None", ":", "hostname", "=", "DEFAULT_MIRROR_HOSTNAME", "# return the last mirror registered on PyPI.", "last_mirror_hostname", "=", "None", "try", ":", "last_mirror_hostname", "=", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
read_no_interrupt
Read from a pipe ignoring EINTR errors. This is necessary because when reading from pipes with GUI event loops running in the background, often interrupts are raised that stop the command from completing.
environment/lib/python2.7/site-packages/IPython/utils/_process_common.py
def read_no_interrupt(p): """Read from a pipe ignoring EINTR errors. This is necessary because when reading from pipes with GUI event loops running in the background, often interrupts are raised that stop the command from completing.""" import errno try: return p.read() except IOEr...
def read_no_interrupt(p): """Read from a pipe ignoring EINTR errors. This is necessary because when reading from pipes with GUI event loops running in the background, often interrupts are raised that stop the command from completing.""" import errno try: return p.read() except IOEr...
[ "Read", "from", "a", "pipe", "ignoring", "EINTR", "errors", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/_process_common.py#L27-L39
[ "def", "read_no_interrupt", "(", "p", ")", ":", "import", "errno", "try", ":", "return", "p", ".", "read", "(", ")", "except", "IOError", ",", "err", ":", "if", "err", ".", "errno", "!=", "errno", ".", "EINTR", ":", "raise" ]
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
process_handler
Open a command in a shell subprocess and execute a callback. This function provides common scaffolding for creating subprocess.Popen() calls. It creates a Popen object and then calls the callback with it. Parameters ---------- cmd : str A string to be executed with the underlying system she...
environment/lib/python2.7/site-packages/IPython/utils/_process_common.py
def process_handler(cmd, callback, stderr=subprocess.PIPE): """Open a command in a shell subprocess and execute a callback. This function provides common scaffolding for creating subprocess.Popen() calls. It creates a Popen object and then calls the callback with it. Parameters ---------- cmd...
def process_handler(cmd, callback, stderr=subprocess.PIPE): """Open a command in a shell subprocess and execute a callback. This function provides common scaffolding for creating subprocess.Popen() calls. It creates a Popen object and then calls the callback with it. Parameters ---------- cmd...
[ "Open", "a", "command", "in", "a", "shell", "subprocess", "and", "execute", "a", "callback", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/_process_common.py#L42-L102
[ "def", "process_handler", "(", "cmd", ",", "callback", ",", "stderr", "=", "subprocess", ".", "PIPE", ")", ":", "sys", ".", "stdout", ".", "flush", "(", ")", "sys", ".", "stderr", ".", "flush", "(", ")", "# On win32, close_fds can't be true when using pipes fo...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
getoutput
Return standard output of executing cmd in a shell. Accepts the same arguments as os.system(). Parameters ---------- cmd : str A command to be executed in the system shell. Returns ------- stdout : str
environment/lib/python2.7/site-packages/IPython/utils/_process_common.py
def getoutput(cmd): """Return standard output of executing cmd in a shell. Accepts the same arguments as os.system(). Parameters ---------- cmd : str A command to be executed in the system shell. Returns ------- stdout : str """ out = process_handler(cmd, lambda p: p.co...
def getoutput(cmd): """Return standard output of executing cmd in a shell. Accepts the same arguments as os.system(). Parameters ---------- cmd : str A command to be executed in the system shell. Returns ------- stdout : str """ out = process_handler(cmd, lambda p: p.co...
[ "Return", "standard", "output", "of", "executing", "cmd", "in", "a", "shell", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/_process_common.py#L105-L123
[ "def", "getoutput", "(", "cmd", ")", ":", "out", "=", "process_handler", "(", "cmd", ",", "lambda", "p", ":", "p", ".", "communicate", "(", ")", "[", "0", "]", ",", "subprocess", ".", "STDOUT", ")", "if", "out", "is", "None", ":", "return", "''", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
getoutputerror
Return (standard output, standard error) of executing cmd in a shell. Accepts the same arguments as os.system(). Parameters ---------- cmd : str A command to be executed in the system shell. Returns ------- stdout : str stderr : str
environment/lib/python2.7/site-packages/IPython/utils/_process_common.py
def getoutputerror(cmd): """Return (standard output, standard error) of executing cmd in a shell. Accepts the same arguments as os.system(). Parameters ---------- cmd : str A command to be executed in the system shell. Returns ------- stdout : str stderr : str """ o...
def getoutputerror(cmd): """Return (standard output, standard error) of executing cmd in a shell. Accepts the same arguments as os.system(). Parameters ---------- cmd : str A command to be executed in the system shell. Returns ------- stdout : str stderr : str """ o...
[ "Return", "(", "standard", "output", "standard", "error", ")", "of", "executing", "cmd", "in", "a", "shell", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/_process_common.py#L126-L146
[ "def", "getoutputerror", "(", "cmd", ")", ":", "out_err", "=", "process_handler", "(", "cmd", ",", "lambda", "p", ":", "p", ".", "communicate", "(", ")", ")", "if", "out_err", "is", "None", ":", "return", "''", ",", "''", "out", ",", "err", "=", "o...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
arg_split
Split a command line's arguments in a shell-like manner. This is a modified version of the standard library's shlex.split() function, but with a default of posix=False for splitting, so that quotes in inputs are respected. if strict=False, then any errors shlex.split would raise will result in the ...
environment/lib/python2.7/site-packages/IPython/utils/_process_common.py
def arg_split(s, posix=False, strict=True): """Split a command line's arguments in a shell-like manner. This is a modified version of the standard library's shlex.split() function, but with a default of posix=False for splitting, so that quotes in inputs are respected. if strict=False, then any er...
def arg_split(s, posix=False, strict=True): """Split a command line's arguments in a shell-like manner. This is a modified version of the standard library's shlex.split() function, but with a default of posix=False for splitting, so that quotes in inputs are respected. if strict=False, then any er...
[ "Split", "a", "command", "line", "s", "arguments", "in", "a", "shell", "-", "like", "manner", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/_process_common.py#L149-L195
[ "def", "arg_split", "(", "s", ",", "posix", "=", "False", ",", "strict", "=", "True", ")", ":", "# Unfortunately, python's shlex module is buggy with unicode input:", "# http://bugs.python.org/issue1170", "# At least encoding the input when it's unicode seems to help, but there", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
collector
TestSuite replacement entry point. Use anywhere you might use a unittest.TestSuite. The collector will, by default, load options from all config files and execute loader.loadTestsFromNames() on the configured testNames, or '.' if no testNames are configured.
environment/lib/python2.7/site-packages/nose/core.py
def collector(): """TestSuite replacement entry point. Use anywhere you might use a unittest.TestSuite. The collector will, by default, load options from all config files and execute loader.loadTestsFromNames() on the configured testNames, or '.' if no testNames are configured. """ # plugins tha...
def collector(): """TestSuite replacement entry point. Use anywhere you might use a unittest.TestSuite. The collector will, by default, load options from all config files and execute loader.loadTestsFromNames() on the configured testNames, or '.' if no testNames are configured. """ # plugins tha...
[ "TestSuite", "replacement", "entry", "point", ".", "Use", "anywhere", "you", "might", "use", "a", "unittest", ".", "TestSuite", ".", "The", "collector", "will", "by", "default", "load", "options", "from", "all", "config", "files", "and", "execute", "loader", ...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/core.py#L295-L319
[ "def", "collector", "(", ")", ":", "# plugins that implement any of these methods are disabled, since", "# we don't control the test runner and won't be able to run them", "# finalize() is also not called, but plugins that use it aren't disabled,", "# because capture needs it.", "setuptools_incomp...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
compress_dhist
Compress a directory history into a new one with at most 20 entries. Return a new list made from the first and last 10 elements of dhist after removal of duplicates.
environment/lib/python2.7/site-packages/IPython/core/magic.py
def compress_dhist(dh): """Compress a directory history into a new one with at most 20 entries. Return a new list made from the first and last 10 elements of dhist after removal of duplicates. """ head, tail = dh[:-10], dh[-10:] newhead = [] done = set() for h in head: if h in ...
def compress_dhist(dh): """Compress a directory history into a new one with at most 20 entries. Return a new list made from the first and last 10 elements of dhist after removal of duplicates. """ head, tail = dh[:-10], dh[-10:] newhead = [] done = set() for h in head: if h in ...
[ "Compress", "a", "directory", "history", "into", "a", "new", "one", "with", "at", "most", "20", "entries", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/magic.py#L64-L80
[ "def", "compress_dhist", "(", "dh", ")", ":", "head", ",", "tail", "=", "dh", "[", ":", "-", "10", "]", ",", "dh", "[", "-", "10", ":", "]", "newhead", "=", "[", "]", "done", "=", "set", "(", ")", "for", "h", "in", "head", ":", "if", "h", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
magics_class
Class decorator for all subclasses of the main Magics class. Any class that subclasses Magics *must* also apply this decorator, to ensure that all the methods that have been decorated as line/cell magics get correctly registered in the class instance. This is necessary because when method decorators r...
environment/lib/python2.7/site-packages/IPython/core/magic.py
def magics_class(cls): """Class decorator for all subclasses of the main Magics class. Any class that subclasses Magics *must* also apply this decorator, to ensure that all the methods that have been decorated as line/cell magics get correctly registered in the class instance. This is necessary becaus...
def magics_class(cls): """Class decorator for all subclasses of the main Magics class. Any class that subclasses Magics *must* also apply this decorator, to ensure that all the methods that have been decorated as line/cell magics get correctly registered in the class instance. This is necessary becaus...
[ "Class", "decorator", "for", "all", "subclasses", "of", "the", "main", "Magics", "class", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/magic.py#L92-L115
[ "def", "magics_class", "(", "cls", ")", ":", "cls", ".", "registered", "=", "True", "cls", ".", "magics", "=", "dict", "(", "line", "=", "magics", "[", "'line'", "]", ",", "cell", "=", "magics", "[", "'cell'", "]", ")", "magics", "[", "'line'", "]"...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
record_magic
Utility function to store a function as a magic of a specific kind. Parameters ---------- dct : dict A dictionary with 'line' and 'cell' subdicts. magic_kind : str Kind of magic to be stored. magic_name : str Key to store the magic as. func : function Callable object ...
environment/lib/python2.7/site-packages/IPython/core/magic.py
def record_magic(dct, magic_kind, magic_name, func): """Utility function to store a function as a magic of a specific kind. Parameters ---------- dct : dict A dictionary with 'line' and 'cell' subdicts. magic_kind : str Kind of magic to be stored. magic_name : str Key to sto...
def record_magic(dct, magic_kind, magic_name, func): """Utility function to store a function as a magic of a specific kind. Parameters ---------- dct : dict A dictionary with 'line' and 'cell' subdicts. magic_kind : str Kind of magic to be stored. magic_name : str Key to sto...
[ "Utility", "function", "to", "store", "a", "function", "as", "a", "magic", "of", "a", "specific", "kind", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/magic.py#L118-L138
[ "def", "record_magic", "(", "dct", ",", "magic_kind", ",", "magic_name", ",", "func", ")", ":", "if", "magic_kind", "==", "'line_cell'", ":", "dct", "[", "'line'", "]", "[", "magic_name", "]", "=", "dct", "[", "'cell'", "]", "[", "magic_name", "]", "="...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
_method_magic_marker
Decorator factory for methods in Magics subclasses.
environment/lib/python2.7/site-packages/IPython/core/magic.py
def _method_magic_marker(magic_kind): """Decorator factory for methods in Magics subclasses. """ validate_type(magic_kind) # This is a closure to capture the magic_kind. We could also use a class, # but it's overkill for just that one bit of state. def magic_deco(arg): call = lambda f...
def _method_magic_marker(magic_kind): """Decorator factory for methods in Magics subclasses. """ validate_type(magic_kind) # This is a closure to capture the magic_kind. We could also use a class, # but it's overkill for just that one bit of state. def magic_deco(arg): call = lambda f...
[ "Decorator", "factory", "for", "methods", "in", "Magics", "subclasses", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/magic.py#L182-L213
[ "def", "_method_magic_marker", "(", "magic_kind", ")", ":", "validate_type", "(", "magic_kind", ")", "# This is a closure to capture the magic_kind. We could also use a class,", "# but it's overkill for just that one bit of state.", "def", "magic_deco", "(", "arg", ")", ":", "ca...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
_function_magic_marker
Decorator factory for standalone functions.
environment/lib/python2.7/site-packages/IPython/core/magic.py
def _function_magic_marker(magic_kind): """Decorator factory for standalone functions. """ validate_type(magic_kind) # This is a closure to capture the magic_kind. We could also use a class, # but it's overkill for just that one bit of state. def magic_deco(arg): call = lambda f, *...
def _function_magic_marker(magic_kind): """Decorator factory for standalone functions. """ validate_type(magic_kind) # This is a closure to capture the magic_kind. We could also use a class, # but it's overkill for just that one bit of state. def magic_deco(arg): call = lambda f, *...
[ "Decorator", "factory", "for", "standalone", "functions", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/magic.py#L216-L269
[ "def", "_function_magic_marker", "(", "magic_kind", ")", ":", "validate_type", "(", "magic_kind", ")", "# This is a closure to capture the magic_kind. We could also use a class,", "# but it's overkill for just that one bit of state.", "def", "magic_deco", "(", "arg", ")", ":", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
MagicsManager.lsmagic_docs
Return dict of documentation of magic functions. The return dict has the keys 'line' and 'cell', corresponding to the two types of magics we support. Each value is a dict keyed by magic name whose value is the function docstring. If a docstring is unavailable, the value of `missing` is ...
environment/lib/python2.7/site-packages/IPython/core/magic.py
def lsmagic_docs(self, brief=False, missing=''): """Return dict of documentation of magic functions. The return dict has the keys 'line' and 'cell', corresponding to the two types of magics we support. Each value is a dict keyed by magic name whose value is the function docstring. If a ...
def lsmagic_docs(self, brief=False, missing=''): """Return dict of documentation of magic functions. The return dict has the keys 'line' and 'cell', corresponding to the two types of magics we support. Each value is a dict keyed by magic name whose value is the function docstring. If a ...
[ "Return", "dict", "of", "documentation", "of", "magic", "functions", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/magic.py#L344-L366
[ "def", "lsmagic_docs", "(", "self", ",", "brief", "=", "False", ",", "missing", "=", "''", ")", ":", "docs", "=", "{", "}", "for", "m_type", "in", "self", ".", "magics", ":", "m_docs", "=", "{", "}", "for", "m_name", ",", "m_func", "in", "self", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
MagicsManager.register
Register one or more instances of Magics. Take one or more classes or instances of classes that subclass the main `core.Magic` class, and register them with IPython to use the magic functions they provide. The registration process will then ensure that any methods that have decorated ...
environment/lib/python2.7/site-packages/IPython/core/magic.py
def register(self, *magic_objects): """Register one or more instances of Magics. Take one or more classes or instances of classes that subclass the main `core.Magic` class, and register them with IPython to use the magic functions they provide. The registration process will then ensur...
def register(self, *magic_objects): """Register one or more instances of Magics. Take one or more classes or instances of classes that subclass the main `core.Magic` class, and register them with IPython to use the magic functions they provide. The registration process will then ensur...
[ "Register", "one", "or", "more", "instances", "of", "Magics", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/magic.py#L368-L402
[ "def", "register", "(", "self", ",", "*", "magic_objects", ")", ":", "# Start by validating them to ensure they have all had their magic", "# methods registered at the instance level", "for", "m", "in", "magic_objects", ":", "if", "not", "m", ".", "registered", ":", "rais...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
MagicsManager.register_function
Expose a standalone function as magic function for IPython. This will create an IPython magic (line, cell or both) from a standalone function. The functions should have the following signatures: * For line magics: `def f(line)` * For cell magics: `def f(line, cell)` *...
environment/lib/python2.7/site-packages/IPython/core/magic.py
def register_function(self, func, magic_kind='line', magic_name=None): """Expose a standalone function as magic function for IPython. This will create an IPython magic (line, cell or both) from a standalone function. The functions should have the following signatures: * For l...
def register_function(self, func, magic_kind='line', magic_name=None): """Expose a standalone function as magic function for IPython. This will create an IPython magic (line, cell or both) from a standalone function. The functions should have the following signatures: * For l...
[ "Expose", "a", "standalone", "function", "as", "magic", "function", "for", "IPython", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/magic.py#L404-L436
[ "def", "register_function", "(", "self", ",", "func", ",", "magic_kind", "=", "'line'", ",", "magic_name", "=", "None", ")", ":", "# Create the new method in the user_magics and register it in the", "# global table", "validate_type", "(", "magic_kind", ")", "magic_name", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
MagicsManager.define_magic
[Deprecated] Expose own function as magic function for IPython. Example:: def foo_impl(self, parameter_s=''): 'My very own magic!. (Use docstrings, IPython reads them).' print 'Magic function. Passed parameter is between < >:' print '<%s>' % paramete...
environment/lib/python2.7/site-packages/IPython/core/magic.py
def define_magic(self, name, func): """[Deprecated] Expose own function as magic function for IPython. Example:: def foo_impl(self, parameter_s=''): 'My very own magic!. (Use docstrings, IPython reads them).' print 'Magic function. Passed parameter is betwee...
def define_magic(self, name, func): """[Deprecated] Expose own function as magic function for IPython. Example:: def foo_impl(self, parameter_s=''): 'My very own magic!. (Use docstrings, IPython reads them).' print 'Magic function. Passed parameter is betwee...
[ "[", "Deprecated", "]", "Expose", "own", "function", "as", "magic", "function", "for", "IPython", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/magic.py#L438-L453
[ "def", "define_magic", "(", "self", ",", "name", ",", "func", ")", ":", "meth", "=", "types", ".", "MethodType", "(", "func", ",", "self", ".", "user_magics", ")", "setattr", "(", "self", ".", "user_magics", ",", "name", ",", "meth", ")", "record_magic...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Magics.format_latex
Format a string for latex inclusion.
environment/lib/python2.7/site-packages/IPython/core/magic.py
def format_latex(self, strng): """Format a string for latex inclusion.""" # Characters that need to be escaped for latex: escape_re = re.compile(r'(%|_|\$|#|&)',re.MULTILINE) # Magic command names as headers: cmd_name_re = re.compile(r'^(%s.*?):' % ESC_MAGIC, ...
def format_latex(self, strng): """Format a string for latex inclusion.""" # Characters that need to be escaped for latex: escape_re = re.compile(r'(%|_|\$|#|&)',re.MULTILINE) # Magic command names as headers: cmd_name_re = re.compile(r'^(%s.*?):' % ESC_MAGIC, ...
[ "Format", "a", "string", "for", "latex", "inclusion", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/magic.py#L516-L541
[ "def", "format_latex", "(", "self", ",", "strng", ")", ":", "# Characters that need to be escaped for latex:", "escape_re", "=", "re", ".", "compile", "(", "r'(%|_|\\$|#|&)'", ",", "re", ".", "MULTILINE", ")", "# Magic command names as headers:", "cmd_name_re", "=", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Magics.parse_options
Parse options passed to an argument string. The interface is similar to that of getopt(), but it returns back a Struct with the options as keys and the stripped argument string still as a string. arg_str is quoted as a true sys.argv vector by using shlex.split. This allows us t...
environment/lib/python2.7/site-packages/IPython/core/magic.py
def parse_options(self, arg_str, opt_str, *long_opts, **kw): """Parse options passed to an argument string. The interface is similar to that of getopt(), but it returns back a Struct with the options as keys and the stripped argument string still as a string. arg_str is quoted ...
def parse_options(self, arg_str, opt_str, *long_opts, **kw): """Parse options passed to an argument string. The interface is similar to that of getopt(), but it returns back a Struct with the options as keys and the stripped argument string still as a string. arg_str is quoted ...
[ "Parse", "options", "passed", "to", "an", "argument", "string", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/magic.py#L543-L610
[ "def", "parse_options", "(", "self", ",", "arg_str", ",", "opt_str", ",", "*", "long_opts", ",", "*", "*", "kw", ")", ":", "# inject default options at the beginning of the input line", "caller", "=", "sys", ".", "_getframe", "(", "1", ")", ".", "f_code", ".",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Magics.default_option
Make an entry in the options_table for fn, with value optstr
environment/lib/python2.7/site-packages/IPython/core/magic.py
def default_option(self, fn, optstr): """Make an entry in the options_table for fn, with value optstr""" if fn not in self.lsmagic(): error("%s is not a magic function" % fn) self.options_table[fn] = optstr
def default_option(self, fn, optstr): """Make an entry in the options_table for fn, with value optstr""" if fn not in self.lsmagic(): error("%s is not a magic function" % fn) self.options_table[fn] = optstr
[ "Make", "an", "entry", "in", "the", "options_table", "for", "fn", "with", "value", "optstr" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/magic.py#L612-L617
[ "def", "default_option", "(", "self", ",", "fn", ",", "optstr", ")", ":", "if", "fn", "not", "in", "self", ".", "lsmagic", "(", ")", ":", "error", "(", "\"%s is not a magic function\"", "%", "fn", ")", "self", ".", "options_table", "[", "fn", "]", "=",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
page_guiref
Show a basic reference about the GUI Console.
environment/lib/python2.7/site-packages/IPython/core/usage.py
def page_guiref(arg_s=None): """Show a basic reference about the GUI Console.""" from IPython.core import page page.page(gui_reference, auto_html=True)
def page_guiref(arg_s=None): """Show a basic reference about the GUI Console.""" from IPython.core import page page.page(gui_reference, auto_html=True)
[ "Show", "a", "basic", "reference", "about", "the", "GUI", "Console", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/usage.py#L561-L564
[ "def", "page_guiref", "(", "arg_s", "=", "None", ")", ":", "from", "IPython", ".", "core", "import", "page", "page", ".", "page", "(", "gui_reference", ",", "auto_html", "=", "True", ")" ]
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
get_member
Get a member from an object by (string) name
src/sisy/models.py
def get_member(thing_obj, member_string): """Get a member from an object by (string) name""" mems = {x[0]: x[1] for x in inspect.getmembers(thing_obj)} if member_string in mems: return mems[member_string]
def get_member(thing_obj, member_string): """Get a member from an object by (string) name""" mems = {x[0]: x[1] for x in inspect.getmembers(thing_obj)} if member_string in mems: return mems[member_string]
[ "Get", "a", "member", "from", "an", "object", "by", "(", "string", ")", "name" ]
phoikoi/sisy
python
https://github.com/phoikoi/sisy/blob/840c5463ab65488d34e99531f230e61f755d2d69/src/sisy/models.py#L23-L27
[ "def", "get_member", "(", "thing_obj", ",", "member_string", ")", ":", "mems", "=", "{", "x", "[", "0", "]", ":", "x", "[", "1", "]", "for", "x", "in", "inspect", ".", "getmembers", "(", "thing_obj", ")", "}", "if", "member_string", "in", "mems", "...
840c5463ab65488d34e99531f230e61f755d2d69
test
func_from_string
Return a live function from a full dotted path. Must be either a plain function directly in a module, a class function, or a static function. (No modules, classes, or instance methods, since those can't be called as tasks.)
src/sisy/models.py
def func_from_string(callable_str): """Return a live function from a full dotted path. Must be either a plain function directly in a module, a class function, or a static function. (No modules, classes, or instance methods, since those can't be called as tasks.)""" components = callable_str.split('.')...
def func_from_string(callable_str): """Return a live function from a full dotted path. Must be either a plain function directly in a module, a class function, or a static function. (No modules, classes, or instance methods, since those can't be called as tasks.)""" components = callable_str.split('.')...
[ "Return", "a", "live", "function", "from", "a", "full", "dotted", "path", ".", "Must", "be", "either", "a", "plain", "function", "directly", "in", "a", "module", "a", "class", "function", "or", "a", "static", "function", ".", "(", "No", "modules", "class...
phoikoi/sisy
python
https://github.com/phoikoi/sisy/blob/840c5463ab65488d34e99531f230e61f755d2d69/src/sisy/models.py#L95-L165
[ "def", "func_from_string", "(", "callable_str", ")", ":", "components", "=", "callable_str", ".", "split", "(", "'.'", ")", "func", "=", "None", "if", "len", "(", "components", ")", "<", "2", ":", "raise", "ValueError", "(", "\"Need full dotted path to task fu...
840c5463ab65488d34e99531f230e61f755d2d69
test
task_with_callable
Factory function to create a properly initialized task.
src/sisy/models.py
def task_with_callable(the_callable, label=None, schedule=DEFAULT_SCHEDULE, userdata=None, pk_override=None): """Factory function to create a properly initialized task.""" task = Task() if isinstance(the_callable, str): if pk_override is not None: components = the_callable.split('.') ...
def task_with_callable(the_callable, label=None, schedule=DEFAULT_SCHEDULE, userdata=None, pk_override=None): """Factory function to create a properly initialized task.""" task = Task() if isinstance(the_callable, str): if pk_override is not None: components = the_callable.split('.') ...
[ "Factory", "function", "to", "create", "a", "properly", "initialized", "task", "." ]
phoikoi/sisy
python
https://github.com/phoikoi/sisy/blob/840c5463ab65488d34e99531f230e61f755d2d69/src/sisy/models.py#L319-L357
[ "def", "task_with_callable", "(", "the_callable", ",", "label", "=", "None", ",", "schedule", "=", "DEFAULT_SCHEDULE", ",", "userdata", "=", "None", ",", "pk_override", "=", "None", ")", ":", "task", "=", "Task", "(", ")", "if", "isinstance", "(", "the_cal...
840c5463ab65488d34e99531f230e61f755d2d69
test
taskinfo_with_label
Return task info dictionary from task label. Internal function, pretty much only used in migrations since the model methods aren't there.
src/sisy/models.py
def taskinfo_with_label(label): """Return task info dictionary from task label. Internal function, pretty much only used in migrations since the model methods aren't there.""" task = Task.objects.get(label=label) info = json.loads(task._func_info) return info
def taskinfo_with_label(label): """Return task info dictionary from task label. Internal function, pretty much only used in migrations since the model methods aren't there.""" task = Task.objects.get(label=label) info = json.loads(task._func_info) return info
[ "Return", "task", "info", "dictionary", "from", "task", "label", ".", "Internal", "function", "pretty", "much", "only", "used", "in", "migrations", "since", "the", "model", "methods", "aren", "t", "there", "." ]
phoikoi/sisy
python
https://github.com/phoikoi/sisy/blob/840c5463ab65488d34e99531f230e61f755d2d69/src/sisy/models.py#L359-L364
[ "def", "taskinfo_with_label", "(", "label", ")", ":", "task", "=", "Task", ".", "objects", ".", "get", "(", "label", "=", "label", ")", "info", "=", "json", ".", "loads", "(", "task", ".", "_func_info", ")", "return", "info" ]
840c5463ab65488d34e99531f230e61f755d2d69
test
Task.func_from_info
Find and return a callable object from a task info dictionary
src/sisy/models.py
def func_from_info(self): """Find and return a callable object from a task info dictionary""" info = self.funcinfo functype = info['func_type'] if functype in ['instancemethod', 'classmethod', 'staticmethod']: the_modelclass = get_module_member_by_dottedpath(info['class_path'...
def func_from_info(self): """Find and return a callable object from a task info dictionary""" info = self.funcinfo functype = info['func_type'] if functype in ['instancemethod', 'classmethod', 'staticmethod']: the_modelclass = get_module_member_by_dottedpath(info['class_path'...
[ "Find", "and", "return", "a", "callable", "object", "from", "a", "task", "info", "dictionary" ]
phoikoi/sisy
python
https://github.com/phoikoi/sisy/blob/840c5463ab65488d34e99531f230e61f755d2d69/src/sisy/models.py#L208-L225
[ "def", "func_from_info", "(", "self", ")", ":", "info", "=", "self", ".", "funcinfo", "functype", "=", "info", "[", "'func_type'", "]", "if", "functype", "in", "[", "'instancemethod'", ",", "'classmethod'", ",", "'staticmethod'", "]", ":", "the_modelclass", ...
840c5463ab65488d34e99531f230e61f755d2d69
test
Task.run_tasks
Internal task-runner class method, called by :py:func:`sisy.consumers.run_heartbeat`
src/sisy/models.py
def run_tasks(cls): """Internal task-runner class method, called by :py:func:`sisy.consumers.run_heartbeat`""" now = timezone.now() tasks = cls.objects.filter(enabled=True) for task in tasks: if task.next_run == HAS_NOT_RUN: task.calc_next_run() if...
def run_tasks(cls): """Internal task-runner class method, called by :py:func:`sisy.consumers.run_heartbeat`""" now = timezone.now() tasks = cls.objects.filter(enabled=True) for task in tasks: if task.next_run == HAS_NOT_RUN: task.calc_next_run() if...
[ "Internal", "task", "-", "runner", "class", "method", "called", "by", ":", "py", ":", "func", ":", "sisy", ".", "consumers", ".", "run_heartbeat" ]
phoikoi/sisy
python
https://github.com/phoikoi/sisy/blob/840c5463ab65488d34e99531f230e61f755d2d69/src/sisy/models.py#L228-L242
[ "def", "run_tasks", "(", "cls", ")", ":", "now", "=", "timezone", ".", "now", "(", ")", "tasks", "=", "cls", ".", "objects", ".", "filter", "(", "enabled", "=", "True", ")", "for", "task", "in", "tasks", ":", "if", "task", ".", "next_run", "==", ...
840c5463ab65488d34e99531f230e61f755d2d69
test
Task.calc_next_run
Calculate next run time of this task
src/sisy/models.py
def calc_next_run(self): """Calculate next run time of this task""" base_time = self.last_run if self.last_run == HAS_NOT_RUN: if self.wait_for_schedule is False: self.next_run = timezone.now() self.wait_for_schedule = False # reset so we don't run on ...
def calc_next_run(self): """Calculate next run time of this task""" base_time = self.last_run if self.last_run == HAS_NOT_RUN: if self.wait_for_schedule is False: self.next_run = timezone.now() self.wait_for_schedule = False # reset so we don't run on ...
[ "Calculate", "next", "run", "time", "of", "this", "task" ]
phoikoi/sisy
python
https://github.com/phoikoi/sisy/blob/840c5463ab65488d34e99531f230e61f755d2d69/src/sisy/models.py#L244-L256
[ "def", "calc_next_run", "(", "self", ")", ":", "base_time", "=", "self", ".", "last_run", "if", "self", ".", "last_run", "==", "HAS_NOT_RUN", ":", "if", "self", ".", "wait_for_schedule", "is", "False", ":", "self", ".", "next_run", "=", "timezone", ".", ...
840c5463ab65488d34e99531f230e61f755d2d69
test
Task.submit
Internal instance method to submit this task for running immediately. Does not handle any iteration, end-date, etc., processing.
src/sisy/models.py
def submit(self, timestamp): """Internal instance method to submit this task for running immediately. Does not handle any iteration, end-date, etc., processing.""" Channel(RUN_TASK_CHANNEL).send({'id':self.pk, 'ts': timestamp.timestamp()})
def submit(self, timestamp): """Internal instance method to submit this task for running immediately. Does not handle any iteration, end-date, etc., processing.""" Channel(RUN_TASK_CHANNEL).send({'id':self.pk, 'ts': timestamp.timestamp()})
[ "Internal", "instance", "method", "to", "submit", "this", "task", "for", "running", "immediately", ".", "Does", "not", "handle", "any", "iteration", "end", "-", "date", "etc", ".", "processing", "." ]
phoikoi/sisy
python
https://github.com/phoikoi/sisy/blob/840c5463ab65488d34e99531f230e61f755d2d69/src/sisy/models.py#L258-L261
[ "def", "submit", "(", "self", ",", "timestamp", ")", ":", "Channel", "(", "RUN_TASK_CHANNEL", ")", ".", "send", "(", "{", "'id'", ":", "self", ".", "pk", ",", "'ts'", ":", "timestamp", ".", "timestamp", "(", ")", "}", ")" ]
840c5463ab65488d34e99531f230e61f755d2d69
test
Task.run
Internal instance method run by worker process to actually run the task callable.
src/sisy/models.py
def run(self, message): """Internal instance method run by worker process to actually run the task callable.""" the_callable = self.func_from_info() try: task_message = dict( task=self, channel_message=message, ) the_callable(ta...
def run(self, message): """Internal instance method run by worker process to actually run the task callable.""" the_callable = self.func_from_info() try: task_message = dict( task=self, channel_message=message, ) the_callable(ta...
[ "Internal", "instance", "method", "run", "by", "worker", "process", "to", "actually", "run", "the", "task", "callable", "." ]
phoikoi/sisy
python
https://github.com/phoikoi/sisy/blob/840c5463ab65488d34e99531f230e61f755d2d69/src/sisy/models.py#L263-L284
[ "def", "run", "(", "self", ",", "message", ")", ":", "the_callable", "=", "self", ".", "func_from_info", "(", ")", "try", ":", "task_message", "=", "dict", "(", "task", "=", "self", ",", "channel_message", "=", "message", ",", ")", "the_callable", "(", ...
840c5463ab65488d34e99531f230e61f755d2d69
test
Task.run_asap
Instance method to run this task immediately.
src/sisy/models.py
def run_asap(self): """Instance method to run this task immediately.""" now = timezone.now() self.last_run = now self.calc_next_run() self.save() self.submit(now)
def run_asap(self): """Instance method to run this task immediately.""" now = timezone.now() self.last_run = now self.calc_next_run() self.save() self.submit(now)
[ "Instance", "method", "to", "run", "this", "task", "immediately", "." ]
phoikoi/sisy
python
https://github.com/phoikoi/sisy/blob/840c5463ab65488d34e99531f230e61f755d2d69/src/sisy/models.py#L286-L292
[ "def", "run_asap", "(", "self", ")", ":", "now", "=", "timezone", ".", "now", "(", ")", "self", ".", "last_run", "=", "now", "self", ".", "calc_next_run", "(", ")", "self", ".", "save", "(", ")", "self", ".", "submit", "(", "now", ")" ]
840c5463ab65488d34e99531f230e61f755d2d69
test
Task.run_iterations
Class method to run a callable with a specified number of iterations
src/sisy/models.py
def run_iterations(cls, the_callable, iterations=1, label=None, schedule='* * * * * *', userdata = None, run_immediately=False, delay_until=None): """Class method to run a callable with a specified number of iterations""" task = task_with_callable(the_callable, label=label, schedule=schedule, userdata=u...
def run_iterations(cls, the_callable, iterations=1, label=None, schedule='* * * * * *', userdata = None, run_immediately=False, delay_until=None): """Class method to run a callable with a specified number of iterations""" task = task_with_callable(the_callable, label=label, schedule=schedule, userdata=u...
[ "Class", "method", "to", "run", "a", "callable", "with", "a", "specified", "number", "of", "iterations" ]
phoikoi/sisy
python
https://github.com/phoikoi/sisy/blob/840c5463ab65488d34e99531f230e61f755d2d69/src/sisy/models.py#L295-L311
[ "def", "run_iterations", "(", "cls", ",", "the_callable", ",", "iterations", "=", "1", ",", "label", "=", "None", ",", "schedule", "=", "'* * * * * *'", ",", "userdata", "=", "None", ",", "run_immediately", "=", "False", ",", "delay_until", "=", "None", ")...
840c5463ab65488d34e99531f230e61f755d2d69
test
Task.run_once
Class method to run a one-shot task, immediately.
src/sisy/models.py
def run_once(cls, the_callable, userdata=None, delay_until=None): """Class method to run a one-shot task, immediately.""" cls.run_iterations(the_callable, userdata=userdata, run_immediately=True, delay_until=delay_until)
def run_once(cls, the_callable, userdata=None, delay_until=None): """Class method to run a one-shot task, immediately.""" cls.run_iterations(the_callable, userdata=userdata, run_immediately=True, delay_until=delay_until)
[ "Class", "method", "to", "run", "a", "one", "-", "shot", "task", "immediately", "." ]
phoikoi/sisy
python
https://github.com/phoikoi/sisy/blob/840c5463ab65488d34e99531f230e61f755d2d69/src/sisy/models.py#L314-L316
[ "def", "run_once", "(", "cls", ",", "the_callable", ",", "userdata", "=", "None", ",", "delay_until", "=", "None", ")", ":", "cls", ".", "run_iterations", "(", "the_callable", ",", "userdata", "=", "userdata", ",", "run_immediately", "=", "True", ",", "del...
840c5463ab65488d34e99531f230e61f755d2d69
test
IPEngineApp.find_url_file
Set the url file. Here we don't try to actually see if it exists for is valid as that is hadled by the connection logic.
environment/lib/python2.7/site-packages/IPython/parallel/apps/ipengineapp.py
def find_url_file(self): """Set the url file. Here we don't try to actually see if it exists for is valid as that is hadled by the connection logic. """ config = self.config # Find the actual controller key file if not self.url_file: self.url_file = o...
def find_url_file(self): """Set the url file. Here we don't try to actually see if it exists for is valid as that is hadled by the connection logic. """ config = self.config # Find the actual controller key file if not self.url_file: self.url_file = o...
[ "Set", "the", "url", "file", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/apps/ipengineapp.py#L189-L201
[ "def", "find_url_file", "(", "self", ")", ":", "config", "=", "self", ".", "config", "# Find the actual controller key file", "if", "not", "self", ".", "url_file", ":", "self", ".", "url_file", "=", "os", ".", "path", ".", "join", "(", "self", ".", "profil...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
IPEngineApp.load_connector_file
load config from a JSON connector file, at a *lower* priority than command-line/config files.
environment/lib/python2.7/site-packages/IPython/parallel/apps/ipengineapp.py
def load_connector_file(self): """load config from a JSON connector file, at a *lower* priority than command-line/config files. """ self.log.info("Loading url_file %r", self.url_file) config = self.config with open(self.url_file) as f: d = js...
def load_connector_file(self): """load config from a JSON connector file, at a *lower* priority than command-line/config files. """ self.log.info("Loading url_file %r", self.url_file) config = self.config with open(self.url_file) as f: d = js...
[ "load", "config", "from", "a", "JSON", "connector", "file", "at", "a", "*", "lower", "*", "priority", "than", "command", "-", "line", "/", "config", "files", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/apps/ipengineapp.py#L203-L231
[ "def", "load_connector_file", "(", "self", ")", ":", "self", ".", "log", ".", "info", "(", "\"Loading url_file %r\"", ",", "self", ".", "url_file", ")", "config", "=", "self", ".", "config", "with", "open", "(", "self", ".", "url_file", ")", "as", "f", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
IPEngineApp.bind_kernel
Promote engine to listening kernel, accessible to frontends.
environment/lib/python2.7/site-packages/IPython/parallel/apps/ipengineapp.py
def bind_kernel(self, **kwargs): """Promote engine to listening kernel, accessible to frontends.""" if self.kernel_app is not None: return self.log.info("Opening ports for direct connections as an IPython kernel") kernel = self.kernel kwargs...
def bind_kernel(self, **kwargs): """Promote engine to listening kernel, accessible to frontends.""" if self.kernel_app is not None: return self.log.info("Opening ports for direct connections as an IPython kernel") kernel = self.kernel kwargs...
[ "Promote", "engine", "to", "listening", "kernel", "accessible", "to", "frontends", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/apps/ipengineapp.py#L233-L270
[ "def", "bind_kernel", "(", "self", ",", "*", "*", "kwargs", ")", ":", "if", "self", ".", "kernel_app", "is", "not", "None", ":", "return", "self", ".", "log", ".", "info", "(", "\"Opening ports for direct connections as an IPython kernel\"", ")", "kernel", "="...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
pid_exists
Check whether pid exists in the current process table.
environment/lib/python2.7/site-packages/psutil/_psposix.py
def pid_exists(pid): """Check whether pid exists in the current process table.""" if not isinstance(pid, int): raise TypeError('an integer is required') if pid < 0: return False try: os.kill(pid, 0) except OSError: e = sys.exc_info()[1] return e.errno == errno...
def pid_exists(pid): """Check whether pid exists in the current process table.""" if not isinstance(pid, int): raise TypeError('an integer is required') if pid < 0: return False try: os.kill(pid, 0) except OSError: e = sys.exc_info()[1] return e.errno == errno...
[ "Check", "whether", "pid", "exists", "in", "the", "current", "process", "table", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/psutil/_psposix.py#L22-L34
[ "def", "pid_exists", "(", "pid", ")", ":", "if", "not", "isinstance", "(", "pid", ",", "int", ")", ":", "raise", "TypeError", "(", "'an integer is required'", ")", "if", "pid", "<", "0", ":", "return", "False", "try", ":", "os", ".", "kill", "(", "pi...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
get_disk_usage
Return disk usage associated with path.
environment/lib/python2.7/site-packages/psutil/_psposix.py
def get_disk_usage(path): """Return disk usage associated with path.""" st = os.statvfs(path) free = (st.f_bavail * st.f_frsize) total = (st.f_blocks * st.f_frsize) used = (st.f_blocks - st.f_bfree) * st.f_frsize percent = usage_percent(used, total, _round=1) # NB: the percentage is -5% than...
def get_disk_usage(path): """Return disk usage associated with path.""" st = os.statvfs(path) free = (st.f_bavail * st.f_frsize) total = (st.f_blocks * st.f_frsize) used = (st.f_blocks - st.f_bfree) * st.f_frsize percent = usage_percent(used, total, _round=1) # NB: the percentage is -5% than...
[ "Return", "disk", "usage", "associated", "with", "path", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/psutil/_psposix.py#L100-L110
[ "def", "get_disk_usage", "(", "path", ")", ":", "st", "=", "os", ".", "statvfs", "(", "path", ")", "free", "=", "(", "st", ".", "f_bavail", "*", "st", ".", "f_frsize", ")", "total", "=", "(", "st", ".", "f_blocks", "*", "st", ".", "f_frsize", ")"...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
timid
Execute a test described by a YAML file. :param ctxt: A ``timid.context.Context`` object. :param test: The name of a YAML file containing the test description. Note that the current working directory set up in ``ctxt.environment`` does not affect the resoluti...
timid/main.py
def timid(ctxt, test, key=None, check=False, exts=None): """ Execute a test described by a YAML file. :param ctxt: A ``timid.context.Context`` object. :param test: The name of a YAML file containing the test description. Note that the current working directory set up ...
def timid(ctxt, test, key=None, check=False, exts=None): """ Execute a test described by a YAML file. :param ctxt: A ``timid.context.Context`` object. :param test: The name of a YAML file containing the test description. Note that the current working directory set up ...
[ "Execute", "a", "test", "described", "by", "a", "YAML", "file", "." ]
rackerlabs/timid
python
https://github.com/rackerlabs/timid/blob/b1c6aa159ab380a033740f4aa392cf0d125e0ac6/timid/main.py#L161-L229
[ "def", "timid", "(", "ctxt", ",", "test", ",", "key", "=", "None", ",", "check", "=", "False", ",", "exts", "=", "None", ")", ":", "# Normalize the extension set", "if", "exts", "is", "None", ":", "exts", "=", "extensions", ".", "ExtensionSet", "(", ")...
b1c6aa159ab380a033740f4aa392cf0d125e0ac6
test
_processor
A ``cli_tools`` processor function that interfaces between the command line and the ``timid()`` function. This function is responsible for allocating a ``timid.context.Context`` object and initializing the activated extensions, and for calling those extensions' ``finalize()`` method. :param args: ...
timid/main.py
def _processor(args): """ A ``cli_tools`` processor function that interfaces between the command line and the ``timid()`` function. This function is responsible for allocating a ``timid.context.Context`` object and initializing the activated extensions, and for calling those extensions' ``final...
def _processor(args): """ A ``cli_tools`` processor function that interfaces between the command line and the ``timid()`` function. This function is responsible for allocating a ``timid.context.Context`` object and initializing the activated extensions, and for calling those extensions' ``final...
[ "A", "cli_tools", "processor", "function", "that", "interfaces", "between", "the", "command", "line", "and", "the", "timid", "()", "function", ".", "This", "function", "is", "responsible", "for", "allocating", "a", "timid", ".", "context", ".", "Context", "obj...
rackerlabs/timid
python
https://github.com/rackerlabs/timid/blob/b1c6aa159ab380a033740f4aa392cf0d125e0ac6/timid/main.py#L248-L295
[ "def", "_processor", "(", "args", ")", ":", "# Begin by initializing a context", "args", ".", "ctxt", "=", "context", ".", "Context", "(", "args", ".", "verbose", ",", "args", ".", "debug", ",", "args", ".", "directory", ")", "# Now set up the extension set", ...
b1c6aa159ab380a033740f4aa392cf0d125e0ac6
test
create_lang_instance
>>> lang_instance = create_lang_instance() >>> lang_instance.aml_evaluate(lang_instance.aml_compile('1 = 1')) True >>> li = create_lang_instance() >>> c = li.aml_compile >>> e = li.aml_evaluate >>> p = li.aml_translate_python >>> s = li.aml_translate_sql >>> u = li.aml_suggest >>> e(c('1 = 0')) False >>> e(c...
aml/__init__.py
def create_lang_instance(var_map = None): """ >>> lang_instance = create_lang_instance() >>> lang_instance.aml_evaluate(lang_instance.aml_compile('1 = 1')) True >>> li = create_lang_instance() >>> c = li.aml_compile >>> e = li.aml_evaluate >>> p = li.aml_translate_python >>> s = li.aml_translate_sql >>> u = l...
def create_lang_instance(var_map = None): """ >>> lang_instance = create_lang_instance() >>> lang_instance.aml_evaluate(lang_instance.aml_compile('1 = 1')) True >>> li = create_lang_instance() >>> c = li.aml_compile >>> e = li.aml_evaluate >>> p = li.aml_translate_python >>> s = li.aml_translate_sql >>> u = l...
[ ">>>", "lang_instance", "=", "create_lang_instance", "()", ">>>", "lang_instance", ".", "aml_evaluate", "(", "lang_instance", ".", "aml_compile", "(", "1", "=", "1", "))", "True", ">>>", "li", "=", "create_lang_instance", "()", ">>>", "c", "=", "li", ".", "a...
gtzampanakis/aml
python
https://github.com/gtzampanakis/aml/blob/56e089a101cc9a51ae7c8f631663c2f568ebd0d1/aml/__init__.py#L16-L445
[ "def", "create_lang_instance", "(", "var_map", "=", "None", ")", ":", "def", "py_bool_to_lit", "(", "py_bool", ")", ":", "return", "parse", "(", "'true'", "if", "py_bool", "else", "'false'", ",", "BooleanLiteral", ")", "if", "not", "var_map", ":", "class", ...
56e089a101cc9a51ae7c8f631663c2f568ebd0d1
test
ParentPollerWindows.create_interrupt_event
Create an interrupt event handle. The parent process should use this static method for creating the interrupt event that is passed to the child process. It should store this handle and use it with ``send_interrupt`` to interrupt the child process.
environment/lib/python2.7/site-packages/IPython/zmq/parentpoller.py
def create_interrupt_event(): """ Create an interrupt event handle. The parent process should use this static method for creating the interrupt event that is passed to the child process. It should store this handle and use it with ``send_interrupt`` to interrupt the child proces...
def create_interrupt_event(): """ Create an interrupt event handle. The parent process should use this static method for creating the interrupt event that is passed to the child process. It should store this handle and use it with ``send_interrupt`` to interrupt the child proces...
[ "Create", "an", "interrupt", "event", "handle", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/parentpoller.py#L67-L92
[ "def", "create_interrupt_event", "(", ")", ":", "# Create a security attributes struct that permits inheritance of the", "# handle by new processes.", "# FIXME: We can clean up this mess by requiring pywin32 for IPython.", "class", "SECURITY_ATTRIBUTES", "(", "ctypes", ".", "Structure", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
ParentPollerWindows.run
Run the poll loop. This method never returns.
environment/lib/python2.7/site-packages/IPython/zmq/parentpoller.py
def run(self): """ Run the poll loop. This method never returns. """ try: from _winapi import WAIT_OBJECT_0, INFINITE except ImportError: from _subprocess import WAIT_OBJECT_0, INFINITE # Build the list of handle to listen on. handles = [] ...
def run(self): """ Run the poll loop. This method never returns. """ try: from _winapi import WAIT_OBJECT_0, INFINITE except ImportError: from _subprocess import WAIT_OBJECT_0, INFINITE # Build the list of handle to listen on. handles = [] ...
[ "Run", "the", "poll", "loop", ".", "This", "method", "never", "returns", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/parentpoller.py#L100-L139
[ "def", "run", "(", "self", ")", ":", "try", ":", "from", "_winapi", "import", "WAIT_OBJECT_0", ",", "INFINITE", "except", "ImportError", ":", "from", "_subprocess", "import", "WAIT_OBJECT_0", ",", "INFINITE", "# Build the list of handle to listen on.", "handles", "=...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
initialize
Function to initialize settings from command line and/or custom settings file :return: Returns str with operation type
c3po/mod/initializer.py
def initialize(): """ Function to initialize settings from command line and/or custom settings file :return: Returns str with operation type """ if len(sys.argv) == 1: usage() sys.exit() command = _get_command(sys.argv[1]) try: opts, args = getopt.getopt(sys.argv[2:...
def initialize(): """ Function to initialize settings from command line and/or custom settings file :return: Returns str with operation type """ if len(sys.argv) == 1: usage() sys.exit() command = _get_command(sys.argv[1]) try: opts, args = getopt.getopt(sys.argv[2:...
[ "Function", "to", "initialize", "settings", "from", "command", "line", "and", "/", "or", "custom", "settings", "file", ":", "return", ":", "Returns", "str", "with", "operation", "type" ]
VorskiImagineering/C3PO
python
https://github.com/VorskiImagineering/C3PO/blob/e3e35835e5ac24158848afed4f905ca44ac3ae00/c3po/mod/initializer.py#L86-L113
[ "def", "initialize", "(", ")", ":", "if", "len", "(", "sys", ".", "argv", ")", "==", "1", ":", "usage", "(", ")", "sys", ".", "exit", "(", ")", "command", "=", "_get_command", "(", "sys", ".", "argv", "[", "1", "]", ")", "try", ":", "opts", "...
e3e35835e5ac24158848afed4f905ca44ac3ae00
test
create_typestr2type_dicts
Return dictionaries mapping lower case typename (e.g. 'tuple') to type objects from the types package, and vice versa.
environment/lib/python2.7/site-packages/IPython/utils/wildcard.py
def create_typestr2type_dicts(dont_include_in_type2typestr=["lambda"]): """Return dictionaries mapping lower case typename (e.g. 'tuple') to type objects from the types package, and vice versa.""" typenamelist = [tname for tname in dir(types) if tname.endswith("Type")] typestr2type, type2typestr = {}, {...
def create_typestr2type_dicts(dont_include_in_type2typestr=["lambda"]): """Return dictionaries mapping lower case typename (e.g. 'tuple') to type objects from the types package, and vice versa.""" typenamelist = [tname for tname in dir(types) if tname.endswith("Type")] typestr2type, type2typestr = {}, {...
[ "Return", "dictionaries", "mapping", "lower", "case", "typename", "(", "e", ".", "g", ".", "tuple", ")", "to", "type", "objects", "from", "the", "types", "package", "and", "vice", "versa", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/wildcard.py#L22-L34
[ "def", "create_typestr2type_dicts", "(", "dont_include_in_type2typestr", "=", "[", "\"lambda\"", "]", ")", ":", "typenamelist", "=", "[", "tname", "for", "tname", "in", "dir", "(", "types", ")", "if", "tname", ".", "endswith", "(", "\"Type\"", ")", "]", "typ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
is_type
is_type(obj, typestr_or_type) verifies if obj is of a certain type. It can take strings or actual python types for the second argument, i.e. 'tuple'<->TupleType. 'all' matches all types. TODO: Should be extended for choosing more than one type.
environment/lib/python2.7/site-packages/IPython/utils/wildcard.py
def is_type(obj, typestr_or_type): """is_type(obj, typestr_or_type) verifies if obj is of a certain type. It can take strings or actual python types for the second argument, i.e. 'tuple'<->TupleType. 'all' matches all types. TODO: Should be extended for choosing more than one type.""" if typestr_or...
def is_type(obj, typestr_or_type): """is_type(obj, typestr_or_type) verifies if obj is of a certain type. It can take strings or actual python types for the second argument, i.e. 'tuple'<->TupleType. 'all' matches all types. TODO: Should be extended for choosing more than one type.""" if typestr_or...
[ "is_type", "(", "obj", "typestr_or_type", ")", "verifies", "if", "obj", "is", "of", "a", "certain", "type", ".", "It", "can", "take", "strings", "or", "actual", "python", "types", "for", "the", "second", "argument", "i", ".", "e", ".", "tuple", "<", "-...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/wildcard.py#L38-L52
[ "def", "is_type", "(", "obj", ",", "typestr_or_type", ")", ":", "if", "typestr_or_type", "==", "\"all\"", ":", "return", "True", "if", "type", "(", "typestr_or_type", ")", "==", "types", ".", "TypeType", ":", "test_type", "=", "typestr_or_type", "else", ":",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
dict_dir
Produce a dictionary of an object's attributes. Builds on dir2 by checking that a getattr() call actually succeeds.
environment/lib/python2.7/site-packages/IPython/utils/wildcard.py
def dict_dir(obj): """Produce a dictionary of an object's attributes. Builds on dir2 by checking that a getattr() call actually succeeds.""" ns = {} for key in dir2(obj): # This seemingly unnecessary try/except is actually needed # because there is code out there with metaclasses that ...
def dict_dir(obj): """Produce a dictionary of an object's attributes. Builds on dir2 by checking that a getattr() call actually succeeds.""" ns = {} for key in dir2(obj): # This seemingly unnecessary try/except is actually needed # because there is code out there with metaclasses that ...
[ "Produce", "a", "dictionary", "of", "an", "object", "s", "attributes", ".", "Builds", "on", "dir2", "by", "checking", "that", "a", "getattr", "()", "call", "actually", "succeeds", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/wildcard.py#L58-L73
[ "def", "dict_dir", "(", "obj", ")", ":", "ns", "=", "{", "}", "for", "key", "in", "dir2", "(", "obj", ")", ":", "# This seemingly unnecessary try/except is actually needed", "# because there is code out there with metaclasses that", "# create 'write only' attributes, where a ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
filter_ns
Filter a namespace dictionary by name pattern and item type.
environment/lib/python2.7/site-packages/IPython/utils/wildcard.py
def filter_ns(ns, name_pattern="*", type_pattern="all", ignore_case=True, show_all=True): """Filter a namespace dictionary by name pattern and item type.""" pattern = name_pattern.replace("*",".*").replace("?",".") if ignore_case: reg = re.compile(pattern+"$", re.I) else: reg...
def filter_ns(ns, name_pattern="*", type_pattern="all", ignore_case=True, show_all=True): """Filter a namespace dictionary by name pattern and item type.""" pattern = name_pattern.replace("*",".*").replace("?",".") if ignore_case: reg = re.compile(pattern+"$", re.I) else: reg...
[ "Filter", "a", "namespace", "dictionary", "by", "name", "pattern", "and", "item", "type", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/wildcard.py#L75-L87
[ "def", "filter_ns", "(", "ns", ",", "name_pattern", "=", "\"*\"", ",", "type_pattern", "=", "\"all\"", ",", "ignore_case", "=", "True", ",", "show_all", "=", "True", ")", ":", "pattern", "=", "name_pattern", ".", "replace", "(", "\"*\"", ",", "\".*\"", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
list_namespace
Return dictionary of all objects in a namespace dictionary that match type_pattern and filter.
environment/lib/python2.7/site-packages/IPython/utils/wildcard.py
def list_namespace(namespace, type_pattern, filter, ignore_case=False, show_all=False): """Return dictionary of all objects in a namespace dictionary that match type_pattern and filter.""" pattern_list=filter.split(".") if len(pattern_list) == 1: return filter_ns(namespace, name_pattern=pattern_l...
def list_namespace(namespace, type_pattern, filter, ignore_case=False, show_all=False): """Return dictionary of all objects in a namespace dictionary that match type_pattern and filter.""" pattern_list=filter.split(".") if len(pattern_list) == 1: return filter_ns(namespace, name_pattern=pattern_l...
[ "Return", "dictionary", "of", "all", "objects", "in", "a", "namespace", "dictionary", "that", "match", "type_pattern", "and", "filter", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/wildcard.py#L89-L111
[ "def", "list_namespace", "(", "namespace", ",", "type_pattern", ",", "filter", ",", "ignore_case", "=", "False", ",", "show_all", "=", "False", ")", ":", "pattern_list", "=", "filter", ".", "split", "(", "\".\"", ")", "if", "len", "(", "pattern_list", ")",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
mutex_opts
Check for presence of mutually exclusive keys in a dict. Call: mutex_opts(dict,[[op1a,op1b],[op2a,op2b]...]
environment/lib/python2.7/site-packages/IPython/utils/attic.py
def mutex_opts(dict,ex_op): """Check for presence of mutually exclusive keys in a dict. Call: mutex_opts(dict,[[op1a,op1b],[op2a,op2b]...]""" for op1,op2 in ex_op: if op1 in dict and op2 in dict: raise ValueError,'\n*** ERROR in Arguments *** '\ 'Options '+op1+' and '+...
def mutex_opts(dict,ex_op): """Check for presence of mutually exclusive keys in a dict. Call: mutex_opts(dict,[[op1a,op1b],[op2a,op2b]...]""" for op1,op2 in ex_op: if op1 in dict and op2 in dict: raise ValueError,'\n*** ERROR in Arguments *** '\ 'Options '+op1+' and '+...
[ "Check", "for", "presence", "of", "mutually", "exclusive", "keys", "in", "a", "dict", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/attic.py#L30-L37
[ "def", "mutex_opts", "(", "dict", ",", "ex_op", ")", ":", "for", "op1", ",", "op2", "in", "ex_op", ":", "if", "op1", "in", "dict", "and", "op2", "in", "dict", ":", "raise", "ValueError", ",", "'\\n*** ERROR in Arguments *** '", "'Options '", "+", "op1", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
map_method
map_method(method,object_list,*args,**kw) -> list Return a list of the results of applying the methods to the items of the argument sequence(s). If more than one sequence is given, the method is called with an argument list consisting of the corresponding item of each sequence. All sequences must be o...
environment/lib/python2.7/site-packages/IPython/utils/attic.py
def map_method(method,object_list,*argseq,**kw): """map_method(method,object_list,*args,**kw) -> list Return a list of the results of applying the methods to the items of the argument sequence(s). If more than one sequence is given, the method is called with an argument list consisting of the correspo...
def map_method(method,object_list,*argseq,**kw): """map_method(method,object_list,*args,**kw) -> list Return a list of the results of applying the methods to the items of the argument sequence(s). If more than one sequence is given, the method is called with an argument list consisting of the correspo...
[ "map_method", "(", "method", "object_list", "*", "args", "**", "kw", ")", "-", ">", "list" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/attic.py#L99-L126
[ "def", "map_method", "(", "method", ",", "object_list", ",", "*", "argseq", ",", "*", "*", "kw", ")", ":", "out_list", "=", "[", "]", "idx", "=", "0", "for", "object", "in", "object_list", ":", "try", ":", "handler", "=", "getattr", "(", "object", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e