repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
75
19.8k
code_tokens
list
docstring
stringlengths
3
17.3k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
87
242
partition
stringclasses
1 value
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Dot.py
Dot.all_node_style
def all_node_style(self, **kwargs): ''' Modifies all node styles ''' for node in self.nodes: self.node_style(node, **kwargs)
python
def all_node_style(self, **kwargs): ''' Modifies all node styles ''' for node in self.nodes: self.node_style(node, **kwargs)
[ "def", "all_node_style", "(", "self", ",", "**", "kwargs", ")", ":", "for", "node", "in", "self", ".", "nodes", ":", "self", ".", "node_style", "(", "node", ",", "**", "kwargs", ")" ]
Modifies all node styles
[ "Modifies", "all", "node", "styles" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Dot.py#L200-L205
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Dot.py
Dot.edge_style
def edge_style(self, head, tail, **kwargs): ''' Modifies an edge style to the dot representation. ''' if tail not in self.nodes: raise GraphError("invalid node %s" % (tail,)) try: if tail not in self.edges[head]: self.edges[head][tail]= {}...
python
def edge_style(self, head, tail, **kwargs): ''' Modifies an edge style to the dot representation. ''' if tail not in self.nodes: raise GraphError("invalid node %s" % (tail,)) try: if tail not in self.edges[head]: self.edges[head][tail]= {}...
[ "def", "edge_style", "(", "self", ",", "head", ",", "tail", ",", "**", "kwargs", ")", ":", "if", "tail", "not", "in", "self", ".", "nodes", ":", "raise", "GraphError", "(", "\"invalid node %s\"", "%", "(", "tail", ",", ")", ")", "try", ":", "if", "...
Modifies an edge style to the dot representation.
[ "Modifies", "an", "edge", "style", "to", "the", "dot", "representation", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Dot.py#L207-L219
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Dot.py
Dot.save_dot
def save_dot(self, file_name=None): ''' Saves the current graph representation into a file ''' if not file_name: warnings.warn(DeprecationWarning, "always pass a file_name") file_name = self.temp_dot fp = open(file_name, "w") try: f...
python
def save_dot(self, file_name=None): ''' Saves the current graph representation into a file ''' if not file_name: warnings.warn(DeprecationWarning, "always pass a file_name") file_name = self.temp_dot fp = open(file_name, "w") try: f...
[ "def", "save_dot", "(", "self", ",", "file_name", "=", "None", ")", ":", "if", "not", "file_name", ":", "warnings", ".", "warn", "(", "DeprecationWarning", ",", "\"always pass a file_name\"", ")", "file_name", "=", "self", ".", "temp_dot", "fp", "=", "open",...
Saves the current graph representation into a file
[ "Saves", "the", "current", "graph", "representation", "into", "a", "file" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Dot.py#L264-L278
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Dot.py
Dot.save_img
def save_img(self, file_name=None, file_type="gif", mode='dot'): ''' Saves the dot file as an image file ''' if not file_name: warnings.warn(DeprecationWarning, "always pass a file_name") file_name = "out" if mode == 'neato': self.save_dot(s...
python
def save_img(self, file_name=None, file_type="gif", mode='dot'): ''' Saves the dot file as an image file ''' if not file_name: warnings.warn(DeprecationWarning, "always pass a file_name") file_name = "out" if mode == 'neato': self.save_dot(s...
[ "def", "save_img", "(", "self", ",", "file_name", "=", "None", ",", "file_type", "=", "\"gif\"", ",", "mode", "=", "'dot'", ")", ":", "if", "not", "file_name", ":", "warnings", ".", "warn", "(", "DeprecationWarning", ",", "\"always pass a file_name\"", ")", ...
Saves the dot file as an image file
[ "Saves", "the", "dot", "file", "as", "an", "image", "file" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Dot.py#L280-L300
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/utils/hg.py
get_repo_revision
def get_repo_revision(): ''' Returns mercurial revision string somelike `hg identify` does. Format is rev1:short-id1+;rev2:short-id2+ Returns an empty string if anything goes wrong, such as missing .hg files or an unexpected format of internal HG files or no mercurial repository found. '''...
python
def get_repo_revision(): ''' Returns mercurial revision string somelike `hg identify` does. Format is rev1:short-id1+;rev2:short-id2+ Returns an empty string if anything goes wrong, such as missing .hg files or an unexpected format of internal HG files or no mercurial repository found. '''...
[ "def", "get_repo_revision", "(", ")", ":", "repopath", "=", "_findrepo", "(", ")", "if", "not", "repopath", ":", "return", "''", "try", ":", "import", "mercurial", ".", "hg", ",", "mercurial", ".", "ui", ",", "mercurial", ".", "scmutil", "from", "mercuri...
Returns mercurial revision string somelike `hg identify` does. Format is rev1:short-id1+;rev2:short-id2+ Returns an empty string if anything goes wrong, such as missing .hg files or an unexpected format of internal HG files or no mercurial repository found.
[ "Returns", "mercurial", "revision", "string", "somelike", "hg", "identify", "does", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/utils/hg.py#L35-L64
train
bwhite/hadoopy
examples/l4-vision-and-image-processing-with-hadoop/ex1-haystack/haystack.py
Reducer.reduce
def reduce(self, key, values): """Select the image with the minimum distance Args: key: (see mapper) values: (see mapper) Yields: A tuple in the form of (key, value) key: Image name value: Image as jpeg byte data """ ...
python
def reduce(self, key, values): """Select the image with the minimum distance Args: key: (see mapper) values: (see mapper) Yields: A tuple in the form of (key, value) key: Image name value: Image as jpeg byte data """ ...
[ "def", "reduce", "(", "self", ",", "key", ",", "values", ")", ":", "dist", ",", "key", ",", "value", "=", "min", "(", "values", ",", "key", "=", "lambda", "x", ":", "x", "[", "0", "]", ")", "print", "(", "'MinDist[%f]'", "%", "dist", ")", "yiel...
Select the image with the minimum distance Args: key: (see mapper) values: (see mapper) Yields: A tuple in the form of (key, value) key: Image name value: Image as jpeg byte data
[ "Select", "the", "image", "with", "the", "minimum", "distance" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/examples/l4-vision-and-image-processing-with-hadoop/ex1-haystack/haystack.py#L64-L79
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/loader/archive.py
Archive.checkmagic
def checkmagic(self): """ Overridable. Check to see if the file object self.lib actually has a file we understand. """ self.lib.seek(self.start) # default - magic is at start of file if self.lib.read(len(self.MAGIC)) != self.MAGIC: raise ArchiveReadE...
python
def checkmagic(self): """ Overridable. Check to see if the file object self.lib actually has a file we understand. """ self.lib.seek(self.start) # default - magic is at start of file if self.lib.read(len(self.MAGIC)) != self.MAGIC: raise ArchiveReadE...
[ "def", "checkmagic", "(", "self", ")", ":", "self", ".", "lib", ".", "seek", "(", "self", ".", "start", ")", "if", "self", ".", "lib", ".", "read", "(", "len", "(", "self", ".", "MAGIC", ")", ")", "!=", "self", ".", "MAGIC", ":", "raise", "Arch...
Overridable. Check to see if the file object self.lib actually has a file we understand.
[ "Overridable", ".", "Check", "to", "see", "if", "the", "file", "object", "self", ".", "lib", "actually", "has", "a", "file", "we", "understand", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/loader/archive.py#L105-L121
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/loader/archive.py
Archive.update_headers
def update_headers(self, tocpos): """ Default - MAGIC + Python's magic + tocpos """ self.lib.seek(self.start) self.lib.write(self.MAGIC) self.lib.write(self.pymagic) self.lib.write(struct.pack('!i', tocpos))
python
def update_headers(self, tocpos): """ Default - MAGIC + Python's magic + tocpos """ self.lib.seek(self.start) self.lib.write(self.MAGIC) self.lib.write(self.pymagic) self.lib.write(struct.pack('!i', tocpos))
[ "def", "update_headers", "(", "self", ",", "tocpos", ")", ":", "self", ".", "lib", ".", "seek", "(", "self", ".", "start", ")", "self", ".", "lib", ".", "write", "(", "self", ".", "MAGIC", ")", "self", ".", "lib", ".", "write", "(", "self", ".", ...
Default - MAGIC + Python's magic + tocpos
[ "Default", "-", "MAGIC", "+", "Python", "s", "magic", "+", "tocpos" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/loader/archive.py#L243-L250
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/macholib/util.py
flipwritable
def flipwritable(fn, mode=None): """ Flip the writability of a file and return the old mode. Returns None if the file is already writable. """ if os.access(fn, os.W_OK): return None old_mode = os.stat(fn).st_mode os.chmod(fn, stat.S_IWRITE | old_mode) return old_mode
python
def flipwritable(fn, mode=None): """ Flip the writability of a file and return the old mode. Returns None if the file is already writable. """ if os.access(fn, os.W_OK): return None old_mode = os.stat(fn).st_mode os.chmod(fn, stat.S_IWRITE | old_mode) return old_mode
[ "def", "flipwritable", "(", "fn", ",", "mode", "=", "None", ")", ":", "if", "os", ".", "access", "(", "fn", ",", "os", ".", "W_OK", ")", ":", "return", "None", "old_mode", "=", "os", ".", "stat", "(", "fn", ")", ".", "st_mode", "os", ".", "chmo...
Flip the writability of a file and return the old mode. Returns None if the file is already writable.
[ "Flip", "the", "writability", "of", "a", "file", "and", "return", "the", "old", "mode", ".", "Returns", "None", "if", "the", "file", "is", "already", "writable", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/macholib/util.py#L44-L53
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/macholib/util.py
mergecopy
def mergecopy(src, dest): """ copy2, but only if the destination isn't up to date """ if os.path.exists(dest) and os.stat(dest).st_mtime >= os.stat(src).st_mtime: return copy2(src, dest)
python
def mergecopy(src, dest): """ copy2, but only if the destination isn't up to date """ if os.path.exists(dest) and os.stat(dest).st_mtime >= os.stat(src).st_mtime: return copy2(src, dest)
[ "def", "mergecopy", "(", "src", ",", "dest", ")", ":", "if", "os", ".", "path", ".", "exists", "(", "dest", ")", "and", "os", ".", "stat", "(", "dest", ")", ".", "st_mtime", ">=", "os", ".", "stat", "(", "src", ")", ".", "st_mtime", ":", "retur...
copy2, but only if the destination isn't up to date
[ "copy2", "but", "only", "if", "the", "destination", "isn", "t", "up", "to", "date" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/macholib/util.py#L104-L110
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/macholib/util.py
sdk_normalize
def sdk_normalize(filename): """ Normalize a path to strip out the SDK portion, normally so that it can be decided whether it is in a system path or not. """ if filename.startswith('/Developer/SDKs/'): pathcomp = filename.split('/') del pathcomp[1:4] filename = '/'.join(pathc...
python
def sdk_normalize(filename): """ Normalize a path to strip out the SDK portion, normally so that it can be decided whether it is in a system path or not. """ if filename.startswith('/Developer/SDKs/'): pathcomp = filename.split('/') del pathcomp[1:4] filename = '/'.join(pathc...
[ "def", "sdk_normalize", "(", "filename", ")", ":", "if", "filename", ".", "startswith", "(", "'/Developer/SDKs/'", ")", ":", "pathcomp", "=", "filename", ".", "split", "(", "'/'", ")", "del", "pathcomp", "[", "1", ":", "4", "]", "filename", "=", "'/'", ...
Normalize a path to strip out the SDK portion, normally so that it can be decided whether it is in a system path or not.
[ "Normalize", "a", "path", "to", "strip", "out", "the", "SDK", "portion", "normally", "so", "that", "it", "can", "be", "decided", "whether", "it", "is", "in", "a", "system", "path", "or", "not", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/macholib/util.py#L146-L155
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/macholib/util.py
in_system_path
def in_system_path(filename): """ Return True if the file is in a system path """ fn = sdk_normalize(os.path.realpath(filename)) if fn.startswith('/usr/local/'): return False elif fn.startswith('/System/') or fn.startswith('/usr/'): return True else: return False
python
def in_system_path(filename): """ Return True if the file is in a system path """ fn = sdk_normalize(os.path.realpath(filename)) if fn.startswith('/usr/local/'): return False elif fn.startswith('/System/') or fn.startswith('/usr/'): return True else: return False
[ "def", "in_system_path", "(", "filename", ")", ":", "fn", "=", "sdk_normalize", "(", "os", ".", "path", ".", "realpath", "(", "filename", ")", ")", "if", "fn", ".", "startswith", "(", "'/usr/local/'", ")", ":", "return", "False", "elif", "fn", ".", "st...
Return True if the file is in a system path
[ "Return", "True", "if", "the", "file", "is", "in", "a", "system", "path" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/macholib/util.py#L157-L167
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/macholib/util.py
is_platform_file
def is_platform_file(path): """ Return True if the file is Mach-O """ if not os.path.exists(path) or os.path.islink(path): return False # If the header is fat, we need to read into the first arch fileobj = open(path, 'rb') bytes = fileobj.read(MAGIC_LEN) if bytes == FAT_MAGIC_BYT...
python
def is_platform_file(path): """ Return True if the file is Mach-O """ if not os.path.exists(path) or os.path.islink(path): return False # If the header is fat, we need to read into the first arch fileobj = open(path, 'rb') bytes = fileobj.read(MAGIC_LEN) if bytes == FAT_MAGIC_BYT...
[ "def", "is_platform_file", "(", "path", ")", ":", "if", "not", "os", ".", "path", ".", "exists", "(", "path", ")", "or", "os", ".", "path", ".", "islink", "(", "path", ")", ":", "return", "False", "fileobj", "=", "open", "(", "path", ",", "'rb'", ...
Return True if the file is Mach-O
[ "Return", "True", "if", "the", "file", "is", "Mach", "-", "O" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/macholib/util.py#L181-L205
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/macholib/util.py
iter_platform_files
def iter_platform_files(dst): """ Walk a directory and yield each full path that is a Mach-O file """ for root, dirs, files in os.walk(dst): for fn in files: fn = os.path.join(root, fn) if is_platform_file(fn): yield fn
python
def iter_platform_files(dst): """ Walk a directory and yield each full path that is a Mach-O file """ for root, dirs, files in os.walk(dst): for fn in files: fn = os.path.join(root, fn) if is_platform_file(fn): yield fn
[ "def", "iter_platform_files", "(", "dst", ")", ":", "for", "root", ",", "dirs", ",", "files", "in", "os", ".", "walk", "(", "dst", ")", ":", "for", "fn", "in", "files", ":", "fn", "=", "os", ".", "path", ".", "join", "(", "root", ",", "fn", ")"...
Walk a directory and yield each full path that is a Mach-O file
[ "Walk", "a", "directory", "and", "yield", "each", "full", "path", "that", "is", "a", "Mach", "-", "O", "file" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/macholib/util.py#L207-L215
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/macholib/util.py
strip_files
def strip_files(files, argv_max=(256 * 1024)): """ Strip a list of files """ tostrip = [(fn, flipwritable(fn)) for fn in files] while tostrip: cmd = list(STRIPCMD) flips = [] pathlen = reduce(operator.add, [len(s) + 1 for s in cmd]) while pathlen < argv_max: ...
python
def strip_files(files, argv_max=(256 * 1024)): """ Strip a list of files """ tostrip = [(fn, flipwritable(fn)) for fn in files] while tostrip: cmd = list(STRIPCMD) flips = [] pathlen = reduce(operator.add, [len(s) + 1 for s in cmd]) while pathlen < argv_max: ...
[ "def", "strip_files", "(", "files", ",", "argv_max", "=", "(", "256", "*", "1024", ")", ")", ":", "tostrip", "=", "[", "(", "fn", ",", "flipwritable", "(", "fn", ")", ")", "for", "fn", "in", "files", "]", "while", "tostrip", ":", "cmd", "=", "lis...
Strip a list of files
[ "Strip", "a", "list", "of", "files" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/macholib/util.py#L217-L238
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/__subprocess.py
check_call
def check_call(*popenargs, **kwargs): """Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. The arguments are the same as for the...
python
def check_call(*popenargs, **kwargs): """Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. The arguments are the same as for the...
[ "def", "check_call", "(", "*", "popenargs", ",", "**", "kwargs", ")", ":", "retcode", "=", "call", "(", "*", "popenargs", ",", "**", "kwargs", ")", "cmd", "=", "kwargs", ".", "get", "(", "\"args\"", ")", "if", "cmd", "is", "None", ":", "cmd", "=", ...
Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. The arguments are the same as for the Popen constructor. Example: check_call...
[ "Run", "command", "with", "arguments", ".", "Wait", "for", "command", "to", "complete", ".", "If", "the", "exit", "code", "was", "zero", "then", "return", "otherwise", "raise", "CalledProcessError", ".", "The", "CalledProcessError", "object", "will", "have", "...
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/__subprocess.py#L493-L509
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/hooks/hookutils.py
__exec_python_cmd
def __exec_python_cmd(cmd): """ Executes an externally spawned Python interpreter and returns anything that was emitted in the standard output as a single string. """ # Prepend PYTHONPATH with pathex pp = os.pathsep.join(PyInstaller.__pathex__) old_pp = compat.getenv('PYTHONPATH') if...
python
def __exec_python_cmd(cmd): """ Executes an externally spawned Python interpreter and returns anything that was emitted in the standard output as a single string. """ # Prepend PYTHONPATH with pathex pp = os.pathsep.join(PyInstaller.__pathex__) old_pp = compat.getenv('PYTHONPATH') if...
[ "def", "__exec_python_cmd", "(", "cmd", ")", ":", "pp", "=", "os", ".", "pathsep", ".", "join", "(", "PyInstaller", ".", "__pathex__", ")", "old_pp", "=", "compat", ".", "getenv", "(", "'PYTHONPATH'", ")", "if", "old_pp", ":", "pp", "=", "os", ".", "...
Executes an externally spawned Python interpreter and returns anything that was emitted in the standard output as a single string.
[ "Executes", "an", "externally", "spawned", "Python", "interpreter", "and", "returns", "anything", "that", "was", "emitted", "in", "the", "standard", "output", "as", "a", "single", "string", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/hooks/hookutils.py#L14-L36
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/hooks/hookutils.py
exec_script
def exec_script(scriptfilename, *args): """ Executes a Python script in an externally spawned interpreter, and returns anything that was emitted in the standard output as a single string. To prevent missuse, the script passed to hookutils.exec-script must be located in the `hooks` directory. ...
python
def exec_script(scriptfilename, *args): """ Executes a Python script in an externally spawned interpreter, and returns anything that was emitted in the standard output as a single string. To prevent missuse, the script passed to hookutils.exec-script must be located in the `hooks` directory. ...
[ "def", "exec_script", "(", "scriptfilename", ",", "*", "args", ")", ":", "if", "scriptfilename", "!=", "os", ".", "path", ".", "basename", "(", "scriptfilename", ")", ":", "raise", "SystemError", "(", "\"To prevent missuse, the script passed to \"", "\"hookutils.exe...
Executes a Python script in an externally spawned interpreter, and returns anything that was emitted in the standard output as a single string. To prevent missuse, the script passed to hookutils.exec-script must be located in the `hooks` directory.
[ "Executes", "a", "Python", "script", "in", "an", "externally", "spawned", "interpreter", "and", "returns", "anything", "that", "was", "emitted", "in", "the", "standard", "output", "as", "a", "single", "string", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/hooks/hookutils.py#L47-L64
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/hooks/hookutils.py
qt4_plugins_binaries
def qt4_plugins_binaries(plugin_type): """Return list of dynamic libraries formated for mod.binaries.""" binaries = [] pdir = qt4_plugins_dir() files = misc.dlls_in_dir(os.path.join(pdir, plugin_type)) for f in files: binaries.append(( os.path.join('qt4_plugins', plugin_type, os....
python
def qt4_plugins_binaries(plugin_type): """Return list of dynamic libraries formated for mod.binaries.""" binaries = [] pdir = qt4_plugins_dir() files = misc.dlls_in_dir(os.path.join(pdir, plugin_type)) for f in files: binaries.append(( os.path.join('qt4_plugins', plugin_type, os....
[ "def", "qt4_plugins_binaries", "(", "plugin_type", ")", ":", "binaries", "=", "[", "]", "pdir", "=", "qt4_plugins_dir", "(", ")", "files", "=", "misc", ".", "dlls_in_dir", "(", "os", ".", "path", ".", "join", "(", "pdir", ",", "plugin_type", ")", ")", ...
Return list of dynamic libraries formated for mod.binaries.
[ "Return", "list", "of", "dynamic", "libraries", "formated", "for", "mod", ".", "binaries", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/hooks/hookutils.py#L115-L124
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/hooks/hookutils.py
qt4_menu_nib_dir
def qt4_menu_nib_dir(): """Return path to Qt resource dir qt_menu.nib.""" menu_dir = '' # Detect MacPorts prefix (usually /opt/local). # Suppose that PyInstaller is using python from macports. macports_prefix = sys.executable.split('/Library')[0] # list of directories where to look for qt_menu.n...
python
def qt4_menu_nib_dir(): """Return path to Qt resource dir qt_menu.nib.""" menu_dir = '' # Detect MacPorts prefix (usually /opt/local). # Suppose that PyInstaller is using python from macports. macports_prefix = sys.executable.split('/Library')[0] # list of directories where to look for qt_menu.n...
[ "def", "qt4_menu_nib_dir", "(", ")", ":", "menu_dir", "=", "''", "macports_prefix", "=", "sys", ".", "executable", ".", "split", "(", "'/Library'", ")", "[", "0", "]", "dirs", "=", "[", "os", ".", "path", ".", "join", "(", "macports_prefix", ",", "'lib...
Return path to Qt resource dir qt_menu.nib.
[ "Return", "path", "to", "Qt", "resource", "dir", "qt_menu", ".", "nib", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/hooks/hookutils.py#L127-L154
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/macholib/dyld.py
dyld_find
def dyld_find(name, executable_path=None, env=None): """ Find a library or framework using dyld semantics """ name = _ensure_utf8(name) executable_path = _ensure_utf8(executable_path) for path in dyld_image_suffix_search(chain( dyld_override_search(name, env), dyl...
python
def dyld_find(name, executable_path=None, env=None): """ Find a library or framework using dyld semantics """ name = _ensure_utf8(name) executable_path = _ensure_utf8(executable_path) for path in dyld_image_suffix_search(chain( dyld_override_search(name, env), dyl...
[ "def", "dyld_find", "(", "name", ",", "executable_path", "=", "None", ",", "env", "=", "None", ")", ":", "name", "=", "_ensure_utf8", "(", "name", ")", "executable_path", "=", "_ensure_utf8", "(", "executable_path", ")", "for", "path", "in", "dyld_image_suff...
Find a library or framework using dyld semantics
[ "Find", "a", "library", "or", "framework", "using", "dyld", "semantics" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/macholib/dyld.py#L135-L148
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/macholib/dyld.py
framework_find
def framework_find(fn, executable_path=None, env=None): """ Find a framework using dyld semantics in a very loose manner. Will take input such as: Python Python.framework Python.framework/Versions/Current """ try: return dyld_find(fn, executable_path=executable_path,...
python
def framework_find(fn, executable_path=None, env=None): """ Find a framework using dyld semantics in a very loose manner. Will take input such as: Python Python.framework Python.framework/Versions/Current """ try: return dyld_find(fn, executable_path=executable_path,...
[ "def", "framework_find", "(", "fn", ",", "executable_path", "=", "None", ",", "env", "=", "None", ")", ":", "try", ":", "return", "dyld_find", "(", "fn", ",", "executable_path", "=", "executable_path", ",", "env", "=", "env", ")", "except", "ValueError", ...
Find a framework using dyld semantics in a very loose manner. Will take input such as: Python Python.framework Python.framework/Versions/Current
[ "Find", "a", "framework", "using", "dyld", "semantics", "in", "a", "very", "loose", "manner", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/macholib/dyld.py#L150-L168
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/utils/svn.py
get_repo_revision
def get_repo_revision(): ''' Returns SVN revision number. Returns 0 if anything goes wrong, such as missing .svn files or an unexpected format of internal SVN files or folder is not a svn working copy. See http://stackoverflow.com/questions/1449935/getting-svn-revision-number-into-a-program-au...
python
def get_repo_revision(): ''' Returns SVN revision number. Returns 0 if anything goes wrong, such as missing .svn files or an unexpected format of internal SVN files or folder is not a svn working copy. See http://stackoverflow.com/questions/1449935/getting-svn-revision-number-into-a-program-au...
[ "def", "get_repo_revision", "(", ")", ":", "rev", "=", "0", "path", "=", "os", ".", "path", ".", "abspath", "(", "os", ".", "path", ".", "dirname", "(", "os", ".", "path", ".", "dirname", "(", "__file__", ")", ")", ")", "entries_path", "=", "os", ...
Returns SVN revision number. Returns 0 if anything goes wrong, such as missing .svn files or an unexpected format of internal SVN files or folder is not a svn working copy. See http://stackoverflow.com/questions/1449935/getting-svn-revision-number-into-a-program-automatically
[ "Returns", "SVN", "revision", "number", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/utils/svn.py#L23-L55
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/utils/winutils.py
get_system_path
def get_system_path(): """Return the path that Windows will search for dlls.""" _bpath = [] if is_win: try: import win32api except ImportError: logger.warn("Cannot determine your Windows or System directories") logger.warn("Please add them to your PATH if ...
python
def get_system_path(): """Return the path that Windows will search for dlls.""" _bpath = [] if is_win: try: import win32api except ImportError: logger.warn("Cannot determine your Windows or System directories") logger.warn("Please add them to your PATH if ...
[ "def", "get_system_path", "(", ")", ":", "_bpath", "=", "[", "]", "if", "is_win", ":", "try", ":", "import", "win32api", "except", "ImportError", ":", "logger", ".", "warn", "(", "\"Cannot determine your Windows or System directories\"", ")", "logger", ".", "war...
Return the path that Windows will search for dlls.
[ "Return", "the", "path", "that", "Windows", "will", "search", "for", "dlls", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/utils/winutils.py#L48-L64
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/utils/winmanifest.py
getFirstChildElementByTagName
def getFirstChildElementByTagName(self, tagName): """ Return the first element of type tagName if found, else None """ for child in self.childNodes: if isinstance(child, Element): if child.tagName == tagName: return child return None
python
def getFirstChildElementByTagName(self, tagName): """ Return the first element of type tagName if found, else None """ for child in self.childNodes: if isinstance(child, Element): if child.tagName == tagName: return child return None
[ "def", "getFirstChildElementByTagName", "(", "self", ",", "tagName", ")", ":", "for", "child", "in", "self", ".", "childNodes", ":", "if", "isinstance", "(", "child", ",", "Element", ")", ":", "if", "child", ".", "tagName", "==", "tagName", ":", "return", ...
Return the first element of type tagName if found, else None
[ "Return", "the", "first", "element", "of", "type", "tagName", "if", "found", "else", "None" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/utils/winmanifest.py#L143-L149
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/utils/winmanifest.py
GetManifestResources
def GetManifestResources(filename, names=None, languages=None): """ Get manifest resources from file """ return winresource.GetResources(filename, [RT_MANIFEST], names, languages)
python
def GetManifestResources(filename, names=None, languages=None): """ Get manifest resources from file """ return winresource.GetResources(filename, [RT_MANIFEST], names, languages)
[ "def", "GetManifestResources", "(", "filename", ",", "names", "=", "None", ",", "languages", "=", "None", ")", ":", "return", "winresource", ".", "GetResources", "(", "filename", ",", "[", "RT_MANIFEST", "]", ",", "names", ",", "languages", ")" ]
Get manifest resources from file
[ "Get", "manifest", "resources", "from", "file" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/utils/winmanifest.py#L951-L953
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/utils/winmanifest.py
UpdateManifestResourcesFromXML
def UpdateManifestResourcesFromXML(dstpath, xmlstr, names=None, languages=None): """ Update or add manifest XML as resource in dstpath """ logger.info("Updating manifest in %s", dstpath) if dstpath.lower().endswith(".exe"): name = 1 else: name = 2 ...
python
def UpdateManifestResourcesFromXML(dstpath, xmlstr, names=None, languages=None): """ Update or add manifest XML as resource in dstpath """ logger.info("Updating manifest in %s", dstpath) if dstpath.lower().endswith(".exe"): name = 1 else: name = 2 ...
[ "def", "UpdateManifestResourcesFromXML", "(", "dstpath", ",", "xmlstr", ",", "names", "=", "None", ",", "languages", "=", "None", ")", ":", "logger", ".", "info", "(", "\"Updating manifest in %s\"", ",", "dstpath", ")", "if", "dstpath", ".", "lower", "(", ")...
Update or add manifest XML as resource in dstpath
[ "Update", "or", "add", "manifest", "XML", "as", "resource", "in", "dstpath" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/utils/winmanifest.py#L956-L965
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/utils/winmanifest.py
UpdateManifestResourcesFromXMLFile
def UpdateManifestResourcesFromXMLFile(dstpath, srcpath, names=None, languages=None): """ Update or add manifest XML from srcpath as resource in dstpath """ logger.info("Updating manifest from %s in %s", srcpath, dstpath) if dstpath.lower().endswith(".exe"): n...
python
def UpdateManifestResourcesFromXMLFile(dstpath, srcpath, names=None, languages=None): """ Update or add manifest XML from srcpath as resource in dstpath """ logger.info("Updating manifest from %s in %s", srcpath, dstpath) if dstpath.lower().endswith(".exe"): n...
[ "def", "UpdateManifestResourcesFromXMLFile", "(", "dstpath", ",", "srcpath", ",", "names", "=", "None", ",", "languages", "=", "None", ")", ":", "logger", ".", "info", "(", "\"Updating manifest from %s in %s\"", ",", "srcpath", ",", "dstpath", ")", "if", "dstpat...
Update or add manifest XML from srcpath as resource in dstpath
[ "Update", "or", "add", "manifest", "XML", "from", "srcpath", "as", "resource", "in", "dstpath" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/utils/winmanifest.py#L968-L978
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/utils/winmanifest.py
create_manifest
def create_manifest(filename, manifest, console): """ Create assembly manifest. """ if not manifest: manifest = ManifestFromXMLFile(filename) # /path/NAME.exe.manifest - split extension twice to get NAME. name = os.path.basename(filename) manifest.name = os.path.splitext(...
python
def create_manifest(filename, manifest, console): """ Create assembly manifest. """ if not manifest: manifest = ManifestFromXMLFile(filename) # /path/NAME.exe.manifest - split extension twice to get NAME. name = os.path.basename(filename) manifest.name = os.path.splitext(...
[ "def", "create_manifest", "(", "filename", ",", "manifest", ",", "console", ")", ":", "if", "not", "manifest", ":", "manifest", "=", "ManifestFromXMLFile", "(", "filename", ")", "name", "=", "os", ".", "path", ".", "basename", "(", "filename", ")", "manife...
Create assembly manifest.
[ "Create", "assembly", "manifest", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/utils/winmanifest.py#L981-L1016
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/utils/winmanifest.py
Manifest.add_file
def add_file(self, name="", hashalg="", hash="", comClasses=None, typelibs=None, comInterfaceProxyStubs=None, windowClasses=None): """ Shortcut for manifest.files.append """ self.files.append(File(name, hashalg, hash, comClasses, typelibs, c...
python
def add_file(self, name="", hashalg="", hash="", comClasses=None, typelibs=None, comInterfaceProxyStubs=None, windowClasses=None): """ Shortcut for manifest.files.append """ self.files.append(File(name, hashalg, hash, comClasses, typelibs, c...
[ "def", "add_file", "(", "self", ",", "name", "=", "\"\"", ",", "hashalg", "=", "\"\"", ",", "hash", "=", "\"\"", ",", "comClasses", "=", "None", ",", "typelibs", "=", "None", ",", "comInterfaceProxyStubs", "=", "None", ",", "windowClasses", "=", "None", ...
Shortcut for manifest.files.append
[ "Shortcut", "for", "manifest", ".", "files", ".", "append" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/utils/winmanifest.py#L305-L310
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/utils/winmanifest.py
Manifest.getid
def getid(self, language=None, version=None): """ Return an identification string which uniquely names a manifest. This string is a combination of the manifest's processorArchitecture, name, publicKeyToken, version and language. Arguments: version (tuple or lis...
python
def getid(self, language=None, version=None): """ Return an identification string which uniquely names a manifest. This string is a combination of the manifest's processorArchitecture, name, publicKeyToken, version and language. Arguments: version (tuple or lis...
[ "def", "getid", "(", "self", ",", "language", "=", "None", ",", "version", "=", "None", ")", ":", "if", "not", "self", ".", "name", ":", "logger", ".", "warn", "(", "\"Assembly metadata incomplete\"", ")", "return", "\"\"", "id", "=", "[", "]", "if", ...
Return an identification string which uniquely names a manifest. This string is a combination of the manifest's processorArchitecture, name, publicKeyToken, version and language. Arguments: version (tuple or list of integers) - If version is given, use it ...
[ "Return", "an", "identification", "string", "which", "uniquely", "names", "a", "manifest", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/utils/winmanifest.py#L514-L542
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/utils/winmanifest.py
Manifest.getpolicyid
def getpolicyid(self, fuzzy=True, language=None, windowsversion=None): """ Return an identification string which can be used to find a policy. This string is a combination of the manifest's processorArchitecture, major and minor version, name, publicKeyToken and language. ...
python
def getpolicyid(self, fuzzy=True, language=None, windowsversion=None): """ Return an identification string which can be used to find a policy. This string is a combination of the manifest's processorArchitecture, major and minor version, name, publicKeyToken and language. ...
[ "def", "getpolicyid", "(", "self", ",", "fuzzy", "=", "True", ",", "language", "=", "None", ",", "windowsversion", "=", "None", ")", ":", "if", "not", "self", ".", "name", ":", "logger", ".", "warn", "(", "\"Assembly metadata incomplete\"", ")", "return", ...
Return an identification string which can be used to find a policy. This string is a combination of the manifest's processorArchitecture, major and minor version, name, publicKeyToken and language. Arguments: fuzzy (boolean) - If False, insert the full version in ...
[ "Return", "an", "identification", "string", "which", "can", "be", "used", "to", "find", "a", "policy", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/utils/winmanifest.py#L561-L608
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/utils/winmanifest.py
Manifest.parse
def parse(self, filename_or_file, initialize=True): """ Load manifest from file or file object """ if isinstance(filename_or_file, (str, unicode)): filename = filename_or_file else: filename = filename_or_file.name try: domtree = minidom.parse(filename...
python
def parse(self, filename_or_file, initialize=True): """ Load manifest from file or file object """ if isinstance(filename_or_file, (str, unicode)): filename = filename_or_file else: filename = filename_or_file.name try: domtree = minidom.parse(filename...
[ "def", "parse", "(", "self", ",", "filename_or_file", ",", "initialize", "=", "True", ")", ":", "if", "isinstance", "(", "filename_or_file", ",", "(", "str", ",", "unicode", ")", ")", ":", "filename", "=", "filename_or_file", "else", ":", "filename", "=", ...
Load manifest from file or file object
[ "Load", "manifest", "from", "file", "or", "file", "object" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/utils/winmanifest.py#L702-L719
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/utils/winmanifest.py
Manifest.parse_string
def parse_string(self, xmlstr, initialize=True): """ Load manifest from XML string """ try: domtree = minidom.parseString(xmlstr) except xml.parsers.expat.ExpatError, e: raise ManifestXMLParseError(e) self.load_dom(domtree, initialize)
python
def parse_string(self, xmlstr, initialize=True): """ Load manifest from XML string """ try: domtree = minidom.parseString(xmlstr) except xml.parsers.expat.ExpatError, e: raise ManifestXMLParseError(e) self.load_dom(domtree, initialize)
[ "def", "parse_string", "(", "self", ",", "xmlstr", ",", "initialize", "=", "True", ")", ":", "try", ":", "domtree", "=", "minidom", ".", "parseString", "(", "xmlstr", ")", "except", "xml", ".", "parsers", ".", "expat", ".", "ExpatError", ",", "e", ":",...
Load manifest from XML string
[ "Load", "manifest", "from", "XML", "string" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/utils/winmanifest.py#L721-L727
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/utils/winmanifest.py
Manifest.same_id
def same_id(self, manifest, skip_version_check=False): """ Return a bool indicating if another manifest has the same identitiy. This is done by comparing language, name, processorArchitecture, publicKeyToken, type and version. """ if skip_version_check:...
python
def same_id(self, manifest, skip_version_check=False): """ Return a bool indicating if another manifest has the same identitiy. This is done by comparing language, name, processorArchitecture, publicKeyToken, type and version. """ if skip_version_check:...
[ "def", "same_id", "(", "self", ",", "manifest", ",", "skip_version_check", "=", "False", ")", ":", "if", "skip_version_check", ":", "version_check", "=", "True", "else", ":", "version_check", "=", "self", ".", "version", "==", "manifest", ".", "version", "re...
Return a bool indicating if another manifest has the same identitiy. This is done by comparing language, name, processorArchitecture, publicKeyToken, type and version.
[ "Return", "a", "bool", "indicating", "if", "another", "manifest", "has", "the", "same", "identitiy", ".", "This", "is", "done", "by", "comparing", "language", "name", "processorArchitecture", "publicKeyToken", "type", "and", "version", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/utils/winmanifest.py#L729-L746
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/utils/winmanifest.py
Manifest.toprettyxml
def toprettyxml(self, indent=" ", newl=os.linesep, encoding="UTF-8"): """ Return the manifest as pretty-printed XML """ domtree = self.todom() # WARNING: The XML declaration has to follow the order # version-encoding-standalone (standalone being optional), otherwise # if it is...
python
def toprettyxml(self, indent=" ", newl=os.linesep, encoding="UTF-8"): """ Return the manifest as pretty-printed XML """ domtree = self.todom() # WARNING: The XML declaration has to follow the order # version-encoding-standalone (standalone being optional), otherwise # if it is...
[ "def", "toprettyxml", "(", "self", ",", "indent", "=", "\" \"", ",", "newl", "=", "os", ".", "linesep", ",", "encoding", "=", "\"UTF-8\"", ")", ":", "domtree", "=", "self", ".", "todom", "(", ")", "if", "sys", ".", "version_info", ">=", "(", "2", ...
Return the manifest as pretty-printed XML
[ "Return", "the", "manifest", "as", "pretty", "-", "printed", "XML" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/utils/winmanifest.py#L853-L869
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/utils/winmanifest.py
Manifest.toxml
def toxml(self, encoding="UTF-8"): """ Return the manifest as XML """ domtree = self.todom() # WARNING: The XML declaration has to follow the order # version-encoding-standalone (standalone being optional), otherwise # if it is embedded in an exe the exe will fail to launch! ...
python
def toxml(self, encoding="UTF-8"): """ Return the manifest as XML """ domtree = self.todom() # WARNING: The XML declaration has to follow the order # version-encoding-standalone (standalone being optional), otherwise # if it is embedded in an exe the exe will fail to launch! ...
[ "def", "toxml", "(", "self", ",", "encoding", "=", "\"UTF-8\"", ")", ":", "domtree", "=", "self", ".", "todom", "(", ")", "xmlstr", "=", "domtree", ".", "toxml", "(", "encoding", ")", ".", "replace", "(", "'<?xml version=\"1.0\" encoding=\"%s\"?>'", "%", "...
Return the manifest as XML
[ "Return", "the", "manifest", "as", "XML" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/utils/winmanifest.py#L871-L882
train
bwhite/hadoopy
hadoopy/_local.py
launch_local
def launch_local(in_name, out_name, script_path, poll=None, max_input=None, files=(), cmdenvs=(), pipe=True, python_cmd='python', remove_tempdir=True, identity_mapper=False, num_reducers=None, **kw): """A simple local emulation of hadoop This doesn't run hadoo...
python
def launch_local(in_name, out_name, script_path, poll=None, max_input=None, files=(), cmdenvs=(), pipe=True, python_cmd='python', remove_tempdir=True, identity_mapper=False, num_reducers=None, **kw): """A simple local emulation of hadoop This doesn't run hadoo...
[ "def", "launch_local", "(", "in_name", ",", "out_name", ",", "script_path", ",", "poll", "=", "None", ",", "max_input", "=", "None", ",", "files", "=", "(", ")", ",", "cmdenvs", "=", "(", ")", ",", "pipe", "=", "True", ",", "python_cmd", "=", "'pytho...
A simple local emulation of hadoop This doesn't run hadoop and it doesn't support many advanced features, it is intended for simple debugging. The input/output uses HDFS if an HDFS path is given. This allows for small tasks to be run locally (primarily while debugging). A temporary working directory i...
[ "A", "simple", "local", "emulation", "of", "hadoop" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/_local.py#L119-L197
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/bindepend.py
getfullnameof
def getfullnameof(mod, xtrapath=None): """ Return the full path name of MOD. MOD is the basename of a dll or pyd. XTRAPATH is a path or list of paths to search first. Return the full path name of MOD. Will search the full Windows search path, as well as sys.path """ # Search sys.path fi...
python
def getfullnameof(mod, xtrapath=None): """ Return the full path name of MOD. MOD is the basename of a dll or pyd. XTRAPATH is a path or list of paths to search first. Return the full path name of MOD. Will search the full Windows search path, as well as sys.path """ # Search sys.path fi...
[ "def", "getfullnameof", "(", "mod", ",", "xtrapath", "=", "None", ")", ":", "epath", "=", "sys", ".", "path", "+", "winutils", ".", "get_system_path", "(", ")", "if", "xtrapath", "is", "not", "None", ":", "if", "type", "(", "xtrapath", ")", "==", "ty...
Return the full path name of MOD. MOD is the basename of a dll or pyd. XTRAPATH is a path or list of paths to search first. Return the full path name of MOD. Will search the full Windows search path, as well as sys.path
[ "Return", "the", "full", "path", "name", "of", "MOD", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/bindepend.py#L61-L86
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/bindepend.py
Dependencies
def Dependencies(lTOC, xtrapath=None, manifest=None): """ Expand LTOC to include all the closure of binary dependencies. LTOC is a logical table of contents, ie, a seq of tuples (name, path). Return LTOC expanded by all the binary dependencies of the entries in LTOC, except those listed in the modu...
python
def Dependencies(lTOC, xtrapath=None, manifest=None): """ Expand LTOC to include all the closure of binary dependencies. LTOC is a logical table of contents, ie, a seq of tuples (name, path). Return LTOC expanded by all the binary dependencies of the entries in LTOC, except those listed in the modu...
[ "def", "Dependencies", "(", "lTOC", ",", "xtrapath", "=", "None", ",", "manifest", "=", "None", ")", ":", "for", "nm", ",", "pth", ",", "typ", "in", "lTOC", ":", "if", "seen", ".", "get", "(", "nm", ".", "upper", "(", ")", ",", "0", ")", ":", ...
Expand LTOC to include all the closure of binary dependencies. LTOC is a logical table of contents, ie, a seq of tuples (name, path). Return LTOC expanded by all the binary dependencies of the entries in LTOC, except those listed in the module global EXCLUDES manifest should be a winmanifest.Manifest ...
[ "Expand", "LTOC", "to", "include", "all", "the", "closure", "of", "binary", "dependencies", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/bindepend.py#L107-L132
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/bindepend.py
pkg_resouces_get_default_cache
def pkg_resouces_get_default_cache(): """ Determine the default cache location This returns the ``PYTHON_EGG_CACHE`` environment variable, if set. Otherwise, on Windows, it returns a 'Python-Eggs' subdirectory of the 'Application Data' directory. On all other systems, it's '~/.python-eggs'. ""...
python
def pkg_resouces_get_default_cache(): """ Determine the default cache location This returns the ``PYTHON_EGG_CACHE`` environment variable, if set. Otherwise, on Windows, it returns a 'Python-Eggs' subdirectory of the 'Application Data' directory. On all other systems, it's '~/.python-eggs'. ""...
[ "def", "pkg_resouces_get_default_cache", "(", ")", ":", "egg_cache", "=", "compat", ".", "getenv", "(", "'PYTHON_EGG_CACHE'", ")", "if", "egg_cache", "is", "not", "None", ":", "return", "egg_cache", "if", "os", ".", "name", "!=", "'nt'", ":", "return", "os",...
Determine the default cache location This returns the ``PYTHON_EGG_CACHE`` environment variable, if set. Otherwise, on Windows, it returns a 'Python-Eggs' subdirectory of the 'Application Data' directory. On all other systems, it's '~/.python-eggs'.
[ "Determine", "the", "default", "cache", "location" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/bindepend.py#L135-L175
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/bindepend.py
getAssemblies
def getAssemblies(pth): """ Return the dependent assemblies of a binary. """ if not os.path.isfile(pth): pth = check_extract_from_egg(pth)[0][0] if pth.lower().endswith(".manifest"): return [] # check for manifest file manifestnm = pth + ".manifest" if os.path.isfile(mani...
python
def getAssemblies(pth): """ Return the dependent assemblies of a binary. """ if not os.path.isfile(pth): pth = check_extract_from_egg(pth)[0][0] if pth.lower().endswith(".manifest"): return [] # check for manifest file manifestnm = pth + ".manifest" if os.path.isfile(mani...
[ "def", "getAssemblies", "(", "pth", ")", ":", "if", "not", "os", ".", "path", ".", "isfile", "(", "pth", ")", ":", "pth", "=", "check_extract_from_egg", "(", "pth", ")", "[", "0", "]", "[", "0", "]", "if", "pth", ".", "lower", "(", ")", ".", "e...
Return the dependent assemblies of a binary.
[ "Return", "the", "dependent", "assemblies", "of", "a", "binary", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/bindepend.py#L231-L280
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/bindepend.py
selectAssemblies
def selectAssemblies(pth, manifest=None): """ Return a binary's dependent assemblies files that should be included. Return a list of pairs (name, fullpath) """ rv = [] if not os.path.isfile(pth): pth = check_extract_from_egg(pth)[0][0] if manifest: _depNames = set([dep.name ...
python
def selectAssemblies(pth, manifest=None): """ Return a binary's dependent assemblies files that should be included. Return a list of pairs (name, fullpath) """ rv = [] if not os.path.isfile(pth): pth = check_extract_from_egg(pth)[0][0] if manifest: _depNames = set([dep.name ...
[ "def", "selectAssemblies", "(", "pth", ",", "manifest", "=", "None", ")", ":", "rv", "=", "[", "]", "if", "not", "os", ".", "path", ".", "isfile", "(", "pth", ")", ":", "pth", "=", "check_extract_from_egg", "(", "pth", ")", "[", "0", "]", "[", "0...
Return a binary's dependent assemblies files that should be included. Return a list of pairs (name, fullpath)
[ "Return", "a", "binary", "s", "dependent", "assemblies", "files", "that", "should", "be", "included", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/bindepend.py#L283-L338
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/bindepend.py
selectImports
def selectImports(pth, xtrapath=None): """ Return the dependencies of a binary that should be included. Return a list of pairs (name, fullpath) """ rv = [] if xtrapath is None: xtrapath = [os.path.dirname(pth)] else: assert isinstance(xtrapath, list) xtrapath = [os.p...
python
def selectImports(pth, xtrapath=None): """ Return the dependencies of a binary that should be included. Return a list of pairs (name, fullpath) """ rv = [] if xtrapath is None: xtrapath = [os.path.dirname(pth)] else: assert isinstance(xtrapath, list) xtrapath = [os.p...
[ "def", "selectImports", "(", "pth", ",", "xtrapath", "=", "None", ")", ":", "rv", "=", "[", "]", "if", "xtrapath", "is", "None", ":", "xtrapath", "=", "[", "os", ".", "path", ".", "dirname", "(", "pth", ")", "]", "else", ":", "assert", "isinstance"...
Return the dependencies of a binary that should be included. Return a list of pairs (name, fullpath)
[ "Return", "the", "dependencies", "of", "a", "binary", "that", "should", "be", "included", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/bindepend.py#L341-L391
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/bindepend.py
getImports
def getImports(pth): """Forwards to the correct getImports implementation for the platform. """ if not os.path.isfile(pth): pth = check_extract_from_egg(pth)[0][0] if is_win or is_cygwin: if pth.lower().endswith(".manifest"): return [] try: return _getImpo...
python
def getImports(pth): """Forwards to the correct getImports implementation for the platform. """ if not os.path.isfile(pth): pth = check_extract_from_egg(pth)[0][0] if is_win or is_cygwin: if pth.lower().endswith(".manifest"): return [] try: return _getImpo...
[ "def", "getImports", "(", "pth", ")", ":", "if", "not", "os", ".", "path", ".", "isfile", "(", "pth", ")", ":", "pth", "=", "check_extract_from_egg", "(", "pth", ")", "[", "0", "]", "[", "0", "]", "if", "is_win", "or", "is_cygwin", ":", "if", "pt...
Forwards to the correct getImports implementation for the platform.
[ "Forwards", "to", "the", "correct", "getImports", "implementation", "for", "the", "platform", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/bindepend.py#L472-L496
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/bindepend.py
findLibrary
def findLibrary(name): """ Look for a library in the system. Emulate the algorithm used by dlopen. `name`must include the prefix, e.g. ``libpython2.4.so`` """ assert is_unix, "Current implementation for Unix only (Linux, Solaris, AIX)" lib = None # Look in the LD_LIBRARY_PATH lp =...
python
def findLibrary(name): """ Look for a library in the system. Emulate the algorithm used by dlopen. `name`must include the prefix, e.g. ``libpython2.4.so`` """ assert is_unix, "Current implementation for Unix only (Linux, Solaris, AIX)" lib = None # Look in the LD_LIBRARY_PATH lp =...
[ "def", "findLibrary", "(", "name", ")", ":", "assert", "is_unix", ",", "\"Current implementation for Unix only (Linux, Solaris, AIX)\"", "lib", "=", "None", "lp", "=", "compat", ".", "getenv", "(", "'LD_LIBRARY_PATH'", ",", "''", ")", "for", "path", "in", "lp", ...
Look for a library in the system. Emulate the algorithm used by dlopen. `name`must include the prefix, e.g. ``libpython2.4.so``
[ "Look", "for", "a", "library", "in", "the", "system", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/bindepend.py#L499-L542
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/bindepend.py
getSoname
def getSoname(filename): """ Return the soname of a library. """ cmd = ["objdump", "-p", "-j", ".dynamic", filename] m = re.search(r'\s+SONAME\s+([^\s]+)', compat.exec_command(*cmd)) if m: return m.group(1)
python
def getSoname(filename): """ Return the soname of a library. """ cmd = ["objdump", "-p", "-j", ".dynamic", filename] m = re.search(r'\s+SONAME\s+([^\s]+)', compat.exec_command(*cmd)) if m: return m.group(1)
[ "def", "getSoname", "(", "filename", ")", ":", "cmd", "=", "[", "\"objdump\"", ",", "\"-p\"", ",", "\"-j\"", ",", "\".dynamic\"", ",", "filename", "]", "m", "=", "re", ".", "search", "(", "r'\\s+SONAME\\s+([^\\s]+)'", ",", "compat", ".", "exec_command", "(...
Return the soname of a library.
[ "Return", "the", "soname", "of", "a", "library", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/bindepend.py#L545-L552
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/loader/iu.py
_os_bootstrap
def _os_bootstrap(): """ Set up 'os' module replacement functions for use during import bootstrap. """ global _os_stat, _os_getcwd, _os_environ, _os_listdir global _os_path_join, _os_path_dirname, _os_path_basename global _os_sep names = sys.builtin_module_names join = dirname = envir...
python
def _os_bootstrap(): """ Set up 'os' module replacement functions for use during import bootstrap. """ global _os_stat, _os_getcwd, _os_environ, _os_listdir global _os_path_join, _os_path_dirname, _os_path_basename global _os_sep names = sys.builtin_module_names join = dirname = envir...
[ "def", "_os_bootstrap", "(", ")", ":", "global", "_os_stat", ",", "_os_getcwd", ",", "_os_environ", ",", "_os_listdir", "global", "_os_path_join", ",", "_os_path_dirname", ",", "_os_path_basename", "global", "_os_sep", "names", "=", "sys", ".", "builtin_module_names...
Set up 'os' module replacement functions for use during import bootstrap.
[ "Set", "up", "os", "module", "replacement", "functions", "for", "use", "during", "import", "bootstrap", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/loader/iu.py#L646-L713
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/mf.py
scan_code_for_ctypes
def scan_code_for_ctypes(co, instrs, i): """Detects ctypes dependencies, using reasonable heuristics that should cover most common ctypes usages; returns a tuple of two lists, one containing names of binaries detected as dependencies, the other containing warnings. """ def _libFromConst(i): ...
python
def scan_code_for_ctypes(co, instrs, i): """Detects ctypes dependencies, using reasonable heuristics that should cover most common ctypes usages; returns a tuple of two lists, one containing names of binaries detected as dependencies, the other containing warnings. """ def _libFromConst(i): ...
[ "def", "scan_code_for_ctypes", "(", "co", ",", "instrs", ",", "i", ")", ":", "def", "_libFromConst", "(", "i", ")", ":", "op", ",", "oparg", ",", "conditional", ",", "curline", "=", "instrs", "[", "i", "]", "if", "op", "==", "LOAD_CONST", ":", "sonam...
Detects ctypes dependencies, using reasonable heuristics that should cover most common ctypes usages; returns a tuple of two lists, one containing names of binaries detected as dependencies, the other containing warnings.
[ "Detects", "ctypes", "dependencies", "using", "reasonable", "heuristics", "that", "should", "cover", "most", "common", "ctypes", "usages", ";", "returns", "a", "tuple", "of", "two", "lists", "one", "containing", "names", "of", "binaries", "detected", "as", "depe...
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/mf.py#L989-L1067
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/mf.py
_resolveCtypesImports
def _resolveCtypesImports(cbinaries): """Completes ctypes BINARY entries for modules with their full path. """ if is_unix: envvar = "LD_LIBRARY_PATH" elif is_darwin: envvar = "DYLD_LIBRARY_PATH" else: envvar = "PATH" def _setPaths(): path = os.pathsep.join(PyInst...
python
def _resolveCtypesImports(cbinaries): """Completes ctypes BINARY entries for modules with their full path. """ if is_unix: envvar = "LD_LIBRARY_PATH" elif is_darwin: envvar = "DYLD_LIBRARY_PATH" else: envvar = "PATH" def _setPaths(): path = os.pathsep.join(PyInst...
[ "def", "_resolveCtypesImports", "(", "cbinaries", ")", ":", "if", "is_unix", ":", "envvar", "=", "\"LD_LIBRARY_PATH\"", "elif", "is_darwin", ":", "envvar", "=", "\"DYLD_LIBRARY_PATH\"", "else", ":", "envvar", "=", "\"PATH\"", "def", "_setPaths", "(", ")", ":", ...
Completes ctypes BINARY entries for modules with their full path.
[ "Completes", "ctypes", "BINARY", "entries", "for", "modules", "with", "their", "full", "path", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/mf.py#L1070-L1139
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/GraphStat.py
degree_dist
def degree_dist(graph, limits=(0,0), bin_num=10, mode='out'): ''' Computes the degree distribution for a graph. Returns a list of tuples where the first element of the tuple is the center of the bin representing a range of degrees and the second element of the tuple are the number of nodes with the...
python
def degree_dist(graph, limits=(0,0), bin_num=10, mode='out'): ''' Computes the degree distribution for a graph. Returns a list of tuples where the first element of the tuple is the center of the bin representing a range of degrees and the second element of the tuple are the number of nodes with the...
[ "def", "degree_dist", "(", "graph", ",", "limits", "=", "(", "0", ",", "0", ")", ",", "bin_num", "=", "10", ",", "mode", "=", "'out'", ")", ":", "deg", "=", "[", "]", "if", "mode", "==", "'inc'", ":", "get_deg", "=", "graph", ".", "inc_degree", ...
Computes the degree distribution for a graph. Returns a list of tuples where the first element of the tuple is the center of the bin representing a range of degrees and the second element of the tuple are the number of nodes with the degree falling in the range. Example:: ....
[ "Computes", "the", "degree", "distribution", "for", "a", "graph", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/GraphStat.py#L7-L34
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/ObjectGraph.py
ObjectGraph.flatten
def flatten(self, condition=None, start=None): """ Iterate over the subgraph that is entirely reachable by condition starting from the given start node or the ObjectGraph root """ if start is None: start = self start = self.getRawIdent(start) return se...
python
def flatten(self, condition=None, start=None): """ Iterate over the subgraph that is entirely reachable by condition starting from the given start node or the ObjectGraph root """ if start is None: start = self start = self.getRawIdent(start) return se...
[ "def", "flatten", "(", "self", ",", "condition", "=", "None", ",", "start", "=", "None", ")", ":", "if", "start", "is", "None", ":", "start", "=", "self", "start", "=", "self", ".", "getRawIdent", "(", "start", ")", "return", "self", ".", "graph", ...
Iterate over the subgraph that is entirely reachable by condition starting from the given start node or the ObjectGraph root
[ "Iterate", "over", "the", "subgraph", "that", "is", "entirely", "reachable", "by", "condition", "starting", "from", "the", "given", "start", "node", "or", "the", "ObjectGraph", "root" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/ObjectGraph.py#L32-L40
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/ObjectGraph.py
ObjectGraph.filterStack
def filterStack(self, filters): """ Filter the ObjectGraph in-place by removing all edges to nodes that do not match every filter in the given filter list Returns a tuple containing the number of: (nodes_visited, nodes_removed, nodes_orphaned) """ visited, removes, orpha...
python
def filterStack(self, filters): """ Filter the ObjectGraph in-place by removing all edges to nodes that do not match every filter in the given filter list Returns a tuple containing the number of: (nodes_visited, nodes_removed, nodes_orphaned) """ visited, removes, orpha...
[ "def", "filterStack", "(", "self", ",", "filters", ")", ":", "visited", ",", "removes", ",", "orphans", "=", "filter_stack", "(", "self", ".", "graph", ",", "self", ",", "filters", ")", "for", "last_good", ",", "tail", "in", "orphans", ":", "self", "."...
Filter the ObjectGraph in-place by removing all edges to nodes that do not match every filter in the given filter list Returns a tuple containing the number of: (nodes_visited, nodes_removed, nodes_orphaned)
[ "Filter", "the", "ObjectGraph", "in", "-", "place", "by", "removing", "all", "edges", "to", "nodes", "that", "do", "not", "match", "every", "filter", "in", "the", "given", "filter", "list" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/ObjectGraph.py#L61-L76
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/ObjectGraph.py
ObjectGraph.removeNode
def removeNode(self, node): """ Remove the given node from the graph if it exists """ ident = self.getIdent(node) if ident is not None: self.graph.hide_node(ident)
python
def removeNode(self, node): """ Remove the given node from the graph if it exists """ ident = self.getIdent(node) if ident is not None: self.graph.hide_node(ident)
[ "def", "removeNode", "(", "self", ",", "node", ")", ":", "ident", "=", "self", ".", "getIdent", "(", "node", ")", "if", "ident", "is", "not", "None", ":", "self", ".", "graph", ".", "hide_node", "(", "ident", ")" ]
Remove the given node from the graph if it exists
[ "Remove", "the", "given", "node", "from", "the", "graph", "if", "it", "exists" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/ObjectGraph.py#L78-L84
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/ObjectGraph.py
ObjectGraph.removeReference
def removeReference(self, fromnode, tonode): """ Remove all edges from fromnode to tonode """ if fromnode is None: fromnode = self fromident = self.getIdent(fromnode) toident = self.getIdent(tonode) if fromident is not None and toident is not None: ...
python
def removeReference(self, fromnode, tonode): """ Remove all edges from fromnode to tonode """ if fromnode is None: fromnode = self fromident = self.getIdent(fromnode) toident = self.getIdent(tonode) if fromident is not None and toident is not None: ...
[ "def", "removeReference", "(", "self", ",", "fromnode", ",", "tonode", ")", ":", "if", "fromnode", "is", "None", ":", "fromnode", "=", "self", "fromident", "=", "self", ".", "getIdent", "(", "fromnode", ")", "toident", "=", "self", ".", "getIdent", "(", ...
Remove all edges from fromnode to tonode
[ "Remove", "all", "edges", "from", "fromnode", "to", "tonode" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/ObjectGraph.py#L86-L99
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/ObjectGraph.py
ObjectGraph.getIdent
def getIdent(self, node): """ Get the graph identifier for a node """ ident = self.getRawIdent(node) if ident is not None: return ident node = self.findNode(node) if node is None: return None return node.graphident
python
def getIdent(self, node): """ Get the graph identifier for a node """ ident = self.getRawIdent(node) if ident is not None: return ident node = self.findNode(node) if node is None: return None return node.graphident
[ "def", "getIdent", "(", "self", ",", "node", ")", ":", "ident", "=", "self", ".", "getRawIdent", "(", "node", ")", "if", "ident", "is", "not", "None", ":", "return", "ident", "node", "=", "self", ".", "findNode", "(", "node", ")", "if", "node", "is...
Get the graph identifier for a node
[ "Get", "the", "graph", "identifier", "for", "a", "node" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/ObjectGraph.py#L101-L111
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/ObjectGraph.py
ObjectGraph.getRawIdent
def getRawIdent(self, node): """ Get the identifier for a node object """ if node is self: return node ident = getattr(node, 'graphident', None) return ident
python
def getRawIdent(self, node): """ Get the identifier for a node object """ if node is self: return node ident = getattr(node, 'graphident', None) return ident
[ "def", "getRawIdent", "(", "self", ",", "node", ")", ":", "if", "node", "is", "self", ":", "return", "node", "ident", "=", "getattr", "(", "node", ",", "'graphident'", ",", "None", ")", "return", "ident" ]
Get the identifier for a node object
[ "Get", "the", "identifier", "for", "a", "node", "object" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/ObjectGraph.py#L113-L120
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/ObjectGraph.py
ObjectGraph.findNode
def findNode(self, node): """ Find the node on the graph """ ident = self.getRawIdent(node) if ident is None: ident = node try: return self.graph.node_data(ident) except KeyError: return None
python
def findNode(self, node): """ Find the node on the graph """ ident = self.getRawIdent(node) if ident is None: ident = node try: return self.graph.node_data(ident) except KeyError: return None
[ "def", "findNode", "(", "self", ",", "node", ")", ":", "ident", "=", "self", ".", "getRawIdent", "(", "node", ")", "if", "ident", "is", "None", ":", "ident", "=", "node", "try", ":", "return", "self", ".", "graph", ".", "node_data", "(", "ident", "...
Find the node on the graph
[ "Find", "the", "node", "on", "the", "graph" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/ObjectGraph.py#L125-L135
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/ObjectGraph.py
ObjectGraph.addNode
def addNode(self, node): """ Add a node to the graph referenced by the root """ self.msg(4, "addNode", node) try: self.graph.restore_node(node.graphident) except GraphError: self.graph.add_node(node.graphident, node)
python
def addNode(self, node): """ Add a node to the graph referenced by the root """ self.msg(4, "addNode", node) try: self.graph.restore_node(node.graphident) except GraphError: self.graph.add_node(node.graphident, node)
[ "def", "addNode", "(", "self", ",", "node", ")", ":", "self", ".", "msg", "(", "4", ",", "\"addNode\"", ",", "node", ")", "try", ":", "self", ".", "graph", ".", "restore_node", "(", "node", ".", "graphident", ")", "except", "GraphError", ":", "self",...
Add a node to the graph referenced by the root
[ "Add", "a", "node", "to", "the", "graph", "referenced", "by", "the", "root" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/ObjectGraph.py#L137-L146
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/ObjectGraph.py
ObjectGraph.createReference
def createReference(self, fromnode, tonode, edge_data=None): """ Create a reference from fromnode to tonode """ if fromnode is None: fromnode = self fromident, toident = self.getIdent(fromnode), self.getIdent(tonode) if fromident is None or toident is None: ...
python
def createReference(self, fromnode, tonode, edge_data=None): """ Create a reference from fromnode to tonode """ if fromnode is None: fromnode = self fromident, toident = self.getIdent(fromnode), self.getIdent(tonode) if fromident is None or toident is None: ...
[ "def", "createReference", "(", "self", ",", "fromnode", ",", "tonode", ",", "edge_data", "=", "None", ")", ":", "if", "fromnode", "is", "None", ":", "fromnode", "=", "self", "fromident", ",", "toident", "=", "self", ".", "getIdent", "(", "fromnode", ")",...
Create a reference from fromnode to tonode
[ "Create", "a", "reference", "from", "fromnode", "to", "tonode" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/ObjectGraph.py#L148-L158
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/ObjectGraph.py
ObjectGraph.createNode
def createNode(self, cls, name, *args, **kw): """ Add a node of type cls to the graph if it does not already exist by the given name """ m = self.findNode(name) if m is None: m = cls(name, *args, **kw) self.addNode(m) return m
python
def createNode(self, cls, name, *args, **kw): """ Add a node of type cls to the graph if it does not already exist by the given name """ m = self.findNode(name) if m is None: m = cls(name, *args, **kw) self.addNode(m) return m
[ "def", "createNode", "(", "self", ",", "cls", ",", "name", ",", "*", "args", ",", "**", "kw", ")", ":", "m", "=", "self", ".", "findNode", "(", "name", ")", "if", "m", "is", "None", ":", "m", "=", "cls", "(", "name", ",", "*", "args", ",", ...
Add a node of type cls to the graph if it does not already exist by the given name
[ "Add", "a", "node", "of", "type", "cls", "to", "the", "graph", "if", "it", "does", "not", "already", "exist", "by", "the", "given", "name" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/ObjectGraph.py#L160-L169
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/ObjectGraph.py
ObjectGraph.msg
def msg(self, level, s, *args): """ Print a debug message with the given level """ if s and level <= self.debug: print "%s%s %s" % (" " * self.indent, s, ' '.join(map(repr, args)))
python
def msg(self, level, s, *args): """ Print a debug message with the given level """ if s and level <= self.debug: print "%s%s %s" % (" " * self.indent, s, ' '.join(map(repr, args)))
[ "def", "msg", "(", "self", ",", "level", ",", "s", ",", "*", "args", ")", ":", "if", "s", "and", "level", "<=", "self", ".", "debug", ":", "print", "\"%s%s %s\"", "%", "(", "\" \"", "*", "self", ".", "indent", ",", "s", ",", "' '", ".", "join"...
Print a debug message with the given level
[ "Print", "a", "debug", "message", "with", "the", "given", "level" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/ObjectGraph.py#L171-L176
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/GraphAlgo.py
dijkstra
def dijkstra(graph, start, end=None): """ Dijkstra's algorithm for shortest paths `David Eppstein, UC Irvine, 4 April 2002 <http://www.ics.uci.edu/~eppstein/161/python/>`_ `Python Cookbook Recipe <http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/119466>`_ Find shortest paths from the star...
python
def dijkstra(graph, start, end=None): """ Dijkstra's algorithm for shortest paths `David Eppstein, UC Irvine, 4 April 2002 <http://www.ics.uci.edu/~eppstein/161/python/>`_ `Python Cookbook Recipe <http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/119466>`_ Find shortest paths from the star...
[ "def", "dijkstra", "(", "graph", ",", "start", ",", "end", "=", "None", ")", ":", "D", "=", "{", "}", "P", "=", "{", "}", "Q", "=", "_priorityDictionary", "(", ")", "Q", "[", "start", "]", "=", "0", "for", "v", "in", "Q", ":", "D", "[", "v"...
Dijkstra's algorithm for shortest paths `David Eppstein, UC Irvine, 4 April 2002 <http://www.ics.uci.edu/~eppstein/161/python/>`_ `Python Cookbook Recipe <http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/119466>`_ Find shortest paths from the start node to all nodes nearer than or equal to the en...
[ "Dijkstra", "s", "algorithm", "for", "shortest", "paths" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/GraphAlgo.py#L7-L44
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/GraphAlgo.py
_priorityDictionary.smallest
def smallest(self): ''' Find smallest item after removing deleted items from front of heap. ''' if len(self) == 0: raise IndexError, "smallest of empty priorityDictionary" heap = self.__heap while heap[0][1] not in self or self[heap[0][1]] != heap[0][0]: ...
python
def smallest(self): ''' Find smallest item after removing deleted items from front of heap. ''' if len(self) == 0: raise IndexError, "smallest of empty priorityDictionary" heap = self.__heap while heap[0][1] not in self or self[heap[0][1]] != heap[0][0]: ...
[ "def", "smallest", "(", "self", ")", ":", "if", "len", "(", "self", ")", "==", "0", ":", "raise", "IndexError", ",", "\"smallest of empty priorityDictionary\"", "heap", "=", "self", ".", "__heap", "while", "heap", "[", "0", "]", "[", "1", "]", "not", "...
Find smallest item after removing deleted items from front of heap.
[ "Find", "smallest", "item", "after", "removing", "deleted", "items", "from", "front", "of", "heap", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/GraphAlgo.py#L90-L109
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/configure.py
_write_textfile
def _write_textfile(filename, text): """ Write `text` into file `filename`. If the target directory does not exist, create it. """ dirname = os.path.dirname(filename) if not os.path.exists(dirname): os.makedirs(dirname) outf = open(filename, 'w') outf.write(text) outf.close()
python
def _write_textfile(filename, text): """ Write `text` into file `filename`. If the target directory does not exist, create it. """ dirname = os.path.dirname(filename) if not os.path.exists(dirname): os.makedirs(dirname) outf = open(filename, 'w') outf.write(text) outf.close()
[ "def", "_write_textfile", "(", "filename", ",", "text", ")", ":", "dirname", "=", "os", ".", "path", ".", "dirname", "(", "filename", ")", "if", "not", "os", ".", "path", ".", "exists", "(", "dirname", ")", ":", "os", ".", "makedirs", "(", "dirname",...
Write `text` into file `filename`. If the target directory does not exist, create it.
[ "Write", "text", "into", "file", "filename", ".", "If", "the", "target", "directory", "does", "not", "exist", "create", "it", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/configure.py#L43-L53
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/configure.py
__add_options
def __add_options(parser): """ Add the `Configure` options to a option-parser instance or a option group. """ parser.add_option('--upx-dir', default=None, help='Directory containing UPX.') parser.add_option('-C', '--configfile', default=DEFAULT_CONFIGF...
python
def __add_options(parser): """ Add the `Configure` options to a option-parser instance or a option group. """ parser.add_option('--upx-dir', default=None, help='Directory containing UPX.') parser.add_option('-C', '--configfile', default=DEFAULT_CONFIGF...
[ "def", "__add_options", "(", "parser", ")", ":", "parser", ".", "add_option", "(", "'--upx-dir'", ",", "default", "=", "None", ",", "help", "=", "'Directory containing UPX.'", ")", "parser", ".", "add_option", "(", "'-C'", ",", "'--configfile'", ",", "default"...
Add the `Configure` options to a option-parser instance or a option group.
[ "Add", "the", "Configure", "options", "to", "a", "option", "-", "parser", "instance", "or", "a", "option", "group", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/configure.py#L328-L338
train
bwhite/hadoopy
hadoopy/_hdfs.py
abspath
def abspath(path): """Return the absolute path to a file and canonicalize it Path is returned without a trailing slash and without redundant slashes. Caches the user's home directory. :param path: A string for the path. This should not have any wildcards. :returns: Absolute path to the file :...
python
def abspath(path): """Return the absolute path to a file and canonicalize it Path is returned without a trailing slash and without redundant slashes. Caches the user's home directory. :param path: A string for the path. This should not have any wildcards. :returns: Absolute path to the file :...
[ "def", "abspath", "(", "path", ")", ":", "global", "_USER_HOME_DIR", "if", "path", "[", "0", "]", "==", "'/'", ":", "return", "os", ".", "path", ".", "abspath", "(", "path", ")", "if", "_USER_HOME_DIR", "is", "None", ":", "try", ":", "_USER_HOME_DIR", ...
Return the absolute path to a file and canonicalize it Path is returned without a trailing slash and without redundant slashes. Caches the user's home directory. :param path: A string for the path. This should not have any wildcards. :returns: Absolute path to the file :raises IOError: If unsucce...
[ "Return", "the", "absolute", "path", "to", "a", "file", "and", "canonicalize", "it" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/_hdfs.py#L113-L135
train
bwhite/hadoopy
hadoopy/_hdfs.py
cp
def cp(hdfs_src, hdfs_dst): """Copy a file :param hdfs_src: Source (str) :param hdfs_dst: Destination (str) :raises: IOError: If unsuccessful """ cmd = "hadoop fs -cp %s %s" % (hdfs_src, hdfs_dst) rcode, stdout, stderr = _checked_hadoop_fs_command(cmd)
python
def cp(hdfs_src, hdfs_dst): """Copy a file :param hdfs_src: Source (str) :param hdfs_dst: Destination (str) :raises: IOError: If unsuccessful """ cmd = "hadoop fs -cp %s %s" % (hdfs_src, hdfs_dst) rcode, stdout, stderr = _checked_hadoop_fs_command(cmd)
[ "def", "cp", "(", "hdfs_src", ",", "hdfs_dst", ")", ":", "cmd", "=", "\"hadoop fs -cp %s %s\"", "%", "(", "hdfs_src", ",", "hdfs_dst", ")", "rcode", ",", "stdout", ",", "stderr", "=", "_checked_hadoop_fs_command", "(", "cmd", ")" ]
Copy a file :param hdfs_src: Source (str) :param hdfs_dst: Destination (str) :raises: IOError: If unsuccessful
[ "Copy", "a", "file" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/_hdfs.py#L148-L156
train
bwhite/hadoopy
hadoopy/_hdfs.py
stat
def stat(path, format): """Call stat on file :param path: HDFS Path :param format: Stat format :returns: Stat output :raises: IOError: If unsuccessful """ cmd = "hadoop fs -stat %s %s" % (format, path) rcode, stdout, stderr = _checked_hadoop_fs_command(cmd) return stdout.rstrip()
python
def stat(path, format): """Call stat on file :param path: HDFS Path :param format: Stat format :returns: Stat output :raises: IOError: If unsuccessful """ cmd = "hadoop fs -stat %s %s" % (format, path) rcode, stdout, stderr = _checked_hadoop_fs_command(cmd) return stdout.rstrip()
[ "def", "stat", "(", "path", ",", "format", ")", ":", "cmd", "=", "\"hadoop fs -stat %s %s\"", "%", "(", "format", ",", "path", ")", "rcode", ",", "stdout", ",", "stderr", "=", "_checked_hadoop_fs_command", "(", "cmd", ")", "return", "stdout", ".", "rstrip"...
Call stat on file :param path: HDFS Path :param format: Stat format :returns: Stat output :raises: IOError: If unsuccessful
[ "Call", "stat", "on", "file" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/_hdfs.py#L159-L169
train
bwhite/hadoopy
hadoopy/_hdfs.py
mv
def mv(hdfs_src, hdfs_dst): """Move a file on hdfs :param hdfs_src: Source (str) :param hdfs_dst: Destination (str) :raises: IOError: If unsuccessful """ cmd = "hadoop fs -mv %s %s" % (hdfs_src, hdfs_dst) rcode, stdout, stderr = _checked_hadoop_fs_command(cmd)
python
def mv(hdfs_src, hdfs_dst): """Move a file on hdfs :param hdfs_src: Source (str) :param hdfs_dst: Destination (str) :raises: IOError: If unsuccessful """ cmd = "hadoop fs -mv %s %s" % (hdfs_src, hdfs_dst) rcode, stdout, stderr = _checked_hadoop_fs_command(cmd)
[ "def", "mv", "(", "hdfs_src", ",", "hdfs_dst", ")", ":", "cmd", "=", "\"hadoop fs -mv %s %s\"", "%", "(", "hdfs_src", ",", "hdfs_dst", ")", "rcode", ",", "stdout", ",", "stderr", "=", "_checked_hadoop_fs_command", "(", "cmd", ")" ]
Move a file on hdfs :param hdfs_src: Source (str) :param hdfs_dst: Destination (str) :raises: IOError: If unsuccessful
[ "Move", "a", "file", "on", "hdfs" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/_hdfs.py#L182-L190
train
bwhite/hadoopy
hadoopy/_hdfs.py
put
def put(local_path, hdfs_path): """Put a file on hdfs :param local_path: Source (str) :param hdfs_path: Destination (str) :raises: IOError: If unsuccessful """ cmd = "hadoop fs -put %s %s" % (local_path, hdfs_path) rcode, stdout, stderr = _checked_hadoop_fs_command(cmd)
python
def put(local_path, hdfs_path): """Put a file on hdfs :param local_path: Source (str) :param hdfs_path: Destination (str) :raises: IOError: If unsuccessful """ cmd = "hadoop fs -put %s %s" % (local_path, hdfs_path) rcode, stdout, stderr = _checked_hadoop_fs_command(cmd)
[ "def", "put", "(", "local_path", ",", "hdfs_path", ")", ":", "cmd", "=", "\"hadoop fs -put %s %s\"", "%", "(", "local_path", ",", "hdfs_path", ")", "rcode", ",", "stdout", ",", "stderr", "=", "_checked_hadoop_fs_command", "(", "cmd", ")" ]
Put a file on hdfs :param local_path: Source (str) :param hdfs_path: Destination (str) :raises: IOError: If unsuccessful
[ "Put", "a", "file", "on", "hdfs" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/_hdfs.py#L193-L201
train
bwhite/hadoopy
hadoopy/_hdfs.py
get
def get(hdfs_path, local_path): """Get a file from hdfs :param hdfs_path: Destination (str) :param local_path: Source (str) :raises: IOError: If unsuccessful """ cmd = "hadoop fs -get %s %s" % (hdfs_path, local_path) rcode, stdout, stderr = _checked_hadoop_fs_command(cmd)
python
def get(hdfs_path, local_path): """Get a file from hdfs :param hdfs_path: Destination (str) :param local_path: Source (str) :raises: IOError: If unsuccessful """ cmd = "hadoop fs -get %s %s" % (hdfs_path, local_path) rcode, stdout, stderr = _checked_hadoop_fs_command(cmd)
[ "def", "get", "(", "hdfs_path", ",", "local_path", ")", ":", "cmd", "=", "\"hadoop fs -get %s %s\"", "%", "(", "hdfs_path", ",", "local_path", ")", "rcode", ",", "stdout", ",", "stderr", "=", "_checked_hadoop_fs_command", "(", "cmd", ")" ]
Get a file from hdfs :param hdfs_path: Destination (str) :param local_path: Source (str) :raises: IOError: If unsuccessful
[ "Get", "a", "file", "from", "hdfs" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/_hdfs.py#L204-L212
train
bwhite/hadoopy
hadoopy/_hdfs.py
ls
def ls(path): """List files on HDFS. :param path: A string (potentially with wildcards). :rtype: A list of strings representing HDFS paths. :raises: IOError: An error occurred listing the directory (e.g., not available). """ rcode, stdout, stderr = _checked_hadoop_fs_command('hadoop fs -ls %s' ...
python
def ls(path): """List files on HDFS. :param path: A string (potentially with wildcards). :rtype: A list of strings representing HDFS paths. :raises: IOError: An error occurred listing the directory (e.g., not available). """ rcode, stdout, stderr = _checked_hadoop_fs_command('hadoop fs -ls %s' ...
[ "def", "ls", "(", "path", ")", ":", "rcode", ",", "stdout", ",", "stderr", "=", "_checked_hadoop_fs_command", "(", "'hadoop fs -ls %s'", "%", "path", ")", "found_line", "=", "lambda", "x", ":", "re", ".", "search", "(", "'Found [0-9]+ items$'", ",", "x", "...
List files on HDFS. :param path: A string (potentially with wildcards). :rtype: A list of strings representing HDFS paths. :raises: IOError: An error occurred listing the directory (e.g., not available).
[ "List", "files", "on", "HDFS", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/_hdfs.py#L215-L226
train
bwhite/hadoopy
hadoopy/_hdfs.py
writetb
def writetb(path, kvs, java_mem_mb=256): """Write typedbytes sequence file to HDFS given an iterator of KeyValue pairs :param path: HDFS path (string) :param kvs: Iterator of (key, value) :param java_mem_mb: Integer of java heap size in MB (default 256) :raises: IOError: An error occurred while sav...
python
def writetb(path, kvs, java_mem_mb=256): """Write typedbytes sequence file to HDFS given an iterator of KeyValue pairs :param path: HDFS path (string) :param kvs: Iterator of (key, value) :param java_mem_mb: Integer of java heap size in MB (default 256) :raises: IOError: An error occurred while sav...
[ "def", "writetb", "(", "path", ",", "kvs", ",", "java_mem_mb", "=", "256", ")", ":", "read_fd", ",", "write_fd", "=", "os", ".", "pipe", "(", ")", "read_fp", "=", "os", ".", "fdopen", "(", "read_fd", ",", "'r'", ")", "hstreaming", "=", "_find_hstream...
Write typedbytes sequence file to HDFS given an iterator of KeyValue pairs :param path: HDFS path (string) :param kvs: Iterator of (key, value) :param java_mem_mb: Integer of java heap size in MB (default 256) :raises: IOError: An error occurred while saving the data.
[ "Write", "typedbytes", "sequence", "file", "to", "HDFS", "given", "an", "iterator", "of", "KeyValue", "pairs" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/_hdfs.py#L229-L251
train
bwhite/hadoopy
hadoopy/_hdfs.py
writetb_parts
def writetb_parts(path, kvs, num_per_file, **kw): """Write typedbytes sequence files to HDFS given an iterator of KeyValue pairs This is useful when a task is CPU bound and wish to break up its inputs into pieces smaller than the HDFS block size. This causes Hadoop to launch one Map task per file. As...
python
def writetb_parts(path, kvs, num_per_file, **kw): """Write typedbytes sequence files to HDFS given an iterator of KeyValue pairs This is useful when a task is CPU bound and wish to break up its inputs into pieces smaller than the HDFS block size. This causes Hadoop to launch one Map task per file. As...
[ "def", "writetb_parts", "(", "path", ",", "kvs", ",", "num_per_file", ",", "**", "kw", ")", ":", "out", "=", "[", "]", "part_num", "=", "0", "def", "_flush", "(", "out", ",", "part_num", ")", ":", "hadoopy", ".", "writetb", "(", "'%s/part-%.5d'", "%"...
Write typedbytes sequence files to HDFS given an iterator of KeyValue pairs This is useful when a task is CPU bound and wish to break up its inputs into pieces smaller than the HDFS block size. This causes Hadoop to launch one Map task per file. As such, you can consider this a way of forcing a minim...
[ "Write", "typedbytes", "sequence", "files", "to", "HDFS", "given", "an", "iterator", "of", "KeyValue", "pairs" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/_hdfs.py#L254-L279
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py
Graph.add_node
def add_node(self, node, node_data=None): """ Adds a new node to the graph. Arbitrary data can be attached to the node via the node_data parameter. Adding the same node twice will be silently ignored. The node must be a hashable value. """ # # the nodes...
python
def add_node(self, node, node_data=None): """ Adds a new node to the graph. Arbitrary data can be attached to the node via the node_data parameter. Adding the same node twice will be silently ignored. The node must be a hashable value. """ # # the nodes...
[ "def", "add_node", "(", "self", ",", "node", ",", "node_data", "=", "None", ")", ":", "if", "node", "in", "self", ".", "hidden_nodes", ":", "return", "if", "node", "not", "in", "self", ".", "nodes", ":", "self", ".", "nodes", "[", "node", "]", "=",...
Adds a new node to the graph. Arbitrary data can be attached to the node via the node_data parameter. Adding the same node twice will be silently ignored. The node must be a hashable value.
[ "Adds", "a", "new", "node", "to", "the", "graph", ".", "Arbitrary", "data", "can", "be", "attached", "to", "the", "node", "via", "the", "node_data", "parameter", ".", "Adding", "the", "same", "node", "twice", "will", "be", "silently", "ignored", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py#L64-L84
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py
Graph.add_edge
def add_edge(self, head_id, tail_id, edge_data=1, create_nodes=True): """ Adds a directed edge going from head_id to tail_id. Arbitrary data can be attached to the edge via edge_data. It may create the nodes if adding edges between nonexisting ones. :param head_id: head node ...
python
def add_edge(self, head_id, tail_id, edge_data=1, create_nodes=True): """ Adds a directed edge going from head_id to tail_id. Arbitrary data can be attached to the edge via edge_data. It may create the nodes if adding edges between nonexisting ones. :param head_id: head node ...
[ "def", "add_edge", "(", "self", ",", "head_id", ",", "tail_id", ",", "edge_data", "=", "1", ",", "create_nodes", "=", "True", ")", ":", "edge", "=", "self", ".", "next_edge", "if", "create_nodes", ":", "self", ".", "add_node", "(", "head_id", ")", "sel...
Adds a directed edge going from head_id to tail_id. Arbitrary data can be attached to the edge via edge_data. It may create the nodes if adding edges between nonexisting ones. :param head_id: head node :param tail_id: tail node :param edge_data: (optional) data attached to the e...
[ "Adds", "a", "directed", "edge", "going", "from", "head_id", "to", "tail_id", ".", "Arbitrary", "data", "can", "be", "attached", "to", "the", "edge", "via", "edge_data", ".", "It", "may", "create", "the", "nodes", "if", "adding", "edges", "between", "nonex...
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py#L86-L119
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py
Graph.hide_edge
def hide_edge(self, edge): """ Hides an edge from the graph. The edge may be unhidden at some later time. """ try: head_id, tail_id, edge_data = self.hidden_edges[edge] = self.edges[edge] self.nodes[tail_id][0].remove(edge) self.nodes[head_id][...
python
def hide_edge(self, edge): """ Hides an edge from the graph. The edge may be unhidden at some later time. """ try: head_id, tail_id, edge_data = self.hidden_edges[edge] = self.edges[edge] self.nodes[tail_id][0].remove(edge) self.nodes[head_id][...
[ "def", "hide_edge", "(", "self", ",", "edge", ")", ":", "try", ":", "head_id", ",", "tail_id", ",", "edge_data", "=", "self", ".", "hidden_edges", "[", "edge", "]", "=", "self", ".", "edges", "[", "edge", "]", "self", ".", "nodes", "[", "tail_id", ...
Hides an edge from the graph. The edge may be unhidden at some later time.
[ "Hides", "an", "edge", "from", "the", "graph", ".", "The", "edge", "may", "be", "unhidden", "at", "some", "later", "time", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py#L121-L132
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py
Graph.hide_node
def hide_node(self, node): """ Hides a node from the graph. The incoming and outgoing edges of the node will also be hidden. The node may be unhidden at some later time. """ try: all_edges = self.all_edges(node) self.hidden_nodes[node] = (self.nodes[node...
python
def hide_node(self, node): """ Hides a node from the graph. The incoming and outgoing edges of the node will also be hidden. The node may be unhidden at some later time. """ try: all_edges = self.all_edges(node) self.hidden_nodes[node] = (self.nodes[node...
[ "def", "hide_node", "(", "self", ",", "node", ")", ":", "try", ":", "all_edges", "=", "self", ".", "all_edges", "(", "node", ")", "self", ".", "hidden_nodes", "[", "node", "]", "=", "(", "self", ".", "nodes", "[", "node", "]", ",", "all_edges", ")"...
Hides a node from the graph. The incoming and outgoing edges of the node will also be hidden. The node may be unhidden at some later time.
[ "Hides", "a", "node", "from", "the", "graph", ".", "The", "incoming", "and", "outgoing", "edges", "of", "the", "node", "will", "also", "be", "hidden", ".", "The", "node", "may", "be", "unhidden", "at", "some", "later", "time", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py#L134-L146
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py
Graph.restore_node
def restore_node(self, node): """ Restores a previously hidden node back into the graph and restores all of its incoming and outgoing edges. """ try: self.nodes[node], all_edges = self.hidden_nodes[node] for edge in all_edges: self.restore_...
python
def restore_node(self, node): """ Restores a previously hidden node back into the graph and restores all of its incoming and outgoing edges. """ try: self.nodes[node], all_edges = self.hidden_nodes[node] for edge in all_edges: self.restore_...
[ "def", "restore_node", "(", "self", ",", "node", ")", ":", "try", ":", "self", ".", "nodes", "[", "node", "]", ",", "all_edges", "=", "self", ".", "hidden_nodes", "[", "node", "]", "for", "edge", "in", "all_edges", ":", "self", ".", "restore_edge", "...
Restores a previously hidden node back into the graph and restores all of its incoming and outgoing edges.
[ "Restores", "a", "previously", "hidden", "node", "back", "into", "the", "graph", "and", "restores", "all", "of", "its", "incoming", "and", "outgoing", "edges", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py#L148-L159
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py
Graph.restore_edge
def restore_edge(self, edge): """ Restores a previously hidden edge back into the graph. """ try: head_id, tail_id, data = self.hidden_edges[edge] self.nodes[tail_id][0].append(edge) self.nodes[head_id][1].append(edge) self.edges[edge] = he...
python
def restore_edge(self, edge): """ Restores a previously hidden edge back into the graph. """ try: head_id, tail_id, data = self.hidden_edges[edge] self.nodes[tail_id][0].append(edge) self.nodes[head_id][1].append(edge) self.edges[edge] = he...
[ "def", "restore_edge", "(", "self", ",", "edge", ")", ":", "try", ":", "head_id", ",", "tail_id", ",", "data", "=", "self", ".", "hidden_edges", "[", "edge", "]", "self", ".", "nodes", "[", "tail_id", "]", "[", "0", "]", ".", "append", "(", "edge",...
Restores a previously hidden edge back into the graph.
[ "Restores", "a", "previously", "hidden", "edge", "back", "into", "the", "graph", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py#L161-L172
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py
Graph.restore_all_edges
def restore_all_edges(self): """ Restores all hidden edges. """ for edge in self.hidden_edges.keys(): try: self.restore_edge(edge) except GraphError: pass
python
def restore_all_edges(self): """ Restores all hidden edges. """ for edge in self.hidden_edges.keys(): try: self.restore_edge(edge) except GraphError: pass
[ "def", "restore_all_edges", "(", "self", ")", ":", "for", "edge", "in", "self", ".", "hidden_edges", ".", "keys", "(", ")", ":", "try", ":", "self", ".", "restore_edge", "(", "edge", ")", "except", "GraphError", ":", "pass" ]
Restores all hidden edges.
[ "Restores", "all", "hidden", "edges", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py#L174-L182
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py
Graph.describe_node
def describe_node(self, node): """ return node, node data, outgoing edges, incoming edges for node """ incoming, outgoing, data = self.nodes[node] return node, data, outgoing, incoming
python
def describe_node(self, node): """ return node, node data, outgoing edges, incoming edges for node """ incoming, outgoing, data = self.nodes[node] return node, data, outgoing, incoming
[ "def", "describe_node", "(", "self", ",", "node", ")", ":", "incoming", ",", "outgoing", ",", "data", "=", "self", ".", "nodes", "[", "node", "]", "return", "node", ",", "data", ",", "outgoing", ",", "incoming" ]
return node, node data, outgoing edges, incoming edges for node
[ "return", "node", "node", "data", "outgoing", "edges", "incoming", "edges", "for", "node" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py#L272-L277
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py
Graph.describe_edge
def describe_edge(self, edge): """ return edge, edge data, head, tail for edge """ head, tail, data = self.edges[edge] return edge, data, head, tail
python
def describe_edge(self, edge): """ return edge, edge data, head, tail for edge """ head, tail, data = self.edges[edge] return edge, data, head, tail
[ "def", "describe_edge", "(", "self", ",", "edge", ")", ":", "head", ",", "tail", ",", "data", "=", "self", ".", "edges", "[", "edge", "]", "return", "edge", ",", "data", ",", "head", ",", "tail" ]
return edge, edge data, head, tail for edge
[ "return", "edge", "edge", "data", "head", "tail", "for", "edge" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py#L279-L284
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py
Graph.out_nbrs
def out_nbrs(self, node): """ List of nodes connected by outgoing edges """ l = map(self.tail, self.out_edges(node)) #l.sort() return l
python
def out_nbrs(self, node): """ List of nodes connected by outgoing edges """ l = map(self.tail, self.out_edges(node)) #l.sort() return l
[ "def", "out_nbrs", "(", "self", ",", "node", ")", ":", "l", "=", "map", "(", "self", ".", "tail", ",", "self", ".", "out_edges", "(", "node", ")", ")", "return", "l" ]
List of nodes connected by outgoing edges
[ "List", "of", "nodes", "connected", "by", "outgoing", "edges" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py#L310-L316
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py
Graph.inc_nbrs
def inc_nbrs(self, node): """ List of nodes connected by incoming edges """ l = map(self.head, self.inc_edges(node)) #l.sort() return l
python
def inc_nbrs(self, node): """ List of nodes connected by incoming edges """ l = map(self.head, self.inc_edges(node)) #l.sort() return l
[ "def", "inc_nbrs", "(", "self", ",", "node", ")", ":", "l", "=", "map", "(", "self", ".", "head", ",", "self", ".", "inc_edges", "(", "node", ")", ")", "return", "l" ]
List of nodes connected by incoming edges
[ "List", "of", "nodes", "connected", "by", "incoming", "edges" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py#L318-L324
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py
Graph.all_nbrs
def all_nbrs(self, node): """ List of nodes connected by incoming and outgoing edges """ l = dict.fromkeys( self.inc_nbrs(node) + self.out_nbrs(node) ) return list(l)
python
def all_nbrs(self, node): """ List of nodes connected by incoming and outgoing edges """ l = dict.fromkeys( self.inc_nbrs(node) + self.out_nbrs(node) ) return list(l)
[ "def", "all_nbrs", "(", "self", ",", "node", ")", ":", "l", "=", "dict", ".", "fromkeys", "(", "self", ".", "inc_nbrs", "(", "node", ")", "+", "self", ".", "out_nbrs", "(", "node", ")", ")", "return", "list", "(", "l", ")" ]
List of nodes connected by incoming and outgoing edges
[ "List", "of", "nodes", "connected", "by", "incoming", "and", "outgoing", "edges" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py#L326-L331
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py
Graph.out_edges
def out_edges(self, node): """ Returns a list of the outgoing edges """ try: return list(self.nodes[node][1]) except KeyError: raise GraphError('Invalid node %s' % node) return None
python
def out_edges(self, node): """ Returns a list of the outgoing edges """ try: return list(self.nodes[node][1]) except KeyError: raise GraphError('Invalid node %s' % node) return None
[ "def", "out_edges", "(", "self", ",", "node", ")", ":", "try", ":", "return", "list", "(", "self", ".", "nodes", "[", "node", "]", "[", "1", "]", ")", "except", "KeyError", ":", "raise", "GraphError", "(", "'Invalid node %s'", "%", "node", ")", "retu...
Returns a list of the outgoing edges
[ "Returns", "a", "list", "of", "the", "outgoing", "edges" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py#L333-L342
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py
Graph.inc_edges
def inc_edges(self, node): """ Returns a list of the incoming edges """ try: return list(self.nodes[node][0]) except KeyError: raise GraphError('Invalid node %s' % node) return None
python
def inc_edges(self, node): """ Returns a list of the incoming edges """ try: return list(self.nodes[node][0]) except KeyError: raise GraphError('Invalid node %s' % node) return None
[ "def", "inc_edges", "(", "self", ",", "node", ")", ":", "try", ":", "return", "list", "(", "self", ".", "nodes", "[", "node", "]", "[", "0", "]", ")", "except", "KeyError", ":", "raise", "GraphError", "(", "'Invalid node %s'", "%", "node", ")", "retu...
Returns a list of the incoming edges
[ "Returns", "a", "list", "of", "the", "incoming", "edges" ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py#L344-L353
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py
Graph.all_edges
def all_edges(self, node): """ Returns a list of incoming and outging edges. """ return set(self.inc_edges(node) + self.out_edges(node))
python
def all_edges(self, node): """ Returns a list of incoming and outging edges. """ return set(self.inc_edges(node) + self.out_edges(node))
[ "def", "all_edges", "(", "self", ",", "node", ")", ":", "return", "set", "(", "self", ".", "inc_edges", "(", "node", ")", "+", "self", ".", "out_edges", "(", "node", ")", ")" ]
Returns a list of incoming and outging edges.
[ "Returns", "a", "list", "of", "incoming", "and", "outging", "edges", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py#L355-L359
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py
Graph._topo_sort
def _topo_sort(self, forward=True): """ Topological sort. Returns a list of nodes where the successors (based on outgoing and incoming edges selected by the forward parameter) of any given node appear in the sequence after that node. """ topo_list = [] qu...
python
def _topo_sort(self, forward=True): """ Topological sort. Returns a list of nodes where the successors (based on outgoing and incoming edges selected by the forward parameter) of any given node appear in the sequence after that node. """ topo_list = [] qu...
[ "def", "_topo_sort", "(", "self", ",", "forward", "=", "True", ")", ":", "topo_list", "=", "[", "]", "queue", "=", "deque", "(", ")", "indeg", "=", "{", "}", "if", "forward", ":", "get_edges", "=", "self", ".", "out_edges", "get_degree", "=", "self",...
Topological sort. Returns a list of nodes where the successors (based on outgoing and incoming edges selected by the forward parameter) of any given node appear in the sequence after that node.
[ "Topological", "sort", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py#L379-L424
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py
Graph._bfs_subgraph
def _bfs_subgraph(self, start_id, forward=True): """ Private method creates a subgraph in a bfs order. The forward parameter specifies whether it is a forward or backward traversal. """ if forward: get_bfs = self.forw_bfs get_nbrs = self.out_nbrs...
python
def _bfs_subgraph(self, start_id, forward=True): """ Private method creates a subgraph in a bfs order. The forward parameter specifies whether it is a forward or backward traversal. """ if forward: get_bfs = self.forw_bfs get_nbrs = self.out_nbrs...
[ "def", "_bfs_subgraph", "(", "self", ",", "start_id", ",", "forward", "=", "True", ")", ":", "if", "forward", ":", "get_bfs", "=", "self", ".", "forw_bfs", "get_nbrs", "=", "self", ".", "out_nbrs", "else", ":", "get_bfs", "=", "self", ".", "back_bfs", ...
Private method creates a subgraph in a bfs order. The forward parameter specifies whether it is a forward or backward traversal.
[ "Private", "method", "creates", "a", "subgraph", "in", "a", "bfs", "order", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py#L444-L467
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py
Graph.iterdfs
def iterdfs(self, start, end=None, forward=True): """ Collecting nodes in some depth first traversal. The forward parameter specifies whether it is a forward or backward traversal. """ visited, stack = set([start]), deque([start]) if forward: get_edg...
python
def iterdfs(self, start, end=None, forward=True): """ Collecting nodes in some depth first traversal. The forward parameter specifies whether it is a forward or backward traversal. """ visited, stack = set([start]), deque([start]) if forward: get_edg...
[ "def", "iterdfs", "(", "self", ",", "start", ",", "end", "=", "None", ",", "forward", "=", "True", ")", ":", "visited", ",", "stack", "=", "set", "(", "[", "start", "]", ")", ",", "deque", "(", "[", "start", "]", ")", "if", "forward", ":", "get...
Collecting nodes in some depth first traversal. The forward parameter specifies whether it is a forward or backward traversal.
[ "Collecting", "nodes", "in", "some", "depth", "first", "traversal", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py#L483-L508
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py
Graph._iterbfs
def _iterbfs(self, start, end=None, forward=True): """ The forward parameter specifies whether it is a forward or backward traversal. Returns a list of tuples where the first value is the hop value the second value is the node id. """ queue, visited = deque([(start, 0)])...
python
def _iterbfs(self, start, end=None, forward=True): """ The forward parameter specifies whether it is a forward or backward traversal. Returns a list of tuples where the first value is the hop value the second value is the node id. """ queue, visited = deque([(start, 0)])...
[ "def", "_iterbfs", "(", "self", ",", "start", ",", "end", "=", "None", ",", "forward", "=", "True", ")", ":", "queue", ",", "visited", "=", "deque", "(", "[", "(", "start", ",", "0", ")", "]", ")", ",", "set", "(", "[", "start", "]", ")", "if...
The forward parameter specifies whether it is a forward or backward traversal. Returns a list of tuples where the first value is the hop value the second value is the node id.
[ "The", "forward", "parameter", "specifies", "whether", "it", "is", "a", "forward", "or", "backward", "traversal", ".", "Returns", "a", "list", "of", "tuples", "where", "the", "first", "value", "is", "the", "hop", "value", "the", "second", "value", "is", "t...
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py#L543-L568
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py
Graph.forw_bfs
def forw_bfs(self, start, end=None): """ Returns a list of nodes in some forward BFS order. Starting from the start node the breadth first search proceeds along outgoing edges. """ return [node for node, step in self._iterbfs(start, end, forward=True)]
python
def forw_bfs(self, start, end=None): """ Returns a list of nodes in some forward BFS order. Starting from the start node the breadth first search proceeds along outgoing edges. """ return [node for node, step in self._iterbfs(start, end, forward=True)]
[ "def", "forw_bfs", "(", "self", ",", "start", ",", "end", "=", "None", ")", ":", "return", "[", "node", "for", "node", ",", "step", "in", "self", ".", "_iterbfs", "(", "start", ",", "end", ",", "forward", "=", "True", ")", "]" ]
Returns a list of nodes in some forward BFS order. Starting from the start node the breadth first search proceeds along outgoing edges.
[ "Returns", "a", "list", "of", "nodes", "in", "some", "forward", "BFS", "order", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py#L571-L578
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py
Graph.back_bfs
def back_bfs(self, start, end=None): """ Returns a list of nodes in some backward BFS order. Starting from the start node the breadth first search proceeds along incoming edges. """ return [node for node, step in self._iterbfs(start, end, forward=False)]
python
def back_bfs(self, start, end=None): """ Returns a list of nodes in some backward BFS order. Starting from the start node the breadth first search proceeds along incoming edges. """ return [node for node, step in self._iterbfs(start, end, forward=False)]
[ "def", "back_bfs", "(", "self", ",", "start", ",", "end", "=", "None", ")", ":", "return", "[", "node", "for", "node", ",", "step", "in", "self", ".", "_iterbfs", "(", "start", ",", "end", ",", "forward", "=", "False", ")", "]" ]
Returns a list of nodes in some backward BFS order. Starting from the start node the breadth first search proceeds along incoming edges.
[ "Returns", "a", "list", "of", "nodes", "in", "some", "backward", "BFS", "order", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py#L580-L587
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py
Graph.forw_dfs
def forw_dfs(self, start, end=None): """ Returns a list of nodes in some forward DFS order. Starting with the start node the depth first search proceeds along outgoing edges. """ return list(self.iterdfs(start, end, forward=True))
python
def forw_dfs(self, start, end=None): """ Returns a list of nodes in some forward DFS order. Starting with the start node the depth first search proceeds along outgoing edges. """ return list(self.iterdfs(start, end, forward=True))
[ "def", "forw_dfs", "(", "self", ",", "start", ",", "end", "=", "None", ")", ":", "return", "list", "(", "self", ".", "iterdfs", "(", "start", ",", "end", ",", "forward", "=", "True", ")", ")" ]
Returns a list of nodes in some forward DFS order. Starting with the start node the depth first search proceeds along outgoing edges.
[ "Returns", "a", "list", "of", "nodes", "in", "some", "forward", "DFS", "order", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py#L589-L596
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py
Graph.back_dfs
def back_dfs(self, start, end=None): """ Returns a list of nodes in some backward DFS order. Starting from the start node the depth first search proceeds along incoming edges. """ return list(self.iterdfs(start, end, forward=False))
python
def back_dfs(self, start, end=None): """ Returns a list of nodes in some backward DFS order. Starting from the start node the depth first search proceeds along incoming edges. """ return list(self.iterdfs(start, end, forward=False))
[ "def", "back_dfs", "(", "self", ",", "start", ",", "end", "=", "None", ")", ":", "return", "list", "(", "self", ".", "iterdfs", "(", "start", ",", "end", ",", "forward", "=", "False", ")", ")" ]
Returns a list of nodes in some backward DFS order. Starting from the start node the depth first search proceeds along incoming edges.
[ "Returns", "a", "list", "of", "nodes", "in", "some", "backward", "DFS", "order", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py#L598-L605
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py
Graph.clust_coef
def clust_coef(self, node): """ Computes and returns the local clustering coefficient of node. The local cluster coefficient is proportion of the actual number of edges between neighbours of node and the maximum number of edges between those neighbours. See <http://en.wikipedia...
python
def clust_coef(self, node): """ Computes and returns the local clustering coefficient of node. The local cluster coefficient is proportion of the actual number of edges between neighbours of node and the maximum number of edges between those neighbours. See <http://en.wikipedia...
[ "def", "clust_coef", "(", "self", ",", "node", ")", ":", "num", "=", "0", "nbr_set", "=", "set", "(", "self", ".", "out_nbrs", "(", "node", ")", ")", "if", "node", "in", "nbr_set", ":", "nbr_set", ".", "remove", "(", "node", ")", "for", "nbr", "i...
Computes and returns the local clustering coefficient of node. The local cluster coefficient is proportion of the actual number of edges between neighbours of node and the maximum number of edges between those neighbours. See <http://en.wikipedia.org/wiki/Clustering_coefficient#Local_clusterin...
[ "Computes", "and", "returns", "the", "local", "clustering", "coefficient", "of", "node", ".", "The", "local", "cluster", "coefficient", "is", "proportion", "of", "the", "actual", "number", "of", "edges", "between", "neighbours", "of", "node", "and", "the", "ma...
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py#L619-L645
train
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py
Graph.get_hops
def get_hops(self, start, end=None, forward=True): """ Computes the hop distance to all nodes centered around a specified node. First order neighbours are at hop 1, their neigbours are at hop 2 etc. Uses :py:meth:`forw_bfs` or :py:meth:`back_bfs` depending on the value of the forward ...
python
def get_hops(self, start, end=None, forward=True): """ Computes the hop distance to all nodes centered around a specified node. First order neighbours are at hop 1, their neigbours are at hop 2 etc. Uses :py:meth:`forw_bfs` or :py:meth:`back_bfs` depending on the value of the forward ...
[ "def", "get_hops", "(", "self", ",", "start", ",", "end", "=", "None", ",", "forward", "=", "True", ")", ":", "if", "forward", ":", "return", "list", "(", "self", ".", "_iterbfs", "(", "start", "=", "start", ",", "end", "=", "end", ",", "forward", ...
Computes the hop distance to all nodes centered around a specified node. First order neighbours are at hop 1, their neigbours are at hop 2 etc. Uses :py:meth:`forw_bfs` or :py:meth:`back_bfs` depending on the value of the forward parameter. If the distance between all neighbouring nodes is 1 t...
[ "Computes", "the", "hop", "distance", "to", "all", "nodes", "centered", "around", "a", "specified", "node", "." ]
ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6
https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/altgraph/Graph.py#L647-L673
train