rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
x, y, z = 0, 0, 0
x = 1
def main(): """Main program when invoked as a script. One argument: tabulate a single row. Two arguments: tabulate a range (inclusive). Extra arguments are used to seed the random generator. """ # default range (inclusive) k1 = 15 k2 = 19 if sys.argv[1:]: # one argument: single point k1 = k2 = int(sys.argv[1]) if sys...
8b6ec79b74284873696b24ab979fb1cb579b86f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b6ec79b74284873696b24ab979fb1cb579b86f8/sortperf.py
h = hash(a) h, d = divmod(h, 256) h = h & 0xffffff x = (x^h^d) & 255 h = h>>8 y = (y^h^d) & 255 h = h>>8 z = (z^h^d) & 255 whrandom.seed(x, y, z)
x = 69069 * x + hash(a) random.seed(x)
def main(): """Main program when invoked as a script. One argument: tabulate a single row. Two arguments: tabulate a range (inclusive). Extra arguments are used to seed the random generator. """ # default range (inclusive) k1 = 15 k2 = 19 if sys.argv[1:]: # one argument: single point k1 = k2 = int(sys.argv[1]) if sys...
8b6ec79b74284873696b24ab979fb1cb579b86f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b6ec79b74284873696b24ab979fb1cb579b86f8/sortperf.py
displayname = linkname = name = cgi.escape(name)
displayname = linkname = name
def list_directory(self, path): """Helper to produce a directory listing (absent index.html).
6d63a8dd09a3be6b5afd7a327bf86bca6be6ff0d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6d63a8dd09a3be6b5afd7a327bf86bca6be6ff0d/SimpleHTTPServer.py
f.write('<li><a href="%s">%s</a>\n' % (linkname, displayname))
f.write('<li><a href="%s">%s</a>\n' % (urllib.quote(linkname), cgi.escape(displayname)))
def list_directory(self, path): """Helper to produce a directory listing (absent index.html).
6d63a8dd09a3be6b5afd7a327bf86bca6be6ff0d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6d63a8dd09a3be6b5afd7a327bf86bca6be6ff0d/SimpleHTTPServer.py
def join(a, *p): """Join two or more pathname components, inserting "\\" as needed""" path = a for b in p: if isabs(b): path = b elif path == '' or path[-1:] in '/\\': path = path + b else: path = path + os.sep + b return path
f3c695c4675e61d5c303c96db699184253810306 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f3c695c4675e61d5c303c96db699184253810306/ntpath.py
"""Split a pathname into drive and path specifiers. Return a 2-tuple (drive, path); either part may be empty. This recognizes UNC paths (e.g. '\\\\host\\mountpoint\\dir\\file')"""
"""Split a pathname into drive and path specifiers. Returns a 2-tuple "(drive,path)"; either part may be empty"""
def splitdrive(p): """Split a pathname into drive and path specifiers. Return a 2-tuple (drive, path); either part may be empty. This recognizes UNC paths (e.g. '\\\\host\\mountpoint\\dir\\file')""" if p[1:2] == ':': return p[0:2], p[2:] firstTwo = p[0:2] if firstTwo == '//' or firstTwo == '\\\\': # is a UNC path: # v...
f3c695c4675e61d5c303c96db699184253810306 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f3c695c4675e61d5c303c96db699184253810306/ntpath.py
def isfile(path): """Test whether a path is a regular file""" try: st = os.stat(path) except os.error: return 0 return stat.S_ISREG(st[stat.ST_MODE])
f3c695c4675e61d5c303c96db699184253810306 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f3c695c4675e61d5c303c96db699184253810306/ntpath.py
def send(self, str): """Send `str' to the server.""" if self.sock is None: if self.auto_open: self.connect() else: raise NotConnected()
e3252ec6cf3e590ebec3df1a7d564b42d7e47847 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e3252ec6cf3e590ebec3df1a7d564b42d7e47847/httplib.py
Aassumes that the line does *not* end with \r\n.
Assumes that the line does *not* end with \\r\\n.
def _output(self, s): """Add a line of output to the current request buffer. Aassumes that the line does *not* end with \r\n. """ self._buffer.append(s)
e3252ec6cf3e590ebec3df1a7d564b42d7e47847 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e3252ec6cf3e590ebec3df1a7d564b42d7e47847/httplib.py
Appends an extra \r\n to the buffer.
Appends an extra \\r\\n to the buffer.
def _send_output(self): """Send the currently buffered request and clear the buffer.
e3252ec6cf3e590ebec3df1a7d564b42d7e47847 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e3252ec6cf3e590ebec3df1a7d564b42d7e47847/httplib.py
def splitdrive(p): """Split a pathname into drive and path. On Posix, drive is always empty.""" return '', p
65ad043ea3c331ee41b19746f3a15b19bef2dab1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/65ad043ea3c331ee41b19746f3a15b19bef2dab1/posixpath.py
return split(p)[1]
i = p.rfind('/') + 1 return p[i:]
def basename(p): """Returns the final component of a pathname""" return split(p)[1]
65ad043ea3c331ee41b19746f3a15b19bef2dab1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/65ad043ea3c331ee41b19746f3a15b19bef2dab1/posixpath.py
return split(p)[0]
i = p.rfind('/') + 1 head = p[:i] if head and head != '/'*len(head): head = head.rstrip('/') return head
def dirname(p): """Returns the directory component of a pathname""" return split(p)[0]
65ad043ea3c331ee41b19746f3a15b19bef2dab1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/65ad043ea3c331ee41b19746f3a15b19bef2dab1/posixpath.py
def __init__(self, root, flist, stack=None): self.top = top = ListedToplevel(root) top.protocol("WM_DELETE_WINDOW", self.close) top.bind("<Key-Escape>", self.close) top.wm_title("Stack viewer") top.wm_iconname("Stack") self.helplabel = Label(top, text="Click once to view variables; twice for source", borderwidth=2, re...
def __init__(self, flist=None): self.flist = flist self.stack = get_stack() self.text = get_exception()
def __init__(self, root, flist, stack=None): self.top = top = ListedToplevel(root) top.protocol("WM_DELETE_WINDOW", self.close) top.bind("<Key-Escape>", self.close) top.wm_title("Stack viewer") top.wm_iconname("Stack") # Create help label self.helplabel = Label(top, text="Click once to view variables; twice for source"...
b6584698733766b2028decd435ed2160f3557124 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b6584698733766b2028decd435ed2160f3557124/StackViewer.py
def close(self, event=None): self.top.destroy()
def GetText(self): return self.text
def close(self, event=None): self.top.destroy()
b6584698733766b2028decd435ed2160f3557124 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b6584698733766b2028decd435ed2160f3557124/StackViewer.py
localsframe = None localsviewer = None localsdict = None globalsframe = None globalsviewer = None globalsdict = None curframe = None
def GetSubList(self): sublist = [] for info in self.stack: item = FrameTreeItem(info, self.flist) sublist.append(item) return sublist
def close(self, event=None): self.top.destroy()
b6584698733766b2028decd435ed2160f3557124 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b6584698733766b2028decd435ed2160f3557124/StackViewer.py
def show_frame(self, (frame, lineno)): if frame is self.curframe: return self.curframe = None if frame.f_globals is not self.globalsdict: self.show_globals(frame) self.show_locals(frame) self.curframe = frame
class FrameTreeItem(TreeItem):
def show_frame(self, (frame, lineno)): if frame is self.curframe: return self.curframe = None if frame.f_globals is not self.globalsdict: self.show_globals(frame) self.show_locals(frame) self.curframe = frame
b6584698733766b2028decd435ed2160f3557124 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b6584698733766b2028decd435ed2160f3557124/StackViewer.py
def show_globals(self, frame): title = "Global Variables" if frame.f_globals.has_key("__name__"): try: name = str(frame.f_globals["__name__"]) + "" except: name = "" if name: title = title + " in module " + name self.globalsdict = None if self.globalsviewer: self.globalsviewer.close() self.globalsviewer = None if not s...
def __init__(self, info, flist): self.info = info self.flist = flist
def show_globals(self, frame): title = "Global Variables" if frame.f_globals.has_key("__name__"): try: name = str(frame.f_globals["__name__"]) + "" except: name = "" if name: title = title + " in module " + name self.globalsdict = None if self.globalsviewer: self.globalsviewer.close() self.globalsviewer = None if not s...
b6584698733766b2028decd435ed2160f3557124 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b6584698733766b2028decd435ed2160f3557124/StackViewer.py
def show_locals(self, frame): self.localsdict = None if self.localsviewer: self.localsviewer.close() self.localsviewer = None if frame.f_locals is not frame.f_globals: title = "Local Variables" code = frame.f_code funcname = code.co_name if funcname not in ("?", "", None): title = title + " in " + funcname if not self....
def GetText(self): frame, lineno = self.info try: modname = frame.f_globals["__name__"] except: modname = "?"
def show_locals(self, frame): self.localsdict = None if self.localsviewer: self.localsviewer.close() self.localsviewer = None if frame.f_locals is not frame.f_globals: title = "Local Variables" code = frame.f_code funcname = code.co_name if funcname not in ("?", "", None): title = title + " in " + funcname if not self....
b6584698733766b2028decd435ed2160f3557124 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b6584698733766b2028decd435ed2160f3557124/StackViewer.py
if os.path.isfile(filename):
funcname = code.co_name sourceline = linecache.getline(filename, lineno) sourceline = string.strip(sourceline) if funcname in ("?", "", None): item = "%s, line %d: %s" % (modname, lineno, sourceline) else: item = "%s.%s(...), line %d: %s" % (modname, funcname, lineno, sourceline) return item def GetSubList(self): fr...
def show_source(self, index): if not (0 <= index < len(self.stack)): return frame, lineno = self.stack[index] code = frame.f_code filename = code.co_filename if os.path.isfile(filename): edit = self.flist.open(filename) if edit: edit.gotoline(lineno)
b6584698733766b2028decd435ed2160f3557124 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b6584698733766b2028decd435ed2160f3557124/StackViewer.py
if edit: edit.gotoline(lineno)
edit.gotoline(lineno)
def show_source(self, index): if not (0 <= index < len(self.stack)): return frame, lineno = self.stack[index] code = frame.f_code filename = code.co_filename if os.path.isfile(filename): edit = self.flist.open(filename) if edit: edit.gotoline(lineno)
b6584698733766b2028decd435ed2160f3557124 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b6584698733766b2028decd435ed2160f3557124/StackViewer.py
def getexception(type=None, value=None):
def get_exception(type=None, value=None):
def get_stack(t=None, f=None): if t is None: t = sys.last_traceback stack = [] if t and t.tb_frame is f: t = t.tb_next while f is not None: stack.append((f, f.f_lineno)) if f is self.botframe: break f = f.f_back stack.reverse() while t is not None: stack.append((t.tb_frame, t.tb_lineno)) t = t.tb_next return stack
b6584698733766b2028decd435ed2160f3557124 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b6584698733766b2028decd435ed2160f3557124/StackViewer.py
class NamespaceViewer: def __init__(self, master, title, dict=None): width = 0 height = 40 if dict: height = 20*len(dict) self.master = master self.title = title self.repr = Repr() self.repr.maxstring = 60 self.repr.maxother = 60 self.frame = frame = Frame(master) self.frame.pack(expand=1, fill="both") self.label = L...
if __name__ == "__main__": root = Tk() root.withdraw() StackBrowser(root)
def getexception(type=None, value=None): if type is None: type = sys.last_type value = sys.last_value if hasattr(type, "__name__"): type = type.__name__ s = str(type) if value is not None: s = s + ": " + str(value) return s
b6584698733766b2028decd435ed2160f3557124 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b6584698733766b2028decd435ed2160f3557124/StackViewer.py
verify(cf.get('Long Line', 'foo', raw=1) == 'this line is much, much longer than my editor\nlikes it.') def write(src): print "Testing writing of files..." cf = ConfigParser.ConfigParser() sio = StringIO.StringIO(src) cf.readfp(sio) output = StringIO.StringIO() cf.write(output) verify(output, """[DEFAULT] foo = anoth...
def basic(src): print "Testing basic accessors..." cf = ConfigParser.ConfigParser() sio = StringIO.StringIO(src) cf.readfp(sio) L = cf.sections() L.sort() verify(L == [r'Commented Bar', r'Foo Bar', r'Internationalized Stuff', r'Section\with$weird%characters[' '\t', r'Spacey Bar', ], "unexpected list of section names") ...
1bf71172f8e1acfce05d8443e3998c425974aeef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1bf71172f8e1acfce05d8443e3998c425974aeef/test_cfgparser.py
makedirs(head, mode)
try: makedirs(head, mode) except OSError, e: if e.errno != EEXIST: raise
def makedirs(name, mode=0777): """makedirs(path [, mode=0777]) Super-mkdir; create a leaf directory and all intermediate ones. Works like mkdir, except that any intermediate path segment (not just the rightmost) will be created if it does not exist. This is recursive. """ head, tail = path.split(name) if not tail: h...
b130743e97410ba2b6c23d69df80e2ecea9d652b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b130743e97410ba2b6c23d69df80e2ecea9d652b/os.py
from errno import ENOENT, ENOTDIR
def _execvpe(file, args, env=None): from errno import ENOENT, ENOTDIR if env is not None: func = execve argrest = (args, env) else: func = execv argrest = (args,) env = environ head, tail = path.split(file) if head: func(file, *argrest) return if 'PATH' in env: envpath = env['PATH'] else: envpath = defpath PATH = env...
b130743e97410ba2b6c23d69df80e2ecea9d652b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b130743e97410ba2b6c23d69df80e2ecea9d652b/os.py
if not strm:
if strm is None:
def __init__(self, strm=None): """ Initialize the handler.
502348d010be73a20cd5d6ce5512746198baa711 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/502348d010be73a20cd5d6ce5512746198baa711/__init__.py
file = open(filename)
try: file = open(filename) except IOError: return None
def synopsis(filename, cache={}): """Get the one-line summary out of a module file.""" mtime = os.stat(filename).st_mtime lastupdate, result = cache.get(filename, (0, None)) if lastupdate < mtime: info = inspect.getmoduleinfo(filename) file = open(filename) if info and 'b' in info[2]: # binary modules have to be import...
26fd2e1dcc6f07f6c58127a790312850849c1c60 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/26fd2e1dcc6f07f6c58127a790312850849c1c60/pydoc.py
def configure(self, cnf=None, **kw): """Configure resources of a widget. The values for resources are specified as keyword arguments. To get an overview about the allowed keyword arguments call the method keys. """
def _configure(self, cmd, cnf, kw): """Internal function."""
def _report_exception(self): """Internal function.""" import sys exc, val, tb = sys.exc_type, sys.exc_value, sys.exc_traceback root = self._root() root.report_callback_exception(exc, val, tb)
6ce1315bd35b6114abf8a59d0e9b9f7dce0bcd7d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6ce1315bd35b6114abf8a59d0e9b9f7dce0bcd7d/Tkinter.py
self.tk.call(self._w, 'configure')):
self.tk.call(_flatten((self._w, cmd)))):
def configure(self, cnf=None, **kw): """Configure resources of a widget.
6ce1315bd35b6114abf8a59d0e9b9f7dce0bcd7d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6ce1315bd35b6114abf8a59d0e9b9f7dce0bcd7d/Tkinter.py
x = self.tk.split(self.tk.call( self._w, 'configure', '-'+cnf))
x = self.tk.split( self.tk.call(_flatten((self._w, cmd, '-'+cnf))))
def configure(self, cnf=None, **kw): """Configure resources of a widget.
6ce1315bd35b6114abf8a59d0e9b9f7dce0bcd7d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6ce1315bd35b6114abf8a59d0e9b9f7dce0bcd7d/Tkinter.py
self.tk.call((self._w, 'configure') + self._options(cnf))
self.tk.call(_flatten((self._w, cmd)) + self._options(cnf)) def configure(self, cnf=None, **kw): """Configure resources of a widget. The values for resources are specified as keyword arguments. To get an overview about the allowed keyword arguments call the method keys. """ return self._configure('configure', cnf, kw...
def configure(self, cnf=None, **kw): """Configure resources of a widget.
6ce1315bd35b6114abf8a59d0e9b9f7dce0bcd7d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6ce1315bd35b6114abf8a59d0e9b9f7dce0bcd7d/Tkinter.py
if cnf is None and not kw: cnf = {} for x in self.tk.split( self.tk.call(self._w, 'itemconfigure', tagOrId)): cnf[x[0][1:]] = (x[0][1:],) + x[1:] return cnf if type(cnf) == StringType and not kw: x = self.tk.split(self.tk.call( self._w, 'itemconfigure', tagOrId, '-'+cnf)) return (x[0][1:],) + x[1:] self.tk.call((self._...
return self._configure(('itemconfigure', tagOrId), cnf, kw)
def itemconfigure(self, tagOrId, cnf=None, **kw): """Configure resources of an item TAGORID.
6ce1315bd35b6114abf8a59d0e9b9f7dce0bcd7d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6ce1315bd35b6114abf8a59d0e9b9f7dce0bcd7d/Tkinter.py
if cnf is None and not kw: cnf = {} for x in self.tk.split( self.tk.call(self._w, 'itemconfigure', index)): cnf[x[0][1:]] = (x[0][1:],) + x[1:] return cnf if type(cnf) == StringType and not kw: x = self.tk.split(self.tk.call( self._w, 'itemconfigure', index, '-'+cnf)) return (x[0][1:],) + x[1:] self.tk.call((self._w, '...
return self._configure(('itemconfigure', index), cnf, kw)
def itemconfigure(self, index, cnf=None, **kw): """Configure resources of an ITEM.
6ce1315bd35b6114abf8a59d0e9b9f7dce0bcd7d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6ce1315bd35b6114abf8a59d0e9b9f7dce0bcd7d/Tkinter.py
if cnf is None and not kw: cnf = {} for x in self.tk.split(self.tk.call( (self._w, 'entryconfigure', index))): cnf[x[0][1:]] = (x[0][1:],) + x[1:] return cnf if type(cnf) == StringType and not kw: x = self.tk.split(self.tk.call( (self._w, 'entryconfigure', index, '-'+cnf))) return (x[0][1:],) + x[1:] self.tk.call((self...
return self._configure(('entryconfigure', index), cnf, kw)
def entryconfigure(self, index, cnf=None, **kw): """Configure a menu item at INDEX.""" if cnf is None and not kw: cnf = {} for x in self.tk.split(self.tk.call( (self._w, 'entryconfigure', index))): cnf[x[0][1:]] = (x[0][1:],) + x[1:] return cnf if type(cnf) == StringType and not kw: x = self.tk.split(self.tk.call( (sel...
6ce1315bd35b6114abf8a59d0e9b9f7dce0bcd7d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6ce1315bd35b6114abf8a59d0e9b9f7dce0bcd7d/Tkinter.py
def image_configure(self, index, cnf={}, **kw):
def image_configure(self, index, cnf=None, **kw):
def image_configure(self, index, cnf={}, **kw): """Configure an embedded image at INDEX.""" if not cnf and not kw: cnf = {} for x in self.tk.split( self.tk.call( self._w, "image", "configure", index)): cnf[x[0][1:]] = (x[0][1:],) + x[1:] return cnf apply(self.tk.call, (self._w, "image", "configure", index) + self._opti...
6ce1315bd35b6114abf8a59d0e9b9f7dce0bcd7d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6ce1315bd35b6114abf8a59d0e9b9f7dce0bcd7d/Tkinter.py
if not cnf and not kw: cnf = {} for x in self.tk.split( self.tk.call( self._w, "image", "configure", index)): cnf[x[0][1:]] = (x[0][1:],) + x[1:] return cnf apply(self.tk.call, (self._w, "image", "configure", index) + self._options(cnf, kw))
return self._configure(('image', 'configure', index), cnf, kw)
def image_configure(self, index, cnf={}, **kw): """Configure an embedded image at INDEX.""" if not cnf and not kw: cnf = {} for x in self.tk.split( self.tk.call( self._w, "image", "configure", index)): cnf[x[0][1:]] = (x[0][1:],) + x[1:] return cnf apply(self.tk.call, (self._w, "image", "configure", index) + self._opti...
6ce1315bd35b6114abf8a59d0e9b9f7dce0bcd7d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6ce1315bd35b6114abf8a59d0e9b9f7dce0bcd7d/Tkinter.py
def tag_configure(self, tagName, cnf={}, **kw):
def tag_configure(self, tagName, cnf=None, **kw):
def tag_configure(self, tagName, cnf={}, **kw): """Configure a tag TAGNAME.""" if type(cnf) == StringType: x = self.tk.split(self.tk.call( self._w, 'tag', 'configure', tagName, '-'+cnf)) return (x[0][1:],) + x[1:] self.tk.call( (self._w, 'tag', 'configure', tagName) + self._options(cnf, kw))
6ce1315bd35b6114abf8a59d0e9b9f7dce0bcd7d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6ce1315bd35b6114abf8a59d0e9b9f7dce0bcd7d/Tkinter.py
if type(cnf) == StringType: x = self.tk.split(self.tk.call( self._w, 'tag', 'configure', tagName, '-'+cnf)) return (x[0][1:],) + x[1:] self.tk.call( (self._w, 'tag', 'configure', tagName) + self._options(cnf, kw))
return self._configure(('tag', 'configure', tagName), cnf, kw)
def tag_configure(self, tagName, cnf={}, **kw): """Configure a tag TAGNAME.""" if type(cnf) == StringType: x = self.tk.split(self.tk.call( self._w, 'tag', 'configure', tagName, '-'+cnf)) return (x[0][1:],) + x[1:] self.tk.call( (self._w, 'tag', 'configure', tagName) + self._options(cnf, kw))
6ce1315bd35b6114abf8a59d0e9b9f7dce0bcd7d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6ce1315bd35b6114abf8a59d0e9b9f7dce0bcd7d/Tkinter.py
def window_configure(self, index, cnf={}, **kw):
def window_configure(self, index, cnf=None, **kw):
def window_configure(self, index, cnf={}, **kw): """Configure an embedded window at INDEX.""" if type(cnf) == StringType: x = self.tk.split(self.tk.call( self._w, 'window', 'configure', index, '-'+cnf)) return (x[0][1:],) + x[1:] self.tk.call( (self._w, 'window', 'configure', index) + self._options(cnf, kw))
6ce1315bd35b6114abf8a59d0e9b9f7dce0bcd7d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6ce1315bd35b6114abf8a59d0e9b9f7dce0bcd7d/Tkinter.py
if type(cnf) == StringType: x = self.tk.split(self.tk.call( self._w, 'window', 'configure', index, '-'+cnf)) return (x[0][1:],) + x[1:] self.tk.call( (self._w, 'window', 'configure', index) + self._options(cnf, kw))
return self._configure(('window', 'configure', index), cnf, kw)
def window_configure(self, index, cnf={}, **kw): """Configure an embedded window at INDEX.""" if type(cnf) == StringType: x = self.tk.split(self.tk.call( self._w, 'window', 'configure', index, '-'+cnf)) return (x[0][1:],) + x[1:] self.tk.call( (self._w, 'window', 'configure', index) + self._options(cnf, kw))
6ce1315bd35b6114abf8a59d0e9b9f7dce0bcd7d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6ce1315bd35b6114abf8a59d0e9b9f7dce0bcd7d/Tkinter.py
otherwise return - (the signal that killed it). """
otherwise return -SIG, where SIG is the signal that killed it. """
def spawnv(mode, file, args): """spawnv(mode, file, args) -> integer
7da3cc5dfbbc722238a6140acccba469f66e7fac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7da3cc5dfbbc722238a6140acccba469f66e7fac/os.py
exception = ['<p>%s: %s' % (strong(str(etype)), str(evalue))]
exception = ['<p>%s: %s' % (strong(pydoc.html.escape(str(etype))), pydoc.html.escape(str(evalue)))]
def reader(lnum=[lnum]): highlight[lnum[0]] = 1 try: return linecache.getline(file, lnum[0]) finally: lnum[0] += 1
b67c94318ec85722ce01c03955d6fbf50e3f7aa9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b67c94318ec85722ce01c03955d6fbf50e3f7aa9/cgitb.py
(msg is None or mod.match(module)) and
(mod is None or mod.match(module)) and
def warn_explicit(message, category, filename, lineno, module=None, registry=None): if module is None: module = filename if module[-3:].lower() == ".py": module = module[:-3] # XXX What about leading pathname? if registry is None: registry = {} if isinstance(message, Warning): text = str(message) category = message.__c...
6cea6933625910298c5fb156f365814eb3600494 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6cea6933625910298c5fb156f365814eb3600494/warnings.py
buffering. Sublcasses should however, if possible, try to
buffering. Subclasses should however, if possible, try to
def readline(self, size=None):
7f3ed74643dd87ef9b6f54c235e4c562179cfb33 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7f3ed74643dd87ef9b6f54c235e4c562179cfb33/codecs.py
was specified. Thisis done to avoid data loss due to encodings
was specified. This is done to avoid data loss due to encodings
def open(filename, mode='rb', encoding=None, errors='strict', buffering=1): """ Open an encoded file using the given mode and return a wrapped version providing transparent encoding/decoding. Note: The wrapped version will only accept the object format defined by the codecs, i.e. Unicode objects for most builtin code...
7f3ed74643dd87ef9b6f54c235e4c562179cfb33 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7f3ed74643dd87ef9b6f54c235e4c562179cfb33/codecs.py
the file.
file.
def open(filename, mode='rb', encoding=None, errors='strict', buffering=1): """ Open an encoded file using the given mode and return a wrapped version providing transparent encoding/decoding. Note: The wrapped version will only accept the object format defined by the codecs, i.e. Unicode objects for most builtin code...
7f3ed74643dd87ef9b6f54c235e4c562179cfb33 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7f3ed74643dd87ef9b6f54c235e4c562179cfb33/codecs.py
If a target mapping in the decoding map occurrs multiple
If a target mapping in the decoding map occurs multiple
def make_encoding_map(decoding_map): """ Creates an encoding map from a decoding map. If a target mapping in the decoding map occurrs multiple times, then that target is mapped to None (undefined mapping), causing an exception when encountered by the charmap codec during translation. One example where this happens i...
7f3ed74643dd87ef9b6f54c235e4c562179cfb33 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7f3ed74643dd87ef9b6f54c235e4c562179cfb33/codecs.py
import Plist builder.plist = Plist.fromFile(plistname)
import plistlib builder.plist = plistlib.Plist.fromFile(plistname)
def process_common_macho(template, progress, code, rsrcname, destname, is_update, raw=0, others=[], filename=None): # Check that we have a filename if filename is None: raise BuildError, "Need source filename on MacOSX" # First make sure the name ends in ".app" if destname[-4:] != '.app': destname = destname + '.app' #...
9f59d528c5a9bfbcc93fdf8bd42d8738105b675c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9f59d528c5a9bfbcc93fdf8bd42d8738105b675c/buildtools.py
expected = longx // longy got = x // y
expected = longx / longy got = x / y
def checkit(*args): # Heavy use of nested scopes here! verify(got == expected, "for %r expected %r got %r" % (args, expected, got))
0dad0f763cfad1d387db91053f50f289732e0011 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0dad0f763cfad1d387db91053f50f289732e0011/test_long.py
def seek(self, pos, mode = 0):
def seek(self, pos, whence = 0):
def seek(self, pos, mode = 0): """Seek to specified position into the chunk. Default position is 0 (start of chunk). If the file is not seekable, this will result in an error.
624a1915121f60350984049a9f942d941ee14fbe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/624a1915121f60350984049a9f942d941ee14fbe/chunk.py
if mode == 1:
if whence == 1:
def seek(self, pos, mode = 0): """Seek to specified position into the chunk. Default position is 0 (start of chunk). If the file is not seekable, this will result in an error.
624a1915121f60350984049a9f942d941ee14fbe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/624a1915121f60350984049a9f942d941ee14fbe/chunk.py
elif mode == 2:
elif whence == 2:
def seek(self, pos, mode = 0): """Seek to specified position into the chunk. Default position is 0 (start of chunk). If the file is not seekable, this will result in an error.
624a1915121f60350984049a9f942d941ee14fbe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/624a1915121f60350984049a9f942d941ee14fbe/chunk.py
def read(self, n = -1): """Read at most n bytes from the chunk. If n is omitted or negative, read until the end
def read(self, size = -1): """Read at most size bytes from the chunk. If size is omitted or negative, read until the end
def read(self, n = -1): """Read at most n bytes from the chunk. If n is omitted or negative, read until the end of the chunk.
624a1915121f60350984049a9f942d941ee14fbe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/624a1915121f60350984049a9f942d941ee14fbe/chunk.py
if n < 0: n = self.chunksize - self.size_read if n > self.chunksize - self.size_read: n = self.chunksize - self.size_read data = self.file.read(n)
if size < 0: size = self.chunksize - self.size_read if size > self.chunksize - self.size_read: size = self.chunksize - self.size_read data = self.file.read(size)
def read(self, n = -1): """Read at most n bytes from the chunk. If n is omitted or negative, read until the end of the chunk.
624a1915121f60350984049a9f942d941ee14fbe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/624a1915121f60350984049a9f942d941ee14fbe/chunk.py
if os.name in ('nt', 'os2'):
if os.name in ('nt', 'os2') or sys.platform == 'cygwin':
def setUp(self): TestMailbox.setUp(self) if os.name in ('nt', 'os2'): self._box.colon = '!'
003c9e29520a24da7177f16fe26e758c6baeaaca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/003c9e29520a24da7177f16fe26e758c6baeaaca/test_mailbox.py
self.assertRaises(mailbox.ExternalClashError, self._box.lock) exited_pid, status = os.waitpid(pid, 0)
try: self.assertRaises(mailbox.ExternalClashError, self._box.lock) finally: exited_pid, status = os.waitpid(pid, 0)
def test_lock_conflict(self): # Fork off a subprocess that will lock the file for 2 seconds, # unlock it, and then exit. if not hasattr(os, 'fork'): return pid = os.fork() if pid == 0: # In the child, lock the mailbox. self._box.lock() time.sleep(2) self._box.unlock() os._exit(0)
003c9e29520a24da7177f16fe26e758c6baeaaca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/003c9e29520a24da7177f16fe26e758c6baeaaca/test_mailbox.py
" LettError, Erik van Blokland, for the \n" " Python for Windows graphic.\n" " http://www.letterror.com/\n" "\n"
def add_ui(db): x = y = 50 w = 370 h = 300 title = "[ProductName] Setup" # see "Dialog Style Bits" modal = 3 # visible | modal modeless = 1 # visible track_disk_space = 32 add_data(db, 'ActionText', uisample.ActionText) add_data(db, 'UIText', uisample.UIText) # Bitmaps if not os.path.exists(srcdir+r"\PC\pytho...
8301c7923ddc90b23b8ab37c29eba6cd5df06669 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8301c7923ddc90b23b8ab37c29eba6cd5df06669/msi.py
ServerClass = SocketServer.TCPServer):
ServerClass = BaseHTTPServer.HTTPServer):
def test(HandlerClass = SimpleHTTPRequestHandler, ServerClass = SocketServer.TCPServer): BaseHTTPServer.test(HandlerClass, ServerClass)
5c3b384a851b5f8f9a4f9a39a6869528d4444658 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5c3b384a851b5f8f9a4f9a39a6869528d4444658/SimpleHTTPServer.py
if timer is None: if os.name == 'mac':
if not timer: if _has_res: self.timer = resgetrusage self.dispatcher = self.trace_dispatch self.get_time = _get_time_resource elif os.name == 'mac':
def __init__(self, timer=None, bias=None): self.timings = {} self.cur = None self.cmd = "" self.c_func_name = ""
a4dac4094acd35810b1497bbf99642fc98afd475 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a4dac4094acd35810b1497bbf99642fc98afd475/profile.py
print 'source', `class_tcl`
def readprofile(self, baseName, className): """Internal function. It reads BASENAME.tcl and CLASSNAME.tcl into the Tcl Interpreter and calls execfile on BASENAME.py and CLASSNAME.py if such a file exists in the home directory.""" import os if os.environ.has_key('HOME'): home = os.environ['HOME'] else: home = os.curdir ...
d2a5ad25d5f6734c919bd40ee26c3e11b98d6bc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d2a5ad25d5f6734c919bd40ee26c3e11b98d6bc3/Tkinter.py
print 'execfile', `class_py`
def readprofile(self, baseName, className): """Internal function. It reads BASENAME.tcl and CLASSNAME.tcl into the Tcl Interpreter and calls execfile on BASENAME.py and CLASSNAME.py if such a file exists in the home directory.""" import os if os.environ.has_key('HOME'): home = os.environ['HOME'] else: home = os.curdir ...
d2a5ad25d5f6734c919bd40ee26c3e11b98d6bc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d2a5ad25d5f6734c919bd40ee26c3e11b98d6bc3/Tkinter.py
print 'source', `base_tcl`
def readprofile(self, baseName, className): """Internal function. It reads BASENAME.tcl and CLASSNAME.tcl into the Tcl Interpreter and calls execfile on BASENAME.py and CLASSNAME.py if such a file exists in the home directory.""" import os if os.environ.has_key('HOME'): home = os.environ['HOME'] else: home = os.curdir ...
d2a5ad25d5f6734c919bd40ee26c3e11b98d6bc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d2a5ad25d5f6734c919bd40ee26c3e11b98d6bc3/Tkinter.py
print 'execfile', `base_py`
def readprofile(self, baseName, className): """Internal function. It reads BASENAME.tcl and CLASSNAME.tcl into the Tcl Interpreter and calls execfile on BASENAME.py and CLASSNAME.py if such a file exists in the home directory.""" import os if os.environ.has_key('HOME'): home = os.environ['HOME'] else: home = os.curdir ...
d2a5ad25d5f6734c919bd40ee26c3e11b98d6bc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d2a5ad25d5f6734c919bd40ee26c3e11b98d6bc3/Tkinter.py
def getinfo(self): return (self.format, self.width, self.height, self.packfactor,\ self.c0bits, self.c1bits, self.c2bits, self.offset, \ self.chrompack)
9a35d57ab2d1f2a8eafd0d487ac8166c93db0a5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9a35d57ab2d1f2a8eafd0d487ac8166c93db0a5a/VFile.py
def rewind(self):
def reopen(self):
def rewind(self): self.fp.seek(0) x = self.initfp(self.fp, self.filename)
9a35d57ab2d1f2a8eafd0d487ac8166c93db0a5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9a35d57ab2d1f2a8eafd0d487ac8166c93db0a5a/VFile.py
def getnextframedata(self, (size, chromsize)):
def getnextframedata(self, size, chromsize):
def getnextframedata(self, (size, chromsize)): if self.hascache: self.position() self.frameno = self.frameno + 1 data = self.fp.read(size) if len(data) <> size: raise EOFError if chromsize: chromdata = self.fp.read(chromsize) if len(chromdata) <> chromsize: raise EOFError else: chromdata = None # return data, chromdata
9a35d57ab2d1f2a8eafd0d487ac8166c93db0a5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9a35d57ab2d1f2a8eafd0d487ac8166c93db0a5a/VFile.py
def skipnextframedata(self, (size, chromsize)):
def skipnextframedata(self, size, chromsize):
def skipnextframedata(self, (size, chromsize)): if self.hascache: self.frameno = self.frameno + 1 return # Note that this won't raise EOFError for a partial frame. try: self.fp.seek(size + chromsize, 1) # Relative seek except: # Assume it's a pipe -- read the data to discard it dummy = self.fp.read(size + chromsize)
9a35d57ab2d1f2a8eafd0d487ac8166c93db0a5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9a35d57ab2d1f2a8eafd0d487ac8166c93db0a5a/VFile.py
def showframe(self, (data, chromdata)):
def showframe(self, data, chromdata):
def showframe(self, (data, chromdata)): w, h, pf = self.width, self.height, self.packfactor if not self.colormapinited: self.initcolormap() factor = self.magnify if pf: factor = factor * pf if chromdata and not self.skipchrom: cp = self.chrompack cw = (w+cp-1)/cp ch = (h+cp-1)/cp gl.rectzoom(factor*cp, factor*cp) gl.pi...
9a35d57ab2d1f2a8eafd0d487ac8166c93db0a5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9a35d57ab2d1f2a8eafd0d487ac8166c93db0a5a/VFile.py
sys.stderr.write('Initializing color map...')
if not self.quiet: sys.stderr.write('Initializing color map...')
def initcolormap(self): self.colormapinited = 1 if self.format == 'rgb': gl.RGBmode() gl.gconfig() return gl.cmode() gl.gconfig() self.skipchrom = 0 sys.stderr.write('Initializing color map...') self.initcmap() sys.stderr.write(' Done.\n') if self.offset == 0: gl.color(0x800) gl.clear() self.mask = 0x7ff else: self.mas...
9a35d57ab2d1f2a8eafd0d487ac8166c93db0a5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9a35d57ab2d1f2a8eafd0d487ac8166c93db0a5a/VFile.py
sys.stderr.write(' Done.\n')
if not self.quiet: sys.stderr.write(' Done.\n')
def initcolormap(self): self.colormapinited = 1 if self.format == 'rgb': gl.RGBmode() gl.gconfig() return gl.cmode() gl.gconfig() self.skipchrom = 0 sys.stderr.write('Initializing color map...') self.initcmap() sys.stderr.write(' Done.\n') if self.offset == 0: gl.color(0x800) gl.clear() self.mask = 0x7ff else: self.mas...
9a35d57ab2d1f2a8eafd0d487ac8166c93db0a5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9a35d57ab2d1f2a8eafd0d487ac8166c93db0a5a/VFile.py
data = ('grey', 0)
data = ('grey', self.c0bits)
def writeheader(self): self.headerwritten = 1 if self.format == 'rgb': self.packfactor = 0 elif self.packfactor == 0: self.packfactor = 1 self.fp.write('CMIF video 3.0\n') if self.format == 'rgb': data = ('rgb', 0) elif self.format == 'grey': data = ('grey', 0) else: data = (self.format, (self.c0bits, self.c1bits, \ se...
9a35d57ab2d1f2a8eafd0d487ac8166c93db0a5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9a35d57ab2d1f2a8eafd0d487ac8166c93db0a5a/VFile.py
except error_proto(val):
except error_proto, val:
def quit(self): """Signoff: commit changes on server, unlock mailbox, close connection.""" try: resp = self._shortcmd('QUIT') except error_proto(val): resp = val self.file.close() self.sock.close() del self.file, self.sock return resp
de23cb0e7e1a5181e6102c4f32ab8a24886f27af /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/de23cb0e7e1a5181e6102c4f32ab8a24886f27af/poplib.py
try: temp = open(tempname, 'w') except IOError: print '*** Cannot create temp file', `tempname` return
temp = open(tempname, 'w')
def pipethrough(input, command, output): tempname = tempfile.mktemp() try: temp = open(tempname, 'w') except IOError: print '*** Cannot create temp file', `tempname` return copyliteral(input, temp) temp.close() pipe = os.popen(command + ' <' + tempname, 'r') copybinary(pipe, output) pipe.close() os.unlink(tempname)
6fd08baddc899d342129d646058ff921650b8573 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6fd08baddc899d342129d646058ff921650b8573/mimetools.py
def resolve_dotted_attribute(obj, attr): """resolve_dotted_attribute(math, 'cos.__doc__') => math.cos.__doc__ Resolves a dotted attribute name to an object. Raises an AttributeError if any attribute in the chain starts with a '_'. """ for i in attr.split('.'): if i.startswith('_'): raise AttributeError( 'attempt to ac...
def resolve_dotted_attribute(obj, attr): """resolve_dotted_attribute(math, 'cos.__doc__') => math.cos.__doc__
787fd8cdeb72bea74a79e5acf61debfd11683502 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/787fd8cdeb72bea74a79e5acf61debfd11683502/SimpleXMLRPCServer.py
return apply( getattr(self.server.instance,'_dispatch'), (method, params) )
return self.server.instance._dispatch(method, params)
def resolve_dotted_attribute(obj, attr): """resolve_dotted_attribute(math, 'cos.__doc__') => math.cos.__doc__
787fd8cdeb72bea74a79e5acf61debfd11683502 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/787fd8cdeb72bea74a79e5acf61debfd11683502/SimpleXMLRPCServer.py
func = resolve_dotted_attribute(
func = _resolve_dotted_attribute(
def resolve_dotted_attribute(obj, attr): """resolve_dotted_attribute(math, 'cos.__doc__') => math.cos.__doc__
787fd8cdeb72bea74a79e5acf61debfd11683502 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/787fd8cdeb72bea74a79e5acf61debfd11683502/SimpleXMLRPCServer.py
s = string.rjust(`vin.packfactor`, 2) if vin.packfactor and vin.format not in ('rgb', 'jpeg') and \ (vin.width/vin.packfactor) % 4 <> 0: s = s + '!'
if type(vin.packfactor) == type(()): xpf, ypf = vin.packfactor s = string.rjust(`xpf`, 2) + ',' + \ string.rjust(`ypf`, 2)
def process(filename): try: vin = VFile.RandomVinFile().init(filename) except IOError, msg: sys.stderr.write(filename + ': I/O error: ' + `msg` + '\n') return 1 except VFile.Error, msg: sys.stderr.write(msg + '\n') return 1 except EOFError: sys.stderr.write(filename + ': EOF in video file\n') return 1 if terse: print ...
83c81448b1db067a8eeea140afbde525499f507b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/83c81448b1db067a8eeea140afbde525499f507b/Vinfo.py
s = s + ' '
s = string.rjust(`vin.packfactor`, 2) if type(vin.packfactor) == type(0) and \ vin.format not in ('rgb', 'jpeg') and \ (vin.width/vin.packfactor) % 4 <> 0: s = s + '! ' else: s = s + ' '
def process(filename): try: vin = VFile.RandomVinFile().init(filename) except IOError, msg: sys.stderr.write(filename + ': I/O error: ' + `msg` + '\n') return 1 except VFile.Error, msg: sys.stderr.write(msg + '\n') return 1 except EOFError: sys.stderr.write(filename + ': EOF in video file\n') return 1 if terse: print ...
83c81448b1db067a8eeea140afbde525499f507b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/83c81448b1db067a8eeea140afbde525499f507b/Vinfo.py
print string.rjust(`int(n*10000.0/t)*0.1`, 5)
if t: print string.rjust(`int(n*10000.0/t)*0.1`, 5), print
def process(filename): try: vin = VFile.RandomVinFile().init(filename) except IOError, msg: sys.stderr.write(filename + ': I/O error: ' + `msg` + '\n') return 1 except VFile.Error, msg: sys.stderr.write(msg + '\n') return 1 except EOFError: sys.stderr.write(filename + ': EOF in video file\n') return 1 if terse: print ...
83c81448b1db067a8eeea140afbde525499f507b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/83c81448b1db067a8eeea140afbde525499f507b/Vinfo.py
args['linker_so'] = linker_so + ' -shared'
if platform == 'darwin1': args['linker_so'] = linker_so else: args['linker_so'] = linker_so + ' -shared'
def build_extensions(self):
df82e58cd516ea1dcd9d0bfc5622a5239af0392d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/df82e58cd516ea1dcd9d0bfc5622a5239af0392d/setup.py
The optional second argument can specify an alternative default."""
The optional second argument can specify an alternate default."""
def getenv(key, default=None): """Get an environment variable, return None if it doesn't exist. The optional second argument can specify an alternative default.""" return environ.get(key, default)
20af3172ce46a13789dbb4087e1115c95cfa9227 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/20af3172ce46a13789dbb4087e1115c95cfa9227/os.py
assert mode[:1] in ("b", "t")
def popen2(cmd, mode="t", bufsize=-1): assert mode[:1] in ("b", "t") import popen2 stdout, stdin = popen2.popen2(cmd, bufsize) return stdin, stdout
20af3172ce46a13789dbb4087e1115c95cfa9227 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/20af3172ce46a13789dbb4087e1115c95cfa9227/os.py
if not hasattr(socket, "ssl"): raise test_support.TestSkipped("socket module has no ssl support")
def test_basic(): test_support.requires('network') if not hasattr(socket, "ssl"): raise test_support.TestSkipped("socket module has no ssl support") import urllib socket.RAND_status() try: socket.RAND_egd(1) except TypeError: pass else: print "didn't raise TypeError" socket.RAND_add("this is a random string", 75.0) ...
1787a0b1cc9679791a2fe775f63c322491c6767a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1787a0b1cc9679791a2fe775f63c322491c6767a/test_socket_ssl.py
('cygwin.*', 'cygwin'),
('cygwin.*', 'unix'),
def mkpath (self, name, mode=0777): mkpath (name, mode, self.verbose, self.dry_run)
a34dbe0fdcfd7cf75c8d339542183d58cacfce8b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a34dbe0fdcfd7cf75c8d339542183d58cacfce8b/ccompiler.py
def storbinary(self, cmd, fp, blocksize):
def storbinary(self, cmd, fp, blocksize=8192):
def storbinary(self, cmd, fp, blocksize): '''Store a file in binary mode.''' self.voidcmd('TYPE I') conn = self.transfercmd(cmd) while 1: buf = fp.read(blocksize) if not buf: break conn.send(buf) conn.close() return self.voidresp()
4ac83474a3201394ea668d624729883d85f9304a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4ac83474a3201394ea668d624729883d85f9304a/ftplib.py
prefix = None exec_prefix = None extensions = [] path = sys.path odir = '' frozen_c = 'frozen.c' config_c = 'config.c' target = 'a.out' makefile = 'Makefile' try: opts, args = getopt.getopt(sys.argv[1:], 'he:o:p:P:') except getopt.error, msg: usage('getopt error: ' + str(msg)) for o, a in opts: if o == '-h': pri...
prefix = None exec_prefix = None extensions = [] path = sys.path odir = '' frozen_c = 'frozen.c' config_c = 'config.c' target = 'a.out' makefile = 'Makefile' try: opts, args = getopt.getopt(sys.argv[1:], 'he:o:p:P:') except getopt.error, msg: usage('getopt error: ' + str(msg)) for o, a in opts: if o == '-h': pri...
def main(): # overridable context prefix = None # settable with -p option exec_prefix = None # settable with -P option extensions = [] path = sys.path odir = '' # output files frozen_c = 'frozen.c' config_c = 'config.c' target = 'a.out' # normally derived from script name makefile = 'Makefile' # parse command lin...
0b4b8a21ce943aa07584c1a6608be6246f214d90 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0b4b8a21ce943aa07584c1a6608be6246f214d90/freeze.py
if completekey: try: import readline readline.set_completer(self.complete) readline.parse_and_bind(completekey+": complete") except ImportError: pass
self.completekey = completekey
def __init__(self, completekey='tab'): """Instantiate a line-oriented interpreter framework.
35a92ce9da03a7a8acce565708eba96bf7cc2f1c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/35a92ce9da03a7a8acce565708eba96bf7cc2f1c/cmd.py
pass
if self.completekey: try: import readline self.old_completer = readline.get_completer() readline.set_completer(self.complete) readline.parse_and_bind(self.completekey+": complete") except ImportError: pass
def preloop(self): """Hook method executed once when the cmdloop() method is called.""" pass
35a92ce9da03a7a8acce565708eba96bf7cc2f1c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/35a92ce9da03a7a8acce565708eba96bf7cc2f1c/cmd.py
pass
if self.completekey: try: import readline readline.set_completer(self.old_completer) except ImportError: pass
def postloop(self): """Hook method executed once when the cmdloop() method is about to return.
35a92ce9da03a7a8acce565708eba96bf7cc2f1c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/35a92ce9da03a7a8acce565708eba96bf7cc2f1c/cmd.py
st = self.stream.Status() host = macdnr.AddrToStr(st.localHost) return host, st.localPort
host, port = self.stream.GetSockName() host = macdnr.AddrToStr(host) return host, port
def getsockname(self): st = self.stream.Status() host = macdnr.AddrToStr(st.localHost) return host, st.localPort
f90a113176df262aa7d495a57bdc0d09c8ac09bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f90a113176df262aa7d495a57bdc0d09c8ac09bb/socket.py
if not self.databuf: print '** socket: no data!' print '** recv: got ', len(self.databuf)
def recv(self, bufsize, flags=0): if flags: raise my_error, 'recv flags not yet supported on mac' if not self.databuf: try: self.databuf, urg, mark = self.stream.Rcv(0) if not self.databuf: print '** socket: no data!' print '** recv: got ', len(self.databuf) except mactcp.error, arg: if arg[0] != MACTCP.connectionClosi...
f90a113176df262aa7d495a57bdc0d09c8ac09bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f90a113176df262aa7d495a57bdc0d09c8ac09bb/socket.py
print '** Readline:',self, `rv`
def readline(self): import string while not '\n' in self.buf: new = self.sock.recv(0x7fffffff) if not new: break self.buf = self.buf + new if not '\n' in self.buf: rv = self.buf self.buf = '' else: i = string.index(self.buf, '\n') rv = self.buf[:i+1] self.buf = self.buf[i+1:] print '** Readline:',self, `rv` return rv
f90a113176df262aa7d495a57bdc0d09c8ac09bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f90a113176df262aa7d495a57bdc0d09c8ac09bb/socket.py
import sys, os, tempfile
import sys, os, tempfile, time
def test_bug737473(self): import sys, os, tempfile savedpath = sys.path[:] testdir = tempfile.mkdtemp() try: sys.path.insert(0, testdir) testfile = os.path.join(testdir, 'test_bug737473.py') print >> open(testfile, 'w'), """\
f1af9c089634b84c1dbbdabed35cd2d43cf6ff04 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f1af9c089634b84c1dbbdabed35cd2d43cf6ff04/test_traceback.py
os.utime(testfile, (0, 0))
past = time.time() - 3 os.utime(testfile, (past, past))
def test(): raise ValueError""" if hasattr(os, 'utime'): os.utime(testfile, (0, 0)) else: import time time.sleep(3) # not to stay in same mtime. if 'test_bug737473' in sys.modules: del sys.modules['test_bug737473'] import test_bug737473 try: test_bug737473.test() except ValueError: # this loads source code to lineca...
f1af9c089634b84c1dbbdabed35cd2d43cf6ff04 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f1af9c089634b84c1dbbdabed35cd2d43cf6ff04/test_traceback.py
"""translate(s,table [,deletechars]) -> string
"""translate(s,table [,deletions]) -> string
def translate(s, table, deletions=""): """translate(s,table [,deletechars]) -> string Return a copy of the string s, where all characters occurring in the optional argument deletechars are removed, and the remaining characters have been mapped through the given translation table, which must be a string of length 256. ...
5aff7752eb28c6ddaa68738ee77e1947b72e1a58 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5aff7752eb28c6ddaa68738ee77e1947b72e1a58/string.py
in the optional argument deletechars are removed, and the
in the optional argument deletions are removed, and the
def translate(s, table, deletions=""): """translate(s,table [,deletechars]) -> string Return a copy of the string s, where all characters occurring in the optional argument deletechars are removed, and the remaining characters have been mapped through the given translation table, which must be a string of length 256. ...
5aff7752eb28c6ddaa68738ee77e1947b72e1a58 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5aff7752eb28c6ddaa68738ee77e1947b72e1a58/string.py
translation table, which must be a string of length 256. """ return s.translate(table, deletions)
translation table, which must be a string of length 256. The deletions argument is not allowed for Unicode strings. """ if deletions: return s.translate(table, deletions) else: return s.translate(table + s[:0])
def translate(s, table, deletions=""): """translate(s,table [,deletechars]) -> string Return a copy of the string s, where all characters occurring in the optional argument deletechars are removed, and the remaining characters have been mapped through the given translation table, which must be a string of length 256. ...
5aff7752eb28c6ddaa68738ee77e1947b72e1a58 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5aff7752eb28c6ddaa68738ee77e1947b72e1a58/string.py
n_lines += 1
def write_results_file(self, path, lines, lnotab, lines_hit): """Return a coverage results file in path."""
546e34b654b03333cee0ba968c9f856a9b0b28d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/546e34b654b03333cee0ba968c9f856a9b0b28d1/trace.py
def search_function(encoding): # Cache lookup entry = _cache.get(encoding,_unknown) if entry is not _unknown: return entry # Import the module modname = encoding.replace('-', '_') modname = aliases.aliases.get(modname,modname) try: mod = __import__(modname,globals(),locals(),'*') except ImportError,why: _cache[encodi...
988ad2bdff836665f004c285fb09182c35775fd6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/988ad2bdff836665f004c285fb09182c35775fd6/__init__.py