rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
if data is None: return self.open(newurl) else: return self.open(newurl, data)
return self.open(newurl)
def redirect_internal(self, url, fp, errcode, errmsg, headers, data): if 'location' in headers: newurl = headers['location'] elif 'uri' in headers: newurl = headers['uri'] else: return void = fp.read() fp.close() # In case the server sent a relative URL, join with original: newurl = basejoin(self.type + ":" + url, newu...
a3c427c1dc3e32d6c4f912f2f1dedcd992d16a2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a3c427c1dc3e32d6c4f912f2f1dedcd992d16a2d/urllib.py
self.rfile.flush()
def run_cgi(self): """Execute a CGI script.""" dir, rest = self.cgi_info i = rest.rfind('?') if i >= 0: rest, query = rest[:i], rest[i+1:] else: query = '' i = rest.find('/') if i >= 0: script, rest = rest[:i], rest[i:] else: script, rest = rest, '' scriptname = dir + '/' + script scriptfile = self.translate_path(scrip...
812639b96d16f5ef7679fbf3c5ebda132e25f5df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/812639b96d16f5ef7679fbf3c5ebda132e25f5df/CGIHTTPServer.py
if remote_background:
if self.remote_background:
def _remote(self, url, action, autoraise): autoraise = int(bool(autoraise)) # always 0/1 raise_opt = self.raise_opts and self.raise_opts[autoraise] or '' cmd = "%s %s %s '%s' >/dev/null 2>&1" % (self.name, raise_opt, self.remote_cmd, action) if remote_background: cmd += ' &' rc = os.system(cmd) if rc: # bad return stat...
4e2d328e64fe445c8cdfee23bd4fae0cc294f776 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4e2d328e64fe445c8cdfee23bd4fae0cc294f776/webbrowser.py
if os.environ.get("DISPLAY"):
def register_X_browsers():
def open(self, url, new=0, autoraise=1): if new: ok = self._remote("LOADNEW " + url) else: ok = self._remote("LOAD " + url) return ok
4e2d328e64fe445c8cdfee23bd4fae0cc294f776 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4e2d328e64fe445c8cdfee23bd4fae0cc294f776/webbrowser.py
if tarinfo.chksum not in calc_chksums(buf): self._dbg(1, "tarfile: Bad Checksum %r" % tarinfo.name)
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
fd5733053dc6a088a58dd9de2321ef1c14fb7cf4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/fd5733053dc6a088a58dd9de2321ef1c14fb7cf4/tarfile.py
return self.inner(it, self.timer)
gcold = gc.isenabled() gc.disable() timing = self.inner(it, self.timer) if gcold: gc.enable() return timing
def timeit(self, number=default_number): """Time 'number' executions of the main statement.
49e4ded805ecd27297103de641a20eed0213910b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/49e4ded805ecd27297103de641a20eed0213910b/timeit.py
modname = modname + dirname + '.'
modname = dirname + '.' + modname
def getenvironment(self): if self.path: file = self.path dir = os.path.dirname(file) # check if we're part of a package modname = "" while os.path.exists(os.path.join(dir, "__init__.py")): dir, dirname = os.path.split(dir) modname = modname + dirname + '.' subname = _filename_as_modname(self.title) if modname: if subna...
b88bfbecebf6bf5ba03c0e87834196a15cabb8fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b88bfbecebf6bf5ba03c0e87834196a15cabb8fd/PyEdit.py
modname = modname[:-1]
modname = modname[:-1]
def getenvironment(self): if self.path: file = self.path dir = os.path.dirname(file) # check if we're part of a package modname = "" while os.path.exists(os.path.join(dir, "__init__.py")): dir, dirname = os.path.split(dir) modname = modname + dirname + '.' subname = _filename_as_modname(self.title) if modname: if subna...
b88bfbecebf6bf5ba03c0e87834196a15cabb8fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b88bfbecebf6bf5ba03c0e87834196a15cabb8fd/PyEdit.py
modname = modname + subname
modname = modname + subname
def getenvironment(self): if self.path: file = self.path dir = os.path.dirname(file) # check if we're part of a package modname = "" while os.path.exists(os.path.join(dir, "__init__.py")): dir, dirname = os.path.split(dir) modname = modname + dirname + '.' subname = _filename_as_modname(self.title) if modname: if subna...
b88bfbecebf6bf5ba03c0e87834196a15cabb8fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b88bfbecebf6bf5ba03c0e87834196a15cabb8fd/PyEdit.py
def _verify(name, expected): computed = eval(name)
def _verify(name, computed, expected):
def _verify(name, expected): computed = eval(name) if abs(computed - expected) > 1e-7: raise ValueError( "computed value for %s deviates too much " "(computed %g, expected %g)" % (name, computed, expected))
d6aac9e347f1c02a6991965619635ee60ddb6e1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6aac9e347f1c02a6991965619635ee60ddb6e1f/random.py
_verify('NV_MAGICCONST', 1.71552776992141)
_verify('NV_MAGICCONST', NV_MAGICCONST, 1.71552776992141)
def _verify(name, expected): computed = eval(name) if abs(computed - expected) > 1e-7: raise ValueError( "computed value for %s deviates too much " "(computed %g, expected %g)" % (name, computed, expected))
d6aac9e347f1c02a6991965619635ee60ddb6e1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6aac9e347f1c02a6991965619635ee60ddb6e1f/random.py
_verify('TWOPI', 6.28318530718)
_verify('TWOPI', TWOPI, 6.28318530718)
def _verify(name, expected): computed = eval(name) if abs(computed - expected) > 1e-7: raise ValueError( "computed value for %s deviates too much " "(computed %g, expected %g)" % (name, computed, expected))
d6aac9e347f1c02a6991965619635ee60ddb6e1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6aac9e347f1c02a6991965619635ee60ddb6e1f/random.py
_verify('LOG4', 1.38629436111989)
_verify('LOG4', LOG4, 1.38629436111989)
def _verify(name, expected): computed = eval(name) if abs(computed - expected) > 1e-7: raise ValueError( "computed value for %s deviates too much " "(computed %g, expected %g)" % (name, computed, expected))
d6aac9e347f1c02a6991965619635ee60ddb6e1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6aac9e347f1c02a6991965619635ee60ddb6e1f/random.py
_verify('SG_MAGICCONST', 2.50407739677627)
_verify('SG_MAGICCONST', SG_MAGICCONST, 2.50407739677627)
def _verify(name, expected): computed = eval(name) if abs(computed - expected) > 1e-7: raise ValueError( "computed value for %s deviates too much " "(computed %g, expected %g)" % (name, computed, expected))
d6aac9e347f1c02a6991965619635ee60ddb6e1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6aac9e347f1c02a6991965619635ee60ddb6e1f/random.py
if self.debugging: print '*welcome*', `self.welcome`
if self.debugging: print '*welcome*', self.sanitize(self.welcome)
def getwelcome(self): if self.debugging: print '*welcome*', `self.welcome` return self.welcome
63e263f517f8518a2f3e9fcad5d9a81461259949 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/63e263f517f8518a2f3e9fcad5d9a81461259949/ftplib.py
if self.debugging > 1: print '*put*', `line`
if self.debugging > 1: print '*put*', self.sanitize(line)
def putline(self, line): line = line + CRLF if self.debugging > 1: print '*put*', `line` self.sock.send(line)
63e263f517f8518a2f3e9fcad5d9a81461259949 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/63e263f517f8518a2f3e9fcad5d9a81461259949/ftplib.py
if self.debugging: print '*cmd*', `line`
if self.debugging: print '*cmd*', self.sanitize(line)
def putcmd(self, line): if self.debugging: print '*cmd*', `line` self.putline(line)
63e263f517f8518a2f3e9fcad5d9a81461259949 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/63e263f517f8518a2f3e9fcad5d9a81461259949/ftplib.py
print '*get*', `line`
print '*get*', self.sanitize(line)
def getline(self): line = self.file.readline() if self.debugging > 1: print '*get*', `line` if not line: raise EOFError if line[-2:] == CRLF: line = line[:-2] elif line[-1:] in CRLF: line = line[:-1] return line
63e263f517f8518a2f3e9fcad5d9a81461259949 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/63e263f517f8518a2f3e9fcad5d9a81461259949/ftplib.py
if self.debugging: print '*resp*', `resp`
if self.debugging: print '*resp*', self.sanitize(resp)
def getresp(self): resp = self.getmultiline() if self.debugging: print '*resp*', `resp` self.lastresp = resp[:3] c = resp[:1] if c == '4': raise error_temp, resp if c == '5': raise error_perm, resp if c not in '123': raise error_proto, resp return resp
63e263f517f8518a2f3e9fcad5d9a81461259949 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/63e263f517f8518a2f3e9fcad5d9a81461259949/ftplib.py
if self.debugging > 1: print '*put urgent*', `line`
if self.debugging > 1: print '*put urgent*', self.sanitize(line)
def abort(self): line = 'ABOR' + CRLF if self.debugging > 1: print '*put urgent*', `line` self.sock.send(line, MSG_OOB) resp = self.getmultiline() if resp[:3] not in ('426', '226'): raise error_proto, resp
63e263f517f8518a2f3e9fcad5d9a81461259949 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/63e263f517f8518a2f3e9fcad5d9a81461259949/ftplib.py
else: boundary = ""
if not valid_boundary(boundary): raise ValueError, ('Invalid boundary in multipart form: %s' % `ib`)
def parse_multipart(fp, pdict): """Parse multipart input. Arguments: fp : input file pdict: dictionary containing other parameters of conten-type header Returns a dictionary just like parse_qs(): keys are the field names, each value is a list of values for that field. This is easy to use but not much good if you a...
6cb8bd41f4a8775c8bc79b45393c0b44463041f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6cb8bd41f4a8775c8bc79b45393c0b44463041f6/cgi.py
part = klass(self.fp, {}, self.innerboundary,
part = klass(self.fp, {}, ib,
def read_multi(self, environ, keep_blank_values, strict_parsing): """Internal: read a part that is itself multipart.""" self.list = [] klass = self.FieldStorageClass or self.__class__ part = klass(self.fp, {}, self.innerboundary, environ, keep_blank_values, strict_parsing) # Throw first part away while not part.done: h...
6cb8bd41f4a8775c8bc79b45393c0b44463041f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6cb8bd41f4a8775c8bc79b45393c0b44463041f6/cgi.py
part = klass(self.fp, headers, self.innerboundary,
part = klass(self.fp, headers, ib,
def read_multi(self, environ, keep_blank_values, strict_parsing): """Internal: read a part that is itself multipart.""" self.list = [] klass = self.FieldStorageClass or self.__class__ part = klass(self.fp, {}, self.innerboundary, environ, keep_blank_values, strict_parsing) # Throw first part away while not part.done: h...
6cb8bd41f4a8775c8bc79b45393c0b44463041f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6cb8bd41f4a8775c8bc79b45393c0b44463041f6/cgi.py
if line == '?': line = 'help' elif line == '!':
if not line: return self.emptyline() elif line[0] == '?': line = 'help ' + line[1:] elif line[0] == '!':
def onecmd(self, line): line = string.strip(line) if line == '?': line = 'help' elif line == '!': if hasattr(self, 'do_shell'): line = 'shell' else: return self.default(line) elif not line: return self.emptyline() self.lastcmd = line i, n = 0, len(line) while i < n and line[i] in self.identchars: i = i+1 cmd, arg = lin...
e7fdeeae8e57033d7e70e50068ecfb4f3f8df5f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e7fdeeae8e57033d7e70e50068ecfb4f3f8df5f2/cmd.py
line = 'shell'
line = 'shell ' + line[1:]
def onecmd(self, line): line = string.strip(line) if line == '?': line = 'help' elif line == '!': if hasattr(self, 'do_shell'): line = 'shell' else: return self.default(line) elif not line: return self.emptyline() self.lastcmd = line i, n = 0, len(line) while i < n and line[i] in self.identchars: i = i+1 cmd, arg = lin...
e7fdeeae8e57033d7e70e50068ecfb4f3f8df5f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e7fdeeae8e57033d7e70e50068ecfb4f3f8df5f2/cmd.py
elif not line: return self.emptyline()
def onecmd(self, line): line = string.strip(line) if line == '?': line = 'help' elif line == '!': if hasattr(self, 'do_shell'): line = 'shell' else: return self.default(line) elif not line: return self.emptyline() self.lastcmd = line i, n = 0, len(line) while i < n and line[i] in self.identchars: i = i+1 cmd, arg = lin...
e7fdeeae8e57033d7e70e50068ecfb4f3f8df5f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e7fdeeae8e57033d7e70e50068ecfb4f3f8df5f2/cmd.py
chunk.skip()
if formlength > 0: chunk.skip()
def initfp(self, file): self._file = file self._version = 0 self._decomp = None self._markers = [] self._soundpos = 0 form = self._file.read(4) if form != 'FORM': raise Error, 'file does not start with FORM id' formlength = _read_long(self._file) if formlength <= 0: raise Error, 'invalid FORM chunk data size' formdata ...
73a527555c5fc4c5fb7ca7a9c8bdf5998fa8c412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/73a527555c5fc4c5fb7ca7a9c8bdf5998fa8c412/aifc.py
params = [CL.FRAME_BUFFER_SIZE, len(data) * 2]
params = [CL.FRAME_BUFFER_SIZE, len(data) * 2, \ CL.COMPRESSED_BUFFER_SIZE, len(data)]
def readframes(self, nframes): if self._ssnd_seek_needed: self._ssnd_chunk.rewind() dummy = self._ssnd_chunk.read(8) pos = self._soundpos * self._nchannels * self._sampwidth if self._decomp: if self._comptype in ('ULAW', 'ALAW'): pos = pos / 2 if pos: self._ssnd_chunk.setpos(pos + 8) self._ssnd_seek_needed = 0 size = n...
73a527555c5fc4c5fb7ca7a9c8bdf5998fa8c412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/73a527555c5fc4c5fb7ca7a9c8bdf5998fa8c412/aifc.py
opts, args = getopt.getopt(sys.argv[1:], 'deh:mo:p:P:qs:w')
opts, args = getopt.getopt(sys.argv[1:], 'de:hmo:p:P:qs:w')
def main(): # overridable context prefix = None # settable with -p option exec_prefix = None # settable with -P option extensions = [] path = sys.path[:] modargs = 0 debug = 1 odir = '' win = sys.platform[:3] == 'win' # modules that are imported by the Python runtime implicits = ...
f61ac5f8520d1a1f962090a953287fd53b0a1985 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f61ac5f8520d1a1f962090a953287fd53b0a1985/freeze.py
fileobj = open(self.name, self.mode)
fileobj = _open(self.name, self.mode)
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...
1317c1abc078140069eb75091b6bcd1f39cbb30b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1317c1abc078140069eb75091b6bcd1f39cbb30b/tarfile.py
fileobj = open(name, mode + "b")
fileobj = _open(name, mode + "b")
def gzopen(cls, name, mode="r", fileobj=None, compresslevel=9): """Open gzip compressed tar archive name for reading or writing. Appending is not allowed. """ if len(mode) > 1 or mode not in "rw": raise ValueError("mode must be 'r' or 'w'")
1317c1abc078140069eb75091b6bcd1f39cbb30b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1317c1abc078140069eb75091b6bcd1f39cbb30b/tarfile.py
f = open(name, "rb")
f = _open(name, "rb")
def add(self, name, arcname=None, recursive=True): """Add the file `name' to the archive. `name' may be any type of file (directory, fifo, symbolic link, etc.). If given, `arcname' specifies an alternative name for the file in the archive. Directories are added recursively by default. This can be avoided by setting `re...
1317c1abc078140069eb75091b6bcd1f39cbb30b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1317c1abc078140069eb75091b6bcd1f39cbb30b/tarfile.py
target = open(targetpath, "wb")
target = _open(targetpath, "wb")
def makefile(self, tarinfo, targetpath): """Make a file called targetpath. """ source = self.extractfile(tarinfo) target = open(targetpath, "wb") copyfileobj(source, target) source.close() target.close()
1317c1abc078140069eb75091b6bcd1f39cbb30b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1317c1abc078140069eb75091b6bcd1f39cbb30b/tarfile.py
Split 'text' into multiple lines of no more than 'self.width' characters each, and return the list of strings that results. Tabs in 'text' are expanded with string.expandtabs(), and all other whitespace characters (including newline) are converted to space.
Reformat the single paragraph in 'text' so it fits in lines of no more than 'self.width' columns, and return a list of wrapped lines. Tabs in 'text' are expanded with string.expandtabs(), and all other whitespace characters (including newline) are converted to space.
def wrap(self, text): """wrap(text : string) -> [string]
5afe79239ac1d4a94a35320620bab45ac8fbc6a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5afe79239ac1d4a94a35320620bab45ac8fbc6a3/textwrap.py
Reformat the paragraph in 'text' to fit in lines of no more than 'width' columns.
Reformat the single paragraph in 'text' to fit in lines of no more than 'self.width' columns, and return a new string containing the entire wrapped paragraph.
def fill(self, text): """fill(text : string) -> string
5afe79239ac1d4a94a35320620bab45ac8fbc6a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5afe79239ac1d4a94a35320620bab45ac8fbc6a3/textwrap.py
def fill(self, text): """fill(text : string) -> string
5afe79239ac1d4a94a35320620bab45ac8fbc6a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5afe79239ac1d4a94a35320620bab45ac8fbc6a3/textwrap.py
self.dispatch = { \ 'call' : self.trace_dispatch_call, \ 'return' : self.trace_dispatch_return, \ 'exception': self.trace_dispatch_exception, \ }
def __init__(self, timer=None): self.timings = {} self.cur = None self.cmd = ""
e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3/profile.py
self.get_time = self.get_time_mac
self.get_time = _get_time_mac
def __init__(self, timer=None): self.timings = {} self.cur = None self.cmd = ""
e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3/profile.py
self.timer = time.clock
self.timer = self.get_time = time.clock
def __init__(self, timer=None): self.timings = {} self.cur = None self.cmd = ""
e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3/profile.py
self.timer = time.time
self.timer = self.get_time = time.time
def __init__(self, timer=None): self.timings = {} self.cur = None self.cmd = ""
e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3/profile.py
if len(t) == 2:
length = len(t) except TypeError: self.get_time = timer self.dispatcher = self.trace_dispatch_i else: if length == 2:
def __init__(self, timer=None): self.timings = {} self.cur = None self.cmd = ""
e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3/profile.py
except TypeError: self.dispatcher = self.trace_dispatch_i
def get_time_timer(timer=timer, reduce=reduce, reducer=operator.add): return reduce(reducer, timer(), 0) self.get_time = get_time_timer
def __init__(self, timer=None): self.timings = {} self.cur = None self.cmd = ""
e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3/profile.py
def get_time(self): t = self.timer() if type(t) == type(()) or type(t) == type([]): t = reduce(lambda x,y: x+y, t, 0) return t def get_time_mac(self): return self.timer()/60.0
def __init__(self, timer=None): self.timings = {} self.cur = None self.cmd = ""
e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3/profile.py
t = self.timer()
timer = self.timer t = timer()
def trace_dispatch(self, frame, event, arg): t = self.timer() t = t[0] + t[1] - self.t # No Calibration constant # t = t[0] + t[1] - self.t - .00053 # Calibration constant
e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3/profile.py
if self.dispatch[event](frame,t): t = self.timer()
if self.dispatch[event](self, frame,t): t = timer()
def trace_dispatch(self, frame, event, arg): t = self.timer() t = t[0] + t[1] - self.t # No Calibration constant # t = t[0] + t[1] - self.t - .00053 # Calibration constant
e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3/profile.py
r = self.timer()
r = timer()
def trace_dispatch(self, frame, event, arg): t = self.timer() t = t[0] + t[1] - self.t # No Calibration constant # t = t[0] + t[1] - self.t - .00053 # Calibration constant
e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3/profile.py
t = self.timer() - self.t if self.dispatch[event](frame,t): self.t = self.timer() else: self.t = self.timer() - t
timer = self.timer t = timer() - self.t if self.dispatch[event](self, frame,t): self.t = timer() else: self.t = timer() - t
def trace_dispatch_i(self, frame, event, arg): t = self.timer() - self.t # - 1 # Integer calibration constant if self.dispatch[event](frame,t): self.t = self.timer() else: self.t = self.timer() - t # put back unrecorded delta return
e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3/profile.py
def trace_dispatch_i(self, frame, event, arg): t = self.timer() - self.t # - 1 # Integer calibration constant if self.dispatch[event](frame,t): self.t = self.timer() else: self.t = self.timer() - t # put back unrecorded delta return
e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3/profile.py
t = self.timer()/60.0 - self.t if self.dispatch[event](frame,t): self.t = self.timer()/60.0 else: self.t = self.timer()/60.0 - t
timer = self.timer t = timer()/60.0 - self.t if self.dispatch[event](self, frame,t): self.t = timer()/60.0 else: self.t = timer()/60.0 - t
def trace_dispatch_mac(self, frame, event, arg): t = self.timer()/60.0 - self.t # - 1 # Integer calibration constant if self.dispatch[event](frame,t): self.t = self.timer()/60.0 else: self.t = self.timer()/60.0 - t # put back unrecorded delta return
e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3/profile.py
t = self.get_time() - self.t if self.dispatch[event](frame,t): self.t = self.get_time() else: self.t = self.get_time()-t
get_time = self.get_time t = get_time() - self.t if self.dispatch[event](self, frame,t): self.t = get_time() else: self.t = get_time() - t
def trace_dispatch_l(self, frame, event, arg): t = self.get_time() - self.t
e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3/profile.py
if self.timings.has_key(fn): cc, ns, tt, ct, callers = self.timings[fn] self.timings[fn] = cc, ns + 1, tt, ct, callers else: self.timings[fn] = 0, 0, 0, 0, {}
timings = self.timings if timings.has_key(fn): cc, ns, tt, ct, callers = timings[fn] timings[fn] = cc, ns + 1, tt, ct, callers else: timings[fn] = 0, 0, 0, 0, {}
def trace_dispatch_call(self, frame, t): fcode = frame.f_code fn = (fcode.co_filename, fcode.co_firstlineno, fcode.co_name) self.cur = (t, 0, 0, fn, frame, self.cur) if self.timings.has_key(fn): cc, ns, tt, ct, callers = self.timings[fn] self.timings[fn] = cc, ns + 1, tt, ct, callers else: self.timings[fn] = 0, 0, 0, 0...
e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3/profile.py
cc, ns, tt, ct, callers = self.timings[rfn]
timings = self.timings cc, ns, tt, ct, callers = timings[rfn]
def trace_dispatch_return(self, frame, t): # if not frame is self.cur[-2]: raise "Bad return", self.cur[3]
e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3/profile.py
self.timings[rfn] = cc, ns - 1, tt+rtt, ct, callers
timings[rfn] = cc, ns - 1, tt+rtt, ct, callers
def trace_dispatch_return(self, frame, t): # if not frame is self.cur[-2]: raise "Bad return", self.cur[3]
e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3/profile.py
a = self.dispatch['call'](frame, 0)
a = self.dispatch['call'](self, frame, 0)
def simulate_call(self, name): code = self.fake_code('profile', 0, name) if self.cur: pframe = self.cur[-2] else: pframe = None frame = self.fake_frame(code, pframe) a = self.dispatch['call'](frame, 0) return
e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3/profile.py
t = self.get_time() - self.t
get_time = self.get_time t = get_time() - self.t
def simulate_cmd_complete(self): t = self.get_time() - self.t while self.cur[-1]: # We *can* cause assertion errors here if # dispatch_trace_return checks for a frame match! a = self.dispatch['return'](self.cur[-2], t) t = 0 self.t = self.get_time() - t
e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3/profile.py
a = self.dispatch['return'](self.cur[-2], t)
a = self.dispatch['return'](self, self.cur[-2], t)
def simulate_cmd_complete(self): t = self.get_time() - self.t while self.cur[-1]: # We *can* cause assertion errors here if # dispatch_trace_return checks for a frame match! a = self.dispatch['return'](self.cur[-2], t) t = 0 self.t = self.get_time() - t
e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3/profile.py
self.t = self.get_time() - t
self.t = get_time() - t
def simulate_cmd_complete(self): t = self.get_time() - self.t while self.cur[-1]: # We *can* cause assertion errors here if # dispatch_trace_return checks for a frame match! a = self.dispatch['return'](self.cur[-2], t) t = 0 self.t = self.get_time() - t
e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3/profile.py
def runcall(self, func, *args):
def runcall(self, func, *args, **kw):
def runcall(self, func, *args): self.set_cmd(`func`) sys.setprofile(self.dispatcher) try: return apply(func, args) finally: sys.setprofile(None)
e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3/profile.py
return apply(func, args)
return apply(func, args, kw)
def runcall(self, func, *args): self.set_cmd(`func`) sys.setprofile(self.dispatcher) try: return apply(func, args) finally: sys.setprofile(None)
e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3/profile.py
s = self.get_time()
s = get_time()
def calibrate(self, m): # Modified by Tim Peters n = m s = self.get_time() while n: self.simple() n = n - 1 f = self.get_time() my_simple = f - s #print "Simple =", my_simple,
e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3/profile.py
f = self.get_time()
f = get_time()
def calibrate(self, m): # Modified by Tim Peters n = m s = self.get_time() while n: self.simple() n = n - 1 f = self.get_time() my_simple = f - s #print "Simple =", my_simple,
e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3/profile.py
s = self.get_time()
s = get_time()
def calibrate(self, m): # Modified by Tim Peters n = m s = self.get_time() while n: self.simple() n = n - 1 f = self.get_time() my_simple = f - s #print "Simple =", my_simple,
e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3/profile.py
f = self.get_time()
f = get_time()
def calibrate(self, m): # Modified by Tim Peters n = m s = self.get_time() while n: self.simple() n = n - 1 f = self.get_time() my_simple = f - s #print "Simple =", my_simple,
e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3/profile.py
import sys import os
def Stats(*args): print 'Report generating functions are in the "pstats" module\a'
e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e5b78a4bafbe2eee27f64fd9f04f745a2a189bd3/profile.py
if part: self._hit(part)
def hitter(ctl, part, self=self): if part: self._hit(part)
85650c4fcb03c17847d3721740fa10fecd9f0097 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/85650c4fcb03c17847d3721740fa10fecd9f0097/Wcontrols.py
def visit(pattern, dirname, names):
def main(): try: opts, args = getopt.getopt(sys.argv[1:], '') if len(args) < 2: raise getopt.error, 'not enough arguments' except getopt.error, msg: sys.stdout = sys.stderr print msg print 'usage: findlinksto pattern directory ...' sys.exit(2) pat, dirs = args[0], args[1:] prog = regex.compile(pat) for dirname in dirs:...
def visit(pattern, dirname, names): if os.path.islink(dirname): names[:] = [] return if os.path.ismount(dirname): print 'descend into', dirname n = len(pattern) for name in names: name = os.path.join(dirname, name) try: linkto = os.readlink(name) if linkto[:n] == pattern: print name, '->', linkto except os.error: pass
1e95ea79543fb0945808097dc1f4711e05715cb3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1e95ea79543fb0945808097dc1f4711e05715cb3/findlinksto.py
n = len(pattern)
def visit(pattern, dirname, names): if os.path.islink(dirname): names[:] = [] return if os.path.ismount(dirname): print 'descend into', dirname n = len(pattern) for name in names: name = os.path.join(dirname, name) try: linkto = os.readlink(name) if linkto[:n] == pattern: print name, '->', linkto except os.error: pass
1e95ea79543fb0945808097dc1f4711e05715cb3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1e95ea79543fb0945808097dc1f4711e05715cb3/findlinksto.py
if linkto[:n] == pattern:
if prog.search(linkto) >= 0:
def visit(pattern, dirname, names): if os.path.islink(dirname): names[:] = [] return if os.path.ismount(dirname): print 'descend into', dirname n = len(pattern) for name in names: name = os.path.join(dirname, name) try: linkto = os.readlink(name) if linkto[:n] == pattern: print name, '->', linkto except os.error: pass
1e95ea79543fb0945808097dc1f4711e05715cb3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1e95ea79543fb0945808097dc1f4711e05715cb3/findlinksto.py
openitem = FrameWork.MenuItem(m, "Open"+ELIPSES, "O", 'open') openbynameitem = FrameWork.MenuItem(m, "Open File by Name"+ELIPSES, "D", 'openbyname')
openitem = FrameWork.MenuItem(m, "Open"+ELLIPSIS, "O", 'open') openbynameitem = FrameWork.MenuItem(m, "Open File by Name"+ELLIPSIS, "D", 'openbyname')
def makeusermenus(self): m = Wapplication.Menu(self.menubar, "File") newitem = FrameWork.MenuItem(m, "New", "N", 'new') openitem = FrameWork.MenuItem(m, "Open"+ELIPSES, "O", 'open') openbynameitem = FrameWork.MenuItem(m, "Open File by Name"+ELIPSES, "D", 'openbyname') self.openrecentmenu = FrameWork.SubMenu(m, "Open Re...
f8a40653079a68a233004a4391a7e19632ab85d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f8a40653079a68a233004a4391a7e19632ab85d2/PythonIDEMain.py
saveasitem = FrameWork.MenuItem(m, "Save as"+ELIPSES, None, 'save_as') FrameWork.Separator(m) saveasappletitem = FrameWork.MenuItem(m, "Save as Applet"+ELIPSES, None, 'save_as_applet')
saveasitem = FrameWork.MenuItem(m, "Save as"+ELLIPSIS, None, 'save_as') FrameWork.Separator(m) saveasappletitem = FrameWork.MenuItem(m, "Save as Applet"+ELLIPSIS, None, 'save_as_applet')
def makeusermenus(self): m = Wapplication.Menu(self.menubar, "File") newitem = FrameWork.MenuItem(m, "New", "N", 'new') openitem = FrameWork.MenuItem(m, "Open"+ELIPSES, "O", 'open') openbynameitem = FrameWork.MenuItem(m, "Open File by Name"+ELIPSES, "D", 'openbyname') self.openrecentmenu = FrameWork.SubMenu(m, "Open Re...
f8a40653079a68a233004a4391a7e19632ab85d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f8a40653079a68a233004a4391a7e19632ab85d2/PythonIDEMain.py
finditem = FrameWork.MenuItem(m, "Find"+ELIPSES, "F", "find")
finditem = FrameWork.MenuItem(m, "Find"+ELLIPSIS, "F", "find")
def makeusermenus(self): m = Wapplication.Menu(self.menubar, "File") newitem = FrameWork.MenuItem(m, "New", "N", 'new') openitem = FrameWork.MenuItem(m, "Open"+ELIPSES, "O", 'open') openbynameitem = FrameWork.MenuItem(m, "Open File by Name"+ELIPSES, "D", 'openbyname') self.openrecentmenu = FrameWork.SubMenu(m, "Open Re...
f8a40653079a68a233004a4391a7e19632ab85d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f8a40653079a68a233004a4391a7e19632ab85d2/PythonIDEMain.py
moditem = FrameWork.MenuItem(m, "Module browser"+ELIPSES, "M", self.domenu_modulebrowser)
moditem = FrameWork.MenuItem(m, "Module browser"+ELLIPSIS, "M", self.domenu_modulebrowser)
def makeusermenus(self): m = Wapplication.Menu(self.menubar, "File") newitem = FrameWork.MenuItem(m, "New", "N", 'new') openitem = FrameWork.MenuItem(m, "Open"+ELIPSES, "O", 'open') openbynameitem = FrameWork.MenuItem(m, "Open File by Name"+ELIPSES, "D", 'openbyname') self.openrecentmenu = FrameWork.SubMenu(m, "Open Re...
f8a40653079a68a233004a4391a7e19632ab85d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f8a40653079a68a233004a4391a7e19632ab85d2/PythonIDEMain.py
FrameWork.MenuItem(mm, "Set Scripts folder"+ELIPSES, None, self.do_setscriptsfolder) FrameWork.MenuItem(mm, "Editor default settings"+ELIPSES, None, self.do_editorprefs) FrameWork.MenuItem(mm, "Set default window font"+ELIPSES, None, self.do_setwindowfont)
FrameWork.MenuItem(mm, "Set Scripts folder"+ELLIPSIS, None, self.do_setscriptsfolder) FrameWork.MenuItem(mm, "Editor default settings"+ELLIPSIS, None, self.do_editorprefs) FrameWork.MenuItem(mm, "Set default window font"+ELLIPSIS, None, self.do_setwindowfont)
def makeusermenus(self): m = Wapplication.Menu(self.menubar, "File") newitem = FrameWork.MenuItem(m, "New", "N", 'new') openitem = FrameWork.MenuItem(m, "Open"+ELIPSES, "O", 'open') openbynameitem = FrameWork.MenuItem(m, "Open File by Name"+ELIPSES, "D", 'openbyname') self.openrecentmenu = FrameWork.SubMenu(m, "Open Re...
f8a40653079a68a233004a4391a7e19632ab85d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f8a40653079a68a233004a4391a7e19632ab85d2/PythonIDEMain.py
f = open(os.path.join(path, "Place your scripts here"+ELIPSES), "w")
f = open(os.path.join(path, "Place your scripts here"+ELLIPSIS), "w")
def makeusermenus(self): m = Wapplication.Menu(self.menubar, "File") newitem = FrameWork.MenuItem(m, "New", "N", 'new') openitem = FrameWork.MenuItem(m, "Open"+ELIPSES, "O", 'open') openbynameitem = FrameWork.MenuItem(m, "Open File by Name"+ELIPSES, "D", 'openbyname') self.openrecentmenu = FrameWork.SubMenu(m, "Open Re...
f8a40653079a68a233004a4391a7e19632ab85d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f8a40653079a68a233004a4391a7e19632ab85d2/PythonIDEMain.py
return "About Python IDE"+ELIPSES
return "About Python IDE"+ELLIPSIS
def getabouttext(self): return "About Python IDE"+ELIPSES
f8a40653079a68a233004a4391a7e19632ab85d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f8a40653079a68a233004a4391a7e19632ab85d2/PythonIDEMain.py
def _charset(charset, fixup):
def _charset(charset, fixup=None):
def _charset(charset, fixup): # internal: optimize character set out = [] charmap = [0]*256 try: for op, av in charset: if op is NEGATE: out.append((op, av)) elif op is LITERAL: charmap[fixup(av)] = 1 elif op is RANGE: for i in range(fixup(av[0]), fixup(av[1])+1): charmap[i] = 1 elif op is CATEGORY: # FIXME: could appe...
08bcb378526229625ae55b0a692ed2eda23e8658 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/08bcb378526229625ae55b0a692ed2eda23e8658/sre_compile.py
try: class C(bool): pass except TypeError: pass else: raise TestFailed, "bool should not be subclassable" try: int.__new__(bool, 0) except TypeError: pass else: raise TestFailed, "should not be able to create new bool instances" fo = open(TESTFN, "wb") print >> fo, False, True fo.close() fo = open(TESTFN, "rb") vere...
class BoolTest(unittest.TestCase): def assertIs(self, a, b): self.assert_(a is b) def assertIsNot(self, a, b): self.assert_(a is not b) def test_subclass(self): try: class C(bool): pass except TypeError: pass else: self.fail("bool should not be subclassable") self.assertRaises(TypeError, int.__new__, bool, 0) def ...
def verisnot(a, b): if a is b: raise TestFailed, "%r is %r" % (a, b)
cf48b77fab099377d4d78c88593031ea8e541535 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cf48b77fab099377d4d78c88593031ea8e541535/test_bool.py
items = map(lambda (k, v), type = type, simp = SIMPLE_TYPES, indent = indent: (k, v, not type(v) in simp, indent), items)
items = [(k, v, not isinstance(v, SIMPLE_TYPES), indent) for k, v in items]
def pack_items(items, indent = 0): items = map(lambda (k, v), type = type, simp = SIMPLE_TYPES, indent = indent: (k, v, not type(v) in simp, indent), items) return tuple_caselesssort(items)
8b1e775b54a15ebaaa7e03a0d0e105c7f635388d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8b1e775b54a15ebaaa7e03a0d0e105c7f635388d/PyBrowser.py
def testPackageRequire(self): tcl = self.interp tcl.eval('package require Tclx') tcl.eval('keylset a b.c 1') self.assertEqual(tcl.eval('keylget a b.c'),'1')
def testPackageRequire(self): tcl = self.interp tcl.eval('package require Tclx') tcl.eval('keylset a b.c 1') self.assertEqual(tcl.eval('keylget a b.c'),'1')
b36ed153208511bcc3fbf7d0183c91afc16ec948 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b36ed153208511bcc3fbf7d0183c91afc16ec948/test_tcl.py
if sys.platform.startswith('win'):
if sys.platform.startswith('win') or sys.platform.startswith('darwin'):
def testLoadTkFailure(self): import os old_display = None import sys if sys.platform.startswith('win'): return # no failure possible on windows? if 'DISPLAY' in os.environ: old_display = os.environ['DISPLAY'] del os.environ['DISPLAY'] # on some platforms, deleting environment variables # doesn't actually carry through ...
b36ed153208511bcc3fbf7d0183c91afc16ec948 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b36ed153208511bcc3fbf7d0183c91afc16ec948/test_tcl.py
def findnames(file, prefix=""):
def findnames(file, prefixes=()):
def findnames(file, prefix=""): names = {} for line in file.readlines(): if line[0] == '!': continue fields = line.split() name, tag = fields[0], fields[-1] if tag == 'd' and name.endswith('_H'): continue if name.startswith(prefix): names[name] = tag return names
3765bd23f1517b1a04fc6472a2ca1e8ea61a227f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3765bd23f1517b1a04fc6472a2ca1e8ea61a227f/undoc_symbols.py
for line in file.readlines():
for line in file.xreadlines():
def findnames(file, prefix=""): names = {} for line in file.readlines(): if line[0] == '!': continue fields = line.split() name, tag = fields[0], fields[-1] if tag == 'd' and name.endswith('_H'): continue if name.startswith(prefix): names[name] = tag return names
3765bd23f1517b1a04fc6472a2ca1e8ea61a227f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3765bd23f1517b1a04fc6472a2ca1e8ea61a227f/undoc_symbols.py
if name.startswith(prefix):
if prefixes: sw = name.startswith for prefix in prefixes: if sw(prefix): names[name] = tag else:
def findnames(file, prefix=""): names = {} for line in file.readlines(): if line[0] == '!': continue fields = line.split() name, tag = fields[0], fields[-1] if tag == 'd' and name.endswith('_H'): continue if name.startswith(prefix): names[name] = tag return names
3765bd23f1517b1a04fc6472a2ca1e8ea61a227f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3765bd23f1517b1a04fc6472a2ca1e8ea61a227f/undoc_symbols.py
fp = os.popen("ctags -IDL_IMPORT --c-types=%s -f - %s" % (TAG_KINDS, incfiles))
fp = os.popen("ctags -IDL_IMPORT --c-types=%s -f - %s" % (TAG_KINDS, incfiles))
def print_undoc_symbols(prefix, docdir, incdir): docs = [] for sect in DOCSECTIONS: for file in glob.glob(os.path.join(docdir, sect, "*.tex")): docs.append(open(file).read()) docs = "\n".join(docs) incfiles = os.path.join(incdir, INCLUDEPATTERN) fp = os.popen("ctags -IDL_IMPORT --c-types=%s -f - %s" % (TAG_KINDS, i...
3765bd23f1517b1a04fc6472a2ca1e8ea61a227f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3765bd23f1517b1a04fc6472a2ca1e8ea61a227f/undoc_symbols.py
print_undoc_symbols(PREFIX, docdir, incdir)
print_undoc_symbols(PREFIXES, docdir, incdir)
def print_undoc_symbols(prefix, docdir, incdir): docs = [] for sect in DOCSECTIONS: for file in glob.glob(os.path.join(docdir, sect, "*.tex")): docs.append(open(file).read()) docs = "\n".join(docs) incfiles = os.path.join(incdir, INCLUDEPATTERN) fp = os.popen("ctags -IDL_IMPORT --c-types=%s -f - %s" % (TAG_KINDS, i...
3765bd23f1517b1a04fc6472a2ca1e8ea61a227f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3765bd23f1517b1a04fc6472a2ca1e8ea61a227f/undoc_symbols.py
def bind(self, sequence=None, command=None): return self.canvas.tag_bind(self.id, sequence, command) def unbind(self, sequence): self.canvas.tag_bind(self.id, sequence, '')
def bind(self, sequence=None, command=None, add=None): return self.canvas.tag_bind(self.id, sequence, command, add) def unbind(self, sequence, funcid=None): self.canvas.tag_unbind(self.id, sequence, funcid)
def bind(self, sequence=None, command=None): return self.canvas.tag_bind(self.id, sequence, command)
20588058299eae7d6047d3ec6dd5511e49a6217f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/20588058299eae7d6047d3ec6dd5511e49a6217f/Canvas.py
self.canvas.lower(self.id, belowthis)
self.canvas.tag_lower(self.id, belowthis)
def lower(self, belowthis=None): self.canvas.lower(self.id, belowthis)
20588058299eae7d6047d3ec6dd5511e49a6217f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/20588058299eae7d6047d3ec6dd5511e49a6217f/Canvas.py
self.canvas.tkraise(self.id, abovethis)
self.canvas.tag_raise(self.id, abovethis)
def tkraise(self, abovethis=None): self.canvas.tkraise(self.id, abovethis)
20588058299eae7d6047d3ec6dd5511e49a6217f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/20588058299eae7d6047d3ec6dd5511e49a6217f/Canvas.py
def bind(self, sequence=None, command=None): return self.canvas.tag_bind(self.id, sequence, command) def unbind(self, sequence): self.canvas.tag_bind(self.id, sequence, '')
def bind(self, sequence=None, command=None, add=None): return self.canvas.tag_bind(self.id, sequence, command, add) def unbind(self, sequence, funcid=None): self.canvas.tag_unbind(self.id, sequence, funcid)
def bind(self, sequence=None, command=None): return self.canvas.tag_bind(self.id, sequence, command)
20588058299eae7d6047d3ec6dd5511e49a6217f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/20588058299eae7d6047d3ec6dd5511e49a6217f/Canvas.py
self._do('lower', belowThis)
self._do('tag_lower', belowThis)
def lower(self, belowThis=None): self._do('lower', belowThis)
20588058299eae7d6047d3ec6dd5511e49a6217f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/20588058299eae7d6047d3ec6dd5511e49a6217f/Canvas.py
self._do('raise', aboveThis)
self._do('tag_raise', aboveThis)
def tkraise(self, aboveThis=None): self._do('raise', aboveThis)
20588058299eae7d6047d3ec6dd5511e49a6217f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/20588058299eae7d6047d3ec6dd5511e49a6217f/Canvas.py
chunks.append(size)
chunks.append(data)
def read(self, size): """Read 'size' bytes from remote.""" # sslobj.read() sometimes returns < size bytes chunks = [] read = 0 while read < size: data = self.sslobj.read(size-read) read += len(data) chunks.append(size)
7fe8eacaa9c39f52bb2f7f077ee92f2b90a1c07a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7fe8eacaa9c39f52bb2f7f077ee92f2b90a1c07a/imaplib.py
print '%s == %s: OK' % (repr(a), repr(b))
print '%s == %s: OK' % (a, b)
def check(a, b): if a != b: print '*** check failed: %s != %s' % (repr(a), repr(b)) else: print '%s == %s: OK' % (repr(a), repr(b))
ae9be15fe5d13ea2d5126535c74bcfb03b54a348 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ae9be15fe5d13ea2d5126535c74bcfb03b54a348/test_charmapcodec.py
doc = getattr(ob, "__doc__", "")
doc = getattr(ob, "__doc__", "").lstrip()
def get_arg_text(ob): "Get a string describing the arguments for the given object" argText = "" if ob is not None: argOffset = 0 if type(ob)==types.ClassType: # Look for the highest __init__ in the class chain. fob = _find_constructor(ob) if fob is None: fob = lambda: None else: argOffset = 1 elif type(ob)==types.Metho...
070c5b6602cf0d3ed66be8a3882cab34a69f20fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/070c5b6602cf0d3ed66be8a3882cab34a69f20fe/CallTips.py
while doc[:1] in " \t\n": doc = doc[1:]
def get_arg_text(ob): "Get a string describing the arguments for the given object" argText = "" if ob is not None: argOffset = 0 if type(ob)==types.ClassType: # Look for the highest __init__ in the class chain. fob = _find_constructor(ob) if fob is None: fob = lambda: None else: argOffset = 1 elif type(ob)==types.Metho...
070c5b6602cf0d3ed66be8a3882cab34a69f20fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/070c5b6602cf0d3ed66be8a3882cab34a69f20fe/CallTips.py
1 <= len(macros) <= 2):
1 <= len(macro) <= 2):
def check_extensions_list (self, extensions): """Ensure that the list of extensions (presumably provided as a command option 'extensions') is valid, i.e. it is a list of Extension objects. We also support the old-style list of 2-tuples, where the tuples are (ext_name, build_info), which are converted to Extension inst...
d591c56d580f3c23921e0043a5957abb01173d1a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d591c56d580f3c23921e0043a5957abb01173d1a/build_ext.py
def splitbins(bins): bytes = sys.maxint for shift in range(16): bin1 = [] bin2 = []
def splitbins(t, trace=0): """t, trace=0 -> (t1, t2, shift). Split a table to save space. t is a sequence of ints. This function can be useful to save space if many of the ints are the same. t1 and t2 are lists of ints, and shift is an int, chosen to minimize the combined size of t1 and t2 (in C code), and where fo...
def splitbins(bins): # split a sparse integer table into two tables, such as: # value = t2[(t1[char>>shift]<<shift)+(char&mask)] # and value == 0 means no data bytes = sys.maxint for shift in range(16): bin1 = [] bin2 = [] size = 2**shift bincache = {} for i in range(0, len(bins), size): bin = bins[i:i+size] index = ...
ba0a5af15315f108f3e529a396b83d1a2395f027 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ba0a5af15315f108f3e529a396b83d1a2395f027/makeunicodedata.py
for i in range(0, len(bins), size): bin = bins[i:i+size] index = bincache.get(tuple(bin))
for i in range(0, len(t), size): bin = t[i:i+size] index = bincache.get(bin)
def splitbins(bins): # split a sparse integer table into two tables, such as: # value = t2[(t1[char>>shift]<<shift)+(char&mask)] # and value == 0 means no data bytes = sys.maxint for shift in range(16): bin1 = [] bin2 = [] size = 2**shift bincache = {} for i in range(0, len(bins), size): bin = bins[i:i+size] index = ...
ba0a5af15315f108f3e529a396b83d1a2395f027 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ba0a5af15315f108f3e529a396b83d1a2395f027/makeunicodedata.py
index = len(bin2) bincache[tuple(bin)] = index for v in bin: if v is None: bin2.append(0) else: bin2.append(v) bin1.append(index>>shift)
index = len(t2) bincache[bin] = index t2.extend(bin) t1.append(index >> shift)
def splitbins(bins): # split a sparse integer table into two tables, such as: # value = t2[(t1[char>>shift]<<shift)+(char&mask)] # and value == 0 means no data bytes = sys.maxint for shift in range(16): bin1 = [] bin2 = [] size = 2**shift bincache = {} for i in range(0, len(bins), size): bin = bins[i:i+size] index = ...
ba0a5af15315f108f3e529a396b83d1a2395f027 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ba0a5af15315f108f3e529a396b83d1a2395f027/makeunicodedata.py
b = len(bin1)*getsize(bin1) + len(bin2)*getsize(bin2)
b = len(t1)*getsize(t1) + len(t2)*getsize(t2) if trace: dump(t1, t2, shift, b)
def splitbins(bins): # split a sparse integer table into two tables, such as: # value = t2[(t1[char>>shift]<<shift)+(char&mask)] # and value == 0 means no data bytes = sys.maxint for shift in range(16): bin1 = [] bin2 = [] size = 2**shift bincache = {} for i in range(0, len(bins), size): bin = bins[i:i+size] index = ...
ba0a5af15315f108f3e529a396b83d1a2395f027 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ba0a5af15315f108f3e529a396b83d1a2395f027/makeunicodedata.py