rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
""" Should return False under normal circumstances """ | """ Should return False under normal circumstances. """ | def test_returns_false_by_default(self): """ Should return False under normal circumstances """ expect_result = False result = daemon.daemon.is_process_started_by_superserver() self.failUnlessIs(expect_result, result) | 33a5bfc655a6417210c5c80d9f942714bf596533 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4939/33a5bfc655a6417210c5c80d9f942714bf596533/test_daemon.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
6154,
67,
5743,
67,
1637,
67,
1886,
12,
2890,
4672,
3536,
9363,
327,
1083,
3613,
2212,
29951,
2639,
18,
3536,
4489,
67,
2088,
273,
1083,
563,
273,
8131,
18,
21511,
18,
291,
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,
1842,
67,
6154,
67,
5743,
67,
1637,
67,
1886,
12,
2890,
4672,
3536,
9363,
327,
1083,
3613,
2212,
29951,
2639,
18,
3536,
4489,
67,
2088,
273,
1083,
563,
273,
8131,
18,
21511,
18,
291,
6... |
error4 = 'Cannot log in to account "%s" on server %s:%i"' | error4 = 'Cannot log in to account "%s" on server "%s:%i"' | def validation(event=None): flag = True if not validateEmailAddr(toCtrl.GetValue()): flag = False if subjectCtrl.GetValue()=='': flag = False panel.dialog.buttonRow.applyButton.Enable(flag) panel.dialog.buttonRow.okButton.Enable(flag) | 12fb689db69b2ce866902fbcc1bb19e0622932ba /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8076/12fb689db69b2ce866902fbcc1bb19e0622932ba/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3379,
12,
2575,
33,
7036,
4672,
2982,
273,
1053,
309,
486,
1954,
4134,
3178,
12,
869,
12418,
18,
967,
620,
1435,
4672,
2982,
273,
1083,
309,
3221,
12418,
18,
967,
620,
1435,
18920,
4278,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3379,
12,
2575,
33,
7036,
4672,
2982,
273,
1053,
309,
486,
1954,
4134,
3178,
12,
869,
12418,
18,
967,
620,
1435,
4672,
2982,
273,
1083,
309,
3221,
12418,
18,
967,
620,
1435,
18920,
4278,... |
raise "\nERROR: Invalid Item" | raise Exception("\nERROR: Invalid Item") | def SetItemWindowEnabled(self, item, enable=True): """Enables/disables the window associated to the item.""" | e1463b9df091ad0e9d76292564d4389882b28de1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12725/e1463b9df091ad0e9d76292564d4389882b28de1/customtreectrl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1000,
1180,
3829,
1526,
12,
2890,
16,
761,
16,
4237,
33,
5510,
4672,
3536,
25924,
19,
2251,
1538,
326,
2742,
3627,
358,
326,
761,
12123,
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,
0,
0,
0,
0,
0,
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,
1000,
1180,
3829,
1526,
12,
2890,
16,
761,
16,
4237,
33,
5510,
4672,
3536,
25924,
19,
2251,
1538,
326,
2742,
3627,
358,
326,
761,
12123,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
if line[0] == "U": print "needs update because of", line return True if line[0] == "P": print "needs update because of", line return True if line[0] == "A": | if line.lower().startswith('restored'): print "needs update because of", line return True s = line[:4] if s.find("U") != -1: print "needs update because of", line return True if s.find("P") != -1: print "needs update because of", line return True if s.find("A") != -1: print "needs update because of", line return True if s.find("G") != -1: print "needs update because of", line return True if s.find("!") != -1: | def NeedsUpdate(outputList): for line in outputList: if line.lower().find("ide scripts") != -1: # this hack is for skipping some Mac-specific files that # under Windows always appear to be needing an update continue if line.lower().find("xercessamples") != -1: # same type of hack as above continue if line[0] == "U": print "needs update because of", line return True if line[0] == "P": print "needs update because of", line return True if line[0] == "A": print "needs update because of", line return True return False | 8fd67468a9f41b95e574894c23940c3231ad3efb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/8fd67468a9f41b95e574894c23940c3231ad3efb/newchandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29164,
1891,
12,
2844,
682,
4672,
364,
980,
316,
876,
682,
30,
309,
980,
18,
8167,
7675,
4720,
2932,
831,
8873,
7923,
480,
300,
21,
30,
468,
333,
11769,
353,
364,
14195,
2690,
13217,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29164,
1891,
12,
2844,
682,
4672,
364,
980,
316,
876,
682,
30,
309,
980,
18,
8167,
7675,
4720,
2932,
831,
8873,
7923,
480,
300,
21,
30,
468,
333,
11769,
353,
364,
14195,
2690,
13217,
1... |
def __removeSubDirectories(self,subDirectories): resDict = {'FilesRemoved':0,'SizeRemoved':0,'AllRemoved':True} if len(subDirectories) > 0: res = self.__removeDirectoryRecursive(subDirectories) | def __removeSubDirectories( self, subDirectories ): resDict = {'FilesRemoved':0, 'SizeRemoved':0, 'AllRemoved':True} if len( subDirectories ) > 0: res = self.__removeDirectoryRecursive( subDirectories ) | def __removeSubDirectories(self,subDirectories): resDict = {'FilesRemoved':0,'SizeRemoved':0,'AllRemoved':True} if len(subDirectories) > 0: res = self.__removeDirectoryRecursive(subDirectories) if res['OK']: for removedSubDir,removedDict in res['Value']['Successful'].items(): resDict['FilesRemoved'] += removedDict['FilesRemoved'] resDict['SizeRemoved'] += removedDict['SizeRemoved'] gLogger.debug("SRM2Storage.__removeSubDirectories: Removed %s files of size %s bytes from %s." % (removedDict['FilesRemoved'],removedDict['SizeRemoved'],removedSubDir)) for removedSubDir,removedDict in res['Value']['Failed'].items(): resDict['FilesRemoved'] += removedDict['FilesRemoved'] resDict['SizeRemoved'] += removedDict['SizeRemoved'] gLogger.debug("SRM2Storage.__removeSubDirectories: Removed %s files of size %s bytes from %s." % (removedDict['FilesRemoved'],removedDict['SizeRemoved'],removedSubDir)) if len(res['Value']['Failed'].keys()) != 0: resDict['AllRemoved'] = False return resDict | 70e66af095cb6701e39b1e701e4a2ce4d012b4f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/70e66af095cb6701e39b1e701e4a2ce4d012b4f7/SRM2Storage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
4479,
1676,
13071,
12,
365,
16,
720,
13071,
262,
30,
400,
5014,
273,
13666,
2697,
10026,
4278,
20,
16,
296,
1225,
10026,
4278,
20,
16,
296,
1595,
10026,
4278,
5510,
97,
309,
562,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
4479,
1676,
13071,
12,
365,
16,
720,
13071,
262,
30,
400,
5014,
273,
13666,
2697,
10026,
4278,
20,
16,
296,
1225,
10026,
4278,
20,
16,
296,
1595,
10026,
4278,
5510,
97,
309,
562,
... |
image_list = ['cbc_plotsummary_4__count_vs_ifar_H1H2L1.png','cbc_plotsummary_4__count_vs_ifar_H1L1.png','cbc_plotsummary_4__count_vs_ifar_H2L1.png'] | image_list = ['cbc_plotsummary_4_count_vs_ifar_H1H2L1.png','cbc_plotsummary_4_count_vs_ifar_H1L1.png','cbc_plotsummary_4_count_vs_ifar_H2L1.png'] | def finish(self): self.file.close() | b9ae784b03603eea0127705621645b4c0039d780 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/b9ae784b03603eea0127705621645b4c0039d780/make_summary_page.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4076,
12,
2890,
4672,
365,
18,
768,
18,
4412,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4076,
12,
2890,
4672,
365,
18,
768,
18,
4412,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
for offset_vector in self.offset_vectors: | for offset_vector in cafepacker.offset_vectors: | def split_bins(cafepacker, extentlimit): """ Split bins of stored in CafePacker until each bin has an extent no longer than extentlimit. """ # # loop overall the bins in cafepacker.bins. we pop items out of # cafepacker.bins and append new ones to the end so need a while loop # checking the extent of each bin in cafepacker.bins until all bins are # done being split # idx = 0 while idx < len(cafepacker.bins): if abs(cafepacker.bins[idx].extent) <= extentlimit: # # bin doesn't need splitting so move to next # idx += 1 continue # # split this bin so pop it out of the list # bigbin = cafepacker.bins.pop(idx) # # calculate the central time of the union of all the input # files in the bin # splittime = lsctables.LIGOTimeGPS(bigbin.extent[0] + (bigbin.extent[1] - bigbin.extent[0])/2) # # split the segmentlistdict at this time # splitseglistdict = segments.segmentlistdict() for key in bigbin.size.keys(): splitseglistdict[key] = segments.segmentlist([segments.segment(-segments.infinity(),splittime)]) # # create bins for the first and second halves # bin1 = LALCacheBin() bin1.size = bigbin.size & splitseglistdict bin1.extent = bigbin.extent & splitseglistdict.values()[0][0] bin2 = LALCacheBin() bin2.size = bigbin.size & ~splitseglistdict bin2.extent = bigbin.extent & (~splitseglistdict.values()[0])[0] # # remove unused keys from the smaller bins' segmentlistdicts # newsize = segments.segmentlistdict() for key in bin1.size.keys(): if len(bin1.size[key]): newsize[key] = bin1.size[key] bin1.size = newsize newsize = segments.segmentlistdict() for key in bin2.size.keys(): if len(bin2.size[key]): newsize[key] = bin2.size[key] bin2.size = newsize # # find which of the objects in bigbin.objects intersect the two # smaller bins # for cache in bigbin.objects: thisseglistdict = cache.to_segmentlistdict() coinc1 = 0 coinc2 = 0 for offset_vector in self.offset_vectors: # # loop over offset vectors updating the smaller # bins and the object we are checking # bin1.size.offsets.update(offset_vector) bin2.size.offsets.update(offset_vector) thisseglistdict.offsets.update(offset_vector) if not coinc1 and bin1.size.is_coincident(thisseglistdict, keys = offset_vector.keys()): # # object is coicident with bin1 # coinc1 = 1 bin1.objects.append(cache) if not coinc2 and bin2.size.is_coincident(thisseglistdict, keys = offset_vector.keys()): # # object is coincident with bin2 # coinc2 = 1 bin2.objects.append(cache) # # end loop if known to be coincident with both # bins # if coinc1 and coinc2: break # # clear offsets applied to object # thisseglistdict.offsets.clear() # # clear offsets applied to bins # bin1.size.offsets.clear() bin2.size.offsets.clear() # # append smaller bins to list of bins # cafepacker.bins.append(bin1) cafepacker.bins.append(bin2) # # do not increment idx as we popped the large bin out of # cafepacker.bins # # # sort the bins in cafepacker # cafepacker.bins.sort() return cafepacker | 4a884fa265544fa4242befa60915a19c7bcfebb7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/4a884fa265544fa4242befa60915a19c7bcfebb7/ligolw_cafe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1416,
67,
11862,
12,
71,
1727,
881,
484,
264,
16,
11933,
3595,
4672,
3536,
5385,
8963,
434,
4041,
316,
385,
2513,
4420,
264,
3180,
1517,
4158,
711,
392,
11933,
1158,
7144,
2353,
11933,
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,
1416,
67,
11862,
12,
71,
1727,
881,
484,
264,
16,
11933,
3595,
4672,
3536,
5385,
8963,
434,
4041,
316,
385,
2513,
4420,
264,
3180,
1517,
4158,
711,
392,
11933,
1158,
7144,
2353,
11933,
3... |
return os.path.join(self.oobdir, name) | return os.path.join(self.oob_dir, name) | def oob_file(self, name): return os.path.join(self.oobdir, name) | 14a87ec5854d72b6b9ed3ff1d721be21db881ad7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/373/14a87ec5854d72b6b9ed3ff1d721be21db881ad7/task.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
320,
947,
67,
768,
12,
2890,
16,
508,
4672,
327,
1140,
18,
803,
18,
5701,
12,
2890,
18,
83,
947,
1214,
16,
508,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
320,
947,
67,
768,
12,
2890,
16,
508,
4672,
327,
1140,
18,
803,
18,
5701,
12,
2890,
18,
83,
947,
1214,
16,
508,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
""" created = self.__openSession() res = self.getUserDirectory(username) if not res['OK']: return res failed = {} for username,error in res['Value']['Failed'].items(): | """ created = self.__openSession() res = self.getUserDirectory( username ) if not res['OK']: return res failed = {} for username, error in res['Value']['Failed'].items(): | def removeUserDirectory(self,username): """ Remove the user directory and remove the user mapping """ created = self.__openSession() res = self.getUserDirectory(username) if not res['OK']: return res failed = {} for username,error in res['Value']['Failed'].items(): failed[username] = error directoriesToRemove = {} successful = {} for username,directory in res['Value']['Successful'].items(): if not directory: successful[username] = True else: directoriesToRemove[directory] = username res = self.removeDirectory(directoriesToRemove.keys()) if not res['OK']: return res for directory,error in res['Value']['Failed'].items(): failed[directoriesToRemove[directory]] = error for directory,success in res['Value']['Successful'].items(): successful[directoriesToRemove[directory]] = True if created: self.__closeSession() resDict = {'Failed':failed,'Successful':successful} return S_OK(resDict) | 6280f3782654b93320f684f56a83a6624459bcec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/6280f3782654b93320f684f56a83a6624459bcec/LcgFileCatalogClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
1299,
2853,
12,
2890,
16,
5053,
4672,
3536,
3581,
326,
729,
1867,
471,
1206,
326,
729,
2874,
3536,
2522,
273,
365,
16186,
3190,
2157,
1435,
400,
273,
365,
18,
588,
1299,
2853,
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,
1206,
1299,
2853,
12,
2890,
16,
5053,
4672,
3536,
3581,
326,
729,
1867,
471,
1206,
326,
729,
2874,
3536,
2522,
273,
365,
16186,
3190,
2157,
1435,
400,
273,
365,
18,
588,
1299,
2853,
12,
... |
self.__getWidget("vpaned_main").set_position(wheight-250) | def __init__(self): self.__device_engine = None self.transfer_manager = None self.__current_mode = None self.__current_folder = None | c53ab5980eab6bc66121ddbad3807ad1581e7164 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2271/c53ab5980eab6bc66121ddbad3807ad1581e7164/MTPnavigatorGui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
365,
16186,
5964,
67,
8944,
273,
599,
365,
18,
13866,
67,
4181,
273,
599,
365,
16186,
2972,
67,
3188,
273,
599,
365,
16186,
2972,
67,
5609,
273,
599,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
365,
16186,
5964,
67,
8944,
273,
599,
365,
18,
13866,
67,
4181,
273,
599,
365,
16186,
2972,
67,
3188,
273,
599,
365,
16186,
2972,
67,
5609,
273,
599,
2... | |
for typ in [l[0] for l in listes.LISTE_TYPES]: | for typ in [l[0] for l in LISTE_TYPES]: | def detail_module(request): # récup visiteur v = request.session['v'] # utilisateur uid = request.GET['id'] try: u = Utilisateur.objects.get(id=uid) except Utilisateur.DoesNotExist: HttpResponseRedirect(reverse('v_home')) # module demandé id_mod = request.GET['mid'] try: m = Module.objects.get(id=id_mod) except Module.DoesNotExist: HttpResponseRedirect(reverse('v_home')) # recup cours auquel le module appartient id_cours = request.GET['cid'] try: c = Cours.objects.get(id=id_cours) except Cours.DoesNotExist: HttpResponseRedirect(reverse('v_home')) m.title = m.titre(langue=u.langue) m.valide = u.module_is_valide(m) if u.echeance(c,m): m.echeance = u.echeance(c,m).echeance if m.valide: m.datev = u.valide_set.get(module=m).date m.retard = m.echeance < m.datev else: m.retard = m.echeance < datetime.datetime.now() else: m.echeance = '' m.retard = False if m.valide: m.datev = u.valide_set.get(module=m).date m.docs = [] for typ in [l[0] for l in listes.LISTE_TYPES]: try: d = m.contenu_set.get(type=typ,langue=u.langue) except Contenu.DoesNotExist: try: d = m.contenu_set.get(type=typ,langue='fr') except Contenu.DoesNotExist: continue d.img = "/media/img/%s.png" % d.type if d.type in ('htm','swf'): d.nbconsult, d.lastconsult = u.stats_contenu(d) m.docs.append(d) m.tests = [] if not u.groupe.is_demo: for t in m.granule_set.all(): t.title = t.titre(langue=u.langue) t.nbtries = u.nb_essais(t) t.lastdate, t.lastscore = u.last_score(t) t.bestdate, t.bestscore = u.best_score(t) t.validdate, t.validscore = u.valid_score(t) m.tests.append(t) v.lastw = datetime.datetime.now() request.session['v'] = v v.save() return render_to_response('coaching/detail_module.html', {'visiteur': v.prenom_nom(), 'client': v.groupe.client, 'staff': v.status==STAFF, 'vgroupe': v.groupe, 'u': u, 'module': m }) | 0ed4a616ddb469b61b24b67392e00ccf2c2d793f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11552/0ed4a616ddb469b61b24b67392e00ccf2c2d793f/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7664,
67,
2978,
12,
2293,
4672,
468,
436,
132,
107,
71,
416,
2281,
1137,
295,
331,
273,
590,
18,
3184,
3292,
90,
3546,
468,
1709,
24954,
4555,
273,
590,
18,
3264,
3292,
350,
3546,
775,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7664,
67,
2978,
12,
2293,
4672,
468,
436,
132,
107,
71,
416,
2281,
1137,
295,
331,
273,
590,
18,
3184,
3292,
90,
3546,
468,
1709,
24954,
4555,
273,
590,
18,
3264,
3292,
350,
3546,
775,... |
def _read_flat(self, cursor, user, ids, fields_names, context=None, load='_classic_read'): selection_obj = self.pool.get('analytic_account.account.selection') res = super(InvoiceLine, self)._read_flat(cursor, user, ids, fields_names, context=context, load=load) | def read(self, cursor, user, ids, fields_names=None, context=None): selection_obj = self.pool.get('analytic_account.account.selection') int_id = False if isinstance(ids, (int, long)): int_id = True ids = [ids] res = super(InvoiceLine, self).read(cursor, user, ids, fields_names=fields_names, context=context) if not fields_names: fields_names = list(set(self._columns.keys() \ + self._inherit_fields.keys())) | def _read_flat(self, cursor, user, ids, fields_names, context=None, load='_classic_read'): selection_obj = self.pool.get('analytic_account.account.selection') res = super(InvoiceLine, self)._read_flat(cursor, user, ids, fields_names, context=context, load=load) | e22dad79d3ab663087ccc80281487ff1686cbc13 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9278/e22dad79d3ab663087ccc80281487ff1686cbc13/invoice.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
896,
67,
15401,
12,
2890,
16,
3347,
16,
729,
16,
3258,
16,
1466,
67,
1973,
16,
819,
33,
7036,
16,
1262,
2218,
67,
1106,
335,
67,
896,
11,
4672,
4421,
67,
2603,
273,
365,
18,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
896,
67,
15401,
12,
2890,
16,
3347,
16,
729,
16,
3258,
16,
1466,
67,
1973,
16,
819,
33,
7036,
16,
1262,
2218,
67,
1106,
335,
67,
896,
11,
4672,
4421,
67,
2603,
273,
365,
18,
6... |
title = obj.getTitle() or '' desc = obj.getRawDescription() or '' filename = obj.getFilename() or '' | title = obj.getTitle() or u'' desc = obj.getRawDescription() or u'' filename = filenameToUnicode(obj.getFilename()) or u'' | def matchingItems(obj, searchString): from miro import search if searchString is None: return True searchString = searchString.lower() title = obj.getTitle() or '' desc = obj.getRawDescription() or '' filename = obj.getFilename() or '' if search.match (searchString, [title.lower(), desc.lower(), filename.lower()]): return True if not obj.isContainerItem: parent = obj.getParent() if parent != obj: return matchingItems (parent, searchString) return False | 7214014ef6bdf85e005b52f8aaedcad6dbcb8a5c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12354/7214014ef6bdf85e005b52f8aaedcad6dbcb8a5c/filters.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3607,
3126,
12,
2603,
16,
1623,
780,
4672,
628,
312,
11373,
1930,
1623,
309,
1623,
780,
353,
599,
30,
327,
1053,
1623,
780,
273,
1623,
780,
18,
8167,
1435,
2077,
273,
1081,
18,
588,
42... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3607,
3126,
12,
2603,
16,
1623,
780,
4672,
628,
312,
11373,
1930,
1623,
309,
1623,
780,
353,
599,
30,
327,
1053,
1623,
780,
273,
1623,
780,
18,
8167,
1435,
2077,
273,
1081,
18,
588,
42... |
'Create HTML from active file') | 'Create HTML from active file') | def init_menubar(self): self.mainmenu = wxMenuBar() mainwindow = self | 3ba07fe9c5b636ef447aa47e40d9f258c1d32e0a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1278/3ba07fe9c5b636ef447aa47e40d9f258c1d32e0a/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
67,
27617,
373,
297,
12,
2890,
4672,
365,
18,
5254,
5414,
273,
7075,
4599,
5190,
1435,
2774,
5668,
273,
365,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1208,
67,
27617,
373,
297,
12,
2890,
4672,
365,
18,
5254,
5414,
273,
7075,
4599,
5190,
1435,
2774,
5668,
273,
365,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
else | else: | def __init__(data = None) if data == None: quickfix.StringField.__init__(self, 3) else quickfix.StringField.__init__(self, 3, data) | 484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
780,
974,
16186,
2738,
972,
12,
2890,
16,
890,
13,
469,
30,
9549,
904,
18,
780,
974,
16186,
2738,
972,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
780,
974,
16186,
2738,
972,
12,
2890,
16,
890,
13,
469,
30,
9549,
904,
18,
780,
974,
16186,
2738,
972,
... |
r1 = ndimage.correlate(a, filter_ * footprint) / 5 | r1 = ndimage.correlate(a, filter_ * footprint) r1 /= 5 | def _filter_func(buffer, weights, total = 1.0): weights = cf / total return (buffer * weights).sum() | be4495bd7d5ff0a88a161beb747f9a0abf7fd804 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12971/be4495bd7d5ff0a88a161beb747f9a0abf7fd804/test_ndimage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2188,
67,
644,
12,
4106,
16,
5376,
16,
2078,
273,
404,
18,
20,
4672,
5376,
273,
6080,
342,
2078,
327,
261,
4106,
380,
5376,
2934,
1364,
1435,
2,
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,
389,
2188,
67,
644,
12,
4106,
16,
5376,
16,
2078,
273,
404,
18,
20,
4672,
5376,
273,
6080,
342,
2078,
327,
261,
4106,
380,
5376,
2934,
1364,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100... |
if distance<=20000: | if distance<=5000: | def drawRegionAroundThisSNP(self, phenotype_method_id, this_snp, candidate_gene_set, gene_annotation, snp_info, analysis_method_id2gwr, \ LD_info, output_dir, which_LD_statistic, snp_region=None, min_distance=40000, list_type_id=None, label_gene=0, draw_LD_relative_to_center_SNP=0, commit=0, snpData=None, phenData=None, ecotype_info=None,\ snpData_before_impute=None, snp_matrix_data_type=1): """ 2009-4-30 deal with argument snp_matrix_data_type =4 (arbitrary non-diallelic SNP matrix) could handle both (chr,pos) and (chr,pos,offset) SNP representation skip drawing gene models if no SNPs in the region at all. return None if no SNPs are found in the region. 2009-3-23 add arguments snp_matrix_data_type to allow CNV or CNV amplitude to fill the SNP matrix 2008-12-01 add option snpData_before_impute 2008-11-30 add code to replace axe_LD with axe_strain_pca, axe_snp_matrix, axe_map to demonstrate the haplotype structure, phenotype and geographic source of strains. 2008-10-24 handle option commit to return png_data & svg_data 2008-10-01 remove the frame of ax1 and add a grid to ax1 leave axe_gene_model's xticks there as otherwise ax1's xticks will go with it as they share xticks. 2008-10-01 draw gene models on a separate axe, add a twinx axe to draw LD w.r.t the center SNP if output_dir is not a directory, it's treated as a filename. 2008-09-24 """ sys.stderr.write("Drawing region ... \n") phenotype = Stock_250kDB.PhenotypeMethod.get(phenotype_method_id) if not os.path.isdir(output_dir): output_fname_prefix = output_dir else: #list_type = Stock_250kDB.GeneListType.get(list_type_id) fname_basename = 'snp_%s_%s_id_%s_phenotype_%s_%s'%\ (this_snp.chromosome, this_snp.position, this_snp.snps_id, phenotype.id, phenotype.short_name) fname_basename = fname_basename.replace('/', '_') output_fname_prefix = os.path.join(output_dir, fname_basename) if snp_region: snps_within_this_region = snp_region elif getattr(this_snp, 'stop', None): snps_within_this_region = self.findSNPsInRegion(snp_info, this_snp.chromosome, this_snp.position, this_snp.stop) snps_within_this_region_snpData = self.findSNPsInRegion(snpData, this_snp.chromosome, this_snp.position, this_snp.stop) else: snps_within_this_region = self.getSNPsAroundThisSNP(this_snp, snp_info, min_distance) snps_within_this_region_snpData = snps_within_this_region if len(snps_within_this_region.chr_pos_ls)==0 and len(snps_within_this_region_snpData.chr_pos_ls)==0: return None pylab.clf() #fig = pylab.figure() axe_y_offset1 = 0.05 #y_offset for axe_LD, axe_strain_pca, axe_phenotype, axe_map axe_height1 = 0.55 #height of axe_LD or axe_snp_matrix axe_y_offset2 = axe_y_offset1+axe_height1 axe_height2 = 0.1 #height of axe_gene_model axe_y_offset3 = axe_y_offset2+axe_height2 axe_height3 = 0.25 #height of ax1 axe_y_offset4 = axe_y_offset3+axe_height3 axe_x_offset1 = 0.02 # axe_width1 = 0.2 #width of axe_strain_pca axe_x_offset2 = axe_x_offset1 + axe_width1 axe_width2 = 0.55 #width of ax1, axe_LD, or axe_snp_matrix axe_x_offset3 = axe_x_offset2 + axe_width2 axe_width3 = 0.02 #width of axe_phenotype axe_x_offset4 = axe_x_offset3 + axe_width3 axe_width4 = 0.2 #width of axe_map, axe_map_frame axe_x_offset5 = axe_x_offset4 + axe_width4 no_of_axes_drawn = 0 ax1 = pylab.axes([axe_x_offset2, axe_y_offset3, axe_width2, axe_height3], frameon=False) #left gap, bottom gap, width, height, axes for pvalue, gene models ax1.grid(True, alpha=0.3) ax1.set_xticklabels([]) #remove xtick labels on ax1 because axe_LD's xtick labels cover this. axe_LD_center_SNP = pylab.twinx() #axes for LD with center SNP, copy ax1's axe_LD_center_SNP.set_xticklabels([]) axe_gene_model = pylab.axes([axe_x_offset2, axe_y_offset2, axe_width2, axe_height2], frameon=False, sharex=ax1) #axe_gene_model.set_xticks([]) #this will set ax1's xticks off as well because the x-axis is shared. axe_gene_model.set_yticks([]) snp_region_tup = [snps_within_this_region_snpData.chr_pos_ls[0][0], snps_within_this_region_snpData.chr_pos_ls[0][1],\ snps_within_this_region_snpData.chr_pos_ls[-1][0], snps_within_this_region_snpData.chr_pos_ls[-1][1]] axe_snp_matrix_margin = abs(snp_region_tup[3]-snp_region_tup[1])/15. #offset to push strain labels on even rows further right if LD_info: axe_LD = pylab.axes([axe_x_offset2, axe_y_offset1, axe_width2, axe_height1], frameon=False) #axes for LD axe_LD_legend = pylab.axes([axe_x_offset3-0.1, axe_y_offset1+0.03, 0.1, 0.13], frameon=False) #axes for the legend of LD axe_LD_legend.set_xticks([]) axe_LD_legend.set_yticks([]) axe_to_put_pvalue_legend = axe_LD legend_loc = 'lower left' axe_pvalue_xlim = [snp_region_tup[1]-axe_snp_matrix_margin, snp_region_tup[3]+axe_snp_matrix_margin] elif snpData: phenotype_col_index = PlotGroupOfSNPs.findOutWhichPhenotypeColumn(phenData, Set([phenotype_method_id]))[0] genome_wide_result = analysis_method_id2gwr.get(1) if not genome_wide_result: sys.stderr.write("No genome association results for phenotype_method_id=%s, analysis_method_id=%s. Take a random one out of analysis_method_id2gwr.\n"%\ (phenotype_method_id, 1)) genome_wide_result = analysis_method_id2gwr.values()[0] #take random gwr if snp_matrix_data_type==1: chr_pos_ls = None else: chr_pos_ls = snpData.chr_pos2index.keys() #2008-12-08 for CNV probes. use snpData.chr_pos2index.keys() to locate top_snp_data because here snpData doesn't match genome_wide_result. top_snp_data = self.getTopSNPData(genome_wide_result, None, snp_region_tup, chr_pos_ls=chr_pos_ls) if snp_matrix_data_type==3: #2009-3-23 for CNV amplitude data, don't convert alleles into binary 0/1=major/minor form and use allele/amplitude to determine alpha need_convert_alleles2binary = False useAlleleToDetermineAlpha = True elif snp_matrix_data_type==4: #2009-3-27, for arbitrary non-diallelic SNP matrix need_convert_alleles2binary = False useAlleleToDetermineAlpha = False else: need_convert_alleles2binary = True useAlleleToDetermineAlpha = False subSNPData = self.getSubStrainSNPMatrix(snpData, phenData, phenotype_method_id, phenotype_col_index, top_snp_data.snp_id_ls, need_convert_alleles2binary=need_convert_alleles2binary) #2009-3-23 last argument is for CNV intensity matrix snp_value2color = None if snp_matrix_data_type==4: ##2009-3-27 it's for SNP matrix inferred from raw sequences, might have >2 alleles, heterozygous calls, deletions etc. from DrawSNPMatrix import DrawSNPMatrix subSNPData.data_matrix = DrawSNPMatrix.transformMatrixIntoTwoAllelesAndHetero(subSNPData.data_matrix) snp_value2color = self.snp_value2five_color #the two offsets below decides where the label of strains/snps should start in axe_snp_matrix last_chr_pos = snps_within_this_region_snpData.chr_pos_ls[-1] strain_id_label_x_offset=snps_within_this_region_snpData.chr_pos2adjacent_window[last_chr_pos][1] #right next to the rightmost SNP snp_id_label_y_offset=0.95 StrainID2PCAPosInfo = self.getStrainID2PCAPosInfo(subSNPData, pca_range=[0,1], snp_id_label_y_offset=snp_id_label_y_offset) #fake one SNPID2PCAPosInfo only for drawSNPMtrix() SNPID2PCAPosInfo = PassingData(step=None, snp_id2img_x_pos={}) for chr_pos, adjacent_window in snps_within_this_region_snpData.chr_pos2adjacent_window.iteritems(): chr_pos = map(str, chr_pos) snp_id = '_'.join(chr_pos) SNPID2PCAPosInfo.snp_id2img_x_pos[snp_id] = adjacent_window phenotype_cmap = mpl.cm.jet max_phenotype = numpy.nanmax(phenData.data_matrix[:,phenotype_col_index]) min_phenotype = numpy.nanmin(phenData.data_matrix[:,phenotype_col_index]) phenotype_gap = max_phenotype - min_phenotype phenotype_jitter = phenotype_gap/10. phenotype_norm = mpl.colors.Normalize(vmin=min_phenotype-phenotype_jitter, vmax=max_phenotype+phenotype_jitter) axe_map_phenotype_legend = pylab.axes([axe_x_offset4+0.02, axe_y_offset1, axe_width4-0.02, axe_height1/10.], frameon=False) cb = mpl.colorbar.ColorbarBase(axe_map_phenotype_legend, cmap=phenotype_cmap, norm=phenotype_norm, orientation='horizontal') cb.set_label('Phenotype Legend On the Map') axe_strain_map = None #no strain map axe_strain_pca = pylab.axes([axe_x_offset1, axe_y_offset1, axe_width1, axe_height1], frameon=False) axe_strain_map_pca_cover = None #not used. axe_strain_pca_xlim = [-0.05,1.05] axe_strain_pca_ylim = [0, 1] axe_strain_pca.set_xlim(axe_strain_pca_xlim) axe_strain_pca.set_ylim(axe_strain_pca_ylim) axe_strain_pca.grid(True, alpha=0.3) axe_strain_pca.set_xticks([]) axe_strain_pca.set_yticks([]) axe_strain_pca_legend =None self.drawStrainPCA(axe_strain_pca, axe_strain_map, axe_strain_map_pca_cover, axe_strain_pca_legend, StrainID2PCAPosInfo, \ ecotype_info, phenData, \ phenotype_col_index, phenotype_cmap, phenotype_norm, rightmost_x_value=axe_strain_pca_xlim[1],\ country_order_name='', strain_color_type=2, draw_axe_strain_map=False) axe_strain_pca.set_xlim(axe_strain_pca_xlim) axe_strain_pca.set_ylim(axe_strain_pca_ylim) no_of_axes_drawn += 1 if self.debug: pylab.savefig('%s_%s.png'%(output_fname_prefix, no_of_axes_drawn), dpi=400) #mark ecotypes on the map colored according to phenotype axe_map = pylab.axes([axe_x_offset4, axe_y_offset1, axe_width4, axe_height1], frameon=False) #axe_map_frame is used to connect strains from axe_phenotype to dot on the axe_map (another axe due to reasons stated in drawMap()) axe_map_frame = pylab.axes([axe_x_offset4, axe_y_offset1, axe_width4, axe_height1], frameon=False, sharey=axe_strain_pca) axe_map_frame.set_xticks([]) axe_map_frame.set_yticks([]) self.drawMap(axe_map_frame, axe_map, StrainID2PCAPosInfo, phenData, phenotype_col_index, phenotype_method_id, \ ecotype_info, phenotype_cmap, phenotype_norm) #axe_map.set_ylim([0,1]) no_of_axes_drawn += 1 if self.debug: pylab.savefig('%s_%s.png'%(output_fname_prefix, no_of_axes_drawn), dpi=400) axe_snp_matrix = pylab.axes([axe_x_offset2, axe_y_offset1, axe_width2, axe_height1], frameon=False, sharey=axe_strain_pca) #axe_snp_matrix.set_xticks([]) axe_snp_matrix.set_yticks([]) self.drawSNPMtrix(axe_snp_matrix, subSNPData, top_snp_data, StrainID2PCAPosInfo, SNPID2PCAPosInfo, \ ecotype_info, strain_id_label_x_offset, snp_id_label_y_offset, strain_id_label_x_offset_extra=axe_snp_matrix_margin,\ draw_snp_id_label=False, snpData_before_impute=snpData_before_impute, \ useAlleleToDetermineAlpha=useAlleleToDetermineAlpha,\ snp_value2color=snp_value2color) #2008-11-14 turn draw_snp_id_label off #axe_snp_matrix.set_xlim([0,1]) #axe_snp_matrix.set_ylim([0,1]) no_of_axes_drawn += 1 #pylab.savefig('%s_%s.png'%(self.output_fname_prefix, no_of_axes_drawn), dpi=400) axe_phenotype = pylab.axes([axe_x_offset3, axe_y_offset1, axe_width3, axe_height1], frameon=False, sharey=axe_snp_matrix) axe_phenotype.set_yticks([]) axe_phenotype.set_xticklabels([]) #no tick labels (axe_map_phenotype_legend has it already) self.drawPhenotype(axe_phenotype, StrainID2PCAPosInfo, phenData, phenotype_col_index, phenotype_method_id, ecotype_info) no_of_axes_drawn += 1 axe_phenotype.set_ylim([0,1]) axe_snp_matrix.set_ylim([0,1]) #without this, ylim of all 3 axes are set to [0,0.9] because axe_map automatically adjust to 0-0.9 #pylab.savefig('%s_%s.png'%(self.output_fname_prefix, no_of_axes_drawn), dpi=400) axe_to_put_pvalue_legend = ax1 #axe_LD is gone. put legend into ax1 itself. legend_loc = 'upper right' axe_LD = None axe_LD_legend = None axe_pvalue_xlim = [snp_region_tup[1]-axe_snp_matrix_margin, snp_region_tup[3]+axe_snp_matrix_margin*2] fig_title = 'SNP chr %s. pos %s.'%(this_snp.chromosome, this_snp.position) if getattr(this_snp, 'stop', None): fig_title += ' - %s. '%this_snp.stop fig_title += "Phenotype %s (id=%s)."%(phenotype.short_name, phenotype.id) ax1.title.set_text(fig_title) #main title using this snp. self.drawPvalue(ax1, axe_to_put_pvalue_legend, axe_LD_center_SNP, snps_within_this_region, analysis_method_id2gwr, LD_info, \ which_LD_statistic, draw_LD_relative_to_center_SNP=draw_LD_relative_to_center_SNP, legend_loc=legend_loc) gene_position_cycle = 5 base_y_value = 1 gene_width=0.8 gene_box_text_gap = min_distance*2*0.005 skip_gene_model = False if len(snps_within_this_region.chr_pos_ls)>0: _snps_within_this_region = snps_within_this_region elif len(snps_within_this_region_snpData.chr_pos_ls)>0: _snps_within_this_region = snps_within_this_region_snpData else: skip_gene_model = True if not skip_gene_model: return_data = self.drawGeneModel(axe_gene_model, _snps_within_this_region, gene_annotation, \ candidate_gene_set, gene_width=gene_width, gene_position_cycle=gene_position_cycle, \ base_y_value=base_y_value, gene_box_text_gap=gene_box_text_gap,\ label_gene=label_gene) matrix_of_gene_descriptions = return_data.matrix_of_gene_descriptions gene_model_min_y = base_y_value-gene_width gene_model_max_y = gene_position_cycle + base_y_value -1 + gene_width #"-1" because genes never sit on y=gene_position_cycle + base_y_value if not skip_gene_model: self.drawLD(axe_gene_model, axe_LD, _snps_within_this_region, LD_info, gene_model_min_y=gene_model_min_y,\ gene_model_max_y=gene_model_max_y, which_LD_statistic=which_LD_statistic) if LD_info: self.drawLDLegend(axe_LD_legend, which_LD_statistic) #adjust x, y limits and etc ax1.set_xlim(axe_pvalue_xlim) ax1_ylim = ax1.get_ylim() ax1.set_ylim((0, ax1_ylim[1])) #set ax1 to 0 to sit right above axe_gene_model axe_gene_model.set_ylim((gene_model_min_y, gene_model_max_y)) #LD panel right under gene models if LD_info: axe_LD.set_xlim(ax1.get_xlim()) #make the axe_LD and ax1 within the same X range axe_LD_x_span = (axe_LD.get_xlim()[1]-axe_LD.get_xlim()[0]) axe_LD.set_ylim((-axe_LD_x_span/2., 0)) #has to force here, don't know why. otherwise it's (0,1) axe_LD.set_yticks([]) #remove all Y ticks on LD plot elif snpData: axe_snp_matrix.set_xlim(ax1.get_xlim()) png_data = None svg_data = None png_output_fname = None if len(snps_within_this_region.chr_pos_ls)>0: distance = abs(snps_within_this_region.chr_pos_ls[-1][1] - snps_within_this_region.chr_pos_ls[0][1]) elif len(snps_within_this_region_snpData.chr_pos_ls)>0: distance = abs(snps_within_this_region_snpData.chr_pos_ls[-1][1] - snps_within_this_region_snpData.chr_pos_ls[0][1]) else: distance = 0 if commit: #2008-10-24 png_data = StringIO.StringIO() svg_data = StringIO.StringIO() pylab.savefig(png_data, format='png', dpi=600) if distance<=20000: #save the svg format if less than 80kb pylab.savefig(svg_data, format='svg', dpi=300) else: png_output_fname = '%s.png'%output_fname_prefix pylab.savefig(png_output_fname, dpi=600) if distance<=20000: #save the svg format if less than 80kb pylab.savefig('%s.svg'%output_fname_prefix, dpi=300) if self.debug: pylab.show() del ax1, axe_LD_center_SNP, axe_gene_model, axe_LD, axe_LD_legend sys.stderr.write("Done.\n") after_plot_data = PassingData(png_output_fname=png_output_fname, matrix_of_gene_descriptions=matrix_of_gene_descriptions, \ png_data=png_data,\ svg_data=svg_data,\ snps_within_this_region=snps_within_this_region) return after_plot_data | bdc3752350001c791e90fb2760fcc0578318b113 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9645/bdc3752350001c791e90fb2760fcc0578318b113/DrawSNPRegion.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
5165,
30022,
2503,
13653,
52,
12,
2890,
16,
28825,
67,
2039,
67,
350,
16,
333,
67,
87,
6782,
16,
5500,
67,
11857,
67,
542,
16,
7529,
67,
11495,
16,
28648,
67,
1376,
16,
6285,
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,
3724,
5165,
30022,
2503,
13653,
52,
12,
2890,
16,
28825,
67,
2039,
67,
350,
16,
333,
67,
87,
6782,
16,
5500,
67,
11857,
67,
542,
16,
7529,
67,
11495,
16,
28648,
67,
1376,
16,
6285,
6... |
register_exception(req=Null, | register_exception(req=None, | def put_css_in_file(html_message, journal_name): """ Takes an external css file and puts all the content of it in the head of an HTML file in style tags. (Used for HTML emails) """ config_strings = get_xml_from_config(["screen"], journal_name) try: css_path = config_strings["screen"][0] except: register_exception(req=Null, suffix="No css file for journal %s. Is this right?" % journal_name) return css_file = urlopen('%s/%s' % (weburl, css_path)) css = css_file.read() css = make_full_paths_in_css(css, journal_name) html_parted = html_message.split("</head>") if len(html_parted) > 1: html = '%s<style type="text/css">%s</style></head>%s' % (html_parted[0], css, html_parted[1]) else: html_parted = html_message.split("<html>") if len(html_parted) > 1: html = '%s<html><head><style type="text/css">%s</style></head>%s' % (html_parted[0], css, html_parted[1]) else: return return html | 07136f2983389563a1038c9139fc73a3a3e4319d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/07136f2983389563a1038c9139fc73a3a3e4319d/webjournal_utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1378,
67,
5212,
67,
267,
67,
768,
12,
2620,
67,
2150,
16,
13001,
67,
529,
4672,
3536,
23004,
392,
3903,
3747,
585,
471,
8200,
777,
326,
913,
434,
518,
316,
326,
910,
434,
392,
3982,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1378,
67,
5212,
67,
267,
67,
768,
12,
2620,
67,
2150,
16,
13001,
67,
529,
4672,
3536,
23004,
392,
3903,
3747,
585,
471,
8200,
777,
326,
913,
434,
518,
316,
326,
910,
434,
392,
3982,
... |
for user_id in users_online: | for user_id in users_online.keys(): | def process_request(self, request): now = datetime.now() delta = now - timedelta(minutes=forum_settings.USER_ONLINE_TIMEOUT) users_online = cache.get('users_online', {}) guests_online = cache.get('guests_online', {}) | f6fcd3de0ec7ab9a4ea2399356c74fa9b2498c8a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13701/f6fcd3de0ec7ab9a4ea2399356c74fa9b2498c8a/middleware.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
2293,
12,
2890,
16,
590,
4672,
2037,
273,
3314,
18,
3338,
1435,
3622,
273,
2037,
300,
10661,
12,
17916,
33,
11725,
67,
4272,
18,
4714,
67,
673,
5997,
67,
9503,
13,
3677,
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,
1207,
67,
2293,
12,
2890,
16,
590,
4672,
2037,
273,
3314,
18,
3338,
1435,
3622,
273,
2037,
300,
10661,
12,
17916,
33,
11725,
67,
4272,
18,
4714,
67,
673,
5997,
67,
9503,
13,
3677,
67,
... |
self.run("/usr/sbin/update-rc.d %s defaults", name) | self.run("/usr/sbin/update-rc.d %s defaults" % name) | def add_init_script(self, file, name): """ Add this file to the init.d directory """ f_path = os.path.join("/etc/init.d", name) f = open(f_path, "w") f.write(file) f.close() os.chmod(f_path, stat.S_IREAD| stat.S_IWRITE | stat.S_IEXEC) self.run("/usr/sbin/update-rc.d %s defaults", name) | 48fa517353691fcb4e9d77a9af4d89219451fd2c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1098/48fa517353691fcb4e9d77a9af4d89219451fd2c/installer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
2738,
67,
4263,
12,
2890,
16,
585,
16,
508,
4672,
3536,
1436,
333,
585,
358,
326,
1208,
18,
72,
1867,
3536,
284,
67,
803,
273,
1140,
18,
803,
18,
5701,
2932,
19,
14175,
19,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
2738,
67,
4263,
12,
2890,
16,
585,
16,
508,
4672,
3536,
1436,
333,
585,
358,
326,
1208,
18,
72,
1867,
3536,
284,
67,
803,
273,
1140,
18,
803,
18,
5701,
2932,
19,
14175,
19,
... |
if scanner.real == 0: | if nrg == 0: | def doshield(shraise): "Change shield status." action = "NONE" game.ididit = False if shraise: action = "SHUP" else: key = scanner.next() if key == "IHALPHA": if scanner.sees("transfer"): action = "NRG" else: if damaged(DSHIELD): prout(_("Shields damaged and down.")) return if scanner.sees("up"): action = "SHUP" elif scanner.sees("down"): action = "SHDN" if action=="NONE": proutn(_("Do you wish to change shield energy? ")) if ja() == True: proutn(_("Energy to transfer to shields- ")) action = "NRG" elif damaged(DSHIELD): prout(_("Shields damaged and down.")) return elif game.shldup: proutn(_("Shields are up. Do you want them down? ")) if ja() == True: action = "SHDN" else: scanner.chew() return else: proutn(_("Shields are down. Do you want them up? ")) if ja() == True: action = "SHUP" else: scanner.chew() return if action == "SHUP": # raise shields if game.shldup: prout(_("Shields already up.")) return game.shldup = True game.shldchg = True if game.condition != "docked": game.energy -= 50.0 prout(_("Shields raised.")) if game.energy <= 0: skip(1) prout(_("Shields raising uses up last of energy.")) finish(FNRG) return game.ididit=True return elif action == "SHDN": if not game.shldup: prout(_("Shields already down.")) return game.shldup=False game.shldchg=True prout(_("Shields lowered.")) game.ididit = True return elif action == "NRG": while scanner.next() != "IHREAL": scanner.chew() proutn(_("Energy to transfer to shields- ")) scanner.chew() if scanner.real == 0: return if scanner.real > game.energy: prout(_("Insufficient ship energy.")) return game.ididit = True if game.shield+scanner.real >= game.inshld: prout(_("Shield energy maximized.")) if game.shield+scanner.real > game.inshld: prout(_("Excess energy requested returned to ship energy")) game.energy -= game.inshld-game.shield game.shield = game.inshld return if scanner.real < 0.0 and game.energy-scanner.real > game.inenrg: # Prevent shield drain loophole skip(1) prout(_("Engineering to bridge--")) prout(_(" Scott here. Power circuit problem, Captain.")) prout(_(" I can't drain the shields.")) game.ididit = False return if game.shield+scanner.real < 0: prout(_("All shield energy transferred to ship.")) game.energy += game.shield game.shield = 0.0 return proutn(_("Scotty- \"")) if scanner.real > 0: prout(_("Transferring energy to shields.\"")) else: prout(_("Draining energy from shields.\"")) game.shield += scanner.real game.energy -= scanner.real return | a84cb603c99e0318fcbf80e75f88f0f3fbcca0aa /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3176/a84cb603c99e0318fcbf80e75f88f0f3fbcca0aa/sst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16153,
76,
491,
12,
674,
11628,
4672,
315,
3043,
699,
491,
1267,
1199,
1301,
273,
315,
9826,
6,
7920,
18,
350,
350,
305,
273,
1083,
309,
699,
11628,
30,
1301,
273,
315,
2664,
3079,
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,
16153,
76,
491,
12,
674,
11628,
4672,
315,
3043,
699,
491,
1267,
1199,
1301,
273,
315,
9826,
6,
7920,
18,
350,
350,
305,
273,
1083,
309,
699,
11628,
30,
1301,
273,
315,
2664,
3079,
6,
... |
else | else: | def __init__(data = None) if data == None: quickfix.DoubleField.__init__(self, 485) else quickfix.DoubleField.__init__(self, 485, data) | 484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
5265,
974,
16186,
2738,
972,
12,
2890,
16,
1059,
7140,
13,
469,
30,
9549,
904,
18,
5265,
974,
16186,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
5265,
974,
16186,
2738,
972,
12,
2890,
16,
1059,
7140,
13,
469,
30,
9549,
904,
18,
5265,
974,
16186,
27... |
def findTag (self, name, desc): | def findTag (self, name, desc=None): | def findTag (self, name, desc): query_serv = self.getQueryService() res = list() p = omero.sys.Parameters() p.map = {} p.map["text"] = rstring(str(name)) p.map["desc"] = rstring(str(desc)) #p.map["eid"] = rlong(self.getEventContext().userId) f = omero.sys.Filter() f.limit = rint(1) p.theFilter = f sql = "select tg from TagAnnotation tg " \ "where tg.textValue=:text and tg.description=:desc and tg.ns is null order by tg.textValue" res = query_serv.findAllByQuery(sql, p) if len(res) > 0: return AnnotationWrapper(self, res[0]) return None | 1ce7e853aa0b13a5b6801c8d05d7256f4ff67744 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12409/1ce7e853aa0b13a5b6801c8d05d7256f4ff67744/gateway.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
1805,
261,
2890,
16,
508,
16,
3044,
33,
7036,
4672,
843,
67,
23039,
273,
365,
18,
588,
1138,
1179,
1435,
400,
273,
666,
1435,
293,
273,
8068,
2439,
18,
9499,
18,
2402,
1435,
293,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
1805,
261,
2890,
16,
508,
16,
3044,
33,
7036,
4672,
843,
67,
23039,
273,
365,
18,
588,
1138,
1179,
1435,
400,
273,
666,
1435,
293,
273,
8068,
2439,
18,
9499,
18,
2402,
1435,
293,... |
if msg.get_content_type() == in ('application/tar', 'application/zip'): | if msg.get_content_type() == 'application/tar': | def handle_msg(self, msgno, msg): if msg.get_content_type() == in ('application/tar', 'application/zip'): logging.info('Received snapshot') workdir = tempfile.mkdtemp(prefix='bitten') archive_name = msg.get('Content-Disposition', 'snapshot.tar.gz') archive_path = os.path.join(workdir, archive_name) file(archive_path, 'wb').write(msg.get_payload()) logging.info('Stored snapshot archive at %s', archive_path) | 065a58ec57b89b6d9d5e50d92abd6f0e6203116e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4547/065a58ec57b89b6d9d5e50d92abd6f0e6203116e/slave.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
3576,
12,
2890,
16,
1234,
2135,
16,
1234,
4672,
309,
1234,
18,
588,
67,
1745,
67,
723,
1435,
422,
296,
3685,
19,
11718,
4278,
2907,
18,
1376,
2668,
8872,
4439,
6134,
22231,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
3576,
12,
2890,
16,
1234,
2135,
16,
1234,
4672,
309,
1234,
18,
588,
67,
1745,
67,
723,
1435,
422,
296,
3685,
19,
11718,
4278,
2907,
18,
1376,
2668,
8872,
4439,
6134,
22231,
2... |
sets up self.conf and self.cmds as well as logger objects | sets up self.conf and self.cmds as well as logger objects | def getOptionsConfig(self, args): """parses command line arguments, takes cli args: sets up self.conf and self.cmds as well as logger objects in base instance""" | d3c62f55995ac3abcfbda384fccc4f8da37dad23 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/34/d3c62f55995ac3abcfbda384fccc4f8da37dad23/cli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9849,
809,
12,
2890,
16,
833,
4672,
3536,
1065,
2420,
1296,
980,
1775,
16,
5530,
4942,
833,
30,
1678,
731,
365,
18,
3923,
471,
365,
18,
24680,
487,
5492,
487,
1194,
2184,
316,
1026,
79... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9849,
809,
12,
2890,
16,
833,
4672,
3536,
1065,
2420,
1296,
980,
1775,
16,
5530,
4942,
833,
30,
1678,
731,
365,
18,
3923,
471,
365,
18,
24680,
487,
5492,
487,
1194,
2184,
316,
1026,
79... |
size += len(field) | size += len(value) | def get_size( self ): """ Used for FTP and apparently the ZMI now too """ size = 0 for name in self.Schema().keys(): value = self[name] if IBaseUnit.isImplementedBy(value): size += field.get_size() else: try: size += len(field) except TypeError: pass | 04005869903a2b18b824df19d39ec59b5522f7af /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/04005869903a2b18b824df19d39ec59b5522f7af/BaseObject.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1467,
12,
365,
262,
30,
3536,
10286,
364,
19324,
471,
29614,
715,
326,
2285,
7492,
2037,
4885,
3536,
963,
273,
374,
364,
508,
316,
365,
18,
3078,
7675,
2452,
13332,
460,
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,
336,
67,
1467,
12,
365,
262,
30,
3536,
10286,
364,
19324,
471,
29614,
715,
326,
2285,
7492,
2037,
4885,
3536,
963,
273,
374,
364,
508,
316,
365,
18,
3078,
7675,
2452,
13332,
460,
273,
... |
return c, conflicts | last = c return last, conflicts | def applyUpstreamChangesets(self, root, module, changesets, applyable=None, replay=None, applied=None, logger=None, delayed_commit=False): """ Apply the collected upstream changes. | d1ea5b6fc5954ee7e1992e75b76eb4bb4a9e47fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5981/d1ea5b6fc5954ee7e1992e75b76eb4bb4a9e47fe/source.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
1211,
3256,
7173,
2413,
12,
2890,
16,
1365,
16,
1605,
16,
3478,
2413,
16,
2230,
429,
33,
7036,
16,
16033,
33,
7036,
16,
6754,
33,
7036,
16,
1194,
33,
7036,
16,
15278,
67,
7371,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
1211,
3256,
7173,
2413,
12,
2890,
16,
1365,
16,
1605,
16,
3478,
2413,
16,
2230,
429,
33,
7036,
16,
16033,
33,
7036,
16,
6754,
33,
7036,
16,
1194,
33,
7036,
16,
15278,
67,
7371,
... |
command = "nvcc --cuda " + options.arguments | if options.ptx: command = "nvcc --ptx " + options.arguments else: command = "nvcc --cuda " + options.arguments | def main(): parser = OptionParser() parser.add_option("-d", "--directory", action="store", default=".", dest="directory", help="The directory to run on.") parser.add_option("-a", "--arguments", action="store", default="-I ~/checkout/thrust -I ./sdk", dest="arguments", help="NVCC options.") parser.add_option("-c", "--clean", action="store_true", dest="clean", default=False, help="Delete all .cu.cpp files.") parser.add_option("-s", "--sanitize", action="store_true", dest="sanitize", default=False, help="Only sanitize .cu.cpp files.") (options, args) = parser.parse_args() command = "nvcc --cuda " + options.arguments path = os.getcwd() sources = getAllCudaSources(options.directory) if options.clean: clean(sources) elif options.sanitize: sanitizeSources(sources) else: compileSources(command, sources) sanitizeSources(sources) | 3531dff3318e49ba5a7525caed84e8171620ec0e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4467/3531dff3318e49ba5a7525caed84e8171620ec0e/CompileCudaTests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
2082,
273,
18862,
1435,
225,
2082,
18,
1289,
67,
3482,
2932,
17,
72,
3113,
5238,
5149,
3113,
1301,
1546,
2233,
3113,
805,
1546,
1199,
16,
1570,
1546,
5149,
3113,
2809,
1546,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
2082,
273,
18862,
1435,
225,
2082,
18,
1289,
67,
3482,
2932,
17,
72,
3113,
5238,
5149,
3113,
1301,
1546,
2233,
3113,
805,
1546,
1199,
16,
1570,
1546,
5149,
3113,
2809,
1546,
... |
btnBox.AddSpacer(4) | btnBox.AddSpacer((4, 4)) | def createOptionsFrame(self): """ Created: 03.11.2004, KP Description: Creates a frame that contains the various widgets used to control the colocalization settings """ GUI.FilterBasedTaskPanel.FilterBasedTaskPanel.createOptionsFrame(self) #self.panel=wx.Panel(self.settingsNotebook,-1) self.panel = wx.Panel(self, -1) self.panelsizer = wx.GridBagSizer() self.filtersizer = wx.GridBagSizer(4, 4) | 1700b123e079a29b8062f04ceab839eee34973a1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2877/1700b123e079a29b8062f04ceab839eee34973a1/ManipulationPanel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
1320,
3219,
12,
2890,
4672,
3536,
12953,
30,
17107,
18,
2499,
18,
6976,
24,
16,
1475,
52,
6507,
30,
10210,
279,
2623,
716,
1914,
326,
11191,
10965,
1399,
358,
3325,
326,
645,
23735,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1320,
3219,
12,
2890,
4672,
3536,
12953,
30,
17107,
18,
2499,
18,
6976,
24,
16,
1475,
52,
6507,
30,
10210,
279,
2623,
716,
1914,
326,
11191,
10965,
1399,
358,
3325,
326,
645,
23735,... |
self.staticControlDelegate = delegate | self.staticControlDelegate = staticControlDelegate | def __init__(self, delegate=None, *args, **kwargs): super(StringAttributeEditor, self).__init__(*args, **kwargs) self.staticControlDelegate = delegate | 7e26b9aa92a7aba337a0a352455dd52dc0b59b42 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/7e26b9aa92a7aba337a0a352455dd52dc0b59b42/AttributeEditors.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
7152,
33,
7036,
16,
380,
1968,
16,
2826,
4333,
4672,
2240,
12,
780,
1499,
6946,
16,
365,
2934,
972,
2738,
972,
30857,
1968,
16,
2826,
4333,
13,
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,
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,
7152,
33,
7036,
16,
380,
1968,
16,
2826,
4333,
4672,
2240,
12,
780,
1499,
6946,
16,
365,
2934,
972,
2738,
972,
30857,
1968,
16,
2826,
4333,
13,
365,
18,
... |
if theDate >= firstDate and theDate <= lastDate: | if theDate >= firstDate and theDate <= endDate: | def addTick(i, xVals=xVals, formatter=formatter, ticks=ticks, labels=labels): ticks.insert(0,xVals[i]) labels.insert(0,formatter(xVals[i])) | 4f7137b6a72dfea5cb32cca1dbed37762a7ec2d7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3878/4f7137b6a72dfea5cb32cca1dbed37762a7ec2d7/axes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
6264,
12,
77,
16,
619,
13169,
33,
92,
13169,
16,
4453,
33,
12354,
16,
13003,
33,
11767,
16,
3249,
33,
5336,
4672,
13003,
18,
6387,
12,
20,
16,
92,
13169,
63,
77,
5717,
3249,
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,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
6264,
12,
77,
16,
619,
13169,
33,
92,
13169,
16,
4453,
33,
12354,
16,
13003,
33,
11767,
16,
3249,
33,
5336,
4672,
13003,
18,
6387,
12,
20,
16,
92,
13169,
63,
77,
5717,
3249,
18,... |
index.exposed = True def default(self,ecomap_id,*args,**kwargs): ecomap_id = int(ecomap_id) try: self.ecomap = Ecomap.get(ecomap_id) except Exception, e: print e cherrypy.session['message'] = "invalid id" return httptools.redirect("/course") if len(args) == 0: return self.view_ecomap(**kwargs) action = args[0] dispatch = { 'delete' : self.delete, 'edit_form' : self.edit_form, 'edit' : self.edit, 'flash' : self.flash, } if dispatch.has_key(action): return dispatch[action](**kwargs) default.exposed = True def edit_form(self): defaults = {'name' : self.ecomap.name, 'description' : self.ecomap.description} | def query(self,id): return Ecomap.get(int(id)) @cherrypy.expose() def edit_form(self,ecomap): defaults = {'name' : ecomap.name, 'description' : ecomap.description} | def index(self): # this should really be a secured list of your ecomaps # it is a duplicate of the functionality of myList # it may be more appropriate to redirect to myList return self.template("list_ecomaps.pt",{'ecomaps' : [e for e in Ecomap.select()]}) | bd620ed6e7bc94139cb8bd730d5c5775ee916a14 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5854/bd620ed6e7bc94139cb8bd730d5c5775ee916a14/controllers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
770,
12,
2890,
4672,
468,
333,
1410,
8654,
506,
279,
1428,
2862,
666,
434,
3433,
425,
832,
6679,
468,
518,
353,
279,
6751,
434,
326,
14176,
434,
3399,
682,
468,
518,
2026,
506,
1898,
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,
770,
12,
2890,
4672,
468,
333,
1410,
8654,
506,
279,
1428,
2862,
666,
434,
3433,
425,
832,
6679,
468,
518,
353,
279,
6751,
434,
326,
14176,
434,
3399,
682,
468,
518,
2026,
506,
1898,
5... |
self.autoSendSelectionCallback = None | self.selectionChangedCallback = None | def __init__(self, parent = None, name = "None"): "Constructs the graph" QwtPlot.__init__(self, parent, name) self.parentName = name self.setWFlags(Qt.WResizeNoErase) #this works like magic.. no flicker during repaint! | b688d29474a63826ced75f81b2e2416316c3c6fd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6366/b688d29474a63826ced75f81b2e2416316c3c6fd/OWGraph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
273,
599,
16,
508,
273,
315,
7036,
6,
4672,
315,
13262,
326,
2667,
6,
2238,
6046,
11532,
16186,
2738,
972,
12,
2890,
16,
982,
16,
508,
13,
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,
1001,
2738,
972,
12,
2890,
16,
982,
273,
599,
16,
508,
273,
315,
7036,
6,
4672,
315,
13262,
326,
2667,
6,
2238,
6046,
11532,
16186,
2738,
972,
12,
2890,
16,
982,
16,
508,
13,
365,
18... |
self.m_f_pull_builtins_hack = f_pull_builtins_hack | self.m_builtins_hack = builtins_hack | def settrace(self, f = None, f_break_on_init = True, timeout = None, f_pull_builtins_hack = False): """ Start tracing mechanism for thread. """ if not self.m_ftrace: return tid = thread.get_ident() if tid in self.m_threads: return | 083f35804d1a92776e7df297bab8763f65ee36ef /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1662/083f35804d1a92776e7df297bab8763f65ee36ef/rpdb2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
5129,
12,
2890,
16,
284,
273,
599,
16,
284,
67,
8820,
67,
265,
67,
2738,
273,
1053,
16,
2021,
273,
599,
16,
284,
67,
13469,
67,
12406,
2679,
67,
76,
484,
273,
1083,
4672,
3536,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
5129,
12,
2890,
16,
284,
273,
599,
16,
284,
67,
8820,
67,
265,
67,
2738,
273,
1053,
16,
2021,
273,
599,
16,
284,
67,
13469,
67,
12406,
2679,
67,
76,
484,
273,
1083,
4672,
3536,
... |
x = int(x) elif isinstance(x, rational.Rational): | if isinstance(x, rational.Rational): | def __init__(self, parent, x, big_oh=infinity, ordp=None, construct=False): r""" INPUT: parent -- a p-adic field. x -- anything that can be coerced to a p-adic number. big_oh -- is such that, e.g. 3^(-1) + 1 + 2 * 3 + (3^2) has big_oh equal to 2. """ field_element.FieldElement.__init__(self, parent) if construct: self.__parent = parent (self.__p, self.__unit, self.__ordp, self.__prec) = x return if isinstance(x, pAdic): self.__parent = x.__parent self.__p = x.__p self.__unit = x.__unit self.__ordp = x.__ordp if big_oh == infinity: self.__prec = x.__prec else: if x.__ordp != infinity: self.__prec = min(x.__prec, big_oh-x.__ordp) else: self.__prec = min(x.__prec, big_oh) return | da5f5081a22672169933e312444f57d2267e1a14 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/da5f5081a22672169933e312444f57d2267e1a14/padic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
619,
16,
5446,
67,
16699,
33,
267,
7850,
16,
4642,
84,
33,
7036,
16,
4872,
33,
8381,
4672,
436,
8395,
12943,
30,
982,
1493,
279,
293,
17,
2033... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
982,
16,
619,
16,
5446,
67,
16699,
33,
267,
7850,
16,
4642,
84,
33,
7036,
16,
4872,
33,
8381,
4672,
436,
8395,
12943,
30,
982,
1493,
279,
293,
17,
2033... |
if len(dbset) > 20 and dbpercent < 50.0 and not repository.testing: | if not filesonly and \ len(dbset) > 20 and dbpercent < 50.0 and \ not repository.testing: | def db_update(archname, reponame, pkgs, options): """ Parses a list and updates the Arch dev database accordingly. Arguments: pkgs -- A list of Pkg objects. """ logger.info('Updating Arch: %s' % archname) force = options.get('force', False) filesonly = options.get('filesonly', False) repository = Repo.objects.get(name__iexact=reponame) architecture = Arch.objects.get(name__iexact=archname) dbpkgs = Package.objects.filter(arch=architecture, repo=repository) # It makes sense to fully evaluate our DB query now because we will # be using 99% of the objects in our "in both sets" loop. Force eval # by calling list() on the QuerySet. list(dbpkgs) # This makes our inner loop where we find packages by name *way* more # efficient by not having to go to the database for each package to # SELECT them by name. dbdict = dict([(pkg.pkgname, pkg) for pkg in dbpkgs]) logger.debug("Creating sets") dbset = set([pkg.pkgname for pkg in dbpkgs]) syncset = set([pkg.name for pkg in pkgs]) logger.info("%d packages in current web DB" % len(dbset)) logger.info("%d packages in new updating db" % len(syncset)) in_sync_not_db = syncset - dbset logger.info("%d packages in sync not db" % len(in_sync_not_db)) # Try to catch those random orphaning issues that make Eric so unhappy. if len(dbset): dbpercent = 100.0 * len(syncset) / len(dbset) else: dbpercent = 0.0 logger.info("DB package ratio: %.1f%%" % dbpercent) # Fewer than 20 packages makes the percentage check unreliable, but it also # means we expect the repo to fluctuate a lot. msg = "Package database has %.1f%% the number of packages in the " \ "web database" % dbpercent if len(dbset) > 20 and dbpercent < 50.0 and not repository.testing: logger.error(msg) raise Exception(msg) if dbpercent < 75.0: logger.warning(msg) if not filesonly: # packages in syncdb and not in database (add to database) for p in [x for x in pkgs if x.name in in_sync_not_db]: logger.info("Adding package %s", p.name) pkg = Package(pkgname = p.name, arch = architecture, repo = repository) populate_pkg(pkg, p, timestamp=datetime.now()) # packages in database and not in syncdb (remove from database) in_db_not_sync = dbset - syncset for p in in_db_not_sync: logger.info("Removing package %s from database", p) Package.objects.get( pkgname=p, arch=architecture, repo=repository).delete() # packages in both database and in syncdb (update in database) pkg_in_both = syncset & dbset for p in [x for x in pkgs if x.name in pkg_in_both]: logger.debug("Looking for package updates") dbp = dbdict[p.name] timestamp = None # for a force, we don't want to update the timestamp. # for a non-force, we don't want to do anything at all. if filesonly: pass elif '-'.join((p.ver, p.rel)) == '-'.join((dbp.pkgver, dbp.pkgrel)): if not force: continue else: timestamp = datetime.now() if filesonly: logger.debug("Checking files for package %s in database", p.name) populate_files(dbp, p) else: logger.info("Updating package %s in database", p.name) populate_pkg(dbp, p, force=force, timestamp=timestamp) logger.info('Finished updating Arch: %s' % archname) | fcc6d98bc438ea917c757ee1a565a5dba625f333 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11256/fcc6d98bc438ea917c757ee1a565a5dba625f333/reporead.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1319,
67,
2725,
12,
991,
529,
16,
283,
500,
339,
16,
16922,
16,
702,
4672,
3536,
2280,
2420,
279,
666,
471,
4533,
326,
16959,
4461,
2063,
15905,
18,
225,
13599,
30,
16922,
1493,
432,
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,
1319,
67,
2725,
12,
991,
529,
16,
283,
500,
339,
16,
16922,
16,
702,
4672,
3536,
2280,
2420,
279,
666,
471,
4533,
326,
16959,
4461,
2063,
15905,
18,
225,
13599,
30,
16922,
1493,
432,
6... |
- doResize resize object when zoom factor changes? | - isImSize is radius in image pixels? else cnv pixels. If true, annotation is resized as zoom changes. | def addAnnotation(self, annType, imPos, rad, tags=None, doResize=True, **kargs): """Add an annotation. | 862ddc6db44e0f15ce4be898eafea39343ed98b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6236/862ddc6db44e0f15ce4be898eafea39343ed98b7/GrayImageDispWdg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24145,
12,
2890,
16,
8226,
559,
16,
709,
1616,
16,
6719,
16,
2342,
33,
7036,
16,
741,
12182,
33,
5510,
16,
2826,
79,
1968,
4672,
3536,
986,
392,
3204,
18,
2,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24145,
12,
2890,
16,
8226,
559,
16,
709,
1616,
16,
6719,
16,
2342,
33,
7036,
16,
741,
12182,
33,
5510,
16,
2826,
79,
1968,
4672,
3536,
986,
392,
3204,
18,
2,
-100,
-100,
-100,
-100,
... |
if product.virtual_available >= 0.0: continue newdate = datetime.today() if product.supply_method == 'buy': location_id = warehouse.lot_input_id.id elif product.supply_method == 'produce': location_id = warehouse.lot_stock_id.id else: continue proc_id = proc_obj.create(cr, uid, { 'name': _('Automatic OP: %s') % (product.name,), 'origin': _('SCHEDULER'), 'date_planned': newdate.strftime('%Y-%m-%d %H:%M:%S'), 'product_id': product.id, 'product_qty': -product.virtual_available, 'product_uom': product.uom_id.id, 'location_id': location_id, 'procure_method': 'make_to_order', }) wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr) wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_check', cr) | if (product.active == True) and (product.purchase_ok == True): if product.virtual_available >= 0.0: continue newdate = datetime.today() if product.supply_method == 'buy': location_id = warehouse.lot_input_id.id elif product.supply_method == 'produce': location_id = warehouse.lot_stock_id.id else: continue proc_id = proc_obj.create(cr, uid, { 'name': _('Automatic OP: %s') % (product.name,), 'origin': _('SCHEDULER'), 'date_planned': newdate.strftime('%Y-%m-%d %H:%M:%S'), 'product_id': product.id, 'product_qty': -product.virtual_available, 'product_uom': product.uom_id.id, 'location_id': location_id, 'procure_method': 'make_to_order', }) wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr) wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_check', cr) | def create_automatic_op(self, cr, uid, context=None): """ Create procurement of virtual stock < 0 @param self: The object pointer @param cr: The current row, from the database cursor, @param uid: The current user ID for security checks @param context: A standard dictionary for contextual values @return: Dictionary of values """ if not context: context = {} product_obj = self.pool.get('product.product') proc_obj = self.pool.get('procurement.order') warehouse_obj = self.pool.get('stock.warehouse') wf_service = netsvc.LocalService("workflow") | cdbdc6e29c80206930b70387e6ac9348586a8b62 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cdbdc6e29c80206930b70387e6ac9348586a8b62/schedulers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
5854,
4941,
67,
556,
12,
2890,
16,
4422,
16,
4555,
16,
819,
33,
7036,
4672,
3536,
1788,
5418,
594,
475,
434,
225,
5024,
12480,
411,
374,
225,
632,
891,
365,
30,
1021,
733,
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,
752,
67,
5854,
4941,
67,
556,
12,
2890,
16,
4422,
16,
4555,
16,
819,
33,
7036,
4672,
3536,
1788,
5418,
594,
475,
434,
225,
5024,
12480,
411,
374,
225,
632,
891,
365,
30,
1021,
733,
4... |
str += I+'<TH CLASS="navbar"> '+\ 'Package </TH>\n' | str += I+'<th class="navbar"> ' str += 'Package </th>\n' | def _navbar(self, where, uid=None): """ @param where: What page the navbar is being displayed on.. """ str = self._start_of('Navbar') str += '<TABLE CLASS="navbar" BORDER="0" WIDTH="100%"' str += ' CELLPADDING="0" BGCOLOR="#a0c0ff" CELLSPACING="0">\n' str += ' <TR>\n' str += ' <TD WIDTH="100%">\n' str += ' <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">\n' str += ' <TR VALIGN="top">\n' | 1b52b16120989cc834166571a9a1e9b8676d968f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/1b52b16120989cc834166571a9a1e9b8676d968f/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
11589,
3215,
12,
2890,
16,
1625,
16,
4555,
33,
7036,
4672,
3536,
632,
891,
1625,
30,
18734,
1363,
326,
8775,
3215,
353,
3832,
10453,
603,
838,
3536,
609,
273,
365,
6315,
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,
389,
11589,
3215,
12,
2890,
16,
1625,
16,
4555,
33,
7036,
4672,
3536,
632,
891,
1625,
30,
18734,
1363,
326,
8775,
3215,
353,
3832,
10453,
603,
838,
3536,
609,
273,
365,
6315,
1937,
67,
... |
for (npy_intp n = 0; n < N; ++n) { //Dz[m*Szm + n*Szn] = 0.0; Dz[m*Szm + n*Szn] = 0.5; //here is the py_offset amount } } //iterate over the sparse array, making the most of an entry wherever we find it. // // Normal matrix matrix multiply: // for m // for n // for k // z[m,n] += a[m,k] * b[k,n] // Here instead: // for k // for m (sparse) // for n // z[m,n] += a[m,k] * b[k,n] for (npy_int32 k = 0; k < K; ++k) { const npy_double * __restrict__ bk = (double *)(%(b)s->data + %(b)s->strides[0] * k); for (npy_int32 m_idx = Dptr[k * Sptr]; m_idx < Dptr[(k+1) * Sptr]; ++m_idx) { npy_int32 m = Dind[m_idx * Sind]; const double Amk = Dval[m_idx * Sval]; npy_double * __restrict__ zm = (npy_double *)(%(z)s->data + %(z)s->strides[0] * m); if (m >= %(z)s->dimensions[0]) {PyErr_SetString(PyExc_NotImplementedError, "illegal row index in a"); %(fail)s;} for(npy_int32 n = 0; n < N; ++n) { zm[n*Szn] += Amk * bk[n*Sbn]; } } | ((double*)PyArray_GETPTR1(%(z)s, m))[0] = 0.5 + ((double*)PyArray_GETPTR1(%(a)s, m))[0] + ((double*)PyArray_GETPTR1(%(b)s, m))[0] ; | def c_code(self, node, name, (a_val, a_ind, a_ptr, a_nrows, b), (z,), sub): return """ if (%(a_val)s->nd != 1) {PyErr_SetString(PyExc_NotImplementedError, "rank(a_val) != 1"); %(fail)s;} if (%(a_ind)s->nd != 1) {PyErr_SetString(PyExc_NotImplementedError, "rank(a_ind) != 1"); %(fail)s;} if (%(a_ptr)s->nd != 1) {PyErr_SetString(PyExc_NotImplementedError, "rank(a_ptr) != 1"); %(fail)s;} if (%(a_nrows)s->nd != 0) {PyErr_SetString(PyExc_NotImplementedError, "rank(nrows) != 0"); %(fail)s;} if (%(b)s->nd != 2) {PyErr_SetString(PyExc_NotImplementedError, "rank(b) != 2"); %(fail)s;} | 46305ee5eb1cd7beebd74117366afb20cd152a02 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/46305ee5eb1cd7beebd74117366afb20cd152a02/test_debugmode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
276,
67,
710,
12,
2890,
16,
756,
16,
508,
16,
261,
69,
67,
1125,
16,
279,
67,
728,
16,
279,
67,
6723,
16,
279,
67,
82,
3870,
16,
324,
3631,
261,
94,
16,
3631,
720,
4672,
327,
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,
276,
67,
710,
12,
2890,
16,
756,
16,
508,
16,
261,
69,
67,
1125,
16,
279,
67,
728,
16,
279,
67,
6723,
16,
279,
67,
82,
3870,
16,
324,
3631,
261,
94,
16,
3631,
720,
4672,
327,
353... |
vgname = self.cfg.GetVGName() | def _ExecD8Secondary(self, feedback_fn): """Replace the secondary node for drbd8. | 4504c3d66847d28ecb22fbda3d10285b993bda61 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/4504c3d66847d28ecb22fbda3d10285b993bda61/cmdlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1905,
40,
28,
14893,
12,
2890,
16,
10762,
67,
4293,
4672,
3536,
5729,
326,
9946,
756,
364,
5081,
16410,
28,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1905,
40,
28,
14893,
12,
2890,
16,
10762,
67,
4293,
4672,
3536,
5729,
326,
9946,
756,
364,
5081,
16410,
28,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
if pathlength != None: (p_descr,e_descr) = hlr_utils.get_descr(pathlength) | if pathlength is not None: p_descr = hlr_utils.get_descr(pathlength) | def tof_to_d_spacing(obj,**kwargs): # import the helper functions import hlr_utils # set up for working through data (result,res_descr)=hlr_utils.empty_result(obj) (o_descr,d_descr)=hlr_utils.get_descr(obj) if o_descr == "number" or o_descr == "list": raise RuntimeError, "Must provide a SOM of a SO to the function." # Go on else: pass # Setup keyword arguments try: polar = kwargs["polar"] except KeyError: polar = None try: pathlength = kwargs["pathlength"] except KeyError: pathlength = None try: units = kwargs["units"] except KeyError: units = "microseconds" # Primary axis for transformation. If a SO is passed, the function, will # assume the axis for transformation is at the 0 position if o_descr == "SOM": axis = hlr_utils.hlr_1D_units(obj, units) else: axis = 0 result=hlr_utils.copy_som_attr(result,res_descr,obj,o_descr) if res_descr == "SOM": result = hlr_utils.hlr_force_units(result, "Angstroms", axis) result.setAxisLabel(axis, "d-spacing") result.setYUnits("Counts/A") result.setYLabel("Intensity") else: pass if pathlength == None or polar == None: if o_descr == "SOM": try: obj.attr_list.instrument.get_primary() inst = obj.attr_list.instrument except RuntimeError: raise RuntimeError, "A detector was not provided" else: if pathlength == None and polar == None: raise RuntimeError, "If no SOM is provided, then pathlength "\ +"and polar angle information must be provided" elif pathlength == None: raise RuntimeError, "If no SOM is provided, then pathlength "\ +"information must be provided" elif polar == None: raise RuntimeError, "If no SOM is provided, then polar angle "\ +"information must be provided" else: pass if pathlength != None: (p_descr,e_descr) = hlr_utils.get_descr(pathlength) if polar != None: (a_descr,e_descr) = hlr_utils.get_descr(polar) # iterate through the values import axis_manip import math for i in range(hlr_utils.get_length(obj)): val = hlr_utils.get_value(obj,i,o_descr,"x",axis) err2 = hlr_utils.get_err2(obj,i,o_descr,"x",axis) map_so = hlr_utils.get_map_so(obj,None,i) if pathlength == None: (pl,pl_err2) = hlr_utils.get_parameter("total",map_so,inst) else: pl = hlr_utils.get_value(pathlength,i,p_descr) pl_err2 = hlr_utils.get_err2(pathlength,i,p_descr) value=axis_manip.tof_to_wavelength(val, err2, pl, pl_err2) if polar == None: (angle,angle_err2) = hlr_utils.get_parameter("polar",map_so,inst) else: angle = hlr_utils.get_value(polar,i,p_descr) angle_err2 = hlr_utils.get_err2(polar,i,p_descr) count = 0 for v,e2 in map(None, value[0], value[1]): term1 = 1.0 / (2.0 * math.sin(angle/2.0)) term2 = 1.0 / (2.0 * math.tan(angle/2.0)) value[0][count] = v * term1 v2 = value[0][count] * value[0][count] value[1][count] = term1*term1*e2 + v2*term2*term2*angle_err2 count += 1 hlr_utils.result_insert(result,res_descr,value,map_so,"x",axis) return result | 8dcf8af8c74e3673ec736b87e019766d76714d13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/763/8dcf8af8c74e3673ec736b87e019766d76714d13/hlr_tof_to_d_spacing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
74,
67,
869,
67,
72,
67,
14080,
12,
2603,
16,
636,
4333,
4672,
225,
468,
1930,
326,
4222,
4186,
1930,
366,
10826,
67,
5471,
225,
468,
444,
731,
364,
5960,
3059,
501,
261,
2088,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
74,
67,
869,
67,
72,
67,
14080,
12,
2603,
16,
636,
4333,
4672,
225,
468,
1930,
326,
4222,
4186,
1930,
366,
10826,
67,
5471,
225,
468,
444,
731,
364,
5960,
3059,
501,
261,
2088,
... |
self.vbox.pack_start(self.effectsHBox) | def __init__(self): # Create GUI objects rgbaColormap = gtk.gdk.screen_get_default().get_rgba_colormap() if rgbaColormap != None: gtk.gdk.screen_get_default().set_default_colormap(rgbaColormap) self.testedEffect = "hover" self.window = gtk.Window() self.window.connect("destroy", gtk.main_quit) #self.window.set_property("skip-taskbar-hint", True) #self.window.set_property("decorated", False) #self.window.set_property("resizable", False) self.vbox = gtk.VBox() self.effectsHBox = gtk.HBox() | ff0629e623d6a32f9ddcb2968962182c361dc9ee /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8416/ff0629e623d6a32f9ddcb2968962182c361dc9ee/test-effects.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
468,
1788,
10978,
2184,
19465,
914,
18804,
273,
22718,
18,
75,
2883,
18,
9252,
67,
588,
67,
1886,
7675,
588,
67,
26198,
67,
1293,
18804,
1435,
309,
19465... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
468,
1788,
10978,
2184,
19465,
914,
18804,
273,
22718,
18,
75,
2883,
18,
9252,
67,
588,
67,
1886,
7675,
588,
67,
26198,
67,
1293,
18804,
1435,
309,
19465... | |
'BazTest.Test1', | 'BazTest.TestOne', | def testFilterWithoutDot(self): """Tests a filter that has no '.' in it.""" | 8811cad3eac09720ff023f0230f7f78253ae10a9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/14009/8811cad3eac09720ff023f0230f7f78253ae10a9/gtest_filter_unittest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
1586,
8073,
10412,
12,
2890,
4672,
3536,
14650,
279,
1034,
716,
711,
1158,
2611,
316,
518,
12123,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1586,
8073,
10412,
12,
2890,
4672,
3536,
14650,
279,
1034,
716,
711,
1158,
2611,
316,
518,
12123,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
if doc: doc = '<small><tt>' + doc + '<br> </tt></small>' | if doc: doc = '<small><tt>' + doc + '</tt></small>' | def docclass(self, object, funcs={}, classes={}): """Produce HTML documentation for a class object.""" name = object.__name__ bases = object.__bases__ contents = '' | c59006cf0425a2636c8284ef2601f7f489fad815 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/c59006cf0425a2636c8284ef2601f7f489fad815/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
1106,
12,
2890,
16,
733,
16,
15630,
28793,
3318,
12938,
4672,
3536,
25884,
3982,
7323,
364,
279,
667,
733,
12123,
508,
273,
733,
16186,
529,
972,
8337,
273,
733,
16186,
18602,
972,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
1106,
12,
2890,
16,
733,
16,
15630,
28793,
3318,
12938,
4672,
3536,
25884,
3982,
7323,
364,
279,
667,
733,
12123,
508,
273,
733,
16186,
529,
972,
8337,
273,
733,
16186,
18602,
972,
... |
for t in Profile.objects.all().values('template__name').annotate(count = models.Count('node')): | for t in Profile.objects.all().values('template__name').annotate(count = models.Count('node')).order_by('template__name'): | def statistics(request): """ Displays some global statistics. """ nodes_by_status = [] for s in Node.objects.all().values('status').annotate(count = models.Count('ip')): nodes_by_status.append({ 'status' : NodeStatus.as_string(s['status']), 'count' : s['count'] }) templates_by_usage = [] for t in Profile.objects.all().values('template__name').annotate(count = models.Count('node')): templates_by_usage.append({ 'template' : t['template__name'], 'count' : t['count'] }) return render_to_response('nodes/statistics.html', { 'node_count' : len(Node.objects.all()), 'nodes_by_status' : nodes_by_status, 'nodes_warned' : len(Node.objects.filter(warnings = True)), 'subnet_count' : len(Subnet.objects.all()), 'clients_online' : len(APClient.objects.all()), 'clients_ever' : Node.objects.aggregate(num = models.Sum('clients_so_far'))['num'], 'external_ant' : len(Node.objects.filter(ant_external = True)), 'template_usage' : templates_by_usage, 'peers_avg' : Node.objects.filter(peers__gt = 0).aggregate(num = models.Avg('peers'))['num'] }, context_instance = RequestContext(request) ) | 95305844728c2b676fa017b5d8a3d0aa20e5759e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11345/95305844728c2b676fa017b5d8a3d0aa20e5759e/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7691,
12,
2293,
4672,
3536,
9311,
87,
2690,
2552,
7691,
18,
3536,
2199,
67,
1637,
67,
2327,
273,
5378,
364,
272,
316,
2029,
18,
6911,
18,
454,
7675,
2372,
2668,
2327,
16063,
18338,
340,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7691,
12,
2293,
4672,
3536,
9311,
87,
2690,
2552,
7691,
18,
3536,
2199,
67,
1637,
67,
2327,
273,
5378,
364,
272,
316,
2029,
18,
6911,
18,
454,
7675,
2372,
2668,
2327,
16063,
18338,
340,
... |
cmd = "cython --embed-positions -I%s -o %s %s"%(os.getcwd(), outfile, f) | cmd = "cython --embed-positions --incref-local-binop -I%s -o %s %s"%(os.getcwd(), outfile, f) | def process_cython_file(f, m): """ INPUT: f -- file name m -- Extension module description (i.e., object of type Extension). """ # This is a cython file, so process accordingly. pyx_inst_file = '%s/%s'%(SITE_PACKAGES, f) if is_older(f, pyx_inst_file): print "%s --> %s"%(f, pyx_inst_file) os.system('cp %s %s 2>/dev/null'%(f, pyx_inst_file)) outfile = f[:-4] + ".c" if m.language == 'c++': outfile += 'pp' if need_to_cython(f, outfile): # Insert the -o parameter to specify the output file (particularly for c++) cmd = "cython --embed-positions -I%s -o %s %s"%(os.getcwd(), outfile, f) print cmd ret = os.system(cmd) if ret != 0: print "sage: Error running cython." sys.exit(1) return [outfile] | 22d6f153360ce8c2c378ff1bae4d09a39b4a2563 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/22d6f153360ce8c2c378ff1bae4d09a39b4a2563/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
2431,
3041,
67,
768,
12,
74,
16,
312,
4672,
3536,
12943,
30,
284,
1493,
585,
508,
312,
1493,
10021,
1605,
2477,
261,
77,
18,
73,
12990,
733,
434,
618,
10021,
2934,
3536,
468,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
2431,
3041,
67,
768,
12,
74,
16,
312,
4672,
3536,
12943,
30,
284,
1493,
585,
508,
312,
1493,
10021,
1605,
2477,
261,
77,
18,
73,
12990,
733,
434,
618,
10021,
2934,
3536,
468,... |
class X(A,B,C,D): | class X(D,B,C,A): | def mro(cls): L = type.mro(cls) L.reverse() return L | 8a1c43101e27f2143eb7d69d9e8d9c114f08f93a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8a1c43101e27f2143eb7d69d9e8d9c114f08f93a/test_descr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
312,
303,
12,
6429,
4672,
511,
273,
618,
18,
81,
303,
12,
6429,
13,
511,
18,
9845,
1435,
327,
511,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
312,
303,
12,
6429,
4672,
511,
273,
618,
18,
81,
303,
12,
6429,
13,
511,
18,
9845,
1435,
327,
511,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
if sid is None and create: sid=uuid.uuid() if sid: self.__sessionID=sid | if sid is None and create: sid=uuid.uuid() if sid: self.__sessionID=sid | def getSessionID(self, create=1): ''' obtain the session id from the request cookie, or, if not available, create a new one. ''' try: return self.__sessionID except AttributeError: sesskey=Configuration.SessionIDKey try: sid=self.requestCookie[sesskey].value except KeyError: # look in connection arguments for session id sid=self.args.get(sesskey) if sid is None and create: sid=uuid.uuid() if sid: self.__sessionID=sid return sid | e45496da053c8025699b4d61f9cac3a4541d2b97 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2304/e45496da053c8025699b4d61f9cac3a4541d2b97/Session.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7183,
734,
12,
2890,
16,
752,
33,
21,
4672,
9163,
7161,
326,
1339,
612,
628,
326,
590,
3878,
16,
578,
16,
309,
486,
2319,
16,
752,
279,
394,
1245,
18,
9163,
775,
30,
327,
365,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7183,
734,
12,
2890,
16,
752,
33,
21,
4672,
9163,
7161,
326,
1339,
612,
628,
326,
590,
3878,
16,
578,
16,
309,
486,
2319,
16,
752,
279,
394,
1245,
18,
9163,
775,
30,
327,
365,
16186,... |
Reporter.endTest(self, method) | def endTest(self, method): Reporter.endTest(self, method) self.endLine(*self._getText(self.getStatus(method))) | 2111afd113df8f03d5a8292816aa499e4230763f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/2111afd113df8f03d5a8292816aa499e4230763f/reporter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
679,
4709,
12,
2890,
16,
707,
4672,
365,
18,
409,
1670,
30857,
2890,
6315,
588,
1528,
12,
2890,
18,
588,
1482,
12,
2039,
20349,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
679,
4709,
12,
2890,
16,
707,
4672,
365,
18,
409,
1670,
30857,
2890,
6315,
588,
1528,
12,
2890,
18,
588,
1482,
12,
2039,
20349,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
(xmm_mem128, {'opcode':[0x0F, 0x51], 'modrm':None, 'prefix':[0xF3]})) | (xmm_mem32 , {'opcode':[0x0F, 0x51], 'modrm':None, 'prefix':[0xF3]})) | def x86_type(op): t = x86_imm_operand_type(op) if t is None: t = x86_reg_operand_type(op) if t is None: t = x86_reloff_operand_type(op) if t is None: t = x86_mem_operand_type(op) return t | 00e8212a9e073ac222647cc5738654d07c44702e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9699/00e8212a9e073ac222647cc5738654d07c44702e/x86_64_isa.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
619,
5292,
67,
723,
12,
556,
4672,
268,
273,
619,
5292,
67,
381,
81,
67,
4063,
464,
67,
723,
12,
556,
13,
225,
309,
268,
353,
599,
30,
268,
273,
619,
5292,
67,
1574,
67,
4063,
464,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
619,
5292,
67,
723,
12,
556,
4672,
268,
273,
619,
5292,
67,
381,
81,
67,
4063,
464,
67,
723,
12,
556,
13,
225,
309,
268,
353,
599,
30,
268,
273,
619,
5292,
67,
1574,
67,
4063,
464,... |
repos arg [option] | %s arg [option] | def do_help(self, arg): msg = """ | 27e83a3774587a84532112eaada08ead41debbe9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5445/27e83a3774587a84532112eaada08ead41debbe9/shell.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
5201,
12,
2890,
16,
1501,
4672,
1234,
273,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
5201,
12,
2890,
16,
1501,
4672,
1234,
273,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return parmpagename, parmyear, parmmonth, parmoffset, parmoffset2, parmheight6, parmanniversary | strtemplate = args.group('template') if strtemplate: parmtemplate = wikiutil.unquoteWikiname(strtemplate) else: parmtemplate = deftemplate return parmpagename, parmyear, parmmonth, parmoffset, parmoffset2, parmheight6, parmanniversary, parmtemplate | def parseargs(args, defpagename, defyear, defmonth, defoffset, defoffset2, defheight6, defanniversary): strpagename = args.group('basepage') if strpagename: parmpagename = wikiutil.unquoteWikiname(strpagename) else: parmpagename = defpagename # multiple pagenames separated by "*" - split into list of pagenames parmpagename = re.split(r'\*', parmpagename) stryear = args.group('year') if stryear: parmyear = int(stryear) else: parmyear = defyear strmonth = args.group('month') if strmonth: parmmonth = int(strmonth) else: parmmonth = defmonth stroffset = args.group('offset') if stroffset: parmoffset = int(stroffset) else: parmoffset = defoffset stroffset2 = args.group('offset2') if stroffset2: parmoffset2 = int(stroffset2) else: parmoffset2 = defoffset2 strheight6 = args.group('height6') if strheight6: parmheight6 = int(strheight6) else: parmheight6 = defheight6 stranniversary = args.group('anniversary') if stranniversary: parmanniversary = int(stranniversary) else: parmanniversary = defanniversary return parmpagename, parmyear, parmmonth, parmoffset, parmoffset2, parmheight6, parmanniversary | 8df0648e183013444c9153b284dd9390e635d11b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/888/8df0648e183013444c9153b284dd9390e635d11b/MonthCalendar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
1968,
12,
1968,
16,
1652,
9095,
1069,
16,
1652,
6874,
16,
1652,
7496,
16,
443,
617,
74,
988,
16,
443,
617,
74,
988,
22,
16,
1652,
4210,
26,
16,
1652,
1072,
6760,
814,
4672,
609... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1968,
12,
1968,
16,
1652,
9095,
1069,
16,
1652,
6874,
16,
1652,
7496,
16,
443,
617,
74,
988,
16,
443,
617,
74,
988,
22,
16,
1652,
4210,
26,
16,
1652,
1072,
6760,
814,
4672,
609... |
- blockStatementExpr - expression defining syntax of statement that | - blockStatementExpr - expression defining syntax of statement that | def indentedBlock(blockStatementExpr, indentStack, indent=True): """Helper method for defining space-delimited indentation blocks, such as those used to define block statements in Python source code. Parameters: - blockStatementExpr - expression defining syntax of statement that is repeated within the indented block - indentStack - list created by caller to manage indentation stack (multiple statementWithIndentedBlock expressions within a single grammar should share a common indentStack) - indent - boolean indicating whether block must be indented beyond the the current level; set to False for block of left-most statements (default=True) A valid block must contain at least one blockStatement. """ def checkPeerIndent(s,l,t): if l >= len(s): return curCol = col(l,s) if curCol != indentStack[-1]: if curCol > indentStack[-1]: raise ParseFatalException(s,l,"illegal nesting") raise ParseException(s,l,"not a peer entry") def checkSubIndent(s,l,t): curCol = col(l,s) if curCol > indentStack[-1]: indentStack.append( curCol ) else: raise ParseException(s,l,"not a subentry") def checkUnindent(s,l,t): if l >= len(s): return curCol = col(l,s) if not(indentStack and curCol < indentStack[-1] and curCol <= indentStack[-2]): raise ParseException(s,l,"not an unindent") indentStack.pop() NL = OneOrMore(LineEnd().setWhitespaceChars("\t ").suppress()) INDENT = Empty() + Empty().setParseAction(checkSubIndent) PEER = Empty().setParseAction(checkPeerIndent) UNDENT = Empty().setParseAction(checkUnindent) if indent: smExpr = Group( Optional(NL) + FollowedBy(blockStatementExpr) + INDENT + (OneOrMore( PEER + Group(blockStatementExpr) + Optional(NL) )) + UNDENT) else: smExpr = Group( Optional(NL) + (OneOrMore( PEER + Group(blockStatementExpr) + Optional(NL) )) ) blockStatementExpr.ignore("\\" + LineEnd()) return smExpr | 106c1bd9e9826a8eaaf30140a9c58bfb1b6d1801 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12364/106c1bd9e9826a8eaaf30140a9c58bfb1b6d1801/pyparsing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23786,
1768,
12,
2629,
3406,
4742,
16,
3504,
2624,
16,
3504,
33,
5510,
4672,
3536,
2276,
707,
364,
9364,
3476,
17,
3771,
1038,
329,
12018,
4398,
16,
4123,
487,
5348,
1399,
358,
4426,
120... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23786,
1768,
12,
2629,
3406,
4742,
16,
3504,
2624,
16,
3504,
33,
5510,
4672,
3536,
2276,
707,
364,
9364,
3476,
17,
3771,
1038,
329,
12018,
4398,
16,
4123,
487,
5348,
1399,
358,
4426,
120... |
if parameters.has_key['group_timeout']: | if parameters.has_key('group_timeout'): | def placeOriginate(self, args): cId, cGUID, cli, cld, body, auth, caller_name = self.eTry.getData() rnum, host, cld, credit_time, expires, no_progress_expires, forward_on_fail, user, passw, cli, \ parameters = args self.huntstop_scodes = parameters.get('huntstop_scodes', ()) if self.global_config.has_key('static_tr_out'): cld = re_replace(self.global_config['static_tr_out'], cld) if not forward_on_fail and self.global_config['acct_enable']: self.acctO = RadiusAccounting(self.global_config, 'originate', send_start = self.global_config['start_acct_enable']) self.acctO.setParams(parameters.get('bill-to', self.username), cli, parameters.get('bill-cld', cld), \ self.cGUID, self.cId, host, credit_time) else: self.acctO = None self.acctA.credit_time = credit_time if host == 'sip-ua': host = self.source[0] port = self.source[1] else: host = host.split(':', 1) if len(host) > 1: port = int(host[1]) else: port = SipConf.default_port host = host[0] conn_handlers = [self.oConn] disc_handlers = [] if not forward_on_fail and self.global_config['acct_enable']: disc_handlers.append(self.acctO.disc) self.uaO = UA(self.global_config, self.recvEvent, user, passw, (host, port), credit_time, tuple(conn_handlers), \ tuple(disc_handlers), tuple(disc_handlers), dead_cbs = (self.oDead,), expire_time = expires, \ no_progress_time = no_progress_expires, extra_headers = parameters.get('extra_headers', None)) if self.rtp_proxy_session != None and parameters.get('rtpp', True): self.uaO.on_local_sdp_change = self.rtp_proxy_session.on_caller_sdp_change self.uaO.on_remote_sdp_change = self.rtp_proxy_session.on_callee_sdp_change body = body.getCopy() body.content += 'a=nortpproxy:yes\r\n' self.uaO.kaInterval = self.global_config['ka_orig'] if parameters.has_key['group_timeout']: timeout, skipto = parameters['group_timeout'] Timeout(self.group_expires, timeout, 1, skipto) self.uaO.recvEvent(CCEventTry((cId + '-b2b_%d' % rnum, cGUID, cli, cld, body, auth, \ parameters.get('caller_name', self.caller_name)))) | 0db8e3500145e01fe06c72e23d08d8349949671b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8853/0db8e3500145e01fe06c72e23d08d8349949671b/b2bua_radius.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3166,
4741,
3322,
12,
2890,
16,
833,
4672,
276,
548,
16,
276,
17525,
16,
4942,
16,
23451,
16,
1417,
16,
1357,
16,
4894,
67,
529,
273,
365,
18,
73,
7833,
18,
588,
751,
1435,
436,
2107... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3166,
4741,
3322,
12,
2890,
16,
833,
4672,
276,
548,
16,
276,
17525,
16,
4942,
16,
23451,
16,
1417,
16,
1357,
16,
4894,
67,
529,
273,
365,
18,
73,
7833,
18,
588,
751,
1435,
436,
2107... |
self.hatari.debug_command("d %06x-%06x" % (self.first, self.last)) | self.hatari.debug_command("d $%06x-$%06x" % (self.first, self.last)) | def _get_disasm(self, address, move_idx): # TODO: uses brute force i.e. ask for more lines that user has # requested to be sure that the window is filled, assuming # 6 bytes is largest possible instruction+args size # (I don't remember anymore my m68k asm...) screenful = 6*self.lines # no move, left/right, up/down, page up/down offsets = [0, 2, 4, screenful] offset = offsets[abs(move_idx)] # force one line of overlap in page up/down if move_idx < 0: address -= offset if address < 0: address = 0 if move_idx == -Constants.MOVE_MAX and self.second: screenful = self.second - address else: if move_idx == Constants.MOVE_MED and self.second: address = self.second elif move_idx == Constants.MOVE_MAX and self.last: address = self.last else: address += offset self._set_clamped(address, address+screenful) self.hatari.debug_command("d %06x-%06x" % (self.first, self.last)) # get & set debugger command results output = self.hatari.get_lines(self.debug_output) # cut output to desired length and check new addresses if len(output) > self.lines: if move_idx < 0: output = output[-self.lines:] else: output = output[:self.lines] # with disasm need to re-get the addresses from the output self.first = int(output[0][:output[0].find(":")], 16) self.second = int(output[1][:output[1].find(":")], 16) self.last = int(output[-1][:output[-1].find(":")], 16) return output | 9b9c5609dfbddf355007116fedb8e4b397858c40 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2811/9b9c5609dfbddf355007116fedb8e4b397858c40/debugui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
2251,
23522,
12,
2890,
16,
1758,
16,
3635,
67,
3465,
4672,
468,
2660,
30,
4692,
5186,
624,
2944,
277,
18,
73,
18,
6827,
364,
1898,
2362,
716,
729,
711,
468,
3764,
358,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
2251,
23522,
12,
2890,
16,
1758,
16,
3635,
67,
3465,
4672,
468,
2660,
30,
4692,
5186,
624,
2944,
277,
18,
73,
18,
6827,
364,
1898,
2362,
716,
729,
711,
468,
3764,
358,
... |
var n = new Node(t, DO) | n = new Node(t, DO) | def DO__build(t): var n = new Node(t, DO) n.isLoop = true return n | 14e57c50767cb32286882c207d0afc37f010f284 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12949/14e57c50767cb32286882c207d0afc37f010f284/Builder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5467,
972,
3510,
12,
88,
4672,
290,
273,
394,
2029,
12,
88,
16,
5467,
13,
290,
18,
291,
6452,
273,
638,
327,
290,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5467,
972,
3510,
12,
88,
4672,
290,
273,
394,
2029,
12,
88,
16,
5467,
13,
290,
18,
291,
6452,
273,
638,
327,
290,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
0.60190723019723457473754000153561733926158688995 | 0.60190723019723457473754000153561733926158688996810645601776795916855358294623784016886370695825821535464409978314005090846929281349329460565572696199608 | def bessel_K(nu,z,prec=53): r""" Implements the "K-Bessel function", or "modifed Bessel function, 2nd kind", with index (or "order") nu and argument z. Defn: | 5d4d1a4315d1dc34b216f5bb99d2f5bcf1f776e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/5d4d1a4315d1dc34b216f5bb99d2f5bcf1f776e9/special.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
324,
403,
292,
67,
47,
12,
13053,
16,
94,
16,
4036,
33,
8643,
4672,
436,
8395,
29704,
326,
315,
47,
17,
38,
403,
292,
445,
3113,
578,
315,
1711,
430,
329,
605,
403,
292,
445,
16,
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,
324,
403,
292,
67,
47,
12,
13053,
16,
94,
16,
4036,
33,
8643,
4672,
436,
8395,
29704,
326,
315,
47,
17,
38,
403,
292,
445,
3113,
578,
315,
1711,
430,
329,
605,
403,
292,
445,
16,
5... |
SDK["PYTHONEXEC"] = os.path.join(os.path.dirname(sys.executable), os.readlink(sys.executable)) | if (os.path.islink(sys.executable)): SDK["PYTHONEXEC"] = os.path.join(os.path.dirname(sys.executable), os.readlink(sys.executable)) else: SDK["PYTHONEXEC"] = sys.executable | def SdkLocatePython(force_use_sys_executable = False): if (PkgSkip("PYTHON")==0): if (sys.platform == "win32" and not force_use_sys_executable): SDK["PYTHON"] = "thirdparty/win-python" if (GetOptimize() <= 2): SDK["PYTHON"] += "-dbg" if (platform.architecture()[0] == "64bit" and os.path.isdir(SDK["PYTHON"] + "-x64")): SDK["PYTHON"] += "-x64" SDK["PYTHONEXEC"] = SDK["PYTHON"] + "/python" if (GetOptimize() <= 2): SDK["PYTHONEXEC"] += "_d.exe" else: SDK["PYTHONEXEC"] += ".exe" if (not os.path.isfile(SDK["PYTHONEXEC"])): exit("Could not find %s!" % SDK["PYTHONEXEC"]) os.system(SDK["PYTHONEXEC"].replace("/", "\\") + " -V > "+OUTPUTDIR+"/tmp/pythonversion 2>&1") pv=ReadFile(OUTPUTDIR+"/tmp/pythonversion") if (pv.startswith("Python ")==0): exit("python -V did not produce the expected output") pv = pv[7:10] SDK["PYTHONVERSION"]="python"+pv elif (sys.platform == "win32"): SDK["PYTHON"] = os.path.dirname(sysconfig.get_python_inc()) SDK["PYTHONVERSION"] = "python" + sysconfig.get_python_version() SDK["PYTHONEXEC"] = sys.executable elif (sys.platform == "darwin"): SDK["PYTHON"] = sysconfig.get_python_inc() SDK["PYTHONVERSION"] = "python" + sysconfig.get_python_version() SDK["PYTHONEXEC"] = sys.executable else: SDK["PYTHON"] = sysconfig.get_python_inc() SDK["PYTHONVERSION"] = "python" + sysconfig.get_python_version() SDK["PYTHONEXEC"] = os.path.join(os.path.dirname(sys.executable), os.readlink(sys.executable)) elif (sys.platform == "darwin"): SDK["PYTHONEXEC"] = sys.executable else: SDK["PYTHONEXEC"] = os.path.join(os.path.dirname(sys.executable), os.readlink(sys.executable)) | 2af783dc286e912ed77b5320b3e0e1b147ac4521 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8543/2af783dc286e912ed77b5320b3e0e1b147ac4521/makepandacore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3426,
1333,
340,
15774,
12,
5734,
67,
1202,
67,
9499,
67,
17751,
273,
1083,
4672,
309,
261,
11264,
6368,
2932,
16235,
20131,
7923,
631,
20,
4672,
309,
261,
9499,
18,
9898,
422,
315,
8082... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3426,
1333,
340,
15774,
12,
5734,
67,
1202,
67,
9499,
67,
17751,
273,
1083,
4672,
309,
261,
11264,
6368,
2932,
16235,
20131,
7923,
631,
20,
4672,
309,
261,
9499,
18,
9898,
422,
315,
8082... |
complete.append(move) | complete.append(move) | def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} picking_obj = self.pool.get('stock.picking') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) new_moves = [] | 18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
11601,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
4702,
67,
13178,
16,
819,
12938,
4672,
3536,
632,
4702,
67,
13178,
294,
2065,
18,
912,
3189,
434,
4702,
6002,
310,
3007,
191... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
11601,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
4702,
67,
13178,
16,
819,
12938,
4672,
3536,
632,
4702,
67,
13178,
294,
2065,
18,
912,
3189,
434,
4702,
6002,
310,
3007,
191... |
return def pollBOSSDB(self): """ _pollBOSSDB_ Poll the BOSSDB for completed job ids, making sure that | elif event == "TrackingComponent:pollDB": self.checkJobs() return return def pollLB(self): """ _pollLB_ Poll the LB through BOSS to update the job status get completed job ids, making sure that | def __call__(self, event, payload): """ _operator()_ | b299645affb60052912599346c5588880cf6034e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8887/b299645affb60052912599346c5588880cf6034e/TrackingComponent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
871,
16,
2385,
4672,
3536,
389,
9497,
1435,
67,
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,
1001,
1991,
972,
12,
2890,
16,
871,
16,
2385,
4672,
3536,
389,
9497,
1435,
67,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
val1 = sets.Set(filter(lambda x: x >= 0, T1.column(c))) val2 = sets.Set(filter(lambda x: x >= 0, T2.column(c))) | val1 = set(filter(lambda x: x >= 0, T1.column(c))) val2 = set(filter(lambda x: x >= 0, T2.column(c))) | def is_row_and_col_balanced(T1, T2): """ Partial latin squares T1 and T2 are balanced if the symbols appearing in row r of T1 are the same as the symbols appearing in row r of T2, for each r, and if the same condition holds on columns. EXAMPLES:: sage: from sage.combinat.matrices.latin import * sage: T1 = matrix([[0,1,-1,-1], [-1,-1,-1,-1], [-1,-1,-1,-1], [-1,-1,-1,-1]]) sage: T2 = matrix([[0,1,-1,-1], [-1,-1,-1,-1], [-1,-1,-1,-1], [-1,-1,-1,-1]]) sage: is_row_and_col_balanced(T1, T2) True sage: T2 = matrix([[0,3,-1,-1], [-1,-1,-1,-1], [-1,-1,-1,-1], [-1,-1,-1,-1]]) sage: is_row_and_col_balanced(T1, T2) False """ for r in range(T1.nrows()): val1 = sets.Set(filter(lambda x: x >= 0, T1.row(r))) val2 = sets.Set(filter(lambda x: x >= 0, T2.row(r))) if val1 != val2: return False for c in range(T1.ncols()): val1 = sets.Set(filter(lambda x: x >= 0, T1.column(c))) val2 = sets.Set(filter(lambda x: x >= 0, T2.column(c))) if val1 != val2: return False return True | 51de86397c8440b9e23046c2f90476176b06c3fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/51de86397c8440b9e23046c2f90476176b06c3fd/latin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
492,
67,
464,
67,
1293,
67,
12296,
72,
12,
56,
21,
16,
399,
22,
4672,
3536,
19060,
30486,
31206,
399,
21,
471,
399,
22,
854,
11013,
72,
309,
326,
7963,
7226,
5968,
316,
1027... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
492,
67,
464,
67,
1293,
67,
12296,
72,
12,
56,
21,
16,
399,
22,
4672,
3536,
19060,
30486,
31206,
399,
21,
471,
399,
22,
854,
11013,
72,
309,
326,
7963,
7226,
5968,
316,
1027... |
'option_list' : ('', '.TP 0\n'), | def __init__(self, document): nodes.NodeVisitor.__init__(self, document) self.settings = settings = document.settings lcode = settings.language_code self.language = languages.get_language(lcode) self.head = [] self.body = [] self.foot = [] self.section_level = 0 self.context = [] self.topic_class = '' self.colspecs = [] self.compact_p = 1 self.compact_simple = None # the list style "*" bullet or "#" numbered self._list_char = [] # writing the header .TH and .SH NAME is postboned after # docinfo. self._docinfo = { "title" : "", "subtitle" : "", "manual_section" : "", "manual_group" : "", "author" : "", "date" : "", "copyright" : "", "version" : "", } self._in_docinfo = None self._active_table = None self._in_entry = None self.header_written = 0 self.authors = [] self.section_level = 0 # central definition of simple processing rules # what to output on : visit, depart self.defs = { 'definition' : ('', ''), 'definition_list' : ('', '.TP 0\n'), 'definition_list_item' : ('\n.TP', ''), 'description' : ('\n', ''), 'field_name' : ('\n.TP\n.B ', '\n'), 'literal' : ('\\fB', '\\fP'), 'literal_block' : ('\n.nf\n', '\n.fi\n'), 'option_list' : ('', '.TP 0\n'), 'option_list_item' : ('\n.TP', ''), 'reference' : (r'\fI\%', r'\fP'), #'target' : (r'\fI\%', r'\fP'), 'emphasis': ('\\fI', '\\fP'), 'strong' : ('\\fB', '\\fP'), 'term' : ('\n.B ', '\n'), 'title_reference' : ('\\fI', '\\fP'), } # TODO dont specify the newline before a dot-command, but ensure # check it is there. | 33fb604531cb0884e8062b15ab6fc530c3335af8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5620/33fb604531cb0884e8062b15ab6fc530c3335af8/manpage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1668,
4672,
2199,
18,
907,
7413,
16186,
2738,
972,
12,
2890,
16,
1668,
13,
365,
18,
4272,
273,
1947,
273,
1668,
18,
4272,
328,
710,
273,
1947,
18,
4923,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1668,
4672,
2199,
18,
907,
7413,
16186,
2738,
972,
12,
2890,
16,
1668,
13,
365,
18,
4272,
273,
1947,
273,
1668,
18,
4272,
328,
710,
273,
1947,
18,
4923,
... | |
cmdclass = {'build_ext':PyBuildExt, 'install':PyBuildInstall, 'install_lib':PyBuildInstallLib}, | cmdclass = {'build_ext': PyBuildExt, 'build_scripts': PyBuildScripts, 'install': PyBuildInstall, 'install_lib': PyBuildInstallLib}, | def main(): # turn off warnings when deprecated modules are imported import warnings warnings.filterwarnings("ignore",category=DeprecationWarning) setup(# PyPI Metadata (PEP 301) name = "Python", version = sys.version.split()[0], url = "http://www.python.org/%s" % sys.version[:3], maintainer = "Guido van Rossum and the Python community", maintainer_email = "python-dev@python.org", description = "A high-level object-oriented programming language", long_description = SUMMARY.strip(), license = "PSF license", classifiers = [x for x in CLASSIFIERS.split("\n") if x], platforms = ["Many"], # Build info cmdclass = {'build_ext':PyBuildExt, 'install':PyBuildInstall, 'install_lib':PyBuildInstallLib}, # The struct module is defined here, because build_ext won't be # called unless there's at least one extension module defined. ext_modules=[Extension('_struct', ['_struct.c'])], scripts = ["Tools/scripts/pydoc3", "Tools/scripts/idle3", "Tools/scripts/2to3"] ) | cd38b5dc6aafe583dde6593b6e345db70bb5e34d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/cd38b5dc6aafe583dde6593b6e345db70bb5e34d/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
468,
7005,
3397,
5599,
1347,
6849,
4381,
854,
9101,
1930,
5599,
5599,
18,
2188,
12103,
2932,
6185,
3113,
4743,
33,
758,
13643,
6210,
13,
3875,
12,
7,
4707,
1102,
6912,
261,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
468,
7005,
3397,
5599,
1347,
6849,
4381,
854,
9101,
1930,
5599,
5599,
18,
2188,
12103,
2932,
6185,
3113,
4743,
33,
758,
13643,
6210,
13,
3875,
12,
7,
4707,
1102,
6912,
261,
... |
print '+ found LilyPond, but could not extract version number.' | logger.info('+ found LilyPond, but could not extract version number.') | def checkConverterEntries(): ''' Check all converters (\converter entries) ''' checkProg('the pdflatex program', ['pdflatex $$i'], rc_entry = [ r'\converter pdflatex pdf2 "%%" "latex"' ]) ''' If we're running LyX in-place then tex2lyx will be found in ../src/tex2lyx. Add this directory to the PATH temporarily and search for tex2lyx. Use PATH to avoid any problems with paths-with-spaces. ''' path_orig = os.environ["PATH"] os.environ["PATH"] = os.path.join('..', 'src', 'tex2lyx') + \ os.pathsep + path_orig checkProg('a LaTeX/Noweb -> LyX converter', ['tex2lyx', 'tex2lyx' + version_suffix], rc_entry = [r'''\converter latex lyx "%% -f $$i $$o" "" | b8ce87578f9d75ccccfc9a3eb0e0156576b6d158 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7514/b8ce87578f9d75ccccfc9a3eb0e0156576b6d158/configure.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
5072,
5400,
13332,
9163,
2073,
777,
19414,
17938,
15747,
3222,
13,
9163,
866,
626,
75,
2668,
5787,
8169,
26264,
5402,
2187,
10228,
7699,
26264,
5366,
77,
17337,
4519,
67,
4099,
273,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
5072,
5400,
13332,
9163,
2073,
777,
19414,
17938,
15747,
3222,
13,
9163,
866,
626,
75,
2668,
5787,
8169,
26264,
5402,
2187,
10228,
7699,
26264,
5366,
77,
17337,
4519,
67,
4099,
273,
3... |
else: pass verify('...%(foo)s...' % {'foo':u"abc"} == u'...abc...') verify('...%(foo)s...' % {'foo':"abc"} == '...abc...') verify('...%(foo)s...' % {u'foo':"abc"} == '...abc...') verify('...%(foo)s...' % {u'foo':u"abc"} == u'...abc...') verify('...%(foo)s...' % {u'foo':u"abc",'def':123} == u'...abc...') verify('...%(foo)s...' % {u'foo':u"abc",u'def':123} == u'...abc...') verify('...%s...%s...%s...%s...' % (1,2,3,u"abc") == u'...1...2...3...abc...') verify('...%%...%%s...%s...%s...%s...%s...' % (1,2,3,u"abc") == u'...%...%s...1...2...3...abc...') verify('...%s...' % u"abc" == u'...abc...') verify('%*s' % (5,u'abc',) == u' abc') verify('%*s' % (-5,u'abc',) == u'abc ') verify('%*.*s' % (5,2,u'abc',) == u' ab') verify('%*.*s' % (5,3,u'abc',) == u' abc') verify('%i %*.*s' % (10, 5,3,u'abc',) == u'10 abc') verify('%i%s %*.*s' % (10, 3, 5,3,u'abc',) == u'103 abc') print 'done.' print 'Testing builtin unicode()...', verify(unicode(u'unicode remains unicode') == u'unicode remains unicode') class UnicodeSubclass(unicode): pass verify(unicode(UnicodeSubclass('unicode subclass becomes unicode')) == u'unicode subclass becomes unicode') verify(unicode('strings are converted to unicode') == u'strings are converted to unicode') class UnicodeCompat: def __init__(self, x): self.x = x def __unicode__(self): return self.x verify(unicode(UnicodeCompat('__unicode__ compatible objects are recognized')) == u'__unicode__ compatible objects are recognized') class StringCompat: def __init__(self, x): self.x = x def __str__(self): return self.x verify(unicode(StringCompat('__str__ compatible objects are recognized')) == u'__str__ compatible objects are recognized') o = StringCompat('unicode(obj) is compatible to str()') verify(unicode(o) == u'unicode(obj) is compatible to str()') verify(str(o) == 'unicode(obj) is compatible to str()') for obj in (123, 123.45, 123L): verify(unicode(obj) == unicode(str(obj))) if not sys.platform.startswith('java'): try: unicode(u'decoding unicode is not supported', 'utf-8', 'strict') except TypeError: pass else: raise TestFailed, "decoding unicode should NOT be supported" verify(unicode('strings are decoded to unicode', 'utf-8', 'strict') == u'strings are decoded to unicode') if not sys.platform.startswith('java'): verify(unicode(buffer('character buffers are decoded to unicode'), 'utf-8', 'strict') == u'character buffers are decoded to unicode') print 'done.' print 'Testing builtin codecs...', utfTests = [(u'A\u2262\u0391.', 'A+ImIDkQ.'), (u'Hi Mom -\u263a-!', 'Hi Mom -+Jjo--!'), (u'\u65E5\u672C\u8A9E', '+ZeVnLIqe-'), (u'Item 3 is \u00a31.', 'Item 3 is +AKM-1.'), (u'+', '+-'), (u'+-', '+--'), (u'+?', '+-?'), (u'\?', '+AFw?'), (u'+?', '+-?'), (ur'\\?', '+AFwAXA?'), (ur'\\\?', '+AFwAXABc?'), (ur'++--', '+-+---')] for x,y in utfTests: verify( x.encode('utf-7') == y ) try: unicode('+3ADYAA-', 'utf-7') except UnicodeError: pass else: raise TestFailed, "unicode('+3ADYAA-', 'utf-7') failed to raise an exception" verify(unicode('+3ADYAA-', 'utf-7', 'replace') == u'\ufffd') verify(u''.encode('utf-8') == '') verify(u'\u20ac'.encode('utf-8') == '\xe2\x82\xac') verify(u'\ud800\udc02'.encode('utf-8') == '\xf0\x90\x80\x82') verify(u'\ud84d\udc56'.encode('utf-8') == '\xf0\xa3\x91\x96') verify(u'\ud800'.encode('utf-8') == '\xed\xa0\x80') verify(u'\udc00'.encode('utf-8') == '\xed\xb0\x80') verify((u'\ud800\udc02'*1000).encode('utf-8') == '\xf0\x90\x80\x82'*1000) verify(u'\u6b63\u78ba\u306b\u8a00\u3046\u3068\u7ffb\u8a33\u306f' u'\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u4e00' u'\u90e8\u306f\u30c9\u30a4\u30c4\u8a9e\u3067\u3059\u304c' u'\u3001\u3042\u3068\u306f\u3067\u305f\u3089\u3081\u3067' u'\u3059\u3002\u5b9f\u969b\u306b\u306f\u300cWenn ist das' u' Nunstuck git und'.encode('utf-8') == '\xe6\xad\xa3\xe7\xa2\xba\xe3\x81\xab\xe8\xa8\x80\xe3\x81' '\x86\xe3\x81\xa8\xe7\xbf\xbb\xe8\xa8\xb3\xe3\x81\xaf\xe3' '\x81\x95\xe3\x82\x8c\xe3\x81\xa6\xe3\x81\x84\xe3\x81\xbe' '\xe3\x81\x9b\xe3\x82\x93\xe3\x80\x82\xe4\xb8\x80\xe9\x83' '\xa8\xe3\x81\xaf\xe3\x83\x89\xe3\x82\xa4\xe3\x83\x84\xe8' '\xaa\x9e\xe3\x81\xa7\xe3\x81\x99\xe3\x81\x8c\xe3\x80\x81' '\xe3\x81\x82\xe3\x81\xa8\xe3\x81\xaf\xe3\x81\xa7\xe3\x81' '\x9f\xe3\x82\x89\xe3\x82\x81\xe3\x81\xa7\xe3\x81\x99\xe3' '\x80\x82\xe5\xae\x9f\xe9\x9a\x9b\xe3\x81\xab\xe3\x81\xaf' '\xe3\x80\x8cWenn ist das Nunstuck git und') verify(unicode('\xf0\xa3\x91\x96', 'utf-8') == u'\U00023456' ) verify(unicode('\xf0\x90\x80\x82', 'utf-8') == u'\U00010002' ) verify(unicode('\xe2\x82\xac', 'utf-8') == u'\u20ac' ) verify(unicode('hello','ascii') == u'hello') verify(unicode('hello','utf-8') == u'hello') verify(unicode('hello','utf8') == u'hello') verify(unicode('hello','latin-1') == u'hello') try: u'Andr\202 x'.encode('ascii') u'Andr\202 x'.encode('ascii','strict') except ValueError: pass else: raise TestFailed, "u'Andr\202'.encode('ascii') failed to raise an exception" verify(u'Andr\202 x'.encode('ascii','ignore') == "Andr x") verify(u'Andr\202 x'.encode('ascii','replace') == "Andr? x") try: unicode('Andr\202 x','ascii') unicode('Andr\202 x','ascii','strict') except ValueError: pass else: raise TestFailed, "unicode('Andr\202') failed to raise an exception" verify(unicode('Andr\202 x','ascii','ignore') == u"Andr x") verify(unicode('Andr\202 x','ascii','replace') == u'Andr\uFFFD x') verify("\\N{foo}xx".decode("unicode-escape", "ignore") == u"xx") try: "\\".decode("unicode-escape") except ValueError: pass else: raise TestFailed, '"\\".decode("unicode-escape") should fail' try: int(u"\u0200") except UnicodeError: pass else: raise TestFailed, "int(u'\\u0200') failed to raise an exception" verify(u'hello'.encode('ascii') == 'hello') verify(u'hello'.encode('utf-7') == 'hello') verify(u'hello'.encode('utf-8') == 'hello') verify(u'hello'.encode('utf8') == 'hello') verify(u'hello'.encode('utf-16-le') == 'h\000e\000l\000l\000o\000') verify(u'hello'.encode('utf-16-be') == '\000h\000e\000l\000l\000o') verify(u'hello'.encode('latin-1') == 'hello') u = u''.join(map(unichr, range(1024))) for encoding in ('utf-7', 'utf-8', 'utf-16', 'utf-16-le', 'utf-16-be', 'raw_unicode_escape', 'unicode_escape', 'unicode_internal'): verify(unicode(u.encode(encoding),encoding) == u) u = u''.join(map(unichr, range(256))) for encoding in ( 'latin-1', ): try: verify(unicode(u.encode(encoding),encoding) == u) except TestFailed: print '*** codec "%s" failed round-trip' % encoding except ValueError,why: print '*** codec for "%s" failed: %s' % (encoding, why) u = u''.join(map(unichr, range(128))) for encoding in ( 'ascii', ): try: verify(unicode(u.encode(encoding),encoding) == u) except TestFailed: print '*** codec "%s" failed round-trip' % encoding except ValueError,why: print '*** codec for "%s" failed: %s' % (encoding, why) u = u'\U00010001\U00020002\U00030003\U00040004\U00050005' for encoding in ('utf-8', 'utf-16', 'utf-16-le', 'utf-16-be', 'unicode_escape', 'unicode_internal'): verify(unicode(u.encode(encoding),encoding) == u) u = u''.join(map(unichr, range(0,0xd800)+range(0xe000,0x10000))) for encoding in ('utf-8',): verify(unicode(u.encode(encoding),encoding) == u) print 'done.' print 'Testing standard mapping codecs...', print '0-127...', s = ''.join(map(chr, range(128))) for encoding in ( 'cp037', 'cp1026', 'cp437', 'cp500', 'cp737', 'cp775', 'cp850', 'cp852', 'cp855', 'cp860', 'cp861', 'cp862', 'cp863', 'cp865', 'cp866', 'iso8859_10', 'iso8859_13', 'iso8859_14', 'iso8859_15', 'iso8859_2', 'iso8859_3', 'iso8859_4', 'iso8859_5', 'iso8859_6', 'iso8859_7', 'iso8859_9', 'koi8_r', 'latin_1', 'mac_cyrillic', 'mac_latin2', 'cp1250', 'cp1251', 'cp1252', 'cp1253', 'cp1254', 'cp1255', 'cp1256', 'cp1257', 'cp1258', 'cp856', 'cp857', 'cp864', 'cp869', 'cp874', 'mac_greek', 'mac_iceland','mac_roman', 'mac_turkish', 'cp1006', 'iso8859_8', ): try: verify(unicode(s,encoding).encode(encoding) == s) except TestFailed: print '*** codec "%s" failed round-trip' % encoding except ValueError,why: print '*** codec for "%s" failed: %s' % (encoding, why) print '128-255...', s = ''.join(map(chr, range(128,256))) for encoding in ( 'cp037', 'cp1026', 'cp437', 'cp500', 'cp737', 'cp775', 'cp850', 'cp852', 'cp855', 'cp860', 'cp861', 'cp862', 'cp863', 'cp865', 'cp866', 'iso8859_10', 'iso8859_13', 'iso8859_14', 'iso8859_15', 'iso8859_2', 'iso8859_4', 'iso8859_5', 'iso8859_9', 'koi8_r', 'latin_1', 'mac_cyrillic', 'mac_latin2', ): try: verify(unicode(s,encoding).encode(encoding) == s) except TestFailed: print '*** codec "%s" failed round-trip' % encoding except ValueError,why: print '*** codec for "%s" failed: %s' % (encoding, why) print 'done.' print 'Testing Unicode string concatenation...', verify((u"abc" u"def") == u"abcdef") verify(("abc" u"def") == u"abcdef") verify((u"abc" "def") == u"abcdef") verify((u"abc" u"def" "ghi") == u"abcdefghi") verify(("abc" "def" u"ghi") == u"abcdefghi") print 'done.' print 'Testing Unicode printing...', print u'abc' print u'abc', u'def' print u'abc', 'def' print 'abc', u'def' print u'abc\n' print u'abc\n', print u'abc\n', print u'def\n' print u'def\n' print 'done.' def test_exception(lhs, rhs, msg): try: lhs in rhs except TypeError: pass else: raise TestFailed, msg def run_contains_tests(): vereq(u'' in '', True) vereq('' in u'', True) vereq(u'' in u'', True) vereq(u'' in 'abc', True) vereq('' in u'abc', True) vereq(u'' in u'abc', True) vereq(u'\0' in 'abc', False) vereq('\0' in u'abc', False) vereq(u'\0' in u'abc', False) vereq(u'\0' in '\0abc', True) vereq('\0' in u'\0abc', True) vereq(u'\0' in u'\0abc', True) vereq(u'\0' in 'abc\0', True) vereq('\0' in u'abc\0', True) vereq(u'\0' in u'abc\0', True) vereq(u'a' in '\0abc', True) vereq('a' in u'\0abc', True) vereq(u'a' in u'\0abc', True) vereq(u'asdf' in 'asdf', True) vereq('asdf' in u'asdf', True) vereq(u'asdf' in u'asdf', True) vereq(u'asdf' in 'asd', False) vereq('asdf' in u'asd', False) vereq(u'asdf' in u'asd', False) vereq(u'asdf' in '', False) vereq('asdf' in u'', False) vereq(u'asdf' in u'', False) run_contains_tests() | out = BitBucket() print >>out, u'abc' print >>out, u'abc', u'def' print >>out, u'abc', 'def' print >>out, 'abc', u'def' print >>out, u'abc\n' print >>out, u'abc\n', print >>out, u'abc\n', print >>out, u'def\n' print >>out, u'def\n' def test_mul(self): self.checkmethod('__mul__', u'abc', u'', -1) self.checkmethod('__mul__', u'abc', u'', 0) self.checkmethod('__mul__', u'abc', u'abc', 1) self.checkmethod('__mul__', u'abc', u'abcabcabc', 3) self.assertRaises(OverflowError, (10000*u'abc').__mul__, sys.maxint) def test_subscript(self): self.checkmethod('__getitem__', u'abc', u'a', 0) self.checkmethod('__getitem__', u'abc', u'c', -1) self.checkmethod('__getitem__', u'abc', u'a', 0L) self.checkmethod('__getitem__', u'abc', u'abc', slice(0, 3)) self.checkmethod('__getitem__', u'abc', u'abc', slice(0, 1000)) self.checkmethod('__getitem__', u'abc', u'a', slice(0, 1)) self.checkmethod('__getitem__', u'abc', u'', slice(0, 0)) self.assertRaises(TypeError, u"abc".__getitem__, "def") def test_slice(self): self.checkmethod('__getslice__', u'abc', u'abc', 0, 1000) self.checkmethod('__getslice__', u'abc', u'abc', 0, 3) self.checkmethod('__getslice__', u'abc', u'ab', 0, 2) self.checkmethod('__getslice__', u'abc', u'bc', 1, 3) self.checkmethod('__getslice__', u'abc', u'b', 1, 2) self.checkmethod('__getslice__', u'abc', u'', 2, 2) self.checkmethod('__getslice__', u'abc', u'', 1000, 1000) self.checkmethod('__getslice__', u'abc', u'', 2000, 1000) self.checkmethod('__getslice__', u'abc', u'', 2, 1) def test_main(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(UnicodeTest)) test.test_support.run_suite(suite) if __name__ == "__main__": test_main() | def test_fixup(s): s2 = u'\ud800\udc01' test_lecmp(s, s2) s2 = u'\ud900\udc01' test_lecmp(s, s2) s2 = u'\uda00\udc01' test_lecmp(s, s2) s2 = u'\udb00\udc01' test_lecmp(s, s2) s2 = u'\ud800\udd01' test_lecmp(s, s2) s2 = u'\ud900\udd01' test_lecmp(s, s2) s2 = u'\uda00\udd01' test_lecmp(s, s2) s2 = u'\udb00\udd01' test_lecmp(s, s2) s2 = u'\ud800\ude01' test_lecmp(s, s2) s2 = u'\ud900\ude01' test_lecmp(s, s2) s2 = u'\uda00\ude01' test_lecmp(s, s2) s2 = u'\udb00\ude01' test_lecmp(s, s2) s2 = u'\ud800\udfff' test_lecmp(s, s2) s2 = u'\ud900\udfff' test_lecmp(s, s2) s2 = u'\uda00\udfff' test_lecmp(s, s2) s2 = u'\udb00\udfff' test_lecmp(s, s2) | 2297ca3284c57a984832427dbc81d0141ceff94c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2297ca3284c57a984832427dbc81d0141ceff94c/test_unicode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
904,
416,
12,
87,
4672,
272,
22,
273,
582,
8314,
1100,
17374,
64,
1100,
71,
1611,
11,
1842,
67,
298,
9625,
12,
87,
16,
272,
22,
13,
272,
22,
273,
582,
8314,
1100,
29,
713... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
904,
416,
12,
87,
4672,
272,
22,
273,
582,
8314,
1100,
17374,
64,
1100,
71,
1611,
11,
1842,
67,
298,
9625,
12,
87,
16,
272,
22,
13,
272,
22,
273,
582,
8314,
1100,
29,
713... |
try: newob.id = ob.getId() except AttributeError: pass | id = ob.id if callable(id): id = id() try: newob._setId(id) except AttributeError: newob.id = id | def convert(self, ob): ob = aq_base(ob) k = self._klass if hasattr(k, '__basicnew__'): newob = k.__basicnew__() else: newob = new.instance(k, {}) try: newob.id = ob.getId() except AttributeError: pass newob.__dict__.update(ob.__dict__) if hasattr(newob, '_objects'): # Clear the children. for info in newob._objects: del newob.__dict__[info['id']] newob._objects = () if hasattr(newob, '_container'): # Clear the children. newob._container.clear() return newob | 4633d1b5c9f15bd8eccf2975cad17434500555bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1843/4633d1b5c9f15bd8eccf2975cad17434500555bb/migrate_ptk.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
12,
2890,
16,
3768,
4672,
3768,
273,
279,
85,
67,
1969,
12,
947,
13,
417,
273,
365,
6315,
22626,
309,
3859,
12,
79,
16,
4940,
13240,
2704,
7250,
4672,
394,
947,
273,
417,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
12,
2890,
16,
3768,
4672,
3768,
273,
279,
85,
67,
1969,
12,
947,
13,
417,
273,
365,
6315,
22626,
309,
3859,
12,
79,
16,
4940,
13240,
2704,
7250,
4672,
394,
947,
273,
417,
16186,
... |
opcodes = diff2._get_opcodes(['A', 'B b'], ['A', 'B b'], | opcodes = Diff._get_opcodes(['A', 'B b'], ['A', 'B b'], | def test_space_changes(self): opcodes = diff2._get_opcodes(['A', 'B b'], ['A', 'B b'], ignore_space_changes=0) self.assertEqual(('equal', 0, 1, 0, 1), opcodes.next()) self.assertEqual(('replace', 1, 2, 1, 2), opcodes.next()) | f0e6a3afeb9f648f246fa50a5aac86386a0128b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f0e6a3afeb9f648f246fa50a5aac86386a0128b9/diff.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2981,
67,
6329,
12,
2890,
4672,
1061,
7000,
273,
13008,
6315,
588,
67,
556,
7000,
12,
3292,
37,
2187,
296,
38,
324,
17337,
10228,
37,
2187,
296,
38,
225,
324,
17337,
2305,
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,
1842,
67,
2981,
67,
6329,
12,
2890,
4672,
1061,
7000,
273,
13008,
6315,
588,
67,
556,
7000,
12,
3292,
37,
2187,
296,
38,
324,
17337,
10228,
37,
2187,
296,
38,
225,
324,
17337,
2305,
67... |
% dst) | % dst) | def copyfile(src, dst, basedir): abssrc, absdst = [util.canonpath(basedir, basedir, x) for x in [src, dst]] if os.path.exists(absdst): raise util.Abort(_("cannot create %s: destination already exists") % dst) dstdir = os.path.dirname(absdst) if dstdir and not os.path.isdir(dstdir): try: os.makedirs(dstdir) except IOError: raise util.Abort( _("cannot create %s: unable to create destination directory") % dst) util.copyfile(abssrc, absdst) | fd9ae6d76bfad317319f3406fa5aff5454ed274e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11312/fd9ae6d76bfad317319f3406fa5aff5454ed274e/patch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29310,
12,
4816,
16,
3046,
16,
15573,
4672,
1223,
1049,
1310,
16,
2417,
11057,
273,
306,
1367,
18,
4169,
265,
803,
12,
31722,
16,
15573,
16,
619,
13,
364,
619,
316,
306,
4816,
16,
3046... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29310,
12,
4816,
16,
3046,
16,
15573,
4672,
1223,
1049,
1310,
16,
2417,
11057,
273,
306,
1367,
18,
4169,
265,
803,
12,
31722,
16,
15573,
16,
619,
13,
364,
619,
316,
306,
4816,
16,
3046... |
neighbors = open_ports[(connection.source.name, 'output')] | key = (connection.source.name, 'output') if key not in open_ports: continue neighbors = open_ports[key] | def create_ungroup(self, full_pipeline, module_id): | efce38d0a227c8eb1e279ac00f9a09a317b8a8ed /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6341/efce38d0a227c8eb1e279ac00f9a09a317b8a8ed/controller.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
318,
1655,
12,
2890,
16,
1983,
67,
14511,
16,
1605,
67,
350,
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... | [
1,
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,
752,
67,
318,
1655,
12,
2890,
16,
1983,
67,
14511,
16,
1605,
67,
350,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
if (game.state.remkl + len(game.state.kcmdr) + game.state.nscrem)==0: | if (game.state.remkl + len(game.state.kcmdr) + game.state.nscrem)<=0: | def torps(): "Launch photon torpedo salvo." course = [] game.ididit = False if damaged(DPHOTON): prout(_("Photon tubes damaged.")) scanner.chew() return if game.torps == 0: prout(_("No torpedoes left.")) scanner.chew() return # First, get torpedo count while True: scanner.next() if scanner.token == "IHALPHA": huh() return elif scanner.token == "IHEOL" or not scanner.waiting(): prout(_("%d torpedoes left.") % game.torps) scanner.chew() proutn(_("Number of torpedoes to fire- ")) continue # Go back around to get a number else: # key == "IHREAL" n = scanner.int() if n <= 0: # abort command scanner.chew() return if n > MAXBURST: scanner.chew() prout(_("Maximum of %d torpedoes per burst.") % MAXBURST) return if n > game.torps: scanner.chew() # User requested more torps than available continue # Go back around break # All is good, go to next stage # Next, get targets target = [] for i in range(n): key = scanner.next() if i==0 and key == "IHEOL": break; # no coordinate waiting, we will try prompting if i==1 and key == "IHEOL": # direct all torpedoes at one target while i < n: target.append(target[0]) course.append(course[0]) i += 1 break scanner.push(scanner.token) target.append(scanner.getcoord()) if target[-1] == None: return course.append(targetcheck(target[-1])) if course[-1] == None: return scanner.chew() if len(target) == 0: # prompt for each one for i in range(n): proutn(_("Target sector for torpedo number %d- ") % (i+1)) scanner.chew() target.append(scanner.getcoord()) if target[-1] == None: return course.append(targetcheck(target[-1])) if course[-1] == None: return game.ididit = True # Loop for moving <n> torpedoes for i in range(n): if game.condition != "docked": game.torps -= 1 dispersion = (randreal()+randreal())*0.5 -0.5 if math.fabs(dispersion) >= 0.47: # misfire! dispersion *= randreal(1.2, 2.2) if n > 0: prouts(_("***TORPEDO NUMBER %d MISFIRES") % (i+1)) else: prouts(_("***TORPEDO MISFIRES.")) skip(1) if i < n: prout(_(" Remainder of burst aborted.")) if withprob(0.2): prout(_("***Photon tubes damaged by misfire.")) game.damage[DPHOTON] = game.damfac * randreal(1.0, 3.0) break if game.shldup or game.condition == "docked": dispersion *= 1.0 + 0.0001*game.shield torpedo(game.sector, course[i], dispersion, number=i, nburst=n) if game.alldone or game.state.galaxy[game.quadrant.i][game.quadrant.j].supernova: return if (game.state.remkl + len(game.state.kcmdr) + game.state.nscrem)==0: finish(FWON); | b599a12ccbd7f0b4dbe131e77576649372d3be69 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3176/b599a12ccbd7f0b4dbe131e77576649372d3be69/sst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8934,
1121,
13332,
315,
9569,
24542,
265,
8934,
1845,
83,
12814,
12307,
1199,
4362,
273,
5378,
7920,
18,
350,
350,
305,
273,
1083,
309,
302,
301,
11349,
12,
8640,
44,
1974,
673,
4672,
45... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8934,
1121,
13332,
315,
9569,
24542,
265,
8934,
1845,
83,
12814,
12307,
1199,
4362,
273,
5378,
7920,
18,
350,
350,
305,
273,
1083,
309,
302,
301,
11349,
12,
8640,
44,
1974,
673,
4672,
45... |
Indices[0] = i; | Indices[0] = i | def main(): Comm = Epetra.PyComm(); args = sys.argv[1:] if len(args) == 0: Type = "Amesos_Lapack" else: Type = args[0]; NumGlobalRows = 10; Map = Epetra.Map(NumGlobalRows, 0, Comm); LHS_exact = Epetra.MultiVector(Map, 1); LHS = Epetra.MultiVector(Map, 1); RHS = Epetra.MultiVector(Map, 1); Matrix = Epetra.CrsMatrix(Epetra.Copy, Map, 0); Indices = Epetra.IntSerialDenseVector(3); Values = Epetra.SerialDenseVector(3); Values[0] = 2.0; Values[1] = -1.0; Values[2] = -1.0; NumLocalRows = Map.NumMyElements() # Builds the matrix (1D Laplacian) for ii in range(0, NumLocalRows): i = Map.GID(ii) Indices[0] = i; if i == 0: NumEntries = 2; Indices[1] = i + 1; elif i == NumGlobalRows - 1: NumEntries = 2; Indices[1] = i - 1; else: NumEntries = 3; Indices[1] = i - 1; Indices[2] = i + 1; Matrix.InsertGlobalValues(i, NumEntries, Values, Indices); ierr = Matrix.FillComplete(); LHS_exact.Random(); Matrix.Multiply(False, LHS_exact, RHS); LHS.PutScalar(1.0); Problem = Epetra.LinearProblem(Matrix, LHS, RHS); if Type == "Amesos_Lapack": Solver = Amesos.Lapack(Problem); elif Type == "Amesos_Klu": Solver = Amesos.Klu(Problem); elif Type == "Amesos_Umfpack": Solver = Amesos.Umfpack(Problem); elif Type == "Amesos_Pardiso": Solver = Amesos.Umfpack(Problem); elif Type == "Amesos_Taucs": Solver = Amesos.Umfpack(Problem); elif Type == "Amesos_Superlu": Solver = Amesos.Superlu(Problem); elif Type == "Amesos_Superludist": Solver = Amesos.Superludist(Problem); elif Type == "Amesos_Dscpack": Solver = Amesos.Dscpack(Problem); elif Type == "Amesos_Mumps": Solver = Amesos.Mumps(Problem); else: print 'Selected solver (%s) not available' % Type PrintHelp(); sys.exit(-2); AmesosList = { "PrintStatus": True, "PrintTiming": True }; Solver.SetParameters(AmesosList); Solver.SymbolicFactorization(); Solver.NumericFactorization(); ierr = Solver.Solve(); print "Solver.Solve() return code = ", ierr del Solver | b0de99b594baede77af9aff7c1b994a5d198a226 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1130/b0de99b594baede77af9aff7c1b994a5d198a226/exSolvers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
16854,
273,
512,
6951,
354,
18,
9413,
12136,
5621,
225,
833,
273,
2589,
18,
19485,
63,
21,
26894,
309,
562,
12,
1968,
13,
422,
374,
30,
1412,
273,
315,
9864,
281,
538,
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,
2774,
13332,
16854,
273,
512,
6951,
354,
18,
9413,
12136,
5621,
225,
833,
273,
2589,
18,
19485,
63,
21,
26894,
309,
562,
12,
1968,
13,
422,
374,
30,
1412,
273,
315,
9864,
281,
538,
67,... |
self.help.hide() | self.help.show() | def customize_installer(self): """Customizing logo and images.""" # images stuff import locale self.lang = locale.getdefaultlocale()[0].split('_')[0] messages_uri = os.path.join(PATH, 'htmldocs/', self.distro, self.lang, 'messages.txt') if os.path.exists(messages_uri): pass else: messages_uri = os.path.join(PATH, 'htmldocs/', self.distro, 'en', 'messages.txt') self.install_image = 0 PIXMAPSDIR = os.path.join(GLADEDIR, 'pixmaps', self.distro) self.total_images = glob.glob("%s/snapshot*.png" % PIXMAPSDIR) self.total_images.reverse() self.total_messages = open(messages_uri).readlines() | 9bfd21fbc5963e59248fe62b6d1feadd6c0494e2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2662/9bfd21fbc5963e59248fe62b6d1feadd6c0494e2/gtkui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20236,
67,
20163,
12,
2890,
4672,
3536,
3802,
6894,
19128,
471,
4602,
12123,
468,
4602,
10769,
1930,
2573,
365,
18,
4936,
273,
2573,
18,
588,
1886,
6339,
1435,
63,
20,
8009,
4939,
2668,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20236,
67,
20163,
12,
2890,
4672,
3536,
3802,
6894,
19128,
471,
4602,
12123,
468,
4602,
10769,
1930,
2573,
365,
18,
4936,
273,
2573,
18,
588,
1886,
6339,
1435,
63,
20,
8009,
4939,
2668,
... |
- the *radial distance* (``rho``), | - the *radial distance* (``radius``) from the `z`-axis - the *azimuth angle* (``azimuth``) from the positive `x`-axis | def gen_transform(self, r=None, theta=None, phi=None): """ EXAMPLE:: sage: T = Spherical('r', ['theta', 'phi']) sage: T.gen_transform(r=var('r'), theta=var('theta'), phi=var('phi')) (r*sin(theta)*cos(phi), r*sin(phi)*sin(theta), r*cos(theta)) """ return (r * sin(theta) * cos(phi), r * sin(theta) * sin(phi), r * cos(theta)) | ae9bf5e0d28a56cbf9d189e5545c9a8340d806de /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/ae9bf5e0d28a56cbf9d189e5545c9a8340d806de/plot3d.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3157,
67,
6547,
12,
2890,
16,
436,
33,
7036,
16,
7338,
33,
7036,
16,
7706,
33,
7036,
4672,
3536,
5675,
21373,
2866,
225,
272,
410,
30,
399,
273,
348,
21570,
2668,
86,
2187,
10228,
1448... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3157,
67,
6547,
12,
2890,
16,
436,
33,
7036,
16,
7338,
33,
7036,
16,
7706,
33,
7036,
4672,
3536,
5675,
21373,
2866,
225,
272,
410,
30,
399,
273,
348,
21570,
2668,
86,
2187,
10228,
1448... |
return None | return None, False | def parselogentry(orig_paths, revnum, author, date, message): self.ui.debug("parsing revision %d (%d changes)\n" % (revnum, len(orig_paths))) | c6a1068cdcfcb9641c61c95fff848144537955b7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11312/c6a1068cdcfcb9641c61c95fff848144537955b7/subversion.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
779,
1786,
717,
4099,
12,
4949,
67,
4481,
16,
5588,
2107,
16,
2869,
16,
1509,
16,
883,
4672,
365,
18,
4881,
18,
4148,
2932,
24979,
6350,
738,
72,
6142,
72,
3478,
5153,
82,
6,
738,
26... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
779,
1786,
717,
4099,
12,
4949,
67,
4481,
16,
5588,
2107,
16,
2869,
16,
1509,
16,
883,
4672,
365,
18,
4881,
18,
4148,
2932,
24979,
6350,
738,
72,
6142,
72,
3478,
5153,
82,
6,
738,
26... |
debugging = False | debugging, just_flex = False, False | def main(argv): debugging = False t0 = time.time() gamelists = ['condensed_games', 'condensed_flex'] if len(argv) > 1: debugging = True gamelist = ['terse_games'] games = [] for gamelist in gamelists: games.extend(LoadGames(debugging, gamelist)) t1 = time.time() print 'games loaded time', t1 - t0 RenderTopPage(games, debugging) for idx, exp_abbrev in enumerate(EXP_ABBREV): RenderGameset(FixedExpansionGameSet(games, idx), 'output/' + exp_abbrev, debugging) | 57a620ce7c222ab1bc56811e70ce40710d67be1d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10357/57a620ce7c222ab1bc56811e70ce40710d67be1d/compute_stats.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
4672,
10450,
16,
2537,
67,
27592,
273,
1083,
16,
1083,
268,
20,
273,
813,
18,
957,
1435,
314,
9925,
1486,
273,
10228,
10013,
28003,
67,
75,
753,
2187,
296,
10013,
28003,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
4672,
10450,
16,
2537,
67,
27592,
273,
1083,
16,
1083,
268,
20,
273,
813,
18,
957,
1435,
314,
9925,
1486,
273,
10228,
10013,
28003,
67,
75,
753,
2187,
296,
10013,
28003,... |
"HUGETLB_SHARE=1", pre)) | "HUGETLB_SHARE=%d" % i, pre)) | def elflink_rw_and_share_test(cmd, pre=""): """ Run the ordinary linkhuge_rw tests with sharing enabled """ clear_hpages() for mode in ("R", "W", "RW"): for i in range(2): do_test(cmd, combine("HUGETLB_ELFMAP=" + mode + " " + \ "HUGETLB_SHARE=1", pre)) clear_hpages() | 8b47c3cf275fa7bed790fd6cb196c14d48b64112 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3715/8b47c3cf275fa7bed790fd6cb196c14d48b64112/run_tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
415,
74,
1232,
67,
21878,
67,
464,
67,
14419,
67,
3813,
12,
4172,
16,
675,
1546,
6,
4672,
3536,
1939,
326,
4642,
2101,
1692,
76,
21627,
67,
21878,
7434,
598,
21001,
3696,
3536,
2424,
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,
415,
74,
1232,
67,
21878,
67,
464,
67,
14419,
67,
3813,
12,
4172,
16,
675,
1546,
6,
4672,
3536,
1939,
326,
4642,
2101,
1692,
76,
21627,
67,
21878,
7434,
598,
21001,
3696,
3536,
2424,
6... |
self.logger.warning('Imaging: While processing result %s for %s : %s' % (MACAddress, result, e)) | self.logger.warning('Imaging: While processing result %s for %s : %s' % (result, MACAddress, e)) | def onSuccess(result): try: if result[0]: self.myUUIDCache.set(result[1]['uuid'], MACAddress, result[1]['shortname'], result[1]['fqdn']) self.logger.info('Imaging: Updating cache for %s' % (MACAddress)) return result[1] except Exception, e: self.logger.warning('Imaging: While processing result %s for %s : %s' % (MACAddress, result, e)) | 433412e00fa04ae64b63408fab93248fec79b319 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5988/433412e00fa04ae64b63408fab93248fec79b319/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20613,
12,
2088,
4672,
775,
30,
309,
563,
63,
20,
14542,
365,
18,
4811,
5562,
1649,
18,
542,
12,
2088,
63,
21,
23962,
7080,
17337,
14246,
1887,
16,
563,
63,
21,
23962,
28650,
17337,
56... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
775,
30,
309,
563,
63,
20,
14542,
365,
18,
4811,
5562,
1649,
18,
542,
12,
2088,
63,
21,
23962,
7080,
17337,
14246,
1887,
16,
563,
63,
21,
23962,
28650,
17337,
56... |
rooted_system_dir = client_root + system_dir | def _MakeLinkFromMirrorToRealLocation(system_dir, client_root, system_links): """Create a link under client root what will resolve to system dir on server. See comments for CompilerDefaults class for rationale. Args: system_dir: a path such as /usr/include or /usr/lib/gcc/i486-linux-gnu/4.0.3/include client_root: a path such as /dev/shm/tmpX.include_server-X-1 system_links: a list of paths under client_root; each denotes a symlink The link is created only if necessary. So, /usr/include/gcc/i486-linux-gnu/4.0.3/include is not created if /usr/include is already in place, since it's a prefix of the longer path. If a link is created, the symlink name will be appended to system_links. For example, if system_dir is '/usr/include' and client_root is '/dev/shm/tmpX.include_server-X-1', then this function will create a symlink in /dev/shm/tmpX.include_server-X-1/usr/include which points to ../../../../../../../../../../../../usr/include, and it will append '/dev/shm/tmpX.include_server-X-1/usr/include' to system_links. """ if not system_dir.startswith('/'): raise ValueError("Expected absolute path, but got '%s'." % system_dir) if os.path.realpath(system_dir) != system_dir: raise NotCoveredError( "Default compiler search path '%s' must be a realpath." %s) rooted_system_dir = client_root + system_dir # Typical values for rooted_system_dir: # /dev/shm/tmpX.include_server-X-1/usr/include real_prefix, is_link = _RealPrefix(rooted_system_dir) parent = os.path.dirname(rooted_system_dir) if real_prefix == rooted_system_dir: # rooted_system_dir already exists as a real (non-symlink) path. # Make rooted_system_dir a link. # # For example, this could happen if /usr/include/c++/4.0 and # /usr/include are both default system directories. # First we'd call this function with /usr/include/c++/4.0, # and it would call os.mkdirdirs() to create # /dev/shm/tmpX.include_server-X-1/usr/include/c++, # and then it would create a symlink named 4.0 within that. # Then we'd call this function again with /usr/include. # In this case, we can replace the whole subtree with a single symlink # at /dev/shm/tmpX.include_server-X-1/usr/include. shutil.rmtree(rooted_system_dir) system_links[:] = filter(lambda path : not path.startswith(rooted_system_dir), system_links) elif real_prefix == parent: # The really constructed path does not extend beyond the parent directory, # so we're all set to create the link if it's not already there. if os.path.exists(rooted_system_dir): assert os.path.islink(rooted_system_dir) return elif not is_link: os.makedirs(parent) else: # A link above real_prefix has already been created with this routine. return assert _RealPrefix(parent) == (parent, False), parent depth = len([c for c in system_dir if c == '/']) # The more directories on the path system_dir, the more '../' need to # appended. We add enough '../' to get to the root directory. It's OK # if we have too many, since '..' in the root directory points back to # the root directory. # TODO(klarlund,fergus): do this in a more principled way. # This probably requires changing the protocol. os.symlink('../' * (basics.MAX_COMPONENTS_IN_SERVER_ROOT + depth) + system_dir[1:], # remove leading '/' rooted_system_dir) system_links.append(rooted_system_dir) | a92f6458ee0d0ec18eb75f96ad74a1bfd349438f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4521/a92f6458ee0d0ec18eb75f96ad74a1bfd349438f/compiler_defaults.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6464,
2098,
1265,
13035,
774,
6955,
2735,
12,
4299,
67,
1214,
16,
1004,
67,
3085,
16,
2619,
67,
7135,
4672,
3536,
1684,
279,
1692,
3613,
1004,
1365,
4121,
903,
2245,
358,
2619,
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,
389,
6464,
2098,
1265,
13035,
774,
6955,
2735,
12,
4299,
67,
1214,
16,
1004,
67,
3085,
16,
2619,
67,
7135,
4672,
3536,
1684,
279,
1692,
3613,
1004,
1365,
4121,
903,
2245,
358,
2619,
1577... | |
result.AppendOutput(FResult.FAILED_ANIMATION, message) | result.AppendOutput(FResult.FAILED_ANIMATION, message) | def __CompileResult(self, testProcedure, execution): if (execution == None): return # Prepare the result structure. result = FResult() history = self.__GetHistoryFilenames() try: currentIndex = history.index(execution.GetExecutionDir()) previousIndex = currentIndex + 1 if (previousIndex >= len(history)): previous = None else: previousPath = os.path.join(history[previousIndex], EXECUTION_FILENAME) previous = self.Load(previousPath) except ValueError, e: print "<FTest> execution not in history" previous = None if ((previous != None) and (previous.GetResult() != None) and (previous.GetResult().IsOverriden()) and (previous == execution)): result.Override(previous.GetResult().GetResult()) else: # checks the executions folder = self.__SearchBlessHash(testProcedure) if ((folder != None) and (self.__HasBlessedExecution(folder, execution))): result.SetPassFromExecution(True) # checks the individual outputs passed = True for step, app, op, setting in testProcedure.GetStepGenerator(): outputs = execution.GetOutputLocation(step) if (outputs == None): result.AppendOutput(FResult.IGNORED_NONE) elif (type(outputs) is types.ListType and op != VALIDATE): failed = False for entry in outputs: if (not os.path.isfile(entry)): result.AppendOutput(FResult.FAILED_MISSING) failed = True passed = False break if (not failed): if (len(outputs) == 1): # still ext = FUtils.GetExtension(outputs[0]) if (FUtils.IsImageFile(ext)): blessed, compareResults = self.__HasBlessed( outputs[0]) if (blessed == None): result.AppendOutput( FResult.IGNORED_NO_BLESS_IMAGE) else: message = FGlobals.imageComparator.GetMessage( compareResults) if (blessed == ""): result.AppendOutput(FResult.FAILED_IMAGE, message) passed = False else: result.AppendOutput(FResult.PASSED_IMAGE, message) else: result.AppendOutput(FResult.IGNORED_TYPE) else: # animation blessed, compareResults = self.__HasBlessedAnimation( outputs) if (blessed == None): result.AppendOutput( FResult.IGNORED_NO_BLESS_ANIMATION) else: message = FGlobals.imageComparator.GetMessage( compareResults) if (blessed == ""): result.AppendOutput(FResult.FAILED_ANIMATION, message) passed = False else: result.AppendOutput(FResult.PASSED_ANIMATION, message) else: # validation if (execution.GetErrorCount(step) == 0): result.AppendOutput(FResult.PASSED_VALIDATION) else: result.AppendOutput(FResult.FAILED_VALIDATION) passed = False result.SetPassFromOutput(passed) | 812120875bbb3b45be5fedb1694c62d50a11c572 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11176/812120875bbb3b45be5fedb1694c62d50a11c572/FTest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9937,
1253,
12,
2890,
16,
1842,
17213,
16,
4588,
4672,
309,
261,
16414,
422,
599,
4672,
327,
225,
468,
7730,
326,
563,
3695,
18,
563,
273,
478,
1253,
1435,
225,
4927,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9937,
1253,
12,
2890,
16,
1842,
17213,
16,
4588,
4672,
309,
261,
16414,
422,
599,
4672,
327,
225,
468,
7730,
326,
563,
3695,
18,
563,
273,
478,
1253,
1435,
225,
4927,
273,
365,
1... |
and hasattr(self.readingOperatorClass, "splitEntityTone")): | and hasattr(self.readingOperatorClass, "splitEntityTone") and hasattr(self.readingOperatorClass, "getReadingEntities")): | def testGetTonalEntityOfSplitEntityToneIsIdentity(self): """ Test if the composition of C{getTonalEntity()} and C{splitEntityTone()} returns the original value for all entities returned by C{getReadingEntities()}. """ if not (hasattr(self.readingOperatorClass, "getTonalEntity") and hasattr(self.readingOperatorClass, "splitEntityTone")): return | 3fae0e33b8734fcf813a0594f0def029b4fe4c3b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11128/3fae0e33b8734fcf813a0594f0def029b4fe4c3b/readingoperator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
967,
56,
9528,
1943,
951,
5521,
1943,
56,
476,
2520,
4334,
12,
2890,
4672,
3536,
7766,
309,
326,
16919,
434,
385,
95,
588,
56,
9528,
1943,
17767,
471,
385,
95,
4939,
1943,
56,
47... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
967,
56,
9528,
1943,
951,
5521,
1943,
56,
476,
2520,
4334,
12,
2890,
4672,
3536,
7766,
309,
326,
16919,
434,
385,
95,
588,
56,
9528,
1943,
17767,
471,
385,
95,
4939,
1943,
56,
47... |
import time if self.basename == "konqueror": os.system(self.name + " --silent &") else: os.system(self.name + " -d &") time.sleep(PROCESS_CREATION_DELAY) rc = os.system(cmd) | if _iscommand("konqueror"): rc = os.system(self.name + " --silent '%s' &" % url) elif _iscommand("kfm"): rc = os.system(self.name + " -d '%s'" % url) | def _remote(self, action): cmd = "kfmclient %s >/dev/null 2>&1" % action rc = os.system(cmd) if rc: import time if self.basename == "konqueror": os.system(self.name + " --silent &") else: os.system(self.name + " -d &") time.sleep(PROCESS_CREATION_DELAY) rc = os.system(cmd) return not rc | 2e17d91b4cf4bb0fb2a60b21783a4491e2a33017 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/2e17d91b4cf4bb0fb2a60b21783a4491e2a33017/webbrowser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7222,
12,
2890,
16,
1301,
4672,
1797,
273,
315,
79,
25089,
2625,
738,
87,
405,
19,
5206,
19,
2011,
576,
22393,
21,
6,
738,
1301,
4519,
273,
1140,
18,
4299,
12,
4172,
13,
309,
45... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7222,
12,
2890,
16,
1301,
4672,
1797,
273,
315,
79,
25089,
2625,
738,
87,
405,
19,
5206,
19,
2011,
576,
22393,
21,
6,
738,
1301,
4519,
273,
1140,
18,
4299,
12,
4172,
13,
309,
45... |
600).rendevous(*all) self.client(server_ip, test, test_time, num_streams) | 600).rendezvous(*all) self.client(server_ip, test, test_time, num_streams, test_specific_args, cpu_affinity) | def run_once(self, server_ip, client_ip, role, test='TCP_STREAM', test_time=10, stream_list=[1]): if test not in self.valid_tests: raise error.TestError('invalid test specified') self.role = role self.test = test self.test_time = test_time self.stream_list = stream_list | 49de5e0d0b50e0987eaa02005bcaf93491bae0f3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12268/49de5e0d0b50e0987eaa02005bcaf93491bae0f3/netperf2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
8243,
12,
2890,
16,
1438,
67,
625,
16,
1004,
67,
625,
16,
2478,
16,
1842,
2218,
13891,
67,
13693,
2187,
1842,
67,
957,
33,
2163,
16,
1407,
67,
1098,
22850,
21,
65,
4672,
30... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
8243,
12,
2890,
16,
1438,
67,
625,
16,
1004,
67,
625,
16,
2478,
16,
1842,
2218,
13891,
67,
13693,
2187,
1842,
67,
957,
33,
2163,
16,
1407,
67,
1098,
22850,
21,
65,
4672,
30... |
self.application.MessageBox(title = _("Load Palette"), message = _("\nCannot load palette %(filename)s!\n") % {'filename': filename}) | self.application.MessageBox(title=_("Load Palette"), message=_("\nCannot load palette %(filename)s!\n") % {'filename': filename}) | def LoadPalette(self, filename = None): if not filename: directory = config.user_palettes if not directory: directory = fs.gethome() filename, sysfilename=dialogman.getGenericOpenFilename(_("Load Palette"), app.managers.dialogmanager.palette_types, initialdir = directory, initialfile = filename) if not filename: return | 5bd05aab08ecc99debb8be46af1003105e4183ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3123/5bd05aab08ecc99debb8be46af1003105e4183ab/mainwindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4444,
25863,
12,
2890,
16,
1544,
273,
599,
4672,
309,
486,
1544,
30,
1867,
273,
642,
18,
1355,
67,
15081,
278,
1078,
309,
486,
1867,
30,
1867,
273,
2662,
18,
75,
546,
1742,
1435,
225,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4444,
25863,
12,
2890,
16,
1544,
273,
599,
4672,
309,
486,
1544,
30,
1867,
273,
642,
18,
1355,
67,
15081,
278,
1078,
309,
486,
1867,
30,
1867,
273,
2662,
18,
75,
546,
1742,
1435,
225,
... |
sage: v = FormalSum([(1,2), (5, 'a'), (-3, 7)]); v 5*a + 2 - 3*7 sage: v[0] (5, 'a') | sage: v = FormalSum([(1,2), (5, 1000), (-3, 7)]); v 2 - 3*7 + 5*1000 sage: v[0] (1, 2) | def __getitem__(self, n): """ EXAMPLES:: | 343a27258123d6b4bcdd414db630c96bc707ebdd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/343a27258123d6b4bcdd414db630c96bc707ebdd/formal_sum.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
290,
4672,
3536,
5675,
8900,
11386,
2866,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
290,
4672,
3536,
5675,
8900,
11386,
2866,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
offsets specified as an optional argument | offsets specified as an optional argument. The input args are filename,gpsRefTime,timescale,useLogColors,colormap each of which is NOT manditory. | def graphdata(self,filename='',gpsReferenceFloat=0.0,timescale='second',useLogColors=True,myColorMap='jet'): """ This method uses matplotlib.py to make plots of curves contained in this list! Currently all plotting functions are hard wired to the method! Method needs to have relative offsets specified as an optional argument """ if self.totalCount==0: sys.stdout.write("Omitting this plot no triggers to plot.\n"); return #This code creates a scatter plot in X windows #If pylab loads Ok. brightX=[] brightY=[] brightP=[] minX=gpsReferenceFloat line2plot=[] brightSpotX=[] brightSpotY=[] brightSpotZ=[] start=True # If the GPSreference for plot is given do not rescan data # automatically. if (gpsReferenceFloat == 0): for element in self.curves: for point in element.getKurveDataBlock_HumanReadable(): if start: minX=float(point[0]) start=False if minX >= float(point[0]): minX = float(point[0]) #Convert the time (X) axis scale to given above argument conversionFactor=1; timeLabel="(seconds)" if timescale.lower().__contains__("hour"): conversionFactor=60*60 timeLabel="(hours)" if timescale.lower().__contains__("day"): conversionFactor=60*60*24 timeLabel="(days)" spinner=progressSpinner(self.verboseMode) spinner.setTag('Plotting') elementIPlist=[] for element in self.curves: xtmp=[] ytmp=[] ztmp=[] bP=element.getBrightPixelAndStats() brightSpotX.append((bP[0][2].getAsFloat()-minX)/conversionFactor) brightSpotY.append(bP[0][3]) brightSpotZ.append(float(bP[0][4]-bP[1]).__abs__()/bP[2]) #Get curve stats IP for point in element.getKurveDataBlock_HumanReadable(): xtmp.append((float(point[0])-minX)/conversionFactor) ytmp.append(float(point[1])) ztmp.append(float(point[2])) elementIP=element.getKurveHeader()[2] elementIPlist.append(elementIP) line2plot.append([xtmp,ytmp,ztmp,elementIP]) del xtmp del ytmp del ztmp spinner.updateSpinner() spinner.closeSpinner() #Set jet colormap #Determine mapping of IP to colors maxValue=max(elementIPlist) minValue=min(elementIPlist) fig=pylab.figure() pylab.cm.ScalarMappable().set_cmap(myColorMap) #pylab.jet() useLogColors=True linearColorScale=pylab.matplotlib.colors.normalize(minValue,maxValue) if (minValue > 0) and (maxValue > 0): logColorScale=pylab.matplotlib.colors.normalize(math.log(minValue),math.log(maxValue)) else: logColorScale=linearColorScale currentPalette=pylab.get_cmap() for entry in line2plot: if useLogColors: myRed,myGreen,myBlue,myAlpha=currentPalette( logColorScale(math.log(entry[3]))) else: myRed,myGreen,myBlue,myAlpha=currentPalette( linearColorScale(entry[3])) pylab.plot(entry[0],entry[1],color=(myRed,myGreen,myBlue)) #Normalize the brightSpotZ max -> 0..5 normalizeZscoreTo=100 if brightSpotZ.__len__() < 1: factor=1; else: factor=normalizeZscoreTo/(max(brightSpotZ)) tmpZ=[] for entry in brightSpotZ: tmpZ.append(entry*factor) brightSpotZ=tmpZ pylab.scatter(brightSpotX,brightSpotY,brightSpotZ,color='black',marker='o') pylab.xlabel(str("Time %s"%(timeLabel))) pylab.ylabel("Freq (Hz)") pylab.figtext(0.01,0.95,"GPS %9.2f"%(minX)) textLocX=0.80 if not useLogColors: pylab.figtext(textLocX,0.025,str(myColorMap).upper()+":Linear Coloring") else: pylab.figtext(textLocX,0.025,str(myColorMap).upper()+":Log Coloring") if ((filename.upper()=='') or (filename.upper()=='AUTO')): [name,extension]=os.path.splitext(self.filename[0]) figtitle=os.path.basename(name) else: figtitle=filename pylab.title("%s"%(figtitle)) pylab.grid(True) if (filename==''): pylab.show() pylab.close() else: if (filename.upper()=='AUTO'): [fullpath,extension]=os.path.splitext(self.filename[0]) filename=os.path.basename(fullpath)+'.png' pylab.savefig(filename) | 200b2ee25a4ba9a59c190b99bab9281409dd3222 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5758/200b2ee25a4ba9a59c190b99bab9281409dd3222/tracksearchutils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2667,
892,
12,
2890,
16,
3459,
2218,
2187,
75,
1121,
2404,
4723,
33,
20,
18,
20,
16,
8584,
31402,
2218,
8538,
2187,
1202,
1343,
12570,
33,
5510,
16,
4811,
2957,
863,
2218,
78,
278,
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,
2667,
892,
12,
2890,
16,
3459,
2218,
2187,
75,
1121,
2404,
4723,
33,
20,
18,
20,
16,
8584,
31402,
2218,
8538,
2187,
1202,
1343,
12570,
33,
5510,
16,
4811,
2957,
863,
2218,
78,
278,
11,... |
sub_key = OpenKey(key, "sub_key") | sub_key = OpenKey(key, subkeystr) | def ReadTestData(self, root_key): # Check we can get default value for this key. val = QueryValue(root_key, test_key_name) self.assertEquals(val, "Default value", "Registry didn't give back the correct value") | cb4d553cf72817f27384af68a0c274424525721b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/cb4d553cf72817f27384af68a0c274424525721b/test_winreg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2720,
4709,
751,
12,
2890,
16,
1365,
67,
856,
4672,
468,
2073,
732,
848,
336,
805,
460,
364,
333,
498,
18,
1244,
273,
2770,
620,
12,
3085,
67,
856,
16,
1842,
67,
856,
67,
529,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2720,
4709,
751,
12,
2890,
16,
1365,
67,
856,
4672,
468,
2073,
732,
848,
336,
805,
460,
364,
333,
498,
18,
1244,
273,
2770,
620,
12,
3085,
67,
856,
16,
1842,
67,
856,
67,
529,
13,
... |
stat_bar = self.gld.get_widget("statusbar") stat_bar.pop(self.stat_id) stat_bar.push(self.stat_id, _("Done.")) | self._statusbar(msg="Updating compleated") | def _done_upgrade(self, widget, data=None): self.database.refresh() self._refresh_repos_tree() self._setup_pacs_models() stat_bar = self.gld.get_widget("statusbar") stat_bar.pop(self.stat_id) stat_bar.push(self.stat_id, _("Done.")) | 64e1ca025017891278f9940d2cf1488af419581a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2654/64e1ca025017891278f9940d2cf1488af419581a/gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8734,
67,
15097,
12,
2890,
16,
3604,
16,
501,
33,
7036,
4672,
365,
18,
6231,
18,
9144,
1435,
365,
6315,
9144,
67,
15564,
67,
3413,
1435,
365,
6315,
8401,
67,
84,
28965,
67,
7665,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8734,
67,
15097,
12,
2890,
16,
3604,
16,
501,
33,
7036,
4672,
365,
18,
6231,
18,
9144,
1435,
365,
6315,
9144,
67,
15564,
67,
3413,
1435,
365,
6315,
8401,
67,
84,
28965,
67,
7665,
... |
print >> sys.stderr, "ERROR: Could not drop copyright_ct_pk_seq. Database said: '%s'" % error | print >> sys.stdout, "ERROR: Could not drop copyright_ct_pk_seq. Database said: '%s'" % error | def drop_database(): db = None try: db = libfosspython.FossDB() except Exception, inst: print >> sys.stderr, 'ERROR: %s, in %s' % inst sys.exit(1) result = db.access("DROP TABLE copyright CASCADE") if result != 0: error = db.errmsg() if error != 'table "copyright" does not exist': print >> sys.stderr, "ERROR: Could not drop copyright. Database said: '%s'" % error result = db.access("DROP SEQUENCE copyright_ct_pk_seq CASCADE") if result != 0: error = db.errmsg() if error != 'sequence "copyright_ct_pk_seq" does not exist': print >> sys.stderr, "ERROR: Could not drop copyright_ct_pk_seq. Database said: '%s'" % error return 0 | 9cbd5f71e1aaef822d05b637d8be742d93279010 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6959/9cbd5f71e1aaef822d05b637d8be742d93279010/copyright.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3640,
67,
6231,
13332,
1319,
273,
599,
775,
30,
1319,
273,
2561,
5075,
1752,
18490,
18,
42,
8464,
2290,
1435,
1335,
1185,
16,
1804,
30,
1172,
1671,
2589,
18,
11241,
16,
296,
3589,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3640,
67,
6231,
13332,
1319,
273,
599,
775,
30,
1319,
273,
2561,
5075,
1752,
18490,
18,
42,
8464,
2290,
1435,
1335,
1185,
16,
1804,
30,
1172,
1671,
2589,
18,
11241,
16,
296,
3589,
30,
... |
if row: | if row is not None: | def grid_slaves(self, row=None, column=None): args = () if row: args = args + ('-row', row) if column: args = args + ('-column', column) return map(self._nametowidget, self.tk.splitlist(self.tk.call( ('grid', 'slaves', self._w) + args))) | ecf89b66573e760f300e62d2ecb4f95095ecdf25 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/ecf89b66573e760f300e62d2ecb4f95095ecdf25/Tkinter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3068,
67,
2069,
6606,
12,
2890,
16,
1027,
33,
7036,
16,
1057,
33,
7036,
4672,
833,
273,
1832,
309,
1027,
353,
486,
599,
30,
833,
273,
833,
397,
7707,
17,
492,
2187,
1027,
13,
309,
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,
3068,
67,
2069,
6606,
12,
2890,
16,
1027,
33,
7036,
16,
1057,
33,
7036,
4672,
833,
273,
1832,
309,
1027,
353,
486,
599,
30,
833,
273,
833,
397,
7707,
17,
492,
2187,
1027,
13,
309,
10... |
try: user = os.getenv('REMOTE_USER') except KeyError: pass | if self.env.has_key('REMOTE_USER'): user = self.env['REMOTE_USER'] else: user = 'anonymous' | def determine_user(self): ''' Determine who the user is ''' # determine the uid to use self.opendb('admin') | 35909d931cbaf91b992743121e746286adec065f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/35909d931cbaf91b992743121e746286adec065f/client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4199,
67,
1355,
12,
2890,
4672,
9163,
10229,
10354,
326,
729,
353,
9163,
468,
4199,
326,
4555,
358,
999,
365,
18,
556,
409,
70,
2668,
3666,
6134,
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,
0,
0,
0,
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,
4199,
67,
1355,
12,
2890,
4672,
9163,
10229,
10354,
326,
729,
353,
9163,
468,
4199,
326,
4555,
358,
999,
365,
18,
556,
409,
70,
2668,
3666,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.assert_(self._box._toc == {key0: os.path.join('new', key0), key1: os.path.join('new', key1)}) | self.assertEqual(self._box._toc, {key0: os.path.join('new', key0), key1: os.path.join('new', key1)}) | def test_refresh(self): # Update the table of contents self.assertEqual(self._box._toc, {}) key0 = self._box.add(self._template % 0) key1 = self._box.add(self._template % 1) self.assertEqual(self._box._toc, {}) self._box._refresh() self.assert_(self._box._toc == {key0: os.path.join('new', key0), key1: os.path.join('new', key1)}) key2 = self._box.add(self._template % 2) self.assert_(self._box._toc == {key0: os.path.join('new', key0), key1: os.path.join('new', key1)}) self._box._refresh() self.assert_(self._box._toc == {key0: os.path.join('new', key0), key1: os.path.join('new', key1), key2: os.path.join('new', key2)}) | ea8344797e1a0ebd0b419ce14e16ab25af771fcc /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/ea8344797e1a0ebd0b419ce14e16ab25af771fcc/test_mailbox.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9144,
12,
2890,
4672,
468,
2315,
326,
1014,
434,
2939,
365,
18,
11231,
5812,
12,
2890,
6315,
2147,
6315,
1391,
16,
2618,
13,
498,
20,
273,
365,
6315,
2147,
18,
1289,
12,
2890... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9144,
12,
2890,
4672,
468,
2315,
326,
1014,
434,
2939,
365,
18,
11231,
5812,
12,
2890,
6315,
2147,
6315,
1391,
16,
2618,
13,
498,
20,
273,
365,
6315,
2147,
18,
1289,
12,
2890... |
oscmd("install_name_tool -change %s /Developer/Panda3D/lib/%s %s" % (libdep, libdep, libname), True) | if not libdep.startswith("/Developer/Panda3D/lib/"): oscmd("install_name_tool -change %s /Developer/Panda3D/lib/%s %s" % (libdep, libdep, libname), True) | def MakeInstallerOSX(): if (RUNTIME): # Invoke the make_installer script. AddToPathEnv("DYLD_LIBRARY_PATH", GetOutputDir() + "/plugins") oscmd(SDK["PYTHONEXEC"] + " direct/src/plugin_installer/make_installer.py --version %s" % VERSION) return import compileall if (os.path.isfile("Panda3D-%s.dmg" % VERSION)): oscmd("rm -f Panda3D-%s.dmg" % VERSION) if (os.path.exists("dstroot")): oscmd("rm -rf dstroot") #TODO: add postflight script #oscmd("sed -e 's@\\$1@%s@' < direct/src/directscripts/profilepaths-osx.command >> Panda3D-tpl-rw/panda3dpaths.command" % VERSION) oscmd("mkdir -p dstroot/base/Developer/Panda3D/lib") oscmd("mkdir -p dstroot/base/Developer/Panda3D/etc") oscmd("cp %s/etc/Config.prc dstroot/base/Developer/Panda3D/etc/Config.prc" % GetOutputDir()) oscmd("cp %s/etc/Confauto.prc dstroot/base/Developer/Panda3D/etc/Confauto.prc" % GetOutputDir()) oscmd("cp -R %s/models dstroot/base/Developer/Panda3D/models" % GetOutputDir()) oscmd("cp -R doc/LICENSE dstroot/base/Developer/Panda3D/LICENSE") oscmd("cp -R doc/ReleaseNotes dstroot/base/Developer/Panda3D/ReleaseNotes") if os.path.isdir(GetOutputDir()+"/plugins"): oscmd("cp -R %s/plugins dstroot/base/Developer/Panda3D/plugins" % GetOutputDir()) for base in os.listdir(GetOutputDir()+"/lib"): if (not base.endswith(".a")): libname = "dstroot/base/Developer/Panda3D/lib/" + base # OSX needs the -R argument to copy symbolic links correctly, it doesn't have -d. How weird. oscmd("cp -R " + GetOutputDir() + "/lib/" + base + " " + libname) # Execute install_name_tool to make them reference an absolute path if (not os.path.islink(libname)): oscmd("install_name_tool -id /Developer/Panda3D/lib/%s %s" % (base, libname), True) oscmd("otool -L %s | grep .%s.dylib > %s/tmp/otool-libs.txt" % (libname, VERSION, GetOutputDir()), True) for line in open(GetOutputDir()+"/tmp/otool-libs.txt", "r"): if len(line.strip()) > 0 and not line.strip().endswith(":"): libdep = line.strip().split(" ", 1)[0] oscmd("install_name_tool -change %s /Developer/Panda3D/lib/%s %s" % (libdep, libdep, libname), True) # Scripts to configure this version of Panda3D (in environment.plist) oscmd("mkdir -p dstroot/scripts/base/") postinstall = open("dstroot/scripts/base/postinstall", "w") print >>postinstall, "#!/usr/bin/python" print >>postinstall, "import os, plistlib" print >>postinstall, "home = os.environ['HOME']" print >>postinstall, "if not os.path.isdir(os.path.join(home, '.MacOSX')):" print >>postinstall, " os.mkdir(os.path.join(home, '.MacOSX'))" print >>postinstall, "plist = dict()" print >>postinstall, "envfile = os.path.join(home, '.MacOSX', 'environment.plist')" print >>postinstall, "if os.path.exists(envfile):" print >>postinstall, " plist = plistlib.readPlist(envfile)" print >>postinstall, "paths = {'PATH' : '/Developer/Tools/Panda3D', 'DYLD_LIBRARY_PATH' : '/Developer/Panda3D/lib', 'PYTHONPATH' : '/Developer/Panda3D/lib'," print >>postinstall, " 'MAYA_SCRIPT_PATH' : '/Developer/Panda3D/plugins', 'MAYA_PLUG_IN_PATH' : '/Developer/Panda3D/plugins'}" print >>postinstall, "for env, path in paths.items():" print >>postinstall, " if env not in plist:" print >>postinstall, " plist[env] = path" print >>postinstall, " elif path not in plist[env]:" print >>postinstall, " plist[env] = '%s:%s' % (path, plist[env])" print >>postinstall, "plistlib.writePlist(plist, envfile)" postinstall.close() postflight = open("dstroot/scripts/base/postflight", "w") print >>postflight, "#!/usr/bin/env bash\n" print >>postflight, "RESULT=`/usr/bin/open 'http://www.panda3d.org/wiki/index.php/Getting_Started_on_OSX'`" print >>postflight, "\nexit 0" postflight.close() oscmd("chmod +x dstroot/scripts/base/postinstall") oscmd("chmod +x dstroot/scripts/base/postflight") oscmd("mkdir -p dstroot/tools/Developer/Tools/Panda3D") oscmd("mkdir -p dstroot/tools/Developer/Panda3D") oscmd("ln -s /Developer/Tools/Panda3D dstroot/tools/Developer/Panda3D/bin") for base in os.listdir(GetOutputDir()+"/bin"): binname = "dstroot/tools/Developer/Tools/Panda3D/" + base # OSX needs the -R argument to copy symbolic links correctly, it doesn't have -d. How weird. oscmd("cp -R " + GetOutputDir() + "/bin/" + base + " " + binname) # Execute install_name_tool to make the binaries reference an absolute path if (not os.path.islink(binname)): oscmd("otool -L %s | grep .%s.dylib > %s/tmp/otool-libs.txt" % (binname, VERSION, GetOutputDir()), True) for line in open(GetOutputDir()+"/tmp/otool-libs.txt", "r"): if len(line.strip()) > 0 and not line.strip().endswith(":"): libdep = line.strip().split(" ", 1)[0] oscmd("install_name_tool -change %s /Developer/Panda3D/lib/%s %s" % (libdep, libdep, binname), True) if PkgSkip("PYTHON")==0: oscmd("mkdir -p dstroot/pythoncode/usr/bin") oscmd("mkdir -p dstroot/pythoncode/Developer/Panda3D/lib/direct") oscmd("cp -R %s/pandac dstroot/pythoncode/Developer/Panda3D/lib/pandac" % GetOutputDir()) oscmd("cp -R direct/src/* dstroot/pythoncode/Developer/Panda3D/lib/direct") oscmd("cp direct/src/ffi/panda3d.py dstroot/pythoncode/Developer/Panda3D/lib/panda3d.py") oscmd("ln -s %s dstroot/pythoncode/usr/bin/ppython" % SDK["PYTHONEXEC"]) if os.path.isdir(GetOutputDir()+"/Pmw"): oscmd("cp -R %s/Pmw dstroot/pythoncode/Developer/Panda3D/lib/Pmw" % GetOutputDir()) compileall.compile_dir("dstroot/pythoncode/Developer/Panda3D/lib/Pmw") WriteFile("dstroot/pythoncode/Developer/Panda3D/lib/direct/__init__.py", "") for base in os.listdir("dstroot/pythoncode/Developer/Panda3D/lib/direct"): if ((base != "extensions") and (base != "extensions_native")): compileall.compile_dir("dstroot/pythoncode/Developer/Panda3D/lib/direct/"+base) oscmd("mkdir -p dstroot/headers/Developer/Panda3D") oscmd("cp -R %s/include dstroot/headers/Developer/Panda3D/include" % GetOutputDir()) if os.path.isdir("samples"): oscmd("mkdir -p dstroot/samples/Developer/Examples/Panda3D") oscmd("cp -R samples/* dstroot/samples/Developer/Examples/Panda3D/") # Dummy package uninstall16 which just contains a preflight script to remove /Applications/Panda3D/ . oscmd("mkdir -p dstroot/scripts/uninstall16/") preflight = open("dstroot/scripts/uninstall16/preflight", "w") print >>preflight, "#!/usr/bin/python" print >>preflight, "import os, re, sys, shutil" print >>preflight, "if os.path.isdir('/Applications/Panda3D'): shutil.rmtree('/Applications/Panda3D')" print >>preflight, "bash_profile = os.path.join(os.environ['HOME'], '.bash_profile')" print >>preflight, "if not os.path.isfile(bash_profile): sys.exit(0)" print >>preflight, "pattern = re.compile('''PANDA_VERSION=[0-9][.][0-9][.][0-9]" print >>preflight, "PANDA_PATH=/Applications/Panda3D/[$A-Z.0-9_]+" print >>preflight, "if \[ -d \$PANDA_PATH \]" print >>preflight, "then(.+?)fi" print >>preflight, "''', flags = re.DOTALL | re.MULTILINE)" print >>preflight, "bpfile = open(bash_profile, 'r')" print >>preflight, "bpdata = bpfile.read()" print >>preflight, "bpfile.close()" print >>preflight, "newbpdata = pattern.sub('', bpdata)" print >>preflight, "if newbpdata == bpdata: sys.exit(0)" print >>preflight, "bpfile = open(bash_profile, 'w')" print >>preflight, "bpfile.write(newbpdata)" print >>preflight, "bpfile.close()" preflight.close() oscmd("chmod +x dstroot/scripts/uninstall16/preflight") oscmd("chmod -R 0775 dstroot/*") # We need to be root to perform a chown. Bleh. # Fortunately PackageMaker does it for us, on 10.5 and above. #oscmd("chown -R root:admin dstroot/*", True) oscmd("mkdir -p dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/") oscmd("mkdir -p dstroot/Panda3D/Panda3D.mpkg/Contents/Resources/en.lproj/") pkgs = ["base", "tools", "headers", "uninstall16"] if PkgSkip("PYTHON")==0: pkgs.append("pythoncode") if os.path.isdir("samples"): pkgs.append("samples") for pkg in pkgs: plist = open("/tmp/Info_plist", "w") plist.write(Info_plist % { "package_id" : "org.panda3d.panda3d.%s.pkg" % pkg, "version" : VERSION }) plist.close() if not os.path.isdir("dstroot/" + pkg): os.makedirs("dstroot/" + pkg) if os.path.exists("/Developer/usr/bin/packagemaker"): cmd = '/Developer/usr/bin/packagemaker --info /tmp/Info_plist --version ' + VERSION + ' --out dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg --target 10.4 --domain system --root dstroot/' + pkg + '/ --no-relocate' elif os.path.exists("/Developer/Tools/packagemaker"): cmd = '/Developer/usr/bin/packagemaker -build -f dstroot/' + pkg + '/ -p dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg -i /tmp/Info_plist' else: exit("PackageMaker could not be found!") if os.path.isdir("dstroot/scripts/" + pkg): cmd += ' --scripts dstroot/scripts/' + pkg oscmd(cmd) if os.path.isfile("/tmp/Info_plist"): oscmd("rm -f /tmp/Info_plist") dist = open("dstroot/Panda3D/Panda3D.mpkg/Contents/distribution.dist", "w") print >>dist, '<?xml version="1.0" encoding="utf-8"?>' print >>dist, '<installer-script minSpecVersion="1.000000" authoringTool="com.apple.PackageMaker" authoringToolVersion="3.0.3" authoringToolBuild="174">' print >>dist, ' <title>Panda3D</title>' print >>dist, ' <options customize="always" allow-external-scripts="no" rootVolumeOnly="false"/>' # The following script is to enable the "Uninstall 1.6.x" option only when Panda3D 1.6.x is actually installed. print >>dist, ''' <script> | d82b2d6a9607ce0e820253f708363882fb231cd0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8543/d82b2d6a9607ce0e820253f708363882fb231cd0/makepanda.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4344,
18678,
4618,
60,
13332,
309,
261,
54,
25375,
4672,
468,
14373,
326,
1221,
67,
20163,
2728,
18,
1436,
774,
743,
3491,
2932,
40,
61,
12069,
67,
2053,
28254,
67,
4211,
3113,
968,
1447... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4344,
18678,
4618,
60,
13332,
309,
261,
54,
25375,
4672,
468,
14373,
326,
1221,
67,
20163,
2728,
18,
1436,
774,
743,
3491,
2932,
40,
61,
12069,
67,
2053,
28254,
67,
4211,
3113,
968,
1447... |
self.session = cookie['roundup_user_2'].value | self.session = cookie[self.cookie_name].value | def determine_user(self): ''' Determine who the user is ''' # determine the uid to use self.opendb('admin') # clean age sessions self.clean_sessions() # make sure we have the session Class sessions = self.db.sessions | 4d4a6e6ca055528d188bbc7f645ade423a905185 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/4d4a6e6ca055528d188bbc7f645ade423a905185/client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4199,
67,
1355,
12,
2890,
4672,
9163,
10229,
10354,
326,
729,
353,
9163,
468,
4199,
326,
4555,
358,
999,
365,
18,
556,
409,
70,
2668,
3666,
6134,
468,
2721,
9388,
8856,
365,
18,
6200,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4199,
67,
1355,
12,
2890,
4672,
9163,
10229,
10354,
326,
729,
353,
9163,
468,
4199,
326,
4555,
358,
999,
365,
18,
556,
409,
70,
2668,
3666,
6134,
468,
2721,
9388,
8856,
365,
18,
6200,
... |
self.child_cset.parents = [rev] | self.child_cset.parents[:] = [rev] | def parselogentry(orig_paths, revnum, author, date, message): self.ui.debug("parsing revision %d (%d changes)\n" % (revnum, len(orig_paths))) | c6a1068cdcfcb9641c61c95fff848144537955b7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11312/c6a1068cdcfcb9641c61c95fff848144537955b7/subversion.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
779,
1786,
717,
4099,
12,
4949,
67,
4481,
16,
5588,
2107,
16,
2869,
16,
1509,
16,
883,
4672,
365,
18,
4881,
18,
4148,
2932,
24979,
6350,
738,
72,
6142,
72,
3478,
5153,
82,
6,
738,
26... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
779,
1786,
717,
4099,
12,
4949,
67,
4481,
16,
5588,
2107,
16,
2869,
16,
1509,
16,
883,
4672,
365,
18,
4881,
18,
4148,
2932,
24979,
6350,
738,
72,
6142,
72,
3478,
5153,
82,
6,
738,
26... |
LOG.info("TKL: Adding Qline: %s" % nickmask) self.data.qlines[nickmask] = (wild_to_regex(nickmask), reason) | self.data.qlines[nickmask] = (nick_re, reason) | def handleCmd_TKL(self, prefix, args): | d2de3b5e189c91aafab22e60dc740a5f8730ec31 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12372/d2de3b5e189c91aafab22e60dc740a5f8730ec31/bridge_server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
5931,
67,
56,
47,
48,
12,
2890,
16,
1633,
16,
833,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
5931,
67,
56,
47,
48,
12,
2890,
16,
1633,
16,
833,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
model = self.pool.get(current_rec.get('object_id')[1]) | current_rec = current_rec[0] model_name = self.pool.get('ir.model').browse(cr, uid, current_rec.get('object_id')[0]).model model = self.pool.get(model_name) | def check_model(self, cr, uid, ids, context = None): if context is None: context = {} current_rec = self.read(cr, uid, ids, context)[0] if current_rec: model = self.pool.get(current_rec.get('object_id')[1]) if hasattr(model, 'message_new'): return True return False | acacf36ebb8dd7f2d736e19cbfc70ed22b867fdc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/acacf36ebb8dd7f2d736e19cbfc70ed22b867fdc/fetchmail.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
2284,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
273,
599,
4672,
309,
819,
353,
599,
30,
819,
273,
2618,
783,
67,
3927,
273,
365,
18,
896,
12,
3353,
16,
4555,
16,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
2284,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
273,
599,
4672,
309,
819,
353,
599,
30,
819,
273,
2618,
783,
67,
3927,
273,
365,
18,
896,
12,
3353,
16,
4555,
16,
32... |
Returns the underlying _Curvedata class for this mwrank elliptic curve. | Returns the underlying :class:`_Curvedata` class for this mwrank elliptic curve. | def _curve_data(self): r""" Returns the underlying _Curvedata class for this mwrank elliptic curve. | 8b53e056cc765e689493ec9632c441ee03a3206a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8b53e056cc765e689493ec9632c441ee03a3206a/interface.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
16683,
67,
892,
12,
2890,
4672,
436,
8395,
2860,
326,
6808,
389,
2408,
2155,
396,
667,
364,
333,
14721,
11500,
415,
549,
21507,
8882,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
16683,
67,
892,
12,
2890,
4672,
436,
8395,
2860,
326,
6808,
389,
2408,
2155,
396,
667,
364,
333,
14721,
11500,
415,
549,
21507,
8882,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
self.fail('conversion specifier: %r failed.' % format) | self.fail("conversion specifier %r failed with '%s' input." % (format, strf_output)) | def test_strptime(self): tt = time.gmtime(self.t) for directive in ('a', 'A', 'b', 'B', 'c', 'd', 'H', 'I', 'j', 'm', 'M', 'p', 'S', 'U', 'w', 'W', 'x', 'X', 'y', 'Y', 'Z', '%'): format = ' %' + directive try: time.strptime(time.strftime(format, tt), format) except ValueError: self.fail('conversion specifier: %r failed.' % format) | 2727b920770b6986b0c54ea9fe80c0e05c2f831e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/2727b920770b6986b0c54ea9fe80c0e05c2f831e/test_time.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
701,
10650,
12,
2890,
4672,
3574,
273,
813,
18,
75,
10838,
12,
2890,
18,
88,
13,
364,
8655,
316,
7707,
69,
2187,
296,
37,
2187,
296,
70,
2187,
296,
38,
2187,
296,
71,
2187,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
701,
10650,
12,
2890,
4672,
3574,
273,
813,
18,
75,
10838,
12,
2890,
18,
88,
13,
364,
8655,
316,
7707,
69,
2187,
296,
37,
2187,
296,
70,
2187,
296,
38,
2187,
296,
71,
2187,... |
if len(self.frags)>1: autoLeading = getattr(self,'autoLeading',getattr(style,'autoLeading','')) calcBounds = autoLeading not in ('','off') return cjkFragSplit(self.frags, maxWidths, calcBounds) elif not len(self.frags): | frags = self.frags nFrags = len(frags) if nFrags==1 and not hasattr(frags[0],'cbDefn'): f = frags[0] if hasattr(self,'blPara') and getattr(self,'_splitpara',0): return f.clone(kind=0, lines=self.blPara.lines) lines = [] lineno = 0 if hasattr(f,'text'): text = f.text else: text = ''.join(getattr(f,'words',[])) from reportlab.lib.textsplit import wordSplit lines = wordSplit(text, maxWidths[0], f.fontName, f.fontSize) wrappedLines = [(sp, [line]) for (sp, line) in lines] return f.clone(kind=0, lines=wrappedLines, ascent=f.fontSize, descent=-0.2*f.fontSize) elif nFrags<=0: | def breakLinesCJK(self, width): """Initially, the dumbest possible wrapping algorithm. Cannot handle font variations.""" | eec5bf031dd52b1c7c781cc7f260f1554571bbc1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3878/eec5bf031dd52b1c7c781cc7f260f1554571bbc1/paragraph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
898,
5763,
39,
19474,
12,
2890,
16,
1835,
4672,
3536,
2570,
6261,
16,
326,
302,
3592,
395,
3323,
14702,
4886,
18,
14143,
1640,
3512,
28401,
12123,
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,
0,
0,
0,
0,
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,
898,
5763,
39,
19474,
12,
2890,
16,
1835,
4672,
3536,
2570,
6261,
16,
326,
302,
3592,
395,
3323,
14702,
4886,
18,
14143,
1640,
3512,
28401,
12123,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.