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 | ByteParser._split_into_chunks | Split the code object into a list of `Chunk` objects.
Each chunk is only entered at its first instruction, though there can
be many exits from a chunk.
Returns a list of `Chunk` objects. | virtualEnvironment/lib/python2.7/site-packages/coverage/parser.py | def _split_into_chunks(self):
"""Split the code object into a list of `Chunk` objects.
Each chunk is only entered at its first instruction, though there can
be many exits from a chunk.
Returns a list of `Chunk` objects.
"""
# The list of chunks so far, and the one we'r... | def _split_into_chunks(self):
"""Split the code object into a list of `Chunk` objects.
Each chunk is only entered at its first instruction, though there can
be many exits from a chunk.
Returns a list of `Chunk` objects.
"""
# The list of chunks so far, and the one we'r... | [
"Split",
"the",
"code",
"object",
"into",
"a",
"list",
"of",
"Chunk",
"objects",
"."
] | tnkteja/myhelp | python | https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/parser.py#L422-L552 | [
"def",
"_split_into_chunks",
"(",
"self",
")",
":",
"# The list of chunks so far, and the one we're working on.",
"chunks",
"=",
"[",
"]",
"chunk",
"=",
"None",
"# A dict mapping byte offsets of line starts to the line numbers.",
"bytes_lines_map",
"=",
"dict",
"(",
"self",
"... | fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb |
test | ByteParser.validate_chunks | Validate the rule that chunks have a single entrance. | virtualEnvironment/lib/python2.7/site-packages/coverage/parser.py | def validate_chunks(self, chunks):
"""Validate the rule that chunks have a single entrance."""
# starts is the entrances to the chunks
starts = set([ch.byte for ch in chunks])
for ch in chunks:
assert all([(ex in starts or ex < 0) for ex in ch.exits]) | def validate_chunks(self, chunks):
"""Validate the rule that chunks have a single entrance."""
# starts is the entrances to the chunks
starts = set([ch.byte for ch in chunks])
for ch in chunks:
assert all([(ex in starts or ex < 0) for ex in ch.exits]) | [
"Validate",
"the",
"rule",
"that",
"chunks",
"have",
"a",
"single",
"entrance",
"."
] | tnkteja/myhelp | python | https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/parser.py#L554-L559 | [
"def",
"validate_chunks",
"(",
"self",
",",
"chunks",
")",
":",
"# starts is the entrances to the chunks",
"starts",
"=",
"set",
"(",
"[",
"ch",
".",
"byte",
"for",
"ch",
"in",
"chunks",
"]",
")",
"for",
"ch",
"in",
"chunks",
":",
"assert",
"all",
"(",
"... | fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb |
test | ByteParser._arcs | Find the executable arcs in the code.
Yields pairs: (from,to). From and to are integer line numbers. If
from is < 0, then the arc is an entrance into the code object. If to
is < 0, the arc is an exit from the code object. | virtualEnvironment/lib/python2.7/site-packages/coverage/parser.py | def _arcs(self):
"""Find the executable arcs in the code.
Yields pairs: (from,to). From and to are integer line numbers. If
from is < 0, then the arc is an entrance into the code object. If to
is < 0, the arc is an exit from the code object.
"""
chunks = self._split_... | def _arcs(self):
"""Find the executable arcs in the code.
Yields pairs: (from,to). From and to are integer line numbers. If
from is < 0, then the arc is an entrance into the code object. If to
is < 0, the arc is an exit from the code object.
"""
chunks = self._split_... | [
"Find",
"the",
"executable",
"arcs",
"in",
"the",
"code",
"."
] | tnkteja/myhelp | python | https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/parser.py#L561-L610 | [
"def",
"_arcs",
"(",
"self",
")",
":",
"chunks",
"=",
"self",
".",
"_split_into_chunks",
"(",
")",
"# A map from byte offsets to chunks jumped into.",
"byte_chunks",
"=",
"dict",
"(",
"[",
"(",
"c",
".",
"byte",
",",
"c",
")",
"for",
"c",
"in",
"chunks",
"... | fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb |
test | ByteParser._all_chunks | Returns a list of `Chunk` objects for this code and its children.
See `_split_into_chunks` for details. | virtualEnvironment/lib/python2.7/site-packages/coverage/parser.py | def _all_chunks(self):
"""Returns a list of `Chunk` objects for this code and its children.
See `_split_into_chunks` for details.
"""
chunks = []
for bp in self.child_parsers():
chunks.extend(bp._split_into_chunks())
return chunks | def _all_chunks(self):
"""Returns a list of `Chunk` objects for this code and its children.
See `_split_into_chunks` for details.
"""
chunks = []
for bp in self.child_parsers():
chunks.extend(bp._split_into_chunks())
return chunks | [
"Returns",
"a",
"list",
"of",
"Chunk",
"objects",
"for",
"this",
"code",
"and",
"its",
"children",
"."
] | tnkteja/myhelp | python | https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/parser.py#L612-L622 | [
"def",
"_all_chunks",
"(",
"self",
")",
":",
"chunks",
"=",
"[",
"]",
"for",
"bp",
"in",
"self",
".",
"child_parsers",
"(",
")",
":",
"chunks",
".",
"extend",
"(",
"bp",
".",
"_split_into_chunks",
"(",
")",
")",
"return",
"chunks"
] | fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb |
test | ByteParser._all_arcs | Get the set of all arcs in this code object and its children.
See `_arcs` for details. | virtualEnvironment/lib/python2.7/site-packages/coverage/parser.py | def _all_arcs(self):
"""Get the set of all arcs in this code object and its children.
See `_arcs` for details.
"""
arcs = set()
for bp in self.child_parsers():
arcs.update(bp._arcs())
return arcs | def _all_arcs(self):
"""Get the set of all arcs in this code object and its children.
See `_arcs` for details.
"""
arcs = set()
for bp in self.child_parsers():
arcs.update(bp._arcs())
return arcs | [
"Get",
"the",
"set",
"of",
"all",
"arcs",
"in",
"this",
"code",
"object",
"and",
"its",
"children",
"."
] | tnkteja/myhelp | python | https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/parser.py#L624-L634 | [
"def",
"_all_arcs",
"(",
"self",
")",
":",
"arcs",
"=",
"set",
"(",
")",
"for",
"bp",
"in",
"self",
".",
"child_parsers",
"(",
")",
":",
"arcs",
".",
"update",
"(",
"bp",
".",
"_arcs",
"(",
")",
")",
"return",
"arcs"
] | fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb |
test | Coverage.options | Add options to command line. | environment/lib/python2.7/site-packages/nose/plugins/cover.py | def options(self, parser, env):
"""
Add options to command line.
"""
super(Coverage, self).options(parser, env)
parser.add_option("--cover-package", action="append",
default=env.get('NOSE_COVER_PACKAGE'),
metavar="PACKAGE",
... | def options(self, parser, env):
"""
Add options to command line.
"""
super(Coverage, self).options(parser, env)
parser.add_option("--cover-package", action="append",
default=env.get('NOSE_COVER_PACKAGE'),
metavar="PACKAGE",
... | [
"Add",
"options",
"to",
"command",
"line",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/plugins/cover.py#L35-L91 | [
"def",
"options",
"(",
"self",
",",
"parser",
",",
"env",
")",
":",
"super",
"(",
"Coverage",
",",
"self",
")",
".",
"options",
"(",
"parser",
",",
"env",
")",
"parser",
".",
"add_option",
"(",
"\"--cover-package\"",
",",
"action",
"=",
"\"append\"",
"... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | Coverage.configure | Configure plugin. | environment/lib/python2.7/site-packages/nose/plugins/cover.py | def configure(self, options, conf):
"""
Configure plugin.
"""
try:
self.status.pop('active')
except KeyError:
pass
super(Coverage, self).configure(options, conf)
if conf.worker:
return
if self.enabled:
try:
... | def configure(self, options, conf):
"""
Configure plugin.
"""
try:
self.status.pop('active')
except KeyError:
pass
super(Coverage, self).configure(options, conf)
if conf.worker:
return
if self.enabled:
try:
... | [
"Configure",
"plugin",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/plugins/cover.py#L93-L137 | [
"def",
"configure",
"(",
"self",
",",
"options",
",",
"conf",
")",
":",
"try",
":",
"self",
".",
"status",
".",
"pop",
"(",
"'active'",
")",
"except",
"KeyError",
":",
"pass",
"super",
"(",
"Coverage",
",",
"self",
")",
".",
"configure",
"(",
"option... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | Coverage.begin | Begin recording coverage information. | environment/lib/python2.7/site-packages/nose/plugins/cover.py | def begin(self):
"""
Begin recording coverage information.
"""
log.debug("Coverage begin")
self.skipModules = sys.modules.keys()[:]
if self.coverErase:
log.debug("Clearing previously collected coverage statistics")
self.coverInstance.combine()
... | def begin(self):
"""
Begin recording coverage information.
"""
log.debug("Coverage begin")
self.skipModules = sys.modules.keys()[:]
if self.coverErase:
log.debug("Clearing previously collected coverage statistics")
self.coverInstance.combine()
... | [
"Begin",
"recording",
"coverage",
"information",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/plugins/cover.py#L139-L151 | [
"def",
"begin",
"(",
"self",
")",
":",
"log",
".",
"debug",
"(",
"\"Coverage begin\"",
")",
"self",
".",
"skipModules",
"=",
"sys",
".",
"modules",
".",
"keys",
"(",
")",
"[",
":",
"]",
"if",
"self",
".",
"coverErase",
":",
"log",
".",
"debug",
"("... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | Coverage.report | Output code coverage report. | environment/lib/python2.7/site-packages/nose/plugins/cover.py | def report(self, stream):
"""
Output code coverage report.
"""
log.debug("Coverage report")
self.coverInstance.stop()
self.coverInstance.combine()
self.coverInstance.save()
modules = [module
for name, module in sys.modules.items()
... | def report(self, stream):
"""
Output code coverage report.
"""
log.debug("Coverage report")
self.coverInstance.stop()
self.coverInstance.combine()
self.coverInstance.save()
modules = [module
for name, module in sys.modules.items()
... | [
"Output",
"code",
"coverage",
"report",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/plugins/cover.py#L153-L186 | [
"def",
"report",
"(",
"self",
",",
"stream",
")",
":",
"log",
".",
"debug",
"(",
"\"Coverage report\"",
")",
"self",
".",
"coverInstance",
".",
"stop",
"(",
")",
"self",
".",
"coverInstance",
".",
"combine",
"(",
")",
"self",
".",
"coverInstance",
".",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | Coverage.wantFile | If inclusive coverage enabled, return true for all source files
in wanted packages. | environment/lib/python2.7/site-packages/nose/plugins/cover.py | def wantFile(self, file, package=None):
"""If inclusive coverage enabled, return true for all source files
in wanted packages.
"""
if self.coverInclusive:
if file.endswith(".py"):
if package and self.coverPackages:
for want in self.coverPac... | def wantFile(self, file, package=None):
"""If inclusive coverage enabled, return true for all source files
in wanted packages.
"""
if self.coverInclusive:
if file.endswith(".py"):
if package and self.coverPackages:
for want in self.coverPac... | [
"If",
"inclusive",
"coverage",
"enabled",
"return",
"true",
"for",
"all",
"source",
"files",
"in",
"wanted",
"packages",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/plugins/cover.py#L216-L228 | [
"def",
"wantFile",
"(",
"self",
",",
"file",
",",
"package",
"=",
"None",
")",
":",
"if",
"self",
".",
"coverInclusive",
":",
"if",
"file",
".",
"endswith",
"(",
"\".py\"",
")",
":",
"if",
"package",
"and",
"self",
".",
"coverPackages",
":",
"for",
"... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | interpret_distro_name | Generate alternative interpretations of a source distro name
Note: if `location` is a filesystem filename, you should call
``pkg_resources.normalize_path()`` on it before passing it to this
routine! | environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/setuptools/package_index.py | def interpret_distro_name(location, basename, metadata,
py_version=None, precedence=SOURCE_DIST, platform=None
):
"""Generate alternative interpretations of a source distro name
Note: if `location` is a filesystem filename, you should call
``pkg_resources.normalize_path()`` on it before passing it to t... | def interpret_distro_name(location, basename, metadata,
py_version=None, precedence=SOURCE_DIST, platform=None
):
"""Generate alternative interpretations of a source distro name
Note: if `location` is a filesystem filename, you should call
``pkg_resources.normalize_path()`` on it before passing it to t... | [
"Generate",
"alternative",
"interpretations",
"of",
"a",
"source",
"distro",
"name"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/setuptools/package_index.py#L103-L135 | [
"def",
"interpret_distro_name",
"(",
"location",
",",
"basename",
",",
"metadata",
",",
"py_version",
"=",
"None",
",",
"precedence",
"=",
"SOURCE_DIST",
",",
"platform",
"=",
"None",
")",
":",
"# Generate alternative interpretations of a source distro name",
"# Because... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | _encode_auth | A function compatible with Python 2.3-3.3 that will encode
auth from a URL suitable for an HTTP header.
>>> _encode_auth('username%3Apassword')
u'dXNlcm5hbWU6cGFzc3dvcmQ=' | environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/setuptools/package_index.py | def _encode_auth(auth):
"""
A function compatible with Python 2.3-3.3 that will encode
auth from a URL suitable for an HTTP header.
>>> _encode_auth('username%3Apassword')
u'dXNlcm5hbWU6cGFzc3dvcmQ='
"""
auth_s = urllib2.unquote(auth)
# convert to bytes
auth_bytes = auth_s.encode()
... | def _encode_auth(auth):
"""
A function compatible with Python 2.3-3.3 that will encode
auth from a URL suitable for an HTTP header.
>>> _encode_auth('username%3Apassword')
u'dXNlcm5hbWU6cGFzc3dvcmQ='
"""
auth_s = urllib2.unquote(auth)
# convert to bytes
auth_bytes = auth_s.encode()
... | [
"A",
"function",
"compatible",
"with",
"Python",
"2",
".",
"3",
"-",
"3",
".",
"3",
"that",
"will",
"encode",
"auth",
"from",
"a",
"URL",
"suitable",
"for",
"an",
"HTTP",
"header",
".",
">>>",
"_encode_auth",
"(",
"username%3Apassword",
")",
"u",
"dXNlcm... | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/setuptools/package_index.py#L813-L828 | [
"def",
"_encode_auth",
"(",
"auth",
")",
":",
"auth_s",
"=",
"urllib2",
".",
"unquote",
"(",
"auth",
")",
"# convert to bytes",
"auth_bytes",
"=",
"auth_s",
".",
"encode",
"(",
")",
"# use the legacy interface for Python 2.3 support",
"encoded_bytes",
"=",
"base64",... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | open_with_auth | Open a urllib2 request, handling HTTP authentication | environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/setuptools/package_index.py | def open_with_auth(url):
"""Open a urllib2 request, handling HTTP authentication"""
scheme, netloc, path, params, query, frag = urlparse.urlparse(url)
# Double scheme does not raise on Mac OS X as revealed by a
# failing test. We would expect "nonnumeric port". Refs #20.
if netloc.endswith(':'):
... | def open_with_auth(url):
"""Open a urllib2 request, handling HTTP authentication"""
scheme, netloc, path, params, query, frag = urlparse.urlparse(url)
# Double scheme does not raise on Mac OS X as revealed by a
# failing test. We would expect "nonnumeric port". Refs #20.
if netloc.endswith(':'):
... | [
"Open",
"a",
"urllib2",
"request",
"handling",
"HTTP",
"authentication"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/setuptools/package_index.py#L830-L863 | [
"def",
"open_with_auth",
"(",
"url",
")",
":",
"scheme",
",",
"netloc",
",",
"path",
",",
"params",
",",
"query",
",",
"frag",
"=",
"urlparse",
".",
"urlparse",
"(",
"url",
")",
"# Double scheme does not raise on Mac OS X as revealed by a",
"# failing test. We would... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | PackageIndex.fetch_distribution | Obtain a distribution suitable for fulfilling `requirement`
`requirement` must be a ``pkg_resources.Requirement`` instance.
If necessary, or if the `force_scan` flag is set, the requirement is
searched for in the (online) package index as well as the locally
installed packages. If a di... | environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/setuptools/package_index.py | def fetch_distribution(self,
requirement, tmpdir, force_scan=False, source=False, develop_ok=False,
local_index=None
):
"""Obtain a distribution suitable for fulfilling `requirement`
`requirement` must be a ``pkg_resources.Requirement`` instance.
If necessary, or if the `for... | def fetch_distribution(self,
requirement, tmpdir, force_scan=False, source=False, develop_ok=False,
local_index=None
):
"""Obtain a distribution suitable for fulfilling `requirement`
`requirement` must be a ``pkg_resources.Requirement`` instance.
If necessary, or if the `for... | [
"Obtain",
"a",
"distribution",
"suitable",
"for",
"fulfilling",
"requirement"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/setuptools/package_index.py#L434-L501 | [
"def",
"fetch_distribution",
"(",
"self",
",",
"requirement",
",",
"tmpdir",
",",
"force_scan",
"=",
"False",
",",
"source",
"=",
"False",
",",
"develop_ok",
"=",
"False",
",",
"local_index",
"=",
"None",
")",
":",
"# process a Requirement",
"self",
".",
"in... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | jrepr | customized `repr()`. | jasily/utils/__init__.py | def jrepr(value):
'''customized `repr()`.'''
if value is None:
return repr(value)
t = type(value)
if t.__repr__ is not object.__repr__:
return repr(value)
return 'object ' + t.__name__ | def jrepr(value):
'''customized `repr()`.'''
if value is None:
return repr(value)
t = type(value)
if t.__repr__ is not object.__repr__:
return repr(value)
return 'object ' + t.__name__ | [
"customized",
"repr",
"()",
"."
] | Jasily/jasily-python | python | https://github.com/Jasily/jasily-python/blob/1c821a120ebbbbc3c5761f5f1e8a73588059242a/jasily/utils/__init__.py#L11-L18 | [
"def",
"jrepr",
"(",
"value",
")",
":",
"if",
"value",
"is",
"None",
":",
"return",
"repr",
"(",
"value",
")",
"t",
"=",
"type",
"(",
"value",
")",
"if",
"t",
".",
"__repr__",
"is",
"not",
"object",
".",
"__repr__",
":",
"return",
"repr",
"(",
"v... | 1c821a120ebbbbc3c5761f5f1e8a73588059242a |
test | get_parent | get parent from obj. | jasily/utils/__init__.py | def get_parent(obj):
'''
get parent from obj.
'''
names = obj.__qualname__.split('.')[:-1]
if '<locals>' in names: # locals function
raise ValueError('cannot get parent from locals object.')
module = sys.modules[obj.__module__]
parent = module
while names:
parent = getatt... | def get_parent(obj):
'''
get parent from obj.
'''
names = obj.__qualname__.split('.')[:-1]
if '<locals>' in names: # locals function
raise ValueError('cannot get parent from locals object.')
module = sys.modules[obj.__module__]
parent = module
while names:
parent = getatt... | [
"get",
"parent",
"from",
"obj",
"."
] | Jasily/jasily-python | python | https://github.com/Jasily/jasily-python/blob/1c821a120ebbbbc3c5761f5f1e8a73588059242a/jasily/utils/__init__.py#L21-L32 | [
"def",
"get_parent",
"(",
"obj",
")",
":",
"names",
"=",
"obj",
".",
"__qualname__",
".",
"split",
"(",
"'.'",
")",
"[",
":",
"-",
"1",
"]",
"if",
"'<locals>'",
"in",
"names",
":",
"# locals function",
"raise",
"ValueError",
"(",
"'cannot get parent from l... | 1c821a120ebbbbc3c5761f5f1e8a73588059242a |
test | EnginePUBHandler.root_topic | this is a property, in case the handler is created
before the engine gets registered with an id | environment/lib/python2.7/site-packages/IPython/zmq/log.py | def root_topic(self):
"""this is a property, in case the handler is created
before the engine gets registered with an id"""
if isinstance(getattr(self.engine, 'id', None), int):
return "engine.%i"%self.engine.id
else:
return "engine" | def root_topic(self):
"""this is a property, in case the handler is created
before the engine gets registered with an id"""
if isinstance(getattr(self.engine, 'id', None), int):
return "engine.%i"%self.engine.id
else:
return "engine" | [
"this",
"is",
"a",
"property",
"in",
"case",
"the",
"handler",
"is",
"created",
"before",
"the",
"engine",
"gets",
"registered",
"with",
"an",
"id"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/log.py#L16-L22 | [
"def",
"root_topic",
"(",
"self",
")",
":",
"if",
"isinstance",
"(",
"getattr",
"(",
"self",
".",
"engine",
",",
"'id'",
",",
"None",
")",
",",
"int",
")",
":",
"return",
"\"engine.%i\"",
"%",
"self",
".",
"engine",
".",
"id",
"else",
":",
"return",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | init_fakemod_dict | Initialize a FakeModule instance __dict__.
Kept as a standalone function and not a method so the FakeModule API can
remain basically empty.
This should be considered for private IPython use, used in managing
namespaces for %run.
Parameters
----------
fm : FakeModule instance
adict :... | environment/lib/python2.7/site-packages/IPython/core/fakemodule.py | def init_fakemod_dict(fm,adict=None):
"""Initialize a FakeModule instance __dict__.
Kept as a standalone function and not a method so the FakeModule API can
remain basically empty.
This should be considered for private IPython use, used in managing
namespaces for %run.
Parameters
--------... | def init_fakemod_dict(fm,adict=None):
"""Initialize a FakeModule instance __dict__.
Kept as a standalone function and not a method so the FakeModule API can
remain basically empty.
This should be considered for private IPython use, used in managing
namespaces for %run.
Parameters
--------... | [
"Initialize",
"a",
"FakeModule",
"instance",
"__dict__",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/fakemodule.py#L18-L46 | [
"def",
"init_fakemod_dict",
"(",
"fm",
",",
"adict",
"=",
"None",
")",
":",
"dct",
"=",
"{",
"}",
"# It seems pydoc (and perhaps others) needs any module instance to",
"# implement a __nonzero__ method, so we add it if missing:",
"dct",
".",
"setdefault",
"(",
"'__nonzero__'"... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | render_template | renders context aware template | toolware/utils/template.py | def render_template(content, context):
""" renders context aware template """
rendered = Template(content).render(Context(context))
return rendered | def render_template(content, context):
""" renders context aware template """
rendered = Template(content).render(Context(context))
return rendered | [
"renders",
"context",
"aware",
"template"
] | un33k/django-toolware | python | https://github.com/un33k/django-toolware/blob/973f3e003dc38b812897dab88455bee37dcaf931/toolware/utils/template.py#L4-L7 | [
"def",
"render_template",
"(",
"content",
",",
"context",
")",
":",
"rendered",
"=",
"Template",
"(",
"content",
")",
".",
"render",
"(",
"Context",
"(",
"context",
")",
")",
"return",
"rendered"
] | 973f3e003dc38b812897dab88455bee37dcaf931 |
test | Capture.configure | Configure plugin. Plugin is enabled by default. | environment/lib/python2.7/site-packages/nose/plugins/capture.py | def configure(self, options, conf):
"""Configure plugin. Plugin is enabled by default.
"""
self.conf = conf
if not options.capture:
self.enabled = False | def configure(self, options, conf):
"""Configure plugin. Plugin is enabled by default.
"""
self.conf = conf
if not options.capture:
self.enabled = False | [
"Configure",
"plugin",
".",
"Plugin",
"is",
"enabled",
"by",
"default",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/plugins/capture.py#L47-L52 | [
"def",
"configure",
"(",
"self",
",",
"options",
",",
"conf",
")",
":",
"self",
".",
"conf",
"=",
"conf",
"if",
"not",
"options",
".",
"capture",
":",
"self",
".",
"enabled",
"=",
"False"
] | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | Capture.formatError | Add captured output to error report. | environment/lib/python2.7/site-packages/nose/plugins/capture.py | def formatError(self, test, err):
"""Add captured output to error report.
"""
test.capturedOutput = output = self.buffer
self._buf = None
if not output:
# Don't return None as that will prevent other
# formatters from formatting and remove earlier formatte... | def formatError(self, test, err):
"""Add captured output to error report.
"""
test.capturedOutput = output = self.buffer
self._buf = None
if not output:
# Don't return None as that will prevent other
# formatters from formatting and remove earlier formatte... | [
"Add",
"captured",
"output",
"to",
"error",
"report",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/plugins/capture.py#L70-L81 | [
"def",
"formatError",
"(",
"self",
",",
"test",
",",
"err",
")",
":",
"test",
".",
"capturedOutput",
"=",
"output",
"=",
"self",
".",
"buffer",
"self",
".",
"_buf",
"=",
"None",
"if",
"not",
"output",
":",
"# Don't return None as that will prevent other",
"#... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | splitBy | Turn a list to list of list | toolware/templatetags/generic.py | def splitBy(data, num):
""" Turn a list to list of list """
return [data[i:i + num] for i in range(0, len(data), num)] | def splitBy(data, num):
""" Turn a list to list of list """
return [data[i:i + num] for i in range(0, len(data), num)] | [
"Turn",
"a",
"list",
"to",
"list",
"of",
"list"
] | un33k/django-toolware | python | https://github.com/un33k/django-toolware/blob/973f3e003dc38b812897dab88455bee37dcaf931/toolware/templatetags/generic.py#L18-L20 | [
"def",
"splitBy",
"(",
"data",
",",
"num",
")",
":",
"return",
"[",
"data",
"[",
"i",
":",
"i",
"+",
"num",
"]",
"for",
"i",
"in",
"range",
"(",
"0",
",",
"len",
"(",
"data",
")",
",",
"num",
")",
"]"
] | 973f3e003dc38b812897dab88455bee37dcaf931 |
test | convert_to_this_nbformat | Convert a notebook to the v3 format.
Parameters
----------
nb : NotebookNode
The Python representation of the notebook to convert.
orig_version : int
The original version of the notebook to convert.
orig_minor : int
The original minor version of the notebook to convert (only... | environment/lib/python2.7/site-packages/IPython/nbformat/v3/convert.py | def convert_to_this_nbformat(nb, orig_version=2, orig_minor=0):
"""Convert a notebook to the v3 format.
Parameters
----------
nb : NotebookNode
The Python representation of the notebook to convert.
orig_version : int
The original version of the notebook to convert.
orig_minor : ... | def convert_to_this_nbformat(nb, orig_version=2, orig_minor=0):
"""Convert a notebook to the v3 format.
Parameters
----------
nb : NotebookNode
The Python representation of the notebook to convert.
orig_version : int
The original version of the notebook to convert.
orig_minor : ... | [
"Convert",
"a",
"notebook",
"to",
"the",
"v3",
"format",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/nbformat/v3/convert.py#L30-L58 | [
"def",
"convert_to_this_nbformat",
"(",
"nb",
",",
"orig_version",
"=",
"2",
",",
"orig_minor",
"=",
"0",
")",
":",
"if",
"orig_version",
"==",
"1",
":",
"nb",
"=",
"v2",
".",
"convert_to_this_nbformat",
"(",
"nb",
")",
"orig_version",
"=",
"2",
"if",
"o... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | hex_to_rgb | Convert a hex color to rgb integer tuple. | environment/lib/python2.7/site-packages/IPython/frontend/qt/console/styles.py | def hex_to_rgb(color):
"""Convert a hex color to rgb integer tuple."""
if color.startswith('#'):
color = color[1:]
if len(color) == 3:
color = ''.join([c*2 for c in color])
if len(color) != 6:
return False
try:
r = int(color[:2],16)
g = int(color[2:4],16)
... | def hex_to_rgb(color):
"""Convert a hex color to rgb integer tuple."""
if color.startswith('#'):
color = color[1:]
if len(color) == 3:
color = ''.join([c*2 for c in color])
if len(color) != 6:
return False
try:
r = int(color[:2],16)
g = int(color[2:4],16)
... | [
"Convert",
"a",
"hex",
"color",
"to",
"rgb",
"integer",
"tuple",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/styles.py#L60-L75 | [
"def",
"hex_to_rgb",
"(",
"color",
")",
":",
"if",
"color",
".",
"startswith",
"(",
"'#'",
")",
":",
"color",
"=",
"color",
"[",
"1",
":",
"]",
"if",
"len",
"(",
"color",
")",
"==",
"3",
":",
"color",
"=",
"''",
".",
"join",
"(",
"[",
"c",
"*... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | get_colors | Construct the keys to be used building the base stylesheet
from a templatee. | environment/lib/python2.7/site-packages/IPython/frontend/qt/console/styles.py | def get_colors(stylename):
"""Construct the keys to be used building the base stylesheet
from a templatee."""
style = get_style_by_name(stylename)
fgcolor = style.style_for_token(Token.Text)['color'] or ''
if len(fgcolor) in (3,6):
# could be 'abcdef' or 'ace' hex, which needs '#' prefix
... | def get_colors(stylename):
"""Construct the keys to be used building the base stylesheet
from a templatee."""
style = get_style_by_name(stylename)
fgcolor = style.style_for_token(Token.Text)['color'] or ''
if len(fgcolor) in (3,6):
# could be 'abcdef' or 'ace' hex, which needs '#' prefix
... | [
"Construct",
"the",
"keys",
"to",
"be",
"used",
"building",
"the",
"base",
"stylesheet",
"from",
"a",
"templatee",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/styles.py#L92-L110 | [
"def",
"get_colors",
"(",
"stylename",
")",
":",
"style",
"=",
"get_style_by_name",
"(",
"stylename",
")",
"fgcolor",
"=",
"style",
".",
"style_for_token",
"(",
"Token",
".",
"Text",
")",
"[",
"'color'",
"]",
"or",
"''",
"if",
"len",
"(",
"fgcolor",
")",... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | sheet_from_template | Use one of the base templates, and set bg/fg/select colors. | environment/lib/python2.7/site-packages/IPython/frontend/qt/console/styles.py | def sheet_from_template(name, colors='lightbg'):
"""Use one of the base templates, and set bg/fg/select colors."""
colors = colors.lower()
if colors=='lightbg':
return default_light_style_template%get_colors(name)
elif colors=='linux':
return default_dark_style_template%get_colors(name)
... | def sheet_from_template(name, colors='lightbg'):
"""Use one of the base templates, and set bg/fg/select colors."""
colors = colors.lower()
if colors=='lightbg':
return default_light_style_template%get_colors(name)
elif colors=='linux':
return default_dark_style_template%get_colors(name)
... | [
"Use",
"one",
"of",
"the",
"base",
"templates",
"and",
"set",
"bg",
"/",
"fg",
"/",
"select",
"colors",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/styles.py#L112-L122 | [
"def",
"sheet_from_template",
"(",
"name",
",",
"colors",
"=",
"'lightbg'",
")",
":",
"colors",
"=",
"colors",
".",
"lower",
"(",
")",
"if",
"colors",
"==",
"'lightbg'",
":",
"return",
"default_light_style_template",
"%",
"get_colors",
"(",
"name",
")",
"eli... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | get_font | Return a font of the requested family, using fallback as alternative.
If a fallback is provided, it is used in case the requested family isn't
found. If no fallback is given, no alternative is chosen and Qt's internal
algorithms may automatically choose a fallback font.
Parameters
----------
... | environment/lib/python2.7/site-packages/IPython/frontend/qt/util.py | def get_font(family, fallback=None):
"""Return a font of the requested family, using fallback as alternative.
If a fallback is provided, it is used in case the requested family isn't
found. If no fallback is given, no alternative is chosen and Qt's internal
algorithms may automatically choose a fallba... | def get_font(family, fallback=None):
"""Return a font of the requested family, using fallback as alternative.
If a fallback is provided, it is used in case the requested family isn't
found. If no fallback is given, no alternative is chosen and Qt's internal
algorithms may automatically choose a fallba... | [
"Return",
"a",
"font",
"of",
"the",
"requested",
"family",
"using",
"fallback",
"as",
"alternative",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/util.py#L82-L106 | [
"def",
"get_font",
"(",
"family",
",",
"fallback",
"=",
"None",
")",
":",
"font",
"=",
"QtGui",
".",
"QFont",
"(",
"family",
")",
"# Check whether we got what we wanted using QFontInfo, since exactMatch()",
"# is overly strict and returns false in too many cases.",
"font_info... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | IPythonWidget._handle_complete_reply | Reimplemented to support IPython's improved completion machinery. | environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py | def _handle_complete_reply(self, rep):
""" Reimplemented to support IPython's improved completion machinery.
"""
self.log.debug("complete: %s", rep.get('content', ''))
cursor = self._get_cursor()
info = self._request_info.get('complete')
if info and info.id == rep['parent... | def _handle_complete_reply(self, rep):
""" Reimplemented to support IPython's improved completion machinery.
"""
self.log.debug("complete: %s", rep.get('content', ''))
cursor = self._get_cursor()
info = self._request_info.get('complete')
if info and info.id == rep['parent... | [
"Reimplemented",
"to",
"support",
"IPython",
"s",
"improved",
"completion",
"machinery",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py#L138-L164 | [
"def",
"_handle_complete_reply",
"(",
"self",
",",
"rep",
")",
":",
"self",
".",
"log",
".",
"debug",
"(",
"\"complete: %s\"",
",",
"rep",
".",
"get",
"(",
"'content'",
",",
"''",
")",
")",
"cursor",
"=",
"self",
".",
"_get_cursor",
"(",
")",
"info",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | IPythonWidget._handle_execute_reply | Reimplemented to support prompt requests. | environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py | def _handle_execute_reply(self, msg):
""" Reimplemented to support prompt requests.
"""
msg_id = msg['parent_header'].get('msg_id')
info = self._request_info['execute'].get(msg_id)
if info and info.kind == 'prompt':
number = msg['content']['execution_count'] + 1
... | def _handle_execute_reply(self, msg):
""" Reimplemented to support prompt requests.
"""
msg_id = msg['parent_header'].get('msg_id')
info = self._request_info['execute'].get(msg_id)
if info and info.kind == 'prompt':
number = msg['content']['execution_count'] + 1
... | [
"Reimplemented",
"to",
"support",
"prompt",
"requests",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py#L166-L176 | [
"def",
"_handle_execute_reply",
"(",
"self",
",",
"msg",
")",
":",
"msg_id",
"=",
"msg",
"[",
"'parent_header'",
"]",
".",
"get",
"(",
"'msg_id'",
")",
"info",
"=",
"self",
".",
"_request_info",
"[",
"'execute'",
"]",
".",
"get",
"(",
"msg_id",
")",
"i... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | IPythonWidget._handle_history_reply | Implemented to handle history tail replies, which are only supported
by the IPython kernel. | environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py | def _handle_history_reply(self, msg):
""" Implemented to handle history tail replies, which are only supported
by the IPython kernel.
"""
content = msg['content']
if 'history' not in content:
self.log.error("History request failed: %r"%content)
if cont... | def _handle_history_reply(self, msg):
""" Implemented to handle history tail replies, which are only supported
by the IPython kernel.
"""
content = msg['content']
if 'history' not in content:
self.log.error("History request failed: %r"%content)
if cont... | [
"Implemented",
"to",
"handle",
"history",
"tail",
"replies",
"which",
"are",
"only",
"supported",
"by",
"the",
"IPython",
"kernel",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py#L178-L209 | [
"def",
"_handle_history_reply",
"(",
"self",
",",
"msg",
")",
":",
"content",
"=",
"msg",
"[",
"'content'",
"]",
"if",
"'history'",
"not",
"in",
"content",
":",
"self",
".",
"log",
".",
"error",
"(",
"\"History request failed: %r\"",
"%",
"content",
")",
"... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | IPythonWidget._handle_pyout | Reimplemented for IPython-style "display hook". | environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py | def _handle_pyout(self, msg):
""" Reimplemented for IPython-style "display hook".
"""
self.log.debug("pyout: %s", msg.get('content', ''))
if not self._hidden and self._is_from_this_session(msg):
content = msg['content']
prompt_number = content.get('execution_count... | def _handle_pyout(self, msg):
""" Reimplemented for IPython-style "display hook".
"""
self.log.debug("pyout: %s", msg.get('content', ''))
if not self._hidden and self._is_from_this_session(msg):
content = msg['content']
prompt_number = content.get('execution_count... | [
"Reimplemented",
"for",
"IPython",
"-",
"style",
"display",
"hook",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py#L211-L233 | [
"def",
"_handle_pyout",
"(",
"self",
",",
"msg",
")",
":",
"self",
".",
"log",
".",
"debug",
"(",
"\"pyout: %s\"",
",",
"msg",
".",
"get",
"(",
"'content'",
",",
"''",
")",
")",
"if",
"not",
"self",
".",
"_hidden",
"and",
"self",
".",
"_is_from_this_... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | IPythonWidget._handle_display_data | The base handler for the ``display_data`` message. | environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py | def _handle_display_data(self, msg):
""" The base handler for the ``display_data`` message.
"""
self.log.debug("display: %s", msg.get('content', ''))
# For now, we don't display data from other frontends, but we
# eventually will as this allows all frontends to monitor the displa... | def _handle_display_data(self, msg):
""" The base handler for the ``display_data`` message.
"""
self.log.debug("display: %s", msg.get('content', ''))
# For now, we don't display data from other frontends, but we
# eventually will as this allows all frontends to monitor the displa... | [
"The",
"base",
"handler",
"for",
"the",
"display_data",
"message",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py#L235-L255 | [
"def",
"_handle_display_data",
"(",
"self",
",",
"msg",
")",
":",
"self",
".",
"log",
".",
"debug",
"(",
"\"display: %s\"",
",",
"msg",
".",
"get",
"(",
"'content'",
",",
"''",
")",
")",
"# For now, we don't display data from other frontends, but we",
"# eventuall... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | IPythonWidget._started_channels | Reimplemented to make a history request and load %guiref. | environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py | def _started_channels(self):
"""Reimplemented to make a history request and load %guiref."""
super(IPythonWidget, self)._started_channels()
self._load_guiref_magic()
self.kernel_manager.shell_channel.history(hist_access_type='tail',
n=100... | def _started_channels(self):
"""Reimplemented to make a history request and load %guiref."""
super(IPythonWidget, self)._started_channels()
self._load_guiref_magic()
self.kernel_manager.shell_channel.history(hist_access_type='tail',
n=100... | [
"Reimplemented",
"to",
"make",
"a",
"history",
"request",
"and",
"load",
"%guiref",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py#L257-L262 | [
"def",
"_started_channels",
"(",
"self",
")",
":",
"super",
"(",
"IPythonWidget",
",",
"self",
")",
".",
"_started_channels",
"(",
")",
"self",
".",
"_load_guiref_magic",
"(",
")",
"self",
".",
"kernel_manager",
".",
"shell_channel",
".",
"history",
"(",
"hi... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | IPythonWidget.execute_file | Reimplemented to use the 'run' magic. | environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py | def execute_file(self, path, hidden=False):
""" Reimplemented to use the 'run' magic.
"""
# Use forward slashes on Windows to avoid escaping each separator.
if sys.platform == 'win32':
path = os.path.normpath(path).replace('\\', '/')
# Perhaps we should not be using ... | def execute_file(self, path, hidden=False):
""" Reimplemented to use the 'run' magic.
"""
# Use forward slashes on Windows to avoid escaping each separator.
if sys.platform == 'win32':
path = os.path.normpath(path).replace('\\', '/')
# Perhaps we should not be using ... | [
"Reimplemented",
"to",
"use",
"the",
"run",
"magic",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py#L287-L311 | [
"def",
"execute_file",
"(",
"self",
",",
"path",
",",
"hidden",
"=",
"False",
")",
":",
"# Use forward slashes on Windows to avoid escaping each separator.",
"if",
"sys",
".",
"platform",
"==",
"'win32'",
":",
"path",
"=",
"os",
".",
"path",
".",
"normpath",
"("... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | IPythonWidget._complete | Reimplemented to support IPython's improved completion machinery. | environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py | def _complete(self):
""" Reimplemented to support IPython's improved completion machinery.
"""
# We let the kernel split the input line, so we *always* send an empty
# text field. Readline-based frontends do get a real text field which
# they can use.
text = ''
#... | def _complete(self):
""" Reimplemented to support IPython's improved completion machinery.
"""
# We let the kernel split the input line, so we *always* send an empty
# text field. Readline-based frontends do get a real text field which
# they can use.
text = ''
#... | [
"Reimplemented",
"to",
"support",
"IPython",
"s",
"improved",
"completion",
"machinery",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py#L317-L333 | [
"def",
"_complete",
"(",
"self",
")",
":",
"# We let the kernel split the input line, so we *always* send an empty",
"# text field. Readline-based frontends do get a real text field which",
"# they can use.",
"text",
"=",
"''",
"# Send the completion request to the kernel",
"msg_id",
"="... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | IPythonWidget._process_execute_error | Reimplemented for IPython-style traceback formatting. | environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py | def _process_execute_error(self, msg):
""" Reimplemented for IPython-style traceback formatting.
"""
content = msg['content']
traceback = '\n'.join(content['traceback']) + '\n'
if False:
# FIXME: For now, tracebacks come as plain text, so we can't use
# th... | def _process_execute_error(self, msg):
""" Reimplemented for IPython-style traceback formatting.
"""
content = msg['content']
traceback = '\n'.join(content['traceback']) + '\n'
if False:
# FIXME: For now, tracebacks come as plain text, so we can't use
# th... | [
"Reimplemented",
"for",
"IPython",
"-",
"style",
"traceback",
"formatting",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py#L335-L354 | [
"def",
"_process_execute_error",
"(",
"self",
",",
"msg",
")",
":",
"content",
"=",
"msg",
"[",
"'content'",
"]",
"traceback",
"=",
"'\\n'",
".",
"join",
"(",
"content",
"[",
"'traceback'",
"]",
")",
"+",
"'\\n'",
"if",
"False",
":",
"# FIXME: For now, tra... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | IPythonWidget._process_execute_payload | Reimplemented to dispatch payloads to handler methods. | environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py | def _process_execute_payload(self, item):
""" Reimplemented to dispatch payloads to handler methods.
"""
handler = self._payload_handlers.get(item['source'])
if handler is None:
# We have no handler for this type of payload, simply ignore it
return False
e... | def _process_execute_payload(self, item):
""" Reimplemented to dispatch payloads to handler methods.
"""
handler = self._payload_handlers.get(item['source'])
if handler is None:
# We have no handler for this type of payload, simply ignore it
return False
e... | [
"Reimplemented",
"to",
"dispatch",
"payloads",
"to",
"handler",
"methods",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py#L356-L365 | [
"def",
"_process_execute_payload",
"(",
"self",
",",
"item",
")",
":",
"handler",
"=",
"self",
".",
"_payload_handlers",
".",
"get",
"(",
"item",
"[",
"'source'",
"]",
")",
"if",
"handler",
"is",
"None",
":",
"# We have no handler for this type of payload, simply ... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | IPythonWidget._show_interpreter_prompt | Reimplemented for IPython-style prompts. | environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py | def _show_interpreter_prompt(self, number=None):
""" Reimplemented for IPython-style prompts.
"""
# If a number was not specified, make a prompt number request.
if number is None:
msg_id = self.kernel_manager.shell_channel.execute('', silent=True)
info = self._Exe... | def _show_interpreter_prompt(self, number=None):
""" Reimplemented for IPython-style prompts.
"""
# If a number was not specified, make a prompt number request.
if number is None:
msg_id = self.kernel_manager.shell_channel.execute('', silent=True)
info = self._Exe... | [
"Reimplemented",
"for",
"IPython",
"-",
"style",
"prompts",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py#L367-L387 | [
"def",
"_show_interpreter_prompt",
"(",
"self",
",",
"number",
"=",
"None",
")",
":",
"# If a number was not specified, make a prompt number request.",
"if",
"number",
"is",
"None",
":",
"msg_id",
"=",
"self",
".",
"kernel_manager",
".",
"shell_channel",
".",
"execute... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | IPythonWidget._show_interpreter_prompt_for_reply | Reimplemented for IPython-style prompts. | environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py | def _show_interpreter_prompt_for_reply(self, msg):
""" Reimplemented for IPython-style prompts.
"""
# Update the old prompt number if necessary.
content = msg['content']
# abort replies do not have any keys:
if content['status'] == 'aborted':
if self._previous... | def _show_interpreter_prompt_for_reply(self, msg):
""" Reimplemented for IPython-style prompts.
"""
# Update the old prompt number if necessary.
content = msg['content']
# abort replies do not have any keys:
if content['status'] == 'aborted':
if self._previous... | [
"Reimplemented",
"for",
"IPython",
"-",
"style",
"prompts",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py#L389-L425 | [
"def",
"_show_interpreter_prompt_for_reply",
"(",
"self",
",",
"msg",
")",
":",
"# Update the old prompt number if necessary.",
"content",
"=",
"msg",
"[",
"'content'",
"]",
"# abort replies do not have any keys:",
"if",
"content",
"[",
"'status'",
"]",
"==",
"'aborted'",... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | IPythonWidget.set_default_style | Sets the widget style to the class defaults.
Parameters:
-----------
colors : str, optional (default lightbg)
Whether to use the default IPython light background or dark
background or B&W style. | environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py | def set_default_style(self, colors='lightbg'):
""" Sets the widget style to the class defaults.
Parameters:
-----------
colors : str, optional (default lightbg)
Whether to use the default IPython light background or dark
background or B&W style.
"""
... | def set_default_style(self, colors='lightbg'):
""" Sets the widget style to the class defaults.
Parameters:
-----------
colors : str, optional (default lightbg)
Whether to use the default IPython light background or dark
background or B&W style.
"""
... | [
"Sets",
"the",
"widget",
"style",
"to",
"the",
"class",
"defaults",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py#L431-L451 | [
"def",
"set_default_style",
"(",
"self",
",",
"colors",
"=",
"'lightbg'",
")",
":",
"colors",
"=",
"colors",
".",
"lower",
"(",
")",
"if",
"colors",
"==",
"'lightbg'",
":",
"self",
".",
"style_sheet",
"=",
"styles",
".",
"default_light_style_sheet",
"self",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | IPythonWidget._edit | Opens a Python script for editing.
Parameters:
-----------
filename : str
A path to a local system file.
line : int, optional
A line of interest in the file. | environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py | def _edit(self, filename, line=None):
""" Opens a Python script for editing.
Parameters:
-----------
filename : str
A path to a local system file.
line : int, optional
A line of interest in the file.
"""
if self.custom_edit:
s... | def _edit(self, filename, line=None):
""" Opens a Python script for editing.
Parameters:
-----------
filename : str
A path to a local system file.
line : int, optional
A line of interest in the file.
"""
if self.custom_edit:
s... | [
"Opens",
"a",
"Python",
"script",
"for",
"editing",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py#L457-L494 | [
"def",
"_edit",
"(",
"self",
",",
"filename",
",",
"line",
"=",
"None",
")",
":",
"if",
"self",
".",
"custom_edit",
":",
"self",
".",
"custom_edit_requested",
".",
"emit",
"(",
"filename",
",",
"line",
")",
"elif",
"not",
"self",
".",
"editor",
":",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | IPythonWidget._make_in_prompt | Given a prompt number, returns an HTML In prompt. | environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py | def _make_in_prompt(self, number):
""" Given a prompt number, returns an HTML In prompt.
"""
try:
body = self.in_prompt % number
except TypeError:
# allow in_prompt to leave out number, e.g. '>>> '
body = self.in_prompt
return '<span class="in-... | def _make_in_prompt(self, number):
""" Given a prompt number, returns an HTML In prompt.
"""
try:
body = self.in_prompt % number
except TypeError:
# allow in_prompt to leave out number, e.g. '>>> '
body = self.in_prompt
return '<span class="in-... | [
"Given",
"a",
"prompt",
"number",
"returns",
"an",
"HTML",
"In",
"prompt",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py#L496-L504 | [
"def",
"_make_in_prompt",
"(",
"self",
",",
"number",
")",
":",
"try",
":",
"body",
"=",
"self",
".",
"in_prompt",
"%",
"number",
"except",
"TypeError",
":",
"# allow in_prompt to leave out number, e.g. '>>> '",
"body",
"=",
"self",
".",
"in_prompt",
"return",
"... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | IPythonWidget._make_continuation_prompt | Given a plain text version of an In prompt, returns an HTML
continuation prompt. | environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py | def _make_continuation_prompt(self, prompt):
""" Given a plain text version of an In prompt, returns an HTML
continuation prompt.
"""
end_chars = '...: '
space_count = len(prompt.lstrip('\n')) - len(end_chars)
body = ' ' * space_count + end_chars
return '... | def _make_continuation_prompt(self, prompt):
""" Given a plain text version of an In prompt, returns an HTML
continuation prompt.
"""
end_chars = '...: '
space_count = len(prompt.lstrip('\n')) - len(end_chars)
body = ' ' * space_count + end_chars
return '... | [
"Given",
"a",
"plain",
"text",
"version",
"of",
"an",
"In",
"prompt",
"returns",
"an",
"HTML",
"continuation",
"prompt",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py#L506-L513 | [
"def",
"_make_continuation_prompt",
"(",
"self",
",",
"prompt",
")",
":",
"end_chars",
"=",
"'...: '",
"space_count",
"=",
"len",
"(",
"prompt",
".",
"lstrip",
"(",
"'\\n'",
")",
")",
"-",
"len",
"(",
"end_chars",
")",
"body",
"=",
"' '",
"*",
"spac... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | IPythonWidget._style_sheet_changed | Set the style sheets of the underlying widgets. | environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py | def _style_sheet_changed(self):
""" Set the style sheets of the underlying widgets.
"""
self.setStyleSheet(self.style_sheet)
if self._control is not None:
self._control.document().setDefaultStyleSheet(self.style_sheet)
bg_color = self._control.palette().window().c... | def _style_sheet_changed(self):
""" Set the style sheets of the underlying widgets.
"""
self.setStyleSheet(self.style_sheet)
if self._control is not None:
self._control.document().setDefaultStyleSheet(self.style_sheet)
bg_color = self._control.palette().window().c... | [
"Set",
"the",
"style",
"sheets",
"of",
"the",
"underlying",
"widgets",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py#L548-L558 | [
"def",
"_style_sheet_changed",
"(",
"self",
")",
":",
"self",
".",
"setStyleSheet",
"(",
"self",
".",
"style_sheet",
")",
"if",
"self",
".",
"_control",
"is",
"not",
"None",
":",
"self",
".",
"_control",
".",
"document",
"(",
")",
".",
"setDefaultStyleShee... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | IPythonWidget._syntax_style_changed | Set the style for the syntax highlighter. | environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py | def _syntax_style_changed(self):
""" Set the style for the syntax highlighter.
"""
if self._highlighter is None:
# ignore premature calls
return
if self.syntax_style:
self._highlighter.set_style(self.syntax_style)
else:
self._highli... | def _syntax_style_changed(self):
""" Set the style for the syntax highlighter.
"""
if self._highlighter is None:
# ignore premature calls
return
if self.syntax_style:
self._highlighter.set_style(self.syntax_style)
else:
self._highli... | [
"Set",
"the",
"style",
"for",
"the",
"syntax",
"highlighter",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py#L562-L571 | [
"def",
"_syntax_style_changed",
"(",
"self",
")",
":",
"if",
"self",
".",
"_highlighter",
"is",
"None",
":",
"# ignore premature calls",
"return",
"if",
"self",
".",
"syntax_style",
":",
"self",
".",
"_highlighter",
".",
"set_style",
"(",
"self",
".",
"syntax_... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | CloudStack.request | Async co-routine to perform requests to a CloudStackAPI. The parameters needs to include the command string,
which refers to the API to be called. In principle any available and future CloudStack API can be called. The
`**kwargs` magic allows us to all add supported parameters to the given API call. A l... | CloudStackAIO/CloudStack.py | async def request(self, command: str, **kwargs) -> dict:
"""
Async co-routine to perform requests to a CloudStackAPI. The parameters needs to include the command string,
which refers to the API to be called. In principle any available and future CloudStack API can be called. The
`**kwarg... | async def request(self, command: str, **kwargs) -> dict:
"""
Async co-routine to perform requests to a CloudStackAPI. The parameters needs to include the command string,
which refers to the API to be called. In principle any available and future CloudStack API can be called. The
`**kwarg... | [
"Async",
"co",
"-",
"routine",
"to",
"perform",
"requests",
"to",
"a",
"CloudStackAPI",
".",
"The",
"parameters",
"needs",
"to",
"include",
"the",
"command",
"string",
"which",
"refers",
"to",
"the",
"API",
"to",
"be",
"called",
".",
"In",
"principle",
"an... | giffels/CloudStackAIO | python | https://github.com/giffels/CloudStackAIO/blob/f9df856622eb8966a6816f8008cc16d75b0067e5/CloudStackAIO/CloudStack.py#L112-L155 | [
"async",
"def",
"request",
"(",
"self",
",",
"command",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"dict",
":",
"kwargs",
".",
"update",
"(",
"dict",
"(",
"apikey",
"=",
"self",
".",
"api_key",
",",
"command",
"=",
"command",
",",
"response",
... | f9df856622eb8966a6816f8008cc16d75b0067e5 |
test | CloudStack._handle_response | Handles the response returned from the CloudStack API. Some CloudStack API are implemented asynchronous, which
means that the API call returns just a job id. The actually expected API response is postponed and a specific
asyncJobResults API has to be polled using the job id to get the final result once ... | CloudStackAIO/CloudStack.py | async def _handle_response(self, response: aiohttp.client_reqrep.ClientResponse, await_final_result: bool) -> dict:
"""
Handles the response returned from the CloudStack API. Some CloudStack API are implemented asynchronous, which
means that the API call returns just a job id. The actually expec... | async def _handle_response(self, response: aiohttp.client_reqrep.ClientResponse, await_final_result: bool) -> dict:
"""
Handles the response returned from the CloudStack API. Some CloudStack API are implemented asynchronous, which
means that the API call returns just a job id. The actually expec... | [
"Handles",
"the",
"response",
"returned",
"from",
"the",
"CloudStack",
"API",
".",
"Some",
"CloudStack",
"API",
"are",
"implemented",
"asynchronous",
"which",
"means",
"that",
"the",
"API",
"call",
"returns",
"just",
"a",
"job",
"id",
".",
"The",
"actually",
... | giffels/CloudStackAIO | python | https://github.com/giffels/CloudStackAIO/blob/f9df856622eb8966a6816f8008cc16d75b0067e5/CloudStackAIO/CloudStack.py#L157-L201 | [
"async",
"def",
"_handle_response",
"(",
"self",
",",
"response",
":",
"aiohttp",
".",
"client_reqrep",
".",
"ClientResponse",
",",
"await_final_result",
":",
"bool",
")",
"->",
"dict",
":",
"try",
":",
"data",
"=",
"await",
"response",
".",
"json",
"(",
"... | f9df856622eb8966a6816f8008cc16d75b0067e5 |
test | CloudStack._sign | According to the CloudStack documentation, each request needs to be signed in order to authenticate the user
account executing the API command. The signature is generated using a combination of the api secret and a SHA-1
hash of the url parameters including the command string. In order to generate a uni... | CloudStackAIO/CloudStack.py | def _sign(self, url_parameters: dict) -> dict:
"""
According to the CloudStack documentation, each request needs to be signed in order to authenticate the user
account executing the API command. The signature is generated using a combination of the api secret and a SHA-1
hash of the url ... | def _sign(self, url_parameters: dict) -> dict:
"""
According to the CloudStack documentation, each request needs to be signed in order to authenticate the user
account executing the API command. The signature is generated using a combination of the api secret and a SHA-1
hash of the url ... | [
"According",
"to",
"the",
"CloudStack",
"documentation",
"each",
"request",
"needs",
"to",
"be",
"signed",
"in",
"order",
"to",
"authenticate",
"the",
"user",
"account",
"executing",
"the",
"API",
"command",
".",
"The",
"signature",
"is",
"generated",
"using",
... | giffels/CloudStackAIO | python | https://github.com/giffels/CloudStackAIO/blob/f9df856622eb8966a6816f8008cc16d75b0067e5/CloudStackAIO/CloudStack.py#L203-L220 | [
"def",
"_sign",
"(",
"self",
",",
"url_parameters",
":",
"dict",
")",
"->",
"dict",
":",
"if",
"url_parameters",
":",
"url_parameters",
".",
"pop",
"(",
"'signature'",
",",
"None",
")",
"# remove potential existing signature from url parameters",
"request_string",
"... | f9df856622eb8966a6816f8008cc16d75b0067e5 |
test | CloudStack._transform_data | Each CloudStack API call returns a nested dictionary structure. The first level contains only one key indicating
the API that originated the response. This function removes that first level from the data returned to the
caller.
:param data: Response of the API call
:type data: dict
... | CloudStackAIO/CloudStack.py | def _transform_data(data: dict) -> dict:
"""
Each CloudStack API call returns a nested dictionary structure. The first level contains only one key indicating
the API that originated the response. This function removes that first level from the data returned to the
caller.
:param... | def _transform_data(data: dict) -> dict:
"""
Each CloudStack API call returns a nested dictionary structure. The first level contains only one key indicating
the API that originated the response. This function removes that first level from the data returned to the
caller.
:param... | [
"Each",
"CloudStack",
"API",
"call",
"returns",
"a",
"nested",
"dictionary",
"structure",
".",
"The",
"first",
"level",
"contains",
"only",
"one",
"key",
"indicating",
"the",
"API",
"that",
"originated",
"the",
"response",
".",
"This",
"function",
"removes",
"... | giffels/CloudStackAIO | python | https://github.com/giffels/CloudStackAIO/blob/f9df856622eb8966a6816f8008cc16d75b0067e5/CloudStackAIO/CloudStack.py#L223-L238 | [
"def",
"_transform_data",
"(",
"data",
":",
"dict",
")",
"->",
"dict",
":",
"for",
"key",
"in",
"data",
".",
"keys",
"(",
")",
":",
"return_value",
"=",
"data",
"[",
"key",
"]",
"if",
"isinstance",
"(",
"return_value",
",",
"dict",
")",
":",
"return"... | f9df856622eb8966a6816f8008cc16d75b0067e5 |
test | virtual_memory | System virtual memory as a namedutple. | environment/lib/python2.7/site-packages/psutil/_psbsd.py | def virtual_memory():
"""System virtual memory as a namedutple."""
mem = _psutil_bsd.get_virtual_mem()
total, free, active, inactive, wired, cached, buffers, shared = mem
avail = inactive + cached + free
used = active + wired + cached
percent = usage_percent((total - avail), total, _round=1)
... | def virtual_memory():
"""System virtual memory as a namedutple."""
mem = _psutil_bsd.get_virtual_mem()
total, free, active, inactive, wired, cached, buffers, shared = mem
avail = inactive + cached + free
used = active + wired + cached
percent = usage_percent((total - avail), total, _round=1)
... | [
"System",
"virtual",
"memory",
"as",
"a",
"namedutple",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/psutil/_psbsd.py#L46-L54 | [
"def",
"virtual_memory",
"(",
")",
":",
"mem",
"=",
"_psutil_bsd",
".",
"get_virtual_mem",
"(",
")",
"total",
",",
"free",
",",
"active",
",",
"inactive",
",",
"wired",
",",
"cached",
",",
"buffers",
",",
"shared",
"=",
"mem",
"avail",
"=",
"inactive",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | swap_memory | System swap memory as (total, used, free, sin, sout) namedtuple. | environment/lib/python2.7/site-packages/psutil/_psbsd.py | def swap_memory():
"""System swap memory as (total, used, free, sin, sout) namedtuple."""
total, used, free, sin, sout = \
[x * _PAGESIZE for x in _psutil_bsd.get_swap_mem()]
percent = usage_percent(used, total, _round=1)
return nt_swapmeminfo(total, used, free, percent, sin, sout) | def swap_memory():
"""System swap memory as (total, used, free, sin, sout) namedtuple."""
total, used, free, sin, sout = \
[x * _PAGESIZE for x in _psutil_bsd.get_swap_mem()]
percent = usage_percent(used, total, _round=1)
return nt_swapmeminfo(total, used, free, percent, sin, sout) | [
"System",
"swap",
"memory",
"as",
"(",
"total",
"used",
"free",
"sin",
"sout",
")",
"namedtuple",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/psutil/_psbsd.py#L56-L61 | [
"def",
"swap_memory",
"(",
")",
":",
"total",
",",
"used",
",",
"free",
",",
"sin",
",",
"sout",
"=",
"[",
"x",
"*",
"_PAGESIZE",
"for",
"x",
"in",
"_psutil_bsd",
".",
"get_swap_mem",
"(",
")",
"]",
"percent",
"=",
"usage_percent",
"(",
"used",
",",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | get_system_cpu_times | Return system per-CPU times as a named tuple | environment/lib/python2.7/site-packages/psutil/_psbsd.py | def get_system_cpu_times():
"""Return system per-CPU times as a named tuple"""
user, nice, system, idle, irq = _psutil_bsd.get_system_cpu_times()
return _cputimes_ntuple(user, nice, system, idle, irq) | def get_system_cpu_times():
"""Return system per-CPU times as a named tuple"""
user, nice, system, idle, irq = _psutil_bsd.get_system_cpu_times()
return _cputimes_ntuple(user, nice, system, idle, irq) | [
"Return",
"system",
"per",
"-",
"CPU",
"times",
"as",
"a",
"named",
"tuple"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/psutil/_psbsd.py#L63-L66 | [
"def",
"get_system_cpu_times",
"(",
")",
":",
"user",
",",
"nice",
",",
"system",
",",
"idle",
",",
"irq",
"=",
"_psutil_bsd",
".",
"get_system_cpu_times",
"(",
")",
"return",
"_cputimes_ntuple",
"(",
"user",
",",
"nice",
",",
"system",
",",
"idle",
",",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | get_system_per_cpu_times | Return system CPU times as a named tuple | environment/lib/python2.7/site-packages/psutil/_psbsd.py | def get_system_per_cpu_times():
"""Return system CPU times as a named tuple"""
ret = []
for cpu_t in _psutil_bsd.get_system_per_cpu_times():
user, nice, system, idle, irq = cpu_t
item = _cputimes_ntuple(user, nice, system, idle, irq)
ret.append(item)
return ret | def get_system_per_cpu_times():
"""Return system CPU times as a named tuple"""
ret = []
for cpu_t in _psutil_bsd.get_system_per_cpu_times():
user, nice, system, idle, irq = cpu_t
item = _cputimes_ntuple(user, nice, system, idle, irq)
ret.append(item)
return ret | [
"Return",
"system",
"CPU",
"times",
"as",
"a",
"named",
"tuple"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/psutil/_psbsd.py#L68-L75 | [
"def",
"get_system_per_cpu_times",
"(",
")",
":",
"ret",
"=",
"[",
"]",
"for",
"cpu_t",
"in",
"_psutil_bsd",
".",
"get_system_per_cpu_times",
"(",
")",
":",
"user",
",",
"nice",
",",
"system",
",",
"idle",
",",
"irq",
"=",
"cpu_t",
"item",
"=",
"_cputime... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | Process.get_process_uids | Return real, effective and saved user ids. | environment/lib/python2.7/site-packages/psutil/_psbsd.py | def get_process_uids(self):
"""Return real, effective and saved user ids."""
real, effective, saved = _psutil_bsd.get_process_uids(self.pid)
return nt_uids(real, effective, saved) | def get_process_uids(self):
"""Return real, effective and saved user ids."""
real, effective, saved = _psutil_bsd.get_process_uids(self.pid)
return nt_uids(real, effective, saved) | [
"Return",
"real",
"effective",
"and",
"saved",
"user",
"ids",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/psutil/_psbsd.py#L202-L205 | [
"def",
"get_process_uids",
"(",
"self",
")",
":",
"real",
",",
"effective",
",",
"saved",
"=",
"_psutil_bsd",
".",
"get_process_uids",
"(",
"self",
".",
"pid",
")",
"return",
"nt_uids",
"(",
"real",
",",
"effective",
",",
"saved",
")"
] | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | Process.get_process_gids | Return real, effective and saved group ids. | environment/lib/python2.7/site-packages/psutil/_psbsd.py | def get_process_gids(self):
"""Return real, effective and saved group ids."""
real, effective, saved = _psutil_bsd.get_process_gids(self.pid)
return nt_gids(real, effective, saved) | def get_process_gids(self):
"""Return real, effective and saved group ids."""
real, effective, saved = _psutil_bsd.get_process_gids(self.pid)
return nt_gids(real, effective, saved) | [
"Return",
"real",
"effective",
"and",
"saved",
"group",
"ids",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/psutil/_psbsd.py#L208-L211 | [
"def",
"get_process_gids",
"(",
"self",
")",
":",
"real",
",",
"effective",
",",
"saved",
"=",
"_psutil_bsd",
".",
"get_process_gids",
"(",
"self",
".",
"pid",
")",
"return",
"nt_gids",
"(",
"real",
",",
"effective",
",",
"saved",
")"
] | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | Process.get_cpu_times | return a tuple containing process user/kernel time. | environment/lib/python2.7/site-packages/psutil/_psbsd.py | def get_cpu_times(self):
"""return a tuple containing process user/kernel time."""
user, system = _psutil_bsd.get_process_cpu_times(self.pid)
return nt_cputimes(user, system) | def get_cpu_times(self):
"""return a tuple containing process user/kernel time."""
user, system = _psutil_bsd.get_process_cpu_times(self.pid)
return nt_cputimes(user, system) | [
"return",
"a",
"tuple",
"containing",
"process",
"user",
"/",
"kernel",
"time",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/psutil/_psbsd.py#L214-L217 | [
"def",
"get_cpu_times",
"(",
"self",
")",
":",
"user",
",",
"system",
"=",
"_psutil_bsd",
".",
"get_process_cpu_times",
"(",
"self",
".",
"pid",
")",
"return",
"nt_cputimes",
"(",
"user",
",",
"system",
")"
] | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | Process.get_memory_info | Return a tuple with the process' RSS and VMS size. | environment/lib/python2.7/site-packages/psutil/_psbsd.py | def get_memory_info(self):
"""Return a tuple with the process' RSS and VMS size."""
rss, vms = _psutil_bsd.get_process_memory_info(self.pid)[:2]
return nt_meminfo(rss, vms) | def get_memory_info(self):
"""Return a tuple with the process' RSS and VMS size."""
rss, vms = _psutil_bsd.get_process_memory_info(self.pid)[:2]
return nt_meminfo(rss, vms) | [
"Return",
"a",
"tuple",
"with",
"the",
"process",
"RSS",
"and",
"VMS",
"size",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/psutil/_psbsd.py#L220-L223 | [
"def",
"get_memory_info",
"(",
"self",
")",
":",
"rss",
",",
"vms",
"=",
"_psutil_bsd",
".",
"get_process_memory_info",
"(",
"self",
".",
"pid",
")",
"[",
":",
"2",
"]",
"return",
"nt_meminfo",
"(",
"rss",
",",
"vms",
")"
] | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | Process.get_process_threads | Return the number of threads belonging to the process. | environment/lib/python2.7/site-packages/psutil/_psbsd.py | def get_process_threads(self):
"""Return the number of threads belonging to the process."""
rawlist = _psutil_bsd.get_process_threads(self.pid)
retlist = []
for thread_id, utime, stime in rawlist:
ntuple = nt_thread(thread_id, utime, stime)
retlist.append(ntuple)
... | def get_process_threads(self):
"""Return the number of threads belonging to the process."""
rawlist = _psutil_bsd.get_process_threads(self.pid)
retlist = []
for thread_id, utime, stime in rawlist:
ntuple = nt_thread(thread_id, utime, stime)
retlist.append(ntuple)
... | [
"Return",
"the",
"number",
"of",
"threads",
"belonging",
"to",
"the",
"process",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/psutil/_psbsd.py#L252-L259 | [
"def",
"get_process_threads",
"(",
"self",
")",
":",
"rawlist",
"=",
"_psutil_bsd",
".",
"get_process_threads",
"(",
"self",
".",
"pid",
")",
"retlist",
"=",
"[",
"]",
"for",
"thread_id",
",",
"utime",
",",
"stime",
"in",
"rawlist",
":",
"ntuple",
"=",
"... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | Process.get_open_files | Return files opened by process as a list of namedtuples. | environment/lib/python2.7/site-packages/psutil/_psbsd.py | def get_open_files(self):
"""Return files opened by process as a list of namedtuples."""
# XXX - C implementation available on FreeBSD >= 8 only
# else fallback on lsof parser
if hasattr(_psutil_bsd, "get_process_open_files"):
rawlist = _psutil_bsd.get_process_open_files(self... | def get_open_files(self):
"""Return files opened by process as a list of namedtuples."""
# XXX - C implementation available on FreeBSD >= 8 only
# else fallback on lsof parser
if hasattr(_psutil_bsd, "get_process_open_files"):
rawlist = _psutil_bsd.get_process_open_files(self... | [
"Return",
"files",
"opened",
"by",
"process",
"as",
"a",
"list",
"of",
"namedtuples",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/psutil/_psbsd.py#L262-L271 | [
"def",
"get_open_files",
"(",
"self",
")",
":",
"# XXX - C implementation available on FreeBSD >= 8 only",
"# else fallback on lsof parser",
"if",
"hasattr",
"(",
"_psutil_bsd",
",",
"\"get_process_open_files\"",
")",
":",
"rawlist",
"=",
"_psutil_bsd",
".",
"get_process_open... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | get_connection_file | Return the path to the connection file of an app
Parameters
----------
app : KernelApp instance [optional]
If unspecified, the currently running app will be used | environment/lib/python2.7/site-packages/IPython/lib/kernel.py | def get_connection_file(app=None):
"""Return the path to the connection file of an app
Parameters
----------
app : KernelApp instance [optional]
If unspecified, the currently running app will be used
"""
if app is None:
from IPython.zmq.ipkernel import IPKernelApp
if... | def get_connection_file(app=None):
"""Return the path to the connection file of an app
Parameters
----------
app : KernelApp instance [optional]
If unspecified, the currently running app will be used
"""
if app is None:
from IPython.zmq.ipkernel import IPKernelApp
if... | [
"Return",
"the",
"path",
"to",
"the",
"connection",
"file",
"of",
"an",
"app",
"Parameters",
"----------",
"app",
":",
"KernelApp",
"instance",
"[",
"optional",
"]",
"If",
"unspecified",
"the",
"currently",
"running",
"app",
"will",
"be",
"used"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/lib/kernel.py#L40-L54 | [
"def",
"get_connection_file",
"(",
"app",
"=",
"None",
")",
":",
"if",
"app",
"is",
"None",
":",
"from",
"IPython",
".",
"zmq",
".",
"ipkernel",
"import",
"IPKernelApp",
"if",
"not",
"IPKernelApp",
".",
"initialized",
"(",
")",
":",
"raise",
"RuntimeError"... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | find_connection_file | find a connection file, and return its absolute path.
The current working directory and the profile's security
directory will be searched for the file if it is not given by
absolute path.
If profile is unspecified, then the current running application's
profile will be used, or 'default', ... | environment/lib/python2.7/site-packages/IPython/lib/kernel.py | def find_connection_file(filename, profile=None):
"""find a connection file, and return its absolute path.
The current working directory and the profile's security
directory will be searched for the file if it is not given by
absolute path.
If profile is unspecified, then the current runni... | def find_connection_file(filename, profile=None):
"""find a connection file, and return its absolute path.
The current working directory and the profile's security
directory will be searched for the file if it is not given by
absolute path.
If profile is unspecified, then the current runni... | [
"find",
"a",
"connection",
"file",
"and",
"return",
"its",
"absolute",
"path",
".",
"The",
"current",
"working",
"directory",
"and",
"the",
"profile",
"s",
"security",
"directory",
"will",
"be",
"searched",
"for",
"the",
"file",
"if",
"it",
"is",
"not",
"g... | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/lib/kernel.py#L56-L123 | [
"def",
"find_connection_file",
"(",
"filename",
",",
"profile",
"=",
"None",
")",
":",
"from",
"IPython",
".",
"core",
".",
"application",
"import",
"BaseIPythonApplication",
"as",
"IPApp",
"try",
":",
"# quick check for absolute path, before going through logic",
"retu... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | get_connection_info | Return the connection information for the current Kernel.
Parameters
----------
connection_file : str [optional]
The connection file to be used. Can be given by absolute path, or
IPython will search in the security directory of a given profile.
If run from IPython,
... | environment/lib/python2.7/site-packages/IPython/lib/kernel.py | def get_connection_info(connection_file=None, unpack=False, profile=None):
"""Return the connection information for the current Kernel.
Parameters
----------
connection_file : str [optional]
The connection file to be used. Can be given by absolute path, or
IPython will search in the... | def get_connection_info(connection_file=None, unpack=False, profile=None):
"""Return the connection information for the current Kernel.
Parameters
----------
connection_file : str [optional]
The connection file to be used. Can be given by absolute path, or
IPython will search in the... | [
"Return",
"the",
"connection",
"information",
"for",
"the",
"current",
"Kernel",
".",
"Parameters",
"----------",
"connection_file",
":",
"str",
"[",
"optional",
"]",
"The",
"connection",
"file",
"to",
"be",
"used",
".",
"Can",
"be",
"given",
"by",
"absolute",... | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/lib/kernel.py#L125-L164 | [
"def",
"get_connection_info",
"(",
"connection_file",
"=",
"None",
",",
"unpack",
"=",
"False",
",",
"profile",
"=",
"None",
")",
":",
"if",
"connection_file",
"is",
"None",
":",
"# get connection file from current kernel",
"cf",
"=",
"get_connection_file",
"(",
"... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | connect_qtconsole | Connect a qtconsole to the current kernel.
This is useful for connecting a second qtconsole to a kernel, or to a
local notebook.
Parameters
----------
connection_file : str [optional]
The connection file to be used. Can be given by absolute path, or
IPython will search in t... | environment/lib/python2.7/site-packages/IPython/lib/kernel.py | def connect_qtconsole(connection_file=None, argv=None, profile=None):
"""Connect a qtconsole to the current kernel.
This is useful for connecting a second qtconsole to a kernel, or to a
local notebook.
Parameters
----------
connection_file : str [optional]
The connection file t... | def connect_qtconsole(connection_file=None, argv=None, profile=None):
"""Connect a qtconsole to the current kernel.
This is useful for connecting a second qtconsole to a kernel, or to a
local notebook.
Parameters
----------
connection_file : str [optional]
The connection file t... | [
"Connect",
"a",
"qtconsole",
"to",
"the",
"current",
"kernel",
".",
"This",
"is",
"useful",
"for",
"connecting",
"a",
"second",
"qtconsole",
"to",
"a",
"kernel",
"or",
"to",
"a",
"local",
"notebook",
".",
"Parameters",
"----------",
"connection_file",
":",
"... | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/lib/kernel.py#L166-L205 | [
"def",
"connect_qtconsole",
"(",
"connection_file",
"=",
"None",
",",
"argv",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"argv",
"=",
"[",
"]",
"if",
"argv",
"is",
"None",
"else",
"argv",
"if",
"connection_file",
"is",
"None",
":",
"# get connec... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | tunnel_to_kernel | tunnel connections to a kernel via ssh
This will open four SSH tunnels from localhost on this machine to the
ports associated with the kernel. They can be either direct
localhost-localhost tunnels, or if an intermediate server is necessary,
the kernel must be listening on a public IP.
Par... | environment/lib/python2.7/site-packages/IPython/lib/kernel.py | def tunnel_to_kernel(connection_info, sshserver, sshkey=None):
"""tunnel connections to a kernel via ssh
This will open four SSH tunnels from localhost on this machine to the
ports associated with the kernel. They can be either direct
localhost-localhost tunnels, or if an intermediate server is ne... | def tunnel_to_kernel(connection_info, sshserver, sshkey=None):
"""tunnel connections to a kernel via ssh
This will open four SSH tunnels from localhost on this machine to the
ports associated with the kernel. They can be either direct
localhost-localhost tunnels, or if an intermediate server is ne... | [
"tunnel",
"connections",
"to",
"a",
"kernel",
"via",
"ssh",
"This",
"will",
"open",
"four",
"SSH",
"tunnels",
"from",
"localhost",
"on",
"this",
"machine",
"to",
"the",
"ports",
"associated",
"with",
"the",
"kernel",
".",
"They",
"can",
"be",
"either",
"di... | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/lib/kernel.py#L207-L253 | [
"def",
"tunnel_to_kernel",
"(",
"connection_info",
",",
"sshserver",
",",
"sshkey",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"connection_info",
",",
"basestring",
")",
":",
"# it's a path, unpack it",
"with",
"open",
"(",
"connection_info",
")",
"as",
"f"... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | swallow_argv | strip frontend-specific aliases and flags from an argument list
For use primarily in frontend apps that want to pass a subset of command-line
arguments through to a subprocess, where frontend-specific flags and aliases
should be removed from the list.
Parameters
----------
argv : ... | environment/lib/python2.7/site-packages/IPython/lib/kernel.py | def swallow_argv(argv, aliases=None, flags=None):
"""strip frontend-specific aliases and flags from an argument list
For use primarily in frontend apps that want to pass a subset of command-line
arguments through to a subprocess, where frontend-specific flags and aliases
should be removed from the ... | def swallow_argv(argv, aliases=None, flags=None):
"""strip frontend-specific aliases and flags from an argument list
For use primarily in frontend apps that want to pass a subset of command-line
arguments through to a subprocess, where frontend-specific flags and aliases
should be removed from the ... | [
"strip",
"frontend",
"-",
"specific",
"aliases",
"and",
"flags",
"from",
"an",
"argument",
"list",
"For",
"use",
"primarily",
"in",
"frontend",
"apps",
"that",
"want",
"to",
"pass",
"a",
"subset",
"of",
"command",
"-",
"line",
"arguments",
"through",
"to",
... | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/lib/kernel.py#L256-L314 | [
"def",
"swallow_argv",
"(",
"argv",
",",
"aliases",
"=",
"None",
",",
"flags",
"=",
"None",
")",
":",
"if",
"aliases",
"is",
"None",
":",
"aliases",
"=",
"set",
"(",
")",
"if",
"flags",
"is",
"None",
":",
"flags",
"=",
"set",
"(",
")",
"stripped",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | pkg_commit_hash | Get short form of commit hash given directory `pkg_path`
We get the commit hash from (in order of preference):
* IPython.utils._sysinfo.commit
* git output, if we are in a git repository
If these fail, we return a not-found placeholder tuple
Parameters
----------
pkg_path : str
di... | environment/lib/python2.7/site-packages/IPython/utils/sysinfo.py | def pkg_commit_hash(pkg_path):
"""Get short form of commit hash given directory `pkg_path`
We get the commit hash from (in order of preference):
* IPython.utils._sysinfo.commit
* git output, if we are in a git repository
If these fail, we return a not-found placeholder tuple
Parameters
-... | def pkg_commit_hash(pkg_path):
"""Get short form of commit hash given directory `pkg_path`
We get the commit hash from (in order of preference):
* IPython.utils._sysinfo.commit
* git output, if we are in a git repository
If these fail, we return a not-found placeholder tuple
Parameters
-... | [
"Get",
"short",
"form",
"of",
"commit",
"hash",
"given",
"directory",
"pkg_path"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/sysinfo.py#L32-L67 | [
"def",
"pkg_commit_hash",
"(",
"pkg_path",
")",
":",
"# Try and get commit from written commit text file",
"if",
"_sysinfo",
".",
"commit",
":",
"return",
"\"installation\"",
",",
"_sysinfo",
".",
"commit",
"# maybe we are in a repository",
"proc",
"=",
"subprocess",
".",... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | pkg_info | Return dict describing the context of this package
Parameters
----------
pkg_path : str
path containing __init__.py for package
Returns
-------
context : dict
with named parameters of interest | environment/lib/python2.7/site-packages/IPython/utils/sysinfo.py | def pkg_info(pkg_path):
"""Return dict describing the context of this package
Parameters
----------
pkg_path : str
path containing __init__.py for package
Returns
-------
context : dict
with named parameters of interest
"""
src, hsh = pkg_commit_hash(pkg_path)
ret... | def pkg_info(pkg_path):
"""Return dict describing the context of this package
Parameters
----------
pkg_path : str
path containing __init__.py for package
Returns
-------
context : dict
with named parameters of interest
"""
src, hsh = pkg_commit_hash(pkg_path)
ret... | [
"Return",
"dict",
"describing",
"the",
"context",
"of",
"this",
"package"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/sysinfo.py#L70-L95 | [
"def",
"pkg_info",
"(",
"pkg_path",
")",
":",
"src",
",",
"hsh",
"=",
"pkg_commit_hash",
"(",
"pkg_path",
")",
"return",
"dict",
"(",
"ipython_version",
"=",
"release",
".",
"version",
",",
"ipython_path",
"=",
"pkg_path",
",",
"commit_source",
"=",
"src",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | sys_info | Return useful information about IPython and the system, as a string.
Example
-------
In [2]: print sys_info()
{'commit_hash': '144fdae', # random
'commit_source': 'repository',
'ipython_path': '/home/fperez/usr/lib/python2.6/site-packages/IPython',
'ipython_version': '0.11.dev',
... | environment/lib/python2.7/site-packages/IPython/utils/sysinfo.py | def sys_info():
"""Return useful information about IPython and the system, as a string.
Example
-------
In [2]: print sys_info()
{'commit_hash': '144fdae', # random
'commit_source': 'repository',
'ipython_path': '/home/fperez/usr/lib/python2.6/site-packages/IPython',
'ipython_ve... | def sys_info():
"""Return useful information about IPython and the system, as a string.
Example
-------
In [2]: print sys_info()
{'commit_hash': '144fdae', # random
'commit_source': 'repository',
'ipython_path': '/home/fperez/usr/lib/python2.6/site-packages/IPython',
'ipython_ve... | [
"Return",
"useful",
"information",
"about",
"IPython",
"and",
"the",
"system",
"as",
"a",
"string",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/sysinfo.py#L99-L117 | [
"def",
"sys_info",
"(",
")",
":",
"p",
"=",
"os",
".",
"path",
"path",
"=",
"p",
".",
"dirname",
"(",
"p",
".",
"abspath",
"(",
"p",
".",
"join",
"(",
"__file__",
",",
"'..'",
")",
")",
")",
"return",
"pprint",
".",
"pformat",
"(",
"pkg_info",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | _num_cpus_darwin | Return the number of active CPUs on a Darwin system. | environment/lib/python2.7/site-packages/IPython/utils/sysinfo.py | def _num_cpus_darwin():
"""Return the number of active CPUs on a Darwin system."""
p = subprocess.Popen(['sysctl','-n','hw.ncpu'],stdout=subprocess.PIPE)
return p.stdout.read() | def _num_cpus_darwin():
"""Return the number of active CPUs on a Darwin system."""
p = subprocess.Popen(['sysctl','-n','hw.ncpu'],stdout=subprocess.PIPE)
return p.stdout.read() | [
"Return",
"the",
"number",
"of",
"active",
"CPUs",
"on",
"a",
"Darwin",
"system",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/sysinfo.py#L125-L128 | [
"def",
"_num_cpus_darwin",
"(",
")",
":",
"p",
"=",
"subprocess",
".",
"Popen",
"(",
"[",
"'sysctl'",
",",
"'-n'",
",",
"'hw.ncpu'",
"]",
",",
"stdout",
"=",
"subprocess",
".",
"PIPE",
")",
"return",
"p",
".",
"stdout",
".",
"read",
"(",
")"
] | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | num_cpus | Return the effective number of CPUs in the system as an integer.
This cross-platform function makes an attempt at finding the total number of
available CPUs in the system, as returned by various underlying system and
python calls.
If it can't find a sensible answer, it returns 1 (though an error *may* mak... | environment/lib/python2.7/site-packages/IPython/utils/sysinfo.py | def num_cpus():
"""Return the effective number of CPUs in the system as an integer.
This cross-platform function makes an attempt at finding the total number of
available CPUs in the system, as returned by various underlying system and
python calls.
If it can't find a sensible answer, it returns 1 (tho... | def num_cpus():
"""Return the effective number of CPUs in the system as an integer.
This cross-platform function makes an attempt at finding the total number of
available CPUs in the system, as returned by various underlying system and
python calls.
If it can't find a sensible answer, it returns 1 (tho... | [
"Return",
"the",
"effective",
"number",
"of",
"CPUs",
"in",
"the",
"system",
"as",
"an",
"integer",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/sysinfo.py#L136-L167 | [
"def",
"num_cpus",
"(",
")",
":",
"# Many thanks to the Parallel Python project (http://www.parallelpython.com)",
"# for the names of the keys we needed to look up for this function. This",
"# code was inspired by their equivalent function.",
"ncpufuncs",
"=",
"{",
"'Linux'",
":",
"_num_c... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | Command.handle | [1, 2, 3, 4] {'accumulate': <built-in function max>} | example/management/commands/positional.py | def handle(self, integers, **options):
"""
[1, 2, 3, 4] {'accumulate': <built-in function max>}
"""
print integers, options
return super(Command, self).handle(integers, **options) | def handle(self, integers, **options):
"""
[1, 2, 3, 4] {'accumulate': <built-in function max>}
"""
print integers, options
return super(Command, self).handle(integers, **options) | [
"[",
"1",
"2",
"3",
"4",
"]",
"{",
"accumulate",
":",
"<built",
"-",
"in",
"function",
"max",
">",
"}"
] | allanlei/django-argparse-command | python | https://github.com/allanlei/django-argparse-command/blob/27ea77e1dd0cf2f0567223735762a5ebd14fdaef/example/management/commands/positional.py#L13-L18 | [
"def",
"handle",
"(",
"self",
",",
"integers",
",",
"*",
"*",
"options",
")",
":",
"print",
"integers",
",",
"options",
"return",
"super",
"(",
"Command",
",",
"self",
")",
".",
"handle",
"(",
"integers",
",",
"*",
"*",
"options",
")"
] | 27ea77e1dd0cf2f0567223735762a5ebd14fdaef |
test | BaseCursor.nextset | Advance to the next result set.
Returns None if there are no more result sets. | environment/lib/python2.7/site-packages/MySQL_python-1.2.4c1-py2.7-linux-x86_64.egg/MySQLdb/cursors.py | def nextset(self):
"""Advance to the next result set.
Returns None if there are no more result sets.
"""
if self._executed:
self.fetchall()
del self.messages[:]
db = self._get_db()
nr = db.next_result()
if nr == -1:
return... | def nextset(self):
"""Advance to the next result set.
Returns None if there are no more result sets.
"""
if self._executed:
self.fetchall()
del self.messages[:]
db = self._get_db()
nr = db.next_result()
if nr == -1:
return... | [
"Advance",
"to",
"the",
"next",
"result",
"set",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/MySQL_python-1.2.4c1-py2.7-linux-x86_64.egg/MySQLdb/cursors.py#L122-L138 | [
"def",
"nextset",
"(",
"self",
")",
":",
"if",
"self",
".",
"_executed",
":",
"self",
".",
"fetchall",
"(",
")",
"del",
"self",
".",
"messages",
"[",
":",
"]",
"db",
"=",
"self",
".",
"_get_db",
"(",
")",
"nr",
"=",
"db",
".",
"next_result",
"(",... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | BaseCursor.execute | Execute a query.
query -- string, query to execute on server
args -- optional sequence or mapping, parameters to use with query.
Note: If args is a sequence, then %s must be used as the
parameter placeholder in the query. If a mapping is used,
%(key)s must be used as th... | environment/lib/python2.7/site-packages/MySQL_python-1.2.4c1-py2.7-linux-x86_64.egg/MySQLdb/cursors.py | def execute(self, query, args=None):
"""Execute a query.
query -- string, query to execute on server
args -- optional sequence or mapping, parameters to use with query.
Note: If args is a sequence, then %s must be used as the
parameter placeholder in the query. If a ma... | def execute(self, query, args=None):
"""Execute a query.
query -- string, query to execute on server
args -- optional sequence or mapping, parameters to use with query.
Note: If args is a sequence, then %s must be used as the
parameter placeholder in the query. If a ma... | [
"Execute",
"a",
"query",
".",
"query",
"--",
"string",
"query",
"to",
"execute",
"on",
"server",
"args",
"--",
"optional",
"sequence",
"or",
"mapping",
"parameters",
"to",
"use",
"with",
"query",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/MySQL_python-1.2.4c1-py2.7-linux-x86_64.egg/MySQLdb/cursors.py#L164-L204 | [
"def",
"execute",
"(",
"self",
",",
"query",
",",
"args",
"=",
"None",
")",
":",
"del",
"self",
".",
"messages",
"[",
":",
"]",
"db",
"=",
"self",
".",
"_get_db",
"(",
")",
"if",
"isinstance",
"(",
"query",
",",
"unicode",
")",
":",
"query",
"=",... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | BaseCursor.executemany | Execute a multi-row query.
query -- string, query to execute on server
args
Sequence of sequences or mappings, parameters to use with
query.
Returns long integer rows affected, if any.
This method improves performance on multiple-r... | environment/lib/python2.7/site-packages/MySQL_python-1.2.4c1-py2.7-linux-x86_64.egg/MySQLdb/cursors.py | def executemany(self, query, args):
"""Execute a multi-row query.
query -- string, query to execute on server
args
Sequence of sequences or mappings, parameters to use with
query.
Returns long integer rows affected, if any.
... | def executemany(self, query, args):
"""Execute a multi-row query.
query -- string, query to execute on server
args
Sequence of sequences or mappings, parameters to use with
query.
Returns long integer rows affected, if any.
... | [
"Execute",
"a",
"multi",
"-",
"row",
"query",
".",
"query",
"--",
"string",
"query",
"to",
"execute",
"on",
"server"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/MySQL_python-1.2.4c1-py2.7-linux-x86_64.egg/MySQLdb/cursors.py#L206-L254 | [
"def",
"executemany",
"(",
"self",
",",
"query",
",",
"args",
")",
":",
"del",
"self",
".",
"messages",
"[",
":",
"]",
"db",
"=",
"self",
".",
"_get_db",
"(",
")",
"if",
"not",
"args",
":",
"return",
"if",
"isinstance",
"(",
"query",
",",
"unicode"... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | BaseCursor.callproc | Execute stored procedure procname with args
procname -- string, name of procedure to execute on server
args -- Sequence of parameters to use with procedure
Returns the original args.
Compatibility warning: PEP-249 specifies that any modified
parameters must be returne... | environment/lib/python2.7/site-packages/MySQL_python-1.2.4c1-py2.7-linux-x86_64.egg/MySQLdb/cursors.py | def callproc(self, procname, args=()):
"""Execute stored procedure procname with args
procname -- string, name of procedure to execute on server
args -- Sequence of parameters to use with procedure
Returns the original args.
Compatibility warning: PEP-249 specifies t... | def callproc(self, procname, args=()):
"""Execute stored procedure procname with args
procname -- string, name of procedure to execute on server
args -- Sequence of parameters to use with procedure
Returns the original args.
Compatibility warning: PEP-249 specifies t... | [
"Execute",
"stored",
"procedure",
"procname",
"with",
"args",
"procname",
"--",
"string",
"name",
"of",
"procedure",
"to",
"execute",
"on",
"server"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/MySQL_python-1.2.4c1-py2.7-linux-x86_64.egg/MySQLdb/cursors.py#L256-L303 | [
"def",
"callproc",
"(",
"self",
",",
"procname",
",",
"args",
"=",
"(",
")",
")",
":",
"db",
"=",
"self",
".",
"_get_db",
"(",
")",
"for",
"index",
",",
"arg",
"in",
"enumerate",
"(",
"args",
")",
":",
"q",
"=",
"\"SET @_%s_%d=%s\"",
"%",
"(",
"p... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | CursorUseResultMixIn.fetchone | Fetches a single row from the cursor. | environment/lib/python2.7/site-packages/MySQL_python-1.2.4c1-py2.7-linux-x86_64.egg/MySQLdb/cursors.py | def fetchone(self):
"""Fetches a single row from the cursor."""
self._check_executed()
r = self._fetch_row(1)
if not r:
self._warning_check()
return None
self.rownumber = self.rownumber + 1
return r[0] | def fetchone(self):
"""Fetches a single row from the cursor."""
self._check_executed()
r = self._fetch_row(1)
if not r:
self._warning_check()
return None
self.rownumber = self.rownumber + 1
return r[0] | [
"Fetches",
"a",
"single",
"row",
"from",
"the",
"cursor",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/MySQL_python-1.2.4c1-py2.7-linux-x86_64.egg/MySQLdb/cursors.py#L417-L425 | [
"def",
"fetchone",
"(",
"self",
")",
":",
"self",
".",
"_check_executed",
"(",
")",
"r",
"=",
"self",
".",
"_fetch_row",
"(",
"1",
")",
"if",
"not",
"r",
":",
"self",
".",
"_warning_check",
"(",
")",
"return",
"None",
"self",
".",
"rownumber",
"=",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | CursorUseResultMixIn.fetchmany | Fetch up to size rows from the cursor. Result set may be smaller
than size. If size is not defined, cursor.arraysize is used. | environment/lib/python2.7/site-packages/MySQL_python-1.2.4c1-py2.7-linux-x86_64.egg/MySQLdb/cursors.py | def fetchmany(self, size=None):
"""Fetch up to size rows from the cursor. Result set may be smaller
than size. If size is not defined, cursor.arraysize is used."""
self._check_executed()
r = self._fetch_row(size or self.arraysize)
self.rownumber = self.rownumber + len(r)
... | def fetchmany(self, size=None):
"""Fetch up to size rows from the cursor. Result set may be smaller
than size. If size is not defined, cursor.arraysize is used."""
self._check_executed()
r = self._fetch_row(size or self.arraysize)
self.rownumber = self.rownumber + len(r)
... | [
"Fetch",
"up",
"to",
"size",
"rows",
"from",
"the",
"cursor",
".",
"Result",
"set",
"may",
"be",
"smaller",
"than",
"size",
".",
"If",
"size",
"is",
"not",
"defined",
"cursor",
".",
"arraysize",
"is",
"used",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/MySQL_python-1.2.4c1-py2.7-linux-x86_64.egg/MySQLdb/cursors.py#L427-L435 | [
"def",
"fetchmany",
"(",
"self",
",",
"size",
"=",
"None",
")",
":",
"self",
".",
"_check_executed",
"(",
")",
"r",
"=",
"self",
".",
"_fetch_row",
"(",
"size",
"or",
"self",
".",
"arraysize",
")",
"self",
".",
"rownumber",
"=",
"self",
".",
"rownumb... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | CursorUseResultMixIn.fetchall | Fetchs all available rows from the cursor. | environment/lib/python2.7/site-packages/MySQL_python-1.2.4c1-py2.7-linux-x86_64.egg/MySQLdb/cursors.py | def fetchall(self):
"""Fetchs all available rows from the cursor."""
self._check_executed()
r = self._fetch_row(0)
self.rownumber = self.rownumber + len(r)
self._warning_check()
return r | def fetchall(self):
"""Fetchs all available rows from the cursor."""
self._check_executed()
r = self._fetch_row(0)
self.rownumber = self.rownumber + len(r)
self._warning_check()
return r | [
"Fetchs",
"all",
"available",
"rows",
"from",
"the",
"cursor",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/MySQL_python-1.2.4c1-py2.7-linux-x86_64.egg/MySQLdb/cursors.py#L437-L443 | [
"def",
"fetchall",
"(",
"self",
")",
":",
"self",
".",
"_check_executed",
"(",
")",
"r",
"=",
"self",
".",
"_fetch_row",
"(",
"0",
")",
"self",
".",
"rownumber",
"=",
"self",
".",
"rownumber",
"+",
"len",
"(",
"r",
")",
"self",
".",
"_warning_check",... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | CursorDictRowsMixIn.fetchmanyDict | Fetch several rows as a list of dictionaries. Deprecated:
Use fetchmany() instead. Will be removed in 1.3. | environment/lib/python2.7/site-packages/MySQL_python-1.2.4c1-py2.7-linux-x86_64.egg/MySQLdb/cursors.py | def fetchmanyDict(self, size=None):
"""Fetch several rows as a list of dictionaries. Deprecated:
Use fetchmany() instead. Will be removed in 1.3."""
from warnings import warn
warn("fetchmanyDict() is non-standard and will be removed in 1.3",
DeprecationWarning, 2)
re... | def fetchmanyDict(self, size=None):
"""Fetch several rows as a list of dictionaries. Deprecated:
Use fetchmany() instead. Will be removed in 1.3."""
from warnings import warn
warn("fetchmanyDict() is non-standard and will be removed in 1.3",
DeprecationWarning, 2)
re... | [
"Fetch",
"several",
"rows",
"as",
"a",
"list",
"of",
"dictionaries",
".",
"Deprecated",
":",
"Use",
"fetchmany",
"()",
"instead",
".",
"Will",
"be",
"removed",
"in",
"1",
".",
"3",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/MySQL_python-1.2.4c1-py2.7-linux-x86_64.egg/MySQLdb/cursors.py#L478-L484 | [
"def",
"fetchmanyDict",
"(",
"self",
",",
"size",
"=",
"None",
")",
":",
"from",
"warnings",
"import",
"warn",
"warn",
"(",
"\"fetchmanyDict() is non-standard and will be removed in 1.3\"",
",",
"DeprecationWarning",
",",
"2",
")",
"return",
"self",
".",
"fetchmany"... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | connect | this function will be called on the engines | environment/share/doc/ipython/examples/parallel/interengine/bintree_script.py | def connect(com, peers, tree, pub_url, root_id):
"""this function will be called on the engines"""
com.connect(peers, tree, pub_url, root_id) | def connect(com, peers, tree, pub_url, root_id):
"""this function will be called on the engines"""
com.connect(peers, tree, pub_url, root_id) | [
"this",
"function",
"will",
"be",
"called",
"on",
"the",
"engines"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/share/doc/ipython/examples/parallel/interengine/bintree_script.py#L56-L58 | [
"def",
"connect",
"(",
"com",
",",
"peers",
",",
"tree",
",",
"pub_url",
",",
"root_id",
")",
":",
"com",
".",
"connect",
"(",
"peers",
",",
"tree",
",",
"pub_url",
",",
"root_id",
")"
] | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | parse_json | Parse a string into a (nbformat, dict) tuple. | environment/lib/python2.7/site-packages/IPython/nbformat/current.py | def parse_json(s, **kwargs):
"""Parse a string into a (nbformat, dict) tuple."""
d = json.loads(s, **kwargs)
nbf = d.get('nbformat', 1)
nbm = d.get('nbformat_minor', 0)
return nbf, nbm, d | def parse_json(s, **kwargs):
"""Parse a string into a (nbformat, dict) tuple."""
d = json.loads(s, **kwargs)
nbf = d.get('nbformat', 1)
nbm = d.get('nbformat_minor', 0)
return nbf, nbm, d | [
"Parse",
"a",
"string",
"into",
"a",
"(",
"nbformat",
"dict",
")",
"tuple",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/nbformat/current.py#L48-L53 | [
"def",
"parse_json",
"(",
"s",
",",
"*",
"*",
"kwargs",
")",
":",
"d",
"=",
"json",
".",
"loads",
"(",
"s",
",",
"*",
"*",
"kwargs",
")",
"nbf",
"=",
"d",
".",
"get",
"(",
"'nbformat'",
",",
"1",
")",
"nbm",
"=",
"d",
".",
"get",
"(",
"'nbf... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | parse_py | Parse a string into a (nbformat, string) tuple. | environment/lib/python2.7/site-packages/IPython/nbformat/current.py | def parse_py(s, **kwargs):
"""Parse a string into a (nbformat, string) tuple."""
nbf = current_nbformat
nbm = current_nbformat_minor
pattern = r'# <nbformat>(?P<nbformat>\d+[\.\d+]*)</nbformat>'
m = re.search(pattern,s)
if m is not None:
digits = m.group('nbformat').split('.')
... | def parse_py(s, **kwargs):
"""Parse a string into a (nbformat, string) tuple."""
nbf = current_nbformat
nbm = current_nbformat_minor
pattern = r'# <nbformat>(?P<nbformat>\d+[\.\d+]*)</nbformat>'
m = re.search(pattern,s)
if m is not None:
digits = m.group('nbformat').split('.')
... | [
"Parse",
"a",
"string",
"into",
"a",
"(",
"nbformat",
"string",
")",
"tuple",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/nbformat/current.py#L56-L69 | [
"def",
"parse_py",
"(",
"s",
",",
"*",
"*",
"kwargs",
")",
":",
"nbf",
"=",
"current_nbformat",
"nbm",
"=",
"current_nbformat_minor",
"pattern",
"=",
"r'# <nbformat>(?P<nbformat>\\d+[\\.\\d+]*)</nbformat>'",
"m",
"=",
"re",
".",
"search",
"(",
"pattern",
",",
"s... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | reads_json | Read a JSON notebook from a string and return the NotebookNode object. | environment/lib/python2.7/site-packages/IPython/nbformat/current.py | def reads_json(s, **kwargs):
"""Read a JSON notebook from a string and return the NotebookNode object."""
nbf, minor, d = parse_json(s, **kwargs)
if nbf == 1:
nb = v1.to_notebook_json(d, **kwargs)
nb = v3.convert_to_this_nbformat(nb, orig_version=1)
elif nbf == 2:
nb = v2.to_note... | def reads_json(s, **kwargs):
"""Read a JSON notebook from a string and return the NotebookNode object."""
nbf, minor, d = parse_json(s, **kwargs)
if nbf == 1:
nb = v1.to_notebook_json(d, **kwargs)
nb = v3.convert_to_this_nbformat(nb, orig_version=1)
elif nbf == 2:
nb = v2.to_note... | [
"Read",
"a",
"JSON",
"notebook",
"from",
"a",
"string",
"and",
"return",
"the",
"NotebookNode",
"object",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/nbformat/current.py#L72-L86 | [
"def",
"reads_json",
"(",
"s",
",",
"*",
"*",
"kwargs",
")",
":",
"nbf",
",",
"minor",
",",
"d",
"=",
"parse_json",
"(",
"s",
",",
"*",
"*",
"kwargs",
")",
"if",
"nbf",
"==",
"1",
":",
"nb",
"=",
"v1",
".",
"to_notebook_json",
"(",
"d",
",",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | reads_py | Read a .py notebook from a string and return the NotebookNode object. | environment/lib/python2.7/site-packages/IPython/nbformat/current.py | def reads_py(s, **kwargs):
"""Read a .py notebook from a string and return the NotebookNode object."""
nbf, nbm, s = parse_py(s, **kwargs)
if nbf == 2:
nb = v2.to_notebook_py(s, **kwargs)
elif nbf == 3:
nb = v3.to_notebook_py(s, **kwargs)
else:
raise NBFormatError('Unsupporte... | def reads_py(s, **kwargs):
"""Read a .py notebook from a string and return the NotebookNode object."""
nbf, nbm, s = parse_py(s, **kwargs)
if nbf == 2:
nb = v2.to_notebook_py(s, **kwargs)
elif nbf == 3:
nb = v3.to_notebook_py(s, **kwargs)
else:
raise NBFormatError('Unsupporte... | [
"Read",
"a",
".",
"py",
"notebook",
"from",
"a",
"string",
"and",
"return",
"the",
"NotebookNode",
"object",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/nbformat/current.py#L93-L102 | [
"def",
"reads_py",
"(",
"s",
",",
"*",
"*",
"kwargs",
")",
":",
"nbf",
",",
"nbm",
",",
"s",
"=",
"parse_py",
"(",
"s",
",",
"*",
"*",
"kwargs",
")",
"if",
"nbf",
"==",
"2",
":",
"nb",
"=",
"v2",
".",
"to_notebook_py",
"(",
"s",
",",
"*",
"... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | reads | Read a notebook from a string and return the NotebookNode object.
This function properly handles notebooks of any version. The notebook
returned will always be in the current version's format.
Parameters
----------
s : unicode
The raw unicode string to read the notebook from.
format : ... | environment/lib/python2.7/site-packages/IPython/nbformat/current.py | def reads(s, format, **kwargs):
"""Read a notebook from a string and return the NotebookNode object.
This function properly handles notebooks of any version. The notebook
returned will always be in the current version's format.
Parameters
----------
s : unicode
The raw unicode string t... | def reads(s, format, **kwargs):
"""Read a notebook from a string and return the NotebookNode object.
This function properly handles notebooks of any version. The notebook
returned will always be in the current version's format.
Parameters
----------
s : unicode
The raw unicode string t... | [
"Read",
"a",
"notebook",
"from",
"a",
"string",
"and",
"return",
"the",
"NotebookNode",
"object",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/nbformat/current.py#L112-L136 | [
"def",
"reads",
"(",
"s",
",",
"format",
",",
"*",
"*",
"kwargs",
")",
":",
"format",
"=",
"unicode",
"(",
"format",
")",
"if",
"format",
"==",
"u'json'",
"or",
"format",
"==",
"u'ipynb'",
":",
"return",
"reads_json",
"(",
"s",
",",
"*",
"*",
"kwar... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | writes | Write a notebook to a string in a given format in the current nbformat version.
This function always writes the notebook in the current nbformat version.
Parameters
----------
nb : NotebookNode
The notebook to write.
format : (u'json', u'ipynb', u'py')
The format to write the noteb... | environment/lib/python2.7/site-packages/IPython/nbformat/current.py | def writes(nb, format, **kwargs):
"""Write a notebook to a string in a given format in the current nbformat version.
This function always writes the notebook in the current nbformat version.
Parameters
----------
nb : NotebookNode
The notebook to write.
format : (u'json', u'ipynb', u'p... | def writes(nb, format, **kwargs):
"""Write a notebook to a string in a given format in the current nbformat version.
This function always writes the notebook in the current nbformat version.
Parameters
----------
nb : NotebookNode
The notebook to write.
format : (u'json', u'ipynb', u'p... | [
"Write",
"a",
"notebook",
"to",
"a",
"string",
"in",
"a",
"given",
"format",
"in",
"the",
"current",
"nbformat",
"version",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/nbformat/current.py#L139-L162 | [
"def",
"writes",
"(",
"nb",
",",
"format",
",",
"*",
"*",
"kwargs",
")",
":",
"format",
"=",
"unicode",
"(",
"format",
")",
"if",
"format",
"==",
"u'json'",
"or",
"format",
"==",
"u'ipynb'",
":",
"return",
"writes_json",
"(",
"nb",
",",
"*",
"*",
"... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | write | Write a notebook to a file in a given format in the current nbformat version.
This function always writes the notebook in the current nbformat version.
Parameters
----------
nb : NotebookNode
The notebook to write.
fp : file
Any file-like object with a write method.
format : (u... | environment/lib/python2.7/site-packages/IPython/nbformat/current.py | def write(nb, fp, format, **kwargs):
"""Write a notebook to a file in a given format in the current nbformat version.
This function always writes the notebook in the current nbformat version.
Parameters
----------
nb : NotebookNode
The notebook to write.
fp : file
Any file-like... | def write(nb, fp, format, **kwargs):
"""Write a notebook to a file in a given format in the current nbformat version.
This function always writes the notebook in the current nbformat version.
Parameters
----------
nb : NotebookNode
The notebook to write.
fp : file
Any file-like... | [
"Write",
"a",
"notebook",
"to",
"a",
"file",
"in",
"a",
"given",
"format",
"in",
"the",
"current",
"nbformat",
"version",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/nbformat/current.py#L186-L205 | [
"def",
"write",
"(",
"nb",
",",
"fp",
",",
"format",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"fp",
".",
"write",
"(",
"writes",
"(",
"nb",
",",
"format",
",",
"*",
"*",
"kwargs",
")",
")"
] | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | _convert_to_metadata | Convert to a notebook having notebook metadata. | environment/lib/python2.7/site-packages/IPython/nbformat/current.py | def _convert_to_metadata():
"""Convert to a notebook having notebook metadata."""
import glob
for fname in glob.glob('*.ipynb'):
print('Converting file:',fname)
with open(fname,'r') as f:
nb = read(f,u'json')
md = new_metadata()
if u'name' in nb:
md.na... | def _convert_to_metadata():
"""Convert to a notebook having notebook metadata."""
import glob
for fname in glob.glob('*.ipynb'):
print('Converting file:',fname)
with open(fname,'r') as f:
nb = read(f,u'json')
md = new_metadata()
if u'name' in nb:
md.na... | [
"Convert",
"to",
"a",
"notebook",
"having",
"notebook",
"metadata",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/nbformat/current.py#L207-L220 | [
"def",
"_convert_to_metadata",
"(",
")",
":",
"import",
"glob",
"for",
"fname",
"in",
"glob",
".",
"glob",
"(",
"'*.ipynb'",
")",
":",
"print",
"(",
"'Converting file:'",
",",
"fname",
")",
"with",
"open",
"(",
"fname",
",",
"'r'",
")",
"as",
"f",
":",... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | Box.load_from_dict | try load value from dict.
if key is not exists, mark as state unset. | jasily/data/box.py | def load_from_dict(self, src: dict, key):
'''
try load value from dict.
if key is not exists, mark as state unset.
'''
if key in src:
self.value = src[key]
else:
self.reset() | def load_from_dict(self, src: dict, key):
'''
try load value from dict.
if key is not exists, mark as state unset.
'''
if key in src:
self.value = src[key]
else:
self.reset() | [
"try",
"load",
"value",
"from",
"dict",
".",
"if",
"key",
"is",
"not",
"exists",
"mark",
"as",
"state",
"unset",
"."
] | Jasily/jasily-python | python | https://github.com/Jasily/jasily-python/blob/1c821a120ebbbbc3c5761f5f1e8a73588059242a/jasily/data/box.py#L50-L58 | [
"def",
"load_from_dict",
"(",
"self",
",",
"src",
":",
"dict",
",",
"key",
")",
":",
"if",
"key",
"in",
"src",
":",
"self",
".",
"value",
"=",
"src",
"[",
"key",
"]",
"else",
":",
"self",
".",
"reset",
"(",
")"
] | 1c821a120ebbbbc3c5761f5f1e8a73588059242a |
test | inputhook_pyglet | Run the pyglet event loop by processing pending events only.
This keeps processing pending events until stdin is ready. After
processing all pending events, a call to time.sleep is inserted. This is
needed, otherwise, CPU usage is at 100%. This sleep time should be tuned
though for best performance. | environment/lib/python2.7/site-packages/IPython/lib/inputhookpyglet.py | def inputhook_pyglet():
"""Run the pyglet event loop by processing pending events only.
This keeps processing pending events until stdin is ready. After
processing all pending events, a call to time.sleep is inserted. This is
needed, otherwise, CPU usage is at 100%. This sleep time should be tuned
... | def inputhook_pyglet():
"""Run the pyglet event loop by processing pending events only.
This keeps processing pending events until stdin is ready. After
processing all pending events, a call to time.sleep is inserted. This is
needed, otherwise, CPU usage is at 100%. This sleep time should be tuned
... | [
"Run",
"the",
"pyglet",
"event",
"loop",
"by",
"processing",
"pending",
"events",
"only",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/lib/inputhookpyglet.py#L69-L115 | [
"def",
"inputhook_pyglet",
"(",
")",
":",
"# We need to protect against a user pressing Control-C when IPython is",
"# idle and this is running. We trap KeyboardInterrupt and pass.",
"try",
":",
"t",
"=",
"clock",
"(",
")",
"while",
"not",
"stdin_ready",
"(",
")",
":",
"pygle... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | Selector.matches | Does the name match my requirements?
To match, a name must match config.testMatch OR config.include
and it must not match config.exclude | environment/lib/python2.7/site-packages/nose/selector.py | def matches(self, name):
"""Does the name match my requirements?
To match, a name must match config.testMatch OR config.include
and it must not match config.exclude
"""
return ((self.match.search(name)
or (self.include and
filter(None,
... | def matches(self, name):
"""Does the name match my requirements?
To match, a name must match config.testMatch OR config.include
and it must not match config.exclude
"""
return ((self.match.search(name)
or (self.include and
filter(None,
... | [
"Does",
"the",
"name",
"match",
"my",
"requirements?"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/selector.py#L47-L60 | [
"def",
"matches",
"(",
"self",
",",
"name",
")",
":",
"return",
"(",
"(",
"self",
".",
"match",
".",
"search",
"(",
"name",
")",
"or",
"(",
"self",
".",
"include",
"and",
"filter",
"(",
"None",
",",
"[",
"inc",
".",
"search",
"(",
"name",
")",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | Selector.wantClass | Is the class a wanted test class?
A class must be a unittest.TestCase subclass, or match test name
requirements. Classes that start with _ are always excluded. | environment/lib/python2.7/site-packages/nose/selector.py | def wantClass(self, cls):
"""Is the class a wanted test class?
A class must be a unittest.TestCase subclass, or match test name
requirements. Classes that start with _ are always excluded.
"""
declared = getattr(cls, '__test__', None)
if declared is not None:
... | def wantClass(self, cls):
"""Is the class a wanted test class?
A class must be a unittest.TestCase subclass, or match test name
requirements. Classes that start with _ are always excluded.
"""
declared = getattr(cls, '__test__', None)
if declared is not None:
... | [
"Is",
"the",
"class",
"a",
"wanted",
"test",
"class?"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/selector.py#L62-L81 | [
"def",
"wantClass",
"(",
"self",
",",
"cls",
")",
":",
"declared",
"=",
"getattr",
"(",
"cls",
",",
"'__test__'",
",",
"None",
")",
"if",
"declared",
"is",
"not",
"None",
":",
"wanted",
"=",
"declared",
"else",
":",
"wanted",
"=",
"(",
"not",
"cls",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | Selector.wantDirectory | Is the directory a wanted test directory?
All package directories match, so long as they do not match exclude.
All other directories must match test requirements. | environment/lib/python2.7/site-packages/nose/selector.py | def wantDirectory(self, dirname):
"""Is the directory a wanted test directory?
All package directories match, so long as they do not match exclude.
All other directories must match test requirements.
"""
tail = op_basename(dirname)
if ispackage(dirname):
wan... | def wantDirectory(self, dirname):
"""Is the directory a wanted test directory?
All package directories match, so long as they do not match exclude.
All other directories must match test requirements.
"""
tail = op_basename(dirname)
if ispackage(dirname):
wan... | [
"Is",
"the",
"directory",
"a",
"wanted",
"test",
"directory?"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/selector.py#L83-L105 | [
"def",
"wantDirectory",
"(",
"self",
",",
"dirname",
")",
":",
"tail",
"=",
"op_basename",
"(",
"dirname",
")",
"if",
"ispackage",
"(",
"dirname",
")",
":",
"wanted",
"=",
"(",
"not",
"self",
".",
"exclude",
"or",
"not",
"filter",
"(",
"None",
",",
"... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | Selector.wantFile | Is the file a wanted test file?
The file must be a python source file and match testMatch or
include, and not match exclude. Files that match ignore are *never*
wanted, regardless of plugin, testMatch, include or exclude settings. | environment/lib/python2.7/site-packages/nose/selector.py | def wantFile(self, file):
"""Is the file a wanted test file?
The file must be a python source file and match testMatch or
include, and not match exclude. Files that match ignore are *never*
wanted, regardless of plugin, testMatch, include or exclude settings.
"""
# never... | def wantFile(self, file):
"""Is the file a wanted test file?
The file must be a python source file and match testMatch or
include, and not match exclude. Files that match ignore are *never*
wanted, regardless of plugin, testMatch, include or exclude settings.
"""
# never... | [
"Is",
"the",
"file",
"a",
"wanted",
"test",
"file?"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/selector.py#L107-L135 | [
"def",
"wantFile",
"(",
"self",
",",
"file",
")",
":",
"# never, ever load files that match anything in ignore",
"# (.* _* and *setup*.py by default)",
"base",
"=",
"op_basename",
"(",
"file",
")",
"ignore_matches",
"=",
"[",
"ignore_this",
"for",
"ignore_this",
"in",
"... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | Selector.wantFunction | Is the function a test function? | environment/lib/python2.7/site-packages/nose/selector.py | def wantFunction(self, function):
"""Is the function a test function?
"""
try:
if hasattr(function, 'compat_func_name'):
funcname = function.compat_func_name
else:
funcname = function.__name__
except AttributeError:
# no... | def wantFunction(self, function):
"""Is the function a test function?
"""
try:
if hasattr(function, 'compat_func_name'):
funcname = function.compat_func_name
else:
funcname = function.__name__
except AttributeError:
# no... | [
"Is",
"the",
"function",
"a",
"test",
"function?"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/selector.py#L137-L157 | [
"def",
"wantFunction",
"(",
"self",
",",
"function",
")",
":",
"try",
":",
"if",
"hasattr",
"(",
"function",
",",
"'compat_func_name'",
")",
":",
"funcname",
"=",
"function",
".",
"compat_func_name",
"else",
":",
"funcname",
"=",
"function",
".",
"__name__",... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | Selector.wantMethod | Is the method a test method? | environment/lib/python2.7/site-packages/nose/selector.py | def wantMethod(self, method):
"""Is the method a test method?
"""
try:
method_name = method.__name__
except AttributeError:
# not a method
return False
if method_name.startswith('_'):
# never collect 'private' methods
re... | def wantMethod(self, method):
"""Is the method a test method?
"""
try:
method_name = method.__name__
except AttributeError:
# not a method
return False
if method_name.startswith('_'):
# never collect 'private' methods
re... | [
"Is",
"the",
"method",
"a",
"test",
"method?"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/selector.py#L159-L179 | [
"def",
"wantMethod",
"(",
"self",
",",
"method",
")",
":",
"try",
":",
"method_name",
"=",
"method",
".",
"__name__",
"except",
"AttributeError",
":",
"# not a method",
"return",
"False",
"if",
"method_name",
".",
"startswith",
"(",
"'_'",
")",
":",
"# never... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | Selector.wantModule | Is the module a test module?
The tail of the module name must match test requirements. One exception:
we always want __main__. | environment/lib/python2.7/site-packages/nose/selector.py | def wantModule(self, module):
"""Is the module a test module?
The tail of the module name must match test requirements. One exception:
we always want __main__.
"""
declared = getattr(module, '__test__', None)
if declared is not None:
wanted = declared
... | def wantModule(self, module):
"""Is the module a test module?
The tail of the module name must match test requirements. One exception:
we always want __main__.
"""
declared = getattr(module, '__test__', None)
if declared is not None:
wanted = declared
... | [
"Is",
"the",
"module",
"a",
"test",
"module?"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/selector.py#L181-L197 | [
"def",
"wantModule",
"(",
"self",
",",
"module",
")",
":",
"declared",
"=",
"getattr",
"(",
"module",
",",
"'__test__'",
",",
"None",
")",
"if",
"declared",
"is",
"not",
"None",
":",
"wanted",
"=",
"declared",
"else",
":",
"wanted",
"=",
"self",
".",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | decorate_fn_with_doc | Make new_fn have old_fn's doc string. This is particularly useful
for the do_... commands that hook into the help system.
Adapted from from a comp.lang.python posting
by Duncan Booth. | environment/lib/python2.7/site-packages/IPython/core/debugger.py | def decorate_fn_with_doc(new_fn, old_fn, additional_text=""):
"""Make new_fn have old_fn's doc string. This is particularly useful
for the do_... commands that hook into the help system.
Adapted from from a comp.lang.python posting
by Duncan Booth."""
def wrapper(*args, **kw):
return new_fn(... | def decorate_fn_with_doc(new_fn, old_fn, additional_text=""):
"""Make new_fn have old_fn's doc string. This is particularly useful
for the do_... commands that hook into the help system.
Adapted from from a comp.lang.python posting
by Duncan Booth."""
def wrapper(*args, **kw):
return new_fn(... | [
"Make",
"new_fn",
"have",
"old_fn",
"s",
"doc",
"string",
".",
"This",
"is",
"particularly",
"useful",
"for",
"the",
"do_",
"...",
"commands",
"that",
"hook",
"into",
"the",
"help",
"system",
".",
"Adapted",
"from",
"from",
"a",
"comp",
".",
"lang",
".",... | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/debugger.py#L153-L162 | [
"def",
"decorate_fn_with_doc",
"(",
"new_fn",
",",
"old_fn",
",",
"additional_text",
"=",
"\"\"",
")",
":",
"def",
"wrapper",
"(",
"*",
"args",
",",
"*",
"*",
"kw",
")",
":",
"return",
"new_fn",
"(",
"*",
"args",
",",
"*",
"*",
"kw",
")",
"if",
"ol... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | _file_lines | Return the contents of a named file as a list of lines.
This function never raises an IOError exception: if the file can't be
read, it simply returns an empty list. | environment/lib/python2.7/site-packages/IPython/core/debugger.py | def _file_lines(fname):
"""Return the contents of a named file as a list of lines.
This function never raises an IOError exception: if the file can't be
read, it simply returns an empty list."""
try:
outfile = open(fname)
except IOError:
return []
else:
out = outfile.re... | def _file_lines(fname):
"""Return the contents of a named file as a list of lines.
This function never raises an IOError exception: if the file can't be
read, it simply returns an empty list."""
try:
outfile = open(fname)
except IOError:
return []
else:
out = outfile.re... | [
"Return",
"the",
"contents",
"of",
"a",
"named",
"file",
"as",
"a",
"list",
"of",
"lines",
"."
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/debugger.py#L165-L178 | [
"def",
"_file_lines",
"(",
"fname",
")",
":",
"try",
":",
"outfile",
"=",
"open",
"(",
"fname",
")",
"except",
"IOError",
":",
"return",
"[",
"]",
"else",
":",
"out",
"=",
"outfile",
".",
"readlines",
"(",
")",
"outfile",
".",
"close",
"(",
")",
"r... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
test | Pdb.list_command_pydb | List command to use if we have a newer pydb installed | environment/lib/python2.7/site-packages/IPython/core/debugger.py | def list_command_pydb(self, arg):
"""List command to use if we have a newer pydb installed"""
filename, first, last = OldPdb.parse_list_cmd(self, arg)
if filename is not None:
self.print_list_lines(filename, first, last) | def list_command_pydb(self, arg):
"""List command to use if we have a newer pydb installed"""
filename, first, last = OldPdb.parse_list_cmd(self, arg)
if filename is not None:
self.print_list_lines(filename, first, last) | [
"List",
"command",
"to",
"use",
"if",
"we",
"have",
"a",
"newer",
"pydb",
"installed"
] | cloud9ers/gurumate | python | https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/debugger.py#L409-L413 | [
"def",
"list_command_pydb",
"(",
"self",
",",
"arg",
")",
":",
"filename",
",",
"first",
",",
"last",
"=",
"OldPdb",
".",
"parse_list_cmd",
"(",
"self",
",",
"arg",
")",
"if",
"filename",
"is",
"not",
"None",
":",
"self",
".",
"print_list_lines",
"(",
... | 075dc74d1ee62a8c6b7a8bf2b271364f01629d1e |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.