rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
s += chunk | s.append(chunk) | def _safe_read(self, amt): """Read the number of bytes requested, compensating for partial reads. | 80ba8e85490515c293959a4196cbd99b1b3819a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/80ba8e85490515c293959a4196cbd99b1b3819a2/httplib.py |
return s | return ''.join(s) | def _safe_read(self, amt): """Read the number of bytes requested, compensating for partial reads. | 80ba8e85490515c293959a4196cbd99b1b3819a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/80ba8e85490515c293959a4196cbd99b1b3819a2/httplib.py |
headers, 'file:'+pathname2url(file)) | headers, 'file:'+file) | def open_local_file(self, url): import mimetypes, mimetools, StringIO mtype = mimetypes.guess_type(url)[0] headers = mimetools.Message(StringIO.StringIO( 'Content-Type: %s\n' % (mtype or 'text/plain'))) host, file = splithost(url) if not host: return addinfourl(open(url2pathname(file), 'rb'), headers, 'file:'+pathname2... | 3764595c980ccba821a29947dbef14947b71825e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3764595c980ccba821a29947dbef14947b71825e/urllib.py |
headers, 'file:'+pathname2url(file)) | headers, 'file:'+file) | def open_local_file(self, url): import mimetypes, mimetools, StringIO mtype = mimetypes.guess_type(url)[0] headers = mimetools.Message(StringIO.StringIO( 'Content-Type: %s\n' % (mtype or 'text/plain'))) host, file = splithost(url) if not host: return addinfourl(open(url2pathname(file), 'rb'), headers, 'file:'+pathname2... | 3764595c980ccba821a29947dbef14947b71825e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3764595c980ccba821a29947dbef14947b71825e/urllib.py |
del dirs_in_sys_path | def addpackage(sitedir, name): fullname = os.path.join(sitedir, name) try: f = open(fullname) except IOError: return while 1: dir = f.readline() if not dir: break if dir[0] == '#': continue if dir.startswith("import"): exec dir continue if dir[-1] == '\n': dir = dir[:-1] dir, dircase = makepath(sitedir, dir) if not dir... | 27451d0fc8924bf2bd9750ff82fff169e3ee2308 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/27451d0fc8924bf2bd9750ff82fff169e3ee2308/site.py | |
co.co_firstlineno, co.co_lnotab) | co.co_firstlineno, co.co_lnotab, co.co_freevars, co.co_cellvars) | def replace_paths_in_code(self, co): new_filename = original_filename = os.path.normpath(co.co_filename) for f,r in self.replace_paths: if original_filename.startswith(f): new_filename = r+original_filename[len(f):] break | 82c72310718024f0a50f684b497ef9e9b62971e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/82c72310718024f0a50f684b497ef9e9b62971e5/modulefinder.py |
if os.environ.has_key('CFLAGS'): extra_args.extend(string.split(os.environ['CFLAGS'])) | for undef in ext.undef_macros: macros.append((undef,)) | 47ca2bc661e39238a948d1c967756fd0580c3502 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/47ca2bc661e39238a948d1c967756fd0580c3502/build_ext.py | |
for undef in ext.undef_macros: macros.append((undef,)) | 47ca2bc661e39238a948d1c967756fd0580c3502 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/47ca2bc661e39238a948d1c967756fd0580c3502/build_ext.py | ||
if sys.platform in ('win', 'mac'): | if sys.platform[:3] in ('win', 'mac'): | def test(): import sys if sys.platform in ('win', 'mac'): if verbose: print "Can't test select easily" return cmd = 'for i in 0 1 2 3 4 5 6 7 8 9; do echo testing...; sleep 1; done' p = os.popen(cmd, 'r') for tout in (0, 1, 2, 4, 8, 16) + (None,)*10: if verbose: print 'timeout =', tout rfd, wfd, xfd = select.select([p]... | 4a0694d23578559cefb49c92ba4107e9997e93ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4a0694d23578559cefb49c92ba4107e9997e93ca/test_select.py |
print "Can't test select easily" | print "Can't test select easily on", sys.platform | def test(): import sys if sys.platform in ('win', 'mac'): if verbose: print "Can't test select easily" return cmd = 'for i in 0 1 2 3 4 5 6 7 8 9; do echo testing...; sleep 1; done' p = os.popen(cmd, 'r') for tout in (0, 1, 2, 4, 8, 16) + (None,)*10: if verbose: print 'timeout =', tout rfd, wfd, xfd = select.select([p]... | 4a0694d23578559cefb49c92ba4107e9997e93ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4a0694d23578559cefb49c92ba4107e9997e93ca/test_select.py |
pkg = PimpPackage(self, dict(p)) | p = dict(p) flavor = p.get('Flavor') if flavor == 'source': pkg = PimpPackage_source(self, p) elif flavor == 'binary': pkg = PimpPackage_binary(self, p) else: pkg = PimpPackage(self, dict(p)) | def _appendPackages(self, packages): """Given a list of dictionaries containing package descriptions create the PimpPackage objects and append them to our internal storage.""" for p in packages: pkg = PimpPackage(self, dict(p)) self._packages.append(pkg) | 0dacac48b92563807267c789889eadc8a5b99044 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0dacac48b92563807267c789889eadc8a5b99044/pimp.py |
def homepage(self): return self._dict['Home-page'] | def homepage(self): return self._dict.get('Home-page') | def homepage(self): return self._dict['Home-page'] | 0dacac48b92563807267c789889eadc8a5b99044 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0dacac48b92563807267c789889eadc8a5b99044/pimp.py |
if not self._dict['Prerequisites']: | if not self._dict.get('Prerequisites'): | def prerequisites(self): """Return a list of prerequisites for this package. The list contains 2-tuples, of which the first item is either a PimpPackage object or None, and the second is a descriptive string. The first item can be None if this package depends on something that isn't pimp-installable, in which case the... | 0dacac48b92563807267c789889eadc8a5b99044 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0dacac48b92563807267c789889eadc8a5b99044/pimp.py |
def downloadSinglePackage(self, output=None): | def downloadPackageOnly(self, output=None): | def downloadSinglePackage(self, output=None): """Download a single package, if needed. An MD5 signature is used to determine whether download is needed, and to test that we actually downloaded what we expected. If output is given it is a file-like object that will receive a log of what happens. If anything unforeseen... | 0dacac48b92563807267c789889eadc8a5b99044 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0dacac48b92563807267c789889eadc8a5b99044/pimp.py |
def unpackSinglePackage(self, output=None): | def unpackPackageOnly(self, output=None): | def unpackSinglePackage(self, output=None): """Unpack a downloaded package archive.""" filename = os.path.split(self.archiveFilename)[1] for ext, cmd in ARCHIVE_FORMATS: if filename[-len(ext):] == ext: break else: return "unknown extension for archive file: %s" % filename basename = filename[:-len(ext)] cmd = cmd % se... | 0dacac48b92563807267c789889eadc8a5b99044 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0dacac48b92563807267c789889eadc8a5b99044/pimp.py |
self._buildDirname = os.path.join(self._db.preferences.buildDir, basename) | def unpackSinglePackage(self, output=None): """Unpack a downloaded package archive.""" filename = os.path.split(self.archiveFilename)[1] for ext, cmd in ARCHIVE_FORMATS: if filename[-len(ext):] == ext: break else: return "unknown extension for archive file: %s" % filename basename = filename[:-len(ext)] cmd = cmd % se... | 0dacac48b92563807267c789889eadc8a5b99044 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0dacac48b92563807267c789889eadc8a5b99044/pimp.py | |
setupname = os.path.join(self._buildDirname, "setup.py") if not os.path.exists(setupname) and not NO_EXECUTE: return "no setup.py found after unpack of archive" | def installPackageOnly(self, output=None): """Default install method, to be overridden by subclasses""" return "Cannot automatically install package %s" % self.fullname() | def unpackSinglePackage(self, output=None): """Unpack a downloaded package archive.""" filename = os.path.split(self.archiveFilename)[1] for ext, cmd in ARCHIVE_FORMATS: if filename[-len(ext):] == ext: break else: return "unknown extension for archive file: %s" % filename basename = filename[:-len(ext)] cmd = cmd % se... | 0dacac48b92563807267c789889eadc8a5b99044 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0dacac48b92563807267c789889eadc8a5b99044/pimp.py |
msg = self.downloadSinglePackage(output) | msg = self.downloadPackageOnly(output) | def installSinglePackage(self, output=None): """Download, unpack and install a single package. If output is given it should be a file-like object and it will receive a log of what happened.""" if not self._dict['Download-URL']: return "%s: This package needs to be installed manually" % _fmtpackagename(self) msg = sel... | 0dacac48b92563807267c789889eadc8a5b99044 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0dacac48b92563807267c789889eadc8a5b99044/pimp.py |
msg = self.unpackSinglePackage(output) | msg = self.unpackPackageOnly(output) | def installSinglePackage(self, output=None): """Download, unpack and install a single package. If output is given it should be a file-like object and it will receive a log of what happened.""" if not self._dict['Download-URL']: return "%s: This package needs to be installed manually" % _fmtpackagename(self) msg = sel... | 0dacac48b92563807267c789889eadc8a5b99044 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0dacac48b92563807267c789889eadc8a5b99044/pimp.py |
if self._dict.has_key('Pre-install-command'): if self._cmd(output, self._buildDirname, self._dict['Pre-install-command']): return "pre-install %s: running \"%s\" failed" % \ (self.fullname(), self._dict['Pre-install-command']) old_contents = os.listdir(self._db.preferences.installDir) installcmd = self._dict.get('Inst... | return self.installPackageOnly(output) def beforeInstall(self): """Bookkeeping before installation: remember what we have in site-packages""" self._old_contents = os.listdir(self._db.preferences.installDir) def afterInstall(self): """Bookkeeping after installation: interpret any new .pth files that have appeared""" | def installSinglePackage(self, output=None): """Download, unpack and install a single package. If output is given it should be a file-like object and it will receive a log of what happened.""" if not self._dict['Download-URL']: return "%s: This package needs to be installed manually" % _fmtpackagename(self) msg = sel... | 0dacac48b92563807267c789889eadc8a5b99044 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0dacac48b92563807267c789889eadc8a5b99044/pimp.py |
self._interpretPthFiles(old_contents, new_contents) if self._dict.has_key('Post-install-command'): if self._cmd(output, self._buildDirname, self._dict['Post-install-command']): return "post-install %s: running \"%s\" failed" % \ (self.fullname(), self._dict['Post-install-command']) return None def _interpretPthFiles(... | def installSinglePackage(self, output=None): """Download, unpack and install a single package. If output is given it should be a file-like object and it will receive a log of what happened.""" if not self._dict['Download-URL']: return "%s: This package needs to be installed manually" % _fmtpackagename(self) msg = sel... | 0dacac48b92563807267c789889eadc8a5b99044 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0dacac48b92563807267c789889eadc8a5b99044/pimp.py | |
if fn in old_contents: | if fn in self._old_contents: | def _interpretPthFiles(self, old_contents, new_contents): """Evaluate any new .pth files that have appeared after installing""" for fn in new_contents: if fn in old_contents: continue if fn[-4:] != '.pth': continue fullname = os.path.join(self._db.preferences.installDir, fn) f = open(fullname) for line in f.readlines()... | 0dacac48b92563807267c789889eadc8a5b99044 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0dacac48b92563807267c789889eadc8a5b99044/pimp.py |
sys.path.append(line) | sys.path.append(line) class PimpPackage_binary(PimpPackage): def unpackPackageOnly(self, output=None): """We don't unpack binary packages until installing""" pass def installPackageOnly(self, output=None): """Install a single source package. If output is given it should be a file-like object and it will receive a l... | def _interpretPthFiles(self, old_contents, new_contents): """Evaluate any new .pth files that have appeared after installing""" for fn in new_contents: if fn in old_contents: continue if fn[-4:] != '.pth': continue fullname = os.path.join(self._db.preferences.installDir, fn) f = open(fullname) for line in f.readlines()... | 0dacac48b92563807267c789889eadc8a5b99044 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0dacac48b92563807267c789889eadc8a5b99044/pimp.py |
__version__ = " | __version__ = " | def testMultiply(self): self.assertEquals((0 * 10), 0) self.assertEquals((5 * 8), 40) | 3198275acef08b4fc7ea8939ed91105f50148e1e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3198275acef08b4fc7ea8939ed91105f50148e1e/unittest.py |
return attrname[:len(prefix)] == prefix and callable(getattr(testCaseClass, attrname)) | return attrname.startswith(prefix) and callable(getattr(testCaseClass, attrname)) | def isTestMethod(attrname, testCaseClass=testCaseClass, prefix=self.testMethodPrefix): return attrname[:len(prefix)] == prefix and callable(getattr(testCaseClass, attrname)) | 3198275acef08b4fc7ea8939ed91105f50148e1e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3198275acef08b4fc7ea8939ed91105f50148e1e/unittest.py |
"""retrieve(url) returns (filename, None) for a local object | """retrieve(url) returns (filename, headers) for a local object | def retrieve(self, url, filename=None, reporthook=None, data=None): """retrieve(url) returns (filename, None) for a local object or (tempfilename, headers) for a remote object.""" url = unwrap(toBytes(url)) if self.tempcache and url in self.tempcache: return self.tempcache[url] type, url1 = splittype(url) if filename i... | 7d618c731c4505ab92f085f97faa475ac3ad72d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7d618c731c4505ab92f085f97faa475ac3ad72d4/urllib.py |
self.s_apply(self.r_exec, args) | return self.s_apply(self.r_exec, args) | def s_exec(self, *args): self.s_apply(self.r_exec, args) | 183a2f243768ffd15ff4324b317ba880da1094ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/183a2f243768ffd15ff4324b317ba880da1094ef/rexec.py |
self.s_apply(self.r_eval, args) | return self.s_apply(self.r_eval, args) | def s_eval(self, *args): self.s_apply(self.r_eval, args) | 183a2f243768ffd15ff4324b317ba880da1094ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/183a2f243768ffd15ff4324b317ba880da1094ef/rexec.py |
self.s_apply(self.r_execfile, args) | return self.s_apply(self.r_execfile, args) | def s_execfile(self, *args): self.s_apply(self.r_execfile, args) | 183a2f243768ffd15ff4324b317ba880da1094ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/183a2f243768ffd15ff4324b317ba880da1094ef/rexec.py |
self.s_apply(self.r_import, args) | return self.s_apply(self.r_import, args) | def s_import(self, *args): self.s_apply(self.r_import, args) | 183a2f243768ffd15ff4324b317ba880da1094ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/183a2f243768ffd15ff4324b317ba880da1094ef/rexec.py |
self.s_apply(self.r_reload, args) | return self.s_apply(self.r_reload, args) | def s_reload(self, *args): self.s_apply(self.r_reload, args) | 183a2f243768ffd15ff4324b317ba880da1094ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/183a2f243768ffd15ff4324b317ba880da1094ef/rexec.py |
self.s_apply(self.r_unload, args) | return self.s_apply(self.r_unload, args) | def s_unload(self, *args): self.s_apply(self.r_unload, args) | 183a2f243768ffd15ff4324b317ba880da1094ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/183a2f243768ffd15ff4324b317ba880da1094ef/rexec.py |
raise SGMLParserError('neither < nor & ??') | raise SGMLParseError('neither < nor & ??') | def goahead(self, end): rawdata = self.rawdata i = 0 n = len(rawdata) while i < n: if self.nomoretags: self.handle_data(rawdata[i:n]) i = n break match = interesting.search(rawdata, i) if match: j = match.start(0) else: j = n if i < j: self.handle_data(rawdata[i:j]) i = j if i == n: break if rawdata[i] == '<': if start... | 74cde5bb3eea5187b199454ab275fe7cbb6e69b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/74cde5bb3eea5187b199454ab275fe7cbb6e69b6/sgmllib.py |
while True: | while 1: | def normalvariate(self, mu, sigma): """Normal distribution. | 42406e6f27e9a42e91db8706d897e0b478b13a4d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/42406e6f27e9a42e91db8706d897e0b478b13a4d/random.py |
while True: | while 1: | def vonmisesvariate(self, mu, kappa): """Circular data distribution. | 42406e6f27e9a42e91db8706d897e0b478b13a4d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/42406e6f27e9a42e91db8706d897e0b478b13a4d/random.py |
if not (u2 >= c * (2.0 - c) and u2 > c * _exp(1.0 - c)): | if u2 < c * (2.0 - c) or u2 <= c * _exp(1.0 - c): | def vonmisesvariate(self, mu, kappa): """Circular data distribution. | 42406e6f27e9a42e91db8706d897e0b478b13a4d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/42406e6f27e9a42e91db8706d897e0b478b13a4d/random.py |
while True: | while 1: | def gammavariate(self, alpha, beta): """Gamma distribution. Not the gamma function! | 42406e6f27e9a42e91db8706d897e0b478b13a4d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/42406e6f27e9a42e91db8706d897e0b478b13a4d/random.py |
while True: | while 1: | def gammavariate(self, alpha, beta): """Gamma distribution. Not the gamma function! | 42406e6f27e9a42e91db8706d897e0b478b13a4d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/42406e6f27e9a42e91db8706d897e0b478b13a4d/random.py |
x = pow(p, 1.0/alpha) | x = p ** (1.0/alpha) | def gammavariate(self, alpha, beta): """Gamma distribution. Not the gamma function! | 42406e6f27e9a42e91db8706d897e0b478b13a4d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/42406e6f27e9a42e91db8706d897e0b478b13a4d/random.py |
def gammavariate(self, alpha, beta): """Gamma distribution. Not the gamma function! | 42406e6f27e9a42e91db8706d897e0b478b13a4d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/42406e6f27e9a42e91db8706d897e0b478b13a4d/random.py | ||
if not (((p <= 1.0) and (u1 > _exp(-x))) or ((p > 1) and (u1 > pow(x, alpha - 1.0)))): | if p > 1.0: if u1 <= x ** (alpha - 1.0): break elif u1 <= _exp(-x): | def gammavariate(self, alpha, beta): """Gamma distribution. Not the gamma function! | 42406e6f27e9a42e91db8706d897e0b478b13a4d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/42406e6f27e9a42e91db8706d897e0b478b13a4d/random.py |
class _Environ(UserDict.UserDict): | class _Environ(UserDict.IterableUserDict): | def unsetenv(key): putenv(key, "") | ca2f537e32e806b02b20a8ad8c976810bfac754d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ca2f537e32e806b02b20a8ad8c976810bfac754d/os.py |
self.compiler = new_compiler (verbose=self.verbose, | self.compiler = new_compiler (compiler=self.compiler, verbose=self.verbose, | def run (self): | 6cd0c433665584abe33539945dbe6a0fbd98a195 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6cd0c433665584abe33539945dbe6a0fbd98a195/build_ext.py |
self.assertRaises( RuntimeError, winsound.PlaySound, 'SystemQuestion', winsound.SND_ALIAS | winsound.SND_NOSTOP ) | try: winsound.PlaySound( 'SystemQuestion', winsound.SND_ALIAS | winsound.SND_NOSTOP ) except RuntimeError: pass else: pass | def test_stopasync(self): winsound.PlaySound( 'SystemQuestion', winsound.SND_ALIAS | winsound.SND_ASYNC | winsound.SND_LOOP ) time.sleep(0.5) self.assertRaises( RuntimeError, winsound.PlaySound, 'SystemQuestion', winsound.SND_ALIAS | winsound.SND_NOSTOP ) winsound.PlaySound(None, winsound.SND_PURGE) | 8bcbe6aa7e1cc3447a5f572d29d0150b7e1145aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8bcbe6aa7e1cc3447a5f572d29d0150b7e1145aa/test_winsound.py |
if type(self.__optiondb) <> DictType: | if not isinstance(self.__optiondb, DictType): | def __init__(self, initfile): self.__initfile = initfile self.__colordb = None self.__optiondb = {} self.__views = [] self.__red = 0 self.__green = 0 self.__blue = 0 self.__canceled = 0 # read the initialization file fp = None if initfile: try: try: fp = open(initfile) self.__optiondb = marshal.load(fp) if type(self.__... | 531e3932bfa8aa5889c6f4d7fdef02bbbb39dcba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/531e3932bfa8aa5889c6f4d7fdef02bbbb39dcba/Switchboard.py |
if 0: def test_timeout(): test_support.requires('network') | def test_timeout(): test_support.requires('network') | def test_basic(): test_support.requires('network') import urllib socket.RAND_status() try: socket.RAND_egd(1) except TypeError: pass else: print "didn't raise TypeError" socket.RAND_add("this is a random string", 75.0) f = urllib.urlopen('https://sf.net') buf = f.read() f.close() | e0bb597d03bc97e1b201e27adb983aabf96e137b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e0bb597d03bc97e1b201e27adb983aabf96e137b/test_socket_ssl.py |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.settimeout(30.0) s.connect(("gmail.org", 995)) ss = socket.ssl(s) ss.read(1) ss.read(1) s.close() else: def test_timeout(): pass | if test_support.verbose: print "test_timeout ..." ADDR = "gmail.org", 995 s = socket.socket() s.settimeout(30.0) try: s.connect(ADDR) except socket.timeout: print >> sys.stderr, """\ WARNING: an attempt to connect to %r timed out, in test_timeout. That may be legitimate, but is not the outcome we hoped for. I... | def test_timeout(): test_support.requires('network') | e0bb597d03bc97e1b201e27adb983aabf96e137b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e0bb597d03bc97e1b201e27adb983aabf96e137b/test_socket_ssl.py |
return self | return iter(self.next, None) | def __iter__(self): return self | 93a696f49171c0593b23817bbf56ab44269a9587 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/93a696f49171c0593b23817bbf56ab44269a9587/mailbox.py |
return self | return iter(self.next, None) | def __iter__(self): return self | 93a696f49171c0593b23817bbf56ab44269a9587 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/93a696f49171c0593b23817bbf56ab44269a9587/mailbox.py |
return self | return iter(self.next, None) | def __iter__(self): return self | 93a696f49171c0593b23817bbf56ab44269a9587 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/93a696f49171c0593b23817bbf56ab44269a9587/mailbox.py |
Execution: --help Display this help then exit. --version Output version information then exit. -t,--trace Print the line to be executed to sys.stdout. -c,--count Count the number of times a line is executed. Results are written in the results file, if given. -r,--report Genera... | Meta-options: --help Display this help then exit. --version Output version information then exit. Otherwise, exactly one of the following three options must be given: -t, --trace Print each line to sys.stdout before it is executed. -c, --count Count the number of times ea... | def usage(outfile): outfile.write("""Usage: %s [OPTIONS] <file> [ARGS] | a30eacf45815c14b480972c5097677fac83ed4c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a30eacf45815c14b480972c5097677fac83ed4c0/trace.py |
def usage(outfile): outfile.write("""Usage: %s [OPTIONS] <file> [ARGS] | a30eacf45815c14b480972c5097677fac83ed4c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a30eacf45815c14b480972c5097677fac83ed4c0/trace.py | ||
def __init__(self, modules = None, dirs = None): self._mods = modules or [] self._dirs = dirs or [] | a30eacf45815c14b480972c5097677fac83ed4c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a30eacf45815c14b480972c5097677fac83ed4c0/trace.py | ||
def run(trace, cmd): import __main__ dict = __main__.__dict__ sys.settrace(trace) try: exec cmd in dict, dict finally: sys.settrace(None) def runctx(trace, cmd, globals=None, locals=None): if globals is None: globals = {} if locals is None: locals = {} sys.settrace(trace) try: exec cmd in dict, dict finally: sys.settr... | def run(trace, cmd): import __main__ dict = __main__.__dict__ sys.settrace(trace) try: exec cmd in dict, dict finally: sys.settrace(None) | a30eacf45815c14b480972c5097677fac83ed4c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a30eacf45815c14b480972c5097677fac83ed4c0/trace.py | |
def __init__(self, counts = {}, modules = {}): self.counts = counts.copy() self.modules = modules.copy() | def __init__(self, counts=None, calledfuncs=None, infile=None, outfile=None): self.counts = counts if self.counts is None: self.counts = {} self.counter = self.counts.copy() self.calledfuncs = calledfuncs if self.calledfuncs is None: self.calledfuncs = {} self.calledfuncs = self.calledfuncs.copy() self.infile = infile ... | def __init__(self, counts = {}, modules = {}): self.counts = counts.copy() # map (filename, lineno) to count self.modules = modules.copy() # map filenames to modules | a30eacf45815c14b480972c5097677fac83ed4c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a30eacf45815c14b480972c5097677fac83ed4c0/trace.py |
modules = self.modules other_modules = other.modules | other_calledfuncs = other.calledfuncs | def update(self, other): """Merge in the data from another CoverageResults""" counts = self.counts other_counts = other.counts modules = self.modules other_modules = other.modules | a30eacf45815c14b480972c5097677fac83ed4c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a30eacf45815c14b480972c5097677fac83ed4c0/trace.py |
counts[key] = counts.get(key, 0) + other_counts[key] for key in other_modules.keys(): if modules.has_key(key): assert modules[key] == other_modules[key], \ "Strange! filename %s has two different module " \ "names: %s and %s" % \ (key, modules[key], other_modules[key]) | if key != 'calledfuncs': counts[key] = counts.get(key, 0) + other_counts[key] for key in other_calledfuncs.keys(): calledfuncs[key] = 1 def write_results(self, show_missing = 1, summary = 0, coverdir = None): """ @param coverdir """ for (filename, modulename, funcname,) in self.calledfuncs.keys(): print "filename: %s... | def update(self, other): """Merge in the data from another CoverageResults""" counts = self.counts other_counts = other.counts modules = self.modules other_modules = other.modules | a30eacf45815c14b480972c5097677fac83ed4c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a30eacf45815c14b480972c5097677fac83ed4c0/trace.py |
modules[key] = other_modules[key] | thiscoverdir = os.path.dirname(os.path.abspath(filename)) tx = None try: os.makedirs(thiscoverdir) except OSError, x: tx = x if not os.path.isdir(thiscoverdir): if tx: raise tx raise exceptions.IOError, "unknown error prevented creation of directory: %s" % thiscoverdir if "." in modulename: finalname = modulen... | def update(self, other): """Merge in the data from another CoverageResults""" counts = self.counts other_counts = other.counts modules = self.modules other_modules = other.modules | a30eacf45815c14b480972c5097677fac83ed4c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a30eacf45815c14b480972c5097677fac83ed4c0/trace.py |
def create_results_log(results, dirname = ".", show_missing = 1, save_counts = 0, summary = 0, coverdir = None): import re per_file = {} for filename, lineno in results.counts.keys(): lines_hit = per_file[filename] = per_file.get(filename, {}) lines_hit[lineno] = results.counts[(filename, lineno)] try: counts = mar... | class Trace: def __init__(self, count=1, trace=1, countfuncs=0, ignoremods=(), ignoredirs=(), infile=None, outfile=None): """ @param count true iff it should count number of times each line is executed @param trace true iff it should print out each line that is being counted @param countfuncs true iff it should just ou... | def create_results_log(results, dirname = ".", show_missing = 1, save_counts = 0, summary = 0, coverdir = None): import re # turn the counts data ("(filename, lineno) = count") into something # accessible on a per-file basis per_file = {} for filename, lineno in results.counts.keys(): lines_hit = per_file[filename] = p... | a30eacf45815c14b480972c5097677fac83ed4c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a30eacf45815c14b480972c5097677fac83ed4c0/trace.py |
fndir = os.path.dirname(filename) if os.path.isabs(filename): coverpath = fndir | self.donothing = 1 def run(self, cmd): import __main__ dict = __main__.__dict__ if not self.donothing: sys.settrace(self.globaltrace) try: exec cmd in dict, dict finally: if not self.donothing: sys.settrace(None) def runctx(self, cmd, globals=None, locals=None): if globals is None: globals = {} if locals is None: lo... | def create_results_log(results, dirname = ".", show_missing = 1, save_counts = 0, summary = 0, coverdir = None): import re # turn the counts data ("(filename, lineno) = count") into something # accessible on a per-file basis per_file = {} for filename, lineno in results.counts.keys(): lines_hit = per_file[filename] = p... | a30eacf45815c14b480972c5097677fac83ed4c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a30eacf45815c14b480972c5097677fac83ed4c0/trace.py |
coverpath = os.path.join(dirname, fndir) if "." in modulename: finalname = modulename.split(".")[-1] listfilename = os.path.join(coverpath, finalname + ".cover") | modulename = None self._calledfuncs[(filename, modulename, funcname,)] = 1 def globaltrace_lt(self, frame, why, arg): """ Handles `call' events (why == 'call') and if the code block being entered is to be ignored then it returns `None', else it returns `self.localtrace'. """ if why == 'call': (filename, lineno, funcna... | def create_results_log(results, dirname = ".", show_missing = 1, save_counts = 0, summary = 0, coverdir = None): import re # turn the counts data ("(filename, lineno) = count") into something # accessible on a per-file basis per_file = {} for filename, lineno in results.counts.keys(): lines_hit = per_file[filename] = p... | a30eacf45815c14b480972c5097677fac83ed4c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a30eacf45815c14b480972c5097677fac83ed4c0/trace.py |
listfilename = os.path.join(coverpath, modulename + ".cover") try: lines = open(filename, 'r').readlines() except IOError, err: print >> sys.stderr, "trace: Could not open %s for reading " \ "because: %s - skipping" % (`filename`, err) continue try: outfile = open(listfilename, 'w') except IOError, err: sys.stderr.w... | return None def localtrace_trace_and_count(self, frame, why, arg): if why == 'line': (filename, lineno, funcname, context, lineindex,) = inspect.getframeinfo(frame, 1) key = (filename, lineno,) self.counts[key] = self.counts.get(key, 0) + 1 bname = self.pathtobasename.get(filename) if bname is None: bname = self.... | def create_results_log(results, dirname = ".", show_missing = 1, save_counts = 0, summary = 0, coverdir = None): import re # turn the counts data ("(filename, lineno) = count") into something # accessible on a per-file basis per_file = {} for filename, lineno in results.counts.keys(): lines_hit = per_file[filename] = p... | a30eacf45815c14b480972c5097677fac83ed4c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a30eacf45815c14b480972c5097677fac83ed4c0/trace.py |
marshal.dump(results.counts, open(os.path.join(dirname, "counts"), "w")) marshal.dump(results.modules, open(os.path.join(dirname, "modules"), "w")) except IOError, err: sys.stderr.write("cannot save counts/modules " \ "files because %s" % err) if summary and sums: mods = sums.keys() mods.sort() print "lines cov% m... | print "%s(%d): %s" % (bname, lineno, context[lineindex],), except IndexError: pass return self.localtrace def localtrace_trace(self, frame, why, arg): | def create_results_log(results, dirname = ".", show_missing = 1, save_counts = 0, summary = 0, coverdir = None): import re # turn the counts data ("(filename, lineno) = count") into something # accessible on a per-file basis per_file = {} for filename, lineno in results.counts.keys(): lines_hit = per_file[filename] = p... | a30eacf45815c14b480972c5097677fac83ed4c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a30eacf45815c14b480972c5097677fac83ed4c0/trace.py |
filename = frame.f_globals.get("__file__", None) if filename is None: filename = frame.f_code.co_filename | (filename, lineno, funcname, context, lineindex,) = inspect.getframeinfo(frame) bname = self.pathtobasename.get(filename) if bname is None: bname = self.pathtobasename.setdefault(filename, os.path.basename(filename)) | def trace(self, frame, why, arg): if why == 'line': # something is fishy about getting the file name filename = frame.f_globals.get("__file__", None) if filename is None: filename = frame.f_code.co_filename try: modulename = frame.f_globals["__name__"] except KeyError: # PyRun_String() for example # XXX what to do? mod... | a30eacf45815c14b480972c5097677fac83ed4c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a30eacf45815c14b480972c5097677fac83ed4c0/trace.py |
modulename = frame.f_globals["__name__"] except KeyError: modulename = None ignore_it = self.ignore_names.get(modulename, -1) if ignore_it == -1: sys.settrace(None) ignore_it = self.ignore.names(filename, modulename) sys.settrace(self.trace) self.modules[filename] = modulename if not ignore_it: lineno = frame.f... | print "%s(%d): %s" % (bname, lineno, context[lineindex],), except IndexError: pass return self.localtrace def localtrace_count(self, frame, why, arg): if why == 'line': (filename, lineno, funcname, context, lineindex,) = inspect.getframeinfo(frame) key = (filename, lineno,) self.counts[key] = self.counts.get(key, ... | def trace(self, frame, why, arg): if why == 'line': # something is fishy about getting the file name filename = frame.f_globals.get("__file__", None) if filename is None: filename = frame.f_code.co_filename try: modulename = frame.f_globals["__name__"] except KeyError: # PyRun_String() for example # XXX what to do? mod... | a30eacf45815c14b480972c5097677fac83ed4c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a30eacf45815c14b480972c5097677fac83ed4c0/trace.py |
return CoverageResults(self.counts, self.modules) class Trace: def __init__(self, ignore = Ignore()): self.ignore = ignore self.ignore_names = ignore._ignore self.files = {'<string>': None} def trace(self, frame, why, arg): if why == 'line': filename = frame.f_code.co_filename try: modulename = frame.f_globals["__n... | return CoverageResults(self.counts, infile=self.infile, outfile=self.outfile, calledfuncs=self._calledfuncs) | def results(self): return CoverageResults(self.counts, self.modules) | a30eacf45815c14b480972c5097677fac83ed4c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a30eacf45815c14b480972c5097677fac83ed4c0/trace.py |
print >> sys.stderr, "%s: %s" % (sys.argv[0], msg) | sys.stderr.write("%s: %s\n" % (sys.argv[0], msg)) | def _err_exit(msg): print >> sys.stderr, "%s: %s" % (sys.argv[0], msg) sys.exit(1) | a30eacf45815c14b480972c5097677fac83ed4c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a30eacf45815c14b480972c5097677fac83ed4c0/trace.py |
def main(argv = None): | def main(argv=None): | def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir=", "coverdir="]) except getopt.error, msg: print >> sys.stderr,... | a30eacf45815c14b480972c5097677fac83ed4c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a30eacf45815c14b480972c5097677fac83ed4c0/trace.py |
opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:", | opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:l", | def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir=", "coverdir="]) except getopt.error, msg: print >> sys.stderr,... | a30eacf45815c14b480972c5097677fac83ed4c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a30eacf45815c14b480972c5097677fac83ed4c0/trace.py |
"file=", "logdir=", "missing", | "file=", "missing", | def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir=", "coverdir="]) except getopt.error, msg: print >> sys.stderr,... | a30eacf45815c14b480972c5097677fac83ed4c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a30eacf45815c14b480972c5097677fac83ed4c0/trace.py |
"coverdir="]) | "coverdir=", "listfuncs",]) | def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir=", "coverdir="]) except getopt.error, msg: print >> sys.stderr,... | a30eacf45815c14b480972c5097677fac83ed4c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a30eacf45815c14b480972c5097677fac83ed4c0/trace.py |
print >> sys.stderr, "%s: %s" % (sys.argv[0], msg) print >> sys.stderr, "Try `%s --help' for more information" \ % sys.argv[0] | sys.stderr.write("%s: %s\n" % (sys.argv[0], msg)) sys.stderr.write("Try `%s --help' for more information\n" % sys.argv[0]) | def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir=", "coverdir="]) except getopt.error, msg: print >> sys.stderr,... | a30eacf45815c14b480972c5097677fac83ed4c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a30eacf45815c14b480972c5097677fac83ed4c0/trace.py |
logdir = "." | def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir=", "coverdir="]) except getopt.error, msg: print >> sys.stderr,... | a30eacf45815c14b480972c5097677fac83ed4c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a30eacf45815c14b480972c5097677fac83ed4c0/trace.py | |
continue if opt == "-d" or opt == "--logdir": logdir = val | def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir=", "coverdir="]) except getopt.error, msg: print >> sys.stderr,... | a30eacf45815c14b480972c5097677fac83ed4c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a30eacf45815c14b480972c5097677fac83ed4c0/trace.py | |
if len(prog_argv) == 0: _err_exit("missing name of file to run") if count + trace + report > 1: _err_exit("can only specify one of --trace, --count or --report") if count + trace + report == 0: _err_exit("must specify one of --trace, --count or --report") if report and counts_file is None: _err_exit("--report requir... | if listfuncs and (count or trace): _err_exit("cannot specify both --listfuncs and (--trace or --count)") if not count and not trace and not report and not listfuncs: _err_exit("must specify one of --trace, --count, --report or --listfuncs") | def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir=", "coverdir="]) except getopt.error, msg: print >> sys.stderr,... | a30eacf45815c14b480972c5097677fac83ed4c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a30eacf45815c14b480972c5097677fac83ed4c0/trace.py |
if logdir is not None: if not os.path.isdir(logdir): sys.stderr.write( "trace: WARNING, --logdir directory %s is not available\n" % `logdir`) sys.argv = prog_argv progname = prog_argv[0] if eval(sys.version[:3])>1.3: sys.path[0] = os.path.split(progname)[0] | if report and not counts_file: _err_exit("--report requires a --file") if no_report and len(prog_argv) == 0: _err_exit("missing name of file to run") | def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir=", "coverdir="]) except getopt.error, msg: print >> sys.stderr,... | a30eacf45815c14b480972c5097677fac83ed4c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a30eacf45815c14b480972c5097677fac83ed4c0/trace.py |
ignore = Ignore(ignore_modules, ignore_dirs) if trace: t = Trace(ignore) | if report: results = CoverageResults(infile=counts_file, outfile=counts_file) results.write_results(missing, summary=summary, coverdir=coverdir) else: sys.argv = prog_argv progname = prog_argv[0] if eval(sys.version[:3])>1.3: sys.path[0] = os.path.split(progname)[0] t = Trace(count, trace, countfuncs=listfuncs, ignore... | def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir=", "coverdir="]) except getopt.error, msg: print >> sys.stderr,... | a30eacf45815c14b480972c5097677fac83ed4c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a30eacf45815c14b480972c5097677fac83ed4c0/trace.py |
run(t.trace, 'execfile(' + `progname` + ')') | t.run('execfile(' + `progname` + ')') | def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir=", "coverdir="]) except getopt.error, msg: print >> sys.stderr,... | a30eacf45815c14b480972c5097677fac83ed4c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a30eacf45815c14b480972c5097677fac83ed4c0/trace.py |
_err_exit("Cannot run file %s because: %s" % \ (`sys.argv[0]`, err)) elif count: t = Coverage(ignore) try: run(t.trace, 'execfile(' + `progname` + ')') except IOError, err: _err_exit("Cannot run file %s because: %s" % \ (`sys.argv[0]`, err)) | _err_exit("Cannot run file %s because: %s" % (`sys.argv[0]`, err)) | def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir=", "coverdir="]) except getopt.error, msg: print >> sys.stderr,... | a30eacf45815c14b480972c5097677fac83ed4c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a30eacf45815c14b480972c5097677fac83ed4c0/trace.py |
results.modules[progname] = os.path.splitext(progname)[0] if counts_file: try: old_counts, old_modules = marshal.load(open(counts_file, 'rb')) except IOError: pass else: results.update(CoverageResults(old_counts, old_modules)) | def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir=", "coverdir="]) except getopt.error, msg: print >> sys.stderr,... | a30eacf45815c14b480972c5097677fac83ed4c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a30eacf45815c14b480972c5097677fac83ed4c0/trace.py | |
create_results_log(results, logdir, missing, summary=summary, coverdir=coverdir) if counts_file: try: marshal.dump( (results.counts, results.modules), open(counts_file, 'wb')) except IOError, err: _err_exit("Cannot save counts file %s because: %s" % \ (`counts_file`, err)) elif report: old_counts, old_modules = marsh... | results.write_results(missing, summary=summary, coverdir=coverdir) | def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir=", "coverdir="]) except getopt.error, msg: print >> sys.stderr,... | a30eacf45815c14b480972c5097677fac83ed4c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a30eacf45815c14b480972c5097677fac83ed4c0/trace.py |
exts.append( Extension('gestalt', ['gestaltmodule.c']) ) | exts.append( Extension('gestalt', ['gestaltmodule.c'], extra_link_args=['-framework', 'Carbon']) ) | def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | 0c46c0cc70613c34862513a2c8d679128146e90e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0c46c0cc70613c34862513a2c8d679128146e90e/setup.py |
exts.append( Extension('_CF', ['cf/_CFmodule.c']) ) exts.append( Extension('_Res', ['res/_Resmodule.c']) ) | exts.append( Extension('_CF', ['cf/_CFmodule.c'], extra_link_args=['-framework', 'CoreFoundation']) ) exts.append( Extension('_Res', ['res/_Resmodule.c'], extra_link_args=['-framework', 'Carbon']) ) | def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | 0c46c0cc70613c34862513a2c8d679128146e90e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0c46c0cc70613c34862513a2c8d679128146e90e/setup.py |
if (type(args) is not TupleType): | if type(args) is not TupleType and args is not None: | def dump_special(self, callable, args, state = None): | d1f4984a9bb2e90d4fc473be1a169917277efa4d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d1f4984a9bb2e90d4fc473be1a169917277efa4d/pickle.py |
if (type(arg_tup) is not TupleType): | if type(arg_tup) is not TupleType and arg_tup is not None: | def save(self, object, pers_save = 0): memo = self.memo | d1f4984a9bb2e90d4fc473be1a169917277efa4d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d1f4984a9bb2e90d4fc473be1a169917277efa4d/pickle.py |
if (type(callable) is not ClassType): if (not safe_constructors.has_key(callable)): | if type(callable) is not ClassType: if not safe_constructors.has_key(callable): | def load_reduce(self): stack = self.stack | d1f4984a9bb2e90d4fc473be1a169917277efa4d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d1f4984a9bb2e90d4fc473be1a169917277efa4d/pickle.py |
value = apply(callable, arg_tup) | if arg_tup is None: value = callable.__basicnew__() else: value = apply(callable, arg_tup) | def load_reduce(self): stack = self.stack | d1f4984a9bb2e90d4fc473be1a169917277efa4d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d1f4984a9bb2e90d4fc473be1a169917277efa4d/pickle.py |
if timeout is None: waiter.acquire() if __debug__: self._note("%s.wait(): got it", self) else: endtime = _time() + timeout delay = 0.000001 while 1: gotit = waiter.acquire(0) if gotit or _time() >= endtime: break _sleep(delay) if delay < 1.0: delay = delay * 2.0 if not gotit: | try: if timeout is None: waiter.acquire() | def wait(self, timeout=None): me = currentThread() assert self._is_owned(), "wait() of un-acquire()d lock" waiter = _allocate_lock() waiter.acquire() self.__waiters.append(waiter) saved_state = self._release_save() if timeout is None: waiter.acquire() if __debug__: self._note("%s.wait(): got it", self) else: endtime = ... | c951bf91283996587246328c49e4b1909883db8c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c951bf91283996587246328c49e4b1909883db8c/threading.py |
self._note("%s.wait(%s): timed out", self, timeout) try: self.__waiters.remove(waiter) except ValueError: pass | self._note("%s.wait(): got it", self) | def wait(self, timeout=None): me = currentThread() assert self._is_owned(), "wait() of un-acquire()d lock" waiter = _allocate_lock() waiter.acquire() self.__waiters.append(waiter) saved_state = self._release_save() if timeout is None: waiter.acquire() if __debug__: self._note("%s.wait(): got it", self) else: endtime = ... | c951bf91283996587246328c49e4b1909883db8c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c951bf91283996587246328c49e4b1909883db8c/threading.py |
if __debug__: self._note("%s.wait(%s): got it", self, timeout) self._acquire_restore(saved_state) | endtime = _time() + timeout delay = 0.000001 while 1: gotit = waiter.acquire(0) if gotit or _time() >= endtime: break _sleep(delay) if delay < 1.0: delay = delay * 2.0 if not gotit: if __debug__: self._note("%s.wait(%s): timed out", self, timeout) try: self.__waiters.remove(waiter) except ValueError: pass else: if __de... | def wait(self, timeout=None): me = currentThread() assert self._is_owned(), "wait() of un-acquire()d lock" waiter = _allocate_lock() waiter.acquire() self.__waiters.append(waiter) saved_state = self._release_save() if timeout is None: waiter.acquire() if __debug__: self._note("%s.wait(): got it", self) else: endtime = ... | c951bf91283996587246328c49e4b1909883db8c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c951bf91283996587246328c49e4b1909883db8c/threading.py |
def checkit(source, opts, morecmds=[]): """Check the LaTeX formatting in a sequence of lines. Opts is a mapping of options to option values if any: -m munge parenthesis and brackets -f forward slash warnings to be skipped -d delimiters only checking -v verbose listing on delimiters ... | 4f0c6b2b70125b55ae41b0f85ee2ea006c81fb98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4f0c6b2b70125b55ae41b0f85ee2ea006c81fb98/texcheck.py | ||
print 'Done checking %d lines.' % (lineno,) | print 'Done checking %d lines.' % (lastline,) | def checkit(source, opts, morecmds=[]): """Check the LaTeX formatting in a sequence of lines. Opts is a mapping of options to option values if any: -m munge parenthesis and brackets -f forward slash warnings to be skipped -d delimiters only checking -v verbose listing on delimiters ... | 4f0c6b2b70125b55ae41b0f85ee2ea006c81fb98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4f0c6b2b70125b55ae41b0f85ee2ea006c81fb98/texcheck.py |
self.transient(parent) | if parent.winfo_viewable(): self.transient(parent) | def __init__(self, parent, title = None): | ce9212f018fbd074aba7a37cef4291ebd2e428d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ce9212f018fbd074aba7a37cef4291ebd2e428d4/tkSimpleDialog.py |
print 'setcmapinfo:', stuff | def setcmapinfo(self): stuff = 0, 0, 0, 0, 0 if self.format in ('rgb8', 'grey'): stuff = 8, 0, 0, 0, 0 if self.format == 'grey4': stuff = 4, 0, 0, 0, 0 if self.format == 'grey2': stuff = 2, 0, 0, 0, 0 if self.format == 'mono': stuff = 1, 0, 0, 0, 0 print 'setcmapinfo:', stuff self.c0bits, self.c1bits, self.c2bits, \ se... | 2d413788cae12576adb965f9b2b5d379b509481c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2d413788cae12576adb965f9b2b5d379b509481c/VFile.py | |
container.set_payload(msg) | container.attach(msg) | def _parsebody(self, container, fp): # Parse the body, but first split the payload on the content-type # boundary if present. boundary = container.get_boundary() isdigest = (container.get_type() == 'multipart/digest') # If there's a boundary, split the payload text into its constituent # parts and parse each separately... | 69e18af96868cfd1f41bedc4eb494408c9c363f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/69e18af96868cfd1f41bedc4eb494408c9c363f5/Parser.py |
def __init__(self, name, mode=RTLD_LOCAL, handle=None): | def __init__(self, name, mode=DEFAULT_MODE, handle=None): | def __init__(self, name, mode=RTLD_LOCAL, handle=None): self._name = name if handle is None: self._handle = _dlopen(self._name, mode) else: self._handle = handle | 47d7a069d19fd117d5fc042748536e6cea80bc70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/47d7a069d19fd117d5fc042748536e6cea80bc70/__init__.py |
os.kill(pid, signal.SIGALARM) | os.kill(pid, signal.SIGALRM) print >> sys.__stdout__, " child sent SIGALRM to", pid | def force_test_exit(): # Sigh, both imports seem necessary to avoid errors. import os fork_pid = os.fork() if fork_pid == 0: # In child import os, time try: # Wait 5 seconds longer than the expected alarm to give enough # time for the normal sequence of events to occur. This is # just a stop-gap to prevent the test fr... | 8b8c59cf1db86682fdc48791a0fcfa997d36eb06 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b8c59cf1db86682fdc48791a0fcfa997d36eb06/test_signal.py |
_platform_cache = None _platform_aliased_cache = None | _platform_cache = {True:None, False:None} _platform_aliased_cache = {True:None, False:None} | def python_compiler(): """ Returns a string identifying the compiler used for compiling Python. """ return _sys_version()[3] | 21beb4c2ceb5238a6a3ab83156db55f678ed01ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/21beb4c2ceb5238a6a3ab83156db55f678ed01ec/platform.py |
if not aliased and (_platform_cache is not None): return _platform_cache elif _platform_aliased_cache is not None: return _platform_aliased_cache | if not aliased and (_platform_cache[bool(terse)] is not None): return _platform_cache[bool(terse)] elif _platform_aliased_cache[bool(terse)] is not None: return _platform_aliased_cache[bool(terse)] | def platform(aliased=0, terse=0): """ Returns a single string identifying the underlying platform with as much useful information as possible (but no more :). The output is intended to be human readable rather than machine parseable. It may look different on different platforms and this is intended. If "aliased" is ... | 21beb4c2ceb5238a6a3ab83156db55f678ed01ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/21beb4c2ceb5238a6a3ab83156db55f678ed01ec/platform.py |
_platform_aliased_cache = platform | _platform_aliased_cache[bool(terse)] = platform | def platform(aliased=0, terse=0): """ Returns a single string identifying the underlying platform with as much useful information as possible (but no more :). The output is intended to be human readable rather than machine parseable. It may look different on different platforms and this is intended. If "aliased" is ... | 21beb4c2ceb5238a6a3ab83156db55f678ed01ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/21beb4c2ceb5238a6a3ab83156db55f678ed01ec/platform.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.