rem
stringlengths
1
226k
add
stringlengths
0
227k
context
stringlengths
6
326k
meta
stringlengths
143
403
input_ids
listlengths
256
256
attention_mask
listlengths
256
256
labels
listlengths
128
128
raise ValueError, "-(2*k)/B_k (=%s) must be invertible in the ring K"%a0inv
raise ValueError, "-(2*k)/B_k (=%s) must be invertible in the %r"%(a0inv, K)
def eisenstein_series_qexp(k, prec=10, K=QQ): r""" Return the $q$-expansion of the weight $k$ Eisenstein series to precision prec in the field $K$. Here's a rough description of how the algorithm works: we know $E_k = const + \sum_n sigma(n,k-1) q^n$. Now, we basically just compute all the $\sigma(n,k-1)$ simultaneously, as $\sigma$ is multiplicative. INPUT: k -- even positive integer prec -- nonnegative integer K -- a ring in which -(2*k)/B_k is invertible EXAMPLES: sage: eisenstein_series_qexp(2,5) -1/24 + q + 3*q^2 + 4*q^3 + 7*q^4 + O(q^5) sage: eisenstein_series_qexp(2,0) O(q^0) sage: eisenstein_series_qexp(2,5,GF(7)) 2 + q + 3*q^2 + 4*q^3 + O(q^5) AUTHORS: -- William Stein: original implementation -- Craig Citro (2007-06-01): rewrote for massive speedup """ k = Integer(k) if k%2 or k < 2: raise ValueError, "k (=%s) must be an even positive integer"%k prec = int(prec) if prec < 0: raise ValueError, "prec (=%s) must be an even nonnegative integer"%prec if (prec == 0): R = QQ[['q']] return R(0).add_bigoh(0) one = Integer(1) val = [one] * prec expt = k - one try: a0inv = - (2*k) / bernoulli(k) a0 = K(1/a0inv) except ZeroDivisionError: raise ValueError, "-(2*k)/B_k (=%s) must be invertible in the ring K"%a0inv for p in prime_range(1,prec): int_p = int(p) ppow = int_p mult = p**expt term = mult*mult last = mult while (ppow < prec): ind = ppow while (ind < prec): val[ind] = (val[ind]*(term-one)).divide_knowing_divisible_by(last - one) ind += ppow ppow *= int_p last = term term *= mult val[0] = a0 R = K[['q']] return R(val, prec=prec, check=False)
655338a7efdf01ea27d9ca425adea6343a86f01d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/655338a7efdf01ea27d9ca425adea6343a86f01d/eis_series.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 425, 291, 275, 334, 13685, 67, 10222, 67, 85, 2749, 12, 79, 16, 13382, 33, 2163, 16, 1475, 33, 53, 53, 4672, 436, 8395, 2000, 326, 271, 85, 8, 17, 2749, 12162, 434, 326, 3119, 271, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 425, 291, 275, 334, 13685, 67, 10222, 67, 85, 2749, 12, 79, 16, 13382, 33, 2163, 16, 1475, 33, 53, 53, 4672, 436, 8395, 2000, 326, 271, 85, 8, 17, 2749, 12162, 434, 326, 3119, 271, ...
the query. :param usekey: Use the `key` specified in the constructor to transform the query into a string. :param threshold: override the threshold specified in the constructor.
the query string.
def search(self, query, usekey=False, threshold=None): """Search the index for items that have similarity to the query.
39f7a6e33ae621db9aac9c718b31cc2533326768 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12095/39f7a6e33ae621db9aac9c718b31cc2533326768/ngram.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1623, 12, 2890, 16, 843, 16, 999, 856, 33, 8381, 16, 5573, 33, 7036, 4672, 3536, 2979, 326, 770, 364, 1516, 716, 1240, 16416, 358, 326, 843, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 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, 1623, 12, 2890, 16, 843, 16, 999, 856, 33, 8381, 16, 5573, 33, 7036, 4672, 3536, 2979, 326, 770, 364, 1516, 716, 1240, 16416, 358, 326, 843, 18, 2, -100, -100, -100, -100, -100, -100, ...
return re.sub (r'\.(c|C|cc|cxx)$', SO)
return re.sub (r'\.(c|C|cc|cxx|cpp)$', self._shared_lib_ext)
def shared_object_filename (self, source_filename): return re.sub (r'\.(c|C|cc|cxx)$', SO)
de6a1e2939e1379adf884ed5fd5b6f676885d387 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/de6a1e2939e1379adf884ed5fd5b6f676885d387/unixccompiler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5116, 67, 1612, 67, 3459, 261, 2890, 16, 1084, 67, 3459, 4672, 327, 283, 18, 1717, 261, 86, 11, 5834, 12, 71, 96, 39, 96, 952, 96, 71, 5279, 21877, 2187, 7460, 13, 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, 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, 5116, 67, 1612, 67, 3459, 261, 2890, 16, 1084, 67, 3459, 4672, 327, 283, 18, 1717, 261, 86, 11, 5834, 12, 71, 96, 39, 96, 952, 96, 71, 5279, 21877, 2187, 7460, 13, 2, -100, -100, -...
red = lamp.col[0] green = lamp.col[1] blue = lamp.col[2] power = lamp.energy * LAMPPOWER.val
def export_lights(lmp): # only lamps type 0, 1 and 4 supported at the moment # lamp types are: 0 - Lamp, 1 - Sun, 2 - Spot, 3 - Hemi, 4 - Area # Spots are replaced by directional (cylinrical) lights: adjust dist as close as possible to the ground receiving the # cone of light if you want Radius as close as possible lamp = lmp.getData() print "o exporting lamps" if lamp.type == 0: print " o exporting lamp "+lmp.name+"..." # get the rgb component for the lamp red = lamp.col[0] green = lamp.col[1] blue = lamp.col[2] power = lamp.energy * LAMPPOWER.val # get the location of the lamp objmatrix = lmp.matrix lampV = Mathutils.Vector([0, 0, 0, 1]) lampV = lampV * objmatrix FILE.write("\n\nlight {\n") FILE.write("\ttype point\n") FILE.write("\tcolor { \"sRGB nonlinear\" %.3f %.3f %.3f }\n" % (red, green, blue)) FILE.write("\tpower %s\n" % (power)) FILE.write("\tp %s %s %s\n" % (lampV[0], lampV[1], lampV[2])) FILE.write("}") elif lamp.type == 1: if IMP_SUN.val == 1: print " o exporting sun-light "+lmp.name+"..." invmatrix = Mathutils.Matrix(lmp.getInverseMatrix()) FILE.write("\nlight {\n") FILE.write("\ttype sunsky\n") FILE.write("\tup 0 0 1\n") FILE.write("\teast 0 1 0\n") FILE.write("\tsundir %f %f %f\n" % (invmatrix[0][2], invmatrix[1][2], invmatrix[2][2])) FILE.write("\tturbidity %s\n" % SUN_TURB.val) FILE.write("\tsamples %s\n" % SUN_SAMPLES.val) FILE.write("}") else: print " o exporting lamp "+lmp.name+"..." # get the rgb component for the lamp red = lamp.col[0] green = lamp.col[1] blue = lamp.col[2] power = lamp.energy * LAMPPOWER.val # get the location of the lamp objmatrix = lmp.matrix lampV = Mathutils.Vector([0, 0, 0, 1]) lampV = lampV * objmatrix FILE.write("\n\nlight {\n") FILE.write("\ttype point\n") FILE.write("\tcolor { \"sRGB nonlinear\" %.3f %.3f %.3f }\n" % (red, green, blue)) FILE.write("\tpower %s\n" % (power)) FILE.write("\tp %s %s %s\n" % (lampV[0], lampV[1], lampV[2])) FILE.write("}") elif lamp.type == 4: print " o exporting area-light "+lmp.name+"..." objmatrix = lmp.matrix xsize = lamp.areaSizeX * 0.5 if lamp.areaSizeY: # If rectangular area: print "o exporting rectangular area-light "+lmp.name+"..." ysize = lamp.areaSizeY * 0.5 else: # Else, square area: print "o exporting square area-light "+lmp.name+"..." ysize = xsize lampV0 = Mathutils.Vector([-xsize, ysize, 0, 1]) lampV1 = Mathutils.Vector([ xsize, ysize, 0, 1]) lampV2 = Mathutils.Vector([ xsize, -ysize, 0, 1]) lampV3 = Mathutils.Vector([-xsize, -ysize, 0, 1]) lampV0 = lampV0 * objmatrix lampV1 = lampV1 * objmatrix lampV2 = lampV2 * objmatrix lampV3 = lampV3 * objmatrix red = lamp.col[0] green = lamp.col[1] blue = lamp.col[2] radiance = lamp.energy * MESHLIGHTPOWER.val FILE.write("\n\nlight {\n") FILE.write("\ttype meshlight\n") FILE.write("\tname \"%s\"\n" % (lmp.name)) FILE.write("\temit { \"sRGB nonlinear\" %.3f %.3f %.3f }\n" % (red, green, blue)) FILE.write("\tradiance %s\n" % (radiance)) FILE.write("\tsamples %s\n" % DSAMPLES.val) FILE.write("\tpoints 4\n") FILE.write("\t\t%s %s %s\n" % (lampV0[0], lampV0[1], lampV0[2])) FILE.write("\t\t%s %s %s\n" % (lampV1[0], lampV1[1], lampV1[2])) FILE.write("\t\t%s %s %s\n" % (lampV2[0], lampV2[1], lampV2[2])) FILE.write("\t\t%s %s %s\n" % (lampV3[0], lampV3[1], lampV3[2])) FILE.write("\ttriangles 2\n") FILE.write("\t\t0 1 2\n") FILE.write("\t\t0 2 3\n") FILE.write("}") elif lamp.type == 2: print " o exporting spotlight "+lmp.name+"..." objmatrix = lmp.matrix targetV = Mathutils.Vector([0, 0, -1, 1]) targetV = targetV * objmatrix lampV = Mathutils.Vector([0, 0, 0, 1]) lampV = lampV * objmatrix angle = lamp.getSpotSize()*pi/360 dist = lamp.getDist() radius = dist/cos(angle)*sin(angle) red = lamp.col[0] green = lamp.col[1] blue = lamp.col[2] radiance = lamp.energy * LAMPPOWER.val FILE.write("\n\nlight {\n") FILE.write("\ttype directional\n") FILE.write("\tsource %s %s %s\n" % (lampV[0], lampV[1], lampV[2])) FILE.write("\ttarget %s %s %s\n" % (targetV[0], targetV[1], targetV[2])) FILE.write("\tradius %s\n" % (radius)) FILE.write("\temit { \"sRGB nonlinear\" %.3f %.3f %.3f }\n" % (red, green, blue)) FILE.write("}") elif lamp.type == 3: print " o exporting spherical light "+lmp.name+"..." objmatrix = lmp.matrix lampV = Mathutils.Vector([0, 0, 0, 1]) lampV = lampV * objmatrix dist = lamp.getDist() red = lamp.col[0] green = lamp.col[1] blue = lamp.col[2] power = lamp.energy * LAMPPOWER.val FILE.write("\n\nlight {\n") FILE.write("\ttype spherical\n") FILE.write("\tcolor { \"sRGB nonlinear\" %.3f %.3f %.3f }\n" % (red, green, blue)) FILE.write("\tradiance %s\n" % (power)) FILE.write("\tcenter %s %s %s\n" % (lampV[0], lampV[1], lampV[2])) FILE.write("\tradius %s\n" % (dist)) FILE.write("\tsamples %s\n" % DSAMPLES.val) FILE.write("}") else: print "Unsupported type lamp detected" if CONVLAMP.val == 1: print " o exporting lamp "+lmp.name+"..." # get the rgb component for the lamp red = lamp.col[0] green = lamp.col[1] blue = lamp.col[2] power = lamp.energy * LAMPPOWER.val # get the location of the lamp objmatrix = lmp.matrix lampV = Mathutils.Vector([0, 0, 0, 1]) lampV = lampV * objmatrix FILE.write("\n\nlight {\n") FILE.write("\ttype point\n") FILE.write("\tcolor { \"sRGB nonlinear\" %.3f %.3f %.3f }\n" % (red, green, blue)) FILE.write("\tpower %s\n" % (power)) FILE.write("\tp %s %s %s\n" % (lampV[0], lampV[1], lampV[2])) FILE.write("}")
223dfc1c7b8557f033095eceba9a38be84b7749e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12400/223dfc1c7b8557f033095eceba9a38be84b7749e/sunflow_export.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3359, 67, 5099, 87, 12, 80, 1291, 4672, 468, 1338, 328, 25508, 618, 374, 16, 404, 471, 1059, 3260, 622, 326, 10382, 468, 328, 931, 1953, 854, 30, 374, 300, 511, 931, 16, 404, 300, 31...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3359, 67, 5099, 87, 12, 80, 1291, 4672, 468, 1338, 328, 25508, 618, 374, 16, 404, 471, 1059, 3260, 622, 326, 10382, 468, 328, 931, 1953, 854, 30, 374, 300, 511, 931, 16, 404, 300, 31...
if not fs.has_key(name):
if value and not fs.has_key(name):
def set_if_missing(fs, name, value): if not fs.has_key(name): fs.list.append(cgi.MiniFieldStorage(name, value))
d22b35a8182abc4575b4f758199665b6d6c77a0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/d22b35a8182abc4575b4f758199665b6d6c77a0b/core.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 430, 67, 7337, 12, 2556, 16, 508, 16, 460, 4672, 309, 460, 471, 486, 2662, 18, 5332, 67, 856, 12, 529, 4672, 2662, 18, 1098, 18, 6923, 12, 19062, 18, 2930, 77, 974, 3245, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 444, 67, 430, 67, 7337, 12, 2556, 16, 508, 16, 460, 4672, 309, 460, 471, 486, 2662, 18, 5332, 67, 856, 12, 529, 4672, 2662, 18, 1098, 18, 6923, 12, 19062, 18, 2930, 77, 974, 3245, ...
tdb = MySQLdb.connect(host = host,port = port, db = db, user = user, passwd = passwd)
tdb = MySQLdb.connect(host = host,port = port, db = db_name, user = user, passwd = password)
def _test_connection(self,cr,uid,part,context={}): lines=pooler.get_pool(cr.dbname).get('olap.fact.database').browse(cr, uid, part['id'],context) host = lines.db_host port = lines.db_port db_name = lines.db_name user = lines.db_login password = lines.db_password type = lines.type return_str = "Connection Successful" try: if type == 'postgres': tdb = psycopg2.connect('host=%s port=%s dbname=%s user=%s password=%s' % (host, port, db_name, user, password)) elif type == 'mysql': import MySQLdb tdb = MySQLdb.connect(host = host,port = port, db = db, user = user, passwd = passwd) elif type == 'oracle': import cx_Oracle tdb = cx_Oracle.connect(user, password, host) except Exception, e: return_str = e.message _arch = ['''<?xml version="1.0"?>''', '''<form string="Connection Status">'''] _arch.append('''<label string='%s' />''' % (return_str)) _arch.append('''</form>''') _connection_arch.string = '\n'.join(_arch) return {}
4fa0094d6a2afa1bc9a5f6ffb8f5d252357d81f2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7339/4fa0094d6a2afa1bc9a5f6ffb8f5d252357d81f2/wizard_test_connection.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3813, 67, 4071, 12, 2890, 16, 3353, 16, 1911, 16, 2680, 16, 2472, 12938, 4672, 2362, 33, 6011, 264, 18, 588, 67, 6011, 12, 3353, 18, 20979, 2934, 588, 2668, 355, 438, 18, 3493, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3813, 67, 4071, 12, 2890, 16, 3353, 16, 1911, 16, 2680, 16, 2472, 12938, 4672, 2362, 33, 6011, 264, 18, 588, 67, 6011, 12, 3353, 18, 20979, 2934, 588, 2668, 355, 438, 18, 3493, ...
return g.mailing_list
return g.mailing_list.split(',')
def get_email_addresses_for_group(g): if g.mailing_list: if g.mailing_list.find(",") == -1: # The mailing list field has only one e-mail address in it, # so we can just use that and the group's display name. return [u'"%s" <%s>' % (g.display_name, g.mailing_list)] else: # The mailing list field has multiple e-mail addresses in it. # We don't know which one should have the group's display name # attached to it, so just return their custom list as-is. return g.mailing_list else: return [get_email_address_for_user(u) for u in g.users.filter(is_active=True)]
74c5d86b5af898b27bd90a44dca4c31c9b69e9e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1600/74c5d86b5af898b27bd90a44dca4c31c9b69e9e2/email.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 3652, 67, 13277, 67, 1884, 67, 1655, 12, 75, 4672, 309, 314, 18, 4408, 310, 67, 1098, 30, 309, 314, 18, 4408, 310, 67, 1098, 18, 4720, 2932, 16, 7923, 422, 300, 21, 30, 46...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3652, 67, 13277, 67, 1884, 67, 1655, 12, 75, 4672, 309, 314, 18, 4408, 310, 67, 1098, 30, 309, 314, 18, 4408, 310, 67, 1098, 18, 4720, 2932, 16, 7923, 422, 300, 21, 30, 46...
def _upload(self, host, xml_file): resp = self._post_multipart(host, xml_file) return self._validate_success(resp)
def upload(self, file_path, host): if host.startswith('http://'): host = host[len('http://'):] xml_file = open(file_path, 'rb') conn = HTTPConnection(host) try: return self._upload(conn, xml_file) finally: xml_file.close() conn.close()
e8980e3eb959d801e54f259c53303548e9e1e012 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7408/e8980e3eb959d801e54f259c53303548e9e1e012/libdoc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3617, 12, 2890, 16, 585, 67, 803, 16, 1479, 4672, 309, 1479, 18, 17514, 1918, 2668, 2505, 8931, 4672, 1479, 273, 1479, 63, 1897, 2668, 2505, 8931, 4672, 65, 2025, 67, 768, 273, 1696, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3617, 12, 2890, 16, 585, 67, 803, 16, 1479, 4672, 309, 1479, 18, 17514, 1918, 2668, 2505, 8931, 4672, 1479, 273, 1479, 63, 1897, 2668, 2505, 8931, 4672, 65, 2025, 67, 768, 273, 1696, 1...
self.filesize_difference = (fabs(int(self.new_filesize) - int(self.old_filesize)) / int(self.old_filesize))*100 self.specto.logger.log(_("Filesize difference: %.2f") % self.filesize_difference, "info", self.name)
if int(self.old_filesize) != 0: self.filesize_difference = (fabs(int(self.new_filesize) - int(self.old_filesize)) / int(self.old_filesize))*100 self.specto.logger.log(_("Filesize difference: %.2f") % self.filesize_difference, "info", self.name)
def check(self): """ See if a http or rss page changed. """ try: # Create a unique name for each url. if self.uri[:7] != "http://" and self.uri[:8] != "https://" and self.uri[:6] != "ftp://": self.uri = "http://" + self.uri self.url_ = self.uri digest = md5.new(self.url_).digest() cacheFileName = "".join(["%02x" % (ord(c),) for c in digest]) self.cacheFullPath_ = os.path.join(self.cacheSubDir__, cacheFileName) self.cacheFullPath2_ = os.path.join(self.cacheSubDir__, cacheFileName + "size") request = web_proxy.urllib2.Request(self.uri, None, {"Accept-encoding" : "gzip"}) cache_res = "" if (self.cached == 1) or (os.path.exists(self.cacheFullPath_)): self.cached = 1 try: f = file(self.cacheFullPath_, "r")# Load up the cached version cache_res = f.read() f.close() except: cache_res = "" try: response = web_proxy.urllib2.urlopen(request) except (URLError, BadStatusLine), e: self.error = True self.specto.logger.log(_('%s') % str(e), "warning", self.name) else: self.info_ = response.info() self.url2_ = response.geturl() self.content_ = self._writeContent(response) self.info_['Url'] = self.uri self.digest_ = md5.new(self.content_).digest() self.digest_ = "".join(["%02x" % (ord(c),) for c in self.digest_]) self.info_['md5sum'] = self.digest_ # This uncompresses the gzipped contents, if you need to parse the page. This is used to check if it is a feed for example, a few lines later. self.compressedstream = StringIO.StringIO(self.content_) try: self.page_source = gzip.GzipFile(fileobj=self.compressedstream).read() #try uncompressing except: self.page_source = self.content_ #the page was not compressed self.diff = textDiff(cache_res, self.page_source) try: out_file = file(self.cacheFullPath_, "w") out_file.write(str(self.page_source)) out_file.close() except: pass # This will check for the "real" website home URL when the website target is an xml feed. # First, check if the web page is actually a known feed type. # Here we look for three kinds of headers, where * is a wildcard: #RSS 1: <feed xmlns=*> #RSS 2: <rdf:RDF xmlns:rdf=*> #Atom : <feed xmlns=*> if not ( compile("<rdf:RDF xmlns:rdf=.*>").findall(self.page_source)==[] ) or not( compile("<rss version=.*>").findall(self.page_source)==[] ) or not ( compile("<feed xmlns=.*>").findall(self.page_source)==[] ): #it seems like it is a syndication feed. Let's see if we can extract the home URL from it. self.regexed_contents=compile("<link>.*</link>").findall(self.page_source) # Grabs anything inside <link> and </link>; .* means "any characters self.rss_links="" for m in self.regexed_contents: # Iterates through and takes off the tags if self.rss_links=="": m=m.strip("<link>").strip("</link>") self.rss_links = m #change the uri_real attribute if self.open_command == self.standard_open_command: self.standard_open_command = spectlib.util.return_webpage(self.rss_links) self.open_command = self.standard_open_command else: #the file is not a recognized feed. We will not parse it for the <link> tag. pass # Here is stuff for filesize comparison, # just in case there is annoying advertising on the page, # rendering the md5sum a false indicator. self.new_filesize = len(str(self.content_))#size in bytes?... will be used for the error_margin in case of annoying advertising in the page #if self.specto.DEBUG: "\tPerceived filesize is", self.new_filesize, "bytes ("+str(self.new_filesize/1024)+"KB)"#useful for adjusting your error_margin if int(self.new_filesize)==4: #FIXME: temporary hack, not sure the etag is ALWAYS 4bytes #4 bytes means it's actually an etag reply, so there is no change. We don't care about filesize checks then. self.filesize_difference = 0 else: self.old_filesize = self.read_filesize() if self.old_filesize!=0:#if 0, that would mean that read_option could not find the filesize in watches.list #if there is a previous filesize #calculate the % changed filesize self.filesize_difference = (fabs(int(self.new_filesize) - int(self.old_filesize)) / int(self.old_filesize))*100 self.specto.logger.log(_("Filesize difference: %.2f") % self.filesize_difference, "info", self.name) if self.filesize_difference >= float(self.error_margin) and (self.filesize_difference != 0.0): #and (self.infoB_['md5sum'] == self.info_['md5sum']): self.to_be_stored_filesize = self.new_filesize self.actually_changed = True else: #we don't want to juggle with all the possible filesizes, #we want to stay close to the original, because replacing the filesize each time #if the watch is not changed would create a lot of fluctuations self.to_be_stored_filesize = self.old_filesize self.actually_changed = False else: #if there is NO previously stored filesize self.to_be_stored_filesize = self.new_filesize ### NOTE: do not write the redirect url in a config file! self.write_filesize() except: self.specto.logger.log(_("Unexpected error: ") + str(sys.exc_info()[0]), "error", self.name) Watch.timer_update(self)
b5488d5d1f7f12fa854e1575c870a05f3b7809f0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10818/b5488d5d1f7f12fa854e1575c870a05f3b7809f0/watch_web_static.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 12, 2890, 4672, 3536, 2164, 309, 279, 1062, 578, 18817, 1363, 3550, 18, 3536, 775, 30, 468, 1788, 279, 3089, 508, 364, 1517, 880, 18, 309, 365, 18, 1650, 10531, 27, 65, 480, 315, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 866, 12, 2890, 4672, 3536, 2164, 309, 279, 1062, 578, 18817, 1363, 3550, 18, 3536, 775, 30, 468, 1788, 279, 3089, 508, 364, 1517, 880, 18, 309, 365, 18, 1650, 10531, 27, 65, 480, 315, ...
def getFullName(self):
def getEmail(self):
def getFullName(self): return self.email
ca022259da04127673113f102e13cb700c03ad06 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1807/ca022259da04127673113f102e13cb700c03ad06/Member.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17297, 12, 2890, 4672, 327, 365, 18, 3652, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17297, 12, 2890, 4672, 327, 365, 18, 3652, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
if path:
if not path: path = get_config_path(create_missing_dir=True) if not path: LOG.error('Could not create config directory!') return False if not os.path.exists(path): print 'Did not find config / preferences file at ' + path print '... making new one.' else:
def set_options(): """Set the most basic options in the config file.""" import googlecl import getpass import socket # These may be useful to define at the module level, but for now, # keep them here. # REMEMBER: updating these means you need to update the CONFIG readme. default_hostid = getpass.getuser() + '@' + socket.gethostname() _youtube = {'max_results': '50'} _contacts = {'list_style': 'title,email'} _calendar = {'list_style': 'title,when'} _picasa = {'access': 'public'} _general = {'regex': 'True', 'delete_by_default': 'False', 'delete_prompt': 'True', 'tags_prompt': 'False', 'url_style': 'site', 'list_style': 'title,url-site', 'missing_field_value': 'N/A', 'date_print_format': '%b %d %H:%M', 'cap_results': 'False', 'hostid': default_hostid} _docs = {'document_format': 'txt', 'spreadsheet_format': 'xls', 'presentation_format': 'ppt', 'format': 'txt', 'spreadsheet_editor': 'openoffice.org', 'presentation_editor': 'openoffice.org'} config_defaults = {googlecl.docs.SECTION_HEADER: _docs, googlecl.picasa.SECTION_HEADER: _picasa, googlecl.contacts.SECTION_HEADER: _contacts, googlecl.calendar.SECTION_HEADER: _calendar, googlecl.youtube.SECTION_HEADER: _youtube, 'GENERAL': _general} made_changes = False for section_name in config_defaults.keys(): if not CONFIG.has_section(section_name): CONFIG.add_section(section_name) section = config_defaults[section_name] missing_opts = set(section.keys()) - set(CONFIG.options(section_name)) if missing_opts: made_changes = True for opt in missing_opts: CONFIG.set(section_name, opt, section[opt]) return made_changes
9733652d586c2a46e5b22394a077d51d9be24bf0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2899/9733652d586c2a46e5b22394a077d51d9be24bf0/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 2116, 13332, 3536, 694, 326, 4486, 5337, 702, 316, 326, 642, 585, 12123, 1930, 5200, 830, 1930, 31889, 1930, 2987, 468, 8646, 2026, 506, 5301, 358, 4426, 622, 326, 1605, 1801, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 2116, 13332, 3536, 694, 326, 4486, 5337, 702, 316, 326, 642, 585, 12123, 1930, 5200, 830, 1930, 31889, 1930, 2987, 468, 8646, 2026, 506, 5301, 358, 4426, 622, 326, 1605, 1801, 1...
payment_term = p.property_payment_term and p.property_payment_term or False
payment_term = p.property_payment_term and p.property_payment_term.id or False
def onchange_partner_id(self, cr, uid, ids, type, partner_id): invoice_addr_id = False contact_addr_id = False payment_term = False acc_id = False opt = [('uid', str(uid))] if partner_id: opt.insert(0, ('id', partner_id)) res = self.pool.get('res.partner').address_get(cr, uid, [partner_id], ['contact', 'invoice']) contact_addr_id = res['contact'] invoice_addr_id = res['invoice'] p = self.pool.get('res.partner').browse(cr, uid, partner_id) if type in ('out_invoice', 'out_refund'): acc_id = p.property_account_receivable.id else: acc_id = p.property_account_payable.id
af23179759733dc163d3450d2759d9ea80b08bad /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7397/af23179759733dc163d3450d2759d9ea80b08bad/invoice.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 3427, 67, 31993, 67, 350, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 618, 16, 19170, 67, 350, 4672, 9179, 67, 4793, 67, 350, 273, 1083, 5388, 67, 4793, 67, 350, 273, 1083, 5184...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3427, 67, 31993, 67, 350, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 618, 16, 19170, 67, 350, 4672, 9179, 67, 4793, 67, 350, 273, 1083, 5388, 67, 4793, 67, 350, 273, 1083, 5184...
task = self._install(pkg, cs, lk, None, pruneweight, depth) for res in task: yield res
task = trans.TaskInstall(self, pkg, cs, lk, None, pruneweight, self._yieldweight) for res in task: yield res; pruneweight=min(pruneweight,self._pruneweight); task.setWeights(pruneweight, self._yieldweight)
def _fix(self, pkgs, changeset, locked, pending, pruneweight, depth=0): depth += 1 trace(1, depth, "_fix()")
c2ff0e2fa3473e5898baf091e7a39f94abf28732 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8317/c2ff0e2fa3473e5898baf091e7a39f94abf28732/transaction.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 904, 12, 2890, 16, 16922, 16, 22463, 16, 8586, 16, 4634, 16, 846, 318, 359, 1274, 16, 3598, 33, 20, 4672, 3598, 1011, 404, 2606, 12, 21, 16, 3598, 16, 4192, 904, 1435, 7923, 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, 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, 904, 12, 2890, 16, 16922, 16, 22463, 16, 8586, 16, 4634, 16, 846, 318, 359, 1274, 16, 3598, 33, 20, 4672, 3598, 1011, 404, 2606, 12, 21, 16, 3598, 16, 4192, 904, 1435, 7923, 2, ...
self.assert_(stylesheet_path in self.get_record(**s))
record = self.get_record(**s) self.assert_(stylesheet_path in record, '%r should be in %r' % (stylesheet_path, record))
def test_stylesheet_dependencies(self): # Parameters to publish_file. s = {'settings_overrides': {}} so = s['settings_overrides'] so['embed_stylesheet'] = 0 stylesheet_path = os.path.join('data', 'stylesheet.txt') so['stylesheet_path'] = stylesheet_path so['stylesheet'] = None s['writer_name'] = 'html' self.assert_(stylesheet_path not in self.get_record(**s)) so['embed_stylesheet'] = 1 self.assert_(stylesheet_path in self.get_record(**s)) s['writer_name'] = 'latex' self.assert_(stylesheet_path in self.get_record(**s)) del so['embed_stylesheet'] self.assert_(stylesheet_path not in self.get_record(**s))
13a920ea7eb61fbaf8249e17845775995a190a02 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1532/13a920ea7eb61fbaf8249e17845775995a190a02/test_dependencies.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 19403, 67, 11037, 12, 2890, 4672, 468, 7012, 358, 3808, 67, 768, 18, 272, 273, 13666, 4272, 67, 19775, 4278, 2618, 97, 1427, 273, 272, 3292, 4272, 67, 19775, 3546, 1427, 3292, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 19403, 67, 11037, 12, 2890, 4672, 468, 7012, 358, 3808, 67, 768, 18, 272, 273, 13666, 4272, 67, 19775, 4278, 2618, 97, 1427, 273, 272, 3292, 4272, 67, 19775, 3546, 1427, 3292, ...
if filetypes.is_allowed_filename(ret.path):
if filetypes.is_allowed_filename(ret[2]):
def should_load_url(self, url): """Returns True if the Miro browser should handle the url and False otherwise.
8132bb904babc62a6f0c237973f70bfeb37ae4a5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12354/8132bb904babc62a6f0c237973f70bfeb37ae4a5/browser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1410, 67, 945, 67, 718, 12, 2890, 16, 880, 4672, 3536, 1356, 1053, 309, 326, 490, 11373, 4748, 1410, 1640, 326, 880, 471, 1083, 3541, 18, 2, 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, 1410, 67, 945, 67, 718, 12, 2890, 16, 880, 4672, 3536, 1356, 1053, 309, 326, 490, 11373, 4748, 1410, 1640, 326, 880, 471, 1083, 3541, 18, 2, -100, -100, -100, -100, -100, -100, -100, -...
'aaaaaAAA10', '' ] gdaltest.runexternal(test_cli_utilities.get_ogr2ogr_path() + ' tmp data/flds.gml') ds = ogr.Open('tmp/Fields.shp')
'aaaaaAAA10' ] gdaltest.runexternal(test_cli_utilities.get_ogr2ogr_path() + ' tmp data/Fields.csv') ds = ogr.Open('tmp/Fields.dbf')
def test_ogr2ogr_20(): if test_cli_utilities.get_ogr2ogr_path() is None: return 'skip' if not ogrtest.have_geos(): return 'skip' gml_drv = ogr.GetDriverByName('GML') if gml_drv is None: return 'skip' expected_fields = [ 'a', 'A_1', 'a_1_2', 'aaaaaAAAAA', 'aAaaaAAA_1', 'aaaaaAAAAB', 'aaaaaAAA_2', 'aaaaaAAA_3', 'aaaaaAAA_4', 'aaaaaAAA_5', 'aaaaaAAA_6', 'aaaaaAAA_7', 'aaaaaAAA_8', 'aaaaaAAA_9', 'aaaaaAAA10', '' ] gdaltest.runexternal(test_cli_utilities.get_ogr2ogr_path() + ' tmp data/flds.gml') ds = ogr.Open('tmp/Fields.shp') if ds is None: return 'fail' layer_defn = ds.GetLayer(0).GetLayerDefn() if layer_defn.GetFieldCount() != 16: gdaltest.post_reason('Unexpected field count: ' + str(ds.GetLayer(0).GetLayerDefn().GetFieldCount()) ) ds.Destroy() ogr.GetDriverByName('ESRI Shapefile').DeleteDataSource('tmp/Fields.shp') return 'fail' error_occured = False for i in range( layer_defn.GetFieldCount() ): if layer_defn.GetFieldDefn( i ).GetNameRef() != expected_fields[i]: print 'Expected ', expected_fields[i],',but got',layer_defn.GetFieldDefn( i ).GetNameRef() error_occured = True ds.Destroy() ogr.GetDriverByName('ESRI Shapefile').DeleteDataSource('tmp/Fields.shp') if error_occured: return 'fail' return 'success'
177ffd16a6f2da58876a744c1018aea601409d81 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10289/177ffd16a6f2da58876a744c1018aea601409d81/test_ogr2ogr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 717, 86, 22, 717, 86, 67, 3462, 13332, 309, 1842, 67, 4857, 67, 1367, 1961, 18, 588, 67, 717, 86, 22, 717, 86, 67, 803, 1435, 353, 599, 30, 327, 296, 7457, 11, 225, 309, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 717, 86, 22, 717, 86, 67, 3462, 13332, 309, 1842, 67, 4857, 67, 1367, 1961, 18, 588, 67, 717, 86, 22, 717, 86, 67, 803, 1435, 353, 599, 30, 327, 296, 7457, 11, 225, 309, ...
ref_lines = rebuild_reference_lines(docbody[start_idx:ref_sect_end_line+1], ref_line_marker_ptn)
ref_lines = \ rebuild_reference_lines(docbody[start_idx:ref_sect_end_line+1], \ ref_line_marker_ptn)
def get_reference_lines(docbody, ref_sect_start_line, ref_sect_end_line, \ ref_sect_title, ref_line_marker_ptn, title_marker_same_line): """After the reference section of a document has been identified, and the first and last lines of the reference section have been recorded, this function is called to take the reference lines out of the document body. The document's reference lines are returned in a list of strings whereby each string is a reference line. Before this can be done however, the reference section is passed to another function that rebuilds any broken reference lines. @param docbody: (list) of strings - the entire document body. @param ref_sect_start_line: (integer) - the index in docbody of the first reference line. @param ref_sect_end_line: (integer) - the index in docbody of the last reference line. @param ref_sect_title: (string) - the title of the reference section (e.g. "References"). @param ref_line_marker_ptn: (string) - the patern used to match the marker for each reference line (e.g., could be used to match lines with markers of the form [1], [2], etc.) @param title_marker_same_line: (integer) - a flag to indicate whether or not the reference section title was on the same line as the first reference line's marker. @return: (list) of strings. Each string is a reference line, extracted from the document. """ start_idx = ref_sect_start_line if title_marker_same_line: ## Title on same line as 1st ref- take title out! title_start = docbody[start_idx].find(ref_sect_title) if title_start != -1: docbody[start_idx] = docbody[start_idx][title_start + len(ref_sect_title):] elif ref_sect_title is not None: ## Pass title line start_idx += 1 ## now rebuild reference lines: if type(ref_sect_end_line) is int: ref_lines = rebuild_reference_lines(docbody[start_idx:ref_sect_end_line+1], ref_line_marker_ptn) else: ref_lines = rebuild_reference_lines(docbody[start_idx:], ref_line_marker_ptn) return ref_lines
afd852f45332d11ac027b8d47ce1a922ce7f2cc6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12027/afd852f45332d11ac027b8d47ce1a922ce7f2cc6/refextract.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 6180, 67, 3548, 12, 2434, 3432, 16, 1278, 67, 5709, 67, 1937, 67, 1369, 16, 1278, 67, 5709, 67, 409, 67, 1369, 16, 521, 1278, 67, 5709, 67, 2649, 16, 1278, 67, 1369, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 6180, 67, 3548, 12, 2434, 3432, 16, 1278, 67, 5709, 67, 1937, 67, 1369, 16, 1278, 67, 5709, 67, 409, 67, 1369, 16, 521, 1278, 67, 5709, 67, 2649, 16, 1278, 67, 1369, 67, 1...
try: v=v.read() except: v=str(v)
if hasattr(v,'read'): v=v.read() else: v=str(v)
def field2Regex(v): try: v=v.read() except: v=str(v) if v: return regex.compile(v)
6e60c63abb35f639b7efc369be01caf096484aa1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/6e60c63abb35f639b7efc369be01caf096484aa1/Publish.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 652, 22, 6628, 12, 90, 4672, 309, 3859, 12, 90, 11189, 896, 11, 4672, 331, 33, 90, 18, 896, 1435, 469, 30, 331, 33, 701, 12, 90, 13, 309, 331, 30, 327, 3936, 18, 11100, 12, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 652, 22, 6628, 12, 90, 4672, 309, 3859, 12, 90, 11189, 896, 11, 4672, 331, 33, 90, 18, 896, 1435, 469, 30, 331, 33, 701, 12, 90, 13, 309, 331, 30, 327, 3936, 18, 11100, 12, 90, 1...
texts["parent"] = FormatName(entry_infos["name"])
texts["parent"] = UnDigitName(FormatName(entry_infos["name"]))
def GenerateFileContent(Node, headerfilepath, pointers_dict = {}): """ pointers_dict = {(Idx,Sidx):"VariableName",...} """ 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]
1c4bd6cb0bddfe85e274f3b52908c78e2a12df9a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/116/1c4bd6cb0bddfe85e274f3b52908c78e2a12df9a/gen_cfile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6654, 25391, 12, 907, 16, 1446, 10561, 16, 13857, 67, 1576, 273, 2618, 4672, 3536, 13857, 67, 1576, 273, 288, 12, 4223, 16, 55, 3465, 13, 2773, 21519, 3113, 2777, 97, 3536, 2552, 618, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 16, 13857, 67, 1576, 273, 2618, 4672, 3536, 13857, 67, 1576, 273, 288, 12, 4223, 16, 55, 3465, 13, 2773, 21519, 3113, 2777, 97, 3536, 2552, 618, ...
assert "10&&10" in baselines
assert "10&&10" not in baselines
def test_simple(self): baselines = flagdata2(vis = self.vis, selectdata=True, antenna="9", summary=True )['baseline'].keys()
37a0b9e0228c19830a3281be1e3962f850977936 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2098/37a0b9e0228c19830a3281be1e3962f850977936/test_flagdata2.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 9647, 12, 2890, 4672, 2580, 14567, 273, 2982, 892, 22, 12, 3516, 273, 365, 18, 3516, 16, 2027, 892, 33, 5510, 16, 392, 2253, 6582, 1546, 29, 3113, 4916, 33, 5510, 262, 3292, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9647, 12, 2890, 4672, 2580, 14567, 273, 2982, 892, 22, 12, 3516, 273, 365, 18, 3516, 16, 2027, 892, 33, 5510, 16, 392, 2253, 6582, 1546, 29, 3113, 4916, 33, 5510, 262, 3292, ...
os.environ["EVENT_LOG_FILE"] = logfile1
os.environ["STUPID_LOG_FILE"] = logfile1
def testLogRestart(self): port = 9090 logfile1 = tempfile.mktemp(suffix="log") logfile2 = tempfile.mktemp(suffix="log") os.environ["EVENT_LOG_FILE"] = logfile1
7b10d3209d559e3cd9a61fbf21399fb4d3105346 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/7b10d3209d559e3cd9a61fbf21399fb4d3105346/testStart.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 1343, 15057, 12, 2890, 4672, 1756, 273, 2468, 5908, 20, 15204, 21, 273, 13275, 18, 24816, 5814, 12, 8477, 1546, 1330, 7923, 15204, 22, 273, 13275, 18, 24816, 5814, 12, 8477, 1546, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1842, 1343, 15057, 12, 2890, 4672, 1756, 273, 2468, 5908, 20, 15204, 21, 273, 13275, 18, 24816, 5814, 12, 8477, 1546, 1330, 7923, 15204, 22, 273, 13275, 18, 24816, 5814, 12, 8477, 1546, ...
encList += ToUtf8(l) + '|'
encList += ToUtf8(l) + u'|'
def ListToParam( list ): """Convert a list of unicode strings into a UTF8 string separated by the '|' symbols """ list = ConvToList( list ) if len(list) == 0: return '' encList = '' # items may not have one symbol - '|' for l in list: if type(l) == str and '|' in l: raise wikipedia.Error("item '%s' contains '|' symbol" % l ) encList += ToUtf8(l) + '|' return encList[:-1]
e46ed7d27867ad8611526fc5a8d03908736354cf /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/e46ed7d27867ad8611526fc5a8d03908736354cf/query.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 987, 774, 786, 12, 666, 262, 30, 3536, 2723, 279, 666, 434, 5252, 2064, 1368, 279, 6380, 28, 533, 8936, 635, 326, 8030, 7963, 3536, 666, 273, 18263, 25772, 12, 666, 262, 309, 562, 12, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 987, 774, 786, 12, 666, 262, 30, 3536, 2723, 279, 666, 434, 5252, 2064, 1368, 279, 6380, 28, 533, 8936, 635, 326, 8030, 7963, 3536, 666, 273, 18263, 25772, 12, 666, 262, 309, 562, 12, ...
addr1 = IP('10.1.1.0/24') addr2 = IP('10.1.1.0/26') addr1.address_exclude(addr2) = [IP('10.1.1.64/26'), IP('10.1.1.128/25')]
>>> addr1 = IP('10.1.1.0/24') >>> addr2 = IP('10.1.1.0/26') >>> addr1.address_exclude(addr2) [IPv4('10.1.1.64/26'), IPv4('10.1.1.128/25')]
def address_exclude(self, other): """Remove an address from a larger block.
df59c3d3df5e1aeab99df5a8068ef42df9dc8d15 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3187/df59c3d3df5e1aeab99df5a8068ef42df9dc8d15/ipaddr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1758, 67, 10157, 12, 2890, 16, 1308, 4672, 3536, 3288, 392, 1758, 628, 279, 10974, 1203, 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, ...
[ 1, 1, 1, 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, 1758, 67, 10157, 12, 2890, 16, 1308, 4672, 3536, 3288, 392, 1758, 628, 279, 10974, 1203, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
sources.append(CudaSource(name))
sources.append(CudaSource(name, ptx))
def getAllCudaSources(path): sources = [] for dirpath, dirnames, filenames in os.walk(path): for filename in filenames: name = os.path.join(dirpath, filename) if os.path.isfile(name): split = name.rsplit('.', 1) extension = "" if len(split) == 2: extension = split[1] if extension == "cu": sources.append(CudaSource(name)) return sources
9192a649c489ae6d9d62d5f57ebd7c6d206b8d28 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4467/9192a649c489ae6d9d62d5f57ebd7c6d206b8d28/CompileCudaTests.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5514, 39, 13177, 8628, 12, 803, 4672, 5550, 273, 5378, 364, 17803, 16, 1577, 1973, 16, 9066, 316, 1140, 18, 11348, 12, 803, 4672, 364, 1544, 316, 9066, 30, 508, 273, 1140, 18, 803, 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, 5514, 39, 13177, 8628, 12, 803, 4672, 5550, 273, 5378, 364, 17803, 16, 1577, 1973, 16, 9066, 316, 1140, 18, 11348, 12, 803, 4672, 364, 1544, 316, 9066, 30, 508, 273, 1140, 18, 803, 18,...
val = self.read(Melcor.REG_PERCENT_OUTPUT) return val
val = int(self.read(Melcor.REG_PERCENT_OUTPUT)) if val > 2**15 : val -= 2**16 return float(val)/10.0
def getPercentCurrent(self) : """ Returns the percent of rated max current being output. See getCurrent() """ val = self.read(Melcor.REG_PERCENT_OUTPUT) return val
50cb1766942ecb28e638828494b1f618abf3740f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1982/50cb1766942ecb28e638828494b1f618abf3740f/temperature.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 22612, 2998, 3935, 12, 2890, 13, 294, 3536, 2860, 326, 5551, 434, 436, 690, 943, 783, 3832, 876, 18, 2164, 5175, 1435, 3536, 1244, 273, 365, 18, 896, 12, 49, 292, 3850, 18, 5937, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 22612, 2998, 3935, 12, 2890, 13, 294, 3536, 2860, 326, 5551, 434, 436, 690, 943, 783, 3832, 876, 18, 2164, 5175, 1435, 3536, 1244, 273, 365, 18, 896, 12, 49, 292, 3850, 18, 5937, 67, ...
if not (var.descr() or var.type()): continue
if (var.descr() is None and var.type() is None and var.value() is None): continue
def _var_details(self, variables, container, heading='Variable Details'): """ @return: The HTML code for a variable details table. This is used by L{_module_to_html} to describe the variables in a module; and by L{_class_to_html} to describe instance variables and class variables. @rtype: C{string} """ variables = self._sort(variables) if len(variables) == 0: return '' str = self._table_header(heading, 'details')+'</table>'
de8498c8efa790d4615edc664395ae04afd746a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/de8498c8efa790d4615edc664395ae04afd746a1/html.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1401, 67, 6395, 12, 2890, 16, 3152, 16, 1478, 16, 11053, 2218, 3092, 21897, 11, 4672, 3536, 632, 2463, 30, 1021, 3982, 981, 364, 279, 2190, 3189, 1014, 18, 225, 1220, 353, 1399, 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, 389, 1401, 67, 6395, 12, 2890, 16, 3152, 16, 1478, 16, 11053, 2218, 3092, 21897, 11, 4672, 3536, 632, 2463, 30, 1021, 3982, 981, 364, 279, 2190, 3189, 1014, 18, 225, 1220, 353, 1399, 6...
childNode = Variables(tokenizer, staticContext)
if tokenType == "var": childNode = builder.VAR_build(tokenizer) else: childNode = builder.CONST_build(tokenizer) variables = Variables(tokenizer, staticContext) childNode.append(variables)
def Statement(tokenizer, staticContext): """Parses a Statement.""" tokenType = tokenizer.get(True) builder = staticContext.builder # Cases for statements ending in a right curly return early, avoiding the # common semicolon insertion magic after this switch. if tokenType == "function": # "declared_form" extends funDecls of staticContext, "statement_form" doesn'tokenizer. if len(staticContext.statementStack) > 1: kind = "statement_form" else: kind = "declared_form" return FunctionDefinition(tokenizer, staticContext, True, kind) elif tokenType == "left_curly": node = Statements(tokenizer, staticContext) tokenizer.mustMatch("right_curly") return node elif tokenType == "if": node = builder.IF_build(tokenizer) builder.IF_setCondition(node, ParenExpression(tokenizer, staticContext)) staticContext.statementStack.append(node) builder.IF_setThenPart(node, Statement(tokenizer, staticContext)) if tokenizer.match("else"): comments = tokenizer.getComments() elsePart = Statement(tokenizer, staticContext) builder.COMMENTS_add(elsePart, node, comments) builder.IF_setElsePart(node, elsePart) staticContext.statementStack.pop() builder.IF_finish(node) return node elif tokenType == "switch": # This allows CASEs after a "default", which is in the standard. node = builder.SWITCH_build(tokenizer) builder.SWITCH_setDiscriminant(node, ParenExpression(tokenizer, staticContext)) staticContext.statementStack.append(node) tokenizer.mustMatch("left_curly") tokenType = tokenizer.get() while tokenType != "right_curly": if tokenType == "default": if node.defaultIndex >= 0: raise SyntaxError("More than one switch default", tokenizer) childNode = builder.DEFAULT_build(tokenizer) builder.SWITCH_setDefaultIndex(node, len(node)-1) tokenizer.mustMatch("colon") builder.DEFAULT_initializeStatements(childNode, tokenizer) while True: tokenType=tokenizer.peek(True) if tokenType == "case" or tokenType == "default" or tokenType == "right_curly": break builder.DEFAULT_addStatement(childNode, Statement(tokenizer, staticContext)) builder.DEFAULT_finish(childNode) elif tokenType == "case": childNode = builder.CASE_build(tokenizer) builder.CASE_setLabel(childNode, Expression(tokenizer, staticContext)) tokenizer.mustMatch("colon") builder.CASE_initializeStatements(childNode, tokenizer) while True: tokenType=tokenizer.peek(True) if tokenType == "case" or tokenType == "default" or tokenType == "right_curly": break builder.CASE_addStatement(childNode, Statement(tokenizer, staticContext)) builder.CASE_finish(childNode) else: raise SyntaxError("Invalid switch case", tokenizer) builder.SWITCH_addCase(node, childNode) tokenType = tokenizer.get() staticContext.statementStack.pop() builder.SWITCH_finish(node) return node elif tokenType == "for": node = builder.FOR_build(tokenizer) forBlock = None if tokenizer.match("identifier") and tokenizer.token.value == "each": builder.FOR_rebuildForEach(node) tokenizer.mustMatch("left_paren") tokenType = tokenizer.peek() childNode = None if tokenType != "semicolon": staticContext.inForLoopInit = True if tokenType == "var" or tokenType == "const": tokenizer.get() childNode = Variables(tokenizer, staticContext) elif tokenType == "let": tokenizer.get() if tokenizer.peek() == "left_paren": childNode = LetBlock(tokenizer, staticContext, False) else: # Let in for head, we need to add an implicit block # around the rest of the for. forBlock = builder.BLOCK_build(tokenizer, staticContext.blockId) staticContext.blockId += 1 staticContext.statementStack.append(forBlock) childNode = Variables(tokenizer, staticContext, forBlock) else: childNode = Expression(tokenizer, staticContext) staticContext.inForLoopInit = False if childNode and tokenizer.match("in"): builder.FOR_rebuildForIn(node) builder.FOR_setObject(node, Expression(tokenizer, staticContext), forBlock) if childNode.type == "var" or childNode.type == "let": if len(childNode) != 1: raise SyntaxError("Invalid for..in left-hand side", tokenizer) builder.FOR_setIterator(node, childNode[0], childNode, forBlock) else: builder.FOR_setIterator(node, childNode, None, forBlock) else: builder.FOR_setSetup(node, childNode) tokenizer.mustMatch("semicolon") if node.isEach: raise SyntaxError("Invalid for each..in loop") if tokenizer.peek() == "semicolon": builder.FOR_setCondition(node, None) else: builder.FOR_setCondition(node, Expression(tokenizer, staticContext)) tokenizer.mustMatch("semicolon") if tokenizer.peek() == "right_paren": builder.FOR_setUpdate(node, None) else: builder.FOR_setUpdate(node, Expression(tokenizer, staticContext)) tokenizer.mustMatch("right_paren") builder.FOR_setBody(node, nest(tokenizer, staticContext, node, Statement)) if forBlock: builder.BLOCK_finish(forBlock) staticContext.statementStack.pop() builder.FOR_finish(node) return node elif tokenType == "while": node = builder.WHILE_build(tokenizer) builder.WHILE_setCondition(node, ParenExpression(tokenizer, staticContext)) builder.WHILE_setBody(node, nest(tokenizer, staticContext, node, Statement)) builder.WHILE_finish(node) return node elif tokenType == "do": node = builder.DO_build(tokenizer) builder.DO_setBody(node, nest(tokenizer, staticContext, node, Statement, "while")) builder.DO_setCondition(node, ParenExpression(tokenizer, staticContext)) builder.DO_finish(node) if not staticContext.ecma3OnlyMode: # <script language="JavaScript"> (without version hints) may need # automatic semicolon insertion without a newline after do-while. # See http://bugzilla.mozilla.org/show_bug.cgi?id=238945. tokenizer.match("semicolon") return node # NO RETURN elif tokenType == "break" or tokenType == "continue": if tokenType == "break": node = builder.BREAK_build(tokenizer) else: node = builder.CONTINUE_build(tokenizer) if tokenizer.peekOnSameLine() == "identifier": tokenizer.get() if tokenType == "break": builder.BREAK_setLabel(node, tokenizer.token.value) else: builder.CONTINUE_setLabel(node, tokenizer.token.value) statementStack = staticContext.statementStack i = len(statementStack) label = node.label if hasattr(node, "label") else None if label: while True: i -= 1 if i < 0: raise SyntaxError("Label not found", tokenizer) if getattr(statementStack[i], "label", None) == label: break # # Both break and continue to label need to be handled specially # within a labeled loop, so that they target that loop. If not in # a loop, then break targets its labeled statement. Labels can be # nested so we skip all labels immediately enclosing the nearest # non-label statement. # while i < len(statementStack) - 1 and statementStack[i+1].type == "label": i += 1 if i < len(statementStack) - 1 and getattr(statementStack[i+1], "isLoop", False): i += 1 elif tokenType == "continue": raise SyntaxError("Invalid continue", tokenizer) else: while True: i -= 1 if i < 0: if tokenType == "break": raise SyntaxError("Invalid break") else: raise SyntaxError("Invalid continue") if getattr(statementStack[i], "isLoop", False) or (tokenType == "break" and statementStack[i].type == "switch"): break if tokenType == "break": builder.BREAK_setTarget(node, statementStack[i]) builder.BREAK_finish(node) else: builder.CONTINUE_setTarget(node, statementStack[i]) builder.CONTINUE_finish(node) # NO RETURN elif tokenType == "try": node = builder.TRY_build(tokenizer) builder.TRY_setTryBlock(node, Block(tokenizer, staticContext)) while tokenizer.match("catch"): childNode = builder.CATCH_build(tokenizer) tokenizer.mustMatch("left_paren") nextTokenType = tokenizer.get() if nextTokenType == "left_bracket" or nextTokenType == "left_curly": # Destructured catch identifiers. tokenizer.unget() builder.CATCH_setVarName(childNode, DestructuringExpression(tokenizer, staticContext, True)) elif nextTokenType == "identifier": builder.CATCH_setVarName(childNode, tokenizer.token.value) else: raise SyntaxError("Missing identifier in catch", tokenizer) if tokenizer.match("if"): if staticContext.ecma3OnlyMode: raise SyntaxError("Illegal catch guard", tokenizer) if node.getChildrenLength() > 0 and not node.getUnrelatedChildren()[0].guard: raise SyntaxError("Guarded catch after unguarded", tokenizer) builder.CATCH_setGuard(childNode, Expression(tokenizer, staticContext)) else: builder.CATCH_setGuard(childNode, None) tokenizer.mustMatch("right_paren") builder.CATCH_setBlock(childNode, Block(tokenizer, staticContext)) builder.CATCH_finish(childNode) builder.TRY_addCatch(node, childNode) builder.TRY_finishCatches(node) if tokenizer.match("finally"): builder.TRY_setFinallyBlock(node, Block(tokenizer, staticContext)) if node.getChildrenLength() == 0 and not hasattr(node, "finallyBlock"): raise SyntaxError("Invalid try statement", tokenizer) builder.TRY_finish(node) return node elif tokenType == "catch" or tokenType == "finally": raise SyntaxError(tokens[tokenType] + " without preceding try") elif tokenType == "throw": node = builder.THROW_build(tokenizer) builder.THROW_setException(node, Expression(tokenizer, staticContext)) builder.THROW_finish(node) # NO RETURN elif tokenType == "return": node = returnOrYield(tokenizer, staticContext) # NO RETURN elif tokenType == "with": node = builder.WITH_build(tokenizer) builder.WITH_setObject(node, ParenExpression(tokenizer, staticContext)) builder.WITH_setBody(node, nest(tokenizer, staticContext, node, Statement)) builder.WITH_finish(node) return node elif tokenType == "var" or tokenType == "const": node = Variables(tokenizer, staticContext) # NO RETURN elif tokenType == "let": if tokenizer.peek() == "left_paren": node = LetBlock(tokenizer, staticContext, True) else: node = Variables(tokenizer, staticContext) # NO RETURN elif tokenType == "debugger": node = builder.DEBUGGER_build(tokenizer) # NO RETURN elif tokenType == "newline" or tokenType == "semicolon": node = builder.SEMICOLON_build(tokenizer) builder.SEMICOLON_setExpression(node, None) builder.SEMICOLON_finish(tokenizer) return node else: if tokenType == "identifier": tokenType = tokenizer.peek() # Labeled statement. if tokenType == "colon": label = tokenizer.token.value statementStack = staticContext.statementStack i = len(statementStack)-1 while i >= 0: if getattr(statementStack[i], "label", None) == label: raise SyntaxError("Duplicate label") i -= 1 tokenizer.get() node = builder.LABEL_build(tokenizer) builder.LABEL_setLabel(node, label) builder.LABEL_setStatement(node, nest(tokenizer, staticContext, node, Statement)) builder.LABEL_finish(node) return node # Expression statement. # We unget the current token to parse the expression as a whole. node = builder.SEMICOLON_build(tokenizer) tokenizer.unget() builder.SEMICOLON_setExpression(node, Expression(tokenizer, staticContext)) node.end = node.expression.end builder.SEMICOLON_finish(node) # NO RETURN MagicalSemicolon(tokenizer) return node
19bafda0b448fd11967e4cae01844c2254735dc3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12949/19bafda0b448fd11967e4cae01844c2254735dc3/Parser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8056, 12, 2316, 1824, 16, 760, 1042, 4672, 3536, 6656, 279, 8056, 12123, 225, 22302, 273, 10123, 18, 588, 12, 5510, 13, 2089, 273, 760, 1042, 18, 9574, 225, 468, 385, 3304, 364, 6317, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 8056, 12, 2316, 1824, 16, 760, 1042, 4672, 3536, 6656, 279, 8056, 12123, 225, 22302, 273, 10123, 18, 588, 12, 5510, 13, 2089, 273, 760, 1042, 18, 9574, 225, 468, 385, 3304, 364, 6317, ...
child = self.spawn(['--withmod-_curses', str(f)])
child = self.spawn(['--withmod-_minimal_curses', str(f)])
def test_tparm(self): source = py.code.Source(""" import _curses _curses.setupterm() assert _curses.tparm(_curses.tigetstr('cup'), 5, 3) == '\033[6;4H' print 'ok!' """) f = udir.join("test_tparm.py") f.write(source) child = self.spawn(['--withmod-_curses', str(f)]) child.expect('ok!')
c95324df53e2debbd866baecc3e8fd82bf3e3691 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6934/c95324df53e2debbd866baecc3e8fd82bf3e3691/test_curses.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 88, 1065, 81, 12, 2890, 4672, 1084, 273, 2395, 18, 710, 18, 1830, 2932, 3660, 1930, 389, 1397, 2420, 389, 1397, 2420, 18, 542, 3648, 1035, 1435, 1815, 389, 1397, 2420, 18, 88...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 88, 1065, 81, 12, 2890, 4672, 1084, 273, 2395, 18, 710, 18, 1830, 2932, 3660, 1930, 389, 1397, 2420, 389, 1397, 2420, 18, 542, 3648, 1035, 1435, 1815, 389, 1397, 2420, 18, 88...
except ValueError: pass
def __calc_date_time(self): # Set self.__date_time, self.__date, & self.__time by using # time.strftime().
444a288e73599ce77294e5a04ab9a6c787b1d9ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/444a288e73599ce77294e5a04ab9a6c787b1d9ec/_strptime.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 12448, 67, 712, 67, 957, 12, 2890, 4672, 468, 1000, 365, 16186, 712, 67, 957, 16, 365, 16186, 712, 16, 473, 365, 16186, 957, 635, 1450, 468, 813, 18, 701, 9982, 7675, 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, 12448, 67, 712, 67, 957, 12, 2890, 4672, 468, 1000, 365, 16186, 712, 67, 957, 16, 365, 16186, 712, 16, 473, 365, 16186, 957, 635, 1450, 468, 813, 18, 701, 9982, 7675, 2, -100, ...
count = int(self.domain.select(query)[0]["Count"])
count = int(self.domain.select(query).next()["Count"])
def count(self, cls, filters): """ Get the number of results that would be returned in this query """ query = "select count(*) from `%s` %s" % (self.domain.name, self._build_filter_part(cls, filters)) count = int(self.domain.select(query)[0]["Count"]) return count
e721ed489c2085d6edfdb71b19087b1636af152b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1098/e721ed489c2085d6edfdb71b19087b1636af152b/sdbmanager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1056, 12, 2890, 16, 2028, 16, 3415, 4672, 3536, 968, 326, 1300, 434, 1686, 716, 4102, 506, 2106, 316, 333, 843, 3536, 843, 273, 315, 4025, 1056, 24099, 628, 12430, 87, 68, 738, 87, 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, 1056, 12, 2890, 16, 2028, 16, 3415, 4672, 3536, 968, 326, 1300, 434, 1686, 716, 4102, 506, 2106, 316, 333, 843, 3536, 843, 273, 315, 4025, 1056, 24099, 628, 12430, 87, 68, 738, 87, 6, ...
for i,c in enumerate(self.model().column_map): m[c] = self.columnWidth(i)
cmap = getattr(self.model(), 'column_map', None) if cmap is not None: for i,c in enumerate(cmap): m[c] = self.columnWidth(i)
def write_settings(self): m = dynamic[self.__class__.__name__+'column width map'] if m is None: m = {} for i,c in enumerate(self.model().column_map): m[c] = self.columnWidth(i) dynamic[self.__class__.__name__+'column width map'] = m self.cw = m
e9402eb98aeea6cd17907ecbc3d182e24b6922fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/e9402eb98aeea6cd17907ecbc3d182e24b6922fa/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 67, 4272, 12, 2890, 4672, 312, 273, 5976, 63, 2890, 16186, 1106, 972, 16186, 529, 972, 6797, 2827, 1835, 852, 3546, 309, 312, 353, 599, 30, 312, 273, 2618, 11136, 273, 3869, 12, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 67, 4272, 12, 2890, 4672, 312, 273, 5976, 63, 2890, 16186, 1106, 972, 16186, 529, 972, 6797, 2827, 1835, 852, 3546, 309, 312, 353, 599, 30, 312, 273, 2618, 11136, 273, 3869, 12, ...
"'extra_path' option must be a list, tuple, or " + \ "comma-separated string with 1 or 2 elements"
("'extra_path' option must be a list, tuple, or " "comma-separated string with 1 or 2 elements")
def handle_extra_path (self):
0e3d62f34dbd113de991760f567eb5f192ddb4d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0e3d62f34dbd113de991760f567eb5f192ddb4d6/install.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 67, 7763, 67, 803, 261, 2890, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 67, 7763, 67, 803, 261, 2890, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
def doIt(file) : """Generates a PDF document, save it into file, and returns Python source code.
def doIt(file, regenerate=0) : """Generates a PDF document, save it into file.
def doIt(file) : """Generates a PDF document, save it into file, and returns Python source code. file : either a filename or a file-like object. returns : the equivalent Python source code as a string of text. """'''
b64a90f56c6220e080453d410d6535e49b580ebc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/b64a90f56c6220e080453d410d6535e49b580ebc/pycanvas.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 7193, 12, 768, 16, 20821, 33, 20, 13, 294, 3536, 6653, 279, 12667, 1668, 16, 1923, 518, 1368, 585, 18, 225, 585, 294, 3344, 279, 1544, 578, 279, 585, 17, 5625, 733, 18, 225, 113...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 7193, 12, 768, 16, 20821, 33, 20, 13, 294, 3536, 6653, 279, 12667, 1668, 16, 1923, 518, 1368, 585, 18, 225, 585, 294, 3344, 279, 1544, 578, 279, 585, 17, 5625, 733, 18, 225, 113...
if sub_model_object_field: copy_val += "." + sub_model_object_field if null_value: copy_val = copy_val + "|default:'''%s'''" % null_value copy_val = copy_val + "}}"
if sub_model_object_field: copy_val += "." + sub_model_object_field if null_value: copy_val = copy_val + "|default:'''%s'''" % null_value copy_val = copy_val + "}}"
def compute_pl(self, model_object_field, sub_model_object_field, null_value, template_language='mako'): """ Returns the expression based on data provided @param model_object_field: First level field @param sub_model_object_field: Second level drilled down field (M2O) @param null_value: What has to be returned if the value is empty @param template_language: The language used for templating @return: computed expression """ #Configure for MAKO copy_val = '' if template_language == 'mako': if model_object_field: copy_val = "${object." + model_object_field if sub_model_object_field: copy_val += "." + sub_model_object_field if null_value: copy_val += " or '''%s'''" % null_value if model_object_field: copy_val += "}" elif template_language == 'django': if model_object_field: copy_val = "{{object." + model_object_field if sub_model_object_field: copy_val += "." + sub_model_object_field if null_value: copy_val = copy_val + "|default:'''%s'''" % null_value copy_val = copy_val + "}}" return copy_val
7bf6844f10fc9278901f8e2a61e83df166f8241c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7bf6844f10fc9278901f8e2a61e83df166f8241c/email_template.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3671, 67, 412, 12, 2890, 16, 938, 67, 1612, 67, 1518, 16, 720, 67, 2284, 67, 1612, 67, 1518, 16, 446, 67, 1132, 16, 1542, 67, 4923, 2218, 81, 581, 83, 11, 4672, 3536, 2860, 326, 26...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3671, 67, 412, 12, 2890, 16, 938, 67, 1612, 67, 1518, 16, 720, 67, 2284, 67, 1612, 67, 1518, 16, 446, 67, 1132, 16, 1542, 67, 4923, 2218, 81, 581, 83, 11, 4672, 3536, 2860, 326, 26...
OUTPUT: - tuple
OUTPUT: tuple
def basis(self): """ Return basis for this fractional ideal. The basis is in Hermite form.
b7a16ed05ab1759a61c3840607275d6cd5b220a1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/b7a16ed05ab1759a61c3840607275d6cd5b220a1/quaternion_algebra.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10853, 12, 2890, 4672, 3536, 2000, 10853, 364, 333, 20462, 23349, 18, 225, 1021, 10853, 353, 316, 670, 1035, 1137, 646, 18, 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, 0, 0, 0, 0, 0, 0, 0, 0, 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, 10853, 12, 2890, 4672, 3536, 2000, 10853, 364, 333, 20462, 23349, 18, 225, 1021, 10853, 353, 316, 670, 1035, 1137, 646, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
constraints = "PRIMARY KEY (event_id)"
constraints = "PRIMARY KEY (coinc_event_id)"
def set_ms_band(self, band): self.ms_flow = band[0] self.ms_bandwidth = abs(band)
f54b3e62a6bfcae6d14de19368ceadc3d63bdbd0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5758/f54b3e62a6bfcae6d14de19368ceadc3d63bdbd0/lsctables.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 959, 67, 12752, 12, 2890, 16, 8937, 4672, 365, 18, 959, 67, 2426, 273, 8937, 63, 20, 65, 365, 18, 959, 67, 29750, 273, 2417, 12, 12752, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 444, 67, 959, 67, 12752, 12, 2890, 16, 8937, 4672, 365, 18, 959, 67, 2426, 273, 8937, 63, 20, 65, 365, 18, 959, 67, 29750, 273, 2417, 12, 12752, 13, 2, -100, -100, -100, -100, -100, ...
_fl_popup_set_title_font = cfuncproto(so_libforms, "fl_popup_set_title_font", None, [cty.POINTER(FL_POPUP), cty.c_int, cty.c_int],
_fl_popup_set_title_font = cfuncproto(so_libforms, "fl_popup_set_title_font", None, [cty.POINTER(FL_POPUP), cty.c_int, cty.c_int],
def fl_popup_get_title_font(p1, p2, p3): """ fl_popup_get_title_font(p1, p2, p3) """ _fl_popup_get_title_font(p1, p2, p3)
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, 16086, 67, 588, 67, 2649, 67, 5776, 12, 84, 21, 16, 293, 22, 16, 293, 23, 4672, 3536, 1183, 67, 16086, 67, 588, 67, 2649, 67, 5776, 12, 84, 21, 16, 293, 22, 16, 293, 23...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1183, 67, 16086, 67, 588, 67, 2649, 67, 5776, 12, 84, 21, 16, 293, 22, 16, 293, 23, 4672, 3536, 1183, 67, 16086, 67, 588, 67, 2649, 67, 5776, 12, 84, 21, 16, 293, 22, 16, 293, 23...
return rdw_helpers.encodeText(replacement)
return rdw_helpers.encodeText(str(replacement))
def _getReplacementText(self, replacement): if isinstance(replacement, unicode): replacement = replacement.encode('utf-8') return rdw_helpers.encodeText(replacement)
970338f3de2e85f28828f19ab93e08d0cee86098 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2223/970338f3de2e85f28828f19ab93e08d0cee86098/rdw_templating.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 15201, 1528, 12, 2890, 16, 6060, 4672, 309, 1549, 12, 24394, 16, 5252, 4672, 6060, 273, 6060, 18, 3015, 2668, 3158, 17, 28, 6134, 327, 9437, 91, 67, 11397, 18, 3015, 1528, 12...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 15201, 1528, 12, 2890, 16, 6060, 4672, 309, 1549, 12, 24394, 16, 5252, 4672, 6060, 273, 6060, 18, 3015, 2668, 3158, 17, 28, 6134, 327, 9437, 91, 67, 11397, 18, 3015, 1528, 12...
MarkerInterface,\
def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node)
6c6678d8443cc0ac1425216db36bdd74c2f8cb7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13054/6c6678d8443cc0ac1425216db36bdd74c2f8cb7b/XMLSchema.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 628, 8832, 12, 2890, 16, 756, 4672, 365, 18, 542, 2498, 12, 2159, 13, 2939, 273, 365, 18, 588, 6323, 12, 2159, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 628, 8832, 12, 2890, 16, 756, 4672, 365, 18, 542, 2498, 12, 2159, 13, 2939, 273, 365, 18, 588, 6323, 12, 2159, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
else
else:
def __init__(data = None) if data == None: quickfix.DoubleField.__init__(self, 845) else quickfix.DoubleField.__init__(self, 845, data)
484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 892, 273, 599, 13, 309, 501, 422, 599, 30, 9549, 904, 18, 5265, 974, 16186, 2738, 972, 12, 2890, 16, 1725, 7950, 13, 469, 30, 9549, 904, 18, 5265, 974, 16186, 27...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 892, 273, 599, 13, 309, 501, 422, 599, 30, 9549, 904, 18, 5265, 974, 16186, 2738, 972, 12, 2890, 16, 1725, 7950, 13, 469, 30, 9549, 904, 18, 5265, 974, 16186, 27...
self.replace.Bind(wx.EVT_KILL_FOCUS, self.OnTabToCommand)
self.replace.Bind(wx.EVT_KILL_FOCUS, self.OnReplaceLoseFocus)
def createCtrls(self): text = self.service.forward grid = wx.GridBagSizer(2, 2) self.label = wx.StaticText(self, -1, _(text) + u":") grid.Add(self.label, (0, 0), flag=wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT) self.find = wx.TextCtrl(self, -1, size=(-1,-1), style=wx.TE_PROCESS_ENTER) grid.Add(self.find, (0, 1), flag=wx.EXPAND) self.replace = wx.TextCtrl(self, -1, size=(-1,-1), style=wx.TE_PROCESS_ENTER) grid.Add(self.replace, (1, 1), flag=wx.EXPAND) # Windows doesn't process char events through a real button, so we use # this fake button as a label and process events through it. It's # added here so that it will be last in the tab order. self.command = FakeButton(self, -1, _("Replace with") + u":") grid.Add(self.command, (1, 0), flag=wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT) grid.AddGrowableCol(1) self.SetSizer(grid) self.find.Bind(wx.EVT_TEXT_ENTER, self.OnTabToReplace) self.find.Bind(wx.EVT_SET_FOCUS, self.OnFindSetFocus) self.replace.Bind(wx.EVT_TEXT_ENTER, self.OnTabToCommand) self.replace.Bind(wx.EVT_KILL_FOCUS, self.OnTabToCommand) self.replace.Bind(wx.EVT_SET_FOCUS, self.OnReplaceSetFocus) self.command.Bind(wx.EVT_BUTTON, self.OnReplace) self.command.Bind(wx.EVT_KEY_DOWN, self.OnCommandKeyDown) self.command.Bind(wx.EVT_CHAR, self.OnCommandChar) self.command.Bind(wx.EVT_SET_FOCUS, self.OnSearchStart) self.command.Bind(wx.EVT_KILL_FOCUS, self.OnSearchStop)
7979c5d4597fb59573cf1b598e9b63ba1365f107 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11522/7979c5d4597fb59573cf1b598e9b63ba1365f107/find_replace.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 39, 313, 3251, 12, 2890, 4672, 977, 273, 365, 18, 3278, 18, 11565, 3068, 273, 7075, 18, 6313, 5013, 20512, 12, 22, 16, 576, 13, 365, 18, 1925, 273, 7075, 18, 5788, 1528, 12, 289...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 752, 39, 313, 3251, 12, 2890, 4672, 977, 273, 365, 18, 3278, 18, 11565, 3068, 273, 7075, 18, 6313, 5013, 20512, 12, 22, 16, 576, 13, 365, 18, 1925, 273, 7075, 18, 5788, 1528, 12, 289...
elif 'ping' in zeile['inhalt']: self.msg(zeile['ziel'],'%s: pong' % zeile['quelle']['nickname'])
self.log.log('Nachricht','%s <%s!%s@%s> %s' % (zeile['ziel'],zeile['quelle']['nickname'],zeile['quelle']['ident'],zeile['quelle']['host']," ".join(zeile['inhalt'])))
def on_PRIVMSG(self,zeile): '''bearbeitet eingehende Nachrichten''' if zeile['inhalt'][0].startswith(self.currentnickname) or zeile['ziel'] == self.currentnickname: # der bot wird entweder angesprochen oder er kriegt eine private message print 'DEBUG: Befehl aufgeschnappt' self._teile_befehl(zeile) # DEBUG elif 'ping' in zeile['inhalt']: self.msg(zeile['ziel'],'%s: pong' % zeile['quelle']['nickname']) print 'Nachricht von %s an %s: %s' % (zeile['quelle']['nickname'], zeile['ziel'], zeile['inhalt']) # Ende DEBUG
d1895b8c3cae4ec425f2295d072b6123a804a1b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2469/d1895b8c3cae4ec425f2295d072b6123a804a1b9/ircbot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 67, 7698, 58, 11210, 12, 2890, 16, 8489, 398, 4672, 9163, 29400, 2196, 305, 278, 425, 30391, 76, 275, 323, 423, 497, 1512, 647, 275, 26418, 309, 26637, 398, 3292, 267, 76, 2390, 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, 603, 67, 7698, 58, 11210, 12, 2890, 16, 8489, 398, 4672, 9163, 29400, 2196, 305, 278, 425, 30391, 76, 275, 323, 423, 497, 1512, 647, 275, 26418, 309, 26637, 398, 3292, 267, 76, 2390, 3...
if keys:
if random.random() < 0.2: mutate = 0 while 1: newkey = Horrid(random.randrange(100)) if newkey not in target: break target[newkey] = Horrid(random.randrange(100)) keys.append(newkey) mutate = 1 elif keys:
def maybe_mutate(): if not mutate: return if random.random() < 0.5: return if random.random() < 0.5: target, keys = dict1, dict1keys else: target, keys = dict2, dict2keys if keys: i = random.randrange(len(keys)) key = keys[i] del target[key] # CAUTION: don't use keys.remove(key) here. Or do <wink>. The # point is that .remove() would trigger more comparisons, and so # also more calls to this routine. We're mutating often enough # without that. del keys[i]
c8e05141603d1b4ecad016ff220ce5059a4422e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/c8e05141603d1b4ecad016ff220ce5059a4422e4/test_mutants.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6944, 67, 10735, 340, 13332, 309, 486, 15887, 30, 327, 309, 2744, 18, 9188, 1435, 411, 374, 18, 25, 30, 327, 309, 2744, 18, 9188, 1435, 411, 374, 18, 25, 30, 1018, 16, 1311, 273, 206...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6944, 67, 10735, 340, 13332, 309, 486, 15887, 30, 327, 309, 2744, 18, 9188, 1435, 411, 374, 18, 25, 30, 327, 309, 2744, 18, 9188, 1435, 411, 374, 18, 25, 30, 1018, 16, 1311, 273, 206...
ng = dict(obj.pool.get(self._obj).name_get(cr, uid, ids, context=context))
ng = dict(obj.pool.get(self._obj).name_get(cr, 1, ids, context=context))
def _fnct_read(self, obj, cr, uid, ids, field_name, args, context=None): self._field_get2(cr, uid, obj, context) if not ids: return {} relation = obj._name res = {}.fromkeys(ids, False)
419149d36b644c2d429137c1333f8ac7f7a182e4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/419149d36b644c2d429137c1333f8ac7f7a182e4/fields.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4293, 299, 67, 896, 12, 2890, 16, 1081, 16, 4422, 16, 4555, 16, 3258, 16, 652, 67, 529, 16, 833, 16, 819, 33, 7036, 4672, 365, 6315, 1518, 67, 588, 22, 12, 3353, 16, 4555, 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, 389, 4293, 299, 67, 896, 12, 2890, 16, 1081, 16, 4422, 16, 4555, 16, 3258, 16, 652, 67, 529, 16, 833, 16, 819, 33, 7036, 4672, 365, 6315, 1518, 67, 588, 22, 12, 3353, 16, 4555, 16,...
<dd><a href="addexistingfield?colID=%s&amp;ln=%s&amp;fmeth=seo
<dd><a href="addexistingfield?colID=%s&amp;ln=%s&amp;fmeth=seo
def perform_showsearchoptions(colID, ln=cdslang, callback='yes', content='', confirm=-1): """show the sort and search options of this collection..""" colID = int(colID) col_dict = dict(get_def_name('', "collection")) fld_dict = dict(get_def_name('', "field")) fld_type = get_sort_nametypes() subtitle = """<a name="7">7. Modify search options for collection '%s'</a>&nbsp;&nbsp&nbsp;<small>[<a title="See guide" href="%s/admin/websearch/guide.html#3.7">?</a>]</small>""" % (col_dict[colID], weburl) output = """<dl> <dt>Field actions (not related to this collection)</dt> <dd>Go to the BibIndex interface to modify</dd> <dt>Collection specific actions <dd><a href="addexistingfield?colID=%s&amp;ln=%s&amp;fmeth=seo#7.2">Add field to collection</a></dd> </dl> """ % (colID, ln) header = ['', 'Fieldname', '', 'Fieldvalue', 'Actions'] actions = [] cdslang = get_languages() lang = dict(cdslang) fld_type_list = fld_type.items() fld_distinct= run_sql("SELECT distinct(id_field) FROM collection_field_fieldvalue WHERE type='seo' AND id_collection=%s ORDER by score desc" % colID) if len(fld_distinct) > 0: i = 0 for (id) in fld_distinct: col_fld = get_col_fld(colID, 'seo', id) #move = """<table cellspacing="1" cellpadding="0" border="0"><tr><td>""" move = "" if i != 0: move += """<a href="%s/admin/websearch/websearchadmin.py/switchfldscore?colID=%s&amp;ln=%s&amp;id_1=%s&amp;id_2=%s&amp;fmeth=seo&amp;rand=%s#7"><img border="0" src="%s/img/smallup.gif" title="Move up"></a>""" % (weburl, colID, ln, id[0], fld_distinct[i - 1][0], random.randint(0, 1000), weburl) else: move += "&nbsp;&nbsp;&nbsp;" #move += "</td><td>" i += 1 if i != len(fld_distinct): move += '<a href="%s/admin/websearch/websearchadmin.py/switchfldscore?colID=%s&amp;ln=%s&amp;id_1=%s&amp;id_2=%s&amp;fmeth=seo&amp;rand=%s#7"><img border="0" src="%s/img/smalldown.gif" title="Move down"></a>' % (weburl, colID, ln, id[0], fld_distinct[i][0], random.randint(0, 1000), weburl) #move += """</td></tr></table>""" j = 0 for (fldID, fldvID, stype, score, score_fieldvalue) in col_fld: fieldvalue = get_fld_value(fldvID) #move2 = """<table cellspacing="1" cellpadding="0" border="0"><tr><td>""" move2 = "" if j != 0: move2 += """<a href="%s/admin/websearch/websearchadmin.py/switchfldvaluescore?colID=%s&amp;ln=%s&amp;id_1=%s&amp;id_fldvalue_1=%s&amp;id_fldvalue_2=%s&amp;rand=%s#7"><img border="0" src="%s/img/smallup.gif" title="Move up"></a>""" % (weburl, colID, ln, id[0], fldvID, col_fld[j - 1][1], random.randint(0, 1000), weburl) else: move2 += "&nbsp;&nbsp;&nbsp;" #move2 += "</td><td>" j += 1 if j != len(col_fld): move2 += """<a href="%s/admin/websearch/websearchadmin.py/switchfldvaluescore?colID=%s&amp;ln=%s&amp;id_1=%s&amp;id_fldvalue_1=%s&amp;id_fldvalue_2=%s&amp;rand=%s#7"><img border="0" src="%s/img/smalldown.gif" title="Move down"></a>""" % (weburl, colID, ln, id[0], fldvID, col_fld[j][1], random.randint(0, 1000), weburl) #move2 += """</td></tr></table>""" if fieldvalue[0][1] != fieldvalue[0][2]: actions.append([move, "%s" % (j==1 and fld_dict[int(fldID)] or '&nbsp'), move2, "%s - %s" % (fieldvalue[0][1],fieldvalue[0][2])]) else: actions.append([move, "%s" % (j==1 and fld_dict[int(fldID)] or '&nbsp;'), move2, "%s" % fieldvalue[0][1]]) move = '' for col in [(('Remove', 'removefield'),)]: actions[-1].append('<a href="%s/admin/websearch/websearchadmin.py/%s?colID=%s&amp;ln=%s&amp;fldID=%s&amp;fldvID=%s&amp;fmeth=seo#7.4">%s</a>' % (weburl, col[0][1], colID, ln, fldID, fldvID, col[0][0])) for (str, function) in col[1:]: actions[-1][-1] += ' / <a href="%s/admin/websearch/websearchadmin.py/%s?colID=%s&amp;ln=%s&amp;fldID=%s#7.5">%s</a>' % (weburl, function, colID, ln, fldID, fldvID, str) output += tupletotable(header=header, tuple=actions) else: output += """No search options exists for this collection""" output += content try: body = [output, extra] except NameError: body = [output] if callback: return perform_editcollection(colID, ln, "perform_showsearchoptions", addadminbox(subtitle, body)) else: return addadminbox(subtitle, body)
e02bf14cfa93e6c83692292855ee97a11d40e01d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/e02bf14cfa93e6c83692292855ee97a11d40e01d/websearchadminlib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3073, 67, 4500, 3072, 2116, 12, 1293, 734, 16, 7211, 33, 4315, 2069, 539, 16, 1348, 2218, 9707, 2187, 913, 2218, 2187, 6932, 29711, 21, 4672, 3536, 4500, 326, 1524, 471, 1623, 702, 434, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4500, 3072, 2116, 12, 1293, 734, 16, 7211, 33, 4315, 2069, 539, 16, 1348, 2218, 9707, 2187, 913, 2218, 2187, 6932, 29711, 21, 4672, 3536, 4500, 326, 1524, 471, 1623, 702, 434, ...
exts.append( Extension('math', ['mathmodule.c'], libraries=['m']) )
exts.append( Extension('math', ['mathmodule.c'], libraries=math_libs) )
def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.append('/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.append( '/usr/local/include' )
11034073929bf044934131deb7329e1114ab6230 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/11034073929bf044934131deb7329e1114ab6230/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5966, 67, 6400, 12, 2890, 4672, 468, 7693, 716, 342, 13640, 19, 3729, 353, 3712, 1399, 309, 1173, 13640, 19, 3729, 19, 2941, 11, 486, 316, 365, 18, 9576, 18, 12083, 67, 8291, 30, 365, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5966, 67, 6400, 12, 2890, 4672, 468, 7693, 716, 342, 13640, 19, 3729, 353, 3712, 1399, 309, 1173, 13640, 19, 3729, 19, 2941, 11, 486, 316, 365, 18, 9576, 18, 12083, 67, 8291, 30, 365, ...
if l1[0] > l2[0]: lim[0] = l2[0] else: lim[0] = l1[0] if l1[1] < l2[1]: lim[1] = l2[1] else: lim[1] = l1[1]
if l1[0] > l2[0]: lim[0] = l2[0] else: lim[0] = l1[0] if l1[1] < l2[1]: lim[1] = l2[1] else: lim[1] = l1[1]
def _check_lim(self, l1, l2): """Return a tuple with the "larger" values of 'l1' and 'l2'.""" lim = [None]*2 if l1[0] > l2[0]: lim[0] = l2[0] else: lim[0] = l1[0] if l1[1] < l2[1]: lim[1] = l2[1] else: lim[1] = l1[1] return tuple(lim)
c8ea790ab23e6d82a1828cb8b3aa7a907ce1cb8d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4727/c8ea790ab23e6d82a1828cb8b3aa7a907ce1cb8d/common.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1893, 67, 7091, 12, 2890, 16, 328, 21, 16, 328, 22, 4672, 3536, 990, 279, 3193, 598, 326, 315, 7901, 693, 6, 924, 434, 296, 80, 21, 11, 471, 296, 80, 22, 11, 12123, 20167, 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, 389, 1893, 67, 7091, 12, 2890, 16, 328, 21, 16, 328, 22, 4672, 3536, 990, 279, 3193, 598, 326, 315, 7901, 693, 6, 924, 434, 296, 80, 21, 11, 471, 296, 80, 22, 11, 12123, 20167, 273...
self.health = health
self.health = gdata.health.service.HealthService() self.health.ClientLogin(username, password, source='Health Client Unit Tests')
def setUp(self): self.health = health self.profile_list_feed = self.health.GetProfileListFeed()
4b0039babc7592f2056fec24dc1589bad7422090 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10620/4b0039babc7592f2056fec24dc1589bad7422090/service_test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24292, 12, 2890, 4672, 365, 18, 13267, 273, 314, 892, 18, 13267, 18, 3278, 18, 7802, 1179, 1435, 365, 18, 13267, 18, 1227, 5358, 12, 5053, 16, 2201, 16, 1084, 2218, 7802, 2445, 8380, 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, 24292, 12, 2890, 4672, 365, 18, 13267, 273, 314, 892, 18, 13267, 18, 3278, 18, 7802, 1179, 1435, 365, 18, 13267, 18, 1227, 5358, 12, 5053, 16, 2201, 16, 1084, 2218, 7802, 2445, 8380, 7...
def targetDev(self, doc, type, path, bus):
def targetDev(self, doc, devicetype, path, bus):
def targetDev(self, doc, type, path, bus): installNode = doc.createElement("disk") installNode.setAttribute("type", "file") installNode.setAttribute("device", type) sourceInstallNode = doc.createElement("source") sourceInstallNode.setAttribute("file", path) installNode.appendChild(sourceInstallNode) targetInstallNode = doc.createElement("target") targetInstallNode.setAttribute("dev", bus) installNode.appendChild(targetInstallNode) return installNode
1f0323a18ecdf94f3b3336d1df235fcd65c18c27 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14184/1f0323a18ecdf94f3b3336d1df235fcd65c18c27/Guest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1018, 8870, 12, 2890, 16, 997, 16, 4461, 335, 5872, 16, 589, 16, 5766, 4672, 3799, 907, 273, 997, 18, 2640, 1046, 2932, 10863, 7923, 3799, 907, 18, 542, 1499, 2932, 723, 3113, 315, 768...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1018, 8870, 12, 2890, 16, 997, 16, 4461, 335, 5872, 16, 589, 16, 5766, 4672, 3799, 907, 273, 997, 18, 2640, 1046, 2932, 10863, 7923, 3799, 907, 18, 542, 1499, 2932, 723, 3113, 315, 768...
testf.write(data)
if DEBUG: testf.write(data)
def write(self, data):
0fc14771c0c0be4db25ab4f7abd742618289c23f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0fc14771c0c0be4db25ab4f7abd742618289c23f/binhex.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 12, 2890, 16, 501, 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, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 12, 2890, 16, 501, 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, -100, -100...
if has_qemu_dir and not has_kvm_dir:
if has_qemu_dir:
def check_kvm_source_dir(source_dir): """ Inspects the kvm source directory and verifies its disposition. In some occasions build may be dependant on the source directory disposition. The reason why the return codes are numbers is that we might have more changes on the source directory layout, so it's not scalable to just use strings like 'old_repo', 'new_repo' and such. @param source_dir: Source code path that will be inspected. """ os.chdir(source_dir) has_qemu_dir = os.path.isdir('qemu') has_kvm_dir = os.path.isdir('kvm') if has_qemu_dir and not has_kvm_dir: logging.debug("qemu directory detected, source dir layout 1") return 1 if has_kvm_dir and not has_qemu_dir: logging.debug("kvm directory detected, source dir layout 2") return 2 else: raise error.TestError("Unknown source dir layout, cannot proceed.")
bc4a73526d23eba1162c99081d59998b81340886 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10349/bc4a73526d23eba1162c99081d59998b81340886/kvm_utils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 79, 3489, 67, 3168, 67, 1214, 12, 3168, 67, 1214, 4672, 3536, 20045, 87, 326, 417, 3489, 1084, 1867, 471, 20761, 2097, 23913, 18, 657, 2690, 9145, 345, 1115, 1361, 2026, 506, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 866, 67, 79, 3489, 67, 3168, 67, 1214, 12, 3168, 67, 1214, 4672, 3536, 20045, 87, 326, 417, 3489, 1084, 1867, 471, 20761, 2097, 23913, 18, 657, 2690, 9145, 345, 1115, 1361, 2026, 506, ...
proc = subprocess.Popen(['git'] + command, stdout=subprocess.PIPE)
shell = (os.name == 'nt') proc = subprocess.Popen(['git'] + command, shell=shell, stdout=subprocess.PIPE)
def RunGit(command): """Run a git subcommand, returning its output.""" proc = subprocess.Popen(['git'] + command, stdout=subprocess.PIPE) return proc.communicate()[0].strip()
8f8fb009a751210801955a262947ef90817a2f61 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/8f8fb009a751210801955a262947ef90817a2f61/sync-webkit-git.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1939, 11540, 12, 3076, 4672, 3536, 1997, 279, 5071, 18856, 16, 5785, 2097, 876, 12123, 225, 5972, 273, 261, 538, 18, 529, 422, 296, 496, 6134, 5418, 273, 6652, 18, 52, 3190, 12, 3292, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1939, 11540, 12, 3076, 4672, 3536, 1997, 279, 5071, 18856, 16, 5785, 2097, 876, 12123, 225, 5972, 273, 261, 538, 18, 529, 422, 296, 496, 6134, 5418, 273, 6652, 18, 52, 3190, 12, 3292, ...
str = string.replace (str, '}', ')s') str = string.replace (str, '$', '%') return str if prefix <> '@' + 'prefix@': exec_prefix = interpolate (exec_prefix) % vars() datadir = os.path.join (interpolate (datadir) % vars() , 'mftrace') libdir = interpolate (libdir) % vars()
str = string.replace (str, '}', ')s') str = string.replace (str, '$', '%') return str if prefix != '@' + 'prefix@': exec_prefix = interpolate (exec_prefix) % vars () datadir = os.path.join (interpolate (datadir) % vars (), 'mftrace') libdir = interpolate (libdir) % vars ()
def interpolate (str): str = string.replace (str, '{', '(') str = string.replace (str, '}', ')s') str = string.replace (str, '$', '%') return str
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13156, 261, 701, 4672, 609, 273, 533, 18, 2079, 261, 701, 16, 2292, 2187, 7321, 13, 609, 273, 533, 18, 2079, 261, 701, 16, 9571, 16, 8624, 87, 6134, 609, 273, 533, 18, 2079, 261, 701...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13156, 261, 701, 4672, 609, 273, 533, 18, 2079, 261, 701, 16, 2292, 2187, 7321, 13, 609, 273, 533, 18, 2079, 261, 701, 16, 9571, 16, 8624, 87, 6134, 609, 273, 533, 18, 2079, 261, 701...
license=info.get('license', 'GPL-2'),
license='GPL-3',
def add_defaults(self): sdist.sdist.add_defaults(self) if self.distribution.has_pure_modules(): build_py = self.get_finalized_command('build_py') data = [] for package in build_py.packages: src_dir = build_py.get_package_dir(package) data.extend(build_py.find_data_files(package, src_dir)) self.filelist.extend(data)
57bc8b5b859c01af5a0e3e2e5b6784d1803735dd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/534/57bc8b5b859c01af5a0e3e2e5b6784d1803735dd/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 7606, 12, 2890, 4672, 272, 4413, 18, 87, 4413, 18, 1289, 67, 7606, 12, 2890, 13, 309, 365, 18, 16279, 18, 5332, 67, 84, 594, 67, 6400, 13332, 1361, 67, 2074, 273, 365, 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, 527, 67, 7606, 12, 2890, 4672, 272, 4413, 18, 87, 4413, 18, 1289, 67, 7606, 12, 2890, 13, 309, 365, 18, 16279, 18, 5332, 67, 84, 594, 67, 6400, 13332, 1361, 67, 2074, 273, 365, 18, ...
document.body[j : j+4] = substj
document.body[j:j + 4] = substj
def revert_vphantom(document): " Reverts vphantom to ERT " i = 0 j = 0 while True: i = find_token(document.body, "\\begin_inset Phantom VPhantom", i) if i == -1: return substi = document.body[i].replace('\\begin_inset Phantom VPhantom', \ '\\begin_inset ERT\nstatus collapsed\n\n' \ '\\begin_layout Plain Layout\n\n\n\\backslash\n' \ 'vphantom{\n\\end_layout\n\n\\end_inset\n') substi = substi.split('\n') document.body[i : i+4] = substi i += len(substi) j = find_token(document.body, "\\end_layout", i) if j == -1: document.warning("Malformed LyX document: Could not find end of VPhantom inset.") return substj = document.body[j].replace('\\end_layout', \ '\\size default\n\n\\begin_inset ERT\nstatus collapsed\n\n' \ '\\begin_layout Plain Layout\n\n' \ '}\n\\end_layout\n\n\\end_inset\n') substj = substj.split('\n') document.body[j : j+4] = substj i += len(substj)
bcd8b9a1f1241c461beb5db1d5a69424a9a25950 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7514/bcd8b9a1f1241c461beb5db1d5a69424a9a25950/lyx_2_0.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15226, 67, 90, 844, 16317, 12, 5457, 4672, 315, 868, 31537, 331, 844, 16317, 358, 4232, 56, 315, 277, 273, 374, 525, 273, 374, 1323, 1053, 30, 277, 273, 1104, 67, 2316, 12, 5457, 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, 15226, 67, 90, 844, 16317, 12, 5457, 4672, 315, 868, 31537, 331, 844, 16317, 358, 4232, 56, 315, 277, 273, 374, 525, 273, 374, 1323, 1053, 30, 277, 273, 1104, 67, 2316, 12, 5457, 18, ...
def submitPilotsForTaskQueue(self, taskQueueDict, waitingPilots ):
def submitPilotsForTaskQueue( self, taskQueueDict, waitingPilots ):
def submitPilotsForTaskQueue(self, taskQueueDict, waitingPilots ):
2167c40fe092d0205e599c452b700e4f2aaec45c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/2167c40fe092d0205e599c452b700e4f2aaec45c/TaskQueueDirector.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4879, 52, 330, 6968, 1290, 2174, 3183, 12, 2890, 16, 1562, 3183, 5014, 16, 7336, 52, 330, 6968, 262, 30, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4879, 52, 330, 6968, 1290, 2174, 3183, 12, 2890, 16, 1562, 3183, 5014, 16, 7336, 52, 330, 6968, 262, 30, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if job.is_example:
if job.is_example or job.is_pyexample:
def run_tests(): # # Run waf to make sure that everything is built, configured and ready to go # unless we are explicitly told not to. We want to be careful about causing # our users pain while waiting for extraneous stuff to compile and link, so # we allow users that know what they''re doing to not invoke waf at all. # if not options.nowaf: # # If the user is running the "kinds" or "list" options, there is an # implied dependency on the test-runner since we call that program # if those options are selected. We will exit after processing those # options, so if we see them, we can safely only build the test-runner. # # If the user has constrained us to running only a particular type of # file, we can only ask waf to build what we know will be necessary. # For example, if the user only wants to run BVT tests, we only have # to build the test-runner and can ignore all of the examples. # # If the user only wants to run a single example, then we can just build # that example. # # If there is no constraint, then we have to build everything since the # user wants to run everything. # if options.kinds or options.list or (len(options.constrain) and options.constrain in core_kinds): if sys.platform == "win32": waf_cmd = "waf --target=test-runner" else: waf_cmd = "./waf --target=test-runner" elif len(options.example): if sys.platform == "win32": waf_cmd = "waf --target=%s" % os.path.basename(options.example) else: waf_cmd = "./waf --target=%s" % os.path.basename(options.example) else: if sys.platform == "win32": waf_cmd = "waf" else: waf_cmd = "./waf" if options.verbose: print "Building: %s" % waf_cmd proc = subprocess.Popen(waf_cmd, shell = True) proc.communicate() # # Pull some interesting configuration information out of waf, primarily # so we can know where executables can be found, but also to tell us what # pieces of the system have been built. This will tell us what examples # are runnable. # read_waf_active_variant() read_waf_config() make_library_path() # # If lots of logging is enabled, we can crash Python when it tries to # save all of the text. We just don't allow logging to be turned on when # test.py runs. If you want to see logging output from your tests, you # have to run them using the test-runner directly. # os.environ["NS_LOG"] = "" # # There are a couple of options that imply we can to exit before starting # up a bunch of threads and running tests. Let's detect these cases and # handle them without doing all of the hard work. # if options.kinds: path_cmd = os.path.join("utils", "test-runner --kinds") (rc, standard_out, standard_err, et) = run_job_synchronously(path_cmd, os.getcwd(), False, False) print standard_out if options.list: path_cmd = os.path.join("utils", "test-runner --list") (rc, standard_out, standard_err, et) = run_job_synchronously(path_cmd, os.getcwd(), False, False) print standard_out if options.kinds or options.list: return # # We communicate results in two ways. First, a simple message relating # PASS, FAIL, CRASH or SKIP is always written to the standard output. It # is expected that this will be one of the main use cases. A developer can # just run test.py with no options and see that all of the tests still # pass. # # The second main use case is when detailed status is requested (with the # --text or --html options). Typicall this will be text if a developer # finds a problem, or HTML for nightly builds. In these cases, an # XML file is written containing the status messages from the test suites. # This file is then read and translated into text or HTML. It is expected # that nobody will really be interested in the XML, so we write it somewhere # with a unique name (time) to avoid collisions. In case an error happens, we # provide a runtime option to retain the temporary files. # # When we run examples as smoke tests, they are going to want to create # lots and lots of trace files. We aren't really interested in the contents # of the trace files, so we also just stash them off in the temporary dir. # The retain option also causes these unchecked trace files to be kept. # date_and_time = time.strftime("%Y-%m-%d-%H-%M-%S-CUT", time.gmtime()) if not os.path.exists(TMP_OUTPUT_DIR): os.makedirs(TMP_OUTPUT_DIR) testpy_output_dir = os.path.join(TMP_OUTPUT_DIR, date_and_time); if not os.path.exists(testpy_output_dir): os.makedirs(testpy_output_dir) # # Create the main output file and start filling it with XML. We need to # do this since the tests will just append individual results to this file. # xml_results_file = os.path.join(testpy_output_dir, "results.xml") f = open(xml_results_file, 'w') f.write('<?xml version="1.0"?>\n') f.write('<TestResults>\n') f.close() # # We need to figure out what test suites to execute. We are either given one # suite or example explicitly via the --suite or --example/--pyexample option, # or we need to call into the test runner and ask it to list all of the available # test suites. Further, we need to provide the constraint information if it # has been given to us. # # This translates into allowing the following options with respect to the # suites # # ./test,py: run all of the suites and examples # ./test.py --constrain=core: run all of the suites of all kinds # ./test.py --constrain=unit: run all unit suites # ./test,py --suite=some-test-suite: run a single suite # ./test,py --example=udp/udp-echo: run no test suites # ./test,py --pyexample=wireless/mixed-wireless.py: run no test suites # ./test,py --suite=some-suite --example=some-example: run the single suite # # We can also use the --constrain option to provide an ordering of test # execution quite easily. # if len(options.suite): suites = options.suite + "\n" elif len(options.example) == 0 and len(options.pyexample) == 0: if len(options.constrain): path_cmd = os.path.join("utils", "test-runner --list --constrain=%s" % options.constrain) (rc, suites, standard_err, et) = run_job_synchronously(path_cmd, os.getcwd(), False, False) else: path_cmd = os.path.join("utils", "test-runner --list") (rc, suites, standard_err, et) = run_job_synchronously(path_cmd, os.getcwd(), False, False) else: suites = "" # # suite_list will either a single test suite name that the user has # indicated she wants to run or a list of test suites provided by # the test-runner possibly according to user provided constraints. # We go through the trouble of setting up the parallel execution # even in the case of a single suite to avoid having two process the # results in two different places. # suite_list = suites.split('\n') # # We now have a possibly large number of test suites to run, so we want to # run them in parallel. We're going to spin up a number of worker threads # that will run our test jobs for us. # input_queue = Queue.Queue(0) output_queue = Queue.Queue(0) jobs = 0 threads=[] # # In Python 2.6 you can just use multiprocessing module, but we don't want # to introduce that dependency yet; so we jump through a few hoops. # processors = 1 if sys.platform != "win32": if 'SC_NPROCESSORS_ONLN'in os.sysconf_names: processors = os.sysconf('SC_NPROCESSORS_ONLN') else: proc = subprocess.Popen("sysctl -n hw.ncpu", shell = True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout_results, stderr_results = proc.communicate() if len(stderr_results) == 0: processors = int(stdout_results) # # Now, spin up one thread per processor which will eventually mean one test # per processor running concurrently. # for i in range(processors): thread = worker_thread(input_queue, output_queue) threads.append(thread) thread.start() # # Keep track of some summary statistics # total_tests = 0 skipped_tests = 0 # # We now have worker threads spun up, and a list of work to do. So, run # through the list of test suites and dispatch a job to run each one. # # Dispatching will run with unlimited speed and the worker threads will # execute as fast as possible from the queue. # # Note that we actually dispatch tests to be skipped, so all of the # PASS, FAIL, CRASH and SKIP processing is done in the same place. # for test in suite_list: test = test.strip() if len(test): job = Job() job.set_is_example(False) job.set_is_pyexample(False) job.set_display_name(test) job.set_tmp_file_name(os.path.join(testpy_output_dir, "%s.xml" % test)) job.set_cwd(os.getcwd()) job.set_basedir(os.getcwd()) job.set_tempdir(testpy_output_dir) if (options.multiple): multiple = " --multiple" else: multiple = "" path_cmd = os.path.join("utils", "test-runner --suite=%s%s" % (test, multiple)) job.set_shell_command(path_cmd) if options.valgrind and test in core_valgrind_skip_tests: job.set_is_skip(True) if options.verbose: print "Queue %s" % test input_queue.put(job) jobs = jobs + 1 total_tests = total_tests + 1 # # We've taken care of the discovered or specified test suites. Now we # have to deal with examples run as smoke tests. We have a list of all of # the example programs it makes sense to try and run. Each example will # have a condition associated with it that must evaluate to true for us # to try and execute it. This is used to determine if the example has # a dependency that is not satisfied. For example, if an example depends # on NSC being configured by waf, that example should have a condition # that evaluates to true if NSC is enabled. For example, # # ("tcp-nsc-zoo", "ENABLE_NSC == True"), # # In this case, the example "tcp-nsc-zoo" will only be run if we find the # waf configuration variable "ENABLE_NSC" to be True. # # We don't care at all how the trace files come out, so we just write them # to a single temporary directory. # # XXX As it stands, all of the trace files have unique names, and so file # collisions can only happen if two instances of an example are running in # two versions of the test.py process concurrently. We may want to create # uniquely named temporary traces directories to avoid this problem. # # We need to figure out what examples to execute. We are either given one # suite or example explicitly via the --suite or --example option, or we # need to walk the list of examples looking for available example # conditions. # # This translates into allowing the following options with respect to the # suites # # ./test,py: run all of the examples # ./test.py --constrain=unit run no examples # ./test.py --constrain=example run all of the examples # ./test.py --suite=some-test-suite: run no examples # ./test.py --example=some-example: run the single example # ./test.py --suite=some-suite --example=some-example: run the single example # # XXX could use constrain to separate out examples used for performance # testing # if len(options.suite) == 0 and len(options.example) == 0 and len(options.pyexample) == 0: if len(options.constrain) == 0 or options.constrain == "example": if ENABLE_EXAMPLES: for test, do_run, do_valgrind_run in example_tests: if eval(do_run): job = Job() job.set_is_example(True) job.set_is_pyexample(False) job.set_display_name(test) job.set_tmp_file_name("") job.set_cwd(testpy_output_dir) job.set_basedir(os.getcwd()) job.set_tempdir(testpy_output_dir) job.set_shell_command("examples/%s" % test) if options.valgrind and not eval(do_valgrind_run): job.set_is_skip (True) if options.verbose: print "Queue %s" % test input_queue.put(job) jobs = jobs + 1 total_tests = total_tests + 1 elif len(options.example): # # If you tell me to run an example, I will try and run the example # irrespective of any condition. # job = Job() job.set_is_example(True) job.set_is_pyexample(False) job.set_display_name(options.example) job.set_tmp_file_name("") job.set_cwd(testpy_output_dir) job.set_basedir(os.getcwd()) job.set_tempdir(testpy_output_dir) job.set_shell_command("examples/%s" % options.example) if options.verbose: print "Queue %s" % options.example input_queue.put(job) jobs = jobs + 1 total_tests = total_tests + 1 # # Run some Python examples as smoke tests. We have a list of all of # the example programs it makes sense to try and run. Each example will # have a condition associated with it that must evaluate to true for us # to try and execute it. This is used to determine if the example has # a dependency that is not satisfied. # # We don't care at all how the trace files come out, so we just write them # to a single temporary directory. # # We need to figure out what python examples to execute. We are either # given one pyexample explicitly via the --pyexample option, or we # need to walk the list of python examples # # This translates into allowing the following options with respect to the # suites # # ./test.py --constrain=pyexample run all of the python examples # ./test.py --pyexample=some-example.py: run the single python example # if len(options.suite) == 0 and len(options.example) == 0 and len(options.pyexample) == 0: if len(options.constrain) == 0 or options.constrain == "pyexample": if ENABLE_EXAMPLES: for test, do_run in python_tests: if eval(do_run): job = Job() job.set_is_example(False) job.set_is_pyexample(True) job.set_display_name(test) job.set_tmp_file_name("") job.set_cwd(testpy_output_dir) job.set_basedir(os.getcwd()) job.set_tempdir(testpy_output_dir) job.set_shell_command("examples/%s" % test) if options.valgrind and not eval(do_valgrind_run): job.set_is_skip (True) if options.verbose: print "Queue %s" % test input_queue.put(job) jobs = jobs + 1 total_tests = total_tests + 1 elif len(options.pyexample): # # If you tell me to run a python example, I will try and run the example # irrespective of any condition. # job = Job() job.set_is_pyexample(True) job.set_display_name(options.pyexample) job.set_tmp_file_name("") job.set_cwd(testpy_output_dir) job.set_basedir(os.getcwd()) job.set_tempdir(testpy_output_dir) job.set_shell_command("examples/%s" % options.pyexample) if options.verbose: print "Queue %s" % options.pyexample input_queue.put(job) jobs = jobs + 1 total_tests = total_tests + 1 # # Tell the worker threads to pack up and go home for the day. Each one # will exit when they see their is_break task. # for i in range(processors): job = Job() job.set_is_break(True) input_queue.put(job) # # Now all of the tests have been dispatched, so all we have to do here # in the main thread is to wait for them to complete. Keyboard interrupt # handling is broken as mentioned above. We use a signal handler to catch # sigint and set a global variable. When the worker threads sense this # they stop doing real work and will just start throwing jobs back at us # with is_break set to True. In this case, there are no real results so we # ignore them. If there are real results, we always print PASS or FAIL to # standard out as a quick indication of what happened. # passed_tests = 0 failed_tests = 0 crashed_tests = 0 valgrind_errors = 0 for i in range(jobs): job = output_queue.get() if job.is_break: continue if job.is_example: kind = "Example" elif job.is_pyexample: kind = "PythonExample" else: kind = "TestSuite" if job.is_skip: status = "SKIP" skipped_tests = skipped_tests + 1 else: if job.returncode == 0: status = "PASS" passed_tests = passed_tests + 1 elif job.returncode == 1: failed_tests = failed_tests + 1 status = "FAIL" elif job.returncode == 2: valgrind_errors = valgrind_errors + 1 status = "VALGR" else: crashed_tests = crashed_tests + 1 status = "CRASH" print "%s: %s %s" % (status, kind, job.display_name) if job.is_example or job.is_pyexample: # # Examples are the odd man out here. They are written without any # knowledge that they are going to be run as a test, so we need to # cook up some kind of output for them. We're writing an xml file, # so we do some simple XML that says we ran the example. # # XXX We could add some timing information to the examples, i.e. run # them through time and print the results here. # f = open(xml_results_file, 'a') f.write('<Example>\n') example_name = " <Name>%s</Name>\n" % job.display_name f.write(example_name) if status == "PASS": f.write(' <Result>PASS</Result>\n') elif status == "FAIL": f.write(' <Result>FAIL</Result>\n') elif status == "VALGR": f.write(' <Result>VALGR</Result>\n') elif status == "SKIP": f.write(' <Result>SKIP</Result>\n') else: f.write(' <Result>CRASH</Result>\n') f.write(' <ElapsedTime>%.3f</ElapsedTime>\n' % job.elapsed_time) f.write('</Example>\n') f.close() else: # # If we're not running an example, we're running a test suite. # These puppies are running concurrently and generating output # that was written to a temporary file to avoid collisions. # # Now that we are executing sequentially in the main thread, we can # concatenate the contents of the associated temp file to the main # results file and remove that temp file. # # One thing to consider is that a test suite can crash just as # well as any other program, so we need to deal with that # possibility as well. If it ran correctly it will return 0 # if it passed, or 1 if it failed. In this case, we can count # on the results file it saved being complete. If it crashed, it # will return some other code, and the file should be considered # corrupt and useless. If the suite didn't create any XML, then # we're going to have to do it ourselves. # # Another issue is how to deal with a valgrind error. If we run # a test suite under valgrind and it passes, we will get a return # code of 0 and there will be a valid xml results file since the code # ran to completion. If we get a return code of 1 under valgrind, # the test case failed, but valgrind did not find any problems so the # test case return code was passed through. We will have a valid xml # results file here as well since the test suite ran. If we see a # return code of 2, this means that valgrind found an error (we asked # it to return 2 if it found a problem in run_job_synchronously) but # the suite ran to completion so there is a valid xml results file. # If the suite crashes under valgrind we will see some other error # return code (like 139). If valgrind finds an illegal instruction or # some other strange problem, it will die with its own strange return # code (like 132). However, if the test crashes by itself, not under # valgrind we will also see some other return code. # # If the return code is 0, 1, or 2, we have a valid xml file. If we # get another return code, we have no xml and we can't really say what # happened -- maybe the TestSuite crashed, maybe valgrind crashed due # to an illegal instruction. If we get something beside 0-2, we assume # a crash and fake up an xml entry. After this is all done, we still # need to indicate a valgrind error somehow, so we fake up an xml entry # with a VALGR result. Thus, in the case of a working TestSuite that # fails valgrind, we'll see the PASS entry for the working TestSuite # followed by a VALGR failing test suite of the same name. # if job.is_skip: f = open(xml_results_file, 'a') f.write("<TestSuite>\n") f.write(" <SuiteName>%s</SuiteName>\n" % job.display_name) f.write(' <SuiteResult>SKIP</SuiteResult>\n') f.write(' <SuiteTime>Execution times not available</SuiteTime>\n') f.write("</TestSuite>\n") f.close() else: if job.returncode == 0 or job.returncode == 1 or job.returncode == 2: f_to = open(xml_results_file, 'a') f_from = open(job.tmp_file_name) f_to.write(f_from.read()) f_to.close() f_from.close() else: f = open(xml_results_file, 'a') f.write("<TestSuite>\n") f.write(" <SuiteName>%s</SuiteName>\n" % job.display_name) f.write(' <SuiteResult>CRASH</SuiteResult>\n') f.write(' <SuiteTime>Execution times not available</SuiteTime>\n') f.write("</TestSuite>\n") f.close() if job.returncode == 2: f = open(xml_results_file, 'a') f.write("<TestSuite>\n") f.write(" <SuiteName>%s</SuiteName>\n" % job.display_name) f.write(' <SuiteResult>VALGR</SuiteResult>\n') f.write(' <SuiteTime>Execution times not available</SuiteTime>\n') f.write("</TestSuite>\n") f.close() # # We have all of the tests run and the results written out. One final # bit of housekeeping is to wait for all of the threads to close down # so we can exit gracefully. # for thread in threads: thread.join() # # Back at the beginning of time, we started the body of an XML document # since the test suites and examples were going to just write their # individual pieces. So, we need to finish off and close out the XML # document # f = open(xml_results_file, 'a') f.write('</TestResults>\n') f.close() # # Print a quick summary of events # print "%d of %d tests passed (%d passed, %d skipped, %d failed, %d crashed, %d valgrind errors)" % (passed_tests, total_tests, passed_tests, skipped_tests, failed_tests, crashed_tests, valgrind_errors) # # The last things to do are to translate the XML results file to "human # readable form" if the user asked for it (or make an XML file somewhere) # if len(options.html): translate_to_html(xml_results_file, options.html) if len(options.text): translate_to_text(xml_results_file, options.text) if len(options.xml): shutil.copyfile(xml_results_file, options.xml) # # If we have been asked to retain all of the little temporary files, we # don't delete tm. If we do delete the temporary files, delete only the # directory we just created. We don't want to happily delete any retained # directories, which will probably surprise the user. # if not options.retain: shutil.rmtree(testpy_output_dir) if passed_tests + skipped_tests == total_tests: return 0 # success else: return 1 # catchall for general errors
4cc7d2ad538b3047b6893fd8eec33132a07a6da5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11087/4cc7d2ad538b3047b6893fd8eec33132a07a6da5/test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 67, 16341, 13332, 468, 468, 1939, 24103, 358, 1221, 3071, 716, 7756, 353, 6650, 16, 4351, 471, 5695, 358, 1960, 468, 3308, 732, 854, 8122, 268, 1673, 486, 358, 18, 225, 1660, 2545,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 16341, 13332, 468, 468, 1939, 24103, 358, 1221, 3071, 716, 7756, 353, 6650, 16, 4351, 471, 5695, 358, 1960, 468, 3308, 732, 854, 8122, 268, 1673, 486, 358, 18, 225, 1660, 2545,...
error(GUI, "Authentication with wrong status %d", status)
wc.log.error(wc.LOG_GUI, "Authentication with wrong status %d", status)
def __init__ (self, client, url, form, protocol, clientheaders, status=200, msg=wc.i18n._('Ok'), localcontext=None, auth=''): """load a web configuration template and return response""" wc.log.debug(wc.LOG_GUI, "WebConfig %s %s", url, form) self.client = client # we pretend to be the server self.connected = True headers = wc.proxy.Headers.WcMessage() headers['Server'] = 'Proxy\r' if auth: if status==407: headers['Proxy-Authenticate'] = "%s\r"%auth elif status==401: headers['WWW-Authenticate'] = "%s\r"%auth else: error(GUI, "Authentication with wrong status %d", status) if status in [301,302]: headers['Location'] = clientheaders['Location'] gm = mimetypes.guess_type(url, None) if gm[0] is not None: ctype = gm[0] else: # note: index.html is appended to directories ctype = 'text/html' if ctype=='text/html': ctype += "; charset=iso-8859-1" headers['Content-Type'] = "%s\r"%ctype try: lang = wc.i18n.get_headers_lang(clientheaders) # get the template filename path, dirs, lang = get_template_url(url, lang) if path.endswith('.html'): fp = file(path) # get TAL context context, newstatus = \ get_context(dirs, form, localcontext, lang) if newstatus==401 and status!=newstatus: client.error(401, wc.i18n._("Authentication Required"), auth=wc.proxy.auth.get_challenges()) return # get translator translator = gettext.translation(wc.Name, wc.LocaleDir, [lang], fallback=True) #wc.log.debug(wc.LOG_GUI, "Using translator %s", translator.info()) # expand template data = expand_template(fp, context, translator=translator) else: fp = file(path, 'rb') data = fp.read() fp.close() except IOError: wc.log.exception(GUI, "Wrong path %r", url) # XXX this can actually lead to a maximum recursion # error when client.error caused the exception client.error(404, wc.i18n._("Not Found")) return except StandardError: # catch standard exceptions and report internal error wc.log.exception(GUI, "Template error") client.error(500, wc.i18n._("Internal Error")) return # not catched builtin exceptions are: # SystemExit, StopIteration and all warnings
2ef4c6c1b57c4985103d07d29bd5009196fb0026 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/2ef4c6c1b57c4985103d07d29bd5009196fb0026/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 261, 2890, 16, 1004, 16, 880, 16, 646, 16, 1771, 16, 1004, 2485, 16, 1267, 33, 6976, 16, 1234, 33, 27594, 18, 77, 2643, 82, 6315, 2668, 8809, 19899, 1191, 2472, 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, 261, 2890, 16, 1004, 16, 880, 16, 646, 16, 1771, 16, 1004, 2485, 16, 1267, 33, 6976, 16, 1234, 33, 27594, 18, 77, 2643, 82, 6315, 2668, 8809, 19899, 1191, 2472, 33, ...
sqlite_defines.append(('PYSQLITE_VERSION',
sqlite_defines.append(('PYSQLITE_VERSION',
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
e25005bba7396fd747cf8a1e8599dbd4d921ef70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e25005bba7396fd747cf8a1e8599dbd4d921ef70/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5966, 67, 6400, 12, 2890, 4672, 468, 7693, 716, 342, 13640, 19, 3729, 353, 3712, 1399, 527, 67, 1214, 67, 869, 67, 1098, 12, 2890, 18, 9576, 18, 12083, 67, 8291, 16, 1173, 13640, 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, 5966, 67, 6400, 12, 2890, 4672, 468, 7693, 716, 342, 13640, 19, 3729, 353, 3712, 1399, 527, 67, 1214, 67, 869, 67, 1098, 12, 2890, 18, 9576, 18, 12083, 67, 8291, 16, 1173, 13640, 19, ...
reference = [data]
messages.append(data)
def image(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine): reference = ''.join(arguments[0].split('\n')) if reference.find(' ') != -1: error = state_machine.reporter.error( 'Image URI contains whitespace.', nodes.literal_block(block_text, block_text), line=lineno) return [error] options['uri'] = reference if options.has_key('target'): block = states.escape2null(options['target']).splitlines() block = [line for line in block] target_type, data = state.parse_target(block, block_text, lineno) if target_type == 'refuri': reference = nodes.reference(refuri=data) elif target_type == 'refname': reference = nodes.reference( refname=data, name=whitespace_normalize_name(options['target'])) state.document.note_refname(reference) else: # malformed target reference = [data] # data is a system message del options['target'] else: reference = None image_node = nodes.image(block_text, **options) if reference: reference += image_node return [reference] else: return [image_node]
1ba9056850e3a0e11e8a87b1564ff10a4c248590 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/1ba9056850e3a0e11e8a87b1564ff10a4c248590/images.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1316, 12, 529, 16, 1775, 16, 702, 16, 913, 16, 7586, 16, 913, 67, 3348, 16, 1203, 67, 955, 16, 919, 16, 919, 67, 9149, 4672, 2114, 273, 875, 18, 5701, 12, 7099, 63, 20, 8009, 4939,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1316, 12, 529, 16, 1775, 16, 702, 16, 913, 16, 7586, 16, 913, 67, 3348, 16, 1203, 67, 955, 16, 919, 16, 919, 67, 9149, 4672, 2114, 273, 875, 18, 5701, 12, 7099, 63, 20, 8009, 4939,...
if game.state.galaxy[game.quadrant.x][game.quadrant.y].supernova:
if game.state.galaxy[game.quadrant.i][game.quadrant.j].supernova:
def destroybase(): "Code merges here for any commander destroying a starbase." # Not perfect, but will have to do # Handle case where base is in same quadrant as starship if game.battle == game.quadrant: game.state.chart[game.battle.x][game.battle.y].starbase = False game.quad[game.base.x][game.base.y] = IHDOT game.base.invalidate() newcnd() skip(1) prout(_("Spock- \"Captain, I believe the starbase has been destroyed.\"")) elif game.state.baseq and communicating(): # Get word via subspace radio announce() skip(1) prout(_("Lt. Uhura- \"Captain, Starfleet Command reports that")) proutn(_(" the starbase in Quadrant %s has been destroyed by") % game.battle) if game.isatb == 2: prout(_("the Klingon Super-Commander")) else: prout(_("a Klingon Commander")) game.state.chart[game.battle.x][game.battle.y].starbase = False # Remove Starbase from galaxy game.state.galaxy[game.battle.x][game.battle.y].starbase = False game.state.baseq = filter(lambda x: x != game.battle, game.state.baseq) if game.isatb == 2: # reinstate a commander's base attack game.battle = hold game.isatb = 0 else: game.battle.invalidate()
e67cf36a789c4ab1cd905a9a08e91d219395f538 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3176/e67cf36a789c4ab1cd905a9a08e91d219395f538/sst.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5546, 1969, 13332, 315, 1085, 19037, 2674, 364, 1281, 1296, 264, 5546, 310, 279, 10443, 1969, 1199, 468, 2288, 24746, 16, 1496, 903, 1240, 358, 741, 468, 5004, 648, 1625, 1026, 353, 316, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5546, 1969, 13332, 315, 1085, 19037, 2674, 364, 1281, 1296, 264, 5546, 310, 279, 10443, 1969, 1199, 468, 2288, 24746, 16, 1496, 903, 1240, 358, 741, 468, 5004, 648, 1625, 1026, 353, 316, ...
bygroups(using(this), Name.Function, using(this), Text, Punctuation),
bygroups(using(this), Name.Function, using(this), Text, Punctuation),
def get_tokens_unprocessed(self, text): scanner = Scanner(text, re.DOTALL | re.MULTILINE | re.IGNORECASE) stack = ['initial'] in_function_block = False in_property_block = False was_dot = False next_token_is_function = False next_token_is_property = False collect_labels = False block_labels = set() brace_balance = [0, 0]
6d740765ad3b421bfe5506b72a027edd5fab930f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6148/6d740765ad3b421bfe5506b72a027edd5fab930f/compiled.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 7860, 67, 318, 11005, 12, 2890, 16, 977, 4672, 7683, 273, 19074, 12, 955, 16, 283, 18, 17591, 4685, 571, 283, 18, 12845, 30690, 571, 283, 18, 20118, 13415, 13, 2110, 273, 1022...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 7860, 67, 318, 11005, 12, 2890, 16, 977, 4672, 7683, 273, 19074, 12, 955, 16, 283, 18, 17591, 4685, 571, 283, 18, 12845, 30690, 571, 283, 18, 20118, 13415, 13, 2110, 273, 1022...
SyntaxError: assignment to None (<doctest test.test_syntax[17]>, line 1)
SyntaxError: cannot assign to None (<doctest test.test_syntax[17]>, line 1)
>>> def f(*None):
7624238d763f3fd52cd4e4da642b98f27bae9a5c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/7624238d763f3fd52cd4e4da642b98f27bae9a5c/test_syntax.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 4080, 1652, 284, 30857, 7036, 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, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 4080, 1652, 284, 30857, 7036, 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, -100, -100, ...
dirs_to_verify = [ { 'path' : self.home_backup_dir, 'user' : 'root', 'group' : 'acl', 'access_acl' : "%s,%s,%s" % (acl_base, acl_admins_ro, acl_mask), 'default_acl' : "%s,%s,%s" % (acl_base, acl_admins_ro, acl_mask), 'content_acl' : ("%s,%s,%s" % (acl_base, acl_admins_ro, acl_mask)).replace('r-x', 'r--').replace('rwx', 'rw-'), }, { 'path' : self.home_archive_dir, 'user' : 'root', 'group' : 'acl', 'access_acl' : "%s,%s,%s" % (acl_base, acl_admins_rw, acl_mask), 'default_acl' : "%s,%s,%s" % (acl_base, acl_admins_rw, acl_mask), 'content_acl' : ("%s,%s,%s" % (acl_base, acl_admins_rw, acl_mask)).replace('r-x', 'r--').replace('rwx', 'rw-'), } ] fsapi.check_dirs_and_contents_perms_and_acls(dirs_to_verify, batch = True, allgroups = groups)
home_backup_dir_info['content_acl'] = ("%s,%s,%s" % (acl_base, acl_admins_ro, acl_mask) ).replace('r-x', 'r--').replace('rwx', 'rw-') home_archive_dir_info['content_acl'] = ("%s,%s,%s" % (acl_base, acl_admins_rw, acl_mask) ).replace('r-x', 'r--').replace('rwx', 'rw-') dirs_to_verify = [ home_backup_dir_info, home_archive_dir_info ] fsapi.check_dirs_and_contents_perms_and_acls(dirs_to_verify, batch = True, allgroups = groups)
def CheckBaseDirs(self, minimal = True, batch = False, auto_answer = None) : """Check and eventually repair default needed dirs."""
5f520867b3ef14a7fdba756665f78d5a9a2ce3de /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/5f520867b3ef14a7fdba756665f78d5a9a2ce3de/configuration.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2073, 2171, 9872, 12, 2890, 16, 16745, 273, 1053, 16, 2581, 273, 1083, 16, 3656, 67, 13490, 273, 599, 13, 294, 3536, 1564, 471, 18011, 20994, 805, 3577, 7717, 12123, 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, 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, 2073, 2171, 9872, 12, 2890, 16, 16745, 273, 1053, 16, 2581, 273, 1083, 16, 3656, 67, 13490, 273, 599, 13, 294, 3536, 1564, 471, 18011, 20994, 805, 3577, 7717, 12123, 2, -100, -100, -100,...
def __init__(self, declaration, expression, dictionary=None):
assign = None def __init__(self, declaration, expression=None, dictionary=None):
def end(self, stream): pass
5e421a432c25636bae1ab66c5082c7eefcc557d5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9696/5e421a432c25636bae1ab66c5082c7eefcc557d5/clauses.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 679, 12, 2890, 16, 1407, 4672, 1342, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 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, 679, 12, 2890, 16, 1407, 4672, 1342, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
, tool[ 'build_cmd' ]
, build_cmd
def build_if_needed( tool ): if os.path.exists( tool[ 'path' ] ): log( 'Found preinstalled "%s"; will use it.' % tool[ 'path' ] ) return log( 'Preinstalled "%s" is not found; building one...' % tool[ 'path' ] ) if os.path.exists( tool[ 'source_dir' ] ): log( 'Found "%s" source directory "%s"' % ( tool[ 'name' ], tool[ 'source_dir' ] ) ) log( 'Building "%s" (%s)...' % ( tool[ 'name'], tool[ 'build_cmd' ] ) ) utils.system( [ 'cd %s' % tool[ 'source_dir' ] , tool[ 'build_cmd' ] ] ) else: raise 'Could not find "%s" source directory "%s"' % ( tool[ 'name' ], tool[ 'source_dir' ] ) if not os.path.exists( tool[ 'build_path' ] ): raise 'Failed to find "%s" after build.' % tool[ 'build_path' ] log( '%s succesfully built in "%s" directory' % ( tool[ 'name' ], tool[ 'build_path' ] ) )
721f3c1635a59f0437a667ea20d069673fc24247 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7959/721f3c1635a59f0437a667ea20d069673fc24247/regression.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1361, 67, 430, 67, 17471, 12, 5226, 262, 30, 309, 1140, 18, 803, 18, 1808, 12, 5226, 63, 296, 803, 11, 308, 262, 30, 613, 12, 296, 2043, 675, 13435, 2213, 87, 14432, 903, 999, 518, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1361, 67, 430, 67, 17471, 12, 5226, 262, 30, 309, 1140, 18, 803, 18, 1808, 12, 5226, 63, 296, 803, 11, 308, 262, 30, 613, 12, 296, 2043, 675, 13435, 2213, 87, 14432, 903, 999, 518, ...
if r[2]['type'] in ('ir.actions.report.xml','ir.actions.act_window','ir.actions.wizard'): if r[2].has_key('groups_id'): groups = r[2]['groups_id'] if len(groups) > 0: group_ids = ','.join([ str(x) for x in r[2]['groups_id']]) cr.execute("select count(*) from res_groups_users_rel where gid in (%s) and uid='%s'" % (group_ids, uid)) gr_ids = cr.fetchall() if not gr_ids[0][0] > 0: res2.remove(r) if r[1]=='Menuitem' and not res2: raise osv.except_osv('Error !','You do not have the permission to perform this operation !!!')
if type(r[2])==type({}) and 'type' in r[2]: if r[2]['type'] in ('ir.actions.report.xml','ir.actions.act_window','ir.actions.wizard'): if r[2].has_key('groups_id'): groups = r[2]['groups_id'] if len(groups) > 0: group_ids = ','.join([ str(x) for x in r[2]['groups_id']]) cr.execute("select count(*) from res_groups_users_rel where gid in (%s) and uid='%s'" % (group_ids, uid)) gr_ids = cr.fetchall() if not gr_ids[0][0] > 0: res2.remove(r) if r[1]=='Menuitem' and not res2: raise osv.except_osv('Error !','You do not have the permission to perform this operation !!!')
def clean(x): for key in ('report_sxw_content', 'report_rml_content', 'report_sxw', 'report_rml', 'report_sxw_content_data', 'report_rml_content_data'): if key in x: del x[key] return x
27a6756dac2c233b788efe93b14145f1c376cbd0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7397/27a6756dac2c233b788efe93b14145f1c376cbd0/ir_values.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2721, 12, 92, 4672, 364, 498, 316, 7707, 6006, 67, 30319, 91, 67, 1745, 2187, 296, 6006, 67, 86, 781, 67, 1745, 2187, 296, 6006, 67, 30319, 91, 2187, 296, 6006, 67, 86, 781, 2187, 29...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2721, 12, 92, 4672, 364, 498, 316, 7707, 6006, 67, 30319, 91, 67, 1745, 2187, 296, 6006, 67, 86, 781, 67, 1745, 2187, 296, 6006, 67, 30319, 91, 2187, 296, 6006, 67, 86, 781, 2187, 29...
self.editor.refresh_words()
try: self.editor.refresh_words() except AttributeError: pass
def update_window(self): puzzle = self.puzzle_manager.current_puzzle if puzzle is None: self.set_title(u"Palabra") self.pop_status(constants.STATUS_GRID) else: status = puzzle.grid.determine_status(False) message = self.determine_status_message(status) self.update_status(constants.STATUS_GRID, message) selection = self.get_selection() if selection is not None: sel_x, sel_y = selection valid = puzzle.grid.is_valid(sel_x, sel_y) for item, predicate in self.selection_toggle_items: item.set_sensitive(valid and predicate(puzzle)) if valid and not puzzle.grid.is_available(sel_x, sel_y): self.set_selection(-1, -1) for item in self.puzzle_toggle_items: item.set_sensitive(puzzle is not None) self.undo_menu_item.set_sensitive(len(action.stack.undo_stack) > 0) self.redo_menu_item.set_sensitive(len(action.stack.redo_stack) > 0) self.undo_tool_item.set_sensitive(len(action.stack.undo_stack) > 0) self.redo_tool_item.set_sensitive(len(action.stack.redo_stack) > 0) self.editor.refresh_words() self.panel.queue_draw()
85dbdaca2016bee54c9ef577b6ca52f4eb1cde6a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6427/85dbdaca2016bee54c9ef577b6ca52f4eb1cde6a/gui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 67, 5668, 12, 2890, 4672, 293, 31550, 273, 365, 18, 84, 31550, 67, 4181, 18, 2972, 67, 84, 31550, 309, 293, 31550, 353, 599, 30, 365, 18, 542, 67, 2649, 12, 89, 6, 14320, 378, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1089, 67, 5668, 12, 2890, 4672, 293, 31550, 273, 365, 18, 84, 31550, 67, 4181, 18, 2972, 67, 84, 31550, 309, 293, 31550, 353, 599, 30, 365, 18, 542, 67, 2649, 12, 89, 6, 14320, 378, ...
ModuleList = []
ModuleList = {}
def _BuildPlatform(self): for BuildTarget in self.BuildTargetList: for ToolChain in self.ToolChainList: Wa = WorkspaceAutoGen( self.WorkspaceDir, self.Platform, BuildTarget, ToolChain, self.ArchList, self.BuildDatabase, self.TargetTxt, self.ToolDef, self.Fdf, self.FdList, self.FvList, self.SkuId ) self.BuildReport.AddPlatformReport(Wa) self.Progress.Stop("done!") self._Build(self.Target, Wa) # Create MAP file when Load Fix Address is enabled. if self.Target in ["", "all", "fds"] and self.LoadFixAddress != 0: for Arch in self.ArchList: # # Check whether the set fix address is above 4G for 32bit image. # if (Arch == 'IA32' or Arch == 'ARM') and self.LoadFixAddress != 0xFFFFFFFFFFFFFFFF and self.LoadFixAddress >= 0x100000000: EdkLogger.error("build", PARAMETER_INVALID, "FIX_LOAD_TOP_MEMORY_ADDRESS can't be set to larger than or equal to 4G for the platorm with IA32 or ARM arch modules") # # Get Module List # ModuleList = [] for Pa in Wa.AutoGenObjectList: for Ma in Pa.ModuleAutoGenList: if Ma == None: continue if not Ma.IsLibrary: ModuleList.append (Ma)
9ff69f35c75043c955fc92ca465db39f6bf1ead5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/914/9ff69f35c75043c955fc92ca465db39f6bf1ead5/build.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3116, 8201, 12, 2890, 4672, 364, 3998, 2326, 316, 365, 18, 3116, 2326, 682, 30, 364, 13288, 3893, 316, 365, 18, 6364, 3893, 682, 30, 678, 69, 273, 14396, 4965, 7642, 12, 365, 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, 389, 3116, 8201, 12, 2890, 4672, 364, 3998, 2326, 316, 365, 18, 3116, 2326, 682, 30, 364, 13288, 3893, 316, 365, 18, 6364, 3893, 682, 30, 678, 69, 273, 14396, 4965, 7642, 12, 365, 18, ...
child = self.endAdcData()
self.endAdcData()
def endElement(self, name): if name == AdcData.tagName: child = self.endAdcData() elif name == AdcInterval.tagName: child = self.endAdcInterval() elif name == Array.tagName: child = self.endArray() elif name == Column.tagName: child = self.endColumn() elif name == Comment.tagName: child = self.endComment() elif name == Detector.tagName: child = self.endDetector() elif name == Dim.tagName: child = self.endDim() elif name == IGWDFrame.tagName: child = self.endIGWDFrame() elif name == LIGO_LW.tagName: child = self.endLIGO_LW() elif name == Param.tagName: child = self.endParam() elif name == Stream.tagName: child = self.endStream() elif name == Table.tagName: child = self.endTable() elif name == Time.tagName: child = self.endTime() else: raise ElementError, "unknown element tag %s" % name self.current = self.current.parentNode
19c70d9d2433f3385423e26af544f557b0c477a4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5758/19c70d9d2433f3385423e26af544f557b0c477a4/ligolw.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 14840, 12, 2890, 16, 508, 4672, 309, 508, 422, 4052, 71, 751, 18, 2692, 461, 30, 365, 18, 409, 1871, 71, 751, 1435, 1327, 508, 422, 4052, 71, 4006, 18, 2692, 461, 30, 1151, 273, 365,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 14840, 12, 2890, 16, 508, 4672, 309, 508, 422, 4052, 71, 751, 18, 2692, 461, 30, 365, 18, 409, 1871, 71, 751, 1435, 1327, 508, 422, 4052, 71, 4006, 18, 2692, 461, 30, 1151, 273, 365,...
'<TR BGCOLOR=" '<TD COLSPAN=2><FONT SIZE="+2">\n<B>' + heading + \ '</B></FONT></TD></TR>\n'
'<TR BGCOLOR=" '<TH COLSPAN=2>\n' + heading + \ '</TH></TR>\n'
def _table_header(self, heading): 'Return a header for an HTML table' return self._start_of(heading)+\ '<TABLE BORDER="1" CELLPADDING="3" ' +\ 'CELLSPACING="0" WIDTH="100%" BGCOLOR="white">\n' +\ '<TR BGCOLOR="#70b0f0">\n'+\ '<TD COLSPAN=2><FONT SIZE="+2">\n<B>' + heading + \ '</B></FONT></TD></TR>\n'
208b57b68fee425e4ef284675975df62fecdb5ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/208b57b68fee425e4ef284675975df62fecdb5ea/html.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2121, 67, 3374, 12, 2890, 16, 11053, 4672, 296, 990, 279, 1446, 364, 392, 3982, 1014, 11, 327, 365, 6315, 1937, 67, 792, 12, 19948, 13, 16971, 2368, 7775, 605, 7954, 1546, 21, 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, 389, 2121, 67, 3374, 12, 2890, 16, 11053, 4672, 296, 990, 279, 1446, 364, 392, 3982, 1014, 11, 327, 365, 6315, 1937, 67, 792, 12, 19948, 13, 16971, 2368, 7775, 605, 7954, 1546, 21, 6, ...
index (or "order") nu and argument z. Defn:
index (or "order") nu and argument z. NOTE: Currently only prec=53 is supported. Defn:
def bessel_Y(nu,z,alg="maxima"): r""" Implements the "Y-Bessel function", or "Bessel function of the 2nd kind", with index (or "order") nu and argument z. Defn:
aae4eb29e05d770a5cff5dd41ca537c970622119 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/aae4eb29e05d770a5cff5dd41ca537c970622119/special.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 324, 403, 292, 67, 61, 12, 13053, 16, 94, 16, 18413, 1546, 1896, 13888, 6, 4672, 436, 8395, 29704, 326, 315, 61, 17, 38, 403, 292, 445, 3113, 578, 315, 38, 403, 292, 445, 434, 326, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 324, 403, 292, 67, 61, 12, 13053, 16, 94, 16, 18413, 1546, 1896, 13888, 6, 4672, 436, 8395, 29704, 326, 315, 61, 17, 38, 403, 292, 445, 3113, 578, 315, 38, 403, 292, 445, 434, 326, ...
player.socket.sysmessage('This player is currently offline. The message has not been sent.', 0x846) player.log(LOG_MESSAGE, "%s sends player %s (%s) a message: %s\n" % (player.name, char.name, self.account, response.text[1]))
player.socket.sysmessage(tr('This player is currently offline. The message has not been sent.'), 0x846) player.log(LOG_MESSAGE, tr("%s sends player %s (%s) a message: %s\n") % (player.name, char.name, self.account, response.text[1]))
def details_response(self, player, response): if response.button == 0: return char = wolfpack.findchar(self.serial) if not char: return # Go to character if response.button == 1: player.removefromview() player.moveto(char.pos) player.update() player.socket.resendworld() # Bring character elif response.button == 2: char.removefromview() char.moveto(player.pos) char.update() if char.socket: char.socket.resendworld()
d8b7b7c1b9e926bd4732e104ef67fe1e1cc770bf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/d8b7b7c1b9e926bd4732e104ef67fe1e1cc770bf/pages.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3189, 67, 2740, 12, 2890, 16, 7291, 16, 766, 4672, 309, 766, 18, 5391, 422, 374, 30, 327, 225, 1149, 273, 341, 355, 74, 2920, 18, 4720, 3001, 12, 2890, 18, 8818, 13, 225, 309, 486, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3189, 67, 2740, 12, 2890, 16, 7291, 16, 766, 4672, 309, 766, 18, 5391, 422, 374, 30, 327, 225, 1149, 273, 341, 355, 74, 2920, 18, 4720, 3001, 12, 2890, 18, 8818, 13, 225, 309, 486, ...
server.WriteLine("")
if username.startswith('NX>'): server.WriteLine("") else: server.WriteLine(username)
def _Login(self, args): """The "login" command.
947dca1b5caec7023ad4985456af786bffc48c92 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5330/947dca1b5caec7023ad4985456af786bffc48c92/nxserver_login.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 5358, 12, 2890, 16, 833, 4672, 3536, 1986, 315, 5819, 6, 1296, 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, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 5358, 12, 2890, 16, 833, 4672, 3536, 1986, 315, 5819, 6, 1296, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
data = file(sys.argv[1]).read()
data = decomp_str(file(sys.argv[1]).read())
def walk_userdata(str, callbacks, data = None): partnum = 0 for part in email.message_from_string(str).walk(): # multipart/* are just containers if part.get_content_maintype() == 'multipart': continue ctype = part.get_content_type() if ctype is None: ctype = 'application/octet-stream' filename = part.get_filename() if not filename: filename = 'part-%03d' % partnum if callbacks.has_key(ctype): callbacks[ctype](data,ctype,filename,part.get_payload()) partnum = partnum+1
3d13ad76368ea3e5f70e274f80fe2da207498008 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7197/3d13ad76368ea3e5f70e274f80fe2da207498008/UserDataHandler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5442, 67, 1355, 892, 12, 701, 16, 6689, 16, 501, 273, 599, 4672, 1087, 2107, 273, 374, 364, 1087, 316, 2699, 18, 2150, 67, 2080, 67, 1080, 12, 701, 2934, 11348, 13332, 468, 10263, 2030...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5442, 67, 1355, 892, 12, 701, 16, 6689, 16, 501, 273, 599, 4672, 1087, 2107, 273, 374, 364, 1087, 316, 2699, 18, 2150, 67, 2080, 67, 1080, 12, 701, 2934, 11348, 13332, 468, 10263, 2030...
msg_txt = email.message_from_file(sys.stdin)
fp = open('/home/admin/Desktop/email1.eml'); msg_txt = email.message_from_file(fp) fp.close()
def parse(self, msg): try: case_str = project_re.search(msg.get('Subject', '')) (case_id, emails) = self.msg_test(msg, case_str and case_str.group(1)) if case_id: if emails[0] and self.email_get(emails[0])==self.email_get(self._decode_header(msg['From'])): print 'From User', case_id self.msg_user(msg, case_id) else: print 'From Partner', case_id self.msg_partner(msg, case_id) else: case_id = self.msg_new(msg) if msg.get('Subject', ''): del msg['Subject'] msg['Subject'] = '['+str(case_id)+'] '+self._decode_header(msg['subject']) print 'Case', case_id, 'created...'
dc50b1520aaf1f66ca9199c1cd5657db62b6f3f0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7397/dc50b1520aaf1f66ca9199c1cd5657db62b6f3f0/tinyerp-mailgate.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 12, 2890, 16, 1234, 4672, 775, 30, 648, 67, 701, 273, 1984, 67, 266, 18, 3072, 12, 3576, 18, 588, 2668, 6638, 2187, 875, 3719, 261, 3593, 67, 350, 16, 14255, 13, 273, 365, 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, 1109, 12, 2890, 16, 1234, 4672, 775, 30, 648, 67, 701, 273, 1984, 67, 266, 18, 3072, 12, 3576, 18, 588, 2668, 6638, 2187, 875, 3719, 261, 3593, 67, 350, 16, 14255, 13, 273, 365, 18, ...
parts = ['..'] * len(source_parts) + target_parts
parts = ['..'] * (len(source_parts) - 1) + target_parts
def relative_path(source, target): """ Build and return a path to `target`, relative to `source`. If there is no common prefix, return the absolute path to `target`. """ source_parts = os.path.abspath(source or '').split(os.sep) target_parts = os.path.abspath(target).split(os.sep) # Check first 2 parts because '/dir'.split('/') == ['', 'dir']: if source_parts[:2] != target_parts[:2]: # Nothing in common between paths. # Return absolute path, using '/' for URLs: return '/'.join(target_parts) source_parts.reverse() target_parts.reverse() while (source_parts and target_parts and source_parts[-1] == target_parts[-1]): # Remove path components in common: source_parts.pop() target_parts.pop() target_parts.reverse() parts = ['..'] * len(source_parts) + target_parts return '/'.join(parts)
53777a2892cdb9f22f63918d052b7a97c45ee307 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/53777a2892cdb9f22f63918d052b7a97c45ee307/utils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3632, 67, 803, 12, 3168, 16, 1018, 4672, 3536, 3998, 471, 327, 279, 589, 358, 1375, 3299, 9191, 3632, 358, 1375, 3168, 8338, 225, 971, 1915, 353, 1158, 2975, 1633, 16, 327, 326, 4967, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3632, 67, 803, 12, 3168, 16, 1018, 4672, 3536, 3998, 471, 327, 279, 589, 358, 1375, 3299, 9191, 3632, 358, 1375, 3168, 8338, 225, 971, 1915, 353, 1158, 2975, 1633, 16, 327, 326, 4967, ...
'AND ( planned_date >= %s)) '\
'AND ( planned_date >= %s OR planned_date IS NULL)) '\
def products_by_location(self, cursor, user, location_ids, product_ids=None, with_childs=False, skip_zero=True, context=None): """ Compute for each location and product the stock quantity in the default uom of the product.
7ab3b82e6f58a12964fd87ef8b59f86539498063 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9298/7ab3b82e6f58a12964fd87ef8b59f86539498063/product.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10406, 67, 1637, 67, 3562, 12, 2890, 16, 3347, 16, 729, 16, 2117, 67, 2232, 16, 3017, 67, 2232, 33, 7036, 16, 598, 67, 3624, 87, 33, 8381, 16, 2488, 67, 7124, 33, 5510, 16, 819, 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, 10406, 67, 1637, 67, 3562, 12, 2890, 16, 3347, 16, 729, 16, 2117, 67, 2232, 16, 3017, 67, 2232, 33, 7036, 16, 598, 67, 3624, 87, 33, 8381, 16, 2488, 67, 7124, 33, 5510, 16, 819, 33...
domain=[('type','=','cr')], context={'default_type':'cr'}),
domain=[('type','=','cr')], context={'default_type':'cr'}, readonly=True, states={'draft':[('readonly',False)]}),
def _get_currency(self, cr, uid, context): user = self.pool.get('res.users').browse(cr, uid, uid) if user.company_id: return user.company_id.currency_id.id return False
a408fd8234d1e27254be9b5bfdd2483b7ff7f77e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a408fd8234d1e27254be9b5bfdd2483b7ff7f77e/voucher.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 7095, 12, 2890, 16, 4422, 16, 4555, 16, 819, 4672, 729, 273, 365, 18, 6011, 18, 588, 2668, 455, 18, 5577, 16063, 25731, 12, 3353, 16, 4555, 16, 4555, 13, 309, 729, 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, 389, 588, 67, 7095, 12, 2890, 16, 4422, 16, 4555, 16, 819, 4672, 729, 273, 365, 18, 6011, 18, 588, 2668, 455, 18, 5577, 16063, 25731, 12, 3353, 16, 4555, 16, 4555, 13, 309, 729, 18, ...
self.SetTargetEnd(self.PositionFromLine(cline + repeat))
self.SetTargetEnd(self.PositionFromLine(cline + repeat - 1))
def ViCmdDispatch(self): """Processes vi commands
1377bd2d55cabaaebb8d77e8612054ddea657387 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3530/1377bd2d55cabaaebb8d77e8612054ddea657387/ed_stc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 23910, 5931, 5325, 12, 2890, 4672, 3536, 10599, 13206, 4364, 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...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 23910, 5931, 5325, 12, 2890, 4672, 3536, 10599, 13206, 4364, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
command, line = line[0], line[1:]
fromend += fromline toend += toline
def htmlify(match): div, mod = divmod(len(match.group(0)), 2) return div * '&nbsp; ' + mod * '&nbsp;'
4d38f8d86ab8897ff67dd4cc3d6d9a0b7793ad84 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/4d38f8d86ab8897ff67dd4cc3d6d9a0b7793ad84/patch.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1729, 1164, 12, 1916, 4672, 3739, 16, 681, 273, 26105, 12, 1897, 12, 1916, 18, 1655, 12, 20, 13, 3631, 576, 13, 327, 3739, 380, 5183, 10600, 31, 296, 397, 681, 380, 5183, 10600, 4359, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1729, 1164, 12, 1916, 4672, 3739, 16, 681, 273, 26105, 12, 1897, 12, 1916, 18, 1655, 12, 20, 13, 3631, 576, 13, 327, 3739, 380, 5183, 10600, 31, 296, 397, 681, 380, 5183, 10600, 4359, ...
if not self.thread or len(self.thread.sessions) == 0:
if not self.thread or not self.server_is_hanging():
def flush_sync_server(self): if not self.thread or len(self.thread.sessions) == 0: return # The server has the database. self.stop_server() self.activate()
7fda96ed688f49283c4102bb229a665bf8618891 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1240/7fda96ed688f49283c4102bb229a665bf8618891/qt_sync_server.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3663, 67, 8389, 67, 3567, 12, 2890, 4672, 309, 486, 365, 18, 5930, 578, 486, 365, 18, 3567, 67, 291, 67, 76, 18183, 13332, 327, 468, 1021, 1438, 711, 326, 2063, 18, 365, 18, 5681, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3663, 67, 8389, 67, 3567, 12, 2890, 4672, 309, 486, 365, 18, 5930, 578, 486, 365, 18, 3567, 67, 291, 67, 76, 18183, 13332, 327, 468, 1021, 1438, 711, 326, 2063, 18, 365, 18, 5681, 67...
if isinstance(defaultLocation, (Carbon.File.FSSpec, Carbon.File.FSRef)): args['defaultLocation'] = aepack.pack(defaultLocation)
if isinstance(defaultLocation, Carbon.File.FSSpec): args['defaultLocation'] = Carbon.AE.AECreateDesc( Carbon.AppleEvents.typeFSS, defaultLocation.data)
def _process_Nav_args(dftflags, **args): import aepack import Carbon.AE import Carbon.File for k in args.keys(): if args[k] is None: del args[k] # Set some defaults, and modify some arguments if not args.has_key('dialogOptionFlags'): args['dialogOptionFlags'] = dftflags if args.has_key('defaultLocation') and \ not isinstance(args['defaultLocation'], Carbon.AE.AEDesc): defaultLocation = args['defaultLocation'] if isinstance(defaultLocation, (Carbon.File.FSSpec, Carbon.File.FSRef)): args['defaultLocation'] = aepack.pack(defaultLocation) else: defaultLocation = Carbon.File.FSRef(defaultLocation) args['defaultLocation'] = aepack.pack(defaultLocation) if args.has_key('typeList') and not isinstance(args['typeList'], Carbon.Res.ResourceType): typeList = args['typeList'][:] # Workaround for OSX typeless files: if 'TEXT' in typeList and not '\0\0\0\0' in typeList: typeList = typeList + ('\0\0\0\0',) data = 'Pyth' + struct.pack("hh", 0, len(typeList)) for type in typeList: data = data+type args['typeList'] = Carbon.Res.Handle(data) tpwanted = str if args.has_key('wanted'): tpwanted = args['wanted'] del args['wanted'] return args, tpwanted
6f79fcc30463a6c50d9e63467bddaa0d478ed199 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8125/6f79fcc30463a6c50d9e63467bddaa0d478ed199/EasyDialogs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2567, 67, 12599, 67, 1968, 12, 72, 1222, 7133, 16, 2826, 1968, 4672, 1930, 279, 881, 484, 1930, 13353, 18, 16985, 1930, 13353, 18, 812, 364, 417, 316, 833, 18, 2452, 13332, 309, 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, 389, 2567, 67, 12599, 67, 1968, 12, 72, 1222, 7133, 16, 2826, 1968, 4672, 1930, 279, 881, 484, 1930, 13353, 18, 16985, 1930, 13353, 18, 812, 364, 417, 316, 833, 18, 2452, 13332, 309, 8...
uri += os.path.join(madcow.dir,
uri += os.path.join(madcow.prefix,
def __init__(self, madcow): self.throttle = Throttle() config = madcow.config.memebot engine = config.db_engine uri = engine + '://' if engine == 'sqlite': uri += os.path.join(madcow.dir, 'data/db-%s-memes' % madcow.namespace) elif engine == 'mysql': user = config.db_user if len(config.db_pass): user += ':' + config.db_pass host = config.db_host if not len(host): host = 'localhost' if len(config.db_port): host += ':' + config.db_port uri += '%s@%s/%s' % (user, host, config.db_name) try: sqlhub.processConnection = connectionForURI(uri) except Exception, e: log.warn('invalid uri: %s (%s)' % (uri, e)) self.enabled = False return
9a825b38d042a5bbd350f0b1a829bed83fb20607 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10942/9a825b38d042a5bbd350f0b1a829bed83fb20607/memebot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 312, 361, 71, 543, 4672, 365, 18, 27971, 298, 273, 20640, 298, 1435, 642, 273, 312, 361, 71, 543, 18, 1425, 18, 3917, 73, 4819, 4073, 273, 642, 18, 196...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 312, 361, 71, 543, 4672, 365, 18, 27971, 298, 273, 20640, 298, 1435, 642, 273, 312, 361, 71, 543, 18, 1425, 18, 3917, 73, 4819, 4073, 273, 642, 18, 196...
return negInf
return _negInf
def ln(self, context=None): """Returns the natural (base e) logarithm of self."""
ebab68ad25421add045049bc0a87fbe7000ec3f7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/ebab68ad25421add045049bc0a87fbe7000ec3f7/decimal.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7211, 12, 2890, 16, 819, 33, 7036, 4672, 3536, 1356, 326, 15145, 261, 1969, 425, 13, 613, 31249, 434, 365, 12123, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7211, 12, 2890, 16, 819, 33, 7036, 4672, 3536, 1356, 326, 15145, 261, 1969, 425, 13, 613, 31249, 434, 365, 12123, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
20 """ return 4*self.base_ring().order()
625 """ return (self.base_ring().order())**4
def order(self): """ Return the number of elements of the quaternion algebra, or +Infinity if the algebra is not finite. EXAMPLES:: sage: Q.<i,j,k> = QuaternionAlgebra(QQ, -3, -7) sage: Q.order() +Infinity sage: Q.<i,j,k> = QuaternionAlgebra(GF(5), -3, -7) sage: Q.order() 20 """ return 4*self.base_ring().order()
fe177d7e9e5b87a4c01b1082cf61c4d867951ed1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/fe177d7e9e5b87a4c01b1082cf61c4d867951ed1/quaternion_algebra.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1353, 12, 2890, 4672, 3536, 2000, 326, 1300, 434, 2186, 434, 326, 26774, 524, 29087, 16, 578, 397, 382, 7850, 309, 326, 524, 29087, 353, 486, 25922, 18, 225, 5675, 8900, 11386, 2866, 225...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1353, 12, 2890, 4672, 3536, 2000, 326, 1300, 434, 2186, 434, 326, 26774, 524, 29087, 16, 578, 397, 382, 7850, 309, 326, 524, 29087, 353, 486, 25922, 18, 225, 5675, 8900, 11386, 2866, 225...
globals_ = {"__name__" : "__main__"} locals_ = globals_
import __main__ __main__.__dict__.clear() __main__.__dict__.update({"__name__" : "__main__", "__file__" : filename, "__builtins__": __builtins__, })
def _runscript(self, filename): # Start with fresh empty copy of globals and locals and tell the script # that it's being run as __main__ to avoid scripts being able to access # the pdb.py namespace. globals_ = {"__name__" : "__main__"} locals_ = globals_
8b76b11cd4dcf0cc84b59527bbe3e25067dbecf1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/8b76b11cd4dcf0cc84b59527bbe3e25067dbecf1/pdb.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2681, 4263, 12, 2890, 16, 1544, 4672, 468, 3603, 598, 12186, 1008, 1610, 434, 10941, 471, 8985, 471, 9276, 326, 2728, 468, 716, 518, 1807, 3832, 1086, 487, 1001, 5254, 972, 358, 454...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2681, 4263, 12, 2890, 16, 1544, 4672, 468, 3603, 598, 12186, 1008, 1610, 434, 10941, 471, 8985, 471, 9276, 326, 2728, 468, 716, 518, 1807, 3832, 1086, 487, 1001, 5254, 972, 358, 454...
def dorequest( self, req, details=False, doverify = True, forceverify = False, stats = None, etags = None ):
def dorequest( self, req, details=False, doverify = True, forceverify = False, stats = None, etags = None, label = "" ):
def dorequest( self, req, details=False, doverify = True, forceverify = False, stats = None, etags = None ): # Special check for DELETEALL if req.method == "DELETEALL": for ruri in req.ruris: collection = (ruri, req.user, req.pswd) hrefs = self.dofindall(collection) self.dodeleteall(hrefs) return True, "", None, None # Special for delay elif req.method == "DELAY": # self.ruri contains a numeric delay in seconds delay = int(req.ruri) starttime = time.time() while (time.time() < starttime + delay): pass return True, "", None, None
1e6bbaa51c1fe6e02709841f4dd5e13a91bd8caa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/129/1e6bbaa51c1fe6e02709841f4dd5e13a91bd8caa/caldavtest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 302, 479, 456, 12, 365, 16, 1111, 16, 3189, 33, 8381, 16, 741, 8705, 273, 1053, 16, 2944, 8705, 273, 1083, 16, 3177, 273, 599, 16, 3393, 1341, 273, 599, 16, 1433, 273, 1408, 262, 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, 302, 479, 456, 12, 365, 16, 1111, 16, 3189, 33, 8381, 16, 741, 8705, 273, 1053, 16, 2944, 8705, 273, 1083, 16, 3177, 273, 599, 16, 3393, 1341, 273, 599, 16, 1433, 273, 1408, 262, 30,...
s += "}" return href+s
if download_url is not None and download_url != "": return href + s + "}" else: return s
def generate_latex(host, db_name, vt_id, version, port, tag, execute, showspreadsheetonly, path_to_figures, graphics_options): """generate_latex(host: str, db_name:str, vt_id: str, version: str, port:str, tag: str, execute: bool, showspreadsheetonly: bool, path_to_figures: str, graphics_options: str) -> str This generates a piece of latex code containing the \href command and a \includegraphics command for each image generated. """ url_params = "getvt=%s&version=%s&db=%s&host=%s&port=%s&tag=%s&\
3123297d6a1b374a7b720af850b6ee46e7955b16 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/3123297d6a1b374a7b720af850b6ee46e7955b16/includevistrail.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2103, 67, 26264, 12, 2564, 16, 1319, 67, 529, 16, 7966, 67, 350, 16, 1177, 16, 1756, 16, 1047, 16, 1836, 16, 2405, 26007, 8118, 3700, 16, 589, 67, 869, 67, 470, 1823, 16, 17313, 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, 2103, 67, 26264, 12, 2564, 16, 1319, 67, 529, 16, 7966, 67, 350, 16, 1177, 16, 1756, 16, 1047, 16, 1836, 16, 2405, 26007, 8118, 3700, 16, 589, 67, 869, 67, 470, 1823, 16, 17313, 67, ...
anchor="w", justify="left",
anchor=W, justify=LEFT,
def toggle_code_context_event(self, event=None): if not self.label: # The following code attempts to figure out the required border # width and vertical padding required for the CodeContext widget # to be perfectly aligned with the text in the main Text widget. # This is done by retrieving the appropriate attributes from the # editwin.text and editwin.text_frame widgets. # # All values are passed through int(str(<value>)), since some # values may be pixel objects, which can't simply be added added # to ints. # # This code is considered somewhat unstable since it relies on # some of Tk's inner workings. However its effect is merely # cosmetic; failure will only cause the CodeContext text to be # somewhat misaligned with the text in the main Text widget. # # To avoid possible errors, all references to the inner workings # of Tk are executed inside try/except blocks.
b79f43230d85e84ab24e1de5a70416b19c64653c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/b79f43230d85e84ab24e1de5a70416b19c64653c/CodeContext.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10486, 67, 710, 67, 2472, 67, 2575, 12, 2890, 16, 871, 33, 7036, 4672, 309, 486, 365, 18, 1925, 30, 468, 1021, 3751, 981, 7531, 358, 7837, 596, 326, 1931, 5795, 468, 1835, 471, 9768, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 10486, 67, 710, 67, 2472, 67, 2575, 12, 2890, 16, 871, 33, 7036, 4672, 309, 486, 365, 18, 1925, 30, 468, 1021, 3751, 981, 7531, 358, 7837, 596, 326, 1931, 5795, 468, 1835, 471, 9768, ...
def __init__(self,workdir=None, addonsdir=None,dbname=False,port=8869, netport=8870, **kwargs):
def __init__(self,workdir=None, addonsdir=None,dbname=False,port=8869, netport=8973, **kwargs):
def __init__(self,workdir=None, addonsdir=None,dbname=False,port=8869, netport=8870, **kwargs): LoggingBuildStep.__init__(self, **kwargs) self.addFactoryArguments(workdir=workdir,addonsdir=addonsdir,dbname=dbname, port=port, netport=netport) self.args = {'addonsdir': addonsdir, 'workdir': workdir, 'dbname' : dbname, 'netport' : netport, 'port' : port, } self.name = 'install-translation' self.description = ["Installing Translation"] self.translation_lst = ''
7a68e954343d42c4fa5cd6af5316b8c862beb85e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12355/7a68e954343d42c4fa5cd6af5316b8c862beb85e/buildstep.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1252, 1214, 33, 7036, 16, 31439, 1214, 33, 7036, 16, 20979, 33, 8381, 16, 655, 33, 28, 5292, 29, 16, 2901, 655, 33, 6675, 9036, 16, 2826, 4333, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1252, 1214, 33, 7036, 16, 31439, 1214, 33, 7036, 16, 20979, 33, 8381, 16, 655, 33, 28, 5292, 29, 16, 2901, 655, 33, 6675, 9036, 16, 2826, 4333, 4672, 1...
print 'Error: '+ cmdname or cmd
print 'Error: '+ (cmdname or cmd)
def do_exec(cmd, cmdname=None): i=os.popen(cmd,'r') print i.read() i = i.close() if i is not None: if cmdname is not None: print 'Error: '+ cmdname or cmd sys.exit(1)
cbdf6ef8276d6a35d096c3ab1b0b0c5c88f67bc1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/cbdf6ef8276d6a35d096c3ab1b0b0c5c88f67bc1/daily.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 4177, 12, 4172, 16, 1797, 529, 33, 7036, 4672, 277, 33, 538, 18, 84, 3190, 12, 4172, 11189, 86, 6134, 1172, 277, 18, 896, 1435, 277, 273, 277, 18, 4412, 1435, 309, 277, 353,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 4177, 12, 4172, 16, 1797, 529, 33, 7036, 4672, 277, 33, 538, 18, 84, 3190, 12, 4172, 11189, 86, 6134, 1172, 277, 18, 896, 1435, 277, 273, 277, 18, 4412, 1435, 309, 277, 353,...
[[(0, 1/7, 0, -1/7, 0, -2/7)]]
[[(0, 1/7, 0, 6/7, 0, 5/7)]]
def gens(self): """ Return generators for this finite subgroup. EXAMPLES: We list generators for several cuspidal subgroups: sage: J0(11).cuspidal_subgroup().gens() [[(0, 1/5)]] sage: J0(37).cuspidal_subgroup().gens() [[(0, 0, 0, 1/3)]] sage: J0(43).cuspidal_subgroup().gens() [[(0, 1/7, 0, -1/7, 0, -2/7)]] sage: J1(13).cuspidal_subgroup().gens() [[(1/19, 0, 0, 9/19)], [(0, 1/19, 1/19, 18/19)]] """
815586779cc2c13231bc1338a2d2284b366f83d0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/815586779cc2c13231bc1338a2d2284b366f83d0/finite_subgroup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 314, 773, 12, 2890, 4672, 3536, 2000, 13327, 364, 333, 25922, 720, 1655, 18, 225, 5675, 8900, 11386, 30, 1660, 666, 13327, 364, 11392, 27964, 6610, 287, 720, 4650, 30, 272, 410, 30, 804,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 314, 773, 12, 2890, 4672, 3536, 2000, 13327, 364, 333, 25922, 720, 1655, 18, 225, 5675, 8900, 11386, 30, 1660, 666, 13327, 364, 11392, 27964, 6610, 287, 720, 4650, 30, 272, 410, 30, 804,...
Export javascript registry.
Export CSS registry.
def exportCSSRegistry(context): """ Export javascript registry. """ return exportResRegistry(context, _REG_ID, _REG_TITLE, _FILENAME)
15f2b6fecdf44a3ff04f756ed52f67d03e55971b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12274/15f2b6fecdf44a3ff04f756ed52f67d03e55971b/cssregistry.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3359, 10276, 4243, 12, 2472, 4672, 3536, 11054, 6765, 4023, 18, 3536, 327, 3359, 607, 4243, 12, 2472, 16, 389, 5937, 67, 734, 16, 389, 5937, 67, 14123, 16, 389, 16080, 13, 282, 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, 3359, 10276, 4243, 12, 2472, 4672, 3536, 11054, 6765, 4023, 18, 3536, 327, 3359, 607, 4243, 12, 2472, 16, 389, 5937, 67, 734, 16, 389, 5937, 67, 14123, 16, 389, 16080, 13, 282, 2, -100...
else: self.parse(connection.getfile().readlines())
_debug("allow all") elif self.errcode == 200 and lines: _debug("parse lines") self.parse(lines)
def read(self): import httplib tries = 0 while tries<5: connection = httplib.HTTP(self.host) connection.putrequest("GET", self.path) connection.putheader("Host", self.host) connection.endheaders() status, text, mime = connection.getreply() if status in [301,302] and mime: tries = tries + 1 newurl = mime.get("Location", mime.get("Uri", "")) newurl = urlparse.urljoin(self.url, newurl) self.set_url(newurl) else: break if status==401 or status==403: self.disallow_all = 1 elif status>=400: self.allow_all = 1 else: # status < 400 self.parse(connection.getfile().readlines())
b66667da981fa224b9ea7a9c3d24435be9537733 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/b66667da981fa224b9ea7a9c3d24435be9537733/robotparser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 12, 2890, 4672, 1930, 15851, 6673, 9327, 273, 374, 1323, 9327, 32, 25, 30, 1459, 273, 15851, 6673, 18, 3693, 12, 2890, 18, 2564, 13, 1459, 18, 458, 2293, 2932, 3264, 3113, 365, 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, 855, 12, 2890, 4672, 1930, 15851, 6673, 9327, 273, 374, 1323, 9327, 32, 25, 30, 1459, 273, 15851, 6673, 18, 3693, 12, 2890, 18, 2564, 13, 1459, 18, 458, 2293, 2932, 3264, 3113, 365, 18...
yield "<div class='build-section' id='build-summary'>\n" yield '<h2>Host summary:</h2>\n'
yield "<div class='build-section' id='build-summary'>" yield '<h2>Host summary:</h2>'
def render_html(self, myself, *requested_hosts): yield "<div class='build-section' id='build-summary'>\n" yield '<h2>Host summary:</h2>\n' for host in requested_hosts: builds = list(self.buildfarm.get_host_builds(host)) if len(builds) > 0: yield "".join(self._render_build_list_header(host)) for build in builds: yield "".join(self._render_build_html(myself, build)) yield "</tbody></table>\n" yield "</div>\n" else: deadhosts.append(host)
6f759d61aa9f4714f83d32476fcc23e0c846d5e7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7314/6f759d61aa9f4714f83d32476fcc23e0c846d5e7/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 67, 2620, 12, 2890, 16, 3399, 2890, 16, 380, 19065, 67, 11588, 4672, 2824, 3532, 2892, 667, 2218, 3510, 17, 3464, 11, 612, 2218, 3510, 17, 7687, 28533, 2824, 2368, 76, 22, 34, 25...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 67, 2620, 12, 2890, 16, 3399, 2890, 16, 380, 19065, 67, 11588, 4672, 2824, 3532, 2892, 667, 2218, 3510, 17, 3464, 11, 612, 2218, 3510, 17, 7687, 28533, 2824, 2368, 76, 22, 34, 25...
if v not in verts: verts.append(v)
if v not in verts: verts.add(v)
def __init__(self, data=None, pos=None, loops=None, format=None, boundary=[], weighted=None, implementation='networkx', sparse=True, vertex_labels=True, **kwds): """ TESTS:: sage: G = Graph() sage: loads(dumps(G)) == G True sage: a = matrix(2,2,[1,0,0,1]) sage: Graph(a).adjacency_matrix() == a True
6d7af7ab7291776d2986e5dad1d1007f72dce49d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/6d7af7ab7291776d2986e5dad1d1007f72dce49d/graph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 501, 33, 7036, 16, 949, 33, 7036, 16, 14075, 33, 7036, 16, 740, 33, 7036, 16, 7679, 22850, 6487, 13747, 33, 7036, 16, 4471, 2218, 5185, 92, 2187, 9387, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 501, 33, 7036, 16, 949, 33, 7036, 16, 14075, 33, 7036, 16, 740, 33, 7036, 16, 7679, 22850, 6487, 13747, 33, 7036, 16, 4471, 2218, 5185, 92, 2187, 9387, ...
job_id = SendJob([op], cl=cl)
job = [op] SetGenericOpcodeOpts(job, opts) job_id = SendJob(job, cl=cl)
def SubmitOrSend(op, opts, cl=None, feedback_fn=None): """Wrapper around SubmitOpCode or SendJob. This function will decide, based on the 'opts' parameter, whether to submit and wait for the result of the opcode (and return it), or whether to just send the job and print its identifier. It is used in order to simplify the implementation of the '--submit' option. It will also add the dry-run parameter from the options passed, if true. """ if opts and opts.dry_run: op.dry_run = opts.dry_run if opts and opts.submit_only: job_id = SendJob([op], cl=cl) raise JobSubmittedException(job_id) else: return SubmitOpCode(op, cl=cl, feedback_fn=feedback_fn)
293ba2d8b9a8303b4dd82c0f71aa3fe3e243c52c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7542/293ba2d8b9a8303b4dd82c0f71aa3fe3e243c52c/cli.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17320, 1162, 3826, 12, 556, 16, 1500, 16, 927, 33, 7036, 16, 10762, 67, 4293, 33, 7036, 4672, 3536, 3611, 6740, 17320, 3817, 1085, 578, 2479, 2278, 18, 225, 1220, 445, 903, 16288, 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, 17320, 1162, 3826, 12, 556, 16, 1500, 16, 927, 33, 7036, 16, 10762, 67, 4293, 33, 7036, 4672, 3536, 3611, 6740, 17320, 3817, 1085, 578, 2479, 2278, 18, 225, 1220, 445, 903, 16288, 16, ...
print count*200.0/lastid, '%,', print count*rate*200.0/lastid, '% of wanted rate',
print '(', print round(count*200.0/lastid), '%, or', print round(count*rate*200.0/lastid), '% of wanted rate )',
def record(v, info, filename, audiofilename, mono, grey, greybits, \ monotreshold, fields, preallocspace): import thread format, x, y, qsize, rate = info fps = 59.64 # Fields per second # XXX (Strange: need fps of Indigo monitor, not of PAL or NTSC!) tpf = 1000.0 / fps # Time per field in msec if filename: vout = VFile.VoutFile(filename) if mono: format = 'mono' elif grey and greybits == 8: format = 'grey' elif grey: format = 'grey'+`abs(greybits)` else: format = 'rgb8' vout.setformat(format) vout.setsize(x, y) if fields: vout.setpf((1, -2)) vout.writeheader() if preallocspace: print 'Preallocating space...' vout.prealloc(preallocspace) print 'done.' MAXSIZE = 20 # XXX should be a user option import Queue queue = Queue.Queue(MAXSIZE) done = thread.allocate_lock() done.acquire_lock() convertor = None if grey: if greybits == 2: convertor = imageop.grey2grey2 elif greybits == 4: convertor = imageop.grey2grey4 elif greybits == -2: convertor = imageop.dither2grey2 thread.start_new_thread(saveframes, \ (vout, queue, done, mono, monotreshold, convertor)) if audiofilename: audiodone = thread.allocate_lock() audiodone.acquire_lock() audiostop = [] initaudio(audiofilename, audiostop, audiodone) gl.wintitle('(rec) ' + filename) lastid = 0 t0 = time.millitimer() count = 0 ids = [] v.InitContinuousCapture(info) while not gl.qtest(): try: cd, id = v.GetCaptureData() except sv.error: #time.millisleep(10) # XXX is this necessary? sgi.nap(1) # XXX Try by Jack continue ids.append(id) id = id + 2*rate
7911430d00ceaac39d086959bf7b8de3452bd9fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/7911430d00ceaac39d086959bf7b8de3452bd9fc/Vrec.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1409, 12, 90, 16, 1123, 16, 1544, 16, 20232, 77, 792, 2550, 16, 6921, 83, 16, 5174, 93, 16, 5174, 93, 6789, 16, 521, 6921, 352, 3444, 16, 1466, 16, 675, 9853, 2981, 4672, 1930, 2650,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1409, 12, 90, 16, 1123, 16, 1544, 16, 20232, 77, 792, 2550, 16, 6921, 83, 16, 5174, 93, 16, 5174, 93, 6789, 16, 521, 6921, 352, 3444, 16, 1466, 16, 675, 9853, 2981, 4672, 1930, 2650,...
version_0 = Version.objects.get_for_object(self.site)[0] version_1 = Version.objects.get_for_object(self.site)[1] self.assertEqual(generate_patch(version_0, version_1, "domain"), "@@ -10,9 +10,9 @@\n rev-\n-1\n+2\n .com\n") self.assertEqual(generate_patch_html(version_0, version_1, "domain"), u'<SPAN TITLE="i=0">www.site-rev-</SPAN><DEL STYLE="background:
version_0 = Version.objects.get_for_object(self.test)[0] version_1 = Version.objects.get_for_object(self.test)[1] self.assertEqual(generate_patch(version_0, version_1, "name"), "@@ -3,5 +3,5 @@\n st1.\n-0\n+1\n") self.assertEqual(generate_patch_html(version_0, version_1, "name"), u'<SPAN TITLE="i=0">test1.</SPAN><DEL STYLE="background:
def testCanGeneratePatch(self): """Tests that text and HTML patches can be generated.""" version_0 = Version.objects.get_for_object(self.site)[0] version_1 = Version.objects.get_for_object(self.site)[1] self.assertEqual(generate_patch(version_0, version_1, "domain"), "@@ -10,9 +10,9 @@\n rev-\n-1\n+2\n .com\n") self.assertEqual(generate_patch_html(version_0, version_1, "domain"), u'<SPAN TITLE="i=0">www.site-rev-</SPAN><DEL STYLE="background:#FFE6E6;" TITLE="i=13">1</DEL><INS STYLE="background:#E6FFE6;" TITLE="i=13">2</INS><SPAN TITLE="i=14">.com</SPAN>')
7719152dbc21d60cdb83458f397a719b0cdb4820 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11809/7719152dbc21d60cdb83458f397a719b0cdb4820/tests.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 2568, 4625, 7332, 12, 2890, 4672, 3536, 14650, 716, 977, 471, 3982, 16482, 848, 506, 4374, 12123, 1177, 67, 20, 273, 4049, 18, 6911, 18, 588, 67, 1884, 67, 1612, 12, 2890, 18, 42...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2568, 4625, 7332, 12, 2890, 4672, 3536, 14650, 716, 977, 471, 3982, 16482, 848, 506, 4374, 12123, 1177, 67, 20, 273, 4049, 18, 6911, 18, 588, 67, 1884, 67, 1612, 12, 2890, 18, 42...