rem
stringlengths
1
226k
add
stringlengths
0
227k
context
stringlengths
6
326k
meta
stringlengths
143
403
input_ids
listlengths
256
256
attention_mask
listlengths
256
256
labels
listlengths
128
128
print 'Comment:\n\t', repr(text)
print 'Comment:\n\t', repr(text)
def CommentHandler(self, text):
77478d671a135f6e358262bbd80ad23419a4e1e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/77478d671a135f6e358262bbd80ad23419a4e1e9/test_pyexpat.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9821, 1503, 12, 2890, 16, 977, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9821, 1503, 12, 2890, 16, 977, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
if isinstance(mv, str): lst = self.move(mv)[1] else: lst = self.facets(mv)
g = self.parse(mv) lst = self.facets(g)
def repr2d(self, mv): r""" Displays a 2d map of the Rubik's cube after the move mv has been made. Nothing is returned. EXAMPLES: sage: rubik = CubeGroup() sage: rubik.display2d("") +--------------+ | 1 2 3 | | 4 top 5 | | 6 7 8 | +------------+--------------+-------------+------------+ | 9 10 11 | 17 18 19 | 25 26 27 | 33 34 35 | | 12 left 13 | 20 front 21 | 28 right 29 | 36 rear 37 | | 14 15 16 | 22 23 24 | 30 31 32 | 38 39 40 | +------------+--------------+-------------+------------+ | 41 42 43 | | 44 bottom 45 | | 46 47 48 | +--------------+
ec7f2353d5f3404d448b1713a40a91d345a6d70b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/ec7f2353d5f3404d448b1713a40a91d345a6d70b/cubegroup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8480, 22, 72, 12, 2890, 16, 7701, 4672, 436, 8395, 9311, 87, 279, 576, 72, 852, 434, 326, 534, 373, 1766, 1807, 18324, 1839, 326, 3635, 7701, 711, 2118, 7165, 18, 13389, 353, 2106, 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, 8480, 22, 72, 12, 2890, 16, 7701, 4672, 436, 8395, 9311, 87, 279, 576, 72, 852, 434, 326, 534, 373, 1766, 1807, 18324, 1839, 326, 3635, 7701, 711, 2118, 7165, 18, 13389, 353, 2106, 18,...
entries = file.split('/');
if file.find('?') > -1: url, querystring = file.split('?') else: url = file entries = url.split('/')
def FileHandler(self): """This handler sends the contents of the requested file. Wow, it's like a real webserver!"""
5f4435da58f80c97ee7ecef38573e0b7d841ded0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5060/5f4435da58f80c97ee7ecef38573e0b7d841ded0/testserver.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1387, 1503, 12, 2890, 4672, 3536, 2503, 1838, 9573, 326, 2939, 434, 326, 3764, 585, 18, 225, 678, 543, 16, 518, 1807, 3007, 279, 2863, 732, 2266, 502, 5, 8395, 2, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1387, 1503, 12, 2890, 4672, 3536, 2503, 1838, 9573, 326, 2939, 434, 326, 3764, 585, 18, 225, 678, 543, 16, 518, 1807, 3007, 279, 2863, 732, 2266, 502, 5, 8395, 2, -100, -100, -100, -10...
row += len(opt['chooseFrom'])
row += len(opt['chooseFrom']) - 1 elif opt.has_key('chooseOneOf') and multiLineChooseOneOf: row += len(opt['chooseOneOf']) - 1
def getNumOfRows(self): '''Count the number of rows that is needed for all parameters''' row = 0 for opt in self.options: if opt.has_key('label') or opt.has_key('separator'): row += 1 if opt.has_key('chooseFrom'): row += len(opt['chooseFrom']) if row / self.nCol * self.nCol == row: row /= self.nCol else: row = row/self.nCol + 1 return row
b8dc92ef8ad792606f004235722b9585e2bbe014 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/401/b8dc92ef8ad792606f004235722b9585e2bbe014/simuOpt.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11187, 951, 4300, 12, 2890, 4672, 9163, 1380, 326, 1300, 434, 2595, 716, 353, 3577, 364, 777, 1472, 26418, 1027, 273, 374, 364, 2153, 316, 365, 18, 2116, 30, 309, 2153, 18, 5332, 67, 8...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11187, 951, 4300, 12, 2890, 4672, 9163, 1380, 326, 1300, 434, 2595, 716, 353, 3577, 364, 777, 1472, 26418, 1027, 273, 374, 364, 2153, 316, 365, 18, 2116, 30, 309, 2153, 18, 5332, 67, 8...
view = self.songlist.view
view = self.songlist
def song_col_filter(self, item): view = self.songlist.view path, col = view.get_cursor() header = col.header_name if "~" in header[1:]: header = filter(None, header.split("~"))[0] self.filter_on_header(header)
280c61da80f0bb001fcd98422dbab50ce5745a40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4764/280c61da80f0bb001fcd98422dbab50ce5745a40/widgets.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17180, 67, 1293, 67, 2188, 12, 2890, 16, 761, 4672, 1476, 273, 365, 18, 816, 75, 1098, 589, 16, 645, 273, 1476, 18, 588, 67, 9216, 1435, 1446, 273, 645, 18, 3374, 67, 529, 309, 31964...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17180, 67, 1293, 67, 2188, 12, 2890, 16, 761, 4672, 1476, 273, 365, 18, 816, 75, 1098, 589, 16, 645, 273, 1476, 18, 588, 67, 9216, 1435, 1446, 273, 645, 18, 3374, 67, 529, 309, 31964...
representative of an element of SL_2(Z) modulo G. This function specfically returns data needed for the first part of the reduction step (the first coordinate).
representative of an element of SL_2(Z) modulo G. This function specifically returns data needed for the first part of the reduction step (the first coordinate).
def _coset_reduction_data_first_coord(G): """ Compute data used for determining the canonical coset representative of an element of SL_2(Z) modulo G. This function specfically returns data needed for the first part of the reduction step (the first coordinate).
299ee84b20febf2ee892f72ec81554234e03ca0e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/299ee84b20febf2ee892f72ec81554234e03ca0e/congroup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 14445, 278, 67, 1118, 4062, 67, 892, 67, 3645, 67, 5732, 12, 43, 4672, 3536, 8155, 501, 1399, 364, 23789, 326, 7378, 4987, 278, 23174, 434, 392, 930, 434, 348, 48, 67, 22, 12, 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, 14445, 278, 67, 1118, 4062, 67, 892, 67, 3645, 67, 5732, 12, 43, 4672, 3536, 8155, 501, 1399, 364, 23789, 326, 7378, 4987, 278, 23174, 434, 392, 930, 434, 348, 48, 67, 22, 12, 6...
open(directory+'epydoc-tree.html', 'w').write(str)
open(filename, 'w').write(str)
def write(self, directory=None, progress_callback=None): """ Write the documentation to the given directory.
dd7fc26b7d69af6d4765be2a892edca4603899ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/dd7fc26b7d69af6d4765be2a892edca4603899ee/html.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 12, 2890, 16, 1867, 33, 7036, 16, 4007, 67, 3394, 33, 7036, 4672, 3536, 2598, 326, 7323, 358, 326, 864, 1867, 18, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 12, 2890, 16, 1867, 33, 7036, 16, 4007, 67, 3394, 33, 7036, 4672, 3536, 2598, 326, 7323, 358, 326, 864, 1867, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
def anyOccurrences(self, vars, x): """ Figure out, given a set of variables whether any occur in a list, formula etc.""" if x in vars: return x if isinstance(x, Formula): for s in x.statements: for p in PRED, SUBJ, OBJ: y = s[p] z = self.anyOccurrences(vars, y) if z != None: return z elif x.asList() != None: for y in x.asList().value(): z = self.anyOccurrences(vars, y) if z != None: return z return None return None
def anyOccurrences(self, vars, x): """ Figure out, given a set of variables whether any occur in a list, formula etc.""" if x in vars: return x if isinstance(x, Formula): for s in x.statements: # Should be valid list for p in PRED, SUBJ, OBJ: y = s[p] z = self.anyOccurrences(vars, y) if z != None: return z elif x.asList() != None: for y in x.asList().value(): z = self.anyOccurrences(vars, y) if z != None: return z return None return None
9014f1b29ec001a58490a448dc6782aa1860acf4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3308/9014f1b29ec001a58490a448dc6782aa1860acf4/llyn.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1281, 12397, 12228, 12, 2890, 16, 4153, 16, 619, 4672, 3536, 18818, 596, 16, 864, 279, 444, 434, 3152, 2856, 1281, 3334, 316, 279, 666, 16, 8013, 5527, 12123, 309, 619, 316, 4153, 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, 1281, 12397, 12228, 12, 2890, 16, 4153, 16, 619, 4672, 3536, 18818, 596, 16, 864, 279, 444, 434, 3152, 2856, 1281, 3334, 316, 279, 666, 16, 8013, 5527, 12123, 309, 619, 316, 4153, 30, ...
p("these objects' docstrings are not proper epytext:")
p("these %s objects' docstrings are not proper epytext:" %(len(system.epytextproblems),))
def p(msg): system.msg('epytext', msg, thresh=-1, topthresh=1)
51575e10e256a1ea9559eec24a7b77ad13c79fe3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5471/51575e10e256a1ea9559eec24a7b77ad13c79fe3/driver.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 293, 12, 3576, 4672, 2619, 18, 3576, 2668, 881, 93, 955, 2187, 1234, 16, 22939, 29711, 21, 16, 358, 2397, 1955, 33, 21, 13, 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, 293, 12, 3576, 4672, 2619, 18, 3576, 2668, 881, 93, 955, 2187, 1234, 16, 22939, 29711, 21, 16, 358, 2397, 1955, 33, 21, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
current.SetTimeBegin(beginTime) current.SetTimeEnd(endTime) current.SetText('') state = SubtitlesLoader.LOOK_FOR_TEXT
beginTime = int(m.group(1))*1000*3600 beginTime += int(m.group(2))*1000*60 beginTime += int(m.group(3))*1000 beginTime += int(beginMili) endTime = int(m.group(5))*1000*3600 endTime += int(m.group(6))*1000*60 endTime += int(m.group(7))*1000 endTime += int(endMili) current.SetTimeBegin(beginTime) current.SetTimeEnd(endTime) current.SetText('') state = SubtitlesLoader.LOOK_FOR_TEXT
def GetSubtitleList(self, path): outputList = [] f = self.convertFile(path) #f = open(path, 'r') state = SubtitlesLoader.LOOK_FOR_ID for line in f: line = line.rstrip() line = line.decode("utf8")
b68affc2d7cadc8e5959cebfc0e485be7d358963 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11741/b68affc2d7cadc8e5959cebfc0e485be7d358963/subtitles_loader.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 968, 1676, 2649, 682, 12, 2890, 16, 589, 4672, 876, 682, 273, 5378, 284, 273, 365, 18, 6283, 812, 12, 803, 13, 468, 74, 273, 1696, 12, 803, 16, 296, 86, 6134, 919, 273, 2592, 17643, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 968, 1676, 2649, 682, 12, 2890, 16, 589, 4672, 876, 682, 273, 5378, 284, 273, 365, 18, 6283, 812, 12, 803, 13, 468, 74, 273, 1696, 12, 803, 16, 296, 86, 6134, 919, 273, 2592, 17643, ...
self.assert_(isinstance(an_entry, gspreadsheet.GSpreadsheetsList))
self.assert_(isinstance(an_entry, gspreadsheet.SpreadsheetsList))
def testToAndFromString(self): self.assert_(len(self.feed.entry) == 2) for an_entry in self.feed.entry: self.assert_(isinstance(an_entry, gspreadsheet.GSpreadsheetsList)) new_feed = gspreadsheet.GSpreadsheetsListFeedFromString(str(self.feed)) for an_entry in new_feed.entry: self.assert_(isinstance(an_entry, gspreadsheet.GSpreadsheetsList))
50afc41651ef00ab4626fbe905c8ac1304fb3b37 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6580/50afc41651ef00ab4626fbe905c8ac1304fb3b37/gspreadsheet_test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 774, 1876, 9193, 12, 2890, 4672, 365, 18, 11231, 67, 12, 1897, 12, 2890, 18, 7848, 18, 4099, 13, 422, 576, 13, 364, 392, 67, 4099, 316, 365, 18, 7848, 18, 4099, 30, 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, 1842, 774, 1876, 9193, 12, 2890, 4672, 365, 18, 11231, 67, 12, 1897, 12, 2890, 18, 7848, 18, 4099, 13, 422, 576, 13, 364, 392, 67, 4099, 316, 365, 18, 7848, 18, 4099, 30, 365, 18, ...
if not str(TempChar).isspace():
if not str(TempChar).isspace() and TempChar not in ('=', '|', ','):
def __GetNextToken(self): self.__SkipWhiteSpace() if self.__EndOfFile(): return False
2f743f829e2c9e634d3e62f83c6af106a22f6583 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/914/2f743f829e2c9e634d3e62f83c6af106a22f6583/FdfParser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 967, 9399, 12, 2890, 4672, 365, 16186, 6368, 23108, 1435, 309, 365, 16186, 23358, 812, 13332, 327, 1083, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 967, 9399, 12, 2890, 4672, 365, 16186, 6368, 23108, 1435, 309, 365, 16186, 23358, 812, 13332, 327, 1083, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
print 'html generation command: ' + ' '.join(command) subprocess.call(command)
print >>sys.stderr, 'html generation command: ' + ' '.join(command) retcode = subprocess.call(command) if retcode: logging.fatal('COVERAGE: %s failed; return code: %d' % (command[0], retcode)) if self.options.strict: sys.exit(retcode)
def GenerateOutput(self): """Convert profile data to html.""" if self.IsLinux(): command = [self.lcov, '--directory', self.directory, '--capture', '--output-file', self.coverage_info_file] else: command = [self.mcov, '--directory', self.directory_parent, '--output', self.coverage_info_file] print 'Assembly command: ' + ' '.join(command) subprocess.call(command)
36a488557d680de1559113071bc40c4d85ec7d9a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5060/36a488557d680de1559113071bc40c4d85ec7d9a/coverage_posix.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6654, 1447, 12, 2890, 4672, 3536, 2723, 3042, 501, 358, 1729, 12123, 309, 365, 18, 2520, 19475, 13332, 1296, 273, 306, 2890, 18, 80, 14014, 16, 3534, 5149, 2187, 365, 18, 5149, 16, 3534,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6654, 1447, 12, 2890, 4672, 3536, 2723, 3042, 501, 358, 1729, 12123, 309, 365, 18, 2520, 19475, 13332, 1296, 273, 306, 2890, 18, 80, 14014, 16, 3534, 5149, 2187, 365, 18, 5149, 16, 3534,...
value = 1.0 / float(self)
value = float(self) if value: value = 1.0 / float(self)
def getValue(self): # convert to seconds per byte value = 1.0 / float(self) # convert to ticks per byte value = ticks.fromSeconds(value) return float(value)
3d2e7797ccb554092a4140fc8e11407edd7eedc4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6787/3d2e7797ccb554092a4140fc8e11407edd7eedc4/params.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2366, 12, 2890, 4672, 468, 1765, 358, 3974, 1534, 1160, 460, 273, 1431, 12, 2890, 13, 309, 460, 30, 460, 273, 404, 18, 20, 342, 1431, 12, 2890, 13, 468, 1765, 358, 13003, 1534, 1160, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2366, 12, 2890, 4672, 468, 1765, 358, 3974, 1534, 1160, 460, 273, 1431, 12, 2890, 13, 309, 460, 30, 460, 273, 404, 18, 20, 342, 1431, 12, 2890, 13, 468, 1765, 358, 13003, 1534, 1160, ...
or with.__dict__[name] != allowedKeysVals[name]): self.__dict__[name]=with.__dict__[name]
or with1.__dict__[name] != allowedKeysVals[name]): self.__dict__[name]=with1.__dict__[name]
def update(self,with,updateToWild=True): """Replace RPN attributes of an instance with RPN attributes from another values not in list of allowed parm keys are ignored also update to wildcard (-1 or '') values unless updateToWild=False
6b17d2335b24a7bfa8604b7b2200391b65b108a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1808/6b17d2335b24a7bfa8604b7b2200391b65b108a4/rpn_helpers.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 12, 2890, 16, 1918, 16, 2725, 774, 59, 545, 33, 5510, 4672, 3536, 5729, 534, 15124, 1677, 434, 392, 791, 598, 534, 15124, 1677, 628, 4042, 924, 486, 316, 666, 434, 2935, 19924, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 12, 2890, 16, 1918, 16, 2725, 774, 59, 545, 33, 5510, 4672, 3536, 5729, 534, 15124, 1677, 434, 392, 791, 598, 534, 15124, 1677, 628, 4042, 924, 486, 316, 666, 434, 2935, 19924, 1...
f.close() if result.get("status", 0) == 304: result['feed'] = FeedParserDict() result['entries'] = [] result['debug_message'] = "The feed has not changed since you last checked, so the server sent no data. This is a feature, not a bug!" return result result['encoding'], http_encoding, xml_encoding = _getCharacterEncoding(result.get("headers", {}), data)
if hasattr(f, "close"): f.close() result['encoding'], http_encoding, xml_encoding, sniffed_xml_encoding = \ _getCharacterEncoding(result.get("headers", {}), data)
def parse(url_file_stream_or_string, etag=None, modified=None, agent=None, referrer=None): """Parse a feed from a URL, file, stream, or string""" result = FeedParserDict() f = _open_resource(url_file_stream_or_string, etag=etag, modified=modified, agent=agent, referrer=referrer) data = f.read() if hasattr(f, "headers"): if gzip and f.headers.get('content-encoding', '') == 'gzip': try: data = gzip.GzipFile(fileobj=_StringIO(data)).read() except: # some feeds claim to be gzipped but they're not, so we get garbage data = '' if hasattr(f, "info"): info = f.info() result["etag"] = info.getheader("ETag") last_modified = info.getheader("Last-Modified") if last_modified: result["modified"] = _parse_date(last_modified) if hasattr(f, "url"): result["url"] = f.url result["status"] = 200 # default, may be overridden later if hasattr(f, "status"): result["status"] = f.status if hasattr(f, "headers"): result["headers"] = f.headers.dict f.close() if result.get("status", 0) == 304: result['feed'] = FeedParserDict() result['entries'] = [] result['debug_message'] = "The feed has not changed since you last checked, so the server sent no data. This is a feature, not a bug!" return result result['encoding'], http_encoding, xml_encoding = _getCharacterEncoding(result.get("headers", {}), data) result['version'], data = _stripDoctype(data) baseuri = result.get('headers', {}).get('content-location', result.get('url')) # try true XML parser first if not _XML_AVAILABLE: if _debug: sys.stderr.write('no xml libraries available\n') use_strict_parser = _XML_AVAILABLE if use_strict_parser: if _debug: sys.stderr.write('using xml library\n') result['bozo'] = 0 feedparser = _StrictFeedParser(baseuri, result['encoding']) if _debug and _debug_never_use_libxml2: sys.stderr.write('not using libxml2 (even if available)\n') additional_parsers = [] else: additional_parsers = ["drv_libxml2"] saxparser = xml.sax.make_parser(additional_parsers) saxparser.setFeature(xml.sax.handler.feature_namespaces, 1) saxparser.setContentHandler(feedparser) saxparser.setErrorHandler(feedparser) try: saxparser.setDTDHandler(feedparser) except xml.sax.SAXNotSupportedException: # libxml2 driver does not support DTDHandler if _debug: sys.stderr.write('using an xml library that does not support DTDHandler (not a big deal)\n') try: saxparser.setEntityResolver(feedparser) except xml.sax.SAXNotSupportedException: # libxml2 driver does not support EntityResolver if _debug: sys.stderr.write('using an xml library that does not support EntityResolver (not a big deal)\n') encoding_set = (result['encoding'] == xml_encoding) if not encoding_set: bozo_exception = None proposed_encodings = [result['encoding'], xml_encoding, 'utf-8', 'iso-8859-1', 'windows-1252'] tried_encodings = [] for proposed_encoding in proposed_encodings: if proposed_encodings in tried_encodings: continue tried_encodings.append(proposed_encoding) try: data = _changeEncodingDeclaration(data, proposed_encoding) except Exception, bozo_exception: if _debug: sys.stderr.write('character encoding is wrong\n') else: if proposed_encoding != result['encoding']: try: raise CharacterEncodingOverride, "document declared as %s, but parsed as %s" % (result['encoding'], proposed_encoding) except CharacterEncodingOverride, bozo_exception: result['bozo'] = 1 result['bozo_exception'] = bozo_exception result['encoding'] = proposed_encoding encoding_set = 1 break if not encoding_set: result['bozo'] = 1 result['bozo_exception'] = bozo_exception use_strict_parser = 0 if use_strict_parser: source = xml.sax.xmlreader.InputSource() source.setByteStream(_StringIO(data)) if hasattr(saxparser, '_ns_stack'): # work around bug in built-in SAX parser (doesn't recognize xml: namespace) # PyXML doesn't have this problem, and it doesn't have _ns_stack either saxparser._ns_stack.append({'http://www.w3.org/XML/1998/namespace':'xml'}) try: saxparser.parse(source) except Exception, e: if _debug: sys.stderr.write('xml parsing failed\n') feedparser.bozo = 1 feedparser.bozo_exception = feedparser.exc or e if feedparser.bozo: # feed is not well-formed XML, fall back on regex-based parser result['bozo'] = 1 result['bozo_exception'] = feedparser.bozo_exception use_strict_parser = 0 if not use_strict_parser: if _debug: sys.stderr.write('using regexes, now you have two problems\n') feedparser = _LooseFeedParser(baseuri, result['encoding']) feedparser.feed(data) result['feed'] = feedparser.feeddata result['entries'] = feedparser.entries result['version'] = result['version'] or feedparser.version return result
99200d105c483d0627b0c87195d2d3372fe4ba91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/99200d105c483d0627b0c87195d2d3372fe4ba91/feedparser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 12, 718, 67, 768, 67, 3256, 67, 280, 67, 1080, 16, 13655, 33, 7036, 16, 4358, 33, 7036, 16, 4040, 33, 7036, 16, 14502, 33, 7036, 4672, 3536, 3201, 279, 4746, 628, 279, 1976, 16...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 12, 718, 67, 768, 67, 3256, 67, 280, 67, 1080, 16, 13655, 33, 7036, 16, 4358, 33, 7036, 16, 4040, 33, 7036, 16, 14502, 33, 7036, 4672, 3536, 3201, 279, 4746, 628, 279, 1976, 16...
print('Average Reward = {0}'.format(sum(rewards) / n))
print('Average Reward = {0}'.format(sum(rewards) / len(rewards)))
def main(argv): if len(argv) <= 1: print('err: incorrect number of arguments', file=sys.stderr) print('usage: ./rl n', file=sys.stderr) return 1 n = int(argv[1]) # Grid world depicted on p.646 of Russel and Norvig (3rd Ed.). world = World(4, 3) world.AddObstacle(1, 1) # Receive a reward of -0.04 each move with a probablity of 0.20 of moving # perpendicular to the intended direction. state = State(world, 0, 0, 0.20, -0.04) state.AddReward(3, 2, +1) state.AddReward(3, 1, -1) state.AddTerminal(3, 2) state.AddTerminal(3, 1) # Learn the optimal policy using Q-Learning with alpha = gamma = 0.20. agent = QLearningAgent(0.2, 0.2, 0.0) states = [ state ] actions = [ ] rewards = [ ] for t in range(0, n): if state.IsTerminal(): break state, action, reward = Simulate(state, agent) states.append(state) actions.append(action) rewards.append(reward) print('Total Reward = {0}'.format(sum(rewards))) print('Average Reward = {0}'.format(sum(rewards) / n)) return 0
28f31d6def6e07fe4e92af3914d54deaa4669601 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14137/28f31d6def6e07fe4e92af3914d54deaa4669601/qlearning.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 19485, 4672, 309, 562, 12, 19485, 13, 1648, 404, 30, 1172, 2668, 370, 30, 11332, 1300, 434, 1775, 2187, 585, 33, 9499, 18, 11241, 13, 1172, 2668, 9167, 30, 263, 19, 1321, 290...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 309, 562, 12, 19485, 13, 1648, 404, 30, 1172, 2668, 370, 30, 11332, 1300, 434, 1775, 2187, 585, 33, 9499, 18, 11241, 13, 1172, 2668, 9167, 30, 263, 19, 1321, 290...
return
def crop(destination, rc): print "Cropping terrain ..." if os.path.exists(destination + "terrain.tif"): return os.unlink(destination + "terrain.tif") args = [cmd_gdal_warp, "-srcnodata", "-1", "-dstnodata", "-1", "-te", str(rc.left.value_degrees()), str(rc.bottom.value_degrees()), str(rc.right.value_degrees()), str(rc.top.value_degrees()), os.path.relpath(destination + "terrain_resampled.tif"), os.path.relpath(destination + "terrain.tif")] p = subprocess.Popen(args) p.wait()
273ec129b7d7f4dc1da4ec198b6c6b59b73965ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6105/273ec129b7d7f4dc1da4ec198b6c6b59b73965ef/srtm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7987, 12, 10590, 16, 4519, 4672, 1172, 315, 19729, 1382, 19272, 7596, 18483, 309, 1140, 18, 803, 18, 1808, 12, 10590, 397, 315, 387, 7596, 18, 26922, 6, 4672, 1140, 18, 318, 1232, 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, 7987, 12, 10590, 16, 4519, 4672, 1172, 315, 19729, 1382, 19272, 7596, 18483, 309, 1140, 18, 803, 18, 1808, 12, 10590, 397, 315, 387, 7596, 18, 26922, 6, 4672, 1140, 18, 318, 1232, 12, ...
% str(job.runningJob['schedulerId']))
% str(selJob.runningJob['schedulerId'])) else: raise SchedulerError('wrong argument type', str( type(obj) ))
def getOutput( self, obj, outdir='' ): """ retrieve job output """
55a0d373215e2d2c4f99fe71353cbd62af3d7838 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8886/55a0d373215e2d2c4f99fe71353cbd62af3d7838/SchedulerGLite.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11062, 12, 365, 16, 1081, 16, 15398, 2218, 11, 262, 30, 3536, 4614, 1719, 876, 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, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11062, 12, 365, 16, 1081, 16, 15398, 2218, 11, 262, 30, 3536, 4614, 1719, 876, 3536, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
self.ioloop = ioloop.IOLoop()
def run(self): """The thread's main activity. Call start() instead.""" self.socket = self.context.socket(zmq.XREQ) self.socket.setsockopt(zmq.IDENTITY, self.session.session) self.socket.connect('tcp://%s:%i' % self.address) self.ioloop = ioloop.IOLoop() self.iostate = POLLERR|POLLIN self.ioloop.add_handler(self.socket, self._handle_events, self.iostate) self.ioloop.start()
c9d5747ff09dc7a24a311ccb59a0dceb3ad36595 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4219/c9d5747ff09dc7a24a311ccb59a0dceb3ad36595/kernelmanager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 3536, 1986, 2650, 1807, 2774, 5728, 18, 225, 3049, 787, 1435, 3560, 12123, 365, 18, 7814, 273, 365, 18, 2472, 18, 7814, 12, 94, 11636, 18, 60, 20373, 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, 1086, 12, 2890, 4672, 3536, 1986, 2650, 1807, 2774, 5728, 18, 225, 3049, 787, 1435, 3560, 12123, 365, 18, 7814, 273, 365, 18, 2472, 18, 7814, 12, 94, 11636, 18, 60, 20373, 13, 365, 18,...
if new_maxi2rate != runningmaxi2rate: message += template % params logger.log("bwmon: %(slice)s %(class)s capped at %(new_maxexemptrate)s/s" % params)
def update(self, runningmaxrate, runningmaxi2rate, usedbytes, usedi2bytes, rspec): """ Update byte counts and check if byte thresholds have been exceeded. If exceeded, cap to remaining bytes in limit over remaining in period. Recalculate every time module runs. """ # Query Node Manager for max rate overrides self.updateSliceAttributes(rspec) # Prepare message parameters from the template message = "" params = {'slice': self.name, 'hostname': socket.gethostname(), 'since': time.asctime(time.gmtime(self.time)) + " GMT", 'until': time.asctime(time.gmtime(self.time + period)) + " GMT", 'date': time.asctime(time.gmtime()) + " GMT", 'period': format_period(period)}
e17ccfdb44360782bd91e02b3b1df8cafb675f28 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6995/e17ccfdb44360782bd91e02b3b1df8cafb675f28/bwmon.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 12, 2890, 16, 3549, 1896, 5141, 16, 3549, 1896, 77, 22, 5141, 16, 1399, 3890, 16, 1399, 77, 22, 3890, 16, 436, 2793, 4672, 3536, 2315, 1160, 6880, 471, 866, 309, 1160, 19983, 124...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 12, 2890, 16, 3549, 1896, 5141, 16, 3549, 1896, 77, 22, 5141, 16, 1399, 3890, 16, 1399, 77, 22, 3890, 16, 436, 2793, 4672, 3536, 2315, 1160, 6880, 471, 866, 309, 1160, 19983, 124...
if not stat1.st_mode == stat2.st_mode: sys.exit('
def compare_data_with(self, path2): path1 = self.data_dir + str(self.change_counter)
bfc20a799fb7ae7a0b6d7996e7ba0681bf49c856 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/736/bfc20a799fb7ae7a0b6d7996e7ba0681bf49c856/backupandrestore_test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3400, 67, 892, 67, 1918, 12, 2890, 16, 589, 22, 4672, 589, 21, 273, 365, 18, 892, 67, 1214, 397, 609, 12, 2890, 18, 3427, 67, 7476, 13, 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, 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, 3400, 67, 892, 67, 1918, 12, 2890, 16, 589, 22, 4672, 589, 21, 273, 365, 18, 892, 67, 1214, 397, 609, 12, 2890, 18, 3427, 67, 7476, 13, 2, -100, -100, -100, -100, -100, -100, -100, ...
for w, marc in work_and_marc():
for work, marc in work_and_marc():
def read_works(): i = 0 pages = {} page_marc = {} for w, marc in work_and_marc(): lines = [] for loc in marc: data = get_data(loc) if not data: continue found = [v for k, v in get_tag_lines(data, set(['600']))] if found: lines.append((loc, found)) if not lines: continue w['lines'] = lines i += 1 print i, w['key'], w['title'] try: people, marc_alt = read_people(j[1] for j in lines) except AssertionError: print w['lines'] continue marc_alt_reverse = defaultdict(set) for k, v in marc_alt.items(): marc_alt_reverse[v].add(k) w = ol.get(w['key']) w['subject_people'] = [] for p, num in people.iteritems(): print ' %2d %s' % (num, ' '.join("%s: %s" % (k, v) for k, v in p)) print ' ', p if p in page_marc: w['subject_people'].append('/subjects/people/' + page_marc[p]) continue obj = build_person_object(p, marc_alt_reverse.get(p, [])) key = obj['name'].replace(' ', '_') full_key = '/subjects/people/' + key w['subject_people'].append(full_key) if key in pages: print key pages[key]['marc'].append(p) continue for m in obj['marc']: page_marc[m] = key pages[key] = obj obj_for_db = obj.copy() del obj_for_db['marc'] obj_for_db['key'] = full_key print ol.save(full_key, obj_for_db, 'create a new person page') print ol.save(w['key'], w, 'add links to people that this work is about')
6a9176a04fdbe1348216b8c03cd958b179472d67 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3913/6a9176a04fdbe1348216b8c03cd958b179472d67/from_works.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 67, 18597, 13332, 277, 273, 374, 4689, 273, 2618, 1363, 67, 3684, 71, 273, 2618, 225, 364, 1440, 16, 312, 11828, 316, 1440, 67, 464, 67, 3684, 71, 13332, 2362, 273, 5378, 364, 151...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 67, 18597, 13332, 277, 273, 374, 4689, 273, 2618, 1363, 67, 3684, 71, 273, 2618, 225, 364, 1440, 16, 312, 11828, 316, 1440, 67, 464, 67, 3684, 71, 13332, 2362, 273, 5378, 364, 151...
sage: B3(1/2,1/2,1/2).mlist() [[(1/2, -1/2, -1/2), 1], [(-1/2, 1/2, -1/2), 1], [(1/2, 1/2, 1/2), 1], [(1/2, 1/2, -1/2), 1], [(-1/2, -1/2, 1/2), 1], [(-1/2, -1/2, -1/2), 1], [(1/2, -1/2, 1/2), 1], [(-1/2, 1/2, 1/2), 1]] """
sage: sorted(B3(1/2,1/2,1/2).mlist()) [[(-1/2, -1/2, -1/2), 1], [(-1/2, -1/2, 1/2), 1], [(-1/2, 1/2, -1/2), 1], [(-1/2, 1/2, 1/2), 1], [(1/2, -1/2, -1/2), 1], [(1/2, -1/2, 1/2), 1], [(1/2, 1/2, -1/2), 1], [(1/2, 1/2, 1/2), 1]] """
def mlist(self): """ Returns a list of weights in self with their multiplicities. EXAMPLES:: sage: B3 = WeylCharacterRing(['B',3]) sage: B3(1/2,1/2,1/2).mlist() [[(1/2, -1/2, -1/2), 1], [(-1/2, 1/2, -1/2), 1], [(1/2, 1/2, 1/2), 1], [(1/2, 1/2, -1/2), 1], [(-1/2, -1/2, 1/2), 1], [(-1/2, -1/2, -1/2), 1], [(1/2, -1/2, 1/2), 1], [(-1/2, 1/2, 1/2), 1]] """
c1d75bd28188ea4a1f81ee812ee9894de021f33e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/c1d75bd28188ea4a1f81ee812ee9894de021f33e/weyl_characters.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 312, 1098, 12, 2890, 4672, 3536, 2860, 279, 666, 434, 5376, 316, 365, 598, 3675, 3309, 1780, 1961, 18, 225, 5675, 8900, 11386, 2866, 225, 272, 410, 30, 605, 23, 273, 678, 402, 80, 7069...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 312, 1098, 12, 2890, 4672, 3536, 2860, 279, 666, 434, 5376, 316, 365, 598, 3675, 3309, 1780, 1961, 18, 225, 5675, 8900, 11386, 2866, 225, 272, 410, 30, 605, 23, 273, 678, 402, 80, 7069...
cvs_root = ''
cvs_root = os.environ.get("SRCSRV_ROOT")
def ProcessFile(self, file): """Dump symbols from this file into a symbol file, stored in the proper directory structure in |symbol_path|.""" result = False sourceFileStream = '' cvs_root = '' for arch in self.archs: try: cmd = os.popen("%s %s %s" % (self.dump_syms, arch, file), "r") module_line = cmd.next() if module_line.startswith("MODULE"): # MODULE os cpu guid debug_file (guid, debug_file) = (module_line.split())[3:5] # strip off .pdb extensions, and append .sym sym_file = re.sub("\.pdb$", "", debug_file) + ".sym" # we do want forward slashes here rel_path = os.path.join(debug_file, guid, sym_file).replace("\\", "/") full_path = os.path.normpath(os.path.join(self.symbol_path, rel_path)) try: os.makedirs(os.path.dirname(full_path)) except OSError: # already exists pass f = open(full_path, "w") f.write(module_line) # now process the rest of the output for line in cmd: if line.startswith("FILE"): # FILE index filename (x, index, filename) = line.split(None, 2) if sys.platform == "sunos5": start = filename.find(self.srcdir) if start == -1: start = 0 filename = filename[start:] filename = self.FixFilenameCase(filename.rstrip()) sourcepath = filename if self.vcsinfo: (filename, rootname) = GetVCSFilename(filename, self.srcdir) # sets cvs_root in case the loop through files were to end on an empty rootname if rootname: cvs_root = rootname # gather up files with cvs for indexing if filename.startswith("cvs"): (ver, checkout, source_file, revision) = filename.split(":", 3) sourceFileStream += sourcepath + "*MYSERVER*" + source_file + '*' + revision + "\r\n" f.write("FILE %s %s\n" % (index, filename)) else: # pass through all other lines unchanged f.write(line) f.close() cmd.close() # we output relative paths so callers can get a list of what # was generated print rel_path if self.copy_debug: self.CopyDebug(file, debug_file, guid) if self.srcsrv: # Call on SourceServerIndexing result = self.SourceServerIndexing(debug_file, guid, sourceFileStream, cvs_root) result = True except StopIteration: pass except: print >> sys.stderr, "Unexpected error: ", sys.exc_info()[0] raise return result
a37303f5b31d51f42b8626fe92b43c3915dcbc05 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11102/a37303f5b31d51f42b8626fe92b43c3915dcbc05/symbolstore.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4389, 812, 12, 2890, 16, 585, 4672, 3536, 10628, 7963, 628, 333, 585, 1368, 279, 3273, 585, 16, 4041, 316, 326, 5338, 1867, 3695, 316, 225, 571, 7175, 67, 803, 96, 12123, 563, 273, 108...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4389, 812, 12, 2890, 16, 585, 4672, 3536, 10628, 7963, 628, 333, 585, 1368, 279, 3273, 585, 16, 4041, 316, 326, 5338, 1867, 3695, 316, 225, 571, 7175, 67, 803, 96, 12123, 563, 273, 108...
self.toggle1.label_set(_("Visibility"))
self.toggle1.label_set(_("Visibility:"))
def createView(self): box1 = elementary.Box(self.window)
96df52ecbc51e86f029c1e5a29cf17a34ae92540 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11428/96df52ecbc51e86f029c1e5a29cf17a34ae92540/shr_bt.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15193, 12, 2890, 4672, 3919, 21, 273, 930, 814, 18, 3514, 12, 2890, 18, 5668, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 15193, 12, 2890, 4672, 3919, 21, 273, 930, 814, 18, 3514, 12, 2890, 18, 5668, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
security.declareProtected(View, 'searchMembers')
security.declareProtected(ListPortalMembers, 'searchMembers')
def listMembers(self): '''Gets the list of all members. ''' return map(self.wrapUser, self.__getPUS().getUsers())
e8407ae52763a1fdd2b2c37623c8f9fd2e729339 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1843/e8407ae52763a1fdd2b2c37623c8f9fd2e729339/MembershipTool.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 666, 6918, 12, 2890, 4672, 9163, 3002, 326, 666, 434, 777, 4833, 18, 9163, 327, 852, 12, 2890, 18, 4113, 1299, 16, 365, 16186, 588, 52, 3378, 7675, 588, 6588, 10756, 2, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 666, 6918, 12, 2890, 4672, 9163, 3002, 326, 666, 434, 777, 4833, 18, 9163, 327, 852, 12, 2890, 18, 4113, 1299, 16, 365, 16186, 588, 52, 3378, 7675, 588, 6588, 10756, 2, -100, -100, -10...
and j*i=-i*j. K is a field not of characteristic and a,b are nonzero elements of K.
and j*i=-i*j. K is a field not of characteristic 2 and a,b are nonzero elements of K.
def vector_space(self): """ Return the vector space associated to self with inner product given by the reduced norm.
f27a1f22d08f6c62e660999f3a665365d7eaa01e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/f27a1f22d08f6c62e660999f3a665365d7eaa01e/quaternion_algebra.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3806, 67, 2981, 12, 2890, 4672, 3536, 2000, 326, 3806, 3476, 3627, 358, 365, 598, 3443, 3017, 864, 635, 326, 13162, 4651, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3806, 67, 2981, 12, 2890, 4672, 3536, 2000, 326, 3806, 3476, 3627, 358, 365, 598, 3443, 3017, 864, 635, 326, 13162, 4651, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
if ( self.is_Embedded(k) ):
if ( self.isEmbedded(k) ):
def Tag_attr_ubyte(self): new_tag = unpack('B', self.data[self.index])[0]
88c97c62bc3fc1e74a11542e8ee3b8464933c063 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/675/88c97c62bc3fc1e74a11542e8ee3b8464933c063/pxldis.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4034, 67, 1747, 67, 10340, 736, 12, 2890, 4672, 394, 67, 2692, 273, 6167, 2668, 38, 2187, 365, 18, 892, 63, 2890, 18, 1615, 5717, 63, 20, 65, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4034, 67, 1747, 67, 10340, 736, 12, 2890, 4672, 394, 67, 2692, 273, 6167, 2668, 38, 2187, 365, 18, 892, 63, 2890, 18, 1615, 5717, 63, 20, 65, 2, -100, -100, -100, -100, -100, -100, -...
map(self.incomplete_injection_coinc_ids.remove, [coinc_event_id for (coinc_event_id,) in self.coinc_table.cursor.execute("SELECT DISTINCT event_id FROM coinc_event_map JOIN coinc_event ON (coinc_event_map.coinc_event_id == coinc_event.coinc_event_id) WHERE table_name == 'coinc_event' AND coinc_def_id == ?", (self.sc_definer_id,))])
map(self.incomplete_injection_coinc_ids.remove, [coinc_event_id for (coinc_event_id,) in self.coinc_table.cursor.execute("SELECT DISTINCT event_id FROM coinc_event_map JOIN coinc_event ON (coinc_event_map.coinc_event_id == coinc_event.coinc_event_id) WHERE table_name == 'coinc_event' AND coinc_def_id == ?", (lsctables.ILWDID(self.sc_definer_id),))])
def summarize(self, xmldoc, live_time_program, verbose = False): """ Compute and record some summary information about the database. Call this after all the data has been inserted, and before you want any of this information. """ self.connection.commit() self.connection.execute("CREATE INDEX time_slide_id_index ON time_slide (time_slide_id)") self.connection.execute("CREATE INDEX coinc_event_id_index ON coinc_event_map (table_name, coinc_event_id)")
c885fe584f38bc7dc722ca6981bb825cfd72aeea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5758/c885fe584f38bc7dc722ca6981bb825cfd72aeea/SnglBurstUtils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 28712, 12, 2890, 16, 2025, 2434, 16, 8429, 67, 957, 67, 12890, 16, 3988, 273, 1083, 4672, 3536, 8155, 471, 1409, 2690, 4916, 1779, 2973, 326, 2063, 18, 225, 3049, 333, 1839, 777, 326, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 28712, 12, 2890, 16, 2025, 2434, 16, 8429, 67, 957, 67, 12890, 16, 3988, 273, 1083, 4672, 3536, 8155, 471, 1409, 2690, 4916, 1779, 2973, 326, 2063, 18, 225, 3049, 333, 1839, 777, 326, ...
const PPB_OpenGLES* Graphics3D::GetOpenGLESInterface() {
const PPB_OpenGLES_Dev* Graphics3D::GetOpenGLESInterface() {
def WritePepperGLES2Implementation(self, filename): """Writes the Pepper OpenGLES interface implementation."""
fa34f7f0b969cee4616b0a88cc66de6c8ff3746d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/fa34f7f0b969cee4616b0a88cc66de6c8ff3746d/build_gles2_cmd_buffer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2598, 28828, 457, 43, 11386, 22, 13621, 12, 2890, 16, 1544, 4672, 3536, 8368, 326, 453, 881, 457, 3502, 43, 11386, 1560, 4471, 12123, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 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, 2598, 28828, 457, 43, 11386, 22, 13621, 12, 2890, 16, 1544, 4672, 3536, 8368, 326, 453, 881, 457, 3502, 43, 11386, 1560, 4471, 12123, 2, -100, -100, -100, -100, -100, -100, -100, -100, -...
if not self.data.has_key(key): self.data[key] = failobj return self.data[key]
if not self.has_key(key): self[key] = failobj return self[key]
def setdefault(self, key, failobj=None): if not self.data.has_key(key): self.data[key] = failobj return self.data[key]
8c23b75bc8a613ff12d725053a65a66baff2f81e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8c23b75bc8a613ff12d725053a65a66baff2f81e/UserDict.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8745, 12, 2890, 16, 498, 16, 2321, 2603, 33, 7036, 4672, 309, 486, 365, 18, 892, 18, 5332, 67, 856, 12, 856, 4672, 365, 18, 892, 63, 856, 65, 273, 2321, 2603, 327, 365, 18, 892, 63...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8745, 12, 2890, 16, 498, 16, 2321, 2603, 33, 7036, 4672, 309, 486, 365, 18, 892, 18, 5332, 67, 856, 12, 856, 4672, 365, 18, 892, 63, 856, 65, 273, 2321, 2603, 327, 365, 18, 892, 63...
print print " INITIALIZATION:" print "----------------------------------------------------------------------------" print " * Processing arguments..." (fileDb, moduleDb) = load(options) execute(fileDb, moduleDb, options, options.packageId) def main(): if len(sys.argv[1:]) == 0: basename = os.path.basename(sys.argv[0]) print "usage: %s [options]" % basename print "Try '%s -h' or '%s --help' to show the help message." % (basename, basename) sys.exit(1) argparser(sys.argv[1:]) def load(options): print print " SOURCE LOADER:" print "----------------------------------------------------------------------------" if options.classPath == None or len(options.classPath) == 0: if len(options.migrationInput) == 0: basename = os.path.basename(sys.argv[0]) print "You must define at least one class path!" print "usage: %s [options]" % basename print "Try '%s -h' or '%s --help' to show the help message." % (basename, basename) sys.exit(1) (fileDb, moduleDb) = loader.indexAll(options) if options.printFiles: print print " OUTPUT OF KNOWN FILES:" print "----------------------------------------------------------------------------" print " * These are all known files:" for fileEntry in fileDb: print " - %s (%s)" % (fileEntry, fileDb[fileEntry]["path"]) if options.printModules: print print " OUTPUT OF KNOWN MODULES:" print "----------------------------------------------------------------------------" print " * These are all known modules:" for moduleEntry in moduleDb: print " * %s" % moduleEntry for fileEntry in moduleDb[moduleEntry]: print " - %s" % fileEntry if options.printFilesWithoutModules: print print " OUTPUT OF FILES WHICH HAVE NO MODULE CONNECTION:" print "----------------------------------------------------------------------------" print " * These are all files without a module connection:" for fileEntry in fileDb: fileFound = False for moduleEntry in moduleDb: for moduleFile in moduleDb[moduleEntry]: if moduleFile == fileEntry: fileFound = True break if not fileFound: print " - %s" % fileEntry return fileDb, moduleDb def execute(fileDb, moduleDb, options, pkgid="", names=[]): print print " GENERATE CLASS INCLUDE LIST:" print "----------------------------------------------------------------------------" sortedIncludeList = loader.getSortedList(options, fileDb, moduleDb) if options.printIncludes: print print " PRINT OF INCLUDE ORDER:" print "----------------------------------------------------------------------------" print " * The files will be included in this order:" for fileId in sortedIncludeList: print " - %s" % fileId if options.printIncludesFile: includeFile = open(options.printIncludesFile, "w") for fileId in sortedIncludeList: includeFile.write(fileId + "\n") includeFile.close() if options.printDependencies: print print " OUTPUT OF DEPENDENCIES:" print "----------------------------------------------------------------------------" print " * These are all included files with their dependencies:" for fileId in sortedIncludeList: print " - %s" % fileId if len(fileDb[fileId]["loadtimeDeps"]) > 0: print " - Loadtime: " for depEntry in fileDb[fileId]["loadtimeDeps"]: print " - %s" % depEntry if len(fileDb[fileId]["runtimeDeps"]) > 0: print " - Runtime: " for depEntry in fileDb[fileId]["runtimeDeps"]: print " - %s" % depEntry if len(fileDb[fileId]["optionalDeps"]) > 0: print " - Optional: " for depEntry in fileDb[fileId]["optionalDeps"]: print " - %s" % depEntry if options.depDotFile: graph.store(fileDb, sortedIncludeList, options) if options.migrateSource: print print " SOURCE MIGRATION:" print "----------------------------------------------------------------------------" print " * Migrate Source Code..." migrator.handle(fileDb, options, options.migrationTarget, options.migrationInput, options.verbose) return if options.fixSource: print print " FIX SOURCE CODE:" print "----------------------------------------------------------------------------" if options.verbose: print " * Fixing code..." else: print " * Fixing code: ", for fileId in sortedIncludeList: if options.verbose: print " - Reading %s" % fileId fileEntry = fileDb[fileId] filePath = fileEntry["path"] fileEncoding = fileEntry["encoding"] fileContent = filetool.read(filePath, fileEncoding) fixedContent = textutil.removeTrailingSpaces(textutil.tab2Space(textutil.any2Unix(fileContent), 2)) if fixedContent != fileContent: if options.verbose: print " - Storing modifications..." else: sys.stdout.write("!") sys.stdout.flush() filetool.save(filePath, fixedContent, fileEncoding) elif not options.verbose: sys.stdout.write(".") sys.stdout.flush() if not options.verbose: print return if options.prettyPrint: print print " GENERATION OF PRETTY PRINTED CODE:" print "----------------------------------------------------------------------------" if options.verbose: print " * Pretty printing..." else: print " * Pretty printing: ", for fileId in sortedIncludeList: if options.verbose: print " - Compiling %s" % fileId else: sys.stdout.write(".") sys.stdout.flush() prettyFileContent = compiler.compile(loader.getTree(fileDb, fileId, options), options) if not prettyFileContent.endswith("\n"): prettyFileContent += "\n" filetool.save(fileDb[fileId]["path"], prettyFileContent) if not options.verbose: print return inlineSourceCode = [] inlineCompiledCode = [] if len(options.useVariant) > 0 and not options.generateSourceScript: print print " VARIANT OPTIMIZATION:" print "----------------------------------------------------------------------------" variantMap = {} for variant in options.useVariant: keyValue = variant.split(":") if len(keyValue) != 2: print " * Error: Variants must be specified as key value pair separated by ':'!" sys.exit(1) variantMap[keyValue[0]] = keyValue[1] if options.verbose: print " * Optimizing for variant setup..." else: print " * Optimizing for variant setup: ", for fileId in sortedIncludeList: if options.verbose: print " - %s" % fileId else: sys.stdout.write(".") sys.stdout.flush() if variantoptimizer.search(loader.getTree(fileDb, fileId, options), variantMap, fileId, options.verbose): if options.verbose: print " - Modified!" if not options.verbose: print if options.optimizeBaseCall: print print " BASE CALL OPTIMIZATION:" print "----------------------------------------------------------------------------" if options.verbose: print " * Optimizing this.base calls..." else: print " * Optimizing this.base calls: ", counter = 0 for fileId in sortedIncludeList: if options.verbose: print " - %s" % fileId else: sys.stdout.write(".") sys.stdout.flush() counter += basecalloptimizer.patch(loader.getTree(fileDb, fileId, options)) if not options.verbose: print print " * Optimized %s calls" % counter if options.obfuscateAccessors: print print " ACCESSOR OBFUSCATION:" print "----------------------------------------------------------------------------" if options.verbose: print " * Obfuscating..." else: print " * Obfuscating: ", for fileId in sortedIncludeList: if options.verbose: print " - %s" % fileId else: sys.stdout.write(".") sys.stdout.flush() accessorobfuscator.process(loader.getTree(fileDb, fileId, options), options.verbose) if not options.verbose: print if options.optimizeStrings: print print " STRING OPTIMIZATION:" print "----------------------------------------------------------------------------" if options.verbose: print " * Searching strings..." else: print " * Searching strings: ", stringMap = {} for fileId in sortedIncludeList: if options.verbose: print " - %s" % fileId else: sys.stdout.write(".") sys.stdout.flush() localMap = stringoptimizer.search(loader.getTree(fileDb, fileId, options), options.verbose) for value in localMap: if value in stringMap: stringMap[value] += localMap[value] else: stringMap[value] = localMap[value] if not options.verbose: print counter = 0 for value in stringMap: counter += stringMap[value] stringList = stringoptimizer.sort(stringMap) print " * Found %s string instances (%s unique)" % (counter, len(stringMap)) if options.verbose: print " * Replacing strings..." else: print " * Replacing strings: ", for fileId in sortedIncludeList: if options.verbose: print " - %s" % fileId else: sys.stdout.write(".") sys.stdout.flush() stringoptimizer.replace(loader.getTree(fileDb, fileId, options), stringList, "$" + pkgid, options.verbose) if not options.verbose: print print " * Generating replacement..." inlineCompiledCode.append(stringoptimizer.replacement(stringList, "$" + pkgid)) if options.optimizeVariables or options.obfuscate: print print " LOCAL VARIABLE OPTIMIZATION:" print "----------------------------------------------------------------------------" if options.verbose: print " * Optimizing variables..." else: print " * Optimizing variables: ", counter = 0 for fileId in sortedIncludeList: if options.verbose: print " - %s" % fileId else: sys.stdout.write(".") sys.stdout.flush() counter += variableoptimizer.search( loader.getTree(fileDb, fileId, options), [], 0, 0, "$", skipPrefix = options.optimizeVariablesSkipPrefix, verbose = options.verbose ) if not options.verbose: print print " * Optimized %s variables" % counter if options.optimizePrivate: print print " PRIVATE MEMBER OPTIMIZATION:" print "----------------------------------------------------------------------------" if options.verbose: print " * Optimizing private members..." else: print " * Optimizing private members: ", counter = 0 for fileId in sortedIncludeList: if options.verbose: print " - %s" % fileId else: sys.stdout.write(".") sys.stdout.flush() counter += privateoptimizer.patch(loader.getTree(fileDb, fileId, options), {}, "$", options.verbose) if not options.verbose: print print " * Optimized %s keys" % counter if options.obfuscate: print print " OBFUSCATION:" print "----------------------------------------------------------------------------" if options.verbose: print " * Searching for assignments..." else: print " * Searching for assignments: ", identifiers = {} for fileId in sortedIncludeList: if options.verbose: print " - %s" % fileId else: sys.stdout.write(".") sys.stdout.flush() obfuscator.search(loader.getTree(fileDb, fileId, options), identifiers, options.verbose) for fileId in sortedIncludeList: if options.verbose: print " - %s" % fileId else: sys.stdout.write(".") sys.stdout.flush() obfuscator.patch(loader.getTree(fileDb, fileId, options), identifiers, options.verbose) if not options.verbose: print if options.storeTokens: print print " TOKEN STORAGE:" print "----------------------------------------------------------------------------" if options.tokenOutputDirectory == None: print " * You must define the token output directory!" sys.exit(1) if options.verbose: print " * Storing tokens..." else: print " * Storing tokens: ", for fileId in sortedIncludeList: tokenString = tokenizer.convertTokensToString(loader.getTokens(fileDb, fileId, options)) if options.verbose: print " * Writing tokens for %s (%s KB)..." % (fileIdm, len(tokenString) / 1000.0) else: sys.stdout.write(".") sys.stdout.flush() filetool.save(os.path.join(filetool.normalize(options.tokenOutputDirectory), fileId + config.TOKENEXT), tokenString) if not options.verbose: print if options.storeTree: print print " TREE STORAGE:" print "----------------------------------------------------------------------------" if options.treeOutputDirectory == None: print " * You must define the tree output directory!" sys.exit(1) if options.verbose: print " * Storing tree..." else: print " * Storing tree: ", for fileId in sortedIncludeList: treeString = "<?xml version=\"1.0\" encoding=\"" + options.xmlOutputEncoding + "\"?>\n" + tree.nodeToXmlString(loader.getTree(fileDb, fileId, options)) if options.verbose: print " * Writing tree for %s (%s KB)..." % (fileId, len(treeString) / 1000.0) else: sys.stdout.write(".") sys.stdout.flush() filetool.save(os.path.join(filetool.normalize(options.treeOutputDirectory), fileId + config.XMLEXT), treeString) if not options.verbose: print if options.generateApiDocumentation: print print " GENERATION OF API:" print "----------------------------------------------------------------------------" if options.apiDocumentationJsonFile == None and options.apiDocumentationXmlFile == None: print " * You must define one of JSON or XML API documentation file!" docTree = None if options.verbose: print " * Generating API tree..." else: print " * Generating API tree: ", hasDocError = False for fileId in sortedIncludeList: if options.verbose: print " - %s" % fileId else: sys.stdout.write(".") sys.stdout.flush() (docTree, error) = api.createDoc(loader.getTree(fileDb, fileId, options), docTree) hasDocError = hasDocError or error if hasDocError: print print " * Building API failed!!" sys.exit(0) if not options.verbose: print if docTree: print " * Finalizing tree..." api.postWorkPackage(docTree, docTree) if options.addNewLines: childPrefix = " " newLine = "\n" else: childPrefix = "" newLine = "" if options.apiDocumentationXmlFile != None: print " * Writing XML API file to %s" % options.apiDocumentationXmlFile if options.apiSeparateFiles: packages = api.packagesToXmlString(docTree, "", childPrefix, newLine) filetool.save(options.apiDocumentationXmlFile, packages, options.scriptOutputEncoding) for cls in api.classNodeIterator(docTree): classContent = "<?xml version=\"1.0\" encoding=\"" + options.xmlOutputEncoding + "\"?>\n" classContent += tree.nodeToXmlString(cls, "", childPrefix, newLine) fileName = os.path.join(os.path.dirname(options.apiDocumentationXmlFile), cls.get("fullName") + ".xml") filetool.save(fileName, classContent, options.xmlOutputEncoding) else: xmlContent = "<?xml version=\"1.0\" encoding=\"" + options.xmlOutputEncoding + "\"?>\n" xmlContent += tree.nodeToXmlString(docTree, "", childPrefix, newLine) filetool.save(options.apiDocumentationXmlFile, xmlContent, options.xmlOutputEncoding) if options.apiDocumentationJsonFile != None: print " * Writing JSON API file to %s" % options.apiDocumentationJsonFile if options.apiSeparateFiles: packages = api.packagesToJsonString(docTree, "", childPrefix, newLine) filetool.save(options.apiDocumentationJsonFile, packages, options.scriptOutputEncoding) for cls in api.classNodeIterator(docTree): classContent = tree.nodeToJsonString(cls, "", childPrefix, newLine) fileName = os.path.join(os.path.dirname(options.apiDocumentationJsonFile), cls.get("fullName") + ".js") filetool.save(fileName, classContent, options.scriptOutputEncoding) else: jsonContent = tree.nodeToJsonString(docTree, "", childPrefix, newLine) filetool.save(options.apiDocumentationJsonFile, jsonContent, options.scriptOutputEncoding) if options.apiDocumentationIndexFile != None: print " * Generating API index..." jsonContent = tree.nodeToIndexString(docTree, "", childPrefix, newLine) print " * Writing API search index to %s" % options.apiDocumentationIndexFile filetool.save(options.apiDocumentationIndexFile, jsonContent, options.scriptOutputEncoding) if options.copyResources: print print " CREATE COPY OF RESOURCES:" print "----------------------------------------------------------------------------" resources.copy(options, sortedIncludeList, fileDb) if options.generateSourceScript or options.generateCompiledScript: print print " INCLUSION OF SETTINGS:" print "----------------------------------------------------------------------------" if options.generateSourceScript: print " * Processing settings of source version..." settingsArr = options.useSetting[:] settingsArr.append("qx.version:%s" % options.version) settingsArr.append("qx.isSource:true") inlineSourceCode.append(settings.generate(settingsArr, options.addNewLines)) if options.generateCompiledScript: print " * Processing settings of compiled version..." settingsArr = options.useSetting[:] settingsArr.append("qx.version:%s" % options.version) settingsArr.append("qx.isSource:false") inlineCompiledCode.append(settings.generate(settingsArr, options.addNewLines)) if options.generateSourceScript or options.generateCompiledScript: print print " INCLUSION OF VARIANTS:" print "----------------------------------------------------------------------------" if options.generateSourceScript: print " * Processing variants of source version..." variantsArr = options.useVariant[:] inlineSourceCode.append(variants.generate(variantsArr, options.addNewLines)) if options.generateCompiledScript: print " * Processing variants of compiled version..." variantsArr = options.useVariant[:] inlineCompiledCode.append(variants.generate(variantsArr, options.addNewLines)) if options.generateSourceScript: print print " GENERATION OF SOURCE SCRIPT:" print "----------------------------------------------------------------------------" if options.sourceScriptFile == None and (options.sourceTemplateInputFile == None or options.sourceTemplateOutputFile == None): print " * You must define at least one source script file or template input/output." sys.exit(1) if options.sourceScriptFile: options.sourceScriptFile = os.path.normpath(options.sourceScriptFile) if options.sourceTemplateInputFile: options.sourceTemplateInputFile = os.path.normpath(options.sourceTemplateInputFile) if options.sourceTemplateOutputFile: options.sourceTemplateOutputFile = os.path.normpath(options.sourceTemplateOutputFile) print " * Generating script block..." sourceLineFeed = ""; if options.addNewLines: sourceLineFeed = "\n"; scriptBlocks = "" scriptBlocks += '<script type="text/javascript">%s</script>' % "".join(inlineSourceCode) for fileId in sortedIncludeList: if 'meta' in fileDb[fileId] and fileDb[fileId]["meta"]: continue if fileDb[fileId]["classUri"] == None: print " * Missing class URI definition for class path %s." % fileDb[fileId]["classPath"] sys.exit(1) scriptBlocks += '<script type="text/javascript" src="%s%s"></script>' % (os.path.join(fileDb[fileId]["classUri"], fileDb[fileId]["pathId"].replace(".", '/')), config.JSEXT) scriptBlocks += sourceLineFeed if options.sourceScriptFile != None: print " * Storing includer as %s..." % options.sourceScriptFile sourceScript = "document.write('%s');" % scriptBlocks.replace("'", "\\'") if options.addNewLines: sourceScript = sourceScript.replace("\n", "\\\n") filetool.save(options.sourceScriptFile, sourceScript, options.scriptOutputEncoding) if options.sourceTemplateInputFile != None and options.sourceTemplateOutputFile != None: print " * Patching template: %s => %s" % (options.sourceTemplateInputFile, options.sourceTemplateOutputFile) tmpl = filetool.read(options.sourceTemplateInputFile) res = tmpl.replace(options.sourceTemplateReplace, scriptBlocks) filetool.save(options.sourceTemplateOutputFile, res, options.scriptOutputEncoding) if options.generateCompiledScript: print print " GENERATION OF COMPILED SCRIPT:" print "----------------------------------------------------------------------------" buildLineFeed = ""; if options.addNewLines: buildLineFeed = "\n"; compiledOutput = "".join(inlineCompiledCode) if options.compiledScriptFile == None: print " * You must define the compiled script file!" sys.exit(1) if options.verbose: print " * Compiling..." else: print " * Compiling: ", for fileId in sortedIncludeList: if fileDb[fileId]["meta"]: continue if options.verbose: print " - Compiling %s" % fileId else: sys.stdout.write(".") sys.stdout.flush() if options.prettyPrint: options.prettyPrint = False compiledFileContent = compiler.compile(loader.getTree(fileDb, fileId, options), options, options.addNewLines, options.verbose) if options.addFileIds: compiledOutput += "\n\n\n/* ID: " + fileId + " */\n" + compiledFileContent + "\n" else: compiledOutput += compiledFileContent if not compiledOutput.endswith(";") and not compiledOutput.endswith("\n"): compiledOutput += ";" if not options.verbose: print print " * Storing output as %s..." % options.compiledScriptFile filetool.save(options.compiledScriptFile, compiledOutput, options.scriptOutputEncoding)
htmlFiles = None for version in neededUpdates: logging.info("") logging.info("UPGRADE TO %s" % (version)) logging.info("----------------------------------------------------------------------------") handle(fileDb, options, getNormalizedVersion(version), htmlFiles, verbose=options.verbose) if not options.makefile is None: patchMakefile(options.makefile, MIGRATION_ORDER[-1], options.from_version) print """ The complete output of the migration process has been logged to the file '%s'. """ % LOGFILE
def argparser(cmdlineargs): # Parse arguments parser = getparser() (options, args) = parser.parse_args(cmdlineargs) if options.generateSourceScript and ( options.obfuscateAccessors or options.optimizeStrings or options.optimizeVariables or options.optimizeVariablesSkipPrefix or options.optimizeBaseCall or options.optimizePrivate or options.obfuscate ): parser.error("The option --generate-source-script cannot be used with source code optimizations!") # Export to file if options.exportToFile != None: print print " EXPORTING:" print "----------------------------------------------------------------------------" print " * Translating options..." optionString = "# Exported configuration from build.py\n\n" ignoreValue = True lastWasKey = False for arg in cmdlineargs: if arg == "--export-to-file": ignoreValue = True elif arg.startswith("--"): if lastWasKey: optionString += "\n" optionString += arg[2:] ignoreValue = False lastWasKey = True elif arg.startswith("-"): print " - Could not export short argument: %s" % arg optionString += "\n# Ignored short argument %s\n" % arg ignoreValue = True elif not ignoreValue: optionString += " = %s\n" % arg ignoreValue = True lastWasKey = False print " * Export to file: %s" % options.exportToFile filetool.save(options.exportToFile, optionString) sys.exit(0) # Read from file elif options.fromFile != None: print print " INITIALIZATION:" print "----------------------------------------------------------------------------" print " * Reading configuration..." # Convert file content into arguments fileargs = {} fileargpos = 0 fileargid = "default" currentfileargs = [] fileargs[fileargid] = currentfileargs alternativeFormatBegin = re.compile("\s*\[\s*") alternativeFormatEnd = re.compile("\s*\]\s*=\s*") emptyLine = re.compile("^\s*$") for line in file(options.fromFile).read().split("\n"): line = line.strip() if emptyLine.match(line) or line.startswith("#") or line.startswith("//"): continue # Translating... line = alternativeFormatBegin.sub(" = ", line) line = alternativeFormatEnd.sub(":", line) # Splitting line line = line.split("=") # Extract key element key = line.pop(0).strip() # Separate packages if key == "package": fileargpos += 1 fileargid = line[0].strip() print " - Found package: %s" % fileargid currentfileargs = [] fileargs[fileargid] = currentfileargs continue currentfileargs.append("--%s" % key) if len(line) > 0: value = line[0].strip() currentfileargs.append(value) # Parse defaultargs = fileargs["default"] if len(fileargs) > 1: (fileDb, moduleDb) = load(getparser().parse_args(defaultargs)[0]) for filearg in fileargs: if filearg == "default": continue print print print print print " PACKAGE: %s" % filearg print "----------------------------------------------------------------------------" combinedargs = [] combinedargs.extend(defaultargs) combinedargs.extend(fileargs[filearg]) options = getparser().parse_args(combinedargs)[0] execute(fileDb, moduleDb, options, filearg) else: options = getparser().parse_args(defaultargs)[0] (fileDb, moduleDb) = load(options) execute(fileDb, moduleDb, options, "") else: print print " INITIALIZATION:" print "----------------------------------------------------------------------------" print " * Processing arguments..." (fileDb, moduleDb) = load(options) execute(fileDb, moduleDb, options, options.packageId)
cdd17787835fc154de4952593087092c745033d2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5718/cdd17787835fc154de4952593087092c745033d2/generator.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1501, 4288, 12, 4172, 1369, 1968, 4672, 225, 468, 2884, 1775, 2082, 273, 336, 4288, 1435, 261, 2116, 16, 833, 13, 273, 2082, 18, 2670, 67, 1968, 12, 4172, 1369, 1968, 13, 225, 309, 702...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1501, 4288, 12, 4172, 1369, 1968, 4672, 225, 468, 2884, 1775, 2082, 273, 336, 4288, 1435, 261, 2116, 16, 833, 13, 273, 2082, 18, 2670, 67, 1968, 12, 4172, 1369, 1968, 13, 225, 309, 702...
patchlist_filename = arg
patchlist_file = arg
def main(argv): patchlist_file = None try: opts, args = getopt.getopt(argv, "hf:", ["help", "patchlist_file="]) for opt, arg in opts: if opt in ("-h", "--help"): usage() sys.exit() elif opt in ("-f", "--patchlist_file"): patchlist_filename = arg except getopt.GetoptError: usage() sys.exit(2) if not patchlist_filename: usage() sys.exit(2) create_partial_patches(patchlist_filename)
bd98254bfb4f89d1bced1b490bbc3ad671c2cca7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11102/bd98254bfb4f89d1bced1b490bbc3ad671c2cca7/make_incremental_updates.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 19485, 4672, 4729, 1098, 67, 768, 273, 599, 775, 30, 1500, 16, 833, 273, 336, 3838, 18, 588, 3838, 12, 19485, 16, 315, 76, 74, 2773, 16, 8247, 5201, 3113, 315, 2272, 1098, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4729, 1098, 67, 768, 273, 599, 775, 30, 1500, 16, 833, 273, 336, 3838, 18, 588, 3838, 12, 19485, 16, 315, 76, 74, 2773, 16, 8247, 5201, 3113, 315, 2272, 1098, ...
if value is not u"":
if value is not "":
def has_sound(sound): """Find out if a particular event is configured with a default sound""" try: key = winreg.OpenKeyEx(_winreg.HKEY_CURRENT_USER, "AppEvents\Schemes\Apps\.Default\{0}\.Default".format(sound)) value = winreg.EnumValue(key, 0)[1] if value is not u"": return True else: return False except WindowsError: return False
141b72e41c37d034a2f0c10bf108b20f4f61b9e6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/141b72e41c37d034a2f0c10bf108b20f4f61b9e6/test_winsound.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 711, 67, 29671, 12, 29671, 4672, 3536, 3125, 596, 309, 279, 6826, 871, 353, 4351, 598, 279, 805, 14190, 8395, 775, 30, 498, 273, 5657, 1574, 18, 3678, 653, 424, 24899, 8082, 1574, 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, 711, 67, 29671, 12, 29671, 4672, 3536, 3125, 596, 309, 279, 6826, 871, 353, 4351, 598, 279, 805, 14190, 8395, 775, 30, 498, 273, 5657, 1574, 18, 3678, 653, 424, 24899, 8082, 1574, 18, ...
coordinates.add_latlngalt(lon, lat, alt)
coordinates.add_latlngalt(lat, lon, alt)
def runTest(self): factory = kmldom.KmlFactory_GetFactory() coordinates = factory.CreateCoordinates() # Test the Element methods assert kmldom.Type_coordinates == coordinates.Type() assert coordinates.IsA(kmldom.Type_coordinates) # Test the Coordinates methods lon = -123.456 lat = 38.765 alt = 1001.909 assert 0 == coordinates.get_coordinates_array_size() coordinates.add_latlng(lon, lat) assert 1 == coordinates.get_coordinates_array_size() coordinates.add_latlngalt(lon, lat, alt) assert 2 == coordinates.get_coordinates_array_size() vec0 = coordinates.get_coordinates_array_at(0) vec1 = coordinates.get_coordinates_array_at(1) # Test the Vec3 methods assert lon == vec0.get_longitude() assert lat == vec0.get_latitude() assert 0 == vec0.get_altitude() assert lon == vec1.get_longitude() assert lat == vec1.get_latitude() assert alt == vec1.get_altitude()
cfd6100abd1cdde1f79e21e19a9778e9fd43f98e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4271/cfd6100abd1cdde1f79e21e19a9778e9fd43f98e/kmldom_test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 4709, 12, 2890, 4672, 3272, 273, 417, 781, 9859, 18, 47, 781, 1733, 67, 967, 1733, 1435, 5513, 273, 3272, 18, 1684, 13431, 1435, 468, 7766, 326, 3010, 2590, 1815, 417, 781, 9859, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4709, 12, 2890, 4672, 3272, 273, 417, 781, 9859, 18, 47, 781, 1733, 67, 967, 1733, 1435, 5513, 273, 3272, 18, 1684, 13431, 1435, 468, 7766, 326, 3010, 2590, 1815, 417, 781, 9859, ...
return(p_record)
return(p_record)
def package_add_record(self, tag_id, file): """ Function to add a package record """ logging.debug('in Binary.package_add_record(%s, %s)' % (tag_id, file))
4a864b026ecf883eb6eaf82312e7a03648d17952 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11154/4a864b026ecf883eb6eaf82312e7a03648d17952/binary.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2181, 67, 1289, 67, 3366, 12, 2890, 16, 1047, 67, 350, 16, 585, 4672, 3536, 4284, 358, 527, 279, 2181, 1409, 3536, 2907, 18, 4148, 2668, 267, 7896, 18, 5610, 67, 1289, 67, 3366, 9275, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2181, 67, 1289, 67, 3366, 12, 2890, 16, 1047, 67, 350, 16, 585, 4672, 3536, 4284, 358, 527, 279, 2181, 1409, 3536, 2907, 18, 4148, 2668, 267, 7896, 18, 5610, 67, 1289, 67, 3366, 9275, ...
result = self.__findAll(path) return result def __findAll(self, parts):
result = self.__childrenAtPath(parts) return result def __childrenAtPath(self, parts):
def findAll(self, path): result = [] child = None parts = [p for p in path.split('/') if len(p) > 0] if len(parts) == 1: child = self.getChild(path) if child is not None: result.append(child) else: result = self.__findAll(path) return result
027cc1c2bb580068ddf27f4735b2f3971f3d6b7c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5930/027cc1c2bb580068ddf27f4735b2f3971f3d6b7c/sax.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11135, 12, 2890, 16, 589, 4672, 563, 273, 5378, 1151, 273, 599, 2140, 273, 306, 84, 364, 293, 316, 589, 18, 4939, 2668, 2473, 13, 309, 562, 12, 84, 13, 405, 374, 65, 309, 562, 12, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11135, 12, 2890, 16, 589, 4672, 563, 273, 5378, 1151, 273, 599, 2140, 273, 306, 84, 364, 293, 316, 589, 18, 4939, 2668, 2473, 13, 309, 562, 12, 84, 13, 405, 374, 65, 309, 562, 12, ...
def setflag(self, flag): if flag in self.flags: self.flags.append(flag)
def setflag(self, flag):
815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 6420, 12, 2890, 16, 2982, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 6420, 12, 2890, 16, 2982, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
params = self.parsePage()
params = self.fix_params(self.parse_page())
def render(self): """ Render action
040e5dcf6357c3b978815cb65f08dc31b1f2365c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/888/040e5dcf6357c3b978815cb65f08dc31b1f2365c/SyncPages.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 12, 2890, 4672, 3536, 6987, 1301, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 12, 2890, 4672, 3536, 6987, 1301, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
f.write(unescape(caption) + '<img alt="' + caption + '" src="images/' + image_filename + '" />')
f.write(unescape(caption) + '<img alt="' + unescape(caption) + '" src="images/' + image_filename + '" />')
def savePost(post, header, save_folder): """ saves an individual post and any resources for it locally """ slug = post["url-with-slug"].rpartition("/")[2] date_gmt = post["date-gmt"] file_name = os.path.join(save_folder, slug + ".html") f = open(file_name, "w") # header info which is the same for all posts f.write(header) f.write("<p>" + date_gmt + "</p>") if post["type"] == "regular": title = post.find("regular-title").string body = post.find("regular-body").string f.write("<h2>" + title + "</h2>" + unescape(body)) if post["type"] == "photo": caption = post.find("photo-caption").string image_url = post.find("photo-url", {"max-width": "1280"}).string image_filename = image_url.rpartition("/")[2] + ".jpg" # the 1280 size doesn't end with an extension strangely image_folder = os.path.join(save_folder, "images") if not os.path.exists(image_folder): os.mkdir(image_folder) local_image_path = os.path.join(image_folder, image_filename) if not os.path.exists(local_image_path): # only download images if they don't already exist print "Downloading a photo. This may take a moment." image_response = urllib2.urlopen(image_url) image_file = open(local_image_path, "wb") image_file.write(image_response.read()) image_file.close() f.write(unescape(caption) + '<img alt="' + caption + '" src="images/' + image_filename + '" />') if post["type"] == "quote": quote = post.find("quote-text").string source = post.find("quote-source").string f.write("<blockquote>" + unescape(quote) + "</blockquote><p>" + unescape(source) + "</p>") # common footer f.write("</body></html>") f.close()
7203e48ad9b9ec70a8aa01cdd20ab7e70f96e515 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11445/7203e48ad9b9ec70a8aa01cdd20ab7e70f96e515/tumblr_backup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1923, 3349, 12, 2767, 16, 1446, 16, 1923, 67, 5609, 4672, 3536, 14649, 392, 7327, 1603, 471, 1281, 2703, 364, 518, 13760, 3536, 225, 4959, 273, 1603, 9614, 718, 17, 1918, 17, 6436, 6, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1923, 3349, 12, 2767, 16, 1446, 16, 1923, 67, 5609, 4672, 3536, 14649, 392, 7327, 1603, 471, 1281, 2703, 364, 518, 13760, 3536, 225, 4959, 273, 1603, 9614, 718, 17, 1918, 17, 6436, 6, ...
db[sha1] = urlparse.urljoin(uri, path)
db[sha1] = '%s/%s' % (uri.rstrip('/'), path)
def _PopulateDuplicateDB(self, db): """Populate db with SHA1 -> URL mapping for packages.
2df2dd5d234039e2ddb1998fbe280a9be86140d6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/2df2dd5d234039e2ddb1998fbe280a9be86140d6/binpkg.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 19097, 11826, 2290, 12, 2890, 16, 1319, 4672, 3536, 19097, 1319, 598, 9777, 21, 317, 1976, 2874, 364, 5907, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 19097, 11826, 2290, 12, 2890, 16, 1319, 4672, 3536, 19097, 1319, 598, 9777, 21, 317, 1976, 2874, 364, 5907, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
" code to use a sesison_id instead by calling the ProxyClient"
" code to use a session_id instead by calling the ProxyClient"
def __init__(self, base_url, useragent=None, session_name='tg-visit', session_as_cookie=True, debug=False): '''Create a client configured for a particular service.
70825ea501f5e1fbacfecb1f6850f90d532192ca /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9952/70825ea501f5e1fbacfecb1f6850f90d532192ca/proxyclient.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1026, 67, 718, 16, 22649, 33, 7036, 16, 1339, 67, 529, 2218, 88, 75, 17, 11658, 2187, 1339, 67, 345, 67, 8417, 33, 5510, 16, 1198, 33, 8381, 4672, 9163...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2890, 16, 1026, 67, 718, 16, 22649, 33, 7036, 16, 1339, 67, 529, 2218, 88, 75, 17, 11658, 2187, 1339, 67, 345, 67, 8417, 33, 5510, 16, 1198, 33, 8381, 4672, 9163...
if timeout == None:
if timeout == reply_cb == None:
def request(self, type, data, timeout = None, reply_cb = None): if timeout == None: timeout = self._default_timeout
0c699a0c1d34c4b1c135dda57b2204d78b56a34d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11722/0c699a0c1d34c4b1c135dda57b2204d78b56a34d/ipc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 590, 12, 2890, 16, 618, 16, 501, 16, 2021, 273, 599, 16, 4332, 67, 7358, 273, 599, 4672, 309, 2021, 422, 4332, 67, 7358, 422, 599, 30, 2021, 273, 365, 6315, 1886, 67, 4538, 2, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 590, 12, 2890, 16, 618, 16, 501, 16, 2021, 273, 599, 16, 4332, 67, 7358, 273, 599, 4672, 309, 2021, 422, 4332, 67, 7358, 422, 599, 30, 2021, 273, 365, 6315, 1886, 67, 4538, 2, -100, ...
self.setHtml(u'<table>%s</table>'%rows)
self.setHtml(templ%(u'<table>%s</table>'%rows))
def _show_data(self, rows, comments): if self.vertical: if comments: rows += u'<tr><td colspan="2">%s</td></tr>'%comments self.setHtml(u'<table>%s</table>'%rows) else: left_pane = u'<table>%s</table>'%rows right_pane = u'<div>%s</div>'%comments self.setHtml(u'<table><tr><td valign="top" ' 'style="padding-right:2em">%s</td><td valign="top">%s</td></tr></table>' % (left_pane, right_pane))
46baa77c0aa1a19550cb61424d7097f87417592a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/46baa77c0aa1a19550cb61424d7097f87417592a/book_details.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4500, 67, 892, 12, 2890, 16, 2595, 16, 5678, 4672, 309, 365, 18, 17824, 30, 309, 5678, 30, 2595, 1011, 582, 11, 32, 313, 4438, 4465, 20856, 1546, 22, 24038, 87, 1757, 4465, 4695, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4500, 67, 892, 12, 2890, 16, 2595, 16, 5678, 4672, 309, 365, 18, 17824, 30, 309, 5678, 30, 2595, 1011, 582, 11, 32, 313, 4438, 4465, 20856, 1546, 22, 24038, 87, 1757, 4465, 4695, ...
del self.client_managed[dispatcher.client_key]
def client_close (self, dispatcher): "remove the dispatcher from cache and increment dispatched" self.client_meter (dispatcher) del self.client_managed[dispatcher.client_key] dispatcher.async_client = None
e1ab414a383f5283cf8d221e97d306e04d6e4044 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2577/e1ab414a383f5283cf8d221e97d306e04d6e4044/async_client.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1004, 67, 4412, 261, 2890, 16, 7393, 4672, 315, 4479, 326, 7393, 628, 1247, 471, 5504, 25513, 6, 365, 18, 2625, 67, 81, 847, 261, 18495, 13, 7393, 18, 3810, 67, 2625, 273, 599, 2, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1004, 67, 4412, 261, 2890, 16, 7393, 4672, 315, 4479, 326, 7393, 628, 1247, 471, 5504, 25513, 6, 365, 18, 2625, 67, 81, 847, 261, 18495, 13, 7393, 18, 3810, 67, 2625, 273, 599, 2, -1...
""" fl_create_roundbutton(type, x, y, w, h, label) -> object ref.
""" fl_create_roundbutton(type, x, y, w, h, label) -> object
def fl_create_roundbutton(type, x, y, w, h, label): """ fl_create_roundbutton(type, x, y, w, h, label) -> object ref. """ retval = _fl_create_roundbutton(type, x, y, w, h, label) return retval
8765c710f695de392f6fc7c664c746ec98668b1d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/8765c710f695de392f6fc7c664c746ec98668b1d/xformslib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1183, 67, 2640, 67, 2260, 5391, 12, 723, 16, 619, 16, 677, 16, 341, 16, 366, 16, 1433, 4672, 3536, 1183, 67, 2640, 67, 2260, 5391, 12, 723, 16, 619, 16, 677, 16, 341, 16, 366, 16, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1183, 67, 2640, 67, 2260, 5391, 12, 723, 16, 619, 16, 677, 16, 341, 16, 366, 16, 1433, 4672, 3536, 1183, 67, 2640, 67, 2260, 5391, 12, 723, 16, 619, 16, 677, 16, 341, 16, 366, 16, ...
init_gamera()
def run(startup=_show_shell): global app has_gui.has_gui = has_gui.WX_GUI has_gui.gui = GameraGui from gamera.gui import args_gui init_gamera() class MyApp(wxApp): def __init__(self, startup, parent): self._startup = startup wxApp.__init__(self, parent) self.SetExitOnFrameDelete(1) # wxWindows calls this method to initialize the application def OnInit(self): self.SetAppName("Gamera") self.splash = GameraSplash() self.splash.Show() self._startup() del self.splash return True def OnExit(self): pass app = MyApp(startup, 0) app.MainLoop()
ee9e8c0b649623ea15ffecd005a87dadc7f9edf7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/ee9e8c0b649623ea15ffecd005a87dadc7f9edf7/gui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 23939, 33, 67, 4500, 67, 10304, 4672, 2552, 595, 711, 67, 20292, 18, 5332, 67, 20292, 273, 711, 67, 20292, 18, 59, 60, 67, 43, 5370, 711, 67, 20292, 18, 20292, 273, 611, 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, 1086, 12, 23939, 33, 67, 4500, 67, 10304, 4672, 2552, 595, 711, 67, 20292, 18, 5332, 67, 20292, 273, 711, 67, 20292, 18, 59, 60, 67, 43, 5370, 711, 67, 20292, 18, 20292, 273, 611, 11...
Rectangle(texture=tex2)
Rectangle()
def build(self): a = Widget() tex = Image('examples/kivy.jpg').texture tex2 = Image('examples/test.png').texture with a.canvas:
0c2ea25bd303a643c484f4ab0fe38bd317fc37cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14181/0c2ea25bd303a643c484f4ab0fe38bd317fc37cb/testcanvas.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1361, 12, 2890, 4672, 279, 273, 11103, 1435, 16573, 273, 3421, 2668, 16858, 19, 79, 427, 93, 18, 14362, 16063, 955, 594, 16573, 22, 273, 3421, 2668, 16858, 19, 3813, 18, 6446, 16063, 955...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1361, 12, 2890, 4672, 279, 273, 11103, 1435, 16573, 273, 3421, 2668, 16858, 19, 79, 427, 93, 18, 14362, 16063, 955, 594, 16573, 22, 273, 3421, 2668, 16858, 19, 3813, 18, 6446, 16063, 955...
preOps = [
preOps = mapSelector(loci=0, fitness={(0,0):(1-s1), (0,1):1, (1,1):(1-s2)}), postOps = [
def simuCDCV(model, N0, N1, G0, G1, spec, s, mu, k): '''Evolve a population using given demographic model and observe the evolution of its allelic spectrum. model: type of demographic model. N0, N1, G0, G1: parameters of demographic model. spec: initial allelic spectrum, should be a list of allele frequencies for each allele. s: selection pressure. mu: mutation rate. k: maximum allele for the k-allele model ''' demo_func = demo_model(model, N0, N1, G0, G1) print demo_func(0) simu = simulator( population(size=demo_func(0), loci=1, infoFields='fitness'), randomMating(subPopSize=demo_func) ) simu.evolve( initOps = [ initSex(), initByFreq(loci=0, alleleFreq=spec) ], preOps = [ kamMutator(rate=mu, maxAllele=k), maSelector(loci=0, fitness=[1, 1, 1 - s], wildtype=0), ne(loci=0, step=100), pyEval(r'"%d: %.2f\t%.2f\n" % (gen, 1 - alleleFreq[0][0], ne[0])', step=100), ], gen = G0 + G1 ) return simu.extract(0)
505ded08bbab01d6828bb201d31e079f6d9e3b55 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/401/505ded08bbab01d6828bb201d31e079f6d9e3b55/userGuide.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3142, 89, 39, 5528, 58, 12, 2284, 16, 423, 20, 16, 423, 21, 16, 611, 20, 16, 611, 21, 16, 857, 16, 272, 16, 4129, 16, 417, 4672, 9163, 20861, 5390, 279, 11209, 1450, 864, 9626, 169...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3142, 89, 39, 5528, 58, 12, 2284, 16, 423, 20, 16, 423, 21, 16, 611, 20, 16, 611, 21, 16, 857, 16, 272, 16, 4129, 16, 417, 4672, 9163, 20861, 5390, 279, 11209, 1450, 864, 9626, 169...
def __createOffscreenCanvas():
def createOffscreenCanvas():
def __createOffscreenCanvas(): offscreenCanvas = self.__createOffscreenCanvas("offscreencanvas", False) self.node = avg.ImageNode(parent=Player.getRootNode(), href="canvas:offscreencanvas")
68ccfeafab4b377d085fe23436b510a8d95ebda3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7300/68ccfeafab4b377d085fe23436b510a8d95ebda3/OffscreenTest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 7210, 9252, 12971, 13332, 3397, 9252, 12971, 273, 365, 16186, 2640, 7210, 9252, 12971, 2932, 3674, 1017, 266, 1331, 304, 4423, 3113, 1083, 13, 365, 18, 2159, 273, 11152, 18, 2040, 907...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 752, 7210, 9252, 12971, 13332, 3397, 9252, 12971, 273, 365, 16186, 2640, 7210, 9252, 12971, 2932, 3674, 1017, 266, 1331, 304, 4423, 3113, 1083, 13, 365, 18, 2159, 273, 11152, 18, 2040, 907...
self.shown {}
self.shown = {}
def __init__(self, irc): callbacks.PluginRegexp.__init__(self, irc) self.db = ircutils.IrcDict() events = [] for name in self.registryValue('bugtrackers'): registerBugtracker(name) group = self.registryValue('bugtrackers.%s' % name.replace('.','\\.'), value=False) if group.trackertype() in defined_bugtrackers.keys(): self.db[name] = defined_bugtrackers[group.trackertype()](name, group.url(), group.description()) else: raise BugtrackerError("Unknown trackertype: %s" % group.trackertype()) self.shorthand = utils.abbrev(self.db.keys())
d8077e0d15c90b07a9c978e10f049658ba06ea6e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3104/d8077e0d15c90b07a9c978e10f049658ba06ea6e/plugin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 277, 1310, 4672, 6689, 18, 3773, 14621, 16186, 2738, 972, 12, 2890, 16, 277, 1310, 13, 365, 18, 1966, 273, 277, 1310, 5471, 18, 45, 1310, 5014, 1435, 264...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 277, 1310, 4672, 6689, 18, 3773, 14621, 16186, 2738, 972, 12, 2890, 16, 277, 1310, 13, 365, 18, 1966, 273, 277, 1310, 5471, 18, 45, 1310, 5014, 1435, 264...
if not h.auth.authorized(h.auth.Or(h.auth.is_same_zookeepr_submitter(id), h.auth.has_organiser_role)):
if not h.auth.authorized(h.auth.Or(h.auth.is_same_zookeepr_registration(id), h.auth.has_organiser_role)):
def _edit(self, id): # We need to recheck auth in here so we can pass in the id if not h.auth.authorized(h.auth.Or(h.auth.is_same_zookeepr_submitter(id), h.auth.has_organiser_role)): # Raise a no_auth error h.auth.no_role()
e300d1f93c731f8d72a7758b4206538782797844 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12856/e300d1f93c731f8d72a7758b4206538782797844/registration.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4619, 12, 2890, 16, 612, 4672, 468, 1660, 1608, 358, 283, 1893, 1357, 316, 2674, 1427, 732, 848, 1342, 316, 326, 612, 309, 486, 366, 18, 1944, 18, 8434, 12, 76, 18, 1944, 18, 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, 389, 4619, 12, 2890, 16, 612, 4672, 468, 1660, 1608, 358, 283, 1893, 1357, 316, 2674, 1427, 732, 848, 1342, 316, 326, 612, 309, 486, 366, 18, 1944, 18, 8434, 12, 76, 18, 1944, 18, 11...
whupeg = (nonzero(qulim & (x == ulim)))[0]
whupeg = (numpy.nonzero(qulim & (x == ulim)))[0]
def iterfunct(myfunct, p, iter, fnorm, functkw=None, parinfo=None, quiet=0, dof=None, [iterkw keywords here])
14558c711c4693ee25ced2a48d6eaf300224bc75 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/682/14558c711c4693ee25ced2a48d6eaf300224bc75/mpfit.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1400, 74, 6931, 12, 4811, 74, 6931, 16, 293, 16, 1400, 16, 2295, 535, 16, 12882, 9987, 33, 7036, 16, 779, 1376, 33, 7036, 16, 10902, 33, 20, 16, 741, 74, 33, 7036, 16, 306, 2165, 9...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1400, 74, 6931, 12, 4811, 74, 6931, 16, 293, 16, 1400, 16, 2295, 535, 16, 12882, 9987, 33, 7036, 16, 779, 1376, 33, 7036, 16, 10902, 33, 20, 16, 741, 74, 33, 7036, 16, 306, 2165, 9...
"""returns a ordered list of sprites (first back, last top).
"""return a ordered list of sprites (first back, last top).
def sprites(self): """returns a ordered list of sprites (first back, last top). LayeredUpdates.sprites(): return sprites """ return list(self._spritelist)
d9760f3e4782abb02dd98080337626eefdad67ee /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1298/d9760f3e4782abb02dd98080337626eefdad67ee/sprite.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1694, 24047, 12, 2890, 4672, 3536, 2463, 279, 5901, 666, 434, 1694, 24047, 261, 3645, 1473, 16, 1142, 1760, 2934, 225, 12112, 329, 5121, 18, 1752, 24047, 13332, 327, 1694, 24047, 3536, 327...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1694, 24047, 12, 2890, 4672, 3536, 2463, 279, 5901, 666, 434, 1694, 24047, 261, 3645, 1473, 16, 1142, 1760, 2934, 225, 12112, 329, 5121, 18, 1752, 24047, 13332, 327, 1694, 24047, 3536, 327...
line = 'shell'
line = 'shell ' + line[1:]
def onecmd(self, line): line = string.strip(line) if line == '?': line = 'help' elif line == '!': if hasattr(self, 'do_shell'): line = 'shell' else: return self.default(line) elif not line: return self.emptyline() self.lastcmd = line i, n = 0, len(line) while i < n and line[i] in self.identchars: i = i+1 cmd, arg = line[:i], string.strip(line[i:]) if cmd == '': return self.default(line) else: try: func = getattr(self, 'do_' + cmd) except AttributeError: return self.default(line) return func(arg)
04f0c73ce75865a1a28d931934a9df8786b86483 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/04f0c73ce75865a1a28d931934a9df8786b86483/cmd.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1245, 4172, 12, 2890, 16, 980, 4672, 980, 273, 533, 18, 6406, 12, 1369, 13, 309, 980, 422, 13023, 4278, 980, 273, 296, 5201, 11, 1327, 980, 422, 11817, 4278, 309, 3859, 12, 2890, 16, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1245, 4172, 12, 2890, 16, 980, 4672, 980, 273, 533, 18, 6406, 12, 1369, 13, 309, 980, 422, 13023, 4278, 980, 273, 296, 5201, 11, 1327, 980, 422, 11817, 4278, 309, 3859, 12, 2890, 16, ...
modname, ext = os.path.splitext(os.path.basename(filename)) if sys.modules.has_key(modname): mod = sys.modules[modname] else: mod = imp.new_module(modname) sys.modules[modname] = mod mod.__file__ = filename saveout = sys.stdout saveerr = sys.stderr owin = OnDemandOutputWindow(self.editwin.flist) try: sys.stderr = PseudoFile(owin, "stderr") try: sys.stdout = PseudoFile(owin, "stdout") try: if debugger: debugger.run("execfile(%s)" % `filename`, mod.__dict__) else: execfile(filename, mod.__dict__) except: (sys.last_type, sys.last_value, sys.last_traceback) = sys.exc_info() linecache.checkcache() traceback.print_exc() if not debugger and \ self.editwin.getvar("<<toggle-jit-stack-viewer>>"): from StackViewer import StackBrowser sv = StackBrowser(self.root, self.flist) finally: sys.stdout = saveout finally: sys.stderr = saveerr def debug_module_event(self, event): import Debugger debugger = Debugger.Debugger(self) self.run_module_event(event, debugger) def close_debugger(self): pass
return filename
def run_module_event(self, event, debugger=None): if not self.editwin.get_saved(): tkMessageBox.showerror("Not saved", "Please save first!", master=self.editwin.text) self.editwin.text.focus_set() return filename = self.editwin.io.filename if not filename: tkMessageBox.showerror("No file name", "This window has no file name", master=self.editwin.text) self.editwin.text.focus_set() return modname, ext = os.path.splitext(os.path.basename(filename)) if sys.modules.has_key(modname): mod = sys.modules[modname] else: mod = imp.new_module(modname) sys.modules[modname] = mod mod.__file__ = filename saveout = sys.stdout saveerr = sys.stderr owin = OnDemandOutputWindow(self.editwin.flist) try: sys.stderr = PseudoFile(owin, "stderr") try: sys.stdout = PseudoFile(owin, "stdout") try: if debugger: debugger.run("execfile(%s)" % `filename`, mod.__dict__) else: execfile(filename, mod.__dict__) except: (sys.last_type, sys.last_value, sys.last_traceback) = sys.exc_info() linecache.checkcache() traceback.print_exc() if not debugger and \ self.editwin.getvar("<<toggle-jit-stack-viewer>>"): from StackViewer import StackBrowser sv = StackBrowser(self.root, self.flist) finally: sys.stdout = saveout finally: sys.stderr = saveerr
1f3de5d7b99190d3dda48349fa163e65e19153dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1f3de5d7b99190d3dda48349fa163e65e19153dc/ScriptBinding.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 67, 2978, 67, 2575, 12, 2890, 16, 871, 16, 19977, 33, 7036, 4672, 309, 486, 365, 18, 4619, 8082, 18, 588, 67, 14077, 13332, 13030, 27647, 18, 4500, 1636, 2932, 1248, 5198, 3113, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2978, 67, 2575, 12, 2890, 16, 871, 16, 19977, 33, 7036, 4672, 309, 486, 365, 18, 4619, 8082, 18, 588, 67, 14077, 13332, 13030, 27647, 18, 4500, 1636, 2932, 1248, 5198, 3113, ...
response.exception()
def publish_module(module_name, stdin=sys.stdin, stdout=sys.stdout, stderr=sys.stderr, environ=os.environ, debug=0): must_die=0 status=200 after_list=[None] try: response=Response(stdout=stdout, stderr=stderr) publisher = ModulePublisher(stdin=stdin, stdout=stdout, stderr=stderr, environ=environ) response = publisher.response response = publisher.publish(module_name,after_list,debug=debug) except SystemExit: must_die=1 response.exception(must_die) except ImportError, v: if type(v)==types.TupleType and len(v)==3: sys.exc_type, sys.exc_value, sys.exc_traceback = v must_die=1 response.exception(must_die) except: status=response.getStatus() response.exception() if response: response=str(response) if response: stdout.write(response) # The module defined a post-access function, call it if after_list[0] is not None: after_list[0]() if must_die: raise sys.exc_type, sys.exc_value, sys.exc_traceback sys.exc_type, sys.exc_value, sys.exc_traceback = None, None, None return status
015a60d9ad22837fb556ca780c442bd688bfc824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/015a60d9ad22837fb556ca780c442bd688bfc824/Publish.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3808, 67, 2978, 12, 2978, 67, 529, 16, 8801, 33, 9499, 18, 21772, 16, 3909, 33, 9499, 18, 10283, 16, 4514, 33, 9499, 18, 11241, 16, 5473, 33, 538, 18, 28684, 16, 1198, 33, 20, 4672, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3808, 67, 2978, 12, 2978, 67, 529, 16, 8801, 33, 9499, 18, 21772, 16, 3909, 33, 9499, 18, 10283, 16, 4514, 33, 9499, 18, 11241, 16, 5473, 33, 538, 18, 28684, 16, 1198, 33, 20, 4672, ...
help = "Detect new translatable fields in all models and sync database structure"
help = "Detect new translatable fields or new available languages and sync database structure"
def print_missing_langs(missing_langs, field_name, model_name): print '\nMissing languages in "%s" field from "%s" model: %s' % \ (field_name, model_name, ", ".join(missing_langs))
bda2e982b9e8cea39e59cb377c1b86cac7e729e1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11729/bda2e982b9e8cea39e59cb377c1b86cac7e729e1/sync_transmeta_db.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1172, 67, 7337, 67, 4936, 87, 12, 7337, 67, 4936, 87, 16, 652, 67, 529, 16, 938, 67, 529, 4672, 1172, 2337, 82, 4841, 8191, 316, 2213, 87, 6, 652, 628, 2213, 87, 6, 938, 30, 738, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1172, 67, 7337, 67, 4936, 87, 12, 7337, 67, 4936, 87, 16, 652, 67, 529, 16, 938, 67, 529, 4672, 1172, 2337, 82, 4841, 8191, 316, 2213, 87, 6, 652, 628, 2213, 87, 6, 938, 30, 738, ...
logger.warning("can't open file : %s, path: %s, mod: %s", ex, path, mod) raise return
logger.warning("can't open file : %s, path: %s", ex, path) return None return None def _open_write(self): path = os.path.join(self.base_path, self.path) dir = os.path.dirname(path) if not os.path.exists(dir): os.makedirs(dir) try: if os.path.isfile(path): self._backup(path) f = open(path, 'w') return f except IOError, ex: logger.warning("can't open file : %s, path: %s", ex, path) raise
def _open(self, mod='r'): path = os.path.join(self.base_path, self.path) dir = os.path.dirname(path) if not os.path.exists(dir): os.makedirs(dir) if os.path.isfile(path): try: self._backup(path) f = open(path, mod) return f except IOError, ex: logger.warning("can't open file : %s, path: %s, mod: %s", ex, path, mod) raise return
9cef252a991da44dfd5ef8bfbee9344920cf402a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4712/9cef252a991da44dfd5ef8bfbee9344920cf402a/persistance.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3190, 12, 2890, 16, 681, 2218, 86, 11, 4672, 589, 273, 1140, 18, 803, 18, 5701, 12, 2890, 18, 1969, 67, 803, 16, 365, 18, 803, 13, 1577, 273, 1140, 18, 803, 18, 12287, 12, 803...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3190, 12, 2890, 16, 681, 2218, 86, 11, 4672, 589, 273, 1140, 18, 803, 18, 5701, 12, 2890, 18, 1969, 67, 803, 16, 365, 18, 803, 13, 1577, 273, 1140, 18, 803, 18, 12287, 12, 803...
if ch != '\n': dummy = ifp.readline()
def __init__(self, ifp): if isinstance(ifp, basestring): ifp = open(ifp) # # Find initial colon. # while 1: ch = ifp.read(1) if not ch: raise Error, "No binhex data found" # Cater for \r\n terminated lines (which show up as \n\r, hence # all lines start with \r) if ch == '\r': continue if ch == ':': break if ch != '\n': dummy = ifp.readline()
e29f108864081c5d86202244a1d2e4557c580f20 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/e29f108864081c5d86202244a1d2e4557c580f20/binhex.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 309, 84, 4672, 309, 1549, 12, 430, 84, 16, 10699, 4672, 309, 84, 273, 1696, 12, 430, 84, 13, 468, 468, 4163, 2172, 13336, 18, 468, 1323, 404, 30, 462, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 309, 84, 4672, 309, 1549, 12, 430, 84, 16, 10699, 4672, 309, 84, 273, 1696, 12, 430, 84, 13, 468, 468, 4163, 2172, 13336, 18, 468, 1323, 404, 30, 462, ...
for headword, translation in self.entries:
for headword, reading, translation in self.entries:
def __iter__(self): """Provides all data of one word per entry.""" seenWordEntries = set() newEntryDict = {} for headword, translation in self.entries: newEntryDict['Headword'] = headword for word in self.wordRegex.findall(translation): word = word.strip() if not word: continue if word and (headword, word) not in seenWordEntries: seenWordEntries.add((headword, word)) newEntryDict['Word'] = word yield newEntryDict
129c88ce110e4129d88344297887ddca66e38376 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11128/129c88ce110e4129d88344297887ddca66e38376/build.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2165, 972, 12, 2890, 4672, 3536, 17727, 777, 501, 434, 1245, 2076, 1534, 1241, 12123, 5881, 3944, 5400, 273, 444, 1435, 24086, 5014, 273, 2618, 225, 364, 910, 1095, 16, 6453, 16, 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, 1001, 2165, 972, 12, 2890, 4672, 3536, 17727, 777, 501, 434, 1245, 2076, 1534, 1241, 12123, 5881, 3944, 5400, 273, 444, 1435, 24086, 5014, 273, 2618, 225, 364, 910, 1095, 16, 6453, 16, 4...
sys.stdout.write("About to start TCP server...\n")
def test_main(): rootLogger = logging.getLogger("") rootLogger.setLevel(logging.DEBUG) hdlr = logging.StreamHandler(sys.stdout) fmt = logging.Formatter(logging.BASIC_FORMAT) hdlr.setFormatter(fmt) rootLogger.addHandler(hdlr) #Set up a handler such that all events are sent via a socket to the log #receiver (logrecv). #The handler will only be added to the rootLogger for some of the tests hdlr = logging.handlers.SocketHandler('localhost', logging.handlers.DEFAULT_TCP_LOGGING_PORT) #Configure the logger for logrecv so events do not propagate beyond it. #The sockLogger output is buffered in memory until the end of the test, #and printed at the end. sockOut = cStringIO.StringIO() sockLogger = logging.getLogger("logrecv") sockLogger.setLevel(logging.DEBUG) sockhdlr = logging.StreamHandler(sockOut) sockhdlr.setFormatter(logging.Formatter( "%(name)s -> %(levelname)s: %(message)s")) sockLogger.addHandler(sockhdlr) sockLogger.propagate = 0 #Set up servers threads = [] tcpserver = LogRecordSocketReceiver() sys.stdout.write("About to start TCP server...\n") threads.append(threading.Thread(target=runTCP, args=(tcpserver,))) for thread in threads: thread.start() try: banner("log_test0", "begin") rootLogger.addHandler(hdlr) test0() rootLogger.removeHandler(hdlr) banner("log_test0", "end") banner("log_test1", "begin") test1() banner("log_test1", "end") banner("log_test2", "begin") test2() banner("log_test2", "end") banner("log_test3", "begin") test3() banner("log_test3", "end") banner("logrecv output", "begin") sys.stdout.write(sockOut.getvalue()) sockOut.close() banner("logrecv output", "end") finally: #shut down server tcpserver.abort = 1 for thread in threads: thread.join()
0844d53e3656902c7bcae91b70ecad553c369283 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0844d53e3656902c7bcae91b70ecad553c369283/test_logging.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 5254, 13332, 1365, 3328, 273, 2907, 18, 588, 3328, 2932, 7923, 1365, 3328, 18, 542, 2355, 12, 11167, 18, 9394, 13, 366, 5761, 86, 273, 2907, 18, 1228, 1503, 12, 9499, 18, 102...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5254, 13332, 1365, 3328, 273, 2907, 18, 588, 3328, 2932, 7923, 1365, 3328, 18, 542, 2355, 12, 11167, 18, 9394, 13, 366, 5761, 86, 273, 2907, 18, 1228, 1503, 12, 9499, 18, 102...
self.cylinderWidth2 = CYLINDER_WIDTH_DEFAULT_VALUE self._determine_resize_handle_radius()
self.cylinderWidth2 = CYLINDER_WIDTH_DEFAULT_VALUE self._update_resizeHandle_radius()
def updateHandlePositions(self): """ Update handle positions """
b6328deff5eae78e09a343d950096c6bc9067a14 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/b6328deff5eae78e09a343d950096c6bc9067a14/DnaSegment_EditCommand.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 3259, 11024, 12, 2890, 4672, 3536, 2315, 1640, 6865, 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, ...
[ 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, 1089, 3259, 11024, 12, 2890, 4672, 3536, 2315, 1640, 6865, 3536, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if checkUnprocessedArgs and (True not in map(lambda x:x.has_key('jump'), options) \ and True not in map(lambda x:x.has_key('jumpIfFalse'), options)):
if checkUnprocessedArgs:
def _termGetParam(options, checkUnprocessedArgs=True, verbose=False, useDefault=False): ''' using user input to get param ''' # get param from short arg processedArgs = [] # process all options values = [] goto = 0 for opt in range(0, len(options)): if opt < goto: values.append(None) continue p = options[opt] # validate p for k in p.keys(): if not k in allowed_keys: raise exceptions.ValueError("Unrecognized option entry " + k ) if p.has_key('separator'): continue val = _getParamShortArg(p, processedArgs) if val == None: val = _getParamLongArg(p, processedArgs) if val == None: val = _getParamConfigFile(p, processedArgs) if val == None: if (useDefault or (not p.has_key('label')) or (p.has_key('useDefault') and p['useDefault'])) and p.has_key('default'): val = p['default'] else: val = _getParamUserInput(p) # should have a valid value now. if val == None: raise exceptions.ValueError("Failed to get parameter " + p.setdefault("label",'') + " " + p.setdefault("longarg",'')) values.append( _getParamValue(p, val)) # now we really short have something not None, unless the default is None # if a string is fine # now, deal with jump option if values[-1] == True and p.has_key('jump'): if p['jump'] == -1: # go to last goto = len(options) else: goto = p['jump'] # can not jump backward if goto <= opt: raise ValueError("Can not stay or jump backwards when processing options.") if values[-1] == False and p.has_key('jumpIfFalse'): if p['jumpIfFalse'] == -1: # go to last goto = len(options) else: goto = p['jumpIfFalse'] # can not jump backward if goto <= opt: raise ValueError("Can not stay or jump backwards when processing options.") # look if any argument was not processed if checkUnprocessedArgs and (True not in map(lambda x:x.has_key('jump'), options) \ and True not in map(lambda x:x.has_key('jumpIfFalse'), options)): for i in range(1, len(sys.argv)): if (not sys.argv[i] in allowed_commandline_options) and (not i in processedArgs): raise exceptions.ValueError("Unprocessed command line argument: " + sys.argv[i]) return values
3cf4f3d491e7d59b292e46f3c18c66c901a8adea /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/401/3cf4f3d491e7d59b292e46f3c18c66c901a8adea/simuOpt.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 6408, 967, 786, 12, 2116, 16, 866, 984, 11005, 2615, 33, 5510, 16, 3988, 33, 8381, 16, 999, 1868, 33, 8381, 4672, 9163, 1450, 729, 810, 358, 336, 579, 9163, 468, 336, 579, 628, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6408, 967, 786, 12, 2116, 16, 866, 984, 11005, 2615, 33, 5510, 16, 3988, 33, 8381, 16, 999, 1868, 33, 8381, 4672, 9163, 1450, 729, 810, 358, 336, 579, 9163, 468, 336, 579, 628, ...
sage: a(0) 1 sage: a(1) 10 sage: a(8) 9969 sage: a(41) 42834431872413650 sage: a.list(12) [1, 10, 36, 104, 273, 686, 1688, 4112, 9969, 24114, 58268, 140728] AUTHOR: -- Jaap Spies (2007-01-19) """ def __init__(self):
INPUT: n -- non negative integer OUTPUT: integer -- function value EXAMPLES: sage: a = sloane.A051959; a Linear second order recurrence. A051959. sage: a(0) 1 sage: a(1) 10 sage: a(8) 9969 sage: a(41) 42834431872413650 sage: a.list(12) [1, 10, 36, 104, 273, 686, 1688, 4112, 9969, 24114, 58268, 140728] AUTHOR: -- Jaap Spies (2007-01-19) """
def list(self, n): self._eval(n) # force computation return self._b[:n]
d2510d4232e17c9cea8d1a0271c6be68a81d317b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/d2510d4232e17c9cea8d1a0271c6be68a81d317b/sloane_functions.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 666, 12, 2890, 16, 290, 4672, 365, 6315, 8622, 12, 82, 13, 282, 468, 2944, 16039, 327, 365, 6315, 70, 10531, 82, 65, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 666, 12, 2890, 16, 290, 4672, 365, 6315, 8622, 12, 82, 13, 282, 468, 2944, 16039, 327, 365, 6315, 70, 10531, 82, 65, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
return gfan(I, cmd, verbose=self.__verbose, format=format)
s = gfan(I, cmd, verbose=self.__verbose, format=format) if s.strip() == '{': raise RuntimeError, "Error running gfan command %s on %s"%(cmd, self) return s
def gfan(self, cmd='', I=None, format=True): if I is None: I = self._gfan_ideal() # todo -- put something in here (?) when self.__symmetry isn't None... cmd += self._gfan_mod() return gfan(I, cmd, verbose=self.__verbose, format=format)
9a99d291cd22860f7c9f989f20a6f41e81115435 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/9a99d291cd22860f7c9f989f20a6f41e81115435/groebner_fan.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13828, 304, 12, 2890, 16, 1797, 2218, 2187, 467, 33, 7036, 16, 740, 33, 5510, 4672, 309, 467, 353, 599, 30, 467, 273, 365, 6315, 75, 74, 304, 67, 831, 287, 1435, 468, 10621, 1493, 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, 13828, 304, 12, 2890, 16, 1797, 2218, 2187, 467, 33, 7036, 16, 740, 33, 5510, 4672, 309, 467, 353, 599, 30, 467, 273, 365, 6315, 75, 74, 304, 67, 831, 287, 1435, 468, 10621, 1493, 13...
pairs = map(lambda x: (x[1], '%s' % x[0].__name__), dict.items())
pairs=[] append=pairs.append for ob, v in dict.items(): if hasattr(ob, '__module__'): name='%s.%s' % (ob.__module__, ob.__name__) else: name='%s' % ob.__name__ append((v, name))
def get_refcounts(self, n=100, t=(type(Fake), type(Acquisition.Implicit))): # get class refcount info
09a53f7b22e8b7a3535198eed06430d5d91fc5a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/09a53f7b22e8b7a3535198eed06430d5d91fc5a5/ApplicationManager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 1734, 8008, 12, 2890, 16, 290, 33, 6625, 16, 268, 28657, 723, 12, 25462, 3631, 618, 12, 9988, 22094, 18, 15787, 3719, 4672, 468, 336, 667, 1278, 1883, 1123, 2, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 1734, 8008, 12, 2890, 16, 290, 33, 6625, 16, 268, 28657, 723, 12, 25462, 3631, 618, 12, 9988, 22094, 18, 15787, 3719, 4672, 468, 336, 667, 1278, 1883, 1123, 2, -100, -100, -10...
if (not repo.local() or '.hg' in repo.root.split('/')
if (not repo.local() or hgcmd in nokwcommands.split() or '.hg' in repo.root.split('/')
def reposetup(ui, repo): '''Sets up repo as kwrepo for keyword substitution. Overrides file method to return kwfilelog instead of filelog if file matches user configuration. Wraps commit to overwrite configured files with updated keyword substitutions. This is done for local repos only, and only if there are files configured at all for keyword substitution.''' try: if (not repo.local() or '.hg' in repo.root.split('/') or repo._url.startswith('bundle:')): return except AttributeError: pass hgcmd, func, args, opts, cmdopts = dispatch._parse(ui, sys.argv[1:]) if hgcmd in nokwcommands.split(): return if hgcmd == 'diff': # only expand if comparing against working dir node1, node2 = cmdutil.revpair(repo, cmdopts.get('rev')) if node2 is not None: return # shrink if rev is not current node if node1 is not None and node1 != repo.changectx().node(): hgcmd = 'diff1' inc, exc = [], ['.hg*'] for pat, opt in ui.configitems('keyword'): if opt != 'ignore': inc.append(pat) else: exc.append(pat) if not inc: return global _kwtemplater restrict = hgcmd in restricted.split() _kwtemplater = kwtemplater(ui, repo, inc, exc, restrict) class kwrepo(repo.__class__): def file(self, f, kwmatch=False): if f[0] == '/': f = f[1:] if kwmatch or _kwtemplater.matcher(f): return kwfilelog(self.sopener, f) return filelog.filelog(self.sopener, f) def wread(self, filename): data = super(kwrepo, self).wread(filename) if restrict and _kwtemplater.matcher(filename): return _kwtemplater.shrink(data) return data def commit(self, files=None, text='', user=None, date=None, match=util.always, force=False, force_editor=False, p1=None, p2=None, extra={}, empty_ok=False): wlock = lock = None _p1 = _p2 = None try: wlock = self.wlock() lock = self.lock() # store and postpone commit hooks commithooks = {} for name, cmd in ui.configitems('hooks'): if name.split('.', 1)[0] == 'commit': commithooks[name] = cmd ui.setconfig('hooks', name, None) if commithooks: # store parents for commit hook environment if p1 is None: _p1, _p2 = repo.dirstate.parents() else: _p1, _p2 = p1, p2 or nullid _p1 = hex(_p1) if _p2 == nullid: _p2 = '' else: _p2 = hex(_p2) node = super(kwrepo, self).commit(files=files, text=text, user=user, date=date, match=match, force=force, force_editor=force_editor, p1=p1, p2=p2, extra=extra, empty_ok=empty_ok) # restore commit hooks for name, cmd in commithooks.iteritems(): ui.setconfig('hooks', name, cmd) if node is not None: _overwrite(ui, self, node=node) repo.hook('commit', node=node, parent1=_p1, parent2=_p2) return node finally: del wlock, lock repo.__class__ = kwrepo patch.patchfile.__init__ = _kwpatchfile_init
456c7fd60d171a3adc3fc12c0f3ad4066f54f2ee /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11312/456c7fd60d171a3adc3fc12c0f3ad4066f54f2ee/keyword.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13686, 278, 416, 12, 4881, 16, 3538, 4672, 9163, 2785, 731, 3538, 487, 5323, 7422, 364, 4932, 12785, 18, 531, 9857, 585, 707, 358, 327, 5323, 7540, 12970, 3560, 434, 661, 12970, 309, 585...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13686, 278, 416, 12, 4881, 16, 3538, 4672, 9163, 2785, 731, 3538, 487, 5323, 7422, 364, 4932, 12785, 18, 531, 9857, 585, 707, 358, 327, 5323, 7540, 12970, 3560, 434, 661, 12970, 309, 585...
self.h9 = h9
self.h9 = gdata.health.service.HealthService(use_h9_sandbox=True) self.h9.ClientLogin(username, password, source='H9 Client Unit Tests')
def setUp(self): self.h9 = h9 self.profile_list_feed = self.h9.GetProfileListFeed() self.profile_id = self.profile_list_feed.entry[0].GetProfileId()
7db56efc3b0c60a54796b2b4dd6f95cd3495f093 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5609/7db56efc3b0c60a54796b2b4dd6f95cd3495f093/service_test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24292, 12, 2890, 4672, 365, 18, 76, 29, 273, 314, 892, 18, 13267, 18, 3278, 18, 7802, 1179, 12, 1202, 67, 76, 29, 67, 27004, 33, 5510, 13, 365, 18, 76, 29, 18, 1227, 5358, 12, 5053...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24292, 12, 2890, 4672, 365, 18, 76, 29, 273, 314, 892, 18, 13267, 18, 3278, 18, 7802, 1179, 12, 1202, 67, 76, 29, 67, 27004, 33, 5510, 13, 365, 18, 76, 29, 18, 1227, 5358, 12, 5053...
sage: open('a.txt','w').write('foo\n{{{\n2+3\n}}}') sage: W = nb.import_worksheet('a.txt', 'admin')
sage: name = tmp_filename() + '.txt' sage: open(name,'w').write('foo\n{{{\n2+3\n}}}') sage: W = nb.import_worksheet(name, 'admin')
def _import_worksheet_sws(self, filename, owner, verbose=True): """ Import an sws format worksheet into this notebook as a new worksheet.
a3d8c3669cc55612be1b3e44f266282ee23950e0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/a3d8c3669cc55612be1b3e44f266282ee23950e0/notebook.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 5666, 67, 1252, 8118, 67, 87, 4749, 12, 2890, 16, 1544, 16, 3410, 16, 3988, 33, 5510, 4672, 3536, 6164, 392, 1352, 87, 740, 13622, 1368, 333, 14718, 487, 279, 394, 13622, 18, 2, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 5666, 67, 1252, 8118, 67, 87, 4749, 12, 2890, 16, 1544, 16, 3410, 16, 3988, 33, 5510, 4672, 3536, 6164, 392, 1352, 87, 740, 13622, 1368, 333, 14718, 487, 279, 394, 13622, 18, 2, ...
ll = polar2xy(r, a)
ll = polar2xy(r, a) + self.xyabsolute
def _get_hpgl_fan(self): ## get corners of shape... ## lower_right (viewing from pole outward) r = self.radius - self.height / 2 ## assumes the fan is centered on (r, a) a = self.angle - self.width_angle / 2 lr = polar2xy(r, a)
e19c9dd132b0f445a96c8633fd73e9fffd632dd4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3716/e19c9dd132b0f445a96c8633fd73e9fffd632dd4/fan.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 15373, 7043, 67, 74, 304, 12, 2890, 4672, 225, 7541, 336, 18398, 434, 2179, 2777, 7541, 2612, 67, 4083, 261, 1945, 310, 628, 25320, 596, 2913, 13, 436, 273, 365, 18, 1128...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 15373, 7043, 67, 74, 304, 12, 2890, 4672, 225, 7541, 336, 18398, 434, 2179, 2777, 7541, 2612, 67, 4083, 261, 1945, 310, 628, 25320, 596, 2913, 13, 436, 273, 365, 18, 1128...
if self.scheduled:
if self.scheduled and not self.scheduled.status in \ ('deleted', 'missed'): print self.scheduled.status
def submenu(self, arg=None, menuw=None, additional_items=False): """ show a submenu for this item """ items = [] if self.scheduled: if self.start < time.time() + 10 and \ self.scheduled[5] in ('recording', 'saved'): items.append(menu.MenuItem(_('Watch recording'), \ self.watch_recording)) if self.stop > time.time(): if self.start < time.time(): items.append(menu.MenuItem(_('Stop recording'), \ self.remove)) else: items.append(menu.MenuItem(_('Remove recording'), \ self.remove)) elif self.stop > time.time(): items.append(menu.MenuItem(_('Schedule for recording'), \ self.schedule)) if additional_items: items.append(menu.MenuItem(_('Show complete listing for %s') % \ self.channel.name, self.channel_details)) items.append(menu.MenuItem(_('Watch %s') % self.channel.name, self.watch_channel)) txt = _('Search for programs with a similar name') items.append(menu.MenuItem(txt, self.search_similar))
b61e0b4734746915c377b7d132f0280bd56709ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/b61e0b4734746915c377b7d132f0280bd56709ea/program.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 27539, 12, 2890, 16, 1501, 33, 7036, 16, 3824, 91, 33, 7036, 16, 3312, 67, 3319, 33, 8381, 4672, 3536, 2405, 279, 27539, 364, 333, 761, 3536, 1516, 273, 5378, 309, 365, 18, 23307, 471,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 27539, 12, 2890, 16, 1501, 33, 7036, 16, 3824, 91, 33, 7036, 16, 3312, 67, 3319, 33, 8381, 4672, 3536, 2405, 279, 27539, 364, 333, 761, 3536, 1516, 273, 5378, 309, 365, 18, 23307, 471,...
if 'ARTIST' in vc.keys(): self.artist = vc['ARTIST'][0] else: self.artist = ''
if 'ARTIST' in vc.keys(): self.artist = vc['ARTIST'][0] else: self.artist = ''
def set_info_ogg( self, file ): """ Sets all the info variables with useful info from the oggfile.
389307fb9d50a3b827f27b9fc2618659b2d2a8eb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/389307fb9d50a3b827f27b9fc2618659b2d2a8eb/audioinfo.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 1376, 67, 23972, 12, 365, 16, 585, 262, 30, 3536, 11511, 777, 326, 1123, 3152, 598, 5301, 1123, 628, 326, 320, 14253, 768, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 1376, 67, 23972, 12, 365, 16, 585, 262, 30, 3536, 11511, 777, 326, 1123, 3152, 598, 5301, 1123, 628, 326, 320, 14253, 768, 18, 2, -100, -100, -100, -100, -100, -100, -100, -10...
serieUrl = 'http://www.imdb.com/title/tt' + seriesID html = urlopen(serieUrl).read()
movieUrl = 'http://www.imdb.com/title/tt' + movieID html = urlopen(movieUrl).read()
def getMoviePoster(self, seriesID): # FIXME: big hack! import os imageDir = os.getcwd()+'/smewt/media/movie/images' os.system('mkdir -p "%s"' % imageDir)
7d5a20f2063d2c370987c004f3b588e15a1c089c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11141/7d5a20f2063d2c370987c004f3b588e15a1c089c/movieimdb.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2108, 83, 13120, 3349, 264, 12, 2890, 16, 4166, 734, 4672, 468, 9852, 30, 5446, 11769, 5, 1930, 1140, 1316, 1621, 273, 1140, 18, 588, 11089, 1435, 6797, 19, 4808, 359, 88, 19, 5829, 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, 2108, 83, 13120, 3349, 264, 12, 2890, 16, 4166, 734, 4672, 468, 9852, 30, 5446, 11769, 5, 1930, 1140, 1316, 1621, 273, 1140, 18, 588, 11089, 1435, 6797, 19, 4808, 359, 88, 19, 5829, 19...
def get_time(self): t = self.timer() if type(t) == type(()) or type(t) == type([]): t = reduce(lambda x,y: x+y, t, 0) return t def get_time_mac(self): return self.timer()/60.0
def __init__(self, timer=None): self.timings = {} self.cur = None self.cmd = ""
bc75e8f6af740f0d3b26d6eeaa9a4428ce268142 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/bc75e8f6af740f0d3b26d6eeaa9a4428ce268142/profile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 5441, 33, 7036, 4672, 365, 18, 8584, 899, 273, 2618, 365, 18, 1397, 273, 599, 365, 18, 4172, 273, 1408, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 5441, 33, 7036, 4672, 365, 18, 8584, 899, 273, 2618, 365, 18, 1397, 273, 599, 365, 18, 4172, 273, 1408, 2, -100, -100, -100, -100, -100, -100, -100, -100...
self.result.set_editable(True) self.result.set_cursor_visible(True) self.result.set_wrap_mode(True)
self.result.set_editable(False) self.result.set_cursor_visible(False)
def __init__(self,default = None): ## Initialise the text view buffer for this widget self.result=gtk.TextView() self.buffer=gtk.TextBuffer(None) self.result.set_buffer(self.buffer) self.result.set_editable(True) self.result.set_cursor_visible(True) self.result.set_wrap_mode(True) self.iter=self.buffer.get_iter_at_offset(0) if default != None: self.form_parms = default.form_parms self.defaults = default.defaults ## This is an array of form widgets. Every time we draw a form widget in this UI, we store it here, and then when we submit the widget, we take the values from here. self.form_widgets=default.form_widgets else: self.form_parms = {} self.defaults = FlagFramework.query_type(()) self.form_widgets=[] ##Initialise the tags: tag = self.buffer.create_tag('title') tag.set_property('font', 'Sans 18')
c2382404387dc87cc861620b92f02d5025c3db16 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5568/c2382404387dc87cc861620b92f02d5025c3db16/GTKUI.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1886, 273, 599, 4672, 7541, 31739, 326, 977, 1476, 1613, 364, 333, 3604, 365, 18, 2088, 33, 4521, 79, 18, 1528, 1767, 1435, 365, 18, 4106, 33, 4521, 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, 1, 1, 1, 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, 1886, 273, 599, 4672, 7541, 31739, 326, 977, 1476, 1613, 364, 333, 3604, 365, 18, 2088, 33, 4521, 79, 18, 1528, 1767, 1435, 365, 18, 4106, 33, 4521, 79, ...
self.assert_( ( r.point() - V3f( (x + 1 - 50) , (y + 1 - 50), 0 ) ).length() < 0.1 )
self.assert_( ( r.point() - V3f( (x + 0.5 - 50) , (y + 0.5 - 50), 0 ) ).length() < 0.1 )
def testDataWindow( self ) : """ Test ImagePrimitiveEvaluator with a data window """ displayWindow = Box2i( V2i( 0, 0 ), V2i( 99, 99 ) ) dataWindow = Box2i( V2i( 50, 50), V2i( 99, 99 ) ) img = ImagePrimitive( dataWindow, displayWindow )
58fb77e98f3635e6cbde51fe2007926b7d5d0fd4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9042/58fb77e98f3635e6cbde51fe2007926b7d5d0fd4/ImagePrimitiveEvaluator.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 751, 3829, 12, 365, 262, 294, 3536, 7766, 3421, 9840, 15876, 598, 279, 501, 2742, 3536, 225, 2562, 3829, 273, 8549, 22, 77, 12, 776, 22, 77, 12, 374, 16, 374, 262, 16, 776, 22,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 751, 3829, 12, 365, 262, 294, 3536, 7766, 3421, 9840, 15876, 598, 279, 501, 2742, 3536, 225, 2562, 3829, 273, 8549, 22, 77, 12, 776, 22, 77, 12, 374, 16, 374, 262, 16, 776, 22,...
return 'Unknown Title'
return 'No Title' def FilterUmlauts(self, s): """a quick hack to get rid of umlauts...""" dict={'':'ae', '':'oe', '':'ue', '':'ss'} for key in dict.keys(): s = s.replace(key, dict[key]) return s
def ExtractTitle(self, data): """look if there's a title tag inside data
184713781fc4a064c8db7ea918fad4b0b476f101 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2853/184713781fc4a064c8db7ea918fad4b0b476f101/cProxyHandler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8152, 4247, 12, 2890, 16, 501, 4672, 3536, 7330, 309, 1915, 1807, 279, 2077, 1047, 4832, 501, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8152, 4247, 12, 2890, 16, 501, 4672, 3536, 7330, 309, 1915, 1807, 279, 2077, 1047, 4832, 501, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
Order by names. __init__ < anything. public < private. otherwise, sorted alphabetically by name.
Compare uid1 and uid2 by their names, using the following rules: - C{'__init__'} < anything. - public < private. - otherwise, sort alphabetically by name. @return: -1 if C{uid1<uid2}; 0 if C{uid1==uid2}; and 1 if C{uid1>uid2}. @rtype: C{int}
def _cmp_name(uid1, uid2): """ Order by names. __init__ < anything. public < private. otherwise, sorted alphabetically by name. """ x = uid1.name() y = uid2.name() if (y == '__init__'): return 1 if (x == '__init__'): return -1 if x == y: return 0 if _is_private(x) and not _is_private(y): return 1 if _is_private(y) and not _is_private(x): return -1 return cmp(x, y)
b1b93a7c8720ea1ae0c715da86bbf6fe1dbf094a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/b1b93a7c8720ea1ae0c715da86bbf6fe1dbf094a/html.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 9625, 67, 529, 12, 1911, 21, 16, 4555, 22, 4672, 3536, 11051, 4555, 21, 471, 4555, 22, 635, 3675, 1257, 16, 1450, 326, 3751, 2931, 30, 300, 385, 27828, 972, 2738, 7250, 97, 411, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9625, 67, 529, 12, 1911, 21, 16, 4555, 22, 4672, 3536, 11051, 4555, 21, 471, 4555, 22, 635, 3675, 1257, 16, 1450, 326, 3751, 2931, 30, 300, 385, 27828, 972, 2738, 7250, 97, 411, ...
contriblnkbtn = gtk.LinkButton("http://www.jokosher.org/contribute")
contriblnkbtn = gtk.LinkButton("http://www.jokosher.org/contribute",label="http://www.jokosher.org/contribute")
def OnContributingDialog(self, widget): """ Creates and shows the "Contributing to Jokosher" dialog. Parameters: widget -- reserved for GTK callbacks, don't use it explicitly. """ self.contribTree = gtk.glade.XML(Globals.GLADE_PATH, "ContributingDialog") # grab references to the ContributingDialog window and vbox self.contribdialog = self.contribTree.get_widget("ContributingDialog") self.contribvbox = self.contribTree.get_widget("vbox14") self.contribdialog.set_icon(self.icon)
0cfdca7713094c29e7ca09e60fcce2edc7b42d4c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10033/0cfdca7713094c29e7ca09e60fcce2edc7b42d4c/JokosherApp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2755, 442, 665, 8490, 6353, 12, 2890, 16, 3604, 4672, 3536, 10210, 471, 17975, 326, 315, 442, 665, 8490, 358, 804, 601, 538, 1614, 6, 6176, 18, 225, 7012, 30, 3604, 1493, 8735, 364, 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, 2755, 442, 665, 8490, 6353, 12, 2890, 16, 3604, 4672, 3536, 10210, 471, 17975, 326, 315, 442, 665, 8490, 358, 804, 601, 538, 1614, 6, 6176, 18, 225, 7012, 30, 3604, 1493, 8735, 364, 19...
identitytab = ''.join([chr(i) for i in range(256)])
identitytab = {}
def rev(self): if self._rev is not None: return self._rev L = list(self) L.reverse() self._rev = self.__class__("".join(L)) return self._rev
85def692392804d753756cd126aaeef97a432a2c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/85def692392804d753756cd126aaeef97a432a2c/test_descr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5588, 12, 2890, 4672, 309, 365, 6315, 9083, 353, 486, 599, 30, 327, 365, 6315, 9083, 511, 273, 666, 12, 2890, 13, 511, 18, 9845, 1435, 365, 6315, 9083, 273, 365, 16186, 1106, 972, 2932...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5588, 12, 2890, 4672, 309, 365, 6315, 9083, 353, 486, 599, 30, 327, 365, 6315, 9083, 511, 273, 666, 12, 2890, 13, 511, 18, 9845, 1435, 365, 6315, 9083, 273, 365, 16186, 1106, 972, 2932...
pass
self.body.append(self.context.pop())
def depart_image(self, node): pass
69d8475b4eb8ec7ab69cb327fb72a96f0e5799e1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1278/69d8475b4eb8ec7ab69cb327fb72a96f0e5799e1/html4css1.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 26000, 67, 2730, 12, 2890, 16, 756, 4672, 1342, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 26000, 67, 2730, 12, 2890, 16, 756, 4672, 1342, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
a 12-byte hexadecimal string.
a 12-byte hexadecimal string.
def extshelp(): doc = _(r''' Mercurial has the ability to add new features through the use of extensions. Extensions may add new commands, add options to existing commands, change the default behavior of commands, or implement hooks. Extensions are not loaded by default for a variety of reasons: they can increase startup overhead; they may be meant for advanced usage only; they may provide potentially dangerous abilities (such as letting you destroy or modify history); they might not be ready for prime time; or they may alter some usual behaviors of stock Mercurial. It is thus up to the user to activate extensions as needed. To enable the "foo" extension, either shipped with Mercurial or in the Python search path, create an entry for it in your hgrc, like this:: [extensions] foo = You may also specify the full path to an extension:: [extensions] myfeature = ~/.hgext/myfeature.py To explicitly disable an extension enabled in an hgrc of broader scope, prepend its path with !:: [extensions] # disabling extension bar residing in /path/to/extension/bar.py hgext.bar = !/path/to/extension/bar.py # ditto, but no path was supplied for extension baz hgext.baz = ! ''') exts, maxlength = extensions.enabled() doc += listexts(_('enabled extensions:'), exts, maxlength) exts, maxlength = extensions.disabled() doc += listexts(_('disabled extensions:'), exts, maxlength) return doc
6559436b337b2c23d3cc0ede357a66e82d94a983 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11312/6559436b337b2c23d3cc0ede357a66e82d94a983/help.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1110, 674, 1992, 13332, 997, 273, 389, 12, 86, 26418, 14940, 1397, 649, 711, 326, 7123, 358, 527, 394, 4467, 3059, 326, 999, 434, 4418, 18, 23105, 2026, 527, 394, 4364, 16, 527, 702, 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, 1110, 674, 1992, 13332, 997, 273, 389, 12, 86, 26418, 14940, 1397, 649, 711, 326, 7123, 358, 527, 394, 4467, 3059, 326, 999, 434, 4418, 18, 23105, 2026, 527, 394, 4364, 16, 527, 702, 3...
elif skip_tags and skip_tags.has_key(tagname):
elif skip_tags.has_key(tagname):
def writeHeader(tags, taghash, region, skip_tags, useinstall, rpmgroup): """Use the data "tags" and change it into a rpmtag header.""" (offset, store, stags1, stags2, stags3) = (0, [], [], [], []) # Sort by number and also first normal tags, then install_keys tags # and at the end the region tag. for tagname in tags.keys(): tagnum = taghash[tagname][0] if tagname == region: stags3.append((tagnum, tagname)) elif skip_tags and skip_tags.has_key(tagname): pass elif useinstall and install_keys.has_key(tagname): stags2.append((tagnum, tagname)) else: stags1.append((tagnum, tagname)) stags1.sort() stags2.sort() stags1.extend(stags3) stags1.extend(stags2) indexdata = [] for (tagnum, tagname) in stags1: value = tags[tagname] ttype = taghash[tagnum][1] count = len(value) pad = 0 if ttype == RPM_ARGSTRING: if isinstance(value, basestring): ttype = RPM_STRING else: ttype = RPM_STRING_ARRAY elif ttype == RPM_GROUP: ttype = RPM_I18NSTRING if rpmgroup: ttype = rpmgroup if ttype == RPM_INT32: if taghash[tagnum][3] & 8: data = pack("!%di" % count, *value) else: data = pack("!%dI" % count, *value) pad = (4 - (offset % 4)) % 4 elif ttype == RPM_STRING: count = 1 data = "%s\x00" % value elif ttype == RPM_STRING_ARRAY or ttype == RPM_I18NSTRING: data = "".join( [ "%s\x00" % value[i] for i in xrange(count) ] ) elif ttype == RPM_BIN: data = value elif ttype == RPM_INT16: data = pack("!%dH" % count, *value) pad = (2 - (offset % 2)) % 2 elif ttype == RPM_INT8 or ttype == RPM_CHAR: data = pack("!%dB" % count, *value) elif ttype == RPM_INT64: data = pack("!%dQ" % count, *value) pad = (8 - (offset % 8)) % 8 if pad: offset += pad store.append("\x00" * pad) store.append(data) index = pack("!4I", tagnum, ttype, offset, count) offset += len(data) if tagname == region: # data for region tag is first indexdata.insert(0, index) else: indexdata.append(index) indexNo = len(stags1) store = "".join(store) indexdata = "".join(indexdata) return (indexNo, len(store), indexdata, store)
13be26721e21a4e961a8227db7d74cd35a0477dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/13be26721e21a4e961a8227db7d74cd35a0477dd/oldpyrpm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 1864, 12, 4156, 16, 1047, 2816, 16, 3020, 16, 2488, 67, 4156, 16, 999, 5425, 16, 25228, 1655, 4672, 3536, 3727, 326, 501, 315, 4156, 6, 471, 2549, 518, 1368, 279, 8715, 1010, 346...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 1864, 12, 4156, 16, 1047, 2816, 16, 3020, 16, 2488, 67, 4156, 16, 999, 5425, 16, 25228, 1655, 4672, 3536, 3727, 326, 501, 315, 4156, 6, 471, 2549, 518, 1368, 279, 8715, 1010, 346...
valid_list = [x for x in entrylist if re.match(matchstr, x[1]._fulltime)] else: valid_list = entrylist maxe = config.get("num_entries", 5) if maxe and not data["pi_yr"]: valid_list = valid_list[:maxe] valid_list = [x[1] for x in valid_list] return valid_list
entrylist = [x for x in entrylist if re.match(matchstr, x._fulltime)] return entrylist def blosxom_sort_list_handler(args): """ This sorts the entries by mtime and then trims them based on num_entries. @param args: dict containing the incoming Request object @type args: object @returns: 1 @rtype: int """ request = args["request"] data = request.data config = request.config entrylist = data["entry_list"] entrylist = [ (e._mtime, e) for e in entrylist ] entrylist.sort() entrylist.reverse() entrylist = [x[1] for x in entrylist] return entrylist
def blosxom_file_list_handler(args): """ This is the default handler for getting entries. It takes the request object in and figures out which entries based on the default behavior that we want to show and generates a list of EntryBase subclass objects which it returns. @param args: dict containing the incoming Request object @type args: object @returns: the content we want to render @rtype: list of EntryBase objects """ request = args["request"] data = request.data config = request.config if data['bl_type'] == 'dir': filelist = tools.walk(request, data['root_datadir'], int(config.get("depth", "0"))) elif data['bl_type'] == 'file': filelist = [data['root_datadir']] else: filelist = [] entrylist = [] for ourfile in filelist: e = FileEntry(request, ourfile, data['root_datadir']) entrylist.append((e._mtime, e)) # this sorts entries by mtime in reverse order. entries that have # no mtime get sorted to the top. entrylist.sort() entrylist.reverse() # Match dates with files if applicable if data['pi_yr']: # This is called when a date has been requested, e.g. # /some/category/2004/Sep month = (data['pi_mo'] in tools.month2num and \ tools.month2num[data['pi_mo']] or \ data['pi_mo']) matchstr = "^" + data["pi_yr"] + month + data["pi_da"] valid_list = [x for x in entrylist if re.match(matchstr, x[1]._fulltime)] else: valid_list = entrylist # This is the maximum number of entries we can show on the front page # (zero indicates show all entries) maxe = config.get("num_entries", 5) if maxe and not data["pi_yr"]: valid_list = valid_list[:maxe] valid_list = [x[1] for x in valid_list] return valid_list
c448cc5127be70118de9005d5ed536fb2469850d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11836/c448cc5127be70118de9005d5ed536fb2469850d/pyblosxom.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 324, 383, 30319, 362, 67, 768, 67, 1098, 67, 4176, 12, 1968, 4672, 3536, 1220, 353, 326, 805, 1838, 364, 8742, 3222, 18, 225, 2597, 5530, 326, 590, 733, 316, 471, 4291, 1823, 596, 1492...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 324, 383, 30319, 362, 67, 768, 67, 1098, 67, 4176, 12, 1968, 4672, 3536, 1220, 353, 326, 805, 1838, 364, 8742, 3222, 18, 225, 2597, 5530, 326, 590, 733, 316, 471, 4291, 1823, 596, 1492...
Multiplicative Abelian Group isomorphic to Z x C3 x C4, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x C3 x C4 generated by [a, b^2, c]
Multiplicative Abelian Group isomorphic to C2 x C3 x Z, which is the subgroup of Multiplicative Abelian Group isomorphic to C3 x C4 x Z generated by [a, b^2, c]
def __init__(self, ambient, gens, names="f"): """ EXAMPLES: sage: F = AbelianGroup(5,[30,64,729],names = list("abcde")) sage: a,b,c,d,e = F.gens() sage: F.subgroup([a^3,b]) Multiplicative Abelian Group isomorphic to Z x Z, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C2 x C3 x C5 x C64 x C729 generated by [a^3, b] sage: F.subgroup([c]) Multiplicative Abelian Group isomorphic to C2 x C3 x C5, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C2 x C3 x C5 x C64 x C729 generated by [c] sage: F.subgroup([a,c]) Multiplicative Abelian Group isomorphic to Z x C2 x C3 x C5, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C2 x C3 x C5 x C64 x C729 generated by [a, c] sage: F.subgroup([a,b*c]) Multiplicative Abelian Group isomorphic to Z x Z, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C2 x C3 x C5 x C64 x C729 generated by [a, b*c] sage: F.subgroup([b*c,d]) Multiplicative Abelian Group isomorphic to Z x C64, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C2 x C3 x C5 x C64 x C729 generated by [b*c, d] sage: F.subgroup([a*b,c^6,d],names = list("xyz")) Multiplicative Abelian Group isomorphic to Z x C5 x C64, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C2 x C3 x C5 x C64 x C729 generated by [a*b, c^6, d] sage: H.<x,y,z> = F.subgroup([a*b, c^6, d]); H Multiplicative Abelian Group isomorphic to Z x C5 x C64, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C2 x C3 x C5 x C64 x C729 generated by [a*b, c^6, d] sage: G = F.subgroup([a*b,c^6,d],names = list("xyz")) sage: G Multiplicative Abelian Group isomorphic to Z x C5 x C64, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C2 x C3 x C5 x C64 x C729 generated by [a*b, c^6, d] sage: x,y,z = G.gens() sage: x.order() +Infinity sage: y.order() 5 sage: z.order() 64 sage: A = AbelianGroup(5,[3, 5, 5, 7, 8], names = "abcde") sage: a,b,c,d,e = A.gens() sage: A.subgroup([a,b]) Multiplicative Abelian Group isomorphic to C3 x C5, which is the subgroup of Multiplicative Abelian Group isomorphic to C3 x C5 x C5 x C7 x C8 generated by [a, b] sage: A.subgroup([a,b,c,d^2,e]) Multiplicative Abelian Group isomorphic to C3 x C5 x C5 x C7 x C8, which is the subgroup of Multiplicative Abelian Group isomorphic to C3 x C5 x C5 x C7 x C8 generated by [a, b, c, d^2, e] sage: A.subgroup([a,b,c,d^2,e^2]) Multiplicative Abelian Group isomorphic to C3 x C4 x C5 x C5 x C7, which is the subgroup of Multiplicative Abelian Group isomorphic to C3 x C5 x C5 x C7 x C8 generated by [a, b, c, d^2, e^2] sage: B = A.subgroup([a^3,b,c,d,e^2]); B Multiplicative Abelian Group isomorphic to C4 x C5 x C5 x C7, which is the subgroup of Multiplicative Abelian Group isomorphic to C3 x C5 x C5 x C7 x C8 generated by [b, c, d, e^2] sage: B.invariants() [4, 5, 5, 7] sage: A = AbelianGroup(4,[1009, 2003, 3001, 4001], names = "abcd") sage: a,b,c,d = A.gens() sage: B = A.subgroup([a^3,b,c,d]) sage: B.invariants() [1009, 2003, 3001, 4001] sage: A.order() 24266473210027 sage: B.order() 24266473210027 sage: A = AbelianGroup(4,[1008, 2003, 3001, 4001], names = "abcd") sage: a,b,c,d = A.gens() sage: B = A.subgroup([a^3,b,c,d]) sage: B Multiplicative Abelian Group isomorphic to C3 x C7 x C16 x C2003 x C3001 x C4001, which is the subgroup of Multiplicative Abelian Group isomorphic to C7 x C9 x C16 x C2003 x C3001 x C4001 generated by [a^3, b, c, d] Infinite groups can also be handled: sage: G = AbelianGroup([3,4,0], names = "abc") sage: a,b,c = G.gens() sage: F = G.subgroup([a,b^2,c]); F Multiplicative Abelian Group isomorphic to Z x C3 x C4, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x C3 x C4 generated by [a, b^2, c] sage: F.invariants() [0, 3, 4] sage: F.gens() [a, b^2, c] sage: F.order() +Infinity
91d93eac9e73babe24c77f9b0d1b0336a7d35cef /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/91d93eac9e73babe24c77f9b0d1b0336a7d35cef/abelian_group.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 13232, 1979, 16, 314, 773, 16, 1257, 1546, 74, 6, 4672, 3536, 225, 5675, 8900, 11386, 30, 272, 410, 30, 478, 273, 9771, 292, 2779, 1114, 12, 25, 16, 63...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 13232, 1979, 16, 314, 773, 16, 1257, 1546, 74, 6, 4672, 3536, 225, 5675, 8900, 11386, 30, 272, 410, 30, 478, 273, 9771, 292, 2779, 1114, 12, 25, 16, 63...
print "Caught expected NoSectionError:", e
pass
def query_errors(): print print "Testing query interface..." cf = ConfigParser.ConfigParser() print cf.sections() print "Has section 'Foo'?", cf.has_section("Foo") try: cf.options("Foo") except ConfigParser.NoSectionError, e: print "Caught expected NoSectionError:", e else: print "Failed to catch expected NoSectionError from options()" try: cf.set("foo", "bar", "value") except ConfigParser.NoSectionError, e: print "Caught expected NoSectionError:", e else: print "Failed to catch expected NoSectionError from set()" expect_get_error(cf, ConfigParser.NoSectionError, "foo", "bar") cf.add_section("foo") expect_get_error(cf, ConfigParser.NoOptionError, "foo", "bar")
3b4eacb6f09a74b34c9b912c4a532ce3c0bf8daa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/3b4eacb6f09a74b34c9b912c4a532ce3c0bf8daa/test_cfgparser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 843, 67, 4324, 13332, 1172, 1172, 315, 22218, 843, 1560, 7070, 6080, 273, 25076, 18, 809, 2678, 1435, 1172, 6080, 18, 11657, 1435, 1172, 315, 5582, 2442, 296, 42, 5161, 11, 35, 3113, 608...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 843, 67, 4324, 13332, 1172, 1172, 315, 22218, 843, 1560, 7070, 6080, 273, 25076, 18, 809, 2678, 1435, 1172, 6080, 18, 11657, 1435, 1172, 315, 5582, 2442, 296, 42, 5161, 11, 35, 3113, 608...
message="You don't have write permission" \
message="You don't have write permission " \
def output_format_show(req, bfo, ln=config.CFG_SITE_LANG, r_fld=[], r_val=[], r_tpl=[], default="", r_upd="", chosen_option="", **args): """ Show a single output format. Check for authentication and print output format settings. The page either shows the output format from file, or from user's POST session, as we want to let him edit the rules without saving. Policy is: r_fld, r_val, rules_tpl are list of attributes of the rules. If they are empty, load from file. Else use POST. The i th value of each list is one of the attributes of rule i. Rule i is the i th rule in order of evaluation. All list have the same number of item. r_upd contains an action that has to be performed on rules. It can composed of a number (i, the rule we want to modify) and an operator : "save" to save the rules, "add" or "del". syntax: operator [number] For eg: r_upd = _("Save Changes") saves all rules (no int should be specified). For eg: r_upd = _("Add New Rule") adds a rule (no int should be specified). For eg: r_upd = _("Remove Rule") + " 5" deletes rule at position 5. The number is used only for operation delete. An action can also be in **args. We must look there for string starting with '(+|-) [number]' to increase (+) or decrease (-) a rule given by its index (number). For example "+ 5" increase priority of rule 5 (put it at fourth position). The string in **args can be followed by some garbage that looks like .x or .y, as this is returned as the coordinate of the click on the <input type="image">. We HAVE to use args and reason on its keys, because for <input> of type image, iexplorer does not return the value of the tag, but only the name. Action is executed only if we are working from user's POST session (means we must have loaded the output format first, which is totally normal and expected behaviour) @param ln language @param bfo the filename of the output format to show @param r_fld the list of 'field' attribute for each rule @param r_val the list of 'value' attribute for each rule @param r_tpl the list of 'template' attribute for each rule @param default the default format template used by this output format @param r_upd the rule that we want to increase/decrease in order of evaluation """ ln = wash_language(ln) _ = gettext_set_language(ln) navtrail_previous_links = bibformatadminlib.getnavtrail(''' &gt; <a class="navtrail" href="%s/admin/bibformat/bibformatadmin.py/output_formats_manage?ln=%s">%s</a>''' % (config.CFG_SITE_URL, ln, _("Manage Output Formats"))) code = wash_url_argument(bfo, 'str') try: uid = getUid(req) except MySQLdb.Error, e: return error_page(req) (auth_code, auth_msg) = check_user(req, 'cfgbibformat') if not auth_code: bfo = wash_url_argument(bfo, 'str') default = wash_url_argument(default, 'str') r_upd = wash_url_argument(r_upd, 'str') if not bibformatadminlib.can_read_output_format(bfo): #No read permission return page(title=_("Restricted Output Format"), body = """You don't have permission to view this output format.""", language=ln, navtrail = navtrail_previous_links, errors = [("ERR_BIBFORMAT_CANNOT_READ_OUTPUT_FILE", bfo , "")], lastupdated=__lastupdated__, req=req) output_format = bibformat_engine.get_output_format(code=bfo, with_attributes=True) name = output_format['attrs']['names']['generic'] if name == "": name = bfo if not bibformatadminlib.can_write_output_format(bfo) and \ chosen_option == "":#No write permission return dialog_box(req=req, ln=ln, title="File Permission on %s" % name, message="You don't have write permission" \ "on <i>%s</i>.<br/> You can view the output " \ "format, but not edit it." % name, navtrail=navtrail_previous_links, options=[ _("Ok")]) return page(title=_('Output Format %s Rules' % name), body=bibformatadminlib.perform_request_output_format_show(bfo=bfo, ln=ln, r_fld=r_fld, r_val=r_val, r_tpl=r_tpl, default=default, r_upd=r_upd, args=args), uid=uid, language=ln, navtrail = navtrail_previous_links, lastupdated=__lastupdated__, req=req) else: return page_not_authorized(req=req, text=auth_msg, navtrail=navtrail_previous_links)
3576493ca5669ccd2804efa86dee57917f0d61ed /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2763/3576493ca5669ccd2804efa86dee57917f0d61ed/bibformatadmin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 876, 67, 2139, 67, 4500, 12, 3658, 16, 324, 617, 16, 7211, 33, 1425, 18, 19727, 67, 20609, 67, 10571, 16, 436, 67, 19794, 22850, 6487, 436, 67, 1125, 22850, 6487, 436, 67, 10933, 22850...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 876, 67, 2139, 67, 4500, 12, 3658, 16, 324, 617, 16, 7211, 33, 1425, 18, 19727, 67, 20609, 67, 10571, 16, 436, 67, 19794, 22850, 6487, 436, 67, 1125, 22850, 6487, 436, 67, 10933, 22850...
popen = os.popen("/bin/sh -c 'echo \"line1\nline2\nline3\"'") it = iter(popen) self.assertEquals(next(it), "line1\n") self.assertEquals(next(it), "line2\n") self.assertEquals(next(it), "line3\n") self.assertRaises(StopIteration, next, it)
with os.popen( "/bin/sh -c 'echo \"line1\nline2\nline3\"'") as popen: it = iter(popen) self.assertEquals(next(it), "line1\n") self.assertEquals(next(it), "line2\n") self.assertEquals(next(it), "line3\n") self.assertRaises(StopIteration, next, it)
def test_os_popen_iter(self): if os.path.exists("/bin/sh"): popen = os.popen("/bin/sh -c 'echo \"line1\nline2\nline3\"'") it = iter(popen) self.assertEquals(next(it), "line1\n") self.assertEquals(next(it), "line2\n") self.assertEquals(next(it), "line3\n") self.assertRaises(StopIteration, next, it)
caed8e9516bf505df5b931fb9aeb2c62c453b2b1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/caed8e9516bf505df5b931fb9aeb2c62c453b2b1/test_os.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 538, 67, 84, 3190, 67, 2165, 12, 2890, 4672, 309, 1140, 18, 803, 18, 1808, 2932, 19, 4757, 19, 674, 6, 4672, 30925, 273, 1140, 18, 84, 3190, 2932, 19, 4757, 19, 674, 300, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 538, 67, 84, 3190, 67, 2165, 12, 2890, 4672, 309, 1140, 18, 803, 18, 1808, 2932, 19, 4757, 19, 674, 6, 4672, 30925, 273, 1140, 18, 84, 3190, 2932, 19, 4757, 19, 674, 300, ...
var command_pat = new RegExp('(.*?)([a-zA-Z._0-9]*)$');
var command_pat = new RegExp('([a-zA-Z._0-9]*)$');
def javascript(): s = r"""
ada3193c2996cf5b695a0c0ce4f81a73c7ec273a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9417/ada3193c2996cf5b695a0c0ce4f81a73c7ec273a/js.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11341, 13332, 272, 273, 436, 8395, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11341, 13332, 272, 273, 436, 8395, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
self.wfile.close()
def close(self): self.rfile.close() self.wfile.close() self.sock.close()
0eb0c4cc832a63ffbb1cc7f140401d1de4b28359 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11109/0eb0c4cc832a63ffbb1cc7f140401d1de4b28359/stasher.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1746, 12, 2890, 4672, 225, 365, 18, 86, 768, 18, 4412, 1435, 225, 365, 18, 15031, 18, 4412, 1435, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1746, 12, 2890, 4672, 225, 365, 18, 86, 768, 18, 4412, 1435, 225, 365, 18, 15031, 18, 4412, 1435, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
self.assertContains(project_page, details)
self.assertContains(project_page, text)
def test_create_bug_answer(self): # go to the project page p = Project.create_dummy(name='Ubuntu') question__pk = 1 question = ProjectInvolvementQuestion.create_dummy(pk=question__pk, is_bug_style=True) question.save() title = 'omfg i wish this bug would go away' details = 'kthxbai' POST_data = { 'project__pk': p.pk, 'question__pk': str(question__pk), 'bug__title': title, 'bug__details': details } POST_handler = reverse(mysite.project.views.create_bug_answer_do) response = self.login_with_client().post(POST_handler, POST_data)
547ea53ecf77894d021058c39de70f02b1f5a199 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11976/547ea53ecf77894d021058c39de70f02b1f5a199/tests.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 2640, 67, 925, 67, 13490, 12, 2890, 4672, 468, 1960, 358, 326, 1984, 1363, 293, 273, 5420, 18, 2640, 67, 21050, 12, 529, 2218, 57, 70, 25348, 6134, 5073, 972, 5465, 273, 404,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2640, 67, 925, 67, 13490, 12, 2890, 4672, 468, 1960, 358, 326, 1984, 1363, 293, 273, 5420, 18, 2640, 67, 21050, 12, 529, 2218, 57, 70, 25348, 6134, 5073, 972, 5465, 273, 404,...
"""You can only call this during motion IN a port of a glyph.
"""This is only called if port_inout is >= 0, i.e. there is valid information concerning a glyph, port side and port index under the mouse at the moment. Called by _observer_glyph_motion().
def update_port_info_statusbar(self, glyph, port_inout, port_idx): """You can only call this during motion IN a port of a glyph. """ msg = '' canvas = self.canvas
afadac5e2e0310d8179849fbe61d4597bc6d87ec /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4494/afadac5e2e0310d8179849fbe61d4597bc6d87ec/graph_editor.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 67, 655, 67, 1376, 67, 2327, 3215, 12, 2890, 16, 9440, 16, 1756, 67, 267, 659, 16, 1756, 67, 3465, 4672, 225, 3536, 2503, 353, 1338, 2566, 309, 1756, 67, 267, 659, 353, 1545, 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, 1089, 67, 655, 67, 1376, 67, 2327, 3215, 12, 2890, 16, 9440, 16, 1756, 67, 267, 659, 16, 1756, 67, 3465, 4672, 225, 3536, 2503, 353, 1338, 2566, 309, 1756, 67, 267, 659, 353, 1545, 3...
.. include:: <nonexistent> """], ]
\.\. include:: <nonexistent> $"""
def suite(): s = DocutilsTestSupport.ParserTestSuite() s.generateTests(totest) return s
890fa949b55831d0ea7841106527db8a18f4fdd7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/890fa949b55831d0ea7841106527db8a18f4fdd7/test_include.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11371, 13332, 272, 273, 3521, 5471, 4709, 6289, 18, 2678, 4709, 13587, 1435, 272, 18, 7163, 14650, 12, 3307, 395, 13, 327, 272, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 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, 11371, 13332, 272, 273, 3521, 5471, 4709, 6289, 18, 2678, 4709, 13587, 1435, 272, 18, 7163, 14650, 12, 3307, 395, 13, 327, 272, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -1...
self.Bind(wx.EVT_MENU, lambda p0=None, p1=2:self.onViewChage(p0, p1), menuItem)
self.Bind(wx.EVT_MENU, lambda p0=None, p1=2:self.onViewChange(p0, p1), menuItem)
def createMenu(self): menuItem = self.menuFile.Insert(0, ID_NEW, self.MENU_TEXTS[ID_NEW][0]) self.Bind(wx.EVT_MENU, self.onNew, menuItem) menuItem = self.menuFile.Insert(1, ID_OPEN, self.MENU_TEXTS[ID_OPEN][0]) self.Bind(wx.EVT_MENU, self.onOpen, menuItem)
d67f4092504b2c470f310c7207434afad7df5495 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7242/d67f4092504b2c470f310c7207434afad7df5495/LevelEditorUIBase.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 4599, 12, 2890, 4672, 19711, 273, 365, 18, 5414, 812, 18, 4600, 12, 20, 16, 1599, 67, 12917, 16, 365, 18, 29227, 67, 5151, 55, 63, 734, 67, 12917, 6362, 20, 5717, 365, 18, 3357,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4599, 12, 2890, 4672, 19711, 273, 365, 18, 5414, 812, 18, 4600, 12, 20, 16, 1599, 67, 12917, 16, 365, 18, 29227, 67, 5151, 55, 63, 734, 67, 12917, 6362, 20, 5717, 365, 18, 3357,...
""" % testtemplate
''' % testtemplate
def testPageInPagesWithClassWithMenu(self): self.assertEqual(queryView(ob, 'test', request), None) testtemplate = os.path.join(tests_path, 'testfiles', 'test.pt')
1cfc7ddd1cac0110cca3e909215477e1c59bbca3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9523/1cfc7ddd1cac0110cca3e909215477e1c59bbca3/test_directives.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 1964, 382, 5716, 1190, 797, 1190, 4599, 12, 2890, 4672, 365, 18, 11231, 5812, 12, 2271, 1767, 12, 947, 16, 296, 3813, 2187, 590, 3631, 599, 13, 1842, 3202, 273, 1140, 18, 803, 18...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 1964, 382, 5716, 1190, 797, 1190, 4599, 12, 2890, 4672, 365, 18, 11231, 5812, 12, 2271, 1767, 12, 947, 16, 296, 3813, 2187, 590, 3631, 599, 13, 1842, 3202, 273, 1140, 18, 803, 18...
self.assertEqual(func, os.remove) self.assertEqual(arg, self.childpath)
if func is os.remove: self.assertEqual(arg, self.childpath) else: self.assertIs(func, os.listdir, "func must be either os.remove or os.listdir") self.assertEqual(arg, TESTFN)
def check_args_to_onerror(self, func, arg, exc): if self.errorState == 0: self.assertEqual(func, os.remove) self.assertEqual(arg, self.childpath) self.failUnless(issubclass(exc[0], OSError)) self.errorState = 1 else: self.assertEqual(func, os.rmdir) self.assertEqual(arg, TESTFN) self.failUnless(issubclass(exc[0], OSError)) self.errorState = 2
9c6fc5187fbf23d584834e9c9697986c42cabecd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8546/9c6fc5187fbf23d584834e9c9697986c42cabecd/test_shutil.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 1968, 67, 869, 67, 265, 1636, 12, 2890, 16, 1326, 16, 1501, 16, 3533, 4672, 309, 365, 18, 1636, 1119, 422, 374, 30, 309, 1326, 353, 1140, 18, 4479, 30, 365, 18, 11231, 5812,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1968, 67, 869, 67, 265, 1636, 12, 2890, 16, 1326, 16, 1501, 16, 3533, 4672, 309, 365, 18, 1636, 1119, 422, 374, 30, 309, 1326, 353, 1140, 18, 4479, 30, 365, 18, 11231, 5812,...
def __init__(self, N, contribs, table=None): MeanStatisticGame.__init__(self, N, contribs)
def __init__(self, N, choices, table=None, matrix=None): MeanStatisticGame.__init__(self, N, choices)
def __init__(self, N, contribs, table=None): MeanStatisticGame.__init__(self, N, contribs) self.payoffs = { } if table is not None: for row in table: self.payoffs[(row[0], row[1])] = row[2]
5b71669e95cb1e59558f3b550ecd43f33998cb0b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12755/5b71669e95cb1e59558f3b550ecd43f33998cb0b/msgame.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 423, 16, 7246, 16, 1014, 33, 7036, 16, 3148, 33, 7036, 4672, 21979, 20673, 12496, 16186, 2738, 972, 12, 2890, 16, 423, 16, 7246, 13, 365, 18, 10239, 2660...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 423, 16, 7246, 16, 1014, 33, 7036, 16, 3148, 33, 7036, 4672, 21979, 20673, 12496, 16186, 2738, 972, 12, 2890, 16, 423, 16, 7246, 13, 365, 18, 10239, 2660...
Example -------
Examples --------
def cublasDaxpy(n, alpha, x, incx, y, incy): """ Real vector addition. Computes the sum of a double-precision vector scaled by a double-precision scalar and another double-precision vector. Parameters ---------- n : int Number of elements in input vectors. alpha : numpy.float64 Double-precision scalar. x : ctypes.c_void_p Pointer to double-precision input vector. incx : int Storage spacing between elements of `x`. y : ctypes.c_void_p Pointer to double-precision input/output vector. incy : int Storage spacing between elements of `y`. Example ------- >>> import pycuda.autoinit >>> import pycuda.gpuarray as gpuarray >>> import numpy as np >>> alpha = np.float64(np.random.rand()) >>> x = np.random.rand(5).astype(np.float64) >>> y = np.random.rand(5).astype(np.float64) >>> x_gpu = gpuarray.to_gpu(x) >>> y_gpu = gpuarray.to_gpu(y) >>> cublasDaxpy(x_gpu.size, alpha, x_gpu.gpudata, 1, y_gpu.gpudata, 1) >>> np.allclose(y_gpu.get(), alpha*x+y) True Notes ----- Both `x` and `y` must contain `n` elements. """ _libcublas.cublasDaxpy(n, alpha, int(x), incx, int(y), incy) status = cublasGetError() cublasCheckStatus(status)
f3eb0a79d8c436d509dec60f91ff7a7dcced528c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14753/f3eb0a79d8c436d509dec60f91ff7a7dcced528c/cublas.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 276, 30579, 40, 651, 2074, 12, 82, 16, 4190, 16, 619, 16, 7290, 92, 16, 677, 16, 316, 2431, 4672, 3536, 15987, 3806, 2719, 18, 225, 14169, 281, 326, 2142, 434, 279, 1645, 17, 14548, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 30579, 40, 651, 2074, 12, 82, 16, 4190, 16, 619, 16, 7290, 92, 16, 677, 16, 316, 2431, 4672, 3536, 15987, 3806, 2719, 18, 225, 14169, 281, 326, 2142, 434, 279, 1645, 17, 14548, ...