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 isinstance(strs,list):
if isinstance(strs,(list,tuple)):
def oneOf( strs, caseless=False, useRegex=True ): """Helper to quickly define a set of alternative Literals, and makes sure to do longest-first testing when there is a conflict, regardless of the input order, but returns a MatchFirst for best performance. Parameters: - strs - a string of space-delimited literals, or a list of string literals - caseless - (default=False) - treat all literals as caseless - useRegex - (default=True) - as an optimization, will generate a Regex object; otherwise, will generate a MatchFirst object (if caseless=True, or if creating a Regex raises an exception) """ if caseless: isequal = ( lambda a,b: a.upper() == b.upper() ) masks = ( lambda a,b: b.upper().startswith(a.upper()) ) parseElementClass = CaselessLiteral else: isequal = ( lambda a,b: a == b ) masks = ( lambda a,b: b.startswith(a) ) parseElementClass = Literal if isinstance(strs,list): symbols = strs[:] elif isinstance(strs,basestring): symbols = strs.split() else: warnings.warn("Invalid argument to oneOf, expected string or list", SyntaxWarning, stacklevel=2) i = 0 while i < len(symbols)-1: cur = symbols[i] for j,other in enumerate(symbols[i+1:]): if ( isequal(other, cur) ): del symbols[i+j+1] break elif ( masks(cur, other) ): del symbols[i+j+1] symbols.insert(i,other) cur = other break else: i += 1 if not caseless and useRegex: #~ print strs,"->", "|".join( [ _escapeRegexChars(sym) for sym in symbols] ) try: if len(symbols)==len("".join(symbols)): return Regex( "[%s]" % "".join( [ _escapeRegexRangeChars(sym) for sym in symbols] ) ) else: return Regex( "|".join( [ re.escape(sym) for sym in symbols] ) ) except: warnings.warn("Exception creating Regex for oneOf, building MatchFirst", SyntaxWarning, stacklevel=2) # last resort, just use MatchFirst return MatchFirst( [ parseElementClass(sym) for sym in symbols ] )
1aae2fe101e71a1d821c5da7c8d41d4b961fd063 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3693/1aae2fe101e71a1d821c5da7c8d41d4b961fd063/pyparsing.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1245, 951, 12, 19954, 16, 8697, 12617, 33, 8381, 16, 999, 6628, 33, 5510, 262, 30, 3536, 2276, 358, 23459, 4426, 279, 444, 434, 10355, 20655, 16, 471, 7297, 3071, 358, 741, 12163, 17, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1245, 951, 12, 19954, 16, 8697, 12617, 33, 8381, 16, 999, 6628, 33, 5510, 262, 30, 3536, 2276, 358, 23459, 4426, 279, 444, 434, 10355, 20655, 16, 471, 7297, 3071, 358, 741, 12163, 17, ...
self.mc.MUL(resloc.value, l0.value, l1.value)
self.mc.MUL(resloc.value, l0.value, r.ip.value)
def emit_op_int_neg(self, op, regalloc, fcond): arg = op.getarg(0) resbox = op.result l0 = regalloc.make_sure_var_in_reg(arg) l1 = regalloc.make_sure_var_in_reg(ConstInt(-1), [arg], imm_fine=False) resloc = regalloc.force_allocate_reg(resbox, [arg]) self.mc.MUL(resloc.value, l0.value, l1.value) regalloc.possibly_free_vars([arg, resbox]) return fcond
395c40d5b99007c96e2f51d39f6250078bf7e4f0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6934/395c40d5b99007c96e2f51d39f6250078bf7e4f0/opassembler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3626, 67, 556, 67, 474, 67, 14518, 12, 2890, 16, 1061, 16, 960, 9853, 16, 284, 10013, 4672, 1501, 273, 1061, 18, 588, 3175, 12, 20, 13, 400, 2147, 273, 1061, 18, 2088, 328, 20, 273, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3626, 67, 556, 67, 474, 67, 14518, 12, 2890, 16, 1061, 16, 960, 9853, 16, 284, 10013, 4672, 1501, 273, 1061, 18, 588, 3175, 12, 20, 13, 400, 2147, 273, 1061, 18, 2088, 328, 20, 273, ...
dialog.destroy()
self.choose_dialog.destroy()
def replace_cover(self, iconview, path, dialog, artist, album): self.stop_art_update = True image_num = int(path[0]) if len(self.remotefilelist) > 0: filename = self.remotefilelist[image_num] if os.path.exists(filename): self.remove_art_location_none_file(artist, album) self.create_dir_if_not_existing('~/.covers/') shutil.move(filename, self.remote_dest_filename) # And finally, set the image in the interface: self.lastalbumart = None self.update_album_art() # Clean up.. if os.path.exists(os.path.dirname(filename)): removeall(os.path.dirname(filename)) self.chooseimage_visible = False dialog.destroy() while self.downloading_image: gtk.main_iteration()
cae3642a8c6d4c5471174bbb1562b9f599b2c3fb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2312/cae3642a8c6d4c5471174bbb1562b9f599b2c3fb/sonata.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1453, 67, 3165, 12, 2890, 16, 4126, 1945, 16, 589, 16, 6176, 16, 15469, 16, 14844, 4672, 365, 18, 5681, 67, 485, 67, 2725, 273, 1053, 1316, 67, 2107, 273, 509, 12, 803, 63, 20, 5717,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1453, 67, 3165, 12, 2890, 16, 4126, 1945, 16, 589, 16, 6176, 16, 15469, 16, 14844, 4672, 365, 18, 5681, 67, 485, 67, 2725, 273, 1053, 1316, 67, 2107, 273, 509, 12, 803, 63, 20, 5717,...
andi t3, t3, 8 or reg, reg, t3
andi t4, t3, 8, flags=(EZF,) or reg, reg, t4 mov t1, t1, t3, flags=(nCEZF,)
def macroop BSF_R_R { # Determine if the input was zero, and also move it to a temp reg. mov t1, t1, t0, dataSize=8 and t1, regm, regm, flags=(ZF,) bri t0, label("end"), flags=(CZF,) # Zero out the result register movi reg, reg, 0 subi t2, t1, 1 xor t1, t2, t1 # Bit 6 srli t3, t1, 32, dataSize=8 andi t3, t3, 32 or reg, reg, t3 # Bit 5 srli t3, t1, 16, dataSize=8 andi t3, t3, 16 or reg, reg, t3 # Bit 4 srli t3, t1, 8, dataSize=8 andi t3, t3, 8 or reg, reg, t3 # Bit 3 srli t3, t1, 4, dataSize=8 andi t3, t3, 4 or reg, reg, t3 # Bit 2 srli t3, t1, 2, dataSize=8 andi t3, t3, 2 or reg, reg, t3 # Bit 1 srli t3, t1, 1, dataSize=8 andi t3, t3, 1 or reg, reg, t3
3e7c07fe3694f0322ad14a3f78d57cc10c7ca6f6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7385/3e7c07fe3694f0322ad14a3f78d57cc10c7ca6f6/bit_scan.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11522, 556, 605, 22395, 67, 54, 67, 54, 288, 468, 10229, 309, 326, 810, 1703, 3634, 16, 471, 2546, 3635, 518, 358, 279, 1906, 960, 18, 5730, 268, 21, 16, 268, 21, 16, 268, 20, 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, 11522, 556, 605, 22395, 67, 54, 67, 54, 288, 468, 10229, 309, 326, 810, 1703, 3634, 16, 471, 2546, 3635, 518, 358, 279, 1906, 960, 18, 5730, 268, 21, 16, 268, 21, 16, 268, 20, 16, ...
import IRC return IRC.format(CommitFormatter.format_module(self, module), 'aqua')
from IRC.Formatting import format return format(CommitFormatter.format_module(self, module), 'aqua')
def format_module(self, module): import IRC return IRC.format(CommitFormatter.format_module(self, module), 'aqua')
36bde6f1876b868f6f35d0419ceedf79bc1add09 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6757/36bde6f1876b868f6f35d0419ceedf79bc1add09/Formatters.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 740, 67, 2978, 12, 2890, 16, 1605, 4672, 1930, 467, 11529, 327, 467, 11529, 18, 2139, 12, 5580, 5074, 18, 2139, 67, 2978, 12, 2890, 16, 1605, 3631, 296, 69, 372, 69, 6134, 2, 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, 1, 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, 740, 67, 2978, 12, 2890, 16, 1605, 4672, 1930, 467, 11529, 327, 467, 11529, 18, 2139, 12, 5580, 5074, 18, 2139, 67, 2978, 12, 2890, 16, 1605, 3631, 296, 69, 372, 69, 6134, 2, -100, -...
except AttributeError: return ln(x) / ln(base)
except (AttributeError, TypeError): return log(x) / log(base)
def log(x, base=None): """ Return the logarithm of x to the given base. Calls the ``log`` method of the object x when computing the logarithm, thus allowing use of logarithm on any object containing a ``log`` method. In other words, log works on more than just real numbers. EXAMPLES:: sage: log(e^2) 2 sage: log(1024, 2); RDF(log(1024, 2)) 10 10.0 sage: log(10, 4); RDF(log(10, 4)) log(10)/log(4) 1.66096404744 :: sage: log(10, 2) log(10)/log(2) sage: n(log(10, 2)) 3.32192809488736 sage: log(10, e) log(10) sage: n(log(10, e)) 2.30258509299405 The log function works for negative numbers, complex numbers, and symbolic numbers too, picking the branch with angle between `-pi` and `pi`:: sage: log(-1+0*I) I*pi sage: log(CC(-1)) 3.14159265358979*I sage: log(-1.0) 3.14159265358979*I For input zero, the following behavior occurs:: sage: log(0) -Infinity sage: log(CC(0)) -infinity sage: log(0.0) -infinity The log function also works in finite fields as long as the base is generator of the multiplicative group:: sage: F = GF(13); g = F.multiplicative_generator(); g 2 sage: a = F(8) sage: log(a,g); g^log(a,g) 3 8 sage: log(a,3) Traceback (most recent call last): ... ValueError: base (=3) for discrete log must generate multiplicative group The log function also works for p-adics (see documentation for p-adics for more information):: sage: R = Zp(5); R 5-adic Ring with capped relative precision 20 sage: a = R(16); a 1 + 3*5 + O(5^20) sage: log(a) 3*5 + 3*5^2 + 3*5^4 + 3*5^5 + 3*5^6 + 4*5^7 + 2*5^8 + 5^9 + 5^11 + 2*5^12 + 5^13 + 3*5^15 + 2*5^16 + 4*5^17 + 3*5^18 + 3*5^19 + O(5^20) """ if base is None: try: return x.log() except AttributeError: return ln(x) else: try: return x.log(base) except AttributeError: return ln(x) / ln(base)
9337b4195c73fe1b7d290f7f4fce77281cf9a8e4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/9337b4195c73fe1b7d290f7f4fce77281cf9a8e4/log.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 613, 12, 92, 16, 1026, 33, 7036, 4672, 3536, 2000, 326, 613, 31249, 434, 619, 358, 326, 864, 1026, 18, 225, 23665, 326, 12176, 1330, 10335, 707, 434, 326, 733, 619, 1347, 20303, 326, 6...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 613, 12, 92, 16, 1026, 33, 7036, 4672, 3536, 2000, 326, 613, 31249, 434, 619, 358, 326, 864, 1026, 18, 225, 23665, 326, 12176, 1330, 10335, 707, 434, 326, 733, 619, 1347, 20303, 326, 6...
m = max(max(GXs), max(GYs))
m = max(max(abs(GXs)), max(abs(GYs)))
def optimizationStep(self, attrIndices, anchorData): dataSize = len(self.rawdata) validData = self.graph.getValidList(attrIndices) selectedData = Numeric.compress(validData, Numeric.take(self.graph.noJitteringScaledData, attrIndices))
124412186d12bde3fe0b836818de0b9222b5f935 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6366/124412186d12bde3fe0b836818de0b9222b5f935/OWFreeVizOptimization.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 14850, 4160, 12, 2890, 16, 1604, 8776, 16, 6984, 751, 4672, 30216, 273, 562, 12, 2890, 18, 1899, 892, 13, 923, 751, 273, 365, 18, 4660, 18, 588, 1556, 682, 12, 1747, 8776, 13, 3170, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 14850, 4160, 12, 2890, 16, 1604, 8776, 16, 6984, 751, 4672, 30216, 273, 562, 12, 2890, 18, 1899, 892, 13, 923, 751, 273, 365, 18, 4660, 18, 588, 1556, 682, 12, 1747, 8776, 13, 3170, ...
@test_support.cpython_only
@support.cpython_only
def test_range_optimization(self): x = range(1) self.assertEqual(type(reversed(x)), type(iter(x)))
4fd283a4fea33b652340fbbbbb850a2ac2dd128e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/4fd283a4fea33b652340fbbbbb850a2ac2dd128e/test_enumerate.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 3676, 67, 16689, 1588, 12, 2890, 4672, 619, 273, 1048, 12, 21, 13, 365, 18, 11231, 5812, 12, 723, 12, 266, 7548, 12, 92, 13, 3631, 618, 12, 2165, 12, 92, 20349, 2, 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, 1, 1, 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, 67, 3676, 67, 16689, 1588, 12, 2890, 4672, 619, 273, 1048, 12, 21, 13, 365, 18, 11231, 5812, 12, 723, 12, 266, 7548, 12, 92, 13, 3631, 618, 12, 2165, 12, 92, 20349, 2, -100, ...
for object_id in ids: self._update_tree(cursor, user, object_id, k,
if len(ids) == 1: self._update_tree(cursor, user, ids[0], k,
def write(self, cursor, user, ids, vals, context=None): ''' Update ids with the content of vals. vals is a dict with fields name as keys. ''' if context is None: context = {} context = context.copy() if not ids: return True if self.table_query(context): return True
721ada6e82f74003646c5e7aa4f82f5257253ec4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9266/721ada6e82f74003646c5e7aa4f82f5257253ec4/orm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 12, 2890, 16, 3347, 16, 729, 16, 3258, 16, 5773, 16, 819, 33, 7036, 4672, 9163, 2315, 3258, 598, 326, 913, 434, 5773, 18, 5773, 353, 279, 2065, 598, 1466, 508, 487, 1311, 18, 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, 1045, 12, 2890, 16, 3347, 16, 729, 16, 3258, 16, 5773, 16, 819, 33, 7036, 4672, 9163, 2315, 3258, 598, 326, 913, 434, 5773, 18, 5773, 353, 279, 2065, 598, 1466, 508, 487, 1311, 18, 9...
if firstItem._sectionTriageStatus == firstItem._triageStatus:
if (getattr(firstItem, '_sectionTriageStatus', None) == firstItem._triageStatus):
def triageForRecurrenceAddition(self): """ When initially adding recurrence, the first occurrence is treated specially, for more info see bug 7904. This method should be called after an initial updateTriageStatus, because subsequent updates may cause the first occurrence to be unmodified. """ master = self.getMaster() firstOccurrence = master.getRecurrenceID(master.effectiveStartTime) if firstOccurrence is None: # This can happen if there's an EXDATE deleting the first occurrence return firstItem = firstOccurrence.itsItem wasModification = firstOccurrence.modificationFor is not None oldTriageStatus = firstItem._triageStatus if not firstItem.hasLocalAttributeValue('_sectionTriageStatus'): firstItem.copyTriageStatusFrom(master.itsItem) # don't let masters keep their _sectionTriageStatus, if they do it'll # be inherited inappropriately by modifications master.itsItem.purgeSectionTriageStatus() # if the master's triage status was NOW because it was just created, # don't leave it that way, it's enough to pin it in the NOW section. # Because force isn't set, this will preserve _sectionTriageStatus # if the master happened to be pinned already firstItem.setTriageStatus('auto', pin=True) if firstItem._sectionTriageStatus == firstItem._triageStatus: firstItem.purgeSectionTriageStatus() if wasModification and oldTriageStatus == TriageEnum.later: # this occurrence was the token Later occurrence, make sure there's # a new token later if firstItem._triageStatus != TriageEnum.later: self.getFirstFutureLater()
45e228b66cf104c15a57062cf45c2c1038a72acf /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9228/45e228b66cf104c15a57062cf45c2c1038a72acf/Calendar.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6882, 410, 1290, 426, 17131, 30296, 12, 2890, 4672, 3536, 5203, 22458, 6534, 25939, 16, 326, 1122, 13083, 353, 13974, 857, 6261, 16, 364, 1898, 1123, 2621, 7934, 26517, 3028, 18, 225, 1220...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6882, 410, 1290, 426, 17131, 30296, 12, 2890, 4672, 3536, 5203, 22458, 6534, 25939, 16, 326, 1122, 13083, 353, 13974, 857, 6261, 16, 364, 1898, 1123, 2621, 7934, 26517, 3028, 18, 225, 1220...
self.singlbase = self.singlpos
if self.singlets: self.singlbase = self.singlpos
def freeze(self): """ set the molecule up for minimization or simulation""" self.center = V(0,0,0) self.quat = Q(1,0,0,0) self.basepos = self.curpos # reference == same object self.singlbase = self.singlpos # ditto
aee9ddd500528fc1707d554edb28bccc7bb6e383 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/aee9ddd500528fc1707d554edb28bccc7bb6e383/chem.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 16684, 12, 2890, 4672, 3536, 444, 326, 13661, 731, 364, 18172, 1588, 578, 14754, 8395, 365, 18, 5693, 273, 776, 12, 20, 16, 20, 16, 20, 13, 365, 18, 372, 270, 273, 2238, 12, 21, 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, 16684, 12, 2890, 4672, 3536, 444, 326, 13661, 731, 364, 18172, 1588, 578, 14754, 8395, 365, 18, 5693, 273, 776, 12, 20, 16, 20, 16, 20, 13, 365, 18, 372, 270, 273, 2238, 12, 21, 16, ...
begin = data[0] if begin < time.time(): begin = time.time() end = data[1] if end < begin: end = begin end += 3600 * 10
begin = time.time() end = begin + 3600 * 10
def startInstantRecording(self): serviceref = self.session.nav.getCurrentlyPlayingServiceReference() # try to get event info event = None try: service = self.session.nav.getCurrentService() info = service.info() ev = info.getEvent(0) event = ev except: pass if event is not None: data = parseEvent(event) begin = data[0] if begin < time.time(): begin = time.time() end = data[1] if end < begin: end = begin end += 3600 * 10 data = (begin, end, data[2], data[3], data[4]) else: data = (time.time(), time.time() + 3600 * 10, "instant record", "", None) # fix me, description. self.recording = self.session.nav.recordWithTimer(serviceref, *data) self.recording.dontSave = True #self["BlinkingPoint"].setConnect(lambda: self.recording.isRunning())
d47262c60dab83c5bb3370eca08e9dfe3f7225f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/d47262c60dab83c5bb3370eca08e9dfe3f7225f9/InfoBarGenerics.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 787, 10675, 21037, 12, 2890, 4672, 24658, 822, 74, 273, 365, 18, 3184, 18, 11589, 18, 588, 3935, 715, 11765, 310, 1179, 2404, 1435, 225, 468, 775, 358, 336, 871, 1123, 871, 273, 599, 7...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 787, 10675, 21037, 12, 2890, 4672, 24658, 822, 74, 273, 365, 18, 3184, 18, 11589, 18, 588, 3935, 715, 11765, 310, 1179, 2404, 1435, 225, 468, 775, 358, 336, 871, 1123, 871, 273, 599, 7...
self.fp.write(struct.pack("<lll", zinfo.CRC, zinfo.compress_size,
self.fp.write(struct.pack("<lLL", zinfo.CRC, zinfo.compress_size,
def write(self, filename, arcname=None, compress_type=None): """Put the bytes from filename into the archive under the name arcname.""" st = os.stat(filename) mtime = time.localtime(st.st_mtime) date_time = mtime[0:6] # Create ZipInfo instance to store file information if arcname is None: zinfo = ZipInfo(filename, date_time) else: zinfo = ZipInfo(arcname, date_time) zinfo.external_attr = (st[0] & 0xFFFF) << 16L # Unix attributes if compress_type is None: zinfo.compress_type = self.compression else: zinfo.compress_type = compress_type self._writecheck(zinfo) fp = open(filename, "rb") zinfo.flag_bits = 0x00 zinfo.header_offset = self.fp.tell() # Start of header bytes # Must overwrite CRC and sizes with correct data later zinfo.CRC = CRC = 0 zinfo.compress_size = compress_size = 0 zinfo.file_size = file_size = 0 self.fp.write(zinfo.FileHeader()) zinfo.file_offset = self.fp.tell() # Start of file bytes if zinfo.compress_type == ZIP_DEFLATED: cmpr = zlib.compressobj(zlib.Z_DEFAULT_COMPRESSION, zlib.DEFLATED, -15) else: cmpr = None while 1: buf = fp.read(1024 * 8) if not buf: break file_size = file_size + len(buf) CRC = binascii.crc32(buf, CRC) if cmpr: buf = cmpr.compress(buf) compress_size = compress_size + len(buf) self.fp.write(buf) fp.close() if cmpr: buf = cmpr.flush() compress_size = compress_size + len(buf) self.fp.write(buf) zinfo.compress_size = compress_size else: zinfo.compress_size = file_size zinfo.CRC = CRC zinfo.file_size = file_size # Seek backwards and write CRC and file sizes position = self.fp.tell() # Preserve current position in file self.fp.seek(zinfo.header_offset + 14, 0) self.fp.write(struct.pack("<lll", zinfo.CRC, zinfo.compress_size, zinfo.file_size)) self.fp.seek(position, 0) self.filelist.append(zinfo) self.NameToInfo[zinfo.filename] = zinfo
9b6aa738b510068980c7faea1d8cc64a39f5f0f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/9b6aa738b510068980c7faea1d8cc64a39f5f0f6/zipfile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 12, 2890, 16, 1544, 16, 8028, 529, 33, 7036, 16, 8099, 67, 723, 33, 7036, 4672, 3536, 6426, 326, 1731, 628, 1544, 1368, 326, 5052, 3613, 326, 508, 8028, 529, 12123, 384, 273, 114...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1045, 12, 2890, 16, 1544, 16, 8028, 529, 33, 7036, 16, 8099, 67, 723, 33, 7036, 4672, 3536, 6426, 326, 1731, 628, 1544, 1368, 326, 5052, 3613, 326, 508, 8028, 529, 12123, 384, 273, 114...
def timecall(val): global g_sliceSlide global g_dir imshowslice(g_dir, g_sliceSlide.val, val) pylab.draw()
def slicecall(val): global g_dir global g_timeSlide imshowslice(g_dir, val, g_timeSlide.val) pylab.draw()
d4cec4e4e439c1f0ea7d11af15dcf13515ede240 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5491/d4cec4e4e439c1f0ea7d11af15dcf13515ede240/bview.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2788, 1991, 12, 1125, 4672, 2552, 314, 67, 1214, 2552, 314, 67, 957, 21068, 31219, 6665, 12, 75, 67, 1214, 16, 1244, 16, 314, 67, 957, 21068, 18, 1125, 13, 2395, 7411, 18, 9446, 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, 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, 2788, 1991, 12, 1125, 4672, 2552, 314, 67, 1214, 2552, 314, 67, 957, 21068, 31219, 6665, 12, 75, 67, 1214, 16, 1244, 16, 314, 67, 957, 21068, 18, 1125, 13, 2395, 7411, 18, 9446, 1435, ...
'%r (ordinal %s)' % (self.state_machine.abs_line_number(), text, ordinal)))
'"%s" (ordinal %s)' % (self.state_machine.abs_line_number(), text, ordinal)))
def enumerator(self, match, context, next_state): """Enumerated List Item""" format, sequence, text, ordinal = self.parse_enumerator(match) if ordinal is None: msg = self.reporter.error( ('Enumerated list start value invalid at line %s: ' '%r (sequence %r)' % (self.state_machine.abs_line_number(), text, sequence))) self.parent += msg indented, line_offset, blank_finish = \ self.state_machine.get_known_indented(match.end()) bq = self.block_quote(indented, line_offset) self.parent += bq if not blank_finish: self.parent += self.unindent_warning( 'Enumerated list') return [], next_state, [] if ordinal != 1: msg = self.reporter.info( ('Enumerated list start value not ordinal-1 at line %s: ' '%r (ordinal %s)' % (self.state_machine.abs_line_number(), text, ordinal))) self.parent += msg enumlist = nodes.enumerated_list() self.parent += enumlist enumlist['enumtype'] = sequence if ordinal != 1: enumlist['start'] = ordinal enumlist['prefix'] = self.enum.formatinfo[format].prefix enumlist['suffix'] = self.enum.formatinfo[format].suffix listitem, blank_finish = self.list_item(match.end()) enumlist += listitem offset = self.state_machine.line_offset + 1 # next line newline_offset, blank_finish = self.nested_list_parse( self.state_machine.input_lines[offset:], input_offset=self.state_machine.abs_line_offset() + 1, node=enumlist, initial_state='EnumeratedList', blank_finish=blank_finish, extra_settings={'lastordinal': ordinal, 'format': format}) self.goto_line(newline_offset) if not blank_finish: self.parent += self.unindent_warning('Enumerated list') return [], next_state, []
1dacb1eda37578279f664cded06f9ce279e461c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1532/1dacb1eda37578279f664cded06f9ce279e461c3/states.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24679, 12, 2890, 16, 845, 16, 819, 16, 1024, 67, 2019, 4672, 3536, 3572, 19007, 987, 4342, 8395, 740, 16, 3102, 16, 977, 16, 12675, 273, 365, 18, 2670, 67, 7924, 7385, 12, 1916, 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, 24679, 12, 2890, 16, 845, 16, 819, 16, 1024, 67, 2019, 4672, 3536, 3572, 19007, 987, 4342, 8395, 740, 16, 3102, 16, 977, 16, 12675, 273, 365, 18, 2670, 67, 7924, 7385, 12, 1916, 13, ...
f = open(name_c, 'r')
with open(name_c, 'rb') as f: magic_str = f.read(4) mtime_str = f.read(4)
def main(): silent = 0 verbose = 0 if sys.argv[1:]: if sys.argv[1] == '-v': verbose = 1 elif sys.argv[1] == '-s': silent = 1 MAGIC = imp.get_magic() if not silent: print('Using MAGIC word', repr(MAGIC)) for dirname in sys.path: try: names = os.listdir(dirname) except os.error: print('Cannot list directory', repr(dirname)) continue if not silent: print('Checking ', repr(dirname), '...') names.sort() for name in names: if name[-3:] == '.py': name = os.path.join(dirname, name) try: st = os.stat(name) except os.error: print('Cannot stat', repr(name)) continue if verbose: print('Check', repr(name), '...') name_c = name + 'c' try: f = open(name_c, 'r') except IOError: print('Cannot open', repr(name_c)) continue magic_str = f.read(4) mtime_str = f.read(4) f.close() if magic_str != MAGIC: print('Bad MAGIC word in ".pyc" file', end=' ') print(repr(name_c)) continue mtime = get_long(mtime_str) if mtime == 0 or mtime == -1: print('Bad ".pyc" file', repr(name_c)) elif mtime != st[ST_MTIME]: print('Out-of-date ".pyc" file', end=' ') print(repr(name_c))
c7eaede21ecb5259f2bd9e160a89b82d19cfb19b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/c7eaede21ecb5259f2bd9e160a89b82d19cfb19b/checkpyc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 10404, 273, 374, 3988, 273, 374, 309, 2589, 18, 19485, 63, 21, 30, 14542, 309, 2589, 18, 19485, 63, 21, 65, 422, 2400, 90, 4278, 3988, 273, 404, 1327, 2589, 18, 19485, 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, 2774, 13332, 10404, 273, 374, 3988, 273, 374, 309, 2589, 18, 19485, 63, 21, 30, 14542, 309, 2589, 18, 19485, 63, 21, 65, 422, 2400, 90, 4278, 3988, 273, 404, 1327, 2589, 18, 19485, 63,...
body += self.TBoxLogURL % (treename, lgb_id)
body += self.TBoxLogURL % (treename, branch_id)
def process(self): builds = {}
44bc9fbb09ad1e931340003bd194de573c6abe08 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/44bc9fbb09ad1e931340003bd194de573c6abe08/status.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 12, 2890, 4672, 10736, 273, 2618, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 1207, 12, 2890, 4672, 10736, 273, 2618, 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, -...
reldir = os.path.relpath(dirpath, dirname) if reldir != ".":
reldir = dirpath[len(dirname)+1:] if reldir:
def scan_package(pkg_name, dirname, stderr=sys.stderr): manifest = [] has_problems = False for dirpath, dirnames, filenames in os.walk(dirname): for fn in [fn for fn in filenames if fn.endswith(".js")]: modname = os.path.splitext(fn)[0] reldir = os.path.relpath(dirpath, dirname) if reldir != ".": modname = "/".join(reldir.split(os.sep) + [modname]) absfn = os.path.join(dirpath, fn) lines = open(absfn).readlines() requires, chrome, problems = scan_module(absfn, lines, stderr) manifest.append( (pkg_name, modname, requires, chrome) ) if problems: has_problems = True return manifest, has_problems
5ea1660dc978df27eef4f974197a7c1e1471b52f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14687/5ea1660dc978df27eef4f974197a7c1e1471b52f/manifest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4135, 67, 5610, 12, 10657, 67, 529, 16, 4283, 16, 4514, 33, 9499, 18, 11241, 4672, 5643, 273, 5378, 711, 67, 29812, 273, 1083, 364, 17803, 16, 1577, 1973, 16, 9066, 316, 1140, 18, 1134...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4135, 67, 5610, 12, 10657, 67, 529, 16, 4283, 16, 4514, 33, 9499, 18, 11241, 4672, 5643, 273, 5378, 711, 67, 29812, 273, 1083, 364, 17803, 16, 1577, 1973, 16, 9066, 316, 1140, 18, 1134...
if client_filename != '': client_file( client_filename )
if input_filename != '': client_file( input_filename )
def usage(): """Displays program usage information. """ progname = os.path.basename( sys.argv[0] ) print 'Usage: ', progname + ' [-d LEVEL] [-s] [-f FILENAME]' print print 'Options:' print ' -?, -h, --help show this help message and exit' print ' -l PATH, --lisp=PATH path of Lisp interpreter' print ' -r PATH, --run=PATH full command to run the server' print ' -p PORT, --port=PORT port number to use by the server/client' print ' -d LEVEL, --debug=LEVEL set debug LEVEL (0..3)' print ' -s start server' print ' -f FILENAME, --file=FILENAME start client and send contents of file' print ' named FILENAME to server' print ' -c LINE1 LINE2 ... LINEn start client and send LINE1...LINEn to server' print ' (if present, this option must be the last one,' print ' mutually exclusive with the -f option)'
7c7a679102e6ac5ef4702ffb14ac6f40280d6ba5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10890/7c7a679102e6ac5ef4702ffb14ac6f40280d6ba5/slimv.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4084, 13332, 3536, 16900, 5402, 4084, 1779, 18, 3536, 11243, 529, 273, 1140, 18, 803, 18, 13909, 12, 2589, 18, 19485, 63, 20, 65, 262, 1172, 296, 5357, 30, 2265, 11243, 529, 397, 296, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4084, 13332, 3536, 16900, 5402, 4084, 1779, 18, 3536, 11243, 529, 273, 1140, 18, 803, 18, 13909, 12, 2589, 18, 19485, 63, 20, 65, 262, 1172, 296, 5357, 30, 2265, 11243, 529, 397, 296, ...
for coll in results_final.keys(): if coll not in colls_to_search: colls_to_search.append(coll)
def perform_request_search(req=None, cc=cdsname, c=None, p="", f="", rg="10", sf="", so="d", sp="", of="id", ot="", as="0", p1="", f1="", m1="", op1="", p2="", f2="", m2="", op2="", p3="", f3="", m3="", sc="0", jrec="0", recid="-1", recidb="-1", sysno="", id="-1", idb="-1", sysnb="", action="SEARCH", d1y="0", d1m="0", d1d="0", d2y="0", d2m="0", d2d="0", dbg="0", ap="0"): """Perform search or browse request, without checking for authentication. Return list of recIDs found, if of=id. Otherwise create web page. The arguments are as follows: req - mod_python Request class instance. cc - current collection (e.g. "ATLAS"). The collection the user started to search/browse from. c - collectin list (e.g. ["Theses", "Books"]). The collections user may have selected/deselected when starting to search from 'cc'. p - pattern to search for (e.g. "ellis and muon or kaon"). f - field to search within (e.g. "author"). rg - records in groups of (e.g. "10"). Defines how many hits per collection in the search results page are displayed. sf - sort field (e.g. "title"). so - sort order ("a"=ascending, "d"=descending). sp - sort pattern (e.g. "CERN-") -- in case there are more values in a sort field, this argument tells which one to prefer of - output format (e.g. "hb"). Usually starting "h" means HTML output (and "hb" for HTML brief, "hd" for HTML detailed), "x" means XML output, "t" means plain text output, "id" means no output at all but to return list of recIDs found. (Suitable for high-level API.) ot - output only these MARC tags (e.g. "100,700,909C0b"). Useful if only some fields are to be shown in the output, e.g. for library to control some fields. as - advanced search ("0" means no, "1" means yes). Whether search was called from within the advanced search interface. p1 - first pattern to search for in the advanced search interface. Much like 'p'. f1 - first field to search within in the advanced search interface. Much like 'f'. m1 - first matching type in the advanced search interface. ("a" all of the words, "o" any of the words, "e" exact phrase, "p" partial phrase, "r" regular expression). op1 - first operator, to join the first and the second unit in the advanced search interface. ("a" add, "o" or, "n" not). p2 - second pattern to search for in the advanced search interface. Much like 'p'. f2 - second field to search within in the advanced search interface. Much like 'f'. m2 - second matching type in the advanced search interface. ("a" all of the words, "o" any of the words, "e" exact phrase, "p" partial phrase, "r" regular expression). op2 - second operator, to join the second and the third unit in the advanced search interface. ("a" add, "o" or, "n" not). p3 - third pattern to search for in the advanced search interface. Much like 'p'. f3 - third field to search within in the advanced search interface. Much like 'f'. m3 - third matching type in the advanced search interface. ("a" all of the words, "o" any of the words, "e" exact phrase, "p" partial phrase, "r" regular expression). sc - split by collection ("0" no, "1" yes). Governs whether we want to present the results in a single huge list, or splitted by collection. jrec - jump to record (e.g. "234"). Used for navigation inside the search results. recid - display record ID (e.g. "20000"). Do not search/browse but go straight away to the Detailed record page for the given recID. recidb - display record ID bis (e.g. "20010"). If greater than 'recid', then display records from recid to recidb. Useful for example for dumping records from the database for reformatting. sysno - display old system SYS number (e.g. ""). If you migrate to CDSware from another system, and store your old SYS call numbers, you can use them instead of recid if you wish so. id - the same as recid, in case recid is not set. For backwards compatibility. idb - the same as recid, in case recidb is not set. For backwards compatibility. sysnb - the same as sysno, in case sysno is not set. For backwards compatibility. action - action to do. "SEARCH" for searching, "Browse" for browsing. d1y - first date year (e.g. "1998"). Useful for search limits on creation date. d1m - first date month (e.g. "08"). Useful for search limits on creation date. d1d - first date day (e.g. "23"). Useful for search limits on creation date. d2y - second date year (e.g. "1998"). Useful for search limits on creation date. d2m - second date month (e.g. "08"). Useful for search limits on creation date. d2d - second date day (e.g. "23"). Useful for search limits on creation date. dbg - debug info level (0=min, 9=max). Useful to print some internal information on the searching process in case something goes wrong. ap - alternative patterns (0=no, 1=yes). In case no exact match is found, the search engine can try alternative patterns e.g. to replace non-alphanumeric characters by a boolean query. ap defines if this is wanted. """ # wash all passed arguments: cc = wash_url_argument(cc, 'str') sc = wash_url_argument(sc, 'int') (cc, colls_to_display, colls_to_search) = wash_colls(cc, c, sc) # which colls to search and to display? p = wash_pattern(wash_url_argument(p, 'str')) f = wash_field(wash_url_argument(f, 'str')) rg = wash_url_argument(rg, 'int') sf = wash_url_argument(sf, 'str') so = wash_url_argument(so, 'str') sp = wash_url_argument(sp, 'string') of = wash_url_argument(of, 'str') if type(ot) is list: ot = string.join(ot,",") ot = wash_url_argument(ot, 'str') as = wash_url_argument(as, 'int') p1 = wash_pattern(wash_url_argument(p1, 'str')) f1 = wash_field(wash_url_argument(f1, 'str')) m1 = wash_url_argument(m1, 'str') op1 = wash_url_argument(op1, 'str') p2 = wash_pattern(wash_url_argument(p2, 'str')) f2 = wash_field(wash_url_argument(f2, 'str')) m2 = wash_url_argument(m2, 'str') op2 = wash_url_argument(op2, 'str') p3 = wash_pattern(wash_url_argument(p3, 'str')) f3 = wash_field(wash_url_argument(f3, 'str')) m3 = wash_url_argument(m3, 'str') jrec = wash_url_argument(jrec, 'int') recid = wash_url_argument(recid, 'int') recidb = wash_url_argument(recidb, 'int') sysno = wash_url_argument(sysno, 'str') id = wash_url_argument(id, 'int') idb = wash_url_argument(idb, 'int') sysnb = wash_url_argument(sysnb, 'str') action = wash_url_argument(action, 'str') d1y = wash_url_argument(d1y, 'int') d1m = wash_url_argument(d1m, 'int') d1d = wash_url_argument(d1d, 'int') d2y = wash_url_argument(d2y, 'int') d2m = wash_url_argument(d2m, 'int') d2d = wash_url_argument(d2d, 'int') day1, day2 = wash_dates(d1y, d1m, d1d, d2y, d2m, d2d) dbg = wash_url_argument(dbg, 'int') ap = wash_url_argument(ap, 'int') # backwards compatibility: id, idb, sysnb -> recid, recidb, sysno (if applicable) if sysnb != "" and sysno == "": sysno = sysnb if id > 0 and recid == -1: recid = id if idb > 0 and recidb == -1: recidb = idb # TODO deduce passed search limiting criterias (if applicable) pl = "" # no limits by default if action != "Browse" and req: # we do not want to add options while browsing or while calling via command-line fieldargs = cgi.parse_qs(req.args) for fieldcode in get_fieldcodes(): if fieldargs.has_key(fieldcode): for val in fieldargs[fieldcode]: pl += "+%s:\"%s\" " % (fieldcode, val) # deduce recid from sysno argument (if applicable): if sysno: # ALEPH SYS number was passed, so deduce MySQL recID for the record: recid = get_mysql_recid_from_aleph_sysno(sysno) # deduce collection we are in (if applicable): if recid>0: cc = guess_primary_collection_of_a_record(recid) # deduce user id (if applicable): try: uid = getUid(req) except: uid = 0 ## 0 - start output page_start(req, of, cc, as, uid) if recid>0: ## 1 - detailed record display if of == "hb": of = "hd" if record_exists(recid): if recidb<=recid: # sanity check recidb=recid+1 print_records(req, range(recid,recidb), -1, -9999, of, ot) else: # record does not exist if of.startswith("h"): print_warning(req, "Requested record does not seem to exist.") elif action == "Browse": ## 2 - browse needed if of.startswith("h"): req.write(create_search_box(cc, colls_to_display, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, pl, d1y, d1m, d1d, d2y, d2m, d2d, action)) if as==1 or (p1 or p2 or p3): browse_pattern(req, colls_to_search, p1, f1, rg) browse_pattern(req, colls_to_search, p2, f2, rg) browse_pattern(req, colls_to_search, p3, f3, rg) else: browse_pattern(req, colls_to_search, p, f, rg) else: ## 3 - search needed if of.startswith("h"): req.write(create_search_box(cc, colls_to_display, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, pl, d1y, d1m, d1d, d2y, d2m, d2d, action)) t1 = os.times()[4] results_in_any_collection = HitSet() if as == 1 or (p1 or p2 or p3): ## 3A - advanced search results_in_any_collection = search_pattern(req, p1, f1, m1, ap=ap, of=of, dbg=dbg) if results_in_any_collection._nbhits == 0: return page_end(req, of) if p2: results_tmp = search_pattern(req, p2, f2, m2, ap=ap, of=of, dbg=dbg) if op1 == "a": # add results_in_any_collection.intersect(results_tmp) elif op1 == "o": # or results_in_any_collection.union(results_tmp) elif op1 == "n": # not results_in_any_collection.difference(results_tmp) else: if of.startswith("h"): print_warning(req, "Invalid set operation %s." % op1, "Error") results_in_any_collection.calculate_nbhits() if results_in_any_collection._nbhits == 0: return page_end(req, of) if p3: results_tmp = search_pattern(req, p3, f3, m3, ap=ap, of=of, dbg=dbg) if op2 == "a": # add results_in_any_collection.intersect(results_tmp) elif op2 == "o": # or results_in_any_collection.union(results_tmp) elif op2 == "n": # not results_in_any_collection.difference(results_tmp) else: if of.startswith("h"): print_warning(req, "Invalid set operation %s." % op2, "Error") results_in_any_collection.calculate_nbhits() else: ## 3B - simple search results_in_any_collection = search_pattern(req, p, f, ap=ap, of=of, dbg=dbg) if results_in_any_collection._nbhits == 0: return page_end(req, of)
f142d489b513c32fe095edb224dc0b340ee86d73 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/f142d489b513c32fe095edb224dc0b340ee86d73/search_engine.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3073, 67, 2293, 67, 3072, 12, 3658, 33, 7036, 16, 4946, 33, 71, 2377, 529, 16, 276, 33, 7036, 16, 293, 1546, 3113, 284, 1546, 3113, 14524, 1546, 2163, 3113, 9033, 1546, 3113, 1427, 154...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3073, 67, 2293, 67, 3072, 12, 3658, 33, 7036, 16, 4946, 33, 71, 2377, 529, 16, 276, 33, 7036, 16, 293, 1546, 3113, 284, 1546, 3113, 14524, 1546, 2163, 3113, 9033, 1546, 3113, 1427, 154...
def veto_segments(ifo, config, segmentList, dqSegFile, categories):
def veto_segments(ifo, config, segmentList, dqSegFile, categories, generateVetoes):
def veto_segments(ifo, config, segmentList, dqSegFile, categories): """ generate veto segments for the given ifo @param ifo : name of the ifo @param segmentList : list of science mode segments @param dqSegfile : the file containing dq flags @param categories : list of veto categories """ executable = config.get("condor", "query_dq") start = config.getint("input","gps-start-time") end = config.getint("input","gps-end-time") vetoFiles = {} for category in categories: dqFile = config.get("segments", ifo.lower() + "-cat-" + str(category) + \ "-veto-file") vetoFile = ifo + "-CATEGORY_" + str(category) + "_VETO_SEGS-" + \ str(start) + "-" + \ str(end - start) + ".txt" dqCall = executable + " --ifo " + ifo + " --dq-segfile " + dqSegFile + \ " --segfile " + segmentList + " --flagfile " + dqFile + \ " --outfile " + vetoFile # generate the segments make_external_call(dqCall) # if there are previous vetoes, generate combined try: previousSegs = \ segmentsUtils.fromsegwizard(open(vetoFiles[category-1])) except: previousSegs = None if previousSegs: combinedFile = ifo + "-COMBINED_CAT_" + str(category) + "_VETO_SEGS-" + \ str(start) + "-" + \ str(end - start) + ".txt" vetoSegs = segmentsUtils.fromsegwizard(open(vetoFile)).coalesce() vetoSegs |= previousSegs segmentsUtils.tosegwizard(file(combinedFile,"w"), vetoSegs) vetoFiles[category] = combinedFile else: vetoFiles[category] = vetoFile return vetoFiles
5ab2e3790fdbae17dea04fe2611df6a4bf698c6f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5758/5ab2e3790fdbae17dea04fe2611df6a4bf698c6f/inspiralutils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 331, 11453, 67, 12838, 12, 20299, 16, 642, 16, 3267, 682, 16, 20803, 3289, 812, 16, 6477, 16, 2103, 58, 11453, 281, 4672, 3536, 2103, 331, 11453, 5155, 364, 326, 864, 21479, 225, 632, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 331, 11453, 67, 12838, 12, 20299, 16, 642, 16, 3267, 682, 16, 20803, 3289, 812, 16, 6477, 16, 2103, 58, 11453, 281, 4672, 3536, 2103, 331, 11453, 5155, 364, 326, 864, 21479, 225, 632, ...
return self([R.random_element(bound) for _ in xrange(degree+1)])
return self([R.random_element(*args, **kwds) for _ in xrange(degree+1)])
def random_element(self, degree, bound=0): """ Return a random polynomial. INPUT: degree -- an integer bound -- an integer (default: 0, which tries to spread choice across ring, if implemented)
d7f871f90f66b73e2cff7bbfc8466421a9efed47 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/d7f871f90f66b73e2cff7bbfc8466421a9efed47/polynomial_ring.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2744, 67, 2956, 12, 2890, 16, 10782, 16, 2489, 33, 20, 4672, 3536, 2000, 279, 2744, 16991, 18, 225, 12943, 30, 10782, 1493, 392, 3571, 2489, 1493, 392, 3571, 261, 1886, 30, 374, 16, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2744, 67, 2956, 12, 2890, 16, 10782, 16, 2489, 33, 20, 4672, 3536, 2000, 279, 2744, 16991, 18, 225, 12943, 30, 10782, 1493, 392, 3571, 2489, 1493, 392, 3571, 261, 1886, 30, 374, 16, 14...
If key_function is ommitted then record.id is used, on the assumption that the records objects returned are SeqRecords with a unique id field.
If key_function is ommitted then record.id is used, on the assumption that the records objects returned are SeqRecords with a unique id.
def to_dict(sequences, key_function=None) : """Turns a sequence iterator or list into a dictionary. - sequences - An iterator that returns SeqRecord objects, or simply a list of SeqRecord objects. - key_function - Optional callback function which when given a SeqRecord should return a unique key for the dictionary. e.g. key_function = lambda rec : rec.name or, key_function = lambda rec : rec.description.split()[0] If key_function is ommitted then record.id is used, on the assumption that the records objects returned are SeqRecords with a unique id field. If there are duplicate keys, an error is raised. Example usage, defaulting to using the record.id as key: >>> from Bio import SeqIO >>> handle = open("GenBank/cor6_6.gb", "rU") >>> format = "genbank" >>> id_dict = SeqIO.to_dict(SeqIO.parse(handle, format)) >>> print sorted(id_dict.keys()) ['AF297471.1', 'AJ237582.1', 'L31939.1', 'M81224.1', 'X55053.1', 'X62281.1'] >>> print id_dict["L31939.1"].description Brassica rapa (clone bif72) kin mRNA, complete cds. A more complex example, using the key_function argument in order to use a sequence checksum as the dictionary key: >>> from Bio import SeqIO >>> from Bio.SeqUtils.CheckSum import seguid >>> handle = open("GenBank/cor6_6.gb", "rU") >>> format = "genbank" >>> seguid_dict = SeqIO.to_dict(SeqIO.parse(handle, format), ... key_function = lambda rec : seguid(rec.seq)) >>> for key, record in sorted(seguid_dict.iteritems()) : ... print key, record.id /wQvmrl87QWcm9llO4/efg23Vgg AJ237582.1 BUg6YxXSKWEcFFH0L08JzaLGhQs L31939.1 SabZaA4V2eLE9/2Fm5FnyYy07J4 X55053.1 TtWsXo45S3ZclIBy4X/WJc39+CY M81224.1 l7gjJFE6W/S1jJn5+1ASrUKW/FA X62281.1 uVEYeAQSV5EDQOnFoeMmVea+Oow AF297471.1 This approach is not suitable for very large sets of sequences, as all the SeqRecord objects are held in memory. Instead, consider using the Bio.SeqIO.indexed_dict() function (if it supports your particular file format). """ if key_function is None : key_function = lambda rec : rec.id d = dict() for record in sequences : key = key_function(record) if key in d : raise ValueError("Duplicate key '%s'" % key) d[key] = record return d
77301f7b9231ec70f40bfa7c22608fa2d2e55329 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7167/77301f7b9231ec70f40bfa7c22608fa2d2e55329/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 358, 67, 1576, 12, 17190, 16, 498, 67, 915, 33, 7036, 13, 294, 3536, 31873, 279, 3102, 2775, 578, 666, 1368, 279, 3880, 18, 225, 300, 8463, 225, 300, 1922, 2775, 716, 1135, 14367, 2115...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 358, 67, 1576, 12, 17190, 16, 498, 67, 915, 33, 7036, 13, 294, 3536, 31873, 279, 3102, 2775, 578, 666, 1368, 279, 3880, 18, 225, 300, 8463, 225, 300, 1922, 2775, 716, 1135, 14367, 2115...
self._devideApp.logError(
self._devideApp.log_error_with_exception(
def _reload_module(self, module_instance, glyph): """Reload a module by storing all configuration information, deleting the module, and then recreating and reconnecting it.
151892e4dc7140cf03301e7e11892e7fcfba5fc9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4494/151892e4dc7140cf03301e7e11892e7fcfba5fc9/graphEditor.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 17517, 67, 2978, 12, 2890, 16, 1605, 67, 1336, 16, 9440, 4672, 3536, 13013, 279, 1605, 635, 15729, 777, 1664, 1779, 16, 12993, 326, 1605, 16, 471, 1508, 283, 23799, 471, 11812, 310,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 389, 17517, 67, 2978, 12, 2890, 16, 1605, 67, 1336, 16, 9440, 4672, 3536, 13013, 279, 1605, 635, 15729, 777, 1664, 1779, 16, 12993, 326, 1605, 16, 471, 1508, 283, 23799, 471, 11812, 310,...
self.ecomap.destroySelf() cherrypy.session['message'] = "deleted"
if cherrypy.session.get(UNI_PARAM,None) in ADMIN_USERS: self.ecomap.destroySelf() cherrypy.session['message'] = "deleted"
def delete(self,confirm=""): self.ecomap.destroySelf() cherrypy.session['message'] = "deleted" return httptools.redirect("/myList")
f9f647d634270515bee09b6beb890e79a8968c7d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5854/f9f647d634270515bee09b6beb890e79a8968c7d/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1430, 12, 2890, 16, 10927, 1546, 6, 4672, 309, 462, 370, 28398, 18, 3184, 18, 588, 12, 10377, 67, 8388, 16, 7036, 13, 316, 25969, 67, 30846, 30, 365, 18, 30433, 438, 18, 11662, 10084, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1430, 12, 2890, 16, 10927, 1546, 6, 4672, 309, 462, 370, 28398, 18, 3184, 18, 588, 12, 10377, 67, 8388, 16, 7036, 13, 316, 25969, 67, 30846, 30, 365, 18, 30433, 438, 18, 11662, 10084, ...
filename = os.path.splitext(self.sourceFilename)[0] + '.pdf'
if self.sourceFilename: filename = os.path.splitext(self.sourceFilename)[0] + '.pdf'
def saveAsPresentation(self): """Write the PDF document, one slide per page.""" if self.verbose: print 'saving presentation...' pageSize = (self.pageWidth, self.pageHeight) filename = os.path.splitext(self.sourceFilename)[0] + '.pdf' if self.outDir: filename = os.path.join(self.outDir,os.path.basename(filename)) if self.verbose: print filename canv = canvas.Canvas(filename, pagesize = pageSize) canv.setPageCompression(self.compression)
f1978dc295686f0bc28de276ebf41b91d67e5b87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f1978dc295686f0bc28de276ebf41b91d67e5b87/pythonpoint.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1923, 1463, 6351, 367, 12, 2890, 4672, 3536, 3067, 326, 12667, 1668, 16, 1245, 12701, 1534, 1363, 12123, 309, 365, 18, 11369, 30, 1172, 296, 87, 5339, 22525, 7821, 13387, 273, 261, 2890, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1923, 1463, 6351, 367, 12, 2890, 4672, 3536, 3067, 326, 12667, 1668, 16, 1245, 12701, 1534, 1363, 12123, 309, 365, 18, 11369, 30, 1172, 296, 87, 5339, 22525, 7821, 13387, 273, 261, 2890, ...
def fl_set_xyplot_linewidth(obj, id, lw): """ fl_set_xyplot_linewidth(obj, id, lw) """ _fl_set_xyplot_linewidth(obj, id, lw)
def fl_set_xyplot_linewidth(pObject, id, lw): """ fl_set_xyplot_linewidth(pObject, id, lw) """ _fl_set_xyplot_linewidth(pObject, id, lw)
def fl_set_xyplot_linewidth(obj, id, lw): """ fl_set_xyplot_linewidth(obj, id, lw) """ _fl_set_xyplot_linewidth(obj, id, lw)
9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1183, 67, 542, 67, 1698, 4032, 67, 7511, 14434, 12, 84, 921, 16, 612, 16, 14589, 4672, 3536, 1183, 67, 542, 67, 1698, 4032, 67, 7511, 14434, 12, 84, 921, 16, 612, 16, 14589, 13, 3536...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1183, 67, 542, 67, 1698, 4032, 67, 7511, 14434, 12, 84, 921, 16, 612, 16, 14589, 4672, 3536, 1183, 67, 542, 67, 1698, 4032, 67, 7511, 14434, 12, 84, 921, 16, 612, 16, 14589, 13, 3536...
def opening(self, node): s = u'' s += write("catch") return s
def opening(s, node): r = u'' r += cls.write("catch") return r
def opening(self, node): s = u'' s += write("catch") return s
01a99d0db0499777506f7fbf9ecf7a7e70c7a9e2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/01a99d0db0499777506f7fbf9ecf7a7e70c7a9e2/Packer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10890, 12, 2890, 16, 756, 4672, 272, 273, 582, 6309, 272, 1011, 1045, 2932, 14683, 7923, 327, 272, 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, 10890, 12, 2890, 16, 756, 4672, 272, 273, 582, 6309, 272, 1011, 1045, 2932, 14683, 7923, 327, 272, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
return S_ERROR('Failed to store some or all the parameters')
return S_ERROR( 'Failed to store some or all the parameters' )
def setHeartBeatData(self,jobID,staticDataDict, dynamicDataDict): """ Add the job's heart beat data to the database """
99c1bc850ba087890925b3180df206f65bb1d4b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/99c1bc850ba087890925b3180df206f65bb1d4b3/JobDB.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 5256, 485, 1919, 270, 751, 12, 2890, 16, 4688, 734, 16, 3845, 751, 5014, 16, 5976, 751, 5014, 4672, 3536, 1436, 326, 1719, 1807, 3904, 485, 23795, 501, 358, 326, 2063, 3536, 2, 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, 1, 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, 444, 5256, 485, 1919, 270, 751, 12, 2890, 16, 4688, 734, 16, 3845, 751, 5014, 16, 5976, 751, 5014, 4672, 3536, 1436, 326, 1719, 1807, 3904, 485, 23795, 501, 358, 326, 2063, 3536, 2, -1...
u'Peikar'], 'no': [u'Peker', u'Etternavn', u'Tobokstavsforkortelse', u'Trebokstavsforkortelse', u'Flertydig', u'Pekerside'],
u'Peikar', u'Disambig'], 'no': [u'Peker', u'Etternavn', u'Disambig', u'Tobokstavsforkortelse', u'Trebokstavsforkortelse', u'Flertydig', u'Pekerside'],
def __init__(self): family.Family.__init__(self) self.name = 'wikipedia'
cf212e6d90e5c18d2e4fdfc6d63af4911fe41e56 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4404/cf212e6d90e5c18d2e4fdfc6d63af4911fe41e56/wikipedia_family.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 6755, 18, 9203, 16186, 2738, 972, 12, 2890, 13, 365, 18, 529, 273, 296, 11999, 13744, 11, 2, 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, 1001, 2738, 972, 12, 2890, 4672, 6755, 18, 9203, 16186, 2738, 972, 12, 2890, 13, 365, 18, 529, 273, 296, 11999, 13744, 11, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
heights for links :math:`$d$` levels below the cluster
heights for links :math:`d` levels below the cluster
def inconsistent(Z, d=2): """ Calculates inconsistency statistics on a linkage. :Parameters: - d : int The number of links up to ``d`` levels below each non-singleton cluster - Z : ndarray The :math:`$(n-1)$` by 4 matrix encoding the linkage (hierarchical clustering). See ``linkage`` documentation for more information on its form. :Returns: - R : ndarray A :math:`$(n-1)$` by 5 matrix where the ``i``'th row contains the link statistics for the non-singleton cluster ``i``. The link statistics are computed over the link heights for links :math:`$d$` levels below the cluster ``i``. ``R[i,0]`` and ``R[i,1]`` are the mean and standard deviation of the link heights, respectively; ``R[i,2]`` is the number of links included in the calculation; and ``R[i,3]`` is the inconsistency coefficient, .. math: \frac{\mathtt{Z[i,2]}-\mathtt{R[i,0]}} {R[i,1]}. This function behaves similarly to the MATLAB(TM) inconsistent function. """ Z = np.asarray(Z, order='c') Zs = Z.shape is_valid_linkage(Z, throw=True, name='Z') if (not d == np.floor(d)) or d < 0: raise ValueError('The second argument d must be a nonnegative integer value.')
8172e9e1737f1f6d84d1b06fa46e587e764a1a0f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5882/8172e9e1737f1f6d84d1b06fa46e587e764a1a0f/hierarchy.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 27403, 12, 62, 16, 302, 33, 22, 4672, 3536, 26128, 316, 28725, 7691, 603, 279, 1692, 410, 18, 225, 294, 2402, 30, 300, 302, 294, 509, 1021, 1300, 434, 4716, 731, 358, 12176, 72, 10335,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 27403, 12, 62, 16, 302, 33, 22, 4672, 3536, 26128, 316, 28725, 7691, 603, 279, 1692, 410, 18, 225, 294, 2402, 30, 300, 302, 294, 509, 1021, 1300, 434, 4716, 731, 358, 12176, 72, 10335,...
version, msgcount, masteridx, transidx = unpack('<4i', buf[4:20]) ii = '<ii'
version, msgcount, masteridx, transidx = unpack('<4I', buf[4:20]) ii = '<II'
def _parse(self, fp): """Override this method to support alternative .mo formats.""" # We need to & all 32 bit unsigned integers with 0xffffffff for # portability to 64 bit machines. MASK = 0xffffffff unpack = struct.unpack filename = getattr(fp, 'name', '') # Parse the .mo file header, which consists of 5 little endian 32 # bit words. self._catalog = catalog = {} buf = fp.read() buflen = len(buf) # Are we big endian or little endian? magic = unpack('<i', buf[:4])[0] & MASK if magic == self.LE_MAGIC: version, msgcount, masteridx, transidx = unpack('<4i', buf[4:20]) ii = '<ii' elif magic == self.BE_MAGIC: version, msgcount, masteridx, transidx = unpack('>4i', buf[4:20]) ii = '>ii' else: raise IOError(0, 'Bad magic number', filename) # more unsigned ints msgcount &= MASK masteridx &= MASK transidx &= MASK # Now put all messages from the .mo file buffer into the catalog # dictionary. for i in xrange(0, msgcount): mlen, moff = unpack(ii, buf[masteridx:masteridx+8]) moff &= MASK mend = moff + (mlen & MASK) tlen, toff = unpack(ii, buf[transidx:transidx+8]) toff &= MASK tend = toff + (tlen & MASK) if mend < buflen and tend < buflen: tmsg = buf[toff:tend] catalog[buf[moff:mend]] = tmsg else: raise IOError(0, 'File is corrupt', filename) # See if we're looking at GNU .mo conventions for metadata if mlen == 0 and tmsg.lower().startswith('project-id-version:'): # Catalog description for item in tmsg.split('\n'): item = item.strip() if not item: continue k, v = item.split(':', 1) k = k.strip().lower() v = v.strip() self._info[k] = v if k == 'content-type': self._charset = v.split('charset=')[1] # advance to next entry in the seek tables masteridx += 8 transidx += 8
3f5e2f11ac43eaefcf057cddfc65684bdfa0ec5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3f5e2f11ac43eaefcf057cddfc65684bdfa0ec5e/gettext.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2670, 12, 2890, 16, 4253, 4672, 3536, 6618, 333, 707, 358, 2865, 10355, 263, 8683, 6449, 12123, 468, 1660, 1608, 358, 473, 777, 3847, 2831, 9088, 12321, 598, 374, 28857, 364, 468, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2670, 12, 2890, 16, 4253, 4672, 3536, 6618, 333, 707, 358, 2865, 10355, 263, 8683, 6449, 12123, 468, 1660, 1608, 358, 473, 777, 3847, 2831, 9088, 12321, 598, 374, 28857, 364, 468, 1...
nsamples-=1
nsamples -= 1
def getGapList(self, filename, time_tolerance = -1, samprate_tolerance = -1, min_gap = None, max_gap = None): """ Returns gaps, overlaps and trace header information of a given file. Each item has a starttime and a duration value to characterize the gap. The starttime is the last correct data sample. If no gaps are found it will return an empty list. @param time_tolerance: Time tolerance while reading the traces, default to -1 (1/2 sample period). @param samprate_tolerance: Sample rate tolerance while reading the traces, defaults to -1 (rate dependent). @param min_gap: Omit gaps with less than this value if not None. @param max_gap: Omit gaps with greater than this value if not None. @return: List of tuples in form of (network, station, location, channel, starttime, endtime, gap, samples) """ # read file mstg = self.readFileToTraceGroup(filename, dataflag = 0, skipnotdata = 0, timetol = time_tolerance, sampratetol = samprate_tolerance) gap_list = [] # iterate through traces cur = mstg.contents.traces.contents for _ in xrange(mstg.contents.numtraces-1): next = cur.next.contents # Skip MSTraces with 0 sample rate, usually from SOH records if cur.samprate == 0: cur = next continue # Check that sample rates match using default tolerance if not self._isRateTolerable(cur.samprate, next.samprate): msg = "%s Sample rate changed! %.10g -> %.10g\n" print msg % (cur.samprate, next.samprate) gap = (next.starttime - cur.endtime) / HPTMODULUS # Check that any overlap is not larger than the trace coverage if gap < 0: if next.samprate: delta = 1 / float(next.samprate) else: delta = 0 temp = (next.endtime - next.starttime) / HPTMODULUS + delta if (gap * -1) > temp: gap = -1 * temp # Check gap/overlap criteria if min_gap and gap < min_gap: cur = next continue if max_gap and gap > max_gap: cur = next continue # Number of missing samples nsamples = math.fabs(gap) * cur.samprate if gap > 0: nsamples-=1 else: nsamples+=1 # Convert to python datetime objects time1 = DateTime.utcfromtimestamp(cur.endtime / HPTMODULUS) time2 = DateTime.utcfromtimestamp(next.starttime / HPTMODULUS) gap_list.append((cur.network, cur.station, cur.location, cur.channel, time1, time2, gap, nsamples)) cur = next return gap_list
da81b4ce7064a28a168b56663efe435b307a52d4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10470/da81b4ce7064a28a168b56663efe435b307a52d4/libmseed.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7162, 438, 682, 12, 2890, 16, 1544, 16, 813, 67, 25456, 273, 300, 21, 16, 16260, 683, 340, 67, 25456, 273, 300, 21, 16, 1131, 67, 14048, 273, 599, 16, 943, 67, 14048, 273, 599, 4672,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 7162, 438, 682, 12, 2890, 16, 1544, 16, 813, 67, 25456, 273, 300, 21, 16, 16260, 683, 340, 67, 25456, 273, 300, 21, 16, 1131, 67, 14048, 273, 599, 16, 943, 67, 14048, 273, 599, 4672,...
def on_select_tag(self, widget, row=None, col=None):
def on_select_tag(self, widget, row=None, col=None):
def on_select_tag(self, widget, row=None, col=None): #pylint: disable-msg=W0613 #When you clic on a tag, you want to unselect the tasks self.task_tview.get_selection().unselect_all() self.taskdone_tview.get_selection().unselect_all() self.do_refresh() #self.do_refresh()
fac54dcba973acc5967f43b60fb540659a1a87a8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8234/fac54dcba973acc5967f43b60fb540659a1a87a8/browser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 67, 4025, 67, 2692, 12, 2890, 16, 3604, 16, 1027, 33, 7036, 16, 645, 33, 7036, 4672, 468, 2074, 5671, 30, 4056, 17, 3576, 33, 59, 7677, 3437, 468, 9434, 1846, 927, 335, 603, 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, 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, 4025, 67, 2692, 12, 2890, 16, 3604, 16, 1027, 33, 7036, 16, 645, 33, 7036, 4672, 468, 2074, 5671, 30, 4056, 17, 3576, 33, 59, 7677, 3437, 468, 9434, 1846, 927, 335, 603, 279...
fid.close()
fid.close()
def write(self): """ write the client menu """ buf = self.buildMenu() filename = os.path.join(self.config.imaging_api['bootmenus_folder'], pulse2.utils.reduceMACAddress(self.mac))
0bd0b28780e5d386cbe7ef6fc848c8feeb79a25e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5988/0bd0b28780e5d386cbe7ef6fc848c8feeb79a25e/menu.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 12, 2890, 4672, 3536, 1045, 326, 1004, 3824, 3536, 1681, 273, 365, 18, 3510, 4599, 1435, 1544, 273, 1140, 18, 803, 18, 5701, 12, 2890, 18, 1425, 18, 381, 5755, 67, 2425, 3292, 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, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 12, 2890, 4672, 3536, 1045, 326, 1004, 3824, 3536, 1681, 273, 365, 18, 3510, 4599, 1435, 1544, 273, 1140, 18, 803, 18, 5701, 12, 2890, 18, 1425, 18, 381, 5755, 67, 2425, 3292, 71...
user1.is_superuser = False user1.save()
def test_view_list(self): """ Test listing all virtual machines """ url = '/vms/' user2 = User(id=3, username='tester1', is_superuser=True) user2.set_password('secret') user2.save() # setup vms and perms vm1, cluster1 = self.create_virtual_machine(cluster, 'test1') vm2, cluster1 = self.create_virtual_machine(cluster, 'test2') vm3, cluster1 = self.create_virtual_machine(cluster, 'test3') user1.grant('admin', vm) user1.grant('admin', vm1) # anonymous user response = c.get(url, follow=True) self.assertEqual(200, response.status_code) self.assertTemplateUsed(response, 'login.html') # user with perms on no virtual machines self.assert_(c.login(username=user.username, password='secret')) response = c.get(url) self.assertEqual(200, response.status_code) self.assertEquals('text/html; charset=utf-8', response['content-type']) self.assertTemplateUsed(response, 'virtual_machine/list.html') vms = response.context['vmlist'] self.assertFalse(vms) # user with some perms user1.is_superuser = False user1.save() self.assert_(c.login(username=user1.username, password='secret')) response = c.get(url) self.assertEqual(200, response.status_code) self.assertEquals('text/html; charset=utf-8', response['content-type']) self.assertTemplateUsed(response, 'virtual_machine/list.html') vms = response.context['vmlist'] self.assert_(vm in vms) self.assert_(vm1 in vms) self.assertEqual(2, len(vms)) # authorized (superuser) user2.is_superuser=True user2.save() self.assert_(c.login(username=user2.username, password='secret')) response = c.get(url) self.assertEqual(200, response.status_code) self.assertEquals('text/html; charset=utf-8', response['content-type']) self.assertTemplateUsed(response, 'virtual_machine/list.html') vms = response.context['vmlist'] self.assert_(vm in vms) self.assert_(vm1 in vms) self.assert_(vm2 in vms) self.assert_(vm3 in vms) self.assertEqual(len(vms), 4)
904957b34a6efd9c650d23700156c3a0bf1af7ee /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10509/904957b34a6efd9c650d23700156c3a0bf1af7ee/virtual_machine.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 1945, 67, 1098, 12, 2890, 4672, 3536, 7766, 11591, 777, 5024, 15942, 3536, 880, 273, 1173, 31032, 2473, 225, 729, 22, 273, 2177, 12, 350, 33, 23, 16, 2718, 2218, 1078, 387, 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, 1842, 67, 1945, 67, 1098, 12, 2890, 4672, 3536, 7766, 11591, 777, 5024, 15942, 3536, 880, 273, 1173, 31032, 2473, 225, 729, 22, 273, 2177, 12, 350, 33, 23, 16, 2718, 2218, 1078, 387, 2...
z = self.gp().eval('Lseries(%s,,%s)'%(a,k-1)) if 'pole' in z: raise ArithmeticError, z elif 'Warning' in z: i = z.rfind('\n') msg = z[:i].replace('digits','decimal digits')
try: z = self.gp()('Vec(Lseries(%s,,%s))'%(a,k-1)) except TypeError, msg: raise RuntimeError, "%s\nUnable to compute Taylor expansion (try lowering the number of terms)"%msg r = repr(z) if 'pole' in r: raise ArithmeticError, r elif 'Warning' in r: i = r.rfind('\n') msg = r[:i].replace('digits','decimal digits')
def taylor_series(self, a=0, k=6, var='z'): """ Return the first k terms of the Taylor series expansion of the $L$-series about $a$.
236a2d8d22bd5677f934ee67e0b88553f91d64f4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/236a2d8d22bd5677f934ee67e0b88553f91d64f4/dokchitser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 268, 528, 80, 280, 67, 10222, 12, 2890, 16, 279, 33, 20, 16, 417, 33, 26, 16, 569, 2218, 94, 11, 4672, 3536, 2000, 326, 1122, 417, 6548, 434, 326, 399, 528, 80, 280, 4166, 17965, 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, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 268, 528, 80, 280, 67, 10222, 12, 2890, 16, 279, 33, 20, 16, 417, 33, 26, 16, 569, 2218, 94, 11, 4672, 3536, 2000, 326, 1122, 417, 6548, 434, 326, 399, 528, 80, 280, 4166, 17965, 4...
for key in self.buffer: del self.buffer[key]
self.buffer = {}
def flush(self): """Kills all data in the buffer""" for key in self.buffer: del self.buffer[key]
63b69e23790a252c2a4830430d7f50fa9b1c7871 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1012/63b69e23790a252c2a4830430d7f50fa9b1c7871/logview.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3663, 12, 2890, 4672, 3536, 19045, 87, 777, 501, 316, 326, 1613, 8395, 365, 18, 4106, 273, 2618, 225, 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, 3663, 12, 2890, 4672, 3536, 19045, 87, 777, 501, 316, 326, 1613, 8395, 365, 18, 4106, 273, 2618, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
satisfied = set([0])
brokenByErase = {} satisfied = { 0 : 0 }
def _orderComponents(compGraph):
427cf111d53cefe7e9cc2048d7f658170bb313ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/427cf111d53cefe7e9cc2048d7f658170bb313ce/deptable.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1019, 7171, 12, 2919, 4137, 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, 0, ...
[ 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, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1019, 7171, 12, 2919, 4137, 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, -1...
'zlapack_lite.c', 'dlapack_lite.c', 'blas_lite.c', 'dlamch.c', 'f2c_lite.c','f2c.h'],
'pythonxerbla.c', 'zlapack_lite.c', 'dlapack_lite.c', 'blas_lite.c', 'dlamch.c', 'f2c_lite.c','f2c.h'],
def get_lapack_lite_sources(ext, build_dir): if not lapack_info: print "### Warning: Using unoptimized lapack ###" return ext.depends[:-1] else: return ext.depends[:1]
6a94903ebb5697192c228c91b4a5f9c5507f2cff /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/14925/6a94903ebb5697192c228c91b4a5f9c5507f2cff/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 3762, 484, 67, 80, 1137, 67, 10141, 12, 408, 16, 1361, 67, 1214, 4672, 309, 486, 328, 438, 484, 67, 1376, 30, 1172, 315, 13151, 9728, 30, 225, 11637, 640, 16689, 1235, 328, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 67, 3762, 484, 67, 80, 1137, 67, 10141, 12, 408, 16, 1361, 67, 1214, 4672, 309, 486, 328, 438, 484, 67, 1376, 30, 1172, 315, 13151, 9728, 30, 225, 11637, 640, 16689, 1235, 328, ...
def writable (self):
def writable(self):
def writable (self): return (not self.connected) or len(self.out_buffer)
52c4de7c23c31563e4f0316b68865e17bb8c0f33 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/52c4de7c23c31563e4f0316b68865e17bb8c0f33/asyncore.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9691, 12, 2890, 4672, 327, 261, 902, 365, 18, 8537, 13, 578, 562, 12, 2890, 18, 659, 67, 4106, 13, 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, 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, 9691, 12, 2890, 4672, 327, 261, 902, 365, 18, 8537, 13, 578, 562, 12, 2890, 18, 659, 67, 4106, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
ole mahdollisuutta käyttää älykkäämpien rajoitusmenetelmiä. Voit lähettää lisäysehdotuksesi
ole mahdollisuutta käyttää älykkäämpiä rajoitusmenetelmiä. Voit lähettää lisäysehdotuksesi
def _print_error_forbidden(req): "Print an error, if adding new words is no longer possible" jotools.write(req, u'''
2beb9efb30577e5182df34f63e5284c964a6be5b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10971/2beb9efb30577e5182df34f63e5284c964a6be5b/ehdotasanoja.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1188, 67, 1636, 67, 1884, 9215, 12, 3658, 4672, 315, 5108, 392, 555, 16, 309, 6534, 394, 4511, 353, 1158, 7144, 3323, 6, 525, 352, 8192, 18, 2626, 12, 3658, 16, 582, 26418, 2, 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, 1, 1, 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, 1188, 67, 1636, 67, 1884, 9215, 12, 3658, 4672, 315, 5108, 392, 555, 16, 309, 6534, 394, 4511, 353, 1158, 7144, 3323, 6, 525, 352, 8192, 18, 2626, 12, 3658, 16, 582, 26418, 2, -...
httpd = BaseHTTPServer.HTTPServer(("localhost", 9000), LocalNamesHandler)
httpd = BaseHTTPServer.HTTPServer(("services.taoriver.net", 9090), LocalNamesHandler)
def xmlrpc_render(self, format, url): if type(url) == type([]): ns = localnames.aggregate(url) else: ns = localnames.get_namespace(url) if format in ["XML-RPC", "XML-RPC-text"]: ns2 = {} for k in ["LN", "X", "NS", "PATTERN"]: ns2[k] = un_unicode_dict(ns[k]) if format == "XML-RPC": return ns2 else: return xmlrpclib.dumps((result,)) elif format == "version1.1": return localnames.clean(ns) elif format == "version1.1-original": return ns["TEXT"]
d600055cd6340e744a27da8778556c8f4aa5879c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2338/d600055cd6340e744a27da8778556c8f4aa5879c/server.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 31811, 67, 5902, 12, 2890, 16, 740, 16, 880, 4672, 309, 618, 12, 718, 13, 422, 618, 3816, 65, 4672, 3153, 273, 1191, 1973, 18, 18573, 12, 718, 13, 469, 30, 3153, 273, 1191, 1973, 18,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 31811, 67, 5902, 12, 2890, 16, 740, 16, 880, 4672, 309, 618, 12, 718, 13, 422, 618, 3816, 65, 4672, 3153, 273, 1191, 1973, 18, 18573, 12, 718, 13, 469, 30, 3153, 273, 1191, 1973, 18,...
from tardis import settings
from django.conf import settings
def setUp(self): from tardis import settings import os f = open(os.path.join(settings.APP_ROOT, 'tardis_portal/tests/METS_test.xml'), 'r') xmlString = f.read() f.close() from tardis.tardis_portal.ExperimentParser import ExperimentParser self.experimentParser = ExperimentParser(str(xmlString))
f203eb462a2d0bcb734a7258964dcac19b408902 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11933/f203eb462a2d0bcb734a7258964dcac19b408902/tests.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24292, 12, 2890, 4672, 628, 13710, 18, 3923, 1930, 1947, 1930, 1140, 284, 273, 1696, 12, 538, 18, 803, 18, 5701, 12, 4272, 18, 7215, 67, 9185, 16, 296, 88, 1060, 291, 67, 24386, 19, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 24292, 12, 2890, 4672, 628, 13710, 18, 3923, 1930, 1947, 1930, 1140, 284, 273, 1696, 12, 538, 18, 803, 18, 5701, 12, 4272, 18, 7215, 67, 9185, 16, 296, 88, 1060, 291, 67, 24386, 19, ...
sys.stdout.flush()
self.owner='unknown' self.jobGroup='unknown' self.jobType='unknown' self.processingType='uknown' self.userGroup='unknown' self.jobClass='unknown' self.inputDataFiles=0 self.outputDataFiles=0 self.inputDataSize=0 self.inputSandboxSize=0 self.outputSandboxSize=0 self.outputDataSize=0 self.diskSpaceConsumed=0 self.processedEvents = 0
def __init__(self, jobID=None): """ Standard constructor """ # FIXME: replace by getSystemSection( "WorkloadManagement/JobWrapper" ) self.section = "%s/JobWrapper" % ( getSystemSection( "WorkloadManagement/" )) self.log = gLogger #Create the acctounting report self.accountingReport = AccountingJob() # Initialize for accounting self.wmsMajorStatus = "unknown" self.wmsMinorStatus = "unknown" #Set now as start time self.accountingReport.setStartTime() # FIXME: if no jobID is provided many things will fail later on with this default, make it 0 # FIXME: it should be cast to int here and not 10 times later on self.jobID = jobID # FIXME: this info is in DIRAC.rootPath self.root = os.getcwd() self.localSiteRoot = gConfig.getValue('/LocalSite/Root',self.root) # FIXME: Why? this is done by dirac-pilot self.__loadLocalCFGFiles(self.localSiteRoot) # FIXME: RPCClients should be created just before using them os that the # resolution is than at the last moment. Other wise the RPCClient should # delay the resolution. self.jobReport = RPCClient('WorkloadManagement/JobStateUpdate') self.inputSandboxClient = SandboxClient() self.outputSandboxClient = SandboxClient('Output') # FIXME why not use DIRAC.version self.diracVersion = 'DIRAC version v%dr%d build %d' %(DIRAC.majorVersion,DIRAC.minorVersion,DIRAC.patchLevel) self.maxPeekLines = gConfig.getValue(self.section+'/MaxJobPeekLines',20) self.defaultCPUTime = gConfig.getValue(self.section+'/DefaultCPUTime',600) self.defaultOutputFile = gConfig.getValue(self.section+'/DefaultOutputFile','std.out') self.defaultErrorFile = gConfig.getValue(self.section+'/DefaultErrorFile','std.err') # FIXME: should use gConfig.getValue(self.section+'/DiskSE',['-disk','-DST','-USER'] ) self.diskSE = gConfig.getValue(self.section+'/DiskSE','-disk,-DST,-USER') if type(self.diskSE) == type(' '): self.diskSE = self.diskSE.split(',') # FIXME: see above self.tapeSE = gConfig.getValue(self.section+'/TapeSE','-tape,-RDST,-RAW') if type(self.tapeSE) == type(' '): self.tapeSE = self.tapeSE.split(',') self.cleanUpFlag = gConfig.getValue(self.section+'/CleanUpFlag',False) self.localSite = gConfig.getValue('/LocalSite/Site','Unknown') self.pilotRef = gConfig.getValue('/LocalSite/PilotReference','Unknown') self.vo = gConfig.getValue('/DIRAC/VirtualOrganization','lhcb') self.defaultOutputSE = gConfig.getValue(self.section+'/DefaultOutputSE','CERN-FAILOVER') self.rm = ReplicaManager() self.log.verbose('===========================================================================') self.log.verbose('CVS version %s' %(__RCSID__)) self.log.verbose(self.diracVersion) self.log.verbose('Developer tag: 1') self.currentPID = os.getpid() self.log.verbose('Job Wrapper started under PID: %s' % self.currentPID ) self.log.verbose('==========================================================================') self.log.verbose('sys.path is: \n%s' %(string.join(sys.path,'\n'))) self.log.verbose('==========================================================================') if not os.environ.has_key('PYTHONPATH'): self.log.verbose('PYTHONPATH is: null') else: pypath = os.environ['PYTHONPATH'] self.log.verbose('PYTHONPATH is: \n%s' %(string.join(string.split(pypath,':'),'\n'))) self.log.verbose('==========================================================================') if os.environ.has_key('LD_LIBRARY_PATH_SAVE'): if os.environ.has_key('LD_LIBRARY_PATH'): os.environ['LD_LIBRARY_PATH'] = os.environ['LD_LIBRARY_PATH']+':'+os.environ['LD_LIBRARY_PATH_SAVE'] else: os.environ['LD_LIBRARY_PATH'] = os.environ['LD_LIBRARY_PATH_SAVE']
b03e51b6437930714ea21108f8c3e6e5dd0ccb3f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/b03e51b6437930714ea21108f8c3e6e5dd0ccb3f/JobWrapper.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 28913, 33, 7036, 4672, 3536, 8263, 3885, 3536, 468, 9852, 30, 1453, 635, 12996, 5285, 12, 315, 2421, 945, 10998, 19, 2278, 3611, 6, 262, 365, 18, 3464, 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, 1001, 2738, 972, 12, 2890, 16, 28913, 33, 7036, 4672, 3536, 8263, 3885, 3536, 468, 9852, 30, 1453, 635, 12996, 5285, 12, 315, 2421, 945, 10998, 19, 2278, 3611, 6, 262, 365, 18, 3464, 2...
return strftime(self.format, (item,)*8+(0,)).capitalize()
t = (2001, 1, item+1, 12, 0, 0, item, item+1, 0) return strftime(self.format, t).capitalize()
def __getitem__(self, item): if isinstance(item, int): if item < 0: item += self.len if not 0 <= item < self.len: raise IndexError, "out of range" return strftime(self.format, (item,)*8+(0,)).capitalize() elif isinstance(item, type(slice(0))): return [self[e] for e in range(self.len)].__getslice__(item.start, item.stop)
07c57d4e60083981a3ddcd8ca56b85dbc62c4dbb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/07c57d4e60083981a3ddcd8ca56b85dbc62c4dbb/calendar.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 31571, 972, 12, 2890, 16, 761, 4672, 309, 1549, 12, 1726, 16, 509, 4672, 309, 761, 411, 374, 30, 761, 1011, 365, 18, 1897, 309, 486, 374, 1648, 761, 411, 365, 18, 1897, 30, 100...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 31571, 972, 12, 2890, 16, 761, 4672, 309, 1549, 12, 1726, 16, 509, 4672, 309, 761, 411, 374, 30, 761, 1011, 365, 18, 1897, 309, 486, 374, 1648, 761, 411, 365, 18, 1897, 30, 100...
buffer=raw_tag[4:])
buffer=raw_tag[4:4+byte_count])
def read_element(self, copy=True): raw_tag = self.mat_stream.read(8) tag = ndarray(shape=(), dtype=self.dtypes['tag_full'], buffer = raw_tag) mdtype = tag['mdtype'] byte_count = mdtype >> 16 if byte_count: # small data element format if byte_count > 4: raise ValueError, 'Too many bytes for sde format' mdtype = mdtype & 0xFFFF dt = self.dtypes[mdtype] el_count = byte_count / dt.itemsize return ndarray(shape=(el_count,), dtype=dt, buffer=raw_tag[4:]) byte_count = tag['byte_count'] if mdtype == miMATRIX: return self.current_getter().get_array() if mdtype in self.codecs: # encoded char data raw_str = self.mat_stream.read(byte_count) codec = self.codecs[mdtype] if not codec: raise TypeError, 'Do not support encoding %d' % mdtype el = raw_str.decode(codec) else: # numeric data dt = self.dtypes[mdtype] el_count = byte_count / dt.itemsize el = ndarray(shape=(el_count,), dtype=dt, buffer=self.mat_stream.read(byte_count)) if copy: el = el.copy() mod8 = byte_count % 8 if mod8: self.mat_stream.seek(8 - mod8, 1) return el
480afd5e75d2805992c5f44fabda71fe19a0a93a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/480afd5e75d2805992c5f44fabda71fe19a0a93a/mio5.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 67, 2956, 12, 2890, 16, 1610, 33, 5510, 4672, 1831, 67, 2692, 273, 365, 18, 7373, 67, 3256, 18, 896, 12, 28, 13, 1047, 273, 8304, 12, 4867, 33, 9334, 3182, 33, 2890, 18, 72, 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, 855, 67, 2956, 12, 2890, 16, 1610, 33, 5510, 4672, 1831, 67, 2692, 273, 365, 18, 7373, 67, 3256, 18, 896, 12, 28, 13, 1047, 273, 8304, 12, 4867, 33, 9334, 3182, 33, 2890, 18, 72, 2...
gLogger.warn('Problem retrieving sections in /Resources/Sites')
gLogger.warn( 'Problem retrieving sections in /Resources/Sites' )
def getCESiteMapping(gridName=''): """ Returns a dictionary of all CEs and their associated site, e.g. {'ce101.cern.ch':'LCG.CERN.ch', ...]} Assumes CS structure of: /Resources/Sites/<GRIDNAME>/<SITENAME> """ ceSiteMapping = {} gridTypes = gConfig.getSections('/Resources/Sites/',[]) if not gridTypes['OK']: gLogger.warn('Problem retrieving sections in /Resources/Sites') return gridTypes gridTypes = gridTypes['Value'] if gridName: if not gridName in gridTypes: return S_ERROR('Could not get sections for /Resources/Sites/%s' %gridName) gridTypes = [gridName] gLogger.debug('Grid Types are: %s' %(string.join(gridTypes,', '))) for grid in gridTypes: sites = gConfig.getSections('/Resources/Sites/%s' %grid,[]) if not sites['OK']: #gConfig returns S_ERROR for empty sections until version gLogger.warn('Problem retrieving /Resources/Sites/%s section' %grid) return sites if sites: for candidate in sites['Value']: siteCEs = gConfig.getValue('/Resources/Sites/%s/%s/CE' %(grid,candidate),[]) for ce in siteCEs: if ceSiteMapping.has_key(ce): current = ceSiteMapping[ce] gLogger.warn('CE %s already has a defined site %s but it is also defined for %s' %(ce,current,candidate)) else: ceSiteMapping[ce]=candidate return S_OK(ceSiteMapping)
22589f96877819f2316c9c3a130752773212d632 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/22589f96877819f2316c9c3a130752773212d632/SiteCEMapping.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 1441, 4956, 3233, 12, 5222, 461, 2218, 11, 4672, 3536, 2860, 279, 3880, 434, 777, 385, 6705, 471, 3675, 3627, 2834, 16, 425, 18, 75, 18, 13666, 311, 15168, 18, 14770, 18, 343, 11,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1441, 4956, 3233, 12, 5222, 461, 2218, 11, 4672, 3536, 2860, 279, 3880, 434, 777, 385, 6705, 471, 3675, 3627, 2834, 16, 425, 18, 75, 18, 13666, 311, 15168, 18, 14770, 18, 343, 11,...
stream.write(fs.decode(stream.encoding) % msg)
fs = fs.decode(stream.encoding) try: stream.write(fs % msg) except UnicodeEncodeError: stream.write((fs % msg).encode(stream.encoding))
def emit(self, record): """ Emit a record.
d65045e6fee659810fb2ecabeed7e85c6de801b9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3187/d65045e6fee659810fb2ecabeed7e85c6de801b9/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3626, 12, 2890, 16, 1409, 4672, 3536, 16008, 279, 1409, 18, 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, ...
[ 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, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3626, 12, 2890, 16, 1409, 4672, 3536, 16008, 279, 1409, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
if not self.liveWire or \ self.liveWire.startNodeLabel() != self.startNodeLabel: self.liveWire = LiveWire( self.map, activePathMeasure, self.startNodeLabel) self.expandTimer.start(0)
if not self._liveWire or \ self._liveWire.startNodeLabel() != self._startNodeLabel: self._liveWire = LiveWire( self._map, activePathMeasure, self._startNodeLabel) self._expandTimer.start(0)
def startSearch(self): """Starts a search at self.startNodeLabel. Initialized the search and starts a QTimer repeatedly calling _expandBorder()."""
65254bc446b7c353066fe806e0424030a38d558d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10394/65254bc446b7c353066fe806e0424030a38d558d/tools.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 787, 2979, 12, 2890, 4672, 3536, 11203, 279, 1623, 622, 365, 18, 1937, 907, 2224, 18, 225, 10188, 1235, 326, 1623, 471, 2542, 279, 2238, 6777, 30412, 4440, 389, 12320, 8107, 1435, 12123, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 787, 2979, 12, 2890, 4672, 3536, 11203, 279, 1623, 622, 365, 18, 1937, 907, 2224, 18, 225, 10188, 1235, 326, 1623, 471, 2542, 279, 2238, 6777, 30412, 4440, 389, 12320, 8107, 1435, 12123, ...
`s \geq` the sturm bound for `\Gamma_0` at
`s \geq` the Sturm bound for `\Gamma_0` at
def sturm_bound(self, M=None): r""" For a space M of modular forms, this function returns an integer B such that two modular forms in either self or M are equal if and only if their q-expansions are equal to precision B (note that this is 1+ the usual Sturm bound, since `O(q^\mathrm{prec})` has precision prec). If M is none, then M is set equal to self. EXAMPLES:: sage: S37=CuspForms(37,2) sage: S37.sturm_bound() 8 sage: M = ModularForms(11,2) sage: M.sturm_bound() 3 sage: ModularForms(Gamma1(15),2).sturm_bound() 33 .. note::
effc3ad03fe4dd602c740e2cd93685b34d86c56c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/effc3ad03fe4dd602c740e2cd93685b34d86c56c/space.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 384, 27430, 67, 3653, 12, 2890, 16, 490, 33, 7036, 4672, 436, 8395, 2457, 279, 3476, 490, 434, 681, 2490, 10138, 16, 333, 445, 1135, 392, 3571, 605, 4123, 716, 2795, 681, 2490, 10138, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 384, 27430, 67, 3653, 12, 2890, 16, 490, 33, 7036, 4672, 436, 8395, 2457, 279, 3476, 490, 434, 681, 2490, 10138, 16, 333, 445, 1135, 392, 3571, 605, 4123, 716, 2795, 681, 2490, 10138, ...
cty.c_double, [cty.POINTER(FL_OBJECT)],
cty.c_double, [cty.POINTER(FL_OBJECT)],
def fl_add_scrollbar(type, x, y, w, h, label): """ fl_add_scrollbar(type, x, y, w, h, label) -> object """ retval = _fl_add_scrollbar(type, x, y, w, h, label) return retval
9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1183, 67, 1289, 67, 12033, 3215, 12, 723, 16, 619, 16, 677, 16, 341, 16, 366, 16, 1433, 4672, 3536, 1183, 67, 1289, 67, 12033, 3215, 12, 723, 16, 619, 16, 677, 16, 341, 16, 366, 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, 1183, 67, 1289, 67, 12033, 3215, 12, 723, 16, 619, 16, 677, 16, 341, 16, 366, 16, 1433, 4672, 3536, 1183, 67, 1289, 67, 12033, 3215, 12, 723, 16, 619, 16, 677, 16, 341, 16, 366, 16...
self.phase = self.phases["inForeignContent"] self.secondaryPhase = self.phases["inBody"]
foreign = True elif last: new_phase = self.phases["inBody"]
def resetInsertionMode(self): # The name of this method is mostly historical. (It's also used in the # specification.) last = False newModes = { "select":"inSelect", "td":"inCell", "th":"inCell", "tr":"inRow", "tbody":"inTableBody", "thead":"inTableBody", "tfoot":"inTableBody", "caption":"inCaption", "colgroup":"inColumnGroup", "table":"inTable", "head":"inBody", "body":"inBody", "frameset":"inFrameset" } for node in self.tree.openElements[::-1]: nodeName = node.name if node == self.tree.openElements[0]: last = True if nodeName not in ['td', 'th']: # XXX assert self.innerHTML nodeName = self.innerHTML # Check for conditions that should only happen in the innerHTML # case if nodeName in ("select", "colgroup", "head", "frameset"): # XXX assert self.innerHTML if nodeName in newModes: self.phase = self.phases[newModes[nodeName]] break elif node.namespace in (namespaces["mathml"], namespaces["svg"]): self.phase = self.phases["inForeignContent"] self.secondaryPhase = self.phases["inBody"] break elif nodeName == "html": if self.tree.headPointer is None: self.phase = self.phases["beforeHead"] else: self.phase = self.phases["afterHead"] break elif last: self.phase = self.phases["inBody"] break
f6c270353a56490f7ddbd3b7ba3730e2971930a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9368/f6c270353a56490f7ddbd3b7ba3730e2971930a4/html5parser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2715, 29739, 2309, 12, 2890, 4672, 468, 1021, 508, 434, 333, 707, 353, 23958, 23922, 18, 261, 7193, 1807, 2546, 1399, 316, 326, 468, 7490, 12998, 1142, 273, 1083, 394, 18868, 273, 288, 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, 2715, 29739, 2309, 12, 2890, 4672, 468, 1021, 508, 434, 333, 707, 353, 23958, 23922, 18, 261, 7193, 1807, 2546, 1399, 316, 326, 468, 7490, 12998, 1142, 273, 1083, 394, 18868, 273, 288, 3...
if startx == None and starty == None and finishx == None and finishy == None: return k
if startx != None or starty != None: sp, sx, sy, ex, ey, cx, cy = kurve.get_span(k, 0)
def make_smaller( k, startx = None, starty = None, finishx = None, finishy = None ): if startx == None and starty == None and finishx == None and finishy == None: return k sp, sx, sy, ex, ey, cx, cy = kurve.get_span(k, 0) if startx == None: startx = sx if starty == None: starty = sy num_spans = kurve.num_spans(k) sp, sx, sy, ex, ey, cx, cy = kurve.get_span(k, num_spans - 1) if finishx == None: finishx = ex if finishy == None: finishy = ey new_k = kurve.make_section(k, startx, starty, finishx, finishy) kurve.delete(k) return new_k
0f42448ace1838272bd459b6d215b30c20760670 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12576/0f42448ace1838272bd459b6d215b30c20760670/kurve_funcs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 67, 12019, 264, 12, 417, 16, 787, 92, 273, 599, 16, 787, 93, 273, 599, 16, 4076, 92, 273, 599, 16, 4076, 93, 273, 599, 262, 30, 309, 787, 92, 480, 599, 578, 787, 93, 480, 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, 1221, 67, 12019, 264, 12, 417, 16, 787, 92, 273, 599, 16, 787, 93, 273, 599, 16, 4076, 92, 273, 599, 16, 4076, 93, 273, 599, 262, 30, 309, 787, 92, 480, 599, 578, 787, 93, 480, 5...
assert res == type(a)
assert_equal(res,type(a))
def check_type(self,level=5): class foo: pass a= foo() res = inline_tools.inline('return_val = a.type();',['a']) assert res == type(a)
1a2e32f8d57897230b5265290279639d73dda37e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12971/1a2e32f8d57897230b5265290279639d73dda37e/test_scxx_object.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 723, 12, 2890, 16, 2815, 33, 25, 4672, 667, 8431, 30, 1342, 279, 33, 8431, 1435, 400, 273, 6370, 67, 6642, 18, 10047, 2668, 2463, 67, 1125, 273, 279, 18, 723, 5621, 2187, 32...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 866, 67, 723, 12, 2890, 16, 2815, 33, 25, 4672, 667, 8431, 30, 1342, 279, 33, 8431, 1435, 400, 273, 6370, 67, 6642, 18, 10047, 2668, 2463, 67, 1125, 273, 279, 18, 723, 5621, 2187, 32...
if type(names) is not list: names = list(names)
if type(names) is str: names = [names]
def __init__(self, redis_conn, mission_name, transcript_name, parser): self.redis_conn = redis_conn self.mission_name = mission_name self.transcript_name = transcript_name self.parser = parser
ab76bdb1f1ef500b848ddbbac06fea8bb1421d80 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13780/ab76bdb1f1ef500b848ddbbac06fea8bb1421d80/indexer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 5813, 67, 4646, 16, 29396, 67, 529, 16, 15194, 67, 529, 16, 2082, 4672, 365, 18, 12311, 67, 4646, 273, 5813, 67, 4646, 365, 18, 3951, 67, 529, 273, 293...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 5813, 67, 4646, 16, 29396, 67, 529, 16, 15194, 67, 529, 16, 2082, 4672, 365, 18, 12311, 67, 4646, 273, 5813, 67, 4646, 365, 18, 3951, 67, 529, 273, 293...
def postForm(self, address, predata, sysop=False, cookies = None):
def postForm(self, address, predata, sysop = False, cookies = None):
def postForm(self, address, predata, sysop=False, cookies = None): """Post http form data to the given address at this site.
9fc1bc84ab7232d5777e367445476322ea4a7c79 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/9fc1bc84ab7232d5777e367445476322ea4a7c79/wikipedia.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1603, 1204, 12, 2890, 16, 1758, 16, 675, 892, 16, 2589, 556, 273, 1083, 16, 7237, 273, 599, 4672, 3536, 3349, 1062, 646, 501, 358, 326, 864, 1758, 622, 333, 2834, 18, 2, 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, 1603, 1204, 12, 2890, 16, 1758, 16, 675, 892, 16, 2589, 556, 273, 1083, 16, 7237, 273, 599, 4672, 3536, 3349, 1062, 646, 501, 358, 326, 864, 1758, 622, 333, 2834, 18, 2, -100, -100, ...
self.snapDecimals = -int(math.ceil(math.log(self.maxVal-self.minVal, 10)) -2)
mdist = self.maxVal - self.minVal if mdist > 1e-30: self.snapDecimals = -int(math.ceil(math.log(mdist, 10)) -2) else: self.snapDecimals = 1
def setData(self, attr, data): self.clear() self.attr, self.data = attr, data self.curCutPoints = []
ae83bc8e1038df87b0fe497ddb634614447ce035 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6366/ae83bc8e1038df87b0fe497ddb634614447ce035/OWDiscretize.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7929, 12, 2890, 16, 1604, 16, 501, 4672, 365, 18, 8507, 1435, 365, 18, 1747, 16, 365, 18, 892, 273, 1604, 16, 501, 365, 18, 1397, 15812, 5636, 273, 5378, 2, 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, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7929, 12, 2890, 16, 1604, 16, 501, 4672, 365, 18, 8507, 1435, 365, 18, 1747, 16, 365, 18, 892, 273, 1604, 16, 501, 365, 18, 1397, 15812, 5636, 273, 5378, 2, -100, -100, -100, -100, -...
P = AddRoundKey(P,K)
P = AddRoundKey(P, K)
def __call__(self, P, K): r""" Encrypts the plaintext $P$ using the key $K$.
e506ccc2459e6e3948659b0d1b28d9d6b70342e4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/e506ccc2459e6e3948659b0d1b28d9d6b70342e4/sr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 453, 16, 1475, 4672, 436, 8395, 8594, 20261, 326, 11917, 271, 52, 8, 1450, 326, 498, 271, 47, 8, 18, 2, 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, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 453, 16, 1475, 4672, 436, 8395, 8594, 20261, 326, 11917, 271, 52, 8, 1450, 326, 498, 271, 47, 8, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, ...
return self.cursor.execute("SELECT COUNT(*) FROM %s" % self.dbtablename).fetchone()[0]
self.cursor.execute("SELECT COUNT(*) FROM %s" % self.dbtablename) return self.cursor.fetchone()[0]
def __len__(self): return self.cursor.execute("SELECT COUNT(*) FROM %s" % self.dbtablename).fetchone()[0]
b8545b74150cfe31e029f12509877cab82e33719 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/b8545b74150cfe31e029f12509877cab82e33719/dbtables.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1897, 972, 12, 2890, 4672, 327, 365, 18, 9216, 18, 8837, 2932, 4803, 12666, 24099, 4571, 738, 87, 6, 738, 365, 18, 1966, 7032, 14724, 2934, 5754, 476, 1435, 63, 20, 65, 2, 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, 1, 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, 1897, 972, 12, 2890, 4672, 327, 365, 18, 9216, 18, 8837, 2932, 4803, 12666, 24099, 4571, 738, 87, 6, 738, 365, 18, 1966, 7032, 14724, 2934, 5754, 476, 1435, 63, 20, 65, 2, -100, ...
experiment_id2accession_id2reading_ls[experiment_id][accession_id] = []
experiment_id2accession_id2reading_ls[experiment_id][accession_id] = {}
def get_experiment_id2accession_id2reading_ls(self, curs, raw_phenotype_table): """ 2008-02-29 replicate gets converted to arabic and included in the returning results 2008-02-23 'long ago' now mapped to 'NA' the reading_error_dict applied before testing whether it's NA or not 2008-02-20 """ sys.stderr.write("Getting experiment_id2accession_id2reading_ls ...\n") curs.execute("select experiment, accession, replicate, reading from %s where measure='first flower open'"%raw_phenotype_table) rows = curs.fetchall() experiment_id2accession_id2reading_ls = {} reading_error_dict = {'1/14/2003+C41':'1/14/03', '110/20/03':'11/20/03', '1/12003':'1/12/03', #could also be 1/1/03 but after discussing with glenda and look around the table, 1/12/03 is more likely. '10//24/03':'10/24/03', 'long ago':'NA'} from pymodule.roman import fromRoman for row in rows: experiment_id, accession_id, replicate, reading = row if reading in reading_error_dict: #correct the typo reading = reading_error_dict[reading] if reading!='NA' and reading!='N': if experiment_id not in experiment_id2accession_id2reading_ls: experiment_id2accession_id2reading_ls[experiment_id] = {} if accession_id not in experiment_id2accession_id2reading_ls[experiment_id]: experiment_id2accession_id2reading_ls[experiment_id][accession_id] = [] try: if experiment_id==3 and reading[-2:]=='99': #wrong year input reading = reading[:-2]+'03' if experiment_id==4 and reading[-2:]=='00': #wrong year input reading = reading[:-2]+'02' if reading!='DNF': time_first_flower_open = time.strptime(reading, '%m/%d/%y') #transform it into a time tuple else: time_first_flower_open = 'DNF' except: print "reading:",reading traceback.print_exc() print sys.exc_info() sys.exit(2) experiment_id2accession_id2reading_ls[experiment_id][accession_id].append((time_first_flower_open, fromRoman(replicate))) sys.stderr.write("Done.\n") return experiment_id2accession_id2reading_ls
e6897ae45631832ceb92bfc9db5ab27edc82a829 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9645/e6897ae45631832ceb92bfc9db5ab27edc82a829/ProcessPhenotype.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 18142, 67, 350, 22, 3860, 285, 67, 350, 22, 21803, 67, 3251, 12, 2890, 16, 25326, 16, 1831, 67, 13819, 10570, 67, 2121, 4672, 3536, 4044, 28, 17, 3103, 17, 5540, 28476, 5571, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 67, 18142, 67, 350, 22, 3860, 285, 67, 350, 22, 21803, 67, 3251, 12, 2890, 16, 25326, 16, 1831, 67, 13819, 10570, 67, 2121, 4672, 3536, 4044, 28, 17, 3103, 17, 5540, 28476, 5571, ...
lu.CheckPrereq() hm = HooksMaster(rpc.call_hooks_runner, self, lu) h_results = hm.RunPhase(constants.HOOKS_PHASE_PRE) lu.HooksCallBack(constants.HOOKS_PHASE_PRE, h_results, self._feedback_fn, None) try: result = lu.Exec(self._feedback_fn) h_results = hm.RunPhase(constants.HOOKS_PHASE_POST) result = lu.HooksCallBack(constants.HOOKS_PHASE_POST, h_results, self._feedback_fn, result) finally: if write_count != self.context.cfg.write_count: hm.RunConfigUpdate()
result = self._ExecLU(lu)
def ExecOpCode(self, op): """Execute an opcode.
36c381d7045383280c76903f255ddcf601d52b15 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/36c381d7045383280c76903f255ddcf601d52b15/mcpu.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3889, 3817, 1085, 12, 2890, 16, 1061, 4672, 3536, 5289, 392, 11396, 18, 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, ...
[ 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, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3889, 3817, 1085, 12, 2890, 16, 1061, 4672, 3536, 5289, 392, 11396, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
"License :: OSI Approved :: LGPL",
"License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
def pkgconfig(*packages, **kw): flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries'} pkgs = ' '.join(packages) cmdline = 'pkg-config --libs --cflags %s' % pkgs status, output = commands.getstatusoutput(cmdline) if status != 0: raise ValueError("could not find pkg-config module: %s" % pkgs) for token in output.split(): if flag_map.get(token[:2]): kw.setdefault(flag_map.get(token[:2]), []).append(token[2:]) elif token.startswith("-Wl,"): kw.setdefault("extra_link_args", []).append(token) else: kw.setdefault("extra_compile_args", []).append(token) return kw
fb7c0814001a30edd3c24892c3fd6eaf7520360a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12343/fb7c0814001a30edd3c24892c3fd6eaf7520360a/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3475, 1425, 30857, 10308, 16, 2826, 9987, 4672, 2982, 67, 1458, 273, 13666, 17, 45, 4278, 296, 6702, 67, 8291, 2187, 2400, 48, 4278, 296, 12083, 67, 8291, 2187, 2400, 80, 4278, 296, 3141...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3475, 1425, 30857, 10308, 16, 2826, 9987, 4672, 2982, 67, 1458, 273, 13666, 17, 45, 4278, 296, 6702, 67, 8291, 2187, 2400, 48, 4278, 296, 12083, 67, 8291, 2187, 2400, 80, 4278, 296, 3141...
name.set_text(game.rom_info.get('name', 'Unknown'))
name.set_text(self.rom_info.get('name', 'Unknown'))
def _display_game(self, filename, coverart=None): assert self.stage
50deb16ab5d1d4c25f1ac7b473b0c7e96f42bfff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5007/50deb16ab5d1d4c25f1ac7b473b0c7e96f42bfff/dinocity.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 5417, 67, 13957, 12, 2890, 16, 1544, 16, 5590, 485, 33, 7036, 4672, 1815, 365, 18, 12869, 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...
[ 1, 1, 1, 1, 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, 389, 5417, 67, 13957, 12, 2890, 16, 1544, 16, 5590, 485, 33, 7036, 4672, 1815, 365, 18, 12869, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
self.push("""<p>Trained on your message. Saving database...</p>""") self.push(" ") if not status.useDB and status.pickleName: fp = open(status.pickleName, 'wb') cPickle.dump(self.bayes, fp, 1) fp.close() self.push("<p>Done.</p><p><a href='/'>Home</a></p>")
self.push("<p>OK. Return <a href='/'>Home</a> or train another:</p>") self.push(self.pageSection % ('Train another', self.train))
def onUpload(self, params): message = params.get('file') or params.get('text') isSpam = (params['which'] == 'spam') # Append the message to a file, to make it easier to rebuild # the database later. message = message.replace('\r\n', '\n').replace('\r', '\n') if isSpam: f = open("_pop3proxyspam.mbox", "a") else: f = open("_pop3proxyham.mbox", "a") f.write("From ???@???\n") # fake From line (XXX good enough?) f.write(message) f.write("\n") f.close() self.bayes.learn(tokenizer.tokenize(message), isSpam, True) self.push("""<p>Trained on your message. Saving database...</p>""") self.push(" ") # Flush... must find out how to do this properly... if not status.useDB and status.pickleName: fp = open(status.pickleName, 'wb') cPickle.dump(self.bayes, fp, 1) fp.close() self.push("<p>Done.</p><p><a href='/'>Home</a></p>")
959f6c8f86abe1ad21eb4ad3e6c79f2ae1aaf183 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6126/959f6c8f86abe1ad21eb4ad3e6c79f2ae1aaf183/pop3proxy.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 4777, 12, 2890, 16, 859, 4672, 883, 273, 859, 18, 588, 2668, 768, 6134, 578, 859, 18, 588, 2668, 955, 6134, 353, 3389, 301, 273, 261, 2010, 3292, 12784, 3546, 422, 296, 1752, 301,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4777, 12, 2890, 16, 859, 4672, 883, 273, 859, 18, 588, 2668, 768, 6134, 578, 859, 18, 588, 2668, 955, 6134, 353, 3389, 301, 273, 261, 2010, 3292, 12784, 3546, 422, 296, 1752, 301,...
"in the directory 'dir'"
"in the directory 'current_dir'"
def GenerateFilename(dir): "Generate a filename of the for gratia/r$UNIQUE.$pid.gratia.xml" "in the directory 'dir'" filename = "r."+str(RecordPid)+ \ "."+FilenameProbeCollectorFragment()+ \ "."+Config.get_GratiaExtension() + "__XXXXXXXXXX" filename = os.path.join(dir,filename) mktemp_pipe = os.popen("mktemp -q \"" + filename + "\""); if mktemp_pipe != None: filename = mktemp_pipe.readline() mktemp_pipe.close() filename = string.strip(filename) if filename != "": return filename raise IOError
2abb6f512aead669f454a58e7b6bf70e0d0428a5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/637/2abb6f512aead669f454a58e7b6bf70e0d0428a5/Gratia.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6654, 5359, 12, 1214, 4672, 315, 4625, 279, 1544, 434, 326, 364, 3821, 270, 1155, 19, 86, 8, 16879, 10806, 6610, 18, 3197, 270, 1155, 18, 2902, 6, 315, 267, 326, 1867, 296, 2972, 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, 6654, 5359, 12, 1214, 4672, 315, 4625, 279, 1544, 434, 326, 364, 3821, 270, 1155, 19, 86, 8, 16879, 10806, 6610, 18, 3197, 270, 1155, 18, 2902, 6, 315, 267, 326, 1867, 296, 2972, 67, ...
print status
print status.encode('UTF-8')
def install(pkgpath, choicesXMLpath=''): """ Uses the apple installer to install the package or metapackage at pkgpath. Prints status messages to STDOUT. Returns the installer return code and true if a restart is needed. """ restartneeded = False installeroutput = [] cmd = ['/usr/sbin/installer', '-pkginfo', '-pkg', pkgpath] p = subprocess.Popen(cmd, shell=False, bufsize=1, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) (output, err) = p.communicate() packagename = output.splitlines()[0] if munkicommon.munkistatusoutput: munkistatus.message("Installing %s..." % packagename) # clear indeterminate progress bar munkistatus.percent(0) munkicommon.log("Installing %s from %s" % (packagename, os.path.basename(pkgpath).encode('UTF-8'))) cmd = ['/usr/sbin/installer', '-query', 'RestartAction', '-pkg', pkgpath] if choicesXMLpath: cmd.extend(['-applyChoiceChangesXML', choicesXMLpath]) p = subprocess.Popen(cmd, shell=False, bufsize=1, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) (output, err) = p.communicate() restartaction = output.rstrip("\n") if restartaction == "RequireRestart": munkicommon.display_status("%s requires a restart after installation." % packagename) restartneeded = True # get the OS version; we need it later when processing installer's output, # which varies depnding on OS version. osvers = int(os.uname()[2].split('.')[0]) cmd = ['/usr/sbin/installer', '-verboseR', '-pkg', pkgpath, '-target', '/'] if choicesXMLpath: cmd.extend(['-applyChoiceChangesXML', choicesXMLpath]) p = subprocess.Popen(cmd, shell=False, bufsize=1, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) while True: installinfo = p.stdout.readline() if not installinfo and (p.poll() != None): break if installinfo.startswith("installer:"): # save all installer output in case there is # an error so we can dump it to the log installeroutput.append(installinfo) msg = installinfo[10:].rstrip("\n") if msg.startswith("PHASE:"): phase = msg[6:] if phase: if munkicommon.munkistatusoutput: munkistatus.detail(phase) else: print phase sys.stdout.flush() elif msg.startswith("STATUS:"): status = msg[7:] if status: if munkicommon.munkistatusoutput: munkistatus.detail(status) else: print status sys.stdout.flush() elif msg.startswith("%"): if munkicommon.munkistatusoutput: percent = float(msg[1:]) if osvers < 10: # Leopard uses a float from 0 to 1 percent = int(percent * 100) munkistatus.percent(percent) elif msg.startswith(" Error"): if munkicommon.munkistatusoutput: munkistatus.detail(msg) else: print >>sys.stderr, msg munkicommon.log(msg) elif msg.startswith(" Cannot install"): if munkicommon.munkistatusoutput: munkistatus.detail(msg) else: print >>sys.stderr, msg munkicommon.log(msg) else: munkicommon.log(msg) retcode = p.poll() if retcode: munkicommon.display_status("Install of %s failed." % packagename) munkicommon.display_error("-------------------------------------------------") for line in installeroutput: munkicommon.display_error(line.rstrip("\n")) munkicommon.display_error("-------------------------------------------------") restartneeded = False else: munkicommon.log("Install of %s was successful." % packagename) if munkicommon.munkistatusoutput: munkistatus.percent(100) return (retcode, restartneeded)
89239f7f143c9ea7b3c22409407bfe201c79c988 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6241/89239f7f143c9ea7b3c22409407bfe201c79c988/installer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3799, 12, 10657, 803, 16, 7246, 4201, 803, 2218, 11, 4672, 3536, 14854, 326, 595, 298, 16050, 358, 3799, 326, 2181, 578, 5100, 438, 1270, 622, 3475, 803, 18, 3038, 87, 1267, 2743, 358, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3799, 12, 10657, 803, 16, 7246, 4201, 803, 2218, 11, 4672, 3536, 14854, 326, 595, 298, 16050, 358, 3799, 326, 2181, 578, 5100, 438, 1270, 622, 3475, 803, 18, 3038, 87, 1267, 2743, 358, ...
opts, args = getopt(argv[1:], "t:v:x") tol = 0
try: opts, args = getopt(argv[1:], "t:v:x", ["help","usage"]) except GetoptError: usagefailure('ERROR: INCORRECT COMMAND LINE 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, ...
f.SetField(FIELD_NAME, cont.levels[i]) f.SetField(GROUP_NAME, group) f.SetGeometryDirectly(geom) layer.CreateFeature(f) f.Destroy()
f.SetGeometryDirectly(geom) layer.CreateFeature(f) f.Destroy()
def numpy_to_shape(x, y, z, shpname=None, epsg=None, group='', levels=None, mask_wkt=''): """turn a numpy grid array into a shapefile. x, y, z are grids (likely from meshgrid (x, y) and interpolation (z) of the original data. shpname: the name of a shapefile to add data to. if none, a new temporary file is created. epsg: the projection. group: to add a new group (likely a new shpname merits a group indication levels: same as for pylab.contour mask_wkt: e.g. the watershed to clip on. stops contours from appearing outside the watershed. """ FIELD_NAME = 'contour' # the field name for the z contour level. GROUP_NAME = 'group' # the name for different groups of contours. if mask_wkt: mask_wkt = ogr.CreateGeometryFromWkt(mask_wkt) if not shpname: # could have problems because not using mkstemp... shpname = tempfile.mktemp(dir='/var/www/ms_tmp', suffix='.shp') # pylab.contour does the work of figuring out the contours. cont = contour(x, y, z, levels=levels, colors='k', origin='lower') shp = ogr.GetDriverByName('ESRI Shapefile') # ogr setup, create that datasource, layer, fields for the .shp if os.path.exists(shpname): data_source = shp.Open(shpname,update=1) layer = data_source.GetLayerByIndex(0) else: data_source = shp.CreateDataSource(shpname) layer = data_source.CreateLayer('', geom_type=ogr.wkbLineString) field = ogr.FieldDefn(FIELD_NAME, ogr.OFTReal) field.SetWidth(4) field.SetPrecision(2) layer.CreateField(field) group_field = ogr.FieldDefn(GROUP_NAME, ogr.OFTString) group_field.SetWidth(12) layer.CreateField(group_field) # iterate through the contours created by pylab.contour and # create wkt to add to a shapefile. line_str = 'LINESTRING(%s)' for i,c in enumerate(cont.collections): f = ogr.Feature(feature_def=layer.GetLayerDefn()) pts = ",".join(["%f %f" % (x, y) for x,y in c.get_verts()]) geom = ogr.CreateGeometryFromWkt(line_str % pts) if mask_wkt: geom = geom.Intersection(mask_wkt) f.SetField(FIELD_NAME, cont.levels[i]) f.SetField(GROUP_NAME, group) f.SetGeometryDirectly(geom) layer.CreateFeature(f) f.Destroy() data_source.Destroy() # write the projection file. as ogr wont do it for us. if epsg: proj = ogr.osr.SpatialReference() proj.ImportFromEPSG(epsg) proj_file = open(shpname[:-4] + ".prj", 'w') proj_file.write(proj.ExportToWkt()) proj_file.close() return shpname
19571229d829ff818f250446cda0fedf913007f8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5022/19571229d829ff818f250446cda0fedf913007f8/numpy_to_shp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3972, 67, 869, 67, 4867, 12, 92, 16, 677, 16, 998, 16, 25771, 529, 33, 7036, 16, 5529, 1055, 33, 7036, 16, 1041, 2218, 2187, 7575, 33, 7036, 16, 3066, 67, 91, 8629, 2218, 11, 4672, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3972, 67, 869, 67, 4867, 12, 92, 16, 677, 16, 998, 16, 25771, 529, 33, 7036, 16, 5529, 1055, 33, 7036, 16, 1041, 2218, 2187, 7575, 33, 7036, 16, 3066, 67, 91, 8629, 2218, 11, 4672, ...
oldOut = sys.stdout
def generate_child(self, child, dir): "Generate a single child. May force a few children to be built as we generate deps" self.generate_type = GEN_DEMAND_CHILD oldOut = sys.stdout
3bf118ac3c499c55c27cfb72faa9df41cc3c099f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/992/3bf118ac3c499c55c27cfb72faa9df41cc3c099f/genpy.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2103, 67, 3624, 12, 2890, 16, 1151, 16, 1577, 4672, 315, 4625, 279, 2202, 1151, 18, 225, 16734, 2944, 279, 11315, 2325, 358, 506, 6650, 487, 732, 2103, 8740, 6, 365, 18, 7163, 67, 723,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2103, 67, 3624, 12, 2890, 16, 1151, 16, 1577, 4672, 315, 4625, 279, 2202, 1151, 18, 225, 16734, 2944, 279, 11315, 2325, 358, 506, 6650, 487, 732, 2103, 8740, 6, 365, 18, 7163, 67, 723,...
from Tkinter import Tk
from tkinter import Tk
def show(self, color, options): # scan for options that can override the ctor options self.__wantspec = options.get('wantspec', self.__wantspec) dbfile = options.get('databasefile', self.__databasefile) # load the database file colordb = None if dbfile != self.__databasefile: colordb = ColorDB.get_colordb(dbfile) if not self.__master: from Tkinter import Tk self.__master = Tk() if not self.__pw: self.__pw, self.__sb = \ Main.build(master = self.__master, initfile = self.__initfile, ignore = self.__ignore) else: self.__pw.deiconify() # convert color if colordb: self.__sb.set_colordb(colordb) else: colordb = self.__sb.colordb() if color: r, g, b = Main.initial_color(color, colordb) self.__sb.update_views(r, g, b) # reset the canceled flag and run it self.__sb.canceled(0) Main.run(self.__pw, self.__sb) rgbtuple = self.__sb.current_rgb() self.__pw.withdraw() # check to see if the cancel button was pushed if self.__sb.canceled_p(): return None, None # Try to return the color name from the database if there is an exact # match, otherwise use the "#rrggbb" spec. BAW: Forget about color # aliases for now, maybe later we should return these too. name = None if not self.__wantspec: try: name = colordb.find_byrgb(rgbtuple)[0] except ColorDB.BadColor: pass if name is None: name = ColorDB.triplet_to_rrggbb(rgbtuple) return rgbtuple, name
cb0e083e810e7ec2bab366be9b4f8b1d561fbfb6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/cb0e083e810e7ec2bab366be9b4f8b1d561fbfb6/pyColorChooser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2405, 12, 2890, 16, 2036, 16, 702, 4672, 468, 4135, 364, 702, 716, 848, 3849, 326, 15120, 702, 365, 16186, 17369, 2793, 273, 702, 18, 588, 2668, 17369, 2793, 2187, 365, 16186, 17369, 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, 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, 2405, 12, 2890, 16, 2036, 16, 702, 4672, 468, 4135, 364, 702, 716, 848, 3849, 326, 15120, 702, 365, 16186, 17369, 2793, 273, 702, 18, 588, 2668, 17369, 2793, 2187, 365, 16186, 17369, 279...
return "'%4d-%02d-%02d %02d:%02d:%02d'" % (
return "'%04d-%02d-%02d %02d:%02d:%02d'" % (
def DateTimeConverter(value, db): return "'%4d-%02d-%02d %02d:%02d:%02d'" % ( value.year, value.month, value.day, value.hour, value.minute, value.second)
f964c20cbe421ec5d360309133cd2eafddf0bdb9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8798/f964c20cbe421ec5d360309133cd2eafddf0bdb9/converters.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3716, 5072, 12, 1132, 16, 1319, 4672, 327, 22288, 3028, 72, 6456, 3103, 72, 6456, 3103, 72, 738, 3103, 72, 5319, 3103, 72, 5319, 3103, 72, 4970, 738, 261, 460, 18, 6874, 16, 460, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3716, 5072, 12, 1132, 16, 1319, 4672, 327, 22288, 3028, 72, 6456, 3103, 72, 6456, 3103, 72, 738, 3103, 72, 5319, 3103, 72, 5319, 3103, 72, 4970, 738, 261, 460, 18, 6874, 16, 460, 18, ...
or cachable"
or cachable
def status(self, indent=0): """ print out doId(parentId, zoneId) className and conditionally show generated, disabled, neverDisable, or cachable" """ spaces=' '*(indent+2) try: print "%s%s:"%( ' '*indent, self.__class__.__name__) print "%sfrom DistributedObject doId:%s, parent:%s, zone:%s"%( spaces, self.doId, self.parentId, self.zoneId), flags=[] if self.__generated: flags.append("generated") if self.air == None: flags.append("deleted") if len(flags): print "(%s)"%(" ".join(flags),), print except Exception, e: print "%serror printing status"%(spaces,), e
5ad4f3bc5f40b8dfdbc0eb797d9bcee63a4c3a12 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8543/5ad4f3bc5f40b8dfdbc0eb797d9bcee63a4c3a12/DistributedObjectUD.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1267, 12, 2890, 16, 3504, 33, 20, 4672, 3536, 1172, 596, 741, 548, 12, 2938, 548, 16, 29939, 13, 2658, 471, 2269, 1230, 2405, 4374, 16, 5673, 16, 5903, 11879, 16, 578, 7122, 429, 3536,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1267, 12, 2890, 16, 3504, 33, 20, 4672, 3536, 1172, 596, 741, 548, 12, 2938, 548, 16, 29939, 13, 2658, 471, 2269, 1230, 2405, 4374, 16, 5673, 16, 5903, 11879, 16, 578, 7122, 429, 3536,...
left join project_task t on c.id=t.case_id left join project_project p on p.id = t.project_id \
left join project_project p on p.id = c.project_id \
def _get_latest_cases(self, cr, uid, ids_cases, name, args, context={}): if not ids_cases: return {} result = {} for id in ids_cases: result[id] = { 'bug_ids': '', 'feature_ids': '', 'support_ids': '', 'announce_ids': '', }
63aca3f99a9c76ca2e99c049a801f7d6f1039030 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7339/63aca3f99a9c76ca2e99c049a801f7d6f1039030/portal_project.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 13550, 67, 22186, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 67, 22186, 16, 508, 16, 833, 16, 819, 12938, 4672, 309, 486, 3258, 67, 22186, 30, 327, 2618, 563, 273, 2618, 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, 389, 588, 67, 13550, 67, 22186, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 67, 22186, 16, 508, 16, 833, 16, 819, 12938, 4672, 309, 486, 3258, 67, 22186, 30, 327, 2618, 563, 273, 2618, 3...
" transform=\"translate(",x-10,", -25)\"\n")
'''
def svg_check(x, style, stroke, fill): svg_string = "%s%s%s%s%s%f%s" %\ ("<path d=\"m 28.4,70.2 -5.9,5.9 -5.9,-5.9 -4.1,-4.1 c -0.7,-0.7", " -1.2,-1.8 -1.2,-2.9 0,-2.3 1.9,-4.1 4.1,-4.1 1.1,0 2.2,0.5", " 2.9,1.2 l 4.1,4.1 14.1,-14.1 c 0.8,-0.7 1.8,-1.2 2.9,-1.2 2.3,", "0 4.1,1.9 4.1,4.1 0,1.1 -0.5,2.2 -1.2,2.9 l -14.1,14.1 z\"\n", " transform=\"translate(",x-10,", -25)\"\n") if style == "none": svg_string += svg_style(WHITE,stroke,1.8) elif style == "gradient": svg_string += svg_style(fill,stroke,1.8) else: svg_string += svg_style(stroke,stroke,1.8) return svg_string
d22a91b001e8af5f64e66652426ca52437f753c5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7609/d22a91b001e8af5f64e66652426ca52437f753c5/gencards.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9804, 67, 1893, 12, 92, 16, 2154, 16, 11040, 16, 3636, 4672, 9804, 67, 1080, 273, 2213, 87, 9, 87, 9, 87, 9, 87, 9, 87, 9, 74, 9, 87, 6, 738, 64, 7566, 32, 803, 302, 5189, 81, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9804, 67, 1893, 12, 92, 16, 2154, 16, 11040, 16, 3636, 4672, 9804, 67, 1080, 273, 2213, 87, 9, 87, 9, 87, 9, 87, 9, 87, 9, 74, 9, 87, 6, 738, 64, 7566, 32, 803, 302, 5189, 81, ...
if not self.data or self.data.domain != data.domain: self.clearLineEdits()
def setData(self, data): self.closeContext() if not self.data or self.data.domain != data.domain: self.clearLineEdits() self.data = data self.cbAttrs.clear() self.cbAttrs.insertItem("(all attributes)") if self.data: for attr in self.data.domain: self.cbAttrs.insertItem(attr.name) self.removeAllAttr() self.openContext("", data) self.apply()
e3e05446afa7a4d55a7e52677567c8a07da8b056 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6366/e3e05446afa7a4d55a7e52677567c8a07da8b056/OWFeatureConstructor.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7929, 12, 2890, 16, 501, 4672, 365, 18, 4412, 1042, 1435, 365, 18, 892, 273, 501, 365, 18, 7358, 8262, 18, 8507, 1435, 365, 18, 7358, 8262, 18, 6387, 1180, 2932, 12, 454, 1677, 2225, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 7929, 12, 2890, 16, 501, 4672, 365, 18, 4412, 1042, 1435, 365, 18, 892, 273, 501, 365, 18, 7358, 8262, 18, 8507, 1435, 365, 18, 7358, 8262, 18, 6387, 1180, 2932, 12, 454, 1677, 2225, ...
label_parts.append(_('%d Playlist Folders Selected') % self.folder_count) label_parts.append(_('(contains %d playlists)') % self.folder_child_count)
label_parts.append(ngettext( '%(count)d Playlist Folder Selected', '%(count)d Playlist Folders Selected', self.folder_count, {"count": self.folder_count})) label_parts.append(ngettext( '(contains %(count)d playlist)', '(contains %(count)d playlist)', self.folder_child_count, {"count": self.folder_child_count}))
def _make_label(self, tab_type, selected_tabs): label_parts = [] if self.folder_count > 0: if tab_type in ('feed', 'audio-feed'): label_parts.append(_('%d Channel Folders Selected') % self.folder_count) label_parts.append(_('(contains %d channels)') % self.folder_child_count) else: label_parts.append(_('%d Playlist Folders Selected') % self.folder_count) label_parts.append(_('(contains %d playlists)') % self.folder_child_count)
77197da57d686c7e5fa90603dbf079559bd86730 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12354/77197da57d686c7e5fa90603dbf079559bd86730/displays.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 6540, 67, 1925, 12, 2890, 16, 3246, 67, 723, 16, 3170, 67, 16056, 4672, 1433, 67, 6019, 273, 5378, 309, 365, 18, 5609, 67, 1883, 405, 374, 30, 309, 3246, 67, 723, 316, 7707, 784...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6540, 67, 1925, 12, 2890, 16, 3246, 67, 723, 16, 3170, 67, 16056, 4672, 1433, 67, 6019, 273, 5378, 309, 365, 18, 5609, 67, 1883, 405, 374, 30, 309, 3246, 67, 723, 316, 7707, 784...
firstrun=False
run_num+=1
def __read_param(self): ''' Read params.log file and write corresponding data Should only be called by __init__''' if self.__creating: fpar=param_file(self.datadir+'params.log',precision=self.precision) while True: (descr,res)=fpar.readline() if descr=='i': sec='init' elif descr=='r': if sec=='init': sec='run' firstrun=True else: firstrun=False elif descr=='d': self.param[sec].attrs['date']=res elif descr=='t' and sec=='run': if firstrun: self.param['run'].create_dataset('timerun',(1,),data=res,maxshape=(None,)) else: append(self.param['run/timerun'],res) elif descr=='&': if sec=='run' and firstrun==False: subsec=self.param[sec+'/'+res] else: subsec=self.param[sec].create_group(res) elif descr=='p': if sec=='run': if firstrun==False: append(subsec[res[0]],res[1]) else: dat=N.array(res[1]) try: subsec.create_dataset(res[0],data=dat.reshape([1]+list(dat.shape)),maxshape=tuple([None]+list(dat.shape))) except ValueError: print "Warning! Multiple presence of "+res[0]+" in params.log run parameters" subsec[res[0]][0]=res[1] else: try: subsec.create_dataset(res[0],data=res[1]) except ValueError: print "Warning! Multiple presence of "+res[0]+" in params.log init parameters" subsec[res[0]][0]=res[1] elif descr=='e': break del(fpar)
bf1a599ad9cde581f4679533ab3c54c55f5e9732 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1377/bf1a599ad9cde581f4679533ab3c54c55f5e9732/hdf5.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 896, 67, 891, 12, 2890, 4672, 9163, 2720, 859, 18, 1330, 585, 471, 1045, 4656, 501, 9363, 1338, 506, 2566, 635, 1001, 2738, 972, 26418, 309, 365, 16186, 23799, 30, 284, 1065, 33, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 896, 67, 891, 12, 2890, 4672, 9163, 2720, 859, 18, 1330, 585, 471, 1045, 4656, 501, 9363, 1338, 506, 2566, 635, 1001, 2738, 972, 26418, 309, 365, 16186, 23799, 30, 284, 1065, 33, ...
msg = ' id : %i\n' % self.currentrow[0] msg += ' proc : %s\n' % self.currentrow[1] msg += ' user : %s\n' % self.currentrow[2] msg += ' runtime : %s\n' % self.currentrow[3].strftime("%Y-%m-%d %H:%M:%S") msg += ' sleeptime : %s\n' % self.currentrow[4] msg += ' status : %s\n' % self.currentrow[5] msg += ' progress : %s\n' % self.currentrow[6]
msg = ' id : %i\n\n' % self.currentrow[0] msg += ' proc : %s\n\n' % self.currentrow[1] msg += ' user : %s\n\n' % self.currentrow[2] msg += ' runtime : %s\n\n' % self.currentrow[3].strftime("%Y-%m-%d %H:%M:%S") msg += ' sleeptime : %s\n\n' % self.currentrow[4] msg += ' status : %s\n\n' % self.currentrow[5] msg += ' progress : %s\n\n' % self.currentrow[6]
def display_task_options(self): """Nicely display information about current process.""" msg = ' id : %i\n' % self.currentrow[0] msg += ' proc : %s\n' % self.currentrow[1] msg += ' user : %s\n' % self.currentrow[2] msg += ' runtime : %s\n' % self.currentrow[3].strftime("%Y-%m-%d %H:%M:%S") msg += ' sleeptime : %s\n' % self.currentrow[4] msg += ' status : %s\n' % self.currentrow[5] msg += ' progress : %s\n' % self.currentrow[6] arguments = marshal.loads(self.currentrow[7]) if type(arguments) is dict: # FIXME: REMOVE AFTER MAJOR RELEASE 1.0 msg += ' options : %s\n' % arguments else: msg += 'executable : %s\n' % arguments[0] msg += ' arguments : %s\n' % ' '.join(arguments[1:]) msg += '\nPress a key to continue...' rows = msg.split('\n') height = len(rows) + 2 width = max([len(row) for row in rows]) + 4 self.win = curses.newwin( height, width, (self.height - height) / 2 + 1, (self.width - width) / 2 + 1 ) self.panel = curses.panel.new_panel( self.win ) self.panel.top() self.win.border() i = 1 for row in rows: self.win.addstr(i, 2, row) i += 1 self.win.refresh() self.win.getch()
621e32812dd0bb7f178db346fc028225f40d7a3d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/621e32812dd0bb7f178db346fc028225f40d7a3d/bibsched.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2562, 67, 4146, 67, 2116, 12, 2890, 4672, 3536, 50, 335, 2357, 2562, 1779, 2973, 783, 1207, 12123, 1234, 273, 225, 296, 3639, 612, 294, 738, 77, 64, 82, 64, 82, 11, 738, 365, 18, 297...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2562, 67, 4146, 67, 2116, 12, 2890, 4672, 3536, 50, 335, 2357, 2562, 1779, 2973, 783, 1207, 12123, 1234, 273, 225, 296, 3639, 612, 294, 738, 77, 64, 82, 64, 82, 11, 738, 365, 18, 297...
print '%s: %s'%(ce,site)
print '%s: %s' % ( ce, site )
def usage(): print 'Usage: %s < ce name> [< ce name>]' %(Script.scriptName) DIRAC.exit(2)
34fa442d048f1227d559bfc78370585cfba9e77f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/34fa442d048f1227d559bfc78370585cfba9e77f/dirac-admin-ce-info.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4084, 13332, 1172, 296, 5357, 30, 738, 87, 411, 5898, 508, 34, 306, 32, 5898, 508, 34, 3864, 8975, 3651, 18, 4263, 461, 13, 18544, 2226, 18, 8593, 12, 22, 13, 225, 2, 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, 4084, 13332, 1172, 296, 5357, 30, 738, 87, 411, 5898, 508, 34, 306, 32, 5898, 508, 34, 3864, 8975, 3651, 18, 4263, 461, 13, 18544, 2226, 18, 8593, 12, 22, 13, 225, 2, -100, -100, -10...
self.start_time = start_time self.end_time = end_time
self.start_time = start_time self.end_time = end_time
def __init__(self, start_time=None, end_time=None, reminder=None, extension_elements=None, extension_attributes=None, text=None): self.start_time = start_time self.end_time = end_time self.reminder = reminder or [] self.text = text self.extension_elements = extension_elements or [] self.extension_attributes = extension_attributes or {}
b441c0ccc7da55ff31f704dc6779ec676da299f1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10620/b441c0ccc7da55ff31f704dc6779ec676da299f1/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 787, 67, 957, 33, 7036, 16, 679, 67, 957, 33, 7036, 16, 849, 14055, 33, 7036, 16, 2710, 67, 6274, 33, 7036, 16, 2710, 67, 4350, 33, 7036, 16, 977, 33...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 787, 67, 957, 33, 7036, 16, 679, 67, 957, 33, 7036, 16, 849, 14055, 33, 7036, 16, 2710, 67, 6274, 33, 7036, 16, 2710, 67, 4350, 33, 7036, 16, 977, 33...
texts["value"] = "\"%s\""%value
texts["value"] = "\"%s%s\""%(value, "\\0" * (default_string_size - len(value)))
def GenerateFileContent(Node, headerfilepath): global type global internal_types global default_string_size texts = {} texts["maxPDOtransmit"] = 0 texts["NodeName"] = Node.GetNodeName() texts["NodeID"] = Node.GetNodeID() texts["NodeType"] = Node.GetNodeType() texts["Description"] = Node.GetNodeDescription() texts["iam_a_slave"] = 0 if (texts["NodeType"] == "slave"): texts["iam_a_slave"] = 1 default_string_size = Node.GetDefaultStringSize() # Compiling lists of indexes rangelist = [idx for idx in Node.GetIndexes() if 0 <= idx <= 0x260] listIndex = [idx for idx in Node.GetIndexes() if 0x1000 <= idx <= 0xFFFF] communicationlist = [idx for idx in Node.GetIndexes() if 0x1000 <= idx <= 0x11FF] sdolist = [idx for idx in Node.GetIndexes() if 0x1200 <= idx <= 0x12FF] pdolist = [idx for idx in Node.GetIndexes() if 0x1400 <= idx <= 0x1BFF] variablelist = [idx for idx in Node.GetIndexes() if 0x2000 <= idx <= 0xBFFF]
1fb7d8eafcc9d19683cadc63b9a7fa56c0639e76 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/116/1fb7d8eafcc9d19683cadc63b9a7fa56c0639e76/gen_cfile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6654, 25391, 12, 907, 16, 1446, 10561, 4672, 2552, 618, 2552, 2713, 67, 2352, 2552, 805, 67, 1080, 67, 1467, 225, 15219, 273, 2618, 15219, 9614, 1896, 14625, 2338, 1938, 11929, 273, 374, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6654, 25391, 12, 907, 16, 1446, 10561, 4672, 2552, 618, 2552, 2713, 67, 2352, 2552, 805, 67, 1080, 67, 1467, 225, 15219, 273, 2618, 15219, 9614, 1896, 14625, 2338, 1938, 11929, 273, 374, ...
rel.getTaggedValue('inverse_reference_name')):
rel.getTaggedValue('inverse_relation_name')):
def getFieldSpecFromBackAssociation(self, rel, classelement, indent_level=0): """Gets the schema field code""" multiValued = 0 obj = rel.fromEnd.obj name = rel.fromEnd.getName() relname = rel.getName()
5c12f67a605867ef951286afa685d601114e82c7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11941/5c12f67a605867ef951286afa685d601114e82c7/ArchetypesGenerator.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5031, 1990, 1265, 2711, 7174, 12, 2890, 16, 1279, 16, 667, 2956, 16, 3504, 67, 2815, 33, 20, 4672, 3536, 3002, 326, 1963, 652, 981, 8395, 3309, 27558, 273, 374, 1081, 273, 1279, 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, 5031, 1990, 1265, 2711, 7174, 12, 2890, 16, 1279, 16, 667, 2956, 16, 3504, 67, 2815, 33, 20, 4672, 3536, 3002, 326, 1963, 652, 981, 8395, 3309, 27558, 273, 374, 1081, 273, 1279, 18, 20...
if issubclass(value.__class__, QuerySet): model = value.model paginator_class = QuerySetPaginator else: value = list(value) try: model = value[0].__class__ except IndexError: return u'' paginator_class = Paginator paginator = paginator_class(value, self.paginate_by, self.orphans)
paginator = Paginator(value, self.paginate_by, self.orphans)
def render(self, context): key = self.queryset_var.var value = self.queryset_var.resolve(context) if issubclass(value.__class__, QuerySet): model = value.model paginator_class = QuerySetPaginator else: value = list(value) try: model = value[0].__class__ except IndexError: return u'' paginator_class = Paginator paginator = paginator_class(value, self.paginate_by, self.orphans) try: page_obj = paginator.page(context['request'].page) except InvalidPage: context[key] = [] context['invalid_page'] = True return u'' context[key] = page_obj.object_list context['paginator'] = paginator context['page_obj'] = page_obj return u''
abb16624e50457a312b82ff0b1843b9319401350 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4362/abb16624e50457a312b82ff0b1843b9319401350/pagination_tags.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 12, 2890, 16, 819, 4672, 498, 273, 365, 18, 21729, 67, 1401, 18, 1401, 460, 273, 365, 18, 21729, 67, 1401, 18, 10828, 12, 2472, 13, 13755, 273, 14358, 12, 1132, 16, 365, 18, 90...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1743, 12, 2890, 16, 819, 4672, 498, 273, 365, 18, 21729, 67, 1401, 18, 1401, 460, 273, 365, 18, 21729, 67, 1401, 18, 10828, 12, 2472, 13, 13755, 273, 14358, 12, 1132, 16, 365, 18, 90...
def callbackWho( char, args, choice ): wholist = args[0] if choice.button == 0: return False elif wholist[ choice.button - 10 ]: player = wolfpack.findchar( wholist[ choice.button - 10 ] ) details(char, player) return True else: return False
def callbackWho( char, args, choice ): wholist = args[0] if choice.button == 0: return False elif wholist[ choice.button - 10 ]: player = wolfpack.findchar( wholist[ choice.button - 10 ] ) details(char, player) return True else: return False
a481dcbd56274d8e191358dddc986da15be4da95 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/a481dcbd56274d8e191358dddc986da15be4da95/who.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1348, 2888, 83, 12, 1149, 16, 833, 16, 6023, 262, 30, 600, 355, 376, 273, 833, 63, 20, 65, 309, 6023, 18, 5391, 422, 374, 30, 327, 1083, 1327, 600, 355, 376, 63, 6023, 18, 5391, 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, 1348, 2888, 83, 12, 1149, 16, 833, 16, 6023, 262, 30, 600, 355, 376, 273, 833, 63, 20, 65, 309, 6023, 18, 5391, 422, 374, 30, 327, 1083, 1327, 600, 355, 376, 63, 6023, 18, 5391, 30...
def __init__(self, title):
def __init__(self, name, title):
def __init__(self, title): self._title = title pass
b8888de85047fe93273e5989b691f6b75032d60e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2516/b8888de85047fe93273e5989b691f6b75032d60e/msvnstats.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 508, 16, 2077, 4672, 365, 6315, 2649, 273, 2077, 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, ...
[ 1, 1, 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, 1001, 2738, 972, 12, 2890, 16, 508, 16, 2077, 4672, 365, 6315, 2649, 273, 2077, 1342, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
oldstyle_cert_filename = os.path.join(skolesys_basepath,'cert',"cert_%s.pem" % conf.get("DOMAIN","domain_name"))
oldstyle_cert_filename = os.path.join('/etc/skolesys/cert',"cert_%s.pem" % conf.get("DOMAIN","domain_name"))
def startserver(): # Check root privilegdes if not os.getuid()==0: print "This command requires root priviledges" sys.exit(1) skolesys_basepath = os.path.split(inspect.getfile(skolesys))[0] certfile = None keyfile = None # Old style filenames before SkoleSYS ver 0.8.1 oldstyle_cert_filename = os.path.join(skolesys_basepath,'cert',"cert_%s.pem" % conf.get("DOMAIN","domain_name")) if os.path.exists(oldstyle_cert_filename): certfile = oldstyle_cert_filename oldstyle_key_filename = os.path.join(skolesys_basepath,'cert',"key_%s.pem" % conf.get("DOMAIN","domain_name")) if os.path.exists(oldstyle_key_filename): keyfile = oldstyle_key_filename # New style filenames from SkoleSYS ver 0.8.1 and after newstyle_cert_filename = os.path.join(skolesys_basepath,'cert',"%s.cert" % conf.get("DOMAIN","domain_name")) if os.path.exists(newstyle_cert_filename): certfile = newstyle_cert_filename newstyle_key_filename = os.path.join(skolesys_basepath,'cert',"%s.key" % conf.get("DOMAIN","domain_name")) if os.path.exists(newstyle_key_filename): keyfile = newstyle_key_filename if certfile == None or keyfile == None: print "Missing a certificate file" print "cert-file shold be: %s ot %s" % (oldstyle_cert_filename,newstyle_cert_filename) print "key-file shold be: %s ot %s" % (oldstyle_key_filename,newstyle_key_filename) sys.exit(1) netif = conf.get("SOAP_SERVICE","interface") addr = if2ip(netif) if not addr: print "Interface %s has not been configured. No SOAP service started" % netif sys.exit(0) ssl_context = SSL.Context() ssl_context.load_cert(certfile,keyfile=keyfile) server = MyServer((addr, 8443),ssl_context = ssl_context) print "Starting SOAP service on interface %s (%s)" % (netif,addr) # Security server.registerFunction(get_id) server.registerFunction(challenge_response_key) server.registerFunction(bind) server.registerFunction(test_session_id) server.registerFunction(test_binded) # Real functionality # ------------------ # User Management server.registerFunction(domain_name) server.registerFunction(user_exists) server.registerFunction(list_users) server.registerFunction(list_usergroups) server.registerFunction(createuser) server.registerFunction(changeuser) server.registerFunction(removeuser) server.registerFunction(groupadd) server.registerFunction(groupdel) # Group Management server.registerFunction(group_exists) server.registerFunction(list_groups) server.registerFunction(list_members) server.registerFunction(creategroup) server.registerFunction(changegroup) server.registerFunction(removegroup) # Group Services server.registerFunction(attach_groupservice) server.registerFunction(detach_groupservice) server.registerFunction(restart_groupservice) server.registerFunction(list_groupservices) server.registerFunction(list_groupservice_options_available) server.registerFunction(get_groupservice_option_values) server.registerFunction(set_groupservice_option_value) server.registerFunction(unset_groupservice_option) # Host Management server.registerFunction(register_host) server.registerFunction(hostname_exists) server.registerFunction(hwaddr_exists) server.registerFunction(hostinfo_by_hwaddr) server.registerFunction(hostinfo_by_hostname) server.registerFunction(listhosts) server.registerFunction(getconf) # File Management server.registerFunction(findfiles) server.registerFunction(removefiles) if os.fork()==0: os.setsid() sys.stdout=open("/dev/null", 'w') sys.stdin=open("/dev/null", 'r') while 1: try: server.serve_forever() except: print "SOAP Service malfunctioned - Reenaging..."
6b681a95327a098646164e34c2f9bb8872bed0c0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2487/6b681a95327a098646164e34c2f9bb8872bed0c0/server.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 787, 3567, 13332, 468, 2073, 1365, 11334, 75, 5489, 309, 486, 1140, 18, 588, 1911, 1435, 631, 20, 30, 1172, 315, 2503, 1296, 4991, 1365, 6015, 1411, 2852, 6, 2589, 18, 8593, 12, 21, 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, 787, 3567, 13332, 468, 2073, 1365, 11334, 75, 5489, 309, 486, 1140, 18, 588, 1911, 1435, 631, 20, 30, 1172, 315, 2503, 1296, 4991, 1365, 6015, 1411, 2852, 6, 2589, 18, 8593, 12, 21, 13...
This is useful for alternate formatting of stack traces. If 'limit' is omitted or None, all entries are extracted. A pre-processed stack trace entry is a quadruple (filename, line number, function name, text) representing the information that is usually printed for a stack trace. The text is a string with leading and trailing whitespace stripped; if the source is not available it is None. """ if limit is None: if hasattr(sys, 'tracebacklimit'): limit = sys.tracebacklimit list = [] n = 0 while tb is not None and (limit is None or n < limit): f = tb.tb_frame lineno = tb.tb_lineno co = f.f_code filename = co.co_filename name = co.co_name linecache.checkcache(filename) line = linecache.getline(filename, lineno, f.f_globals) if line: line = line.strip() else: line = None list.append((filename, lineno, name, line)) tb = tb.tb_next n = n+1 return list
def syntax_error_with_caret_2(self): compile("1 +\n", "?", "exec") def syntax_error_without_caret(self): import test.badsyntax_nocaret def syntax_error_bad_indentation(self): compile("def spam():\n print 1\n print 2", "?", "exec") def test_caret(self): err = self.get_exception_format(self.syntax_error_with_caret, SyntaxError) self.assertTrue(len(err) == 4) self.assertTrue(err[1].strip() == "return x!") self.assertIn("^", err[2]) self.assertTrue(err[1].find("!") == err[2].find("^")) err = self.get_exception_format(self.syntax_error_with_caret_2, SyntaxError) self.assertIn("^", err[2]) self.assertTrue(err[2].count('\n') == 1) self.assertTrue(err[1].find("+") == err[2].find("^")) @unittest2.skipIf(sys.platform.startswith('java'), "Jython has different behaviour") def test_nocaret(self): err = self.get_exception_format(self.syntax_error_without_caret, SyntaxError) self.assertTrue(len(err) == 3) self.assertTrue(err[1].strip() == "[x for x in x] = x") def test_bad_indentation(self): err = self.get_exception_format(self.syntax_error_bad_indentation, IndentationError) self.assertTrue(len(err) == 4) self.assertTrue(err[1].strip() == "print 2") self.assertIn("^", err[2]) self.assertTrue(err[1].find("2") == err[2].find("^")) def test_bug737473(self): import os, tempfile, time savedpath = sys.path[:] testdir = tempfile.mkdtemp() try: sys.path.insert(0, testdir) testfile = os.path.join(testdir, 'test_bug737473.py') print >> open(testfile, 'w'), """ def test(): raise ValueError""" if 'test_bug737473' in sys.modules: del sys.modules['test_bug737473'] import test_bug737473 try: test_bug737473.test() except ValueError: traceback.extract_tb(sys.exc_traceback) time.sleep(4) print >> open(testfile, 'w'), """ def test(): raise NotImplementedError""" reload(test_bug737473) try: test_bug737473.test() except NotImplementedError: src = traceback.extract_tb(sys.exc_traceback)[-1][-1] self.assertEqual(src, 'raise NotImplementedError') finally: sys.path[:] = savedpath for f in os.listdir(testdir): os.unlink(os.path.join(testdir, f)) os.rmdir(testdir) def test_base_exception(self): e = KeyboardInterrupt() lst = traceback.format_exception_only(e.__class__, e) self.assertEqual(lst, ['KeyboardInterrupt\n']) def test_string_exception1(self): str_type = "String Exception" err = traceback.format_exception_only(str_type, None) self.assertEqual(len(err), 1) self.assertEqual(err[0], str_type + '\n') def test_string_exception2(self): str_type = "String Exception" str_value = "String Value" err = traceback.format_exception_only(str_type, str_value) self.assertEqual(len(err), 1) self.assertEqual(err[0], str_type + ': ' + str_value + '\n') def test_format_exception_only_bad__str__(self): class X(Exception): def __str__(self): 1 // 0 err = traceback.format_exception_only(X, X()) self.assertEqual(len(err), 1) str_value = '<unprintable %s object>' % X.__name__ self.assertEqual(err[0], X.__name__ + ': ' + str_value + '\n') def test_without_exception(self): err = traceback.format_exception_only(None, None) self.assertEqual(err, ['None\n']) def test_unicode(self): err = AssertionError('\xff') lines = traceback.format_exception_only(type(err), err) self.assertEqual(lines, ['AssertionError: \xff\n']) err = AssertionError(u'\xe9') lines = traceback.format_exception_only(type(err), err) self.assertEqual(lines, ['AssertionError: \\xe9\n'])
def extract_tb(tb, limit = None): """Return list of up to limit pre-processed entries from traceback. This is useful for alternate formatting of stack traces. If 'limit' is omitted or None, all entries are extracted. A pre-processed stack trace entry is a quadruple (filename, line number, function name, text) representing the information that is usually printed for a stack trace. The text is a string with leading and trailing whitespace stripped; if the source is not available it is None. """ if limit is None: if hasattr(sys, 'tracebacklimit'): limit = sys.tracebacklimit list = [] n = 0 while tb is not None and (limit is None or n < limit): f = tb.tb_frame lineno = tb.tb_lineno co = f.f_code filename = co.co_filename name = co.co_name linecache.checkcache(filename) line = linecache.getline(filename, lineno, f.f_globals) if line: line = line.strip() else: line = None list.append((filename, lineno, name, line)) tb = tb.tb_next n = n+1 return list
fd28c146b86832d824d3664f1f3fbbd694c22c05 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7464/fd28c146b86832d824d3664f1f3fbbd694c22c05/traceback27.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2608, 67, 18587, 12, 18587, 16, 1800, 273, 599, 4672, 3536, 990, 666, 434, 731, 358, 1800, 675, 17, 11005, 3222, 628, 10820, 18, 225, 1652, 6279, 67, 1636, 67, 1918, 67, 71, 20731, 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, 2608, 67, 18587, 12, 18587, 16, 1800, 273, 599, 4672, 3536, 990, 666, 434, 731, 358, 1800, 675, 17, 11005, 3222, 628, 10820, 18, 225, 1652, 6279, 67, 1636, 67, 1918, 67, 71, 20731, 67,...
ensure_free_space(outfile)
ensure_free_space(os.path.dirname(outfile))
def _safe_fileop(op, mode, outfile, timeout): ensure_free_space(outfile) outstream = file(outfile, mode) while timeout > 0: try: fcntl.flock(outstream, fcntl.LOCK_EX | fcntl.LOCK_NB) r = op(outstream) outstream.close() return r except IOError, x: # Python / BSD doc guides us to check for these errors if x.errno in (errno.EACCES, errno.EAGAIN, errno.EWOULDBLOCK): time.sleep(0.1) timeout -= 0.1 else: raise raise DataError("Timeout when updating file", outfile)
d44a1d0409c38d2a6abb93f7578f20f0c9ed6f08 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/373/d44a1d0409c38d2a6abb93f7578f20f0c9ed6f08/fileutils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4626, 67, 768, 556, 12, 556, 16, 1965, 16, 8756, 16, 2021, 4672, 3387, 67, 9156, 67, 2981, 12, 538, 18, 803, 18, 12287, 12, 26050, 3719, 596, 3256, 273, 585, 12, 26050, 16, 1965...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4626, 67, 768, 556, 12, 556, 16, 1965, 16, 8756, 16, 2021, 4672, 3387, 67, 9156, 67, 2981, 12, 538, 18, 803, 18, 12287, 12, 26050, 3719, 596, 3256, 273, 585, 12, 26050, 16, 1965...
retcode = call(cmd, shell=True)
retcode = subprocess.call(cmd, shell=True)
def safe_exec(cmd): """ Executes a command and checks its return value, throwing an exception if it fails. """ from subprocess import * try: retcode = call(cmd, shell=True) if retcode < 0: raise RuntimeError("Child was terminated by signal " + -retcode) except OSError, e: raise RuntimeError("Execution failed: " + e)
05ad83e9147b364a76290370008c4d3b2e40f6ee /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/310/05ad83e9147b364a76290370008c4d3b2e40f6ee/make_win.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4183, 67, 4177, 12, 4172, 4672, 3536, 3889, 993, 279, 1296, 471, 4271, 2097, 327, 460, 16, 19440, 392, 1520, 309, 518, 6684, 18, 3536, 628, 6652, 1930, 380, 775, 30, 22115, 273, 6652, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4183, 67, 4177, 12, 4172, 4672, 3536, 3889, 993, 279, 1296, 471, 4271, 2097, 327, 460, 16, 19440, 392, 1520, 309, 518, 6684, 18, 3536, 628, 6652, 1930, 380, 775, 30, 22115, 273, 6652, ...
This is the main interface to the client code, once the complete
This is the main interface to the client code, once the complete
def parseString( self, instring ): """Execute the parse expression with the given string. This is the main interface to the client code, once the complete expression has been built. """ if not self.streamlined: self.streamline() self.saveAsList = True for e in self.ignoreExprs: e.streamline() if self.keepTabs: loc, tokens = self.parse( instring, 0 ) else: loc, tokens = self.parse( instring.expandtabs(), 0 ) return tokens
f734f22ba11a967624c3b1351b79174f1d17c2ac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3554/f734f22ba11a967624c3b1351b79174f1d17c2ac/pyparsing.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 23659, 12, 365, 16, 316, 1080, 262, 30, 3536, 5289, 326, 1109, 2652, 598, 326, 864, 533, 18, 1220, 353, 326, 2774, 1560, 358, 326, 1004, 981, 16, 3647, 326, 3912, 2652, 711, 2118, 6650...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 23659, 12, 365, 16, 316, 1080, 262, 30, 3536, 5289, 326, 1109, 2652, 598, 326, 864, 533, 18, 1220, 353, 326, 2774, 1560, 358, 326, 1004, 981, 16, 3647, 326, 3912, 2652, 711, 2118, 6650...
def _load_state(self, resource): self.data = resource.read()
def _load_state_from_file(self, file): self.data = file.read()
def _load_state(self, resource): self.data = resource.read()
7f6ebbb93d15d33c9aba52af1137b03cb8d6fdca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7f6ebbb93d15d33c9aba52af1137b03cb8d6fdca/Image.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 945, 67, 2019, 12, 2890, 16, 1058, 4672, 365, 18, 892, 273, 1058, 18, 896, 1435, 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, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 945, 67, 2019, 12, 2890, 16, 1058, 4672, 365, 18, 892, 273, 1058, 18, 896, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
end = endbracket.search(rawdata, i+1) if not end:
end = endbracketfind.match(rawdata, i+1) if end is None:
def parse_starttag(self, i): rawdata = self.rawdata # i points to start of tag end = endbracket.search(rawdata, i+1) if not end: return -1 j = end.start(0) res = tagfind.match(rawdata, i+1) if not res: raise RuntimeError, 'unexpected call to parse_starttag' k = res.end(0) tag = res.group(0) if not self.__seen_starttag and self.__seen_doctype: if tag != self.__seen_doctype: self.syntax_error('starttag does not match DOCTYPE') if self.__seen_starttag and not self.stack: self.syntax_error('multiple elements on top level') if hasattr(self, tag + '_attributes'): attributes = getattr(self, tag + '_attributes') else: attributes = None attrdict, k = self.parse_attributes(tag, k, j, attributes) res = starttagend.match(rawdata, k) if not res: self.syntax_error('garbage in start tag') self.finish_starttag(tag, attrdict) if res and res.group('slash') == '/': self.finish_endtag(tag) return end.end(0)
66deea208f1331393577924315dda6e767e376e1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/66deea208f1331393577924315dda6e767e376e1/xmllib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 1937, 2692, 12, 2890, 16, 277, 4672, 1831, 892, 273, 365, 18, 1899, 892, 468, 277, 3143, 358, 787, 434, 1047, 679, 273, 679, 21025, 4720, 18, 1916, 12, 1899, 892, 16, 277, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1109, 67, 1937, 2692, 12, 2890, 16, 277, 4672, 1831, 892, 273, 365, 18, 1899, 892, 468, 277, 3143, 358, 787, 434, 1047, 679, 273, 679, 21025, 4720, 18, 1916, 12, 1899, 892, 16, 277, ...
status, error, location = sendToPastebin( open( filename ).read() ) if status == 302: print "SHELL: Pasted to %s" % location else: print "ERROR: %s %s" % ( status, error )
file = open( filename ).read() sendToPastebin( "contents of " + filename, file )
def pasteLog( self, params ): """Send the last event exception error log (if there is one) to http://oe.pastebin.com""" if last_exception is None: print "SHELL: No Errors yet (Phew)..." else: reason, event = last_exception.args print "SHELL: Reason for the last error: '%s'" % reason if ':' in reason: msg, filename = reason.split( ':' ) filename = filename.strip() print "SHELL: Pasting log file to pastebin..."
bf90e3078f5499ef3f01210efec0f87f140966d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2672/bf90e3078f5499ef3f01210efec0f87f140966d1/shell.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 19401, 1343, 12, 365, 16, 859, 262, 30, 3536, 3826, 326, 1142, 871, 1520, 555, 613, 261, 430, 1915, 353, 1245, 13, 358, 1062, 2207, 15548, 18, 29795, 4757, 18, 832, 8395, 309, 1142, 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, 19401, 1343, 12, 365, 16, 859, 262, 30, 3536, 3826, 326, 1142, 871, 1520, 555, 613, 261, 430, 1915, 353, 1245, 13, 358, 1062, 2207, 15548, 18, 29795, 4757, 18, 832, 8395, 309, 1142, 67...
if instance.name not in hyper.ListInstances(): return (False, 'not running')
iname = instance.name if iname not in hyper.ListInstances(): _Fail("Instance %s is not running", iname)
def GetInstanceMigratable(instance): """Gives whether an instance can be migrated. @type instance: L{objects.Instance} @param instance: object representing the instance to be checked. @rtype: tuple @return: tuple of (result, description) where: - result: whether the instance can be migrated or not - description: a description of the issue, if relevant """ hyper = hypervisor.GetHypervisor(instance.hypervisor) if instance.name not in hyper.ListInstances(): return (False, 'not running') for idx in range(len(instance.disks)): link_name = _GetBlockDevSymlinkPath(instance.name, idx) if not os.path.islink(link_name): return (False, 'not restarted since ganeti 1.2.5') return (True, '')
afdc3985644be8d2b91d9f0e37dfda391a30d036 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7542/afdc3985644be8d2b91d9f0e37dfda391a30d036/backend.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 21337, 25483, 8163, 12, 1336, 4672, 3536, 43, 3606, 2856, 392, 791, 848, 506, 24741, 18, 225, 632, 723, 791, 30, 511, 95, 6911, 18, 1442, 97, 632, 891, 791, 30, 733, 5123, 326, 791, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 21337, 25483, 8163, 12, 1336, 4672, 3536, 43, 3606, 2856, 392, 791, 848, 506, 24741, 18, 225, 632, 723, 791, 30, 511, 95, 6911, 18, 1442, 97, 632, 891, 791, 30, 733, 5123, 326, 791, ...
proc.wait()
try: proc.wait() except OSError, e: if e.errno != 10: raise
def proc_communicate(proc, stdin=None, stdout=None, stderr=None): """ Run the given process, piping input/output/errors to the given file-like objects (which need not be actual file objects, unlike the arguments passed to Popen). Wait for process to terminate. Note: this is taken from the posix version of subprocess.Popen.communicate, but made more general through the use of file-like objects. """ read_set = [] write_set = [] input_buffer = '' trans_nl = proc.universal_newlines and hasattr(open, 'newlines') if proc.stdin: # Flush stdio buffer. This might block, if the user has # been writing to .stdin in an uncontrolled fashion. proc.stdin.flush() if input: write_set.append(proc.stdin) else: proc.stdin.close() else: assert stdin is None if proc.stdout: read_set.append(proc.stdout) else: assert stdout is None if proc.stderr: read_set.append(proc.stderr) else: assert stderr is None while read_set or write_set: rlist, wlist, xlist = select.select(read_set, write_set, []) if proc.stdin in wlist: # When select has indicated that the file is writable, # we can write up to PIPE_BUF bytes without risk # blocking. POSIX defines PIPE_BUF >= 512 next, input_buffer = input_buffer, '' next_len = 512-len(next) if next_len: next += stdin.read(next_len) if not next: proc.stdin.close() write_set.remove(proc.stdin) else: bytes_written = os.write(proc.stdin.fileno(), next) if bytes_written < len(next): input_buffer = next[bytes_written:] if proc.stdout in rlist: data = os.read(proc.stdout.fileno(), 1024) if data == "": proc.stdout.close() read_set.remove(proc.stdout) if trans_nl: data = proc._translate_newlines(data) stdout.write(data) if proc.stderr in rlist: data = os.read(proc.stderr.fileno(), 1024) if data == "": proc.stderr.close() read_set.remove(proc.stderr) if trans_nl: data = proc._translate_newlines(data) stderr.write(data) proc.wait()
4de91357c4a37b308feecc504ad55b7bbacaf70f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2097/4de91357c4a37b308feecc504ad55b7bbacaf70f/cgiapp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5418, 67, 5702, 318, 2659, 12, 9381, 16, 8801, 33, 7036, 16, 3909, 33, 7036, 16, 4514, 33, 7036, 4672, 3536, 1939, 326, 864, 1207, 16, 8341, 310, 810, 19, 2844, 19, 4324, 358, 326, 8...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5418, 67, 5702, 318, 2659, 12, 9381, 16, 8801, 33, 7036, 16, 3909, 33, 7036, 16, 4514, 33, 7036, 4672, 3536, 1939, 326, 864, 1207, 16, 8341, 310, 810, 19, 2844, 19, 4324, 358, 326, 8...
this = apply(_quickfix.new_OfferForwardPoints2, args)
this = _quickfix.new_OfferForwardPoints2(*args)
def __init__(self, *args): this = apply(_quickfix.new_OfferForwardPoints2, 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, 10513, 8514, 5636, 22, 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, 10513, 8514, 5636, 22, 30857, 1968, 13, 775, 30, 365, 18, 2211, 18, 6923, 12, 2211, 13, 1335, ...
if False = stdout:
if False == stdout:
def run_external(args, stdout = False): """Run external command and return (return code, stdout, stderr)""" print 'debug: running cmd ', args import subprocess if False = stdout: stdout = subprocess.PIPE p = subprocess.Popen(args, stdout = stdout, \ stderr = subprocess.PIPE) try: p.wait() except KeyboardInterrupt: out = p.communicate() print out[0] print out[1] raise outputs = p.communicate() return (p.returncode, outputs[0], outputs[1])
a11971213c27e0f0617bee000d8652ea1863746c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7853/a11971213c27e0f0617bee000d8652ea1863746c/General.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 67, 9375, 12, 1968, 16, 3909, 273, 1083, 4672, 3536, 1997, 3903, 1296, 471, 327, 261, 2463, 981, 16, 3909, 16, 4514, 15574, 1172, 296, 4148, 30, 3549, 1797, 2265, 833, 1930, 6652, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1086, 67, 9375, 12, 1968, 16, 3909, 273, 1083, 4672, 3536, 1997, 3903, 1296, 471, 327, 261, 2463, 981, 16, 3909, 16, 4514, 15574, 1172, 296, 4148, 30, 3549, 1797, 2265, 833, 1930, 6652, ...
auv = au["Authentication"][:1]
auv = base_metas["Authentication"][:1]
def buildVector(base_metas): vector = "" avset = set(['Local', 'Network', 'Adjacent Network']) acset = set(['High', 'Medium', 'Low']) auset = set(['Multiple', 'Single', 'None']) avv = av["Access Vector"][:1] if avv not in avset: return None else: vector += "AV:" + avv[0] + "/" acv = ac["Access Complexity"][:1] if acv not in acset: return None else: vector += "AC:" + acv[0] + "/" auv = au["Authentication"][:1] if auv not in auset: return None else: vector += "Au:" + auv[0] + "/C:C/I:C/A:C" return vector
c26f8512b0043239d49dd53411e5c3aee8e28f67 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/888/c26f8512b0043239d49dd53411e5c3aee8e28f67/CVSS.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1361, 5018, 12, 1969, 67, 10578, 345, 4672, 3806, 273, 1408, 1712, 542, 273, 444, 12, 3292, 2042, 2187, 296, 3906, 2187, 296, 17886, 25897, 5128, 19486, 1721, 542, 273, 444, 12, 3292, 85...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5018, 12, 1969, 67, 10578, 345, 4672, 3806, 273, 1408, 1712, 542, 273, 444, 12, 3292, 2042, 2187, 296, 3906, 2187, 296, 17886, 25897, 5128, 19486, 1721, 542, 273, 444, 12, 3292, 85...
def ShouldExcludePath(path): head, tail = os.path.split(path) if tail in ('.svn', '.git'): return True if not options.remove_nonessential_files: return False for nonessential_dir in NONESSENTIAL_DIRS: if path.startswith(os.path.join(GetSourceDirectory(), nonessential_dir)): return True return False
def ShouldExcludePath(path): head, tail = os.path.split(path) if tail in ('.svn', '.git'): return True
f3aea71ac44157b90f5ec5f839e4defa826ae658 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/f3aea71ac44157b90f5ec5f839e4defa826ae658/export_tarball.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9363, 12689, 743, 12, 803, 4672, 910, 16, 5798, 273, 1140, 18, 803, 18, 4939, 12, 803, 13, 309, 5798, 316, 7707, 18, 31505, 2187, 2418, 6845, 11, 4672, 327, 1053, 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, 9363, 12689, 743, 12, 803, 4672, 910, 16, 5798, 273, 1140, 18, 803, 18, 4939, 12, 803, 13, 309, 5798, 316, 7707, 18, 31505, 2187, 2418, 6845, 11, 4672, 327, 1053, 2, -100, -100, -100, ...