rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
cty.c_int, [cty.c_long], | cty.c_int, [cty.c_long], | def flps_emit_prolog(): """ flps_emit_prolog() """ _flps_emit_prolog() | 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,
1121,
67,
18356,
67,
685,
1330,
13332,
3536,
1183,
1121,
67,
18356,
67,
685,
1330,
1435,
3536,
225,
389,
2242,
1121,
67,
18356,
67,
685,
1330,
1435,
282,
2,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
1121,
67,
18356,
67,
685,
1330,
13332,
3536,
1183,
1121,
67,
18356,
67,
685,
1330,
1435,
3536,
225,
389,
2242,
1121,
67,
18356,
67,
685,
1330,
1435,
282,
2,
-100,
-100,
-100,
-100,... |
in given paths list. "filepath" is the absolute path, "atime" is | in self._builder.dirs. "filepath" is the absolute path, "atime" is | def file_times(self, paths, depth=100, ignoreprefix='.'): """ Return a dict of "filepath: (atime, mtime)" entries for each file in given paths list. "filepath" is the absolute path, "atime" is the access time, "mtime" the modification time. Recurse directories that don't start with ignoreprefix """ | 24c80eaef07fc9120855d96de23dbb14b5ce3fa8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7381/24c80eaef07fc9120855d96de23dbb14b5ce3fa8/fabricate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
585,
67,
8293,
12,
2890,
16,
2953,
16,
3598,
33,
6625,
16,
2305,
3239,
2218,
1093,
4672,
3536,
2000,
279,
2065,
434,
315,
10561,
30,
261,
270,
494,
16,
13158,
2225,
3222,
364,
1517,
58... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
585,
67,
8293,
12,
2890,
16,
2953,
16,
3598,
33,
6625,
16,
2305,
3239,
2218,
1093,
4672,
3536,
2000,
279,
2065,
434,
315,
10561,
30,
261,
270,
494,
16,
13158,
2225,
3222,
364,
1517,
58... |
set = HitList() | set = HitSet() | def get_collection_reclist(coll): """Return hitlist of recIDs that belong to the collection 'coll'.""" global collection_reclist_cache if not collection_reclist_cache[coll]: set = HitList() query = "SELECT nbrecs,reclist FROM collection WHERE name='%s'" % coll # launch the query: res = run_sql(query, None, 1) # fill the result set: if res: try: set._nbhits, set._set = res[0][0], Numeric.loads(zlib.decompress(res[0][1])) except: set._nbhits = 0 collection_reclist_cache[coll] = set return collection_reclist_cache[coll] | f89feb7ea51a59100f9e1291d3f34cbf65a4ba8b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/f89feb7ea51a59100f9e1291d3f34cbf65a4ba8b/search_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5548,
67,
266,
830,
376,
12,
12910,
4672,
3536,
990,
6800,
1098,
434,
1950,
5103,
716,
10957,
358,
326,
1849,
296,
12910,
11,
12123,
2552,
1849,
67,
266,
830,
376,
67,
2493,
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,
336,
67,
5548,
67,
266,
830,
376,
12,
12910,
4672,
3536,
990,
6800,
1098,
434,
1950,
5103,
716,
10957,
358,
326,
1849,
296,
12910,
11,
12123,
2552,
1849,
67,
266,
830,
376,
67,
2493,
3... |
dy = max(dx, -self.top) | dy = max(dy, -self.top) | def motion(self, event): dx = event.x - self.x0; self.x0 = event.x dy = event.y - self.y0; self.y0 = event.y new_top, new_left, new_right, new_bottom = \ self.top, self.left, self.right, self.bottom if self.state == DRAG_C: # A center drag bumps into the edges if dx > 0: dx = min(dx, self.right - self.w) else: dx = max(dx, -self.left) if dy > 0: dy = min(dx, self.bottom - self.h) else: dy = max(dx, -self.top) if self.state in (DRAG_TL, DRAG_T, DRAG_TR, DRAG_C): new_top = self.top + dy if self.state in (DRAG_TL, DRAG_L, DRAG_BL, DRAG_C): new_left = self.left + dx if self.state in (DRAG_TR, DRAG_R, DRAG_BR, DRAG_C): new_right = self.right + dx if self.state in (DRAG_BL, DRAG_B, DRAG_BR, DRAG_C): new_bottom = self.bottom + dy # A drag never moves left past right and so on new_top = min(self.bottom, new_top) new_left = min(self.right, new_left) new_right = max(self.left, new_right) new_bottom = max(self.top, new_bottom) | b3eaf5869a14ff310ecbd9fda1cb61b2ee52c9c3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7932/b3eaf5869a14ff310ecbd9fda1cb61b2ee52c9c3/cropgui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21188,
12,
2890,
16,
871,
4672,
6633,
273,
871,
18,
92,
300,
365,
18,
92,
20,
31,
365,
18,
92,
20,
273,
871,
18,
92,
7732,
273,
871,
18,
93,
300,
365,
18,
93,
20,
31,
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,
21188,
12,
2890,
16,
871,
4672,
6633,
273,
871,
18,
92,
300,
365,
18,
92,
20,
31,
365,
18,
92,
20,
273,
871,
18,
92,
7732,
273,
871,
18,
93,
300,
365,
18,
93,
20,
31,
365,
18,
... |
sorted_edges_iterator=iter(sorted(self.edges(), cmp=cmp)) | sorted_edges_iterator=iter(sorted(self.edges(), cmp=lambda x,y: cmp(weight_function(x),weight_function(y)))) | def min_spanning_tree(self, weight_function=lambda e: 1, algorithm='Kruskal', starting_vertex=None ): """ Returns the edges of a minimum spanning tree, if one exists, otherwise returns False. | 30ecbc9c06fa554aae7d820d36e9af4492d08e38 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/30ecbc9c06fa554aae7d820d36e9af4492d08e38/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1131,
67,
1752,
10903,
67,
3413,
12,
2890,
16,
3119,
67,
915,
33,
14661,
425,
30,
404,
16,
4886,
2218,
47,
8010,
79,
287,
2187,
5023,
67,
15281,
33,
7036,
262,
30,
3536,
2860,
326,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1131,
67,
1752,
10903,
67,
3413,
12,
2890,
16,
3119,
67,
915,
33,
14661,
425,
30,
404,
16,
4886,
2218,
47,
8010,
79,
287,
2187,
5023,
67,
15281,
33,
7036,
262,
30,
3536,
2860,
326,
5... |
odf_smil_namesapce = XMLNamespace(smil_uri, 'uri', []) | odf_smil_namespace = XMLNamespace(smil_uri, 'uri', []) | def is_translatable(self, attributes, attribute_name): return attribute_name in self.translatable_attributes | 590c9568ba443ebfebed711250b9621a3b68810e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12681/590c9568ba443ebfebed711250b9621a3b68810e/schema.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
2338,
27290,
12,
2890,
16,
1677,
16,
1566,
67,
529,
4672,
327,
1566,
67,
529,
316,
365,
18,
2338,
27290,
67,
4350,
2,
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,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
2338,
27290,
12,
2890,
16,
1677,
16,
1566,
67,
529,
4672,
327,
1566,
67,
529,
316,
365,
18,
2338,
27290,
67,
4350,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
def my_anchorblock_edge_right(obj, event, data): | def my_anchorblock_edge_right(obj, *args, **kwargs): | def my_anchorblock_edge_right(obj, event, data): print "right" | dff3caa2ec713908f112c4970120d3d880226170 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12343/dff3caa2ec713908f112c4970120d3d880226170/test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3399,
67,
16215,
2629,
67,
7126,
67,
4083,
12,
2603,
16,
380,
1968,
16,
2826,
4333,
4672,
1172,
315,
4083,
6,
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,
3399,
67,
16215,
2629,
67,
7126,
67,
4083,
12,
2603,
16,
380,
1968,
16,
2826,
4333,
4672,
1172,
315,
4083,
6,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
db = cx_Oracle.Connection("TESTJERX001/TESTJERX001@//10.11.216.4:1521/JERX001") | db = cx_Oracle.Connection(u'TESTJERX001/TESTJERX001@//10.11.216.4:1521/JERX001') | def write_receipt_waybill_compas(self,waybill_id): db = cx_Oracle.Connection("TESTJERX001/TESTJERX001@//10.11.216.4:1521/JERX001") cursor = db.cursor()#connections['compas'].cursor() self.ErrorMessages = '' self.ErrorCodes = '' the_waybill = Waybill.objects.get(id=waybill_id) lineItems = the_waybill.loadingdetail_set.select_related() WB_CODE = the_waybill.waybillNumber receiverPerson = EpicPerson.objects.get(person_pk = the_waybill.recipientName) recPersonOUC = receiverPerson.org_unit_code recPersonCode = receiverPerson.code arrival_date = the_waybill.recipientArrivalDate all_ok = True db.begin() for lineItem in lineItems: goodUnits = lineItem.numberUnitsGood damadgedUnits =lineItem.numberUnitsDamaged damadgedReason = lineItem.unitsDamagedReason.compasCode lostUnits =lineItem.numberUnitsLost lossReason = lineItem.unitsLostReason.compasCode Response_Message = cursor.var(cx_Oracle.STRING) Response_Message.setvalue(0,' '*200) Response_Code = cursor.var(cx_Oracle.STRING) Response_Code.setvalue(0,' '*2) Full_coi= TheStockItems[0].origin_id | c497ff3c7ca806866130c41e5403acfcbf770652 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12559/c497ff3c7ca806866130c41e5403acfcbf770652/compas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
8606,
8138,
67,
1888,
17240,
67,
2919,
345,
12,
2890,
16,
1888,
17240,
67,
350,
4672,
1319,
273,
9494,
67,
23601,
18,
1952,
12,
89,
11,
16961,
46,
654,
60,
11664,
19,
16961,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8606,
8138,
67,
1888,
17240,
67,
2919,
345,
12,
2890,
16,
1888,
17240,
67,
350,
4672,
1319,
273,
9494,
67,
23601,
18,
1952,
12,
89,
11,
16961,
46,
654,
60,
11664,
19,
16961,
... |
ValueError: j values must be integer or half integer and fulfil the triangle relation | ValueError: j values must be integer or half integer and fulfill the triangle relation | def wigner_6j(j_1, j_2, j_3, j_4, j_5, j_6, prec=None): r""" Calculate the Wigner 6j symbol `Wigner6j(j_1,j_2,j_3,j_4,j_5,j_6)`. INPUT: - ``j_1``, ..., ``j_6`` - integer or half integer - ``prec`` - precision, default: None. Providing a precision can drastically speed up the calculation. OUTPUT: rational number times the square root of a rational number (if prec=None), or real number if a precision is given EXAMPLES:: sage: wigner_6j(3,3,3,3,3,3) -1/14 sage: wigner_6j(5,5,5,5,5,5) 1/52 sage: wigner_6j(6,6,6,6,6,6) 309/10868 sage: wigner_6j(8,8,8,8,8,8) -12219/965770 sage: wigner_6j(30,30,30,30,30,30) 36082186869033479581/87954851694828981714124 sage: wigner_6j(0.5,0.5,1,0.5,0.5,1) 1/6 sage: wigner_6j(200,200,200,200,200,200, prec=1000)*1.0 0.000155903212413242 It is an error to have arguments that are not integer or half integer values or do not fulfil the triangle relation:: sage: wigner_6j(2.5,2.5,2.5,2.5,2.5,2.5) Traceback (most recent call last): ... ValueError: j values must be integer or half integer and fulfil the triangle relation sage: wigner_6j(0.5,0.5,1.1,0.5,0.5,1.1) Traceback (most recent call last): ... ValueError: j values must be integer or half integer and fulfil the triangle relation NOTES: The Wigner 6j symbol is related to the Racah symbol but exhibits more symmetries as detailed below. .. math:: Wigner6j(j_1,j_2,j_3,j_4,j_5,j_6) =(-1)^{j_1+j_2+j_4+j_5} W(j_1,j_2,j_5,j_4,j_3,j_6) The Wigner 6j symbol obeys the following symmetry rules: - Wigner $6j$ symbols are left invariant under any permutation of the columns: .. math:: Wigner6j(j_1,j_2,j_3,j_4,j_5,j_6) =Wigner6j(j_3,j_1,j_2,j_6,j_4,j_5) =Wigner6j(j_2,j_3,j_1,j_5,j_6,j_4) =Wigner6j(j_3,j_2,j_1,j_6,j_5,j_4) =Wigner6j(j_1,j_3,j_2,j_4,j_6,j_5) =Wigner6j(j_2,j_1,j_3,j_5,j_4,j_6) - They are invariant under the exchange of the upper and lower arguments in each of any two columns, i. e. .. math:: Wigner6j(j_1,j_2,j_3,j_4,j_5,j_6) =Wigner6j(j_1,j_5,j_6,j_4,j_2,j_3) =Wigner6j(j_4,j_2,j_6,j_1,j_5,j_3) =Wigner6j(j_4,j_5,j_3,j_1,j_2,j_6) - additional 6 symmetries [Regge59] giving rise to 144 symmetries in total - only non-zero if any triple of `j`'s fulfil a triangle relation ALGORITHM: This function uses the algorithm of [Edmonds74] to calculate the value of the 6j symbol exactly. Note that the formula contains alternating sums over large factorials and is therefore unsuitable for finite precision arithmetic and only useful for a computer algebra system [Rasch03]. REFERENCES: - [Regge59] 'Symmetry Properties of Racah Coefficients', T. Regge, Nuovo Cimento, Volume 11, pp. 116 (1959) - [Edmonds74] 'Angular Momentum in Quantum Mechanics', A. R. Edmonds, Princeton University Press (1974) - [Rasch03] 'Efficient Storage Scheme for Pre-calculated Wigner 3j, 6j and Gaunt Coefficients', J. Rasch and A. C. H. Yu, SIAM J. Sci. Comput. Volume 25, Issue 4, pp. 1416-1428 (2003) """ res = (-1) ** (int(j_1 + j_2 + j_4 + j_5)) * \ racah(j_1, j_2, j_5, j_4, j_3, j_6, prec) return res | 88e8ded3e4e8fadbc380d719dcf3bdc6eab9d557 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/88e8ded3e4e8fadbc380d719dcf3bdc6eab9d557/wigner.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
341,
724,
264,
67,
26,
78,
12,
78,
67,
21,
16,
525,
67,
22,
16,
525,
67,
23,
16,
525,
67,
24,
16,
525,
67,
25,
16,
525,
67,
26,
16,
13382,
33,
7036,
4672,
436,
8395,
9029,
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,
341,
724,
264,
67,
26,
78,
12,
78,
67,
21,
16,
525,
67,
22,
16,
525,
67,
23,
16,
525,
67,
24,
16,
525,
67,
25,
16,
525,
67,
26,
16,
13382,
33,
7036,
4672,
436,
8395,
9029,
326,... |
"""This draws a (British) stop sign. possible attributes: 'x', 'y', 'size' """ _attrMap = AttrMap(BASE=ETriangle0, UNWANTED=('strokeColor', 'color'), ) def __init__(self): self.x = 0 self.y = 0 self.size = 100 def demo(self): D = shapes.Drawing(200, 100) ss = StopSign0() ss.x=50 ss.y=0 ss.draw() D.add(ss) labelFontSize = 10 D.add(shapes.String(ss.x+(ss.size/2),(ss.y-(1.2*labelFontSize)), self.__class__.__name__, fillColor=colors.black, textAnchor='middle', fontSize=labelFontSize)) return D def draw(self): s = self.size g = shapes.Group() athird=s/3 outerOctagon = shapes.Polygon(points=[self.x+athird, self.y, self.x, self.y+athird, self.x, self.y+(athird*2), self.x+athird, self.y+s, self.x+(athird*2), self.y+s, self.x+s, self.y+(athird*2), self.x+s, self.y+athird, self.x+(athird*2), self.y], strokeColor = colors.black, fillColor = None, strokeWidth=1) g.add(outerOctagon) innerOctagon = shapes.Polygon(points=[self.x+athird+(s/75), self.y+(s/75), self.x+(s/75), self.y+athird+(s/75), self.x+(s/75), self.y+(athird*2)-(s/75), self.x+athird+(s/75), self.y+s-(s/75), self.x+(athird*2)-(s/75), (self.y+s)-(s/75), (self.x+s)-(s/75), self.y+(athird*2)-(s/75), (self.x+s)-(s/75), self.y+athird+(s/75), self.x+(athird*2)-(s/75), self.y+(s/75)], strokeColor = None, fillColor = colors.orangered, strokeWidth=0) g.add(innerOctagon) g.add(shapes.String(self.x+(s*0.5),self.y+(s*0.4), 'STOP', fillColor=colors.ghostwhite, textAnchor='middle', fontSize=s/3, fontName="Helvetica-Bold")) return g | """This draws a (British) stop sign. possible attributes: 'x', 'y', 'size' """ _attrMap = AttrMap(BASE=ETriangle0, UNWANTED=('strokeColor', 'color'), ) def __init__(self): self.x = 0 self.y = 0 self.size = 100 def draw(self): s = float(self.size) g = shapes.Group() athird=s/3 outerOctagon = shapes.Polygon(points=[self.x+athird, self.y, self.x, self.y+athird, self.x, self.y+(athird*2), self.x+athird, self.y+s, self.x+(athird*2), self.y+s, self.x+s, self.y+(athird*2), self.x+s, self.y+athird, self.x+(athird*2), self.y], strokeColor = colors.black, fillColor = None, strokeWidth=1) g.add(outerOctagon) innerOctagon = shapes.Polygon(points=[self.x+athird+(s/75), self.y+(s/75), self.x+(s/75), self.y+athird+(s/75), self.x+(s/75), self.y+(athird*2)-(s/75), self.x+athird+(s/75), self.y+s-(s/75), self.x+(athird*2)-(s/75), (self.y+s)-(s/75), (self.x+s)-(s/75), self.y+(athird*2)-(s/75), (self.x+s)-(s/75), self.y+athird+(s/75), self.x+(athird*2)-(s/75), self.y+(s/75)], strokeColor = None, fillColor = colors.orangered, strokeWidth=0) g.add(innerOctagon) g.add(shapes.String(self.x+(s*0.5),self.y+(s*0.4), 'STOP', fillColor=colors.ghostwhite, textAnchor='middle', fontSize=s/3, fontName="Helvetica-Bold")) return g | def draw(self): # general widget bits s = self.size # abbreviate as we will use this a lot g = shapes.Group() # SmileyFace specific bits outerCircle = shapes.Circle(cx = (self.x+(s/2)), cy = (self.y+(s/2)), r = s/2, fillColor = self.color, strokeColor = colors.black, strokeWidth=s/38.) g.add(outerCircle) | a94ee8176f1eaa19b5cc320daa2067dbafd93acd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a94ee8176f1eaa19b5cc320daa2067dbafd93acd/signsandsymbols.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
12,
2890,
4672,
468,
7470,
3604,
4125,
272,
273,
365,
18,
1467,
225,
468,
1223,
7379,
340,
487,
732,
903,
999,
333,
279,
17417,
314,
273,
14736,
18,
1114,
1435,
225,
468,
9425,
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,
3724,
12,
2890,
4672,
468,
7470,
3604,
4125,
272,
273,
365,
18,
1467,
225,
468,
1223,
7379,
340,
487,
732,
903,
999,
333,
279,
17417,
314,
273,
14736,
18,
1114,
1435,
225,
468,
9425,
3... |
for key in keys: | for key in keys: | def recentVotes(self, nr=25): """ Returns the most recent nr moderations (if existing), for moderators that you selected to forward for """ forwardable = [] #Create a list of infohashes that we are willing to forward keys = self.moderationcast_db.getVotedModerators() for key in keys: #print >> sys.stderr, "reasons i don't know ", key forwardable.append(key) forwardable.sort(self._compareFunction) return forwardable[0:nr] | db66f00adf7290609371661c677db18349224176 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9686/db66f00adf7290609371661c677db18349224176/SqliteCacheDBHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8399,
29637,
12,
2890,
16,
9884,
33,
2947,
4672,
3536,
2860,
326,
4486,
8399,
9884,
681,
264,
1012,
261,
430,
2062,
3631,
364,
681,
264,
3062,
716,
1846,
3170,
358,
5104,
364,
3536,
5104... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8399,
29637,
12,
2890,
16,
9884,
33,
2947,
4672,
3536,
2860,
326,
4486,
8399,
9884,
681,
264,
1012,
261,
430,
2062,
3631,
364,
681,
264,
3062,
716,
1846,
3170,
358,
5104,
364,
3536,
5104... |
jump_to_cell(id,0); //reset the cursor (for explorer) try{ //firefox, et al. var pos = before_replacing_word.length + word.length; cell_input.selectionStart = pos; cell_input.selectionEnd = pos; } catch(e) {} try{ //explorer; anybody else? var range = document.selection.createRange(); range.moveStart('character', -after_cursor.length); range.moveEnd('character', -after_cursor.length); } catch(e) {} if(browser_op || browser_saf) focus_delay(id); | var pos = before_replacing_word.length + word.length; //note for explorer: may need to focus cell first. if(cell_input.setSelectionRange) { cell_input.setSelectionRange(pos,pos); } else if (cell_input.createTextRange) { var range = cell_input.createTextRange(); range.moveEnd('character', pos - cell_input.value.length); range.collapse(false); range.select(); } else { //debug_append("crap"); } | def javascript(): s = async_lib() s+= r""" | 40481c1b15104046a00992f4301d508a3d319d6e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/40481c1b15104046a00992f4301d508a3d319d6e/js.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11341,
13332,
272,
273,
4326,
67,
2941,
1435,
272,
15,
33,
436,
8395,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
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,
11341,
13332,
272,
273,
4326,
67,
2941,
1435,
272,
15,
33,
436,
8395,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.filename = latestFileForBranch[self.branch] | self.filename = self.getProperty("filename") | def start(self): if not self.filename: if self.branch: self.filename = latestFileForBranch[self.branch] else: return FAILURE if self.filename: self.setCommand(self.command[0] + " " + self.filename) ShellCommand.start(self) | 86a88c92ce1af8279700c2e6f16b735f1b066c8b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13067/86a88c92ce1af8279700c2e6f16b735f1b066c8b/perfrunner.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
4672,
309,
486,
365,
18,
3459,
30,
309,
365,
18,
7500,
30,
365,
18,
3459,
273,
365,
18,
588,
1396,
2932,
3459,
7923,
469,
30,
327,
24077,
309,
365,
18,
3459,
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,
787,
12,
2890,
4672,
309,
486,
365,
18,
3459,
30,
309,
365,
18,
7500,
30,
365,
18,
3459,
273,
365,
18,
588,
1396,
2932,
3459,
7923,
469,
30,
327,
24077,
309,
365,
18,
3459,
30,
365,
... |
self.server.av_transport_server.set_variable(self.server.connection_manager_server.lookup_avt_id(self.current_connection_id), 'TransportState', 'PAUSED_PLAYBACK') elif(self.playcontainer != None and message == gst.MESSAGE_EOS and self.playcontainer[0]+1 < len(self.playcontainer[2])): | av_transport.set_variable(conn_id, 'TransportState', 'PAUSED_PLAYBACK') elif self.playcontainer != None and message == gst.MESSAGE_EOS and \ self.playcontainer[0]+1 < len(self.playcontainer[2]): | def update( self,message=None): _, current,_ = self.player.get_state() self.debug("update current %r" % current) """ if current == gst.STATE_NULL: return if current not in (gst.STATE_PLAYING, gst.STATE_PAUSED, gst.STATE_READY): print "I'm out" return """ if current == gst.STATE_PLAYING: state = 'playing' self.server.av_transport_server.set_variable(self.server.connection_manager_server.lookup_avt_id(self.current_connection_id), 'TransportState', 'PLAYING') elif current == gst.STATE_PAUSED: state = 'paused' self.server.av_transport_server.set_variable(self.server.connection_manager_server.lookup_avt_id(self.current_connection_id), 'TransportState', 'PAUSED_PLAYBACK') elif(self.playcontainer != None and message == gst.MESSAGE_EOS and self.playcontainer[0]+1 < len(self.playcontainer[2])): state = 'transitioning' self.server.av_transport_server.set_variable(self.server.connection_manager_server.lookup_avt_id(self.current_connection_id), 'TransportState', 'TRANSITIONING') | 56a690641745e5de48e43c2d6f0dd10f24a0e22c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11626/56a690641745e5de48e43c2d6f0dd10f24a0e22c/gstreamer_renderer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
365,
16,
2150,
33,
7036,
4672,
389,
16,
783,
16,
67,
273,
365,
18,
14872,
18,
588,
67,
2019,
1435,
365,
18,
4148,
2932,
2725,
783,
738,
86,
6,
738,
783,
13,
3536,
309,
78... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
365,
16,
2150,
33,
7036,
4672,
389,
16,
783,
16,
67,
273,
365,
18,
14872,
18,
588,
67,
2019,
1435,
365,
18,
4148,
2932,
2725,
783,
738,
86,
6,
738,
783,
13,
3536,
309,
78... |
subprocess.call(cmd, shell=shell) | return subprocess.call(cmd, shell=shell) else: return 0 | def _RunCommand(cmd, dry_run, shell=False, echo_cmd=True): """Runs the command if dry_run is false, otherwise just prints the command.""" if echo_cmd: print cmd # TODO(wtc): Check the return value of subprocess.call, which is the return # value of the command. if not dry_run: subprocess.call(cmd, shell=shell) | a2f96b95f19b75486a9013d2d670330315bd8202 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a2f96b95f19b75486a9013d2d670330315bd8202/coverity.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1997,
2189,
12,
4172,
16,
10299,
67,
2681,
16,
5972,
33,
8381,
16,
3376,
67,
4172,
33,
5510,
4672,
3536,
9361,
326,
1296,
309,
10299,
67,
2681,
353,
629,
16,
3541,
2537,
14971,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1997,
2189,
12,
4172,
16,
10299,
67,
2681,
16,
5972,
33,
8381,
16,
3376,
67,
4172,
33,
5510,
4672,
3536,
9361,
326,
1296,
309,
10299,
67,
2681,
353,
629,
16,
3541,
2537,
14971,
32... |
self.req.hdf.setValue('title', self.path) | def display(self): self.env.log.debug("Displaying file: %s mime-type: %s" % (self.filename, self.mime_type)) # We don't have to guess if the charset is specified in the # svn:mime-type property ctpos = self.mime_type.find('charset=') if ctpos >= 0: charset = self.mime_type[ctpos + 8:] self.env.log.debug("Charset %s selected" % charset) else: charset = self.env.get_config('trac', 'default_charset', 'iso-8859-15') data = util.to_utf8(self.read_func(self.DISP_MAX_FILE_SIZE), charset) | b3110117e7781f8989b01c6eae9e9ab71d6da4c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/b3110117e7781f8989b01c6eae9e9ab71d6da4c1/File.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2562,
12,
2890,
4672,
365,
18,
3074,
18,
1330,
18,
4148,
2932,
4236,
310,
585,
30,
738,
87,
225,
4892,
17,
723,
30,
738,
87,
6,
738,
261,
2890,
18,
3459,
16,
365,
18,
11757,
67,
72... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2562,
12,
2890,
4672,
365,
18,
3074,
18,
1330,
18,
4148,
2932,
4236,
310,
585,
30,
738,
87,
225,
4892,
17,
723,
30,
738,
87,
6,
738,
261,
2890,
18,
3459,
16,
365,
18,
11757,
67,
72... | |
if not os.path.exists(svn_binary): | if not os.path.exists(prog.svn_binary): | def check_tools(): """Check that needed external tools can be found.""" if not os.path.exists(svn_binary): print 'Subversion binary could not be found from:' print svn_binary print 'Please check script configuration and/or make sure Subversion is installed.' return False vs_cmd = get_vs_ide_bin() if not os.path.exists(vs_cmd): print 'Cannot find Visual Studio IDE binary from:' print vs_cmd print 'Please check script configuration.' return False return True | 7f222394e7f848573cfa1d04c8f7002cca97d45b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5857/7f222394e7f848573cfa1d04c8f7002cca97d45b/create_release.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
6642,
13332,
3536,
1564,
716,
3577,
3903,
8513,
848,
506,
1392,
12123,
225,
309,
486,
1140,
18,
803,
18,
1808,
12,
14654,
18,
31505,
67,
8578,
4672,
1172,
296,
1676,
1589,
3112,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6642,
13332,
3536,
1564,
716,
3577,
3903,
8513,
848,
506,
1392,
12123,
225,
309,
486,
1140,
18,
803,
18,
1808,
12,
14654,
18,
31505,
67,
8578,
4672,
1172,
296,
1676,
1589,
3112,... |
return getSites(cloud) | sites = getSites(cloud) if sites: return sites raise BackendError('LCG','Could not find any sites for selected cloud %s. Allowed clouds: %s'%(cloud,self._cloudNameList.keys())) | def list_sites_cloud(self, cloudName=''): | 8023e60f64cbb868b18ffd5ab7a38fcc2d226c54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1488/8023e60f64cbb868b18ffd5ab7a38fcc2d226c54/AtlasLCGRequirements.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
67,
12180,
67,
7277,
12,
2890,
16,
5051,
461,
2218,
11,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
67,
12180,
67,
7277,
12,
2890,
16,
5051,
461,
2218,
11,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
path = sys.argv[2] | configfile = sys.argv[2] | def safeget(self, section, option, default): """safet get method using default values""" try: v = self.get(section, option) except NoSectionError, NoOptionError: v = default if isinstance(v, bool): return v try: return int(v) except ValueError: return v | c4e4d8fb3c988bfdec9342382b2b6e8c5ce51fad /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6932/c4e4d8fb3c988bfdec9342382b2b6e8c5ce51fad/cli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4183,
588,
12,
2890,
16,
2442,
16,
1456,
16,
225,
805,
4672,
3536,
87,
1727,
278,
336,
707,
1450,
805,
924,
8395,
775,
30,
331,
273,
365,
18,
588,
12,
3464,
16,
1456,
13,
1335,
2631,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4183,
588,
12,
2890,
16,
2442,
16,
1456,
16,
225,
805,
4672,
3536,
87,
1727,
278,
336,
707,
1450,
805,
924,
8395,
775,
30,
331,
273,
365,
18,
588,
12,
3464,
16,
1456,
13,
1335,
2631,... |
return render(template_name, { | return render('authopenid/associate.html', { | def associate(request, template_name='authopenid/associate.html', openid_form=AssociateOpenID, redirect_field_name='/', on_failure=associate_failure, extra_context=None): nb_associated_openids, associated_openids = get_associate_openid(request.user) redirect_to = request.REQUEST.get(redirect_field_name, '') if request.POST: if 'a_openids' in request.POST.keys(): a_openids = [] if request.POST.get('a_openids','') is not '': a_openids = request.POST.getlist('a_openids') if len(a_openids) == nb_associated_openids and not request.user.has_usable_password(): if len(a_openids) > 1: msg = ["You can't remove these openids, You should set a password first."] else: msg = ["You can't remove this openid, You should set a password first."] return render(template_name, { redirect_field_name: redirect_to, 'associated_openids' : associated_openids, 'nb_associated_openids' : nb_associated_openids, 'msg':msg, }, context_instance=_build_context(request, extra_context=extra_context)) return render_to_response("authopenid/dissociate.html",{ 'a_openids' : a_openids }, context_instance = RequestContext(request) ) else: form = openid_form(request.user, data=request.POST) if form.is_valid(): if ' ' in form.cleaned_data['openid_url'] or form.cleaned_data['openid_url'] in OPENID_PROVIDER: msg = ['You must enter a valid OpenID url'] return render(template_name, { redirect_field_name: redirect_to, 'associated_openids' : associated_openids, 'nb_associated_openids' : nb_associated_openids, 'msg':msg, }, context_instance=_build_context(request, extra_context=extra_context)) if not redirect_to or '//' in redirect_to or ' ' in redirect_to: redirect_to = settings.LOGIN_REDIRECT_URL redirect_url = "%s%s?%s" % ( get_url_host(request), reverse('user_complete_myassociate'), urllib.urlencode({ redirect_field_name: redirect_to }) ) return ask_openid(request, form.cleaned_data['openid_url'], redirect_url, on_failure=on_failure) else: msg = ['You must enter a valid OpenID url'] return render(template_name, { redirect_field_name: redirect_to, 'associated_openids' : associated_openids, 'nb_associated_openids' : nb_associated_openids, 'msg':msg, }, context_instance=_build_context(request, extra_context=extra_context)) else: form = openid_form(request.user) msg = request.user.get_and_delete_messages() return render(template_name, { 'form': form, redirect_field_name: redirect_to, 'associated_openids' : associated_openids, 'nb_associated_openids' : nb_associated_openids, 'msg':msg, }, context_instance=_build_context(request, extra_context=extra_context)) | 281883f9c8e64cdb7ec8da00caea543243a2272d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11208/281883f9c8e64cdb7ec8da00caea543243a2272d/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13251,
12,
2293,
16,
1542,
67,
529,
2218,
1944,
20619,
19,
11577,
18,
2620,
2187,
21629,
67,
687,
33,
23880,
22414,
16,
3136,
67,
1518,
67,
529,
2218,
19,
2187,
603,
67,
12251,
33,
115... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
13251,
12,
2293,
16,
1542,
67,
529,
2218,
1944,
20619,
19,
11577,
18,
2620,
2187,
21629,
67,
687,
33,
23880,
22414,
16,
3136,
67,
1518,
67,
529,
2218,
19,
2187,
603,
67,
12251,
33,
115... |
- [Regge59] 'Symmetry Properties of Racah Coefficients', | .. [Regge59] 'Symmetry Properties of Racah Coefficients', | def wigner_6j(j_1, j_2, j_3, j_4, j_5, j_6, prec=None): r""" Calculate the Wigner 6j symbol `Wigner6j(j_1,j_2,j_3,j_4,j_5,j_6)`. INPUT: - ``j_1``, ..., ``j_6`` - integer or half integer - ``prec`` - precision, default: None. Providing a precision can drastically speed up the calculation. OUTPUT: rational number times the square root of a rational number (if prec=None), or real number if a precision is given EXAMPLES:: sage: wigner_6j(3,3,3,3,3,3) -1/14 sage: wigner_6j(5,5,5,5,5,5) 1/52 sage: wigner_6j(6,6,6,6,6,6) 309/10868 sage: wigner_6j(8,8,8,8,8,8) -12219/965770 sage: wigner_6j(30,30,30,30,30,30) 36082186869033479581/87954851694828981714124 sage: wigner_6j(0.5,0.5,1,0.5,0.5,1) 1/6 sage: wigner_6j(200,200,200,200,200,200, prec=1000)*1.0 0.000155903212413242 It is an error to have arguments that are not integer or half integer values or do not fulfil the triangle relation:: sage: wigner_6j(2.5,2.5,2.5,2.5,2.5,2.5) Traceback (most recent call last): ... ValueError: j values must be integer or half integer and fulfil the triangle relation sage: wigner_6j(0.5,0.5,1.1,0.5,0.5,1.1) Traceback (most recent call last): ... ValueError: j values must be integer or half integer and fulfil the triangle relation NOTES: The Wigner 6j symbol is related to the Racah symbol but exhibits more symmetries as detailed below. .. math:: Wigner6j(j_1,j_2,j_3,j_4,j_5,j_6) =(-1)^{j_1+j_2+j_4+j_5} W(j_1,j_2,j_5,j_4,j_3,j_6) The Wigner 6j symbol obeys the following symmetry rules: - Wigner $6j$ symbols are left invariant under any permutation of the columns: .. math:: Wigner6j(j_1,j_2,j_3,j_4,j_5,j_6) =Wigner6j(j_3,j_1,j_2,j_6,j_4,j_5) =Wigner6j(j_2,j_3,j_1,j_5,j_6,j_4) =Wigner6j(j_3,j_2,j_1,j_6,j_5,j_4) =Wigner6j(j_1,j_3,j_2,j_4,j_6,j_5) =Wigner6j(j_2,j_1,j_3,j_5,j_4,j_6) - They are invariant under the exchange of the upper and lower arguments in each of any two columns, i. e. .. math:: Wigner6j(j_1,j_2,j_3,j_4,j_5,j_6) =Wigner6j(j_1,j_5,j_6,j_4,j_2,j_3) =Wigner6j(j_4,j_2,j_6,j_1,j_5,j_3) =Wigner6j(j_4,j_5,j_3,j_1,j_2,j_6) - additional 6 symmetries [Regge59] giving rise to 144 symmetries in total - only non-zero if any triple of `j`'s fulfil a triangle relation ALGORITHM: This function uses the algorithm of [Edmonds74] to calculate the value of the 6j symbol exactly. Note that the formula contains alternating sums over large factorials and is therefore unsuitable for finite precision arithmetic and only useful for a computer algebra system [Rasch03]. REFERENCES: - [Regge59] 'Symmetry Properties of Racah Coefficients', T. Regge, Nuovo Cimento, Volume 11, pp. 116 (1959) - [Edmonds74] 'Angular Momentum in Quantum Mechanics', A. R. Edmonds, Princeton University Press (1974) - [Rasch03] 'Efficient Storage Scheme for Pre-calculated Wigner 3j, 6j and Gaunt Coefficients', J. Rasch and A. C. H. Yu, SIAM J. Sci. Comput. Volume 25, Issue 4, pp. 1416-1428 (2003) """ res = (-1) ** (int(j_1 + j_2 + j_4 + j_5)) * \ racah(j_1, j_2, j_5, j_4, j_3, j_6, prec) return res | 2aae1a34350173041dcaa920c230128b23fb8288 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/2aae1a34350173041dcaa920c230128b23fb8288/wigner.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
341,
724,
264,
67,
26,
78,
12,
78,
67,
21,
16,
525,
67,
22,
16,
525,
67,
23,
16,
525,
67,
24,
16,
525,
67,
25,
16,
525,
67,
26,
16,
13382,
33,
7036,
4672,
436,
8395,
9029,
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,
341,
724,
264,
67,
26,
78,
12,
78,
67,
21,
16,
525,
67,
22,
16,
525,
67,
23,
16,
525,
67,
24,
16,
525,
67,
25,
16,
525,
67,
26,
16,
13382,
33,
7036,
4672,
436,
8395,
9029,
326,... |
if self.show_response: msg = '\n'.join(('-' * 75, r.read(), '-' * 75)) self.announce(msg, log.INFO) | def upload_file(self, command, pyversion, filename): # Makes sure the repository URL is compliant schema, netloc, url, params, query, fragments = \ urlparse.urlparse(self.repository) if params or query or fragments: raise AssertionError("Incompatible url %s" % self.repository) | 5cf79f66378cc90eac12dfdbbdef05f1b3cd7771 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/5cf79f66378cc90eac12dfdbbdef05f1b3cd7771/upload.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3617,
67,
768,
12,
2890,
16,
1296,
16,
2395,
1589,
16,
1544,
4672,
468,
490,
3223,
3071,
326,
3352,
1976,
353,
24820,
1963,
16,
17345,
16,
880,
16,
859,
16,
843,
16,
14656,
273,
521,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
768,
12,
2890,
16,
1296,
16,
2395,
1589,
16,
1544,
4672,
468,
490,
3223,
3071,
326,
3352,
1976,
353,
24820,
1963,
16,
17345,
16,
880,
16,
859,
16,
843,
16,
14656,
273,
521,
... | |
def acquire(self, name, debug=1): | def acquire(self, name, debug=0): | def acquire(self, name, debug=1): """ Look for an attribute or element by name in all of our parents """ return self._lookup(name, acquire=1, debug=debug) | ea0b08aa06fe462a957cfe0e88a4554a2bc285cc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ea0b08aa06fe462a957cfe0e88a4554a2bc285cc/refpath.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10533,
12,
2890,
16,
508,
16,
1198,
33,
20,
4672,
3536,
10176,
364,
392,
1566,
578,
930,
635,
508,
316,
777,
434,
3134,
6298,
3536,
327,
365,
6315,
8664,
12,
529,
16,
10533,
33,
21,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10533,
12,
2890,
16,
508,
16,
1198,
33,
20,
4672,
3536,
10176,
364,
392,
1566,
578,
930,
635,
508,
316,
777,
434,
3134,
6298,
3536,
327,
365,
6315,
8664,
12,
529,
16,
10533,
33,
21,
... |
print "Failed to catch expected NoSectionError from options()" | raise TestFailed( "Failed to catch expected NoSectionError from options()") | def query_errors(): print print "Testing query interface..." cf = ConfigParser.ConfigParser() print cf.sections() print "Has section 'Foo'?", cf.has_section("Foo") try: cf.options("Foo") except ConfigParser.NoSectionError, e: print "Caught expected NoSectionError:", e else: print "Failed to catch expected NoSectionError from options()" try: cf.set("foo", "bar", "value") except ConfigParser.NoSectionError, e: print "Caught expected NoSectionError:", e else: print "Failed to catch expected NoSectionError from set()" expect_get_error(cf, ConfigParser.NoSectionError, "foo", "bar") cf.add_section("foo") expect_get_error(cf, ConfigParser.NoOptionError, "foo", "bar") | 3b4eacb6f09a74b34c9b912c4a532ce3c0bf8daa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/3b4eacb6f09a74b34c9b912c4a532ce3c0bf8daa/test_cfgparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
843,
67,
4324,
13332,
1172,
1172,
315,
22218,
843,
1560,
7070,
6080,
273,
25076,
18,
809,
2678,
1435,
1172,
6080,
18,
11657,
1435,
1172,
315,
5582,
2442,
296,
42,
5161,
11,
35,
3113,
608... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
843,
67,
4324,
13332,
1172,
1172,
315,
22218,
843,
1560,
7070,
6080,
273,
25076,
18,
809,
2678,
1435,
1172,
6080,
18,
11657,
1435,
1172,
315,
5582,
2442,
296,
42,
5161,
11,
35,
3113,
608... |
u.flush() except: if options['debugger']: pdb.post_mortem(sys.exc_info()[2]) u.print_exc() raise | prof.close() stats = hotshot.stats.load("hg.prof") stats.strip_dirs() stats.sort_stats('time', 'calls') stats.print_stats(40) elif options['lsprof']: try: from mercurial import lsprof except ImportError: raise util.Abort(_( 'lsprof not available - install from ' 'http://codespeak.net/svn/user/arigo/hack/misc/lsprof/')) p = lsprof.Profiler() p.enable(subcalls=True) try: return d() finally: p.disable() stats = lsprof.Stats(p.getstats()) stats.sort() stats.pprint(top=10, file=sys.stderr, climit=5) else: return d() | def runcommand(u, options, d): # enter the debugger before command execution if options['debugger']: pdb.set_trace() try: try: if options['profile']: import hotshot, hotshot.stats prof = hotshot.Profile("hg.prof") try: try: return prof.runcall(d) except: try: u.warn(_('exception raised - generating ' 'profile anyway\n')) except: pass raise finally: prof.close() stats = hotshot.stats.load("hg.prof") stats.strip_dirs() stats.sort_stats('time', 'calls') stats.print_stats(40) elif options['lsprof']: try: from mercurial import lsprof except ImportError: raise util.Abort(_( 'lsprof not available - install from ' 'http://codespeak.net/svn/user/arigo/hack/misc/lsprof/')) p = lsprof.Profiler() p.enable(subcalls=True) try: return d() finally: p.disable() stats = lsprof.Stats(p.getstats()) stats.sort() stats.pprint(top=10, file=sys.stderr, climit=5) else: return d() finally: u.flush() except: # enter the debugger when we hit an exception if options['debugger']: pdb.post_mortem(sys.exc_info()[2]) u.print_exc() raise | 85f77abb0abfdca26807633af9e1751ab19d1255 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11312/85f77abb0abfdca26807633af9e1751ab19d1255/cmdutil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
436,
551,
362,
889,
12,
89,
16,
702,
16,
302,
4672,
468,
6103,
326,
19977,
1865,
1296,
4588,
309,
702,
3292,
4148,
693,
3546,
30,
10892,
18,
542,
67,
5129,
1435,
225,
775,
30,
775,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
436,
551,
362,
889,
12,
89,
16,
702,
16,
302,
4672,
468,
6103,
326,
19977,
1865,
1296,
4588,
309,
702,
3292,
4148,
693,
3546,
30,
10892,
18,
542,
67,
5129,
1435,
225,
775,
30,
775,
3... |
version = '1.1.15dev' | version = '1.1.15' | def read(*rnames): return open(os.path.join(os.path.dirname(__file__), *rnames)).read() | 119cd48c6d52f4071ee577308aed6c1e415dafa5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10274/119cd48c6d52f4071ee577308aed6c1e415dafa5/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
30857,
86,
1973,
4672,
327,
1696,
12,
538,
18,
803,
18,
5701,
12,
538,
18,
803,
18,
12287,
12,
972,
768,
972,
3631,
380,
86,
1973,
13,
2934,
896,
1435,
225,
2,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
30857,
86,
1973,
4672,
327,
1696,
12,
538,
18,
803,
18,
5701,
12,
538,
18,
803,
18,
12287,
12,
972,
768,
972,
3631,
380,
86,
1973,
13,
2934,
896,
1435,
225,
2,
-100,
-100,
-100,... |
self.main.blit(icon.image, icon.xy) | self.canvas.root().add("GnomeCanvasPixbuf", pixbuf=icon.image, x=icon.xy[0], y=icon.xy[1], ) | def displayModel(self): mapinfo = self._getMapInfo() log.msg('displaying map %s' % (mapinfo['name'],)) self.model = Model(pygame.image.load(fs.downloads(mapinfo['name']))) self.main.blit(self.model.background, (0,0)) for n, character in enumerate(self._getCharacterInfo()): icon_image = pygame.image.load(fs.downloads(character['name'])) icon = Icon() self.model.icons.append(icon) icon.image = icon_image icon.xy = n*80, n*80 self.main.blit(icon.image, icon.xy) # self.addCharacter # self.addItem # self.addText # self.addSound # self.clearObscurement() # self.obscure? | b678ac7eff46d2af5d07c3c0b6b3064a0f4ca389 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/b678ac7eff46d2af5d07c3c0b6b3064a0f4ca389/frontend.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2562,
1488,
12,
2890,
4672,
852,
1376,
273,
365,
6315,
588,
863,
966,
1435,
613,
18,
3576,
2668,
5417,
310,
852,
738,
87,
11,
738,
261,
1458,
1376,
3292,
529,
17337,
3719,
365,
18,
228... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2562,
1488,
12,
2890,
4672,
852,
1376,
273,
365,
6315,
588,
863,
966,
1435,
613,
18,
3576,
2668,
5417,
310,
852,
738,
87,
11,
738,
261,
1458,
1376,
3292,
529,
17337,
3719,
365,
18,
228... |
_attrMap = AttrMap(BASE=ETriangle0, UNWANTED=('strokeColor', 'color'), tickcolor = AttrMapValue(isColor), crosscolor = AttrMapValue(isColor), testValue = AttrMapValue(isBoolean), ) def __init__(self): self.x = 0 self.y = 0 self.size = 100 self.tickcolor = colors.green self.crosscolor = colors.red self.testValue = 1 def draw(self): if self.testValue: yn=Tickbox0() yn.tickColor=self.tickcolor else: yn=Crossbox0() yn.crossColor=self.crosscolor yn.x=self.x yn.y=self.y yn.size=self.size yn.draw() return yn def demo(self): D = shapes.Drawing(200, 100) yn = YesNo0() yn.x = 15 yn.y = 25 yn.size = 70 yn.testValue = 0 yn.draw() D.add(yn) yn2 = YesNo0() yn2.x = 120 yn2.y = 25 yn2.size = 70 yn2.testValue = 1 yn2.draw() D.add(yn2) labelFontSize = 8 D.add(shapes.String(yn.x+(yn.size/2),(yn.y-(1.2*labelFontSize)), 'testValue=0', fillColor=colors.black, textAnchor='middle', fontSize=labelFontSize)) D.add(shapes.String(yn2.x+(yn2.size/2),(yn2.y-(1.2*labelFontSize)), 'testValue=1', fillColor=colors.black, textAnchor='middle', fontSize=labelFontSize)) labelFontSize = 10 D.add(shapes.String(yn.x+85,(yn.y-20), self.__class__.__name__, fillColor=colors.black, textAnchor='middle', fontSize=labelFontSize)) return D | _attrMap = AttrMap(BASE=ETriangle0, UNWANTED=('strokeColor', 'color'), tickcolor = AttrMapValue(isColor), crosscolor = AttrMapValue(isColor), testValue = AttrMapValue(isBoolean), ) def __init__(self): self.x = 0 self.y = 0 self.size = 100 self.tickcolor = colors.green self.crosscolor = colors.red self.testValue = 1 def draw(self): if self.testValue: yn=Tickbox0() yn.tickColor=self.tickcolor else: yn=Crossbox0() yn.crossColor=self.crosscolor yn.x=self.x yn.y=self.y yn.size=self.size yn.draw() return yn def demo(self): D = shapes.Drawing(200, 100) yn = YesNo0() yn.x = 15 yn.y = 25 yn.size = 70 yn.testValue = 0 yn.draw() D.add(yn) yn2 = YesNo0() yn2.x = 120 yn2.y = 25 yn2.size = 70 yn2.testValue = 1 yn2.draw() D.add(yn2) labelFontSize = 8 D.add(shapes.String(yn.x+(yn.size/2),(yn.y-(1.2*labelFontSize)), 'testValue=0', fillColor=colors.black, textAnchor='middle', fontSize=labelFontSize)) D.add(shapes.String(yn2.x+(yn2.size/2),(yn2.y-(1.2*labelFontSize)), 'testValue=1', fillColor=colors.black, textAnchor='middle', fontSize=labelFontSize)) labelFontSize = 10 D.add(shapes.String(yn.x+85,(yn.y-20), self.__class__.__name__, fillColor=colors.black, textAnchor='middle', fontSize=labelFontSize)) return D | def draw(self): # general widget bits s = self.size # abbreviate as we will use this a lot g = shapes.Group() ew = self.exmarkWidth ae = s*0.125 #(ae = 'an eighth') | a94ee8176f1eaa19b5cc320daa2067dbafd93acd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a94ee8176f1eaa19b5cc320daa2067dbafd93acd/signsandsymbols.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
12,
2890,
4672,
468,
7470,
3604,
4125,
272,
273,
365,
18,
1467,
225,
468,
1223,
7379,
340,
487,
732,
903,
999,
333,
279,
17417,
314,
273,
14736,
18,
1114,
1435,
22722,
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,
3724,
12,
2890,
4672,
468,
7470,
3604,
4125,
272,
273,
365,
18,
1467,
225,
468,
1223,
7379,
340,
487,
732,
903,
999,
333,
279,
17417,
314,
273,
14736,
18,
1114,
1435,
22722,
273,
365,
... |
if server_clobber_date is not None: | if server_clobber_date is not None and our_clobber_date is not None: | def getClobberDate(baseURL, branch, builder, slave): url = "%s?%s" % (baseURL, urllib.urlencode(dict(branch=branch, builder=builder, slave=slave))) print "Checking clobber URL: %s" % url data = urllib2.urlopen(url).read().strip() try: return str_to_datetime(data) except ValueError: return None | 28d06334908e4ae1102cda371f3c91a0f1eabeaf /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6206/28d06334908e4ae1102cda371f3c91a0f1eabeaf/clobberer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1927,
1295,
744,
1626,
12,
1969,
1785,
16,
3803,
16,
2089,
16,
11735,
4672,
880,
273,
2213,
87,
35,
9,
87,
6,
738,
261,
1969,
1785,
16,
11527,
18,
718,
3015,
12,
1576,
12,
7500,
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,
1927,
1295,
744,
1626,
12,
1969,
1785,
16,
3803,
16,
2089,
16,
11735,
4672,
880,
273,
2213,
87,
35,
9,
87,
6,
738,
261,
1969,
1785,
16,
11527,
18,
718,
3015,
12,
1576,
12,
7500,
33,
... |
from iotbx import file_reader input_file = file_reader.any_file(file_name) | input_file = self.open_file(file_name) | def set_param_file (self, file_name, file_param_name, input_file=None, run_callback=True) : if self.allowed_param_names is not None : if not file_param_name in self.allowed_param_names : raise KeyError("Unrecognized input file parameter %s."%file_param_name) if (file_name is None) or (file_name == "") or (file_name == "None") : self._param_files.pop(file_param_name) else : if (input_file is not None) : self.save_file(input_file) elif (self.get_file(file_name) is None) : from iotbx import file_reader input_file = file_reader.any_file(file_name) self.save_file(input_file) if self.allow_multiple(file_param_name) : if (not file_param_name in self._param_files) : self._param_files[file_param_name] = [] self._param_files[file_param_name].append(file_name) else : self._param_files[file_param_name] = file_name if run_callback : callback = self._param_callbacks.get(file_param_name, None) if (callback is not None) : callback(file_name) | 2c103d69702325080e912e31a11fe51ab1d234a2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/696/2c103d69702325080e912e31a11fe51ab1d234a2/file_cache.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
891,
67,
768,
261,
2890,
16,
585,
67,
529,
16,
585,
67,
891,
67,
529,
16,
810,
67,
768,
33,
7036,
16,
1086,
67,
3394,
33,
5510,
13,
294,
309,
365,
18,
8151,
67,
891,
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,
444,
67,
891,
67,
768,
261,
2890,
16,
585,
67,
529,
16,
585,
67,
891,
67,
529,
16,
810,
67,
768,
33,
7036,
16,
1086,
67,
3394,
33,
5510,
13,
294,
309,
365,
18,
8151,
67,
891,
67,... |
self.paragraph_style_stack.append('rststyle-bulletitem') else: el = SubElement(self.current_element, 'text:list', attrib={ 'text:style-name': 'rststyle-bulletlist', }) self.paragraph_style_stack.append('rststyle-bulletitem') | self.list_style_stack.append('rststyle-bulletitem') else: if self.blockstyle == 'rststyle-blockquote': el = SubElement(self.current_element, 'text:list', attrib={ 'text:style-name': 'rststyle-blockquote-bulletlist', }) self.list_style_stack.append('rststyle-blockquote-bulletitem') elif self.blockstyle == 'rststyle-highlights': el = SubElement(self.current_element, 'text:list', attrib={ 'text:style-name': 'rststyle-highlights-bulletlist', }) self.list_style_stack.append('rststyle-highlights-bulletitem') elif self.blockstyle == 'rststyle-epigraph': el = SubElement(self.current_element, 'text:list', attrib={ 'text:style-name': 'rststyle-epigraph-bulletlist', }) self.list_style_stack.append('rststyle-epigraph-bulletitem') else: el = SubElement(self.current_element, 'text:list', attrib={ 'text:style-name': 'rststyle-bulletlist', }) self.list_style_stack.append('rststyle-bulletitem') | def visit_bullet_list(self, node): #ipshell('At visit_bullet_list') if self.in_table_of_contents: if node.has_key('classes') and \ 'auto-toc' in node.attributes['classes']: el = SubElement(self.current_element, 'text:list', attrib={ 'text:style-name': 'rststyle-tocenumlist', }) self.paragraph_style_stack.append('rststyle-enumitem') else: el = SubElement(self.current_element, 'text:list', attrib={ 'text:style-name': 'rststyle-tocbulletlist', }) self.paragraph_style_stack.append('rststyle-bulletitem') else: el = SubElement(self.current_element, 'text:list', attrib={ 'text:style-name': 'rststyle-bulletlist', }) self.paragraph_style_stack.append('rststyle-bulletitem') self.set_current_element(el) | 70476cda555c9cc167786150a5d65f22dd78a366 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5620/70476cda555c9cc167786150a5d65f22dd78a366/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
70,
19994,
67,
1098,
12,
2890,
16,
756,
4672,
468,
625,
10304,
2668,
861,
3757,
67,
70,
19994,
67,
1098,
6134,
309,
365,
18,
267,
67,
2121,
67,
792,
67,
3980,
30,
309,
756,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3757,
67,
70,
19994,
67,
1098,
12,
2890,
16,
756,
4672,
468,
625,
10304,
2668,
861,
3757,
67,
70,
19994,
67,
1098,
6134,
309,
365,
18,
267,
67,
2121,
67,
792,
67,
3980,
30,
309,
756,... |
if gtk.main_level(): gtk.main_quit() | if _main_loop: _main_loop.quit() else: if gtk.main_level(): gtk.main_quit() | def _timeout_cb(self): if self.success: # dispose of previous waiters. return False self._timeout_count += 1 self.poll() if self._timeout_count >= self.timeout or self.success: try: if gtk.main_level(): gtk.main_quit() except RuntimeError: # In Mandriva RuntimeError exception is thrown # If, gtk.main was already quit pass return False return True | 4d402ab8b98837e718d887827d3d5e283cd599e1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/4d402ab8b98837e718d887827d3d5e283cd599e1/waiters.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4538,
67,
7358,
12,
2890,
4672,
309,
365,
18,
4768,
30,
468,
15825,
434,
2416,
30487,
18,
327,
1083,
365,
6315,
4538,
67,
1883,
1011,
404,
365,
18,
13835,
1435,
309,
365,
6315,
45... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4538,
67,
7358,
12,
2890,
4672,
309,
365,
18,
4768,
30,
468,
15825,
434,
2416,
30487,
18,
327,
1083,
365,
6315,
4538,
67,
1883,
1011,
404,
365,
18,
13835,
1435,
309,
365,
6315,
45... |
use_classifiers = self.context.getUseClassifiers(): | use_classifiers = self.context.getUseClassifiers() | def parent_url(url): return '/'.join(url.split('/')[:-2]) | 57a4855c64e0e8a7f42397469ca27147602523f9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12516/57a4855c64e0e8a7f42397469ca27147602523f9/root.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
982,
67,
718,
12,
718,
4672,
327,
2023,
18,
5701,
12,
718,
18,
4939,
2668,
2473,
13,
10531,
17,
22,
5717,
225,
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,
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,
982,
67,
718,
12,
718,
4672,
327,
2023,
18,
5701,
12,
718,
18,
4939,
2668,
2473,
13,
10531,
17,
22,
5717,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
NotificationToast(self.specto, _("The watch, <b>%s</b>, has a problem. You may need to check the error log.") % str(self.name), self.specto.PATH + "icons/notifier/big/error.png", 0, 0, 5000, urgency="critical") | NotificationToast(self.specto, _("The watch, <b>%s</b>, has a problem. You may need to check the error log.") % str(self.name), self.specto.PATH + "icons/notifier/big/error.png", urgency="critical") | def update(self, lock): """ Check if an error sound has to be played or if a watch has to be flagged updated. """ #play error sound if self.error == True and self.specto.conf_pref.get_entry("/use_problem_sound", "boolean"): problem_sound = self.specto.conf_pref.get_entry("/problem_sound", "string") gnome.sound_play(problem_sound) pop_toast = self.specto.conf_pref.get_entry("/pop_toast", "boolean") if (pop_toast == True) and (self.specto.GTK): NotificationToast(self.specto, _("The watch, <b>%s</b>, has a problem. You may need to check the error log.") % str(self.name), self.specto.PATH + "icons/notifier/big/error.png", 0, 0, 5000, urgency="critical") #call update function if watch was updated if self.actually_updated:#we want to notify, but ONLY if it has not been marked as updated already try: self.specto.toggle_updated(self.id) #call the main function to update the notifier entry. We need to use a try statement in case the watch was already toggled in the notifier entry. except: if self.specto.DEBUG : self.specto.logger.log(_("Watch \"%s\" is already marked as updated in the notifier") % self.name, "info", self.__class__) else: pass self.notify() self.updated = True self.actually_updated = False self.timer_id = gobject.timeout_add(self.refresh, self.thread_update) lock.release() | c49972c30e3848c1267c798e6634d5c5d830006d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10818/c49972c30e3848c1267c798e6634d5c5d830006d/watch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
16,
2176,
4672,
3536,
2073,
309,
392,
555,
14190,
711,
358,
506,
6599,
329,
578,
309,
279,
4267,
711,
358,
506,
2982,
2423,
3526,
18,
3536,
468,
1601,
555,
14190,
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,
1089,
12,
2890,
16,
2176,
4672,
3536,
2073,
309,
392,
555,
14190,
711,
358,
506,
6599,
329,
578,
309,
279,
4267,
711,
358,
506,
2982,
2423,
3526,
18,
3536,
468,
1601,
555,
14190,
309,
... |
return self._executeSingleStorageElementFunction(storageElementName,physicalFile,'removeFile') else: return self._executeStorageElementFunction(storageElementName,physicalFile,'removeFile') def prestageStorageFile(self,physicalFile,storageElementName,singleFile=False): | return self._executeSingleStorageElementFunction( storageElementName, physicalFile, 'removeFile' ) else: return self._executeStorageElementFunction( storageElementName, physicalFile, 'removeFile' ) def prestageStorageFile( self, physicalFile, storageElementName, singleFile=False ): | def removeStorageFile(self,physicalFile,storageElementName,singleFile=False): """ Remove physical files 'physicalFile' is the pfn(s) to be removed 'storageElementName' is the Storage Element """ if singleFile: return self._executeSingleStorageElementFunction(storageElementName,physicalFile,'removeFile') else: return self._executeStorageElementFunction(storageElementName,physicalFile,'removeFile') | 9fabceb719d19d46d8b75011d2932552dbe360f9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/9fabceb719d19d46d8b75011d2932552dbe360f9/ReplicaManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
3245,
812,
12,
2890,
16,
20441,
812,
16,
5697,
30584,
16,
7526,
812,
33,
8381,
4672,
3536,
3581,
11640,
1390,
225,
296,
20441,
812,
11,
353,
326,
293,
4293,
12,
87,
13,
358,
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,
1206,
3245,
812,
12,
2890,
16,
20441,
812,
16,
5697,
30584,
16,
7526,
812,
33,
8381,
4672,
3536,
3581,
11640,
1390,
225,
296,
20441,
812,
11,
353,
326,
293,
4293,
12,
87,
13,
358,
506,... |
self.connect_controls() | self.connect_or_disconnect_signals(True) | def Enter(self): self.status_msg("preparing to enter %s..." % self.msg_modename) # this msg won't last long enough to be seen, if all goes well self.clear() ##e see comment there self.initial_down = self.o.down self.initial_out = self.o.out reinit_extrude_controls(self.w, self.o, length = 7.0, attr_target = self) basicMode.Enter(self) | 430a3ed23a8ca34ca31349a23e89006f9447699d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/430a3ed23a8ca34ca31349a23e89006f9447699d/extrudeMode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15439,
12,
2890,
4672,
365,
18,
2327,
67,
3576,
2932,
1484,
12583,
358,
6103,
738,
87,
7070,
738,
365,
18,
3576,
67,
1711,
1069,
13,
468,
333,
1234,
8462,
1404,
1142,
1525,
7304,
358,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15439,
12,
2890,
4672,
365,
18,
2327,
67,
3576,
2932,
1484,
12583,
358,
6103,
738,
87,
7070,
738,
365,
18,
3576,
67,
1711,
1069,
13,
468,
333,
1234,
8462,
1404,
1142,
1525,
7304,
358,
... |
path=pywbem.CIMInstanceName('CIM_Namespace', | path=CIMInstanceName('CIM_Namespace', | def _create_ns(p, handle, ns): # Figure out the flavor of cim server cimom_type = None try: inames = handle.EnumerateInstanceNames('__Namespace', namespace='root') inames = [x['name'] for x in inames] if 'PG_InterOp' in inames: cimom_type = 'pegasus' except pywbem.CIMError, ce: if ce.args[0] != pywbem.CIM_ERR_NOT_FOUND: ce.file_line = (p.parser.file, p.lexer.lineno) raise if not cimom_type: try: inames = handle.EnumerateInstanceNames('CIM_Namespace', namespace='Interop') inames = [x['name'] for x in inames] cimom_type = 'proper' except pywbem.CIMError, ce: ce.file_line = (p.parser.file, p.lexer.lineno) raise if not cimom_type: ce = pywbem.CIMError(pywbem.CIM_ERR_FAILED, 'Unable to determine CIMOM type') ce.file_line = (p.parser.file, p.lexer.lineno) raise ce if cimom_type == 'pegasus': nsl = ns.split('/') if nsl[0] != 'root': ce = pywbem.CIMError(pywbem.CIM_ERR_FAILED, 'Pegasus namespaces must start with "root"') ce.file_line = (p.parser.file, p.lexer.lineno) raise ce for i in range(1, len(nsl)): containing_ns = '/'.join(nsl[:i]) inames = handle.EnumerateInstanceNames('__Namespace', namespace=containing_ns) inames = [x['name'] for x in inames] if nsl[i] not in inames: inst = pywbem.CIMInstance('__Namespace', properties={'Name':nsl[i]}, path=pywbem.CIMInstanceName('__Namespace', keybindings={'Name':nsl[i]}, namespace=containing_ns)) handle.CreateInstance(inst) elif cimom_type == 'proper': inst = pywbem.CIMInstance('CIM_Namespace', properties={'Name': ns}, path=pywbem.CIMInstanceName('CIM_Namespace', namespace='root', keybindings={'Name':ns})) handle.CreateInstance(inst) | d1a547f385819908b15c26774bc5fc75671b5883 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10648/d1a547f385819908b15c26774bc5fc75671b5883/mof_compiler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2640,
67,
2387,
12,
84,
16,
1640,
16,
3153,
4672,
468,
18818,
596,
326,
19496,
434,
276,
381,
1438,
276,
381,
362,
67,
723,
273,
599,
775,
30,
316,
753,
273,
1640,
18,
3572,
126... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2640,
67,
2387,
12,
84,
16,
1640,
16,
3153,
4672,
468,
18818,
596,
326,
19496,
434,
276,
381,
1438,
276,
381,
362,
67,
723,
273,
599,
775,
30,
316,
753,
273,
1640,
18,
3572,
126... |
self._file.seek(pos+8) return self._file.read(8) | self._file.seek(pos) h = self._file.read(16) assert oid == h[:8] return h[8:] | def _getSerial(self, oid, pos): self._file.seek(pos+8) return self._file.read(8) | 91c7c62985ee663d922d41d132660c71bbfcb526 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/91c7c62985ee663d922d41d132660c71bbfcb526/FileStorage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
6342,
12,
2890,
16,
7764,
16,
949,
4672,
365,
6315,
768,
18,
16508,
12,
917,
15,
28,
13,
327,
365,
6315,
768,
18,
896,
12,
28,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
6342,
12,
2890,
16,
7764,
16,
949,
4672,
365,
6315,
768,
18,
16508,
12,
917,
15,
28,
13,
327,
365,
6315,
768,
18,
896,
12,
28,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
adjustment[index] = (adjustment[index] / magnitude) * eta adjustment[index] = adjustment[index] * (ranges[index][1] - ranges[index][0]) | adjustment[index] = (adjustment[index] / magnitude) * eta adjustment[index] = adjustment[index] * (ranges[index][1] - ranges[index][0]) change = center[index] + adjustment[index] if change < ranges[index][0]: adjustment[index] = ranges[index][0] - center[index] if change > ranges[index][1]: adjustment[index] = ranges[index][1] - center[index] | def computeNextMove(self, center, ranges, samples): '''Returns the center of the next distribution.''' | 6bfb350da95b11d6e0fcb5644fb0f75c8a0a4044 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13791/6bfb350da95b11d6e0fcb5644fb0f75c8a0a4044/Strategy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3671,
2134,
7607,
12,
2890,
16,
4617,
16,
7322,
16,
5216,
4672,
9163,
1356,
326,
4617,
434,
326,
1024,
7006,
1093,
6309,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
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,
3671,
2134,
7607,
12,
2890,
16,
4617,
16,
7322,
16,
5216,
4672,
9163,
1356,
326,
4617,
434,
326,
1024,
7006,
1093,
6309,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
import sys, traceback | import traceback | def _run_exitfuncs(): """run any registered exit functions _exithandlers is traversed in reverse order so functions are executed last in, first out. """ exc_info = None while _exithandlers: func, targs, kargs = _exithandlers.pop() try: func(*targs, **kargs) except SystemExit: exc_info = sys.exc_info() except: import sys, traceback print >> sys.stderr, "Error in atexit._run_exitfuncs:" traceback.print_exc() exc_info = sys.exc_info() if exc_info is not None: raise exc_info[0], exc_info[1], exc_info[2] | a9ef5e565d3e33e3a6f410d9c610ffe5bdc6c474 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a9ef5e565d3e33e3a6f410d9c610ffe5bdc6c474/atexit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2681,
67,
8593,
17728,
13332,
3536,
2681,
1281,
4104,
2427,
4186,
225,
389,
338,
483,
464,
3135,
353,
29062,
316,
4219,
1353,
1427,
4186,
854,
7120,
1142,
316,
16,
1122,
596,
18,
35... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2681,
67,
8593,
17728,
13332,
3536,
2681,
1281,
4104,
2427,
4186,
225,
389,
338,
483,
464,
3135,
353,
29062,
316,
4219,
1353,
1427,
4186,
854,
7120,
1142,
316,
16,
1122,
596,
18,
35... |
sys.stderr.write('> RTS %s\n' % (self.rts_state and 'active' or 'inactive')) sys.stderr.write('> DTR %s\n' % (self.dtr_state and 'active' or 'inactive')) sys.stderr.write('> BREAK %s\n' % (self.break_state and 'active' or 'inactive')) sys.stderr.write('> software flow control %s\n' % (self.serial.xonxoff and 'active' or 'inactive')) sys.stderr.write('> hardware flow control %s\n' % (self.serial.rtscts and 'active' or 'inactive')) | sys.stderr.write('--- RTS %s\n' % (self.rts_state and 'active' or 'inactive')) sys.stderr.write('--- DTR %s\n' % (self.dtr_state and 'active' or 'inactive')) sys.stderr.write('--- BREAK %s\n' % (self.break_state and 'active' or 'inactive')) sys.stderr.write('--- software flow control %s\n' % (self.serial.xonxoff and 'active' or 'inactive')) sys.stderr.write('--- hardware flow control %s\n' % (self.serial.rtscts and 'active' or 'inactive')) sys.stderr.write('--- data escaping: %s\n' % (REPR_MODES[self.repr_mode],)) sys.stderr.write('--- linefeed: %s\n' % (LF_MODES[self.convert_outgoing],)) | def dump_port_settings(self): sys.stderr.write("\n> Settings: %s %s,%s,%s,%s\n" % ( self.serial.portstr, self.serial.baudrate, self.serial.bytesize, self.serial.parity, self.serial.stopbits, )) sys.stderr.write('> RTS %s\n' % (self.rts_state and 'active' or 'inactive')) sys.stderr.write('> DTR %s\n' % (self.dtr_state and 'active' or 'inactive')) sys.stderr.write('> BREAK %s\n' % (self.break_state and 'active' or 'inactive')) sys.stderr.write('> software flow control %s\n' % (self.serial.xonxoff and 'active' or 'inactive')) sys.stderr.write('> hardware flow control %s\n' % (self.serial.rtscts and 'active' or 'inactive')) | 0f6a48ec722750ef078f74b1aa09e2fb405fc04e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10955/0f6a48ec722750ef078f74b1aa09e2fb405fc04e/miniterm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4657,
67,
655,
67,
4272,
12,
2890,
4672,
2589,
18,
11241,
18,
2626,
31458,
82,
34,
8709,
30,
738,
87,
225,
738,
87,
15529,
87,
15529,
87,
15529,
87,
64,
82,
6,
738,
261,
365,
18,
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,
4657,
67,
655,
67,
4272,
12,
2890,
4672,
2589,
18,
11241,
18,
2626,
31458,
82,
34,
8709,
30,
738,
87,
225,
738,
87,
15529,
87,
15529,
87,
15529,
87,
64,
82,
6,
738,
261,
365,
18,
8... |
sendmail_smtp(to_addrs, subj, msg, from_addr) else: sendmail_pipe(to_addrs, subj, msg, from_addr) def sendmail_smtp ( to_addrs, subj, msg, from_addr = Configuration.FromAddress ): | sendmail_smtp(to_addrs, messagetext, envelope_sender) elif _method == 'qmail': qmail_pipe(to_addrs, messagetext, envelope_sender) else: sendmail_pipe(to_addrs, messagetext, envelope_sender) def sendmail_smtp ( to_addrs, msg, envelope_sender): | def sendmail ( to_addrs, subj, msg, from_addr = Configuration.FromAddress ): """** <p>The general-purpose sendmail function, which is called by the STML <:sendmail:> tag, or directly by Python code.</p> <p><tt>to_addrs</tt> should be a list or tuple of email address strings. <tt>subj</tt> must be a string, although it may be empty. <tt>msg</tt> is a string containing the body of the message; it can be empty. <tt>from_addr</tt> is a single mail address string; it defaults to the value of the <tt>FromAddress</tt> variable in <tt>templating.conf</tt>.</p> <p>This function returns nothing on success, and raises a <code>MailError</code> on any mail failure.</p> """ # if they supplied only a string as to_Addrs (i.e. one address), # make it a list if type(to_addrs) == type(''): to_addrs = [to_addrs] # dispatch to correct function based on method if _method == 'relay': sendmail_smtp(to_addrs, subj, msg, from_addr) else: sendmail_pipe(to_addrs, subj, msg, from_addr) | 55a7d3c06f6110b021bbed1151c6a0f4334d53cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2304/55a7d3c06f6110b021bbed1151c6a0f4334d53cf/MailServices.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
4408,
261,
358,
67,
23305,
16,
15333,
16,
1234,
16,
628,
67,
4793,
273,
4659,
18,
1265,
1887,
262,
30,
3536,
636,
411,
84,
34,
1986,
7470,
17,
22987,
1366,
4408,
445,
16,
1492,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1366,
4408,
261,
358,
67,
23305,
16,
15333,
16,
1234,
16,
628,
67,
4793,
273,
4659,
18,
1265,
1887,
262,
30,
3536,
636,
411,
84,
34,
1986,
7470,
17,
22987,
1366,
4408,
445,
16,
1492,
... |
return http.Response(stream=s) | return HTMLResponse(stream=s) | def render(self, ctx): s = notebook.worksheet_html(self.name, do_print=True) return http.Response(stream=s) | 5da3b1cd72cd4a94421b8bc914d7957cdbe6b56d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/5da3b1cd72cd4a94421b8bc914d7957cdbe6b56d/twist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
1103,
4672,
272,
273,
14718,
18,
1252,
8118,
67,
2620,
12,
2890,
18,
529,
16,
741,
67,
1188,
33,
5510,
13,
327,
1062,
18,
1064,
12,
3256,
33,
87,
13,
2,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
1103,
4672,
272,
273,
14718,
18,
1252,
8118,
67,
2620,
12,
2890,
18,
529,
16,
741,
67,
1188,
33,
5510,
13,
327,
1062,
18,
1064,
12,
3256,
33,
87,
13,
2,
-100,
-... |
errors.append( 'Room <strong>%s</strong> does not have all resources that <strong>%s</strong> needs (or it is too small) and you have opted not to compromise. Try a better room.' % (base_room.name, self) ) | errors.append( u'Room <strong>%s</strong> does not have all resources that <strong>%s</strong> needs (or it is too small) and you have opted not to compromise. Try a better room.' % (base_room.name, self) ) | def assign_room(self, base_room, compromise=True, clear_others=False): """ Assign the classroom given, except at the times needed by this class. """ rooms_to_assign = base_room.identical_resources().filter(event__in=list(self.meeting_times.all())) status = True errors = [] if clear_others: self.clearRooms() if compromise is False: # Check that the room satisfies all needs of the class. result = base_room.satisfies_requests(self) if result[0] is False: status = False errors.append( 'Room <strong>%s</strong> does not have all resources that <strong>%s</strong> needs (or it is too small) and you have opted not to compromise. Try a better room.' % (base_room.name, self) ) if rooms_to_assign.count() != self.meeting_times.count(): status = False errors.append( 'Room <strong>%s</strong> is not available at the times requested by <strong>%s</strong>. Bug the webmasters to find out why you were allowed to assign this room.' % (base_room.name, self) ) for r in rooms_to_assign: r.clear_schedule_cache(self.parent_program) result = self.assignClassRoom(r) if not result: status = False occupiers_str = '' occupiers_set = base_room.assignments() if occupiers_set.count() > 0: # We really shouldn't have to test for this, but I guess it's safer not to assume... -ageng 2008-11-02 occupiers_str = ' by <strong>%s</strong>' % (occupiers_set[0].target or occupiers_set[0].target_subj) errors.append( 'Error: Room <strong>%s</strong> is already taken%s. Please assign a different one to <strong>%s</strong>. While you\'re at it, bug the webmasters to find out why you were allowed to assign a conflict.' % ( base_room.name, occupiers_str, self ) ) return (status, errors) | ac4e32124e9cb5f77723bb7e7325ac6d02285935 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12041/ac4e32124e9cb5f77723bb7e7325ac6d02285935/class_.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2683,
67,
13924,
12,
2890,
16,
1026,
67,
13924,
16,
1161,
4108,
33,
5510,
16,
2424,
67,
28197,
33,
8381,
4672,
3536,
12093,
326,
667,
13924,
864,
16,
1335,
622,
326,
4124,
3577,
635,
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,
2683,
67,
13924,
12,
2890,
16,
1026,
67,
13924,
16,
1161,
4108,
33,
5510,
16,
2424,
67,
28197,
33,
8381,
4672,
3536,
12093,
326,
667,
13924,
864,
16,
1335,
622,
326,
4124,
3577,
635,
3... |
data.SetData(dataFormat, '') | data.SetData(self.itemFormat, '') | def PasteData(self, data): """ Determine what kind of object is in data, paste accordingly. """ dataFormat = None for format in data.GetAllFormats(): if data.GetDataSize(format) > 0: dataFormat = format break if dataFormat is not None: if dataFormat.GetType() == self.fileFormat.GetType(): self.OnFilePaste() elif dataFormat == self.dataFormats[OUTLOOK_EXPRESS_DRAG_FORMAT]: self.OnEmailPaste( self.dataObjects[OUTLOOK_EXPRESS_DRAG_FORMAT].GetData()) else: self.OnItemPaste() # based on Robin's suggestion at: # http://aspn.activestate.com/ASPN/Mail/Message/wxPython-users/1989308 # composite data objects don't empty their last dragged item, # so their data needs to be set to '' by hand. data.SetData(dataFormat, '') | 24d11e9ef367b80220d869b5371beacfb49edbe4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/24d11e9ef367b80220d869b5371beacfb49edbe4/DragAndDrop.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
453,
14725,
751,
12,
2890,
16,
501,
4672,
3536,
10229,
4121,
3846,
434,
733,
353,
316,
501,
16,
19401,
15905,
18,
3536,
501,
1630,
273,
599,
364,
740,
316,
501,
18,
21413,
8976,
13332,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
453,
14725,
751,
12,
2890,
16,
501,
4672,
3536,
10229,
4121,
3846,
434,
733,
353,
316,
501,
16,
19401,
15905,
18,
3536,
501,
1630,
273,
599,
364,
740,
316,
501,
18,
21413,
8976,
13332,
... |
self.process_wiki_text(refuri) | self.process_wiki_text("[[%s]]" % refuri) | def visit_reference(self, node): """ Pass links to MoinMoin to get the correct wiki space url. Extract the url and pass it on to the html4css1 writer to handle. Inline images are also handled by visit_image. Not sure what the "drawing:" link scheme is used for, so for now it is handled here. | 7d1383967162b84a4a648c93b16a971a5577be3f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/888/7d1383967162b84a4a648c93b16a971a5577be3f/text_rst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
6180,
12,
2890,
16,
756,
4672,
3536,
10311,
4716,
358,
490,
885,
49,
885,
358,
336,
326,
3434,
9050,
3476,
880,
18,
8152,
326,
880,
471,
1342,
518,
603,
358,
326,
1729,
24,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3757,
67,
6180,
12,
2890,
16,
756,
4672,
3536,
10311,
4716,
358,
490,
885,
49,
885,
358,
336,
326,
3434,
9050,
3476,
880,
18,
8152,
326,
880,
471,
1342,
518,
603,
358,
326,
1729,
24,
... |
title = _('For&ward'), | title = _(u'For&ward'), | def makeVisibleHourMenuItems(parcel): """ Create the 'Visible Hours' submenu. Should look like: Automatic --------- 5 hours 6 hours | 043a08a77771b31713425ec3f48a9c0186570e1d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/043a08a77771b31713425ec3f48a9c0186570e1d/menus.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
6207,
13433,
4599,
3126,
12,
1065,
2183,
4672,
3536,
1788,
326,
296,
6207,
670,
4390,
11,
27539,
18,
9363,
2324,
3007,
30,
225,
11809,
4941,
300,
788,
1381,
7507,
1666,
7507,
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,
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,
1221,
6207,
13433,
4599,
3126,
12,
1065,
2183,
4672,
3536,
1788,
326,
296,
6207,
670,
4390,
11,
27539,
18,
9363,
2324,
3007,
30,
225,
11809,
4941,
300,
788,
1381,
7507,
1666,
7507,
2,
-1... |
self.SubindexGrid.Bind(wx.grid.EVT_GRID_CELL_LEFT_CLICK, self.OnSubindexGridCellLeftClick) | self.SubindexGrid.Bind(wx.grid.EVT_GRID_CELL_LEFT_CLICK, self.OnSubindexGridCellLeftClick) | def _init_ctrls(self, prnt): wx.SplitterWindow.__init__(self, id=ID_EDITINGPANEL, name='MainSplitter', parent=prnt, point=wx.Point(0, 0), size=wx.Size(-1, -1), style=wx.SP_3D) self._init_utils() self.SetNeedUpdating(True) self.SetMinimumPaneSize(1) | e0bf7e2755a322b4665274404afad0c20c5e5cd7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11017/e0bf7e2755a322b4665274404afad0c20c5e5cd7/subindextable.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
67,
16277,
87,
12,
2890,
16,
846,
496,
4672,
7075,
18,
26738,
3829,
16186,
2738,
972,
12,
2890,
16,
612,
33,
734,
67,
10776,
1360,
30819,
2247,
16,
508,
2218,
6376,
26738,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
67,
16277,
87,
12,
2890,
16,
846,
496,
4672,
7075,
18,
26738,
3829,
16186,
2738,
972,
12,
2890,
16,
612,
33,
734,
67,
10776,
1360,
30819,
2247,
16,
508,
2218,
6376,
26738,
2... |
""" called when building a SELECT statment, position is just before column list Firebird puts the limit and offset right after the select...thanks for adding the visit_select_precolumns!!!""" | """Called when building a SELECT statement, position is just before column list Firebird puts the limit and offset right after the select...""" | def visit_select_precolumns(self, select): """ called when building a SELECT statment, position is just before column list Firebird puts the limit and offset right after the select...thanks for adding the visit_select_precolumns!!!""" result = "" if select.limit: result += " FIRST %d " % select.limit if select.offset: result +=" SKIP %d " % select.offset if select.distinct: result += " DISTINCT " return result | 046703498161bc3cd3851e24e20ce87796440d31 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1074/046703498161bc3cd3851e24e20ce87796440d31/firebird.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
4025,
67,
1484,
5112,
12,
2890,
16,
2027,
4672,
3536,
8185,
1347,
10504,
279,
9111,
3021,
16,
1754,
353,
2537,
1865,
1057,
666,
10151,
31245,
8200,
326,
1800,
471,
1384,
2145,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3757,
67,
4025,
67,
1484,
5112,
12,
2890,
16,
2027,
4672,
3536,
8185,
1347,
10504,
279,
9111,
3021,
16,
1754,
353,
2537,
1865,
1057,
666,
10151,
31245,
8200,
326,
1800,
471,
1384,
2145,
... |
add(link(request, quotedname + '?action=info', _('Info', formatted=False))) | add(link(request, quotedname + '?action=info', _('Info', formatted=False))) | def editbar(self, d): """ Assemble the page edit bar. | ffeb30f5bf661420132dc13c04f7ab4fee14ba11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/888/ffeb30f5bf661420132dc13c04f7ab4fee14ba11/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3874,
3215,
12,
2890,
16,
302,
4672,
3536,
2970,
10045,
326,
1363,
3874,
4653,
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,
... | [
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3874,
3215,
12,
2890,
16,
302,
4672,
3536,
2970,
10045,
326,
1363,
3874,
4653,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
"\n"+\ | def createHtmlTableLegend(self, libsOnly): | 14ce9fd4920947e5f8b1813e1f49ee4adffd7eaf /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1130/14ce9fd4920947e5f8b1813e1f49ee4adffd7eaf/TrilinosDependencies.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
4353,
1388,
16812,
12,
2890,
16,
15042,
3386,
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,
... | [
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,
752,
4353,
1388,
16812,
12,
2890,
16,
15042,
3386,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
noRestart = True | kwargs['noRestart'] = True | def runCommand(self, cfg, argSet, otherArgs): kwargs = { 'systemModel': False } model = cml.CML(cfg) modelFile = systemmodel.SystemModelFile(model) | 2615b5965293e4b3acffbd3b5bfee51beb091724 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8747/2615b5965293e4b3acffbd3b5bfee51beb091724/conarycmd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31933,
12,
2890,
16,
2776,
16,
1501,
694,
16,
1308,
2615,
4672,
1205,
273,
288,
296,
4299,
1488,
4278,
1083,
289,
938,
273,
276,
781,
18,
39,
1495,
12,
7066,
13,
938,
812,
273,
2619,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
31933,
12,
2890,
16,
2776,
16,
1501,
694,
16,
1308,
2615,
4672,
1205,
273,
288,
296,
4299,
1488,
4278,
1083,
289,
938,
273,
276,
781,
18,
39,
1495,
12,
7066,
13,
938,
812,
273,
2619,
... |
@login_required | def _get_mail_template(issue): """Helper to return the template and context for an email. If this is the first email for this issue, a template that lists the reviewers, description and files is used. """ context = {} if issue.message_set.count(1) == 0: template = 'mails/review.txt' files, patch = _get_affected_files(issue) context.update({'files': files, 'patch': patch}) else: template = 'mails/comment.txt' return template, context | 264566c645d8695a06618b4b815fa86679143ee3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/476/264566c645d8695a06618b4b815fa86679143ee3/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
4408,
67,
3202,
12,
13882,
4672,
3536,
2276,
358,
327,
326,
1542,
471,
819,
364,
392,
2699,
18,
225,
971,
333,
353,
326,
1122,
2699,
364,
333,
5672,
16,
279,
1542,
716,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4408,
67,
3202,
12,
13882,
4672,
3536,
2276,
358,
327,
326,
1542,
471,
819,
364,
392,
2699,
18,
225,
971,
333,
353,
326,
1122,
2699,
364,
333,
5672,
16,
279,
1542,
716,
... | |
yield "<option value='%s'>%s -- %s</option>" % (host, hosts[host], host) | yield "<option value='%s'>%s -- %s</option>\n" % (host, hosts[host], host) | def main_menu(): """main page""" yield "<form method='GET'>" yield "<div id='build-menu'>" yield "<select name='host'>" for host in hosts: yield "<option value='%s'>%s -- %s</option>" % (host, hosts[host], host) yield "</select>" yield "<select name='tree'>" for tree, t in trees.iteritems(): yield "<option value='%s'>%s:%s</option>" % (tree, tree, t.branch) yield "</select>" yield "<select name='compiler'>" for compiler in compilers: yield "<option>%s</option>" % compiler yield "</select>" yield "<br/>" yield "<input type='submit' name='function' value='View Build'/>" yield "<input type='submit' name='function' value='View Host'/>" yield "<input type='submit' name='function' value='Recent Checkins'/>" yield "<input type='submit' name='function' value='Summary'/>" yield "<input type='submit' name='function' value='Recent Builds'/>" yield "</div>" yield "</form>" | 2f96994b0560407d1d9a82cb63b4ca80644ab796 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7314/2f96994b0560407d1d9a82cb63b4ca80644ab796/build.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
67,
5414,
13332,
3536,
5254,
1363,
8395,
225,
2824,
3532,
687,
707,
2218,
3264,
28533,
2824,
3532,
2892,
612,
2218,
3510,
17,
5414,
28533,
2824,
3532,
4025,
508,
2218,
2564,
28533,
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,
2774,
67,
5414,
13332,
3536,
5254,
1363,
8395,
225,
2824,
3532,
687,
707,
2218,
3264,
28533,
2824,
3532,
2892,
612,
2218,
3510,
17,
5414,
28533,
2824,
3532,
4025,
508,
2218,
2564,
28533,
3... |
tr = ogrtest.check_features_against_list( sql_lyr, 'prfedea', [ '32' ] ) | tr = ogrtest.check_features_against_list( sql_lyr, 'prfedea', [ '2' ] ) | def ogr_mysql_6(): if gdaltest.mysql_ds is None: return 'skip' sql_lyr = gdaltest.mysql_ds.ExecuteSQL( "select * from tpoly where prfedea = '2'" ) # FIXME. Should be '2' instead of '32' tr = ogrtest.check_features_against_list( sql_lyr, 'prfedea', [ '32' ] ) if tr: sql_lyr.ResetReading() feat_read = sql_lyr.GetNextFeature() if ogrtest.check_feature_geometry( feat_read, 'MULTILINESTRING ((5.00121349 2.99853132,5.00121349 1.99853133),(5.00121349 1.99853133,5.00121349 0.99853133),(3.00121351 1.99853127,5.00121349 1.99853133),(5.00121349 1.99853133,6.00121348 1.99853135))' ) != 0: tr = 0 feat_read.Destroy() sql_lyr.ResetReading() geom = ogr.CreateGeometryFromWkt( \ 'LINESTRING(-10 -10,0 0)' ) sql_lyr.SetSpatialFilter( geom ) geom.Destroy() if sql_lyr.GetFeatureCount() != 0: gdaltest.post_reason( 'GetFeatureCount() returned %d instead of 0' % sql_lyr.GetFeatureCount() ) return 'fail' if sql_lyr.GetNextFeature() != None: gdaltest.post_reason( 'GetNextFeature() didn not return None' ) return 'fail' gdaltest.mysql_ds.ReleaseResultSet( sql_lyr ) if tr: return 'success' else: return 'fail' | 2d7763ec1708c3a8c1851ac619e2f1c13eb01124 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10289/2d7763ec1708c3a8c1851ac619e2f1c13eb01124/ogr_mysql.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
320,
3197,
67,
12527,
67,
26,
13332,
225,
309,
15551,
2390,
395,
18,
12527,
67,
2377,
353,
599,
30,
327,
296,
7457,
11,
225,
1847,
67,
715,
86,
273,
15551,
2390,
395,
18,
12527,
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,
320,
3197,
67,
12527,
67,
26,
13332,
225,
309,
15551,
2390,
395,
18,
12527,
67,
2377,
353,
599,
30,
327,
296,
7457,
11,
225,
1847,
67,
715,
86,
273,
15551,
2390,
395,
18,
12527,
67,
... |
for line in range(len(lyxin)): lyxin[line] = lyxin[line].replace(fr, to) | if fr == '@.*@': for line in range(len(lyxin)): lyxin[line] = re.sub('@.*@', to, lyxin[line]) else: for line in range(len(lyxin)): lyxin[line] = lyxin[line].replace(fr, to) | def createLaTeXConfig(): ''' create LaTeXConfig.lyx ''' # if chkconfig.sed does not exist (because LaTeX did not run), # then provide a standard version. if not os.path.isfile('chkconfig.sed'): writeToFile('chkconfig.sed', '##s/@.*@/???/g\n') print "creating packages.lst" # if packages.lst does not exist (because LaTeX did not run), # then provide a standard version. if not os.path.isfile('packages.lst'): writeToFile('packages.lst', ''' | 7f6a2747424dc1ff1cce7f3c683da43ffed37724 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7514/7f6a2747424dc1ff1cce7f3c683da43ffed37724/configure.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
30745,
21575,
60,
809,
13332,
9163,
752,
21072,
21575,
60,
809,
18,
715,
92,
9163,
468,
309,
15000,
1425,
18,
730,
1552,
486,
1005,
261,
26274,
21072,
21575,
60,
5061,
486,
1086,
36... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
30745,
21575,
60,
809,
13332,
9163,
752,
21072,
21575,
60,
809,
18,
715,
92,
9163,
468,
309,
15000,
1425,
18,
730,
1552,
486,
1005,
261,
26274,
21072,
21575,
60,
5061,
486,
1086,
36... |
otr = self.to_other(elem) | otr = self.other(elem, namespace, localtag) | def read(self): """Parse the phyloXML file and create a single Phyloxml object.""" phyloxml = Tree.Phyloxml(dict((local(key), val) for key, val in self.root.items())) other_depth = 0 for event, elem in self.context: namespace, localtag = split_namespace(elem.tag) if event == 'start': if namespace != NAMESPACES['phy']: other_depth += 1 continue if localtag == 'phylogeny': phylogeny = self._parse_phylogeny(elem) phyloxml.phylogenies.append(phylogeny) if event == 'end' and namespace != NAMESPACES['phy']: # Deal with items not specified by phyloXML other_depth -= 1 if other_depth == 0: # We're directly under the root node -- evaluate otr = self.to_other(elem) phyloxml.other.append(otr) self.root.clear() return phyloxml | 5f38465441061de22d67bc9df2281f70d7ac37ce /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7167/5f38465441061de22d67bc9df2281f70d7ac37ce/PhyloXMLIO.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
12,
2890,
4672,
3536,
3201,
326,
1844,
93,
383,
4201,
585,
471,
752,
279,
2202,
4360,
93,
383,
2902,
733,
12123,
1844,
93,
383,
2902,
273,
4902,
18,
3731,
93,
383,
2902,
12,
1576,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3536,
3201,
326,
1844,
93,
383,
4201,
585,
471,
752,
279,
2202,
4360,
93,
383,
2902,
733,
12123,
1844,
93,
383,
2902,
273,
4902,
18,
3731,
93,
383,
2902,
12,
1576,... |
return max( (g.longest_path(s = s, t = t, weighted = weighted, algorithm = algorithm) for g in self.connected_components_subgraphs() ), key = lambda x : x.order() ) | return max((g.longest_path(s=s, t=t, weighted=weighted, algorithm=algorithm) for g in self.connected_components_subgraphs()), key=lambda x: x.order()) | def longest_path(self, s = None, t = None, weighted = False, algorithm = "MILP", solver = None, verbose = 0): r""" Returns a longest path of ``self``. | 1ce3f98f3b3a6c76baa509a4ebc0110ea7853d74 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/1ce3f98f3b3a6c76baa509a4ebc0110ea7853d74/generic_graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12163,
67,
803,
12,
2890,
16,
272,
273,
599,
16,
268,
273,
599,
16,
13747,
273,
1083,
16,
4886,
273,
315,
49,
2627,
52,
3113,
12776,
273,
599,
16,
3988,
273,
374,
4672,
436,
8395,
28... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12163,
67,
803,
12,
2890,
16,
272,
273,
599,
16,
268,
273,
599,
16,
13747,
273,
1083,
16,
4886,
273,
315,
49,
2627,
52,
3113,
12776,
273,
599,
16,
3988,
273,
374,
4672,
436,
8395,
28... |
align_view=7, | align_view='7', | def localBlast( self, seqFile, db, method='blastp', resultOut=None, e=0.01, **kw ): """ Performa a local blast search (requires that the blast binaries and databases are installed localy). Uses Bio.Blast.NCBIStandalone.blastall (Biopython) for the search. @param seqFile: file name with search sequence in FASTA format @type seqFile: str @param db: database(s) to search, e.g. ['swissprot', 'pdb'] @type db: [str] @param method: search program to use, e.g. 'blastp', 'fasta' (default: blastp) @type method: str @param e: expectation value cutoff @type e: float @param resultOut: save blast output to this new file @type resultOut: str @param kw: optional keywords:: --- Scoring --- matrix Matrix to use (default BLOSUM62). gap_open Gap open penalty (default 0). gap_extend Gap extension penalty (default 0). | be16af044c84d140f0984e73ad722121058bc87f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/482/be16af044c84d140f0984e73ad722121058bc87f/SequenceSearcher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1191,
38,
2722,
12,
365,
16,
3833,
812,
16,
1319,
16,
707,
2218,
30901,
84,
2187,
563,
1182,
33,
7036,
16,
425,
33,
20,
18,
1611,
16,
2826,
9987,
262,
30,
3536,
11217,
69,
279,
1191,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1191,
38,
2722,
12,
365,
16,
3833,
812,
16,
1319,
16,
707,
2218,
30901,
84,
2187,
563,
1182,
33,
7036,
16,
425,
33,
20,
18,
1611,
16,
2826,
9987,
262,
30,
3536,
11217,
69,
279,
1191,... |
slines[0] = '%2d. ' % msgcount + slines[0] | def send_i18n_digests(mlist, mboxfp): mbox = Mailbox(mboxfp) # Prepare common information lang = mlist.preferred_language lcset = Utils.GetCharSet(lang) realname = mlist.real_name volume = mlist.volume issue = mlist.next_digest_number digestid = _('%(realname)s Digest, Vol %(volume)d, Issue %(issue)d') digestsubj = Header(digestid, lcset, header_name='Subject') # Set things up for the MIME digest. Only headers not added by # CookHeaders need be added here. mimemsg = Message.Message() mimemsg['Content-Type'] = 'multipart/mixed' mimemsg['MIME-Version'] = '1.0' mimemsg['From'] = mlist.GetRequestEmail() mimemsg['Subject'] = digestsubj mimemsg['To'] = mlist.GetListEmail() mimemsg['Reply-To'] = mlist.GetListEmail() # Set things up for the rfc1153 digest plainmsg = StringIO() rfc1153msg = Message.Message() rfc1153msg['From'] = mlist.GetRequestEmail() rfc1153msg['Subject'] = digestsubj rfc1153msg['To'] = mlist.GetListEmail() rfc1153msg['Reply-To'] = mlist.GetListEmail() separator70 = '-' * 70 separator30 = '-' * 30 # In the rfc1153 digest, the masthead contains the digest boilerplate plus # any digest header. In the MIME digests, the masthead and digest header # are separate MIME subobjects. In either case, it's the first thing in # the digest, and we can calculate it now, so go ahead and add it now. mastheadtxt = Utils.maketext( 'masthead.txt', {'real_name' : mlist.real_name, 'got_list_email': mlist.GetListEmail(), 'got_listinfo_url': mlist.GetScriptURL('listinfo', absolute=1), 'got_request_email': mlist.GetRequestEmail(), 'got_owner_email': mlist.GetOwnerEmail(), }, mlist=mlist) # MIME masthead = MIMEText(mastheadtxt, _charset=lcset) masthead['Content-Description'] = digestid mimemsg.attach(masthead) # RFC 1153 print >> plainmsg, mastheadtxt print >> plainmsg # Now add the optional digest header if mlist.digest_header: headertxt = decorate(mlist, mlist.digest_header, _('digest header')) # MIME header = MIMEText(headertxt, _charset=lcset) header['Content-Description'] = _('Digest Header') mimemsg.attach(header) # RFC 1153 print >> plainmsg, headertxt print >> plainmsg # Now we have to cruise through all the messages accumulated in the # mailbox file. We can't add these messages to the plainmsg and mimemsg # yet, because we first have to calculate the table of contents # (i.e. grok out all the Subjects). Store the messages in a list until # we're ready for them. # # Meanwhile prepare things for the table of contents toc = StringIO() print >> toc, _("Today's Topics:\n") # Now cruise through all the messages in the mailbox of digest messages, # building the MIME payload and core of the RFC 1153 digest. We'll also # accumulate Subject: headers and authors for the table-of-contents. messages = [] msgcount = 0 msg = mbox.next() while msg is not None: if msg == '': # It was an unparseable message msg = mbox.next() msgcount += 1 messages.append(msg) # Get the Subject header msgsubj = msg.get('subject', _('(no subject)')) subject = lheader(msgsubj, lcset) # Don't include the redundant subject prefix in the toc mo = re.match('(re:? *)?(%s)' % re.escape(mlist.subject_prefix), subject, re.IGNORECASE) if mo: subject = subject[:mo.start(2)] + subject[mo.end(2):] username = '' addresses = getaddresses([lheader(msg.get('from', ''), lcset)]) # Take only the first author we find if isinstance(addresses, ListType) and addresses: username = addresses[0][0] if not username: username = addresses[0][1] if username: # username = lheader(username, lcset) username = ' (%s)' % username # Wrap the toc subject line wrapped = lheader(msgsubj, lcset, continuation_ws='') slines = wrapped.split('\n') # Put the count on the first line slines[0] = '%2d. ' % msgcount + slines[0] # See if the user's name can fit on the last line if len(slines[-1]) + len(username) > 70: slines.append(username) else: slines[-1] += username # Add this subject to the accumulating topics first = 1 for line in slines: if first: print >> toc, ' ', line first = 0 else: print >> toc, ' ', line.lstrip() # We do not want all the headers of the original message to leak # through in the digest messages. For this phase, we'll leave the # same set of headers in both digests, i.e. those required in RFC 1153 # plus a couple of other useful ones. We also need to reorder the # headers according to RFC 1153. Later, we'll strip out headers for # for the specific MIME or plain digests. keeper = {} all_keepers = {} for header in (mm_cfg.MIME_DIGEST_KEEP_HEADERS + mm_cfg.PLAIN_DIGEST_KEEP_HEADERS): all_keepers[header] = 1 all_keepers = all_keepers.keys() for keep in all_keepers: keeper[keep] = msg.get_all(keep, []) # Now remove all unkempt headers :) for header in msg.keys(): del msg[header] # And add back the kept header in the RFC 1153 designated order for keep in all_keepers: for field in keeper[keep]: msg[keep] = field # And a bit of extra stuff msg['Message'] = `msgcount` # Get the next message in the digest mailbox msg = mbox.next() print >> toc # Now we're finished with all the messages in the digest. First do some # sanity checking and then on to adding the toc. if msgcount == 0: # Why did we even get here? return toctext = toc.getvalue() # MIME tocpart = MIMEText(toctext, _charset=lcset) tocpart['Content-Description']= _("Today's Topics (%(msgcount)d messages)") mimemsg.attach(tocpart) # RFC 1153 print >> plainmsg, toctext print >> plainmsg # For RFC 1153 digests, we now need the standard separator print >> plainmsg, separator70 print >> plainmsg # Now go through and add each message mimedigest = MIMEBase('multipart', 'digest') mimemsg.attach(mimedigest) first = 1 for msg in messages: # MIME mimedigest.attach(MIMEMessage(msg)) # rfc1153 if first: first = 0 else: print >> plainmsg, separator30 print >> plainmsg # Use Mailman.Handlers.Scrubber.process() to get plain text msg = scrubber(mlist, msg) # Honor the default setting for h in mm_cfg.PLAIN_DIGEST_KEEP_HEADERS: if msg[h]: uh = lheader(msg[h], lcset, header_name=h, continuation_ws='\t') print >> plainmsg, '%s: %s' % (h, uh) print >> plainmsg print >> plainmsg, msg.get_payload(decode=1) # Now add the footer if mlist.digest_footer: footertxt = decorate(mlist, mlist.digest_footer, _('digest footer')) # MIME footer = MIMEText(footertxt, _charset=lcset) footer['Content-Description'] = _('Digest Footer') mimemsg.attach(footer) # RFC 1153 # BAW: This is not strictly conformant RFC 1153. The trailer is only # supposed to contain two lines, i.e. the "End of ... Digest" line and # the row of asterisks. If this screws up MUAs, the solution is to # add the footer as the last message in the RFC 1153 digest. I just # hate the way that VM does that and I think it's confusing to users, # so don't do it unless there's a clamor. print >> plainmsg, separator30 print >> plainmsg print >> plainmsg, footertxt print >> plainmsg # Do the last bit of stuff for each digest type signoff = _('End of ') + digestid # MIME # BAW: This stuff is outside the normal MIME goo, and it's what the old # MIME digester did. No one seemed to complain, probably because you # won't see it in an MUA that can't display the raw message. We've never # got complaints before, but if we do, just wax this. It's primarily # included for (marginally useful) backwards compatibility. mimemsg.postamble = signoff # rfc1153 print >> plainmsg, signoff print >> plainmsg, '*' * len(signoff) # Do our final bit of housekeeping, and then send each message to the # outgoing queue for delivery. mlist.next_digest_number += 1 virginq = get_switchboard(mm_cfg.VIRGINQUEUE_DIR) # Calculate the recipients lists plainrecips = [] mimerecips = [] drecips = mlist.getDigestMemberKeys() + mlist.one_last_digest.keys() for user in mlist.getMemberCPAddresses(drecips): # user might be None if someone who toggled off digest delivery # subsequently unsubscribed from the mailing list. Also, filter out # folks who have disabled delivery. if user is None or mlist.getDeliveryStatus(user) <> ENABLED: continue # Otherwise, decide whether they get MIME or RFC 1153 digests if mlist.getMemberOption(user, mm_cfg.DisableMime): plainrecips.append(user) else: mimerecips.append(user) # Zap this since we're now delivering the last digest to these folks. mlist.one_last_digest.clear() # MIME virginq.enqueue(mimemsg, recips=mimerecips, listname=mlist.internal_name(), isdigest=1) # RFC 1153 rfc1153msg.set_payload(plainmsg.getvalue(), lcset) virginq.enqueue(rfc1153msg, recips=plainrecips, listname=mlist.internal_name(), isdigest=1) | 7bd9b6eb8b0e04c1af6de2ad705ed88d2206351d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/7bd9b6eb8b0e04c1af6de2ad705ed88d2206351d/ToDigest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
77,
2643,
82,
67,
10171,
87,
12,
781,
376,
16,
312,
2147,
7944,
4672,
312,
2147,
273,
11542,
2147,
12,
81,
2147,
7944,
13,
468,
7730,
2975,
1779,
3303,
273,
312,
1098,
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,
1366,
67,
77,
2643,
82,
67,
10171,
87,
12,
781,
376,
16,
312,
2147,
7944,
4672,
312,
2147,
273,
11542,
2147,
12,
81,
2147,
7944,
13,
468,
7730,
2975,
1779,
3303,
273,
312,
1098,
18,
... | |
ntohs = _c.ntohs ntohl = _c.ntohl htons = _c.htons htonl = _c.htonl | def ntohs(x): return rffi.cast(lltype.Signed, _c.ntohs(x)) def ntohl(x): return rffi.cast(lltype.Signed, _c.ntohl(x)) def htons(x): return rffi.cast(lltype.Signed, _c.htons(x)) def htonl(x): return rffi.cast(lltype.Signed, _c.htonl(x)) | def rsocket_startup(): pass | 7f755ae9d31b65dabb195f2aa365290d8a00ffd1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6934/7f755ae9d31b65dabb195f2aa365290d8a00ffd1/rsocket_rffi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3597,
1861,
67,
23939,
13332,
1342,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
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,
3597,
1861,
67,
23939,
13332,
1342,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
table.addRow([Container(*welcome)]) | table.AddRow([Container(*welcome)]) | def admin_overview(msg=''): # Show the administrative overview page, with the list of all the lists on # this host. msg is an optional error message to display at the top of # the page. # # This page should be displayed in the server's default language, which # should have already been set. hostname = mm_cfg.DEFAULT_HOST_NAME legend = _('%(default_hostname)s mailing lists - Admin Links') # The html `document' doc = Document() doc.set_language(mm_cfg.DEFAULT_SERVER_LANGUAGE) doc.SetTitle(legend) # The table that will hold everything table = Table(border=0, width="100%") table.AddRow([Center(Header(2, legend))]) table.AddCellInfo(max(table.GetCurrentRowIndex(), 0), 0, colspan=2, bgcolor="#99ccff") # Skip any mailing list that isn't advertised. advertised = [] listnames = Utils.list_names() listnames.sort() for name in listnames: mlist = MailList.MailList(name, lock=0) if mlist.advertised: advertised.append(mlist) # Greeting depends on whether there was an error or not if msg: greeting = FontAttr(msg, color="ff5060", size="+1") else: greeting = _("Welcome!") welcome = [] if not advertised: welcome.extend([ greeting, _('<p>There currently are no publicly-advertised '), Link(mm_cfg.MAILMAN_URL, _('Mailman')), _(' mailing lists on %(hostname)s.'), ]) else: welcome.extend([ greeting, _('<p>Below is the collection of publicly-advertised '), Link(mm_cfg.MAILMAN_URL, _('Mailman')), _(' mailing lists on %(hostname)s.'), _(''' Click on a list name to visit the configuration pages for that list.'''), ]) mailman_owner = mm_cfg.MAILMAN_OWNER extra = msg and _('right ') or '' welcome.extend([ _('''To visit the administrators configuration page for an unadvertised list, open a URL similar to this one, but with a '/' and the %(extra)slist name appended. <p>General list information can be found at '''), Link(Utils.ScriptURL('listinfo'), _('the mailing list overview page')), '.', _('<p>(Send questions and comments to '), Link('mailto:%(mailman_owner)s', mailman_owner), '.)<p>', ]) table.addRow([Container(*welcome)]) table.AddCellInfo(max(table.GetCurrentRowIndex(), 0), 0, colspan=2) if advertised: table.AddRow([' ', ' ']) table.AddRow([Bold(_('List')), Bold(_('Description'))]) for mlist in advertised: table.AddRow( [Link(mlist.GetScriptURL('admin'), Bold(mlist.real_name)), mlist.description or Italic(_('[no description available]')), ]) doc.AddItem(table) doc.AddItem('<hr>') doc.AddItem(MailmanLogo()) print doc.Format(bgcolor="#ffffff") | f3fe2a64799b95fd2c5979eda46dc1ead83c3caf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/f3fe2a64799b95fd2c5979eda46dc1ead83c3caf/admin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3981,
67,
26081,
12,
3576,
2218,
11,
4672,
468,
9674,
326,
30162,
1535,
18471,
1363,
16,
598,
326,
666,
434,
777,
326,
6035,
603,
468,
333,
1479,
18,
225,
1234,
353,
392,
3129,
555,
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,
3981,
67,
26081,
12,
3576,
2218,
11,
4672,
468,
9674,
326,
30162,
1535,
18471,
1363,
16,
598,
326,
666,
434,
777,
326,
6035,
603,
468,
333,
1479,
18,
225,
1234,
353,
392,
3129,
555,
88... |
"MD5Sum" | "MD5Sum", "User-install-skips", "Systemwide-only", | def find(self, ident): """Find a package. The package can be specified by name or as a dictionary with name, version and flavor entries. Only name is obligatory. If there are multiple matches the best one (higher version number, flavors ordered according to users' preference) is returned.""" if type(ident) == str: # Remove ( and ) for pseudo-packages if ident[0] == '(' and ident[-1] == ')': ident = ident[1:-1] # Split into name-version-flavor fields = ident.split('-') if len(fields) < 1 or len(fields) > 3: return None name = fields[0] if len(fields) > 1: version = fields[1] else: version = None if len(fields) > 2: flavor = fields[2] else: flavor = None else: name = ident['Name'] version = ident.get('Version') flavor = ident.get('Flavor') found = None for p in self._packages: if name == p.name() and \ (not version or version == p.version()) and \ (not flavor or flavor == p.flavor()): if not found or found < p: found = p return found | b8bc1787f4d2ad5bafcd19ae7aee7c0bf279e0f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b8bc1787f4d2ad5bafcd19ae7aee7c0bf279e0f5/pimp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
12,
2890,
16,
3390,
4672,
3536,
3125,
279,
2181,
18,
1021,
2181,
848,
506,
1269,
635,
508,
578,
487,
279,
3880,
598,
508,
16,
1177,
471,
19496,
3222,
18,
225,
5098,
508,
353,
320... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
12,
2890,
16,
3390,
4672,
3536,
3125,
279,
2181,
18,
1021,
2181,
848,
506,
1269,
635,
508,
578,
487,
279,
3880,
598,
508,
16,
1177,
471,
19496,
3222,
18,
225,
5098,
508,
353,
320... |
eq(msg.get_payload(decode=1), None) | eq(msg.get_payload(decode=True), None) | def test_get_decoded_payload(self): eq = self.assertEqual msg = self._msgobj('msg_10.txt') # The outer message is a multipart eq(msg.get_payload(decode=1), None) # Subpart 1 is 7bit encoded eq(msg.get_payload(0).get_payload(decode=1), 'This is a 7bit encoded message.\n') # Subpart 2 is quopri eq(msg.get_payload(1).get_payload(decode=1), '\xa1This is a Quoted Printable encoded message!\n') # Subpart 3 is base64 eq(msg.get_payload(2).get_payload(decode=1), 'This is a Base64 encoded message.') # Subpart 4 has no Content-Transfer-Encoding: header. eq(msg.get_payload(3).get_payload(decode=1), 'This has no Content-Transfer-Encoding: header.\n') | 1abdc903fc08a89b4695728d372aaf3594fcb8c8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/1abdc903fc08a89b4695728d372aaf3594fcb8c8/test_email.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
588,
67,
26646,
67,
7648,
12,
2890,
4672,
7555,
273,
365,
18,
11231,
5812,
1234,
273,
365,
6315,
3576,
2603,
2668,
3576,
67,
2163,
18,
5830,
6134,
468,
1021,
6390,
883,
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,
1842,
67,
588,
67,
26646,
67,
7648,
12,
2890,
4672,
7555,
273,
365,
18,
11231,
5812,
1234,
273,
365,
6315,
3576,
2603,
2668,
3576,
67,
2163,
18,
5830,
6134,
468,
1021,
6390,
883,
353,
... |
result = set() | result = {} | def __resolveDependencies(self, classObj, available, result=None): if result == None: result = set() | 834c056c86969fa2063df43e6b26f8809cf20532 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12949/834c056c86969fa2063df43e6b26f8809cf20532/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
10828,
8053,
12,
2890,
16,
667,
2675,
16,
2319,
16,
563,
33,
7036,
4672,
309,
563,
422,
599,
30,
563,
273,
444,
1435,
2,
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,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
10828,
8053,
12,
2890,
16,
667,
2675,
16,
2319,
16,
563,
33,
7036,
4672,
309,
563,
422,
599,
30,
563,
273,
444,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
- Switching which memberfuncion is used is done based on type and | - Switching which method is used is done based on type and | def __str__(self): '''Return meaningfull string''' #Including the column is not useful because it is often wrong #for higher level errors. Preserving the text of the original #pyparsing error is transporting the column information for parsing #errors. Only parsing errors have useful column information. return ' File "' + self.fileName() + '", line ' + str(self.lineNo()) | 90817d6c04b2ff5746473ce2e5d7bccc717cf328 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2720/90817d6c04b2ff5746473ce2e5d7bccc717cf328/ast.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
9163,
990,
12256,
2854,
533,
26418,
468,
382,
18596,
326,
1057,
353,
486,
5301,
2724,
518,
353,
16337,
7194,
468,
1884,
10478,
1801,
1334,
18,
18346,
264,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
701,
972,
12,
2890,
4672,
9163,
990,
12256,
2854,
533,
26418,
468,
382,
18596,
326,
1057,
353,
486,
5301,
2724,
518,
353,
16337,
7194,
468,
1884,
10478,
1801,
1334,
18,
18346,
264,
... |
elif self.isResizing: self.isResizing = 0 return | def updateGraph(self, *args): attrs = self.getShownAttributeList() maxAttrs = self.mainArea.width() / self.linesDistance if len(attrs) > maxAttrs: rest = len(attrs) - maxAttrs if self.sliderRange != rest: self.slider.setRange(0, rest) self.sliderRange = rest elif self.isResizing: self.isResizing = 0 return # if we resized widget and it doesn't change the number of attributes that are shown then we return start = min(self.slider.value(), len(attrs)-maxAttrs) if self.setSliderIndex != -1: if self.setSliderIndex == 0: start = 0 else: start = min(len(attrs)-maxAttrs, self.setSliderIndex - (maxAttrs+1)/2) start = max(start, 0) self.setSliderIndex = -1 self.slider.setValue(start) else: self.slider.setRange(0,0) self.sliderRange = 0 maxAttrs = len(attrs) start = 0 | 3b9dc20860e1e7af83f13fd27cf8036ecb949be5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6366/3b9dc20860e1e7af83f13fd27cf8036ecb949be5/OWParallelCoordinates.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
4137,
12,
2890,
16,
380,
1968,
4672,
3422,
273,
365,
18,
588,
27042,
1499,
682,
1435,
943,
8262,
273,
365,
18,
5254,
5484,
18,
2819,
1435,
342,
365,
18,
3548,
7200,
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,
1089,
4137,
12,
2890,
16,
380,
1968,
4672,
3422,
273,
365,
18,
588,
27042,
1499,
682,
1435,
943,
8262,
273,
365,
18,
5254,
5484,
18,
2819,
1435,
342,
365,
18,
3548,
7200,
309,
562,
12,... | |
security.declareProtected(view, 'checkPermissionParticipateInMeeting') | def saveProperties(self, REQUEST=None, **kwargs): """ """ if not self.checkPermissionEditObject(): raise EXCEPTION_NOTAUTHORIZED, EXCEPTION_NOTAUTHORIZED_MSG | 8afd301eaf36cc928b4d20ac0866a206b63c61f5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3287/8afd301eaf36cc928b4d20ac0866a206b63c61f5/meeting.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
2297,
12,
2890,
16,
12492,
33,
7036,
16,
2826,
4333,
4672,
3536,
3536,
309,
486,
365,
18,
1893,
5041,
4666,
921,
13332,
1002,
23136,
67,
4400,
28383,
16,
23136,
67,
4400,
28383,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
2297,
12,
2890,
16,
12492,
33,
7036,
16,
2826,
4333,
4672,
3536,
3536,
309,
486,
365,
18,
1893,
5041,
4666,
921,
13332,
1002,
23136,
67,
4400,
28383,
16,
23136,
67,
4400,
28383,
67... | |
n = re.search('<option value="([^"]+)">%s[^<]*</option>' % name, resp) | code_regex = '<option value="([^"]+)">%s[^<]*</option>' n = re.search(code_regex % name, resp) | def update_languages(self): '''Naively try to determine if new languages are available by scraping http://translate.google.com''' restr = '<meta name="description" content="Google's free online language translation service instantly translates text and web pages. This translator supports: (.*?)">' resp = urllib2.urlopen(urllib2.Request('http://translate.google.com', None, {'User-Agent':'Traduisons/%s' % msg_VERSION})).read() m = re.search(restr, resp) d = {} if m: names = m.group(1).split(', ') for name in names: n = re.search('<option value="([^"]+)">%s[^<]*</option>' % name, resp) if n: d[name] = n.group(1) else: return False for k, v in [('Detect Language', 'auto'), ('Gaelic', 'ga'), ('Chinese (Traditional)', 'zh-TW'), ('Chinese (Simplified)', 'zh-CN')]: d[k] = v for k in self.dictLang: if not d.has_key(k): print k, ': Unavailable' self.dictLang = d else: print 'Unable to update_languages' return False | aa80d065d095c420e5ef14cb7c4c6f364c10ceea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9947/aa80d065d095c420e5ef14cb7c4c6f364c10ceea/traduisons.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
14045,
12,
2890,
4672,
9163,
24101,
4492,
775,
358,
4199,
309,
394,
8191,
854,
2319,
635,
888,
1266,
310,
1062,
2207,
13929,
18,
9536,
18,
832,
26418,
400,
313,
273,
2368,
3901... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
14045,
12,
2890,
4672,
9163,
24101,
4492,
775,
358,
4199,
309,
394,
8191,
854,
2319,
635,
888,
1266,
310,
1062,
2207,
13929,
18,
9536,
18,
832,
26418,
400,
313,
273,
2368,
3901... |
former works only in Robot Framework 2.1 and newer. | former works only in Robot Framework 2.1 and newer. See also note from `Set Suite Variable`. | def variable_should_exist(self, name, msg=None): """Fails unless the given variable exists within the current scope. The name of the variable can be given either as a normal variable name (e.g. ${NAME}) or in escaped format (e.g. \\${NAME}). Notice that the former works only in Robot Framework 2.1 and newer. The default error message can be overridden with the `msg` argument. """ name = self._get_var_name(name) variables = self._get_variables() if msg: msg = variables.replace_string(msg) else: msg = "Variable %s does not exist" % name asserts.fail_unless(variables.has_key(name), msg) | 244328efbd10e5be31e592d4c011f8a395ef60de /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7408/244328efbd10e5be31e592d4c011f8a395ef60de/BuiltIn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2190,
67,
13139,
67,
7398,
12,
2890,
16,
508,
16,
1234,
33,
7036,
4672,
3536,
30800,
3308,
326,
864,
2190,
1704,
3470,
326,
783,
2146,
18,
225,
1021,
508,
434,
326,
2190,
848,
506,
864... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2190,
67,
13139,
67,
7398,
12,
2890,
16,
508,
16,
1234,
33,
7036,
4672,
3536,
30800,
3308,
326,
864,
2190,
1704,
3470,
326,
783,
2146,
18,
225,
1021,
508,
434,
326,
2190,
848,
506,
864... |
width=80, | width=79, | def __init__ (self, indent_increment=0, max_help_position=24, width=80, short_first=0): HelpFormatter.__init__ ( self, indent_increment, max_help_position, width, short_first) | 1b309762c28f5b85d7e1081f837ed6f95a37016c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/1b309762c28f5b85d7e1081f837ed6f95a37016c/optparse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
2890,
16,
3504,
67,
15016,
33,
20,
16,
943,
67,
5201,
67,
3276,
33,
3247,
16,
1835,
33,
7235,
16,
3025,
67,
3645,
33,
20,
4672,
11288,
5074,
16186,
2738,
972,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
2890,
16,
3504,
67,
15016,
33,
20,
16,
943,
67,
5201,
67,
3276,
33,
3247,
16,
1835,
33,
7235,
16,
3025,
67,
3645,
33,
20,
4672,
11288,
5074,
16186,
2738,
972,
2... |
data = google.doGoogleSearch('%s "%s"' % (no_result_with_those_words, query) | data = google.doGoogleSearch('%s "%s"' % (no_result_with_those_words, query)) | def get_results(query, numresults = 10): url = list() query = re.sub("[()\"<>]", "", query) #wikipedia.output(query) if config.copyright_google: import google google.LICENSE_KEY = config.google_key print " Google query..." search_request_retry = config.copyright_connection_tries while search_request_retry: try: data = google.doGoogleSearch('%s "%s"' % (no_result_with_those_words, query) search_request_retry = 0 for entry in data.results: add_in_urllist(url, entry.URL, 'google') except KeyboardInterrupt: raise except Exception, err: print "Got an error ->", err # # SOAP.faultType: <Fault SOAP-ENV:Server: Exception from service object: # Daily limit of 1000 queries exceeded for key ***> # if 'Daily limit' in str(err): exceeded_in_queries('google') if search_request_retry: search_request_retry -= 1 if config.copyright_yahoo: import yahoo.search.web print " Yahoo query..." data = yahoo.search.web.WebSearch(config.yahoo_appid, query='"%s" %s' % ( query.encode('utf_8'), no_result_with_those_words ), results = numresults) search_request_retry = config.copyright_connection_tries while search_request_retry: try: for entry in data.parse_results(): add_in_urllist(url, entry.Url, 'yahoo') search_request_retry = 0 except Exception, err: print "Got an error ->", err if 'limit exceeded' in str(err): exceeded_in_queries('yahoo') if search_request_retry: search_request_retry -= 1 if config.copyright_msn: #max_query_len = 150? from SOAPpy import WSDL print " Live query..." try: server = WSDL.Proxy('http://soap.search.msn.com/webservices.asmx?wsdl') except: print "Live Search Error" raise params = {'AppID': config.msn_appid, 'Query': '%s "%s"' % (no_result_with_those_words, query), 'CultureInfo': 'en-US', 'SafeSearch': 'Off', 'Requests': { 'SourceRequest':{'Source': 'Web', 'Offset': 0, 'Count': 10, 'ResultFields': 'All',}}} search_request_retry = config.copyright_connection_tries results = '' while search_request_retry: try: server_results = server.Search(Request = params) search_request_retry = 0 if server_results.Responses[0].Results: results = server_results.Responses[0].Results[0] except Exception, err: print "Got an error ->", err if search_request_retry: search_request_retry -= 1 if results: # list or instance? if type(results) == type([]): for entry in results: add_in_urllist(url, entry.Url, 'msn') else: add_in_urllist(url, results.Url, 'msn') offset = 0 for i in range(len(url)): if check_list(url[i + offset][0], excl_list, verbose = True): url.pop(i + offset) offset += -1 return url | 3f25c8b662a762e03fe82d13cd0a23e825a35e16 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/3f25c8b662a762e03fe82d13cd0a23e825a35e16/copyright.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4717,
12,
2271,
16,
818,
4717,
273,
1728,
4672,
880,
273,
666,
1435,
843,
273,
283,
18,
1717,
2932,
63,
1435,
2412,
29667,
65,
3113,
23453,
843,
13,
468,
11999,
13744,
18,
284... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4717,
12,
2271,
16,
818,
4717,
273,
1728,
4672,
880,
273,
666,
1435,
843,
273,
283,
18,
1717,
2932,
63,
1435,
2412,
29667,
65,
3113,
23453,
843,
13,
468,
11999,
13744,
18,
284... |
self.main.xmlrpc.DBus("sendfiles", _("Teacher"), server, open ) | self.main.xmlrpc.DBus("sendfiles", "%s %s %s" %(_("Teacher"), server, open) ) | def send_all(self, *args): if not self.get_all_clients(): return # action sent by vidal_joshur at gva dot es # send files # search for connected users if len(self.connected_users) == 0 or self.connected_users[0] == shared.NO_LOGIN_MSG: shared.error_msg( _("No users logged.") ) return str_scapes=[" ", "(", ")", "*", "!", "?", "\"", "`", "[", "]", "{", "}", ";", ":", ",", "=", "$"] dialog = gtk.FileChooserDialog( _("Select file or files..."), None, gtk.FILE_CHOOSER_ACTION_OPEN, (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OPEN, gtk.RESPONSE_OK)) dialog.set_default_response(gtk.RESPONSE_OK) #dialog.set_select_multiple(select_multiple) dialog.set_select_multiple(True) self.folder = self._folder = os.environ['HOME'] dialog.set_current_folder(self.folder) filter = gtk.FileFilter() filter.set_name("All files") filter.add_pattern("*") dialog.add_filter(filter) if not os.path.isdir("/tmp/tcos_share"): shared.info_msg( _("TcosMonitor: FTP+TLS server is not running.") ) return for filename in os.listdir("/tmp/tcos_share/"): if os.path.isfile("/tmp/tcos_share/%s" %filename): os.remove("/tmp/tcos_share/%s" %filename) response = dialog.run() if response == gtk.RESPONSE_OK: filenames = dialog.get_filenames() open="False" basenames = "" for filename in filenames: basenames += "%s\n" % ( os.path.basename(filename) ) copy(filename, "/tmp/tcos_share/") os.chmod("/tmp/tcos_share/%s" %os.path.basename(filename), 0644) self.main.write_into_statusbar( _("Waiting for send files...") ) msg=_( "Do you want open file(s) on client?" ) if shared.ask_msg ( msg ): open="True" newusernames=[] for user in self.connected_users: if user.find(":") != -1: usern, ip=user.split(":") self.main.xmlrpc.newhost(ip) server=self.main.xmlrpc.GetStandalone("get_server") self.main.xmlrpc.DBus("sendfiles", _("Teacher"), server, open ) self.main.xmlrpc.DBus("mess", _("Teacher has sent some files to %(teacher)s folder:\n\n%(basenames)s") %{"teacher":_("Teacher"), "basenames":basenames}) else: newusernames.append(user) interface=self.main.config.GetVar("network_interface") # maybe we the x remote display is other than tcosmonitor server server=self.get_ip_address(interface) result = self.main.dbus_action.do_sendfiles( newusernames , _("Teacher"), server, open) if not result: shared.error_msg ( _("Error while exec remote app:\nReason:%s") %( self.main.dbus_action.get_error_msg() ) ) self.main.write_into_statusbar( _("Error creating destination folder.") ) else: result = self.main.dbus_action.do_message(newusernames , _("Teacher has sent some files to %(teacher)s folder:\n\n%(basenames)s") %{"teacher":_("Teacher"), "basenames":basenames} ) self.main.write_into_statusbar( _("Files sent.") ) dialog.destroy() | 4c8b460e1e727762b6a3b10431823d1d6b889789 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13520/4c8b460e1e727762b6a3b10431823d1d6b889789/sendfiles.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
454,
12,
2890,
16,
380,
1968,
4672,
309,
486,
365,
18,
588,
67,
454,
67,
16931,
13332,
327,
468,
1301,
3271,
635,
18339,
287,
67,
78,
17636,
295,
622,
11404,
69,
3928,
5001,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1366,
67,
454,
12,
2890,
16,
380,
1968,
4672,
309,
486,
365,
18,
588,
67,
454,
67,
16931,
13332,
327,
468,
1301,
3271,
635,
18339,
287,
67,
78,
17636,
295,
622,
11404,
69,
3928,
5001,
... |
self.troves[name, version, flavor] = (False, False, comps) | self.troves[name, version, flavor] = (False, False, comps, childByDefaults) | def delTrove(self, name, version, flavor): (explicit, byDefault, comps) = self.troves[name, version, flavor] if explicit: del self.troves[name, version, flavor] else: self.troves[name, version, flavor] = (False, False, comps) | 74a07587cebc9b61ae9ea7fec2d4845bd485e0f0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/74a07587cebc9b61ae9ea7fec2d4845bd485e0f0/grouprecipe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1464,
56,
303,
537,
12,
2890,
16,
508,
16,
1177,
16,
19496,
4672,
261,
16511,
16,
635,
1868,
16,
13979,
13,
273,
365,
18,
88,
303,
3324,
63,
529,
16,
1177,
16,
19496,
65,
309,
5515,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1464,
56,
303,
537,
12,
2890,
16,
508,
16,
1177,
16,
19496,
4672,
261,
16511,
16,
635,
1868,
16,
13979,
13,
273,
365,
18,
88,
303,
3324,
63,
529,
16,
1177,
16,
19496,
65,
309,
5515,
... |
depth = int((len(fullmatch.group('ldepth')) + 1) / 2) | ldepth = len(fullmatch.group('ldepth')) depth = int((ldepth + 1) / 2) | def _listitem_formatter(self, match, fullmatch): depth = int((len(fullmatch.group('ldepth')) + 1) / 2) #self.out.write('depth:%d' % depth) type = ['ol', 'ul'][match[depth * 2 - 1] == '*'] self._li_open = 1 self._set_list_depth(depth, type) return '<li>' #return '<li>%s</li>' % match[depth * 2 + 1:] | 7c2a5e3433f5dfc31c5bac2dd237f9b15525aa07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/7c2a5e3433f5dfc31c5bac2dd237f9b15525aa07/Wiki.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1098,
1726,
67,
12354,
12,
2890,
16,
845,
16,
1983,
1916,
4672,
328,
5979,
273,
562,
12,
2854,
1916,
18,
1655,
2668,
80,
5979,
26112,
3598,
273,
509,
12443,
80,
5979,
397,
404,
13... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1098,
1726,
67,
12354,
12,
2890,
16,
845,
16,
1983,
1916,
4672,
328,
5979,
273,
562,
12,
2854,
1916,
18,
1655,
2668,
80,
5979,
26112,
3598,
273,
509,
12443,
80,
5979,
397,
404,
13... |
sage: sr = mq.SR(1,1,1,8,gf2=True) | sage: sr = mq.SR(1, 1, 1, 8, gf2=True) | def inversion_polynomials_single_sbox(self, x= None, w=None, biaffine_only=None, correct_only=None): """ Generator for S-Box inversion polynomials of a single sbox. | e506ccc2459e6e3948659b0d1b28d9d6b70342e4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/e506ccc2459e6e3948659b0d1b28d9d6b70342e4/sr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
316,
1589,
67,
3915,
13602,
87,
67,
7526,
67,
87,
2147,
12,
2890,
16,
619,
33,
599,
16,
341,
33,
7036,
16,
324,
1155,
1403,
558,
67,
3700,
33,
7036,
16,
3434,
67,
3700,
33,
7036,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
316,
1589,
67,
3915,
13602,
87,
67,
7526,
67,
87,
2147,
12,
2890,
16,
619,
33,
599,
16,
341,
33,
7036,
16,
324,
1155,
1403,
558,
67,
3700,
33,
7036,
16,
3434,
67,
3700,
33,
7036,
4... |
'rating': movieImdb['rating'], | def getMovieData(self, movieImdb): self.imdb.update(movieImdb) movie = Movie({ 'title': movieImdb['title'], 'year': movieImdb['year'], 'rating': movieImdb['rating'], 'director': [ unicode(p) for p in movieImdb['director'] ], 'writer': [ unicode(p) for p in movieImdb['writer'] ], 'genres': [ unicode(p) for p in movieImdb['genres'] ], }) g = Getter(movie, movieImdb) g.get('plot') g.get('plotOutline', 'plot outline') | 4ae5cdc1bf894dba4bdf23ea8bd4eea780dd5a47 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11141/4ae5cdc1bf894dba4bdf23ea8bd4eea780dd5a47/imdbmetadataprovider.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2108,
83,
13120,
751,
12,
2890,
16,
21360,
1170,
1966,
4672,
365,
18,
381,
1966,
18,
2725,
12,
8683,
13120,
1170,
1966,
13,
21360,
273,
26963,
12590,
296,
2649,
4278,
21360,
1170,
1966,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2108,
83,
13120,
751,
12,
2890,
16,
21360,
1170,
1966,
4672,
365,
18,
381,
1966,
18,
2725,
12,
8683,
13120,
1170,
1966,
13,
21360,
273,
26963,
12590,
296,
2649,
4278,
21360,
1170,
1966,
... | |
self.exec_cmd(self.cmd_lock) | self.__exec_cmd(self.cmd_lock) | def click_button(self, widget, data=None): if (data == 'logout'): self.exec_cmd(self.cmd_logout) elif (data == 'restart'): if self.usehal: self.dbus.restart() else: self.exec_cmd(self.cmd_restart) elif (data == 'shutdown'): if self.usehal: self.dbus.shutdown() else: self.exec_cmd(self.cmd_shutdown) elif (data == 'suspend'): self.window.hide() self.exec_cmd(self.cmd_lock) if self.usehal: self.dbus.suspend() else: self.exec_cmd(self.cmd_suspend) elif (data == 'hibernate'): self.window.hide() self.exec_cmd(self.cmd_lock) if self.usehal: self.dbus.hibernate() else: self.__exec_cmd(self.cmd_hibernate) elif (data == 'safesuspend'): self.window.hide() if self.usehal: self.dbus.safesuspend() else: self.exec_cmd(self.cmd_safesuspend) elif (data == 'lock'): self.__exec_cmd(self.cmd_lock) elif (data == 'switch'): self.__exec_cmd(self.cmd_switchuser) | 4a3e00fa548b5caea48c42dfcf9ee74395367fd7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11198/4a3e00fa548b5caea48c42dfcf9ee74395367fd7/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4682,
67,
5391,
12,
2890,
16,
3604,
16,
501,
33,
7036,
4672,
309,
261,
892,
422,
296,
21229,
11,
4672,
365,
18,
4177,
67,
4172,
12,
2890,
18,
4172,
67,
21229,
13,
225,
1327,
261,
892... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4682,
67,
5391,
12,
2890,
16,
3604,
16,
501,
33,
7036,
4672,
309,
261,
892,
422,
296,
21229,
11,
4672,
365,
18,
4177,
67,
4172,
12,
2890,
18,
4172,
67,
21229,
13,
225,
1327,
261,
892... |
if self.checksum == -1: if len(s) <= 10: self.checksum = 1 else: self.checksum = 2 if self.checksum > 0: i = 0; v = 1; c = 0 while i < len(s): c = c + v * string.index(self.chars, s[-(i+1)]) i = i + 1; v = v + 1 if v > 10: v = 1 s = s + self.chars[c % 11] if self.checksum > 1: i = 0; v = 1; c = 0 while i < len(s): c = c + v * string.index(self.chars, s[-(i+1)]) i = i + 1; v = v + 1 if v > 9: v = 1 s = s + self.chars[c % 10] | tcs = self.checksum if tcs<0: self.checksum = tcs = 1+int(len(s)>10) if tcs > 0: s = self._addCSD(s,11) if tcs > 1: s = self._addCSD(s,10) | def encode(self): s = self.validated | ed4d5e3d35978e4181cc1427d9b15440f7310ded /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3878/ed4d5e3d35978e4181cc1427d9b15440f7310ded/common.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2017,
12,
2890,
4672,
272,
273,
365,
18,
877,
690,
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... | [
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,
2017,
12,
2890,
4672,
272,
273,
365,
18,
877,
690,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
gtk.VBox.__init__(self) label = gtk.Label(self.prop.doc or self.prop.blurb or "(unnamed group property)") label.show() | def __init__(self, layer, propname): self.layer = layer self.propname = propname self.prop = layer.get_prop(propname) # create widgets gtk.VBox.__init__(self) | 9c32eac186439f07092e593414a8822590fd0705 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2510/9c32eac186439f07092e593414a8822590fd0705/layerwin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3018,
16,
2270,
529,
4672,
365,
18,
6363,
273,
3018,
365,
18,
5986,
529,
273,
2270,
529,
365,
18,
5986,
273,
3018,
18,
588,
67,
5986,
12,
5986,
529,
13... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3018,
16,
2270,
529,
4672,
365,
18,
6363,
273,
3018,
365,
18,
5986,
529,
273,
2270,
529,
365,
18,
5986,
273,
3018,
18,
588,
67,
5986,
12,
5986,
529,
13... | |
self.whenLocoHorn(event, False) return def whenLocoHorn(self, event, state) : self.msgText("whenLocoHorn\n") | self.doLocoHorn(event, False) return def doLocoHorn(self, event, state) : | def whenLocoHornOff(self, event) : self.whenLocoHorn(event, False) return | 79baa866e687b74ac4f77e3c3432eb8cbbfb5a3e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2146/79baa866e687b74ac4f77e3c3432eb8cbbfb5a3e/RobotThrottle2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1347,
1333,
83,
44,
14245,
7210,
12,
2890,
16,
871,
13,
294,
365,
18,
13723,
1333,
83,
44,
14245,
12,
2575,
16,
1083,
13,
327,
2,
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,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1347,
1333,
83,
44,
14245,
7210,
12,
2890,
16,
871,
13,
294,
365,
18,
13723,
1333,
83,
44,
14245,
12,
2575,
16,
1083,
13,
327,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
while 1: | while True: | def compute_from_file(self, fp, spec, seekable=1): line_offsets = [] | 1baf13ee480075d2e48ad565f8ac10bedffe1164 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7249/1baf13ee480075d2e48ad565f8ac10bedffe1164/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3671,
67,
2080,
67,
768,
12,
2890,
16,
4253,
16,
857,
16,
6520,
429,
33,
21,
4672,
980,
67,
16542,
273,
5378,
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,
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,
3671,
67,
2080,
67,
768,
12,
2890,
16,
4253,
16,
857,
16,
6520,
429,
33,
21,
4672,
980,
67,
16542,
273,
5378,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
raise ScanError('Could not get version information from server') | raise ConnectionError('Could not get version information from server') | def version(self): """ Get Clamscan version | bef3518a3bfa5e86c06cb84c8b0244be7487803a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8077/bef3518a3bfa5e86c06cb84c8b0244be7487803a/pyclamd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1177,
12,
2890,
4672,
3536,
968,
3905,
301,
9871,
1177,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1177,
12,
2890,
4672,
3536,
968,
3905,
301,
9871,
1177,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
print (mousePos - wr.topLeft()).manhattanLength() | def mousePressed(self, x, y, button): if self._painting and button == qt.Qt.RightButton: self._stopPainting() self.setROI(self._oldROI) return if button != qt.Qt.LeftButton: return if self.roi: mousePos = self._viewer.toWindowCoordinates(x, y) wr = self.windowRect() print (mousePos - wr.topLeft()).manhattanLength() if (mousePos - wr.topLeft()).manhattanLength() < 9: self.startPos = self.roi.lowerRight() elif (mousePos - wr.bottomRight()).manhattanLength() < 9: self.startPos = self.roi.upperLeft() else: self.startPos = intPos((x, y)) else: self.startPos = intPos((x, y)) self.mouseMoved(x, y) self._startPainting() | 66ec2e44c5ec7238ba11d6b92cd130947baef15e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10394/66ec2e44c5ec7238ba11d6b92cd130947baef15e/mapdisplay.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7644,
24624,
12,
2890,
16,
619,
16,
677,
16,
3568,
4672,
309,
365,
6315,
84,
1598,
310,
471,
3568,
422,
25672,
18,
23310,
18,
4726,
3616,
30,
365,
6315,
5681,
12699,
310,
1435,
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,
7644,
24624,
12,
2890,
16,
619,
16,
677,
16,
3568,
4672,
309,
365,
6315,
84,
1598,
310,
471,
3568,
422,
25672,
18,
23310,
18,
4726,
3616,
30,
365,
6315,
5681,
12699,
310,
1435,
365,
18... | |
assert res == (a == 1) | assert_equal(res,(a == 1)) | def check_unsigned_long(self,level=5): a = 1 res = inline_tools.inline('return_val = (a == (unsigned long)1);',['a']) assert res == (a == 1) | 267b08d9c3e7613c126729a179f4503c91625e9c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7416/267b08d9c3e7613c126729a179f4503c91625e9c/test_scxx_object.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
22297,
67,
5748,
12,
2890,
16,
2815,
33,
25,
4672,
279,
273,
404,
400,
273,
6370,
67,
6642,
18,
10047,
2668,
2463,
67,
1125,
273,
261,
69,
422,
261,
22297,
1525,
13,
21,
176... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
866,
67,
22297,
67,
5748,
12,
2890,
16,
2815,
33,
25,
4672,
279,
273,
404,
400,
273,
6370,
67,
6642,
18,
10047,
2668,
2463,
67,
1125,
273,
261,
69,
422,
261,
22297,
1525,
13,
21,
176... |
if special_char: encoded_char = special_char.decode(locale_encoding) temp_mod_name = 'test_imp_helper_' + encoded_char test_package_name = 'test_imp_helper_package_' + encoded_char init_file_name = os.path.join(test_package_name, '__init__.py') try: with open(temp_mod_name + '.py', 'w') as file: file.write('a = 1\n') file, filename, info = imp.find_module(temp_mod_name) self.assertNotEquals(None, file) self.assertTrue(filename[:-3].endswith(temp_mod_name)) self.assertEquals('.py', info[0]) self.assertEquals('U', info[1]) self.assertEquals(imp.PY_SOURCE, info[2]) | if not special_char: self.skipTest("can't run this test with %s as preferred encoding" % locale_encoding) decoded_char = special_char.decode(locale_encoding) temp_mod_name = 'test_imp_helper_' + decoded_char test_package_name = 'test_imp_helper_package_' + decoded_char init_file_name = os.path.join(test_package_name, '__init__.py') try: with open(temp_mod_name + '.py', 'w') as file: file.write('a = 1\n') file, filename, info = imp.find_module(temp_mod_name) self.assertNotEquals(None, file) self.assertTrue(filename[:-3].endswith(temp_mod_name)) self.assertEquals('.py', info[0]) self.assertEquals('U', info[1]) self.assertEquals(imp.PY_SOURCE, info[2]) | def test_issue5604(self): # Test cannot cover imp.load_compiled function. # Martin von Loewis note what shared library cannot have non-ascii # character because init_xxx function cannot be compiled # and issue never happens for dynamic modules. # But sources modified to follow generic way for processing pathes. | 09899e7e9562a523af348244bc5027bd76bbb5e6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/09899e7e9562a523af348244bc5027bd76bbb5e6/test_imp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
13882,
4313,
3028,
12,
2890,
4672,
468,
7766,
2780,
5590,
1646,
18,
945,
67,
19397,
445,
18,
468,
490,
485,
267,
331,
265,
3176,
359,
291,
4721,
4121,
5116,
5313,
2780,
1240,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
13882,
4313,
3028,
12,
2890,
4672,
468,
7766,
2780,
5590,
1646,
18,
945,
67,
19397,
445,
18,
468,
490,
485,
267,
331,
265,
3176,
359,
291,
4721,
4121,
5116,
5313,
2780,
1240,
... |
if not path: | if not path or path=='/': | def norm_url (url): """replace empty paths with / and normalize them""" urlparts = list(urlparse.urlparse(url)) path = urlparts[2] if not path: urlparts[2] = '/' else: # XXX only windows and posix?? # collapse redundant path segments urlparts[2] = os.path.normpath(path).replace('\\', '/') if path.endswith('/'): urlparts[2] += '/' return urlparse.urlunparse(urlparts) | c3741560c4d8e9a1e9ed66791ebf54daf97a8304 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/c3741560c4d8e9a1e9ed66791ebf54daf97a8304/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4651,
67,
718,
261,
718,
4672,
3536,
2079,
1008,
2953,
598,
342,
471,
3883,
2182,
8395,
880,
6019,
273,
666,
12,
718,
2670,
18,
718,
2670,
12,
718,
3719,
589,
273,
880,
6019,
63,
22,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4651,
67,
718,
261,
718,
4672,
3536,
2079,
1008,
2953,
598,
342,
471,
3883,
2182,
8395,
880,
6019,
273,
666,
12,
718,
2670,
18,
718,
2670,
12,
718,
3719,
589,
273,
880,
6019,
63,
22,
... |
file_obj = open(STATUS_DIR+"/"+filename+".txt",'a') file_obj.write(results) | file_obj = open(STATUS_DIR+"/"+filename+".txt",'r') contents = file_obj.read() file_obj.close() if contents.find("Grading Complete") == -1: file_obj = open(STATUS_DIR+"/"+filename+".txt",'w') file_obj.write("Grading Complete\n") else: file_obj = open(STATUS_DIR+"/"+filename+".txt",'a') file_obj.write(results+"\n") | def save_grade(results,filename): file_obj = open(STATUS_DIR+"/"+filename+".txt",'a') file_obj.write(results) file_obj.close() | f448ac0aa00383d8363134c56e7549a55e26dc82 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7995/f448ac0aa00383d8363134c56e7549a55e26dc82/autograder_runner.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
67,
3994,
12,
4717,
16,
3459,
4672,
282,
585,
67,
2603,
273,
1696,
12,
8608,
67,
4537,
9078,
4898,
15,
3459,
9078,
18,
5830,
3113,
11,
86,
6134,
2939,
273,
585,
67,
2603,
18,
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,
1923,
67,
3994,
12,
4717,
16,
3459,
4672,
282,
585,
67,
2603,
273,
1696,
12,
8608,
67,
4537,
9078,
4898,
15,
3459,
9078,
18,
5830,
3113,
11,
86,
6134,
2939,
273,
585,
67,
2603,
18,
8... |
if DEBUG: print "All priors are too small, reinitiallizing" issmall = True | if DEBUG: print "All priors are too small, reinitializing" issmall = num.array((1,)).any() | def gmmupdate(mu,S,priors,gamma,x,weights=1,mincov=.01,initcovars=None): if num.any(initcovars) == False: initcovars = S # number of data points n = gamma.shape[0] # number of clusters k = gamma.shape[1] # dimensionality of data d = x.shape[1] gamma *= num.tile(weights.reshape(n,1),[1,k]) # update the priors (note that it has not been normalized yet) priors[:] = num.sum(gamma,axis=0) Z = priors.copy() sumpriors = num.sum(priors) if sumpriors > 0: priors /= sumpriors issmall = priors < .01 issmall = issmall.any() else: if DEBUG: print "All priors are too small, reinitiallizing" issmall = True #print 'updated priors to ' + str(priors) # if any prior is to small, then reinitialize that cluster if issmall: fixsmallpriors(x,mu,S,priors,initcovars,gamma) priors[:] = num.sum(gamma,axis=0) Z = priors.copy() priors /= num.sum(priors) if DEBUG: print 'after fixsmallpriors, priors is ' + str(priors) issmall = issmall.any() if issmall: if DEBUG: print 'outside fixsmallpriors' print 'reset mu = ' + str(mu) for i in range(k): print 'reset S[:,:,%d] = '%i + str(S[:,:,i]) print 'reset priors = ' + str(priors) #print 'reset gamma = ' #print gamma for i in range(k): # update the means mu[i,:] = num.sum(num.tile(gamma[:,i].reshape(n,1),[1,d])*x,axis=0)/Z[i] if DEBUG: if issmall: print 'updated mu[%d,:] to '%i + str(mu[i,:]) # update the covariances diffs = x - num.tile(mu[i,:],[n,1]) #if issmall: print 'diffs = ' + str(diffs) diffs *= num.tile(num.sqrt(gamma[:,i].reshape(n,1)),[1,d]) #if issmall: print 'weighted diffs = ' + str(diffs) S[:,:,i] = (num.dot(num.transpose(diffs),diffs)) / Z[i] if DEBUG: if issmall: print 'updated S[:,:,%d] to [%.4f,%.4f;%.4f,%.4f]'%(i,S[0,0,i],S[0,1,i],S[1,0,i],S[1,1,i]) # make sure covariance is not too small if mincov > 0: [D,V] = num.linalg.eig(S[:,:,i]) if num.min(D) < mincov: S[:,:,i] = initcovars[:,:,i] if DEBUG: print 'mineigval = %.4f'%num.min(D) print 'reinitializing covariance' print 'D = ' print D print 'initcovars[:,:,%d] = [%.4f,%.4f;%.4f,%.4f]'%(i,initcovars[0,0,i],initcovars[0,1,i],initcovars[1,0,i],initcovars[1,1,i]) | 26b0f5f3cf9734f05864fdde2ceb047f873c8bdd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2711/26b0f5f3cf9734f05864fdde2ceb047f873c8bdd/kcluster.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
314,
7020,
2725,
12,
13297,
16,
55,
16,
29112,
1383,
16,
20589,
16,
92,
16,
9727,
33,
21,
16,
1154,
14014,
33,
18,
1611,
16,
2738,
2894,
4699,
33,
7036,
4672,
225,
309,
818,
18,
2273... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7020,
2725,
12,
13297,
16,
55,
16,
29112,
1383,
16,
20589,
16,
92,
16,
9727,
33,
21,
16,
1154,
14014,
33,
18,
1611,
16,
2738,
2894,
4699,
33,
7036,
4672,
225,
309,
818,
18,
2273... |
def _validate_statement(self, statement): if type(statement) in Query.STATEMENT_TYPES or isinstance(statement, Query): if type(statement) in [list, tuple]: try: s,p,o = statement except: raise ValueError('''Statement of type [list, tuple] does not have all the (s,p,o) members (the length of the supplied arguemnt must be at least 3)''') if type(s) in [URIRef, BNode] or \ (type(s) in [str, unicode] and s.startswith('?')): pass else: raise ValueError('The subject is not a valid variable type') if type(p) in [URIRef] or \ (type(p) in [str, unicode] and p.startswith('?')): pass else: raise ValueError('The predicate is not a valid variable type') if type(o) in [URIRef, BNode, Literal] or \ (type(o) in [str, unicode] and o.startswith('?')): pass else: raise ValueError('The object is not a valid variable type') return True else: raise ValueError('Statement type not in %s'%str(Query.STATEMENT_TYPES)) | def _validate_variable(self, var): if type(var) in [str, unicode]: if not var.startswith('?'): for aggregate in Query.AGGREGATE_FUCTIONS: if var.lower().startswith(aggregate): return True raise ValueError('''Not a variable : <%s>, check correct syntax ("?" or supported aggregate %s)'''%(var,str(Query.AGGREGATE_FUCTIONS))) return True else: raise ValueError('''Unknown variable type, all variables must either start with a "?" or be among the recognized aggregates : %s'''%Query.AGGREGATE_FUCTIONS) | 50987b42a702657a5f2489c63c92902a26233ef6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13812/50987b42a702657a5f2489c63c92902a26233ef6/query.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5662,
67,
6105,
12,
2890,
16,
569,
4672,
309,
618,
12,
1401,
13,
316,
306,
701,
16,
5252,
14542,
309,
486,
569,
18,
17514,
1918,
2668,
4899,
4672,
364,
7047,
316,
2770,
18,
1781,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5662,
67,
6105,
12,
2890,
16,
569,
4672,
309,
618,
12,
1401,
13,
316,
306,
701,
16,
5252,
14542,
309,
486,
569,
18,
17514,
1918,
2668,
4899,
4672,
364,
7047,
316,
2770,
18,
1781,
... | |
next = request.GET.get('next', '/') if not is_valid_next_url(next): next = '/' | next = clean_next(next) | def signout(request): """ signout from the website. Remove openid from session and kill it. url : /signout/" """ try: del request.session['openid'] except KeyError: pass next = request.GET.get('next', '/') if not is_valid_next_url(next): next = '/' logout(request) return HttpResponseRedirect(next) | 25d791473be87f7ee0fb708fe2461e03b711e056 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5675/25d791473be87f7ee0fb708fe2461e03b711e056/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1573,
659,
12,
2293,
4672,
3536,
1573,
659,
628,
326,
12504,
18,
3581,
21629,
628,
1339,
471,
8673,
518,
18,
225,
880,
294,
342,
2977,
659,
4898,
3536,
775,
30,
1464,
590,
18,
3184,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1573,
659,
12,
2293,
4672,
3536,
1573,
659,
628,
326,
12504,
18,
3581,
21629,
628,
1339,
471,
8673,
518,
18,
225,
880,
294,
342,
2977,
659,
4898,
3536,
775,
30,
1464,
590,
18,
3184,
32... |
self.substringSet.add(syllable[0:i+1]) return string in self.substringSet | self._substringSet.add(syllable[0:i+1]) return string in self._substringSet | def _hasSyllableSubstring(self, string): """ Checks if the given string is a syllable supported by this romanisation or a substring of one. | 01cc0f3b3089a2c824402c7d0c59f75b7c5af166 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11128/01cc0f3b3089a2c824402c7d0c59f75b7c5af166/operator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5332,
10876,
2906,
429,
1676,
1080,
12,
2890,
16,
533,
4672,
3536,
13074,
309,
326,
864,
533,
353,
279,
29136,
3260,
635,
333,
24137,
304,
10742,
578,
279,
3019,
434,
1245,
18,
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,
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,
5332,
10876,
2906,
429,
1676,
1080,
12,
2890,
16,
533,
4672,
3536,
13074,
309,
326,
864,
533,
353,
279,
29136,
3260,
635,
333,
24137,
304,
10742,
578,
279,
3019,
434,
1245,
18,
2,
... |
f = open(file, 'r') x = TestSGML() while 1: line = f.readline() if not line: x.close() break x.feed(line) | if file == '-': f = sys.stdin else: try: f = open(file, 'r') except IOError, msg: print file, ":", msg sys.exit(1) data = f.read() if f is not sys.stdin: f.close() x = klass() for c in data: x.feed(c) x.close() | def test(): file = 'test.html' f = open(file, 'r') x = TestSGML() while 1: line = f.readline() if not line: x.close() break x.feed(line) | 405f97f14e8d0830cb0c1f6bd902252c38367248 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/405f97f14e8d0830cb0c1f6bd902252c38367248/sgmllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
13332,
585,
273,
296,
3813,
18,
2620,
11,
225,
309,
585,
422,
4014,
30,
284,
273,
2589,
18,
21772,
469,
30,
775,
30,
284,
273,
1696,
12,
768,
16,
296,
86,
6134,
1335,
8340,
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,
1842,
13332,
585,
273,
296,
3813,
18,
2620,
11,
225,
309,
585,
422,
4014,
30,
284,
273,
2589,
18,
21772,
469,
30,
775,
30,
284,
273,
1696,
12,
768,
16,
296,
86,
6134,
1335,
8340,
16,... |
self.view(self.fileinfo, zoom=0, rotation = self.rotation) | self.view(self.fileitem, zoom=0, rotation = self.rotation) | def eventhandler(self, event): | b72d486c76612e003909b5e9a5bb41d0394f92df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/b72d486c76612e003909b5e9a5bb41d0394f92df/viewer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
871,
4176,
12,
2890,
16,
871,
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,... | [
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,
871,
4176,
12,
2890,
16,
871,
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,... |
def listupdate_event(self, event): | def listselect_event(self, event): | def listupdate_event(self, event): if not self.is_active(): return self.userwantswindow = True self._selection_changed() | 5eec54ba09f2e4c519a8e394f43366bed50de2e0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/5eec54ba09f2e4c519a8e394f43366bed50de2e0/AutoCompleteWindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
4025,
67,
2575,
12,
2890,
16,
871,
4672,
309,
486,
365,
18,
291,
67,
3535,
13332,
327,
365,
18,
1355,
91,
4388,
5668,
273,
1053,
365,
6315,
10705,
67,
6703,
1435,
2,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
4025,
67,
2575,
12,
2890,
16,
871,
4672,
309,
486,
365,
18,
291,
67,
3535,
13332,
327,
365,
18,
1355,
91,
4388,
5668,
273,
1053,
365,
6315,
10705,
67,
6703,
1435,
2,
-100,
-100,
... |
fo = open(test_support.TESTFN, "wb") | fo = open(test_support.TESTFN, "w") | def test_print(self): d = deque(range(200)) d.append(d) try: fo = open(test_support.TESTFN, "wb") fo.write(str(d)) fo.close() fo = open(test_support.TESTFN, "rb") self.assertEqual(fo.read(), repr(d)) finally: fo.close() os.remove(test_support.TESTFN) | 70e684189b52dd8d60e2f365e8cdcbd3759e45d5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/70e684189b52dd8d60e2f365e8cdcbd3759e45d5/test_deque.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1188,
12,
2890,
4672,
302,
273,
21147,
12,
3676,
12,
6976,
3719,
302,
18,
6923,
12,
72,
13,
775,
30,
18261,
273,
1696,
12,
3813,
67,
13261,
18,
16961,
19793,
16,
315,
91,
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,
1842,
67,
1188,
12,
2890,
4672,
302,
273,
21147,
12,
3676,
12,
6976,
3719,
302,
18,
6923,
12,
72,
13,
775,
30,
18261,
273,
1696,
12,
3813,
67,
13261,
18,
16961,
19793,
16,
315,
91,
7... |
txt += "%s:\t%s\n" % (i, self.data[i]) | txt += "\t%s:\t%s\n" % (i, self.data[i]) | def __repr__(self): """Returns some information on the current video flux""" txt = self.Video + "\n" txt += "Producer: %s\tWidth= %i\tHeigth= %i\n" % (self.Producer, self.Width, self.Height) for i in self.data: txt += "%s:\t%s\n" % (i, self.data[i]) return txt | 0f0f2eb5efa0b5fe47f801b6ea2a52be49c33744 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12328/0f0f2eb5efa0b5fe47f801b6ea2a52be49c33744/NommeVideo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
12715,
972,
12,
2890,
4672,
3536,
1356,
2690,
1779,
603,
326,
783,
6191,
11772,
8395,
6463,
273,
365,
18,
10083,
397,
1548,
82,
6,
6463,
1011,
315,
12140,
30,
738,
87,
64,
88,
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,
1001,
12715,
972,
12,
2890,
4672,
3536,
1356,
2690,
1779,
603,
326,
783,
6191,
11772,
8395,
6463,
273,
365,
18,
10083,
397,
1548,
82,
6,
6463,
1011,
315,
12140,
30,
738,
87,
64,
88,
23... |
raise unittest.SkipTest("test works only on NT+, and with " "pseudo-Unicode filesystems") | raise unittest.SkipTest("only NT+ and systems with Unicode" "-friendly filesystem encoding") | def setUp(self): try: os.mkdir(test_support.TESTFN) except OSError: pass for name in self.files: try: f = open(name, 'w') except UnicodeEncodeError: if not os.path.supports_unicode_filenames: raise unittest.SkipTest("test works only on NT+, and with " "pseudo-Unicode filesystems") f.write((name+'\n').encode("utf-8")) f.close() os.stat(name) | 2c1022f05fcc107e9f0fd3ac02637368433951ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/2c1022f05fcc107e9f0fd3ac02637368433951ab/test_pep277.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
12,
2890,
4672,
775,
30,
1140,
18,
26686,
12,
3813,
67,
13261,
18,
16961,
19793,
13,
1335,
10002,
30,
1342,
364,
508,
316,
365,
18,
2354,
30,
775,
30,
284,
273,
1696,
12,
529,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
775,
30,
1140,
18,
26686,
12,
3813,
67,
13261,
18,
16961,
19793,
13,
1335,
10002,
30,
1342,
364,
508,
316,
365,
18,
2354,
30,
775,
30,
284,
273,
1696,
12,
529,
... |
def __init__(self,argumentsDict): | def __init__( self, argumentsDict ): | def __init__(self,argumentsDict): """ Standard constructor """ self.name = COMPONENT_NAME self.log = gLogger.getSubLogger(self.name) self.argumentsDict = argumentsDict self.rm = False gMonitor.registerActivity("Put and register","Put and register operations","PutAndRegister", "Attempts/min", gMonitor.OP_SUM ) gMonitor.registerActivity("Put failed","Failed puts","PutAndRegister", "Failed/min", gMonitor.OP_SUM ) gMonitor.registerActivity("Put successful","Successful puts","PutAndRegister", "Successful/min", gMonitor.OP_SUM ) gMonitor.registerActivity("File registration successful","Successful file registrations","PutAndRegister", "Successful/min", gMonitor.OP_SUM ) gMonitor.registerActivity("File registration failed","Failed file registrations","TransferAgent", "Failed/min", gMonitor.OP_SUM ) | 203b3f482634aa69b2569c32c04bfbf6f7a10c51 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/203b3f482634aa69b2569c32c04bfbf6f7a10c51/PutAndRegister.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
1775,
5014,
262,
30,
3536,
8263,
3885,
3536,
365,
18,
529,
273,
13846,
15624,
67,
1985,
365,
18,
1330,
273,
314,
3328,
18,
588,
1676,
3328,
12,
2890,
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,
1001,
2738,
972,
12,
365,
16,
1775,
5014,
262,
30,
3536,
8263,
3885,
3536,
365,
18,
529,
273,
13846,
15624,
67,
1985,
365,
18,
1330,
273,
314,
3328,
18,
588,
1676,
3328,
12,
2890,
18,
... |
return self.tk.call(self.stylename, 'cget', '-%s'%key, value) | return self.tk.call(self.stylename, 'cget', '-%s'%key) | def __getitem__(self,key): return self.tk.call(self.stylename, 'cget', '-%s'%key, value) | 33ff39520183dc58941b8edafcbec7ff721e8e41 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/33ff39520183dc58941b8edafcbec7ff721e8e41/Tix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
856,
4672,
327,
365,
18,
16099,
18,
1991,
12,
2890,
18,
334,
93,
14724,
16,
296,
71,
588,
2187,
2400,
9,
87,
11,
9,
856,
16,
460,
13,
2,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
856,
4672,
327,
365,
18,
16099,
18,
1991,
12,
2890,
18,
334,
93,
14724,
16,
296,
71,
588,
2187,
2400,
9,
87,
11,
9,
856,
16,
460,
13,
2,
-100,
-100,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.