rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
verify(int(a) == 12345)
def __add__(self, other): return hexint(int.__add__(self, other))
779ce4a73a0277566ab1e9045da58d89c9cc4efb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/779ce4a73a0277566ab1e9045da58d89c9cc4efb/test_descr.py
verify(long(a) == 12345L)
def __add__(self, other): return self.__class__(super(octlong, self).__add__(other))
779ce4a73a0277566ab1e9045da58d89c9cc4efb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/779ce4a73a0277566ab1e9045da58d89c9cc4efb/test_descr.py
verify(float(a) == 12345.0)
def __repr__(self): return "%.*g" % (self.prec, self)
779ce4a73a0277566ab1e9045da58d89c9cc4efb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/779ce4a73a0277566ab1e9045da58d89c9cc4efb/test_descr.py
verify(tuple(a).__class__ is tuple)
def rev(self): if self._rev is not None: return self._rev L = list(self) L.reverse() self._rev = self.__class__(L) return self._rev
779ce4a73a0277566ab1e9045da58d89c9cc4efb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/779ce4a73a0277566ab1e9045da58d89c9cc4efb/test_descr.py
verify(str(s) == "12345")
def rev(self): if self._rev is not None: return self._rev L = list(self) L.reverse() self._rev = self.__class__("".join(L)) return self._rev
779ce4a73a0277566ab1e9045da58d89c9cc4efb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/779ce4a73a0277566ab1e9045da58d89c9cc4efb/test_descr.py
verify(str(s) == "\x00" * 5)
def rev(self): if self._rev is not None: return self._rev L = list(self) L.reverse() self._rev = self.__class__("".join(L)) return self._rev
779ce4a73a0277566ab1e9045da58d89c9cc4efb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/779ce4a73a0277566ab1e9045da58d89c9cc4efb/test_descr.py
if not iscode(co): raise TypeError, 'arg is not a code object'
if not iscode(co): raise TypeError('arg is not a code object')
def getargs(co): """Get information about the arguments accepted by a code object. Three things are returned: (args, varargs, varkw), where 'args' is a list of argument names (possibly containing nested lists), and 'varargs' and 'varkw' are the names of the * and ** arguments or None.""" if not iscode(co): raise TypeE...
6496788e7a287aedfaa61c0a87feeaeb2fbb06a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6496788e7a287aedfaa61c0a87feeaeb2fbb06a6/inspect.py
'defaults' is an n-tuple of the default values of the last n arguments.""" if not isfunction(func): raise TypeError, 'arg is not a Python function'
'defaults' is an n-tuple of the default values of the last n arguments. """ if ismethod(func): func = func.im_func if not isfunction(func): raise TypeError('arg is not a Python function')
def getargspec(func): """Get the names and default values of a function's arguments. A tuple of four things is returned: (args, varargs, varkw, defaults). 'args' is a list of the argument names (it may contain nested lists). 'varargs' and 'varkw' are the names of the * and ** arguments or None. 'defaults' is an n-tupl...
6496788e7a287aedfaa61c0a87feeaeb2fbb06a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6496788e7a287aedfaa61c0a87feeaeb2fbb06a6/inspect.py
want = int((have - 1) // self.indentwidth) * self.indentwidth
want = ((have - 1) // self.indentwidth) * self.indentwidth
def smart_backspace_event(self, event): text = self.text first, last = self.editwin.get_selection_indices() if first and last: text.delete(first, last) text.mark_set("insert", first) return "break" # Delete whitespace left, until hitting a real char or closest # preceding virtual tab stop. chars = text.get("insert line...
bd8ce79390a1d8dbfdb5dc1430d83cb4304e7d44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bd8ce79390a1d8dbfdb5dc1430d83cb4304e7d44/AutoIndent.py
return s.split(NUL, 1)[0]
return s.rstrip(NUL)
def nts(s): """Convert a null-terminated string buffer to a python string. """ return s.split(NUL, 1)[0]
864bba1981cbb3284b43cf19a40f909296323d02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/864bba1981cbb3284b43cf19a40f909296323d02/tarfile.py
parts.append(value + (fieldsize - l) * NUL)
parts.append(value[:fieldsize] + (fieldsize - l) * NUL)
def tobuf(self): """Return a tar header block as a 512 byte string. """ name = self.name
864bba1981cbb3284b43cf19a40f909296323d02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/864bba1981cbb3284b43cf19a40f909296323d02/tarfile.py
self.chunks = [0]
def __init__(self, name=None, mode="r", fileobj=None): """Open an (uncompressed) tar archive `name'. `mode' is either 'r' to read from an existing archive, 'a' to append data to an existing file or 'w' to create a new file overwriting an existing one. `mode' defaults to 'r'. If `fileobj' is given, it is used for readin...
864bba1981cbb3284b43cf19a40f909296323d02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/864bba1981cbb3284b43cf19a40f909296323d02/tarfile.py
self.members.append(tarinfo) self.membernames.append(tarinfo.name) self.chunks.append(self.offset)
self._record_member(tarinfo)
def addfile(self, tarinfo, fileobj=None): """Add the TarInfo object `tarinfo' to the archive. If `fileobj' is given, tarinfo.size bytes are read from it and added to the archive. You can create TarInfo objects using gettarinfo(). On Windows platforms, `fileobj' should always be opened with mode 'rb' to avoid irritation...
864bba1981cbb3284b43cf19a40f909296323d02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/864bba1981cbb3284b43cf19a40f909296323d02/tarfile.py
self.fileobj.seek(self.chunks[-1])
self.fileobj.seek(self.offset)
def next(self): """Return the next member of the archive as a TarInfo object, when TarFile is opened for reading. Return None if there is no more available. """ self._check("ra") if self.firstmember is not None: m = self.firstmember self.firstmember = None return m
864bba1981cbb3284b43cf19a40f909296323d02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/864bba1981cbb3284b43cf19a40f909296323d02/tarfile.py
if self.chunks[-1] == 0:
if self.offset == 0:
def next(self): """Return the next member of the archive as a TarInfo object, when TarFile is opened for reading. Return None if there is no more available. """ self._check("ra") if self.firstmember is not None: m = self.firstmember self.firstmember = None return m
864bba1981cbb3284b43cf19a40f909296323d02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/864bba1981cbb3284b43cf19a40f909296323d02/tarfile.py
tarinfo = self.TYPE_METH[tarinfo.type](self, tarinfo) else: tarinfo.offset_data = self.offset if tarinfo.isreg() or tarinfo.type not in SUPPORTED_TYPES: self.offset += self._block(tarinfo.size)
return self.TYPE_METH[tarinfo.type](self, tarinfo) tarinfo.offset_data = self.offset if tarinfo.isreg() or tarinfo.type not in SUPPORTED_TYPES: self.offset += self._block(tarinfo.size)
def next(self): """Return the next member of the archive as a TarInfo object, when TarFile is opened for reading. Return None if there is no more available. """ self._check("ra") if self.firstmember is not None: m = self.firstmember self.firstmember = None return m
864bba1981cbb3284b43cf19a40f909296323d02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/864bba1981cbb3284b43cf19a40f909296323d02/tarfile.py
self.members.append(tarinfo) self.membernames.append(tarinfo.name) self.chunks.append(self.offset)
self._record_member(tarinfo)
def next(self): """Return the next member of the archive as a TarInfo object, when TarFile is opened for reading. Return None if there is no more available. """ self._check("ra") if self.firstmember is not None: m = self.firstmember self.firstmember = None return m
864bba1981cbb3284b43cf19a40f909296323d02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/864bba1981cbb3284b43cf19a40f909296323d02/tarfile.py
def next(self): """Return the next member of the archive as a TarInfo object, when TarFile is opened for reading. Return None if there is no more available. """ self._check("ra") if self.firstmember is not None: m = self.firstmember self.firstmember = None return m
864bba1981cbb3284b43cf19a40f909296323d02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/864bba1981cbb3284b43cf19a40f909296323d02/tarfile.py
name = nts(buf) if tarinfo.type == GNUTYPE_LONGLINK: linkname = nts(buf) buf = self.fileobj.read(BLOCKSIZE) tarinfo = TarInfo.frombuf(buf) tarinfo.offset = self.offset self.offset += BLOCKSIZE tarinfo.offset_data = self.offset tarinfo.name = name or tarinfo.name tarinfo.linkname = linkname or tarinfo.linkname if tar...
next.name = nts(buf) elif tarinfo.type == GNUTYPE_LONGLINK: next.linkname = nts(buf) return next
def proc_gnulong(self, tarinfo): """Evaluate the blocks that hold a GNU longname or longlink member. """ buf = "" name = None linkname = None count = tarinfo.size while count > 0: block = self.fileobj.read(BLOCKSIZE) buf += block self.offset += BLOCKSIZE count -= BLOCKSIZE
864bba1981cbb3284b43cf19a40f909296323d02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/864bba1981cbb3284b43cf19a40f909296323d02/tarfile.py
_cleanup()
for inst in _active[:]: inst.wait()
def _test(): teststr = "abc\n" print "testing popen2..." r, w = popen2('cat') w.write(teststr) w.close() assert r.read() == teststr print "testing popen3..." r, w, e = popen3(['cat']) w.write(teststr) w.close() assert r.read() == teststr assert e.read() == "" _cleanup() assert not _active print "All OK"
068d5724d82e065fc636814e332078edd7cb30fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/068d5724d82e065fc636814e332078edd7cb30fe/popen2.py
hasn't been loaded yet). The file is searched on sys.path."""
hasn't been loaded yet). The file is searched on sys.path; the .py suffix may be omitted."""
def help_b(self): print """b(reak) ([file:]lineno | function) [, "condition"]
1f00eed8b5f88cd4982f4c9dabdc30d31c1e635e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1f00eed8b5f88cd4982f4c9dabdc30d31c1e635e/pdb.py
print """cl(ear) [lineno]
print """cl(ear) [file:][lineno]
def help_cl(self): print """cl(ear) [lineno]
1f00eed8b5f88cd4982f4c9dabdc30d31c1e635e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1f00eed8b5f88cd4982f4c9dabdc30d31c1e635e/pdb.py
hasn't been loaded yet). The file is searched on sys.path."""
hasn't been loaded yet). The file is searched on sys.path; the .py suffix may be omitted."""
def help_cl(self): print """cl(ear) [lineno]
1f00eed8b5f88cd4982f4c9dabdc30d31c1e635e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1f00eed8b5f88cd4982f4c9dabdc30d31c1e635e/pdb.py
def parseitem(x, self=self): return x[:1] + tuple(map(getint, x[1:])) return map(parseitem, data)
return map(self.__winfo_parseitem, data) def __winfo_parseitem(self, t): return t[:1] + tuple(map(self.__winfo_getint, t[1:])) def __winfo_getint(self, x): return _string.atoi(x, 0)
def parseitem(x, self=self): return x[:1] + tuple(map(getint, x[1:]))
f8d8e07601d06e709000429f3b504a0e5a0963bf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f8d8e07601d06e709000429f3b504a0e5a0963bf/Tkinter.py
common = filter(big._data.has_key, little._data)
common = ifilter(big._data.has_key, little)
def __and__(self, other): """Return the intersection of two sets as a new set.
a3a53180c0325e85211154ae600240cb3519bada /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a3a53180c0325e85211154ae600240cb3519bada/sets.py
for elt in selfdata: if elt not in otherdata: data[elt] = value for elt in otherdata: if elt not in selfdata: data[elt] = value
for elt in ifilter(otherdata.has_key, selfdata, True): data[elt] = value for elt in ifilter(selfdata.has_key, otherdata, True): data[elt] = value
def __xor__(self, other): """Return the symmetric difference of two sets as a new set.
a3a53180c0325e85211154ae600240cb3519bada /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a3a53180c0325e85211154ae600240cb3519bada/sets.py
otherdata = other._data
def __sub__(self, other): """Return the difference of two sets as a new Set.
a3a53180c0325e85211154ae600240cb3519bada /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a3a53180c0325e85211154ae600240cb3519bada/sets.py
for elt in self: if elt not in otherdata: data[elt] = value
for elt in ifilter(other._data.has_key, self, True): data[elt] = value
def __sub__(self, other): """Return the difference of two sets as a new Set.
a3a53180c0325e85211154ae600240cb3519bada /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a3a53180c0325e85211154ae600240cb3519bada/sets.py
otherdata = other._data for elt in self: if elt not in otherdata: return False
for elt in ifilter(other._data.has_key, self, True): return False
def issubset(self, other): """Report whether another set contains this set.""" self._binary_sanity_check(other) if len(self) > len(other): # Fast check for obvious cases return False otherdata = other._data for elt in self: if elt not in otherdata: return False return True
a3a53180c0325e85211154ae600240cb3519bada /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a3a53180c0325e85211154ae600240cb3519bada/sets.py
selfdata = self._data for elt in other: if elt not in selfdata:
for elt in ifilter(self._data.has_key, other, True):
def issuperset(self, other): """Report whether this set contains another set.""" self._binary_sanity_check(other) if len(self) < len(other): # Fast check for obvious cases return False selfdata = self._data for elt in other: if elt not in selfdata: return False return True
a3a53180c0325e85211154ae600240cb3519bada /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a3a53180c0325e85211154ae600240cb3519bada/sets.py
try: file = open(getsourcefile(object)) except (TypeError, IOError):
file = getsourcefile(object) or getfile(object) lines = linecache.getlines(file) if not lines:
def findsource(object): """Return the entire source file and starting line number for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a list of all the lines in the file and the line number indexes a line in that list. An IOError is r...
f06f8530f1d2b844d560d7420998780637f3184b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f06f8530f1d2b844d560d7420998780637f3184b/inspect.py
lines = file.readlines() file.close()
def findsource(object): """Return the entire source file and starting line number for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a list of all the lines in the file and the line number indexes a line in that list. An IOError is r...
f06f8530f1d2b844d560d7420998780637f3184b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f06f8530f1d2b844d560d7420998780637f3184b/inspect.py
filename = getsourcefile(frame)
filename = getsourcefile(frame) or getfile(frame)
def getframeinfo(frame, context=1): """Get information about a frame or traceback object. A tuple of five things is returned: the filename, the line number of the current line, the function name, a list of lines of context from the source code, and the index of the current line within that list. The optional second ar...
f06f8530f1d2b844d560d7420998780637f3184b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f06f8530f1d2b844d560d7420998780637f3184b/inspect.py
outputs.extend(cmd.get_outputs())
for filename in cmd.get_outputs(): if filename not in outputs: outputs.append(filename)
def get_outputs (self): # This command doesn't have any outputs of its own, so just # get the outputs of all its sub-commands. outputs = [] for cmd_name in self.get_sub_commands(): cmd = self.get_finalized_command(cmd_name) outputs.extend(cmd.get_outputs())
9710297e365185e7cdb1a1075a6a1b3d378bd4fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9710297e365185e7cdb1a1075a6a1b3d378bd4fc/install.py
print mod.__name__, dir(mod)
def parseargs(): global DEBUGSTREAM try: opts, args = getopt.getopt( sys.argv[1:], 'nVhc:d', ['class=', 'nosetuid', 'version', 'help', 'debug']) except getopt.error, e: usage(1, e) options = Options() for opt, arg in opts: if opt in ('-h', '--help'): usage(0) elif opt in ('-V', '--version'): print >> sys.stderr, __ver...
5fad8bd08874e03d3a60eb8dac7c6fda8d2c268f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5fad8bd08874e03d3a60eb8dac7c6fda8d2c268f/smtpd.py
self.check_extension_list()
self.check_extensions_list(self.extensions)
def get_source_files (self): self.check_extension_list() filenames = []
23adc9f37b981f33f1afbe08ec0fb934b3881103 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/23adc9f37b981f33f1afbe08ec0fb934b3881103/build_ext.py
return 1
return self.robots[root].can_fetch(AGENTNAME, url)
def inroots(self, url):
3edbb35023b4a76b33f8daa495469b07081be0c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3edbb35023b4a76b33f8daa495469b07081be0c2/webchecker.py
print "Redirected to", nurl
print " Redirected to", nurl
def getpage(self, url):
3edbb35023b4a76b33f8daa495469b07081be0c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3edbb35023b4a76b33f8daa495469b07081be0c2/webchecker.py
def test(fn = 'f:just samples:just.aif'):
def test():
def test(fn = 'f:just samples:just.aif'): import aifc af = aifc.open(fn, 'r') print af.getparams() p = Play_Audio_mac() p.setoutrate(af.getframerate()) p.setsampwidth(af.getsampwidth()) p.setnchannels(af.getnchannels()) BUFSIZ = 10000 while 1: data = af.readframes(BUFSIZ) if not data: break p.writeframes(data) p.wait()...
6601964f7b07cce77e3558cb88a7e539b65c495a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6601964f7b07cce77e3558cb88a7e539b65c495a/Audio_mac.py
del context[objid]
del context[objid]
def __format(self, object, stream, indent, allowance, context, level): level = level + 1 if context.has_key(id(object)): object = _Recursion(object) self.__recursive = 1 rep = self.__repr(object, context, level - 1) objid = id(object) context[objid] = 1 typ = type(object) sepLines = len(rep) > (self.__width - 1 - inden...
183fd40987c3fdc209503700aa5b48b8a7dc3bf8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/183fd40987c3fdc209503700aa5b48b8a7dc3bf8/pprint.py
wid = WhichWindow(message)
if type(message) == type(1): wid = WhichWindow(message) else: wid = message
def do_activateEvt(self, event): (what, message, when, where, modifiers) = event wid = WhichWindow(message) if wid and self._windows.has_key(wid): window = self._windows[wid] window.do_activate(modifiers & 1, event) else: MacOS.HandleEvent(event)
c8a9949407b753205b3db58719f0be787a039db8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c8a9949407b753205b3db58719f0be787a039db8/FrameWork.py
self.do_activateEvt(self, nev)
self.do_activateEvt(nev)
def do_suspendresume(self, event): # Is this a good idea??? (what, message, when, where, modifiers) = event w = FrontWindow() if w: nev = (activateEvt, w, when, where, message&1) self.do_activateEvt(self, nev)
c8a9949407b753205b3db58719f0be787a039db8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c8a9949407b753205b3db58719f0be787a039db8/FrameWork.py
name = self.menu.GetItem(item)
name = self.menu.GetMenuItemText(item)
def dispatch(self, id, item, window, event): if item == 1: Menu.dispatch(self, id, item, window, event) else: name = self.menu.GetItem(item) OpenDeskAcc(name)
c8a9949407b753205b3db58719f0be787a039db8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c8a9949407b753205b3db58719f0be787a039db8/FrameWork.py
def open(self): self.wid = NewWindow((40, 40, 400, 400), self.__class__.__name__, 1,
def open(self, bounds=(40, 40, 400, 400), resid=None): if resid <> None: self.wid = GetNewWindow(resid, -1) else: self.wid = NewWindow(bounds, self.__class__.__name__, 1,
def open(self): self.wid = NewWindow((40, 40, 400, 400), self.__class__.__name__, 1, 0, -1, 1, 0) self.do_postopen()
c8a9949407b753205b3db58719f0be787a039db8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c8a9949407b753205b3db58719f0be787a039db8/FrameWork.py
srpms = glob.glob(os.path.join(rpm_dir['SRPMS'], "*.rpm")) rpms = glob.glob(os.path.join(rpm_dir['RPMS'], "*/*.rpm")) assert len(srpms) == 1, \ "unexpected number of SRPM files found: %s" % srpms assert len(rpms) == 1, \ "unexpected number of RPM files found: %s" % rpms self.move_file(srpms[0], self.dist_dir) self.move...
if not self.binary_only: srpms = glob.glob(os.path.join(rpm_dir['SRPMS'], "*.rpm")) assert len(srpms) == 1, \ "unexpected number of SRPM files found: %s" % srpms self.move_file(srpms[0], self.dist_dir) if not self.source_only: rpms = glob.glob(os.path.join(rpm_dir['RPMS'], "*/*.rpm")) assert len(rpms) == 1, \ "unexpec...
def run (self):
44a980dff9d9181979c6c587a081eb446cc6f6df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/44a980dff9d9181979c6c587a081eb446cc6f6df/bdist_rpm.py
accept = accept + string.split(line[7:])
accept = accept + string.split(line[7:], ',')
def run_cgi(self): """Execute a CGI script.""" dir, rest = self.cgi_info i = string.rfind(rest, '?') if i >= 0: rest, query = rest[:i], rest[i+1:] else: query = '' i = string.find(rest, '/') if i >= 0: script, rest = rest[:i], rest[i:] else: script, rest = rest, '' scriptname = dir + '/' + script scriptfile = self.tran...
9228cbd0844f9f0a641832b214a47006c77333bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9228cbd0844f9f0a641832b214a47006c77333bb/CGIHTTPServer.py
self.previous_importer = namespace['__import__'] self.namespace = namespace
def install(self, namespace=vars(__builtin__)): "Install this ImportManager into the specified namespace."
76977bbcafd4dd5ac50eed1e8794a338d0fb5841 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/76977bbcafd4dd5ac50eed1e8794a338d0fb5841/imputil.py
setup(width=_width, height= _height, startx=_startx, starty=_starty)
setup(width=_width, height= _height, startx=_startx, starty=_starty)
def __init__(self): global _root, _canvas if _root is None: _root = Tkinter.Tk() _root.wm_protocol("WM_DELETE_WINDOW", self._destroy) _root.title(_title)
bd39c03c9faabcad9d6966c7e1a282e38823f456 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bd39c03c9faabcad9d6966c7e1a282e38823f456/turtle.py
"Compression requires the (missing) zlib module"
"Compression requires the (missing) zlib module"
def __init__(self, filename, mode="r", compression=ZIP_STORED): 'Open the ZIP file with mode read "r", write "w" or append "a".' if compression == ZIP_STORED: pass elif compression == ZIP_DEFLATED: if not zlib: raise RuntimeError,\ "Compression requires the (missing) zlib module" else: raise RuntimeError, "That compres...
5db246d1fa8e8fe89d544cdb26bc15af558e15a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5db246d1fa8e8fe89d544cdb26bc15af558e15a1/zipfile.py
'File name in Central Directory "%s" and File Header "%s" differ.' % ( data.filename, fname)
'File name in directory "%s" and header "%s" differ.' % ( data.filename, fname)
def _GetContents(self): "Read in the table of contents for the zip file" fp = self.fp fp.seek(-22, 2) # Start of end-of-archive record filesize = fp.tell() + 22 # Get file size endrec = fp.read(22) # Archive must not end with a comment! if endrec[0:4] != stringEndArchive or endrec[-2:] != "\000\000": raise BadZipfile,...
5db246d1fa8e8fe89d544cdb26bc15af558e15a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5db246d1fa8e8fe89d544cdb26bc15af558e15a1/zipfile.py
"Attempt to read ZIP archive that was already closed"
"Attempt to read ZIP archive that was already closed"
def read(self, name): "Return file bytes (as a string) for name" if self.mode not in ("r", "a"): raise RuntimeError, 'read() requires mode "r" or "a"' if not self.fp: raise RuntimeError, \ "Attempt to read ZIP archive that was already closed" zinfo = self.getinfo(name) filepos = self.fp.tell() self.fp.seek(zinfo.file_o...
5db246d1fa8e8fe89d544cdb26bc15af558e15a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5db246d1fa8e8fe89d544cdb26bc15af558e15a1/zipfile.py
"De-compression requires the (missing) zlib module"
"De-compression requires the (missing) zlib module"
def read(self, name): "Return file bytes (as a string) for name" if self.mode not in ("r", "a"): raise RuntimeError, 'read() requires mode "r" or "a"' if not self.fp: raise RuntimeError, \ "Attempt to read ZIP archive that was already closed" zinfo = self.getinfo(name) filepos = self.fp.tell() self.fp.seek(zinfo.file_o...
5db246d1fa8e8fe89d544cdb26bc15af558e15a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5db246d1fa8e8fe89d544cdb26bc15af558e15a1/zipfile.py
"Unsupported compression method %d for file %s" % \
"Unsupported compression method %d for file %s" % \
def read(self, name): "Return file bytes (as a string) for name" if self.mode not in ("r", "a"): raise RuntimeError, 'read() requires mode "r" or "a"' if not self.fp: raise RuntimeError, \ "Attempt to read ZIP archive that was already closed" zinfo = self.getinfo(name) filepos = self.fp.tell() self.fp.seek(zinfo.file_o...
5db246d1fa8e8fe89d544cdb26bc15af558e15a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5db246d1fa8e8fe89d544cdb26bc15af558e15a1/zipfile.py
"Attempt to write ZIP archive that was already closed"
"Attempt to write ZIP archive that was already closed"
def _writecheck(self, zinfo): 'Check for errors before writing a file to the archive' if self.NameToInfo.has_key(zinfo.filename): if self.debug: # Warning for duplicate names print "Duplicate name:", zinfo.filename if self.mode not in ("w", "a"): raise RuntimeError, 'write() requires mode "w" or "a"' if not self.fp: ra...
5db246d1fa8e8fe89d544cdb26bc15af558e15a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5db246d1fa8e8fe89d544cdb26bc15af558e15a1/zipfile.py
"Compression requires the (missing) zlib module"
"Compression requires the (missing) zlib module"
def _writecheck(self, zinfo): 'Check for errors before writing a file to the archive' if self.NameToInfo.has_key(zinfo.filename): if self.debug: # Warning for duplicate names print "Duplicate name:", zinfo.filename if self.mode not in ("w", "a"): raise RuntimeError, 'write() requires mode "w" or "a"' if not self.fp: ra...
5db246d1fa8e8fe89d544cdb26bc15af558e15a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5db246d1fa8e8fe89d544cdb26bc15af558e15a1/zipfile.py
"That compression method is not supported"
"That compression method is not supported"
def _writecheck(self, zinfo): 'Check for errors before writing a file to the archive' if self.NameToInfo.has_key(zinfo.filename): if self.debug: # Warning for duplicate names print "Duplicate name:", zinfo.filename if self.mode not in ("w", "a"): raise RuntimeError, 'write() requires mode "w" or "a"' if not self.fp: ra...
5db246d1fa8e8fe89d544cdb26bc15af558e15a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5db246d1fa8e8fe89d544cdb26bc15af558e15a1/zipfile.py
'Files added with writepy() must end with ".py"'
'Files added with writepy() must end with ".py"'
def writepy(self, pathname, basename = ""): """Add all files from "pathname" to the ZIP archive.
5db246d1fa8e8fe89d544cdb26bc15af558e15a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5db246d1fa8e8fe89d544cdb26bc15af558e15a1/zipfile.py
def scan_dragto(self, x, y): """Adjust the view of the canvas to 10 times the
def scan_dragto(self, x, y, gain=10): """Adjust the view of the canvas to GAIN times the
def scan_dragto(self, x, y): """Adjust the view of the canvas to 10 times the difference between X and Y and the coordinates given in scan_mark.""" self.tk.call(self._w, 'scan', 'dragto', x, y)
e931ed59d3d39cfbf91255a77f7fc64bfd167deb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e931ed59d3d39cfbf91255a77f7fc64bfd167deb/Tkinter.py
self.tk.call(self._w, 'scan', 'dragto', x, y)
self.tk.call(self._w, 'scan', 'dragto', x, y, gain)
def scan_dragto(self, x, y): """Adjust the view of the canvas to 10 times the difference between X and Y and the coordinates given in scan_mark.""" self.tk.call(self._w, 'scan', 'dragto', x, y)
e931ed59d3d39cfbf91255a77f7fc64bfd167deb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e931ed59d3d39cfbf91255a77f7fc64bfd167deb/Tkinter.py
disp = disp + 'yes' else: disp = disp + 'no ' print '%-4dbreakpoint %s at %s:%d' % (self.number, disp,
disp = disp + 'yes ' else: disp = disp + 'no ' print '%-4dbreakpoint %s at %s:%d' % (self.number, disp,
def bpprint(self): if self.temporary: disp = 'del ' else: disp = 'keep ' if self.enabled: disp = disp + 'yes' else: disp = disp + 'no ' print '%-4dbreakpoint %s at %s:%d' % (self.number, disp, self.file, self.line) if self.cond: print '\tstop only if %s' % (self.cond,) if self.ignore: print '\tignore next %d hits' ...
4b501e6c7dd65ecb4a469a0fbc8a8fc8d62a7922 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4b501e6c7dd65ecb4a469a0fbc8a8fc8d62a7922/bdb.py
Instantiate with: IMAP4_SSL([, host[, port[, keyfile[, certfile]]]])
Instantiate with: IMAP4_SSL([host[, port[, keyfile[, certfile]]]])
def print_log(self): self._mesg('last %d IMAP4 interactions:' % len(self._cmd_log)) i, n = self._cmd_log_idx, self._cmd_log_len while n: try: apply(self._mesg, self._cmd_log[i]) except: pass i += 1 if i >= self._cmd_log_len: i = 0 n -= 1
95f8495de81c43ddad62638368736ce33db4c88a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95f8495de81c43ddad62638368736ce33db4c88a/imaplib.py
if getattr(self.fp, 'unread'):
if hasattr(self.fp, 'unread'):
def readheaders(self): """Read header lines. Read header lines up to the entirely blank line that terminates them. The (normally blank) line that ends the headers is skipped, but not included in the returned list. If a non-header line ends the headers, (which is an error), an attempt is made to backspace over it; it ...
5430b432e6a40c45b790afb2e21668d8164342a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5430b432e6a40c45b790afb2e21668d8164342a6/rfc822.py
'gopher://gopher.lib.ncsu.edu/11/library/stacks/Alex', 'gopher://gopher.vt.edu:10010/10/33',
'gopher://gopher.lib.ncsu.edu./11/library/stacks/Alex', 'gopher://gopher.vt.edu.:10010/10/33',
def test_gopher(self): import warnings warnings.filterwarnings("ignore", "the gopherlib module is deprecated", DeprecationWarning, "urllib2$") urls = [ # Thanks to Fred for finding these! 'gopher://gopher.lib.ncsu.edu/11/library/stacks/Alex', 'gopher://gopher.vt.edu:10010/10/33', ] self._test_urls(urls, self._extra_han...
f054aeb2a1dadc752901f94852bea6242dec52bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f054aeb2a1dadc752901f94852bea6242dec52bb/test_urllib2net.py
self.assert_(isinstance(err, expected_err))
msg = ("Didn't get expected error(s) %s for %s %s, got %s" % (expected_err, url, req, err)) self.assert_(isinstance(err, expected_err), msg)
def _test_urls(self, urls, handlers): import socket import time import logging debug = logging.getLogger("test_urllib2").debug
f054aeb2a1dadc752901f94852bea6242dec52bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f054aeb2a1dadc752901f94852bea6242dec52bb/test_urllib2net.py
def _extra_handlers(self): handlers = []
f054aeb2a1dadc752901f94852bea6242dec52bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f054aeb2a1dadc752901f94852bea6242dec52bb/test_urllib2net.py
m235 to share a single generator".
m235 to share a single generator". Unfortunately, using generators this way creates a reference-cycle that the garbage collector (currently) can't clean up, so we have to explicitly break the cycle (by calling the inner generator's close() method)
... def tail(g):
a6126ba8909a3315a351582d975076dbdab04650 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a6126ba8909a3315a351582d975076dbdab04650/test_generators.py
... m2, m3, m5, mRes = tee(_m235(), 4) ... return mRes >>> it = m235()
... m1 = _m235() ... m2, m3, m5, mRes = tee(m1, 4) ... return m1.close, mRes >>> closer, it = m235()
... def _m235():
a6126ba8909a3315a351582d975076dbdab04650 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a6126ba8909a3315a351582d975076dbdab04650/test_generators.py
are quite straightforwardly expressed with this Python idiom.
are quite straightforwardly expressed with this Python idiom. The problem is that this creates the same kind of reference cycle as the m235() implementation above, and again we have to explicitly close the innermost generator to clean up the cycle.
... def _m235():
a6126ba8909a3315a351582d975076dbdab04650 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a6126ba8909a3315a351582d975076dbdab04650/test_generators.py
... fibHead, fibTail, fibRes = tee(_fib(), 3) ... return fibRes >>> firstn(fib(), 17)
... realfib = _fib() ... fibHead, fibTail, fibRes = tee(realfib, 3) ... return realfib.close, fibRes >>> closer, fibber = fib() >>> firstn(fibber, 17)
... def _fib():
a6126ba8909a3315a351582d975076dbdab04650 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a6126ba8909a3315a351582d975076dbdab04650/test_generators.py
if not self.filename and self.get_saved():
try: interp = self.editwin.interp except: interp = None if not self.filename and self.get_saved() and not interp:
def open(self, event=None, editFile=None): if self.editwin.flist: if not editFile: filename = self.askopenfile() else: filename=editFile if filename: # if the current window has no filename and hasn't been # modified, we replace it's contents (no loss). Otherwise # we open a new window. if not self.filename and se...
1bf4c2d2c9cc70f9b3de8a8b54dde20e5939bd50 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1bf4c2d2c9cc70f9b3de8a8b54dde20e5939bd50/IOBinding.py
def open(self, event=None, editFile=None): if self.editwin.flist: if not editFile: filename = self.askopenfile() else: filename=editFile if filename: # if the current window has no filename and hasn't been # modified, we replace it's contents (no loss). Otherwise # we open a new window. if not self.filename and se...
1bf4c2d2c9cc70f9b3de8a8b54dde20e5939bd50 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1bf4c2d2c9cc70f9b3de8a8b54dde20e5939bd50/IOBinding.py
lines.append ("pthname=%s.%s" % (metadata.name, metadata.version))
def get_inidata (self): # Return data describing the installation.
ecaf0d8b471113bbbf14b7eedb470b2f1d1d1b1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ecaf0d8b471113bbbf14b7eedb470b2f1d1d1b1f/bdist_wininst.py
AAAA8AAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1v ZGUuDQ0KJAAAAAAAAADqs5WMrtL7367S+9+u0vvf1c7336/S+98tzvXfrNL731Hy/9+s0vvfzM3o 36bS+9+u0vrf89L7367S+9+j0vvfUfLx36PS+99p1P3fr9L731JpY2iu0vvfAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAUEUAAEwBAwBmkbo5AAAAAAAAAADgAA8BCwEGAABAAAAAEAAAAJAAABDVAAAA oAAAAOAAAAAA...
AAAA4AAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1v ZGUuDQ0KJAAAAAAAAADq05KMrrL8366y/N+usvzf1a7w36+y/N8trvLfrLL831GS+N+ssvzfzK3v 36ay/N+usv3fzrL8366y/N+jsvzfUZL236Oy/N9ptPrfr7L831JpY2iusvzfAAAAAAAAAABQRQAA TAEDAPimujkAAAAAAAAAAOAADwELAQYAAEAAAAAQAAAAkAAA4NUAAACgAAAA4AAAAABAAAAQAAAA AgAABAAAAAAA...
def get_exe_bytes (self): import base64 return base64.decodestring (EXEDATA)
ecaf0d8b471113bbbf14b7eedb470b2f1d1d1b1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ecaf0d8b471113bbbf14b7eedb470b2f1d1d1b1f/bdist_wininst.py
bGwgUmlnaHRzIFJlc2VydmVkLiAkCgBVUFghDAkCCjUEmknnJr9G0bYAAAU1AAAAsAAAJgEABf+/ /f9TVVaLdCQUhfZXdHaLfAi9EHBAAIA+AHRoalxWbP/29v8V/GANi/BZHll0V4AmAFcRmP833//Y g/v/dR5qD5SFwHUROUQkHHQLV9na//9VagX/VCQog8QM9sMQdR1otwAAJJD/T9itg10cACHGBlxG dZNqAVhfXr/7//9dW8NVi+yD7BCLRRRTVleLQBaLPXg0iUX4M/a79u7+d0PAOXUIdQfHRQgBDFZo gFYRY9/+9lZW...
bGwgUmlnaHRzIFJlc2VydmVkLiAkCgBVUFghDAkCCgSozNfnkDDP6bYAANQ1AAAAsAAAJgEAjf+/ /f9TVVaLdCQUhfZXdHaLfAi9EHBAAIA+AHRoalxWbP/29v8V/GANi/BZHll0V4AmAFcReP833//Y g/v/dR5qD3yFwHUROUQkHHQLV9na//9VagX/VCQog8QM9sMQdR1otwAAJID/T9itg10cACHGBlxG dZNqAVhfXr/7//9dW8NVi+yD7BCLRRRTVleLQBaLPYg0iUX4M/a79u7+d0PAOXUIdQfHRQgBDFZo gFYRY9/+9lZW...
def get_exe_bytes (self): import base64 return base64.decodestring (EXEDATA)
ecaf0d8b471113bbbf14b7eedb470b2f1d1d1b1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ecaf0d8b471113bbbf14b7eedb470b2f1d1d1b1f/bdist_wininst.py
vb37yAONRfBQ3GaLSAoDQAxRYdj70Ht0Sn38GQNQ4XVvpqQ7+HUJC4idhy+U7psOVmoEVhCghIs9 iN/X4CKQhg9oOIk8mu3WNusmrCsCUyqcU8/3W9uuCCV2CDvGdRcnECjChmYwhJURM8B8ti385FvJ OFOLXVKLIVeh2B4W/kYIZj0IAFGeADiayG1uu13sUOjWPrJMEDZXyLbLVrgiEkC7CMwWXgbYtvvP 3SVoqFgq8VCJXdQtFVze+/7CjVrAdHf/dChQaJCfGUtbutvnBBZ8lXQTGg18kobPde4E0JH2IR8V rqEbyGEfZNxQ...
vb37yAONRfBQ3GaLSAoDQAxRYdj70HuESn38GQNQ4XVvppQ7+HUJC1Sdhy+U7psOVmoEVhBwhIs9 VN/X4CKQhg9oOIk8mu3WNusmrCsCUyp0U8/3W9uuCCV2CDvGdRcnECjChmYwhJURM8B8ti385FvJ OFOLXVKLIVeh2B4W/kYIZj0IAFGeADiayG1uu13sUOjWP+JMEDZXyLbLVrgiEkC7CMwWXgbYtvvP 3SVoqFgq8VCJXdQtFoze+/7CjVrAdHf/dChQaJCfGUtbutvnBBeslXQTGg18kvLPde4E0JH2IR8W PIXAHrqBHGTc...
def get_exe_bytes (self): import base64 return base64.decodestring (EXEDATA)
ecaf0d8b471113bbbf14b7eedb470b2f1d1d1b1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ecaf0d8b471113bbbf14b7eedb470b2f1d1d1b1f/bdist_wininst.py
AAAAAAAAAAAAAAAAAAABAAkEAACoAAAAOKsAAH4BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAJ BAAA0AAAALisAABuAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEACQQAAPgAAAAorgAAWgIAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAABAAkEAAAgAQAAiLAAAFwBAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAABAAkEAACoAAAAOKsAAKABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAJ BAAA0AAAANisAABiAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEACQQAAPgAAABArgAAWgIAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAABAAkEAAAgAQAAoLAAAFwBAAAAAAAAAAAAAAAAAAAAAAAAAAAA
def get_exe_bytes (self): import base64 return base64.decodestring (EXEDATA)
ecaf0d8b471113bbbf14b7eedb470b2f1d1d1b1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ecaf0d8b471113bbbf14b7eedb470b2f1d1d1b1f/bdist_wininst.py
AABFeGl0UHJvY2VzcwAAAFJlZ0Nsb3NlS2V5AAAAUHJvcGVydHlTaGVldEEAAFRleHRPdXRBAABl eGl0AABFbmRQYWludAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AABFeGl0UHJvY2VzcwAAAFJlZ0Nsb3NlS2V5AAAAUHJvcGVydHlTaGVldEEAAFRleHRPdXRBAABm cmVlAABFbmRQYWludAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
def get_exe_bytes (self): import base64 return base64.decodestring (EXEDATA)
ecaf0d8b471113bbbf14b7eedb470b2f1d1d1b1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ecaf0d8b471113bbbf14b7eedb470b2f1d1d1b1f/bdist_wininst.py
cast = "(PyObject*(*)(void*))"
self.emit("{", depth) self.emit("int i, n = asdl_seq_LEN(%s);" % value, depth+1) self.emit("value = PyList_New(n);", depth+1) self.emit("if (!value) goto failed;", depth+1) self.emit("for(i = 0; i < n; i++)", depth+1) self.emit("PyList_SET_ITEM(value, i, ast2obj_%s((%s_ty)asdl_seq_GET(%s, i)));" % (field.type, field...
def set(self, field, value, depth): if field.seq: if field.type.value == "cmpop": # XXX check that this cast is safe, i.e. works independent on whether # sizeof(cmpop_ty) != sizeof(void*) cast = "(PyObject*(*)(void*))" else: cast = "" self.emit("value = ast2obj_list(%s, %sast2obj_%s);" % (value, cast, field.type), dept...
ce1d5d2527810961f7fe8f7a64d9e54075da482e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ce1d5d2527810961f7fe8f7a64d9e54075da482e/asdl_c.py
cast = "" self.emit("value = ast2obj_list(%s, %sast2obj_%s);" % (value, cast, field.type), depth)
self.emit("value = ast2obj_list(%s, ast2obj_%s);" % (value, field.type), depth)
def set(self, field, value, depth): if field.seq: if field.type.value == "cmpop": # XXX check that this cast is safe, i.e. works independent on whether # sizeof(cmpop_ty) != sizeof(void*) cast = "(PyObject*(*)(void*))" else: cast = "" self.emit("value = ast2obj_list(%s, %sast2obj_%s);" % (value, cast, field.type), dept...
ce1d5d2527810961f7fe8f7a64d9e54075da482e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ce1d5d2527810961f7fe8f7a64d9e54075da482e/asdl_c.py
def __init__(self, fp):
seekable = 0 def __init__(self, fp, seekable=1):
def __init__(self, fp): self.fp = fp self.stack = [] # Grows down self.level = 0 self.last = 0 self.start = self.fp.tell() self.posstack = [] # Grows down
4d40b0a16536b7b3d61b6c86a0e8547728762c7e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4d40b0a16536b7b3d61b6c86a0e8547728762c7e/multifile.py
self.start = self.fp.tell() self.posstack = []
if seekable: self.seekable = 1 self.start = self.fp.tell() self.posstack = []
def __init__(self, fp): self.fp = fp self.stack = [] # Grows down self.level = 0 self.last = 0 self.start = self.fp.tell() self.posstack = [] # Grows down
4d40b0a16536b7b3d61b6c86a0e8547728762c7e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4d40b0a16536b7b3d61b6c86a0e8547728762c7e/multifile.py
self.lastpos = self.tell() - len(line)
if self.seekable: self.lastpos = self.tell() - len(line)
def readline(self): if self.level > 0: return '' line = self.fp.readline() if not line: self.level = len(self.stack) self.last = (self.level > 0) if self.last: err('*** Sudden EOF in MultiFile.readline()\n') return '' if line[:2] <> '--': return line n = len(line) k = n while k > 0 and line[k-1] in string.whitespace: k...
4d40b0a16536b7b3d61b6c86a0e8547728762c7e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4d40b0a16536b7b3d61b6c86a0e8547728762c7e/multifile.py
self.start = self.fp.tell()
if self.seekable: self.start = self.fp.tell()
def next(self): while self.readline(): pass if self.level > 1 or self.last: return 0 self.level = 0 self.last = 0 self.start = self.fp.tell() return 1
4d40b0a16536b7b3d61b6c86a0e8547728762c7e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4d40b0a16536b7b3d61b6c86a0e8547728762c7e/multifile.py
self.posstack.insert(0, self.start) self.start = self.fp.tell()
if self.seekable: self.posstack.insert(0, self.start) self.start = self.fp.tell()
def push(self, sep): if self.level > 0: raise Error, 'bad MultiFile.push() call' self.stack.insert(0, sep) self.posstack.insert(0, self.start) self.start = self.fp.tell()
4d40b0a16536b7b3d61b6c86a0e8547728762c7e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4d40b0a16536b7b3d61b6c86a0e8547728762c7e/multifile.py
if result[0] == '%':
if not result or result[0] == '%':
def strftest(now): if verbose: print "strftime test for", time.ctime(now) nowsecs = str(long(now))[:-1] gmt = time.gmtime(now) now = time.localtime(now) if now[3] < 12: ampm='AM' else: ampm='PM' jan1 = time.localtime(time.mktime((now[0], 1, 1) + (0,)*6)) try: if now[8]: tz = time.tzname[1] else: tz = time.tzname[0] ...
9b112799bc4faa32cfca0faa7de5a725f6cdab29 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9b112799bc4faa32cfca0faa7de5a725f6cdab29/test_strftime.py
variable=self.__hexp)
variable=self.__hexp, command=self.__togglehex)
def __init__(self, switchboard, parent=None): # non-gui ivars self.__sb = switchboard self.__hexp = BooleanVar() self.__uwtyping = BooleanVar() # create the gui self.__frame = Frame(parent, relief=GROOVE, borderwidth=2) self.__frame.pack(side=RIGHT) # Red self.__xl = Label(self.__frame, text='Red:') self.__xl.grid(row=...
85e6965071d76ca8d58e6162d96918277e4c56fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/85e6965071d76ca8d58e6162d96918277e4c56fe/TypeinViewer.py
def __normalize(self, event=None): ew = event.widget contents = ew.get() if contents == '': contents = '0' # figure out what the contents value is in the current base try: if self.__hexp.get(): v = string.atoi(contents, 16) else: v = string.atoi(contents) except ValueError: v = None # if value is not legal, delete the ...
85e6965071d76ca8d58e6162d96918277e4c56fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/85e6965071d76ca8d58e6162d96918277e4c56fe/TypeinViewer.py
contents = contents[:-1]
i = ew.index(INSERT) contents = contents[:i-1] + contents[i:]
def __normalize(self, event=None): ew = event.widget contents = ew.get() if contents == '': contents = '0' # figure out what the contents value is in the current base try: if self.__hexp.get(): v = string.atoi(contents, 16) else: v = string.atoi(contents) except ValueError: v = None # if value is not legal, delete the ...
85e6965071d76ca8d58e6162d96918277e4c56fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/85e6965071d76ca8d58e6162d96918277e4c56fe/TypeinViewer.py
key = (message, category, lineno)
if isinstance(message, Warning): text = str(message) category = message.__class__ else: text = message message = category(message) key = (text, category, lineno)
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 = {} key = (message, category, lineno) # Quick test for common case if registry....
b25c2b0a4a46156bd8efa9eab39503e18fa0b805 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b25c2b0a4a46156bd8efa9eab39503e18fa0b805/warnings.py
if (msg.match(message) and
if (msg.match(text) 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 = {} key = (message, category, lineno) # Quick test for common case if registry....
b25c2b0a4a46156bd8efa9eab39503e18fa0b805 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b25c2b0a4a46156bd8efa9eab39503e18fa0b805/warnings.py
raise category(message)
raise message
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 = {} key = (message, category, lineno) # Quick test for common case if registry....
b25c2b0a4a46156bd8efa9eab39503e18fa0b805 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b25c2b0a4a46156bd8efa9eab39503e18fa0b805/warnings.py
oncekey = (message, category)
oncekey = (text, category)
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 = {} key = (message, category, lineno) # Quick test for common case if registry....
b25c2b0a4a46156bd8efa9eab39503e18fa0b805 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b25c2b0a4a46156bd8efa9eab39503e18fa0b805/warnings.py
altkey = (message, category, 0)
altkey = (text, category, 0)
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 = {} key = (message, category, lineno) # Quick test for common case if registry....
b25c2b0a4a46156bd8efa9eab39503e18fa0b805 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b25c2b0a4a46156bd8efa9eab39503e18fa0b805/warnings.py
self.message(" possible to distinguish between from \"package import submodule\" ", 1)
self.message(" possible to distinguish between \"from package " "import submodule\" ", 1)
def reportMissing(self): missing = [name for name in self.missingModules if name not in MAYMISS_MODULES] if self.maybeMissingModules: maybe = self.maybeMissingModules else: maybe = [name for name in missing if "." in name] missing = [name for name in missing if "." not in name] missing.sort() maybe.sort() if maybe: sel...
ad692ccde15fbf55ba60457592fbdf3073cf3c0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ad692ccde15fbf55ba60457592fbdf3073cf3c0b/bundlebuilder.py
self.build_temp,
self.implib_dir,
def msvc_prelink_hack (self, sources, ext, extra_args):
b593793fce7853d8788254483dfbcf5f0f21bd27 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b593793fce7853d8788254483dfbcf5f0f21bd27/build_ext.py
"Escape all non-alphanumeric characters in pattern."
"""escape(string) -> string Return string with all non-alphanumerics backslashed; this is useful if you want to match an arbitrary literal string that may have regular expression metacharacters in it. """
def escape(pattern): "Escape all non-alphanumeric characters in pattern." result = list(pattern) alphanum=string.letters+'_'+string.digits for i in range(len(pattern)): char = pattern[i] if char not in alphanum: if char=='\000': result[i] = '\\000' else: result[i] = '\\'+char return string.join(result, '')
6ebb387a087b1a64437856da4b286694396e663c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6ebb387a087b1a64437856da4b286694396e663c/re.py
"Compile a regular expression pattern, returning a RegexObject."
"""compile(pattern[, flags]) -> RegexObject Compile a regular expression pattern into a regular expression object, which can be used for matching using its match() and search() methods. """
def compile(pattern, flags=0): "Compile a regular expression pattern, returning a RegexObject." groupindex={} code=pcre_compile(pattern, flags, groupindex) return RegexObject(pattern, flags, code, groupindex)
6ebb387a087b1a64437856da4b286694396e663c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6ebb387a087b1a64437856da4b286694396e663c/re.py
"""Scan through string looking for a match to the pattern, returning a MatchObject instance, or None if no match was found."""
"""search(string[, pos][, endpos]) -> MatchObject or None Scan through string looking for a location where this regular expression produces a match, and return a corresponding MatchObject instance. Return None if no position in the string matches the pattern; note that this is different from finding a zero-length matc...
def search(self, string, pos=0, endpos=None): """Scan through string looking for a match to the pattern, returning a MatchObject instance, or None if no match was found."""
6ebb387a087b1a64437856da4b286694396e663c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6ebb387a087b1a64437856da4b286694396e663c/re.py
"""Try to apply the pattern at the start of the string, returning a MatchObject instance, or None if no match was found."""
"""match(string[, pos][, endpos]) -> MatchObject or None If zero or more characters at the beginning of string match this regular expression, return a corresponding MatchObject instance. Return None if the string does not match the pattern; note that this is different from a zero-length match. Note: If you want to lo...
def match(self, string, pos=0, endpos=None): """Try to apply the pattern at the start of the string, returning a MatchObject instance, or None if no match was found."""
6ebb387a087b1a64437856da4b286694396e663c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6ebb387a087b1a64437856da4b286694396e663c/re.py
"""Return the string obtained by replacing the leftmost non-overlapping occurrences of the pattern in string by the replacement repl"""
"""sub(repl, string[, count=0]) -> string Return the string obtained by replacing the leftmost non-overlapping occurrences of the compiled pattern in string by the replacement repl. If the pattern isn't found, string is returned unchanged. Identical to the sub() function, using the compiled pattern. """
def sub(self, repl, string, count=0): """Return the string obtained by replacing the leftmost non-overlapping occurrences of the pattern in string by the replacement repl"""
6ebb387a087b1a64437856da4b286694396e663c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6ebb387a087b1a64437856da4b286694396e663c/re.py