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
compare_response_code
Compare the response code of url param with code param and returns boolean @param url -> string e.g. http://127.0.0.1/index @param content_type -> int e.g. 404, 500, 400 ..etc
environment/lib/python2.7/site-packages/gurumate-2.8.6-py2.7.egg/gurumate/web.py
def compare_response_code(url, code): ''' Compare the response code of url param with code param and returns boolean @param url -> string e.g. http://127.0.0.1/index @param content_type -> int e.g. 404, 500, 400 ..etc ''' try: response = urllib2.urlopen(url) except HTTPError as...
def compare_response_code(url, code): ''' Compare the response code of url param with code param and returns boolean @param url -> string e.g. http://127.0.0.1/index @param content_type -> int e.g. 404, 500, 400 ..etc ''' try: response = urllib2.urlopen(url) except HTTPError as...
[ "Compare", "the", "response", "code", "of", "url", "param", "with", "code", "param", "and", "returns", "boolean" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/gurumate-2.8.6-py2.7.egg/gurumate/web.py#L70-L85
[ "def", "compare_response_code", "(", "url", ",", "code", ")", ":", "try", ":", "response", "=", "urllib2", ".", "urlopen", "(", "url", ")", "except", "HTTPError", "as", "e", ":", "return", "e", ".", "code", "==", "code", "except", ":", "return", "False...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
publish_display_data
Publish data and metadata to all frontends. See the ``display_data`` message in the messaging documentation for more details about this message type. The following MIME types are currently implemented: * text/plain * text/html * text/latex * application/json * application/javascript ...
environment/lib/python2.7/site-packages/IPython/core/displaypub.py
def publish_display_data(source, data, metadata=None): """Publish data and metadata to all frontends. See the ``display_data`` message in the messaging documentation for more details about this message type. The following MIME types are currently implemented: * text/plain * text/html * te...
def publish_display_data(source, data, metadata=None): """Publish data and metadata to all frontends. See the ``display_data`` message in the messaging documentation for more details about this message type. The following MIME types are currently implemented: * text/plain * text/html * te...
[ "Publish", "data", "and", "metadata", "to", "all", "frontends", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/displaypub.py#L119-L159
[ "def", "publish_display_data", "(", "source", ",", "data", ",", "metadata", "=", "None", ")", ":", "from", "IPython", ".", "core", ".", "interactiveshell", "import", "InteractiveShell", "InteractiveShell", ".", "instance", "(", ")", ".", "display_pub", ".", "p...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
DisplayPublisher._validate_data
Validate the display data. Parameters ---------- source : str The fully dotted name of the callable that created the data, like :func:`foo.bar.my_formatter`. data : dict The formata data dictionary. metadata : dict Any metadata for...
environment/lib/python2.7/site-packages/IPython/core/displaypub.py
def _validate_data(self, source, data, metadata=None): """Validate the display data. Parameters ---------- source : str The fully dotted name of the callable that created the data, like :func:`foo.bar.my_formatter`. data : dict The formata dat...
def _validate_data(self, source, data, metadata=None): """Validate the display data. Parameters ---------- source : str The fully dotted name of the callable that created the data, like :func:`foo.bar.my_formatter`. data : dict The formata dat...
[ "Validate", "the", "display", "data", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/displaypub.py#L46-L66
[ "def", "_validate_data", "(", "self", ",", "source", ",", "data", ",", "metadata", "=", "None", ")", ":", "if", "not", "isinstance", "(", "source", ",", "basestring", ")", ":", "raise", "TypeError", "(", "'source must be a str, got: %r'", "%", "source", ")",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
DisplayPublisher.publish
Publish data and metadata to all frontends. See the ``display_data`` message in the messaging documentation for more details about this message type. The following MIME types are currently implemented: * text/plain * text/html * text/latex * application/json ...
environment/lib/python2.7/site-packages/IPython/core/displaypub.py
def publish(self, source, data, metadata=None): """Publish data and metadata to all frontends. See the ``display_data`` message in the messaging documentation for more details about this message type. The following MIME types are currently implemented: * text/plain * t...
def publish(self, source, data, metadata=None): """Publish data and metadata to all frontends. See the ``display_data`` message in the messaging documentation for more details about this message type. The following MIME types are currently implemented: * text/plain * t...
[ "Publish", "data", "and", "metadata", "to", "all", "frontends", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/displaypub.py#L68-L106
[ "def", "publish", "(", "self", ",", "source", ",", "data", ",", "metadata", "=", "None", ")", ":", "# The default is to simply write the plain text data using io.stdout.", "if", "data", ".", "has_key", "(", "'text/plain'", ")", ":", "print", "(", "data", "[", "'...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
DisplayPublisher.clear_output
Clear the output of the cell receiving output.
environment/lib/python2.7/site-packages/IPython/core/displaypub.py
def clear_output(self, stdout=True, stderr=True, other=True): """Clear the output of the cell receiving output.""" if stdout: print('\033[2K\r', file=io.stdout, end='') io.stdout.flush() if stderr: print('\033[2K\r', file=io.stderr, end='') io.stde...
def clear_output(self, stdout=True, stderr=True, other=True): """Clear the output of the cell receiving output.""" if stdout: print('\033[2K\r', file=io.stdout, end='') io.stdout.flush() if stderr: print('\033[2K\r', file=io.stderr, end='') io.stde...
[ "Clear", "the", "output", "of", "the", "cell", "receiving", "output", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/displaypub.py#L108-L115
[ "def", "clear_output", "(", "self", ",", "stdout", "=", "True", ",", "stderr", "=", "True", ",", "other", "=", "True", ")", ":", "if", "stdout", ":", "print", "(", "'\\033[2K\\r'", ",", "file", "=", "io", ".", "stdout", ",", "end", "=", "''", ")", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
grad
Returns numerical gradient function of given input function Input: f, scalar function of one or two variables delta(optional), finite difference step Output: gradient function object
findifftool/core.py
def grad(f, delta=DELTA): """ Returns numerical gradient function of given input function Input: f, scalar function of one or two variables delta(optional), finite difference step Output: gradient function object """ def grad_f(*args, **kwargs): if len(args) == 1: ...
def grad(f, delta=DELTA): """ Returns numerical gradient function of given input function Input: f, scalar function of one or two variables delta(optional), finite difference step Output: gradient function object """ def grad_f(*args, **kwargs): if len(args) == 1: ...
[ "Returns", "numerical", "gradient", "function", "of", "given", "input", "function", "Input", ":", "f", "scalar", "function", "of", "one", "or", "two", "variables", "delta", "(", "optional", ")", "finite", "difference", "step", "Output", ":", "gradient", "funct...
vahtras/findifftool
python
https://github.com/vahtras/findifftool/blob/d1b36cc852acc2594c95a4bf7a786d68369802b3/findifftool/core.py#L18-L38
[ "def", "grad", "(", "f", ",", "delta", "=", "DELTA", ")", ":", "def", "grad_f", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "len", "(", "args", ")", "==", "1", ":", "x", ",", "=", "args", "gradf_x", "=", "(", "f", "(", "x", ...
d1b36cc852acc2594c95a4bf7a786d68369802b3
test
hessian
Returns numerical hessian function of given input function Input: f, scalar function of one or two variables delta(optional), finite difference step Output: hessian function object
findifftool/core.py
def hessian(f, delta=DELTA): """ Returns numerical hessian function of given input function Input: f, scalar function of one or two variables delta(optional), finite difference step Output: hessian function object """ def hessian_f(*args, **kwargs): if len(args) == 1: ...
def hessian(f, delta=DELTA): """ Returns numerical hessian function of given input function Input: f, scalar function of one or two variables delta(optional), finite difference step Output: hessian function object """ def hessian_f(*args, **kwargs): if len(args) == 1: ...
[ "Returns", "numerical", "hessian", "function", "of", "given", "input", "function", "Input", ":", "f", "scalar", "function", "of", "one", "or", "two", "variables", "delta", "(", "optional", ")", "finite", "difference", "step", "Output", ":", "hessian", "functio...
vahtras/findifftool
python
https://github.com/vahtras/findifftool/blob/d1b36cc852acc2594c95a4bf7a786d68369802b3/findifftool/core.py#L40-L70
[ "def", "hessian", "(", "f", ",", "delta", "=", "DELTA", ")", ":", "def", "hessian_f", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "len", "(", "args", ")", "==", "1", ":", "x", ",", "=", "args", "hessianf_x", "=", "(", "f", "(",...
d1b36cc852acc2594c95a4bf7a786d68369802b3
test
ndgrad
Returns numerical gradient function of given input function Input: f, scalar function of an numpy array object delta(optional), finite difference step Output: gradient function object
findifftool/core.py
def ndgrad(f, delta=DELTA): """ Returns numerical gradient function of given input function Input: f, scalar function of an numpy array object delta(optional), finite difference step Output: gradient function object """ def grad_f(*args, **kwargs): x = args[0] grad_val...
def ndgrad(f, delta=DELTA): """ Returns numerical gradient function of given input function Input: f, scalar function of an numpy array object delta(optional), finite difference step Output: gradient function object """ def grad_f(*args, **kwargs): x = args[0] grad_val...
[ "Returns", "numerical", "gradient", "function", "of", "given", "input", "function", "Input", ":", "f", "scalar", "function", "of", "an", "numpy", "array", "object", "delta", "(", "optional", ")", "finite", "difference", "step", "Output", ":", "gradient", "func...
vahtras/findifftool
python
https://github.com/vahtras/findifftool/blob/d1b36cc852acc2594c95a4bf7a786d68369802b3/findifftool/core.py#L72-L92
[ "def", "ndgrad", "(", "f", ",", "delta", "=", "DELTA", ")", ":", "def", "grad_f", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "x", "=", "args", "[", "0", "]", "grad_val", "=", "numpy", ".", "zeros", "(", "x", ".", "shape", ")", "it",...
d1b36cc852acc2594c95a4bf7a786d68369802b3
test
ndhess
Returns numerical hessian function of given input function Input: f, scalar function of an numpy array object delta(optional), finite difference step Output: hessian function object
findifftool/core.py
def ndhess(f, delta=DELTA): """ Returns numerical hessian function of given input function Input: f, scalar function of an numpy array object delta(optional), finite difference step Output: hessian function object """ def hess_f(*args, **kwargs): x = args[0] hess_val =...
def ndhess(f, delta=DELTA): """ Returns numerical hessian function of given input function Input: f, scalar function of an numpy array object delta(optional), finite difference step Output: hessian function object """ def hess_f(*args, **kwargs): x = args[0] hess_val =...
[ "Returns", "numerical", "hessian", "function", "of", "given", "input", "function", "Input", ":", "f", "scalar", "function", "of", "an", "numpy", "array", "object", "delta", "(", "optional", ")", "finite", "difference", "step", "Output", ":", "hessian", "functi...
vahtras/findifftool
python
https://github.com/vahtras/findifftool/blob/d1b36cc852acc2594c95a4bf7a786d68369802b3/findifftool/core.py#L94-L123
[ "def", "ndhess", "(", "f", ",", "delta", "=", "DELTA", ")", ":", "def", "hess_f", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "x", "=", "args", "[", "0", "]", "hess_val", "=", "numpy", ".", "zeros", "(", "x", ".", "shape", "+", "x", ...
d1b36cc852acc2594c95a4bf7a786d68369802b3
test
clgrad
Returns numerical gradient function of given class method with respect to a class attribute Input: obj, general object exe (str), name of object method arg (str), name of object atribute delta(float, optional), finite difference step Output: gradient function object
findifftool/core.py
def clgrad(obj, exe, arg, delta=DELTA): """ Returns numerical gradient function of given class method with respect to a class attribute Input: obj, general object exe (str), name of object method arg (str), name of object atribute delta(float, optional), finite differenc...
def clgrad(obj, exe, arg, delta=DELTA): """ Returns numerical gradient function of given class method with respect to a class attribute Input: obj, general object exe (str), name of object method arg (str), name of object atribute delta(float, optional), finite differenc...
[ "Returns", "numerical", "gradient", "function", "of", "given", "class", "method", "with", "respect", "to", "a", "class", "attribute", "Input", ":", "obj", "general", "object", "exe", "(", "str", ")", "name", "of", "object", "method", "arg", "(", "str", ")"...
vahtras/findifftool
python
https://github.com/vahtras/findifftool/blob/d1b36cc852acc2594c95a4bf7a786d68369802b3/findifftool/core.py#L125-L148
[ "def", "clgrad", "(", "obj", ",", "exe", ",", "arg", ",", "delta", "=", "DELTA", ")", ":", "f", ",", "x", "=", "get_method_and_copy_of_attribute", "(", "obj", ",", "exe", ",", "arg", ")", "def", "grad_f", "(", "*", "args", ",", "*", "*", "kwargs", ...
d1b36cc852acc2594c95a4bf7a786d68369802b3
test
clmixhess
Returns numerical mixed Hessian function of given class method with respect to two class attributes Input: obj, general object exe (str), name of object method arg1(str), name of object attribute arg2(str), name of object attribute delta(float, optional), finite diffe...
findifftool/core.py
def clmixhess(obj, exe, arg1, arg2, delta=DELTA): """ Returns numerical mixed Hessian function of given class method with respect to two class attributes Input: obj, general object exe (str), name of object method arg1(str), name of object attribute arg2(str), name of ob...
def clmixhess(obj, exe, arg1, arg2, delta=DELTA): """ Returns numerical mixed Hessian function of given class method with respect to two class attributes Input: obj, general object exe (str), name of object method arg1(str), name of object attribute arg2(str), name of ob...
[ "Returns", "numerical", "mixed", "Hessian", "function", "of", "given", "class", "method", "with", "respect", "to", "two", "class", "attributes", "Input", ":", "obj", "general", "object", "exe", "(", "str", ")", "name", "of", "object", "method", "arg1", "(", ...
vahtras/findifftool
python
https://github.com/vahtras/findifftool/blob/d1b36cc852acc2594c95a4bf7a786d68369802b3/findifftool/core.py#L184-L218
[ "def", "clmixhess", "(", "obj", ",", "exe", ",", "arg1", ",", "arg2", ",", "delta", "=", "DELTA", ")", ":", "f", ",", "x", "=", "get_method_and_copy_of_attribute", "(", "obj", ",", "exe", ",", "arg1", ")", "_", ",", "y", "=", "get_method_and_copy_of_at...
d1b36cc852acc2594c95a4bf7a786d68369802b3
test
find_cmd
Find absolute path to executable cmd in a cross platform manner. This function tries to determine the full path to a command line program using `which` on Unix/Linux/OS X and `win32api` on Windows. Most of the time it will use the version that is first on the users `PATH`. If cmd is `python` return `...
environment/lib/python2.7/site-packages/IPython/utils/process.py
def find_cmd(cmd): """Find absolute path to executable cmd in a cross platform manner. This function tries to determine the full path to a command line program using `which` on Unix/Linux/OS X and `win32api` on Windows. Most of the time it will use the version that is first on the users `PATH`. If ...
def find_cmd(cmd): """Find absolute path to executable cmd in a cross platform manner. This function tries to determine the full path to a command line program using `which` on Unix/Linux/OS X and `win32api` on Windows. Most of the time it will use the version that is first on the users `PATH`. If ...
[ "Find", "absolute", "path", "to", "executable", "cmd", "in", "a", "cross", "platform", "manner", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/process.py#L42-L72
[ "def", "find_cmd", "(", "cmd", ")", ":", "if", "cmd", "==", "'python'", ":", "return", "os", ".", "path", ".", "abspath", "(", "sys", ".", "executable", ")", "try", ":", "path", "=", "_find_cmd", "(", "cmd", ")", ".", "rstrip", "(", ")", "except", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
pycmd2argv
r"""Take the path of a python command and return a list (argv-style). This only works on Python based command line programs and will find the location of the ``python`` executable using ``sys.executable`` to make sure the right version is used. For a given path ``cmd``, this returns [cmd] if cmd's ext...
environment/lib/python2.7/site-packages/IPython/utils/process.py
def pycmd2argv(cmd): r"""Take the path of a python command and return a list (argv-style). This only works on Python based command line programs and will find the location of the ``python`` executable using ``sys.executable`` to make sure the right version is used. For a given path ``cmd``, this r...
def pycmd2argv(cmd): r"""Take the path of a python command and return a list (argv-style). This only works on Python based command line programs and will find the location of the ``python`` executable using ``sys.executable`` to make sure the right version is used. For a given path ``cmd``, this r...
[ "r", "Take", "the", "path", "of", "a", "python", "command", "and", "return", "a", "list", "(", "argv", "-", "style", ")", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/process.py#L75-L98
[ "def", "pycmd2argv", "(", "cmd", ")", ":", "ext", "=", "os", ".", "path", ".", "splitext", "(", "cmd", ")", "[", "1", "]", "if", "ext", "in", "[", "'.exe'", ",", "'.com'", ",", "'.bat'", "]", ":", "return", "[", "cmd", "]", "else", ":", "return...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
abbrev_cwd
Return abbreviated version of cwd, e.g. d:mydir
environment/lib/python2.7/site-packages/IPython/utils/process.py
def abbrev_cwd(): """ Return abbreviated version of cwd, e.g. d:mydir """ cwd = os.getcwdu().replace('\\','/') drivepart = '' tail = cwd if sys.platform == 'win32': if len(cwd) < 4: return cwd drivepart,tail = os.path.splitdrive(cwd) parts = tail.split('/') if l...
def abbrev_cwd(): """ Return abbreviated version of cwd, e.g. d:mydir """ cwd = os.getcwdu().replace('\\','/') drivepart = '' tail = cwd if sys.platform == 'win32': if len(cwd) < 4: return cwd drivepart,tail = os.path.splitdrive(cwd) parts = tail.split('/') if l...
[ "Return", "abbreviated", "version", "of", "cwd", "e", ".", "g", ".", "d", ":", "mydir" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/process.py#L101-L117
[ "def", "abbrev_cwd", "(", ")", ":", "cwd", "=", "os", ".", "getcwdu", "(", ")", ".", "replace", "(", "'\\\\'", ",", "'/'", ")", "drivepart", "=", "''", "tail", "=", "cwd", "if", "sys", ".", "platform", "==", "'win32'", ":", "if", "len", "(", "cwd...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
code_unit_factory
Construct a list of CodeUnits from polymorphic inputs. `morfs` is a module or a filename, or a list of same. `file_locator` is a FileLocator that can help resolve filenames. Returns a list of CodeUnit objects.
virtualEnvironment/lib/python2.7/site-packages/coverage/codeunit.py
def code_unit_factory(morfs, file_locator): """Construct a list of CodeUnits from polymorphic inputs. `morfs` is a module or a filename, or a list of same. `file_locator` is a FileLocator that can help resolve filenames. Returns a list of CodeUnit objects. """ # Be sure we have a list. i...
def code_unit_factory(morfs, file_locator): """Construct a list of CodeUnits from polymorphic inputs. `morfs` is a module or a filename, or a list of same. `file_locator` is a FileLocator that can help resolve filenames. Returns a list of CodeUnit objects. """ # Be sure we have a list. i...
[ "Construct", "a", "list", "of", "CodeUnits", "from", "polymorphic", "inputs", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/codeunit.py#L9-L34
[ "def", "code_unit_factory", "(", "morfs", ",", "file_locator", ")", ":", "# Be sure we have a list.", "if", "not", "isinstance", "(", "morfs", ",", "(", "list", ",", "tuple", ")", ")", ":", "morfs", "=", "[", "morfs", "]", "# On Windows, the shell doesn't expand...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
CodeUnit.flat_rootname
A base for a flat filename to correspond to this code unit. Useful for writing files about the code where you want all the files in the same directory, but need to differentiate same-named files from different directories. For example, the file a/b/c.py might return 'a_b_c'
virtualEnvironment/lib/python2.7/site-packages/coverage/codeunit.py
def flat_rootname(self): """A base for a flat filename to correspond to this code unit. Useful for writing files about the code where you want all the files in the same directory, but need to differentiate same-named files from different directories. For example, the file a/b/c...
def flat_rootname(self): """A base for a flat filename to correspond to this code unit. Useful for writing files about the code where you want all the files in the same directory, but need to differentiate same-named files from different directories. For example, the file a/b/c...
[ "A", "base", "for", "a", "flat", "filename", "to", "correspond", "to", "this", "code", "unit", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/codeunit.py#L95-L109
[ "def", "flat_rootname", "(", "self", ")", ":", "if", "self", ".", "modname", ":", "return", "self", ".", "modname", ".", "replace", "(", "'.'", ",", "'_'", ")", "else", ":", "root", "=", "os", ".", "path", ".", "splitdrive", "(", "self", ".", "name...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
CodeUnit.source_file
Return an open file for reading the source of the code unit.
virtualEnvironment/lib/python2.7/site-packages/coverage/codeunit.py
def source_file(self): """Return an open file for reading the source of the code unit.""" if os.path.exists(self.filename): # A regular text file: open it. return open_source(self.filename) # Maybe it's in a zip file? source = self.file_locator.get_zip_data(self....
def source_file(self): """Return an open file for reading the source of the code unit.""" if os.path.exists(self.filename): # A regular text file: open it. return open_source(self.filename) # Maybe it's in a zip file? source = self.file_locator.get_zip_data(self....
[ "Return", "an", "open", "file", "for", "reading", "the", "source", "of", "the", "code", "unit", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/codeunit.py#L111-L125
[ "def", "source_file", "(", "self", ")", ":", "if", "os", ".", "path", ".", "exists", "(", "self", ".", "filename", ")", ":", "# A regular text file: open it.", "return", "open_source", "(", "self", ".", "filename", ")", "# Maybe it's in a zip file?", "source", ...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
CodeUnit.should_be_python
Does it seem like this file should contain Python? This is used to decide if a file reported as part of the exection of a program was really likely to have contained Python in the first place.
virtualEnvironment/lib/python2.7/site-packages/coverage/codeunit.py
def should_be_python(self): """Does it seem like this file should contain Python? This is used to decide if a file reported as part of the exection of a program was really likely to have contained Python in the first place. """ # Get the file extension. _, ext =...
def should_be_python(self): """Does it seem like this file should contain Python? This is used to decide if a file reported as part of the exection of a program was really likely to have contained Python in the first place. """ # Get the file extension. _, ext =...
[ "Does", "it", "seem", "like", "this", "file", "should", "contain", "Python?" ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/codeunit.py#L127-L145
[ "def", "should_be_python", "(", "self", ")", ":", "# Get the file extension.", "_", ",", "ext", "=", "os", ".", "path", ".", "splitext", "(", "self", ".", "filename", ")", "# Anything named *.py* should be Python.", "if", "ext", ".", "startswith", "(", "'.py'", ...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
_total_seconds
timedelta.total_seconds was added in 2.7
environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py
def _total_seconds(td): """timedelta.total_seconds was added in 2.7""" try: # Python >= 2.7 return td.total_seconds() except AttributeError: # Python 2.6 return 1e-6 * (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6)
def _total_seconds(td): """timedelta.total_seconds was added in 2.7""" try: # Python >= 2.7 return td.total_seconds() except AttributeError: # Python 2.6 return 1e-6 * (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6)
[ "timedelta", ".", "total_seconds", "was", "added", "in", "2", ".", "7" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py#L34-L41
[ "def", "_total_seconds", "(", "td", ")", ":", "try", ":", "# Python >= 2.7", "return", "td", ".", "total_seconds", "(", ")", "except", "AttributeError", ":", "# Python 2.6", "return", "1e-6", "*", "(", "td", ".", "microseconds", "+", "(", "td", ".", "secon...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
check_ready
Call spin() to sync state prior to calling the method.
environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py
def check_ready(f, self, *args, **kwargs): """Call spin() to sync state prior to calling the method.""" self.wait(0) if not self._ready: raise error.TimeoutError("result not ready") return f(self, *args, **kwargs)
def check_ready(f, self, *args, **kwargs): """Call spin() to sync state prior to calling the method.""" self.wait(0) if not self._ready: raise error.TimeoutError("result not ready") return f(self, *args, **kwargs)
[ "Call", "spin", "()", "to", "sync", "state", "prior", "to", "calling", "the", "method", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py#L54-L59
[ "def", "check_ready", "(", "f", ",", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "self", ".", "wait", "(", "0", ")", "if", "not", "self", ".", "_ready", ":", "raise", "error", ".", "TimeoutError", "(", "\"result not ready\"", ")", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
AsyncResult.get
Return the result when it arrives. If `timeout` is not ``None`` and the result does not arrive within `timeout` seconds then ``TimeoutError`` is raised. If the remote call raised an exception then that exception will be reraised by get() inside a `RemoteError`.
environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py
def get(self, timeout=-1): """Return the result when it arrives. If `timeout` is not ``None`` and the result does not arrive within `timeout` seconds then ``TimeoutError`` is raised. If the remote call raised an exception then that exception will be reraised by get() inside a `R...
def get(self, timeout=-1): """Return the result when it arrives. If `timeout` is not ``None`` and the result does not arrive within `timeout` seconds then ``TimeoutError`` is raised. If the remote call raised an exception then that exception will be reraised by get() inside a `R...
[ "Return", "the", "result", "when", "it", "arrives", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py#L110-L127
[ "def", "get", "(", "self", ",", "timeout", "=", "-", "1", ")", ":", "if", "not", "self", ".", "ready", "(", ")", ":", "self", ".", "wait", "(", "timeout", ")", "if", "self", ".", "_ready", ":", "if", "self", ".", "_success", ":", "return", "sel...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
AsyncResult.wait
Wait until the result is available or until `timeout` seconds pass. This method always returns None.
environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py
def wait(self, timeout=-1): """Wait until the result is available or until `timeout` seconds pass. This method always returns None. """ if self._ready: return self._ready = self._client.wait(self.msg_ids, timeout) if self._ready: try: ...
def wait(self, timeout=-1): """Wait until the result is available or until `timeout` seconds pass. This method always returns None. """ if self._ready: return self._ready = self._client.wait(self.msg_ids, timeout) if self._ready: try: ...
[ "Wait", "until", "the", "result", "is", "available", "or", "until", "timeout", "seconds", "pass", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py#L135-L161
[ "def", "wait", "(", "self", ",", "timeout", "=", "-", "1", ")", ":", "if", "self", ".", "_ready", ":", "return", "self", ".", "_ready", "=", "self", ".", "_client", ".", "wait", "(", "self", ".", "msg_ids", ",", "timeout", ")", "if", "self", ".",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
AsyncResult.get_dict
Get the results as a dict, keyed by engine_id. timeout behavior is described in `get()`.
environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py
def get_dict(self, timeout=-1): """Get the results as a dict, keyed by engine_id. timeout behavior is described in `get()`. """ results = self.get(timeout) engine_ids = [ md['engine_id'] for md in self._metadata ] bycount = sorted(engine_ids, key=lambda k: engine_ids.co...
def get_dict(self, timeout=-1): """Get the results as a dict, keyed by engine_id. timeout behavior is described in `get()`. """ results = self.get(timeout) engine_ids = [ md['engine_id'] for md in self._metadata ] bycount = sorted(engine_ids, key=lambda k: engine_ids.co...
[ "Get", "the", "results", "as", "a", "dict", "keyed", "by", "engine_id", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py#L177-L191
[ "def", "get_dict", "(", "self", ",", "timeout", "=", "-", "1", ")", ":", "results", "=", "self", ".", "get", "(", "timeout", ")", "engine_ids", "=", "[", "md", "[", "'engine_id'", "]", "for", "md", "in", "self", ".", "_metadata", "]", "bycount", "=...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
AsyncResult.abort
abort my tasks.
environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py
def abort(self): """abort my tasks.""" assert not self.ready(), "Can't abort, I am already done!" return self._client.abort(self.msg_ids, targets=self._targets, block=True)
def abort(self): """abort my tasks.""" assert not self.ready(), "Can't abort, I am already done!" return self._client.abort(self.msg_ids, targets=self._targets, block=True)
[ "abort", "my", "tasks", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py#L218-L221
[ "def", "abort", "(", "self", ")", ":", "assert", "not", "self", ".", "ready", "(", ")", ",", "\"Can't abort, I am already done!\"", "return", "self", ".", "_client", ".", "abort", "(", "self", ".", "msg_ids", ",", "targets", "=", "self", ".", "_targets", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
AsyncResult.timedelta
compute the difference between two sets of timestamps The default behavior is to use the earliest of the first and the latest of the second list, but this can be changed by passing a different Parameters ---------- start : one or more datetime o...
environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py
def timedelta(self, start, end, start_key=min, end_key=max): """compute the difference between two sets of timestamps The default behavior is to use the earliest of the first and the latest of the second list, but this can be changed by passing a different Param...
def timedelta(self, start, end, start_key=min, end_key=max): """compute the difference between two sets of timestamps The default behavior is to use the earliest of the first and the latest of the second list, but this can be changed by passing a different Param...
[ "compute", "the", "difference", "between", "two", "sets", "of", "timestamps", "The", "default", "behavior", "is", "to", "use", "the", "earliest", "of", "the", "first", "and", "the", "latest", "of", "the", "second", "list", "but", "this", "can", "be", "chan...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py#L289-L322
[ "def", "timedelta", "(", "self", ",", "start", ",", "end", ",", "start_key", "=", "min", ",", "end_key", "=", "max", ")", ":", "if", "not", "isinstance", "(", "start", ",", "datetime", ")", ":", "# handle single_result AsyncResults, where ar.stamp is single obje...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
AsyncResult.progress
the number of tasks which have been completed at this point. Fractional progress would be given by 1.0 * ar.progress / len(ar)
environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py
def progress(self): """the number of tasks which have been completed at this point. Fractional progress would be given by 1.0 * ar.progress / len(ar) """ self.wait(0) return len(self) - len(set(self.msg_ids).intersection(self._client.outstanding))
def progress(self): """the number of tasks which have been completed at this point. Fractional progress would be given by 1.0 * ar.progress / len(ar) """ self.wait(0) return len(self) - len(set(self.msg_ids).intersection(self._client.outstanding))
[ "the", "number", "of", "tasks", "which", "have", "been", "completed", "at", "this", "point", ".", "Fractional", "progress", "would", "be", "given", "by", "1", ".", "0", "*", "ar", ".", "progress", "/", "len", "(", "ar", ")" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py#L325-L331
[ "def", "progress", "(", "self", ")", ":", "self", ".", "wait", "(", "0", ")", "return", "len", "(", "self", ")", "-", "len", "(", "set", "(", "self", ".", "msg_ids", ")", ".", "intersection", "(", "self", ".", "_client", ".", "outstanding", ")", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
AsyncResult.elapsed
elapsed time since initial submission
environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py
def elapsed(self): """elapsed time since initial submission""" if self.ready(): return self.wall_time now = submitted = datetime.now() for msg_id in self.msg_ids: if msg_id in self._client.metadata: stamp = self._client.metadata[msg_id]['s...
def elapsed(self): """elapsed time since initial submission""" if self.ready(): return self.wall_time now = submitted = datetime.now() for msg_id in self.msg_ids: if msg_id in self._client.metadata: stamp = self._client.metadata[msg_id]['s...
[ "elapsed", "time", "since", "initial", "submission" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py#L334-L345
[ "def", "elapsed", "(", "self", ")", ":", "if", "self", ".", "ready", "(", ")", ":", "return", "self", ".", "wall_time", "now", "=", "submitted", "=", "datetime", ".", "now", "(", ")", "for", "msg_id", "in", "self", ".", "msg_ids", ":", "if", "msg_i...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
AsyncResult.serial_time
serial computation time of a parallel calculation Computed as the sum of (completed-started) of each task
environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py
def serial_time(self): """serial computation time of a parallel calculation Computed as the sum of (completed-started) of each task """ t = 0 for md in self._metadata: t += _total_seconds(md['completed'] - md['started']) return t
def serial_time(self): """serial computation time of a parallel calculation Computed as the sum of (completed-started) of each task """ t = 0 for md in self._metadata: t += _total_seconds(md['completed'] - md['started']) return t
[ "serial", "computation", "time", "of", "a", "parallel", "calculation", "Computed", "as", "the", "sum", "of", "(", "completed", "-", "started", ")", "of", "each", "task" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py#L349-L357
[ "def", "serial_time", "(", "self", ")", ":", "t", "=", "0", "for", "md", "in", "self", ".", "_metadata", ":", "t", "+=", "_total_seconds", "(", "md", "[", "'completed'", "]", "-", "md", "[", "'started'", "]", ")", "return", "t" ]
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
AsyncResult.wait_interactive
interactive wait, printing progress at regular intervals
environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py
def wait_interactive(self, interval=1., timeout=None): """interactive wait, printing progress at regular intervals""" N = len(self) tic = time.time() while not self.ready() and (timeout is None or time.time() - tic <= timeout): self.wait(interval) clear_output() ...
def wait_interactive(self, interval=1., timeout=None): """interactive wait, printing progress at regular intervals""" N = len(self) tic = time.time() while not self.ready() and (timeout is None or time.time() - tic <= timeout): self.wait(interval) clear_output() ...
[ "interactive", "wait", "printing", "progress", "at", "regular", "intervals" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py#L376-L386
[ "def", "wait_interactive", "(", "self", ",", "interval", "=", "1.", ",", "timeout", "=", "None", ")", ":", "N", "=", "len", "(", "self", ")", "tic", "=", "time", ".", "time", "(", ")", "while", "not", "self", ".", "ready", "(", ")", "and", "(", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
AsyncResult._republish_displaypub
republish individual displaypub content dicts
environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py
def _republish_displaypub(self, content, eid): """republish individual displaypub content dicts""" try: ip = get_ipython() except NameError: # displaypub is meaningless outside IPython return md = content['metadata'] or {} md['engine'] = eid ...
def _republish_displaypub(self, content, eid): """republish individual displaypub content dicts""" try: ip = get_ipython() except NameError: # displaypub is meaningless outside IPython return md = content['metadata'] or {} md['engine'] = eid ...
[ "republish", "individual", "displaypub", "content", "dicts" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py#L388-L397
[ "def", "_republish_displaypub", "(", "self", ",", "content", ",", "eid", ")", ":", "try", ":", "ip", "=", "get_ipython", "(", ")", "except", "NameError", ":", "# displaypub is meaningless outside IPython", "return", "md", "=", "content", "[", "'metadata'", "]", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
AsyncResult._wait_for_outputs
wait for the 'status=idle' message that indicates we have all outputs
environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py
def _wait_for_outputs(self, timeout=-1): """wait for the 'status=idle' message that indicates we have all outputs """ if not self._success: # don't wait on errors return tic = time.time() while not all(md['outputs_ready'] for md in self._metadata): ...
def _wait_for_outputs(self, timeout=-1): """wait for the 'status=idle' message that indicates we have all outputs """ if not self._success: # don't wait on errors return tic = time.time() while not all(md['outputs_ready'] for md in self._metadata): ...
[ "wait", "for", "the", "status", "=", "idle", "message", "that", "indicates", "we", "have", "all", "outputs" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py#L429-L440
[ "def", "_wait_for_outputs", "(", "self", ",", "timeout", "=", "-", "1", ")", ":", "if", "not", "self", ".", "_success", ":", "# don't wait on errors", "return", "tic", "=", "time", ".", "time", "(", ")", "while", "not", "all", "(", "md", "[", "'outputs...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
AsyncResult.display_outputs
republish the outputs of the computation Parameters ---------- groupby : str [default: type] if 'type': Group outputs by type (show all stdout, then all stderr, etc.): [stdout:1] foo [stdout:2] foo ...
environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py
def display_outputs(self, groupby="type"): """republish the outputs of the computation Parameters ---------- groupby : str [default: type] if 'type': Group outputs by type (show all stdout, then all stderr, etc.): ...
def display_outputs(self, groupby="type"): """republish the outputs of the computation Parameters ---------- groupby : str [default: type] if 'type': Group outputs by type (show all stdout, then all stderr, etc.): ...
[ "republish", "the", "outputs", "of", "the", "computation", "Parameters", "----------", "groupby", ":", "str", "[", "default", ":", "type", "]", "if", "type", ":", "Group", "outputs", "by", "type", "(", "show", "all", "stdout", "then", "all", "stderr", "etc...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py#L443-L543
[ "def", "display_outputs", "(", "self", ",", "groupby", "=", "\"type\"", ")", ":", "if", "self", ".", "_single_result", ":", "self", ".", "_display_single_result", "(", ")", "return", "stdouts", "=", "self", ".", "stdout", "stderrs", "=", "self", ".", "stde...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
AsyncMapResult._unordered_iter
iterator for results *as they arrive*, on FCFS basis, ignoring submission order.
environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py
def _unordered_iter(self): """iterator for results *as they arrive*, on FCFS basis, ignoring submission order.""" try: rlist = self.get(0) except error.TimeoutError: pending = set(self.msg_ids) while pending: try: self._clie...
def _unordered_iter(self): """iterator for results *as they arrive*, on FCFS basis, ignoring submission order.""" try: rlist = self.get(0) except error.TimeoutError: pending = set(self.msg_ids) while pending: try: self._clie...
[ "iterator", "for", "results", "*", "as", "they", "arrive", "*", "on", "FCFS", "basis", "ignoring", "submission", "order", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py#L600-L632
[ "def", "_unordered_iter", "(", "self", ")", ":", "try", ":", "rlist", "=", "self", ".", "get", "(", "0", ")", "except", "error", ".", "TimeoutError", ":", "pending", "=", "set", "(", "self", ".", "msg_ids", ")", "while", "pending", ":", "try", ":", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
AsyncHubResult.wait
wait for result to complete.
environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py
def wait(self, timeout=-1): """wait for result to complete.""" start = time.time() if self._ready: return local_ids = filter(lambda msg_id: msg_id in self._client.outstanding, self.msg_ids) local_ready = self._client.wait(local_ids, timeout) if local_ready: ...
def wait(self, timeout=-1): """wait for result to complete.""" start = time.time() if self._ready: return local_ids = filter(lambda msg_id: msg_id in self._client.outstanding, self.msg_ids) local_ready = self._client.wait(local_ids, timeout) if local_ready: ...
[ "wait", "for", "result", "to", "complete", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/client/asyncresult.py#L646-L684
[ "def", "wait", "(", "self", ",", "timeout", "=", "-", "1", ")", ":", "start", "=", "time", ".", "time", "(", ")", "if", "self", ".", "_ready", ":", "return", "local_ids", "=", "filter", "(", "lambda", "msg_id", ":", "msg_id", "in", "self", ".", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
abs_file
Return the absolute normalized form of `filename`.
virtualEnvironment/lib/python2.7/site-packages/coverage/files.py
def abs_file(filename): """Return the absolute normalized form of `filename`.""" path = os.path.expandvars(os.path.expanduser(filename)) path = os.path.abspath(os.path.realpath(path)) path = actual_path(path) return path
def abs_file(filename): """Return the absolute normalized form of `filename`.""" path = os.path.expandvars(os.path.expanduser(filename)) path = os.path.abspath(os.path.realpath(path)) path = actual_path(path) return path
[ "Return", "the", "absolute", "normalized", "form", "of", "filename", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/files.py#L115-L120
[ "def", "abs_file", "(", "filename", ")", ":", "path", "=", "os", ".", "path", ".", "expandvars", "(", "os", ".", "path", ".", "expanduser", "(", "filename", ")", ")", "path", "=", "os", ".", "path", ".", "abspath", "(", "os", ".", "path", ".", "r...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
prep_patterns
Prepare the file patterns for use in a `FnmatchMatcher`. If a pattern starts with a wildcard, it is used as a pattern as-is. If it does not start with a wildcard, then it is made absolute with the current directory. If `patterns` is None, an empty list is returned.
virtualEnvironment/lib/python2.7/site-packages/coverage/files.py
def prep_patterns(patterns): """Prepare the file patterns for use in a `FnmatchMatcher`. If a pattern starts with a wildcard, it is used as a pattern as-is. If it does not start with a wildcard, then it is made absolute with the current directory. If `patterns` is None, an empty list is returned....
def prep_patterns(patterns): """Prepare the file patterns for use in a `FnmatchMatcher`. If a pattern starts with a wildcard, it is used as a pattern as-is. If it does not start with a wildcard, then it is made absolute with the current directory. If `patterns` is None, an empty list is returned....
[ "Prepare", "the", "file", "patterns", "for", "use", "in", "a", "FnmatchMatcher", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/files.py#L128-L144
[ "def", "prep_patterns", "(", "patterns", ")", ":", "prepped", "=", "[", "]", "for", "p", "in", "patterns", "or", "[", "]", ":", "if", "p", ".", "startswith", "(", "\"*\"", ")", "or", "p", ".", "startswith", "(", "\"?\"", ")", ":", "prepped", ".", ...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
sep
Find the path separator used in this string, or os.sep if none.
virtualEnvironment/lib/python2.7/site-packages/coverage/files.py
def sep(s): """Find the path separator used in this string, or os.sep if none.""" sep_match = re.search(r"[\\/]", s) if sep_match: the_sep = sep_match.group(0) else: the_sep = os.sep return the_sep
def sep(s): """Find the path separator used in this string, or os.sep if none.""" sep_match = re.search(r"[\\/]", s) if sep_match: the_sep = sep_match.group(0) else: the_sep = os.sep return the_sep
[ "Find", "the", "path", "separator", "used", "in", "this", "string", "or", "os", ".", "sep", "if", "none", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/files.py#L196-L203
[ "def", "sep", "(", "s", ")", ":", "sep_match", "=", "re", ".", "search", "(", "r\"[\\\\/]\"", ",", "s", ")", "if", "sep_match", ":", "the_sep", "=", "sep_match", ".", "group", "(", "0", ")", "else", ":", "the_sep", "=", "os", ".", "sep", "return", ...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
find_python_files
Yield all of the importable Python files in `dirname`, recursively. To be importable, the files have to be in a directory with a __init__.py, except for `dirname` itself, which isn't required to have one. The assumption is that `dirname` was specified directly, so the user knows best, but subdirectori...
virtualEnvironment/lib/python2.7/site-packages/coverage/files.py
def find_python_files(dirname): """Yield all of the importable Python files in `dirname`, recursively. To be importable, the files have to be in a directory with a __init__.py, except for `dirname` itself, which isn't required to have one. The assumption is that `dirname` was specified directly, so th...
def find_python_files(dirname): """Yield all of the importable Python files in `dirname`, recursively. To be importable, the files have to be in a directory with a __init__.py, except for `dirname` itself, which isn't required to have one. The assumption is that `dirname` was specified directly, so th...
[ "Yield", "all", "of", "the", "importable", "Python", "files", "in", "dirname", "recursively", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/files.py#L288-L309
[ "def", "find_python_files", "(", "dirname", ")", ":", "for", "i", ",", "(", "dirpath", ",", "dirnames", ",", "filenames", ")", "in", "enumerate", "(", "os", ".", "walk", "(", "dirname", ")", ")", ":", "if", "i", ">", "0", "and", "'__init__.py'", "not...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
FileLocator.relative_filename
Return the relative form of `filename`. The filename will be relative to the current directory when the `FileLocator` was constructed.
virtualEnvironment/lib/python2.7/site-packages/coverage/files.py
def relative_filename(self, filename): """Return the relative form of `filename`. The filename will be relative to the current directory when the `FileLocator` was constructed. """ fnorm = os.path.normcase(filename) if fnorm.startswith(self.relative_dir): fi...
def relative_filename(self, filename): """Return the relative form of `filename`. The filename will be relative to the current directory when the `FileLocator` was constructed. """ fnorm = os.path.normcase(filename) if fnorm.startswith(self.relative_dir): fi...
[ "Return", "the", "relative", "form", "of", "filename", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/files.py#L19-L29
[ "def", "relative_filename", "(", "self", ",", "filename", ")", ":", "fnorm", "=", "os", ".", "path", ".", "normcase", "(", "filename", ")", "if", "fnorm", ".", "startswith", "(", "self", ".", "relative_dir", ")", ":", "filename", "=", "filename", "[", ...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
FileLocator.canonical_filename
Return a canonical filename for `filename`. An absolute path with no redundant components and normalized case.
virtualEnvironment/lib/python2.7/site-packages/coverage/files.py
def canonical_filename(self, filename): """Return a canonical filename for `filename`. An absolute path with no redundant components and normalized case. """ if filename not in self.canonical_filename_cache: if not os.path.isabs(filename): for path in [os.cu...
def canonical_filename(self, filename): """Return a canonical filename for `filename`. An absolute path with no redundant components and normalized case. """ if filename not in self.canonical_filename_cache: if not os.path.isabs(filename): for path in [os.cu...
[ "Return", "a", "canonical", "filename", "for", "filename", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/files.py#L31-L48
[ "def", "canonical_filename", "(", "self", ",", "filename", ")", ":", "if", "filename", "not", "in", "self", ".", "canonical_filename_cache", ":", "if", "not", "os", ".", "path", ".", "isabs", "(", "filename", ")", ":", "for", "path", "in", "[", "os", "...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
FileLocator.get_zip_data
Get data from `filename` if it is a zip file path. Returns the string data read from the zip file, or None if no zip file could be found or `filename` isn't in it. The data returned will be an empty string if the file is empty.
virtualEnvironment/lib/python2.7/site-packages/coverage/files.py
def get_zip_data(self, filename): """Get data from `filename` if it is a zip file path. Returns the string data read from the zip file, or None if no zip file could be found or `filename` isn't in it. The data returned will be an empty string if the file is empty. """ ...
def get_zip_data(self, filename): """Get data from `filename` if it is a zip file path. Returns the string data read from the zip file, or None if no zip file could be found or `filename` isn't in it. The data returned will be an empty string if the file is empty. """ ...
[ "Get", "data", "from", "filename", "if", "it", "is", "a", "zip", "file", "path", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/files.py#L50-L72
[ "def", "get_zip_data", "(", "self", ",", "filename", ")", ":", "import", "zipimport", "markers", "=", "[", "'.zip'", "+", "os", ".", "sep", ",", "'.egg'", "+", "os", ".", "sep", "]", "for", "marker", "in", "markers", ":", "if", "marker", "in", "filen...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
TreeMatcher.match
Does `fpath` indicate a file in one of our trees?
virtualEnvironment/lib/python2.7/site-packages/coverage/files.py
def match(self, fpath): """Does `fpath` indicate a file in one of our trees?""" for d in self.dirs: if fpath.startswith(d): if fpath == d: # This is the same file! return True if fpath[len(d)] == os.sep: ...
def match(self, fpath): """Does `fpath` indicate a file in one of our trees?""" for d in self.dirs: if fpath.startswith(d): if fpath == d: # This is the same file! return True if fpath[len(d)] == os.sep: ...
[ "Does", "fpath", "indicate", "a", "file", "in", "one", "of", "our", "trees?" ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/files.py#L163-L173
[ "def", "match", "(", "self", ",", "fpath", ")", ":", "for", "d", "in", "self", ".", "dirs", ":", "if", "fpath", ".", "startswith", "(", "d", ")", ":", "if", "fpath", "==", "d", ":", "# This is the same file!", "return", "True", "if", "fpath", "[", ...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
FnmatchMatcher.match
Does `fpath` match one of our filename patterns?
virtualEnvironment/lib/python2.7/site-packages/coverage/files.py
def match(self, fpath): """Does `fpath` match one of our filename patterns?""" for pat in self.pats: if fnmatch.fnmatch(fpath, pat): return True return False
def match(self, fpath): """Does `fpath` match one of our filename patterns?""" for pat in self.pats: if fnmatch.fnmatch(fpath, pat): return True return False
[ "Does", "fpath", "match", "one", "of", "our", "filename", "patterns?" ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/files.py#L188-L193
[ "def", "match", "(", "self", ",", "fpath", ")", ":", "for", "pat", "in", "self", ".", "pats", ":", "if", "fnmatch", ".", "fnmatch", "(", "fpath", ",", "pat", ")", ":", "return", "True", "return", "False" ]
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
PathAliases.add
Add the `pattern`/`result` pair to the list of aliases. `pattern` is an `fnmatch`-style pattern. `result` is a simple string. When mapping paths, if a path starts with a match against `pattern`, then that match is replaced with `result`. This models isomorphic source trees being root...
virtualEnvironment/lib/python2.7/site-packages/coverage/files.py
def add(self, pattern, result): """Add the `pattern`/`result` pair to the list of aliases. `pattern` is an `fnmatch`-style pattern. `result` is a simple string. When mapping paths, if a path starts with a match against `pattern`, then that match is replaced with `result`. This models...
def add(self, pattern, result): """Add the `pattern`/`result` pair to the list of aliases. `pattern` is an `fnmatch`-style pattern. `result` is a simple string. When mapping paths, if a path starts with a match against `pattern`, then that match is replaced with `result`. This models...
[ "Add", "the", "pattern", "/", "result", "pair", "to", "the", "list", "of", "aliases", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/files.py#L223-L262
[ "def", "add", "(", "self", ",", "pattern", ",", "result", ")", ":", "# The pattern can't end with a wildcard component.", "pattern", "=", "pattern", ".", "rstrip", "(", "r\"\\/\"", ")", "if", "pattern", ".", "endswith", "(", "\"*\"", ")", ":", "raise", "Covera...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
PathAliases.map
Map `path` through the aliases. `path` is checked against all of the patterns. The first pattern to match is used to replace the root of the path with the result root. Only one pattern is ever used. If no patterns match, `path` is returned unchanged. The separator style in th...
virtualEnvironment/lib/python2.7/site-packages/coverage/files.py
def map(self, path): """Map `path` through the aliases. `path` is checked against all of the patterns. The first pattern to match is used to replace the root of the path with the result root. Only one pattern is ever used. If no patterns match, `path` is returned unchanged. ...
def map(self, path): """Map `path` through the aliases. `path` is checked against all of the patterns. The first pattern to match is used to replace the root of the path with the result root. Only one pattern is ever used. If no patterns match, `path` is returned unchanged. ...
[ "Map", "path", "through", "the", "aliases", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/files.py#L264-L285
[ "def", "map", "(", "self", ",", "path", ")", ":", "for", "regex", ",", "result", ",", "pattern_sep", ",", "result_sep", "in", "self", ".", "aliases", ":", "m", "=", "regex", ".", "match", "(", "path", ")", "if", "m", ":", "new", "=", "path", ".",...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
loop_qt4
Start a kernel with PyQt4 event loop integration.
environment/lib/python2.7/site-packages/IPython/zmq/eventloops.py
def loop_qt4(kernel): """Start a kernel with PyQt4 event loop integration.""" from IPython.external.qt_for_kernel import QtCore from IPython.lib.guisupport import get_app_qt4, start_event_loop_qt4 kernel.app = get_app_qt4([" "]) kernel.app.setQuitOnLastWindowClosed(False) kernel.timer = QtCore...
def loop_qt4(kernel): """Start a kernel with PyQt4 event loop integration.""" from IPython.external.qt_for_kernel import QtCore from IPython.lib.guisupport import get_app_qt4, start_event_loop_qt4 kernel.app = get_app_qt4([" "]) kernel.app.setQuitOnLastWindowClosed(False) kernel.timer = QtCore...
[ "Start", "a", "kernel", "with", "PyQt4", "event", "loop", "integration", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/eventloops.py#L31-L43
[ "def", "loop_qt4", "(", "kernel", ")", ":", "from", "IPython", ".", "external", ".", "qt_for_kernel", "import", "QtCore", "from", "IPython", ".", "lib", ".", "guisupport", "import", "get_app_qt4", ",", "start_event_loop_qt4", "kernel", ".", "app", "=", "get_ap...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
loop_wx
Start a kernel with wx event loop support.
environment/lib/python2.7/site-packages/IPython/zmq/eventloops.py
def loop_wx(kernel): """Start a kernel with wx event loop support.""" import wx from IPython.lib.guisupport import start_event_loop_wx doi = kernel.do_one_iteration # Wx uses milliseconds poll_interval = int(1000*kernel._poll_interval) # We have to put the wx.Timer in a wx.Frame for it t...
def loop_wx(kernel): """Start a kernel with wx event loop support.""" import wx from IPython.lib.guisupport import start_event_loop_wx doi = kernel.do_one_iteration # Wx uses milliseconds poll_interval = int(1000*kernel._poll_interval) # We have to put the wx.Timer in a wx.Frame for it t...
[ "Start", "a", "kernel", "with", "wx", "event", "loop", "support", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/eventloops.py#L46-L89
[ "def", "loop_wx", "(", "kernel", ")", ":", "import", "wx", "from", "IPython", ".", "lib", ".", "guisupport", "import", "start_event_loop_wx", "doi", "=", "kernel", ".", "do_one_iteration", "# Wx uses milliseconds", "poll_interval", "=", "int", "(", "1000", "*", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
loop_tk
Start a kernel with the Tk event loop.
environment/lib/python2.7/site-packages/IPython/zmq/eventloops.py
def loop_tk(kernel): """Start a kernel with the Tk event loop.""" import Tkinter doi = kernel.do_one_iteration # Tk uses milliseconds poll_interval = int(1000*kernel._poll_interval) # For Tkinter, we create a Tk object and call its withdraw method. class Timer(object): def __init__(...
def loop_tk(kernel): """Start a kernel with the Tk event loop.""" import Tkinter doi = kernel.do_one_iteration # Tk uses milliseconds poll_interval = int(1000*kernel._poll_interval) # For Tkinter, we create a Tk object and call its withdraw method. class Timer(object): def __init__(...
[ "Start", "a", "kernel", "with", "the", "Tk", "event", "loop", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/eventloops.py#L92-L115
[ "def", "loop_tk", "(", "kernel", ")", ":", "import", "Tkinter", "doi", "=", "kernel", ".", "do_one_iteration", "# Tk uses milliseconds", "poll_interval", "=", "int", "(", "1000", "*", "kernel", ".", "_poll_interval", ")", "# For Tkinter, we create a Tk object and call...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
loop_gtk
Start the kernel, coordinating with the GTK event loop
environment/lib/python2.7/site-packages/IPython/zmq/eventloops.py
def loop_gtk(kernel): """Start the kernel, coordinating with the GTK event loop""" from .gui.gtkembed import GTKEmbed gtk_kernel = GTKEmbed(kernel) gtk_kernel.start()
def loop_gtk(kernel): """Start the kernel, coordinating with the GTK event loop""" from .gui.gtkembed import GTKEmbed gtk_kernel = GTKEmbed(kernel) gtk_kernel.start()
[ "Start", "the", "kernel", "coordinating", "with", "the", "GTK", "event", "loop" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/eventloops.py#L118-L123
[ "def", "loop_gtk", "(", "kernel", ")", ":", "from", ".", "gui", ".", "gtkembed", "import", "GTKEmbed", "gtk_kernel", "=", "GTKEmbed", "(", "kernel", ")", "gtk_kernel", ".", "start", "(", ")" ]
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
loop_cocoa
Start the kernel, coordinating with the Cocoa CFRunLoop event loop via the matplotlib MacOSX backend.
environment/lib/python2.7/site-packages/IPython/zmq/eventloops.py
def loop_cocoa(kernel): """Start the kernel, coordinating with the Cocoa CFRunLoop event loop via the matplotlib MacOSX backend. """ import matplotlib if matplotlib.__version__ < '1.1.0': kernel.log.warn( "MacOSX backend in matplotlib %s doesn't have a Timer, " "falling back ...
def loop_cocoa(kernel): """Start the kernel, coordinating with the Cocoa CFRunLoop event loop via the matplotlib MacOSX backend. """ import matplotlib if matplotlib.__version__ < '1.1.0': kernel.log.warn( "MacOSX backend in matplotlib %s doesn't have a Timer, " "falling back ...
[ "Start", "the", "kernel", "coordinating", "with", "the", "Cocoa", "CFRunLoop", "event", "loop", "via", "the", "matplotlib", "MacOSX", "backend", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/eventloops.py#L126-L194
[ "def", "loop_cocoa", "(", "kernel", ")", ":", "import", "matplotlib", "if", "matplotlib", ".", "__version__", "<", "'1.1.0'", ":", "kernel", ".", "log", ".", "warn", "(", "\"MacOSX backend in matplotlib %s doesn't have a Timer, \"", "\"falling back on Tk for CFRunLoop int...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
enable_gui
Enable integration with a given GUI
environment/lib/python2.7/site-packages/IPython/zmq/eventloops.py
def enable_gui(gui, kernel=None): """Enable integration with a given GUI""" if gui not in loop_map: raise ValueError("GUI %r not supported" % gui) if kernel is None: if Application.initialized(): kernel = getattr(Application.instance(), 'kernel', None) if kernel is None: ...
def enable_gui(gui, kernel=None): """Enable integration with a given GUI""" if gui not in loop_map: raise ValueError("GUI %r not supported" % gui) if kernel is None: if Application.initialized(): kernel = getattr(Application.instance(), 'kernel', None) if kernel is None: ...
[ "Enable", "integration", "with", "a", "given", "GUI" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/eventloops.py#L209-L223
[ "def", "enable_gui", "(", "gui", ",", "kernel", "=", "None", ")", ":", "if", "gui", "not", "in", "loop_map", ":", "raise", "ValueError", "(", "\"GUI %r not supported\"", "%", "gui", ")", "if", "kernel", "is", "None", ":", "if", "Application", ".", "initi...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
GOE
Creates an NxN element of the Gaussian Orthogonal Ensemble
environment/share/doc/ipython/examples/parallel/rmt/rmtkernel.py
def GOE(N): """Creates an NxN element of the Gaussian Orthogonal Ensemble""" m = ra.standard_normal((N,N)) m += m.T return m/2
def GOE(N): """Creates an NxN element of the Gaussian Orthogonal Ensemble""" m = ra.standard_normal((N,N)) m += m.T return m/2
[ "Creates", "an", "NxN", "element", "of", "the", "Gaussian", "Orthogonal", "Ensemble" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/share/doc/ipython/examples/parallel/rmt/rmtkernel.py#L9-L13
[ "def", "GOE", "(", "N", ")", ":", "m", "=", "ra", ".", "standard_normal", "(", "(", "N", ",", "N", ")", ")", "m", "+=", "m", ".", "T", "return", "m", "/", "2" ]
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
center_eigenvalue_diff
Compute the eigvals of mat and then find the center eigval difference.
environment/share/doc/ipython/examples/parallel/rmt/rmtkernel.py
def center_eigenvalue_diff(mat): """Compute the eigvals of mat and then find the center eigval difference.""" N = len(mat) evals = np.sort(la.eigvals(mat)) diff = np.abs(evals[N/2] - evals[N/2-1]) return diff
def center_eigenvalue_diff(mat): """Compute the eigvals of mat and then find the center eigval difference.""" N = len(mat) evals = np.sort(la.eigvals(mat)) diff = np.abs(evals[N/2] - evals[N/2-1]) return diff
[ "Compute", "the", "eigvals", "of", "mat", "and", "then", "find", "the", "center", "eigval", "difference", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/share/doc/ipython/examples/parallel/rmt/rmtkernel.py#L16-L21
[ "def", "center_eigenvalue_diff", "(", "mat", ")", ":", "N", "=", "len", "(", "mat", ")", "evals", "=", "np", ".", "sort", "(", "la", ".", "eigvals", "(", "mat", ")", ")", "diff", "=", "np", ".", "abs", "(", "evals", "[", "N", "/", "2", "]", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
ensemble_diffs
Return num eigenvalue diffs for the NxN GOE ensemble.
environment/share/doc/ipython/examples/parallel/rmt/rmtkernel.py
def ensemble_diffs(num, N): """Return num eigenvalue diffs for the NxN GOE ensemble.""" diffs = np.empty(num) for i in xrange(num): mat = GOE(N) diffs[i] = center_eigenvalue_diff(mat) return diffs
def ensemble_diffs(num, N): """Return num eigenvalue diffs for the NxN GOE ensemble.""" diffs = np.empty(num) for i in xrange(num): mat = GOE(N) diffs[i] = center_eigenvalue_diff(mat) return diffs
[ "Return", "num", "eigenvalue", "diffs", "for", "the", "NxN", "GOE", "ensemble", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/share/doc/ipython/examples/parallel/rmt/rmtkernel.py#L24-L30
[ "def", "ensemble_diffs", "(", "num", ",", "N", ")", ":", "diffs", "=", "np", ".", "empty", "(", "num", ")", "for", "i", "in", "xrange", "(", "num", ")", ":", "mat", "=", "GOE", "(", "N", ")", "diffs", "[", "i", "]", "=", "center_eigenvalue_diff",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
StepItem.init
Initialize the item. This calls the class constructor with the appropriate arguments and returns the initialized object. :param ctxt: The context object. :param step_addr: The address of the step in the test configuration.
timid/steps.py
def init(self, ctxt, step_addr): """ Initialize the item. This calls the class constructor with the appropriate arguments and returns the initialized object. :param ctxt: The context object. :param step_addr: The address of the step in the test configu...
def init(self, ctxt, step_addr): """ Initialize the item. This calls the class constructor with the appropriate arguments and returns the initialized object. :param ctxt: The context object. :param step_addr: The address of the step in the test configu...
[ "Initialize", "the", "item", ".", "This", "calls", "the", "class", "constructor", "with", "the", "appropriate", "arguments", "and", "returns", "the", "initialized", "object", "." ]
rackerlabs/timid
python
https://github.com/rackerlabs/timid/blob/b1c6aa159ab380a033740f4aa392cf0d125e0ac6/timid/steps.py#L329-L339
[ "def", "init", "(", "self", ",", "ctxt", ",", "step_addr", ")", ":", "return", "self", ".", "cls", "(", "ctxt", ",", "self", ".", "name", ",", "self", ".", "conf", ",", "step_addr", ")" ]
b1c6aa159ab380a033740f4aa392cf0d125e0ac6
test
Step.parse_file
Parse a YAML file containing test steps. :param ctxt: The context object. :param fname: The name of the file to parse. :param key: An optional dictionary key. If specified, the file must be a YAML dictionary, and the referenced value will be interpreted ...
timid/steps.py
def parse_file(cls, ctxt, fname, key=None, step_addr=None): """ Parse a YAML file containing test steps. :param ctxt: The context object. :param fname: The name of the file to parse. :param key: An optional dictionary key. If specified, the file must be a YA...
def parse_file(cls, ctxt, fname, key=None, step_addr=None): """ Parse a YAML file containing test steps. :param ctxt: The context object. :param fname: The name of the file to parse. :param key: An optional dictionary key. If specified, the file must be a YA...
[ "Parse", "a", "YAML", "file", "containing", "test", "steps", "." ]
rackerlabs/timid
python
https://github.com/rackerlabs/timid/blob/b1c6aa159ab380a033740f4aa392cf0d125e0ac6/timid/steps.py#L353-L409
[ "def", "parse_file", "(", "cls", ",", "ctxt", ",", "fname", ",", "key", "=", "None", ",", "step_addr", "=", "None", ")", ":", "# Load the YAML file", "try", ":", "with", "open", "(", "fname", ")", "as", "f", ":", "step_data", "=", "yaml", ".", "load"...
b1c6aa159ab380a033740f4aa392cf0d125e0ac6
test
Step.parse_step
Parse a step dictionary. :param ctxt: The context object. :param step_addr: The address of the step in the test configuration. :param step_conf: The description of the step. This may be a scalar string or a dictionary. :returns: A li...
timid/steps.py
def parse_step(cls, ctxt, step_addr, step_conf): """ Parse a step dictionary. :param ctxt: The context object. :param step_addr: The address of the step in the test configuration. :param step_conf: The description of the step. This may be a ...
def parse_step(cls, ctxt, step_addr, step_conf): """ Parse a step dictionary. :param ctxt: The context object. :param step_addr: The address of the step in the test configuration. :param step_conf: The description of the step. This may be a ...
[ "Parse", "a", "step", "dictionary", "." ]
rackerlabs/timid
python
https://github.com/rackerlabs/timid/blob/b1c6aa159ab380a033740f4aa392cf0d125e0ac6/timid/steps.py#L412-L531
[ "def", "parse_step", "(", "cls", ",", "ctxt", ",", "step_addr", ",", "step_conf", ")", ":", "# Make sure the step makes sense", "if", "isinstance", "(", "step_conf", ",", "six", ".", "string_types", ")", ":", "# Convert string to a dict for uniformity of processing", ...
b1c6aa159ab380a033740f4aa392cf0d125e0ac6
test
BaseIPythonApplication.init_crash_handler
Create a crash handler, typically setting sys.excepthook to it.
environment/lib/python2.7/site-packages/IPython/core/application.py
def init_crash_handler(self): """Create a crash handler, typically setting sys.excepthook to it.""" self.crash_handler = self.crash_handler_class(self) sys.excepthook = self.excepthook def unset_crashhandler(): sys.excepthook = sys.__excepthook__ atexit.register(unset...
def init_crash_handler(self): """Create a crash handler, typically setting sys.excepthook to it.""" self.crash_handler = self.crash_handler_class(self) sys.excepthook = self.excepthook def unset_crashhandler(): sys.excepthook = sys.__excepthook__ atexit.register(unset...
[ "Create", "a", "crash", "handler", "typically", "setting", "sys", ".", "excepthook", "to", "it", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/application.py#L159-L165
[ "def", "init_crash_handler", "(", "self", ")", ":", "self", ".", "crash_handler", "=", "self", ".", "crash_handler_class", "(", "self", ")", "sys", ".", "excepthook", "=", "self", ".", "excepthook", "def", "unset_crashhandler", "(", ")", ":", "sys", ".", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
BaseIPythonApplication.excepthook
this is sys.excepthook after init_crashhandler set self.verbose_crash=True to use our full crashhandler, instead of a regular traceback with a short message (crash_handler_lite)
environment/lib/python2.7/site-packages/IPython/core/application.py
def excepthook(self, etype, evalue, tb): """this is sys.excepthook after init_crashhandler set self.verbose_crash=True to use our full crashhandler, instead of a regular traceback with a short message (crash_handler_lite) """ if self.verbose_crash: r...
def excepthook(self, etype, evalue, tb): """this is sys.excepthook after init_crashhandler set self.verbose_crash=True to use our full crashhandler, instead of a regular traceback with a short message (crash_handler_lite) """ if self.verbose_crash: r...
[ "this", "is", "sys", ".", "excepthook", "after", "init_crashhandler", "set", "self", ".", "verbose_crash", "=", "True", "to", "use", "our", "full", "crashhandler", "instead", "of", "a", "regular", "traceback", "with", "a", "short", "message", "(", "crash_handl...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/application.py#L167-L177
[ "def", "excepthook", "(", "self", ",", "etype", ",", "evalue", ",", "tb", ")", ":", "if", "self", ".", "verbose_crash", ":", "return", "self", ".", "crash_handler", "(", "etype", ",", "evalue", ",", "tb", ")", "else", ":", "return", "crashhandler", "."...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
BaseIPythonApplication.load_config_file
Load the config file. By default, errors in loading config are handled, and a warning printed on screen. For testing, the suppress_errors option is set to False, so errors will make tests fail.
environment/lib/python2.7/site-packages/IPython/core/application.py
def load_config_file(self, suppress_errors=True): """Load the config file. By default, errors in loading config are handled, and a warning printed on screen. For testing, the suppress_errors option is set to False, so errors will make tests fail. """ self.log.debug("Sear...
def load_config_file(self, suppress_errors=True): """Load the config file. By default, errors in loading config are handled, and a warning printed on screen. For testing, the suppress_errors option is set to False, so errors will make tests fail. """ self.log.debug("Sear...
[ "Load", "the", "config", "file", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/application.py#L191-L235
[ "def", "load_config_file", "(", "self", ",", "suppress_errors", "=", "True", ")", ":", "self", ".", "log", ".", "debug", "(", "\"Searching path %s for config files\"", ",", "self", ".", "config_file_paths", ")", "base_config", "=", "'ipython_config.py'", "self", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
BaseIPythonApplication.init_profile_dir
initialize the profile dir
environment/lib/python2.7/site-packages/IPython/core/application.py
def init_profile_dir(self): """initialize the profile dir""" try: # location explicitly specified: location = self.config.ProfileDir.location except AttributeError: # location not specified, find by profile name try: p = ProfileDir....
def init_profile_dir(self): """initialize the profile dir""" try: # location explicitly specified: location = self.config.ProfileDir.location except AttributeError: # location not specified, find by profile name try: p = ProfileDir....
[ "initialize", "the", "profile", "dir" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/application.py#L237-L282
[ "def", "init_profile_dir", "(", "self", ")", ":", "try", ":", "# location explicitly specified:", "location", "=", "self", ".", "config", ".", "ProfileDir", ".", "location", "except", "AttributeError", ":", "# location not specified, find by profile name", "try", ":", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
BaseIPythonApplication.init_config_files
[optionally] copy default config files into profile dir.
environment/lib/python2.7/site-packages/IPython/core/application.py
def init_config_files(self): """[optionally] copy default config files into profile dir.""" # copy config files path = self.builtin_profile_dir if self.copy_config_files: src = self.profile cfg = self.config_file_name if path and os.path.exists(os.pat...
def init_config_files(self): """[optionally] copy default config files into profile dir.""" # copy config files path = self.builtin_profile_dir if self.copy_config_files: src = self.profile cfg = self.config_file_name if path and os.path.exists(os.pat...
[ "[", "optionally", "]", "copy", "default", "config", "files", "into", "profile", "dir", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/application.py#L284-L310
[ "def", "init_config_files", "(", "self", ")", ":", "# copy config files", "path", "=", "self", ".", "builtin_profile_dir", "if", "self", ".", "copy_config_files", ":", "src", "=", "self", ".", "profile", "cfg", "=", "self", ".", "config_file_name", "if", "path...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
BaseIPythonApplication.stage_default_config_file
auto generate default config file, and stage it into the profile.
environment/lib/python2.7/site-packages/IPython/core/application.py
def stage_default_config_file(self): """auto generate default config file, and stage it into the profile.""" s = self.generate_config_file() fname = os.path.join(self.profile_dir.location, self.config_file_name) if self.overwrite or not os.path.exists(fname): self.log.warn("G...
def stage_default_config_file(self): """auto generate default config file, and stage it into the profile.""" s = self.generate_config_file() fname = os.path.join(self.profile_dir.location, self.config_file_name) if self.overwrite or not os.path.exists(fname): self.log.warn("G...
[ "auto", "generate", "default", "config", "file", "and", "stage", "it", "into", "the", "profile", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/application.py#L313-L320
[ "def", "stage_default_config_file", "(", "self", ")", ":", "s", "=", "self", ".", "generate_config_file", "(", ")", "fname", "=", "os", ".", "path", ".", "join", "(", "self", ".", "profile_dir", ".", "location", ",", "self", ".", "config_file_name", ")", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
CoverageData.read
Read coverage data from the coverage data file (if it exists).
virtualEnvironment/lib/python2.7/site-packages/coverage/data.py
def read(self): """Read coverage data from the coverage data file (if it exists).""" if self.use_file: self.lines, self.arcs = self._read_file(self.filename) else: self.lines, self.arcs = {}, {}
def read(self): """Read coverage data from the coverage data file (if it exists).""" if self.use_file: self.lines, self.arcs = self._read_file(self.filename) else: self.lines, self.arcs = {}, {}
[ "Read", "coverage", "data", "from", "the", "coverage", "data", "file", "(", "if", "it", "exists", ")", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/data.py#L71-L76
[ "def", "read", "(", "self", ")", ":", "if", "self", ".", "use_file", ":", "self", ".", "lines", ",", "self", ".", "arcs", "=", "self", ".", "_read_file", "(", "self", ".", "filename", ")", "else", ":", "self", ".", "lines", ",", "self", ".", "arc...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
CoverageData.write
Write the collected coverage data to a file. `suffix` is a suffix to append to the base file name. This can be used for multiple or parallel execution, so that many coverage data files can exist simultaneously. A dot will be used to join the base name and the suffix.
virtualEnvironment/lib/python2.7/site-packages/coverage/data.py
def write(self, suffix=None): """Write the collected coverage data to a file. `suffix` is a suffix to append to the base file name. This can be used for multiple or parallel execution, so that many coverage data files can exist simultaneously. A dot will be used to join the base name a...
def write(self, suffix=None): """Write the collected coverage data to a file. `suffix` is a suffix to append to the base file name. This can be used for multiple or parallel execution, so that many coverage data files can exist simultaneously. A dot will be used to join the base name a...
[ "Write", "the", "collected", "coverage", "data", "to", "a", "file", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/data.py#L78-L91
[ "def", "write", "(", "self", ",", "suffix", "=", "None", ")", ":", "if", "self", ".", "use_file", ":", "filename", "=", "self", ".", "filename", "if", "suffix", ":", "filename", "+=", "\".\"", "+", "suffix", "self", ".", "write_file", "(", "filename", ...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
CoverageData.erase
Erase the data, both in this object, and from its file storage.
virtualEnvironment/lib/python2.7/site-packages/coverage/data.py
def erase(self): """Erase the data, both in this object, and from its file storage.""" if self.use_file: if self.filename: file_be_gone(self.filename) self.lines = {} self.arcs = {}
def erase(self): """Erase the data, both in this object, and from its file storage.""" if self.use_file: if self.filename: file_be_gone(self.filename) self.lines = {} self.arcs = {}
[ "Erase", "the", "data", "both", "in", "this", "object", "and", "from", "its", "file", "storage", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/data.py#L93-L99
[ "def", "erase", "(", "self", ")", ":", "if", "self", ".", "use_file", ":", "if", "self", ".", "filename", ":", "file_be_gone", "(", "self", ".", "filename", ")", "self", ".", "lines", "=", "{", "}", "self", ".", "arcs", "=", "{", "}" ]
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
CoverageData.line_data
Return the map from filenames to lists of line numbers executed.
virtualEnvironment/lib/python2.7/site-packages/coverage/data.py
def line_data(self): """Return the map from filenames to lists of line numbers executed.""" return dict( [(f, sorted(lmap.keys())) for f, lmap in iitems(self.lines)] )
def line_data(self): """Return the map from filenames to lists of line numbers executed.""" return dict( [(f, sorted(lmap.keys())) for f, lmap in iitems(self.lines)] )
[ "Return", "the", "map", "from", "filenames", "to", "lists", "of", "line", "numbers", "executed", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/data.py#L101-L105
[ "def", "line_data", "(", "self", ")", ":", "return", "dict", "(", "[", "(", "f", ",", "sorted", "(", "lmap", ".", "keys", "(", ")", ")", ")", "for", "f", ",", "lmap", "in", "iitems", "(", "self", ".", "lines", ")", "]", ")" ]
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
CoverageData.arc_data
Return the map from filenames to lists of line number pairs.
virtualEnvironment/lib/python2.7/site-packages/coverage/data.py
def arc_data(self): """Return the map from filenames to lists of line number pairs.""" return dict( [(f, sorted(amap.keys())) for f, amap in iitems(self.arcs)] )
def arc_data(self): """Return the map from filenames to lists of line number pairs.""" return dict( [(f, sorted(amap.keys())) for f, amap in iitems(self.arcs)] )
[ "Return", "the", "map", "from", "filenames", "to", "lists", "of", "line", "number", "pairs", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/data.py#L107-L111
[ "def", "arc_data", "(", "self", ")", ":", "return", "dict", "(", "[", "(", "f", ",", "sorted", "(", "amap", ".", "keys", "(", ")", ")", ")", "for", "f", ",", "amap", "in", "iitems", "(", "self", ".", "arcs", ")", "]", ")" ]
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
CoverageData.write_file
Write the coverage data to `filename`.
virtualEnvironment/lib/python2.7/site-packages/coverage/data.py
def write_file(self, filename): """Write the coverage data to `filename`.""" # Create the file data. data = {} data['lines'] = self.line_data() arcs = self.arc_data() if arcs: data['arcs'] = arcs if self.collector: data['collector'] = se...
def write_file(self, filename): """Write the coverage data to `filename`.""" # Create the file data. data = {} data['lines'] = self.line_data() arcs = self.arc_data() if arcs: data['arcs'] = arcs if self.collector: data['collector'] = se...
[ "Write", "the", "coverage", "data", "to", "filename", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/data.py#L113-L135
[ "def", "write_file", "(", "self", ",", "filename", ")", ":", "# Create the file data.", "data", "=", "{", "}", "data", "[", "'lines'", "]", "=", "self", ".", "line_data", "(", ")", "arcs", "=", "self", ".", "arc_data", "(", ")", "if", "arcs", ":", "d...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
CoverageData.read_file
Read the coverage data from `filename`.
virtualEnvironment/lib/python2.7/site-packages/coverage/data.py
def read_file(self, filename): """Read the coverage data from `filename`.""" self.lines, self.arcs = self._read_file(filename)
def read_file(self, filename): """Read the coverage data from `filename`.""" self.lines, self.arcs = self._read_file(filename)
[ "Read", "the", "coverage", "data", "from", "filename", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/data.py#L137-L139
[ "def", "read_file", "(", "self", ",", "filename", ")", ":", "self", ".", "lines", ",", "self", ".", "arcs", "=", "self", ".", "_read_file", "(", "filename", ")" ]
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
CoverageData.raw_data
Return the raw pickled data from `filename`.
virtualEnvironment/lib/python2.7/site-packages/coverage/data.py
def raw_data(self, filename): """Return the raw pickled data from `filename`.""" if self.debug and self.debug.should('dataio'): self.debug.write("Reading data from %r" % (filename,)) fdata = open(filename, 'rb') try: data = pickle.load(fdata) finally: ...
def raw_data(self, filename): """Return the raw pickled data from `filename`.""" if self.debug and self.debug.should('dataio'): self.debug.write("Reading data from %r" % (filename,)) fdata = open(filename, 'rb') try: data = pickle.load(fdata) finally: ...
[ "Return", "the", "raw", "pickled", "data", "from", "filename", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/data.py#L141-L150
[ "def", "raw_data", "(", "self", ",", "filename", ")", ":", "if", "self", ".", "debug", "and", "self", ".", "debug", ".", "should", "(", "'dataio'", ")", ":", "self", ".", "debug", ".", "write", "(", "\"Reading data from %r\"", "%", "(", "filename", ","...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
CoverageData._read_file
Return the stored coverage data from the given file. Returns two values, suitable for assigning to `self.lines` and `self.arcs`.
virtualEnvironment/lib/python2.7/site-packages/coverage/data.py
def _read_file(self, filename): """Return the stored coverage data from the given file. Returns two values, suitable for assigning to `self.lines` and `self.arcs`. """ lines = {} arcs = {} try: data = self.raw_data(filename) if isinstance...
def _read_file(self, filename): """Return the stored coverage data from the given file. Returns two values, suitable for assigning to `self.lines` and `self.arcs`. """ lines = {} arcs = {} try: data = self.raw_data(filename) if isinstance...
[ "Return", "the", "stored", "coverage", "data", "from", "the", "given", "file", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/data.py#L152-L176
[ "def", "_read_file", "(", "self", ",", "filename", ")", ":", "lines", "=", "{", "}", "arcs", "=", "{", "}", "try", ":", "data", "=", "self", ".", "raw_data", "(", "filename", ")", "if", "isinstance", "(", "data", ",", "dict", ")", ":", "# Unpack th...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
CoverageData.combine_parallel_data
Combine a number of data files together. Treat `self.filename` as a file prefix, and combine the data from all of the data files starting with that prefix plus a dot. If `aliases` is provided, it's a `PathAliases` object that is used to re-map paths to match the local machine's.
virtualEnvironment/lib/python2.7/site-packages/coverage/data.py
def combine_parallel_data(self, aliases=None): """Combine a number of data files together. Treat `self.filename` as a file prefix, and combine the data from all of the data files starting with that prefix plus a dot. If `aliases` is provided, it's a `PathAliases` object that is used to...
def combine_parallel_data(self, aliases=None): """Combine a number of data files together. Treat `self.filename` as a file prefix, and combine the data from all of the data files starting with that prefix plus a dot. If `aliases` is provided, it's a `PathAliases` object that is used to...
[ "Combine", "a", "number", "of", "data", "files", "together", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/data.py#L178-L202
[ "def", "combine_parallel_data", "(", "self", ",", "aliases", "=", "None", ")", ":", "aliases", "=", "aliases", "or", "PathAliases", "(", ")", "data_dir", ",", "local", "=", "os", ".", "path", ".", "split", "(", "self", ".", "filename", ")", "localdot", ...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
CoverageData.add_line_data
Add executed line data. `line_data` is { filename: { lineno: None, ... }, ...}
virtualEnvironment/lib/python2.7/site-packages/coverage/data.py
def add_line_data(self, line_data): """Add executed line data. `line_data` is { filename: { lineno: None, ... }, ...} """ for filename, linenos in iitems(line_data): self.lines.setdefault(filename, {}).update(linenos)
def add_line_data(self, line_data): """Add executed line data. `line_data` is { filename: { lineno: None, ... }, ...} """ for filename, linenos in iitems(line_data): self.lines.setdefault(filename, {}).update(linenos)
[ "Add", "executed", "line", "data", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/data.py#L204-L211
[ "def", "add_line_data", "(", "self", ",", "line_data", ")", ":", "for", "filename", ",", "linenos", "in", "iitems", "(", "line_data", ")", ":", "self", ".", "lines", ".", "setdefault", "(", "filename", ",", "{", "}", ")", ".", "update", "(", "linenos",...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
CoverageData.add_arc_data
Add measured arc data. `arc_data` is { filename: { (l1,l2): None, ... }, ...}
virtualEnvironment/lib/python2.7/site-packages/coverage/data.py
def add_arc_data(self, arc_data): """Add measured arc data. `arc_data` is { filename: { (l1,l2): None, ... }, ...} """ for filename, arcs in iitems(arc_data): self.arcs.setdefault(filename, {}).update(arcs)
def add_arc_data(self, arc_data): """Add measured arc data. `arc_data` is { filename: { (l1,l2): None, ... }, ...} """ for filename, arcs in iitems(arc_data): self.arcs.setdefault(filename, {}).update(arcs)
[ "Add", "measured", "arc", "data", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/data.py#L213-L220
[ "def", "add_arc_data", "(", "self", ",", "arc_data", ")", ":", "for", "filename", ",", "arcs", "in", "iitems", "(", "arc_data", ")", ":", "self", ".", "arcs", ".", "setdefault", "(", "filename", ",", "{", "}", ")", ".", "update", "(", "arcs", ")" ]
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
CoverageData.add_to_hash
Contribute `filename`'s data to the Md5Hash `hasher`.
virtualEnvironment/lib/python2.7/site-packages/coverage/data.py
def add_to_hash(self, filename, hasher): """Contribute `filename`'s data to the Md5Hash `hasher`.""" hasher.update(self.executed_lines(filename)) hasher.update(self.executed_arcs(filename))
def add_to_hash(self, filename, hasher): """Contribute `filename`'s data to the Md5Hash `hasher`.""" hasher.update(self.executed_lines(filename)) hasher.update(self.executed_arcs(filename))
[ "Contribute", "filename", "s", "data", "to", "the", "Md5Hash", "hasher", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/data.py#L243-L246
[ "def", "add_to_hash", "(", "self", ",", "filename", ",", "hasher", ")", ":", "hasher", ".", "update", "(", "self", ".", "executed_lines", "(", "filename", ")", ")", "hasher", ".", "update", "(", "self", ".", "executed_arcs", "(", "filename", ")", ")" ]
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
CoverageData.summary
Return a dict summarizing the coverage data. Keys are based on the filenames, and values are the number of executed lines. If `fullpath` is true, then the keys are the full pathnames of the files, otherwise they are the basenames of the files.
virtualEnvironment/lib/python2.7/site-packages/coverage/data.py
def summary(self, fullpath=False): """Return a dict summarizing the coverage data. Keys are based on the filenames, and values are the number of executed lines. If `fullpath` is true, then the keys are the full pathnames of the files, otherwise they are the basenames of the files. ...
def summary(self, fullpath=False): """Return a dict summarizing the coverage data. Keys are based on the filenames, and values are the number of executed lines. If `fullpath` is true, then the keys are the full pathnames of the files, otherwise they are the basenames of the files. ...
[ "Return", "a", "dict", "summarizing", "the", "coverage", "data", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/data.py#L248-L263
[ "def", "summary", "(", "self", ",", "fullpath", "=", "False", ")", ":", "summ", "=", "{", "}", "if", "fullpath", ":", "filename_fn", "=", "lambda", "f", ":", "f", "else", ":", "filename_fn", "=", "os", ".", "path", ".", "basename", "for", "filename",...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
get_pasted_lines
Yield pasted lines until the user enters the given sentinel value.
environment/lib/python2.7/site-packages/IPython/frontend/terminal/interactiveshell.py
def get_pasted_lines(sentinel, l_input=py3compat.input): """ Yield pasted lines until the user enters the given sentinel value. """ print "Pasting code; enter '%s' alone on the line to stop or use Ctrl-D." \ % sentinel while True: try: l = l_input(':') if l == s...
def get_pasted_lines(sentinel, l_input=py3compat.input): """ Yield pasted lines until the user enters the given sentinel value. """ print "Pasting code; enter '%s' alone on the line to stop or use Ctrl-D." \ % sentinel while True: try: l = l_input(':') if l == s...
[ "Yield", "pasted", "lines", "until", "the", "user", "enters", "the", "given", "sentinel", "value", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/terminal/interactiveshell.py#L59-L73
[ "def", "get_pasted_lines", "(", "sentinel", ",", "l_input", "=", "py3compat", ".", "input", ")", ":", "print", "\"Pasting code; enter '%s' alone on the line to stop or use Ctrl-D.\"", "%", "sentinel", "while", "True", ":", "try", ":", "l", "=", "l_input", "(", "':'"...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
TerminalInteractiveShell.mainloop
Start the mainloop. If an optional banner argument is given, it will override the internally created default banner.
environment/lib/python2.7/site-packages/IPython/frontend/terminal/interactiveshell.py
def mainloop(self, display_banner=None): """Start the mainloop. If an optional banner argument is given, it will override the internally created default banner. """ with nested(self.builtin_trap, self.display_trap): while 1: try: ...
def mainloop(self, display_banner=None): """Start the mainloop. If an optional banner argument is given, it will override the internally created default banner. """ with nested(self.builtin_trap, self.display_trap): while 1: try: ...
[ "Start", "the", "mainloop", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/terminal/interactiveshell.py#L456-L475
[ "def", "mainloop", "(", "self", ",", "display_banner", "=", "None", ")", ":", "with", "nested", "(", "self", ".", "builtin_trap", ",", "self", ".", "display_trap", ")", ":", "while", "1", ":", "try", ":", "self", ".", "interact", "(", "display_banner", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
TerminalInteractiveShell._replace_rlhist_multiline
Store multiple lines as a single entry in history
environment/lib/python2.7/site-packages/IPython/frontend/terminal/interactiveshell.py
def _replace_rlhist_multiline(self, source_raw, hlen_before_cell): """Store multiple lines as a single entry in history""" # do nothing without readline or disabled multiline if not self.has_readline or not self.multiline_history: return hlen_before_cell # windows rl has no...
def _replace_rlhist_multiline(self, source_raw, hlen_before_cell): """Store multiple lines as a single entry in history""" # do nothing without readline or disabled multiline if not self.has_readline or not self.multiline_history: return hlen_before_cell # windows rl has no...
[ "Store", "multiple", "lines", "as", "a", "single", "entry", "in", "history" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/terminal/interactiveshell.py#L477-L502
[ "def", "_replace_rlhist_multiline", "(", "self", ",", "source_raw", ",", "hlen_before_cell", ")", ":", "# do nothing without readline or disabled multiline", "if", "not", "self", ".", "has_readline", "or", "not", "self", ".", "multiline_history", ":", "return", "hlen_be...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
TerminalInteractiveShell.interact
Closely emulate the interactive Python console.
environment/lib/python2.7/site-packages/IPython/frontend/terminal/interactiveshell.py
def interact(self, display_banner=None): """Closely emulate the interactive Python console.""" # batch run -> do not interact if self.exit_now: return if display_banner is None: display_banner = self.display_banner if isinstance(display_banner, basestri...
def interact(self, display_banner=None): """Closely emulate the interactive Python console.""" # batch run -> do not interact if self.exit_now: return if display_banner is None: display_banner = self.display_banner if isinstance(display_banner, basestri...
[ "Closely", "emulate", "the", "interactive", "Python", "console", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/terminal/interactiveshell.py#L504-L591
[ "def", "interact", "(", "self", ",", "display_banner", "=", "None", ")", ":", "# batch run -> do not interact", "if", "self", ".", "exit_now", ":", "return", "if", "display_banner", "is", "None", ":", "display_banner", "=", "self", ".", "display_banner", "if", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
TerminalInteractiveShell.raw_input
Write a prompt and read a line. The returned line does not include the trailing newline. When the user enters the EOF key sequence, EOFError is raised. Optional inputs: - prompt(''): a string to be printed to prompt the user. - continue_prompt(False): whether this line is...
environment/lib/python2.7/site-packages/IPython/frontend/terminal/interactiveshell.py
def raw_input(self, prompt=''): """Write a prompt and read a line. The returned line does not include the trailing newline. When the user enters the EOF key sequence, EOFError is raised. Optional inputs: - prompt(''): a string to be printed to prompt the user. - c...
def raw_input(self, prompt=''): """Write a prompt and read a line. The returned line does not include the trailing newline. When the user enters the EOF key sequence, EOFError is raised. Optional inputs: - prompt(''): a string to be printed to prompt the user. - c...
[ "Write", "a", "prompt", "and", "read", "a", "line", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/terminal/interactiveshell.py#L593-L631
[ "def", "raw_input", "(", "self", ",", "prompt", "=", "''", ")", ":", "# Code run by the user may have modified the readline completer state.", "# We must ensure that our completer is back in place.", "if", "self", ".", "has_readline", ":", "self", ".", "set_readline_completer",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
TerminalInteractiveShell.edit_syntax_error
The bottom half of the syntax error handler called in the main loop. Loop until syntax error is fixed or user cancels.
environment/lib/python2.7/site-packages/IPython/frontend/terminal/interactiveshell.py
def edit_syntax_error(self): """The bottom half of the syntax error handler called in the main loop. Loop until syntax error is fixed or user cancels. """ while self.SyntaxTB.last_syntax_error: # copy and clear last_syntax_error err = self.SyntaxTB.clear_err_sta...
def edit_syntax_error(self): """The bottom half of the syntax error handler called in the main loop. Loop until syntax error is fixed or user cancels. """ while self.SyntaxTB.last_syntax_error: # copy and clear last_syntax_error err = self.SyntaxTB.clear_err_sta...
[ "The", "bottom", "half", "of", "the", "syntax", "error", "handler", "called", "in", "the", "main", "loop", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/terminal/interactiveshell.py#L637-L663
[ "def", "edit_syntax_error", "(", "self", ")", ":", "while", "self", ".", "SyntaxTB", ".", "last_syntax_error", ":", "# copy and clear last_syntax_error", "err", "=", "self", ".", "SyntaxTB", ".", "clear_err_state", "(", ")", "if", "not", "self", ".", "_should_re...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
TerminalInteractiveShell._should_recompile
Utility routine for edit_syntax_error
environment/lib/python2.7/site-packages/IPython/frontend/terminal/interactiveshell.py
def _should_recompile(self,e): """Utility routine for edit_syntax_error""" if e.filename in ('<ipython console>','<input>','<string>', '<console>','<BackgroundJob compilation>', None): return False try: if (self.autoed...
def _should_recompile(self,e): """Utility routine for edit_syntax_error""" if e.filename in ('<ipython console>','<input>','<string>', '<console>','<BackgroundJob compilation>', None): return False try: if (self.autoed...
[ "Utility", "routine", "for", "edit_syntax_error" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/terminal/interactiveshell.py#L665-L693
[ "def", "_should_recompile", "(", "self", ",", "e", ")", ":", "if", "e", ".", "filename", "in", "(", "'<ipython console>'", ",", "'<input>'", ",", "'<string>'", ",", "'<console>'", ",", "'<BackgroundJob compilation>'", ",", "None", ")", ":", "return", "False", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
TerminalInteractiveShell.exit
Handle interactive exit. This method calls the ask_exit callback.
environment/lib/python2.7/site-packages/IPython/frontend/terminal/interactiveshell.py
def exit(self): """Handle interactive exit. This method calls the ask_exit callback.""" if self.confirm_exit: if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'): self.ask_exit() else: self.ask_exit()
def exit(self): """Handle interactive exit. This method calls the ask_exit callback.""" if self.confirm_exit: if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'): self.ask_exit() else: self.ask_exit()
[ "Handle", "interactive", "exit", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/terminal/interactiveshell.py#L703-L711
[ "def", "exit", "(", "self", ")", ":", "if", "self", ".", "confirm_exit", ":", "if", "self", ".", "ask_yes_no", "(", "'Do you really want to exit ([y]/n)?'", ",", "'y'", ")", ":", "self", ".", "ask_exit", "(", ")", "else", ":", "self", ".", "ask_exit", "(...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
VersionControl.get_url_rev
Returns the correct repository URL and revision by parsing the given repository URL
environment/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg/pip/vcs/__init__.py
def get_url_rev(self): """ Returns the correct repository URL and revision by parsing the given repository URL """ error_message= ( "Sorry, '%s' is a malformed VCS url. " "Ihe format is <vcs>+<protocol>://<url>, " "e.g. svn+http://myrepo/svn/MyApp...
def get_url_rev(self): """ Returns the correct repository URL and revision by parsing the given repository URL """ error_message= ( "Sorry, '%s' is a malformed VCS url. " "Ihe format is <vcs>+<protocol>://<url>, " "e.g. svn+http://myrepo/svn/MyApp...
[ "Returns", "the", "correct", "repository", "URL", "and", "revision", "by", "parsing", "the", "given", "repository", "URL" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg/pip/vcs/__init__.py#L115-L131
[ "def", "get_url_rev", "(", "self", ")", ":", "error_message", "=", "(", "\"Sorry, '%s' is a malformed VCS url. \"", "\"Ihe format is <vcs>+<protocol>://<url>, \"", "\"e.g. svn+http://myrepo/svn/MyApp#egg=MyApp\"", ")", "assert", "'+'", "in", "self", ".", "url", ",", "error_me...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
dispose_at_exit
register `exitable.__exit__()` into `atexit` module. return the `exitable` itself.
jasily/lang/exitable.py
def dispose_at_exit(exitable): ''' register `exitable.__exit__()` into `atexit` module. return the `exitable` itself. ''' @atexit.register def callback(): exitable.__exit__(*sys.exc_info()) return exitable
def dispose_at_exit(exitable): ''' register `exitable.__exit__()` into `atexit` module. return the `exitable` itself. ''' @atexit.register def callback(): exitable.__exit__(*sys.exc_info()) return exitable
[ "register", "exitable", ".", "__exit__", "()", "into", "atexit", "module", "." ]
Jasily/jasily-python
python
https://github.com/Jasily/jasily-python/blob/1c821a120ebbbbc3c5761f5f1e8a73588059242a/jasily/lang/exitable.py#L11-L20
[ "def", "dispose_at_exit", "(", "exitable", ")", ":", "@", "atexit", ".", "register", "def", "callback", "(", ")", ":", "exitable", ".", "__exit__", "(", "*", "sys", ".", "exc_info", "(", ")", ")", "return", "exitable" ]
1c821a120ebbbbc3c5761f5f1e8a73588059242a
test
IPythonQtConsoleApp.new_frontend_master
Create and return new frontend attached to new kernel, launched on localhost.
environment/lib/python2.7/site-packages/IPython/frontend/qt/console/qtconsoleapp.py
def new_frontend_master(self): """ Create and return new frontend attached to new kernel, launched on localhost. """ ip = self.ip if self.ip in LOCAL_IPS else LOCALHOST kernel_manager = self.kernel_manager_class( ip=ip, conn...
def new_frontend_master(self): """ Create and return new frontend attached to new kernel, launched on localhost. """ ip = self.ip if self.ip in LOCAL_IPS else LOCALHOST kernel_manager = self.kernel_manager_class( ip=ip, conn...
[ "Create", "and", "return", "new", "frontend", "attached", "to", "new", "kernel", "launched", "on", "localhost", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/qtconsoleapp.py#L193-L214
[ "def", "new_frontend_master", "(", "self", ")", ":", "ip", "=", "self", ".", "ip", "if", "self", ".", "ip", "in", "LOCAL_IPS", "else", "LOCALHOST", "kernel_manager", "=", "self", ".", "kernel_manager_class", "(", "ip", "=", "ip", ",", "connection_file", "=...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
IPythonQtConsoleApp.new_frontend_slave
Create and return a new frontend attached to an existing kernel. Parameters ---------- current_widget : IPythonWidget The IPythonWidget whose kernel this frontend is to share
environment/lib/python2.7/site-packages/IPython/frontend/qt/console/qtconsoleapp.py
def new_frontend_slave(self, current_widget): """Create and return a new frontend attached to an existing kernel. Parameters ---------- current_widget : IPythonWidget The IPythonWidget whose kernel this frontend is to share """ kernel_manager = self.k...
def new_frontend_slave(self, current_widget): """Create and return a new frontend attached to an existing kernel. Parameters ---------- current_widget : IPythonWidget The IPythonWidget whose kernel this frontend is to share """ kernel_manager = self.k...
[ "Create", "and", "return", "a", "new", "frontend", "attached", "to", "an", "existing", "kernel", ".", "Parameters", "----------", "current_widget", ":", "IPythonWidget", "The", "IPythonWidget", "whose", "kernel", "this", "frontend", "is", "to", "share" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/qtconsoleapp.py#L216-L237
[ "def", "new_frontend_slave", "(", "self", ",", "current_widget", ")", ":", "kernel_manager", "=", "self", ".", "kernel_manager_class", "(", "connection_file", "=", "current_widget", ".", "kernel_manager", ".", "connection_file", ",", "config", "=", "self", ".", "c...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
IPythonQtConsoleApp.init_colors
Configure the coloring of the widget
environment/lib/python2.7/site-packages/IPython/frontend/qt/console/qtconsoleapp.py
def init_colors(self, widget): """Configure the coloring of the widget""" # Note: This will be dramatically simplified when colors # are removed from the backend. # parse the colors arg down to current known labels try: colors = self.config.ZMQInteractiveShell.colors...
def init_colors(self, widget): """Configure the coloring of the widget""" # Note: This will be dramatically simplified when colors # are removed from the backend. # parse the colors arg down to current known labels try: colors = self.config.ZMQInteractiveShell.colors...
[ "Configure", "the", "coloring", "of", "the", "widget" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/qtconsoleapp.py#L268-L325
[ "def", "init_colors", "(", "self", ",", "widget", ")", ":", "# Note: This will be dramatically simplified when colors", "# are removed from the backend.", "# parse the colors arg down to current known labels", "try", ":", "colors", "=", "self", ".", "config", ".", "ZMQInteracti...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
EngineCommunicator.info
return the connection info for this object's sockets.
environment/share/doc/ipython/examples/parallel/interengine/communicator.py
def info(self): """return the connection info for this object's sockets.""" return (self.identity, self.url, self.pub_url, self.location)
def info(self): """return the connection info for this object's sockets.""" return (self.identity, self.url, self.pub_url, self.location)
[ "return", "the", "connection", "info", "for", "this", "object", "s", "sockets", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/share/doc/ipython/examples/parallel/interengine/communicator.py#L38-L40
[ "def", "info", "(", "self", ")", ":", "return", "(", "self", ".", "identity", ",", "self", ".", "url", ",", "self", ".", "pub_url", ",", "self", ".", "location", ")" ]
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
EngineCommunicator.connect
connect to peers. `peers` will be a dict of 4-tuples, keyed by name. {peer : (ident, addr, pub_addr, location)} where peer is the name, ident is the XREP identity, addr,pub_addr are the
environment/share/doc/ipython/examples/parallel/interengine/communicator.py
def connect(self, peers): """connect to peers. `peers` will be a dict of 4-tuples, keyed by name. {peer : (ident, addr, pub_addr, location)} where peer is the name, ident is the XREP identity, addr,pub_addr are the """ for peer, (ident, url, pub_url, location) in peers.items(): ...
def connect(self, peers): """connect to peers. `peers` will be a dict of 4-tuples, keyed by name. {peer : (ident, addr, pub_addr, location)} where peer is the name, ident is the XREP identity, addr,pub_addr are the """ for peer, (ident, url, pub_url, location) in peers.items(): ...
[ "connect", "to", "peers", ".", "peers", "will", "be", "a", "dict", "of", "4", "-", "tuples", "keyed", "by", "name", ".", "{", "peer", ":", "(", "ident", "addr", "pub_addr", "location", ")", "}", "where", "peer", "is", "the", "name", "ident", "is", ...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/share/doc/ipython/examples/parallel/interengine/communicator.py#L42-L55
[ "def", "connect", "(", "self", ",", "peers", ")", ":", "for", "peer", ",", "(", "ident", ",", "url", ",", "pub_url", ",", "location", ")", "in", "peers", ".", "items", "(", ")", ":", "self", ".", "peers", "[", "peer", "]", "=", "ident", "if", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Rconverter
Convert an object in R's namespace to one suitable for ipython's namespace. For a data.frame, it tries to return a structured array. It first checks for colnames, then names. If all are NULL, it returns np.asarray(Robj), else it tries to construct a recarray Parameters ---------- Robj...
environment/lib/python2.7/site-packages/IPython/extensions/rmagic.py
def Rconverter(Robj, dataframe=False): """ Convert an object in R's namespace to one suitable for ipython's namespace. For a data.frame, it tries to return a structured array. It first checks for colnames, then names. If all are NULL, it returns np.asarray(Robj), else it tries to construct ...
def Rconverter(Robj, dataframe=False): """ Convert an object in R's namespace to one suitable for ipython's namespace. For a data.frame, it tries to return a structured array. It first checks for colnames, then names. If all are NULL, it returns np.asarray(Robj), else it tries to construct ...
[ "Convert", "an", "object", "in", "R", "s", "namespace", "to", "one", "suitable", "for", "ipython", "s", "namespace", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/extensions/rmagic.py#L83-L115
[ "def", "Rconverter", "(", "Robj", ",", "dataframe", "=", "False", ")", ":", "is_data_frame", "=", "ro", ".", "r", "(", "'is.data.frame'", ")", "colnames", "=", "ro", ".", "r", "(", "'colnames'", ")", "rownames", "=", "ro", ".", "r", "(", "'rownames'", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
findsource
Return the entire source file and starting line number for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a list of all the lines in the file and the line number indexes a line in that list. An IOError is raised if th...
environment/lib/python2.7/site-packages/IPython/core/ultratb.py
def findsource(object): """Return the entire source file and starting line number for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a list of all the lines in the file and the line number indexes a line in that list. ...
def findsource(object): """Return the entire source file and starting line number for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a list of all the lines in the file and the line number indexes a line in that list. ...
[ "Return", "the", "entire", "source", "file", "and", "starting", "line", "number", "for", "an", "object", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/ultratb.py#L138-L211
[ "def", "findsource", "(", "object", ")", ":", "file", "=", "getsourcefile", "(", "object", ")", "or", "getfile", "(", "object", ")", "# If the object is a frame, then trying to get the globals dict from its", "# module won't work. Instead, the frame object itself has the globals"...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
fix_frame_records_filenames
Try to fix the filenames in each record from inspect.getinnerframes(). Particularly, modules loaded from within zip files have useless filenames attached to their code object, and inspect.getinnerframes() just uses it.
environment/lib/python2.7/site-packages/IPython/core/ultratb.py
def fix_frame_records_filenames(records): """Try to fix the filenames in each record from inspect.getinnerframes(). Particularly, modules loaded from within zip files have useless filenames attached to their code object, and inspect.getinnerframes() just uses it. """ fixed_records = [] for fram...
def fix_frame_records_filenames(records): """Try to fix the filenames in each record from inspect.getinnerframes(). Particularly, modules loaded from within zip files have useless filenames attached to their code object, and inspect.getinnerframes() just uses it. """ fixed_records = [] for fram...
[ "Try", "to", "fix", "the", "filenames", "in", "each", "record", "from", "inspect", ".", "getinnerframes", "()", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/ultratb.py#L218-L235
[ "def", "fix_frame_records_filenames", "(", "records", ")", ":", "fixed_records", "=", "[", "]", "for", "frame", ",", "filename", ",", "line_no", ",", "func_name", ",", "lines", ",", "index", "in", "records", ":", "# Look inside the frame's globals dictionary for __f...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
TBTools.set_colors
Shorthand access to the color table scheme selector method.
environment/lib/python2.7/site-packages/IPython/core/ultratb.py
def set_colors(self,*args,**kw): """Shorthand access to the color table scheme selector method.""" # Set own color table self.color_scheme_table.set_active_scheme(*args,**kw) # for convenience, set Colors to the active scheme self.Colors = self.color_scheme_table.active_colors ...
def set_colors(self,*args,**kw): """Shorthand access to the color table scheme selector method.""" # Set own color table self.color_scheme_table.set_active_scheme(*args,**kw) # for convenience, set Colors to the active scheme self.Colors = self.color_scheme_table.active_colors ...
[ "Shorthand", "access", "to", "the", "color", "table", "scheme", "selector", "method", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/ultratb.py#L380-L389
[ "def", "set_colors", "(", "self", ",", "*", "args", ",", "*", "*", "kw", ")", ":", "# Set own color table", "self", ".", "color_scheme_table", ".", "set_active_scheme", "(", "*", "args", ",", "*", "*", "kw", ")", "# for convenience, set Colors to the active sche...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
TBTools.color_toggle
Toggle between the currently active color scheme and NoColor.
environment/lib/python2.7/site-packages/IPython/core/ultratb.py
def color_toggle(self): """Toggle between the currently active color scheme and NoColor.""" if self.color_scheme_table.active_scheme_name == 'NoColor': self.color_scheme_table.set_active_scheme(self.old_scheme) self.Colors = self.color_scheme_table.active_colors else: ...
def color_toggle(self): """Toggle between the currently active color scheme and NoColor.""" if self.color_scheme_table.active_scheme_name == 'NoColor': self.color_scheme_table.set_active_scheme(self.old_scheme) self.Colors = self.color_scheme_table.active_colors else: ...
[ "Toggle", "between", "the", "currently", "active", "color", "scheme", "and", "NoColor", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/ultratb.py#L391-L400
[ "def", "color_toggle", "(", "self", ")", ":", "if", "self", ".", "color_scheme_table", ".", "active_scheme_name", "==", "'NoColor'", ":", "self", ".", "color_scheme_table", ".", "set_active_scheme", "(", "self", ".", "old_scheme", ")", "self", ".", "Colors", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
TBTools.text
Return formatted traceback. Subclasses may override this if they add extra arguments.
environment/lib/python2.7/site-packages/IPython/core/ultratb.py
def text(self, etype, value, tb, tb_offset=None, context=5): """Return formatted traceback. Subclasses may override this if they add extra arguments. """ tb_list = self.structured_traceback(etype, value, tb, tb_offset, context) return ...
def text(self, etype, value, tb, tb_offset=None, context=5): """Return formatted traceback. Subclasses may override this if they add extra arguments. """ tb_list = self.structured_traceback(etype, value, tb, tb_offset, context) return ...
[ "Return", "formatted", "traceback", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/ultratb.py#L406-L413
[ "def", "text", "(", "self", ",", "etype", ",", "value", ",", "tb", ",", "tb_offset", "=", "None", ",", "context", "=", "5", ")", ":", "tb_list", "=", "self", ".", "structured_traceback", "(", "etype", ",", "value", ",", "tb", ",", "tb_offset", ",", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
ListTB.structured_traceback
Return a color formatted string with the traceback info. Parameters ---------- etype : exception type Type of the exception raised. value : object Data stored in the exception elist : list List of frames, see class docstring for details. ...
environment/lib/python2.7/site-packages/IPython/core/ultratb.py
def structured_traceback(self, etype, value, elist, tb_offset=None, context=5): """Return a color formatted string with the traceback info. Parameters ---------- etype : exception type Type of the exception raised. value : object ...
def structured_traceback(self, etype, value, elist, tb_offset=None, context=5): """Return a color formatted string with the traceback info. Parameters ---------- etype : exception type Type of the exception raised. value : object ...
[ "Return", "a", "color", "formatted", "string", "with", "the", "traceback", "info", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/ultratb.py#L453-L504
[ "def", "structured_traceback", "(", "self", ",", "etype", ",", "value", ",", "elist", ",", "tb_offset", "=", "None", ",", "context", "=", "5", ")", ":", "tb_offset", "=", "self", ".", "tb_offset", "if", "tb_offset", "is", "None", "else", "tb_offset", "Co...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
ListTB._format_list
Format a list of traceback entry tuples for printing. Given a list of tuples as returned by extract_tb() or extract_stack(), return a list of strings ready for printing. Each string in the resulting list corresponds to the item with the same index in the argument list. Each string ends...
environment/lib/python2.7/site-packages/IPython/core/ultratb.py
def _format_list(self, extracted_list): """Format a list of traceback entry tuples for printing. Given a list of tuples as returned by extract_tb() or extract_stack(), return a list of strings ready for printing. Each string in the resulting list corresponds to the item with the ...
def _format_list(self, extracted_list): """Format a list of traceback entry tuples for printing. Given a list of tuples as returned by extract_tb() or extract_stack(), return a list of strings ready for printing. Each string in the resulting list corresponds to the item with the ...
[ "Format", "a", "list", "of", "traceback", "entry", "tuples", "for", "printing", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/ultratb.py#L506-L542
[ "def", "_format_list", "(", "self", ",", "extracted_list", ")", ":", "Colors", "=", "self", ".", "Colors", "list", "=", "[", "]", "for", "filename", ",", "lineno", ",", "name", ",", "line", "in", "extracted_list", "[", ":", "-", "1", "]", ":", "item"...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e