rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
can be instanced when used by the MultiPathXMLRPCServer | can be instanced when used by the MultiPathXMLRPCServer. | def remove_duplicates(lst): """remove_duplicates([2,2,2,1,3,3]) => [3,1,2] Returns a copy of a list without duplicates. Every list item must be hashable and the order of the items in the resulting list is not defined. """ u = {} for x in lst: u[x] = 1 return u.keys() | e1ff21413963af513932104c2730206d952b2537 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/e1ff21413963af513932104c2730206d952b2537/SimpleXMLRPCServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
67,
22449,
12,
16923,
4672,
3536,
4479,
67,
22449,
3816,
22,
16,
22,
16,
22,
16,
21,
16,
23,
16,
23,
5717,
516,
306,
23,
16,
21,
16,
22,
65,
225,
2860,
279,
1610,
434,
279,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
67,
22449,
12,
16923,
4672,
3536,
4479,
67,
22449,
3816,
22,
16,
22,
16,
22,
16,
21,
16,
23,
16,
23,
5717,
516,
306,
23,
16,
21,
16,
22,
65,
225,
2860,
279,
1610,
434,
279,
... |
sf = self.static and "staticforward " | sf = self.static and "static " | def generate(self): # XXX This should use long strings and %(varname)s substitution! | 31cefc5118ef45111342ab6802115e1250c9ea15 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/31cefc5118ef45111342ab6802115e1250c9ea15/bgenObjectDefinition.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
12,
2890,
4672,
468,
11329,
1220,
1410,
999,
1525,
2064,
471,
8975,
1401,
529,
13,
87,
12785,
5,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
12,
2890,
4672,
468,
11329,
1220,
1410,
999,
1525,
2064,
471,
8975,
1401,
529,
13,
87,
12785,
5,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
if counter % 3 != 2: | else: | def print_section(count, name): print >> f print >> f, "% 7i !N%s" % (count, name) | bca6260b20603e4b8548e3cd4269c77d165487ac /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11052/bca6260b20603e4b8548e3cd4269c77d165487ac/psf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
67,
3464,
12,
1883,
16,
508,
4672,
1172,
1671,
284,
1172,
1671,
284,
16,
2213,
2371,
77,
401,
50,
9,
87,
6,
738,
261,
1883,
16,
508,
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,
1172,
67,
3464,
12,
1883,
16,
508,
4672,
1172,
1671,
284,
1172,
1671,
284,
16,
2213,
2371,
77,
401,
50,
9,
87,
6,
738,
261,
1883,
16,
508,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
vals_journal['type'] = 'cash' | vals_journal['type'] = line.account_type == 'cash' and 'cash' or 'bank' | def execute(self, cr, uid, ids, context=None): obj_multi = self.browse(cr, uid, ids[0]) obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') obj_sequence = self.pool.get('ir.sequence') obj_acc_template = self.pool.get('account.account.template') obj_fiscal_position_template = self.pool.get('account.fiscal.position.template') obj_fiscal_position = self.pool.get('account.fiscal.position') obj_data = self.pool.get('ir.model.data') analytic_journal_obj = self.pool.get('account.analytic.journal') obj_tax_code = self.pool.get('account.tax.code') # Creating Account obj_acc_root = obj_multi.chart_template_id.account_root_id tax_code_root_id = obj_multi.chart_template_id.tax_code_root_id.id company_id = obj_multi.company_id.id | 8e59d73e71dc2406f96ee3bb4fe2477532f46993 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8e59d73e71dc2406f96ee3bb4fe2477532f46993/account.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
1081,
67,
7027,
273,
365,
18,
25731,
12,
3353,
16,
4555,
16,
3258,
63,
20,
5717,
1081,
67,
8981,
273,
365,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
1081,
67,
7027,
273,
365,
18,
25731,
12,
3353,
16,
4555,
16,
3258,
63,
20,
5717,
1081,
67,
8981,
273,
365,
18,
... |
return cls.from_element(etree.XML(document, cls._parser)) | try: xml = etree.XML(document, cls._parser) except etree.XMLSyntaxError, e: raise ParserError(str(e)) else: return cls.from_element(xml) | def parse(cls, document): return cls.from_element(etree.XML(document, cls._parser)) | 7c44fa25e6f64846630e8a44033b681e59cd9c26 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3449/7c44fa25e6f64846630e8a44033b681e59cd9c26/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
6429,
16,
1668,
4672,
775,
30,
2025,
273,
12031,
18,
4201,
12,
5457,
16,
2028,
6315,
4288,
13,
1335,
12031,
18,
4201,
22510,
16,
425,
30,
1002,
6783,
668,
12,
701,
12,
73,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1109,
12,
6429,
16,
1668,
4672,
775,
30,
2025,
273,
12031,
18,
4201,
12,
5457,
16,
2028,
6315,
4288,
13,
1335,
12031,
18,
4201,
22510,
16,
425,
30,
1002,
6783,
668,
12,
701,
12,
73,
... |
x += 1 | return x + 1 | def increment(x): x += 1 | 7d2f2bc72e3690966c88bb56ad64cbf352e9aed7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1390/7d2f2bc72e3690966c88bb56ad64cbf352e9aed7/stash.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5504,
12,
92,
4672,
327,
619,
397,
404,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5504,
12,
92,
4672,
327,
619,
397,
404,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
table.attach(option3,1,2,2,3) | table.attach(option3, 1, 2, 2, 3) | def validedChanges(*args): """Check for a least one selected kana portion (display of a message if not the case), catch parameters, then close the window. | 64cfb9e0b60a3a976c72fa9d5d722987641133b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3073/64cfb9e0b60a3a976c72fa9d5d722987641133b9/gtk_gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1244,
13898,
7173,
30857,
1968,
4672,
3536,
1564,
364,
279,
4520,
1245,
3170,
417,
13848,
14769,
261,
5417,
434,
279,
883,
309,
486,
326,
648,
3631,
1044,
1472,
16,
1508,
1746,
326,
2742,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1244,
13898,
7173,
30857,
1968,
4672,
3536,
1564,
364,
279,
4520,
1245,
3170,
417,
13848,
14769,
261,
5417,
434,
279,
883,
309,
486,
326,
648,
3631,
1044,
1472,
16,
1508,
1746,
326,
2742,
... |
for u in users: if u not in self._users.keys(): self._users[u] = "" | for user in users: self._users.append(user) | def users(self, users=None): """Update the uers list and eventually add the given users.""" if not users: users = [] | 5a77d0d6ad8ba4d270242721147b8485302bc0c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2718/5a77d0d6ad8ba4d270242721147b8485302bc0c6/window_channel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3677,
12,
2890,
16,
3677,
33,
7036,
4672,
3536,
1891,
326,
582,
414,
666,
471,
18011,
527,
326,
864,
3677,
12123,
309,
486,
3677,
30,
3677,
273,
5378,
2,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
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,
3677,
12,
2890,
16,
3677,
33,
7036,
4672,
3536,
1891,
326,
582,
414,
666,
471,
18011,
527,
326,
864,
3677,
12123,
309,
486,
3677,
30,
3677,
273,
5378,
2,
-100,
-100,
-100,
-100,
-100,
... |
def __init__(self, tokens = TOKENS): | def __init__(self, tokens = TOKENS, mode = MODE_NORMAL): | def __init__(self, tokens = TOKENS): ''' Constructor: tokens = t-uple with TOKENS list ''' self.lex = None self.tokens = tokens | 091ad034b09c85c4d3c2a7e4ebfdf9df96d58698 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4631/091ad034b09c85c4d3c2a7e4ebfdf9df96d58698/lexer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2430,
273,
14275,
55,
16,
1965,
273,
11741,
67,
15480,
4672,
9163,
11417,
30,
2430,
273,
268,
17,
2268,
598,
14275,
55,
666,
9163,
365,
18,
4149,
273,
59... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
2738,
972,
12,
2890,
16,
2430,
273,
14275,
55,
16,
1965,
273,
11741,
67,
15480,
4672,
9163,
11417,
30,
2430,
273,
268,
17,
2268,
598,
14275,
55,
666,
9163,
365,
18,
4149,
273,
59... |
not exists.' % wdir, logfile, 0, '') | not exists.' % wdir, logfile, 0, '') | def ClearDir(DEBUGON, logfile, dirl): 'Clear the node directories under dirlist' nodelist = [] dirlist=dirl.split(',') dirlen=len(dirlist) nodename = str(socket.gethostname()) if DEBUGON: printlog('o2tf.ClearDir: logfile = (%s)' % logfile, logfile, 0, '') printlog('o2tf.ClearDir: dirlist = (%s)' % dirlist, logfile, 0, '') | 657bfc37c22ea26052b0df161170cb3df469efec /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1915/657bfc37c22ea26052b0df161170cb3df469efec/o2tf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10121,
1621,
12,
9394,
673,
16,
15204,
16,
1577,
80,
4672,
296,
9094,
326,
756,
6402,
3613,
1577,
1098,
11,
30068,
273,
5378,
1577,
1098,
33,
1214,
80,
18,
4939,
12,
2187,
6134,
1577,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10121,
1621,
12,
9394,
673,
16,
15204,
16,
1577,
80,
4672,
296,
9094,
326,
756,
6402,
3613,
1577,
1098,
11,
30068,
273,
5378,
1577,
1098,
33,
1214,
80,
18,
4939,
12,
2187,
6134,
1577,
... |
for (redir_name, code, target, final) in self.generator.get_redirects_via_api( namespaces = self.generator.namespaces, start = self.generator.api_start, until = self.generator.api_until, maxlen = 2): | for (redir_name, code, target, final)\ in self.generator.get_redirects_via_api( namespaces=self.generator.namespaces, start=self.generator.api_start, until=self.generator.api_until, maxlen = 2): | def fix_double_or_delete_broken_redirects(self): # TODO: part of this should be moved to generator, the rest merged into self.run() # get reason for deletion text delete_reason = wikipedia.translate(self.site, reason_broken) count = 0 for (redir_name, code, target, final) in self.generator.get_redirects_via_api( namespaces = self.generator.namespaces, start = self.generator.api_start, until = self.generator.api_until, maxlen = 2): if code == 1: continue elif code == 0: self.delete_1_broken_redirect(redir_name, delete_reason) count += 1 else: self.fix_1_double_redirect(redir_name) count += 1 # print ('%s .. %s' % (count, self.number)) if self.exiting or ( self.number and count >= self.number ): break | c499f5c4d7eb66e6b361af0a88786c3f2ea91f11 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/c499f5c4d7eb66e6b361af0a88786c3f2ea91f11/redirect.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
67,
9056,
67,
280,
67,
3733,
67,
70,
19906,
67,
22715,
12,
2890,
4672,
468,
2660,
30,
1087,
434,
333,
1410,
506,
10456,
358,
4456,
16,
326,
3127,
5384,
1368,
365,
18,
2681,
1435,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
67,
9056,
67,
280,
67,
3733,
67,
70,
19906,
67,
22715,
12,
2890,
4672,
468,
2660,
30,
1087,
434,
333,
1410,
506,
10456,
358,
4456,
16,
326,
3127,
5384,
1368,
365,
18,
2681,
1435,... |
u.encode(sys.getfilesystemencoding())) | u.encode('utf8')) | def setUp(self): u = uw("profileDir_") self.path = os.path.join(os.path.dirname(__file__), u.encode(sys.getfilesystemencoding())) | a5b8fcc714de19288a60feb87f6d2ea9d24ef5dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/a5b8fcc714de19288a60feb87f6d2ea9d24ef5dd/TestCrypto.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
12,
2890,
4672,
582,
273,
582,
91,
2932,
5040,
1621,
67,
7923,
365,
18,
803,
273,
1140,
18,
803,
18,
5701,
12,
538,
18,
803,
18,
12287,
12,
972,
768,
972,
3631,
582,
18,
3015,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
24292,
12,
2890,
4672,
582,
273,
582,
91,
2932,
5040,
1621,
67,
7923,
365,
18,
803,
273,
1140,
18,
803,
18,
5701,
12,
538,
18,
803,
18,
12287,
12,
972,
768,
972,
3631,
582,
18,
3015,... |
"ASDMBinary", | def verify_asdm(asdmname): print "Verifying asdm ", asdmname if(not os.path.exists(asdmname)): print "asdm ", asdmname, " doesn't exist." raise Exception # test for the existence of all obligatory tables allTables = [ "Antenna.xml", "ASDMBinary", "ASDM.xml", # "CalData.xml", # "CalDelay.xml", # "CalReduction.xml", "ConfigDescription.xml", "CorrelatorMode.xml", "DataDescription.xml", "ExecBlock.xml", "Feed.xml", "Field.xml", "FocusModel.xml", "Focus.xml", "Main.xml", # "Pointing.bin", # "PointingModel.xml", "Polarization.xml", "Processor.xml", "Receiver.xml", "SBSummary.xml", "Scan.xml", "Source.xml", "SpectralWindow.xml", "State.xml", "Station.xml", "Subscan.xml", "SwitchCycle.xml" ] for fileName in allTables: filePath = asdmname+'/'+fileName if(not os.path.exists(filePath)): print "ASDM table file ", filePath, " doesn't exist." raise Exception else: # test if well formed rval = os.system('xmllint --noout '+filePath) if(rval !=0): print "Table ", filePath, " is not a well formed XML document." print "Note: xml validation not possible since ASDM DTDs (schemas) not yet online." | 77217459743833ff8dae04aa1983004faa1bb6b6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2098/77217459743833ff8dae04aa1983004faa1bb6b6/test_task_exportasdm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3929,
67,
345,
10956,
12,
345,
10956,
529,
4672,
1172,
315,
8097,
310,
487,
10956,
3104,
487,
10956,
529,
309,
12,
902,
1140,
18,
803,
18,
1808,
12,
345,
10956,
529,
3719,
30,
1172,
31... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3929,
67,
345,
10956,
12,
345,
10956,
529,
4672,
1172,
315,
8097,
310,
487,
10956,
3104,
487,
10956,
529,
309,
12,
902,
1140,
18,
803,
18,
1808,
12,
345,
10956,
529,
3719,
30,
1172,
31... | |
data only result classes via fetch_as_classes. | data only result classes via fetch_as_classes. | def new (self, **kwargs): """This is the equivalent to the raw-WMI SpawnInstance_ method. Note that there are relatively few uses for this, certainly fewer than you might imagine. Most classes which need to create a new *real* instance of themselves, eg Win32_Process, offer a .Create method. SpawnInstance_ is generally reserved for instances which are passed as parameters to such .Create methods, a common example being the Win32_SecurityDescriptor, passed to Win32_Share.Create and other instances which need security. | 33b6afeb09b0fb0f6979802bcea6210277916dda /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1886/33b6afeb09b0fb0f6979802bcea6210277916dda/wmi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
261,
2890,
16,
2826,
4333,
4672,
3536,
2503,
353,
326,
7680,
358,
326,
1831,
17,
59,
7492,
5878,
9533,
1442,
67,
707,
18,
3609,
716,
1915,
854,
1279,
17526,
11315,
4692,
364,
333,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
261,
2890,
16,
2826,
4333,
4672,
3536,
2503,
353,
326,
7680,
358,
326,
1831,
17,
59,
7492,
5878,
9533,
1442,
67,
707,
18,
3609,
716,
1915,
854,
1279,
17526,
11315,
4692,
364,
333,
... |
pix=QPixmap() | pix = QPixmap() | def notify(self, sender, event): """ Notification sent by node """ img_pil = self.node.get_input(0) if img_pil != None: if img_pil.mode in ("RGB", "RGBA"): img = ImageQt(img_pil) else : img = ImageQt(img_pil.convert("RGBA")) pix=QPixmap.fromImage(img) self.set_image(pix) else : pix=QPixmap() self.set_image(pix) | 6d6d4beac9df3babbbd11312afbdd2d5200131eb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4914/6d6d4beac9df3babbbd11312afbdd2d5200131eb/widgets.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5066,
12,
2890,
16,
5793,
16,
871,
4672,
3536,
8050,
3271,
635,
756,
3536,
3774,
67,
84,
330,
273,
365,
18,
2159,
18,
588,
67,
2630,
12,
20,
13,
309,
3774,
67,
84,
330,
480,
599,
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,
5066,
12,
2890,
16,
5793,
16,
871,
4672,
3536,
8050,
3271,
635,
756,
3536,
3774,
67,
84,
330,
273,
365,
18,
2159,
18,
588,
67,
2630,
12,
20,
13,
309,
3774,
67,
84,
330,
480,
599,
3... |
the specified wmi_classname + where_clause, then return the results as a list of simple class instances with attributes matching fields_list. If fields is left empty, select * and pre-load all class attributes for each class returned. | the specified wmi_classname + where_clause, then return the results as a list of simple class instances with attributes matching fields_list. If fields is left empty, select * and pre-load all class attributes for each class returned. | def fetch_as_classes (self, wmi_classname, fields=(), **where_clause): """Build and execute a wql query to fetch the specified list of fields from the specified wmi_classname + where_clause, then return the results as a list of simple class instances with attributes matching fields_list. | 33b6afeb09b0fb0f6979802bcea6210277916dda /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1886/33b6afeb09b0fb0f6979802bcea6210277916dda/wmi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2158,
67,
345,
67,
4701,
261,
2890,
16,
341,
9197,
67,
18340,
16,
1466,
33,
9334,
2826,
6051,
67,
18128,
4672,
3536,
3116,
471,
1836,
279,
341,
1217,
843,
358,
2158,
326,
1269,
666,
43... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2158,
67,
345,
67,
4701,
261,
2890,
16,
341,
9197,
67,
18340,
16,
1466,
33,
9334,
2826,
6051,
67,
18128,
4672,
3536,
3116,
471,
1836,
279,
341,
1217,
843,
358,
2158,
326,
1269,
666,
43... |
if type(key) == types.TupleType: key = key[1] | if isinstance(key, tuple): key = key[1] | def check_key(key, key_extra_len=0): """Checks sanity of key. Fails if: Key length is > SERVER_MAX_KEY_LENGTH (Raises MemcachedKeyLength). Contains control characters (Raises MemcachedKeyCharacterError). Is not a string (Raises MemcachedStringEncodingError) Is an unicode string (Raises MemcachedStringEncodingError) Is not a string (Raises MemcachedKeyError) Is None (Raises MemcachedKeyError) """ if type(key) == types.TupleType: key = key[1] if not key: raise Client.MemcachedKeyNoneError, ("Key is None") if isinstance(key, unicode): raise Client.MemcachedStringEncodingError, ("Keys must be str()'s, not " "unicode. Convert your unicode strings using " "mystring.encode(charset)!") if not isinstance(key, str): raise Client.MemcachedKeyTypeError, ("Key must be str()'s") if isinstance(key, basestring): if len(key) + key_extra_len > SERVER_MAX_KEY_LENGTH: raise Client.MemcachedKeyLengthError, ("Key length is > %s" % SERVER_MAX_KEY_LENGTH) for char in key: if ord(char) < 32 or ord(char) == 127: raise Client.MemcachedKeyCharacterError, "Control characters not allowed" | aa973f034fdfe4801db987afda8191177edefc04 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11935/aa973f034fdfe4801db987afda8191177edefc04/memcache.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
856,
12,
856,
16,
498,
67,
7763,
67,
1897,
33,
20,
4672,
3536,
4081,
16267,
434,
498,
18,
225,
8911,
87,
309,
30,
1929,
769,
353,
405,
15061,
67,
6694,
67,
3297,
67,
7096,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
856,
12,
856,
16,
498,
67,
7763,
67,
1897,
33,
20,
4672,
3536,
4081,
16267,
434,
498,
18,
225,
8911,
87,
309,
30,
1929,
769,
353,
405,
15061,
67,
6694,
67,
3297,
67,
7096,
... |
myunmerge=string.join(myunmerge) | myunmerge=string.join(myunmerge) | def unmerge(self): print "Unmerging packages" if self.settings.has_key("embedded/unmerge"): if type(self.settings["embedded/unmerge"])==types.StringType: self.settings["embedded/unmerge"]=[self.settings["embedded/unmerge"]] myunmerge=self.settings["embedded/unmerge"][:] for x in range(0,len(myunmerge)): myunmerge[x]="'"+myunmerge[x]+"'" | 174272f3cab1885c032298a60fea31ba7fc6d2ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7327/174272f3cab1885c032298a60fea31ba7fc6d2ae/targets.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
640,
2702,
12,
2890,
4672,
1172,
315,
984,
6592,
1998,
5907,
6,
309,
365,
18,
4272,
18,
5332,
67,
856,
2932,
20722,
19,
318,
2702,
6,
4672,
309,
618,
12,
2890,
18,
4272,
9614,
20722,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
640,
2702,
12,
2890,
4672,
1172,
315,
984,
6592,
1998,
5907,
6,
309,
365,
18,
4272,
18,
5332,
67,
856,
2932,
20722,
19,
318,
2702,
6,
4672,
309,
618,
12,
2890,
18,
4272,
9614,
20722,
... |
self._parser.CommentHandler = self._lex_handler_prop.comment self._parser.StartCdataSectionHandler = self._lex_handler_prop.startCDATA self._parser.EndCdataSectionHandler = self._lex_handler_prop.endCDATA | self._reset_lex_handler_prop() | def reset(self): if self._namespaces: self._parser = expat.ParserCreate(None, " ") self._parser.StartElementHandler = self.start_element_ns self._parser.EndElementHandler = self.end_element_ns else: self._parser = expat.ParserCreate() self._parser.StartElementHandler = self.start_element self._parser.EndElementHandler = self.end_element | fb73bb129b2ccbd9644709ac8eeac1d5e7f0a32d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fb73bb129b2ccbd9644709ac8eeac1d5e7f0a32d/expatreader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2715,
12,
2890,
4672,
309,
365,
6315,
16078,
30,
365,
6315,
4288,
273,
1329,
270,
18,
2678,
1684,
12,
7036,
16,
315,
9369,
365,
6315,
4288,
18,
1685,
1046,
1503,
273,
365,
18,
1937,
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,
2715,
12,
2890,
4672,
309,
365,
6315,
16078,
30,
365,
6315,
4288,
273,
1329,
270,
18,
2678,
1684,
12,
7036,
16,
315,
9369,
365,
6315,
4288,
18,
1685,
1046,
1503,
273,
365,
18,
1937,
67... |
_prelude.prelude_client_destroy(self._client) | _prelude.prelude_client_destroy(self._client, self._exit_status) | def __del__(self): #print "Client.__del__" if self._msgbuf: _prelude.prelude_msgbuf_close(self._msgbuf) #self._msgbuf = None | ca993d7bedc20a8b801a911e9981c7242533d1da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11628/ca993d7bedc20a8b801a911e9981c7242533d1da/prelude.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
3771,
972,
12,
2890,
4672,
468,
1188,
315,
1227,
16186,
3771,
14437,
225,
309,
365,
6315,
3576,
4385,
30,
389,
1484,
80,
1317,
18,
1484,
80,
1317,
67,
3576,
4385,
67,
4412,
12,
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,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
3771,
972,
12,
2890,
4672,
468,
1188,
315,
1227,
16186,
3771,
14437,
225,
309,
365,
6315,
3576,
4385,
30,
389,
1484,
80,
1317,
18,
1484,
80,
1317,
67,
3576,
4385,
67,
4412,
12,
2... |
if coords is None: coords = self.ndim*[None] if coords_stag is None: coords_stag = self.ndim*[None] | if coords is None: coords = self.ndim*[None] else: coords = list(coords) if coords_stag is None: coords_stag = self.ndim*[None] else: coords_stag = list(coords_stag) | def __init__(self,dimensions=(),coords=None,coords_stag=None,data=None): self.ndim = len(dimensions) if coords is None: coords = self.ndim*[None] if coords_stag is None: coords_stag = self.ndim*[None] self.dimensions = dimensions self.data = data self.coords = coords self.coords_stag = coords_stag # Bounds for confidence interval (optional) self.lbound = None self.ubound = None | 4daa3c55696f8e4d8f289e878d9f6e2177a73314 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/381/4daa3c55696f8e4d8f289e878d9f6e2177a73314/common.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
14797,
33,
9334,
9076,
33,
7036,
16,
9076,
67,
334,
346,
33,
7036,
16,
892,
33,
7036,
4672,
365,
18,
82,
3509,
273,
562,
12,
14797,
13,
309,
6074,
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,
1001,
2738,
972,
12,
2890,
16,
14797,
33,
9334,
9076,
33,
7036,
16,
9076,
67,
334,
346,
33,
7036,
16,
892,
33,
7036,
4672,
365,
18,
82,
3509,
273,
562,
12,
14797,
13,
309,
6074,
353,... |
entry = (self.__curfile, self.__lineno) linenos = self.__messages.get(msg) if linenos is None: self.__messages[msg] = [entry] else: linenos.append(entry) | if not msg in self.__options.toexclude: entry = (self.__curfile, self.__lineno) linenos = self.__messages.get(msg) if linenos is None: self.__messages[msg] = [entry] else: linenos.append(entry) | def __openseen(self, ttype, tstring, lineno): if ttype == tokenize.OP and tstring == ')': # We've seen the last of the translatable strings. Record the # line number of the first line of the strings and update the list # of messages seen. Reset state for the next batch. If there # were no strings inside _(), then just ignore this entry. if self.__data: msg = string.join(self.__data, '') entry = (self.__curfile, self.__lineno) linenos = self.__messages.get(msg) if linenos is None: self.__messages[msg] = [entry] else: linenos.append(entry) self.__state = self.__waiting elif ttype == tokenize.STRING: self.__data.append(safe_eval(tstring)) # TBD: should we warn if we seen anything else? | c8f0892d1236df81af1811cf182692f28c85f916 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c8f0892d1236df81af1811cf182692f28c85f916/pygettext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
3190,
15156,
12,
2890,
16,
27963,
16,
268,
1080,
16,
7586,
4672,
309,
27963,
422,
13672,
18,
3665,
471,
268,
1080,
422,
5777,
30,
468,
1660,
8081,
5881,
326,
1142,
434,
326,
21884,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3190,
15156,
12,
2890,
16,
27963,
16,
268,
1080,
16,
7586,
4672,
309,
27963,
422,
13672,
18,
3665,
471,
268,
1080,
422,
5777,
30,
468,
1660,
8081,
5881,
326,
1142,
434,
326,
21884,... |
completing_from = True | def complete(line, cw): """Construct a full list of possibly completions for imports.""" tokens = line.split() if tokens[0] in ['from', 'import']: if tokens[0] == 'from': completing_from = True if len(tokens) > 3: if '.' in cw: # This will result in a SyntaxError, so do not return # any matches return list() cw = '%s.%s' % (tokens[1], cw) elif len(tokens) == 3: return ['import'] else: completing_from = False matches = list() for name in modules: if not (name.startswith(cw) and name.find('.', len(cw)) == -1): continue if completing_from: name = name[len(tokens[1]) + 1:] matches.append(name) return matches else: return list() | 399692f79e8a621b111c84a9b96e7d768128a811 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6932/399692f79e8a621b111c84a9b96e7d768128a811/importcompletion.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3912,
12,
1369,
16,
14098,
4672,
3536,
7249,
279,
1983,
666,
434,
10016,
23738,
364,
10095,
12123,
2430,
273,
980,
18,
4939,
1435,
309,
2430,
63,
20,
65,
316,
10228,
2080,
2187,
296,
566... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3912,
12,
1369,
16,
14098,
4672,
3536,
7249,
279,
1983,
666,
434,
10016,
23738,
364,
10095,
12123,
2430,
273,
980,
18,
4939,
1435,
309,
2430,
63,
20,
65,
316,
10228,
2080,
2187,
296,
566... | |
c = msvcrt.getch() | c = msvcrt.getwch() | def win_getpass(prompt='Password: ', stream=None): """Prompt for password with echo off, using Windows getch().""" if sys.stdin is not sys.__stdin__: return default_getpass(prompt, stream) import msvcrt for c in prompt: msvcrt.putch(c) pw = "" while 1: c = msvcrt.getch() if c == '\r' or c == '\n': break if c == '\003': raise KeyboardInterrupt if c == '\b': pw = pw[:-1] else: pw = pw + c msvcrt.putch('\r') msvcrt.putch('\n') return pw | 7485e5e4b73ce8915891f6776776e0474e749e5c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/7485e5e4b73ce8915891f6776776e0474e749e5c/getpass.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5657,
67,
588,
5466,
12,
13325,
2218,
3913,
30,
2265,
1407,
33,
7036,
4672,
3536,
15967,
364,
2201,
598,
3376,
3397,
16,
1450,
8202,
336,
343,
1435,
12123,
309,
2589,
18,
21772,
353,
486... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5657,
67,
588,
5466,
12,
13325,
2218,
3913,
30,
2265,
1407,
33,
7036,
4672,
3536,
15967,
364,
2201,
598,
3376,
3397,
16,
1450,
8202,
336,
343,
1435,
12123,
309,
2589,
18,
21772,
353,
486... |
exit_code, out = runo('svn diff %s --diff-cmd diff -x "-U %d" %s' % (revision, context, path)) | exit_code, out = runo('svn diff %s --diff-cmd diff -x "-U %d -b" %s' % (revision, context, path)) | def svn_savediff(file, target, revision=None, context=100): path = file.path if revision: revision = '-r %s' % revision else: revision = '' exit_code, out = runo('svn diff %s --diff-cmd diff -x "-U %d" %s' % (revision, context, path)) open(target, 'w').write(''.join(out)) return exit_code | 88aadcb727612edce5ac3e87edd9da0e6d603b6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14747/88aadcb727612edce5ac3e87edd9da0e6d603b6e/sublib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5893,
82,
67,
14077,
3048,
12,
768,
16,
1018,
16,
6350,
33,
7036,
16,
819,
33,
6625,
4672,
589,
273,
585,
18,
803,
309,
6350,
30,
6350,
273,
2400,
86,
738,
87,
11,
738,
6350,
469,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5893,
82,
67,
14077,
3048,
12,
768,
16,
1018,
16,
6350,
33,
7036,
16,
819,
33,
6625,
4672,
589,
273,
585,
18,
803,
309,
6350,
30,
6350,
273,
2400,
86,
738,
87,
11,
738,
6350,
469,
... |
self.acl_users.getDefaultUserSource().userFolderEditUser(id, None, user.getUserRoles()+groups, user.getDomains()) | self.acl_users._updateUser( name = id, groups = tuple(groups), ) | def removeMember(self, id): """ Remove the member with the provided id from the group """ user = self.acl_users.getUser(id) prefix = self.acl_users.getGroupPrefix() | a73a2acc4376912a8a3616f9c8e380f2d8b64733 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1807/a73a2acc4376912a8a3616f9c8e380f2d8b64733/GroupDataTool.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
4419,
12,
2890,
16,
612,
4672,
3536,
3581,
326,
3140,
598,
326,
2112,
612,
628,
326,
1041,
3536,
729,
273,
365,
18,
10150,
67,
5577,
18,
588,
1299,
12,
350,
13,
1633,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
4419,
12,
2890,
16,
612,
4672,
3536,
3581,
326,
3140,
598,
326,
2112,
612,
628,
326,
1041,
3536,
729,
273,
365,
18,
10150,
67,
5577,
18,
588,
1299,
12,
350,
13,
1633,
273,
365,
... |
olist.append("\t{ mpiPi_" + funct) olist.append(", \"" + funct + "\"") olist.append("}") counter = counter + 1 | olist.append("\t{ mpiPi_" + funct) olist.append(", \"" + funct + "\"") olist.append("}") counter = counter + 1 | def GenerateLookup(): global flist global fdict global gParamDict print "-----*----- Generating the lookup table" cwd = os.getcwd() os.chdir(cwd) sname = cwd + "/lookup.c" g = open(sname, "w") olist = StandardFileHeader(sname) ##### -jsv 8/14 | 381da0b99cf880ab0b33c8b91b75e552d211be1c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5863/381da0b99cf880ab0b33c8b91b75e552d211be1c/make-wrappers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6654,
6609,
13332,
2552,
284,
1098,
2552,
284,
1576,
2552,
314,
786,
5014,
225,
1172,
315,
13465,
14,
13465,
3055,
1776,
326,
3689,
1014,
6,
7239,
273,
1140,
18,
588,
11089,
1435,
1140,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6654,
6609,
13332,
2552,
284,
1098,
2552,
284,
1576,
2552,
314,
786,
5014,
225,
1172,
315,
13465,
14,
13465,
3055,
1776,
326,
3689,
1014,
6,
7239,
273,
1140,
18,
588,
11089,
1435,
1140,
... |
gen = pagegenerators.AllpagesPageGenerator(start) | def main(): gen = None pageTitle = [] args = wikipedia.handleArgs() args = globalvar.handleArgs(args) for arg in args: if arg.startswith('-start:'): start = arg[7:] gen = pagegenerators.AllpagesPageGenerator(start) else: pageTitle.append(arg) if pageTitle: pageTitle = ' '.join(pageTitle) page = wikipedia.Page(wikipedia.getSite(), pageTitle) gen = iter([page]) if gen: gen = pagegenerators.PreloadingGenerator(gen, pageNumber = 240) gen = pagegenerators.RedirectFilterPageGenerator(gen) bot = WeblinkCheckerRobot(gen) try: bot.run() finally: waitTime = 0 # Don't wait longer than 30 seconds for threads to finish. while threading.activeCount() > 2 and waitTime < 30: wikipedia.output(u"Waiting for remaining %i threads to finish, please wait..." % (threading.activeCount() - 2)) # don't count the main thread and report thread # wait 1 second time.sleep(1) waitTime += 1 if threading.activeCount() > 2: wikipedia.output(u'Remaining %i threads will be killed.' % (threading.activeCount() - 2)) # Threads will die automatically because they are daemonic. wikipedia.output(u'Saving history...') bot.history.save() if bot.history.reportThread: bot.history.reportThread.shutdown() # wait until the report thread is shut down; the user can interrupt # it by pressing CTRL-C. #try: try: while bot.history.reportThread.isAlive(): time.sleep(0.1) except KeyboardInterrupt: print 'INTERRUPT' bot.history.reportThread.kill() else: wikipedia.showHelp() | f6c245ec5408bb93af79987a33b9e6a8f1072b4a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/f6c245ec5408bb93af79987a33b9e6a8f1072b4a/weblinkchecker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
3157,
273,
599,
1363,
4247,
273,
5378,
833,
273,
21137,
18,
4110,
2615,
1435,
833,
273,
2552,
1401,
18,
4110,
2615,
12,
1968,
13,
225,
364,
1501,
316,
833,
30,
309,
1501,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
3157,
273,
599,
1363,
4247,
273,
5378,
833,
273,
21137,
18,
4110,
2615,
1435,
833,
273,
2552,
1401,
18,
4110,
2615,
12,
1968,
13,
225,
364,
1501,
316,
833,
30,
309,
1501,
... | |
pass | def on_vte_size_allocate(self, widget, allocation): self.titlebar.update_terminal_size(self.vte.get_column_count(), self.vte.get_row_count()) pass | e18f848487a0d60b6338c4cdcb8300b2c3480648 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1032/e18f848487a0d60b6338c4cdcb8300b2c3480648/terminal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
90,
736,
67,
1467,
67,
16247,
12,
2890,
16,
3604,
16,
13481,
4672,
365,
18,
2649,
3215,
18,
2725,
67,
15979,
67,
1467,
12,
2890,
18,
90,
736,
18,
588,
67,
2827,
67,
1883,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
90,
736,
67,
1467,
67,
16247,
12,
2890,
16,
3604,
16,
13481,
4672,
365,
18,
2649,
3215,
18,
2725,
67,
15979,
67,
1467,
12,
2890,
18,
90,
736,
18,
588,
67,
2827,
67,
1883,
... | |
cmd = ['git-ls-files', '-z', '--others', '--directory'] | cmd = ['git-ls-files', '-z', '--others', '--directory', '--no-empty-directory'] | def tree_status(files = None, tree_id = 'HEAD', unknown = False, noexclude = True, verbose = False, diff_flags = []): """Returns a list of pairs - (status, filename) """ if verbose: out.start('Checking for changes in the working directory') refresh_index() if not files: files = [] cache_files = [] # unknown files if unknown: cmd = ['git-ls-files', '-z', '--others', '--directory'] if not noexclude: cmd += ['--exclude=%s' % s for s in ['*.[ao]', '*.pyc', '.*', '*~', '#*', 'TAGS', 'tags']] cmd += ['--exclude-per-directory=.gitignore'] cmd += ['--exclude-from=%s' % fn for fn in exclude_files() if os.path.exists(fn)] lines = GRun(*cmd).raw_output().split('\0') cache_files += [('?', line) for line in lines] # conflicted files conflicts = get_conflicts() if not conflicts: conflicts = [] cache_files += [('C', filename) for filename in conflicts] # the rest for line in GRun('git-diff-index', *(diff_flags + [tree_id, '--'] + files) ).output_lines(): fs = tuple(line.rstrip().split(' ',4)[-1].split('\t',1)) if fs[1] not in conflicts: cache_files.append(fs) if verbose: out.done() return cache_files | 6d0d7ee68bda85bd5b943d6836a5001cd887c939 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12366/6d0d7ee68bda85bd5b943d6836a5001cd887c939/git.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2151,
67,
2327,
12,
2354,
273,
599,
16,
2151,
67,
350,
273,
296,
12458,
2187,
5917,
273,
1083,
16,
1158,
10157,
273,
1053,
16,
3988,
273,
1083,
16,
3122,
67,
7133,
273,
5378,
4672,
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,
2151,
67,
2327,
12,
2354,
273,
599,
16,
2151,
67,
350,
273,
296,
12458,
2187,
5917,
273,
1083,
16,
1158,
10157,
273,
1053,
16,
3988,
273,
1083,
16,
3122,
67,
7133,
273,
5378,
4672,
353... |
_GetLogicalDriveStringsW = windll.kernel32.GetLogicalDriveStringsW | _GetLogicalDriveStringsW = ctypes.windll.kernel32.GetLogicalDriveStringsW | def GetLogicalDriveStringsW(): _GetLogicalDriveStringsW = windll.kernel32.GetLogicalDriveStringsW _GetLogicalDriveStringsW.argtypes = [DWORD, LPWSTR] _GetLogicalDriveStringsW.restype = DWORD _GetLogicalDriveStringsW.errcheck = RaiseIfZero nBufferLength = 0x1000 lpBuffer = ctypes.create_unicode_buffer('', nBufferLength) _GetLogicalDriveStringsW(nBufferLength, lpBuffer) return lpBuffer.value | b0245edfa9e50c7caf2ea7a3da6fbcd88689a78d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7261/b0245edfa9e50c7caf2ea7a3da6fbcd88689a78d/kernel32.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
17955,
24681,
7957,
59,
13332,
389,
967,
17955,
24681,
7957,
59,
273,
6983,
18,
10094,
2906,
18,
8111,
1578,
18,
967,
17955,
24681,
7957,
59,
389,
967,
17955,
24681,
7957,
59,
18,
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,
968,
17955,
24681,
7957,
59,
13332,
389,
967,
17955,
24681,
7957,
59,
273,
6983,
18,
10094,
2906,
18,
8111,
1578,
18,
967,
17955,
24681,
7957,
59,
389,
967,
17955,
24681,
7957,
59,
18,
3... |
def RenderPage(name, test_shell): | def RenderPages(names, test_shell): | def RenderPage(name, test_shell): """ Calls test_shell --layout-tests .../generator.html?<name> and writes the result to .../docs/<name>.html """ if not name: raise Exception("RenderPage called with empty name") generator_url = "file:" + urllib.pathname2url(_generator_html) + "?" + name input_file = _base_dir + "/" + name + ".html" # Copy page_shell to destination output and move aside original, if it exists. original = None if (os.path.isfile(input_file)): original = open(input_file, 'rb').read() os.remove(input_file) shutil.copy(_page_shell_html, input_file) # Run test_shell and capture result p = Popen([test_shell, "--layout-tests", generator_url], stdout=PIPE) # The remaining output will be the content of the generated page. result = p.stdout.read() content_start = result.find(_expected_output_preamble) content_end = result.find(_expected_output_postamble) if (content_start < 0): if (result.startswith("#TEST_TIMED_OUT")): raise Exception("test_shell returned TEST_TIMED_OUT.\n" + "Their was probably a problem with generating the " + "page\n" + "Try copying template/page_shell.html to:\n" + input_file + "\nAnd open it in chrome using the file: scheme.\n" + "Look from javascript errors via the inspector.") raise Exception("test_shell returned unexpected output: " + result) postamble_length = len(_expected_output_postamble) result = result[content_start:content_end + postamble_length] + "\n" # Remove the trailing #EOF that test shell appends to the output. result = result.replace('#EOF', '') # Remove page_shell os.remove(input_file) # Remove CRs that are appearing from captured test_shell output. result = result.replace('\r', '') # Write output open(input_file, 'wb').write(result) if (original and result == original): return None else: return input_file | b40d40f02a627229cc5081b53a2adde3111a181e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b40d40f02a627229cc5081b53a2adde3111a181e/build.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6987,
5716,
12,
1973,
16,
1842,
67,
10304,
4672,
3536,
23665,
1842,
67,
10304,
1493,
6741,
17,
16341,
1372,
19,
8812,
18,
2620,
35,
32,
529,
34,
471,
7262,
326,
563,
358,
1372,
19,
853... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6987,
5716,
12,
1973,
16,
1842,
67,
10304,
4672,
3536,
23665,
1842,
67,
10304,
1493,
6741,
17,
16341,
1372,
19,
8812,
18,
2620,
35,
32,
529,
34,
471,
7262,
326,
563,
358,
1372,
19,
853... |
print e.args print e print dir(e) | def _eval(self, expr): try: res = eval(expr, self.localcontext) if res is False or res is None: res = '' except Exception,e: print e.args print e print dir(e) res = 'Error' return res | 1b12bca7fec8e5ed9d0e75d5fbe2c2711381f28c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12853/1b12bca7fec8e5ed9d0e75d5fbe2c2711381f28c/report_sxw.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8622,
12,
2890,
16,
3065,
4672,
775,
30,
400,
273,
5302,
12,
8638,
16,
365,
18,
3729,
2472,
13,
309,
400,
353,
1083,
578,
400,
353,
599,
30,
400,
273,
875,
1335,
1185,
16,
73,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
389,
8622,
12,
2890,
16,
3065,
4672,
775,
30,
400,
273,
5302,
12,
8638,
16,
365,
18,
3729,
2472,
13,
309,
400,
353,
1083,
578,
400,
353,
599,
30,
400,
273,
875,
1335,
1185,
16,
73,
... | |
'Access Denied!') | 'Access Denied!', self.window) | def sig_win_new(self, widget=None, menu_type='menu_id', quiet=True, except_id=False): try: act_id = rpc.session.rpc_exec_auth('/object', 'execute', 'res.user', 'read', [rpc.session.user], [menu_type,'name'], rpc.session.context) except: return False sb_id = self.sb_username.get_context_id('message') self.sb_username.push(sb_id, act_id[0]['name'] or '') sb_id = self.sb_servername.get_context_id('message') data = urlparse.urlsplit(rpc.session._url) self.sb_servername.push(sb_id, data[0]+':'+(data[1] and '//'+data[1] \ or data[2])+' ['+CONFIG['login.db']+']') if not act_id[0][menu_type]: if quiet: return False common.warning(_('You can not log into the system !\n' \ 'Ask the administrator to verify\n' \ 'you have an action defined for your user.'), 'Access Denied!') rpc.session.logout() return False act_id = act_id[0][menu_type][0] if except_id and act_id == except_id: return act_id Action.execute(act_id, {'window': self.window}) try: user = rpc.session.rpc_exec_auth_wo('/object', 'execute', 'res.user', 'read', [rpc.session.user], [menu_type, 'name'], rpc.session.context) if user[0][menu_type]: act_id = user[0][menu_type][0] except: pass return act_id | febd069989730288ac0203c5c9f3319341391014 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9151/febd069989730288ac0203c5c9f3319341391014/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3553,
67,
8082,
67,
2704,
12,
2890,
16,
3604,
33,
7036,
16,
3824,
67,
723,
2218,
5414,
67,
350,
2187,
10902,
33,
5510,
16,
1335,
67,
350,
33,
8381,
4672,
775,
30,
1328,
67,
350,
273,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3553,
67,
8082,
67,
2704,
12,
2890,
16,
3604,
33,
7036,
16,
3824,
67,
723,
2218,
5414,
67,
350,
2187,
10902,
33,
5510,
16,
1335,
67,
350,
33,
8381,
4672,
775,
30,
1328,
67,
350,
273,... |
def _posHprBroadcast(self, task=DummyTask): | def _posHprBroadcast(self, task=None): | def _posHprBroadcast(self, task=DummyTask): # TODO: we explicitly stagger the initial task timing in # startPosHprBroadcast; we should at least make an effort to keep # this task accurately aligned with its period and starting time. self.d_broadcastPosHpr() task.setDelay(self.__broadcastPeriod) return Task.again | 24b0ce64e2180207540827acf5565e73cb1d7647 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8543/24b0ce64e2180207540827acf5565e73cb1d7647/DistributedSmoothNodeBase.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
917,
44,
683,
15926,
12,
2890,
16,
1562,
33,
7036,
4672,
468,
2660,
30,
732,
8122,
384,
7594,
326,
2172,
1562,
15538,
316,
468,
16013,
44,
683,
15926,
31,
732,
1410,
622,
4520,
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,
389,
917,
44,
683,
15926,
12,
2890,
16,
1562,
33,
7036,
4672,
468,
2660,
30,
732,
8122,
384,
7594,
326,
2172,
1562,
15538,
316,
468,
16013,
44,
683,
15926,
31,
732,
1410,
622,
4520,
12... |
self.log.info( "[COMPACT] Compacting %s records %s seconds size for %s" % ( len( bucketsData ), bucketLength, typeName ) ) | deleteEndTime = time.time() self.log.info( "[COMPACT] Deleted %s out-of-bounds buckets (took %.2f secs)" % ( len( bucketsData ), deleteEndTime - selectEndTime ) ) | def __slowCompactBucketsForType( self, typeName ): """ Compact all buckets for a given type """ tableName = self.__getTableName( "bucket", typeName ) nowEpoch = Time.toEpoch() retVal = self._getConnection() if not retVal[ 'OK' ]: return retVal connObj = retVal[ 'Value' ] for bPos in range( len( self.dbBucketsLength[ typeName ] ) - 1 ): self.log.info( "[COMPACT] Query %d of %d" % ( bPos, len( self.dbBucketsLength[ typeName ] ) - 1 ) ) secondsLimit = self.dbBucketsLength[ typeName ][ bPos ][0] bucketLength = self.dbBucketsLength[ typeName ][ bPos ][1] timeLimit = ( nowEpoch - nowEpoch % bucketLength ) - secondsLimit nextBucketLength = self.dbBucketsLength[ typeName ][ bPos + 1 ][1] self.log.info( "[COMPACT] Compacting data newer that %s with bucket size %s" % ( Time.fromEpoch( timeLimit ), bucketLength ) ) querySize = 1000 previousRecordsSelected = querySize totalCompacted = 0 while previousRecordsSelected == querySize: #Retrieve the data self.log.info( "[COMPACT] Retrieving records to compact" ) result = self.__selectIndividualForCompactBuckets( typeName, timeLimit, bucketLength, nextBucketLength, querySize, connObj ) if not result[ 'OK' ]: #self.__rollbackTransaction( connObj ) return result bucketsData = result[ 'Value' ] previousRecordsSelected = len( bucketsData ) self.log.info( "[COMPACT] Got %d records to compact (%d done)" % ( previousRecordsSelected, totalCompacted ) ) if len( bucketsData ) == 0: break result = self.__deleteIndividualForCompactBuckets( typeName, bucketsData, connObj ) if not result[ 'OK' ]: #self.__rollbackTransaction( connObj ) return result bucketsData = result[ 'Value' ] self.log.info( "[COMPACT] Compacting %s records %s seconds size for %s" % ( len( bucketsData ), bucketLength, typeName ) ) #Add data for record in bucketsData: startTime = record[-2] endTime = record[-2] + record[-1] valuesList = record[:-2] retVal = self.__splitInBuckets( typeName, startTime, endTime, valuesList, connObj ) if not retVal[ 'OK' ]: self.log.error( "[COMPACT] Error while compacting data for record in %s: %s" % ( typeName, retVal[ 'Value' ] ) ) totalCompacted += len( bucketsData ) self.log.info( "[COMPACT] Finised compaction %d of %d" % ( bPos, len( self.dbBucketsLength[ typeName ] ) - 1 ) ) #return self.__commitTransaction( connObj ) connObj.close() return S_OK() | 20794236a2a7be5aef39b9c2feeef4fc7b6fcab0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/20794236a2a7be5aef39b9c2feeef4fc7b6fcab0/AccountingDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
87,
821,
16863,
14517,
22405,
12,
365,
16,
8173,
262,
30,
3536,
23823,
777,
9169,
364,
279,
864,
618,
3536,
4775,
273,
365,
16186,
588,
7147,
12,
315,
7242,
3113,
8173,
262,
2037,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
87,
821,
16863,
14517,
22405,
12,
365,
16,
8173,
262,
30,
3536,
23823,
777,
9169,
364,
279,
864,
618,
3536,
4775,
273,
365,
16186,
588,
7147,
12,
315,
7242,
3113,
8173,
262,
2037,
... |
self.check_sizeof(complex(0,1), h + 2*8) | self.check_sizeof(complex(0,1), size(h + '2d')) | def method(): pass | 5c5f6ea02a90835741c65e40e2b7c4e412c33d55 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/5c5f6ea02a90835741c65e40e2b7c4e412c33d55/test_sys.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
707,
13332,
1342,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
707,
13332,
1342,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.assertEqual(rc, 1) | self.assertEqual(rc, 1, "%r is not in sys.path (sys.exit returned %r)" % (usersite, rc)) | def test_s_option(self): usersite = site.USER_SITE self.assert_(usersite in sys.path) | edb19de1a427071d74f1487f54bc3958a95b8d6a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8125/edb19de1a427071d74f1487f54bc3958a95b8d6a/test_site.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
87,
67,
3482,
12,
2890,
4672,
3677,
1137,
273,
2834,
18,
4714,
67,
20609,
365,
18,
11231,
67,
12,
5577,
1137,
316,
2589,
18,
803,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
87,
67,
3482,
12,
2890,
4672,
3677,
1137,
273,
2834,
18,
4714,
67,
20609,
365,
18,
11231,
67,
12,
5577,
1137,
316,
2589,
18,
803,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
os.remove(self.vcard.filename) new_file = open(filename, "w") | if not self.vcard.filename.startswith(path): filename = self.vcard.filename else: os.remove(self.vcard.filename) new_file = file(filename, "w") | def save(self): new_vcard = vobject.vCard() new_vcard.add("prodid").value = "Arkadas 1.0" if has_child(self.vcard, "uid"): new_vcard.add("uid").value = uuid() | a8a4c6ca09f6afe3062c9a37ce6363c545145985 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2651/a8a4c6ca09f6afe3062c9a37ce6363c545145985/arkadas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
2890,
4672,
394,
67,
90,
3327,
273,
331,
1612,
18,
90,
6415,
1435,
394,
67,
90,
3327,
18,
1289,
2932,
685,
14044,
20387,
1132,
273,
315,
686,
79,
361,
345,
404,
18,
20,
6,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
2890,
4672,
394,
67,
90,
3327,
273,
331,
1612,
18,
90,
6415,
1435,
394,
67,
90,
3327,
18,
1289,
2932,
685,
14044,
20387,
1132,
273,
315,
686,
79,
361,
345,
404,
18,
20,
6,
... |
if sector_map.has_key(deg): result_data['wind']['sectors']['avg'][i]=sector_map[deg][0]; result_data['wind']['sectors']['freq'][i]=sector_map[deg][1]; if sector_gust_map.has_key(deg): result_data['wind']['sectors']['max'][i]=sector_gust_map[deg]; | if sector_map.has_key(deg % 360): result_data['wind']['sectors']['avg'][i % 16] = result_data['wind']['sectors']['avg'][i % 16] + sector_map[deg % 360][0]; result_data['wind']['sectors']['freq'][i % 16] = result_data['wind']['sectors']['freq'][i % 16] + sector_map[deg % 360][1]; if sector_gust_map.has_key(deg % 360): result_data['wind']['sectors']['max'][i % 16] = result_data['wind']['sectors']['max'][i % 16] + sector_gust_map[deg % 360]; | def execute(self,data={}, context={}): | a87ad4bda5b496e70643036559bdf8e8152d1208 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3323/a87ad4bda5b496e70643036559bdf8e8152d1208/database.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
16,
892,
28793,
819,
12938,
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,
... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
16,
892,
28793,
819,
12938,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
mod_start_time_data_val = comp_file_info['Mod_Start_(min.)'] mod_stop_time_data_val = comp_file_info['Mod_End_(min.)'] mod_start_time_comp_val = comp_file_info['Mod_Comp_Start_(min.)'] mod_stop_time_comp_val = comp_file_info['Mod_Comp_End_(min.)'] | mod_start_data_val = comp_file_info['Mod_Start_(min.)'] mod_stop_data_val = comp_file_info['Mod_End_(min.)'] mod_start_comp_val = comp_file_info['Mod_Comp_Start_(min.)'] mod_stop_comp_val = comp_file_info['Mod_Comp_End_(min.)'] | def extract_comp_data(comp_file_info): ## Read in d line dict from config file and Process data from source .csv files. exp_data = [] mod_data = [] exp_data_dict = {} mod_data_dict = {} exp_scatter_data_labels = [] mod_scatter_data_labels = [] #List of variables from configuration file column names. exp_data_filename = comp_file_info['Exp_Filename'] #String of filename exp_column_name_row_index = int(comp_file_info['Exp_Col_Name_Row'])-1 #Experimental Data Column Name Row Number exp_data_row_index = int(comp_file_info['Exp_Data_Row'])-1 #Experimental Data Starting Row Number exp_start_time_data_val = comp_file_info['Exp_Start_(min.)'] #String in minutes to start exp plot data exp_stop_time_data_val = comp_file_info['Exp_End_(min.)'] #String in minutes to stop exp plot data exp_start_time_comp_val = comp_file_info['Exp_Comp_Start_(min.)'] #String in minutes to start exp compare data exp_stop_time_comp_val = comp_file_info['Exp_Comp_End_(min.)'] #String in minutes to start exp compare data exp_initial_value = comp_file_info['Exp_Intitial_Value'] #Initial Value for Quantity exp_column_name_value = comp_file_info['Exp_Col_Name'].strip() #Experimental Data Column Name mod_data_filename = comp_file_info['Mod_Filename'] #String of filename mod_column_name_row_index = int(comp_file_info['Mod_Col_Name_Row'])-1 #Modeling Data Column Name Row Number mod_data_row_index = int(comp_file_info['Mod_Data_Row'])-1 #Modeling Data Starting Row Number mod_start_time_data_val = comp_file_info['Mod_Start_(min.)'] #String in minutes to start mod plot data mod_stop_time_data_val = comp_file_info['Mod_End_(min.)'] #String in minutes to stop mod plot data mod_start_time_comp_val = comp_file_info['Mod_Comp_Start_(min.)'] #String in minutes to start mod compare data mod_stop_time_comp_val = comp_file_info['Mod_Comp_End_(min.)'] #String in minutes to start mod compare data mod_initial_value = comp_file_info['Mod_Intitial_Value'] #Initial Value for Quantity mod_column_name_value = comp_file_info['Mod_Col_Name'].strip() #Modeling Data Column Name # Create Scatter Data Labels for the comparison results. if exp_column_name_value[0] == '[': print "Exp Column Name List Detected" exp_compound_col_names = eval(exp_column_name_value) #print "Exp Compound Column Names:", exp_compound_col_names for name in exp_compound_col_names: print "Exp Sub-Column Name:", name exp_scatter_data_labels.append(comp_file_info['Quantity']+"~"+comp_file_info['Group']+"~"+comp_file_info['Dataname']+"~"+name) else: print "Single Exp. Column Name:", exp_column_name_value exp_scatter_data_labels.append(comp_file_info['Quantity']+"~"+comp_file_info['Group']+"~"+comp_file_info['Dataname']+"~"+exp_column_name_value) if mod_column_name_value[0] == '[': print "Mod Column Name List Detected" mod_compound_col_names = eval(mod_column_name_value) #print "Mod Compound Column Names:", mod_column_name_value for name in mod_compound_col_names: print "Mod Sub-Column Name:", name mod_scatter_data_labels.append(comp_file_info['Quantity']+"~"+comp_file_info['Group']+"~"+comp_file_info['Dataname']+"~"+name) else: print "Single Mod. Column Name:", mod_column_name_value mod_scatter_data_labels.append(comp_file_info['Quantity']+"~"+comp_file_info['Group']+"~"+comp_file_info['Dataname']+"~"+mod_column_name_value) #print "Exp Data Labels:\n", exp_scatter_data_labels #print "Mod Data Labels:\n", mod_scatter_data_labels combined_scatter_data_labels = [exp_scatter_data_labels,mod_scatter_data_labels] #print "Combined Scatter Data:",combined_scatter_data_labels min_max = comp_file_info['max/min'] #String indicating if min or max value is required. group_value = int(comp_file_info['Group']) try: exp_file_object = open(data_directory+exp_data_filename, "U") except: print "!!! Experimental "+exp_data_filename+" Data File will not open. !!!" exit() try: mod_file_object = open(data_directory+mod_data_filename, "U") except: print "!!! Modeling "+mod_data_filename+" Data File will not open. !!!" exit() ## Start File Processing #Read in experimental data and flip lists from rows to columns. print "Reading in:", exp_data_filename exp_data_cols = zip(*csv.reader(exp_file_object)) #Convert tuples to lists. exp_data_list = [list(sublist) for sublist in exp_data_cols] #Pull the Time column name out and strip whitespace. Assumes that Time is in first column. exp_time_col_name = exp_data_list[0][exp_column_name_row_index].strip() #Build Experimental Data Dictionary. #Catch errors if conversion of data from string to float fails. for exp_list in exp_data_list: try: temp_list = [] for x in exp_list[exp_data_row_index:]: if x == 'Null' or x == '' or x == 'NaN' or x == 'inf' or x == '-inf': list_value = 'Null' else: list_value = float(x) temp_list.append(list_value) exp_data_dict[exp_list[exp_column_name_row_index].strip()] = temp_list except: print "!!! Exp Data Conversion in Column Name "+exp_list[exp_column_name_row_index].strip()+". !!!" exit() #Read in model data and flip lists from rows to columns. print "Reading in:", mod_data_filename mod_data_cols = zip(*csv.reader(mod_file_object)) #Convert tuples to lists. mod_data_list = [list(sublist) for sublist in mod_data_cols] #Pull the Time column name out and strip whitespace from ends of string. mod_time_col_name = mod_data_list[0][mod_column_name_row_index].strip() #Build Prediction/Model Data Dictionary #Catch errors if conversion of data from string to float fails. for mod_list in mod_data_list: try: temp_list = [] for x in mod_list[mod_data_row_index:]: if x == 'Null' or x == '' or x == 'NaN' or x == 'inf' or x == '-inf': list_value = 'Null' else: list_value = float(x) temp_list.append(list_value) mod_data_dict[mod_list[mod_column_name_row_index].strip()] = temp_list except: print "!!! Mod Data Conversion in Column Name "+mod_list[mod_column_name_row_index].strip()+". !!!" exit() # Assuming that all column time ranges are the same. Passing in the first Column Name. exp_comp_ranges = find_start_stop_index(exp_data_dict,exp_time_col_name,exp_start_time_data_val,exp_stop_time_data_val,exp_start_time_comp_val,exp_stop_time_comp_val) mod_comp_ranges = find_start_stop_index(mod_data_dict,mod_time_col_name,mod_start_time_data_val,mod_stop_time_data_val,mod_start_time_comp_val,mod_stop_time_comp_val) #print exp_comp_ranges #print mod_comp_ranges #### Begin Column specific operations. scatter_counter = 0 for scatter_label in combined_scatter_data_labels[0]: #print scatter_counter exp_label_temp = [] mod_label_temp = [] exp_label_temp = split("~",combined_scatter_data_labels[0][scatter_counter]) mod_label_temp = split("~",combined_scatter_data_labels[1][scatter_counter]) #print "Exp. Label Split:", exp_label_temp #print "Mod. Label Split:", mod_label_temp ##Find max or min values. exp_data_values_comp = exp_data_dict[exp_label_temp[3]][exp_comp_ranges[2]:exp_comp_ranges[3]] mod_data_values_comp = mod_data_dict[mod_label_temp[3]][mod_comp_ranges[2]:mod_comp_ranges[3]] #print "Exp data values:", exp_data_values_comp #print "Mod data values:", mod_data_values_comp # This allows the d line Quantity value to be set to 0 when either model or experimental data is missing. if comp_file_info['Quantity'] == str(0): print "Quantity set to 0, no comparison made." else: if min_max == 'max': print "*** Rise Computed ***" temp_exp_data_values = [x for x in exp_data_values_comp if x != 'Null'] exp_rise_value = max(temp_exp_data_values) - float(exp_initial_value) temp_mod_data_values = [x for x in mod_data_values_comp if x != 'Null'] mod_rise_value = max(temp_mod_data_values) - float(mod_initial_value) print "Experimental Initial Value is:", exp_initial_value print "Experimental Rise Value is:", exp_rise_value print "Model Initial Value is:", mod_initial_value print "Model Rise Value is:", mod_rise_value print "\n*** Computing Relative Difference ***" try: relative_difference = ((mod_rise_value-exp_rise_value)/exp_rise_value) print "Relative Difference is:", relative_difference #Append Rise Values to Global Scatter Data Dictionary. scatter_data_dict[combined_scatter_data[0][scatter_counter]] = [exp_rise_value,mod_rise_value,relative_difference] except: print "!!! Computation of relative_difference failed. !!!\nCheck source data for columns listed above." exit() elif min_max == 'min': print "*** Drop Computed ***" temp_exp_data_values = [x for x in exp_data_values_comp if x != 'Null'] exp_drop_value = float(exp_initial_value) - min(temp_exp_data_values) temp_mod_data_values = [x for x in mod_data_values_comp if x != 'Null'] mod_drop_value = float(mod_initial_value) - min(temp_mod_data_values) print "Experimental Initial Value is:", exp_initial_value print "Experimental Drop Value is:", exp_drop_value print "Model Initial Value is:", mod_initial_value print "Model Drop Value is:", mod_drop_value print "\n*** Computing Relative Difference ***" try: relative_difference = ((mod_drop_value-exp_drop_value)/exp_drop_value) print "Relative Difference is:", relative_difference #Append Drop Values to Global Scatter Data Dictionary. scatter_data_dict[combined_scatter_data[0][scatter_counter]] = [exp_drop_value,mod_drop_value,relative_difference] except: print "!!! Computation of relative_difference failed. !!!\nCheck source data for columns listed above." exit() else: print "!!! Min or Max is undefined in the input file. !!!" exit() #Create data lists based on specified ranges exp_data_seconds = zip(exp_data_dict[exp_time_col_name][exp_comp_ranges[0]:exp_comp_ranges[1]], exp_data_dict[exp_label_temp[3]][exp_comp_ranges[0]:exp_comp_ranges[1]]) #print exp_data_seconds mod_data_seconds = zip(mod_data_dict[mod_time_col_name][mod_comp_ranges[0]:mod_comp_ranges[1]], mod_data_dict[mod_label_temp[3]][mod_comp_ranges[0]:mod_comp_ranges[1]]) #print mod_data_seconds #Convert time to minutes from seconds. exp_data.append([[x[0] / 60, x[1]] for x in exp_data_seconds]) #print exp_data mod_data.append([[x[0] / 60, x[1]] for x in mod_data_seconds]) #print mod_data #print "\nUpdating the Scatter Counter.\n" scatter_counter = scatter_counter + 1 # Close files exp_file_object.close() mod_file_object.close() return [exp_data,mod_data] | c2bd4f556a2ce61eab4e48660ca05fb2aaf49751 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12/c2bd4f556a2ce61eab4e48660ca05fb2aaf49751/Validation_Data_Processor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
67,
2919,
67,
892,
12,
2919,
67,
768,
67,
1376,
4672,
7541,
2720,
316,
302,
980,
2065,
628,
642,
585,
471,
4389,
501,
628,
1084,
263,
6715,
1390,
18,
225,
1329,
67,
892,
273,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
67,
2919,
67,
892,
12,
2919,
67,
768,
67,
1376,
4672,
7541,
2720,
316,
302,
980,
2065,
628,
642,
585,
471,
4389,
501,
628,
1084,
263,
6715,
1390,
18,
225,
1329,
67,
892,
273,
5... |
def resolve( self, query ): """Returns a variable mapping (or None if it doesn't work)""" map = VarMap() if query.unify(self.consequent, map): | def copy( self ): return self.__class__(self.consequent, self.antecedents) | 4c11f87c46e68caaf61290f0e699940ee52ad8b4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6444/4c11f87c46e68caaf61290f0e699940ee52ad8b4/prolog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
12,
365,
262,
30,
327,
365,
16186,
1106,
972,
12,
2890,
18,
591,
9116,
16,
365,
18,
7974,
3263,
4877,
13,
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,
1610,
12,
365,
262,
30,
327,
365,
16186,
1106,
972,
12,
2890,
18,
591,
9116,
16,
365,
18,
7974,
3263,
4877,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
if os.path.isdir (name): | if os.path.isdir (name) or name == '': | def mkpath (name, mode=0777, verbose=0, dry_run=0): """Create a directory and any missing ancestor directories. If the directory already exists, return silently. Raise DistutilsFileError if unable to create some directory along the way (eg. some sub-path exists, but is a file rather than a directory). If 'verbose' is true, print a one-line summary of each mkdir to stdout.""" global PATH_CREATED # XXX what's the better way to handle verbosity? print as we create # each directory in the path (the current behaviour), or only announce # the creation of the whole path? (quite easy to do the latter since # we're not using a recursive algorithm) name = os.path.normpath (name) if os.path.isdir (name): return if PATH_CREATED.get (name): return (head, tail) = os.path.split (name) tails = [tail] # stack of lone dirs to create while head and tail and not os.path.isdir (head): #print "splitting '%s': " % head, (head, tail) = os.path.split (head) #print "to ('%s','%s')" % (head, tail) tails.insert (0, tail) # push next higher dir onto stack #print "stack of tails:", tails # now 'head' contains the deepest directory that already exists # (that is, the child of 'head' in 'name' is the highest directory # that does *not* exist) for d in tails: #print "head = %s, d = %s: " % (head, d), head = os.path.join (head, d) if PATH_CREATED.get (head): continue if verbose: print "creating", head if not dry_run: try: os.mkdir (head) except os.error, (errno, errstr): raise DistutilsFileError, "%s: %s" % (head, errstr) PATH_CREATED[head] = 1 | 031994d923a677aa78f425f5289409ea94321872 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/031994d923a677aa78f425f5289409ea94321872/util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5028,
803,
261,
529,
16,
1965,
33,
20,
14509,
16,
3988,
33,
20,
16,
10299,
67,
2681,
33,
20,
4672,
3536,
1684,
279,
1867,
471,
1281,
3315,
9731,
6402,
18,
225,
971,
326,
1867,
1818,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5028,
803,
261,
529,
16,
1965,
33,
20,
14509,
16,
3988,
33,
20,
16,
10299,
67,
2681,
33,
20,
4672,
3536,
1684,
279,
1867,
471,
1281,
3315,
9731,
6402,
18,
225,
971,
326,
1867,
1818,
... |
margin, id and usemap * `border` and `margin` can only be a number | margin, margin-(left,right,top,bottom), id and usemap * `border`, `margin`, and `margin-`* can only be a single number | def expand_macro(self, formatter, name, content): min_depth, max_depth = 1, 6 title = None inline = 0 if content: argv = [arg.strip() for arg in content.split(',')] if len(argv) > 0: depth = argv[0] if '-' in depth: min_depth, max_depth = [int(d) for d in depth.split('-', 1)] else: min_depth = max_depth = int(depth) if len(argv) > 1: title = argv[1].strip() if len(argv) > 2: inline = argv[2].strip().lower() == 'inline' | 6f5cdcee987feb7deef27c84b28248442c2a2078 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9317/6f5cdcee987feb7deef27c84b28248442c2a2078/macros.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4542,
67,
26448,
12,
2890,
16,
4453,
16,
508,
16,
913,
4672,
1131,
67,
5979,
16,
943,
67,
5979,
273,
404,
16,
1666,
2077,
273,
599,
6370,
273,
374,
309,
913,
30,
5261,
273,
306,
3175... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4542,
67,
26448,
12,
2890,
16,
4453,
16,
508,
16,
913,
4672,
1131,
67,
5979,
16,
943,
67,
5979,
273,
404,
16,
1666,
2077,
273,
599,
6370,
273,
374,
309,
913,
30,
5261,
273,
306,
3175... |
def correctorStep(siv, pos, epsilon = 1e-8, n0 = 3): result = copy.copy(pos) | def correctorStep(siv, pos, epsilon = 1e-8): """correctorStep(siv, pos, epsilon = 1e-8) -> Vector2 Perform corrector step, i.e. perform 1D iterative Newton method in direction of gradient in order to return to zero level (with accuracy given by epsilon).""" x, y = pos n = Vector2(siv.dx(x, y), siv.dy(x, y)) n /= n.magnitude() | def correctorStep(siv, pos, epsilon = 1e-8, n0 = 3): result = copy.copy(pos) # copy for k in range(100): value = siv(result[0], result[1]) if abs(value) < epsilon: break g = gradient(siv, result) correction = value / g.squaredMagnitude() result -= g * correction if not siv.isInside(result[0], result[1]): return None, None # out of range if (result-pos).squaredMagnitude() > 1.0: # FIXME return None, None # FIXME: find out why this does not always converge to epsilons # around 1e-8, but don't throw away good points (value < 1e-5)! | 06f56e130542a1c91cca5aded8b43db966347318 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10394/06f56e130542a1c91cca5aded8b43db966347318/levelcontours.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3434,
280,
4160,
12,
87,
427,
16,
949,
16,
12263,
273,
404,
73,
17,
28,
4672,
3536,
6746,
280,
4160,
12,
87,
427,
16,
949,
16,
12263,
273,
404,
73,
17,
28,
13,
317,
5589,
22,
225,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3434,
280,
4160,
12,
87,
427,
16,
949,
16,
12263,
273,
404,
73,
17,
28,
4672,
3536,
6746,
280,
4160,
12,
87,
427,
16,
949,
16,
12263,
273,
404,
73,
17,
28,
13,
317,
5589,
22,
225,
... |
self.colind = temp.rowind | self.colind = temp.colind | def __init__(self, arg1, dims=(None,None), nzmax=100, dtype='d', copy=False): spmatrix.__init__(self) if isdense(arg1): # Convert the dense matrix arg1 to CSR format if rank(arg1) == 2: s = asarray(arg1) ocsc = csc_matrix(transpose(s)) self.colind = ocsc.rowind self.indptr = ocsc.indptr self.data = ocsc.data self.shape = (ocsc.shape[1], ocsc.shape[0]) | 0b2d25691f3b5b478761024814ba8dc28534e0fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/0b2d25691f3b5b478761024814ba8dc28534e0fb/sparse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1501,
21,
16,
9914,
28657,
7036,
16,
7036,
3631,
15062,
1896,
33,
6625,
16,
3182,
2218,
72,
2187,
1610,
33,
8381,
4672,
1694,
5667,
16186,
2738,
972,
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,
1001,
2738,
972,
12,
2890,
16,
1501,
21,
16,
9914,
28657,
7036,
16,
7036,
3631,
15062,
1896,
33,
6625,
16,
3182,
2218,
72,
2187,
1610,
33,
8381,
4672,
1694,
5667,
16186,
2738,
972,
12,
... |
__builtins__["__import__"] = _demandimport | __builtin__.__import__ = _demandimport | def enable(): "enable global demand-loading of modules" __builtins__["__import__"] = _demandimport | 448db2bd36b7657f2a94619468f10afee7bff596 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11312/448db2bd36b7657f2a94619468f10afee7bff596/demandimport.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4237,
13332,
315,
7589,
2552,
23653,
17,
15174,
434,
4381,
6,
1001,
24553,
972,
16186,
5666,
972,
273,
389,
323,
889,
5666,
225,
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,
0,
0,
0,
0,
0,
0,
0,
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,
4237,
13332,
315,
7589,
2552,
23653,
17,
15174,
434,
4381,
6,
1001,
24553,
972,
16186,
5666,
972,
273,
389,
323,
889,
5666,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.path = path | def __init__(self, name, metainfo, path=None): """ @param path : directory where to store wralea and module files """ Package.__init__(self, name, metainfo) | a039d3e7e6c901f44613b68316e93b47d85f02e2 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11338/a039d3e7e6c901f44613b68316e93b47d85f02e2/package.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
508,
16,
5100,
28935,
16,
589,
33,
7036,
4672,
3536,
632,
891,
589,
294,
1867,
1625,
358,
1707,
12408,
5349,
69,
471,
1605,
1390,
3536,
225,
7508,
16186,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
2738,
972,
12,
2890,
16,
508,
16,
5100,
28935,
16,
589,
33,
7036,
4672,
3536,
632,
891,
589,
294,
1867,
1625,
358,
1707,
12408,
5349,
69,
471,
1605,
1390,
3536,
225,
7508,
16186,
... | |
def get_flags_debug(self): @@ -216,7 +216,7 @@ - for fc_exe in map(find_executable,['gfortran','f95']): + for fc_exe in map(find_executable,['gfortran-dp-4.0','f95']): if os.path.isfile(fc_exe): break executables = { | if os.path.join(sys.prefix, 'lib') not in default_lib_dirs: | def get_flags_debug(self): | 0604d588f88244e8ef75ac4005b45c6f28b538b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2028/0604d588f88244e8ef75ac4005b45c6f28b538b9/patch-system_info.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
7133,
67,
4148,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
7133,
67,
4148,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
for ms in m: print "inserting milestone ", ms[key] | for value in m: | def setMilestoneList(self, m, key): """Remove all milestones, set them to `m`""" if self.hasTickets(): raise Exception("Will not modify database with existing tickets!") c = self.db().cursor() c.execute("""DELETE FROM milestone""") for ms in m: print "inserting milestone ", ms[key] c.execute("""INSERT INTO milestone (name) VALUES (%s)""", ms[key]) self.db().commit() | bdf7574edc4cb2b55e7db1424e146142fbbbc08d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/bdf7574edc4cb2b55e7db1424e146142fbbbc08d/sourceforge2trac.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15430,
18270,
682,
12,
2890,
16,
312,
16,
498,
4672,
3536,
3288,
777,
312,
14849,
5322,
16,
444,
2182,
358,
1375,
81,
68,
8395,
309,
365,
18,
5332,
6264,
2413,
13332,
1002,
1185,
2932,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15430,
18270,
682,
12,
2890,
16,
312,
16,
498,
4672,
3536,
3288,
777,
312,
14849,
5322,
16,
444,
2182,
358,
1375,
81,
68,
8395,
309,
365,
18,
5332,
6264,
2413,
13332,
1002,
1185,
2932,
... |
raise | return (-1, res, 'Line ' + str(counter) +' : ' + str(e), '' ) | fields_def = self.fields_get(cr, uid, context=context) | 761bc4d0b408276067175e4e40b99529080b9688 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/761bc4d0b408276067175e4e40b99529080b9688/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1466,
67,
536,
273,
365,
18,
2821,
67,
588,
12,
3353,
16,
4555,
16,
819,
33,
2472,
13,
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,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1466,
67,
536,
273,
365,
18,
2821,
67,
588,
12,
3353,
16,
4555,
16,
819,
33,
2472,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
print 'could not find or import %s' % repr(thing) | print 'No Python documentation found for %s.' % repr(thing) | def doc(thing): """Display documentation on an object (for interactive use).""" if type(thing) is type(""): try: path, x = locate(thing) except DocImportError, value: print 'problem in %s - %s' % (value.filename, value.args) return if x: thing = x else: print 'could not find or import %s' % repr(thing) return desc = describe(thing) module = inspect.getmodule(thing) if module and module is not thing: desc = desc + ' in module ' + module.__name__ pager('Help on %s:\n\n' % desc + text.document(thing)) | 66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
12,
4274,
4672,
3536,
4236,
7323,
603,
392,
733,
261,
1884,
12625,
999,
13,
12123,
309,
618,
12,
4274,
13,
353,
618,
2932,
6,
4672,
775,
30,
589,
16,
619,
273,
10627,
12,
4274,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
12,
4274,
4672,
3536,
4236,
7323,
603,
392,
733,
261,
1884,
12625,
999,
13,
12123,
309,
618,
12,
4274,
13,
353,
618,
2932,
6,
4672,
775,
30,
589,
16,
619,
273,
10627,
12,
4274,
... |
skills.animaltaming.removetags( totame ) | removetags( totame ) | def callback( char, args ): if len( args ) < 2: return # animal = args[ 1 ] totame = wolfpack.findchar( args[ 1 ] ) if not totame: return if not char: return # tamer dead : 502796 if char.dead: skills.animaltaming.removetags( totame ) char.socket.clilocmessage( 502796, "", 0x3b2, 3, totame ) return # out of range : 502795 if char.distanceto( totame ) > TAMING_RANGE: skills.animaltaming.removetags( totame ) char.socket.clilocmessage( 502795, "", 0x3b2, 3, totame ) return # no los : 502800 if not char.canreach( totame, TAMING_RANGE ): skills.animaltaming.removetags( totame ) char.socket.clilocmessage( 502800, "", 0x3b2, 3, totame ) return # angry : 502794 -> let it attack the char ? if totame.hastag( 'angry' ) and totame.gettag( 'angry' ) > 1: skills.animaltaming.removetags( totame ) char.socket.clilocmessage( 502794, "", 0x3b2, 3, totame ) return havetamed = args[ 0 ] # no. trying = args[ 2 ] num_try = args[ 2 ] if num_try > 3: # if have-tamed, do not advance the skill - will be added success = char.checkskill( TAMING, totame.totame, 1200 ) if success: skills.animaltaming.removetags( totame ) # set owner totame.tamed = true totame.owner = char # increase follower control slot - will be added # set tamed number num_tamed = 1 if totame.hastag( 'num_tamed' ): num_tamed = totame.gettag( 'num_tamed' ) + 1 totame.settag( 'num_tamed', num_tamed ) # increase required taming skill totame.totame += TAME_UPS[ num_tamed ] # success msg : 502799 char.socket.clilocmessage( 502799, "", 0x3b2, 3, totame ) else: skills.animaltaming.removetags( totame ) # fail msg : 502798 char.socket.clilocmessage( 502798, "", 0x3b2, 3, totame ) return num_try += 1 # taming msg : 502790 - 502793 # become angry : 502805 msgID = whrandom.choice( TAMING_MSGS ) if msgID == 502805: if totame.hastag( 'angry' ): m = totame.gettag( 'angry' ) totame.settag( 'angry', m + 1 ) else: totame.settag( 'angry', 1 ) char.socket.clilocmessage( msgID, "", 0x3b2, 3, totame ) char.addtimer( TAMING_DURATION, "skills.animaltaming.callback", [ havetamed, totame.serial, num_try ] ) | 592cd6f0b1b67bd3de2ce51301b995a7dd5ea1a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/592cd6f0b1b67bd3de2ce51301b995a7dd5ea1a5/animaltaming.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1348,
12,
1149,
16,
833,
262,
30,
309,
562,
12,
833,
262,
411,
576,
30,
327,
225,
468,
392,
2840,
273,
833,
63,
404,
308,
9997,
339,
273,
341,
355,
74,
2920,
18,
4720,
3001,
12,
83... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1348,
12,
1149,
16,
833,
262,
30,
309,
562,
12,
833,
262,
411,
576,
30,
327,
225,
468,
392,
2840,
273,
833,
63,
404,
308,
9997,
339,
273,
341,
355,
74,
2920,
18,
4720,
3001,
12,
83... |
err = 1 | err = 2 | def _apply(self, repo, series, list=False, update_status=True, strict=False, patchdir=None, merge=None, all_files={}): # TODO unify with commands.py if not patchdir: patchdir = self.path err = 0 n = None for patchname in series: pushable, reason = self.pushable(patchname) if not pushable: self.explain_pushable(patchname, all_patches=True) continue self.ui.warn(_("applying %s\n") % patchname) pf = os.path.join(patchdir, patchname) | f52535e6b7d0506591219441d8e9f8a07f59c438 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11312/f52535e6b7d0506591219441d8e9f8a07f59c438/mq.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9010,
12,
2890,
16,
3538,
16,
4166,
16,
666,
33,
8381,
16,
1089,
67,
2327,
33,
5510,
16,
5490,
33,
8381,
16,
4729,
1214,
33,
7036,
16,
2691,
33,
7036,
16,
777,
67,
2354,
12938,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9010,
12,
2890,
16,
3538,
16,
4166,
16,
666,
33,
8381,
16,
1089,
67,
2327,
33,
5510,
16,
5490,
33,
8381,
16,
4729,
1214,
33,
7036,
16,
2691,
33,
7036,
16,
777,
67,
2354,
12938,
... |
if dt is None or isinstance(dt, time) or dt.tzinfo is None: | if dt is None or dt.tzinfo is None: | def dst(self, dt): if dt is None or isinstance(dt, time) or dt.tzinfo is None: # An exception instead may be sensible here, in one or more of # the cases. return ZERO | 63c6dcfeaa4c05747abf69297a2100784adf596b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/63c6dcfeaa4c05747abf69297a2100784adf596b/test_datetime.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3046,
12,
2890,
16,
3681,
4672,
309,
3681,
353,
599,
578,
3681,
18,
12994,
1376,
353,
599,
30,
468,
1922,
1520,
3560,
2026,
506,
15390,
1523,
2674,
16,
316,
1245,
578,
1898,
434,
468,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3046,
12,
2890,
16,
3681,
4672,
309,
3681,
353,
599,
578,
3681,
18,
12994,
1376,
353,
599,
30,
468,
1922,
1520,
3560,
2026,
506,
15390,
1523,
2674,
16,
316,
1245,
578,
1898,
434,
468,
... |
return True | return False | def check_condition(condition) : | 03b8111887de3101a5bfa1262ea70ca5f5fa4fb1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13069/03b8111887de3101a5bfa1262ea70ca5f5fa4fb1/PyDT.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
4175,
12,
4175,
13,
294,
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,
866,
67,
4175,
12,
4175,
13,
294,
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,
... |
return self.getconf('remotehost') | host = None localeval = self.localeval if self.config.has_option(self.getsection(), 'remotehosteval'): host = self.getconf('remotehosteval') if host != None: return localeval.eval(host) host = self.getconf('remotehost') if host != None: return host | def gethost(self): return self.getconf('remotehost') | a6db99a21ee5e9452ed47fb4d1c6237b239eef6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5335/a6db99a21ee5e9452ed47fb4d1c6237b239eef6e/IMAP.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
2564,
12,
2890,
4672,
327,
365,
18,
588,
3923,
2668,
7222,
2564,
6134,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
336,
2564,
12,
2890,
4672,
327,
365,
18,
588,
3923,
2668,
7222,
2564,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
name = current_thread().get_name() | name = current_thread().name | def _writerThread(self, d, howMany, writerNum): name = current_thread().get_name() start = howMany * writerNum stop = howMany * (writerNum + 1) - 1 if verbose: print("%s: creating records %d - %d" % (name, start, stop)) | 71b0bbd9b9e9096b7ab19895c1fc6634f5d6cb14 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/71b0bbd9b9e9096b7ab19895c1fc6634f5d6cb14/test_thread.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6299,
3830,
12,
2890,
16,
302,
16,
3661,
5594,
16,
2633,
2578,
4672,
508,
273,
783,
67,
5930,
7675,
529,
787,
273,
3661,
5594,
380,
2633,
2578,
2132,
273,
3661,
5594,
380,
261,
62... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6299,
3830,
12,
2890,
16,
302,
16,
3661,
5594,
16,
2633,
2578,
4672,
508,
273,
783,
67,
5930,
7675,
529,
787,
273,
3661,
5594,
380,
2633,
2578,
2132,
273,
3661,
5594,
380,
261,
62... |
self.add_link('last', self.env.href.changeset(youngest_rev), | self.add_link(req, 'last', self.env.href.changeset(youngest_rev), | def render(self, req): self.perm.assert_permission (perm.CHANGESET_VIEW) | a58bf75f08d28944f258f5229101a5bf8f73f15a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/a58bf75f08d28944f258f5229101a5bf8f73f15a/Changeset.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
1111,
4672,
365,
18,
12160,
18,
11231,
67,
9827,
261,
12160,
18,
14473,
4043,
67,
12145,
13,
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,
1743,
12,
2890,
16,
1111,
4672,
365,
18,
12160,
18,
11231,
67,
9827,
261,
12160,
18,
14473,
4043,
67,
12145,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
if not self.plugin.workerThread: self.plugin.workerThread = MediaMonkeyWorkerThread(self.plugin) self.plugin.workerThread.Start(100.0) if sep == '': sep = '\n' tracks, albums = self.plugin.workerThread.CallWait(partial(self.plugin.workerThread.GetStatistics),60) return self.text.tracks % tracks+sep+self.text.albums % albums | if self.plugin.checkWorkerThread(): if sep == '': sep = '\n' tracks, albums = self.plugin.workerThread.CallWait(partial(self.plugin.workerThread.GetStatistics),60) return self.text.tracks % tracks+sep+self.text.albums % albums | def __call__(self,sep=''): if not self.plugin.workerThread: self.plugin.workerThread = MediaMonkeyWorkerThread(self.plugin) self.plugin.workerThread.Start(100.0) if sep == '': sep = '\n' tracks, albums = self.plugin.workerThread.CallWait(partial(self.plugin.workerThread.GetStatistics),60) return self.text.tracks % tracks+sep+self.text.albums % albums | d5260163cbd4fbc67849ace2ade2149e354e4a3f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8076/d5260163cbd4fbc67849ace2ade2149e354e4a3f/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
10814,
2218,
11,
4672,
309,
365,
18,
4094,
18,
1893,
6671,
3830,
13332,
309,
5478,
422,
875,
30,
5478,
273,
2337,
82,
11,
13933,
16,
14844,
87,
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,
1001,
1991,
972,
12,
2890,
16,
10814,
2218,
11,
4672,
309,
365,
18,
4094,
18,
1893,
6671,
3830,
13332,
309,
5478,
422,
875,
30,
5478,
273,
2337,
82,
11,
13933,
16,
14844,
87,
273,
365,... |
print self.employment_history | def saveProperties(self, REQUEST=None, **kwargs): """ """ if not self.checkPermissionEditObject(): raise EXCEPTION_NOTAUTHORIZED, EXCEPTION_NOTAUTHORIZED_MSG | 7cc94b510480ba23e2c15ff7466d3c0e65bc7cee /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3287/7cc94b510480ba23e2c15ff7466d3c0e65bc7cee/expert_item.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... | |
self.debug_excs = [] | if not we_are_translated(): self.debug_excs = [] | def __init__(self, w_type, w_value, tb=None): if w_type is None: from pypy.tool.error import FlowingError raise FlowingError(w_value) self.w_type = w_type self.w_value = w_value self.application_traceback = tb self.debug_excs = [] | 22796224f788380ea3ea96ee4c2b3541b1753efc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/22796224f788380ea3ea96ee4c2b3541b1753efc/error.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
341,
67,
723,
16,
341,
67,
1132,
16,
8739,
33,
7036,
4672,
309,
341,
67,
723,
353,
599,
30,
628,
18951,
93,
18,
6738,
18,
1636,
1930,
9473,
310,
668,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
341,
67,
723,
16,
341,
67,
1132,
16,
8739,
33,
7036,
4672,
309,
341,
67,
723,
353,
599,
30,
628,
18951,
93,
18,
6738,
18,
1636,
1930,
9473,
310,
668,
... |
import wx,sys; app = wx.PySimpleApp(); plot(sys.argv[1]) | plot_demo() | def plot(filename): """ Read and print all command line arguments """ import sys, pylab, wx canvas = pylab.gcf().canvas d = data(filename) if len(d.v.shape) > 1: pylab.gca().pcolorfast(d.xedges,d.yedges,d.v) pylab.xlabel(d.xlabel) pylab.ylabel(d.ylabel) else: pylab.plot(d.x,d.v) pylab.xlabel(d.xlabel) pylab.ylabel(d.vlabel) pylab.show() | 54a865670739ce2fbfd3dda17c8895b3d414fa27 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13135/54a865670739ce2fbfd3dda17c8895b3d414fa27/icpformat.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
12,
3459,
4672,
3536,
2720,
471,
1172,
777,
1296,
980,
1775,
3536,
1930,
2589,
16,
2395,
7411,
16,
7075,
5953,
273,
2395,
7411,
18,
75,
8522,
7675,
15424,
302,
273,
501,
12,
3459,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
12,
3459,
4672,
3536,
2720,
471,
1172,
777,
1296,
980,
1775,
3536,
1930,
2589,
16,
2395,
7411,
16,
7075,
5953,
273,
2395,
7411,
18,
75,
8522,
7675,
15424,
302,
273,
501,
12,
3459,
... |
import string, re | def letters_only(s): import string, re _match = re.compile(r"\D+") try: s = reduce( unicode.join, _match.findall(s) ) except: s = unicode(s) return s | 8dd23db0ad40a315c4c2431088bf2a98189408a8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2687/8dd23db0ad40a315c4c2431088bf2a98189408a8/CSV.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13768,
67,
3700,
12,
87,
4672,
389,
1916,
273,
283,
18,
11100,
12,
86,
12691,
40,
15,
7923,
775,
30,
272,
273,
5459,
12,
5252,
18,
5701,
16,
389,
1916,
18,
4720,
454,
12,
87,
13,
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,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13768,
67,
3700,
12,
87,
4672,
389,
1916,
273,
283,
18,
11100,
12,
86,
12691,
40,
15,
7923,
775,
30,
272,
273,
5459,
12,
5252,
18,
5701,
16,
389,
1916,
18,
4720,
454,
12,
87,
13,
2... | |
else: self.frameMode = mode | self.frameMode = mode | def setFrameMode(self, mode): """Set the mode of the output frame for (Qx, Qy, Qz) | 8862dcf26a4225de67d49c677cfa7010b7a8e0ce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8436/8862dcf26a4225de67d49c677cfa7010b7a8e0ce/transformations.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
3219,
2309,
12,
2890,
16,
1965,
4672,
3536,
694,
326,
1965,
434,
326,
876,
2623,
364,
261,
53,
92,
16,
2238,
93,
16,
2238,
94,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
3219,
2309,
12,
2890,
16,
1965,
4672,
3536,
694,
326,
1965,
434,
326,
876,
2623,
364,
261,
53,
92,
16,
2238,
93,
16,
2238,
94,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
path = path to log file | path = path to log file. | def set_log_file(self, path): """ Set the Condor log file. path = path to log file """ self.__log_file = path | 43adc4d722e280c921ddb7c38f99393e57936591 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3589/43adc4d722e280c921ddb7c38f99393e57936591/pipeline.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
1330,
67,
768,
12,
2890,
16,
589,
4672,
3536,
1000,
326,
735,
72,
280,
613,
585,
18,
589,
273,
589,
358,
613,
585,
18,
3536,
365,
16186,
1330,
67,
768,
273,
589,
225,
2,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
444,
67,
1330,
67,
768,
12,
2890,
16,
589,
4672,
3536,
1000,
326,
735,
72,
280,
613,
585,
18,
589,
273,
589,
358,
613,
585,
18,
3536,
365,
16186,
1330,
67,
768,
273,
589,
225,
2,
-... |
self.gthread = spawn(self._run) | if self.gthread is None: self.gthread = spawn(self._run) | def start(self): self.gthread = spawn(self._run) | 4a801c4cd02ecbca54583207d75b0a788da49af4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5703/4a801c4cd02ecbca54583207d75b0a788da49af4/enginebuffer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
4672,
365,
18,
658,
896,
273,
12560,
12,
2890,
6315,
2681,
13,
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,
... | [
1,
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,
787,
12,
2890,
4672,
365,
18,
658,
896,
273,
12560,
12,
2890,
6315,
2681,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
lib_dir_release = buildenv['root'] + os.sep + 'chandler' + os.sep + 'release' + os.sep + \ 'lib' + os.sep + 'python2.3' lib_dir_debug = buildenv['root'] + os.sep + 'chandler' + os.sep + 'debug' + os.sep + \ 'lib' + os.sep + 'python2.3' | lib_dir_release = os.path.join(CHANDLERBIN, 'release', 'lib', 'python2.3') lib_dir_debug = os.path.join(CHANDLERBIN, 'debug', 'lib', 'python2.3') | def init(buildenv): """ Initialize the build environment, which is a dictionary containing various values for OS type, PATH, compiler, debug/release setting, etc. Parameters: root: fully qualified path to the top of the build hierarchy Returns: buildenv: a dictionary containing the following environment settings: - root: the root path passed in (which should be the parent of chandler) - os: win, posix, unknown - path: system executable search path - compiler: full path to C compiler (currently windows only) - python: full path to release version of python we are building - python_d: full path to debug version of python we are building - verbosity: 0 for quiet, > 0 for messages displayed to stdout - log: a time-ordered list of log entries - version: 'debug' or 'release' """ if not buildenv.has_key('root'): raise HardHatBuildEnvError, "Missing 'root'" if not buildenv.has_key('hardhatroot'): raise HardHatBuildEnvError, "Missing 'hardhatroot'" for key in defaults.keys(): if not buildenv.has_key(key): buildenv[key] = defaults[key] if not buildenv.has_key('logfile'): buildenv['logfile'] = os.path.join(buildenv['root'], "hardhat.log") # normalize what python thinks the OS is to a string that we like: buildenv['os'] = 'unknown' if os.name == 'nt': buildenv['os'] = 'win' buildenv['oslabel'] = 'win' buildenv['root_dos'] = buildenv['root'] buildenv['path'] = os.environ['path'] elif os.name == 'posix': buildenv['os'] = 'posix' buildenv['oslabel'] = 'linux' buildenv['path'] = os.environ['PATH'] if sys.platform == 'darwin': # It turns out that Mac OS X happens to have os.name of 'posix' # but the steps to build things under OS X is different enough # to warrant its own 'os' value: buildenv['os'] = 'osx' buildenv['oslabel'] = 'osx' if sys.platform == 'cygwin': buildenv['os'] = 'win' buildenv['oslabel'] = 'win' buildenv['path'] = os.environ['PATH'] try: cygpath = os.popen("/bin/cygpath -w " + buildenv['root'], "r") buildenv['root_dos'] = cygpath.readline() buildenv['root_dos'] = buildenv['root_dos'][:-1] cygpath.close() except Exception, e: print e print "Unable to call 'cygpath' to determine DOS-equivalent for project path." print "Either make sure that 'cygpath' is in your PATH or run the Windows version" print "of Python from http://python.org/, rather than the Cygwin Python" raise HardHatError else: raise HardHatUnknownPlatformError # set up paths to the pythons we are building (release and debug) buildenv['python'] = buildenv['root'] + os.sep + 'chandler' + os.sep + 'release' + os.sep + \ 'bin' + os.sep + 'python' buildenv['python_d'] = buildenv['root'] + os.sep + 'chandler' + os.sep + 'debug' + os.sep + \ 'bin' + os.sep + 'python_d' buildenv['sh'] = findInPath(buildenv['path'], "sh") buildenv['make'] = findInPath(buildenv['path'], "make") buildenv['cvs'] = findInPath(buildenv['path'], "cvs") buildenv['scp'] = findInPath(buildenv['path'], "scp") buildenv['tar'] = findInPath(buildenv['path'], "tar") buildenv['gzip'] = findInPath(buildenv['path'], "gzip") buildenv['zip'] = findInPath(buildenv['path'], "zip") buildenv['cvs'] = findInPath(buildenv['path'], "cvs") #buildenv['perl'] = findInPath(buildenv['path'], "perl") # set OS-specific variables if buildenv['os'] == 'win': buildenv['python'] = buildenv['root'] + os.sep + 'chandler' + os.sep + 'release' + os.sep + \ 'bin' + os.sep + 'python.exe' buildenv['python_d'] = buildenv['root'] + os.sep + 'chandler' + os.sep + 'debug' + os.sep + \ 'bin' + os.sep + 'python_d.exe' import os_win vs = os_win.VisualStudio(); buildenv['compilerVersion'] = vs.version # log(buildenv, HARDHAT_MESSAGE, "HardHat", "Looking for devenv.exe...") devenv_file = vs.find_exe( "devenv.exe") if( devenv_file ): # log(buildenv, HARDHAT_MESSAGE, "HardHat", "Found " + devenv_file) buildenv['compiler'] = devenv_file else: log(buildenv, HARDHAT_ERROR, "HardHat", "Can't find devenv.exe") log_dump(buildenv) raise HardHatMissingCompilerError # log(buildenv, HARDHAT_MESSAGE, "HardHat", "Looking for nmake.exe...") nmake_file = vs.find_exe( "nmake.exe") if( nmake_file ): # log(buildenv, HARDHAT_MESSAGE, "HardHat", "Found " + nmake_file) buildenv['nmake'] = nmake_file else: log(buildenv, HARDHAT_ERROR, "HardHat", "Can't find nmake.exe") log_dump(buildenv) raise HardHatMissingCompilerError include_path = vs.get_msvc_paths('include') include_path = string.join( include_path, ";") # log(buildenv, HARDHAT_MESSAGE, "HardHat", "Include: " + include_path) os.putenv('INCLUDE', include_path) lib_path = vs.get_msvc_paths('library') lib_path = string.join( lib_path, ";") # log(buildenv, HARDHAT_MESSAGE, "HardHat", "lib: " + lib_path) os.putenv('LIB', lib_path) cl_dir = os.path.dirname(nmake_file) buildenv['path'] = cl_dir + os.pathsep + buildenv['path'] devenv_dir = os.path.dirname(devenv_file) buildenv['path'] = devenv_dir + os.pathsep + buildenv['path'] buildenv['swig'] = buildenv['root'] + os.sep + 'chandler' + os.sep + 'release' + os.sep + \ 'bin' + os.sep + 'swig.exe' buildenv['swig_d'] = buildenv['root'] + os.sep + 'chandler' + os.sep + 'debug' + os.sep + \ 'bin' + os.sep + 'swig.exe' if buildenv['os'] == 'posix': buildenv['swig'] = buildenv['root'] + os.sep + 'chandler' + os.sep + 'release' + os.sep + \ 'bin' + os.sep + 'swig' buildenv['swig_d'] = buildenv['root'] + os.sep + 'chandler' + os.sep + 'debug' + os.sep + \ 'bin' + os.sep + 'swig' if buildenv['os'] == 'osx': buildenv['swig'] = buildenv['root'] + os.sep + 'chandler' + os.sep + 'release' + os.sep + \ 'bin' + os.sep + 'swig' buildenv['swig_d'] = buildenv['root'] + os.sep + 'chandler' + os.sep + 'debug' + os.sep + \ 'bin' + os.sep + 'swig' buildenv['python'] = os.path.join(buildenv['root'], 'chandler', 'release', 'Library', 'Frameworks', 'Python.framework', 'Versions', 'Current', 'Resources', 'Python.app', 'Contents', 'MacOS', 'Python') buildenv['python_d'] = os.path.join(buildenv['root'], 'chandler', 'debug', 'Library', 'Frameworks', 'Python.framework', 'Versions', 'Current', 'Resources', 'Python.app', 'Contents', 'MacOS', 'Python') # Determine the Python lib directory (the parent of site-packages) if buildenv['os'] == 'posix': lib_dir_release = buildenv['root'] + os.sep + 'chandler' + os.sep + 'release' + os.sep + \ 'lib' + os.sep + 'python2.3' lib_dir_debug = buildenv['root'] + os.sep + 'chandler' + os.sep + 'debug' + os.sep + \ 'lib' + os.sep + 'python2.3' if buildenv['os'] == 'win': lib_dir_release = buildenv['root'] + os.sep + 'chandler' + os.sep + 'release' + os.sep + \ 'bin' + os.sep + 'Lib' lib_dir_debug = buildenv['root'] + os.sep + 'chandler' + os.sep + 'debug' + os.sep + \ 'bin' + os.sep + 'Lib' if buildenv['os'] == 'osx': lib_dir_release = buildenv['root'] + os.sep + 'chandler' + os.sep + 'release' + os.sep + \ 'Library/Frameworks/Python.framework/Versions/Current/lib/python2.3' lib_dir_debug = buildenv['root'] + os.sep + 'chandler' + os.sep + 'debug' + os.sep + \ 'Library/Frameworks/Python.framework/Versions/Current/lib/python2.3' buildenv['pythonlibdir'] = lib_dir_release buildenv['pythonlibdir_d'] = lib_dir_debug return buildenv | a17acba4eaef7c37e9e8fb617272ca059931311b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/a17acba4eaef7c37e9e8fb617272ca059931311b/hardhatlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
12,
3510,
3074,
4672,
3536,
9190,
326,
1361,
3330,
16,
1492,
353,
279,
3880,
4191,
11191,
924,
364,
5932,
618,
16,
7767,
16,
5274,
16,
1198,
19,
9340,
3637,
16,
5527,
18,
7012,
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,
1208,
12,
3510,
3074,
4672,
3536,
9190,
326,
1361,
3330,
16,
1492,
353,
279,
3880,
4191,
11191,
924,
364,
5932,
618,
16,
7767,
16,
5274,
16,
1198,
19,
9340,
3637,
16,
5527,
18,
7012,
3... |
s = s.translate(self.text_map) | s = s.translate(self.text_map) | def add_text(self, text): s = unicode(text, "utf-16-le") if s: s = s.translate(self.text_map) self.content.append(self.entity_pattern.sub(entity_to_unicode, s)) | 87657c6fd43af1f78a50d6c6a61d57c990e902c3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9125/87657c6fd43af1f78a50d6c6a61d57c990e902c3/objects.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
955,
12,
2890,
16,
977,
4672,
272,
273,
5252,
12,
955,
16,
315,
3158,
17,
2313,
17,
298,
7923,
309,
272,
30,
272,
273,
272,
18,
13929,
12,
2890,
18,
955,
67,
1458,
13,
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,
527,
67,
955,
12,
2890,
16,
977,
4672,
272,
273,
5252,
12,
955,
16,
315,
3158,
17,
2313,
17,
298,
7923,
309,
272,
30,
272,
273,
272,
18,
13929,
12,
2890,
18,
955,
67,
1458,
13,
365... |
trafo = trafo(Trafo(1, tan(args[0] * degrees), 0, 1, 0, 0)) | trafo = trafo(Trafo(1, tan(float(args[0]) * degrees), 0, 1, 0, 0)) | def parse_transform(self, trafo_string): trafo = self.trafo #print trafo trafo_string = as_latin1(trafo_string) while trafo_string: #print trafo_string match = rx_trafo.match(trafo_string) if match: function = match.group(1) args = string.translate(match.group(2), commatospace) args = map(float, split(args)) trafo_string = trafo_string[match.end(0):] if function == 'matrix': trafo = trafo(apply(Trafo, tuple(args))) elif function == 'scale': if len(args) == 1: sx = sy = args[0] else: sx, sy = args trafo = trafo(Scale(sx, sy)) elif function == 'translate': if len(args) == 1: dx, dy = args[0], 0 else: dx, dy = args trafo = trafo(Translation(dx, dy)) elif function == 'rotate': if len(args) == 1: trafo = trafo(Rotation(args[0] * degrees)) else: angle, cx, cy = args trafo = trafo(Rotation(angle * degrees, Point(cx * .8, cy * .8))) elif function == 'skewX': trafo = trafo(Trafo(1, 0, tan(args[0] * degrees), 1, 0, 0)) elif function == 'skewY': trafo = trafo(Trafo(1, tan(args[0] * degrees), 0, 1, 0, 0)) else: trafo_string = '' #print trafo self.trafo = trafo | 20f97a1a1862b824365b83f00419d19bd29be2c5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3123/20f97a1a1862b824365b83f00419d19bd29be2c5/svgloader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
6547,
12,
2890,
16,
1284,
617,
67,
1080,
4672,
1284,
617,
273,
365,
18,
2033,
617,
468,
1188,
1284,
617,
1284,
617,
67,
1080,
273,
487,
67,
26578,
21,
12,
2033,
617,
67,
10... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
6547,
12,
2890,
16,
1284,
617,
67,
1080,
4672,
1284,
617,
273,
365,
18,
2033,
617,
468,
1188,
1284,
617,
1284,
617,
67,
1080,
273,
487,
67,
26578,
21,
12,
2033,
617,
67,
10... |
return str(self.restrictions) | return self.__class__.__name__+"("+str(map(str, self.restrictions))+")" | def __str__(self): return str(self.restrictions) | 4c6d9ed8551782a72e5e7ba21768fdca69c482a8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3224/4c6d9ed8551782a72e5e7ba21768fdca69c482a8/PathSupport.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
327,
609,
12,
2890,
18,
23954,
87,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
327,
609,
12,
2890,
18,
23954,
87,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
assert str(e) == "slatec: d9lgmc: x must be ge 10 (nerr=1, level=2)" | assert str(e) == \ "slatec: dbinom: result overflows" \ " because n and/or m too big (nerr=3, level=2)" | def exercise_slatec_dbinom(): f = scitbx.math.slatec_dlnrel try: f(-1) except RuntimeError, e: assert str(e) == \ "slatec: dlnrel: x is le -1 (nerr=2, level=2)" else: raise RuntimeError("Exception expected.") assert approx_equal(f(-1+1.e-10), -23.0258508472) assert approx_equal(f(0.374), 0.3177261938) assert approx_equal(f(0.376), 0.319180739511) assert eps_eq(f(-0.4), -0.510825623766) assert eps_eq(f(0), 0.0) assert eps_eq(f(0.3), 0.262364264467) assert eps_eq(f(0.4), 0.336472236621) f = scitbx.math.slatec_dbinom try: f(n=0, m=1) except RuntimeError, e: assert str(e) == "slatec: dbinom: n lt m (nerr=2, level=2)" else: raise RuntimeError("Exception expected.") expected = [ 1, 2, 1, 3, 3, 1, 4, 6, 4, 1, 5, 10, 10, 5, 1, 6, 15, 20, 15, 6, 1, 7, 21, 35, 35, 21, 7, 1, 8, 28, 56, 70, 56, 28, 8, 1, 9, 36, 84, 126, 126, 84, 36, 9, 1, 10, 45, 120, 210, 252, 210, 120, 45, 10, 1] i = 0 for n in xrange(1,11): for m in xrange(1,n+1): assert approx_equal(f(n=n, m=m), expected[i]) i += 1 assert eps_eq(f(100, 10), 1.73103095E+13) assert eps_eq(f(100, 33), 2.94692427E+26) assert eps_eq(f(1000, 100), 6.38505119E+139) assert eps_eq(f(1000, 333), 5.77613455E+274) nms = [ (5, 2), (9, 6), (8, 3), (9, 1), (8, 2), (6, 1), (8, 4), (7, 5), (7, 3), (8, 7), (93, 70), (64, 57), (76, 66), (55, 22), (70, 2), (90, 85), (78, 4), (82, 19), (99, 6), (71, 5), (957, 516), (896, 665), (909, 253), (579, 74), (653, 651), (820, 581), (638, 290), (697, 533), (937, 695), (725, 78)] expected = [ 10, 84, 56, 9, 28, 6, 70, 21, 35, 8, 3.73549788E+21, 621216192., 9.54526729E+11, 1.30085363E+15, 2415., 43949268., 1426425., 1.97103824E+18, 1.12052926E+09, 13019909., 1.66252414E+285, 3.80970836E+220, 8.43685887E+231, 6.3253529E+94, 212878., 2.45633786E+213, 2.58081251E+189, 5.06707246E+163, 8.53013061E+230, 1.53361301E+106] for nm,e in zip(nms,expected): assert eps_eq(f(*nm), e) try: f(n=2**32-1,m=2**5) except RuntimeError, e: assert str(e) == "slatec: d9lgmc: x must be ge 10 (nerr=1, level=2)" else: raise RuntimeError("Exception expected.") | f45726c66371c9ae0bdbca0069e2d9ed47af0cd2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/696/f45726c66371c9ae0bdbca0069e2d9ed47af0cd2/tst_math.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24165,
67,
2069,
340,
71,
67,
1966,
267,
362,
13332,
284,
273,
888,
305,
70,
92,
18,
15949,
18,
2069,
340,
71,
67,
72,
2370,
2878,
775,
30,
284,
19236,
21,
13,
1335,
7265,
16,
425,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24165,
67,
2069,
340,
71,
67,
1966,
267,
362,
13332,
284,
273,
888,
305,
70,
92,
18,
15949,
18,
2069,
340,
71,
67,
72,
2370,
2878,
775,
30,
284,
19236,
21,
13,
1335,
7265,
16,
425,
... |
"""Test signal handling semantics of threads. We spawn a thread, have the thread send two signals, and wait for it to finish. Check that we got both signals and that they were run by the main thread. """ | def send_signals(): os.kill(process_pid, signal.SIGUSR1) os.kill(process_pid, signal.SIGUSR2) signalled_all.release() | 3c111512cd61c7edf959da4afe997b433f7b3bad /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/3c111512cd61c7edf959da4afe997b433f7b3bad/test_threadsignals.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
29659,
13332,
1140,
18,
16418,
12,
2567,
67,
6610,
16,
4277,
18,
18513,
27984,
21,
13,
1140,
18,
16418,
12,
2567,
67,
6610,
16,
4277,
18,
18513,
27984,
22,
13,
4277,
1259,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
29659,
13332,
1140,
18,
16418,
12,
2567,
67,
6610,
16,
4277,
18,
18513,
27984,
21,
13,
1140,
18,
16418,
12,
2567,
67,
6610,
16,
4277,
18,
18513,
27984,
22,
13,
4277,
1259,
67... | |
save_warnings_filters = warnings.filters[:] globals = func.func_globals if '__warningregistry__' in globals: del globals['__warningregistry__'] warnings.filterwarnings("error", r"""^struct.*""", DeprecationWarning) warnings.filterwarnings("error", r""".*format requires.*""", DeprecationWarning) | def deprecated_err(func, *args): # The `warnings` module doesn't have an advertised way to restore # its filter list. Cheat. save_warnings_filters = warnings.filters[:] # Grrr, we need this function to warn every time. Without removing # the warningregistry, running test_tarfile then test_struct would fail # on 64-bit platforms. globals = func.func_globals if '__warningregistry__' in globals: del globals['__warningregistry__'] warnings.filterwarnings("error", r"""^struct.*""", DeprecationWarning) warnings.filterwarnings("error", r""".*format requires.*""", DeprecationWarning) try: try: func(*args) except (struct.error, TypeError): pass except DeprecationWarning: if not PY_STRUCT_OVERFLOW_MASKING: raise TestFailed, "%s%s expected to raise struct.error" % ( func.__name__, args) else: raise TestFailed, "%s%s did not raise error" % ( func.__name__, args) finally: warnings.filters[:] = save_warnings_filters[:] | 3b5b6b5c2bc506e16c67bad1e5fd46ca4e8b3a82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/3b5b6b5c2bc506e16c67bad1e5fd46ca4e8b3a82/test_struct.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6849,
67,
370,
12,
644,
16,
380,
1968,
4672,
468,
1021,
1375,
12103,
68,
1605,
3302,
1404,
1240,
392,
16738,
5918,
4031,
358,
5217,
468,
2097,
1034,
666,
18,
225,
22682,
270,
18,
1923,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6849,
67,
370,
12,
644,
16,
380,
1968,
4672,
468,
1021,
1375,
12103,
68,
1605,
3302,
1404,
1240,
392,
16738,
5918,
4031,
358,
5217,
468,
2097,
1034,
666,
18,
225,
22682,
270,
18,
1923,
... | |
from user. After login sucessfully, the username and password will be saved in 'default_user.csv', when login next time, username and password saved in 'default_user.csv' will be used first. | from user. After the login is sucessful, the username and password will be saved in 'default_user.csv', when run the next time, username and password saved in 'default_user.csv' will be used first. | def login_to_cmdctl(self): '''Login to cmdctl with the username and password inputted from user. After login sucessfully, the username and password will be saved in 'default_user.csv', when login next time, username and password saved in 'default_user.csv' will be used first. ''' csvfile = None bsuccess = False try: csvfile = open('default_user.csv') users = csv.reader(csvfile) for row in users: param = {'username': row[0], 'password' : row[1]} response = self.send_POST('/login', param) data = response.read().decode() if response.status == http.client.OK: print(data + ' login as ' + row[0] ) bsuccess = True break except IOError as e: pass except Exception as e: print(e) finally: if csvfile: csvfile.close() if bsuccess: return True | 6fe5d6fe60deb4152630d98eba051ff984b6fcf3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6792/6fe5d6fe60deb4152630d98eba051ff984b6fcf3/bindcmd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3925,
67,
869,
67,
4172,
12930,
12,
2890,
4672,
9163,
5358,
358,
1797,
12930,
598,
326,
2718,
471,
2201,
810,
2344,
628,
729,
18,
7360,
326,
3925,
353,
1597,
614,
2706,
16,
326,
2718,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3925,
67,
869,
67,
4172,
12930,
12,
2890,
4672,
9163,
5358,
358,
1797,
12930,
598,
326,
2718,
471,
2201,
810,
2344,
628,
729,
18,
7360,
326,
3925,
353,
1597,
614,
2706,
16,
326,
2718,
... |
lineno = frame.f_lineno filename = frame.f_globals["__file__"] if filename.endswith(".pyc") or filename.endswith(".pyo"): filename = filename[:-1] | def _traceit (frame, event, arg): """ Print current executed line. """ if event == "line": lineno = frame.f_lineno filename = frame.f_globals["__file__"] if filename.endswith(".pyc") or filename.endswith(".pyo"): filename = filename[:-1] name = frame.f_globals["__name__"] line = linecache.getline(filename, lineno) info(tracelog, "%s:%s: %s", name, lineno, line.rstrip()) return _traceit | 20bd07a826aadaf358497702efb933ef4b5ec736 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/20bd07a826aadaf358497702efb933ef4b5ec736/log.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5129,
305,
261,
3789,
16,
871,
16,
1501,
4672,
3536,
3038,
783,
7120,
980,
18,
3536,
309,
871,
422,
315,
1369,
6877,
508,
273,
2623,
18,
74,
67,
16227,
9614,
972,
529,
972,
11929,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5129,
305,
261,
3789,
16,
871,
16,
1501,
4672,
3536,
3038,
783,
7120,
980,
18,
3536,
309,
871,
422,
315,
1369,
6877,
508,
273,
2623,
18,
74,
67,
16227,
9614,
972,
529,
972,
11929,... | |
print 'modifiziert' | def modifyEntry(self, timestamp, **kw): """ modify an entry given by its timestamp """ for event in self.getEvents(): if str(event.getTimestamp()) == str(timestamp): for k,v in kw.items(): setattr(event, k, v) print 'modifiziert' | 1b363b40f2be0af9b8c391d777dda2220717dc28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1807/1b363b40f2be0af9b8c391d777dda2220717dc28/Transcript.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5612,
1622,
12,
2890,
16,
2858,
16,
2826,
9987,
4672,
3536,
5612,
392,
1241,
864,
635,
2097,
2858,
3536,
364,
871,
316,
365,
18,
588,
3783,
13332,
309,
609,
12,
2575,
18,
588,
4921,
10... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5612,
1622,
12,
2890,
16,
2858,
16,
2826,
9987,
4672,
3536,
5612,
392,
1241,
864,
635,
2097,
2858,
3536,
364,
871,
316,
365,
18,
588,
3783,
13332,
309,
609,
12,
2575,
18,
588,
4921,
10... | |
cmd = cmd + ' -S"' + dotdots + 'built/include/parser-inc" -S"/usr/include"' cmd = cmd + ' -I"' + dotdots + 'built/python/include"' | cmd = cmd + ' -S"' + dotdots + PREFIX+'/include/parser-inc" -S"/usr/include"' cmd = cmd + ' -I"' + dotdots + PREFIX+'/python/include"' | def Interrogate(ipath=0, opts=0, outd=0, outc=0, src=0, module=0, library=0, files=0): if ((ipath==0)|(opts==0)|(outd==0)|(outc==0)|(src==0)|(module==0)|(library==0)|(files==0)): sys.exit("syntax error in Interrogate directive"); ipath = ["built/tmp"] + ipath + ["built/include"] outd = "built/etc/"+outd outc = "built/tmp/"+outc paths = xpaths(src+"/",files,"") dep = CxxCalcDependenciesAll(paths, ipath) dotdots = "" for i in range(0,src.count("/")+1): dotdots = dotdots + "../" ALLIN.append(outd) building = 0; for x in opts: if (x[:9]=="BUILDING_"): building = x[9:] if (older(outc, dep) or older(outd, dep)): if (COMPILER=="MSVC7"): cmd = dotdots + "built/bin/interrogate.exe" cmd = cmd + ' -DCPPPARSER -D__STDC__=1 -D__cplusplus -longlong __int64 -D_X86_ -DWIN32_VC -D_WIN32' cmd = cmd + ' -D"_declspec(param)=" -D_near -D_far -D__near -D__far -D__stdcall' if (OPTIMIZE==1): cmd = cmd + ' ' if (OPTIMIZE==2): cmd = cmd + ' ' if (OPTIMIZE==3): cmd = cmd + ' -DFORCE_INLINING' if (OPTIMIZE==4): cmd = cmd + ' -DFORCE_INLINING' cmd = cmd + ' -S"' + dotdots + 'built/include/parser-inc"' cmd = cmd + ' -I"' + dotdots + 'built/python/include"' if (COMPILER=="LINUXA"): cmd = dotdots + "built/bin/interrogate" cmd = cmd + ' -DCPPPARSER -D__STDC__=1 -D__cplusplus -D__i386__ -D__const=const' if (OPTIMIZE==1): cmd = cmd + ' ' if (OPTIMIZE==2): cmd = cmd + ' ' if (OPTIMIZE==3): cmd = cmd + ' ' if (OPTIMIZE==4): cmd = cmd + ' ' cmd = cmd + ' -S"' + dotdots + 'built/include/parser-inc" -S"/usr/include"' cmd = cmd + ' -I"' + dotdots + 'built/python/include"' cmd = cmd + " -oc "+dotdots+outc+" -od "+dotdots+outd cmd = cmd + ' -fnames -string -refcount -assert -python' for x in ipath: cmd = cmd + ' -I"' + dotdots + x + '"' if (building): cmd = cmd + " -DBUILDING_"+building if (opts.count("WITHINPANDA")): cmd = cmd + " -DWITHIN_PANDA" for pkg in PACKAGES: if (PkgSelected(opts,pkg)): cmd = cmd + ' -I"' + dotdots + STDTHIRDPARTY + pkg.lower() + "/include" + '"' cmd = cmd + ' -module "' + module + '" -library "' + library + '"' if ((COMPILER=="MSVC7") and opts.count("DXSDK")): cmd = cmd + ' -I"' + DirectXSDK + '/include"' if ((COMPILER=="MSVC7") and opts.count("MAYA5")): cmd = cmd + ' -I"' + Maya5SDK + 'include"' if ((COMPILER=="MSVC7") and opts.count("MAYA6")): cmd = cmd + ' -I"' + Maya6SDK + 'include"' for x in files: cmd = cmd + ' ' + x oscdcmd(src, cmd) updatefiledate(outd) updatefiledate(outc) | aa9700942409f59dfc63d4542d0bad0a01230726 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/aa9700942409f59dfc63d4542d0bad0a01230726/makepanda.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5294,
15283,
12,
625,
421,
33,
20,
16,
1500,
33,
20,
16,
596,
72,
33,
20,
16,
596,
71,
33,
20,
16,
1705,
33,
20,
16,
1605,
33,
20,
16,
5313,
33,
20,
16,
1390,
33,
20,
4672,
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,
5294,
15283,
12,
625,
421,
33,
20,
16,
1500,
33,
20,
16,
596,
72,
33,
20,
16,
596,
71,
33,
20,
16,
1705,
33,
20,
16,
1605,
33,
20,
16,
5313,
33,
20,
16,
1390,
33,
20,
4672,
309... |
oRPC = kws['rpc'] | rpc = kws['rpc'] | def executeRPC(self, *parms, **kws): toExecute = self.call # Check whether 'rpc' keyword is specified oRPC = False if kws.has_key('rpc'): oRPC = kws['rpc'] del kws['rpc'] # Check whether the 'timeout' keyword is specified timeout=120 if kws.has_key('timeout'): oRPC = kws['timeout'] del kws['timeout'] # Check whether the 'url' keyword is specified url = '' if kws.has_key('url'): url = kws['url'] del kws['url'] # Create the RPCClient rpcClient = self.__getRPC(oRPC, url, timeout) # Execute the method return eval("rpcClient.%s(*parms,**kws)" % toExecute) | 8fc5f736b594b14d52ae63d885217b436429c57d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12864/8fc5f736b594b14d52ae63d885217b436429c57d/Client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
8087,
12,
2890,
16,
380,
29927,
16,
2826,
79,
4749,
4672,
358,
5289,
273,
365,
18,
1991,
468,
2073,
2856,
296,
7452,
11,
4932,
353,
1269,
320,
8087,
273,
1083,
309,
18681,
18,
53... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
8087,
12,
2890,
16,
380,
29927,
16,
2826,
79,
4749,
4672,
358,
5289,
273,
365,
18,
1991,
468,
2073,
2856,
296,
7452,
11,
4932,
353,
1269,
320,
8087,
273,
1083,
309,
18681,
18,
53... |
for dataWriter in dataWriters: | updateCTF = 0 origCTF = self.settings.get("ColorTransferFunction") if len(dataWriters) > 1: updateCTF = 1 for i, dataWriter in enumerate(dataWriters): if updateCTF: self.settings.set("ColorTransferFunction", self.sourceunits[i].getColorTransferFunction()) | def doProcessing(self, bxdFile, **kws): """ Executes the module's operation using the current settings Parameters: bxdFile The name of the created .bxdfile Keywords: settings_only If this parameter is set, then only the settings will be written out and not the VTI files. timepoints The timepoints that should be processed """ if not self.module: Logging.error("No module set", "No module was set for the dataunit to do processing with") callback = None settings_only = kws.get("settings_only", 0) callback = kws.get("callback", None) timepoints = kws.get("timepoints", range(self.getNumberOfTimepoints())) # We create the vtidatasource with the name of the dataunit file # so it knows where to store the vtkImageData objects | 99e90d2b609b5176b37d5d98a1d44e38e54559e4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2877/99e90d2b609b5176b37d5d98a1d44e38e54559e4/CombinedDataUnit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
7798,
12,
2890,
16,
324,
7669,
812,
16,
2826,
79,
4749,
4672,
3536,
3889,
993,
326,
1605,
1807,
1674,
1450,
326,
783,
1947,
7012,
30,
324,
7669,
812,
202,
202,
1986,
508,
434,
326... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
7798,
12,
2890,
16,
324,
7669,
812,
16,
2826,
79,
4749,
4672,
3536,
3889,
993,
326,
1605,
1807,
1674,
1450,
326,
783,
1947,
7012,
30,
324,
7669,
812,
202,
202,
1986,
508,
434,
326... |
price = self.item['price'] | price = item['price'] | def makePurchase(self, item): ''' You need to have guards in place that item exists ''' | d853e36a6c7b232c77e43e43d67502c138fcc1e3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8066/d853e36a6c7b232c77e43e43d67502c138fcc1e3/sodauser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
23164,
12,
2890,
16,
761,
4672,
9163,
4554,
1608,
358,
1240,
11026,
87,
316,
3166,
716,
761,
1704,
9163,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
23164,
12,
2890,
16,
761,
4672,
9163,
4554,
1608,
358,
1240,
11026,
87,
316,
3166,
716,
761,
1704,
9163,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.state = runQueueCleanup | self.state = runQueueCleanUp | def task_fail(self, task, exitcode): """ Called when a task has failed Updates the state engine with the failure """ bb.msg.error(bb.msg.domain.RunQueue, "Task %s (%s) failed with %s" % (task, self.get_user_idstring(task), exitcode)) self.stats.taskFailed() fnid = self.runq_fnid[task] self.failed_fnids.append(fnid) bb.event.fire(runQueueTaskFailed(task, self.stats, self), self.cfgData) if self.taskData.abort: self.state = runQueueCleanup | 573f6125e61e7f8e0a85a3ba0e42d8e1518cefba /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8123/573f6125e61e7f8e0a85a3ba0e42d8e1518cefba/runqueue.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1562,
67,
6870,
12,
2890,
16,
1562,
16,
2427,
710,
4672,
3536,
11782,
1347,
279,
1562,
711,
2535,
15419,
326,
919,
4073,
598,
326,
5166,
3536,
7129,
18,
3576,
18,
1636,
12,
9897,
18,
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,
1562,
67,
6870,
12,
2890,
16,
1562,
16,
2427,
710,
4672,
3536,
11782,
1347,
279,
1562,
711,
2535,
15419,
326,
919,
4073,
598,
326,
5166,
3536,
7129,
18,
3576,
18,
1636,
12,
9897,
18,
3... |
def close(f): | def close(self): | def close(f): self.flush() | db95d46848a7a0880dcd0ee486dec63474b594cd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/db95d46848a7a0880dcd0ee486dec63474b594cd/rexec.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
12,
2890,
4672,
365,
18,
11330,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
12,
2890,
4672,
365,
18,
11330,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
{}).setdefault(model, {}).update( self._cache[model][record_id]) | {}).setdefault(model, {})[record_id] = \ self._cache[model][record_id] | def setLang(self, lang): self._context = self._context.copy() prev_lang = self._context.get('language') or 'en_US' self._context['language'] = lang for model in self._cache: for record_id in self._cache[model]: self._language_cache.setdefault(prev_lang, {}).setdefault(model, {}).update( self._cache[model][record_id]) if lang in self._language_cache \ and model in self._language_cache[lang] \ and record_id in self._language_cache[lang][model]: self._cache[model][record_id] = \ self._language_cache[lang][model][record_id] else: self._cache[model][record_id] = {'id': record_id} | 74d7051407eed4af504b55cfaa9be06bc3e48d9f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9266/74d7051407eed4af504b55cfaa9be06bc3e48d9f/browse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
7275,
12,
2890,
16,
3303,
4672,
365,
6315,
2472,
273,
365,
6315,
2472,
18,
3530,
1435,
2807,
67,
4936,
273,
365,
6315,
2472,
18,
588,
2668,
4923,
6134,
578,
296,
275,
67,
3378,
11... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
7275,
12,
2890,
16,
3303,
4672,
365,
6315,
2472,
273,
365,
6315,
2472,
18,
3530,
1435,
2807,
67,
4936,
273,
365,
6315,
2472,
18,
588,
2668,
4923,
6134,
578,
296,
275,
67,
3378,
11... |
wrapped = lheader(msgsubj, lcset, continuation_ws='') | wrapped = Utils.wrap('%2d. %s' % (msgcount, subject), 65) | 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,
... |
connection.execute(self.results.insert(), into_results) | connection.execute(self.results.insert(), into_results) | def __insert_into_machines_and_results(self, connection, computers, groupid): """ This function is called by reload_group and addmembers_to_group to update the Results and Machines tables of the database. | 20c13b18dc6fa0bcfca76d1db5ea8bf1d4c217ee /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5988/20c13b18dc6fa0bcfca76d1db5ea8bf1d4c217ee/database.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
6387,
67,
18591,
67,
81,
10635,
67,
464,
67,
4717,
12,
2890,
16,
1459,
16,
5305,
414,
16,
22895,
4672,
3536,
1220,
445,
353,
2566,
635,
7749,
67,
1655,
471,
527,
7640,
67,
869,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
6387,
67,
18591,
67,
81,
10635,
67,
464,
67,
4717,
12,
2890,
16,
1459,
16,
5305,
414,
16,
22895,
4672,
3536,
1220,
445,
353,
2566,
635,
7749,
67,
1655,
471,
527,
7640,
67,
869,
... |
self.ClassColors=OWGraphTools.ColorPaletteHSV(len(self.tree.distribution)) | self.ClassColors = OWColorPalette.ColorPaletteHSV(len(self.tree.distribution)) | def ctree(self, tree=None): self.clear() if not tree: self.centerRootButton.setDisabled(1) self.centerNodeButton.setDisabled(0) self.infoa.setText('No tree.') self.infob.setText('') self.tree=None else: self.tree=tree.tree self.infoa.setText('Number of nodes: ' + str(orngTree.countNodes(tree))) self.infob.setText('Number of leaves: ' + str(orngTree.countLeaves(tree))) self.ClassColors=OWGraphTools.ColorPaletteHSV(len(self.tree.distribution)) self.rootNode=self.walkcreate(self.tree, None) self.canvas.fixPos(self.rootNode,self.HSpacing,self.VSpacing) self.activateLoadedSettings() self.canvasView.centerOn(self.rootNode.x(), self.rootNode.y()) self.centerRootButton.setDisabled(0) self.centerNodeButton.setDisabled(1) | 5ad68907f54792406e2b5734a23f0132938123d5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6366/5ad68907f54792406e2b5734a23f0132938123d5/OWTreeViewer2D.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
276,
3413,
12,
2890,
16,
2151,
33,
7036,
4672,
365,
18,
8507,
1435,
309,
486,
2151,
30,
365,
18,
5693,
2375,
3616,
18,
542,
8853,
12,
21,
13,
365,
18,
5693,
907,
3616,
18,
542,
8853,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
276,
3413,
12,
2890,
16,
2151,
33,
7036,
4672,
365,
18,
8507,
1435,
309,
486,
2151,
30,
365,
18,
5693,
2375,
3616,
18,
542,
8853,
12,
21,
13,
365,
18,
5693,
907,
3616,
18,
542,
8853,... |
return FilenameType(self.status.get('filename', '')) | return self.status.get('filename', FilenameType('')) | def get_filename(self): """Returns the filename that we're downloading to. Should not be called until state is "finished." """ self.confirm_db_thread() # FIXME - '' is a bogus value, but looks like a filename. # should return None. return FilenameType(self.status.get('filename', '')) | 8d69b3b2c78c88c47c9db784f198ee11062d9eed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12354/8d69b3b2c78c88c47c9db784f198ee11062d9eed/downloader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3459,
12,
2890,
4672,
3536,
1356,
326,
1544,
716,
732,
4565,
23742,
358,
18,
225,
9363,
486,
506,
2566,
3180,
919,
353,
315,
13527,
1199,
3536,
365,
18,
10927,
67,
1966,
67,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3459,
12,
2890,
4672,
3536,
1356,
326,
1544,
716,
732,
4565,
23742,
358,
18,
225,
9363,
486,
506,
2566,
3180,
919,
353,
315,
13527,
1199,
3536,
365,
18,
10927,
67,
1966,
67,
5... |
if element.tag.endswith('data') and element.attrib['type'] == 'primary': | if element.tag.endswith('data') and element.get('type') == 'primary': | def loadRepos(repolist): ''' repolist is a list of urls to yum repositories. Builds a dictionary keyed by the package name. Dictionary item is a list, one entry per package instance found. The list entries are dictionaries. Keys are 'filename', 'mtime' 'name', 'arch', 'epoch', 'version' and 'release'. e.g. packages = { 'bcfg2' : [ {'filename':'bcfg2-0.9.2-0.0rc1.noarch.rpm', 'mtime':'' 'name':"bcfg2', ''arch':'noarch', 'epoch':None, 'version':'0.9.2', 'release':'0.0rc1'} {'filename':'bcfg2-0.9.2-0.0rc5.noarch.rpm', 'mtime':'' 'name':"bcfg2', ''arch':'noarch', 'epoch':None, 'version':'0.9.2', 'release':'0.0rc5'}], 'bcfg2-server' : [ {'filename':'bcfg2-server-0.9.2-0.0rc1.noarch.rpm', 'mtime':'' 'name':"bcfg2-server', ''arch':'noarch', 'epoch':None, 'version':'0.9.2', 'release':'0.0rc1'} {'filename':'bcfg2-server-0.9.2-0.0rc5.noarch.rpm', 'mtime':'' 'name':"bcfg2-server', ''arch':'noarch', 'epoch':None, 'version':'0.9.2', 'release':'0.0rc5'}], } ''' packages = {} for repo in repolist: url = urlparse.urljoin(repo, './repodata/repomd.xml') try: opener = pkgmgr_URLopener() file, message = opener.retrieve(url) except: sys.exit() try: tree = parse(file) except IOError: print "ERROR: Unable to parse retrieved repomd.xml." sys.exit() repomd = tree.getroot() for element in repomd: if element.tag.endswith('data') and element.attrib['type'] == 'primary': for property in element: if property.tag.endswith('location'): primaryhref = property.attrib['href'] url = urlparse.urljoin(repo, './' + primaryhref) if options.verbose: print 'Loading : %s' % url try: opener = pkgmgr_URLopener() file, message = opener.retrieve(url) except: sys.exit() try: repo_file = gzip.open(file) tree = parse(repo_file) except IOError: print "ERROR: Unable to parse retrieved file." sys.exit() repo = tree.getroot() for element in repo: if element.tag.endswith('package'): for property in element: if property.tag.endswith('name'): name = property.text elif property.tag.endswith('arch'): subarch = property.text elif property.tag.endswith('version'): version = property.get('ver') epoch = property.get('epoch') release = property.get('rel') elif property.tag.endswith('location'): file = property.get('href') # Only load RPMs with subarchitectures as calculated from the --archs option. if subarch in subarchs or 'all' in subarchs: packages.setdefault(name, []).append({'filename':file, 'name':name, \ 'arch':subarch, 'epoch':epoch, \ 'version':version, 'release':release}) # Print '.' for each package. stdio is line buffered, so have to flush it. if options.verbose: sys.stdout.write('.') sys.stdout.flush() if options.verbose: sys.stdout.write('\n') repo_file.close() return packages | e1ee914acf6f256c1bc2603177900ffccae1bc99 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11867/e1ee914acf6f256c1bc2603177900ffccae1bc99/pkgmgr_gen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
28453,
12,
266,
3915,
376,
4672,
9163,
2071,
355,
376,
353,
279,
666,
434,
6903,
358,
677,
379,
14531,
18,
225,
3998,
87,
279,
3880,
17408,
635,
326,
2181,
508,
18,
225,
16447,
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,
1262,
28453,
12,
266,
3915,
376,
4672,
9163,
2071,
355,
376,
353,
279,
666,
434,
6903,
358,
677,
379,
14531,
18,
225,
3998,
87,
279,
3880,
17408,
635,
326,
2181,
508,
18,
225,
16447,
7... |
maxLen = self.__speed | if (goForward): maxLen = self.__speed else: maxLen = self.ship.reverseAcceleration | def handleAvatarControls(self, task): """ Check on the arrow keys and update the "avatar" (ship). """ if __debug__: if self.wantDebugIndicator: onScreenDebug.append("localAvatar pos = %s\n"%( base.localAvatar.getPos().pPrintValues(),)) onScreenDebug.append("localAvatar hpr = %s\n"%( base.localAvatar.getHpr().pPrintValues(),)) assert self.debugPrint("handleAvatarControls(task=%s)"%(task,)) physObject = self.actorNode.getPhysicsObject() contact = self.actorNode.getContactVector() # get the button states: forward = inputState.isSet("forward") reverse = inputState.isSet("reverse") turnLeft = inputState.isSet("slideLeft") or inputState.isSet("turnLeft") turnRight = inputState.isSet("slideRight") or inputState.isSet("turnRight") slide = inputState.isSet("slide") slideLeft = 0 slideRight = 0 jump = inputState.isSet("jump") # Determine what the speeds are based on the buttons: # Check for Auto-Sailing if self.ship.getIsAutoSailing(): forward = 1 reverse = 0 else: forward = 0 # How far did we move based on the amount of time elapsed? dt = ClockObject.getGlobalClock().getDt() if reverse: # Reverse kills Travel Speed totally self.straightHeading = 0 elif (self.__speed < (self.ship.acceleration + self.ship.speedboost) * self.ship.speednerf) and forward: # If not at MinSpeed, Accelerate regardless self.straightHeading += dt * 1.5 elif self.ship.threatCounter: # If ship is recently damaged, do not increase Travel Speed self.straightHeading = min(1.0 / self.MAX_STRAIGHT_SAIL_BONUS * self.STRAIGHT_SAIL_BONUS_TIME * self.ship.speednerf, self.straightHeading) elif turnLeft or turnRight or not forward: # Reset Straight Sailing Bonus self.straightHeading -= dt * self.TURNING_BONUS_REDUCTION else: # Add in the Straight Sailing Time self.straightHeading += dt self.straightHeading = max(0, min(self.STRAIGHT_SAIL_BONUS_TIME, self.straightHeading)) # Straight Sailing Acceleration Bonus straightSailBonus = 0.0 straightSailBonus = self.straightHeading / self.STRAIGHT_SAIL_BONUS_TIME straightSailBonus = min(self.MAX_STRAIGHT_SAIL_BONUS, straightSailBonus * self.MAX_STRAIGHT_SAIL_BONUS) self.__speed=(forward and self.ship.acceleration) or \ (reverse and -self.ship.reverseAcceleration) avatarSlideSpeed=self.ship.acceleration * 0.5 * straightSailBonus #self.__slideSpeed=slide and ( # (turnLeft and -avatarSlideSpeed) or # (turnRight and avatarSlideSpeed)) self.__slideSpeed=(forward or reverse) and ( (slideLeft and -avatarSlideSpeed) or (slideRight and avatarSlideSpeed)) self.__rotationSpeed=not slide and ( (turnLeft and self.ship.turnRate) or (turnRight and -self.ship.turnRate)) # Add in Straight Sailing Multiplier self.__speed *= straightSailBonus self.__speed += self.ship.speedboost self.__slideSpeed *= straightSailBonus maxSpeed = self.ship.maxSpeed self.__speed *= self.ship.speednerf # Enable debug turbo modec debugRunning = inputState.isSet("debugRunning") if(debugRunning): self.__speed*=base.debugRunningMultiplier self.__slideSpeed*=base.debugRunningMultiplier self.__rotationSpeed*=1.25 maxSpeed = self.ship.maxSpeed * base.debugRunningMultiplier #*# self.currentTurning += self.__rotationSpeed if self.currentTurning > self.ship.maxTurn: self.currentTurning = self.ship.maxTurn elif self.currentTurning < -self.ship.maxTurn: self.currentTurning = -self.ship.maxTurn if turnLeft or turnRight: mult = .9 elif forward or reverse: mult = .82 else: mult = .8 self.currentTurning *= mult if self.currentTurning < 0.001 and self.currentTurning > -0.001: self.currentTurning = 0.0 self.__rotationSpeed = self.currentTurning #print "########################" #print self.__speed #print self.ship.baseAcceleration #print self.ship.acceleration #print self.ship.speedboost #print straightSailBonus # Broadcast Event to Handlers (ShipStatusMeter) messenger.send("setShipSpeed-%s" % (self.ship.getDoId()), [self.__speed, self.getMaxSpeed()]) if self.wantDebugIndicator: self.displayDebugInfo() if self.needToDeltaPos: self.setPriorParentVector() self.needToDeltaPos = 0 #------------------------------ #debugTempH=self.shipNodePath.getH() if __debug__: q1=self.shipNodePath.getQuat() q2=physObject.getOrientation() q1.normalize() q2.normalize() assert q1.isSameDirection(q2) or (q1.getHpr() == q2.getHpr()) assert self.shipNodePath.getPos().almostEqual( physObject.getPosition(), 0.0001) #------------------------------ | 391e901acef6c39a51bba3e7c5286791d18c7780 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7242/391e901acef6c39a51bba3e7c5286791d18c7780/ShipPilot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
23999,
16795,
12,
2890,
16,
1562,
4672,
3536,
2073,
603,
326,
12274,
1311,
471,
1089,
326,
315,
19660,
6,
261,
3261,
2934,
3536,
309,
1001,
4148,
972,
30,
309,
365,
18,
17369,
2829... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
23999,
16795,
12,
2890,
16,
1562,
4672,
3536,
2073,
603,
326,
12274,
1311,
471,
1089,
326,
315,
19660,
6,
261,
3261,
2934,
3536,
309,
1001,
4148,
972,
30,
309,
365,
18,
17369,
2829... |
act.user_id NOT IN (SELECT user_id FROM award WHERE badge_id = %s)" % (TYPE_ACTIVITY_ANSWER, 15) cursor = connection.cursor() cursor.execute(query) rows = cursor.fetchall() | act.user_id NOT IN (SELECT distinct user_id FROM award WHERE badge_id = %s)" % (TYPE_ACTIVITY_ANSWER, 15) cursor = connection.cursor() cursor.execute(query) rows = cursor.fetchall() awarded_users = [] | def first_answer_be_voted(self): query = "SELECT act.user_id, a.vote_up_count FROM \ activity act, answer a WHERE act.activity_type = %s AND \ act.object_id = a.id AND\ act.user_id NOT IN (SELECT user_id FROM award WHERE badge_id = %s)" % (TYPE_ACTIVITY_ANSWER, 15) cursor = connection.cursor() cursor.execute(query) rows = cursor.fetchall() badge = get_object_or_404(Badge, id=15) for row in rows: user_id = row[0] vote_up_count = row[1] if vote_up_count > 0: user = get_object_or_404(User, id=user_id) award = Award(user=user, badge=badge) award.save() | 13407f9b909fb0fb93ffbc0838b57262c10d9f21 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3729/13407f9b909fb0fb93ffbc0838b57262c10d9f21/once_award_badges.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1122,
67,
13490,
67,
2196,
67,
90,
16474,
12,
2890,
4672,
843,
273,
315,
4803,
1328,
18,
1355,
67,
350,
16,
279,
18,
25911,
67,
416,
67,
1883,
4571,
521,
5728,
1328,
16,
5803,
279,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1122,
67,
13490,
67,
2196,
67,
90,
16474,
12,
2890,
4672,
843,
273,
315,
4803,
1328,
18,
1355,
67,
350,
16,
279,
18,
25911,
67,
416,
67,
1883,
4571,
521,
5728,
1328,
16,
5803,
279,
4... |
else: return None | else: return None | def get_first_node(node, dtype): if node is None: return None if any([o.dtype!=dtype for o in node.outputs]): for i in node.inputs: n = get_first_node(i.owner, dtype) if n is not None: return n return node#no parent generated a different type else: return None | a163846d3a3b6a281fcb9f40adf797eebf4737ec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/a163846d3a3b6a281fcb9f40adf797eebf4737ec/pfunc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3645,
67,
2159,
12,
2159,
16,
3182,
4672,
309,
756,
353,
599,
30,
327,
599,
309,
1281,
3816,
83,
18,
8972,
5,
33,
8972,
364,
320,
316,
756,
18,
12295,
65,
4672,
364,
277,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3645,
67,
2159,
12,
2159,
16,
3182,
4672,
309,
756,
353,
599,
30,
327,
599,
309,
1281,
3816,
83,
18,
8972,
5,
33,
8972,
364,
320,
316,
756,
18,
12295,
65,
4672,
364,
277,
... |
LIBS = [ '$LIBSENF' ], | LIBS = [ '$LIBSENF$LIBADDSUFFIX' ], | def Objects(env, sources, testSources = None, OBJECTS = []): if type(sources) == type(()): testSources = sources[1] sources = sources[0] if type(sources) is not type([]): sources = [ sources ] objects = None if sources: obsources = [ source for source in sources if type(source) is type('') and not source.endswith('.o') ] objects = [ source for source in sources if type(source) is not type('') or source.endswith('.o') ] if obsources: objects += env.Object(obsources) if testSources: test = [ env.BoostUnitTests( target = 'test', objects = objects, test_sources = testSources, LIBS = [ '$LIBSENF' ], OBJECTS = OBJECTS, DEPENDS = [ env.File(LibPath(env['LIBSENF'])) ]) ] compileTestSources = [ src for src in testSources if 'COMPILE_CHECK' in file(src).read() ] if compileTestSources: test.extend(env.CompileCheck(source = compileTestSources)) env.Alias('all_tests', test) # Hmm ... here I'd like to use an Alias instead of a file # however the alias does not seem to live in the subdirectory # which breaks 'scons -u test' env.Command(env.File('test'), test, []) #env.Alias(env.File('test'), test) return objects | 7dd5507d136f8377c7268abf9c2454f5323f09ca /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2548/7dd5507d136f8377c7268abf9c2454f5323f09ca/SENFSCons.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8487,
12,
3074,
16,
5550,
16,
1842,
8628,
273,
599,
16,
12166,
55,
273,
5378,
4672,
309,
618,
12,
10141,
13,
422,
618,
12,
1435,
4672,
1842,
8628,
273,
5550,
63,
21,
65,
5550,
273,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8487,
12,
3074,
16,
5550,
16,
1842,
8628,
273,
599,
16,
12166,
55,
273,
5378,
4672,
309,
618,
12,
10141,
13,
422,
618,
12,
1435,
4672,
1842,
8628,
273,
5550,
63,
21,
65,
5550,
273,
5... |
apprai_id = [] | def button_plan_in_progress(self, cr, uid, ids, context=None): hr_eval_inter_obj = self.pool.get('hr.evaluation.interview') if context is None: context = {} apprai_id = [] for evaluation in self.browse(cr, uid, ids, context=context): wait = False for phase in evaluation.plan_id.phase_ids: childs = [] if phase.action == "bottom-up": childs = evaluation.employee_id.child_ids elif phase.action in ("top-down", "final"): if evaluation.employee_id.parent_id: childs = [evaluation.employee_id.parent_id] elif phase.action == "self": childs = [evaluation.employee_id] for child in childs: | 74dc9a43786b367b0c8508e2cf1c46ad50d31e4c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/74dc9a43786b367b0c8508e2cf1c46ad50d31e4c/hr_evaluation.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3568,
67,
7088,
67,
267,
67,
8298,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
15407,
67,
8622,
67,
2761,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
7256,
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,
3568,
67,
7088,
67,
267,
67,
8298,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
15407,
67,
8622,
67,
2761,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
7256,
18,
... | |
d.addCallbacks(onSuccess, client.onError, errbackArgs = (func, args, False)) | d.addCallbacks(_onSuccess, client.onError, errbackArgs = (func, args, False)) | def onSuccess(result): if type(result) != list and len(result) != 2: self.logger.error('Imaging: Couldn\'t set default entry on %s for %s : %s' % (num, computerUUID, str(result))) ret = False elif not result[0]: self.logger.error('Imaging: Couldn\'t set default entry on %s for %s : %s' % (num, computerUUID, str(result))) ret = False else: self.logger.error('Imaging: Couldn\'t set default entry on %s for %s : %s' % (num, computerUUID, str(result))) ret = True return ret | 9243f98ba17d3c22702ab69f4700cc04c9ed9c91 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5988/9243f98ba17d3c22702ab69f4700cc04c9ed9c91/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20613,
12,
2088,
4672,
309,
618,
12,
2088,
13,
480,
666,
471,
562,
12,
2088,
13,
480,
576,
30,
365,
18,
4901,
18,
1636,
2668,
1170,
5755,
30,
14312,
82,
3730,
88,
444,
805,
1241,
603... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20613,
12,
2088,
4672,
309,
618,
12,
2088,
13,
480,
666,
471,
562,
12,
2088,
13,
480,
576,
30,
365,
18,
4901,
18,
1636,
2668,
1170,
5755,
30,
14312,
82,
3730,
88,
444,
805,
1241,
603... |
status,reason,data=wikipedia.putPage(mylang,name,newtext) | status,reason,data=wikipedia.putPage(mylang,inname,newtext) | def treesearch(code,name): arr={(code,name):None} # First make one step based on the language itself try: n=treestep(arr,code,name,abort_on_redirect=1) except wikipedia.IsRedirectPage: print "Is redirect page" return if n==0 and not arr[code,name]: print "Mother doesn't exist" return # Then add translations if we survived. autotranslate(name,arr) modifications=1 while modifications: modifications=0 for newcode,newname in arr.keys(): if arr[newcode,newname] is None: modifications+=treestep(arr,newcode,newname) return arr | 6c5c872b9683996d89fc011067137fdbe3a51618 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/6c5c872b9683996d89fc011067137fdbe3a51618/treelang.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9787,
3392,
991,
12,
710,
16,
529,
4672,
2454,
5899,
12,
710,
16,
529,
4672,
7036,
97,
468,
5783,
1221,
1245,
2235,
2511,
603,
326,
2653,
6174,
775,
30,
290,
33,
27427,
395,
881,
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,
9787,
3392,
991,
12,
710,
16,
529,
4672,
2454,
5899,
12,
710,
16,
529,
4672,
7036,
97,
468,
5783,
1221,
1245,
2235,
2511,
603,
326,
2653,
6174,
775,
30,
290,
33,
27427,
395,
881,
12,
... |
if occupied_size + tmp_size <= width: break | if (occupied_size + tmp_size) <= width: break | def drawstringframedhard(self, string, x, y, width, height, fgcolor=None, bgcolor=None, font=None, ptsize=0, align_h='left', align_v='top'): | 2ea40a76b425329045198513ac4f1a13125fdb43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/2ea40a76b425329045198513ac4f1a13125fdb43/osd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
1080,
74,
1940,
329,
20379,
12,
2890,
16,
533,
16,
619,
16,
677,
16,
1835,
16,
2072,
16,
10186,
3266,
33,
7036,
16,
31509,
33,
7036,
16,
3512,
33,
7036,
16,
5818,
1467,
33,
20,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
1080,
74,
1940,
329,
20379,
12,
2890,
16,
533,
16,
619,
16,
677,
16,
1835,
16,
2072,
16,
10186,
3266,
33,
7036,
16,
31509,
33,
7036,
16,
3512,
33,
7036,
16,
5818,
1467,
33,
20,... |
def __init__(data = None) | def __init__(data = None): | def __init__(data = None) if data == None: quickfix.IntField.__init__(self, 727) else quickfix.IntField.__init__(self, 727, data) | 484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
4672,
309,
501,
422,
599,
30,
9549,
904,
18,
1702,
974,
16186,
2738,
972,
12,
2890,
16,
2371,
5324,
13,
469,
9549,
904,
18,
1702,
974,
16186,
2738,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
2738,
972,
12,
892,
273,
599,
4672,
309,
501,
422,
599,
30,
9549,
904,
18,
1702,
974,
16186,
2738,
972,
12,
2890,
16,
2371,
5324,
13,
469,
9549,
904,
18,
1702,
974,
16186,
2738,
... |
"""PRAGMA synchronous="0FF";""", | """PRAGMA synchronous="OFF";""", | def create_filelists_db(self): schema = [ """PRAGMA synchronous="0FF";""", """pragma locking_mode="EXCLUSIVE";""", """CREATE TABLE db_info (dbversion INTEGER, checksum TEXT);""", """CREATE TABLE filelist ( pkgKey INTEGER, dirname TEXT, filenames TEXT, filetypes TEXT);""", """CREATE TABLE packages ( pkgKey INTEGER PRIMARY KEY, pkgId TEXT);""", """CREATE INDEX dirnames ON filelist (dirname);""", """CREATE INDEX keyfile ON filelist (pkgKey);""", """CREATE INDEX pkgId ON packages (pkgId);""", """CREATE TRIGGER remove_filelist AFTER DELETE ON packages BEGIN DELETE FROM filelist WHERE pkgKey = old.pkgKey; END;""", """INSERT into db_info values (%s, 'direct_create');""" % sqlitecachec.DBVERSION, ] for cmd in schema: executeSQL(self.filelists_cursor, cmd) | 774e0415d654f7a03136cfa1197240b4e3b26b14 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9557/774e0415d654f7a03136cfa1197240b4e3b26b14/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
7540,
292,
1486,
67,
1966,
12,
2890,
4672,
1963,
273,
306,
3536,
8025,
1781,
5535,
12209,
1546,
8797,
14432,
3660,
3113,
3536,
683,
9454,
18887,
67,
3188,
1546,
2294,
11686,
24870... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
7540,
292,
1486,
67,
1966,
12,
2890,
4672,
1963,
273,
306,
3536,
8025,
1781,
5535,
12209,
1546,
8797,
14432,
3660,
3113,
3536,
683,
9454,
18887,
67,
3188,
1546,
2294,
11686,
24870... |
label='Try to &Scan Executable Files Only', | label='Try to Scan &Executable Files Only', | def _init_ctrls(self, prnt): # generated method, don't edit wxDialog.__init__(self, id=wxID_WXPREFERENCESDLG, name='', parent=prnt, pos=wxPoint(523, 301), size=wxSize(419, 351), style=wxDEFAULT_DIALOG_STYLE, title='ClamWin Preferences') self._init_utils() self.SetClientSize(wxSize(411, 324)) self.SetAutoLayout(False) self.Center(wxBOTH) EVT_CHAR_HOOK(self, self.OnCharHook) | ced0911957faf8b1fa6a8ca1040dbad5f3b217f2 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3644/ced0911957faf8b1fa6a8ca1040dbad5f3b217f2/wxDialogPreferences.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
67,
16277,
87,
12,
2890,
16,
846,
496,
4672,
468,
4374,
707,
16,
2727,
1404,
3874,
7075,
6353,
16186,
2738,
972,
12,
2890,
16,
612,
33,
27226,
734,
67,
59,
60,
3670,
10830,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
468,
4374,
707,
16,
2727,
1404,
3874,
7075,
6353,
16186,
2738,
972,
12,
2890,
16,
612,
33,
27226,
734,
67,
59,
60,
3670,
10830,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.