rem
stringlengths
2
226k
add
stringlengths
0
227k
context
stringlengths
8
228k
meta
stringlengths
156
215
input_ids
list
attention_mask
list
labels
list
if name[:1] == '{' and name[-1:] == '}':
if name.startswith('{') and name.endswith('}'):
def expandvars(path): """Expand shell variables of form $var and ${var}. Unknown variables are left unchanged.""" global _varprog if '$' not in path: return path if not _varprog: import re _varprog = re.compile(r'\$(\w+|\{[^}]*\})') i = 0 while True: m = _varprog.search(path, i) if not m: break i, j = m.span(0) name = m.group(1) if name[:1] == '{' and name[-1:] == '}': name = name[1:-1] if name in os.environ: tail = path[j:] path = path[:i] + os.environ[name] i = len(path) path = path + tail else: i = j return path
77cdeaff556447a980fe8632e8cd010499ade2d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/77cdeaff556447a980fe8632e8cd010499ade2d0/posixpath.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4542, 4699, 12, 803, 4672, 3536, 12271, 5972, 3152, 434, 646, 271, 1401, 471, 3531, 1401, 5496, 225, 9077, 3152, 854, 2002, 14827, 12123, 2552, 389, 1401, 14654, 309, 11874, 486, 316, 589,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4542, 4699, 12, 803, 4672, 3536, 12271, 5972, 3152, 434, 646, 271, 1401, 471, 3531, 1401, 5496, 225, 9077, 3152, 854, 2002, 14827, 12123, 2552, 389, 1401, 14654, 309, 11874, 486, 316, 589,...
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 log of what happened.""" msgs = [] if self._dict.has_key('Pre-install-command'): msg.append("%s: Pre-install-command ignored" % self.fullname()) if self._dict.has_key('Install-command'): msgs.append("%s: Install-command ignored" % self.fullname()) if self._dict.has_key('Post-install-command'): msgs.append("%s: Post-install-command ignored" % self.fullname()) self.beforeInstall() 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 prefixmod = '-C /' cmd = cmd % self.archiveFilename if self._cmd(output, self._db.preferences.buildDir, cmd, prefixmod): return "unpack command failed" self.afterInstall() 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 class PimpPackage_source(PimpPackage): def unpackPackageOnly(self, output=None): """Unpack a source package and check that setup.py exists""" PimpPackage.unpackPackageOnly(self, output) self._buildDirname = os.path.join(self._db.preferences.buildDir, basename) 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): """Install a single source package. If output is given it should be a file-like object and it will receive a log of what happened.""" 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']) self.beforeInstall() installcmd = self._dict.get('Install-command') if not installcmd: installcmd = '"%s" setup.py install' % sys.executable if self._cmd(output, self._buildDirname, installcmd): return "install %s: running \"%s\" failed" % self.fullname() self.afterInstall() 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(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(): if not line: continue if line[0] == '#': continue if line[:6] == 'import': exec line continue if line[-1] == '\n': line = line[:-1] if not os.path.isabs(line): line = os.path.join(self._db.preferences.installDir, line) line = os.path.realpath(line) if not line in sys.path: sys.path.append(line)
1454510be1ca7c85b6cc8abbb1bcc7d7ead6adf6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/1454510be1ca7c85b6cc8abbb1bcc7d7ead6adf6/pimp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 24713, 52, 451, 2697, 12, 2890, 16, 1592, 67, 3980, 16, 394, 67, 3980, 4672, 3536, 15369, 1281, 394, 263, 2397, 1390, 716, 1240, 7226, 2258, 1839, 3799, 310, 8395, 364, 2295, 316, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 24713, 52, 451, 2697, 12, 2890, 16, 1592, 67, 3980, 16, 394, 67, 3980, 4672, 3536, 15369, 1281, 394, 263, 2397, 1390, 716, 1240, 7226, 2258, 1839, 3799, 310, 8395, 364, 2295, 316, ...
def copyFile(source, target): assertMessage(os.path.isfile(source), "failed to find file: " + source) print source, "->", target shutil.copy2(source, target)
import sys, re, string, os
def copyFile(source, target): assertMessage(os.path.isfile(source), "failed to find file: " + source) print source, "->", target shutil.copy2(source, target)
eae32ce680b5f9da9be171e86f095dfbb0f933ac /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7101/eae32ce680b5f9da9be171e86f095dfbb0f933ac/install.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1930, 2589, 16, 283, 16, 533, 16, 1140, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1930, 2589, 16, 283, 16, 533, 16, 1140, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if time.daylight: utc_in_secs = time.mktime(timetuple) - time.altzone
if dst_in_effect: utc_in_secs = time.mktime(timetuple) - time.altzone
def stringtotime(timestring): """Return time in seconds from w3 timestring If there is an error parsing the string, or it doesn't look like a w3 datetime string, return None. """ try: date, daytime = timestring[:19].split("T") year, month, day = map(int, date.split("-")) hour, minute, second = map(int, daytime.split(":")) assert 1900 < year < 2100, year assert 1 <= month <= 12 assert 1 <= day <= 31 assert 0 <= hour <= 23 assert 0 <= minute <= 59 assert 0 <= second <= 61 # leap seconds timetuple = (year, month, day, hour, minute, second, -1, -1, -1) if time.daylight: utc_in_secs = time.mktime(timetuple) - time.altzone else: utc_in_secs = time.mktime(timetuple) - time.timezone return long(utc_in_secs) + tzdtoseconds(timestring[19:]) except (TypeError, ValueError, AssertionError): return None
8b39890779e75a3bd728c2feb98022450b8adc44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/8b39890779e75a3bd728c2feb98022450b8adc44/Time.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 533, 12133, 12, 8293, 371, 4672, 3536, 990, 813, 316, 3974, 628, 341, 23, 4124, 371, 225, 971, 1915, 353, 392, 555, 5811, 326, 533, 16, 578, 518, 3302, 1404, 2324, 3007, 279, 341, 23, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 533, 12133, 12, 8293, 371, 4672, 3536, 990, 813, 316, 3974, 628, 341, 23, 4124, 371, 225, 971, 1915, 353, 392, 555, 5811, 326, 533, 16, 578, 518, 3302, 1404, 2324, 3007, 279, 341, 23, ...
self.lasttime=0.0
self.lasttime=-1000
def __init__(self): print "init1INITNITNITNTINTINTINTINTITNINTINTINTINTINT\nININTINTINTITNITNITNTINTINTINTINTITNITNITNITNITNITNITNITNITNIT" VS.SetDifficulty(.9) Director.Mission.__init__(self) self.lasttime=0.0 self.waittime=10.0 print "init"
51d0cc42b3afc8db952b1e989680bf85a0ddb40a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/51d0cc42b3afc8db952b1e989680bf85a0ddb40a/total_war.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 1172, 315, 2738, 21, 12919, 50, 1285, 50, 1285, 1784, 3217, 3217, 3217, 3217, 1285, 50, 3217, 3217, 3217, 3217, 3217, 64, 82, 706, 3217, 3217, 3217, 1285...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 1172, 315, 2738, 21, 12919, 50, 1285, 50, 1285, 1784, 3217, 3217, 3217, 3217, 1285, 50, 3217, 3217, 3217, 3217, 3217, 64, 82, 706, 3217, 3217, 3217, 1285...
result += " <a class='tooltip' href='
result += " <a class='tooltip' href='
def getHTMLTOC(rootCategory): result = "<div id='toc'>\n" result += "<h2>Contents</h2>\n" result += "<div class='tabber'>\n" for mainSceneryCategory in rootCategory.childSceneryCategories: result += "<div class='tabberTab'>\n" result += "<h3>" + mainSceneryCategory.title + "</h3>\n" if len(mainSceneryCategory.childSceneryCategories) > 0: for subSceneryCategory in mainSceneryCategory.childSceneryCategories: result += "<h4><a href='" + subSceneryCategory.url + "'>" + subSceneryCategory.title + "</a></h4>\n" result += "<ul class='inline'>\n" if len(subSceneryCategory.childSceneryCategories) > 0: # We have another level of categorisation, show a category list where each link takes the user to a # landing page for that category for subsubSceneryCategory in subSceneryCategory.childSceneryCategories: result += "<li><a href='" + subsubSceneryCategory.url + "'>" + subsubSceneryCategory.title + "</a>" result += " <a class='tooltip' href='#'><img class='attributeicon' src='doc/variations.gif'><span>Multiple variants available</span></a>" result += "</li>\n" # Also show the list of objects directly in this category sceneryObjects = subSceneryCategory.getSceneryObjects(0) result += getHTMLSceneryObjects(sceneryObjects) else: # No more category levels, show the list of objects sceneryObjects = subSceneryCategory.getSceneryObjects(1) result += getHTMLSceneryObjects(sceneryObjects) result += "</ul>\n" else: # No categorisation, show the list of objects result += "<ul class='inline'>\n" sceneryObjects = mainSceneryCategory.getSceneryObjects(1) result += getHTMLSceneryObjects(sceneryObjects) result += "</ul>\n" result += "</div>\n" result += "</div>\n" result += "</div>\n" return result
078e0be4deaaf2aa2d52a3d9771c07110719bb9b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5176/078e0be4deaaf2aa2d52a3d9771c07110719bb9b/functions.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 4870, 4296, 39, 12, 3085, 4457, 4672, 563, 273, 3532, 2892, 612, 2218, 1391, 11, 5333, 82, 6, 563, 1011, 3532, 76, 22, 34, 6323, 1757, 76, 22, 5333, 82, 6, 563, 1011, 3532, 2892...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 4870, 4296, 39, 12, 3085, 4457, 4672, 563, 273, 3532, 2892, 612, 2218, 1391, 11, 5333, 82, 6, 563, 1011, 3532, 76, 22, 34, 6323, 1757, 76, 22, 5333, 82, 6, 563, 1011, 3532, 2892...
wrapper.write("
def buildStubs(): global py_types global py_return_types global unknown_types try: f = open("libxml2-api.xml") data = f.read() (parser, target) = getparser() parser.feed(data) parser.close() except IOError, msg: try: f = open("../doc/libxml2-api.xml") data = f.read() (parser, target) = getparser() parser.feed(data) parser.close() except IOError, msg: print file, ":", msg sys.exit(1) n = len(functions.keys()) print "Found %d functions in libxml2-api.xml" % (n) py_types['pythonObject'] = ('O', "pythonObject", "pythonObject", "pythonObject") try: f = open("libxml2-python-api.xml") data = f.read() (parser, target) = getparser() parser.feed(data) parser.close() except IOError, msg: print file, ":", msg print "Found %d functions in libxml2-python-api.xml" % ( len(functions.keys()) - n) nb_wrap = 0 failed = 0 skipped = 0 include = open("libxml2-py.h", "w") include.write("/* Generated */\n\n") export = open("libxml2-export.c", "w") export.write("/* Generated */\n\n") wrapper = open("libxml2-py.c", "w") wrapper.write("/* Generated */\n\n") wrapper.write("#include <Python.h>\n")
f7eb794c142e31ca895f2d7743f872a809e514ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12659/f7eb794c142e31ca895f2d7743f872a809e514ab/generator.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1361, 11974, 87, 13332, 2552, 2395, 67, 2352, 2552, 2395, 67, 2463, 67, 2352, 2552, 5917, 67, 2352, 225, 775, 30, 284, 273, 1696, 2932, 2941, 2902, 22, 17, 2425, 18, 2902, 7923, 501, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1361, 11974, 87, 13332, 2552, 2395, 67, 2352, 2552, 2395, 67, 2463, 67, 2352, 2552, 5917, 67, 2352, 225, 775, 30, 284, 273, 1696, 2932, 2941, 2902, 22, 17, 2425, 18, 2902, 7923, 501, 2...
Link ('http://www.www.ahsodit.com/', "Matt 'Crazy' Parsons",),
Link ('http://www.ahsodit.com/', "Matt 'Crazy' Parsons",),
def __init__ (self, url, label=None, text=None, logo=None):
3ab655a9e057286d31e795cdacbd12f8ad83996e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4747/3ab655a9e057286d31e795cdacbd12f8ad83996e/links.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 261, 2890, 16, 880, 16, 1433, 33, 7036, 16, 977, 33, 7036, 16, 19128, 33, 7036, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 261, 2890, 16, 880, 16, 1433, 33, 7036, 16, 977, 33, 7036, 16, 19128, 33, 7036, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
'''
"""
def handleListCGIValue(value): ''' Value is either a single item or a list of items. Each item has a .value that we're actually interested in. ''' if isinstance(value, type([])): return [value.value for value in value] else: value = value.value.strip() if not value: return [] return value.split(',')
16a3ebf380b95607b344181655488d818a27791f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1906/16a3ebf380b95607b344181655488d818a27791f/templating.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 682, 39, 13797, 620, 12, 1132, 4672, 3536, 1445, 353, 3344, 279, 2202, 761, 578, 279, 666, 434, 1516, 18, 8315, 761, 711, 279, 263, 1132, 716, 732, 4565, 6013, 20506, 316, 18, 35...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 682, 39, 13797, 620, 12, 1132, 4672, 3536, 1445, 353, 3344, 279, 2202, 761, 578, 279, 666, 434, 1516, 18, 8315, 761, 711, 279, 263, 1132, 716, 732, 4565, 6013, 20506, 316, 18, 35...
def _tokenize_literal(lines, start, block_indent, tokens, warnings):
def _tokenize_literal(lines, start, block_indent, tokens, errors):
def _tokenize_literal(lines, start, block_indent, tokens, warnings): """ Construct a L{Token} containing the literal block starting at C{lines[start]}, and append it to C{tokens}. C{block_indent} should be the indentation of the literal block. Any warnings generated while tokenizing the literal block will be appended to C{warnings}. @param lines: The list of lines to be tokenized @param start: The index into C{lines} of the first line of the literal block to be tokenized. @param block_indent: The indentation of C{lines[start]}. This is the indentation of the literal block. @param warnings: A list of the warnings generated by parsing. Any new warnings generated while will tokenizing this paragraph will be appended to this list. @return: The line number of the first line following the literal block. @type lines: C{list} of C{string} @type start: C{int} @type block_indent: C{int} @type tokens: C{list} of L{Token} @type warnings: C{list} of L{ParseError} @rtype: C{int} """ linenum = start + 1 while linenum < len(lines): # Find the indentation of this line. line = lines[linenum] indent = len(line) - len(line.lstrip()) # A Dedent to block_indent ends the literal block. # (Ignore blank likes, though) if len(line) != indent and indent <= block_indent: break # Go on to the next line. linenum += 1 # Add the token, and return the linenum after the token ends. contents = [line[block_indent+1:] for line in lines[start:linenum]] contents = '\n'.join(contents) contents = re.sub('(\A[ \n]*\n)|(\n[ \n]*\Z)', '', contents) tokens.append(Token(Token.LBLOCK, start, contents, block_indent)) return linenum
36ace726c8fc4e9c1a450d16c75087d594ead7cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/36ace726c8fc4e9c1a450d16c75087d594ead7cf/epytext.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2316, 554, 67, 13107, 12, 3548, 16, 787, 16, 1203, 67, 9355, 16, 2430, 16, 1334, 4672, 3536, 14291, 279, 511, 95, 1345, 97, 4191, 326, 7158, 1203, 5023, 622, 385, 95, 3548, 63, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2316, 554, 67, 13107, 12, 3548, 16, 787, 16, 1203, 67, 9355, 16, 2430, 16, 1334, 4672, 3536, 14291, 279, 511, 95, 1345, 97, 4191, 326, 7158, 1203, 5023, 622, 385, 95, 3548, 63, ...
ox = px + ((y2 - y1) * (R + g + r)) / b; oy = py + ((x1 - x2) * (R + g + r)) / b; d = l - sqrt(R**2 - h**2) else: ox = px + ((hx - px) * (R + g + r)) / h; oy = py + ((hy - py) * (R + g + r)) / h; d = l - sqrt(R**2 - h**2) return (d, ox, oy)
dx = ((y2 - y1) * (R + g + r)) / b dy = ((x1 - x2) * (R + g + r)) / b ox1 = px + dx oy1 = py + dy ox2 = px - dx oy2 = py - dy else: dx = ((hx - px) * (R + g + r)) / h dy = ((hy - py) * (R + g + r)) / h ox1 = px + dx oy1 = py + dy ox2 = px - dx oy2 = py - dy d = l - sqrt(R**2 - h**2) return (d, ox1, oy1, ox2, oy2) def calcTargetsChainAvoidance(vx, vy, ox, oy, d, prev, objects): """ recursively checks if the given avoidance point hits other objects and calculates the coords to avoid it by going to the same side as the given ox, oy proposes if no collision is expected, returns None """ for o in objects: if ((ox - o.x)**2 + (oy - o.y)**2) <= o.radius**2: rslt = calc_hit(vx, vy, ox, oy, o.x, o.y, o.radius, 0.5, 0.5) if rslt is not None: new_d, new_ox, new_oy, new_alt_ox, new_alt_oy = rslt if (prev.x - new_ox)**2 + (prev.y - new_oy)**2 <= prev.radius**2: new_ox = new_alt_ox new_oy = new_alt_oy new_rslt = calcTargetsChainAvoidance(vx, by, new_ox, new_oy, o, objects) if new_rslt is None: return (o, new_d, new_ox, new_oy) else: return new_rslt return None
def calc_hit(x1, y1, x2, y2, px, py, R, r, g): """ calculates the math magic for an obstacle (px,py) with the radius R over the segment ((x1,y1),(x2,y2)). r - rover radius g - preferred avoidance distance (safe distance to pass by an obstacle) returns: - None when the point's height does not hit the segment - distance till the point of an obstacle hit and coordinates of recommended avoidance point otherwise """ a2 = (x2-px)**2 + (y2-py)**2 b2 = (x1-x2)**2 + (y1-y2)**2 c2 = (x1-px)**2 + (y1-py)**2 b = sqrt(b2) c = sqrt(c2) cosalpha = (b2 + c2 - a2) / (2 * b * c) # b != 0 because then we reached the target; c != 0 because then we died if (cosalpha < 0.0): return None # does not hit assert cosalpha <= 1.01 assert cosalpha >= -1.01 l = c * cosalpha if l > b: return None # does not hit sinalpha2 = 1.0 - cosalpha**2 if sinalpha2 < 0: sinalpha2 = 0 sinalpha = sqrt(sinalpha2) assert sinalpha <= 1.01 assert sinalpha >= -1.01 h = abs(c * sinalpha) if h > R: return None # does not hit hx = x1 + ((x2 - x1) * l) / b; hy = y1 + ((y2 - y1) * l) / b; if h == 0: ox = px + ((y2 - y1) * (R + g + r)) / b; oy = py + ((x1 - x2) * (R + g + r)) / b; d = l - sqrt(R**2 - h**2) else: ox = px + ((hx - px) * (R + g + r)) / h; oy = py + ((hy - py) * (R + g + r)) / h; d = l - sqrt(R**2 - h**2) return (d, ox, oy)
f368fffb7a533e3f73d871c6f6fc1a80c91b00e5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5773/f368fffb7a533e3f73d871c6f6fc1a80c91b00e5/simple_stack_logic.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7029, 67, 15989, 12, 92, 21, 16, 677, 21, 16, 619, 22, 16, 677, 22, 16, 10318, 16, 2395, 16, 534, 16, 436, 16, 314, 4672, 3536, 17264, 326, 4233, 8146, 364, 392, 3768, 334, 16066, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7029, 67, 15989, 12, 92, 21, 16, 677, 21, 16, 619, 22, 16, 677, 22, 16, 10318, 16, 2395, 16, 534, 16, 436, 16, 314, 4672, 3536, 17264, 326, 4233, 8146, 364, 392, 3768, 334, 16066, ...
res = self.checkArgumentFormat(directory) if not res['OK']: return res urls = res['Value'] gLogger.debug("SRM2Storage.__removeDirectory: Attempting to remove %s directories." % len(urls)) resDict = self.__gfalremovedir_wrapper(urls)['Value']
res = self.checkArgumentFormat( directory ) if not res['OK']: return res urls = res['Value'] gLogger.debug( "SRM2Storage.__removeDirectory: Attempting to remove %s directories." % len( urls ) ) resDict = self.__gfalremovedir_wrapper( urls )['Value']
def __removeDirectory(self,directory): """ This function removes the directory on the storage """ res = self.checkArgumentFormat(directory) if not res['OK']: return res urls = res['Value'] gLogger.debug("SRM2Storage.__removeDirectory: Attempting to remove %s directories." % len(urls)) resDict = self.__gfalremovedir_wrapper(urls)['Value'] failed = resDict['Failed'] allResults = resDict['AllResults'] successful = {} for urlDict in allResults: if urlDict.has_key('surl'): pathSURL = urlDict['surl'] if urlDict['status'] == 0: infoStr = 'SRM2Storage.__removeDirectory: Successfully removed directory: %s' % pathSURL gLogger.debug(infoStr) successful[pathSURL] = True elif urlDict['status'] == 2: # This is the case where the file doesn't exist. infoStr = 'SRM2Storage.__removeDirectory: Directory did not exist, sucessfully removed: %s' % pathSURL gLogger.debug(infoStr) successful[pathSURL] = True else: errStr = "SRM2Storage.removeDirectory: Failed to remove directory." errMessage = urlDict['ErrorMessage'] gLogger.error(errStr,"%s: %s" % (pathSURL,errMessage)) failed[pathSURL] = "%s %s" % (errStr,errMessage) resDict = {'Failed':failed,'Successful':successful} return S_OK(resDict)
70e66af095cb6701e39b1e701e4a2ce4d012b4f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/70e66af095cb6701e39b1e701e4a2ce4d012b4f7/SRM2Storage.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 4479, 2853, 12, 2890, 16, 5149, 4672, 3536, 1220, 445, 7157, 326, 1867, 603, 326, 2502, 3536, 400, 273, 365, 18, 1893, 1379, 1630, 12, 1867, 262, 309, 486, 400, 3292, 3141, 3546, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 4479, 2853, 12, 2890, 16, 5149, 4672, 3536, 1220, 445, 7157, 326, 1867, 603, 326, 2502, 3536, 400, 273, 365, 18, 1893, 1379, 1630, 12, 1867, 262, 309, 486, 400, 3292, 3141, 3546, ...
profilers = self.job.profilers if not profilers.only(): utils.system(cmd) if profilers.present(): profilers.start(self) utils.system(cmd) profilers.stop(self) profilers.report(self)
utils.system(cmd)
def execute(self, testdir = None, extra_args = '', nproc = '1000', nops = '1000'): if not testdir: testdir = self.tmpdir
e9f3021c639a6af1b7fc23f99c9b07a6b40c9d2e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12268/e9f3021c639a6af1b7fc23f99c9b07a6b40c9d2e/fsstress.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1836, 12, 2890, 16, 1842, 1214, 273, 599, 16, 2870, 67, 1968, 273, 10226, 290, 9381, 273, 296, 18088, 2187, 290, 4473, 273, 296, 18088, 11, 4672, 309, 486, 1842, 1214, 30, 1842, 1214, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1836, 12, 2890, 16, 1842, 1214, 273, 599, 16, 2870, 67, 1968, 273, 10226, 290, 9381, 273, 296, 18088, 2187, 290, 4473, 273, 296, 18088, 11, 4672, 309, 486, 1842, 1214, 30, 1842, 1214, ...
user = self.pool.get('res.users').browse(cr, uid, uid)
user = self.pool.get('res.users').browse(cr, uid, uid, fields_process=_fields_process)
def __init__(self, cr, uid, name, parents=rml_parents, tag=rml_tag, context=None): if not context: context={} self.cr = cr self.uid = uid self.pool = pooler.get_pool(cr.dbname) user = self.pool.get('res.users').browse(cr, uid, uid) self.localcontext = { 'user': user, 'company': user.company_id, 'repeatIn': self.repeatIn, 'setLang': self.setLang, 'setTag': self.setTag, 'removeParentNode': self.removeParentNode, 'format': self.format, 'formatLang': self.formatLang, 'logo' : user.company_id.logo, 'lang' : user.company_id.partner_id.lang, } self.localcontext.update(context) self.rml_header = user.company_id.rml_header self.rml_header2 = user.company_id.rml_header2 self.logo = user.company_id.logo self.name = name self._regex = re.compile('\[\[(.+?)\]\]') self._transl_regex = re.compile('(\[\[.+?\]\])') self._node = None self.parents = parents self.tag = tag self._lang_cache = {}
f16cf978ff88ce3b744db58016d29e38fb92872c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/f16cf978ff88ce3b744db58016d29e38fb92872c/report_sxw.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 4422, 16, 4555, 16, 508, 16, 6298, 33, 86, 781, 67, 12606, 16, 1047, 33, 86, 781, 67, 2692, 16, 819, 33, 7036, 4672, 309, 486, 819, 30, 819, 12938, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 4422, 16, 4555, 16, 508, 16, 6298, 33, 86, 781, 67, 12606, 16, 1047, 33, 86, 781, 67, 2692, 16, 819, 33, 7036, 4672, 309, 486, 819, 30, 819, 12938, 3...
workdir = tempfile.mkdtemp( prefix = obj['name'], dir = os.getcwd() ) tmp, fname = tempfile.mkstemp( workdir, "glite_bulk_", os.getcwd() )
tmp, fname = tempfile.mkstemp( suffix = '.jdl', prefix = obj['name'], dir = os.getcwd() )
def submit( self, obj, requirements='', config ='', service='' ): """ submit a jdl to glite ends with a call to retrieve wms and job,gridid asssociation """
46dd67000db921707982ea47bf69034db2744228 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8886/46dd67000db921707982ea47bf69034db2744228/SchedulerGLite.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4879, 12, 365, 16, 1081, 16, 8433, 2218, 2187, 642, 273, 11, 2187, 1156, 2218, 11, 262, 30, 3536, 4879, 279, 525, 5761, 358, 5118, 1137, 3930, 598, 279, 745, 358, 4614, 341, 959, 471, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4879, 12, 365, 16, 1081, 16, 8433, 2218, 2187, 642, 273, 11, 2187, 1156, 2218, 11, 262, 30, 3536, 4879, 279, 525, 5761, 358, 5118, 1137, 3930, 598, 279, 745, 358, 4614, 341, 959, 471, ...
except OSError: pass
def remove_database(self): try: os.unlink(self.save_path) except OSError: pass
63cb7b859499466f8497aba539825913d00de831 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12354/63cb7b859499466f8497aba539825913d00de831/storedatabasetest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1206, 67, 6231, 12, 2890, 4672, 775, 30, 1140, 18, 318, 1232, 12, 2890, 18, 5688, 67, 803, 13, 1335, 10002, 30, 1342, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1206, 67, 6231, 12, 2890, 4672, 775, 30, 1140, 18, 318, 1232, 12, 2890, 18, 5688, 67, 803, 13, 1335, 10002, 30, 1342, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
update_ids(connection, verbose)
update_ids(connection, xmldoc, verbose) xmldoc.unlink()
def insert_from_url(connection, url, preserve_ids = False, verbose = False): """ Parse and insert the LIGO Light Weight document at the URL into the database the at the given connection. """ # # load document. this process inserts the document's contents into # the database. the document is unlinked to delete database cursor # objects it retains # utils.load_url(url, verbose = verbose, gz = (url or "stdin").endswith(".gz")).unlink() # # update references to row IDs # if not preserve_ids: update_ids(connection, verbose)
af592752cf35b9a561a2351661d817b99a8d50ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/af592752cf35b9a561a2351661d817b99a8d50ab/ligolw_sqlite.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2243, 67, 2080, 67, 718, 12, 4071, 16, 880, 16, 9420, 67, 2232, 273, 1083, 16, 3988, 273, 1083, 4672, 3536, 2884, 471, 2243, 326, 511, 3047, 51, 15992, 15437, 1668, 622, 326, 1976, 136...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2243, 67, 2080, 67, 718, 12, 4071, 16, 880, 16, 9420, 67, 2232, 273, 1083, 16, 3988, 273, 1083, 4672, 3536, 2884, 471, 2243, 326, 511, 3047, 51, 15992, 15437, 1668, 622, 326, 1976, 136...
domainname = '.'.join(socket.gethostbyname_ex(socket.gethostname())[0].split('.')[1:])
domainname = '.'.join(socket.gethostbyname_ex(socket.gethostname())[0].split('.')[1:]) or "defaultdomain"
def _register_base_settings(self): self.register_setting('-d', '--dest', dest='destdir', help='Specify the destination directory. [default: <hypervisor>-<distro>].') self.register_setting('-c', '--config', type='string', help='Specify a additional configuration file') self.register_setting('--debug', action='callback', callback=log.set_verbosity, help='Show debug information') self.register_setting('-v', '--verbose', action='callback', callback=log.set_verbosity, help='Show progress information') self.register_setting('-q', '--quiet', action='callback', callback=log.set_verbosity, help='Silent operation') self.register_setting('-t', '--tmp', default=os.environ.get('TMPDIR', '/tmp'), help='Use TMP as temporary working space for image generation. Defaults to $TMPDIR if it is defined or /tmp otherwise. [default: %default]') self.register_setting('--templates', metavar='DIR', help='Prepend DIR to template search path.') self.register_setting('-o', '--overwrite', action='store_true', default=False, help='Force overwrite of destination directory if it already exist. [default: %default]') self.register_setting('--in-place', action='store_true', default=False, help='Install directly into the filesystem images. This is needed if your $TMPDIR is nodev and/or nosuid, but will result in slightly larger file system images.') self.register_setting('--tmpfs', metavar="OPTS", help='Use a tmpfs as the working directory, specifying its size or "-" to use tmpfs default (suid,dev,size=1G).') self.register_setting('-m', '--mem', type='int', default=128, help='Assign MEM megabytes of memory to the guest vm. [default: %default]')
24103ff4de7988636a7e33c5d1904f080ccdf326 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1496/24103ff4de7988636a7e33c5d1904f080ccdf326/vm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4861, 67, 1969, 67, 4272, 12, 2890, 4672, 365, 18, 4861, 67, 8920, 2668, 17, 72, 2187, 3534, 10488, 2187, 1570, 2218, 10488, 1214, 2187, 2809, 2218, 19302, 326, 2929, 1867, 18, 306,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4861, 67, 1969, 67, 4272, 12, 2890, 4672, 365, 18, 4861, 67, 8920, 2668, 17, 72, 2187, 3534, 10488, 2187, 1570, 2218, 10488, 1214, 2187, 2809, 2218, 19302, 326, 2929, 1867, 18, 306,...
self.progressSlider.track = NSImage.imageNamed_(u'fs-progress-background')
def awakeFromNib(self): self.shareButton.setImage_(getOverlayButtonImage(self.shareButton.bounds().size)) self.shareButton.setAlternateImage_(getOverlayButtonAlternateImage(self.shareButton.bounds().size)) self.shareButton.setTitle_(_("Share"))
ae68df51c7e8fd6c4892dc67dd855a4ebbb805e2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12354/ae68df51c7e8fd6c4892dc67dd855a4ebbb805e2/overlay.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1690, 911, 1265, 50, 495, 12, 2890, 4672, 365, 18, 14419, 3616, 18, 542, 2040, 67, 12, 588, 11627, 3616, 2040, 12, 2890, 18, 14419, 3616, 18, 10576, 7675, 1467, 3719, 365, 18, 14419, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1690, 911, 1265, 50, 495, 12, 2890, 4672, 365, 18, 14419, 3616, 18, 542, 2040, 67, 12, 588, 11627, 3616, 2040, 12, 2890, 18, 14419, 3616, 18, 10576, 7675, 1467, 3719, 365, 18, 14419, 3...
preparse -- if True, then produce code to be evaluated with
- ``preparse`` -- if True, then produce code to be evaluated with
def explain_pickle(pickle=None, file=None, compress=True, **kwargs): r""" Explain a pickle. (That is, produce source code such that evaluating the code is equivalent to loading the pickle.) Feeding the result of explain_pickle to sage_eval should be totally equivalent to loading the pickle with cPickle. INPUTS: pickle -- the pickle to explain, as a string (default: None) file -- a filename of a pickle (default: None) compress -- if False, don't attempt to decompress the pickle (default: True) in_current_sage -- if True, produce potentially simpler code that is tied to the current version of Sage. (default: False) default_assumptions -- if True, produce potentially simpler code that assumes that generic unpickling code will be used. This code may not actually work. (default: False) eval -- if True, then evaluate the resulting code and return the evaluated result. (default: False) preparse -- if True, then produce code to be evaluated with Sage's preparser; if False, then produce standard Python code; if None, then produce code that will work either with or without the preparser. (default: True) pedantic -- if True, then carefully ensures that the result has at least as much sharing as the result of cPickle (it may have more, for immutable objects). (default: False) Exactly one of pickle (a string containing a pickle) or file (the filename of a pickle) must be provided. EXAMPLES: sage: explain_pickle(dumps({('a', 'b'): [1r, 2r]})) {('a', 'b'):[1r, 2r]} sage: explain_pickle(dumps(RR(pi)), in_current_sage=True) from sage.rings.real_mpfr import __create__RealNumber_version0 from sage.rings.real_mpfr import __create__RealField_version0 __create__RealNumber_version0(__create__RealField_version0(53r, False, 'RNDN'), '3.4gvml245kc0@0', 32r) sage: s = 'hi' sage: explain_pickle(dumps((s, s))) ('hi', 'hi') sage: explain_pickle(dumps((s, s)), pedantic=True) si = 'hi' (si, si) sage: explain_pickle(dumps(5r)) 5r sage: explain_pickle(dumps(5r), preparse=False) 5 sage: explain_pickle(dumps(5r), preparse=None) int(5) sage: explain_pickle(dumps(22/7)) pg_make_rational = unpickle_global('sage.rings.rational', 'make_rational') pg_make_rational('m/7') sage: explain_pickle(dumps(22/7), in_current_sage=True) from sage.rings.rational import make_rational make_rational('m/7') sage: explain_pickle(dumps(22/7), default_assumptions=True) from sage.rings.rational import make_rational make_rational('m/7') """ if pickle is not None: p = pickle elif file is not None: p = open(file).read() else: raise ValueError, "Either pickle or file must be specified" if compress: try: p = comp.decompress(p) except Exception, msg1: try: p = comp_other.decompress(p) except Exception, msg2: # Maybe data is uncompressed? pass return explain_pickle_string(p, **kwargs)
03555b4381371de7688c2f08f833898ba9658b7b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/03555b4381371de7688c2f08f833898ba9658b7b/explain_pickle.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 19765, 67, 20847, 12, 20847, 33, 7036, 16, 585, 33, 7036, 16, 8099, 33, 5510, 16, 2826, 4333, 4672, 436, 8395, 1312, 7446, 279, 13379, 18, 225, 261, 18163, 353, 16, 11402, 1084, 981, 4...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 19765, 67, 20847, 12, 20847, 33, 7036, 16, 585, 33, 7036, 16, 8099, 33, 5510, 16, 2826, 4333, 4672, 436, 8395, 1312, 7446, 279, 13379, 18, 225, 261, 18163, 353, 16, 11402, 1084, 981, 4...
blocksize = self.datasize - blockstart
blocksize = max(self.datasize - blockstart, 0)
def loadblock(self, blockstart, blocksize, data=None): if self.all: return if data is None: self.dataf.seek(blockstart) if blockstart + blocksize > self.datasize: # the revlog may have grown since we've started running, # but we don't have space in self.index for more entries. # limit blocksize so that we don't get too much data. blocksize = self.datasize - blockstart data = self.dataf.read(blocksize) lend = len(data) / self.s i = blockstart / self.s off = 0 for x in xrange(lend): if self.index[i + x] == None: b = data[off : off + self.s] self.index[i + x] = b n = b[self.shaoffset:self.shaoffset + 20] self.map[n] = i + x off += self.s
b746f9da3a11a69df071c375ed5de8c356d3dbac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/b746f9da3a11a69df071c375ed5de8c356d3dbac/revlog.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 2629, 12, 2890, 16, 1203, 1937, 16, 18440, 16, 501, 33, 7036, 4672, 309, 365, 18, 454, 30, 327, 309, 501, 353, 599, 30, 365, 18, 892, 74, 18, 16508, 12, 2629, 1937, 13, 309, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 2629, 12, 2890, 16, 1203, 1937, 16, 18440, 16, 501, 33, 7036, 4672, 309, 365, 18, 454, 30, 327, 309, 501, 353, 599, 30, 365, 18, 892, 74, 18, 16508, 12, 2629, 1937, 13, 309, ...
return p1-direction_vector*0.5, [ Line(p1-direction_vector, p1-direction_vector*0.5j), Line(p1-direction_vector, p1-direction_vector*-0.5j)
return p1-direction_vector*1.5, [ Line(p1-direction_vector*1.5, p1-direction_vector*0.5j), Line(p1-direction_vector*1.5, p1-direction_vector*-0.5j)
def _reversed_arrow(self, p1, p2): """--<""" direction_vector = p1 - p2 direction_vector /= abs(direction_vector) return p1-direction_vector*0.5, [ Line(p1-direction_vector, p1-direction_vector*0.5j), Line(p1-direction_vector, p1-direction_vector*-0.5j) ]
148f0ecef28839da3f1a261509f7b089a2c0d9e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1203/148f0ecef28839da3f1a261509f7b089a2c0d9e5/aafigure.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 266, 7548, 67, 7815, 12, 2890, 16, 293, 21, 16, 293, 22, 4672, 3536, 413, 32, 8395, 4068, 67, 7737, 273, 293, 21, 300, 293, 22, 4068, 67, 7737, 9531, 2417, 12, 9855, 67, 7737, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 266, 7548, 67, 7815, 12, 2890, 16, 293, 21, 16, 293, 22, 4672, 3536, 413, 32, 8395, 4068, 67, 7737, 273, 293, 21, 300, 293, 22, 4068, 67, 7737, 9531, 2417, 12, 9855, 67, 7737, ...
cmp_id = super(dm_campaign, self).copy(cr, uid, id, default)
cmp_id = super(dm_campaign, self).copy(cr, uid, id, default, context=context) print "Campaign copy id : ",cmp_id
def copy(self, cr, uid, id, default=None, context={}): cmp_id = super(dm_campaign, self).copy(cr, uid, id, default) data = self.browse(cr, uid, cmp_id, context) name_default='Copy of %s' % data.name prjt_default = 'Copy of %s' % data.project_id.name prj_id=self.pool.get('project.project').copy(cr, uid, data.project_id.id, default={'name':prjt_default}) cr.execute('select id from project_task where project_id=%d', (data.project_id.id,)) res = cr.fetchall() for (tasks_id,) in res: self.pool.get('project.task').copy(cr, uid, tasks_id,default={'project_id':prj_id,'active':True}, context=context) super(dm_campaign, self).write(cr, uid, cmp_id, {'name':name_default, 'date_start':0, 'date':0, 'project_id':prj_id}) return cmp_id
c69335317aaf82e14fae5bbe353c64f19d00d7e0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7339/c69335317aaf82e14fae5bbe353c64f19d00d7e0/campaign.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1610, 12, 2890, 16, 4422, 16, 4555, 16, 612, 16, 805, 33, 7036, 16, 819, 12938, 4672, 9411, 67, 350, 273, 2240, 12, 10956, 67, 14608, 16, 365, 2934, 3530, 12, 3353, 16, 4555, 16, 612...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1610, 12, 2890, 16, 4422, 16, 4555, 16, 612, 16, 805, 33, 7036, 16, 819, 12938, 4672, 9411, 67, 350, 273, 2240, 12, 10956, 67, 14608, 16, 365, 2934, 3530, 12, 3353, 16, 4555, 16, 612...
def needs_declaration(fullpath):
return False def can_be_compiled(fullpath): infile = _open(fullpath) if infile is None: return False code = infile.read() infile.close()
def needs_declaration(fullpath): try: infile = open(fullpath, 'rU') except IOError: # Oops, the file was removed - ignore it return None line1 = infile.readline() line2 = infile.readline() if get_declaration(line1) or get_declaration(line2): # the file does have an encoding declaration, so trust it infile.close() return False # check the whole file for non-ASCII characters rest = infile.read() infile.close() if has_correct_encoding(line1+line2+rest, "ascii"): return False return True
cf21dba6a3042d2651a66805a6080a3c476ad222 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cf21dba6a3042d2651a66805a6080a3c476ad222/pysource.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 327, 1083, 225, 1652, 848, 67, 2196, 67, 19397, 12, 2854, 803, 4672, 14568, 273, 389, 3190, 12, 2854, 803, 13, 309, 14568, 353, 599, 30, 327, 1083, 225, 981, 273, 14568, 18, 896, 1435, 14568...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 327, 1083, 225, 1652, 848, 67, 2196, 67, 19397, 12, 2854, 803, 4672, 14568, 273, 389, 3190, 12, 2854, 803, 13, 309, 14568, 353, 599, 30, 327, 1083, 225, 981, 273, 14568, 18, 896, 1435, 14568...
x^2 - 2
x |--> x^2 - 2
def equify(f): """ Returns the equation rewritten to give negative values when True, positive when False. EXAMPLES: sage: from sage.plot.contour_plot import equify sage: equify(x^2 < 2) x^2 - 2 sage: equify(x^2 > 2) 2 - x^2 """ import operator op = f.operator() if op is operator.gt or op is operator.ge: return f.rhs() - f.lhs() else: return f.lhs() - f.rhs()
22fa7dda7576e5ff502de8f13ac26c3e31896176 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/22fa7dda7576e5ff502de8f13ac26c3e31896176/contour_plot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1298, 1164, 12, 74, 4672, 3536, 2860, 326, 15778, 26768, 358, 8492, 6092, 924, 1347, 1053, 16, 6895, 1347, 1083, 18, 225, 5675, 8900, 11386, 30, 272, 410, 30, 628, 272, 410, 18, 4032, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1298, 1164, 12, 74, 4672, 3536, 2860, 326, 15778, 26768, 358, 8492, 6092, 924, 1347, 1053, 16, 6895, 1347, 1083, 18, 225, 5675, 8900, 11386, 30, 272, 410, 30, 628, 272, 410, 18, 4032, ...
except ValueError: pass else: raise TestFailed, "int(%s)" % `s[1:]` + " should raise ValueError"
except: raise TestFailed, "int(%s)" % `s[1:]` + " should return long"
def f(): pass
16da432bbdd537d1020c4d0e03df2acfd0b848c7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/16da432bbdd537d1020c4d0e03df2acfd0b848c7/test_b1.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 284, 13332, 1342, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 284, 13332, 1342, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
wikipedia.output(u'Page [[%s]] does not seem to exist?! Skipping.') % refpl.linkname()
wikipedia.output(u'Page [[%s]] does not seem to exist?! Skipping.' % refpl.linkname())
def treat(self, refpl, disambPl): """ Parameters: disambPl - The disambiguation page or redirect we don't want anything to link on refpl - A page linking to disambPl Returns False if the user pressed q to completely quit the program. Otherwise, returns True. """ if self.mylang in link_trail: linktrail=link_trail[self.mylang] else: linktrail='[a-z]*' trailR=re.compile(linktrail) # The regular expression which finds links. Results consist of three groups: # group(1) is the target page title, that is, everything before | or ]. # group(2) is the alternative link title, that's everything between | and ]. # group(3) is the link trail, that's letters after ]] which are part of the word. # note that the definition of 'letter' varies from language to language. linkR=re.compile(r'\[\[([^\]\|]*)(?:\|([^\]]*))?\]\](' + linktrail + ')')
b1df638933fa01f922fa91d1b27302a0f96a0426 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/b1df638933fa01f922fa91d1b27302a0f96a0426/solve_disambiguation.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10116, 12, 2890, 16, 1278, 412, 16, 1015, 2536, 1749, 4672, 3536, 7012, 30, 1015, 2536, 1749, 300, 1021, 1015, 26011, 367, 1363, 578, 3136, 732, 2727, 1404, 2545, 6967, 358, 1692, 603, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10116, 12, 2890, 16, 1278, 412, 16, 1015, 2536, 1749, 4672, 3536, 7012, 30, 1015, 2536, 1749, 300, 1021, 1015, 26011, 367, 1363, 578, 3136, 732, 2727, 1404, 2545, 6967, 358, 1692, 603, 1...
self.chem_mod_ids.append(chem_mod_id)
self.chem_mod_ids.add(chem_mod_id)
def _track_mods(self, chem_mod_ids): for chem_mod_id in chem_mod_ids: self.chem_mod_ids.append(chem_mod_id) self.residue_name += "%" + chem_mod_id
df774b14776ab9af8eaf49865101ea638ce3e215 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/696/df774b14776ab9af8eaf49865101ea638ce3e215/pdb_interpretation.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4101, 67, 22760, 12, 2890, 16, 19028, 67, 1711, 67, 2232, 4672, 364, 19028, 67, 1711, 67, 350, 316, 19028, 67, 1711, 67, 2232, 30, 365, 18, 1036, 67, 1711, 67, 2232, 18, 1289, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4101, 67, 22760, 12, 2890, 16, 19028, 67, 1711, 67, 2232, 4672, 364, 19028, 67, 1711, 67, 350, 316, 19028, 67, 1711, 67, 2232, 30, 365, 18, 1036, 67, 1711, 67, 2232, 18, 1289, 1...
print '%s: No additional data found by this name' % item
print _('%s: No additional data found by this name') % item
def historyAddonInfoCmd(self, extcmds): tid = extcmds[1] try: int(tid) except ValueError: self.logger.critical(_('No transaction ID given')) return 1, ['Failed history addon-info']
dc4c3674848f38d7c125f16f3b3f3fcbf42a1054 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/dc4c3674848f38d7c125f16f3b3f3fcbf42a1054/output.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4927, 27901, 966, 5931, 12, 2890, 16, 1110, 24680, 4672, 11594, 273, 1110, 24680, 63, 21, 65, 775, 30, 509, 12, 18081, 13, 1335, 2068, 30, 365, 18, 4901, 18, 28000, 24899, 2668, 2279, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4927, 27901, 966, 5931, 12, 2890, 16, 1110, 24680, 4672, 11594, 273, 1110, 24680, 63, 21, 65, 775, 30, 509, 12, 18081, 13, 1335, 2068, 30, 365, 18, 4901, 18, 28000, 24899, 2668, 2279, ...
if not hostname: print "You must sepcify a hostname with the -h switch" sys.exit(1) if not lab_server: print "You must sepcify a lab_server with the -S switch" sys.exit(1)
def main(): global lab_server, hostname lab_server = '' hostname = '' debug = 0 if ('LAB_SERVER' in os.environ.keys()): lab_server = "http://%s/cgi-bin/rhts/xmlrpc.cgi" % os.environ['LAB_SERVER'] if ('HOSTNAME' in os.environ.keys()): hostname = os.environ['HOSTNAME'] args = sys.argv[1:] try: opts, args = getopt.getopt(args, 'dh:S:', ['server=']) except: usage() for opt, val in opts: if opt in ('-d', '--debug'): debug = 1 if opt in ('-h', '--hostname'): hostname = val if opt in ('-S', '--server'): lab_server = "http://%s/cgi-bin/rhts/xmlrpc.cgi" % val if not hostname: print "You must sepcify a hostname with the -h switch" sys.exit(1) if not lab_server: print "You must sepcify a lab_server with the -S switch" sys.exit(1) inventory = read_inventory() if debug: print inventory else: push_inventory(hostname, inventory)
ea8c09d2b93b1e919254134e451af59ddb961e63 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14755/ea8c09d2b93b1e919254134e451af59ddb961e63/push-inventory.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 2552, 11814, 67, 3567, 16, 5199, 225, 11814, 67, 3567, 273, 875, 5199, 273, 875, 1198, 273, 374, 225, 309, 7707, 48, 2090, 67, 4370, 11, 316, 1140, 18, 28684, 18, 2452, 14...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 2552, 11814, 67, 3567, 16, 5199, 225, 11814, 67, 3567, 273, 875, 5199, 273, 875, 1198, 273, 374, 225, 309, 7707, 48, 2090, 67, 4370, 11, 316, 1140, 18, 28684, 18, 2452, 14...
except KeyError:
except KeyError:
def find_site(): """Find the site by looking at the environment.""" try: settings_module = os.environ['DJANGO_SETTINGS_MODULE'] except KeyError: raise AssertionError("DJANGO_SETTINGS_MODULE not set.") settingsl = settings_module.split('.') site = __import__(settingsl[0]) settings = __import__(settings_module, {}, {}, settingsl[-1]) return site, settings
0b5b5bdddb5618fc3777a5e213b03abd527f7ab5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13656/0b5b5bdddb5618fc3777a5e213b03abd527f7ab5/load_data.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 67, 4256, 13332, 3536, 3125, 326, 2834, 635, 7849, 622, 326, 3330, 12123, 775, 30, 1947, 67, 2978, 273, 1140, 18, 28684, 3292, 40, 46, 31630, 67, 19428, 67, 12194, 3546, 1335, 4999...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 67, 4256, 13332, 3536, 3125, 326, 2834, 635, 7849, 622, 326, 3330, 12123, 775, 30, 1947, 67, 2978, 273, 1140, 18, 28684, 3292, 40, 46, 31630, 67, 19428, 67, 12194, 3546, 1335, 4999...
def _imp(name, globals={}, locals={}, from_list=[], level=-1): raise ImportError
def _imp(name, globals={}, locals={}, from_list=[], level=-1): raise ImportError
3a5ff0e42055d6dd0ad6ac045677d13d7a543d77 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12347/3a5ff0e42055d6dd0ad6ac045677d13d7a543d77/standard.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 14532, 12, 529, 16, 10941, 28793, 8985, 28793, 628, 67, 1098, 22850, 6487, 1801, 29711, 21, 4672, 1002, 11308, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 14532, 12, 529, 16, 10941, 28793, 8985, 28793, 628, 67, 1098, 22850, 6487, 1801, 29711, 21, 4672, 1002, 11308, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
new_file = open(filename, "w") new_file.write(new_vcard.serialize()) new_file.close() self.vcard = new_vcard self.vcard.filename = filename self.vcard.iter = iter self.new_parent.contactData.set(self.vcard.iter, 0, unescape(self.vcard.fn.value), 1, self.vcard) except: raise
new_file = open(filename, "w") new_file.write(new_vcard.serialize()) new_file.close() self.vcard = new_vcard self.vcard.filename = filename self.vcard.iter = iter self.new_parent.contactData.set(self.vcard.iter, 0, unescape(self.vcard.fn.value), 1, self.vcard) except: raise
def switch_mode(self, edit=False, save=False): self.edit = edit self.addButton.set_sensitive(edit) self.saveButton.set_property("visible", edit) self.editButton.set_property("visible", not edit) self.imagechangeButton.set_property("visible", edit) self.imageremoveButton.set_property("visible", edit and self.hasphoto) self.changeButton.set_property("visible", edit)
337e2628519817abde9df50dbed69c769add8439 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2651/337e2628519817abde9df50dbed69c769add8439/arkadas.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1620, 67, 3188, 12, 2890, 16, 3874, 33, 8381, 16, 1923, 33, 8381, 4672, 365, 18, 4619, 273, 3874, 365, 18, 1289, 3616, 18, 542, 67, 23481, 12, 4619, 13, 365, 18, 5688, 3616, 18, 542,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1620, 67, 3188, 12, 2890, 16, 3874, 33, 8381, 16, 1923, 33, 8381, 4672, 365, 18, 4619, 273, 3874, 365, 18, 1289, 3616, 18, 542, 67, 23481, 12, 4619, 13, 365, 18, 5688, 3616, 18, 542,...
f = i[0].clone() f.text=i[1] words.append(f) maxSize = max(maxSize,f.fontSize)
g = i[0].clone() g.text=i[1] words.append(g) maxSize = max(maxSize,g.fontSize)
def breakLines(self, width): """ Returns a broken line structure. There are two cases A) For the simple case of a single formatting input fragment the output is A fragment specifier with kind = 0 fontName, fontSize, leading, textColor lines= A list of lines Each line has two items. 1) unused width in points 2) word list
40f8b066b964b0e05022709df1159c04df677861 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/40f8b066b964b0e05022709df1159c04df677861/paragraph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 898, 5763, 12, 2890, 16, 1835, 4672, 3536, 2860, 279, 12933, 980, 3695, 18, 6149, 854, 2795, 6088, 225, 432, 13, 2457, 326, 4143, 648, 434, 279, 2202, 10407, 810, 5481, 326, 876, 353, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 898, 5763, 12, 2890, 16, 1835, 4672, 3536, 2860, 279, 12933, 980, 3695, 18, 6149, 854, 2795, 6088, 225, 432, 13, 2457, 326, 4143, 648, 434, 279, 2202, 10407, 810, 5481, 326, 876, 353, ...
version = '3.6.0dev',
version = '3.5.2',
def read(*rnames): return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
efc48c7bc4f71d7a00da4f29c40db8266483f639 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9520/efc48c7bc4f71d7a00da4f29c40db8266483f639/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 30857, 86, 1973, 4672, 327, 1696, 12, 538, 18, 803, 18, 5701, 12, 538, 18, 803, 18, 12287, 12, 972, 768, 972, 3631, 380, 86, 1973, 13, 2934, 896, 1435, 225, 2, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 30857, 86, 1973, 4672, 327, 1696, 12, 538, 18, 803, 18, 5701, 12, 538, 18, 803, 18, 12287, 12, 972, 768, 972, 3631, 380, 86, 1973, 13, 2934, 896, 1435, 225, 2, -100, -100, -100,...
drawer.drawsphere(color, atom_pos, self.dnaStyleBasesScale, 2)
drawer.drawsphere(color, atom.posn() - chunk.center, self.dnaStyleBasesScale, 2)
def drawStrand(points, colors, radii, color_style, shape, arrows): """ Renders a strand shape along points array using colors and radii arrays, optionally with arrows. """ n = len(points) if n>3: # copy colors and radii colors[0] = colors[1] colors[n-1] = colors[n-2] radii[0] = radii[1] radii[n-1] = radii[n-2] # draw the terminal spheres drawer.drawsphere(colors[1],points[1],radii[1],2) drawer.drawsphere(colors[n-2],points[n-2],radii[1],2) # draw the arrows if arrows==1 or arrows==3: # 5' glDisable(GL_COLOR_MATERIAL) drawer.drawpolycone(colors[1], [points[1]+0.25*(points[2]-points[1]), points[1]+0.25*(points[2]-points[1]), points[1]-0.25*(points[2]-points[1]), points[1]-0.25*(points[2]-points[1])], [0.0, 0.0, radii[1]*2.0, radii[1]*2.0, ]) if arrows==2 or arrows==3: # 3' drawer.drawpolycone(colors[n-2], [points[n-2], points[n-2], points[n-2]-0.5*(points[n-3]-points[n-2]), points[n-2]-0.5*(points[n-3]-points[n-2])], [radii[1]*2.0, radii[1]*2.0, 0.0, 0.0]) if shape==1: # draw cylinders gleSetJoinStyle(TUBE_JN_ROUND | TUBE_NORM_PATH_EDGE | TUBE_JN_CAP | TUBE_CONTOUR_CLOSED) #drawer.drawpolycone(colors[1], # points, # radii) if color_style==1: drawer.drawpolycone_multicolor(colors[1], points, colors, radii) else: drawer.drawpolycone(colors[1], points, radii) elif shape==2: # draw spline tube gleSetJoinStyle(TUBE_JN_ANGLE | TUBE_NORM_PATH_EDGE | TUBE_JN_CAP | TUBE_CONTOUR_CLOSED) new_points = zeros([4*(n-2)-1,3],Float) new_colors = zeros([4*(n-2)-1,3],Float) new_radii = zeros([4*(n-2)-1],Float) o = 1 for p in range (1,n-2): for m in range (0,4): t = float(m)/4.0 new_points[o] = self.spline(points, p, t) new_colors[o] = self.spline(colors, p, t) new_radii[o] = self.spline(radii, p, t) o += 1 new_points[o] = self.spline(points, p, 1.0) new_colors[o] = self.spline(colors, p, 1.0) new_radii[o] = self.spline(radii, p, 1.0) o += 1 new_points[0] = 3.0*new_points[1]-3.0*new_points[2]+new_points[3] new_points[o] = 3.0*new_points[o-1]-3.0*new_points[o-2]+new_points[o-3] # draw the tube if color_style==1: drawer.drawpolycone_multicolor( colors[1], new_points, new_colors, new_radii) else: drawer.drawpolycone( colors[1], new_points, new_radii)
cbc143d808cf827d03bc69ee526e2fca8459d46d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/cbc143d808cf827d03bc69ee526e2fca8459d46d/DnaCylinderChunks.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3724, 1585, 464, 12, 4139, 16, 5740, 16, 28125, 16, 2036, 67, 4060, 16, 2179, 16, 419, 3870, 4672, 3536, 534, 10130, 279, 16706, 2179, 7563, 3143, 526, 1450, 5740, 471, 28125, 5352, 16, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3724, 1585, 464, 12, 4139, 16, 5740, 16, 28125, 16, 2036, 67, 4060, 16, 2179, 16, 419, 3870, 4672, 3536, 534, 10130, 279, 16706, 2179, 7563, 3143, 526, 1450, 5740, 471, 28125, 5352, 16, ...
>>> old = sys.modules.get('zope.app.layers', None)
>>> import zope.app.layers >>> old = sys.modules['zope.app.layers']
... def resolve(self, path):
0437228b54d73af25b4a383d5609ee2c3d4b1fad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/0437228b54d73af25b4a383d5609ee2c3d4b1fad/back35.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1372, 377, 1652, 2245, 12, 2890, 16, 589, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1372, 377, 1652, 2245, 12, 2890, 16, 589, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
def _handleColWidth(self, args): if not args.has_key("width"):
def _handleColWidth(self, argsdict={}): if not argsdict.has_key("width"):
def _handleColWidth(self, args): if not args.has_key("width"): return args["width"] = args["width"].strip('"') if not args["width"].endswith("%"): self.formatter._emitComment("Width %s not supported" % args["width"]) return
1433435f169a98600ed153334470f8365d04459c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/888/1433435f169a98600ed153334470f8365d04459c/text_docbook.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4110, 914, 2384, 12, 2890, 16, 833, 1576, 12938, 4672, 309, 486, 833, 1576, 18, 5332, 67, 856, 2932, 2819, 6, 4672, 327, 833, 9614, 2819, 11929, 273, 833, 9614, 2819, 6, 8009, 640...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4110, 914, 2384, 12, 2890, 16, 833, 1576, 12938, 4672, 309, 486, 833, 1576, 18, 5332, 67, 856, 2932, 2819, 6, 4672, 327, 833, 9614, 2819, 11929, 273, 833, 9614, 2819, 6, 8009, 640...
file, pathname, desc = imp.find_module(name, plugin_dirs) plugins[name] = imp.load_module(name, file, pathname, desc) except Exception, e: print "Error: %s" % e
try: file, pathname, desc = imp.find_module(name, plugin_dirs) tmp_load = imp.load_module(name, file, pathname, desc) is_plugin = False for key in tmp_load.__dict__.keys(): try: is_plugin = getattr(tmp_load.__dict__[key], 'PLUGIN_NAME', None) except TypeError: continue if is_plugin: plugins[name] = [tmp_load, key] break except Exception, e: print "Error while trying to load a python module: %s" % e continue
def LoadPlugins(self): plugins = {} # find all the folders in the plugin dir plugin_dirs = [] plugin_dirs.append(self.plugin_path[0]) for f in os.listdir(self.plugin_path[0]): if os.path.isdir(os.path.join(self.plugin_path[0], f)): plugin_dirs.append(os.path.join(self.plugin_path[0], f)) try: for loader, name, ispkg in pkgutil.iter_modules(plugin_dirs): file, pathname, desc = imp.find_module(name, plugin_dirs) plugins[name] = imp.load_module(name, file, pathname, desc) except Exception, e: print "Error: %s" % e for name, plugin in plugins.items(): tmp_plgin = self.loadPlugin(plugin) if tmp_plgin: self.Plugins.append(tmp_plgin)
5d2665c0725adce205f3c0f4c5bd4f29e9fd499d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7036/5d2665c0725adce205f3c0f4c5bd4f29e9fd499d/engine.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4444, 9461, 12, 2890, 4672, 4799, 273, 2618, 225, 468, 1104, 777, 326, 9907, 316, 326, 1909, 1577, 1909, 67, 8291, 273, 5378, 1909, 67, 8291, 18, 6923, 12, 2890, 18, 4094, 67, 803, 63,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4444, 9461, 12, 2890, 4672, 4799, 273, 2618, 225, 468, 1104, 777, 326, 9907, 316, 326, 1909, 1577, 1909, 67, 8291, 273, 5378, 1909, 67, 8291, 18, 6923, 12, 2890, 18, 4094, 67, 803, 63,...
size_upper = self.__get_num(self.size_upper) size_lower = self.__get_num(self.size_lower) if size_float > size_upper: size_float = size_upper elif size_float < size_lower: size_float = size_lower else: size_float_exts = self.__get_extents(size_float) size_float = self.__get_num(size_float_exts) self.size_new = self.__get_extents(size_float) self.size_entry.set_text(str(size_float)) self.size_scale.set_value(size_float) self.update_remaining_space_label()
self.set_size_new(self.__get_extents(size_float))
def on_size_change_entry(self, obj1, obj2): size_text = self.size_entry.get_text() size_float = 0.0 try: ##In case gibberish is entered into the size field... size_float = float(size_text) except ValueError, e: self.size_entry.set_text(str(self.__get_num(self.size_new))) return False size_upper = self.__get_num(self.size_upper) size_lower = self.__get_num(self.size_lower) if size_float > size_upper: size_float = size_upper elif size_float < size_lower: size_float = size_lower else: size_float_exts = self.__get_extents(size_float) size_float = self.__get_num(size_float_exts) self.size_new = self.__get_extents(size_float) self.size_entry.set_text(str(size_float)) self.size_scale.set_value(size_float) self.update_remaining_space_label() return False
9853486877ffa9129d0f5ea9d5bb5e86f67600dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3880/9853486877ffa9129d0f5ea9d5bb5e86f67600dd/InputController.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 67, 1467, 67, 3427, 67, 4099, 12, 2890, 16, 1081, 21, 16, 1081, 22, 4672, 963, 67, 955, 273, 365, 18, 1467, 67, 4099, 18, 588, 67, 955, 1435, 963, 67, 5659, 273, 374, 18, 20, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 67, 1467, 67, 3427, 67, 4099, 12, 2890, 16, 1081, 21, 16, 1081, 22, 4672, 963, 67, 955, 273, 365, 18, 1467, 67, 4099, 18, 588, 67, 955, 1435, 963, 67, 5659, 273, 374, 18, 20, ...
else: fname = self.getCachedFilename(uri)
def checksum(self, uri, cstype): """Calculates and returns the checksum for a give URL and corresponding subdir. The type parameter is either "sha" or "md5".
2fdd1a366c1d88f5ae4f2257566e5854a99b75f0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/2fdd1a366c1d88f5ae4f2257566e5854a99b75f0/cache.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6697, 12, 2890, 16, 2003, 16, 276, 27273, 4672, 3536, 10587, 471, 1135, 326, 6697, 364, 279, 8492, 1976, 471, 4656, 16921, 18, 1021, 618, 1569, 353, 3344, 315, 7819, 6, 578, 315, 1264, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6697, 12, 2890, 16, 2003, 16, 276, 27273, 4672, 3536, 10587, 471, 1135, 326, 6697, 364, 279, 8492, 1976, 471, 4656, 16921, 18, 1021, 618, 1569, 353, 3344, 315, 7819, 6, 578, 315, 1264, ...
self.muteTip.set_tip(self.muteButton, "Mute - silence this instrument", None) soloimg = gtk.Image() soloimg.set_from_file(os.path.join(Globals.IMAGE_PATH, "icon_solo.png"))
self.muteTip.set_tip(self.muteButton, self.muteTipDisabled, None)
def __init__(self, project, instrument, mixview, mainview): """ Creates a new instance of MixerStrip. Parameters: project -- the currently active Project. instrument -- the instrument associated with this MixerStrip. mixview -- the mixing view object (CompactMixView). mainview -- the main Jokosher window (MainApp). """ gtk.Container.__init__(self) self.project = project self.instrument = instrument self.mixview = mixview self.mainview = mainview self.Updating = False self.vbox = gtk.VBox() self.add(self.vbox)
b8308db032cc85212b1951474b7bcaebfab85f7f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10033/b8308db032cc85212b1951474b7bcaebfab85f7f/MixerStrip.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1984, 16, 10353, 16, 6843, 1945, 16, 2774, 1945, 4672, 3536, 10210, 279, 394, 791, 434, 31043, 264, 16632, 18, 225, 7012, 30, 1984, 1493, 326, 4551, 2695, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1984, 16, 10353, 16, 6843, 1945, 16, 2774, 1945, 4672, 3536, 10210, 279, 394, 791, 434, 31043, 264, 16632, 18, 225, 7012, 30, 1984, 1493, 326, 4551, 2695, ...
if sys.platform in ('win32', 'cygwin') and options.target == 'Release':
if sys.platform in ('win32', 'cygwin'):
def main(options, args): """Run the tests. Will call sys.exit when complete. Args: options: a dictionary of command line options args: a list of sub directories or files to test """ if options.sources: options.verbose = True # Set up our logging format. log_level = logging.INFO if options.verbose: log_level = logging.DEBUG logging.basicConfig(level=log_level, format='%(asctime)s %(filename)s:%(lineno)-3d' ' %(levelname)s %(message)s', datefmt='%y%m%d %H:%M:%S') if not options.target: if options.debug: options.target = "Debug" else: options.target = "Release" if options.results_directory.startswith("/"): # Assume it's an absolute path and normalize options.results_directory = path_utils.GetAbsolutePath( options.results_directory) else: # If it's a relative path, make the output directory relative to Debug or # Release. basedir = path_utils.WebKitRoot() basedir = os.path.join(basedir, options.target) options.results_directory = path_utils.GetAbsolutePath( os.path.join(basedir, options.results_directory)) if options.platform is None: options.platform = path_utils.PlatformDir() if not options.num_test_shells: # For now, only run Windows-Release in parallel until we make other # configurations more stable. if sys.platform in ('win32', 'cygwin') and options.target == 'Release': cpus = 1 if sys.platform in ('win32', 'cygwin'): cpus = int(os.environ.get('NUMBER_OF_PROCESSORS', 1)) elif (hasattr(os, "sysconf") and os.sysconf_names.has_key("SC_NPROCESSORS_ONLN")): # Linux & Unix: ncpus = os.sysconf("SC_NPROCESSORS_ONLN") if isinstance(ncpus, int) and ncpus > 0: cpus = ncpus elif sys.platform in ('darwin'): # OSX: cpus = int(os.popen2("sysctl -n hw.ncpu")[1].read()) # TODO: Do timing tests on a single-core machine. options.num_test_shells = 2 * cpus # Some HTTP tests start timing out when tests are run in parallel. # TODO(ojan): Impelement per-test-timeouts instead. http://crbug.com/9613 if not options.time_out_ms: options.time_out_ms = 20000 else: options.num_test_shells = 1 # Include all tests if none are specified. paths = args if not paths: paths = [] if options.test_list: paths += ReadTestFiles(options.test_list) if not paths: paths = ['.'] test_runner = TestRunner(options, paths) if options.lint_test_files: # Just creating the TestRunner checks the syntax of the test lists. print "If there are no fail messages or exceptions, the lint succeeded." return try: test_shell_binary_path = path_utils.TestShellBinaryPath(options.target) except path_utils.PathNotFound: print "\nERROR: test_shell is not found. Be sure that you have built it" print "and that you are using the correct build. This script will run the" print "Release one by default. Use --debug to use the Debug build.\n" sys.exit(1) logging.info("Using platform '%s'" % options.platform) logging.info("Placing test results in %s" % options.results_directory) if options.new_baseline: logging.info("Placing new baselines in %s" % os.path.join(path_utils.PlatformResultsDir(options.platform), options.platform)) logging.info("Using %s build at %s" % (options.target, test_shell_binary_path)) if not options.no_pixel_tests: logging.info("Running pixel tests") if 'cygwin' == sys.platform: logging.warn("#" * 40) logging.warn("# UNEXPECTED PYTHON VERSION") logging.warn("# This script should be run using the version of python") logging.warn("# in third_party/python_24/") logging.warn("#" * 40) sys.exit(1) # Delete the disk cache if any to ensure a clean test run. cachedir = os.path.split(test_shell_binary_path)[0] cachedir = os.path.join(cachedir, "cache") if os.path.exists(cachedir): shutil.rmtree(cachedir) test_runner.AddTestType(text_diff.TestTextDiff) test_runner.AddTestType(simplified_text_diff.SimplifiedTextDiff) if not options.no_pixel_tests: test_runner.AddTestType(image_diff.ImageDiff) if options.fuzzy_pixel_tests: test_runner.AddTestType(fuzzy_image_diff.FuzzyImageDiff) has_new_failures = test_runner.Run() logging.info("Exit status: %d" % has_new_failures) sys.exit(has_new_failures)
d837a98189b9667532b479a772c899297b479a90 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/d837a98189b9667532b479a772c899297b479a90/run_webkit_tests.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 2116, 16, 833, 4672, 3536, 1997, 326, 7434, 18, 225, 9980, 745, 2589, 18, 8593, 1347, 3912, 18, 225, 6634, 30, 702, 30, 279, 3880, 434, 1296, 980, 702, 833, 30, 279, 666, 4...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 2116, 16, 833, 4672, 3536, 1997, 326, 7434, 18, 225, 9980, 745, 2589, 18, 8593, 1347, 3912, 18, 225, 6634, 30, 702, 30, 279, 3880, 434, 1296, 980, 702, 833, 30, 279, 666, 4...
if name == 'inCollection': import pdb; pdb.set_trace()
def instantiateItem(self, name, parent, uuid, cls=None, version=0, withInitialValues=False, _noMonitors=False): """ Instantiate an existing item of this kind.
9ca2ef4887fcdbe65a3f323612001ead41021eb5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/9ca2ef4887fcdbe65a3f323612001ead41021eb5/Kind.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10275, 1180, 12, 2890, 16, 508, 16, 982, 16, 3822, 16, 2028, 33, 7036, 16, 1177, 33, 20, 16, 598, 4435, 1972, 33, 8381, 16, 389, 2135, 11415, 13704, 33, 8381, 4672, 3536, 26492, 392, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10275, 1180, 12, 2890, 16, 508, 16, 982, 16, 3822, 16, 2028, 33, 7036, 16, 1177, 33, 20, 16, 598, 4435, 1972, 33, 8381, 16, 389, 2135, 11415, 13704, 33, 8381, 4672, 3536, 26492, 392, ...
return not self._getFeed().loaded
feed=self._getFeed() if not feed.loaded: return True if feed.needs_update: return True return False
def initializing(self): """should return True if deferred template should be displayed""" return not self._getFeed().loaded
c5555f489c88cd9eed97bd3d65d5a29ead766742 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12194/c5555f489c88cd9eed97bd3d65d5a29ead766742/rss.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 22584, 12, 2890, 4672, 3536, 13139, 327, 1053, 309, 7045, 1542, 1410, 506, 10453, 8395, 4746, 33, 2890, 6315, 588, 8141, 1435, 309, 486, 4746, 18, 4230, 30, 327, 1053, 309, 4746, 18, 206...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 22584, 12, 2890, 4672, 3536, 13139, 327, 1053, 309, 7045, 1542, 1410, 506, 10453, 8395, 4746, 33, 2890, 6315, 588, 8141, 1435, 309, 486, 4746, 18, 4230, 30, 327, 1053, 309, 4746, 18, 206...
We do an example with a split prime and show byother the quo and lift maps:
We do an example with a split prime and show both the quo and lift maps:
def _p_quotient(self, p): """ This is an internal technical function that is used for example for computing the quotient of the ring of integers by a prime ideal.
19de6fd6519615ae1f3bb095f91df966b47f49b2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/19de6fd6519615ae1f3bb095f91df966b47f49b2/number_field_ideal.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 84, 67, 9270, 1979, 12, 2890, 16, 293, 4672, 3536, 1220, 353, 392, 2713, 17734, 1706, 445, 716, 353, 1399, 364, 3454, 364, 20303, 326, 26708, 434, 326, 9221, 434, 12321, 635, 279, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 84, 67, 9270, 1979, 12, 2890, 16, 293, 4672, 3536, 1220, 353, 392, 2713, 17734, 1706, 445, 716, 353, 1399, 364, 3454, 364, 20303, 326, 26708, 434, 326, 9221, 434, 12321, 635, 279, ...
m.make('fire',type='fire',xyz=(0.7,0.7,0),parent=cfire.id)
m.make('fire',type='fire',xyz=(0,0,0),parent=cfire.id)
#def dontrunme():
621785333557a3ec8a3bc40103856abc96422ef5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12932/621785333557a3ec8a3bc40103856abc96422ef5/define_world.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 468, 536, 2727, 313, 318, 3501, 13332, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 468, 536, 2727, 313, 318, 3501, 13332, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
_exposed_ = ('isSet', 'set', 'clear', 'wait')
_exposed_ = ('is_set', 'set', 'clear', 'wait')
def notify_all(self): return self._callmethod('notify_all')
1444b583fcc045791ddb183fdb22052fb015df58 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/1444b583fcc045791ddb183fdb22052fb015df58/managers.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5066, 67, 454, 12, 2890, 4672, 327, 365, 6315, 1991, 2039, 2668, 12336, 67, 454, 6134, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5066, 67, 454, 12, 2890, 4672, 327, 365, 6315, 1991, 2039, 2668, 12336, 67, 454, 6134, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
outdir = outputfile('')
outDir = outputfile('')
def test0(self): "Test if pythonpoint.pdf can be created from pythonpoint.xml."
80a5af4bd2a4641790bf438f53554e192f536b89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/80a5af4bd2a4641790bf438f53554e192f536b89/test_tools_pythonpoint.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 20, 12, 2890, 4672, 315, 4709, 309, 5790, 1153, 18, 7699, 848, 506, 2522, 628, 5790, 1153, 18, 2902, 1199, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 20, 12, 2890, 4672, 315, 4709, 309, 5790, 1153, 18, 7699, 848, 506, 2522, 628, 5790, 1153, 18, 2902, 1199, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
if not exists(root):
if not self.config.has_key(relpathto(root, self.basedir)):
def __call__(self, args): from os.path import join self.__load()
47143a9e940f950526e6db62f789e6cb91fd46ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5981/47143a9e940f950526e6db62f789e6cb91fd46ce/tailor.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 833, 4672, 628, 1140, 18, 803, 1930, 1233, 225, 365, 16186, 945, 1435, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 833, 4672, 628, 1140, 18, 803, 1930, 1233, 225, 365, 16186, 945, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
input_name = '_%s.cfg' % (name,)
input_name = '%s.cfg' % (name,)
def roda_arquivo(nome_input, nome_output, map): input = open(nome_input) lines = input.readlines() result = [] in_item = False for line in lines: # Comentário match = re.match(r'#(?P<comentario>.*)$', line) if match: result.append(comment(match.groupdict()['comentario'])) continue #2051 933 -23 match = re.match(r'(?P<x>-?[0-9]+) (?P<y>-?[0-9]+) (?P<z>-?[0-9]+)', line) if match: groups = match.groupdict() x = groups['x'] y = groups['y'] z = groups['z'] result.append(pos(x, y, z, map)) continue # Nome 0x1231 (qqrporra=XYZ) match = re.match(r'(?P<name>[A-Za-z][A-Za-z0-9]+) (?P<id>0x[0-9A-F]+)(?P<rest>.*)', line) if match: in_item = True groups = match.groupdict() name = groups['name'] id = groups['id'] rest = groups['rest'] result.append(item(name, id, rest)) continue match = re.match(r'\s*', line) if match: if in_item: result.append('\t</item>') result.append('') in_item = False continue output = open(nome_output, 'w') output.write("<decoration>\n") for l in result: output.write(l + "\n") output.write("</decoration>\n") output.close()
c678e40510b766149b1be6bfe946b2810a84522c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2534/c678e40510b766149b1be6bfe946b2810a84522c/converte.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 721, 2414, 67, 297, 372, 20593, 12, 82, 1742, 67, 2630, 16, 290, 1742, 67, 2844, 16, 852, 4672, 810, 273, 1696, 12, 82, 1742, 67, 2630, 13, 2362, 273, 810, 18, 896, 3548, 1435, 225, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 721, 2414, 67, 297, 372, 20593, 12, 82, 1742, 67, 2630, 16, 290, 1742, 67, 2844, 16, 852, 4672, 810, 273, 1696, 12, 82, 1742, 67, 2630, 13, 2362, 273, 810, 18, 896, 3548, 1435, 225, ...
conf = "/* dtool_config.h. Generated automatically by makepanda.py */\n" for key,win,unix in DTOOLDEFAULTS: val = DTOOLCONFIG[key] if (val == 'UNDEF'): conf = conf + " else: conf = conf + " ConditionalWriteFile(PREFIX+'/include/dtool_config.h',conf) CONFAUTOPRC=ReadFile("makepanda/confauto.in") if (os.path.isfile("makepanda/myconfig.in")): CONFIGPRC=ReadFile("makepanda/myconfig.in") else: CONFIGPRC=ReadFile("makepanda/config.in") if (sys.platform != "win32"): CONFAUTOPRC = CONFAUTOPRC.replace("aux-display pandadx9","") CONFAUTOPRC = CONFAUTOPRC.replace("aux-display pandadx8","") CONFAUTOPRC = CONFAUTOPRC.replace("aux-display pandadx7","") ConditionalWriteFile(PREFIX + "/etc/Confauto.prc", CONFAUTOPRC) ConditionalWriteFile(PREFIX + "/etc/Config.prc", CONFIGPRC) for pkg in (PACKAGES + ["extras"]): if (OMIT.count(pkg)==0): if (COMPILER == "MSVC7"): if (os.path.exists(THIRDPARTY+"/win-libs-vc7/"+pkg.lower()+"/bin")): CopyAllFiles(PREFIX+"/bin/",THIRDPARTY+"/win-libs-vc7/"+pkg.lower()+"/bin/") if (COMPILER == "LINUXA"): if (os.path.exists(THIRDPARTY+"/linux-libs-a/"+pkg.lower()+"/lib")): CopyAllFiles(PREFIX+"/lib/",THIRDPARTY+"/linux-libs-a/"+pkg.lower()+"/lib/") if (sys.platform == "win32"): CopyFile(PREFIX+'/bin/', 'thirdparty/win-python/python22.dll')
if (SLAVEBUILD==0): for pkg in (PACKAGES + ["extras"]): if (OMIT.count(pkg)==0): if (COMPILER == "MSVC7"): if (os.path.exists("thirdparty/win-libs-vc7/"+pkg.lower()+"/bin")): CopyAllFiles("built/bin/","thirdparty/win-libs-vc7/"+pkg.lower()+"/bin/") if (COMPILER == "LINUXA"): if (os.path.exists("thirdparty/linux-libs-a/"+pkg.lower()+"/lib")): CopyAllFiles("built/lib/","thirdparty/linux-libs-a/"+pkg.lower()+"/lib/") if (sys.platform == "win32"): CopyFile('built/bin/', 'thirdparty/win-python/python24.dll') if (OMIT.count("PYTHON")==0): CopyTree('built/python', 'thirdparty/win-python') if (SLAVEBUILD==0): CopyFile("built/", "doc/LICENSE") CopyFile("built/", "doc/ReleaseNotes") CopyAllFiles("built/plugins/", "pandatool/src/scripts/", ".mel") CopyAllFiles("built/plugins/", "pandatool/src/scripts/", ".ms")
# ifndef WIN32
8f86705296f973090fc3f2bedce1bf0e6e54e9f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/8f86705296f973090fc3f2bedce1bf0e6e54e9f6/makepanda.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 468, 309, 82, 536, 678, 706, 1578, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 468, 309, 82, 536, 678, 706, 1578, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
self.assertEquals(so_dir, os.getcwd())
self.assertEquals(so_dir, other_tmp_dir)
def test_get_outputs(self): tmp_dir = self.mkdtemp() c_file = os.path.join(tmp_dir, 'foo.c') self.write_file(c_file, 'void initfoo(void) {};\n') ext = Extension('foo', [c_file], optional=False) dist = Distribution({'name': 'xx', 'ext_modules': [ext]}) cmd = build_ext(dist) cmd.ensure_finalized() self.assertEquals(len(cmd.get_outputs()), 1)
99e067992eac472cfc36b6fb509b118553cf09f9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8125/99e067992eac472cfc36b6fb509b118553cf09f9/test_build_ext.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 588, 67, 12295, 12, 2890, 4672, 1853, 67, 1214, 273, 365, 18, 24816, 72, 5814, 1435, 276, 67, 768, 273, 1140, 18, 803, 18, 5701, 12, 5645, 67, 1214, 16, 296, 11351, 18, 71,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 588, 67, 12295, 12, 2890, 4672, 1853, 67, 1214, 273, 365, 18, 24816, 72, 5814, 1435, 276, 67, 768, 273, 1140, 18, 803, 18, 5701, 12, 5645, 67, 1214, 16, 296, 11351, 18, 71,...
self.widgets['quiz_infos']['questionNumLabel'] = gtk.Label(msg(67)\ % (self.score.get_question_total() + 1, self.param['length']))
self.widgets['quiz_infos']['questionNumLabel'] = gtk.Label( msg(67).format(self.score.get_question_total() + 1, self.param['length']))
def quiz(self, oldbox): # Randomly getting a kana (respecting bellow conditions). self.kana = self.kana_engine.randomKana()
5e25a2dd329b709a23460a382ee7bc2bada60f67 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3073/5e25a2dd329b709a23460a382ee7bc2bada60f67/gtk_gui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 16479, 12, 2890, 16, 1592, 2147, 4672, 468, 8072, 715, 8742, 279, 417, 13848, 261, 455, 1181, 310, 3952, 821, 4636, 2934, 365, 18, 79, 13848, 273, 365, 18, 79, 13848, 67, 8944, 18, 918...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 16479, 12, 2890, 16, 1592, 2147, 4672, 468, 8072, 715, 8742, 279, 417, 13848, 261, 455, 1181, 310, 3952, 821, 4636, 2934, 365, 18, 79, 13848, 273, 365, 18, 79, 13848, 67, 8944, 18, 918...
w('"%s"' % t[1])
lit = re.sub(r'[\"\\]', escchar, t[1]) w('"%s"' % lit)
def _writeTerm(self, t, vmap, level): w = self._write if t[0] is notation3.RESOURCE: nvl = vmap.get(t[1], None)
0e6ce2163d245c13ea4c5af082d1bc676b2643df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3308/0e6ce2163d245c13ea4c5af082d1bc676b2643df/KIFSink.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2626, 4065, 12, 2890, 16, 268, 16, 331, 1458, 16, 1801, 4672, 341, 273, 365, 6315, 2626, 309, 268, 63, 20, 65, 353, 12155, 23, 18, 11395, 30, 8779, 80, 273, 331, 1458, 18, 588, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2626, 4065, 12, 2890, 16, 268, 16, 331, 1458, 16, 1801, 4672, 341, 273, 365, 6315, 2626, 309, 268, 63, 20, 65, 353, 12155, 23, 18, 11395, 30, 8779, 80, 273, 331, 1458, 18, 588, ...
res = "ArrayField(%s)," % utils.indent(res, 2)
res = "ArrayField(%s),\n\n" % utils.indent(res, 2)
def getFieldFormatted(self, name, fieldtype, map={}, doc=None, indent_level=0, rawType='String', array_field=False): """Return the a formatted field definition for the schema. """
cf351150bc015de7758ae77e73767e9a6b434d56 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11941/cf351150bc015de7758ae77e73767e9a6b434d56/ArchetypesGenerator.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5031, 18298, 12, 2890, 16, 508, 16, 652, 723, 16, 852, 28793, 997, 33, 7036, 16, 3504, 67, 2815, 33, 20, 16, 25333, 2218, 780, 2187, 526, 67, 1518, 33, 8381, 4672, 3536, 990, 326, 27...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5031, 18298, 12, 2890, 16, 508, 16, 652, 723, 16, 852, 28793, 997, 33, 7036, 16, 3504, 67, 2815, 33, 20, 16, 25333, 2218, 780, 2187, 526, 67, 1518, 33, 8381, 4672, 3536, 990, 326, 27...
self.checkMessageCount(2) self.checkChangedMessage(1, removed=[self.feed2])
self.checkMessageCount(3) self.checkChangedMessage(2, removed=[self.feed2])
def testRemoved(self): self.feed2.remove() self.runUrgentCalls() self.checkMessageCount(2) self.checkChangedMessage(1, removed=[self.feed2])
69858501f3380a2140e17bd59f52ef0c473defe6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12354/69858501f3380a2140e17bd59f52ef0c473defe6/messagetest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 10026, 12, 2890, 4672, 365, 18, 7848, 22, 18, 4479, 1435, 365, 18, 2681, 57, 26876, 319, 10125, 1435, 365, 18, 1893, 1079, 1380, 12, 22, 13, 365, 18, 1893, 5033, 1079, 12, 21, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 10026, 12, 2890, 4672, 365, 18, 7848, 22, 18, 4479, 1435, 365, 18, 2681, 57, 26876, 319, 10125, 1435, 365, 18, 1893, 1079, 1380, 12, 22, 13, 365, 18, 1893, 5033, 1079, 12, 21, ...
staticdir = (root == path.join(outdir, '_static'))
staticdir = root.startswith(path.join(outdir, '_static'))
def build_hhx(self, outdir, outname): self.info('dumping stopword list...') f = self.open_file(outdir, outname+'.stp') try: for word in sorted(stopwords): print >>f, word finally: f.close()
4192925b46f66e1cceaa9b53938b1110f3738a28 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5532/4192925b46f66e1cceaa9b53938b1110f3738a28/htmlhelp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1361, 67, 21622, 92, 12, 2890, 16, 15398, 16, 596, 529, 4672, 365, 18, 1376, 2668, 13302, 1382, 2132, 1095, 666, 7821, 13, 284, 273, 365, 18, 3190, 67, 768, 12, 659, 1214, 16, 596, 5...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1361, 67, 21622, 92, 12, 2890, 16, 15398, 16, 596, 529, 4672, 365, 18, 1376, 2668, 13302, 1382, 2132, 1095, 666, 7821, 13, 284, 273, 365, 18, 3190, 67, 768, 12, 659, 1214, 16, 596, 5...
(isinstance(exc, WindowsError) and exc.winerror in (ERROR_INVALID_WINDOW_HANDLE, ERROR_TIMEOUT, RPC_S_SERVER_UNAVAILABLE, RPC_S_CALL_FAILED_DNE))
(isinstance(exc, WindowsError) and exc.winerror in (ERROR_INVALID_WINDOW_HANDLE, ERROR_TIMEOUT, RPC_S_SERVER_UNAVAILABLE, RPC_S_CALL_FAILED_DNE, RPC_E_CALL_CANCELED))
def exception(self, msg="", exc_info=True): """Log an exception at an appropriate levle. Normally, it will be logged at level "ERROR". However, certain exceptions which aren't considered errors (or aren't errors that we can fix) are expected and will therefore be logged at a lower level. """ import comtypes if exc_info is True: exc_info = sys.exc_info()
d4952eab50ea6bd5736a41322dfd7db8d1478c1b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9340/d4952eab50ea6bd5736a41322dfd7db8d1478c1b/logHandler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1520, 12, 2890, 16, 1234, 1546, 3113, 3533, 67, 1376, 33, 5510, 4672, 3536, 1343, 392, 1520, 622, 392, 5505, 18565, 298, 18, 24773, 1230, 16, 518, 903, 506, 7545, 622, 1801, 315, 3589, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1520, 12, 2890, 16, 1234, 1546, 3113, 3533, 67, 1376, 33, 5510, 4672, 3536, 1343, 392, 1520, 622, 392, 5505, 18565, 298, 18, 24773, 1230, 16, 518, 903, 506, 7545, 622, 1801, 315, 3589, ...
static void *gen_void_ptr(int no ATTRIBUTE_UNUSED) { return(NULL); } static void des_void_ptr(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED) {
static void *gen_void_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { return(NULL); } static void des_void_ptr(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
def is_known_param_type(name): for type in known_param_types: if type == name: return 1 return 0
3d97e669eca6f4849c7b3014f472cacc57817015 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12659/3d97e669eca6f4849c7b3014f472cacc57817015/gentest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 67, 2994, 67, 891, 67, 723, 12, 529, 4672, 364, 618, 316, 4846, 67, 891, 67, 2352, 30, 309, 618, 422, 508, 30, 327, 404, 327, 374, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 67, 2994, 67, 891, 67, 723, 12, 529, 4672, 364, 618, 316, 4846, 67, 891, 67, 2352, 30, 309, 618, 422, 508, 30, 327, 404, 327, 374, 225, 2, -100, -100, -100, -100, -100, -100, ...
start_date = dates_lim[0]
start_date = dates_lims[0]
def mask_period(data, period=None, start_date=None, end_date=None, inside=True, include_edges=True, inplace=False): """Returns x as an array masked where dates fall outside the selection period,
79a636b650d9ff431e0d5e5d02f0e3ad98ef1639 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12971/79a636b650d9ff431e0d5e5d02f0e3ad98ef1639/tseries.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3066, 67, 6908, 12, 892, 16, 3879, 33, 7036, 16, 787, 67, 712, 33, 7036, 16, 679, 67, 712, 33, 7036, 16, 4832, 33, 5510, 16, 2341, 67, 8746, 33, 5510, 16, 11783, 33, 8381, 4672, 35...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3066, 67, 6908, 12, 892, 16, 3879, 33, 7036, 16, 787, 67, 712, 33, 7036, 16, 679, 67, 712, 33, 7036, 16, 4832, 33, 5510, 16, 2341, 67, 8746, 33, 5510, 16, 11783, 33, 8381, 4672, 35...
fp = file(filename)
fp = file(filename,'rb')
def do_load(self): self.lock_file() try: try: # TODO : why does this load fails sometimes with an EOFError ? filename = os.path.join(self._sessdir, 'mp_sess_%s' % self._sid) fp = file(filename) try: data = cPickle.load(fp) if (time.time() - data["_accessed"]) <= data["_timeout"]: # Change the file access time to the current time so the # cleanup does not delete this file before the request # can save it's session data os.utime(filename,None) return data finally: fp.close() except: s = cStringIO.StringIO() traceback.print_exc(file=s) s = s.getvalue() self._req.log_error('Error while loading a session : %s'%s) return None finally: self.unlock_file()
d412f0820c82d32fbb80317cc86d5d8fd7f86ffa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10002/d412f0820c82d32fbb80317cc86d5d8fd7f86ffa/FileSession.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 945, 12, 2890, 4672, 365, 18, 739, 67, 768, 1435, 775, 30, 775, 30, 468, 2660, 294, 11598, 1552, 333, 1262, 6684, 16594, 598, 392, 6431, 668, 692, 1544, 273, 1140, 18, 803, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 945, 12, 2890, 4672, 365, 18, 739, 67, 768, 1435, 775, 30, 775, 30, 468, 2660, 294, 11598, 1552, 333, 1262, 6684, 16594, 598, 392, 6431, 668, 692, 1544, 273, 1140, 18, 803, ...
...the URL string will be "http //cdsware.cern.ch/" and the URL description will also be "http //cdsware.cern.ch/".
...the URL string will be "http://cdsware.cern.ch/" and the URL description will also be "http://cdsware.cern.ch/".
def identify_and_tag_URLs(line): """Given a reference line, identify URLs in the line, record the information about them, and replace them with a "<cds.URL />" tag. URLs are identified in 2 forms: + Raw: http //cdsware.cern.ch/ + HTML marked-up: <a href="http //cdsware.cern.ch/">CERN Document Server Software Consortium</a> These URLs are considered to have 2 components: The URL itself (url string); and the URL description. The description is effectively the text used for the created Hyperlink when the URL is marked-up in HTML. When an HTML marked-up URL has been recognised, the text between the anchor tags is therefore taken as the URL description. In the case of a raw URL recognition, however, the URL itself will also be used as the URL description. For example, in the following reference line: [1] See <a href="http //cdsware.cern.ch/">CERN Document Server Software Consortium</a>. ...the URL string will be "http //cdsware.cern.ch/" and the URL description will be "CERN Document Server Software Consortium". The line returned from this function will be: [1] See <cds.URL /> In the following line, however: [1] See http //cdsware.cern.ch/ for more details. ...the URL string will be "http //cdsware.cern.ch/" and the URL description will also be "http //cdsware.cern.ch/". The line returned will be: [1] See <cds.URL /> for more details. Note that URLs recognised may not have the colon separator in the protocol. This is because in the step prior to the calling of this function, colons will have been removed from the line so that numeration (as found in journal article citations) could be identified and tagged. @param line: (string) the reference line in which to search for URLs. @return: (tuple) - containing 2 items: + the line after URLs have been recognised and removed; + a list of 2-item tuples where each tuple represents a recognised URL and its description: [(url, url-description), (url, url-description), ... ] @Exceptions raised: + an IndexError if there is a problem with the number of URLs recognised (this should not happen.) """ ## Take a copy of the line: line_pre_url_check = line ## Dictionaries to record details of matched URLs: found_url_full_matchlen = {} found_url_urlstring = {} found_url_urldescr = {} ## List to contain details of all matched URLs: identified_urls = [] ## Attempt to identify and tag all HTML-MARKED-UP URLs in the line: m_tagged_url_iter = sre_html_tagged_url.finditer(line) for m_tagged_url in m_tagged_url_iter: startposn = m_tagged_url.start() ## start position of matched URL endposn = m_tagged_url.end() ## end position of matched URL matchlen = len(m_tagged_url.group(0)) ## total length of URL match found_url_full_matchlen[startposn] = matchlen found_url_urlstring[startposn] = m_tagged_url.group(3) found_url_urldescr[startposn] = m_tagged_url.group(12) ## temporarily replace the URL match with underscores so that ## it won't be re-found line = line[0:startposn] + u"_"*matchlen + line[endposn:] ## Attempt to identify and tag all RAW (i.e. not ## HTML-marked-up) URLs in the line: m_raw_url_iter = sre_raw_url.finditer(line) for m_raw_url in m_raw_url_iter: startposn = m_raw_url.start() ## start position of matched URL endposn = m_raw_url.end() ## end position of matched URL matchlen = len(m_raw_url.group(0)) ## total length of URL match matched_url = m_raw_url.group(1) if len(matched_url) > 0 and matched_url[-1] in (".", ","): ## Strip the full-stop or comma from the end of the url: matched_url = matched_url[:-1] found_url_full_matchlen[startposn] = matchlen found_url_urlstring[startposn] = matched_url found_url_urldescr[startposn] = matched_url ## temporarily replace the URL match with underscores ## so that it won't be re-found line = line[0:startposn] + u"_"*matchlen + line[endposn:] ## Now that all URLs have been identified, insert them ## back into the line, tagged: found_url_positions = found_url_urlstring.keys() found_url_positions.sort() found_url_positions.reverse() for url_position in found_url_positions: line = line[0:url_position] + "<cds.URL />" \ + line[url_position + found_url_full_matchlen[url_position]:] ## The line has been rebuilt. Now record the information about the ## matched URLs: found_url_positions = found_url_urlstring.keys() found_url_positions.sort() for url_position in found_url_positions: identified_urls.append((found_url_urlstring[url_position], \ found_url_urldescr[url_position])) if len(identified_urls) != len(found_url_positions): ## Somehow the number of URLs found doesn't match the number of ## URLs recorded in "identified_urls". Raise an IndexError. msg = """Error: The number of URLs found in the reference line """ \ """does not match the number of URLs recorded in the """ \ """list of identified URLs!\nLine pre-URL checking: %s\n""" \ """Line post-URL checking: %s\n""" \ % (line_pre_url_check, line) raise IndexError(msg) ## return the line containing the tagged URLs: return (line, identified_urls)
1d6f7a5e95c56c50f28e6e12c01234899064c396 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12027/1d6f7a5e95c56c50f28e6e12c01234899064c396/refextract.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9786, 67, 464, 67, 2692, 67, 15749, 12, 1369, 4672, 3536, 6083, 279, 2114, 980, 16, 9786, 10414, 316, 326, 980, 16, 1409, 326, 1779, 2973, 2182, 16, 471, 1453, 2182, 598, 279, 3532, 71...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9786, 67, 464, 67, 2692, 67, 15749, 12, 1369, 4672, 3536, 6083, 279, 2114, 980, 16, 9786, 10414, 316, 326, 980, 16, 1409, 326, 1779, 2973, 2182, 16, 471, 1453, 2182, 598, 279, 3532, 71...
os.unlink(src.name)
def do_config(self): if self.job_manager.has_jobs(): d = error_dialog(self, _('Cannot configure'), _('Cannot configure while there are running jobs.')) d.exec_() return columns = [(self.library_view.isColumnHidden(i), \ self.library_view.model().headerData(i, Qt.Horizontal, Qt.DisplayRole).toString())\ for i in range(self.library_view.model().columnCount(None))] d = ConfigDialog(self, self.library_view.model().db, columns) d.exec_() if d.result() == d.Accepted: self.library_view.set_visible_columns(d.final_columns) if os.path.dirname(self.database_path) != d.database_location: try: newloc = os.path.join(d.database_location, os.path.basename(self.database_path)) if not os.path.exists(newloc): dirname = os.path.dirname(newloc) if not os.path.isdir(dirname): os.makedirs(dirname) dest = open(newloc, 'wb') if os.access(self.database_path, os.R_OK): self.status_bar.showMessage('Copying database to '+newloc) self.setCursor(Qt.BusyCursor) self.library_view.setEnabled(False) self.library_view.close() src = open(self.database_path, 'rb') shutil.copyfileobj(src, dest) src.close() dest.close() os.unlink(self.database_path) else: try: db = LibraryDatabase(newloc) db.close() except Exception, err: d = error_dialog(self, _('Invalid database'), _('<p>An invalid database already exists at %s, delete it before trying to move the existing database.<br>Error: %s')%(newloc, str(err))) newloc = self.database_path self.database_path = newloc settings = Settings() settings.setValue("database path", QVariant(self.database_path)) os.unlink(src.name) except Exception, err: traceback.print_exc() d = error_dialog(self, _('Could not move database'), unicode(err)) d.exec_() finally: self.unsetCursor() self.library_view.setEnabled(True) self.status_bar.clearMessage() self.search.clear_to_help() self.status_bar.reset_info() self.library_view.set_database(self.database_path) self.library_view.sortByColumn(3, Qt.DescendingOrder) self.library_view.resizeRowsToContents() if hasattr(d, 'directories'): set_sidebar_directories(d.directories) self.library_view.model().read_config()
222d3fa2f37f6ffad4f4f2cb09bca53c89349fd0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9125/222d3fa2f37f6ffad4f4f2cb09bca53c89349fd0/main.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 1425, 12, 2890, 4672, 309, 365, 18, 4688, 67, 4181, 18, 5332, 67, 10088, 13332, 302, 273, 555, 67, 12730, 12, 2890, 16, 389, 2668, 4515, 5068, 19899, 389, 2668, 4515, 5068, 13...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 1425, 12, 2890, 4672, 309, 365, 18, 4688, 67, 4181, 18, 5332, 67, 10088, 13332, 302, 273, 555, 67, 12730, 12, 2890, 16, 389, 2668, 4515, 5068, 19899, 389, 2668, 4515, 5068, 13...
simplejson.dump(dumpObject,fh)
simplejson.dump(dumpObject, fh, ensure_ascii=False)
def putDumpToFile(self,ooid,dumpObject, timestamp=None): """ Given a ooid and an dumpObject, create the appropriate dump file and fill it with object's data """ fh = self.newEntry(ooid, timestamp) try: simplejson.dump(dumpObject,fh) finally: fh.close()
7b819765e3728314049a7f24f3000465d5dcb797 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12383/7b819765e3728314049a7f24f3000465d5dcb797/processedDumpStorage.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1378, 10628, 15450, 12, 2890, 16, 83, 839, 16, 8481, 921, 16, 2858, 33, 7036, 4672, 3536, 16803, 279, 320, 839, 471, 392, 4657, 921, 16, 752, 326, 5505, 4657, 585, 471, 3636, 518, 598,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1378, 10628, 15450, 12, 2890, 16, 83, 839, 16, 8481, 921, 16, 2858, 33, 7036, 4672, 3536, 16803, 279, 320, 839, 471, 392, 4657, 921, 16, 752, 326, 5505, 4657, 585, 471, 3636, 518, 598,...
q = params.get('q', None)
q = params.get('q')
def advanced_to_simple(params): q_list = [] q = params.get('q', None) if q and q != '*:*': q_list.append(params['q']) for k in 'title', 'author': if k in params: q_list.append("%s:(%s)" % (k, params[k])) return ' '.join(q_list)
1fa11b06e5d6f25e789c3ba7e4898691478392d9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3913/1fa11b06e5d6f25e789c3ba7e4898691478392d9/code.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 16111, 67, 869, 67, 9647, 12, 2010, 4672, 1043, 67, 1098, 273, 5378, 1043, 273, 859, 18, 588, 2668, 85, 6134, 309, 1043, 471, 1043, 480, 14609, 30, 4035, 30, 1043, 67, 1098, 18, 6923, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 16111, 67, 869, 67, 9647, 12, 2010, 4672, 1043, 67, 1098, 273, 5378, 1043, 273, 859, 18, 588, 2668, 85, 6134, 309, 1043, 471, 1043, 480, 14609, 30, 4035, 30, 1043, 67, 1098, 18, 6923, ...
self.canvas.lower(self.id, belowthis)
self.canvas.tag_lower(self.id, belowthis)
def lower(self, belowthis=None): self.canvas.lower(self.id, belowthis)
00236f38dabd16ffe5da4d75664f051c37833aa5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/00236f38dabd16ffe5da4d75664f051c37833aa5/Canvas.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2612, 12, 2890, 16, 5712, 2211, 33, 7036, 4672, 365, 18, 15424, 18, 8167, 12, 2890, 18, 350, 16, 5712, 2211, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2612, 12, 2890, 16, 5712, 2211, 33, 7036, 4672, 365, 18, 15424, 18, 8167, 12, 2890, 18, 350, 16, 5712, 2211, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
values = dict[key] if half_in < 0: if new_bond: values += [value] else: found = False for ii in range(len(values)): if type(values[ii]) == type(1): if value == values[ii]: found = True break elif value == values[ii][0]: values[ii] = value
dict[key] = [(value, half_in)] else: values = dict[key] if half_in < 0: if new_bond: values += [value] else: found = False for ii in range(len(values)): if type(values[ii]) == type(1): if value == values[ii]:
def _createBond(self, dict, key, value, half_in = -1, new_bond = False): # TODO: fix indent levels. """ Create a new bond if <new_bond> is True. Otherwise, search if there is such a full/half bond, change it appropriately if found. Otherwise, create a new bond. If <half_in> == -1, it's a full bond; otherwise, it means a half bond with the atom of <half_in> is inside. """ if not key in dict: if half_in < 0: dict[key] = [value] else: dict[key] = [(value, half_in)] else: values = dict[key] if half_in < 0: if new_bond: values += [value] else: found = False for ii in range(len(values)): if type(values[ii]) == type(1): if value == values[ii]: found = True break elif value == values[ii][0]: values[ii] = value found = True break if not found: values += [value] else: if new_bond: values +=[(value, half_in)] else: try: idex = values.index((value, half_in)) except: values += [(value, half_in)] dict[key] = values
be7153ce421a674e97de640e3063c3bb1bccf4a9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/be7153ce421a674e97de640e3063c3bb1bccf4a9/shape.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2640, 9807, 12, 2890, 16, 2065, 16, 498, 16, 460, 16, 8816, 67, 267, 273, 300, 21, 16, 394, 67, 26425, 273, 1083, 4672, 468, 2660, 30, 2917, 3504, 7575, 18, 3536, 1788, 279, 394...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2640, 9807, 12, 2890, 16, 2065, 16, 498, 16, 460, 16, 8816, 67, 267, 273, 300, 21, 16, 394, 67, 26425, 273, 1083, 4672, 468, 2660, 30, 2917, 3504, 7575, 18, 3536, 1788, 279, 394...
failure()
usagefailure('ERROR: WRONG NUMBER OF ARGUMENTS FOR nccmp.py')
def compare(file1, file2, variables, exclude, tol): try: from netCDF4 import Dataset as NC except: from netCDF3 import Dataset as NC from numpy import unique, r_ try: nc1 = NC(file1, 'r') nc2 = NC(file2, 'r') except: # This can happen if one of the files could not be opened. failure() if (exclude == False): if len(variables) == 0: vars1 = nc1.variables.keys() vars2 = nc2.variables.keys() variables = unique(r_[vars1, vars2]) for each in variables: compare_vars(nc1, nc2, each, tol) else: vars1 = nc1.variables.keys() vars2 = nc2.variables.keys() vars = unique(r_[vars1, vars2]) for each in vars: if (each in variables): continue compare_vars(nc1, nc2, each, tol)
600c993bfecdc1612e545f1cceece934dd01593b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7383/600c993bfecdc1612e545f1cceece934dd01593b/nccmp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3400, 12, 768, 21, 16, 585, 22, 16, 3152, 16, 4433, 16, 6085, 4672, 775, 30, 628, 2901, 39, 4577, 24, 1930, 10778, 487, 423, 39, 1335, 30, 628, 2901, 39, 4577, 23, 1930, 10778, 487, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3400, 12, 768, 21, 16, 585, 22, 16, 3152, 16, 4433, 16, 6085, 4672, 775, 30, 628, 2901, 39, 4577, 24, 1930, 10778, 487, 423, 39, 1335, 30, 628, 2901, 39, 4577, 23, 1930, 10778, 487, ...
if exists(dst): print "Warning: %r already exists, unlinking" % dst os.unlink(dst)
if exists(fpath): print "Warning: %r already exists, unlinking" % fpath os.unlink(fpath)
def unlink(fpath): if exists(dst): print "Warning: %r already exists, unlinking" % dst os.unlink(dst)
478a0d7d00d257df93b2e71bce64d6249aa56769 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7707/478a0d7d00d257df93b2e71bce64d6249aa56769/scripts.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8255, 12, 28900, 4672, 309, 1704, 12, 28900, 4672, 1172, 315, 6210, 30, 738, 86, 1818, 1704, 16, 8255, 310, 6, 738, 13543, 1140, 18, 318, 1232, 12, 28900, 13, 282, 2, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8255, 12, 28900, 4672, 309, 1704, 12, 28900, 4672, 1172, 315, 6210, 30, 738, 86, 1818, 1704, 16, 8255, 310, 6, 738, 13543, 1140, 18, 318, 1232, 12, 28900, 13, 282, 2, -100, -100, -100,...
methodname = 'repr_' + join(split(type(x).__name__), '_') if hasattr(self, methodname): return getattr(self, methodname)(x, level) else: return cram(stripid(repr(x)), self.maxother)
if hasattr(type(x), '__name__'): methodname = 'repr_' + join(split(type(x).__name__), '_') if hasattr(self, methodname): return getattr(self, methodname)(x, level) return cram(stripid(repr(x)), self.maxother)
def repr1(self, x, level): methodname = 'repr_' + join(split(type(x).__name__), '_') if hasattr(self, methodname): return getattr(self, methodname)(x, level) else: return cram(stripid(repr(x)), self.maxother)
9e10a95d470d9809c1a73fcb3af977a663e21a39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/9e10a95d470d9809c1a73fcb3af977a663e21a39/pydoc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8480, 21, 12, 2890, 16, 619, 16, 1801, 4672, 707, 529, 273, 296, 12715, 4623, 397, 1233, 12, 4939, 12, 723, 12, 92, 2934, 972, 529, 972, 3631, 4427, 13, 309, 3859, 12, 2890, 16, 707,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8480, 21, 12, 2890, 16, 619, 16, 1801, 4672, 707, 529, 273, 296, 12715, 4623, 397, 1233, 12, 4939, 12, 723, 12, 92, 2934, 972, 529, 972, 3631, 4427, 13, 309, 3859, 12, 2890, 16, 707,...
osm.bsm.addNickChunk( chunks, irc_to_dc(u.inick), new_infoindex)
if new_infoindex == old_infoindex: friendly_change = "well that was pointless" else: friendly_change = "%s -> %s" % ( scfg.chan_umodes.friendly[old_infoindex], scfg.chan_umodes.friendly[new_infoindex]) osm.bsm.addNickChunk( chunks, irc_to_dc(u.inick), new_infoindex)
def setChannelUserModes(self, whoset, u, changes): # changes: dict of {mode -> on_off} if u not in self.chanusers: LOG.error("setChannelUserModes: %r not in channel." % u) return
2f4956b1445682fd7dfe11c3b9b7247bb52b598e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8524/2f4956b1445682fd7dfe11c3b9b7247bb52b598e/bridge_server.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 2909, 1299, 18868, 12, 2890, 16, 600, 538, 278, 16, 582, 16, 3478, 4672, 468, 3478, 30, 2065, 434, 288, 3188, 317, 603, 67, 3674, 97, 309, 582, 486, 316, 365, 18, 7472, 5577, 30...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 2909, 1299, 18868, 12, 2890, 16, 600, 538, 278, 16, 582, 16, 3478, 4672, 468, 3478, 30, 2065, 434, 288, 3188, 317, 603, 67, 3674, 97, 309, 582, 486, 316, 365, 18, 7472, 5577, 30...
gamess params we want to write to an mmp file from this set.
gamess params we want to write to an mmp file from this set, sorted by <param name>.
def param_names_and_valstrings(self): #bruce 050701; extended by Mark 050704 to return the proper set of params """Return a list of pairs of (<param name>, <param value printable by %s>) for all gamess params we want to write to an mmp file from this set. These names and value-strings need to be recognized and decoded by the info_gamess_setitem method of this class, and they need to strictly follow certain rules documented in comments in the self.writemmp() method. Note: If we implement a "duplicate" context menu command for gamess jigs, it should work by generating this same set of items, and feeding them to that same info_gamess_setitem method (or an appropriate subroutine it calls) of the new jig being made as a copy. """ items = [] items = self.ui.get_mmp_parms() return items
cb18fd8e13b495ff2f5fc622ff2570903aeaa260 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/cb18fd8e13b495ff2f5fc622ff2570903aeaa260/jig_Gamess.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 579, 67, 1973, 67, 464, 67, 4524, 371, 87, 12, 2890, 4672, 468, 2848, 3965, 374, 3361, 27, 1611, 31, 7021, 635, 6622, 374, 3361, 27, 3028, 358, 327, 326, 5338, 444, 434, 859, 3536, 9...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 579, 67, 1973, 67, 464, 67, 4524, 371, 87, 12, 2890, 4672, 468, 2848, 3965, 374, 3361, 27, 1611, 31, 7021, 635, 6622, 374, 3361, 27, 3028, 358, 327, 326, 5338, 444, 434, 859, 3536, 9...
def _utest(tester, name, doc, filename, lineno): import sys from StringIO import StringIO old = sys.stdout sys.stdout = new = StringIO() try: failures, tries = tester.runstring(doc, name) finally: sys.stdout = old if failures: msg = new.getvalue() lname = '.'.join(name.split('.')[-1:]) if not lineno: lineno = "0 (don't know line number)" raise DocTestTestFailure('Failed doctest test for %s\n' ' File "%s", line %s, in %s\n\n%s' % (name, filename, lineno, lname, msg)) class DocTestTestFailure(Exception): """A doctest test failed""" def DocTestSuite(module=None): """Convert doctest tests for a module to a unittest TestSuite. The returned TestSuite is to be run by the unittest framework, and runs each doctest in the module. If any of the doctests fail, then the synthesized unit test fails, and an error is raised showing the name of the file containing the test and a (sometimes approximate) line number. The optional module argument provides the module to be tested. It can be a module object or a (possibly dotted) module name. If not specified, the module calling DocTestSuite() is used. Example (although note that unittest supplies many ways to use the TestSuite returned; see the unittest docs): import unittest import doctest import my_module_with_doctests suite = doctest.DocTestSuite(my_module_with_doctests) runner = unittest.TextTestRunner() runner.run(suite)
from StringIO import StringIO import os import sys import tempfile import unittest class DocTestTestCase(unittest.TestCase): """A test case that wraps a test function. This is useful for slipping pre-existing test functions into the PyUnit framework. Optionally, set-up and tidy-up functions can be supplied. As with TestCase, the tidy-up ('tearDown') function will always be called if the set-up ('setUp') function ran successfully.
def _find_tests(module, prefix=None): if prefix is None: prefix = module.__name__ mdict = module.__dict__ tests = [] # Get the module-level doctest (if any). _get_doctest(prefix, module, tests, '', lineno="1 (or above)") # Recursively search the module __dict__ for doctests. if prefix: prefix += "." _extract_doctests(mdict.items(), module, mdict, tests, prefix) return tests
1323871f770a1332c44031c18abe670abdf6c641 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1323871f770a1332c44031c18abe670abdf6c641/doctest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4720, 67, 16341, 12, 2978, 16, 1633, 33, 7036, 4672, 309, 1633, 353, 599, 30, 1633, 273, 1605, 16186, 529, 972, 312, 1576, 273, 1605, 16186, 1576, 972, 7434, 273, 5378, 468, 968, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4720, 67, 16341, 12, 2978, 16, 1633, 33, 7036, 4672, 309, 1633, 353, 599, 30, 1633, 273, 1605, 16186, 529, 972, 312, 1576, 273, 1605, 16186, 1576, 972, 7434, 273, 5378, 468, 968, ...
msg['Subject'] = mail.headencode(self.ui, subject, self.charsets)
msg['Subject'] = mail.headencode(self.ui, subject, self.charsets, self.test)
def fix_subject(subject): '''try to make subject line exist and be useful.'''
fe4d7ee89491fa2e41d35f218205af0fd40dd232 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11312/fe4d7ee89491fa2e41d35f218205af0fd40dd232/notify.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2917, 67, 7857, 12, 7857, 4672, 9163, 698, 358, 1221, 3221, 980, 1005, 471, 506, 5301, 1093, 6309, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2917, 67, 7857, 12, 7857, 4672, 9163, 698, 358, 1221, 3221, 980, 1005, 471, 506, 5301, 1093, 6309, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if p2cread is not None: p2cread.Close() if c2pwrite is not None: c2pwrite.Close() if errwrite is not None: errwrite.Close()
def _execute_child(self, args, executable, preexec_fn, close_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite): """Execute program (MS Windows version)"""
b40355d862c92f0fa60ea6e4f7f27b56a96b7ff1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/b40355d862c92f0fa60ea6e4f7f27b56a96b7ff1/subprocess.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 8837, 67, 3624, 12, 2890, 16, 833, 16, 9070, 16, 675, 4177, 67, 4293, 16, 1746, 67, 74, 2377, 16, 7239, 16, 1550, 16, 26182, 67, 31276, 16, 11850, 1376, 16, 6710, 7133, 16, 5972...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 8837, 67, 3624, 12, 2890, 16, 833, 16, 9070, 16, 675, 4177, 67, 4293, 16, 1746, 67, 74, 2377, 16, 7239, 16, 1550, 16, 26182, 67, 31276, 16, 11850, 1376, 16, 6710, 7133, 16, 5972...
print >> fp, '
print >> fp, '
def _addvirtual(mlist, fp): listname = mlist.internal_name() fieldsz = len(listname) + len('-unsubscribe') hostname = mlist.host_name # Set up the mailman-loop address loopaddr = mlist.no_reply_address loopdest = Utils.ParseEmail(loopaddr)[0] # Seek to the end of the text file, but if it's empty write the standard # disclaimer, and the loop catch address. fp.seek(0, 2) if not fp.tell(): print >> fp, """\
0ed4bbf9bee8e4a319d0c8cb122ca9be1e632c9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/0ed4bbf9bee8e4a319d0c8cb122ca9be1e632c9b/Postfix.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1289, 12384, 12, 781, 376, 16, 4253, 4672, 666, 529, 273, 312, 1098, 18, 7236, 67, 529, 1435, 1466, 94, 273, 562, 12, 1098, 529, 13, 397, 562, 2668, 17, 318, 9174, 6134, 5199, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1289, 12384, 12, 781, 376, 16, 4253, 4672, 666, 529, 273, 312, 1098, 18, 7236, 67, 529, 1435, 1466, 94, 273, 562, 12, 1098, 529, 13, 397, 562, 2668, 17, 318, 9174, 6134, 5199, 2...
tmp = os.path.normpath(tempfile.mktemp())
tmp = os.path.normpath(tempfile.mktemp('.lnk'))
def __call__(self, target, source, env, for_signature): cmd = env.subst_list(self.cmd, 0, target, source)[0] if for_signature or \ (reduce(lambda x, y: x + len(y), cmd, 0) + len(cmd)) <= 2048: return self.cmd else: # In Cygwin, we want to use rm to delete the temporary file, # because del does not exist in the sh shell. rm = env.Detect('rm') or 'del'
5e922d474a53d2bb706809aec96aad3dd622d3f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12817/5e922d474a53d2bb706809aec96aad3dd622d3f5/win32.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 1018, 16, 1084, 16, 1550, 16, 364, 67, 8195, 4672, 1797, 273, 1550, 18, 1717, 334, 67, 1098, 12, 2890, 18, 4172, 16, 374, 16, 1018, 16, 1084, 25146, 20...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 1018, 16, 1084, 16, 1550, 16, 364, 67, 8195, 4672, 1797, 273, 1550, 18, 1717, 334, 67, 1098, 12, 2890, 18, 4172, 16, 374, 16, 1018, 16, 1084, 25146, 20...
[(1, 5, 12), (2, 9, 19), (3, 13, 17), (4, 8, 15), (6, 16, 20), (7, 11, 18), (10, 14, 21)]
[(1, 15, 8), (2, 16, 12), (3, 20, 4), (5, 7, 18), (6, 14, 10), (9, 11, 19), (13, 21, 17)]
def tau123(T1, T2): """ Compute the tau_i representation for a bitrade (T1, T2). See the functions tau1, tau2, and tau3 for the mathematical definitions. RETURNS: (cells_map, t1, t2, t3) where cells_map is a map to/from the filled cells of T1, and t1, t2, t3 are the tau1, tau2, tau3 permutations. EXAMPLES: sage: from sage.combinat.matrices.latin import * sage: (a, b, c, G) = pq_group_bitrade_generators(3, 7) sage: (T1, T2) = bitrade_from_group(a, b, c, G) sage: print T1 [0 6 4] [1 0 5] [2 1 6] [3 2 0] [4 3 1] [5 4 2] [6 5 3] sage: print T2 [6 4 0] [0 5 1] [1 6 2] [2 0 3] [3 1 4] [4 2 5] [5 3 6] sage: (cells_map, t1, t2, t3) = tau123(T1, T2) sage: print cells_map {1: (0, 0), 2: (0, 1), 3: (0, 2), 4: (1, 0), 5: (1, 1), 6: (1, 2), 7: (2, 0), 8: (2, 1), 9: (2, 2), 10: (3, 0), 11: (3, 1), 12: (3, 2), 13: (4, 0), (2, 1): 8, 15: (4, 2), 16: (5, 0), 17: (5, 1), 18: (5, 2), 19: (6, 0), 20: (6, 1), 21: (6, 2), (5, 1): 17, (4, 0): 13, (1, 2): 6, (3, 0): 10, (5, 0): 16, (2, 2): 9, (4, 1): 14, (1, 1): 5, (3, 2): 12, (0, 0): 1, (6, 0): 19, 14: (4, 1), (4, 2): 15, (1, 0): 4, (0, 1): 2, (6, 1): 20, (3, 1): 11, (2, 0): 7, (6, 2): 21, (5, 2): 18, (0, 2): 3} sage: print cells_map_as_square(cells_map, max(T1.nrows(), T1.ncols())) [ 1 2 3 -1 -1 -1 -1] [ 4 5 6 -1 -1 -1 -1] [ 7 8 9 -1 -1 -1 -1] [10 11 12 -1 -1 -1 -1] [13 14 15 -1 -1 -1 -1] [16 17 18 -1 -1 -1 -1] [19 20 21 -1 -1 -1 -1] sage: t1 [3, 1, 2, 6, 4, 5, 9, 7, 8, 12, 10, 11, 15, 13, 14, 18, 16, 17, 21, 19, 20] sage: t2 [19, 17, 12, 1, 20, 15, 4, 2, 18, 7, 5, 21, 10, 8, 3, 13, 11, 6, 16, 14, 9] sage: print t3 [5, 9, 13, 8, 12, 16, 11, 15, 19, 14, 18, 1, 17, 21, 4, 20, 3, 7, 2, 6, 10] sage: t1.to_cycles() [(1, 3, 2), (4, 6, 5), (7, 9, 8), (10, 12, 11), (13, 15, 14), (16, 18, 17), (19, 21, 20)] sage: t2.to_cycles() [(1, 19, 16, 13, 10, 7, 4), (2, 17, 11, 5, 20, 14, 8), (3, 12, 21, 9, 18, 6, 15)] sage: t3.to_cycles() [(1, 5, 12), (2, 9, 19), (3, 13, 17), (4, 8, 15), (6, 16, 20), (7, 11, 18), (10, 14, 21)] The product t1*t2*t3 is the identity, i.e. it fixes every point: sage: len((t1*t2*t3).fixed_points()) == T1.nr_filled_cells() True """ assert is_bitrade(T1, T2) cells_map = T1.filled_cells_map() t1 = tau1(T1, T2, cells_map) t2 = tau2(T1, T2, cells_map) t3 = tau3(T1, T2, cells_map) return (cells_map, t1, t2, t3)
0d333d6beb48cce2a6cb9f6c18b5d14e9b0765b2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/0d333d6beb48cce2a6cb9f6c18b5d14e9b0765b2/latin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12284, 12936, 12, 56, 21, 16, 399, 22, 4672, 3536, 8155, 326, 12284, 67, 77, 4335, 364, 279, 2831, 354, 323, 261, 56, 21, 16, 399, 22, 2934, 2164, 326, 4186, 12284, 21, 16, 12284, 22...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12284, 12936, 12, 56, 21, 16, 399, 22, 4672, 3536, 8155, 326, 12284, 67, 77, 4335, 364, 279, 2831, 354, 323, 261, 56, 21, 16, 399, 22, 2934, 2164, 326, 4186, 12284, 21, 16, 12284, 22...
path = settings.get('path', 'text')
path = settings.get_path('media', 'text')
def medialist(): answer = dict() answer['all'] = [] answer['audio'] = [] answer['video'] = [] answer['txt'] = [] path = settings.get('path', 'video') if isdir(path): for f in listdir(path): if f[0] != '.': answer['video'].append(f) path = settings.get('path', 'audio') if isdir(path): for f in listdir(path): if f[0] != '.': answer['audio'].append(f) path = settings.get('path', 'text') if isdir(path): for f in listdir(path): if f[0] != '.': answer['txt'].append(f) for i, liste in answer.items(): answer[i] = sorted(liste) return sendjson(answer)
dd723e8bcb4b72c7741d7b934e923ce7663ad7ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4363/dd723e8bcb4b72c7741d7b934e923ce7663ad7ef/server.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6735, 649, 376, 13332, 5803, 273, 2065, 1435, 5803, 3292, 454, 3546, 273, 5378, 5803, 3292, 11509, 3546, 273, 5378, 5803, 3292, 9115, 3546, 273, 5378, 5803, 3292, 5830, 3546, 273, 5378, 22...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6735, 649, 376, 13332, 5803, 273, 2065, 1435, 5803, 3292, 454, 3546, 273, 5378, 5803, 3292, 11509, 3546, 273, 5378, 5803, 3292, 9115, 3546, 273, 5378, 5803, 3292, 5830, 3546, 273, 5378, 22...
if date is not None:
if date:
def __init__(self, repo, parents=None, text="", user=None, date=None, extra=None, changes=None): self._repo = repo self._rev = None self._node = None self._text = text if date is not None: self._date = util.parsedate(date) else: self._date = util.makedate() if user: self._user = user else: self._user = self._repo.ui.username() if parents: p1, p2 = parents self._parents = [self._repo.changectx(p) for p in (p1, p2)] if changes: self._status = list(changes)
f70f9e2ad182aa06bc3b803b420151274d656e91 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11312/f70f9e2ad182aa06bc3b803b420151274d656e91/context.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 3538, 16, 6298, 33, 7036, 16, 977, 1546, 3113, 729, 33, 7036, 16, 1509, 33, 7036, 16, 2870, 33, 7036, 16, 3478, 33, 7036, 4672, 365, 6315, 7422, 273, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 3538, 16, 6298, 33, 7036, 16, 977, 1546, 3113, 729, 33, 7036, 16, 1509, 33, 7036, 16, 2870, 33, 7036, 16, 3478, 33, 7036, 4672, 365, 6315, 7422, 273, 3...
class account_bank_statement_line(osv.osv): def _default_company(self, cr, uid, context={}): """ To get default company for the object" @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of bank statement ids @param context: A standard dictionary for contextual values @return: company """ user = self.pool.get('res.users').browse(cr, uid, uid, context=context) if user.company_id: return user.company_id.id return self.pool.get('res.company').search(cr, uid, [('parent_id', '=', False)])[0] _inherit = 'account.bank.statement.line' _columns = { 'company_id':fields.many2one('res.company', 'Company', required=True), } _defaults = { 'company_id': _default_company, } account_bank_statement_line()
def _user_allow(self, cr, uid, ids, statement, context={}): res = False uids = [] for user in statement.journal_id.journal_users: uids.append(user.id) if uid in uids: res = True return res
c4f4f475dd0eef7e9be88811fcf620d03650feeb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c4f4f475dd0eef7e9be88811fcf620d03650feeb/account_bank_statement.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1355, 67, 5965, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 3021, 16, 819, 12938, 4672, 400, 273, 1083, 21550, 273, 5378, 364, 729, 316, 3021, 18, 22644, 67, 350, 18, 22644, 67, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1355, 67, 5965, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 3021, 16, 819, 12938, 4672, 400, 273, 1083, 21550, 273, 5378, 364, 729, 316, 3021, 18, 22644, 67, 350, 18, 22644, 67, ...
cursor.execute('UPDATE "' + self._table + '" ' \ 'SET "' + right + '" = "' + right + '" + ' \ + str(old_right - old_left + 1) + ' ' \ 'WHERE id IN (' + ','.join(['%s' for x in right_ids]) + ')', right_ids)
for i in range(0, len(right_ids), cursor.IN_MAX): sub_ids = right_ids[i:i + cursor.IN_MAX] str_d = ','.join(('%s',) * len(sub_ids)) cursor.execute('UPDATE "' + self._table + '" ' \ 'SET "' + right + '" = "' + right + '" + ' \ + str(old_right - old_left + 1) + ' ' \ 'WHERE id IN (' + str_d + ')', sub_ids)
def _update_tree(self, cursor, user, object_id, field_name, left, right): ''' Update left, right values for the tree. Remarks: the value (right - left - 1) / 2 will not give the number of children node ''' cursor.execute('SELECT "' + left + '", "' + right + '" ' \ 'FROM "' + self._table + '" ' \ 'WHERE id = %s', (object_id,)) if not cursor.rowcount: return old_left, old_right = cursor.fetchone() if old_left == old_right: cursor.execute('UPDATE "' + self._table + '" ' \ 'SET "' + right + '" = "' + right + '" + 1 ' \ 'WHERE id = %s', (object_id,)) old_right += 1
c0fae9fde246d8011ce7b49f9fa3229a3d8429ea /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9266/c0fae9fde246d8011ce7b49f9fa3229a3d8429ea/orm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2725, 67, 3413, 12, 2890, 16, 3347, 16, 729, 16, 733, 67, 350, 16, 652, 67, 529, 16, 2002, 16, 2145, 4672, 9163, 2315, 2002, 16, 2145, 924, 364, 326, 2151, 18, 2663, 27943, 30, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2725, 67, 3413, 12, 2890, 16, 3347, 16, 729, 16, 733, 67, 350, 16, 652, 67, 529, 16, 2002, 16, 2145, 4672, 9163, 2315, 2002, 16, 2145, 924, 364, 326, 2151, 18, 2663, 27943, 30, ...
self.myException.msg = self.errmsg
def __init__( self, matchString, identChars=DEFAULT_KEYWORD_CHARS, caseless=False ): super(Keyword,self).__init__() self.match = matchString self.matchLen = len(matchString) try: self.firstMatchChar = matchString[0] except IndexError: warnings.warn("null string passed to Keyword; use Empty() instead", SyntaxWarning, stacklevel=2) self.name = '"%s"' % self.match self.errmsg = "Expected " + self.name self.mayReturnEmpty = False self.myException.msg = self.errmsg self.mayIndexError = False self.caseless = caseless if caseless: self.caselessmatch = matchString.upper() identChars = identChars.upper() self.identChars = _str2dict(identChars)
bb0e6c1d8894ec4cade5f95640e793eeb8be8f10 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3693/bb0e6c1d8894ec4cade5f95640e793eeb8be8f10/pyparsing.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 365, 16, 845, 780, 16, 3390, 7803, 33, 5280, 67, 28813, 67, 21666, 16, 8697, 12617, 33, 8381, 262, 30, 2240, 12, 8736, 16, 2890, 2934, 972, 2738, 972, 1435, 365, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 365, 16, 845, 780, 16, 3390, 7803, 33, 5280, 67, 28813, 67, 21666, 16, 8697, 12617, 33, 8381, 262, 30, 2240, 12, 8736, 16, 2890, 2934, 972, 2738, 972, 1435, 365, ...
fixmols[id(ma)] = ma
fixmols[id(ma)] = ma
def modifyDehydrogenate(self): self.status_msg("Dehydrogenating...") from platform import fix_plurals fixmols = {} if self.o.assy.selmols: counta = countm = 0 for m in self.o.assy.selmols: changed = m.Dehydrogenate() # note: this might have removed all atoms from m! Fixed below. if changed: counta += changed countm += 1 fixmols[id(m)] = m ###e In theory, we might have removed an H whose neighbor # is in a different chunk/molecule, which therefore might need a # shakedown... I have not tried to fix that, and I'm not # sure it's a bug (since Dehydrogenate did changeapp on it, # and maybe that's enough -- this needs review). if counta: didwhat = "Dehydrogenate: removed %d atom(s) from %d chunk(s)" \ % (counta, countm) if len(self.o.assy.selmols) > countm: didwhat += \ " (%d selected chunks(s) had no hydrogens)" \ % (len(self.o.assy.selmols) - countm) didwhat = fix_plurals(didwhat) else: didwhat = "Dehydrogenate: selected chunks contain no hydrogens" elif self.o.assy.selatoms: count = 0 for a in self.o.assy.selatoms.values(): ma = a.molecule for atm in list(a.neighbors()) + [a]: #bruce 041018 semantic change: added [a] as well matm = atm.molecule changed = atm.Dehydrogenate() if changed: count += 1 fixmols[id(ma)] = ma # shakedown at most once per mol fixmols[id(matm)] = matm if fixmols: didwhat = \ "Dehydrogenate: removed %d atom(s) from %d chunk(s)" \ % (count, len(fixmols)) didwhat = fix_plurals(didwhat) # Technically, we *should* say ", affected" instead of "from" # since the count includes mols of neighbors of # atoms we removed, not always only mols of atoms we removed. # Since that's rare, we word this assuming it didn't happen. # [#e needs low-pri fix to be accurate in that rare case; # might as well deliver that as a warning, since that case is # also "dangerous" in some sense.] else: didwhat = "Dehydrogenate: no hydrogens bonded to selected atoms" else: didwhat = "Dehydrogenate: nothing selected" if fixmols: self.o.assy.modified = 1 for mol in fixmols.values(): if mol.atoms: mol.shakedown() else: mol.kill() self.w.update() self.status_msg(didwhat) return
a1e9f5e57cd2af68cf70c5ca1c0bc27b35854b68 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/a1e9f5e57cd2af68cf70c5ca1c0bc27b35854b68/modes.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5612, 758, 18112, 24096, 340, 12, 2890, 4672, 365, 18, 2327, 67, 3576, 2932, 758, 18112, 24096, 1776, 7070, 13, 628, 4072, 1930, 2917, 67, 412, 17645, 2917, 81, 3528, 273, 2618, 309, 365...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5612, 758, 18112, 24096, 340, 12, 2890, 4672, 365, 18, 2327, 67, 3576, 2932, 758, 18112, 24096, 1776, 7070, 13, 628, 4072, 1930, 2917, 67, 412, 17645, 2917, 81, 3528, 273, 2618, 309, 365...
@type dbConnectInst: instance @param dbConnectInst: instance of a L{DatabaseConnector}
@keyword dbConnectInst: instance of a L{DatabaseConnector}
def __init__(self, entryFactory=None, columnFormatStrategies=None, readingSearchStrategy=None, translationSearchStrategy=None, databaseUrl=None, dbConnectInst=None): """ Initialises the BaseDictionary instance.
7768f0434aecc2e353c85a4406b0b7da401f6ea2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11128/7768f0434aecc2e353c85a4406b0b7da401f6ea2/dictionary.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1241, 1733, 33, 7036, 16, 1057, 1630, 1585, 15127, 33, 7036, 16, 6453, 2979, 4525, 33, 7036, 16, 4794, 2979, 4525, 33, 7036, 16, 2063, 1489, 33, 7036, 16...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1241, 1733, 33, 7036, 16, 1057, 1630, 1585, 15127, 33, 7036, 16, 6453, 2979, 4525, 33, 7036, 16, 4794, 2979, 4525, 33, 7036, 16, 2063, 1489, 33, 7036, 16...
return S_OK( value.replace( '"', "'" ) )
return S_OK( value.replace( '"', '' ) )
def cleanValue( value ): value = value.strip() if value[0] == '"': entries = [] iPos = 1 current = "" state = "in" while iPos < len( value ): if value[ iPos ] == '"': if state == "in": entries.append( current ) current = "" state = "out" elif state == "out": current = current.strip() if current not in ( ",", ): return S_ERROR( "value seems a list but is not separated in commas" ) current = "" state = "in" else: current += value[ iPos ] iPos += 1 if state == "in": return S_ERROR( 'value is opened with " but is not closed' ) return S_OK( ", ".join ( entries ) ) else: return S_OK( value.replace( '"', "'" ) )
ffe316105d2255e67f7e9924de4353cb9a410727 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12864/ffe316105d2255e67f7e9924de4353cb9a410727/JDL.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2721, 620, 12, 460, 262, 30, 460, 273, 460, 18, 6406, 1435, 309, 460, 63, 20, 65, 422, 2119, 4278, 3222, 273, 5378, 277, 1616, 273, 404, 783, 273, 1408, 919, 273, 315, 267, 6, 1323, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2721, 620, 12, 460, 262, 30, 460, 273, 460, 18, 6406, 1435, 309, 460, 63, 20, 65, 422, 2119, 4278, 3222, 273, 5378, 277, 1616, 273, 404, 783, 273, 1408, 919, 273, 315, 267, 6, 1323, ...
t.setText(text[5])
t.setText(text[6])
def drawRules(self): self.oldSelection=[r.rule for r in self.selRect] self.sort() self.clear() for r in self.rectObj: r.setCanvas(None) self.rectObj=[] text=self.text filter=[self.RuleLen, self.RuleQ, self.Coverage, self.Class, self.Dist or self.DistBar,self.Rule] l=[] #a=["Length","Quality","Coverage","Class","Distribution", "Distribution(Bar)", "Rule"] a=["Length","Quality","Coverage","Class","Distribution", "Rule"] for i, k in enumerate(a): if filter[i]: t=QCanvasText(self.headerCanvas) t.setText(k) l.append(t) l.append(QCanvasText(self.canvas)) items=[] items.append(l) self.obj.extend(l) for text in self.text: l=[] if self.RuleLen: t=QCanvasText(self.canvas) t.setText(text[0]) l.append(t) if self.RuleQ: t=QCanvasText(self.canvas) t.setText(text[1]) l.append(t) if self.Coverage: t=QCanvasText(self.canvas) t.setText(text[2]) l.append(t) if self.Class: t=QCanvasText(self.canvas) t.setText(text[3]) l.append(t) if self.Dist and not self.DistBar: t=QCanvasText(self.canvas) t.setText(text[4]) l.append(t) if self.DistBar: t=DistBar(text[4],self.Dist,self.canvas) l.append(t) if self.Rule: t=QCanvasText(self.canvas) t.setText(text[5])#self.ruleText(text[-1])) l.append(t) l.append(QCanvasText(self.canvas)) self.obj.extend(l) items.append(l) #print len(items) textMapV=[10]+map(lambda s:max([t.boundingRect().height()+10 for t in s]), items[1:]) textMapH=[[s[i].boundingRect().width()+10 for s in items] for i in range(len(items[0]))] textMapH=[10]+map(lambda s:max(s), textMapH)
f6b6b724b64646141604db59c794c0c0ee707f2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6366/f6b6b724b64646141604db59c794c0c0ee707f2d/OWCN2RulesViewer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3724, 4478, 12, 2890, 4672, 365, 18, 1673, 6233, 22850, 86, 18, 5345, 364, 436, 316, 365, 18, 1786, 6120, 65, 365, 18, 3804, 1435, 365, 18, 8507, 1435, 364, 436, 316, 365, 18, 2607, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3724, 4478, 12, 2890, 4672, 365, 18, 1673, 6233, 22850, 86, 18, 5345, 364, 436, 316, 365, 18, 1786, 6120, 65, 365, 18, 3804, 1435, 365, 18, 8507, 1435, 364, 436, 316, 365, 18, 2607, ...
user, path = self.mucous.BrowseShares.CurrentDir() self.mucous.Transfers.FolderDownload(user, path + "\\")
user, path = self.mucous.BrowseShares.CurrentDir() self.mucous.Transfers.FolderDownload(user, path + "\\")
def ExecuteBrowse(self): try: the_list = self.List() #username = self.mucous.BrowseShares.current user, path = self.mucous.BrowseShares.CurrentFile() mode = self.mucous.BrowseShares.selected if mode == "directories": number = self.mucous.BrowseShares.scrolling[mode]-self.mucous.BrowseShares.dimensions["directories"]["start"] if self.position == 0: # Download # CHANGED 12/17/2007 Josh Leder # Transfers.FolderDownload strips the end of the path for some reason # so I am adding a trailing path delimiter (which will be discarded) # to prevent going an extra level up in the folder hierarchy # I'm also changing CurrentFile() to CurrentDir() which seems to make # a lot more sense. :) user, path = self.mucous.BrowseShares.CurrentDir() self.mucous.Transfers.FolderDownload(user, path + "\\") return 0 elif self.position == 1: user, path = self.mucous.BrowseShares.CurrentDir() self.mucous.Help.Log("status", "[%d] %s" % (number, path)) return 0 else: self.position -= 2 elif mode == "files": #user, path = self.mucous.BrowseShares.CurrentFile() mode = "files" number = self.mucous.BrowseShares.scrolling[mode] if self.position == 0: # Download self.mucous.Transfers.RetryDownload(user, path) return 0 elif self.position == 1: # Download Dir user, path = self.mucous.BrowseShares.CurrentDir() self.mucous.Transfers.FolderDownload(user, path + "\\") return 0 elif self.position == 2: self.mucous.Help.Log("status", "[%d] %s" % (number+1, path)) return 0 else: self.position -= 3
86ae30586ac86d7133548b2905974986ecd567c7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8737/86ae30586ac86d7133548b2905974986ecd567c7/MucousPopup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7903, 27304, 12, 2890, 4672, 775, 30, 326, 67, 1098, 273, 365, 18, 682, 1435, 468, 5053, 273, 365, 18, 81, 5286, 1481, 18, 27304, 24051, 18, 2972, 729, 16, 589, 273, 365, 18, 81, 528...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7903, 27304, 12, 2890, 4672, 775, 30, 326, 67, 1098, 273, 365, 18, 682, 1435, 468, 5053, 273, 365, 18, 81, 5286, 1481, 18, 27304, 24051, 18, 2972, 729, 16, 589, 273, 365, 18, 81, 528...
self.assertEqual(range(10).index(always_equal), 10)
self.assertEqual(range(10).index(always_equal), 0)
def __eq__(self, other): return True
d57bb55c7d8f98aacb568ab6e32155acedb12ca2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/d57bb55c7d8f98aacb568ab6e32155acedb12ca2/test_range.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 11253, 972, 12, 2890, 16, 1308, 4672, 327, 1053, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 11253, 972, 12, 2890, 16, 1308, 4672, 327, 1053, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
def debugstate(ui, repo):
def debugstate(ui, repo, nodates=None):
def debugstate(ui, repo): """show the contents of the current dirstate""" k = repo.dirstate._map.items() k.sort() for file_, ent in k: if ent[3] == -1: # Pad or slice to locale representation locale_len = len(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(0))) timestr = 'unset' timestr = timestr[:locale_len] + ' '*(locale_len - len(timestr)) else: timestr = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(ent[3])) if ent[1] & 020000: mode = 'lnk' else: mode = '%3o' % (ent[1] & 0777) ui.write("%c %s %10d %s %s\n" % (ent[0], mode, ent[2], timestr, file_)) for f in repo.dirstate.copies(): ui.write(_("copy: %s -> %s\n") % (repo.dirstate.copied(f), f))
d324c8346e4390f4f5bdd3e4e144d41a6df0bbc4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11312/d324c8346e4390f4f5bdd3e4e144d41a6df0bbc4/commands.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1198, 2019, 12, 4881, 16, 3538, 16, 14003, 815, 33, 7036, 4672, 3536, 4500, 326, 2939, 434, 326, 783, 302, 920, 340, 8395, 417, 273, 3538, 18, 72, 920, 340, 6315, 1458, 18, 3319, 1435,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1198, 2019, 12, 4881, 16, 3538, 16, 14003, 815, 33, 7036, 4672, 3536, 4500, 326, 2939, 434, 326, 783, 302, 920, 340, 8395, 417, 273, 3538, 18, 72, 920, 340, 6315, 1458, 18, 3319, 1435,...
descInfo[nsEntry.idhex] = (0, "")
pass
def monitorConsensus(): gmailAccount, gmailPassword = DEFAULT_GMAIL_ACCOUNT, "" toAddress = DEFAULT_TO_ADDRESS seenFingerprintsPath = DEFAULT_FINGERPRINTS nsOutputPath = DEFAULT_NS_OUTPUT isQuiet = False # parses user input, noting any issues try: opts, args = getopt.getopt(sys.argv[1:], OPT, OPT_EXPANDED) except getopt.GetoptError, exc: print str(exc) + " (for usage provide --help)" sys.exit() for opt, arg in opts: if opt in ("-g", "--gmail"): gmailAccount = arg elif opt in ("-t", "--to"): toAddress = arg elif opt in ("-f", "--fingerprints"): seenFingerprintsPath = arg elif opt in ("-n", "--nsOutput"): nsOutputPath = arg elif opt in ("-q", "--quiet"): isQuiet = True elif opt in ("-h", "--help"): # notes default values if they exist gmailAcctLabel = " (%s)" % gmailAccount if gmailAccount else "" toAddrLabel = " (%s)" % toAddress if toAddress else "" seenFpLabel = " (%s)" % seenFingerprintsPath if seenFingerprintsPath else "" nsOutputLabel = " (%s)" % nsOutputPath if nsOutputPath else "" print HELP_MSG % (gmailAcctLabel, toAddrLabel, seenFpLabel, nsOutputLabel) sys.exit() # ns output path is a directory, and later expected to end with a slash if nsOutputPath and not nsOutputPath.endswith("/"): nsOutputPath += "/" # fetches gmail password if we're sending email alerts isEmailUsed = gmailAccount and toAddress if isEmailUsed: gmailPassword = getpass.getpass("GMail Password: ") if not gmailAccount or not gmailPassword or not toAddress: print "Email notifications disabled" # get a control port connection conn = util.torTools.connect() if conn == None: print "Unable to connect to control port" sys.exit(1) # prepopulate seenFingerprints with past entries if available seenFingerprints = set() if seenFingerprintsPath and os.path.exists(seenFingerprintsPath): try: seenFingerprintsFile = open(seenFingerprintsPath, "r") for entry in seenFingerprintsFile: seenFingerprints.add(entry.upper().strip()) seenFingerprintsFile.close() except IOError: print "Unable to prepopulate fingerprints from %s" % seenFingerprintsPath seenFingerprintsFile = None if seenFingerprintsPath: try: seenFingerprintsFile = open(seenFingerprintsPath, "a") except IOError: print FP_WRITE_FAIL_MSG % seenFingerprintsPath tick = 0 # number of consensuses processed samplings = [] validAfterDate = None # the 'valid-after' time of the last consensus we've processed # fingerprint => (observedBandwidth, exitPolicy) for all relays descInfo = {} for nsEntry in conn.get_network_status(): try: descLookupCmd = "desc/id/%s" % nsEntry.idhex router = TorCtl.Router.build_from_desc(conn.get_info(descLookupCmd)[descLookupCmd].split("\n"), nsEntry) descInfo[router.idhex] = (router.desc_bw, router.exitpolicy) except TorCtl.ErrorReply: descInfo[nsEntry.idhex] = (0, "") except TorCtl.TorCtlClosed: print "Connection to tor is closed" sys.exit() while True: tick += 1 # fetches the consensus, blocking until a new one's available newConsensus, validAfterDate = getNextConsensus(conn, validAfterDate) nsEntries = TorCtl.parse_ns_body(newConsensus) # determines which entries are new newEntries = [] for nsEntry in nsEntries: # adds entry to descInfo hash if not nsEntry.idhex in descInfo: try: descLookupCmd = "desc/id/%s" % nsEntry.idhex router = TorCtl.Router.build_from_desc(conn.get_info(descLookupCmd)[descLookupCmd].split("\n"), nsEntry) descInfo[router.idhex] = (router.desc_bw, router.exitpolicy) except TorCtl.ErrorReply: descInfo[nsEntry.idhex] = (0, "") except TorCtl.TorCtlClosed: print "Connection to tor is closed" sys.exit() if not nsEntry.idhex in seenFingerprints: newEntries.append(nsEntry) seenFingerprints.add(nsEntry.idhex) # records the seen fingerprint if seenFingerprintsFile: try: seenFingerprintsFile.write(nsEntry.idhex + "\n") except IOError: print FP_WRITE_FAIL_MSG % seenFingerprintsPath seenFingerprintsFile = None newSampling = Sampling(conn, validAfterDate, nsEntries, newEntries) # check if we broke any thresholds (currently just checking hourly exit stats) countAlert = newSampling.getCount(RELAY_EXIT, True) > HOURLY_COUNT_THRESHOLD bwAlert = newSampling.getBandwidth(descInfo, RELAY_EXIT, True) > HOURLY_BW_THRESHOLD samplings.insert(0, newSampling) if len(samplings) > 168: # only remove entries if we have a full day's worth of data to discard lastDate = samplings[-1].getValidAfter().split(" ")[0] earlierDate = samplings[-25].getValidAfter().split(" ")[0] if lastDate == earlierDate: samplings = samplings[:-25] # writes new ns entries if nsOutputPath: nsContents = "" entryDir = nsOutputPath + newSampling.getValidAfter().split(" ")[0] + "/" entryFilename = newSampling.getValidAfter().split(" ")[1] + ".txt" for label, relayType in (("Exits:", RELAY_EXIT), ("Middle:", RELAY_MIDDLE), ("Guards:", RELAY_GUARD)): nsContents += label + "\n" nsContents += "-" * 40 + "\n" for nsEntry in newSampling.newRelays[relayType]: # TODO: the str call of the following produces a deprecation warning, as discussed on: # https://trac.torproject.org/projects/tor/ticket/1777 exitPolicy = [str(policyLine) for policyLine in descInfo[nsEntry.idhex][1]] nsContents += "%s (%s:%s)\n" % (nsEntry.idhex, nsEntry.ip, nsEntry.orport) nsContents += " nickname: %s\n" % nsEntry.nickname nsContents += " bandwidth: %s\n" % getSizeLabel(descInfo[nsEntry.idhex][0], 2) nsContents += " flags: %s\n" % ", ".join(nsEntry.flags) nsContents += " exit policy: %s\n\n" % ", ".join(exitPolicy) try: # make ns entries directory if it doesn't already exist if not os.path.exists(entryDir): os.makedirs(entryDir) # creates subdirectory for each date, then file named after the time nsFile = open(entryDir + entryFilename, "w") nsFile.write(nsContents) nsFile.close() except IOError: print "Unable to access '%s', network status summaries won't be persisted" % (entryDir + entryFilename) nsOutputPath = None # prints results to terminal, ex: # 7. 2010-07-18 10:00:00 - 941/1732/821 relays (8/12/4 are new, 153 MB / 215 MB / 48 MB added bandwidth) if not isQuiet: print "%i. %s" % (tick, newSampling.getSummary(descInfo)) if countAlert: print " *count threshold broken*" if bwAlert: print " *bandwidth threshold broken*" if countAlert or bwAlert or (tick % 24 == 0): currentTime = time.strftime("%H:%M", time.localtime(time.time())) currentDate = time.strftime("%m/%d/%Y", time.localtime(time.time())) if countAlert: subject = "Alert: Relay Count Threshold Broken" noticeBody = "The relay count threshold was broken today at %s (%s) with the addition of %i new exits (the current threshold is set at %i)." noticeMsg = noticeBody % (currentTime, currentDate, newSampling.getCount(RELAY_EXIT), HOURLY_COUNT_THRESHOLD) elif bwAlert: subject = "Alert: Relay Bandwidth Threshold Broken" noticeBody = "The relay bandwidth threshold was broken today at %s (%s) with the addition of %s of new exit capacity (the current threshold is set at %i)." noticeMsg = noticeBody % (currentTime, currentDate, getSizeLabel(newSampling.getBandwidth(descInfo, RELAY_EXIT)), getSizeLabel(HOURLY_BW_THRESHOLD)) else: subject = "Daily Consensus Report for %s" % currentDate noticeMsg = "At present there's no breaches to report. See below for a summary of consensus additions." greetingMsg = "Greetings from your friendly consensus monitoring daemon. %s" % noticeMsg # constructs the plain text message msgText = greetingMsg + "\n" msgText += "-" * 80 + "\n\n" for sampling in samplings: msgText += sampling.getSummary(descInfo) + "\n" # constructs the html message msgHtml = """<html> <head></head> <body> <p>%s</p> <hr /> <table style="border-collapse:collapse;"> <tr> <td></td> <td colspan="3" bgcolor="green"><b>&nbsp;Guards</b></td> <td colspan="3" bgcolor="yellow"><b>&nbsp;Middle</b></td> <td colspan="3" bgcolor="red"><b>&nbsp;Exits</b></td> <td bgcolor="blue"><b>&nbsp;Total</b></td> </tr> <tr> <td bgcolor="#444444"><b>&nbsp;Date:</b></td> <td bgcolor="green"><b>&nbsp;Count:&nbsp;</b></td> <td bgcolor="green"><b>New:&nbsp;</b></td> <td bgcolor="green"><b>Bandwidth:&nbsp;</b></td> <td bgcolor="yellow"><b>&nbsp;Count:&nbsp;</b></td> <td bgcolor="yellow"><b>New:&nbsp;</b></td> <td bgcolor="yellow"><b>Bandwidth:&nbsp;</b></td> <td bgcolor="red"><b>&nbsp;Count:&nbsp;</b></td> <td bgcolor="red"><b>New:&nbsp;</b></td> <td bgcolor="red"><b>Bandwidth:&nbsp;</b></td> <td bgcolor="blue"><b>&nbsp;Bandwidth:&nbsp;</b></td> </tr>
22da42af41f7b69227eb4a16ec1028b853c9b023 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13459/22da42af41f7b69227eb4a16ec1028b853c9b023/consensusTracker.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6438, 9054, 9781, 13332, 314, 4408, 3032, 16, 314, 4408, 3913, 273, 3331, 67, 43, 18191, 67, 21690, 16, 1408, 358, 1887, 273, 3331, 67, 4296, 67, 15140, 5881, 17678, 87, 743, 273, 3331, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6438, 9054, 9781, 13332, 314, 4408, 3032, 16, 314, 4408, 3913, 273, 3331, 67, 43, 18191, 67, 21690, 16, 1408, 358, 1887, 273, 3331, 67, 4296, 67, 15140, 5881, 17678, 87, 743, 273, 3331, ...
options = self._clean_unicode(options)
options = self._make_unicode(options)
def set_options(self, watchdir_id, options): """Update the options for a watch folder.""" watchdir_id = str(watchdir_id) options = self._clean_unicode(options) CheckInput(watchdir_id in self.watchdirs , _("Watch folder does not exist.")) if options.has_key('path'): options['abspath'] = os.path.abspath(options['path']) CheckInput(os.path.isdir(options['abspath']), _("Path does not exist.")) for w_id, w in self.watchdirs.iteritems(): if options['abspath'] == w['abspath'] and watchdir_id != w_id: raise Exception("Path is already being watched.") for key in options.keys(): if not key in OPTIONS_AVAILABLE: if not key in [key2+'_toggle' for key2 in OPTIONS_AVAILABLE.iterkeys()]: raise Exception("autoadd: Invalid options key:%s" % key) #disable the watch loop if it was active if watchdir_id in self.update_timers: self.disable_watchdir(watchdir_id) self.watchdirs[watchdir_id].update(options) #re-enable watch loop if appropriate if self.watchdirs[watchdir_id]['enabled']: self.enable_watchdir(watchdir_id) self.config.save() component.get("EventManager").emit(AutoaddOptionsChangedEvent())
d898def9eca1a9f7c91cda3667c2879a477fc353 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12915/d898def9eca1a9f7c91cda3667c2879a477fc353/core.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 2116, 12, 2890, 16, 4267, 1214, 67, 350, 16, 702, 4672, 3536, 1891, 326, 702, 364, 279, 4267, 3009, 12123, 4267, 1214, 67, 350, 273, 609, 12, 7585, 1214, 67, 350, 13, 702, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 2116, 12, 2890, 16, 4267, 1214, 67, 350, 16, 702, 4672, 3536, 1891, 326, 702, 364, 279, 4267, 3009, 12123, 4267, 1214, 67, 350, 273, 609, 12, 7585, 1214, 67, 350, 13, 702, 2...
"xcl", "exclude"
"xcl", "exclude",
def readConfigFile(): # can add other mappings from config file to local settings" cfgmap = [("serverBase", "ssd-server", "url")] try: import ConfigParser config = ConfigParser.ConfigParser() filename = "ssdwrap.conf" # look in the same place as the script is located... # should I check current working directory instead? filepath = os.path.join(os.path.split(sys.argv[0])[0], filename) config.read(filepath) for m in cfgmap: if config.has_option(m[1], m[2]): setattr(local, m[0], config.get(m[1],m[2])) # dump entire config file (to remember the interface) #for section in config.sections(): # print section # for option in config.options(section): # print " ", option, "=", config.get(section, option) pass except AttributeError: # no config file, probably safe to silently ignore pass
6ec0b0531a7e666b6002cab94a82e9376f852147 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5203/6ec0b0531a7e666b6002cab94a82e9376f852147/ssdwrap.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 13705, 13332, 468, 848, 527, 1308, 7990, 628, 642, 585, 358, 1191, 1947, 6, 2776, 1458, 273, 306, 2932, 3567, 2171, 3113, 315, 1049, 72, 17, 3567, 3113, 315, 718, 7923, 65, 775, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 13705, 13332, 468, 848, 527, 1308, 7990, 628, 642, 585, 358, 1191, 1947, 6, 2776, 1458, 273, 306, 2932, 3567, 2171, 3113, 315, 1049, 72, 17, 3567, 3113, 315, 718, 7923, 65, 775, 3...
('SimpleType', ('enum', '<B', '%d', {
('_Type', ('scalar', '<H', None )), ('SimpleType', ('enum', '& _Type 15', '%d', {
def symname(value): parts = struct.unpack("<2L", value) if parts[0] == 0: return string_table_entry(parts[1]) else: return '%s'
1060839120afe09b592e2d75e8cc3b1d76d75290 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11986/1060839120afe09b592e2d75e8cc3b1d76d75290/coff-dump.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5382, 529, 12, 1132, 4672, 2140, 273, 1958, 18, 17309, 2932, 32, 22, 48, 3113, 460, 13, 309, 2140, 63, 20, 65, 422, 374, 30, 327, 533, 67, 2121, 67, 4099, 12, 6019, 63, 21, 5717, 4...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5382, 529, 12, 1132, 4672, 2140, 273, 1958, 18, 17309, 2932, 32, 22, 48, 3113, 460, 13, 309, 2140, 63, 20, 65, 422, 374, 30, 327, 533, 67, 2121, 67, 4099, 12, 6019, 63, 21, 5717, 4...
yield pspecs[i]
yield ctypes.cast(pspecs[i], ctypes.POINTER(GParamSpec)).contents
def object_interface_list_properties(type_id): iface = _gobj.g_type_default_interface_ref(type_id) n = ctypes.c_uint() pspecs = _gobj.g_object_interface_list_properties(iface, ctypes.byref(n)) for i in range(n.value): yield pspecs[i]
8c6447d4b0bbaa908ca6aa283e0ac05010496730 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2770/8c6447d4b0bbaa908ca6aa283e0ac05010496730/cgobject.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 733, 67, 5831, 67, 1098, 67, 4738, 12, 723, 67, 350, 4672, 9751, 273, 389, 75, 2603, 18, 75, 67, 723, 67, 1886, 67, 5831, 67, 1734, 12, 723, 67, 350, 13, 290, 273, 6983, 18, 71, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 733, 67, 5831, 67, 1098, 67, 4738, 12, 723, 67, 350, 4672, 9751, 273, 389, 75, 2603, 18, 75, 67, 723, 67, 1886, 67, 5831, 67, 1734, 12, 723, 67, 350, 13, 290, 273, 6983, 18, 71, ...
this = apply(_quickfix.new_InViewOfCommon, args)
this = _quickfix.new_InViewOfCommon(*args)
def __init__(self, *args): this = apply(_quickfix.new_InViewOfCommon, args) try: self.this.append(this) except: self.this = this
7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 1968, 4672, 333, 273, 389, 19525, 904, 18, 2704, 67, 382, 1767, 951, 6517, 30857, 1968, 13, 775, 30, 365, 18, 2211, 18, 6923, 12, 2211, 13, 1335, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 1968, 4672, 333, 273, 389, 19525, 904, 18, 2704, 67, 382, 1767, 951, 6517, 30857, 1968, 13, 775, 30, 365, 18, 2211, 18, 6923, 12, 2211, 13, 1335, ...
aLoggerStub = LoggerStub( theSimulator, aFullPNString )
aLoggerStub = LoggerStub( self.theSimulator, aFullPNString )
def saveData( self, obj ):
e706cf45aba627079b4fc4b62d4ef7e44aad9211 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12724/e706cf45aba627079b4fc4b62d4ef7e44aad9211/LoggerWindow.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1923, 751, 12, 365, 16, 1081, 262, 30, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1923, 751, 12, 365, 16, 1081, 262, 30, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
except (urllib2.HTTPError, urllib2.URLError, httplib.HTTPException, ), m: logging.critical( unicodeC(m) + os.linesep + u'error grabbing url %s' % getConfig()['threads'][tName]['link'] )
except (urllib2.HTTPError, urllib2.URLError, httplib.HTTPException, ): logging.critical(''.join((traceback.format_exc(), os.linesep, u'error grabbing url %s' % getConfig()['threads'][tName]['link'])))
def rssparse(tName): u"""loops through the rss feed, searching for downloadable files""" page = None try: page = downloader(getConfig()['threads'][tName]['link']) except (urllib2.HTTPError, urllib2.URLError, httplib.HTTPException, ), m: logging.critical( unicodeC(m) + os.linesep + u'error grabbing url %s' % getConfig()['threads'][tName]['link'] ) return None if not page: logging.critical( u"failed to grab url %s" % getConfig()['threads'][tName]['link']) return None pr = page.read() try: ppage = feedparser.parse(pr) except Exception, m: # feedparser does not seem to throw exceptions properly, is a dictionary of some kind logging.critical( unicodeC(m) + os.linesep + u"page grabbed was not a parseable rss feed") return None if 'ttl' in ppage['feed'] and ppage['feed']['ttl'] != '' and not ( getConfig()['threads'][tName]['scanMins'] > int(ppage['feed']['ttl'])): logging.debug(u"setting ttl") getSaved().minScanTime[tName] = (time.time(), int(ppage['feed']['ttl'])) elif getConfig()['threads'][tName]['scanMins']: getSaved().minScanTime[tName] = (time.time(), getConfig()['threads'][tName]['scanMins'] ) if getConfig()['threads'][tName]['noSave']: for entry in ppage['entries']: if ( 'enclosures' in entry and len(entry['enclosures']) and 'href' in entry['enclosures'][0] #and not getConfig()['threads'][tName]['preferLink'] # proposed configuration option ): entry['link']=unQuoteReQuote(entry['enclosures'][0]['href']) else: entry['link'] = unQuoteReQuote( entry['link'] ) getSaved().downloads.append(entry['link']) else: for i in range(len(ppage['entries'])): # deals with feedparser bug with not properly uri unquoting/xml unescaping links from some feeds if 'link' not in ppage['entries'][i]: continue #and ( #'enclosures' not in ppage['entries'][i] or #not ppage['entries'][i]['enclosures'] or #'href' not in ppage['entries'][i]['enclosures'][0]): continue ppage['entries'][i]['oldlink'] = ppage['entries'][i]['link'] if ( 'enclosures' in ppage['entries'][i] and len(ppage['entries'][i]['enclosures']) and 'href' in ppage['entries'][i]['enclosures'][0] #and not getConfig()['threads'][tName]['preferLink'] # proposed configuration option ): ppage['entries'][i]['link'] = unQuoteReQuote( ppage['entries'][i]['enclosures'][0]['href'] ) else: ppage['entries'][i]['link'] = unQuoteReQuote( ppage['entries'][i]['link'] ) #if we have downloaded before, just skip (but what about e.g. multiple rips of about same size/type we might download multiple times) if ppage['entries'][i]['link'] in getSaved().downloads: logging.debug(u"already downloaded %s" % ppage['entries'][i]['link']) continue # if it failed before, no reason to believe it will work now, plus it's already queued up if searchFailed( ppage['entries'][i]['link'] ): logging.debug(u"link was in failedDown") continue dirDict = checkRegEx(tName, ppage['entries'][i]) if not dirDict: continue userFunctArgs = downloadFile(ppage['entries'][i]['link'], tName, ppage['entries'][i], dirDict) if userFunctArgs == None: continue # size was inappropriate == None elif userFunctArgs == False: # was supposed to download, but failed logging.debug(u"adding to failedDown: %s" % ppage['entries'][i]['link'] ) getSaved().failedDown.append( FailedItem(ppage['entries'][i]['link'], tName, ppage['entries'][i], dirDict) ) elif userFunctArgs: # should have succeeded logging.debug(u"adding to saved downloads: %s" % ppage['entries'][i]['link'] ) getSaved().downloads.append( ppage['entries'][i]['link'] ) if isinstance(dirDict, DownloadItemConfig) and dirDict['Function']: callUserFunction( dirDict['Function'], *userFunctArgs ) elif getConfig()['threads'][tName]['postDownloadFunction']: callUserFunction( getConfig()['threads'][tName]['postDownloadFunction'], *userFunctArgs ) if getConfig()['threads'][tName]['postScanFunction']: callUserFunction( getConfig()['threads'][tName]['postScanFunction'], pr, ppage, page.geturl(), tName )
0d66125a786b9ec925cf42d85180c8c854987932 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1664/0d66125a786b9ec925cf42d85180c8c854987932/rssdler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 18817, 2670, 12, 88, 461, 4672, 582, 8395, 383, 4473, 3059, 326, 18817, 4746, 16, 15300, 364, 4224, 429, 1390, 8395, 1363, 273, 599, 775, 30, 1363, 273, 28122, 12, 588, 809, 1435, 3292, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 18817, 2670, 12, 88, 461, 4672, 582, 8395, 383, 4473, 3059, 326, 18817, 4746, 16, 15300, 364, 4224, 429, 1390, 8395, 1363, 273, 599, 775, 30, 1363, 273, 28122, 12, 588, 809, 1435, 3292, ...
@param port: port on which the LDRdataFindServer listens
@param port: port on which the LSCsegFindServer listens
def __connect__(self, host, port): """ Attempt to open a connection to the LSCsegFindServer using the 'host' and 'port' and expecting the server to identify itself with a corresponding host certificate.
99f3c8a95daab623425a71c7275384312b5fffb2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5758/99f3c8a95daab623425a71c7275384312b5fffb2/LSCsegFindClient.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 3612, 972, 12, 2890, 16, 1479, 16, 1756, 4672, 3536, 12864, 358, 1696, 279, 1459, 358, 326, 511, 2312, 5680, 3125, 2081, 1450, 326, 296, 2564, 11, 471, 296, 655, 11, 471, 17012, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 3612, 972, 12, 2890, 16, 1479, 16, 1756, 4672, 3536, 12864, 358, 1696, 279, 1459, 358, 326, 511, 2312, 5680, 3125, 2081, 1450, 326, 296, 2564, 11, 471, 296, 655, 11, 471, 17012, ...