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 | ListTB._format_exception_only | Format the exception part of a traceback.
The arguments are the exception type and value such as given by
sys.exc_info()[:2]. The return value is a list of strings, each ending
in a newline. Normally, the list contains a single string; however,
for SyntaxError exceptions, it contains s... | environment/lib/python2.7/site-packages/IPython/core/ultratb.py | def _format_exception_only(self, etype, value):
"""Format the exception part of a traceback.
The arguments are the exception type and value such as given by
sys.exc_info()[:2]. The return value is a list of strings, each ending
in a newline. Normally, the list contains a single string;... | def _format_exception_only(self, etype, value):
"""Format the exception part of a traceback.
The arguments are the exception type and value such as given by
sys.exc_info()[:2]. The return value is a list of strings, each ending
in a newline. Normally, the list contains a single string;... | [
"Format",
"the",
"exception",
"part",
"of",
"a",
"traceback",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/ultratb.py#L544-L607 | [
"def",
"_format_exception_only",
"(",
"self",
",",
"etype",
",",
"value",
")",
":",
"have_filedata",
"=",
"False",
"Colors",
"=",
"self",
".",
"Colors",
"list",
"=",
"[",
"]",
"stype",
"=",
"Colors",
".",
"excName",
"+",
"etype",
".",
"__name__",
"+",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | ListTB.show_exception_only | Only print the exception type and message, without a traceback.
Parameters
----------
etype : exception type
value : exception value | environment/lib/python2.7/site-packages/IPython/core/ultratb.py | def show_exception_only(self, etype, evalue):
"""Only print the exception type and message, without a traceback.
Parameters
----------
etype : exception type
value : exception value
"""
# This method needs to use __call__ from *this* class, not the one from
... | def show_exception_only(self, etype, evalue):
"""Only print the exception type and message, without a traceback.
Parameters
----------
etype : exception type
value : exception value
"""
# This method needs to use __call__ from *this* class, not the one from
... | [
"Only",
"print",
"the",
"exception",
"type",
"and",
"message",
"without",
"a",
"traceback",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/ultratb.py#L620-L633 | [
"def",
"show_exception_only",
"(",
"self",
",",
"etype",
",",
"evalue",
")",
":",
"# This method needs to use __call__ from *this* class, not the one from",
"# a subclass whose signature or behavior may be different",
"ostream",
"=",
"self",
".",
"ostream",
"ostream",
".",
"flu... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | VerboseTB.structured_traceback | Return a nice text document describing the traceback. | environment/lib/python2.7/site-packages/IPython/core/ultratb.py | def structured_traceback(self, etype, evalue, etb, tb_offset=None,
context=5):
"""Return a nice text document describing the traceback."""
tb_offset = self.tb_offset if tb_offset is None else tb_offset
# some locals
try:
etype = etype.__name__
... | def structured_traceback(self, etype, evalue, etb, tb_offset=None,
context=5):
"""Return a nice text document describing the traceback."""
tb_offset = self.tb_offset if tb_offset is None else tb_offset
# some locals
try:
etype = etype.__name__
... | [
"Return",
"a",
"nice",
"text",
"document",
"describing",
"the",
"traceback",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/ultratb.py#L674-L966 | [
"def",
"structured_traceback",
"(",
"self",
",",
"etype",
",",
"evalue",
",",
"etb",
",",
"tb_offset",
"=",
"None",
",",
"context",
"=",
"5",
")",
":",
"tb_offset",
"=",
"self",
".",
"tb_offset",
"if",
"tb_offset",
"is",
"None",
"else",
"tb_offset",
"# s... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | VerboseTB.debugger | Call up the pdb debugger if desired, always clean up the tb
reference.
Keywords:
- force(False): by default, this routine checks the instance call_pdb
flag and does not actually invoke the debugger if the flag is false.
The 'force' option forces the debugger to activate e... | environment/lib/python2.7/site-packages/IPython/core/ultratb.py | def debugger(self,force=False):
"""Call up the pdb debugger if desired, always clean up the tb
reference.
Keywords:
- force(False): by default, this routine checks the instance call_pdb
flag and does not actually invoke the debugger if the flag is false.
The 'forc... | def debugger(self,force=False):
"""Call up the pdb debugger if desired, always clean up the tb
reference.
Keywords:
- force(False): by default, this routine checks the instance call_pdb
flag and does not actually invoke the debugger if the flag is false.
The 'forc... | [
"Call",
"up",
"the",
"pdb",
"debugger",
"if",
"desired",
"always",
"clean",
"up",
"the",
"tb",
"reference",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/ultratb.py#L968-L1010 | [
"def",
"debugger",
"(",
"self",
",",
"force",
"=",
"False",
")",
":",
"if",
"force",
"or",
"self",
".",
"call_pdb",
":",
"if",
"self",
".",
"pdb",
"is",
"None",
":",
"self",
".",
"pdb",
"=",
"debugger",
".",
"Pdb",
"(",
"self",
".",
"color_scheme_t... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | FormattedTB.set_mode | Switch to the desired mode.
If mode is not specified, cycles through the available modes. | environment/lib/python2.7/site-packages/IPython/core/ultratb.py | def set_mode(self,mode=None):
"""Switch to the desired mode.
If mode is not specified, cycles through the available modes."""
if not mode:
new_idx = ( self.valid_modes.index(self.mode) + 1 ) % \
len(self.valid_modes)
self.mode = self.valid_modes[ne... | def set_mode(self,mode=None):
"""Switch to the desired mode.
If mode is not specified, cycles through the available modes."""
if not mode:
new_idx = ( self.valid_modes.index(self.mode) + 1 ) % \
len(self.valid_modes)
self.mode = self.valid_modes[ne... | [
"Switch",
"to",
"the",
"desired",
"mode",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/ultratb.py#L1096-L1113 | [
"def",
"set_mode",
"(",
"self",
",",
"mode",
"=",
"None",
")",
":",
"if",
"not",
"mode",
":",
"new_idx",
"=",
"(",
"self",
".",
"valid_modes",
".",
"index",
"(",
"self",
".",
"mode",
")",
"+",
"1",
")",
"%",
"len",
"(",
"self",
".",
"valid_modes"... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | group_required | View decorator for requiring a user group. | django_baseline/decorators.py | def group_required(group,
login_url=None,
redirect_field_name=REDIRECT_FIELD_NAME,
skip_superuser=True):
"""
View decorator for requiring a user group.
"""
def decorator(view_func):
@login_required(redirect_field_name=redirect_fiel... | def group_required(group,
login_url=None,
redirect_field_name=REDIRECT_FIELD_NAME,
skip_superuser=True):
"""
View decorator for requiring a user group.
"""
def decorator(view_func):
@login_required(redirect_field_name=redirect_fiel... | [
"View",
"decorator",
"for",
"requiring",
"a",
"user",
"group",
"."
] | theduke/django-baseline | python | https://github.com/theduke/django-baseline/blob/7be8b956e53c70b35f34e1783a8fe8f716955afb/django_baseline/decorators.py#L7-L26 | [
"def",
"group_required",
"(",
"group",
",",
"login_url",
"=",
"None",
",",
"redirect_field_name",
"=",
"REDIRECT_FIELD_NAME",
",",
"skip_superuser",
"=",
"True",
")",
":",
"def",
"decorator",
"(",
"view_func",
")",
":",
"@",
"login_required",
"(",
"redirect_fiel... | 7be8b956e53c70b35f34e1783a8fe8f716955afb |
test | get_parent | parent, name = get_parent(globals, level)
Return the package that an import is being performed in. If globals comes
from the module foo.bar.bat (not itself a package), this returns the
sys.modules entry for foo.bar. If globals is from a package's __init__.py,
the package's entry in sys.modules is ret... | environment/lib/python2.7/site-packages/IPython/lib/deepreload.py | def get_parent(globals, level):
"""
parent, name = get_parent(globals, level)
Return the package that an import is being performed in. If globals comes
from the module foo.bar.bat (not itself a package), this returns the
sys.modules entry for foo.bar. If globals is from a package's __init__.py,
... | def get_parent(globals, level):
"""
parent, name = get_parent(globals, level)
Return the package that an import is being performed in. If globals comes
from the module foo.bar.bat (not itself a package), this returns the
sys.modules entry for foo.bar. If globals is from a package's __init__.py,
... | [
"parent",
"name",
"=",
"get_parent",
"(",
"globals",
"level",
")"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/lib/deepreload.py#L46-L117 | [
"def",
"get_parent",
"(",
"globals",
",",
"level",
")",
":",
"orig_level",
"=",
"level",
"if",
"not",
"level",
"or",
"not",
"isinstance",
"(",
"globals",
",",
"dict",
")",
":",
"return",
"None",
",",
"''",
"pkgname",
"=",
"globals",
".",
"get",
"(",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | load_next | mod, name, buf = load_next(mod, altmod, name, buf)
altmod is either None or same as mod | environment/lib/python2.7/site-packages/IPython/lib/deepreload.py | def load_next(mod, altmod, name, buf):
"""
mod, name, buf = load_next(mod, altmod, name, buf)
altmod is either None or same as mod
"""
if len(name) == 0:
# completely empty module name should only happen in
# 'from . import' (or '__import__("")')
return mod, None, buf
... | def load_next(mod, altmod, name, buf):
"""
mod, name, buf = load_next(mod, altmod, name, buf)
altmod is either None or same as mod
"""
if len(name) == 0:
# completely empty module name should only happen in
# 'from . import' (or '__import__("")')
return mod, None, buf
... | [
"mod",
"name",
"buf",
"=",
"load_next",
"(",
"mod",
"altmod",
"name",
"buf",
")"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/lib/deepreload.py#L119-L155 | [
"def",
"load_next",
"(",
"mod",
",",
"altmod",
",",
"name",
",",
"buf",
")",
":",
"if",
"len",
"(",
"name",
")",
"==",
"0",
":",
"# completely empty module name should only happen in",
"# 'from . import' (or '__import__(\"\")')",
"return",
"mod",
",",
"None",
",",... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | import_submodule | m = import_submodule(mod, subname, fullname) | environment/lib/python2.7/site-packages/IPython/lib/deepreload.py | def import_submodule(mod, subname, fullname):
"""m = import_submodule(mod, subname, fullname)"""
# Require:
# if mod == None: subname == fullname
# else: mod.__name__ + "." + subname == fullname
global found_now
if fullname in found_now and fullname in sys.modules:
m = sys.modules[fulln... | def import_submodule(mod, subname, fullname):
"""m = import_submodule(mod, subname, fullname)"""
# Require:
# if mod == None: subname == fullname
# else: mod.__name__ + "." + subname == fullname
global found_now
if fullname in found_now and fullname in sys.modules:
m = sys.modules[fulln... | [
"m",
"=",
"import_submodule",
"(",
"mod",
"subname",
"fullname",
")"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/lib/deepreload.py#L160-L203 | [
"def",
"import_submodule",
"(",
"mod",
",",
"subname",
",",
"fullname",
")",
":",
"# Require:",
"# if mod == None: subname == fullname",
"# else: mod.__name__ + \".\" + subname == fullname",
"global",
"found_now",
"if",
"fullname",
"in",
"found_now",
"and",
"fullname",
"in"... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | add_submodule | mod.{subname} = submod | environment/lib/python2.7/site-packages/IPython/lib/deepreload.py | def add_submodule(mod, submod, fullname, subname):
"""mod.{subname} = submod"""
if mod is None:
return #Nothing to do here.
if submod is None:
submod = sys.modules[fullname]
setattr(mod, subname, submod)
return | def add_submodule(mod, submod, fullname, subname):
"""mod.{subname} = submod"""
if mod is None:
return #Nothing to do here.
if submod is None:
submod = sys.modules[fullname]
setattr(mod, subname, submod)
return | [
"mod",
".",
"{",
"subname",
"}",
"=",
"submod"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/lib/deepreload.py#L205-L215 | [
"def",
"add_submodule",
"(",
"mod",
",",
"submod",
",",
"fullname",
",",
"subname",
")",
":",
"if",
"mod",
"is",
"None",
":",
"return",
"#Nothing to do here.",
"if",
"submod",
"is",
"None",
":",
"submod",
"=",
"sys",
".",
"modules",
"[",
"fullname",
"]",... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | ensure_fromlist | Handle 'from module import a, b, c' imports. | environment/lib/python2.7/site-packages/IPython/lib/deepreload.py | def ensure_fromlist(mod, fromlist, buf, recursive):
"""Handle 'from module import a, b, c' imports."""
if not hasattr(mod, '__path__'):
return
for item in fromlist:
if not hasattr(item, 'rindex'):
raise TypeError("Item in ``from list'' not a string")
if item == '*':
... | def ensure_fromlist(mod, fromlist, buf, recursive):
"""Handle 'from module import a, b, c' imports."""
if not hasattr(mod, '__path__'):
return
for item in fromlist:
if not hasattr(item, 'rindex'):
raise TypeError("Item in ``from list'' not a string")
if item == '*':
... | [
"Handle",
"from",
"module",
"import",
"a",
"b",
"c",
"imports",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/lib/deepreload.py#L217-L236 | [
"def",
"ensure_fromlist",
"(",
"mod",
",",
"fromlist",
",",
"buf",
",",
"recursive",
")",
":",
"if",
"not",
"hasattr",
"(",
"mod",
",",
"'__path__'",
")",
":",
"return",
"for",
"item",
"in",
"fromlist",
":",
"if",
"not",
"hasattr",
"(",
"item",
",",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | deep_import_hook | Replacement for __import__() | environment/lib/python2.7/site-packages/IPython/lib/deepreload.py | def deep_import_hook(name, globals=None, locals=None, fromlist=None, level=-1):
"""Replacement for __import__()"""
parent, buf = get_parent(globals, level)
head, name, buf = load_next(parent, None if level < 0 else parent, name, buf)
tail = head
while name:
tail, name, buf = load_next(tail... | def deep_import_hook(name, globals=None, locals=None, fromlist=None, level=-1):
"""Replacement for __import__()"""
parent, buf = get_parent(globals, level)
head, name, buf = load_next(parent, None if level < 0 else parent, name, buf)
tail = head
while name:
tail, name, buf = load_next(tail... | [
"Replacement",
"for",
"__import__",
"()"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/lib/deepreload.py#L238-L258 | [
"def",
"deep_import_hook",
"(",
"name",
",",
"globals",
"=",
"None",
",",
"locals",
"=",
"None",
",",
"fromlist",
"=",
"None",
",",
"level",
"=",
"-",
"1",
")",
":",
"parent",
",",
"buf",
"=",
"get_parent",
"(",
"globals",
",",
"level",
")",
"head",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | deep_reload_hook | Replacement for reload(). | environment/lib/python2.7/site-packages/IPython/lib/deepreload.py | def deep_reload_hook(m):
"""Replacement for reload()."""
if not isinstance(m, ModuleType):
raise TypeError("reload() argument must be module")
name = m.__name__
if name not in sys.modules:
raise ImportError("reload(): module %.200s not in sys.modules" % name)
global modules_reload... | def deep_reload_hook(m):
"""Replacement for reload()."""
if not isinstance(m, ModuleType):
raise TypeError("reload() argument must be module")
name = m.__name__
if name not in sys.modules:
raise ImportError("reload(): module %.200s not in sys.modules" % name)
global modules_reload... | [
"Replacement",
"for",
"reload",
"()",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/lib/deepreload.py#L262-L311 | [
"def",
"deep_reload_hook",
"(",
"m",
")",
":",
"if",
"not",
"isinstance",
"(",
"m",
",",
"ModuleType",
")",
":",
"raise",
"TypeError",
"(",
"\"reload() argument must be module\"",
")",
"name",
"=",
"m",
".",
"__name__",
"if",
"name",
"not",
"in",
"sys",
".... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | reload | Recursively reload all modules used in the given module. Optionally
takes a list of modules to exclude from reloading. The default exclude
list contains sys, __main__, and __builtin__, to prevent, e.g., resetting
display, exception, and io hooks. | environment/lib/python2.7/site-packages/IPython/lib/deepreload.py | def reload(module, exclude=['sys', 'os.path', '__builtin__', '__main__']):
"""Recursively reload all modules used in the given module. Optionally
takes a list of modules to exclude from reloading. The default exclude
list contains sys, __main__, and __builtin__, to prevent, e.g., resetting
display, ex... | def reload(module, exclude=['sys', 'os.path', '__builtin__', '__main__']):
"""Recursively reload all modules used in the given module. Optionally
takes a list of modules to exclude from reloading. The default exclude
list contains sys, __main__, and __builtin__, to prevent, e.g., resetting
display, ex... | [
"Recursively",
"reload",
"all",
"modules",
"used",
"in",
"the",
"given",
"module",
".",
"Optionally",
"takes",
"a",
"list",
"of",
"modules",
"to",
"exclude",
"from",
"reloading",
".",
"The",
"default",
"exclude",
"list",
"contains",
"sys",
"__main__",
"and",
... | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/lib/deepreload.py#L320-L334 | [
"def",
"reload",
"(",
"module",
",",
"exclude",
"=",
"[",
"'sys'",
",",
"'os.path'",
",",
"'__builtin__'",
",",
"'__main__'",
"]",
")",
":",
"global",
"found_now",
"for",
"i",
"in",
"exclude",
":",
"found_now",
"[",
"i",
"]",
"=",
"1",
"try",
":",
"w... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | code_name | Compute a (probably) unique name for code for caching.
This now expects code to be unicode. | environment/lib/python2.7/site-packages/IPython/core/compilerop.py | def code_name(code, number=0):
""" Compute a (probably) unique name for code for caching.
This now expects code to be unicode.
"""
hash_digest = hashlib.md5(code.encode("utf-8")).hexdigest()
# Include the number and 12 characters of the hash in the name. It's
# pretty much impossible that ... | def code_name(code, number=0):
""" Compute a (probably) unique name for code for caching.
This now expects code to be unicode.
"""
hash_digest = hashlib.md5(code.encode("utf-8")).hexdigest()
# Include the number and 12 characters of the hash in the name. It's
# pretty much impossible that ... | [
"Compute",
"a",
"(",
"probably",
")",
"unique",
"name",
"for",
"code",
"for",
"caching",
".",
"This",
"now",
"expects",
"code",
"to",
"be",
"unicode",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/compilerop.py#L41-L50 | [
"def",
"code_name",
"(",
"code",
",",
"number",
"=",
"0",
")",
":",
"hash_digest",
"=",
"hashlib",
".",
"md5",
"(",
"code",
".",
"encode",
"(",
"\"utf-8\"",
")",
")",
".",
"hexdigest",
"(",
")",
"# Include the number and 12 characters of the hash in the name. I... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | CachingCompiler.ast_parse | Parse code to an AST with the current compiler flags active.
Arguments are exactly the same as ast.parse (in the standard library),
and are passed to the built-in compile function. | environment/lib/python2.7/site-packages/IPython/core/compilerop.py | def ast_parse(self, source, filename='<unknown>', symbol='exec'):
"""Parse code to an AST with the current compiler flags active.
Arguments are exactly the same as ast.parse (in the standard library),
and are passed to the built-in compile function."""
return compile(source, fil... | def ast_parse(self, source, filename='<unknown>', symbol='exec'):
"""Parse code to an AST with the current compiler flags active.
Arguments are exactly the same as ast.parse (in the standard library),
and are passed to the built-in compile function."""
return compile(source, fil... | [
"Parse",
"code",
"to",
"an",
"AST",
"with",
"the",
"current",
"compiler",
"flags",
"active",
".",
"Arguments",
"are",
"exactly",
"the",
"same",
"as",
"ast",
".",
"parse",
"(",
"in",
"the",
"standard",
"library",
")",
"and",
"are",
"passed",
"to",
"the",
... | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/compilerop.py#L82-L87 | [
"def",
"ast_parse",
"(",
"self",
",",
"source",
",",
"filename",
"=",
"'<unknown>'",
",",
"symbol",
"=",
"'exec'",
")",
":",
"return",
"compile",
"(",
"source",
",",
"filename",
",",
"symbol",
",",
"self",
".",
"flags",
"|",
"PyCF_ONLY_AST",
",",
"1",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | CachingCompiler.cache | Make a name for a block of code, and cache the code.
Parameters
----------
code : str
The Python source code to cache.
number : int
A number which forms part of the code's name. Used for the execution
counter.
Returns
----... | environment/lib/python2.7/site-packages/IPython/core/compilerop.py | def cache(self, code, number=0):
"""Make a name for a block of code, and cache the code.
Parameters
----------
code : str
The Python source code to cache.
number : int
A number which forms part of the code's name. Used for the execution
coun... | def cache(self, code, number=0):
"""Make a name for a block of code, and cache the code.
Parameters
----------
code : str
The Python source code to cache.
number : int
A number which forms part of the code's name. Used for the execution
coun... | [
"Make",
"a",
"name",
"for",
"a",
"block",
"of",
"code",
"and",
"cache",
"the",
"code",
".",
"Parameters",
"----------",
"code",
":",
"str",
"The",
"Python",
"source",
"code",
"to",
"cache",
".",
"number",
":",
"int",
"A",
"number",
"which",
"forms",
"p... | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/compilerop.py#L101-L122 | [
"def",
"cache",
"(",
"self",
",",
"code",
",",
"number",
"=",
"0",
")",
":",
"name",
"=",
"code_name",
"(",
"code",
",",
"number",
")",
"entry",
"=",
"(",
"len",
"(",
"code",
")",
",",
"time",
".",
"time",
"(",
")",
",",
"[",
"line",
"+",
"'\... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | CachingCompiler.check_cache | Call linecache.checkcache() safely protecting our cached values. | environment/lib/python2.7/site-packages/IPython/core/compilerop.py | def check_cache(self, *args):
"""Call linecache.checkcache() safely protecting our cached values.
"""
# First call the orignal checkcache as intended
linecache._checkcache_ori(*args)
# Then, update back the cache with our data, so that tracebacks related
# to our compiled... | def check_cache(self, *args):
"""Call linecache.checkcache() safely protecting our cached values.
"""
# First call the orignal checkcache as intended
linecache._checkcache_ori(*args)
# Then, update back the cache with our data, so that tracebacks related
# to our compiled... | [
"Call",
"linecache",
".",
"checkcache",
"()",
"safely",
"protecting",
"our",
"cached",
"values",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/compilerop.py#L124-L131 | [
"def",
"check_cache",
"(",
"self",
",",
"*",
"args",
")",
":",
"# First call the orignal checkcache as intended",
"linecache",
".",
"_checkcache_ori",
"(",
"*",
"args",
")",
"# Then, update back the cache with our data, so that tracebacks related",
"# to our compiled codes can be... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | CodeBuilder.add_line | Add a line of source to the code.
Don't include indentations or newlines. | virtualEnvironment/lib/python2.7/site-packages/coverage/templite.py | def add_line(self, line):
"""Add a line of source to the code.
Don't include indentations or newlines.
"""
self.code.append(" " * self.indent_amount)
self.code.append(line)
self.code.append("\n") | def add_line(self, line):
"""Add a line of source to the code.
Don't include indentations or newlines.
"""
self.code.append(" " * self.indent_amount)
self.code.append(line)
self.code.append("\n") | [
"Add",
"a",
"line",
"of",
"source",
"to",
"the",
"code",
"."
] | tnkteja/myhelp | python | https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/templite.py#L17-L25 | [
"def",
"add_line",
"(",
"self",
",",
"line",
")",
":",
"self",
".",
"code",
".",
"append",
"(",
"\" \"",
"*",
"self",
".",
"indent_amount",
")",
"self",
".",
"code",
".",
"append",
"(",
"line",
")",
"self",
".",
"code",
".",
"append",
"(",
"\"\\n\"... | fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb |
test | CodeBuilder.add_section | Add a section, a sub-CodeBuilder. | virtualEnvironment/lib/python2.7/site-packages/coverage/templite.py | def add_section(self):
"""Add a section, a sub-CodeBuilder."""
sect = CodeBuilder(self.indent_amount)
self.code.append(sect)
return sect | def add_section(self):
"""Add a section, a sub-CodeBuilder."""
sect = CodeBuilder(self.indent_amount)
self.code.append(sect)
return sect | [
"Add",
"a",
"section",
"a",
"sub",
"-",
"CodeBuilder",
"."
] | tnkteja/myhelp | python | https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/templite.py#L27-L31 | [
"def",
"add_section",
"(",
"self",
")",
":",
"sect",
"=",
"CodeBuilder",
"(",
"self",
".",
"indent_amount",
")",
"self",
".",
"code",
".",
"append",
"(",
"sect",
")",
"return",
"sect"
] | fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb |
test | CodeBuilder.get_function | Compile the code, and return the function `fn_name`. | virtualEnvironment/lib/python2.7/site-packages/coverage/templite.py | def get_function(self, fn_name):
"""Compile the code, and return the function `fn_name`."""
assert self.indent_amount == 0
g = {}
code_text = str(self)
exec(code_text, g)
return g[fn_name] | def get_function(self, fn_name):
"""Compile the code, and return the function `fn_name`."""
assert self.indent_amount == 0
g = {}
code_text = str(self)
exec(code_text, g)
return g[fn_name] | [
"Compile",
"the",
"code",
"and",
"return",
"the",
"function",
"fn_name",
"."
] | tnkteja/myhelp | python | https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/templite.py#L44-L50 | [
"def",
"get_function",
"(",
"self",
",",
"fn_name",
")",
":",
"assert",
"self",
".",
"indent_amount",
"==",
"0",
"g",
"=",
"{",
"}",
"code_text",
"=",
"str",
"(",
"self",
")",
"exec",
"(",
"code_text",
",",
"g",
")",
"return",
"g",
"[",
"fn_name",
... | fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb |
test | Templite.expr_code | Generate a Python expression for `expr`. | virtualEnvironment/lib/python2.7/site-packages/coverage/templite.py | def expr_code(self, expr):
"""Generate a Python expression for `expr`."""
if "|" in expr:
pipes = expr.split("|")
code = self.expr_code(pipes[0])
for func in pipes[1:]:
self.all_vars.add(func)
code = "c_%s(%s)" % (func, code)
el... | def expr_code(self, expr):
"""Generate a Python expression for `expr`."""
if "|" in expr:
pipes = expr.split("|")
code = self.expr_code(pipes[0])
for func in pipes[1:]:
self.all_vars.add(func)
code = "c_%s(%s)" % (func, code)
el... | [
"Generate",
"a",
"Python",
"expression",
"for",
"expr",
"."
] | tnkteja/myhelp | python | https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/templite.py#L169-L185 | [
"def",
"expr_code",
"(",
"self",
",",
"expr",
")",
":",
"if",
"\"|\"",
"in",
"expr",
":",
"pipes",
"=",
"expr",
".",
"split",
"(",
"\"|\"",
")",
"code",
"=",
"self",
".",
"expr_code",
"(",
"pipes",
"[",
"0",
"]",
")",
"for",
"func",
"in",
"pipes"... | fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb |
test | Templite.render | Render this template by applying it to `context`.
`context` is a dictionary of values to use in this rendering. | virtualEnvironment/lib/python2.7/site-packages/coverage/templite.py | def render(self, context=None):
"""Render this template by applying it to `context`.
`context` is a dictionary of values to use in this rendering.
"""
# Make the complete context we'll use.
ctx = dict(self.context)
if context:
ctx.update(context)
ret... | def render(self, context=None):
"""Render this template by applying it to `context`.
`context` is a dictionary of values to use in this rendering.
"""
# Make the complete context we'll use.
ctx = dict(self.context)
if context:
ctx.update(context)
ret... | [
"Render",
"this",
"template",
"by",
"applying",
"it",
"to",
"context",
"."
] | tnkteja/myhelp | python | https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/templite.py#L187-L197 | [
"def",
"render",
"(",
"self",
",",
"context",
"=",
"None",
")",
":",
"# Make the complete context we'll use.",
"ctx",
"=",
"dict",
"(",
"self",
".",
"context",
")",
"if",
"context",
":",
"ctx",
".",
"update",
"(",
"context",
")",
"return",
"self",
".",
"... | fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb |
test | Templite.do_dots | Evaluate dotted expressions at runtime. | virtualEnvironment/lib/python2.7/site-packages/coverage/templite.py | def do_dots(self, value, *dots):
"""Evaluate dotted expressions at runtime."""
for dot in dots:
try:
value = getattr(value, dot)
except AttributeError:
value = value[dot]
if hasattr(value, '__call__'):
value = value()
... | def do_dots(self, value, *dots):
"""Evaluate dotted expressions at runtime."""
for dot in dots:
try:
value = getattr(value, dot)
except AttributeError:
value = value[dot]
if hasattr(value, '__call__'):
value = value()
... | [
"Evaluate",
"dotted",
"expressions",
"at",
"runtime",
"."
] | tnkteja/myhelp | python | https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/templite.py#L199-L208 | [
"def",
"do_dots",
"(",
"self",
",",
"value",
",",
"*",
"dots",
")",
":",
"for",
"dot",
"in",
"dots",
":",
"try",
":",
"value",
"=",
"getattr",
"(",
"value",
",",
"dot",
")",
"except",
"AttributeError",
":",
"value",
"=",
"value",
"[",
"dot",
"]",
... | fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb |
test | render_template | A shortcut function to render a partial template with context and return
the output. | django_baseline/template.py | def render_template(tpl, context):
'''
A shortcut function to render a partial template with context and return
the output.
'''
templates = [tpl] if type(tpl) != list else tpl
tpl_instance = None
for tpl in templates:
try:
tpl_instance = template.loader.get_t... | def render_template(tpl, context):
'''
A shortcut function to render a partial template with context and return
the output.
'''
templates = [tpl] if type(tpl) != list else tpl
tpl_instance = None
for tpl in templates:
try:
tpl_instance = template.loader.get_t... | [
"A",
"shortcut",
"function",
"to",
"render",
"a",
"partial",
"template",
"with",
"context",
"and",
"return",
"the",
"output",
"."
] | theduke/django-baseline | python | https://github.com/theduke/django-baseline/blob/7be8b956e53c70b35f34e1783a8fe8f716955afb/django_baseline/template.py#L5-L24 | [
"def",
"render_template",
"(",
"tpl",
",",
"context",
")",
":",
"templates",
"=",
"[",
"tpl",
"]",
"if",
"type",
"(",
"tpl",
")",
"!=",
"list",
"else",
"tpl",
"tpl_instance",
"=",
"None",
"for",
"tpl",
"in",
"templates",
":",
"try",
":",
"tpl_instance"... | 7be8b956e53c70b35f34e1783a8fe8f716955afb |
test | format_display_data | Return a format data dict for an object.
By default all format types will be computed.
The following MIME types are currently implemented:
* text/plain
* text/html
* text/latex
* application/json
* application/javascript
* image/png
* image/jpeg
* image/svg+xml
Parameters... | environment/lib/python2.7/site-packages/IPython/core/formatters.py | def format_display_data(obj, include=None, exclude=None):
"""Return a format data dict for an object.
By default all format types will be computed.
The following MIME types are currently implemented:
* text/plain
* text/html
* text/latex
* application/json
* application/javascript
... | def format_display_data(obj, include=None, exclude=None):
"""Return a format data dict for an object.
By default all format types will be computed.
The following MIME types are currently implemented:
* text/plain
* text/html
* text/latex
* application/json
* application/javascript
... | [
"Return",
"a",
"format",
"data",
"dict",
"for",
"an",
"object",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/formatters.py#L576-L620 | [
"def",
"format_display_data",
"(",
"obj",
",",
"include",
"=",
"None",
",",
"exclude",
"=",
"None",
")",
":",
"from",
"IPython",
".",
"core",
".",
"interactiveshell",
"import",
"InteractiveShell",
"InteractiveShell",
".",
"instance",
"(",
")",
".",
"display_fo... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | DisplayFormatter._formatters_default | Activate the default formatters. | environment/lib/python2.7/site-packages/IPython/core/formatters.py | def _formatters_default(self):
"""Activate the default formatters."""
formatter_classes = [
PlainTextFormatter,
HTMLFormatter,
SVGFormatter,
PNGFormatter,
JPEGFormatter,
LatexFormatter,
JSONFormatter,
Javascr... | def _formatters_default(self):
"""Activate the default formatters."""
formatter_classes = [
PlainTextFormatter,
HTMLFormatter,
SVGFormatter,
PNGFormatter,
JPEGFormatter,
LatexFormatter,
JSONFormatter,
Javascr... | [
"Activate",
"the",
"default",
"formatters",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/formatters.py#L48-L64 | [
"def",
"_formatters_default",
"(",
"self",
")",
":",
"formatter_classes",
"=",
"[",
"PlainTextFormatter",
",",
"HTMLFormatter",
",",
"SVGFormatter",
",",
"PNGFormatter",
",",
"JPEGFormatter",
",",
"LatexFormatter",
",",
"JSONFormatter",
",",
"JavascriptFormatter",
"]"... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | DisplayFormatter.format | Return a format data dict for an object.
By default all format types will be computed.
The following MIME types are currently implemented:
* text/plain
* text/html
* text/latex
* application/json
* application/javascript
* image/png
* image/jpeg... | environment/lib/python2.7/site-packages/IPython/core/formatters.py | def format(self, obj, include=None, exclude=None):
"""Return a format data dict for an object.
By default all format types will be computed.
The following MIME types are currently implemented:
* text/plain
* text/html
* text/latex
* application/json
* a... | def format(self, obj, include=None, exclude=None):
"""Return a format data dict for an object.
By default all format types will be computed.
The following MIME types are currently implemented:
* text/plain
* text/html
* text/latex
* application/json
* a... | [
"Return",
"a",
"format",
"data",
"dict",
"for",
"an",
"object",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/formatters.py#L66-L132 | [
"def",
"format",
"(",
"self",
",",
"obj",
",",
"include",
"=",
"None",
",",
"exclude",
"=",
"None",
")",
":",
"format_dict",
"=",
"{",
"}",
"# If plain text only is active",
"if",
"self",
".",
"plain_text_only",
":",
"formatter",
"=",
"self",
".",
"formatt... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | BaseFormatter.for_type | Add a format function for a given type.
Parameters
-----------
typ : class
The class of the object that will be formatted using `func`.
func : callable
The callable that will be called to compute the format data. The
call signature of this function is... | environment/lib/python2.7/site-packages/IPython/core/formatters.py | def for_type(self, typ, func):
"""Add a format function for a given type.
Parameters
-----------
typ : class
The class of the object that will be formatted using `func`.
func : callable
The callable that will be called to compute the format data. The
... | def for_type(self, typ, func):
"""Add a format function for a given type.
Parameters
-----------
typ : class
The class of the object that will be formatted using `func`.
func : callable
The callable that will be called to compute the format data. The
... | [
"Add",
"a",
"format",
"function",
"for",
"a",
"given",
"type",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/formatters.py#L253-L272 | [
"def",
"for_type",
"(",
"self",
",",
"typ",
",",
"func",
")",
":",
"oldfunc",
"=",
"self",
".",
"type_printers",
".",
"get",
"(",
"typ",
",",
"None",
")",
"if",
"func",
"is",
"not",
"None",
":",
"# To support easy restoration of old printers, we need to ignore... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | BaseFormatter.for_type_by_name | Add a format function for a type specified by the full dotted
module and name of the type, rather than the type of the object.
Parameters
----------
type_module : str
The full dotted name of the module the type is defined in, like
``numpy``.
type_name : s... | environment/lib/python2.7/site-packages/IPython/core/formatters.py | def for_type_by_name(self, type_module, type_name, func):
"""Add a format function for a type specified by the full dotted
module and name of the type, rather than the type of the object.
Parameters
----------
type_module : str
The full dotted name of the module the ... | def for_type_by_name(self, type_module, type_name, func):
"""Add a format function for a type specified by the full dotted
module and name of the type, rather than the type of the object.
Parameters
----------
type_module : str
The full dotted name of the module the ... | [
"Add",
"a",
"format",
"function",
"for",
"a",
"type",
"specified",
"by",
"the",
"full",
"dotted",
"module",
"and",
"name",
"of",
"the",
"type",
"rather",
"than",
"the",
"type",
"of",
"the",
"object",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/formatters.py#L274-L298 | [
"def",
"for_type_by_name",
"(",
"self",
",",
"type_module",
",",
"type_name",
",",
"func",
")",
":",
"key",
"=",
"(",
"type_module",
",",
"type_name",
")",
"oldfunc",
"=",
"self",
".",
"deferred_printers",
".",
"get",
"(",
"key",
",",
"None",
")",
"if",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | BaseFormatter._in_deferred_types | Check if the given class is specified in the deferred type registry.
Returns the printer from the registry if it exists, and None if the
class is not in the registry. Successful matches will be moved to the
regular type registry for future use. | environment/lib/python2.7/site-packages/IPython/core/formatters.py | def _in_deferred_types(self, cls):
"""
Check if the given class is specified in the deferred type registry.
Returns the printer from the registry if it exists, and None if the
class is not in the registry. Successful matches will be moved to the
regular type registry for future ... | def _in_deferred_types(self, cls):
"""
Check if the given class is specified in the deferred type registry.
Returns the printer from the registry if it exists, and None if the
class is not in the registry. Successful matches will be moved to the
regular type registry for future ... | [
"Check",
"if",
"the",
"given",
"class",
"is",
"specified",
"in",
"the",
"deferred",
"type",
"registry",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/formatters.py#L300-L316 | [
"def",
"_in_deferred_types",
"(",
"self",
",",
"cls",
")",
":",
"mod",
"=",
"getattr",
"(",
"cls",
",",
"'__module__'",
",",
"None",
")",
"name",
"=",
"getattr",
"(",
"cls",
",",
"'__name__'",
",",
"None",
")",
"key",
"=",
"(",
"mod",
",",
"name",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | PlainTextFormatter._float_precision_changed | float_precision changed, set float_format accordingly.
float_precision can be set by int or str.
This will set float_format, after interpreting input.
If numpy has been imported, numpy print precision will also be set.
integer `n` sets format to '%.nf', otherwise, format set directly.
... | environment/lib/python2.7/site-packages/IPython/core/formatters.py | def _float_precision_changed(self, name, old, new):
"""float_precision changed, set float_format accordingly.
float_precision can be set by int or str.
This will set float_format, after interpreting input.
If numpy has been imported, numpy print precision will also be set.
inte... | def _float_precision_changed(self, name, old, new):
"""float_precision changed, set float_format accordingly.
float_precision can be set by int or str.
This will set float_format, after interpreting input.
If numpy has been imported, numpy print precision will also be set.
inte... | [
"float_precision",
"changed",
"set",
"float_format",
"accordingly",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/formatters.py#L370-L413 | [
"def",
"_float_precision_changed",
"(",
"self",
",",
"name",
",",
"old",
",",
"new",
")",
":",
"if",
"'%'",
"in",
"new",
":",
"# got explicit format string",
"fmt",
"=",
"new",
"try",
":",
"fmt",
"%",
"3.14159",
"except",
"Exception",
":",
"raise",
"ValueE... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | user_config_files | Return path to any existing user config files | environment/lib/python2.7/site-packages/nose/config.py | def user_config_files():
"""Return path to any existing user config files
"""
return filter(os.path.exists,
map(os.path.expanduser, config_files)) | def user_config_files():
"""Return path to any existing user config files
"""
return filter(os.path.exists,
map(os.path.expanduser, config_files)) | [
"Return",
"path",
"to",
"any",
"existing",
"user",
"config",
"files"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/config.py#L607-L611 | [
"def",
"user_config_files",
"(",
")",
":",
"return",
"filter",
"(",
"os",
".",
"path",
".",
"exists",
",",
"map",
"(",
"os",
".",
"path",
".",
"expanduser",
",",
"config_files",
")",
")"
] | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | flag | Does the value look like an on/off flag? | environment/lib/python2.7/site-packages/nose/config.py | def flag(val):
"""Does the value look like an on/off flag?"""
if val == 1:
return True
elif val == 0:
return False
val = str(val)
if len(val) > 5:
return False
return val.upper() in ('1', '0', 'F', 'T', 'TRUE', 'FALSE', 'ON', 'OFF') | def flag(val):
"""Does the value look like an on/off flag?"""
if val == 1:
return True
elif val == 0:
return False
val = str(val)
if len(val) > 5:
return False
return val.upper() in ('1', '0', 'F', 'T', 'TRUE', 'FALSE', 'ON', 'OFF') | [
"Does",
"the",
"value",
"look",
"like",
"an",
"on",
"/",
"off",
"flag?"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/config.py#L625-L634 | [
"def",
"flag",
"(",
"val",
")",
":",
"if",
"val",
"==",
"1",
":",
"return",
"True",
"elif",
"val",
"==",
"0",
":",
"return",
"False",
"val",
"=",
"str",
"(",
"val",
")",
"if",
"len",
"(",
"val",
")",
">",
"5",
":",
"return",
"False",
"return",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | Config.configure | Configure the nose running environment. Execute configure before
collecting tests with nose.TestCollector to enable output capture and
other features. | environment/lib/python2.7/site-packages/nose/config.py | def configure(self, argv=None, doc=None):
"""Configure the nose running environment. Execute configure before
collecting tests with nose.TestCollector to enable output capture and
other features.
"""
env = self.env
if argv is None:
argv = sys.argv
cfg... | def configure(self, argv=None, doc=None):
"""Configure the nose running environment. Execute configure before
collecting tests with nose.TestCollector to enable output capture and
other features.
"""
env = self.env
if argv is None:
argv = sys.argv
cfg... | [
"Configure",
"the",
"nose",
"running",
"environment",
".",
"Execute",
"configure",
"before",
"collecting",
"tests",
"with",
"nose",
".",
"TestCollector",
"to",
"enable",
"output",
"capture",
"and",
"other",
"features",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/config.py#L266-L339 | [
"def",
"configure",
"(",
"self",
",",
"argv",
"=",
"None",
",",
"doc",
"=",
"None",
")",
":",
"env",
"=",
"self",
".",
"env",
"if",
"argv",
"is",
"None",
":",
"argv",
"=",
"sys",
".",
"argv",
"cfg_files",
"=",
"getattr",
"(",
"self",
",",
"'files... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | Config.configureLogging | Configure logging for nose, or optionally other packages. Any logger
name may be set with the debug option, and that logger will be set to
debug level and be assigned the same handler as the nose loggers, unless
it already has a handler. | environment/lib/python2.7/site-packages/nose/config.py | def configureLogging(self):
"""Configure logging for nose, or optionally other packages. Any logger
name may be set with the debug option, and that logger will be set to
debug level and be assigned the same handler as the nose loggers, unless
it already has a handler.
"""
... | def configureLogging(self):
"""Configure logging for nose, or optionally other packages. Any logger
name may be set with the debug option, and that logger will be set to
debug level and be assigned the same handler as the nose loggers, unless
it already has a handler.
"""
... | [
"Configure",
"logging",
"for",
"nose",
"or",
"optionally",
"other",
"packages",
".",
"Any",
"logger",
"name",
"may",
"be",
"set",
"with",
"the",
"debug",
"option",
"and",
"that",
"logger",
"will",
"be",
"set",
"to",
"debug",
"level",
"and",
"be",
"assigned... | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/config.py#L341-L386 | [
"def",
"configureLogging",
"(",
"self",
")",
":",
"if",
"self",
".",
"loggingConfig",
":",
"from",
"logging",
".",
"config",
"import",
"fileConfig",
"fileConfig",
"(",
"self",
".",
"loggingConfig",
")",
"return",
"format",
"=",
"logging",
".",
"Formatter",
"... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | Config.configureWhere | Configure the working directory or directories for the test run. | environment/lib/python2.7/site-packages/nose/config.py | def configureWhere(self, where):
"""Configure the working directory or directories for the test run.
"""
from nose.importer import add_path
self.workingDir = None
where = tolist(where)
warned = False
for path in where:
if not self.workingDir:
... | def configureWhere(self, where):
"""Configure the working directory or directories for the test run.
"""
from nose.importer import add_path
self.workingDir = None
where = tolist(where)
warned = False
for path in where:
if not self.workingDir:
... | [
"Configure",
"the",
"working",
"directory",
"or",
"directories",
"for",
"the",
"test",
"run",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/config.py#L388-L416 | [
"def",
"configureWhere",
"(",
"self",
",",
"where",
")",
":",
"from",
"nose",
".",
"importer",
"import",
"add_path",
"self",
".",
"workingDir",
"=",
"None",
"where",
"=",
"tolist",
"(",
"where",
")",
"warned",
"=",
"False",
"for",
"path",
"in",
"where",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | Config.getParser | Get the command line option parser. | environment/lib/python2.7/site-packages/nose/config.py | def getParser(self, doc=None):
"""Get the command line option parser.
"""
if self.parser:
return self.parser
env = self.env
parser = self.parserClass(doc)
parser.add_option(
"-V","--version", action="store_true",
dest="version", default... | def getParser(self, doc=None):
"""Get the command line option parser.
"""
if self.parser:
return self.parser
env = self.env
parser = self.parserClass(doc)
parser.add_option(
"-V","--version", action="store_true",
dest="version", default... | [
"Get",
"the",
"command",
"line",
"option",
"parser",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/config.py#L423-L568 | [
"def",
"getParser",
"(",
"self",
",",
"doc",
"=",
"None",
")",
":",
"if",
"self",
".",
"parser",
":",
"return",
"self",
".",
"parser",
"env",
"=",
"self",
".",
"env",
"parser",
"=",
"self",
".",
"parserClass",
"(",
"doc",
")",
"parser",
".",
"add_o... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | page_dumb | Very dumb 'pager' in Python, for when nothing else works.
Only moves forward, same interface as page(), except for pager_cmd and
mode. | environment/lib/python2.7/site-packages/IPython/core/page.py | def page_dumb(strng, start=0, screen_lines=25):
"""Very dumb 'pager' in Python, for when nothing else works.
Only moves forward, same interface as page(), except for pager_cmd and
mode."""
out_ln = strng.splitlines()[start:]
screens = chop(out_ln,screen_lines-1)
if len(screens) == 1:
... | def page_dumb(strng, start=0, screen_lines=25):
"""Very dumb 'pager' in Python, for when nothing else works.
Only moves forward, same interface as page(), except for pager_cmd and
mode."""
out_ln = strng.splitlines()[start:]
screens = chop(out_ln,screen_lines-1)
if len(screens) == 1:
... | [
"Very",
"dumb",
"pager",
"in",
"Python",
"for",
"when",
"nothing",
"else",
"works",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/page.py#L51-L71 | [
"def",
"page_dumb",
"(",
"strng",
",",
"start",
"=",
"0",
",",
"screen_lines",
"=",
"25",
")",
":",
"out_ln",
"=",
"strng",
".",
"splitlines",
"(",
")",
"[",
"start",
":",
"]",
"screens",
"=",
"chop",
"(",
"out_ln",
",",
"screen_lines",
"-",
"1",
"... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | _detect_screen_size | Attempt to work out the number of lines on the screen.
This is called by page(). It can raise an error (e.g. when run in the
test suite), so it's separated out so it can easily be called in a try block. | environment/lib/python2.7/site-packages/IPython/core/page.py | def _detect_screen_size(use_curses, screen_lines_def):
"""Attempt to work out the number of lines on the screen.
This is called by page(). It can raise an error (e.g. when run in the
test suite), so it's separated out so it can easily be called in a try block.
"""
TERM = os.environ.get('TERM',N... | def _detect_screen_size(use_curses, screen_lines_def):
"""Attempt to work out the number of lines on the screen.
This is called by page(). It can raise an error (e.g. when run in the
test suite), so it's separated out so it can easily be called in a try block.
"""
TERM = os.environ.get('TERM',N... | [
"Attempt",
"to",
"work",
"out",
"the",
"number",
"of",
"lines",
"on",
"the",
"screen",
".",
"This",
"is",
"called",
"by",
"page",
"()",
".",
"It",
"can",
"raise",
"an",
"error",
"(",
"e",
".",
"g",
".",
"when",
"run",
"in",
"the",
"test",
"suite",
... | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/page.py#L73-L127 | [
"def",
"_detect_screen_size",
"(",
"use_curses",
",",
"screen_lines_def",
")",
":",
"TERM",
"=",
"os",
".",
"environ",
".",
"get",
"(",
"'TERM'",
",",
"None",
")",
"if",
"(",
"TERM",
"==",
"'xterm'",
"or",
"TERM",
"==",
"'xterm-color'",
")",
"and",
"sys"... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | page | Print a string, piping through a pager after a certain length.
The screen_lines parameter specifies the number of *usable* lines of your
terminal screen (total lines minus lines you need to reserve to show other
information).
If you set screen_lines to a number <=0, page() will try to auto-determine
... | environment/lib/python2.7/site-packages/IPython/core/page.py | def page(strng, start=0, screen_lines=0, pager_cmd=None):
"""Print a string, piping through a pager after a certain length.
The screen_lines parameter specifies the number of *usable* lines of your
terminal screen (total lines minus lines you need to reserve to show other
information).
If you set ... | def page(strng, start=0, screen_lines=0, pager_cmd=None):
"""Print a string, piping through a pager after a certain length.
The screen_lines parameter specifies the number of *usable* lines of your
terminal screen (total lines minus lines you need to reserve to show other
information).
If you set ... | [
"Print",
"a",
"string",
"piping",
"through",
"a",
"pager",
"after",
"a",
"certain",
"length",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/page.py#L129-L233 | [
"def",
"page",
"(",
"strng",
",",
"start",
"=",
"0",
",",
"screen_lines",
"=",
"0",
",",
"pager_cmd",
"=",
"None",
")",
":",
"# Some routines may auto-compute start offsets incorrectly and pass a",
"# negative value. Offset to 0 for robustness.",
"start",
"=",
"max",
"... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | page_file | Page a file, using an optional pager command and starting line. | environment/lib/python2.7/site-packages/IPython/core/page.py | def page_file(fname, start=0, pager_cmd=None):
"""Page a file, using an optional pager command and starting line.
"""
pager_cmd = get_pager_cmd(pager_cmd)
pager_cmd += ' ' + get_pager_start(pager_cmd,start)
try:
if os.environ['TERM'] in ['emacs','dumb']:
raise EnvironmentError
... | def page_file(fname, start=0, pager_cmd=None):
"""Page a file, using an optional pager command and starting line.
"""
pager_cmd = get_pager_cmd(pager_cmd)
pager_cmd += ' ' + get_pager_start(pager_cmd,start)
try:
if os.environ['TERM'] in ['emacs','dumb']:
raise EnvironmentError
... | [
"Page",
"a",
"file",
"using",
"an",
"optional",
"pager",
"command",
"and",
"starting",
"line",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/page.py#L236-L253 | [
"def",
"page_file",
"(",
"fname",
",",
"start",
"=",
"0",
",",
"pager_cmd",
"=",
"None",
")",
":",
"pager_cmd",
"=",
"get_pager_cmd",
"(",
"pager_cmd",
")",
"pager_cmd",
"+=",
"' '",
"+",
"get_pager_start",
"(",
"pager_cmd",
",",
"start",
")",
"try",
":"... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | get_pager_cmd | Return a pager command.
Makes some attempts at finding an OS-correct one. | environment/lib/python2.7/site-packages/IPython/core/page.py | def get_pager_cmd(pager_cmd=None):
"""Return a pager command.
Makes some attempts at finding an OS-correct one.
"""
if os.name == 'posix':
default_pager_cmd = 'less -r' # -r for color control sequences
elif os.name in ['nt','dos']:
default_pager_cmd = 'type'
if pager_cmd is No... | def get_pager_cmd(pager_cmd=None):
"""Return a pager command.
Makes some attempts at finding an OS-correct one.
"""
if os.name == 'posix':
default_pager_cmd = 'less -r' # -r for color control sequences
elif os.name in ['nt','dos']:
default_pager_cmd = 'type'
if pager_cmd is No... | [
"Return",
"a",
"pager",
"command",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/page.py#L256-L271 | [
"def",
"get_pager_cmd",
"(",
"pager_cmd",
"=",
"None",
")",
":",
"if",
"os",
".",
"name",
"==",
"'posix'",
":",
"default_pager_cmd",
"=",
"'less -r'",
"# -r for color control sequences",
"elif",
"os",
".",
"name",
"in",
"[",
"'nt'",
",",
"'dos'",
"]",
":",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | get_pager_start | Return the string for paging files with an offset.
This is the '+N' argument which less and more (under Unix) accept. | environment/lib/python2.7/site-packages/IPython/core/page.py | def get_pager_start(pager, start):
"""Return the string for paging files with an offset.
This is the '+N' argument which less and more (under Unix) accept.
"""
if pager in ['less','more']:
if start:
start_string = '+' + str(start)
else:
start_string = ''
els... | def get_pager_start(pager, start):
"""Return the string for paging files with an offset.
This is the '+N' argument which less and more (under Unix) accept.
"""
if pager in ['less','more']:
if start:
start_string = '+' + str(start)
else:
start_string = ''
els... | [
"Return",
"the",
"string",
"for",
"paging",
"files",
"with",
"an",
"offset",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/page.py#L274-L287 | [
"def",
"get_pager_start",
"(",
"pager",
",",
"start",
")",
":",
"if",
"pager",
"in",
"[",
"'less'",
",",
"'more'",
"]",
":",
"if",
"start",
":",
"start_string",
"=",
"'+'",
"+",
"str",
"(",
"start",
")",
"else",
":",
"start_string",
"=",
"''",
"else"... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | snip_print | Print a string snipping the midsection to fit in width.
print_full: mode control:
- 0: only snip long strings
- 1: send to page() directly.
- 2: snip long strings and ask for full length viewing with page()
Return 1 if snipping was necessary, 0 otherwise. | environment/lib/python2.7/site-packages/IPython/core/page.py | def snip_print(str,width = 75,print_full = 0,header = ''):
"""Print a string snipping the midsection to fit in width.
print_full: mode control:
- 0: only snip long strings
- 1: send to page() directly.
- 2: snip long strings and ask for full length viewing with page()
Return 1 if snipping... | def snip_print(str,width = 75,print_full = 0,header = ''):
"""Print a string snipping the midsection to fit in width.
print_full: mode control:
- 0: only snip long strings
- 1: send to page() directly.
- 2: snip long strings and ask for full length viewing with page()
Return 1 if snipping... | [
"Print",
"a",
"string",
"snipping",
"the",
"midsection",
"to",
"fit",
"in",
"width",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/page.py#L315-L339 | [
"def",
"snip_print",
"(",
"str",
",",
"width",
"=",
"75",
",",
"print_full",
"=",
"0",
",",
"header",
"=",
"''",
")",
":",
"if",
"print_full",
"==",
"1",
":",
"page",
"(",
"header",
"+",
"str",
")",
"return",
"0",
"print",
"header",
",",
"if",
"l... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | timings_out | timings_out(reps,func,*args,**kw) -> (t_total,t_per_call,output)
Execute a function reps times, return a tuple with the elapsed total
CPU time in seconds, the time per call and the function's output.
Under Unix, the return value is the sum of user+system time consumed by
the process, computed via the ... | environment/lib/python2.7/site-packages/IPython/utils/timing.py | def timings_out(reps,func,*args,**kw):
"""timings_out(reps,func,*args,**kw) -> (t_total,t_per_call,output)
Execute a function reps times, return a tuple with the elapsed total
CPU time in seconds, the time per call and the function's output.
Under Unix, the return value is the sum of user+system time ... | def timings_out(reps,func,*args,**kw):
"""timings_out(reps,func,*args,**kw) -> (t_total,t_per_call,output)
Execute a function reps times, return a tuple with the elapsed total
CPU time in seconds, the time per call and the function's output.
Under Unix, the return value is the sum of user+system time ... | [
"timings_out",
"(",
"reps",
"func",
"*",
"args",
"**",
"kw",
")",
"-",
">",
"(",
"t_total",
"t_per_call",
"output",
")"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/timing.py#L70-L96 | [
"def",
"timings_out",
"(",
"reps",
",",
"func",
",",
"*",
"args",
",",
"*",
"*",
"kw",
")",
":",
"reps",
"=",
"int",
"(",
"reps",
")",
"assert",
"reps",
">=",
"1",
",",
"'reps must be >= 1'",
"if",
"reps",
"==",
"1",
":",
"start",
"=",
"clock",
"... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | timings | timings(reps,func,*args,**kw) -> (t_total,t_per_call)
Execute a function reps times, return a tuple with the elapsed total CPU
time in seconds and the time per call. These are just the first two values
in timings_out(). | environment/lib/python2.7/site-packages/IPython/utils/timing.py | def timings(reps,func,*args,**kw):
"""timings(reps,func,*args,**kw) -> (t_total,t_per_call)
Execute a function reps times, return a tuple with the elapsed total CPU
time in seconds and the time per call. These are just the first two values
in timings_out()."""
return timings_out(reps,func,*args,**... | def timings(reps,func,*args,**kw):
"""timings(reps,func,*args,**kw) -> (t_total,t_per_call)
Execute a function reps times, return a tuple with the elapsed total CPU
time in seconds and the time per call. These are just the first two values
in timings_out()."""
return timings_out(reps,func,*args,**... | [
"timings",
"(",
"reps",
"func",
"*",
"args",
"**",
"kw",
")",
"-",
">",
"(",
"t_total",
"t_per_call",
")"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/timing.py#L99-L106 | [
"def",
"timings",
"(",
"reps",
",",
"func",
",",
"*",
"args",
",",
"*",
"*",
"kw",
")",
":",
"return",
"timings_out",
"(",
"reps",
",",
"func",
",",
"*",
"args",
",",
"*",
"*",
"kw",
")",
"[",
"0",
":",
"2",
"]"
] | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | print_basic_unicode | A function to pretty print sympy Basic objects. | environment/lib/python2.7/site-packages/IPython/extensions/sympyprinting.py | def print_basic_unicode(o, p, cycle):
"""A function to pretty print sympy Basic objects."""
if cycle:
return p.text('Basic(...)')
out = pretty(o, use_unicode=True)
if '\n' in out:
p.text(u'\n')
p.text(out) | def print_basic_unicode(o, p, cycle):
"""A function to pretty print sympy Basic objects."""
if cycle:
return p.text('Basic(...)')
out = pretty(o, use_unicode=True)
if '\n' in out:
p.text(u'\n')
p.text(out) | [
"A",
"function",
"to",
"pretty",
"print",
"sympy",
"Basic",
"objects",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/extensions/sympyprinting.py#L44-L51 | [
"def",
"print_basic_unicode",
"(",
"o",
",",
"p",
",",
"cycle",
")",
":",
"if",
"cycle",
":",
"return",
"p",
".",
"text",
"(",
"'Basic(...)'",
")",
"out",
"=",
"pretty",
"(",
"o",
",",
"use_unicode",
"=",
"True",
")",
"if",
"'\\n'",
"in",
"out",
":... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | print_png | A function to display sympy expression using inline style LaTeX in PNG. | environment/lib/python2.7/site-packages/IPython/extensions/sympyprinting.py | def print_png(o):
"""
A function to display sympy expression using inline style LaTeX in PNG.
"""
s = latex(o, mode='inline')
# mathtext does not understand certain latex flags, so we try to replace
# them with suitable subs.
s = s.replace('\\operatorname','')
s = s.replace('\\overline',... | def print_png(o):
"""
A function to display sympy expression using inline style LaTeX in PNG.
"""
s = latex(o, mode='inline')
# mathtext does not understand certain latex flags, so we try to replace
# them with suitable subs.
s = s.replace('\\operatorname','')
s = s.replace('\\overline',... | [
"A",
"function",
"to",
"display",
"sympy",
"expression",
"using",
"inline",
"style",
"LaTeX",
"in",
"PNG",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/extensions/sympyprinting.py#L54-L64 | [
"def",
"print_png",
"(",
"o",
")",
":",
"s",
"=",
"latex",
"(",
"o",
",",
"mode",
"=",
"'inline'",
")",
"# mathtext does not understand certain latex flags, so we try to replace",
"# them with suitable subs.",
"s",
"=",
"s",
".",
"replace",
"(",
"'\\\\operatorname'",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | print_display_png | A function to display sympy expression using display style LaTeX in PNG. | environment/lib/python2.7/site-packages/IPython/extensions/sympyprinting.py | def print_display_png(o):
"""
A function to display sympy expression using display style LaTeX in PNG.
"""
s = latex(o, mode='plain')
s = s.strip('$')
# As matplotlib does not support display style, dvipng backend is
# used here.
png = latex_to_png('$$%s$$' % s, backend='dvipng')
ret... | def print_display_png(o):
"""
A function to display sympy expression using display style LaTeX in PNG.
"""
s = latex(o, mode='plain')
s = s.strip('$')
# As matplotlib does not support display style, dvipng backend is
# used here.
png = latex_to_png('$$%s$$' % s, backend='dvipng')
ret... | [
"A",
"function",
"to",
"display",
"sympy",
"expression",
"using",
"display",
"style",
"LaTeX",
"in",
"PNG",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/extensions/sympyprinting.py#L67-L76 | [
"def",
"print_display_png",
"(",
"o",
")",
":",
"s",
"=",
"latex",
"(",
"o",
",",
"mode",
"=",
"'plain'",
")",
"s",
"=",
"s",
".",
"strip",
"(",
"'$'",
")",
"# As matplotlib does not support display style, dvipng backend is",
"# used here.",
"png",
"=",
"latex... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | can_print_latex | Return True if type o can be printed with LaTeX.
If o is a container type, this is True if and only if every element of o
can be printed with LaTeX. | environment/lib/python2.7/site-packages/IPython/extensions/sympyprinting.py | def can_print_latex(o):
"""
Return True if type o can be printed with LaTeX.
If o is a container type, this is True if and only if every element of o
can be printed with LaTeX.
"""
import sympy
if isinstance(o, (list, tuple, set, frozenset)):
return all(can_print_latex(i) for i in o... | def can_print_latex(o):
"""
Return True if type o can be printed with LaTeX.
If o is a container type, this is True if and only if every element of o
can be printed with LaTeX.
"""
import sympy
if isinstance(o, (list, tuple, set, frozenset)):
return all(can_print_latex(i) for i in o... | [
"Return",
"True",
"if",
"type",
"o",
"can",
"be",
"printed",
"with",
"LaTeX",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/extensions/sympyprinting.py#L79-L93 | [
"def",
"can_print_latex",
"(",
"o",
")",
":",
"import",
"sympy",
"if",
"isinstance",
"(",
"o",
",",
"(",
"list",
",",
"tuple",
",",
"set",
",",
"frozenset",
")",
")",
":",
"return",
"all",
"(",
"can_print_latex",
"(",
"i",
")",
"for",
"i",
"in",
"o... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | print_latex | A function to generate the latex representation of sympy
expressions. | environment/lib/python2.7/site-packages/IPython/extensions/sympyprinting.py | def print_latex(o):
"""A function to generate the latex representation of sympy
expressions."""
if can_print_latex(o):
s = latex(o, mode='plain')
s = s.replace('\\dag','\\dagger')
s = s.strip('$')
return '$$%s$$' % s
# Fallback to the string printer
return None | def print_latex(o):
"""A function to generate the latex representation of sympy
expressions."""
if can_print_latex(o):
s = latex(o, mode='plain')
s = s.replace('\\dag','\\dagger')
s = s.strip('$')
return '$$%s$$' % s
# Fallback to the string printer
return None | [
"A",
"function",
"to",
"generate",
"the",
"latex",
"representation",
"of",
"sympy",
"expressions",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/extensions/sympyprinting.py#L95-L104 | [
"def",
"print_latex",
"(",
"o",
")",
":",
"if",
"can_print_latex",
"(",
"o",
")",
":",
"s",
"=",
"latex",
"(",
"o",
",",
"mode",
"=",
"'plain'",
")",
"s",
"=",
"s",
".",
"replace",
"(",
"'\\\\dag'",
",",
"'\\\\dagger'",
")",
"s",
"=",
"s",
".",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | load_ipython_extension | Load the extension in IPython. | environment/lib/python2.7/site-packages/IPython/extensions/sympyprinting.py | def load_ipython_extension(ip):
"""Load the extension in IPython."""
import sympy
# sympyprinting extension has been moved to SymPy as of 0.7.2, if it
# exists there, warn the user and import it
try:
import sympy.interactive.ipythonprinting
except ImportError:
pass
else:
... | def load_ipython_extension(ip):
"""Load the extension in IPython."""
import sympy
# sympyprinting extension has been moved to SymPy as of 0.7.2, if it
# exists there, warn the user and import it
try:
import sympy.interactive.ipythonprinting
except ImportError:
pass
else:
... | [
"Load",
"the",
"extension",
"in",
"IPython",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/extensions/sympyprinting.py#L108-L171 | [
"def",
"load_ipython_extension",
"(",
"ip",
")",
":",
"import",
"sympy",
"# sympyprinting extension has been moved to SymPy as of 0.7.2, if it",
"# exists there, warn the user and import it",
"try",
":",
"import",
"sympy",
".",
"interactive",
".",
"ipythonprinting",
"except",
"... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | str2tokens | Usage:
{% with 'this, is a, string'|str2tokens:',' as token_list %}do something{% endwith %} | toolware/templatetags/strings.py | def str2tokens(string, delimiter):
"""
Usage:
{% with 'this, is a, string'|str2tokens:',' as token_list %}do something{% endwith %}
"""
token_list = [token.strip() for token in string.split(delimiter)]
return token_list | def str2tokens(string, delimiter):
"""
Usage:
{% with 'this, is a, string'|str2tokens:',' as token_list %}do something{% endwith %}
"""
token_list = [token.strip() for token in string.split(delimiter)]
return token_list | [
"Usage",
":",
"{",
"%",
"with",
"this",
"is",
"a",
"string",
"|str2tokens",
":",
"as",
"token_list",
"%",
"}",
"do",
"something",
"{",
"%",
"endwith",
"%",
"}"
] | un33k/django-toolware | python | https://github.com/un33k/django-toolware/blob/973f3e003dc38b812897dab88455bee37dcaf931/toolware/templatetags/strings.py#L22-L29 | [
"def",
"str2tokens",
"(",
"string",
",",
"delimiter",
")",
":",
"token_list",
"=",
"[",
"token",
".",
"strip",
"(",
")",
"for",
"token",
"in",
"string",
".",
"split",
"(",
"delimiter",
")",
"]",
"return",
"token_list"
] | 973f3e003dc38b812897dab88455bee37dcaf931 |
test | str2tokenstags | Usage:
{% str2tokens 'a/b/c/d' '/' as token_list %} | toolware/templatetags/strings.py | def str2tokenstags(string, delimiter):
"""
Usage:
{% str2tokens 'a/b/c/d' '/' as token_list %}
"""
token_list = [token.strip() for token in string.split(delimiter)]
return token_list | def str2tokenstags(string, delimiter):
"""
Usage:
{% str2tokens 'a/b/c/d' '/' as token_list %}
"""
token_list = [token.strip() for token in string.split(delimiter)]
return token_list | [
"Usage",
":",
"{",
"%",
"str2tokens",
"a",
"/",
"b",
"/",
"c",
"/",
"d",
"/",
"as",
"token_list",
"%",
"}"
] | un33k/django-toolware | python | https://github.com/un33k/django-toolware/blob/973f3e003dc38b812897dab88455bee37dcaf931/toolware/templatetags/strings.py#L33-L40 | [
"def",
"str2tokenstags",
"(",
"string",
",",
"delimiter",
")",
":",
"token_list",
"=",
"[",
"token",
".",
"strip",
"(",
")",
"for",
"token",
"in",
"string",
".",
"split",
"(",
"delimiter",
")",
"]",
"return",
"token_list"
] | 973f3e003dc38b812897dab88455bee37dcaf931 |
test | Plugin.add_options | Non-camel-case version of func name for backwards compatibility.
.. warning ::
DEPRECATED: Do not use this method,
use :meth:`options <nose.plugins.base.IPluginInterface.options>`
instead. | environment/lib/python2.7/site-packages/nose/plugins/base.py | def add_options(self, parser, env=None):
"""Non-camel-case version of func name for backwards compatibility.
.. warning ::
DEPRECATED: Do not use this method,
use :meth:`options <nose.plugins.base.IPluginInterface.options>`
instead.
"""
# FIXME raise d... | def add_options(self, parser, env=None):
"""Non-camel-case version of func name for backwards compatibility.
.. warning ::
DEPRECATED: Do not use this method,
use :meth:`options <nose.plugins.base.IPluginInterface.options>`
instead.
"""
# FIXME raise d... | [
"Non",
"-",
"camel",
"-",
"case",
"version",
"of",
"func",
"name",
"for",
"backwards",
"compatibility",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/plugins/base.py#L54-L74 | [
"def",
"add_options",
"(",
"self",
",",
"parser",
",",
"env",
"=",
"None",
")",
":",
"# FIXME raise deprecation warning if wasn't called by wrapper",
"if",
"env",
"is",
"None",
":",
"env",
"=",
"os",
".",
"environ",
"try",
":",
"self",
".",
"options",
"(",
"... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | Plugin.options | Register commandline options.
Implement this method for normal options behavior with protection from
OptionConflictErrors. If you override this method and want the default
--with-$name option to be registered, be sure to call super(). | environment/lib/python2.7/site-packages/nose/plugins/base.py | def options(self, parser, env):
"""Register commandline options.
Implement this method for normal options behavior with protection from
OptionConflictErrors. If you override this method and want the default
--with-$name option to be registered, be sure to call super().
"""
... | def options(self, parser, env):
"""Register commandline options.
Implement this method for normal options behavior with protection from
OptionConflictErrors. If you override this method and want the default
--with-$name option to be registered, be sure to call super().
"""
... | [
"Register",
"commandline",
"options",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/plugins/base.py#L76-L90 | [
"def",
"options",
"(",
"self",
",",
"parser",
",",
"env",
")",
":",
"env_opt",
"=",
"'NOSE_WITH_%s'",
"%",
"self",
".",
"name",
".",
"upper",
"(",
")",
"env_opt",
"=",
"env_opt",
".",
"replace",
"(",
"'-'",
",",
"'_'",
")",
"parser",
".",
"add_option... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | Plugin.configure | Configure the plugin and system, based on selected options.
The base plugin class sets the plugin to enabled if the enable option
for the plugin (self.enableOpt) is true. | environment/lib/python2.7/site-packages/nose/plugins/base.py | def configure(self, options, conf):
"""Configure the plugin and system, based on selected options.
The base plugin class sets the plugin to enabled if the enable option
for the plugin (self.enableOpt) is true.
"""
if not self.can_configure:
return
self.conf =... | def configure(self, options, conf):
"""Configure the plugin and system, based on selected options.
The base plugin class sets the plugin to enabled if the enable option
for the plugin (self.enableOpt) is true.
"""
if not self.can_configure:
return
self.conf =... | [
"Configure",
"the",
"plugin",
"and",
"system",
"based",
"on",
"selected",
"options",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/plugins/base.py#L92-L102 | [
"def",
"configure",
"(",
"self",
",",
"options",
",",
"conf",
")",
":",
"if",
"not",
"self",
".",
"can_configure",
":",
"return",
"self",
".",
"conf",
"=",
"conf",
"if",
"hasattr",
"(",
"options",
",",
"self",
".",
"enableOpt",
")",
":",
"self",
".",... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | validate_string_list | Validate that the input is a list of strings.
Raises ValueError if not. | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def validate_string_list(lst):
"""Validate that the input is a list of strings.
Raises ValueError if not."""
if not isinstance(lst, list):
raise ValueError('input %r must be a list' % lst)
for x in lst:
if not isinstance(x, basestring):
raise ValueError('element %r in list m... | def validate_string_list(lst):
"""Validate that the input is a list of strings.
Raises ValueError if not."""
if not isinstance(lst, list):
raise ValueError('input %r must be a list' % lst)
for x in lst:
if not isinstance(x, basestring):
raise ValueError('element %r in list m... | [
"Validate",
"that",
"the",
"input",
"is",
"a",
"list",
"of",
"strings",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L60-L68 | [
"def",
"validate_string_list",
"(",
"lst",
")",
":",
"if",
"not",
"isinstance",
"(",
"lst",
",",
"list",
")",
":",
"raise",
"ValueError",
"(",
"'input %r must be a list'",
"%",
"lst",
")",
"for",
"x",
"in",
"lst",
":",
"if",
"not",
"isinstance",
"(",
"x"... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | validate_string_dict | Validate that the input is a dict with string keys and values.
Raises ValueError if not. | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def validate_string_dict(dct):
"""Validate that the input is a dict with string keys and values.
Raises ValueError if not."""
for k,v in dct.iteritems():
if not isinstance(k, basestring):
raise ValueError('key %r in dict must be a string' % k)
if not isinstance(v, basestring):
... | def validate_string_dict(dct):
"""Validate that the input is a dict with string keys and values.
Raises ValueError if not."""
for k,v in dct.iteritems():
if not isinstance(k, basestring):
raise ValueError('key %r in dict must be a string' % k)
if not isinstance(v, basestring):
... | [
"Validate",
"that",
"the",
"input",
"is",
"a",
"dict",
"with",
"string",
"keys",
"and",
"values",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L71-L79 | [
"def",
"validate_string_dict",
"(",
"dct",
")",
":",
"for",
"k",
",",
"v",
"in",
"dct",
".",
"iteritems",
"(",
")",
":",
"if",
"not",
"isinstance",
"(",
"k",
",",
"basestring",
")",
":",
"raise",
"ValueError",
"(",
"'key %r in dict must be a string'",
"%",... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | ZMQSocketChannel._run_loop | Run my loop, ignoring EINTR events in the poller | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def _run_loop(self):
"""Run my loop, ignoring EINTR events in the poller"""
while True:
try:
self.ioloop.start()
except ZMQError as e:
if e.errno == errno.EINTR:
continue
else:
raise
... | def _run_loop(self):
"""Run my loop, ignoring EINTR events in the poller"""
while True:
try:
self.ioloop.start()
except ZMQError as e:
if e.errno == errno.EINTR:
continue
else:
raise
... | [
"Run",
"my",
"loop",
"ignoring",
"EINTR",
"events",
"in",
"the",
"poller"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L123-L139 | [
"def",
"_run_loop",
"(",
"self",
")",
":",
"while",
"True",
":",
"try",
":",
"self",
".",
"ioloop",
".",
"start",
"(",
")",
"except",
"ZMQError",
"as",
"e",
":",
"if",
"e",
".",
"errno",
"==",
"errno",
".",
"EINTR",
":",
"continue",
"else",
":",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | ZMQSocketChannel._queue_send | Queue a message to be sent from the IOLoop's thread.
Parameters
----------
msg : message to send
This is threadsafe, as it uses IOLoop.add_callback to give the loop's
thread control of the action. | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def _queue_send(self, msg):
"""Queue a message to be sent from the IOLoop's thread.
Parameters
----------
msg : message to send
This is threadsafe, as it uses IOLoop.add_callback to give the loop's
thread control of the action.
"""
def th... | def _queue_send(self, msg):
"""Queue a message to be sent from the IOLoop's thread.
Parameters
----------
msg : message to send
This is threadsafe, as it uses IOLoop.add_callback to give the loop's
thread control of the action.
"""
def th... | [
"Queue",
"a",
"message",
"to",
"be",
"sent",
"from",
"the",
"IOLoop",
"s",
"thread",
".",
"Parameters",
"----------",
"msg",
":",
"message",
"to",
"send",
"This",
"is",
"threadsafe",
"as",
"it",
"uses",
"IOLoop",
".",
"add_callback",
"to",
"give",
"the",
... | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L159-L171 | [
"def",
"_queue_send",
"(",
"self",
",",
"msg",
")",
":",
"def",
"thread_send",
"(",
")",
":",
"self",
".",
"session",
".",
"send",
"(",
"self",
".",
"stream",
",",
"msg",
")",
"self",
".",
"ioloop",
".",
"add_callback",
"(",
"thread_send",
")"
] | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | ZMQSocketChannel._handle_recv | callback for stream.on_recv
unpacks message, and calls handlers with it. | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def _handle_recv(self, msg):
"""callback for stream.on_recv
unpacks message, and calls handlers with it.
"""
ident,smsg = self.session.feed_identities(msg)
self.call_handlers(self.session.unserialize(smsg)) | def _handle_recv(self, msg):
"""callback for stream.on_recv
unpacks message, and calls handlers with it.
"""
ident,smsg = self.session.feed_identities(msg)
self.call_handlers(self.session.unserialize(smsg)) | [
"callback",
"for",
"stream",
".",
"on_recv",
"unpacks",
"message",
"and",
"calls",
"handlers",
"with",
"it",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L173-L179 | [
"def",
"_handle_recv",
"(",
"self",
",",
"msg",
")",
":",
"ident",
",",
"smsg",
"=",
"self",
".",
"session",
".",
"feed_identities",
"(",
"msg",
")",
"self",
".",
"call_handlers",
"(",
"self",
".",
"session",
".",
"unserialize",
"(",
"smsg",
")",
")"
] | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | ShellSocketChannel.run | The thread's main activity. Call start() instead. | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def run(self):
"""The thread's main activity. Call start() instead."""
self.socket = self.context.socket(zmq.DEALER)
self.socket.setsockopt(zmq.IDENTITY, self.session.bsession)
self.socket.connect('tcp://%s:%i' % self.address)
self.stream = zmqstream.ZMQStream(self.socket, self.... | def run(self):
"""The thread's main activity. Call start() instead."""
self.socket = self.context.socket(zmq.DEALER)
self.socket.setsockopt(zmq.IDENTITY, self.session.bsession)
self.socket.connect('tcp://%s:%i' % self.address)
self.stream = zmqstream.ZMQStream(self.socket, self.... | [
"The",
"thread",
"s",
"main",
"activity",
".",
"Call",
"start",
"()",
"instead",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L195-L206 | [
"def",
"run",
"(",
"self",
")",
":",
"self",
".",
"socket",
"=",
"self",
".",
"context",
".",
"socket",
"(",
"zmq",
".",
"DEALER",
")",
"self",
".",
"socket",
".",
"setsockopt",
"(",
"zmq",
".",
"IDENTITY",
",",
"self",
".",
"session",
".",
"bsessi... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | ShellSocketChannel.execute | Execute code in the kernel.
Parameters
----------
code : str
A string of Python code.
silent : bool, optional (default False)
If set, the kernel will execute the code as quietly possible.
user_variables : list, optional
A list of variable na... | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def execute(self, code, silent=False,
user_variables=None, user_expressions=None, allow_stdin=None):
"""Execute code in the kernel.
Parameters
----------
code : str
A string of Python code.
silent : bool, optional (default False)
If set, ... | def execute(self, code, silent=False,
user_variables=None, user_expressions=None, allow_stdin=None):
"""Execute code in the kernel.
Parameters
----------
code : str
A string of Python code.
silent : bool, optional (default False)
If set, ... | [
"Execute",
"code",
"in",
"the",
"kernel",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L222-L277 | [
"def",
"execute",
"(",
"self",
",",
"code",
",",
"silent",
"=",
"False",
",",
"user_variables",
"=",
"None",
",",
"user_expressions",
"=",
"None",
",",
"allow_stdin",
"=",
"None",
")",
":",
"if",
"user_variables",
"is",
"None",
":",
"user_variables",
"=",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | ShellSocketChannel.complete | Tab complete text in the kernel's namespace.
Parameters
----------
text : str
The text to complete.
line : str
The full line of text that is the surrounding context for the
text to complete.
cursor_pos : int
The position of the cur... | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def complete(self, text, line, cursor_pos, block=None):
"""Tab complete text in the kernel's namespace.
Parameters
----------
text : str
The text to complete.
line : str
The full line of text that is the surrounding context for the
text to com... | def complete(self, text, line, cursor_pos, block=None):
"""Tab complete text in the kernel's namespace.
Parameters
----------
text : str
The text to complete.
line : str
The full line of text that is the surrounding context for the
text to com... | [
"Tab",
"complete",
"text",
"in",
"the",
"kernel",
"s",
"namespace",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L279-L302 | [
"def",
"complete",
"(",
"self",
",",
"text",
",",
"line",
",",
"cursor_pos",
",",
"block",
"=",
"None",
")",
":",
"content",
"=",
"dict",
"(",
"text",
"=",
"text",
",",
"line",
"=",
"line",
",",
"block",
"=",
"block",
",",
"cursor_pos",
"=",
"curso... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | ShellSocketChannel.object_info | Get metadata information about an object.
Parameters
----------
oname : str
A string specifying the object name.
detail_level : int, optional
The level of detail for the introspection (0-2)
Returns
-------
The msg_id of the message sent. | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def object_info(self, oname, detail_level=0):
"""Get metadata information about an object.
Parameters
----------
oname : str
A string specifying the object name.
detail_level : int, optional
The level of detail for the introspection (0-2)
Returns... | def object_info(self, oname, detail_level=0):
"""Get metadata information about an object.
Parameters
----------
oname : str
A string specifying the object name.
detail_level : int, optional
The level of detail for the introspection (0-2)
Returns... | [
"Get",
"metadata",
"information",
"about",
"an",
"object",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L304-L321 | [
"def",
"object_info",
"(",
"self",
",",
"oname",
",",
"detail_level",
"=",
"0",
")",
":",
"content",
"=",
"dict",
"(",
"oname",
"=",
"oname",
",",
"detail_level",
"=",
"detail_level",
")",
"msg",
"=",
"self",
".",
"session",
".",
"msg",
"(",
"'object_i... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | ShellSocketChannel.history | Get entries from the history list.
Parameters
----------
raw : bool
If True, return the raw input.
output : bool
If True, then return the output as well.
hist_access_type : str
'range' (fill in session, start and stop params), 'tail' (fill in ... | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def history(self, raw=True, output=False, hist_access_type='range', **kwargs):
"""Get entries from the history list.
Parameters
----------
raw : bool
If True, return the raw input.
output : bool
If True, then return the output as well.
hist_access... | def history(self, raw=True, output=False, hist_access_type='range', **kwargs):
"""Get entries from the history list.
Parameters
----------
raw : bool
If True, return the raw input.
output : bool
If True, then return the output as well.
hist_access... | [
"Get",
"entries",
"from",
"the",
"history",
"list",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L323-L359 | [
"def",
"history",
"(",
"self",
",",
"raw",
"=",
"True",
",",
"output",
"=",
"False",
",",
"hist_access_type",
"=",
"'range'",
",",
"*",
"*",
"kwargs",
")",
":",
"content",
"=",
"dict",
"(",
"raw",
"=",
"raw",
",",
"output",
"=",
"output",
",",
"his... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | ShellSocketChannel.shutdown | Request an immediate kernel shutdown.
Upon receipt of the (empty) reply, client code can safely assume that
the kernel has shut down and it's safe to forcefully terminate it if
it's still alive.
The kernel will send the reply via a function registered with Python's
atexit modul... | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def shutdown(self, restart=False):
"""Request an immediate kernel shutdown.
Upon receipt of the (empty) reply, client code can safely assume that
the kernel has shut down and it's safe to forcefully terminate it if
it's still alive.
The kernel will send the reply via a function... | def shutdown(self, restart=False):
"""Request an immediate kernel shutdown.
Upon receipt of the (empty) reply, client code can safely assume that
the kernel has shut down and it's safe to forcefully terminate it if
it's still alive.
The kernel will send the reply via a function... | [
"Request",
"an",
"immediate",
"kernel",
"shutdown",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L361-L376 | [
"def",
"shutdown",
"(",
"self",
",",
"restart",
"=",
"False",
")",
":",
"# Send quit message to kernel. Once we implement kernel-side setattr,",
"# this should probably be done that way, but for now this will do.",
"msg",
"=",
"self",
".",
"session",
".",
"msg",
"(",
"'shutdo... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | SubSocketChannel.flush | Immediately processes all pending messages on the SUB channel.
Callers should use this method to ensure that :method:`call_handlers`
has been called for all messages that have been received on the
0MQ SUB socket of this channel.
This method is thread safe.
Parameters
-... | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def flush(self, timeout=1.0):
"""Immediately processes all pending messages on the SUB channel.
Callers should use this method to ensure that :method:`call_handlers`
has been called for all messages that have been received on the
0MQ SUB socket of this channel.
This method is t... | def flush(self, timeout=1.0):
"""Immediately processes all pending messages on the SUB channel.
Callers should use this method to ensure that :method:`call_handlers`
has been called for all messages that have been received on the
0MQ SUB socket of this channel.
This method is t... | [
"Immediately",
"processes",
"all",
"pending",
"messages",
"on",
"the",
"SUB",
"channel",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L416-L438 | [
"def",
"flush",
"(",
"self",
",",
"timeout",
"=",
"1.0",
")",
":",
"# We do the IOLoop callback process twice to ensure that the IOLoop",
"# gets to perform at least one full poll.",
"stop_time",
"=",
"time",
".",
"time",
"(",
")",
"+",
"timeout",
"for",
"i",
"in",
"x... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | StdInSocketChannel.input | Send a string of raw input to the kernel. | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def input(self, string):
"""Send a string of raw input to the kernel."""
content = dict(value=string)
msg = self.session.msg('input_reply', content)
self._queue_send(msg) | def input(self, string):
"""Send a string of raw input to the kernel."""
content = dict(value=string)
msg = self.session.msg('input_reply', content)
self._queue_send(msg) | [
"Send",
"a",
"string",
"of",
"raw",
"input",
"to",
"the",
"kernel",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L483-L487 | [
"def",
"input",
"(",
"self",
",",
"string",
")",
":",
"content",
"=",
"dict",
"(",
"value",
"=",
"string",
")",
"msg",
"=",
"self",
".",
"session",
".",
"msg",
"(",
"'input_reply'",
",",
"content",
")",
"self",
".",
"_queue_send",
"(",
"msg",
")"
] | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | HBSocketChannel._poll | poll for heartbeat replies until we reach self.time_to_dead
Ignores interrupts, and returns the result of poll(), which
will be an empty list if no messages arrived before the timeout,
or the event tuple if there is a message to receive. | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def _poll(self, start_time):
"""poll for heartbeat replies until we reach self.time_to_dead
Ignores interrupts, and returns the result of poll(), which
will be an empty list if no messages arrived before the timeout,
or the event tuple if there is a message to receive.
"... | def _poll(self, start_time):
"""poll for heartbeat replies until we reach self.time_to_dead
Ignores interrupts, and returns the result of poll(), which
will be an empty list if no messages arrived before the timeout,
or the event tuple if there is a message to receive.
"... | [
"poll",
"for",
"heartbeat",
"replies",
"until",
"we",
"reach",
"self",
".",
"time_to_dead",
"Ignores",
"interrupts",
"and",
"returns",
"the",
"result",
"of",
"poll",
"()",
"which",
"will",
"be",
"an",
"empty",
"list",
"if",
"no",
"messages",
"arrived",
"befo... | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L522-L553 | [
"def",
"_poll",
"(",
"self",
",",
"start_time",
")",
":",
"until_dead",
"=",
"self",
".",
"time_to_dead",
"-",
"(",
"time",
".",
"time",
"(",
")",
"-",
"start_time",
")",
"# ensure poll at least once",
"until_dead",
"=",
"max",
"(",
"until_dead",
",",
"1e-... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | HBSocketChannel.run | The thread's main activity. Call start() instead. | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def run(self):
"""The thread's main activity. Call start() instead."""
self._create_socket()
self._running = True
self._beating = True
while self._running:
if self._pause:
# just sleep, and skip the rest of the loop
time.sleep... | def run(self):
"""The thread's main activity. Call start() instead."""
self._create_socket()
self._running = True
self._beating = True
while self._running:
if self._pause:
# just sleep, and skip the rest of the loop
time.sleep... | [
"The",
"thread",
"s",
"main",
"activity",
".",
"Call",
"start",
"()",
"instead",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L555-L594 | [
"def",
"run",
"(",
"self",
")",
":",
"self",
".",
"_create_socket",
"(",
")",
"self",
".",
"_running",
"=",
"True",
"self",
".",
"_beating",
"=",
"True",
"while",
"self",
".",
"_running",
":",
"if",
"self",
".",
"_pause",
":",
"# just sleep, and skip the... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | HBSocketChannel.is_beating | Is the heartbeat running and responsive (and not paused). | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def is_beating(self):
"""Is the heartbeat running and responsive (and not paused)."""
if self.is_alive() and not self._pause and self._beating:
return True
else:
return False | def is_beating(self):
"""Is the heartbeat running and responsive (and not paused)."""
if self.is_alive() and not self._pause and self._beating:
return True
else:
return False | [
"Is",
"the",
"heartbeat",
"running",
"and",
"responsive",
"(",
"and",
"not",
"paused",
")",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L604-L609 | [
"def",
"is_beating",
"(",
"self",
")",
":",
"if",
"self",
".",
"is_alive",
"(",
")",
"and",
"not",
"self",
".",
"_pause",
"and",
"self",
".",
"_beating",
":",
"return",
"True",
"else",
":",
"return",
"False"
] | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | KernelManager.start_channels | Starts the channels for this kernel.
This will create the channels if they do not exist and then start
them. If port numbers of 0 are being used (random ports) then you
must first call :method:`start_kernel`. If the channels have been
stopped and you call this, :class:`RuntimeError` wil... | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def start_channels(self, shell=True, sub=True, stdin=True, hb=True):
"""Starts the channels for this kernel.
This will create the channels if they do not exist and then start
them. If port numbers of 0 are being used (random ports) then you
must first call :method:`start_kernel`. If the... | def start_channels(self, shell=True, sub=True, stdin=True, hb=True):
"""Starts the channels for this kernel.
This will create the channels if they do not exist and then start
them. If port numbers of 0 are being used (random ports) then you
must first call :method:`start_kernel`. If the... | [
"Starts",
"the",
"channels",
"for",
"this",
"kernel",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L693-L711 | [
"def",
"start_channels",
"(",
"self",
",",
"shell",
"=",
"True",
",",
"sub",
"=",
"True",
",",
"stdin",
"=",
"True",
",",
"hb",
"=",
"True",
")",
":",
"if",
"shell",
":",
"self",
".",
"shell_channel",
".",
"start",
"(",
")",
"if",
"sub",
":",
"se... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | KernelManager.stop_channels | Stops all the running channels for this kernel. | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def stop_channels(self):
"""Stops all the running channels for this kernel.
"""
if self.shell_channel.is_alive():
self.shell_channel.stop()
if self.sub_channel.is_alive():
self.sub_channel.stop()
if self.stdin_channel.is_alive():
self.stdin_cha... | def stop_channels(self):
"""Stops all the running channels for this kernel.
"""
if self.shell_channel.is_alive():
self.shell_channel.stop()
if self.sub_channel.is_alive():
self.sub_channel.stop()
if self.stdin_channel.is_alive():
self.stdin_cha... | [
"Stops",
"all",
"the",
"running",
"channels",
"for",
"this",
"kernel",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L713-L723 | [
"def",
"stop_channels",
"(",
"self",
")",
":",
"if",
"self",
".",
"shell_channel",
".",
"is_alive",
"(",
")",
":",
"self",
".",
"shell_channel",
".",
"stop",
"(",
")",
"if",
"self",
".",
"sub_channel",
".",
"is_alive",
"(",
")",
":",
"self",
".",
"su... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | KernelManager.channels_running | Are any of the channels created and running? | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def channels_running(self):
"""Are any of the channels created and running?"""
return (self.shell_channel.is_alive() or self.sub_channel.is_alive() or
self.stdin_channel.is_alive() or self.hb_channel.is_alive()) | def channels_running(self):
"""Are any of the channels created and running?"""
return (self.shell_channel.is_alive() or self.sub_channel.is_alive() or
self.stdin_channel.is_alive() or self.hb_channel.is_alive()) | [
"Are",
"any",
"of",
"the",
"channels",
"created",
"and",
"running?"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L726-L729 | [
"def",
"channels_running",
"(",
"self",
")",
":",
"return",
"(",
"self",
".",
"shell_channel",
".",
"is_alive",
"(",
")",
"or",
"self",
".",
"sub_channel",
".",
"is_alive",
"(",
")",
"or",
"self",
".",
"stdin_channel",
".",
"is_alive",
"(",
")",
"or",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | KernelManager.cleanup_connection_file | cleanup connection file *if we wrote it*
Will not raise if the connection file was already removed somehow. | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def cleanup_connection_file(self):
"""cleanup connection file *if we wrote it*
Will not raise if the connection file was already removed somehow.
"""
if self._connection_file_written:
# cleanup connection files on full shutdown of kernel we started
self._... | def cleanup_connection_file(self):
"""cleanup connection file *if we wrote it*
Will not raise if the connection file was already removed somehow.
"""
if self._connection_file_written:
# cleanup connection files on full shutdown of kernel we started
self._... | [
"cleanup",
"connection",
"file",
"*",
"if",
"we",
"wrote",
"it",
"*",
"Will",
"not",
"raise",
"if",
"the",
"connection",
"file",
"was",
"already",
"removed",
"somehow",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L735-L746 | [
"def",
"cleanup_connection_file",
"(",
"self",
")",
":",
"if",
"self",
".",
"_connection_file_written",
":",
"# cleanup connection files on full shutdown of kernel we started",
"self",
".",
"_connection_file_written",
"=",
"False",
"try",
":",
"os",
".",
"remove",
"(",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | KernelManager.load_connection_file | load connection info from JSON dict in self.connection_file | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def load_connection_file(self):
"""load connection info from JSON dict in self.connection_file"""
with open(self.connection_file) as f:
cfg = json.loads(f.read())
self.ip = cfg['ip']
self.shell_port = cfg['shell_port']
self.stdin_port = cfg['stdin_port']
... | def load_connection_file(self):
"""load connection info from JSON dict in self.connection_file"""
with open(self.connection_file) as f:
cfg = json.loads(f.read())
self.ip = cfg['ip']
self.shell_port = cfg['shell_port']
self.stdin_port = cfg['stdin_port']
... | [
"load",
"connection",
"info",
"from",
"JSON",
"dict",
"in",
"self",
".",
"connection_file"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L748-L758 | [
"def",
"load_connection_file",
"(",
"self",
")",
":",
"with",
"open",
"(",
"self",
".",
"connection_file",
")",
"as",
"f",
":",
"cfg",
"=",
"json",
".",
"loads",
"(",
"f",
".",
"read",
"(",
")",
")",
"self",
".",
"ip",
"=",
"cfg",
"[",
"'ip'",
"]... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | KernelManager.write_connection_file | write connection info to JSON dict in self.connection_file | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def write_connection_file(self):
"""write connection info to JSON dict in self.connection_file"""
if self._connection_file_written:
return
self.connection_file,cfg = write_connection_file(self.connection_file,
ip=self.ip, key=self.session.key,
stdin_port=self.... | def write_connection_file(self):
"""write connection info to JSON dict in self.connection_file"""
if self._connection_file_written:
return
self.connection_file,cfg = write_connection_file(self.connection_file,
ip=self.ip, key=self.session.key,
stdin_port=self.... | [
"write",
"connection",
"info",
"to",
"JSON",
"dict",
"in",
"self",
".",
"connection_file"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L760-L774 | [
"def",
"write_connection_file",
"(",
"self",
")",
":",
"if",
"self",
".",
"_connection_file_written",
":",
"return",
"self",
".",
"connection_file",
",",
"cfg",
"=",
"write_connection_file",
"(",
"self",
".",
"connection_file",
",",
"ip",
"=",
"self",
".",
"ip... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | KernelManager.start_kernel | Starts a kernel process and configures the manager to use it.
If random ports (port=0) are being used, this method must be called
before the channels are created.
Parameters:
-----------
launcher : callable, optional (default None)
A custom function for launching t... | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def start_kernel(self, **kw):
"""Starts a kernel process and configures the manager to use it.
If random ports (port=0) are being used, this method must be called
before the channels are created.
Parameters:
-----------
launcher : callable, optional (default None)
... | def start_kernel(self, **kw):
"""Starts a kernel process and configures the manager to use it.
If random ports (port=0) are being used, this method must be called
before the channels are created.
Parameters:
-----------
launcher : callable, optional (default None)
... | [
"Starts",
"a",
"kernel",
"process",
"and",
"configures",
"the",
"manager",
"to",
"use",
"it",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L776-L806 | [
"def",
"start_kernel",
"(",
"self",
",",
"*",
"*",
"kw",
")",
":",
"if",
"self",
".",
"ip",
"not",
"in",
"LOCAL_IPS",
":",
"raise",
"RuntimeError",
"(",
"\"Can only launch a kernel on a local interface. \"",
"\"Make sure that the '*_address' attributes are \"",
"\"confi... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | KernelManager.shutdown_kernel | Attempts to the stop the kernel process cleanly. If the kernel
cannot be stopped, it is killed, if possible. | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def shutdown_kernel(self, restart=False):
""" Attempts to the stop the kernel process cleanly. If the kernel
cannot be stopped, it is killed, if possible.
"""
# FIXME: Shutdown does not work on Windows due to ZMQ errors!
if sys.platform == 'win32':
self.kill_kernel()
... | def shutdown_kernel(self, restart=False):
""" Attempts to the stop the kernel process cleanly. If the kernel
cannot be stopped, it is killed, if possible.
"""
# FIXME: Shutdown does not work on Windows due to ZMQ errors!
if sys.platform == 'win32':
self.kill_kernel()
... | [
"Attempts",
"to",
"the",
"stop",
"the",
"kernel",
"process",
"cleanly",
".",
"If",
"the",
"kernel",
"cannot",
"be",
"stopped",
"it",
"is",
"killed",
"if",
"possible",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L808-L841 | [
"def",
"shutdown_kernel",
"(",
"self",
",",
"restart",
"=",
"False",
")",
":",
"# FIXME: Shutdown does not work on Windows due to ZMQ errors!",
"if",
"sys",
".",
"platform",
"==",
"'win32'",
":",
"self",
".",
"kill_kernel",
"(",
")",
"return",
"# Pause the heart beat ... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | KernelManager.restart_kernel | Restarts a kernel with the arguments that were used to launch it.
If the old kernel was launched with random ports, the same ports will be
used for the new kernel.
Parameters
----------
now : bool, optional
If True, the kernel is forcefully restarted *immediately*, ... | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def restart_kernel(self, now=False, **kw):
"""Restarts a kernel with the arguments that were used to launch it.
If the old kernel was launched with random ports, the same ports will be
used for the new kernel.
Parameters
----------
now : bool, optional
If Tr... | def restart_kernel(self, now=False, **kw):
"""Restarts a kernel with the arguments that were used to launch it.
If the old kernel was launched with random ports, the same ports will be
used for the new kernel.
Parameters
----------
now : bool, optional
If Tr... | [
"Restarts",
"a",
"kernel",
"with",
"the",
"arguments",
"that",
"were",
"used",
"to",
"launch",
"it",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L843-L881 | [
"def",
"restart_kernel",
"(",
"self",
",",
"now",
"=",
"False",
",",
"*",
"*",
"kw",
")",
":",
"if",
"self",
".",
"_launch_args",
"is",
"None",
":",
"raise",
"RuntimeError",
"(",
"\"Cannot restart the kernel. \"",
"\"No previous call to 'start_kernel'.\"",
")",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | KernelManager.kill_kernel | Kill the running kernel. | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def kill_kernel(self):
""" Kill the running kernel. """
if self.has_kernel:
# Pause the heart beat channel if it exists.
if self._hb_channel is not None:
self._hb_channel.pause()
# Attempt to kill the kernel.
try:
self.kern... | def kill_kernel(self):
""" Kill the running kernel. """
if self.has_kernel:
# Pause the heart beat channel if it exists.
if self._hb_channel is not None:
self._hb_channel.pause()
# Attempt to kill the kernel.
try:
self.kern... | [
"Kill",
"the",
"running",
"kernel",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L890-L914 | [
"def",
"kill_kernel",
"(",
"self",
")",
":",
"if",
"self",
".",
"has_kernel",
":",
"# Pause the heart beat channel if it exists.",
"if",
"self",
".",
"_hb_channel",
"is",
"not",
"None",
":",
"self",
".",
"_hb_channel",
".",
"pause",
"(",
")",
"# Attempt to kill ... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | KernelManager.interrupt_kernel | Interrupts the kernel. Unlike ``signal_kernel``, this operation is
well supported on all platforms. | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def interrupt_kernel(self):
""" Interrupts the kernel. Unlike ``signal_kernel``, this operation is
well supported on all platforms.
"""
if self.has_kernel:
if sys.platform == 'win32':
from parentpoller import ParentPollerWindows as Poller
Polle... | def interrupt_kernel(self):
""" Interrupts the kernel. Unlike ``signal_kernel``, this operation is
well supported on all platforms.
"""
if self.has_kernel:
if sys.platform == 'win32':
from parentpoller import ParentPollerWindows as Poller
Polle... | [
"Interrupts",
"the",
"kernel",
".",
"Unlike",
"signal_kernel",
"this",
"operation",
"is",
"well",
"supported",
"on",
"all",
"platforms",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L916-L927 | [
"def",
"interrupt_kernel",
"(",
"self",
")",
":",
"if",
"self",
".",
"has_kernel",
":",
"if",
"sys",
".",
"platform",
"==",
"'win32'",
":",
"from",
"parentpoller",
"import",
"ParentPollerWindows",
"as",
"Poller",
"Poller",
".",
"send_interrupt",
"(",
"self",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | KernelManager.signal_kernel | Sends a signal to the kernel. Note that since only SIGTERM is
supported on Windows, this function is only useful on Unix systems. | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def signal_kernel(self, signum):
""" Sends a signal to the kernel. Note that since only SIGTERM is
supported on Windows, this function is only useful on Unix systems.
"""
if self.has_kernel:
self.kernel.send_signal(signum)
else:
raise RuntimeError("Cannot ... | def signal_kernel(self, signum):
""" Sends a signal to the kernel. Note that since only SIGTERM is
supported on Windows, this function is only useful on Unix systems.
"""
if self.has_kernel:
self.kernel.send_signal(signum)
else:
raise RuntimeError("Cannot ... | [
"Sends",
"a",
"signal",
"to",
"the",
"kernel",
".",
"Note",
"that",
"since",
"only",
"SIGTERM",
"is",
"supported",
"on",
"Windows",
"this",
"function",
"is",
"only",
"useful",
"on",
"Unix",
"systems",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L929-L936 | [
"def",
"signal_kernel",
"(",
"self",
",",
"signum",
")",
":",
"if",
"self",
".",
"has_kernel",
":",
"self",
".",
"kernel",
".",
"send_signal",
"(",
"signum",
")",
"else",
":",
"raise",
"RuntimeError",
"(",
"\"Cannot signal kernel. No kernel is running!\"",
")"
] | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | KernelManager.is_alive | Is the kernel process still running? | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def is_alive(self):
"""Is the kernel process still running?"""
if self.has_kernel:
if self.kernel.poll() is None:
return True
else:
return False
elif self._hb_channel is not None:
# We didn't start the kernel with this KernelMan... | def is_alive(self):
"""Is the kernel process still running?"""
if self.has_kernel:
if self.kernel.poll() is None:
return True
else:
return False
elif self._hb_channel is not None:
# We didn't start the kernel with this KernelMan... | [
"Is",
"the",
"kernel",
"process",
"still",
"running?"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L939-L953 | [
"def",
"is_alive",
"(",
"self",
")",
":",
"if",
"self",
".",
"has_kernel",
":",
"if",
"self",
".",
"kernel",
".",
"poll",
"(",
")",
"is",
"None",
":",
"return",
"True",
"else",
":",
"return",
"False",
"elif",
"self",
".",
"_hb_channel",
"is",
"not",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | KernelManager.shell_channel | Get the REQ socket channel object to make requests of the kernel. | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def shell_channel(self):
"""Get the REQ socket channel object to make requests of the kernel."""
if self._shell_channel is None:
self._shell_channel = self.shell_channel_class(self.context,
self.session,
... | def shell_channel(self):
"""Get the REQ socket channel object to make requests of the kernel."""
if self._shell_channel is None:
self._shell_channel = self.shell_channel_class(self.context,
self.session,
... | [
"Get",
"the",
"REQ",
"socket",
"channel",
"object",
"to",
"make",
"requests",
"of",
"the",
"kernel",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L960-L966 | [
"def",
"shell_channel",
"(",
"self",
")",
":",
"if",
"self",
".",
"_shell_channel",
"is",
"None",
":",
"self",
".",
"_shell_channel",
"=",
"self",
".",
"shell_channel_class",
"(",
"self",
".",
"context",
",",
"self",
".",
"session",
",",
"(",
"self",
"."... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | KernelManager.sub_channel | Get the SUB socket channel object. | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def sub_channel(self):
"""Get the SUB socket channel object."""
if self._sub_channel is None:
self._sub_channel = self.sub_channel_class(self.context,
self.session,
(self.ip, self.io... | def sub_channel(self):
"""Get the SUB socket channel object."""
if self._sub_channel is None:
self._sub_channel = self.sub_channel_class(self.context,
self.session,
(self.ip, self.io... | [
"Get",
"the",
"SUB",
"socket",
"channel",
"object",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L969-L975 | [
"def",
"sub_channel",
"(",
"self",
")",
":",
"if",
"self",
".",
"_sub_channel",
"is",
"None",
":",
"self",
".",
"_sub_channel",
"=",
"self",
".",
"sub_channel_class",
"(",
"self",
".",
"context",
",",
"self",
".",
"session",
",",
"(",
"self",
".",
"ip"... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | KernelManager.stdin_channel | Get the REP socket channel object to handle stdin (raw_input). | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def stdin_channel(self):
"""Get the REP socket channel object to handle stdin (raw_input)."""
if self._stdin_channel is None:
self._stdin_channel = self.stdin_channel_class(self.context,
self.session,
... | def stdin_channel(self):
"""Get the REP socket channel object to handle stdin (raw_input)."""
if self._stdin_channel is None:
self._stdin_channel = self.stdin_channel_class(self.context,
self.session,
... | [
"Get",
"the",
"REP",
"socket",
"channel",
"object",
"to",
"handle",
"stdin",
"(",
"raw_input",
")",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L978-L984 | [
"def",
"stdin_channel",
"(",
"self",
")",
":",
"if",
"self",
".",
"_stdin_channel",
"is",
"None",
":",
"self",
".",
"_stdin_channel",
"=",
"self",
".",
"stdin_channel_class",
"(",
"self",
".",
"context",
",",
"self",
".",
"session",
",",
"(",
"self",
"."... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | KernelManager.hb_channel | Get the heartbeat socket channel object to check that the
kernel is alive. | environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py | def hb_channel(self):
"""Get the heartbeat socket channel object to check that the
kernel is alive."""
if self._hb_channel is None:
self._hb_channel = self.hb_channel_class(self.context,
self.session,
... | def hb_channel(self):
"""Get the heartbeat socket channel object to check that the
kernel is alive."""
if self._hb_channel is None:
self._hb_channel = self.hb_channel_class(self.context,
self.session,
... | [
"Get",
"the",
"heartbeat",
"socket",
"channel",
"object",
"to",
"check",
"that",
"the",
"kernel",
"is",
"alive",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py#L987-L994 | [
"def",
"hb_channel",
"(",
"self",
")",
":",
"if",
"self",
".",
"_hb_channel",
"is",
"None",
":",
"self",
".",
"_hb_channel",
"=",
"self",
".",
"hb_channel_class",
"(",
"self",
".",
"context",
",",
"self",
".",
"session",
",",
"(",
"self",
".",
"ip",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | bind_kernel | Bind an Engine's Kernel to be used as a full IPython kernel.
This allows a running Engine to be used simultaneously as a full IPython kernel
with the QtConsole or other frontends.
This function returns immediately. | environment/lib/python2.7/site-packages/IPython/parallel/__init__.py | def bind_kernel(**kwargs):
"""Bind an Engine's Kernel to be used as a full IPython kernel.
This allows a running Engine to be used simultaneously as a full IPython kernel
with the QtConsole or other frontends.
This function returns immediately.
"""
from IPython.zmq.ipkernel import IPKe... | def bind_kernel(**kwargs):
"""Bind an Engine's Kernel to be used as a full IPython kernel.
This allows a running Engine to be used simultaneously as a full IPython kernel
with the QtConsole or other frontends.
This function returns immediately.
"""
from IPython.zmq.ipkernel import IPKe... | [
"Bind",
"an",
"Engine",
"s",
"Kernel",
"to",
"be",
"used",
"as",
"a",
"full",
"IPython",
"kernel",
".",
"This",
"allows",
"a",
"running",
"Engine",
"to",
"be",
"used",
"simultaneously",
"as",
"a",
"full",
"IPython",
"kernel",
"with",
"the",
"QtConsole",
... | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/__init__.py#L48-L72 | [
"def",
"bind_kernel",
"(",
"*",
"*",
"kwargs",
")",
":",
"from",
"IPython",
".",
"zmq",
".",
"ipkernel",
"import",
"IPKernelApp",
"from",
"IPython",
".",
"parallel",
".",
"apps",
".",
"ipengineapp",
"import",
"IPEngineApp",
"# first check for IPKernelApp, in which... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | ExtensionDebugger.debug | Emit a debugging message depending on the debugging level.
:param level: The debugging level.
:param message: The message to emit. | timid/extensions.py | def debug(self, level, message):
"""
Emit a debugging message depending on the debugging level.
:param level: The debugging level.
:param message: The message to emit.
"""
if self._debug >= level:
print(message, file=sys.stderr) | def debug(self, level, message):
"""
Emit a debugging message depending on the debugging level.
:param level: The debugging level.
:param message: The message to emit.
"""
if self._debug >= level:
print(message, file=sys.stderr) | [
"Emit",
"a",
"debugging",
"message",
"depending",
"on",
"the",
"debugging",
"level",
"."
] | rackerlabs/timid | python | https://github.com/rackerlabs/timid/blob/b1c6aa159ab380a033740f4aa392cf0d125e0ac6/timid/extensions.py#L262-L271 | [
"def",
"debug",
"(",
"self",
",",
"level",
",",
"message",
")",
":",
"if",
"self",
".",
"_debug",
">=",
"level",
":",
"print",
"(",
"message",
",",
"file",
"=",
"sys",
".",
"stderr",
")"
] | b1c6aa159ab380a033740f4aa392cf0d125e0ac6 |
test | ExtensionSet._get_extension_classes | Retrieve the extension classes in priority order.
:returns: A list of extension classes, in proper priority
order. | timid/extensions.py | def _get_extension_classes(cls):
"""
Retrieve the extension classes in priority order.
:returns: A list of extension classes, in proper priority
order.
"""
if cls._extension_classes is None:
exts = {}
# Iterate over the entrypoints
... | def _get_extension_classes(cls):
"""
Retrieve the extension classes in priority order.
:returns: A list of extension classes, in proper priority
order.
"""
if cls._extension_classes is None:
exts = {}
# Iterate over the entrypoints
... | [
"Retrieve",
"the",
"extension",
"classes",
"in",
"priority",
"order",
"."
] | rackerlabs/timid | python | https://github.com/rackerlabs/timid/blob/b1c6aa159ab380a033740f4aa392cf0d125e0ac6/timid/extensions.py#L284-L303 | [
"def",
"_get_extension_classes",
"(",
"cls",
")",
":",
"if",
"cls",
".",
"_extension_classes",
"is",
"None",
":",
"exts",
"=",
"{",
"}",
"# Iterate over the entrypoints",
"for",
"ext",
"in",
"entry",
".",
"points",
"[",
"NAMESPACE_EXTENSIONS",
"]",
":",
"exts"... | b1c6aa159ab380a033740f4aa392cf0d125e0ac6 |
test | ExtensionSet.prepare | Prepare all the extensions. Extensions are prepared during
argument parser preparation. An extension implementing the
``prepare()`` method is able to add command line arguments
specific for that extension.
:param parser: The argument parser, an instance of
``arg... | timid/extensions.py | def prepare(cls, parser):
"""
Prepare all the extensions. Extensions are prepared during
argument parser preparation. An extension implementing the
``prepare()`` method is able to add command line arguments
specific for that extension.
:param parser: The argument parse... | def prepare(cls, parser):
"""
Prepare all the extensions. Extensions are prepared during
argument parser preparation. An extension implementing the
``prepare()`` method is able to add command line arguments
specific for that extension.
:param parser: The argument parse... | [
"Prepare",
"all",
"the",
"extensions",
".",
"Extensions",
"are",
"prepared",
"during",
"argument",
"parser",
"preparation",
".",
"An",
"extension",
"implementing",
"the",
"prepare",
"()",
"method",
"is",
"able",
"to",
"add",
"command",
"line",
"arguments",
"spec... | rackerlabs/timid | python | https://github.com/rackerlabs/timid/blob/b1c6aa159ab380a033740f4aa392cf0d125e0ac6/timid/extensions.py#L306-L321 | [
"def",
"prepare",
"(",
"cls",
",",
"parser",
")",
":",
"debugger",
"=",
"ExtensionDebugger",
"(",
"'prepare'",
")",
"for",
"ext",
"in",
"cls",
".",
"_get_extension_classes",
"(",
")",
":",
"with",
"debugger",
"(",
"ext",
")",
":",
"ext",
".",
"prepare",
... | b1c6aa159ab380a033740f4aa392cf0d125e0ac6 |
test | ExtensionSet.activate | Initialize the extensions. This loops over each extension
invoking its ``activate()`` method; those extensions that
return an object are considered "activated" and will be called
at later phases of extension processing.
:param ctxt: An instance of ``timid.context.Context``.
:pa... | timid/extensions.py | def activate(cls, ctxt, args):
"""
Initialize the extensions. This loops over each extension
invoking its ``activate()`` method; those extensions that
return an object are considered "activated" and will be called
at later phases of extension processing.
:param ctxt: An... | def activate(cls, ctxt, args):
"""
Initialize the extensions. This loops over each extension
invoking its ``activate()`` method; those extensions that
return an object are considered "activated" and will be called
at later phases of extension processing.
:param ctxt: An... | [
"Initialize",
"the",
"extensions",
".",
"This",
"loops",
"over",
"each",
"extension",
"invoking",
"its",
"activate",
"()",
"method",
";",
"those",
"extensions",
"that",
"return",
"an",
"object",
"are",
"considered",
"activated",
"and",
"will",
"be",
"called",
... | rackerlabs/timid | python | https://github.com/rackerlabs/timid/blob/b1c6aa159ab380a033740f4aa392cf0d125e0ac6/timid/extensions.py#L324-L364 | [
"def",
"activate",
"(",
"cls",
",",
"ctxt",
",",
"args",
")",
":",
"debugger",
"=",
"ExtensionDebugger",
"(",
"'activate'",
")",
"exts",
"=",
"[",
"]",
"for",
"ext",
"in",
"cls",
".",
"_get_extension_classes",
"(",
")",
":",
"# Not using debugger as a contex... | b1c6aa159ab380a033740f4aa392cf0d125e0ac6 |
test | ExtensionSet.read_steps | Called after reading steps, prior to adding them to the list of
test steps. Extensions are able to alter the list (in place).
:param ctxt: An instance of ``timid.context.Context``.
:param steps: A list of ``timid.steps.Step`` instances.
:returns: The ``steps`` parameter, for convenien... | timid/extensions.py | def read_steps(self, ctxt, steps):
"""
Called after reading steps, prior to adding them to the list of
test steps. Extensions are able to alter the list (in place).
:param ctxt: An instance of ``timid.context.Context``.
:param steps: A list of ``timid.steps.Step`` instances.
... | def read_steps(self, ctxt, steps):
"""
Called after reading steps, prior to adding them to the list of
test steps. Extensions are able to alter the list (in place).
:param ctxt: An instance of ``timid.context.Context``.
:param steps: A list of ``timid.steps.Step`` instances.
... | [
"Called",
"after",
"reading",
"steps",
"prior",
"to",
"adding",
"them",
"to",
"the",
"list",
"of",
"test",
"steps",
".",
"Extensions",
"are",
"able",
"to",
"alter",
"the",
"list",
"(",
"in",
"place",
")",
"."
] | rackerlabs/timid | python | https://github.com/rackerlabs/timid/blob/b1c6aa159ab380a033740f4aa392cf0d125e0ac6/timid/extensions.py#L375-L393 | [
"def",
"read_steps",
"(",
"self",
",",
"ctxt",
",",
"steps",
")",
":",
"debugger",
"=",
"ExtensionDebugger",
"(",
"'read_steps'",
")",
"for",
"ext",
"in",
"self",
".",
"exts",
":",
"with",
"debugger",
"(",
"ext",
")",
":",
"ext",
".",
"read_steps",
"("... | b1c6aa159ab380a033740f4aa392cf0d125e0ac6 |
test | ExtensionSet.pre_step | Called prior to executing a step.
:param ctxt: An instance of ``timid.context.Context``.
:param step: An instance of ``timid.steps.Step`` describing
the step to be executed.
:param idx: The index of the step in the list of steps.
:returns: A ``True`` value if the s... | timid/extensions.py | def pre_step(self, ctxt, step, idx):
"""
Called prior to executing a step.
:param ctxt: An instance of ``timid.context.Context``.
:param step: An instance of ``timid.steps.Step`` describing
the step to be executed.
:param idx: The index of the step in the li... | def pre_step(self, ctxt, step, idx):
"""
Called prior to executing a step.
:param ctxt: An instance of ``timid.context.Context``.
:param step: An instance of ``timid.steps.Step`` describing
the step to be executed.
:param idx: The index of the step in the li... | [
"Called",
"prior",
"to",
"executing",
"a",
"step",
"."
] | rackerlabs/timid | python | https://github.com/rackerlabs/timid/blob/b1c6aa159ab380a033740f4aa392cf0d125e0ac6/timid/extensions.py#L395-L417 | [
"def",
"pre_step",
"(",
"self",
",",
"ctxt",
",",
"step",
",",
"idx",
")",
":",
"debugger",
"=",
"ExtensionDebugger",
"(",
"'pre_step'",
")",
"for",
"ext",
"in",
"self",
".",
"exts",
":",
"with",
"debugger",
"(",
"ext",
")",
":",
"if",
"ext",
".",
... | b1c6aa159ab380a033740f4aa392cf0d125e0ac6 |
test | ExtensionSet.post_step | Called after executing a step.
:param ctxt: An instance of ``timid.context.Context``.
:param step: An instance of ``timid.steps.Step`` describing
the step that was executed.
:param idx: The index of the step in the list of steps.
:param result: An instance of ``timi... | timid/extensions.py | def post_step(self, ctxt, step, idx, result):
"""
Called after executing a step.
:param ctxt: An instance of ``timid.context.Context``.
:param step: An instance of ``timid.steps.Step`` describing
the step that was executed.
:param idx: The index of the step ... | def post_step(self, ctxt, step, idx, result):
"""
Called after executing a step.
:param ctxt: An instance of ``timid.context.Context``.
:param step: An instance of ``timid.steps.Step`` describing
the step that was executed.
:param idx: The index of the step ... | [
"Called",
"after",
"executing",
"a",
"step",
"."
] | rackerlabs/timid | python | https://github.com/rackerlabs/timid/blob/b1c6aa159ab380a033740f4aa392cf0d125e0ac6/timid/extensions.py#L419-L442 | [
"def",
"post_step",
"(",
"self",
",",
"ctxt",
",",
"step",
",",
"idx",
",",
"result",
")",
":",
"debugger",
"=",
"ExtensionDebugger",
"(",
"'post_step'",
")",
"for",
"ext",
"in",
"self",
".",
"exts",
":",
"with",
"debugger",
"(",
"ext",
")",
":",
"ex... | b1c6aa159ab380a033740f4aa392cf0d125e0ac6 |
test | ExtensionSet.finalize | Called at the end of processing. This call allows extensions to
emit any additional data, such as timing information, prior to
``timid``'s exit. Extensions may also alter the return value.
:param ctxt: An instance of ``timid.context.Context``.
:param result: The return value of the ba... | timid/extensions.py | def finalize(self, ctxt, result):
"""
Called at the end of processing. This call allows extensions to
emit any additional data, such as timing information, prior to
``timid``'s exit. Extensions may also alter the return value.
:param ctxt: An instance of ``timid.context.Contex... | def finalize(self, ctxt, result):
"""
Called at the end of processing. This call allows extensions to
emit any additional data, such as timing information, prior to
``timid``'s exit. Extensions may also alter the return value.
:param ctxt: An instance of ``timid.context.Contex... | [
"Called",
"at",
"the",
"end",
"of",
"processing",
".",
"This",
"call",
"allows",
"extensions",
"to",
"emit",
"any",
"additional",
"data",
"such",
"as",
"timing",
"information",
"prior",
"to",
"timid",
"s",
"exit",
".",
"Extensions",
"may",
"also",
"alter",
... | rackerlabs/timid | python | https://github.com/rackerlabs/timid/blob/b1c6aa159ab380a033740f4aa392cf0d125e0ac6/timid/extensions.py#L444-L465 | [
"def",
"finalize",
"(",
"self",
",",
"ctxt",
",",
"result",
")",
":",
"debugger",
"=",
"ExtensionDebugger",
"(",
"'finalize'",
")",
"for",
"ext",
"in",
"self",
".",
"exts",
":",
"with",
"debugger",
"(",
"ext",
")",
":",
"result",
"=",
"ext",
".",
"fi... | b1c6aa159ab380a033740f4aa392cf0d125e0ac6 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.