rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
if self.numUses and self.allowedUses and self.allowedUses > 0 and self.numUses > self.allowedUses: | if self.numUses and self.allowedUses and self.allowedUses > 0 and self.numUses >= self.allowedUses: | def isValid(self, cart=None, contact=None): """ Make sure this discount still has available uses and is in the current date range. If a cart has been populated, validate that it does apply to the products we have selected. If this is a "FREECHEAP" discount, then error if the cheapest shipping hasn't been chosen. """ if not self.active: return (False, ugettext('This coupon is disabled.')) if self.startDate > datetime.date.today(): return (False, ugettext('This coupon is not active yet.')) if self.endDate < datetime.date.today(): return (False, ugettext('This coupon has expired.')) if self.numUses and self.allowedUses and self.allowedUses > 0 and self.numUses > self.allowedUses: return (False, ugettext('This discount has exceeded the number of allowed uses.')) if cart: minOrder = self.minOrder or 0 if cart.total < minOrder: return (False, ugettext('This discount only applies to orders of at least %s.' % moneyfmt(minOrder))) | 191851790855049f672dac0d354513958b81fce4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/171/191851790855049f672dac0d354513958b81fce4/models.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4908,
12,
2890,
16,
7035,
33,
7036,
16,
5388,
33,
7036,
4672,
3536,
4344,
3071,
333,
12137,
4859,
711,
2319,
4692,
471,
353,
316,
326,
783,
1509,
1048,
18,
971,
279,
7035,
711,
2118,
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,
4908,
12,
2890,
16,
7035,
33,
7036,
16,
5388,
33,
7036,
4672,
3536,
4344,
3071,
333,
12137,
4859,
711,
2319,
4692,
471,
353,
316,
326,
783,
1509,
1048,
18,
971,
279,
7035,
711,
2118,
6... |
try: self.win.addch(ch) except curses.error: pass | self._insert_printable_char(ch) | def do_command(self, ch): "Process a single editing command." (y, x) = self.win.getyx() self.lastcmd = ch if ascii.isprint(ch): if y < self.maxy or x < self.maxx: # The try-catch ignores the error we trigger from some curses # versions by trying to write into the lowest-rightmost spot # in the window. try: self.win.addch(ch) except curses.error: pass elif ch == ascii.SOH: # ^a self.win.move(y, 0) elif ch in (ascii.STX,curses.KEY_LEFT, ascii.BS,curses.KEY_BACKSPACE): if x > 0: self.win.move(y, x-1) elif y == 0: pass elif self.stripspaces: self.win.move(y-1, self._end_of_line(y-1)) else: self.win.move(y-1, self.maxx) if ch in (ascii.BS, curses.KEY_BACKSPACE): self.win.delch() elif ch == ascii.EOT: # ^d self.win.delch() elif ch == ascii.ENQ: # ^e if self.stripspaces: self.win.move(y, self._end_of_line(y)) else: self.win.move(y, self.maxx) elif ch in (ascii.ACK, curses.KEY_RIGHT): # ^f if x < self.maxx: self.win.move(y, x+1) elif y == self.maxy: pass else: self.win.move(y+1, 0) elif ch == ascii.BEL: # ^g return 0 elif ch == ascii.NL: # ^j if self.maxy == 0: return 0 elif y < self.maxy: self.win.move(y+1, 0) elif ch == ascii.VT: # ^k if x == 0 and self._end_of_line(y) == 0: self.win.deleteln() else: # first undo the effect of self._end_of_line self.win.move(y, x) self.win.clrtoeol() elif ch == ascii.FF: # ^l self.win.refresh() elif ch in (ascii.SO, curses.KEY_DOWN): # ^n if y < self.maxy: self.win.move(y+1, x) if x > self._end_of_line(y+1): self.win.move(y+1, self._end_of_line(y+1)) elif ch == ascii.SI: # ^o self.win.insertln() elif ch in (ascii.DLE, curses.KEY_UP): # ^p if y > 0: self.win.move(y-1, x) if x > self._end_of_line(y-1): self.win.move(y-1, self._end_of_line(y-1)) return 1 | 50edc5079ee531362c050e928e4abf15ca91024d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/50edc5079ee531362c050e928e4abf15ca91024d/textpad.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
3076,
12,
2890,
16,
462,
4672,
315,
2227,
279,
2202,
15755,
1296,
1199,
261,
93,
16,
619,
13,
273,
365,
18,
8082,
18,
588,
93,
92,
1435,
365,
18,
2722,
4172,
273,
462,
309,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
3076,
12,
2890,
16,
462,
4672,
315,
2227,
279,
2202,
15755,
1296,
1199,
261,
93,
16,
619,
13,
273,
365,
18,
8082,
18,
588,
93,
92,
1435,
365,
18,
2722,
4172,
273,
462,
309,
... |
global proxy_info | def setup(proxy={}, filename=None): if len(proxy) > 0: # build a new opener that uses a proxy requiring authorization proxy_support = urllib2.ProxyHandler({"http" : "http://%(user)s:%(pass)s@%(host)s:%(port)d" % proxy}) opener = urllib2.build_opener(proxy_support, urllib2.HTTPHandler) else: # Build a new opener without any proxy information. opener = urllib2.build_opener(urllib2.HTTPHandler) # install it urllib2.install_opener(opener) # read any url cache if os.path.exists(filename): f = file(filename, "r") url_dict = pickle.load(f) f.close() | 63d2c607181208bb43c4291430a0ecf9a583d380 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9857/63d2c607181208bb43c4291430a0ecf9a583d380/urlslurper.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
12,
5656,
28793,
1544,
33,
7036,
4672,
309,
562,
12,
5656,
13,
405,
374,
30,
468,
1361,
279,
394,
20532,
716,
4692,
279,
2889,
29468,
6093,
2889,
67,
13261,
273,
11527,
22,
18,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
12,
5656,
28793,
1544,
33,
7036,
4672,
309,
562,
12,
5656,
13,
405,
374,
30,
468,
1361,
279,
394,
20532,
716,
4692,
279,
2889,
29468,
6093,
2889,
67,
13261,
273,
11527,
22,
18,
3... | |
self.roichanged_id=None | self.roichanged_id = None | def close(self,*args): if self.roichanged_id is not None: self.app.toolbar.roi_tool.disconnect(self.roichanged_id) self.roichanged_id=None | 18bebfddf000a5af98d1ab83e4246e700756e2a4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11090/18bebfddf000a5af98d1ab83e4246e700756e2a4/Tool_Export.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
12,
2890,
16,
14,
1968,
4672,
309,
365,
18,
303,
1354,
2330,
67,
350,
353,
486,
599,
30,
365,
18,
2910,
18,
18849,
18,
303,
77,
67,
6738,
18,
20177,
12,
2890,
18,
303,
1354,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1746,
12,
2890,
16,
14,
1968,
4672,
309,
365,
18,
303,
1354,
2330,
67,
350,
353,
486,
599,
30,
365,
18,
2910,
18,
18849,
18,
303,
77,
67,
6738,
18,
20177,
12,
2890,
18,
303,
1354,
... |
if not hasattr( torrents, '__iter__' ): | if not hasattr( torrents, '__iter__' ) or isinstance( torrents, str ): | def _get_hashes( self, torrents ): if not hasattr( torrents, '__iter__' ): torrents = ( torrents, ) out = [] for t in torrents: if isinstance( t, self._TorrentClass ): out.append( t.hash ) elif isinstance( t, str ): out.append( t ) else: raise uTorrentError( 'Hash designation only supported via Torrent class or string' ) return { 'hash' : out } | c101628da93ccb6ed8a2544aff0bf142189a91cf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14855/c101628da93ccb6ed8a2544aff0bf142189a91cf/utorrentctl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
17612,
12,
365,
16,
17351,
87,
262,
30,
309,
486,
3859,
12,
17351,
87,
16,
4940,
2165,
7250,
262,
578,
1549,
12,
17351,
87,
16,
609,
262,
30,
17351,
87,
273,
261,
17351... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
17612,
12,
365,
16,
17351,
87,
262,
30,
309,
486,
3859,
12,
17351,
87,
16,
4940,
2165,
7250,
262,
578,
1549,
12,
17351,
87,
16,
609,
262,
30,
17351,
87,
273,
261,
17351... |
sRadius = abs((self.portPos - self.starboardPos)[0] / 2.0) | def setupCollisions(self): if self.pusher: return """ Set up the collision sphere """ # This is a sphere on the ground to detect barrier collisions | 11781707991b52e32b24d0ea9a6fbf496e80c54c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7242/11781707991b52e32b24d0ea9a6fbf496e80c54c/ShipPilot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
13535,
12682,
12,
2890,
4672,
309,
365,
18,
6206,
264,
30,
327,
3536,
1000,
731,
326,
17740,
20041,
3536,
468,
1220,
353,
279,
20041,
603,
326,
19209,
358,
5966,
24651,
27953,
2,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
13535,
12682,
12,
2890,
4672,
309,
365,
18,
6206,
264,
30,
327,
3536,
1000,
731,
326,
17740,
20041,
3536,
468,
1220,
353,
279,
20041,
603,
326,
19209,
358,
5966,
24651,
27953,
2,
-... | |
Column('user_id', Integer, Sequence('user1_id_seq'), primary_key=True), | Column('user_id', Integer, Sequence('user1_id_seq', optional=True), primary_key=True), | def setUpAll(self): global user1, user2, address1, address2, metadata, ctx metadata = MetaData(testbase.db) ctx = SessionContext(create_session) user1 = Table('user1', metadata, Column('user_id', Integer, Sequence('user1_id_seq'), primary_key=True), Column('name', String(60), nullable=False) ) user2 = Table('user2', metadata, Column('user_id', Integer, Sequence('user2_id_seq'), primary_key=True), Column('name', String(60), nullable=False) ) address1 = Table('address1', metadata, Column('address_id', Integer, Sequence('address1_id_seq'), primary_key=True), Column('user_id', Integer, ForeignKey(user1.c.user_id), nullable=False), Column('email', String(100), nullable=False) ) address2 = Table('address2', metadata, Column('address_id', Integer, Sequence('address2_id_seq'), primary_key=True), Column('user_id', Integer, ForeignKey(user2.c.user_id), nullable=False), Column('email', String(100), nullable=False) ) metadata.create_all() | 9db4d1f8f547ac436991e2be40e00c5feee0ac20 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1074/9db4d1f8f547ac436991e2be40e00c5feee0ac20/entity.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
1595,
12,
2890,
4672,
2552,
729,
21,
16,
729,
22,
16,
1758,
21,
16,
1758,
22,
16,
1982,
16,
1103,
1982,
273,
27512,
12,
3813,
1969,
18,
1966,
13,
1103,
273,
3877,
1042,
12,
26... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
1595,
12,
2890,
4672,
2552,
729,
21,
16,
729,
22,
16,
1758,
21,
16,
1758,
22,
16,
1982,
16,
1103,
1982,
273,
27512,
12,
3813,
1969,
18,
1966,
13,
1103,
273,
3877,
1042,
12,
26... |
-46 : { "name": 'Ash Wednesday', "colour":'purple', "prec":7 }, | -46 : { "name": 'Ash Wednesday', "colour":'purple', "prec":7 }, | def adventSunday(y): christmas = QDate(y, 12, 25) day = christmas.dayOfWeek() % 7 return christmas.addDays(-day).addDays(-4*7) | 8d0a242ab6c0f712dfc57059da50483717388795 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13197/8d0a242ab6c0f712dfc57059da50483717388795/calendar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1261,
616,
55,
25649,
12,
93,
4672,
4513,
376,
15260,
273,
2238,
1626,
12,
93,
16,
2593,
16,
6969,
13,
2548,
273,
4513,
376,
15260,
18,
2881,
12250,
1435,
738,
2371,
327,
4513,
376,
15... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1261,
616,
55,
25649,
12,
93,
4672,
4513,
376,
15260,
273,
2238,
1626,
12,
93,
16,
2593,
16,
6969,
13,
2548,
273,
4513,
376,
15260,
18,
2881,
12250,
1435,
738,
2371,
327,
4513,
376,
15... |
while o < len(data)-10: name, size, flags = unpack('>4sLH', data[o:o+10]) | while o < len(data) - 10: part = data[o:o + 10] if part == EMPTY: bpioff = -((len(data) - o) % 10) break name, size, flags = unpack('>4sLH', part) | def __determine_bpi(self, data, frames): if self.version < (2,4,0): return int # have to special case whether to use bitpaddedints here # spec says to use them, but iTunes has it wrong | 26991618fd7a29f803f9850c6bbbafd6fe6cb6f2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1845/26991618fd7a29f803f9850c6bbbafd6fe6cb6f2/id3.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
24661,
67,
70,
7259,
12,
2890,
16,
501,
16,
7793,
4672,
309,
365,
18,
1589,
411,
261,
22,
16,
24,
16,
20,
4672,
327,
509,
468,
1240,
358,
4582,
648,
2856,
358,
999,
2831,
6982,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
24661,
67,
70,
7259,
12,
2890,
16,
501,
16,
7793,
4672,
309,
365,
18,
1589,
411,
261,
22,
16,
24,
16,
20,
4672,
327,
509,
468,
1240,
358,
4582,
648,
2856,
358,
999,
2831,
6982,... |
self.log.error('Fail to get Number of Waiting pilots',result['Message']) | self.log.error( 'Fail to get Number of Waiting pilots', result['Message'] ) | def execute(self): """Main Agent code: 1.- Query TaskQueueDB for existing TQs 2.- Add their Priorities 3.- Submit pilots """ | 2167c40fe092d0205e599c452b700e4f2aaec45c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/2167c40fe092d0205e599c452b700e4f2aaec45c/TaskQueueDirector.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
4672,
3536,
6376,
8669,
981,
30,
404,
18,
17,
2770,
3837,
3183,
2290,
364,
2062,
399,
53,
87,
576,
18,
17,
1436,
3675,
30326,
1961,
890,
18,
17,
17320,
24970,
6968,
353... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
4672,
3536,
6376,
8669,
981,
30,
404,
18,
17,
2770,
3837,
3183,
2290,
364,
2062,
399,
53,
87,
576,
18,
17,
1436,
3675,
30326,
1961,
890,
18,
17,
17320,
24970,
6968,
353... |
msg = fmt % (self.parsed_uri,) openid_url = self.query.get('openid_url') return self.render(msg, 'error', openid_url, status='404 Not Found') def render(self, message=None, css_class='alert', form_contents=None, | msg = fmt % (request['parsed_uri'],) openid_url = request['query'].get('openid_url') return self.render(request, msg, 'error', openid_url, status='404 Not Found') def render(self, request, message=None, css_class='alert', form_contents=None, | def not_found(self): """Render a page with a 404 return code and a message.""" fmt = 'The path <q>%s</q> was not understood by this server.' msg = fmt % (self.parsed_uri,) openid_url = self.query.get('openid_url') return self.render(msg, 'error', openid_url, status='404 Not Found') | 3613973e0dba8bc750646a30918b4dc7828ea1b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3613973e0dba8bc750646a30918b4dc7828ea1b1/open_id.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
486,
67,
7015,
12,
2890,
4672,
3536,
3420,
279,
1363,
598,
279,
7709,
327,
981,
471,
279,
883,
12123,
1325,
273,
296,
1986,
589,
411,
85,
9822,
87,
1757,
85,
34,
1703,
486,
31727,
4773... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
486,
67,
7015,
12,
2890,
4672,
3536,
3420,
279,
1363,
598,
279,
7709,
327,
981,
471,
279,
883,
12123,
1325,
273,
296,
1986,
589,
411,
85,
9822,
87,
1757,
85,
34,
1703,
486,
31727,
4773... |
date = email.Utils.parsedate(self.getDate()) | date = email.Utils.parsedate(self.date) | def getPath(self): """Return the message's index name""" | e4fc328b2ad5db6985e54b3de1089e0f6fe35706 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/e4fc328b2ad5db6985e54b3de1089e0f6fe35706/message.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4339,
12,
2890,
4672,
3536,
990,
326,
883,
1807,
770,
508,
8395,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
4339,
12,
2890,
4672,
3536,
990,
326,
883,
1807,
770,
508,
8395,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
infoDict["status"] = self.StatusByValueDict[status_id[0]] | infoDict["ticketStatus"] = self.StatusByValueDict[status_id[0]] | def getRequests(self): requests = [] if self.isLoggedIn: self.selectQueryForm() self.createValueDicts() self.br.select_form(name="bug_form") response = self.br.submit() | f494c553772420aaee1480d55c3c1d2bab6bcc05 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8887/f494c553772420aaee1480d55c3c1d2bab6bcc05/RequestQuery.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4328,
87,
12,
2890,
4672,
3285,
273,
5378,
225,
309,
365,
18,
291,
29327,
30,
365,
18,
4025,
1138,
1204,
1435,
365,
18,
2640,
620,
5014,
87,
1435,
225,
365,
18,
2848,
18,
4025,
67,
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,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4328,
87,
12,
2890,
4672,
3285,
273,
5378,
225,
309,
365,
18,
291,
29327,
30,
365,
18,
4025,
1138,
1204,
1435,
365,
18,
2640,
620,
5014,
87,
1435,
225,
365,
18,
2848,
18,
4025,
67,
6... |
return('userdata'); | return('userdata') | def type_convert(str, name, info, module, function, pos): | 094dd86c130f3ffb7ec9bc47bb0ed711e0f68994 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12659/094dd86c130f3ffb7ec9bc47bb0ed711e0f68994/gentest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
618,
67,
6283,
12,
701,
16,
508,
16,
1123,
16,
1605,
16,
445,
16,
949,
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,
... | [
1,
1,
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,
618,
67,
6283,
12,
701,
16,
508,
16,
1123,
16,
1605,
16,
445,
16,
949,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
results = lapack_routine('V', UPLO, n, a, n, w, work, -1, | results = lapack_routine(_V, UPLO, n, a, n, w, work, -1, | def eigh(a, UPLO='L'): """ Return the eigenvalues and eigenvectors of a Hermitian or symmetric matrix. Returns two objects, a 1-D array containing the eigenvalues of `a`, and a 2-D square array or matrix (depending on the input type) of the corresponding eigenvectors (in columns). Parameters ---------- a : array_like, shape (M, M) A complex Hermitian or real symmetric matrix. UPLO : {'L', 'U'}, optional Specifies whether the calculation is done with the lower triangular part of `a` ('L', default) or the upper triangular part ('U'). Returns ------- w : ndarray, shape (M,) The eigenvalues, not necessarily ordered. v : ndarray, or matrix object if `a` is, shape (M, M) The column ``v[:, i]`` is the normalized eigenvector corresponding to the eigenvalue ``w[i]``. Raises ------ LinAlgError If the eigenvalue computation does not converge. See Also -------- eigvalsh : eigenvalues of symmetric or Hermitian arrays. eig : eigenvalues and right eigenvectors for non-symmetric arrays. eigvals : eigenvalues of non-symmetric arrays. Notes ----- This is a simple interface to the LAPACK routines dsyevd and zheevd, which compute the eigenvalues and eigenvectors of real symmetric and complex Hermitian arrays, respectively. The eigenvalues of real symmetric or complex Hermitian matrices are always real. [1]_ The array `v` of (column) eigenvectors is unitary and `a`, `w`, and `v` satisfy the equations ``dot(a, v[:, i]) = w[i] * v[:, i]``. References ---------- .. [1] G. Strang, *Linear Algebra and Its Applications*, 2nd Ed., Orlando, FL, Academic Press, Inc., 1980, pg. 222. Examples -------- >>> from numpy import linalg as LA >>> a = np.array([[1, -2j], [2j, 5]]) >>> a array([[ 1.+0.j, 0.-2.j], [ 0.+2.j, 5.+0.j]]) >>> w, v = LA.eigh(a) >>> w; v array([ 0.17157288, 5.82842712]) array([[-0.92387953+0.j , -0.38268343+0.j ], [ 0.00000000+0.38268343j, 0.00000000-0.92387953j]]) >>> np.dot(a, v[:, 0]) - w[0] * v[:, 0] # verify 1st e-val/vec pair array([2.77555756e-17 + 0.j, 0. + 1.38777878e-16j]) >>> np.dot(a, v[:, 1]) - w[1] * v[:, 1] # verify 2nd e-val/vec pair array([ 0.+0.j, 0.+0.j]) >>> A = np.matrix(a) # what happens if input is a matrix object >>> A matrix([[ 1.+0.j, 0.-2.j], [ 0.+2.j, 5.+0.j]]) >>> w, v = LA.eigh(A) >>> w; v array([ 0.17157288, 5.82842712]) matrix([[-0.92387953+0.j , -0.38268343+0.j ], [ 0.00000000+0.38268343j, 0.00000000-0.92387953j]]) """ a, wrap = _makearray(a) _assertRank2(a) _assertSquareness(a) t, result_t = _commonType(a) real_t = _linalgRealType(t) a = _fastCopyAndTranspose(t, a) n = a.shape[0] liwork = 5*n+3 iwork = zeros((liwork,), fortran_int) if isComplexType(t): lapack_routine = lapack_lite.zheevd w = zeros((n,), real_t) lwork = 1 work = zeros((lwork,), t) lrwork = 1 rwork = zeros((lrwork,), real_t) results = lapack_routine('V', UPLO, n, a, n, w, work, -1, rwork, -1, iwork, liwork, 0) lwork = int(abs(work[0])) work = zeros((lwork,), t) lrwork = int(rwork[0]) rwork = zeros((lrwork,), real_t) results = lapack_routine('V', UPLO, n, a, n, w, work, lwork, rwork, lrwork, iwork, liwork, 0) else: lapack_routine = lapack_lite.dsyevd w = zeros((n,), t) lwork = 1 work = zeros((lwork,), t) results = lapack_routine('V', UPLO, n, a, n, w, work, -1, iwork, liwork, 0) lwork = int(work[0]) work = zeros((lwork,), t) results = lapack_routine('V', UPLO, n, a, n, w, work, lwork, iwork, liwork, 0) if results['info'] > 0: raise LinAlgError, 'Eigenvalues did not converge' at = a.transpose().astype(result_t) return w.astype(_realType(result_t)), wrap(at) | f8012ce42ee9ce709d2f4044e74e61d5d292b3cd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14925/f8012ce42ee9ce709d2f4044e74e61d5d292b3cd/linalg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
425,
2031,
12,
69,
16,
7376,
1502,
2218,
48,
11,
4672,
3536,
2000,
326,
29831,
471,
11043,
29098,
434,
279,
670,
1035,
305,
2779,
578,
15108,
3148,
18,
225,
2860,
2795,
2184,
16,
279,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
425,
2031,
12,
69,
16,
7376,
1502,
2218,
48,
11,
4672,
3536,
2000,
326,
29831,
471,
11043,
29098,
434,
279,
670,
1035,
305,
2779,
578,
15108,
3148,
18,
225,
2860,
2795,
2184,
16,
279,
... |
si = synchronization_index vector_strength = synchronization_index vs = synchronization_index | calc_si = calc_synchronization_index calc_vector_strength = calc_synchronization_index calc_vs = calc_synchronization_index | def synchronization_index(Fstim, spike_trains): """ Calculate Synchronization Index. Fstim: stimulus frequency in Hz spike_trains: list of arrays of spiking times min_max: range for SI calculation return: synchronization index >>> fs = 36000.0 >>> Fstim = 100.0 >>> test0 = [np.arange(0, 0.1, 1/fs)*1000, np.arange(0, 0.1, 1/fs)*1000] >>> si0 = synchronization_index(Fstim, test0) >>> si0 < 1e-4 # numerical errors True >>> test1 = [np.zeros(fs)] >>> si1 = synchronization_index(Fstim, test1) >>> si1 == 1 True """ Fstim = Fstim / 1000 # Hz -> kHz; s -> ms if len(spike_trains) == 0: return 0 all_spikes = np.concatenate(tuple(spike_trains)) if len(all_spikes) == 0: return 0 all_spikes = all_spikes - all_spikes.min() folded = np.fmod(all_spikes, 1/Fstim) ph = np.histogram(folded, bins=180)[0] # indexing trick is necessary, because the sample at 2*pi belongs # to the next cycle x = np.cos(np.linspace(0, 2*np.pi, len(ph)+1))[0:-1] y = np.sin(np.linspace(0, 2*np.pi, len(ph)+1))[0:-1] xsum2 = (np.sum(x*ph))**2 ysum2 = (np.sum(y*ph))**2 r = np.sqrt(xsum2 + ysum2) / np.sum(ph) return r | 1407da21fff05aaaab170d93e79e5d335e125ea7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7039/1407da21fff05aaaab170d93e79e5d335e125ea7/_thorns.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24488,
67,
1615,
12,
42,
334,
381,
16,
28883,
67,
313,
4167,
4672,
3536,
9029,
26535,
1588,
3340,
18,
225,
478,
334,
381,
30,
25542,
17284,
8670,
316,
670,
94,
28883,
67,
313,
4167,
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,
24488,
67,
1615,
12,
42,
334,
381,
16,
28883,
67,
313,
4167,
4672,
3536,
9029,
26535,
1588,
3340,
18,
225,
478,
334,
381,
30,
25542,
17284,
8670,
316,
670,
94,
28883,
67,
313,
4167,
30... |
def read(self, cr, user, ids, fields_to_read=None, context=None, load='_classic_read'): | def read(self, cr, user, ids, fields_to_read=None, context=None, load='_classic_read'): | def read(self, cr, user, ids, fields_to_read=None, context=None, load='_classic_read'): if not context: context = {} if not fields_to_read: fields_to_read = self._columns.keys() result = [] if self.datas: ids_orig = ids if isinstance(ids, (int, long)): ids = [ids] for id in ids: r = {'id': id} for f in fields_to_read: if id in self.datas: r[f] = self.datas[id].get(f, False) if r[f] and isinstance(self._columns[f], fields.binary) and context.get('bin_size', False): r[f] = len(r[f]) result.append(r) if id in self.datas: self.datas[id]['internal.date_access'] = time.time() fields_post = filter(lambda x: x in self._columns and not getattr(self._columns[x], load), fields_to_read) for f in fields_post: res2 = self._columns[f].get_memory(cr, self, ids, f, user, context=context, values=result) for record in result: record[f] = res2[record['id']] if isinstance(ids_orig, (int, long)): return result[0] return result | 19c6bf3cbf9c418ef8f4c3664582e8a20fbf6749 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/19c6bf3cbf9c418ef8f4c3664582e8a20fbf6749/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
12,
2890,
16,
4422,
16,
729,
16,
3258,
16,
1466,
67,
869,
67,
896,
33,
7036,
16,
819,
33,
7036,
16,
1262,
2218,
67,
1106,
335,
67,
896,
11,
4672,
309,
486,
819,
30,
819,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
12,
2890,
16,
4422,
16,
729,
16,
3258,
16,
1466,
67,
869,
67,
896,
33,
7036,
16,
819,
33,
7036,
16,
1262,
2218,
67,
1106,
335,
67,
896,
11,
4672,
309,
486,
819,
30,
819,
273,
... |
"""Returns the md5 hash of a string.""" hash = hashlib.md5() hash.update(_string(text)) return hash.hexdigest() | """Returns the md5 hash of a string.""" h = hashlib.md5() h.update(_string(text)) return h.hexdigest() | def md5(text): """Returns the md5 hash of a string.""" hash = hashlib.md5() hash.update(_string(text)) return hash.hexdigest() | 312230e30b9a32836e57d3014b7461a466a3dbed /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9926/312230e30b9a32836e57d3014b7461a466a3dbed/pylast.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3481,
25,
12,
955,
4672,
3536,
1356,
326,
3481,
25,
1651,
434,
279,
533,
12123,
225,
366,
273,
15956,
18,
1264,
25,
1435,
366,
18,
2725,
24899,
1080,
12,
955,
3719,
225,
327,
366,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3481,
25,
12,
955,
4672,
3536,
1356,
326,
3481,
25,
1651,
434,
279,
533,
12123,
225,
366,
273,
15956,
18,
1264,
25,
1435,
366,
18,
2725,
24899,
1080,
12,
955,
3719,
225,
327,
366,
18,
... |
except (ValueError,AssertionError),e: | except (ValueError,AssertionError,KeyError),e: | def setBGFreq(self,arglist=None): "Arguments: A C G T|bgSampleSequence\nBackground nucleotide frequencies. Removes markov background." if (not arglist==None): try: if len(arglist)==4: tot=reduce(lambda x,y:float(x)+float(y),arglist,0.0)*1.0 self.A,self.C,self.G,self.T=map(lambda x:float(x)/tot,arglist) elif len(arglist)==1: seq=self.seq.sequence(arglist[0]).getvalue() self.A,self.C,self.G,self.T=[seq.count(x) for x in "ACGT"] tot=float(self.A+self.C+self.G+self.T) self.A,self.C,self.G,self.T=self.A/tot,self.C/tot,self.G/tot,self.T/tot else: assert(1==0) except (ValueError,AssertionError),e: raise CommandError("Invalid parameters as background frequencies.\nBackground distribution not set.",e) | 8432e103f3c6074a42b1af1738c592acde9c81a4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11674/8432e103f3c6074a42b1af1738c592acde9c81a4/Interface.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15268,
43,
14485,
12,
2890,
16,
3175,
1098,
33,
7036,
4672,
315,
4628,
30,
432,
385,
611,
399,
96,
12370,
8504,
4021,
64,
82,
8199,
9244,
23165,
18138,
18,
20284,
2267,
1527,
5412,
1199,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15268,
43,
14485,
12,
2890,
16,
3175,
1098,
33,
7036,
4672,
315,
4628,
30,
432,
385,
611,
399,
96,
12370,
8504,
4021,
64,
82,
8199,
9244,
23165,
18138,
18,
20284,
2267,
1527,
5412,
1199,... |
def __setitem__(self, key, value): | def add(self, key): | def __setitem__(self, key, value): if self.map.has_key(key): self.keys[self.map[key]] = value else: self.keys.append(key) self.map[key] = len(self.keys) - 1 | 99ef8dc45ac95cf0f7340c6550585958fa21eeac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/99ef8dc45ac95cf0f7340c6550585958fa21eeac/rowjournal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
12,
2890,
16,
498,
4672,
309,
365,
18,
1458,
18,
5332,
67,
856,
12,
856,
4672,
365,
18,
2452,
63,
2890,
18,
1458,
63,
856,
13563,
273,
460,
469,
30,
365,
18,
2452,
18,
6923,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
12,
2890,
16,
498,
4672,
309,
365,
18,
1458,
18,
5332,
67,
856,
12,
856,
4672,
365,
18,
2452,
63,
2890,
18,
1458,
63,
856,
13563,
273,
460,
469,
30,
365,
18,
2452,
18,
6923,
1... |
pid = os.spawnv(os.P_NOWAIT, self.binaryFinder(cmd), cmdLine) | pid = self.resistErrno513(os.P_NOWAIT, self.binaryFinder(cmd), cmdLine) | def launch(self, cmd): self.tokenLock.acquire() self.token += 1 token = self.token self.tokenLock.release() # make sure our inputs are ready missing = filter(lambda f: not self.filemap.existsForRead(f), cmd.inputs) self._fetchLogicals(missing, cmd.inputSrcs) # doublecheck that remaining logicals are available. self._verifyLogicals(set(cmd.inputs).difference(missing)) cmdLine = cmd.makeCommandLine(self.filemap.mapReadFile, self.filemap.mapWriteFile) log.debug("-exec-> %s"% " ".join(cmdLine)) # make sure there's room to write the output self.clearFiles(map(lambda t: t[1], cmd.actualOutputs)) pid = os.spawnv(os.P_NOWAIT, self.binaryFinder(cmd), cmdLine) log.debug("child pid: "+str(pid)) | 8eac62fba42c57a2e2bd315961da837c0339d598 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5203/8eac62fba42c57a2e2bd315961da837c0339d598/swamp_common.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8037,
12,
2890,
16,
1797,
4672,
365,
18,
2316,
2531,
18,
1077,
1039,
1435,
365,
18,
2316,
1011,
404,
1147,
273,
365,
18,
2316,
365,
18,
2316,
2531,
18,
9340,
1435,
468,
1221,
3071,
313... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8037,
12,
2890,
16,
1797,
4672,
365,
18,
2316,
2531,
18,
1077,
1039,
1435,
365,
18,
2316,
1011,
404,
1147,
273,
365,
18,
2316,
365,
18,
2316,
2531,
18,
9340,
1435,
468,
1221,
3071,
313... |
"""search engine washing of URL arguments""" | """search engine - washing of URL arguments""" | def test_wash_url_argument(self): """search engine washing of URL arguments""" self.assertEqual(1, search_engine.wash_url_argument(['1'],'int')) self.assertEqual("1", search_engine.wash_url_argument(['1'],'str')) self.assertEqual(['1'], search_engine.wash_url_argument(['1'],'list')) self.assertEqual(0, search_engine.wash_url_argument('ellis','int')) self.assertEqual("ellis", search_engine.wash_url_argument('ellis','str')) self.assertEqual(["ellis"], search_engine.wash_url_argument('ellis','list')) self.assertEqual(0, search_engine.wash_url_argument(['ellis'],'int')) self.assertEqual("ellis", search_engine.wash_url_argument(['ellis'],'str')) self.assertEqual(["ellis"], search_engine.wash_url_argument(['ellis'],'list')) | 373c3cf8222840ef319c6b6642892be55f56dbdd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/373c3cf8222840ef319c6b6642892be55f56dbdd/search_engine_tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
91,
961,
67,
718,
67,
3446,
12,
2890,
4672,
3536,
3072,
4073,
300,
341,
961,
310,
434,
1976,
1775,
8395,
365,
18,
11231,
5812,
12,
21,
16,
1623,
67,
8944,
18,
91,
961,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
91,
961,
67,
718,
67,
3446,
12,
2890,
4672,
3536,
3072,
4073,
300,
341,
961,
310,
434,
1976,
1775,
8395,
365,
18,
11231,
5812,
12,
21,
16,
1623,
67,
8944,
18,
91,
961,
67,
... |
return cmp(_rl_accel_dir_info(b),__rl_accel_dir_info(a)) | return cmp(_rl_accel_dir_info(b),_rl_accel_dir_info(a)) | def _cmp_rl_accel_dirs(a,b): return cmp(_rl_accel_dir_info(b),__rl_accel_dir_info(a)) | 51ebc39da3d313de76d2c9beda5f348d71f3dde0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/51ebc39da3d313de76d2c9beda5f348d71f3dde0/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9625,
67,
1321,
67,
30737,
67,
8291,
12,
69,
16,
70,
4672,
327,
9411,
24899,
1321,
67,
30737,
67,
1214,
67,
1376,
12,
70,
3631,
67,
1321,
67,
30737,
67,
1214,
67,
1376,
12,
69,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9625,
67,
1321,
67,
30737,
67,
8291,
12,
69,
16,
70,
4672,
327,
9411,
24899,
1321,
67,
30737,
67,
1214,
67,
1376,
12,
70,
3631,
67,
1321,
67,
30737,
67,
1214,
67,
1376,
12,
69,
... |
el1 = etree.SubElement(root, 'meta:editing-duration') | el1 = SubElement(root, 'meta:editing-duration') | def create_meta(self): root = etree.Element('office:document-meta', attrib=META_NAMESPACE_DICT) doc = etree.ElementTree(root) root = etree.SubElement(root, 'office:meta') el1 = etree.SubElement(root, 'meta:generator') el1.text = 'Docutils/rst2odf.py/%s' % (VERSION, ) s1 = os.environ.get('USER', '') el1 = etree.SubElement(root, 'meta:initial-creator') el1.text = s1 s2 = time.strftime('%Y-%m-%dT%H:%M:%S', time.localtime()) el1 = etree.SubElement(root, 'meta:creation-date') el1.text = s2 el1 = etree.SubElement(root, 'dc:creator') el1.text = s1 el1 = etree.SubElement(root, 'dc:date') el1.text = s2 el1 = etree.SubElement(root, 'dc:language') el1.text = 'en-US' el1 = etree.SubElement(root, 'meta:editing-cycles') el1.text = '1' el1 = etree.SubElement(root, 'meta:editing-duration') el1.text = 'PT00M01S' title = self.visitor.get_title() el1 = etree.SubElement(root, 'dc:title') if title: el1.text = title else: el1.text = '[no title]' s1 = etree.tostring(doc) #doc = minidom.parseString(s1) #s1 = doc.toprettyxml(' ') return s1 | 57ceb741b8ea9b94d9b9e314a03912d12bd3c5c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1278/57ceb741b8ea9b94d9b9e314a03912d12bd3c5c5/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
3901,
12,
2890,
4672,
1365,
273,
12031,
18,
1046,
2668,
19789,
30,
5457,
17,
3901,
2187,
5885,
33,
19294,
67,
11368,
67,
31456,
13,
997,
273,
12031,
18,
1046,
2471,
12,
3085,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
3901,
12,
2890,
4672,
1365,
273,
12031,
18,
1046,
2668,
19789,
30,
5457,
17,
3901,
2187,
5885,
33,
19294,
67,
11368,
67,
31456,
13,
997,
273,
12031,
18,
1046,
2471,
12,
3085,
... |
import copy | def TestSpamFilter(driver): nspam = driver.manager.bayes.nspam nham = driver.manager.bayes.nham import copy original_bayes = copy.copy(driver.manager.bayes) # Create a spam message in the Inbox - it should get immediately filtered msg = driver.CreateTestMessageInFolder(SPAM, driver.folder_watch) # sleep to ensure filtering. WaitForFilters() # It should no longer be in the Inbox. if driver.FindTestMessage(driver.folder_watch) is not None: TestFailed("The test message appeared to not be filtered") # It should be in the "sure is spam" folder. spam_msg = driver.FindTestMessage(driver.folder_spam) if spam_msg is None: TestFailed("The test message vanished from the Inbox, but didn't appear in Spam") # Check that none of the above caused training. if nspam != driver.manager.bayes.nspam: TestFailed("Something caused a new spam message to appear") if nham != driver.manager.bayes.nham: TestFailed("Something caused a new ham message to appear") # Now move the message back to the inbox - it should get trained. store_msg = driver.manager.message_store.GetMessage(spam_msg) import train if train.been_trained_as_ham(store_msg, driver.manager): TestFailed("This new spam message should not have been trained as ham yet") if train.been_trained_as_spam(store_msg, driver.manager): TestFailed("This new spam message should not have been trained as spam yet") spam_msg.Move(driver.folder_watch) WaitForFilters() spam_msg = driver.FindTestMessage(driver.folder_watch) store_msg = driver.manager.message_store.GetMessage(spam_msg) need_untrain = True try: if nspam != driver.manager.bayes.nspam: TestFailed("There were not the same number of spam messages after a re-train") if nham+1 != driver.manager.bayes.nham: TestFailed("There was not one more ham messages after a re-train") if train.been_trained_as_spam(store_msg, driver.manager): TestFailed("This new spam message should not have been trained as spam yet") if not train.been_trained_as_ham(store_msg, driver.manager): TestFailed("This new spam message should have been trained as ham now") # Now move it back to the Spam folder. # This should see the message un-trained as ham, and re-trained as Spam spam_msg.Move(driver.folder_spam) WaitForFilters() spam_msg = driver.FindTestMessage(driver.folder_spam) if spam_msg is None: TestFailed("Could not find the message in the Spam folder") store_msg = driver.manager.message_store.GetMessage(spam_msg) if nspam +1 != driver.manager.bayes.nspam: TestFailed("There should be one more spam now") if nham != driver.manager.bayes.nham: TestFailed("There should be the same number of hams again") if not train.been_trained_as_spam(store_msg, driver.manager): TestFailed("This new spam message should have been trained as spam by now") if train.been_trained_as_ham(store_msg, driver.manager): TestFailed("This new spam message should have been un-trained as ham") # Move the message to another folder, and make sure we still # identify it correctly as having been trained. # Move to the "unsure" folder, just cos we know about it, and # we know that no special watching of this folder exists. spam_msg.Move(driver.folder_unsure) spam_msg = driver.FindTestMessage(driver.folder_unsure) if spam_msg is None: TestFailed("Could not find the message in the Unsure folder") store_msg = driver.manager.message_store.GetMessage(spam_msg) if not train.been_trained_as_spam(store_msg, driver.manager): TestFailed("Message was not identified as Spam after moving") # Now undo the damage we did. was_spam = train.untrain_message(store_msg, driver.manager) if not was_spam: TestFailed("Untraining this message did not indicate it was spam") if train.been_trained_as_spam(store_msg, driver.manager) or \ train.been_trained_as_ham(store_msg, driver.manager): TestFailed("Untraining this message kept it has ham/spam") need_untrain = False finally: if need_untrain: train.untrain_message(store_msg, driver.manager) # Check all the counts are back where we started. if nspam != driver.manager.bayes.nspam: TestFailed("Spam count didn't get back to the same") if nham != driver.manager.bayes.nham: TestFailed("Ham count didn't get back to the same") if driver.manager.bayes.wordinfo != original_bayes.wordinfo: TestFailed("The bayes object's 'wordinfo' did not compare the same at the end of all this!") if driver.manager.bayes.probcache != original_bayes.probcache: TestFailed("The bayes object's 'probcache' did not compare the same at the end of all this!") spam_msg.Delete() print "Created a Spam message, and saw it get filtered and trained." | 1906eaa7cce41636b5054be689664fc95342a8ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6126/1906eaa7cce41636b5054be689664fc95342a8ca/tester.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7766,
3389,
301,
1586,
12,
7407,
4672,
28390,
301,
273,
3419,
18,
4181,
18,
70,
528,
281,
18,
82,
1752,
301,
24043,
301,
273,
3419,
18,
4181,
18,
70,
528,
281,
18,
82,
31698,
2282,
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,
7766,
3389,
301,
1586,
12,
7407,
4672,
28390,
301,
273,
3419,
18,
4181,
18,
70,
528,
281,
18,
82,
1752,
301,
24043,
301,
273,
3419,
18,
4181,
18,
70,
528,
281,
18,
82,
31698,
2282,
6... | |
"params",GL_GET_SIZES, "pname", | "params",GL_GET_SIZES, "pname", | def addGLGetConstant( constant, arraySize ): """Add a glGet* constant to return an output array of correct size""" GL_GET_SIZES[ constant ] = arraySize | 779beb78d8242dd156d555119ccab07062fb4bf3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1545/779beb78d8242dd156d555119ccab07062fb4bf3/glget.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
11261,
967,
6902,
12,
5381,
16,
526,
1225,
262,
30,
3536,
986,
279,
5118,
967,
14,
5381,
358,
327,
392,
876,
526,
434,
3434,
963,
8395,
10252,
67,
3264,
67,
4574,
55,
63,
5381,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
527,
11261,
967,
6902,
12,
5381,
16,
526,
1225,
262,
30,
3536,
986,
279,
5118,
967,
14,
5381,
358,
327,
392,
876,
526,
434,
3434,
963,
8395,
10252,
67,
3264,
67,
4574,
55,
63,
5381,
... |
stdout_thread.setDaemon(True) | stdout_thread.set_daemon(True) | def _communicate(self, input): stdout = None # Return stderr = None # Return | 469b577cfa72a1c51ddf42f966e6247d2819cca3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/469b577cfa72a1c51ddf42f966e6247d2819cca3/subprocess.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5702,
318,
2659,
12,
2890,
16,
810,
4672,
3909,
273,
599,
468,
2000,
4514,
273,
599,
468,
2000,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5702,
318,
2659,
12,
2890,
16,
810,
4672,
3909,
273,
599,
468,
2000,
4514,
273,
599,
468,
2000,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
v = self.get(section, option) val = int(v) if val not in (0, 1): | states = {'1': 1, 'yes': 1, 'true': 1, 'on': 1, '0': 0, 'no': 0, 'false': 0, 'off': 0} v = self.get(section, option) if not states.has_key(v.lower()): | def getboolean(self, section, option): v = self.get(section, option) val = int(v) if val not in (0, 1): raise ValueError, 'Not a boolean: %s' % v return val | fb06f75c5ac24c720aaf8f221efff35543d878b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fb06f75c5ac24c720aaf8f221efff35543d878b6/ConfigParser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
6494,
12,
2890,
16,
2442,
16,
1456,
4672,
5493,
273,
13666,
21,
4278,
404,
16,
296,
9707,
4278,
404,
16,
296,
3767,
4278,
404,
16,
296,
265,
4278,
404,
16,
296,
20,
4278,
374,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
6494,
12,
2890,
16,
2442,
16,
1456,
4672,
5493,
273,
13666,
21,
4278,
404,
16,
296,
9707,
4278,
404,
16,
296,
3767,
4278,
404,
16,
296,
265,
4278,
404,
16,
296,
20,
4278,
374,
1... |
return sitem and self.nodeClassDict[sitem] | return sitem and self.nodeClassDict.get(sitem, None) | def findCurrentNode(self, exhaustively=0): sitem = self.v.selectedItem() if not sitem and (1 or exhaustively): sitem = self.v.currentItem() or (self.v.childCount() == 1 and self.v.firstChild()) if sitem.childCount(): return return sitem and self.nodeClassDict[sitem] | 90e55ebe6a26a881a462f6682bc6e81061492465 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6366/90e55ebe6a26a881a462f6682bc6e81061492465/OWITree.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
3935,
907,
12,
2890,
16,
19575,
641,
4492,
33,
20,
4672,
272,
1726,
273,
365,
18,
90,
18,
8109,
1180,
1435,
309,
486,
272,
1726,
471,
261,
21,
578,
19575,
641,
4492,
4672,
272,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
3935,
907,
12,
2890,
16,
19575,
641,
4492,
33,
20,
4672,
272,
1726,
273,
365,
18,
90,
18,
8109,
1180,
1435,
309,
486,
272,
1726,
471,
261,
21,
578,
19575,
641,
4492,
4672,
272,
... |
self.b(' TpProxyPendingCall *data = user_data;') self.b(' TpProxy *tpproxy;') | self.h('typedef void (*%s) (%sproxy,' % (callback_name, self.proxy_cls)) | 72581ce580a8b27fa2d8cb0130d532e58727327f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8150/72581ce580a8b27fa2d8cb0130d532e58727327f/glib-client-gen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
365,
18,
76,
2668,
723,
536,
918,
261,
14,
9,
87,
13,
6142,
87,
5656,
11189,
738,
261,
3394,
67,
529,
16,
365,
18,
5656,
67,
6429,
3719,
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,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
365,
18,
76,
2668,
723,
536,
918,
261,
14,
9,
87,
13,
6142,
87,
5656,
11189,
738,
261,
3394,
67,
529,
16,
365,
18,
5656,
67,
6429,
3719,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
if process.CommandLine.rindex('gears.dll') > 0: | if process.CommandLine.rfind('gears.dll') > 0: | def _DestroyOldSlaveProcesses(self): """ Check for and kill any existing gears slave processes. | 49022b6511b14d9bbb0999ecf8b38191bbe63684 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1918/49022b6511b14d9bbb0999ecf8b38191bbe63684/installer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
10740,
7617,
20302,
10599,
12,
2890,
4672,
3536,
2073,
364,
471,
8673,
1281,
2062,
30142,
87,
11735,
8488,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
10740,
7617,
20302,
10599,
12,
2890,
4672,
3536,
2073,
364,
471,
8673,
1281,
2062,
30142,
87,
11735,
8488,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
traceback.print_exc(file=sys.stdout) | pass | def h(self, data, **kwargs): self.send_response(kwargs.get('status', 200)) self.send_header('Content-Type', kwargs.get('type', 'application/x-dmap-tagged')) self.send_header('DAAP-Server', 'Simple') self.send_header('Expires', '-1') self.send_header('Cache-Control', 'no-cache') self.send_header('Accept-Ranges', 'bytes') self.send_header('Content-Language', 'en_us') if kwargs.has_key('extra_headers'): for k, v in kwargs['extra_headers'].iteritems(): self.send_header(k, v) try: if type(data) == file: self.send_header("Content-Length", str(os.stat(data.name).st_size)) else: self.send_header("Content-Length", len(data)) except: traceback.print_exc(file=sys.stdout) self.end_headers() try: if (hasattr(data, 'next')): for d in data: self.wfile.write(d) else: self.wfile.write(data) except socket.error, ex: if ex.errno in [errno.ECONNRESET]: return else: raise | 79840fc390d5d944230be4a575b431ac6686c105 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8691/79840fc390d5d944230be4a575b431ac6686c105/server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
366,
12,
2890,
16,
501,
16,
2826,
4333,
4672,
365,
18,
4661,
67,
2740,
12,
4333,
18,
588,
2668,
2327,
2187,
4044,
3719,
365,
18,
4661,
67,
3374,
2668,
1350,
17,
559,
2187,
1205,
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,
366,
12,
2890,
16,
501,
16,
2826,
4333,
4672,
365,
18,
4661,
67,
2740,
12,
4333,
18,
588,
2668,
2327,
2187,
4044,
3719,
365,
18,
4661,
67,
3374,
2668,
1350,
17,
559,
2187,
1205,
18,
... |
error_handler=log.err) | error_handler=d.errback) | def network_scan_cb(networks): home_network_found = False for network in networks: if network['operator-num'] == imsi[:5]: home_network_found = True break | 45c00959c14e666ef31b3f93137f14e6d66959e4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12036/45c00959c14e666ef31b3f93137f14e6d66959e4/test_dbus.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2483,
67,
9871,
67,
7358,
12,
19982,
4672,
6382,
67,
5185,
67,
7015,
273,
1083,
364,
2483,
316,
13884,
30,
309,
2483,
3292,
9497,
17,
2107,
3546,
422,
709,
7722,
10531,
25,
14542,
6382,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2483,
67,
9871,
67,
7358,
12,
19982,
4672,
6382,
67,
5185,
67,
7015,
273,
1083,
364,
2483,
316,
13884,
30,
309,
2483,
3292,
9497,
17,
2107,
3546,
422,
709,
7722,
10531,
25,
14542,
6382,
... |
self.check_sizeof(get_gen(), size(h + 'Pi2P')) | check(get_gen(), size(h + 'Pi2P')) | def get_gen(): yield 1 | 2a9c012d274c588c51bc5660baff9bd0676bd399 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/2a9c012d274c588c51bc5660baff9bd0676bd399/test_sys.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4507,
13332,
2824,
404,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4507,
13332,
2824,
404,
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,
-1... |
chdir('_build') version = make_version() pkgname = 'toto' print run(['cp', '-r', 'html', pkgname]) | def make_release(): # Make HTML & PDF make_html() chdir('_build') version = make_version() | 87cecf36c37b598e03bd4e1086e84602821df4d0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12681/87cecf36c37b598e03bd4e1086e84602821df4d0/ipkg-docs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
9340,
13332,
468,
4344,
3982,
473,
12667,
1221,
67,
2620,
1435,
225,
14029,
2668,
67,
3510,
6134,
1177,
273,
1221,
67,
1589,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
9340,
13332,
468,
4344,
3982,
473,
12667,
1221,
67,
2620,
1435,
225,
14029,
2668,
67,
3510,
6134,
1177,
273,
1221,
67,
1589,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
conf.width, conf.height = self.GetClientSize() | if wx.Platform == '__WXMAC__': conf.width, conf.height = self.GetClientSize() else: conf.width, conf.height = self.GetSize() | def OnCloseWindow(self, evt): if not self.AskSave(): return if g.testWin: g.testWin.Destroy() if not panel.GetPageCount() == 2: panel.page2.Destroy() else: # If we don't do this, page does not get destroyed (a bug?) panel.RemovePage(1) if not self.IsIconized(): conf.x, conf.y = self.GetPosition() conf.width, conf.height = self.GetClientSize() if conf.embedPanel: conf.sashPos = self.splitter.GetSashPosition() else: conf.panelX, conf.panelY = self.miniFrame.GetPosition() conf.panelWidth, conf.panelHeight = self.miniFrame.GetSize() evt.Skip() | 2702a0c1bf81b553f493320776918fe5d9259e7e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12725/2702a0c1bf81b553f493320776918fe5d9259e7e/xrced.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
4605,
3829,
12,
2890,
16,
6324,
4672,
309,
486,
365,
18,
23663,
4755,
13332,
327,
309,
314,
18,
3813,
18049,
30,
314,
18,
3813,
18049,
18,
10740,
1435,
309,
486,
6594,
18,
967,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4605,
3829,
12,
2890,
16,
6324,
4672,
309,
486,
365,
18,
23663,
4755,
13332,
327,
309,
314,
18,
3813,
18049,
30,
314,
18,
3813,
18049,
18,
10740,
1435,
309,
486,
6594,
18,
967,
1... |
if style == 5: | if style == 5 or style == 3: | def findIndent(self, stc, linenum): """Reindent the specified line to the correct level. | 50cb1de65b1aacb32db0778f9fcd867c218e50f0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11522/50cb1de65b1aacb32db0778f9fcd867c218e50f0/makefile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
7790,
12,
2890,
16,
384,
71,
16,
4739,
7924,
4672,
3536,
426,
9355,
326,
1269,
980,
358,
326,
3434,
1801,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
7790,
12,
2890,
16,
384,
71,
16,
4739,
7924,
4672,
3536,
426,
9355,
326,
1269,
980,
358,
326,
3434,
1801,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.connect_changed_signals() | def main(self): | 75a4f8fc4331cc720e9d8c18e303ddad24d6afbc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8234/75a4f8fc4331cc720e9d8c18e303ddad24d6afbc/browser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... | |
child = handle.blockUntil(resource.createCollection, testCollName) handle.blockUntil(child.delete) | privilege_set = handle.blockUntil(resource.getPrivileges) if ('read', 'DAV:') in privilege_set.privileges: hasPrivileges = True if ('write', 'DAV:') in privilege_set.privileges: isReadOnly = False shareMode = 'both' | def subscribe(view, url, accountInfoCallback=None, updateCallback=None, username=None, password=None): if updateCallback: progressMonitor = ProgressMonitor(0, updateCallback) callback = progressMonitor.callback else: progressMonitor = None callback = None (useSSL, host, port, path, query, fragment) = splitUrl(url) ticket = "" if query: for part in query.split('&'): (arg, value) = part.split('=') if arg == 'ticket': ticket = value.encode('utf8') break # Get the parent directory of the given path: # '/dev1/foo/bar' becomes ['dev1', 'foo'] pathList = path.strip(u'/').split(u'/') parentPath = pathList[:-1] # ['dev1', 'foo'] becomes "dev1/foo" parentPath = u"/".join(parentPath) if ticket: account = None shareName = pathList[-1] else: account = WebDAVAccount.findMatchingAccount(view, url) # Allow the caller to override (and set) new username/password; helpful # from a 'subscribe' dialog: if username is not None: account.username = username if password is not None: account.password = password if account is None: # Prompt user for account information then create an account if accountInfoCallback: # Prompt the user for username/password/description: info = accountInfoCallback(host, path) if info is not None: (description, username, password) = info account = WebDAVAccount(itsView=view) account.displayName = description account.host = host account.path = parentPath account.username = username account.password = password account.useSSL = useSSL account.port = port # The user cancelled out of the dialog if account is None: return None # compute shareName relative to the account path: accountPathLen = len(account.path.strip(u"/")) shareName = path.strip(u"/")[accountPathLen:] if account: conduit = WebDAVConduit(itsView=view, account=account, shareName=shareName) else: conduit = WebDAVConduit(itsView=view, host=host, port=port, sharePath=parentPath, shareName=shareName, useSSL=useSSL, ticket=ticket) try: location = conduit.getLocation() for share in Share.iterItems(view): if share.getLocation() == location: raise AlreadySubscribed(_(u"Already subscribed")) # Shortcut: if it's a .ics file we're subscribing to, it's only # going to be read-only (in 0.6 at least), and we don't need to # mess around with checking Allow headers and the like: if url.endswith(".ics"): share = Share(itsView=view) share.format = ICalendarFormat(itsParent=share) share.conduit = SimpleHTTPConduit(itsParent=share, shareName=shareName, account=account) share.mode = "get" share.filterClasses = \ ["osaf.pim.calendar.Calendar.CalendarEventMixin"] if updateCallback: updateCallback(msg=_(u"Subscribing to calendar...")) try: share.get(updateCallback=callback) try: share.contents.shares.append(share, 'main') except ValueError: # There is already a 'main' share for this collection share.contents.shares.append(share) return share.contents except Exception, err: logger.exception("Failed to subscribe to %s", url) share.delete(True) raise # Shortcut: similarly, if it's a .ifb file we're subscribing to, it's # read-only elif path.endswith(".ifb"): share = Share(itsView=view) share.format = FreeBusyFileFormat(itsParent=share) share.conduit = SimpleHTTPConduit(itsParent=share, host=host, port=port, useSSL=useSSL, shareName=shareName, sharePath=parentPath, account=account) if ticket: share.conduit.ticketReadOnly = ticket share.mode = "get" share.filterClasses = \ ["osaf.pim.calendar.Calendar.CalendarEventMixin"] if updateCallback: updateCallback(msg=_(u"Subscribing to freebusy...")) try: share.get(updateCallback=callback) try: share.contents.shares.append(share, 'main') except ValueError: # There is already a 'main' share for this collection share.contents.shares.append(share) return share.contents except Exception, err: logger.exception("Failed to subscribe to %s", url) share.delete(True) raise if updateCallback: updateCallback(msg=_(u"Detecting share settings...")) # Interrogate the server if not location.endswith("/"): location += "/" handle = conduit._getServerHandle() resource = handle.getResource(location) if ticket: resource.ticketId = ticket logger.debug('Examining %s ...', location) exists = handle.blockUntil(resource.exists) if not exists: logger.debug("...doesn't exist") raise NotFound(message="%s does not exist" % location) isReadOnly = False shareMode = 'both' # if ticket: # @@@MOR: Grant -- canWrite( ) would be used here, hint hint logger.debug('Checking for write-access to %s...', location) # Create a random collection name to create testCollName = u'.%s.tmp' % (chandlerdb.util.c.UUID()) try: child = handle.blockUntil(resource.createCollection, testCollName) handle.blockUntil(child.delete) except zanshin.http.HTTPError, err: logger.debug("Failed to create test subcollection %s; error status %d", testCollName, err.status) isReadOnly = True shareMode = 'get' # Creating a subcollection failed, but subcollections aren't required # for CalDAV servers. Before deciding that the collection is really # read-only, try putting an empty event. This should be replaced with # code that does a PROPFIND on current-user-privilege-set and checks # for the write privilege. if isReadOnly: dummyICS = vobject.iCalendar() vevent = dummyICS.add('vevent') vevent.add('dtstart').value = datetime.datetime.now(vobject.icalendar.utc) vevent.add('duration').value = datetime.timedelta(hours=1) id = str(chandlerdb.util.c.UUID()) vevent.add('uid').value = id vevent.add('summary').value = "Test event" dummyPath = location + id + '.ics' handle = conduit._getServerHandle() dummyResource = handle.getResource(dummyPath) if ticket: dummyResource.ticketId = ticket try: handle.blockUntil(dummyResource.put, dummyICS.serialize(), checkETag=False, contentType="text/calendar") except zanshin.http.HTTPError, err: logger.debug("Failed to create dummy event; error status %d", err.status) else: # succeeded at putting the resource, now delete it try: handle.blockUntil(dummyResource.delete) except zanshin.webdav.ConnectionError, M2Crypto.BIO.BIOError: msg = "Failed to delete dummy event, dangling resource " \ "%s left on server!" logger.debug(msg, dummypath) isReadOnly = False shareMode = 'both' logger.debug('...Read Only? %s', isReadOnly) isCalendar = handle.blockUntil(resource.isCalendar) logger.debug('...Calendar? %s', isCalendar) if isCalendar: subLocation = urlparse.urljoin(location, SUBCOLLECTION) if not subLocation.endswith("/"): subLocation += "/" subResource = handle.getResource(subLocation) if ticket: subResource.ticketId = ticket try: hasSubCollection = handle.blockUntil(subResource.exists) and \ handle.blockUntil(subResource.isCollection) except Exception, e: logger.exception("Couldn't determine existence of subcollection %s", subLocation) hasSubCollection = False logger.debug('...Has subcollection? %s', hasSubCollection) isCollection = handle.blockUntil(resource.isCollection) logger.debug('...Collection? %s', isCollection) response = handle.blockUntil(resource.options) dav = response.headers.getHeader('DAV') logger.debug('...DAV: %s', dav) allowed = response.headers.getHeader('Allow') logger.debug('...Allow: %s', allowed) if updateCallback: updateCallback(msg=_(u"Share settings detected; ready to subscribe")) finally: conduit.delete(True) # Clean up the temporary conduit if not isCalendar: # Just a WebDAV/XML collection share = Share(itsView=view) share.mode = shareMode share.format = CloudXMLFormat(itsParent=share) if account: share.conduit = WebDAVConduit(itsParent=share, shareName=shareName, account=account) else: share.conduit = WebDAVConduit(itsParent=share, host=host, port=port, sharePath=parentPath, shareName=shareName, useSSL=useSSL, ticket=ticket) try: if progressMonitor: if updateCallback and updateCallback( msg=_(u"Getting list of remote items...")): raise SharingError(_(u"Cancelled by user")) progressMonitor.totalWork = share.getCount() share.sync(updateCallback=callback, modeOverride='get') share.conduit.getTickets() try: share.contents.shares.append(share, 'main') except ValueError: # There is already a 'main' share for this collection share.contents.shares.append(share) except Exception, err: location = share.getLocation() logger.exception("Failed to subscribe to %s", location) share.delete(True) raise return share.contents else: # This is a CalDAV calendar, possibly containing an XML subcollection totalWork = 0 try: share = None subShare = None if hasSubCollection: # Here is the Share for the subcollection with cloudXML subShare = Share(itsView=view) subShare.mode = shareMode subShareName = "%s/%s" % (shareName, SUBCOLLECTION) if account: subShare.conduit = WebDAVConduit(itsParent=subShare, shareName=subShareName, account=account) else: subShare.conduit = WebDAVConduit(itsParent=subShare, host=host, port=port, sharePath=parentPath, shareName=subShareName, useSSL=useSSL, ticket=ticket) subShare.format = CloudXMLFormat(itsParent=subShare) for attr in CALDAVFILTER: subShare.filterAttributes.append(attr) if updateCallback and updateCallback( msg=_(u"Getting list of remote items...")): raise SharingError(_(u"Cancelled by user")) totalWork += subShare.getCount() share = Share(itsView=view) share.mode = shareMode share.format = CalDAVFormat(itsParent=share) if account: share.conduit = CalDAVConduit(itsParent=share, shareName=shareName, account=account) else: share.conduit = CalDAVConduit(itsParent=share, host=host, port=port, sharePath=parentPath, shareName=shareName, useSSL=useSSL, ticket=ticket) if updateCallback and updateCallback( msg=_(u"Getting list of remote items...")): raise SharingError(_(u"Cancelled by user")) totalWork += share.getCount() if subShare is not None: share.follows = subShare if progressMonitor: progressMonitor.totalWork = totalWork share.sync(updateCallback=callback, modeOverride='get') share.conduit.getTickets() if subShare is not None: # If this is a partial share, we need to store that fact # into this Share object if hasattr(subShare, 'filterClasses'): share.filterClasses = list(subShare.filterClasses) try: share.contents.shares.append(share, 'main') except ValueError: # There is already a 'main' share for this collection share.contents.shares.append(share) except Exception, err: logger.exception("Failed to subscribe to %s", url) if share: share.delete(True) if subShare: subShare.delete(True) raise return share.contents | 117b1dc8d72f96c41950e2b52f441da488379a2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/117b1dc8d72f96c41950e2b52f441da488379a2e/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9129,
12,
1945,
16,
880,
16,
2236,
966,
2428,
33,
7036,
16,
1089,
2428,
33,
7036,
16,
2718,
33,
7036,
16,
2201,
33,
7036,
4672,
225,
309,
1089,
2428,
30,
4007,
7187,
273,
10980,
7187,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9129,
12,
1945,
16,
880,
16,
2236,
966,
2428,
33,
7036,
16,
1089,
2428,
33,
7036,
16,
2718,
33,
7036,
16,
2201,
33,
7036,
4672,
225,
309,
1089,
2428,
30,
4007,
7187,
273,
10980,
7187,
... |
exts.append(Extension('_codecs_' + loc, | exts.append(Extension('_codecs_%s' % loc, | def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | d1287323ca3273f4408a5c3f3047c316b72ea78c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/d1287323ca3273f4408a5c3f3047c316b72ea78c/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5966,
67,
6400,
12,
2890,
4672,
468,
7693,
716,
342,
13640,
19,
3729,
353,
3712,
1399,
527,
67,
1214,
67,
869,
67,
1098,
12,
2890,
18,
9576,
18,
12083,
67,
8291,
16,
1173,
13640,
19,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5966,
67,
6400,
12,
2890,
4672,
468,
7693,
716,
342,
13640,
19,
3729,
353,
3712,
1399,
527,
67,
1214,
67,
869,
67,
1098,
12,
2890,
18,
9576,
18,
12083,
67,
8291,
16,
1173,
13640,
19,
... |
user_info = cherrypy.session.get('login_info', '') if not user_info: return dict(value=value, error="You are not logged in...") | def voting(self, **kw): id = kw.get('id') pond_val = kw.get('pond_val') user_id = kw.get('user') value = None model = "comparison.factor" proxy = rpc.RPCProxy(model) res = proxy.read([id], ['name', 'ponderation']) name = res[0]['name'] pond = res[0]['ponderation'] smodel = "comparison.ponderation.suggestion" sproxy = rpc.RPCProxy(smodel) if pond_val == 'incr': if pond > 0.0: pond = pond + 0.1 else: if pond > 0.0: pond = pond - 0.1 user_info = cherrypy.session.get('login_info', '') if not user_info: return dict(value=value, error="You are not logged in...") try: value = sproxy.create({'factor_id': id, 'user_id': 1, 'ponderation': pond}) except Exception, e: return dict(value=value, error=str(e)) return dict(value=value, error="") | 9dd6ccfb2ed2bf444290a1a5b4bd1d87fabf4ce1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7339/9dd6ccfb2ed2bf444290a1a5b4bd1d87fabf4ce1/comparison.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
331,
17128,
12,
2890,
16,
2826,
9987,
4672,
225,
612,
273,
5323,
18,
588,
2668,
350,
6134,
293,
1434,
67,
1125,
273,
5323,
18,
588,
2668,
3111,
67,
1125,
6134,
729,
67,
350,
273,
5323,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
331,
17128,
12,
2890,
16,
2826,
9987,
4672,
225,
612,
273,
5323,
18,
588,
2668,
350,
6134,
293,
1434,
67,
1125,
273,
5323,
18,
588,
2668,
3111,
67,
1125,
6134,
729,
67,
350,
273,
5323,... | |
elif self.activeButton == self.textureBrowse: self.texturePathList = path elif self.activeButton == self.displayBrowse: self.displayPathList = path elif self.activeButton == self.proceduralBrowse: self.proceduralPathList = path elif self.activeButton == self.archiveBrowse: self.archivePathList = path | def select(self, file): path = os.path.dirname(file) if self.activeButton == self.binaryBrowse: self.binaryPath = path elif self.activeButton == self.shaderBrowse: self.shaderPathList = path elif self.activeButton == self.textureBrowse: self.texturePathList = path elif self.activeButton == self.displayBrowse: self.displayPathList = path elif self.activeButton == self.proceduralBrowse: self.proceduralPathList = path elif self.activeButton == self.archiveBrowse: self.archivePathList = path elif self.activeButton == self.outputBrowse: self.outputPath = path self.update() | 74bddf362fa2502791a0646abd613f6613d08c8a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11560/74bddf362fa2502791a0646abd613f6613d08c8a/BtoRMain.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2027,
12,
2890,
16,
585,
4672,
589,
273,
1140,
18,
803,
18,
12287,
12,
768,
13,
309,
365,
18,
3535,
3616,
422,
365,
18,
8578,
27304,
30,
365,
18,
8578,
743,
273,
589,
1327,
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,
2027,
12,
2890,
16,
585,
4672,
589,
273,
1140,
18,
803,
18,
12287,
12,
768,
13,
309,
365,
18,
3535,
3616,
422,
365,
18,
8578,
27304,
30,
365,
18,
8578,
743,
273,
589,
1327,
365,
18,
... | |
sandbox = TransferClient('WorkloadManagement/%sSandbox' % sandbox_type) | sandbox = TransferClient('WorkloadManagement/%sSandbox' % self.sandbox_type) | def getSandbox(self,jobID,output_dir=''): """ Get the job complete sandbox """ | 9ae9a74a56a413fd4ca0e96185ac4ba5fe5d807b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/9ae9a74a56a413fd4ca0e96185ac4ba5fe5d807b/SandboxClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1322,
9069,
12,
2890,
16,
4688,
734,
16,
2844,
67,
1214,
2218,
11,
4672,
3536,
225,
968,
326,
1719,
3912,
15202,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1322,
9069,
12,
2890,
16,
4688,
734,
16,
2844,
67,
1214,
2218,
11,
4672,
3536,
225,
968,
326,
1719,
3912,
15202,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
print >> sys.stderr, _(__doc__) % globals() | if code: fd = sys.stderr else: fd = sys.stdout print >> fd, _(__doc__) % globals() | def usage(code, msg=''): print >> sys.stderr, _(__doc__) % globals() if msg: print >> sys.stderr, msg sys.exit(code) | 17da8273eb61687e1eb7c1e068613036fc1f3f46 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/17da8273eb61687e1eb7c1e068613036fc1f3f46/pygettext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
12,
710,
16,
1234,
2218,
11,
4672,
309,
981,
30,
5194,
273,
2589,
18,
11241,
469,
30,
5194,
273,
2589,
18,
10283,
1172,
1671,
5194,
16,
389,
12,
972,
2434,
972,
13,
738,
10941,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4084,
12,
710,
16,
1234,
2218,
11,
4672,
309,
981,
30,
5194,
273,
2589,
18,
11241,
469,
30,
5194,
273,
2589,
18,
10283,
1172,
1671,
5194,
16,
389,
12,
972,
2434,
972,
13,
738,
10941,
... |
getattr(self.view[self.watchingItem], self.methodName)(op, uItem, dirties) | try: watchingItem = self.view[self.watchingItem] except KeyError: return getattr(watchingItem, self.methodName)(op, uItem, dirties) | def __call__(self, op, uItem, dirties): | b8aef561e988a8ab2362d8a13027c65c4c3fa7b7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/b8aef561e988a8ab2362d8a13027c65c4c3fa7b7/RepositoryView.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
1061,
16,
582,
1180,
16,
1577,
88,
606,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
1061,
16,
582,
1180,
16,
1577,
88,
606,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
def writeOut(self, widget): | def writeOut(self, widget=None, data=None): | def writeOut(self, widget): ''' Save the data in text field to the XML data file. ''' self.characterData.setData(self.attributes['path'], self.text.get_text()) self.characterData.writeOut() | a19c49d50daf587bd65dc947110411a62bd2f4e7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6757/a19c49d50daf587bd65dc947110411a62bd2f4e7/GTKsheetElements.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
1182,
12,
2890,
16,
3604,
33,
7036,
16,
501,
33,
7036,
4672,
9163,
7074,
326,
501,
316,
977,
652,
358,
326,
3167,
501,
585,
18,
9163,
365,
18,
11560,
751,
18,
542,
751,
12,
289... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
1182,
12,
2890,
16,
3604,
33,
7036,
16,
501,
33,
7036,
4672,
9163,
7074,
326,
501,
316,
977,
652,
358,
326,
3167,
501,
585,
18,
9163,
365,
18,
11560,
751,
18,
542,
751,
12,
289... |
self.__gsessionid = m.group(0) | self.__gsessionid = m.group(1) | def Delete(self, uri, extra_headers=None, url_params=None, escape_params=True, redirects_remaining=4): """Deletes the entry at the given URI. | 4d5fe85d01ec7eb842c11e4106cf25eb224af99e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6580/4d5fe85d01ec7eb842c11e4106cf25eb224af99e/gdata_service.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2504,
12,
2890,
16,
2003,
16,
2870,
67,
2485,
33,
7036,
16,
880,
67,
2010,
33,
7036,
16,
4114,
67,
2010,
33,
5510,
16,
18064,
67,
17956,
33,
24,
4672,
3536,
7551,
326,
1241,
622,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2504,
12,
2890,
16,
2003,
16,
2870,
67,
2485,
33,
7036,
16,
880,
67,
2010,
33,
7036,
16,
4114,
67,
2010,
33,
5510,
16,
18064,
67,
17956,
33,
24,
4672,
3536,
7551,
326,
1241,
622,
326... |
def average_firing_rate(spike_trains, stimulus_duration=None, trial_num=None): | def calc_average_firing_rate(spike_trains, stimulus_duration=None, trial_num=None): | def average_firing_rate(spike_trains, stimulus_duration=None, trial_num=None): """ Calculates average firing rate. spike_trains: trains of spikes stimulus_duration: in ms, if None, then calculated from spike timeings return: average firing rate in spikes per second (Hz) >>> spike_trains = [range(20), range(10)] >>> average_firing_rate(spike_trains, 1000) 15.0 """ if len(spike_trains) == 0: return 0 all_spikes = np.concatenate(tuple(spike_trains)) if stimulus_duration == None: stimulus_duration = all_spikes.max() - all_spikes.min() if trial_num == None: trial_num = len(spike_trains) r = all_spikes.size / (stimulus_duration * trial_num) r = r * 1000 # kHz -> Hz return r | 1407da21fff05aaaab170d93e79e5d335e125ea7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7039/1407da21fff05aaaab170d93e79e5d335e125ea7/_thorns.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7029,
67,
15621,
67,
74,
11256,
67,
5141,
12,
1752,
2547,
67,
313,
4167,
16,
25542,
17284,
67,
8760,
33,
7036,
16,
12950,
67,
2107,
33,
7036,
4672,
3536,
26128,
8164,
30253,
4993,
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,
7029,
67,
15621,
67,
74,
11256,
67,
5141,
12,
1752,
2547,
67,
313,
4167,
16,
25542,
17284,
67,
8760,
33,
7036,
16,
12950,
67,
2107,
33,
7036,
4672,
3536,
26128,
8164,
30253,
4993,
18,
... |
Hresult = integrate.odeint(SMsurface,[h_f],x_grid,atol=1.e-9,rtol=1.e-9) | Hresult = odeint(SMsurface,[h_f],x_grid,atol=1.e-9,rtol=1.e-9) | def SMsurface(h,x): b_x = SMcold_bedslope(x) s = a * abs(x) # ??? return b_x - (C / rho_g) * s**m / h**(m+1) | ab05ed26873ec7c6a125e320974ae7e10028b967 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7383/ab05ed26873ec7c6a125e320974ae7e10028b967/solverSM.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
348,
6947,
295,
865,
12,
76,
16,
92,
4672,
324,
67,
92,
273,
12014,
1293,
72,
67,
2992,
30320,
12,
92,
13,
272,
273,
279,
380,
2417,
12,
92,
13,
468,
5317,
35,
327,
324,
67,
92,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
348,
6947,
295,
865,
12,
76,
16,
92,
4672,
324,
67,
92,
273,
12014,
1293,
72,
67,
2992,
30320,
12,
92,
13,
272,
273,
279,
380,
2417,
12,
92,
13,
468,
5317,
35,
327,
324,
67,
92,
... |
If no ``length`` is provided the standard state space size is | If no ``length`` is provided, the standard state space size is | def lin_matrix(self, length=None): """ Return the ``Lin`` matrix. If no ``length`` is provided the standard state space size is used. The key schedule calls this method with an explicit length argument because only ``self.r`` S-Box applications are performed in the key schedule. INPUT: - ``length`` - length of state space. (default: ``None``) EXAMPLE:: sage: sr = mq.SR(1, 1, 1, 4, gf2=True) sage: sr.lin_matrix() [1 0 1 1] [1 1 0 1] [1 1 1 0] [0 1 1 1] """ r, c, e = self.r, self.c, self.e | 8851127220b91c29eb0dc162b4b9ae01cfac9a9f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/8851127220b91c29eb0dc162b4b9ae01cfac9a9f/sr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4739,
67,
5667,
12,
2890,
16,
769,
33,
7036,
4672,
3536,
2000,
326,
12176,
48,
267,
10335,
3148,
18,
225,
971,
1158,
12176,
2469,
10335,
353,
2112,
16,
326,
4529,
919,
3476,
963,
353,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4739,
67,
5667,
12,
2890,
16,
769,
33,
7036,
4672,
3536,
2000,
326,
12176,
48,
267,
10335,
3148,
18,
225,
971,
1158,
12176,
2469,
10335,
353,
2112,
16,
326,
4529,
919,
3476,
963,
353,
... |
channel_data.packet = None | def handle_read(self, channel): channel_data = self.channels[channel] if channel_data.packet == None: channel_data.buffer += channel.recv(1) channel_data.packet = packets.create_packet(channel_data.buffer) else: try: channel_data.buffer += channel.recv(channel_data.packet.MAX_SIZE - len(channel_data.buffer)) if len(channel_data.buffer) == channel_data.packet.MAX_SIZE: # A complete packet has been received, notify the state machine channel_data.packet.deserialize(channel_data.buffer) channel_data.buffer = "" | 1ebe10bdbd93b2e02afc21b78a99f384cb67cfcc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6230/1ebe10bdbd93b2e02afc21b78a99f384cb67cfcc/eventloop.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
896,
12,
2890,
16,
1904,
4672,
1904,
67,
892,
273,
365,
18,
9114,
63,
4327,
65,
309,
1904,
67,
892,
18,
11482,
422,
599,
30,
1904,
67,
892,
18,
4106,
1011,
1904,
18,
18334,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
896,
12,
2890,
16,
1904,
4672,
1904,
67,
892,
273,
365,
18,
9114,
63,
4327,
65,
309,
1904,
67,
892,
18,
11482,
422,
599,
30,
1904,
67,
892,
18,
4106,
1011,
1904,
18,
18334,... | |
for fd in range(3, maxfd): | for fd in range(0, maxfd): | def createDaemon(workdir): """Detach a process from the controlling terminal and run it in the background as a daemon. """ try: # Fork a child process so the parent can exit. This returns control to # the command-line or shell. It also guarantees that the child will not # be a process group leader, since the child receives a new process ID # and inherits the parent's process group ID. This step is required # to insure that the next call to os.setsid is successful. pid = os.fork() except OSError, e: raise Exception, "%s [%d]" % (e.strerror, e.errno) if (pid == 0): # The first child. # To become the session leader of this new session and the process group # leader of the new process group, we call os.setsid(). The process is # also guaranteed not to have a controlling terminal. os.setsid() # Is ignoring SIGHUP necessary? # # It's often suggested that the SIGHUP signal should be ignored before # the second fork to avoid premature termination of the process. The # reason is that when the first child terminates, all processes, e.g. # the second child, in the orphaned group will be sent a SIGHUP. # # "However, as part of the session management system, there are exactly # two cases where SIGHUP is sent on the death of a process: # # 1) When the process that dies is the session leader of a session that # is attached to a terminal device, SIGHUP is sent to all processes # in the foreground process group of that terminal device. # 2) When the death of a process causes a process group to become # orphaned, and one or more processes in the orphaned group are # stopped, then SIGHUP and SIGCONT are sent to all members of the # orphaned group." [2] # # The first case can be ignored since the child is guaranteed not to have # a controlling terminal. The second case isn't so easy to dismiss. # The process group is orphaned when the first child terminates and # POSIX.1 requires that every STOPPED process in an orphaned process # group be sent a SIGHUP signal followed by a SIGCONT signal. Since the # second child is not STOPPED though, we can safely forego ignoring the # SIGHUP signal. In any case, there are no ill-effects if it is ignored. # # import signal # Set handlers for asynchronous events. # signal.signal(signal.SIGHUP, signal.SIG_IGN) try: # Fork a second child and exit immediately to prevent zombies. This # causes the second child process to be orphaned, making the init # process responsible for its cleanup. And, since the first child is # a session leader without a controlling terminal, it's possible for # it to acquire one by opening a terminal in the future (System V- # based systems). This second fork guarantees that the child is no # longer a session leader, preventing the daemon from ever acquiring # a controlling terminal. pid = os.fork() # Fork a second child. except OSError, e: raise Exception, "%s [%d]" % (e.strerror, e.errno) if (pid == 0): # The second child. # Since the current working directory may be a mounted filesystem, we # avoid the issue of not being able to unmount the filesystem at # shutdown time by changing it to the root directory. os.chdir(workdir) # We probably don't want the file mode creation mask inherited from # the parent, so we give the child complete control over permissions. os.umask(UMASK) doc = IMProvDoc("Daemon") doc.addNode(IMProvNode("ProcessID", None, Value = os.getpid())) doc.addNode(IMProvNode("ParentProcessID", None, Value = os.getppid())) doc.addNode(IMProvNode("ProcessGroupID", None, Value = os.getpgrp())) doc.addNode(IMProvNode("UserID", None, Value = os.getuid())) doc.addNode(IMProvNode("EffectiveUserID", None, Value = os.geteuid())) doc.addNode(IMProvNode("GroupID", None, Value = os.getgid())) doc.addNode(IMProvNode("EffectiveGroupID", None, Value = os.getegid())) open("Daemon.xml", "w").write(doc.makeDOMDocument().toprettyxml()) print "Started Daemon:" print str(doc) else: # exit() or _exit()? See below. os._exit(0) # Exit parent (the first child) of the second child. else: # exit() or _exit()? # _exit is like exit(), but it doesn't call any functions registered # with atexit (and on_exit) or any registered signal handlers. It also # closes any open file descriptors. Using exit() may cause all stdio # streams to be flushed twice and any temporary files may be unexpectedly # removed. It's therefore recommended that child branches of a fork() # and the parent branch(es) of a daemon use _exit(). os._exit(0) # Exit parent of the first child. # Close all open file descriptors. This prevents the child from keeping # open any file descriptors inherited from the parent. There is a variety # of methods to accomplish this task. Three are listed below. # # Try the system configuration variable, SC_OPEN_MAX, to obtain the maximum # number of open file descriptors to close. If it doesn't exists, use # the default value (configurable). # # try: # maxfd = os.sysconf("SC_OPEN_MAX") # except (AttributeError, ValueError): # maxfd = MAXFD # # OR # # if (os.sysconf_names.has_key("SC_OPEN_MAX")): # maxfd = os.sysconf("SC_OPEN_MAX") # else: # maxfd = MAXFD # # OR # # Use the getrlimit method to retrieve the maximum file descriptor number # that can be opened by this process. If there is not limit on the # resource, use the default value. # import resource # Resource usage information. maxfd = resource.getrlimit(resource.RLIMIT_NOFILE)[1] if (maxfd == resource.RLIM_INFINITY): maxfd = MAXFD # Iterate through and close all file descriptors. for fd in range(3, maxfd): try: os.close(fd) except OSError: # ERROR, fd wasn't open to begin with (ignored) pass # Redirect the standard I/O file descriptors to the specified file. Since # the daemon has no controlling terminal, most daemons redirect stdin, # stdout, and stderr to /dev/null. This is done to prevent side-effects # from reads and writes to the standard I/O file descriptors. # This call to open is guaranteed to return the lowest file descriptor, # which will be 0 (stdin), since it was closed above. os.open(REDIRECT_TO, os.O_RDWR) # standard input (0) # Duplicate standard input to standard output and standard error. #os.dup2(0, 1) # standard output (1) #os.dup2(0, 2) # standard error (2) return(0) | b4bc51875731675bdb2986f04d54dc368b04a2a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8887/b4bc51875731675bdb2986f04d54dc368b04a2a6/CreateDaemon.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12858,
12,
1252,
1214,
4672,
3536,
17650,
279,
1207,
628,
326,
3325,
2456,
8651,
471,
1086,
518,
316,
326,
5412,
487,
279,
8131,
18,
3536,
225,
775,
30,
468,
27599,
279,
1151,
1207,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12858,
12,
1252,
1214,
4672,
3536,
17650,
279,
1207,
628,
326,
3325,
2456,
8651,
471,
1086,
518,
316,
326,
5412,
487,
279,
8131,
18,
3536,
225,
775,
30,
468,
27599,
279,
1151,
1207,... |
return self._insert( "bucket%s" % typeName, sqlFields, sqlValues, conn = connObj ) | return self._insert( self.__getTableName( "bucket", typeName ), sqlFields, sqlValues, conn = connObj ) | def __insertBucket( self, typeName, startTime, bucketLength, keyValues, bucketValues, connObj = False ): """ Insert a bucket when coming from the raw insert """ sqlFields = [ 'startTime', 'bucketLength' ] sqlValues = [ startTime.strftime( "%Y-%m-%d %H:%M:%S" ), bucketLength ] for keyPos in range( len( self.dbCatalog[ typeName ][ 'keys' ] ) ): sqlFields.append( self.dbCatalog[ typeName ][ 'keys' ][ keyPos ] ) sqlValues.append( keyValues[ keyPos ] ) for valPos in range( len( self.dbCatalog[ typeName ][ 'values' ] ) ): sqlFields.append( self.dbCatalog[ typeName ][ 'values' ][ valPos ] ) sqlValues.append( bucketValues[ valPos ] ) return self._insert( "bucket%s" % typeName, sqlFields, sqlValues, conn = connObj ) | 7663d95782c4987a99eb5394bb9f465c2ab982d5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/7663d95782c4987a99eb5394bb9f465c2ab982d5/AccountingDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
6387,
4103,
12,
365,
16,
8173,
16,
8657,
16,
2783,
1782,
16,
498,
1972,
16,
2783,
1972,
16,
1487,
2675,
273,
1083,
262,
30,
3536,
8040,
279,
2783,
1347,
19283,
628,
326,
1831,
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,
1001,
6387,
4103,
12,
365,
16,
8173,
16,
8657,
16,
2783,
1782,
16,
498,
1972,
16,
2783,
1972,
16,
1487,
2675,
273,
1083,
262,
30,
3536,
8040,
279,
2783,
1347,
19283,
628,
326,
1831,
22... |
self.connect(self.jigAtomSetAction,SIGNAL("activated()"),self.makeAtomSet) | self.connect(self.jigsAtomSetAction,SIGNAL("activated()"),self.makeAtomSet) | def __init__(self,parent = None,name = None,fl = 0): QMainWindow.__init__(self,parent,name,fl) self.statusBar() | 60e6bb271f2753e161f309e8cf0bf2108593416a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/60e6bb271f2753e161f309e8cf0bf2108593416a/MainWindowUI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2938,
273,
599,
16,
529,
273,
599,
16,
2242,
273,
374,
4672,
2238,
6376,
3829,
16186,
2738,
972,
12,
2890,
16,
2938,
16,
529,
16,
2242,
13,
365,
18,
23... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2938,
273,
599,
16,
529,
273,
599,
16,
2242,
273,
374,
4672,
2238,
6376,
3829,
16186,
2738,
972,
12,
2890,
16,
2938,
16,
529,
16,
2242,
13,
365,
18,
23... |
q.append('SELECT 2 as type, a.summary AS title, ' ' b.newvalue AS message, a.reporter AS author,' ' a.keywords as keywords,' ' a.id AS data, a.time AS time,0 AS ver' ' FROM ticket a, ticket_change b' ' WHERE a.id = b.ticket AND b.field=\'comment\' AND %s' % (self.query_to_sql(query, 'b.newvalue'))) | def perform_query (self, query, changeset, tickets, wiki, page=0): keywords = query.split(' ') | b6e5c7c3f923b426c893284b757311fef3461c79 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/b6e5c7c3f923b426c893284b757311fef3461c79/Search.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
2271,
261,
2890,
16,
843,
16,
22463,
16,
24475,
16,
9050,
16,
1363,
33,
20,
4672,
7093,
273,
843,
18,
4939,
2668,
8624,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
2271,
261,
2890,
16,
843,
16,
22463,
16,
24475,
16,
9050,
16,
1363,
33,
20,
4672,
7093,
273,
843,
18,
4939,
2668,
8624,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
sorter = ColumnSorter(colIndex) req.hdf[k] = 1 rows.sort(sorter.sort) | asc = 1 req.hdf[k] = asc def sortkey(row): val = row[colIndex] if isinstance(val, basestring): val = val.lower() return val rows = sorted(rows, key=sortkey, reverse=(not asc)) | def _render_view(self, req, db, id): """ uses a user specified sql query to extract some information from the database and presents it as a html table. """ actions = {'create': 'REPORT_CREATE', 'delete': 'REPORT_DELETE', 'modify': 'REPORT_MODIFY'} for action in [k for k,v in actions.items() if req.perm.has_permission(v)]: req.hdf['report.can_' + action] = True req.hdf['report.href'] = self.env.href.report(id) | b53fe327d1b953307679c1da09963190c813837a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/b53fe327d1b953307679c1da09963190c813837a/report.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5902,
67,
1945,
12,
2890,
16,
1111,
16,
1319,
16,
612,
4672,
3536,
4692,
279,
729,
1269,
1847,
843,
358,
2608,
2690,
1779,
628,
326,
2063,
471,
3430,
87,
518,
487,
279,
1729,
1014... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5902,
67,
1945,
12,
2890,
16,
1111,
16,
1319,
16,
612,
4672,
3536,
4692,
279,
729,
1269,
1847,
843,
358,
2608,
2690,
1779,
628,
326,
2063,
471,
3430,
87,
518,
487,
279,
1729,
1014... |
self.badmodules[fqname][parent.__name__] = None | if parent: self.badmodules[fqname][parent.__name__] = None | def import_module(self, partname, fqname, parent): self.msgin(3, "import_module", partname, fqname, parent) try: m = self.modules[fqname] except KeyError: pass else: self.msgout(3, "import_module ->", m) return m if self.badmodules.has_key(fqname): self.msgout(3, "import_module -> None") self.badmodules[fqname][parent.__name__] = None return None try: fp, pathname, stuff = self.find_module(partname, parent and parent.__path__) except ImportError: self.msgout(3, "import_module ->", None) return None try: m = self.load_module(fqname, fp, pathname, stuff) finally: if fp: fp.close() if parent: setattr(parent, partname, m) self.msgout(3, "import_module ->", m) return m | f9c6001c99e8f6c23c89901dadd11da083d7c8ff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/f9c6001c99e8f6c23c89901dadd11da083d7c8ff/modulefinder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
67,
2978,
12,
2890,
16,
1087,
529,
16,
8508,
529,
16,
982,
4672,
365,
18,
959,
1912,
12,
23,
16,
315,
5666,
67,
2978,
3113,
1087,
529,
16,
8508,
529,
16,
982,
13,
775,
30,
31... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
67,
2978,
12,
2890,
16,
1087,
529,
16,
8508,
529,
16,
982,
4672,
365,
18,
959,
1912,
12,
23,
16,
315,
5666,
67,
2978,
3113,
1087,
529,
16,
8508,
529,
16,
982,
13,
775,
30,
31... |
try: db = dbhash.open(hammie, "c") except: print "Your storage %s is a: bsddb3" % (hammie,) return | if hasattr(bsddb, '__version__'): try: db = bsddb.hashopen(hammie, "r") except bsddb.error: pass else: db.close() print "Your storage", hammie, "is a: bsddb[3]" return | def main(): print "Pickle is available." db = dumbdbm.open("dumbdb", "c") db["1"] = "1" db.close() str = whichdb.whichdb("dumbdb") if str: print "Dumbdbm is available." else: print "Dumbdbm is not available." db = dbhash.open("dbhash", "c") db["1"] = "1" db.close() str = whichdb.whichdb("dbhash") if str == "dbhash": print "Dbhash is available." else: print "Dbhash is not available." if bsddb is None: str = "" else: db = bsddb.hashopen("bsddb3", "c") db["1"] = "1" db.close() str = whichdb.whichdb("bsddb3") if str == "dbhash": print "Bsddb[3] is available." else: print "Bsddb[3] is not available." print hammie = os.path.expanduser(options["Storage", "persistent_storage_file"]) use_dbm = options["Storage", "persistent_use_database"] if not use_dbm: print "Your storage %s is a: pickle" % (hammie,) return if not os.path.exists(hammie): print "Your storage file does not exist yet." return db_type = whichdb.whichdb(hammie) if db_type == "dbhash": # could be dbhash or bsddb3 try: db = dbhash.open(hammie, "c") except: print "Your storage %s is a: bsddb3" % (hammie,) return elif db_type is None: print "Your storage %s is unreadable." % (hammie,) print "Your storage %s is a: %s" % (hammie, db_type) | 523232321d83143534704996b1c002ec7e416f10 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9857/523232321d83143534704996b1c002ec7e416f10/which_database.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
1172,
315,
17968,
298,
353,
2319,
1199,
1319,
273,
302,
3592,
1966,
81,
18,
3190,
2932,
72,
3592,
1966,
3113,
315,
71,
7923,
1319,
9614,
21,
11929,
273,
315,
21,
6,
1319,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
1172,
315,
17968,
298,
353,
2319,
1199,
1319,
273,
302,
3592,
1966,
81,
18,
3190,
2932,
72,
3592,
1966,
3113,
315,
71,
7923,
1319,
9614,
21,
11929,
273,
315,
21,
6,
1319,
... |
ls = li['path'] if len(ls) ==0: | def only_alnum(s): return filter(lambda c: c.isalnum(), s) ls = map(only_alnum, li['path']) if len(ls) == 0: | def _addTorrentToDB(self, infohash, data, commit=True): torrent_id = self._db.getTorrentID(infohash) #print >> sys.stderr, "-------------- Adding torrent to DB..", bin2str(infohash), str(torrent_id) if torrent_id is None: # not in db infohash_str = bin2str(infohash) self._db.insert('Torrent', commit=True, # must commit to get the torrent id infohash = infohash_str, name = dunno2unicode(data['name']), torrent_file_name = data['torrent_file_name'], length = data['length'], creation_date = data['creation_date'], num_files = data['num_files'], thumbnail = data['thumbnail'], insert_time = data['insert_time'], secret = data['secret'], relevance = data['relevance'], source_id = data['source'], category_id = data['category'], status_id = data['status'], num_seeders = data['num_seeders'], num_leechers = data['num_leechers'], comment = dunno2unicode(data['comment'])) torrent_id = self._db.getTorrentID(infohash) # adding in TorrentFiles table else: # infohash in db where = 'torrent_id = %d'%torrent_id self._db.update('Torrent', where = where, commit=False, name = dunno2unicode(data['name']), torrent_file_name = data['torrent_file_name'], length = data['length'], creation_date = data['creation_date'], num_files = data['num_files'], thumbnail = data['thumbnail'], insert_time = data['insert_time'], secret = data['secret'], relevance = data['relevance'], source_id = data['source'], category_id = data['category'], status_id = data['status'], num_seeders = data['num_seeders'], num_leechers = data['num_leechers'], comment = dunno2unicode(data['comment'])) | dd38a58c867405681df717cbbef78787b6112925 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9686/dd38a58c867405681df717cbbef78787b6112925/SqliteCacheDBHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1289,
27266,
547,
774,
2290,
12,
2890,
16,
1123,
2816,
16,
501,
16,
3294,
33,
5510,
4672,
17351,
67,
350,
273,
365,
6315,
1966,
18,
588,
27266,
547,
734,
12,
1376,
2816,
13,
468,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1289,
27266,
547,
774,
2290,
12,
2890,
16,
1123,
2816,
16,
501,
16,
3294,
33,
5510,
4672,
17351,
67,
350,
273,
365,
6315,
1966,
18,
588,
27266,
547,
734,
12,
1376,
2816,
13,
468,
... |
if retval: return retval | if retval: return retval if checkdeps: retval=dep_frontend("runtime",mydeps[1]) if (retval): return retval | def doebuild(myebuild,mydo,checkdeps=1): global settings if not os.path.exists(myebuild): print "!!!",myebuild,"not found." return 1 if myebuild[-7:]!=".ebuild": print "!!!",myebuild,"does not appear to be an ebuild file." return 1 settings.reset() settings["ROOT"]=root settings["STARTDIR"]=os.getcwd() settings["EBUILD"]=os.path.abspath(myebuild) settings["O"]=os.path.dirname(settings["EBUILD"]) settings["CATEGORY"]=os.path.basename(os.path.normpath(settings["O"]+"/..")) #PEBUILD settings["FILESDIR"]=settings["O"]+"/files" settings["PF"]=os.path.basename(settings["EBUILD"])[:-7] mysplit=pkgsplit(settings["PF"],0) if mysplit==None: return 1 settings["P"]=mysplit[0]+"-"+mysplit[1] settings["PN"]=mysplit[0] settings["PV"]=mysplit[1] settings["PR"]=mysplit[2] if mysplit[2]=="r0": settings["PVR"]=mysplit[1] else: settings["PVR"]=mysplit[1]+"-"+mysplit[2] if settings.has_key("PATH"): mysplit=string.split(settings["PATH"],":") else: mysplit=[] if not "/usr/lib/portage/bin" in mysplit: settings["PATH"]="/usr/lib/portage/bin:"+settings["PATH"] if not settings.has_key("BUILD_PREFIX"): print "!!! Error: BUILD_PREFIX not defined." return 1 settings["BUILDDIR"]=settings["BUILD_PREFIX"]+"/"+settings["PF"] if not os.path.exists(settings["BUILDDIR"]): os.makedirs(settings["BUILDDIR"]) settings["T"]=settings["BUILDDIR"]+"/temp" if not os.path.exists(settings["T"]): os.makedirs(settings["T"]) settings["WORKDIR"]=settings["BUILDDIR"]+"/work" settings["D"]=settings["BUILDDIR"]+"/image/" #initial ebuild.sh bash environment configured if mydo in ["prerm","postrm","preinst","postinst","config","touch","clean","digest","unmerge"]: #no dep check needed pass elif mydo=="depend": return string.split(getoutput("/usr/sbin/ebuild.sh depend"),"\n") elif checkdeps: #optional dependency check -- if emerge is calling us, it will be skipped mydeps=string.split(getoutput("/usr/sbin/ebuild.sh depend"),"\n") retval=dep_frontend("build",mydeps[0]) if (retval): return retval if mydo not in ["package","rpm"]: retval=dep_frontend("runtime",mydeps[1]) if retval: return retval #initial dep checks complete; time to process main commands if mydo=="unpack": return spawn("/usr/sbin/ebuild.sh fetch unpack") elif mydo=="compile": #do build deps return spawn("/usr/sbin/ebuild.sh fetch unpack compile") elif mydo in ["prerm","postrm","preinst","postinst","config","touch","clean","fetch","digest","unmerge","install"]: return spawn("/usr/sbin/ebuild.sh "+mydo) elif mydo=="qmerge": return merge(settings["CATEGORY"],settings["PF"],settings["D"],settings["BUILDDIR"]+"/build-info") elif mydo=="merge": retval=spawn("/usr/sbin/ebuild.sh fetch unpack compile install") if retval: return retval return merge(settings["CATEGORY"],settings["PF"],settings["D"],settings["BUILDDIR"]+"/build-info") elif mydo=="unmerge": return unmerge(settings["CATEGORY"],settings["PF"]) elif mydo=="rpm": return spawn("/usr/sbin/ebuild.sh fetch unpack compile install rpm") elif mydo=="package": retval=spawn("/usr/sbin/ebuild.sh fetch") if retval: return retval for x in ["","/"+settings["CATEGORY"]]: if not os.path.exists(settings["PKGDIR"]+x): os.makedirs(settings["PKGDIR"]+x) pkgloc=settings["PKGDIR"]+"/All/"+settings["PF"]+".tbz2" rebuild=0 if os.path.exists(pkgloc): for x in [settings["A"],settings["EBUILD"]]: if not os.path.exists(x): continue if os.path.getmtime(x)>os.path.getmtime(pkgloc): rebuild=1 break else: rebuild=1 if not rebuild: print print ">>> Package",settings["PF"]+".tbz2 appears to be up-to-date." print ">>> To force rebuild, touch",os.path.basename(settings["EBUILD"]) print return 0 else: return spawn("/usr/sbin/ebuild.sh unpack compile install package") else: print "!!! Please specify a valid command." return 1 | 6b52396a86e4a7bc3d80d37d6c94f0e6d3033f43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2807/6b52396a86e4a7bc3d80d37d6c94f0e6d3033f43/portage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
73,
3510,
12,
4811,
73,
3510,
16,
4811,
2896,
16,
1893,
14877,
33,
21,
4672,
2552,
1947,
309,
486,
1140,
18,
803,
18,
1808,
12,
4811,
73,
3510,
4672,
1172,
315,
25885,
3113,
4811,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
73,
3510,
12,
4811,
73,
3510,
16,
4811,
2896,
16,
1893,
14877,
33,
21,
4672,
2552,
1947,
309,
486,
1140,
18,
803,
18,
1808,
12,
4811,
73,
3510,
4672,
1172,
315,
25885,
3113,
4811,... |
print tmp | def emit( self, record ): color = QColor( "#000000" ) if record.levelno > 20: color = QColor( "#ffff00" ) if record.levelno > 30: color = QColor( "#ff0000" ) if record.levelno <= 10: color = QColor( "#808080" ) self.setTextColor( color ) tmp = "%s %s: %s" % (record.asctime, record.name, record.getMessage()) print tmp self.append( tmp ) self.verticalScrollBar().triggerAction( QAbstractSlider.SliderToMaximum ) | e369f5d7019d8ad3a93939d0a258f64a59a7976a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11526/e369f5d7019d8ad3a93939d0a258f64a59a7976a/ffado_logginghandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3626,
12,
365,
16,
1409,
262,
30,
2036,
273,
2238,
2957,
12,
6619,
9449,
6,
262,
309,
1409,
18,
2815,
2135,
405,
4200,
30,
2036,
273,
2238,
2957,
12,
6619,
9460,
713,
6,
262,
309,
14... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3626,
12,
365,
16,
1409,
262,
30,
2036,
273,
2238,
2957,
12,
6619,
9449,
6,
262,
309,
1409,
18,
2815,
2135,
405,
4200,
30,
2036,
273,
2238,
2957,
12,
6619,
9460,
713,
6,
262,
309,
14... | |
documents = [] user = context.user handlers = [] for object in documents: abspath = object.abspath handler = root.get_handler(abspath) ac = handler.get_access_control() if ac.is_allowed_to_view(user, handler): handlers.append(handler) total = len(handlers) objects = [] for handler in handlers[start:start+size]: abspath = handler.get_abspath() info = {} info['abspath'] = abspath info['title'] = handler.title_or_name info['type'] = self.gettext(handler.class_title) info['size'] = handler.get_human_size() info['url'] = '%s/;%s' % (self.get_pathto(handler), handler.get_firstview()) icon = handler.get_path_to_icon(16, from_handler=self) if icon.startswith(';'): icon = Path('%s/' % handler.name).resolve(icon) info['icon'] = icon objects.append(info) namespace = {} namespace['text'] = text namespace['objects'] = objects namespace['batch'] = widgets.batch(context.uri, start, size, total) | namespace['text'] = '' | def site_search(self, context): root = context.root | 42a0985806fc3f0b06f6ddb5eb602e0eafb012ca /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12681/42a0985806fc3f0b06f6ddb5eb602e0eafb012ca/website.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2834,
67,
3072,
12,
2890,
16,
819,
4672,
1365,
273,
819,
18,
3085,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2834,
67,
3072,
12,
2890,
16,
819,
4672,
1365,
273,
819,
18,
3085,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
else: | else: | def do_run(self, options, args): windows = platform == "Windows" if options.unmount: | 541006a76a12343a29852dec14beab20966e9909 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5578/541006a76a12343a29852dec14beab20966e9909/fsmount.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
2681,
12,
2890,
16,
702,
16,
833,
4672,
225,
9965,
273,
4072,
422,
315,
10399,
6,
225,
309,
702,
18,
318,
4778,
30,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
2681,
12,
2890,
16,
702,
16,
833,
4672,
225,
9965,
273,
4072,
422,
315,
10399,
6,
225,
309,
702,
18,
318,
4778,
30,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
url=reverse('grades.views.student', course_slug=course.slug) | url=reverse('grades.views.course_info', kwargs={'course_slug':self.activity.offering.slug}) | def save(self): super(NumericGrade, self).save() if activity.status == "RLS": n = NewsItem(user=self.member.person, author=request.userid, course=activity.offering, source_app="grades", title="%s grade available" % (activity.name), content="...", url=reverse('grades.views.student', course_slug=course.slug) ) n.save() | 5b86bc080f2e0ac2cb75fe2d814675a45076f51d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6634/5b86bc080f2e0ac2cb75fe2d814675a45076f51d/models.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
2890,
4672,
2240,
12,
9902,
14571,
323,
16,
365,
2934,
5688,
1435,
309,
5728,
18,
2327,
422,
315,
54,
3045,
6877,
290,
273,
27061,
1180,
12,
1355,
33,
2890,
18,
5990,
18,
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,
1923,
12,
2890,
4672,
2240,
12,
9902,
14571,
323,
16,
365,
2934,
5688,
1435,
309,
5728,
18,
2327,
422,
315,
54,
3045,
6877,
290,
273,
27061,
1180,
12,
1355,
33,
2890,
18,
5990,
18,
124... |
self.stream.write(fs % msg) | if hasattr(self.stream, 'encoding'): self.stream.write(fs % msg.encode(self.stream.encoding)) else: self.stream.write(fs % msg) | def emit(self, record): """ Emit a record. | c5f81e8bd1e225bff74999888d7ec731b4c03b51 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/c5f81e8bd1e225bff74999888d7ec731b4c03b51/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3626,
12,
2890,
16,
1409,
4672,
3536,
16008,
279,
1409,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
3626,
12,
2890,
16,
1409,
4672,
3536,
16008,
279,
1409,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
def __init__(self, bus_name, object_path='/Updatesd'): | def __init__(self, updd, bus_name, object_path='/Updatesd'): | def __init__(self, bus_name, object_path='/Updatesd'): dbus.service.Object.__init__(self, bus_name, object_path) | e2d410c6d27e539632284c34aafe0b0bf67c6b04 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5445/e2d410c6d27e539632284c34aafe0b0bf67c6b04/yum-updatesd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
731,
449,
16,
5766,
67,
529,
16,
733,
67,
803,
2218,
19,
5121,
72,
11,
4672,
21866,
18,
3278,
18,
921,
16186,
2738,
972,
12,
2890,
16,
5766,
67,
529,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
731,
449,
16,
5766,
67,
529,
16,
733,
67,
803,
2218,
19,
5121,
72,
11,
4672,
21866,
18,
3278,
18,
921,
16186,
2738,
972,
12,
2890,
16,
5766,
67,
529,
... |
if (self._ieqs == [] and self._vertices != []) or force_from_vertices: | if self._vertices != []: | def ieqs(self, force_from_vertices = False): """ Return the inequalities (half-planes) defining the polyhedron. | dbdb3fc1a2e2ea33a2d2ecc78afb66bc9cc5cd48 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/dbdb3fc1a2e2ea33a2d2ecc78afb66bc9cc5cd48/polyhedra.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9228,
12926,
12,
2890,
16,
2944,
67,
2080,
67,
17476,
273,
1083,
4672,
3536,
2000,
326,
316,
9729,
1961,
261,
20222,
17,
7088,
281,
13,
9364,
326,
7573,
18550,
1949,
18,
2,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9228,
12926,
12,
2890,
16,
2944,
67,
2080,
67,
17476,
273,
1083,
4672,
3536,
2000,
326,
316,
9729,
1961,
261,
20222,
17,
7088,
281,
13,
9364,
326,
7573,
18550,
1949,
18,
2,
-100,
-100,
... |
try: uid = getUid(req) req.write(create_header(cc, as, create_user_infobox(uid))) except: req.write(create_header(cc, as)) | req.write(create_header(cc, as, uid)) | def perform_request_search(req=None, cc=cdsname, c=None, p="", f="", rg="10", sf="", so="d", sp="", of="hb", ot="", as="0", p1="", f1="", m1="", op1="", p2="", f2="", m2="", op2="", p3="", f3="", m3="", sc="0", jrec="0", id="-1", idb="-1", sysnb="", search="SEARCH", d1y="", d1m="", d1d="", d2y="", d2m="", d2d=""): """Perform search, without checking for authentication. Return list of recIDs found, if of=id. Otherwise create web page.""" # wash all passed arguments: cc = wash_url_argument(cc, 'str') p = wash_url_argument(p, 'str') f = wash_url_argument(f, 'str') rg = wash_url_argument(rg, 'int') sf = wash_url_argument(sf, 'str') so = wash_url_argument(so, 'str') sp = wash_url_argument(sp, 'string') of = wash_url_argument(of, 'str') if type(ot) is list: ot = string.join(ot,",") ot = wash_url_argument(ot, 'str') as = wash_url_argument(as, 'int') p1 = wash_url_argument(p1, 'str') f1 = wash_url_argument(f1, 'str') m1 = wash_url_argument(m1, 'str') op1 = wash_url_argument(op1, 'str') p2 = wash_url_argument(p2, 'str') f2 = wash_url_argument(f2, 'str') m2 = wash_url_argument(m2, 'str') op2 = wash_url_argument(op2, 'str') p3 = wash_url_argument(p3, 'str') f3 = wash_url_argument(f3, 'str') m3 = wash_url_argument(m3, 'str') sc = wash_url_argument(sc, 'int') jrec = wash_url_argument(jrec, 'int') id = wash_url_argument(id, 'int') idb = wash_url_argument(idb, 'int') sysnb = wash_url_argument(sysnb, 'int') search = wash_url_argument(search, 'str') d1y = wash_url_argument(d1y, 'str') d1m = wash_url_argument(d1m, 'str') d1d = wash_url_argument(d1d, 'str') d2y = wash_url_argument(d2y, 'str') d2m = wash_url_argument(d2m, 'str') d2d = wash_url_argument(d2d, 'str') day1, day2 = wash_dates(d1y, d1m, d1d, d2y, d2m, d2d) # start output if of.startswith('x'): # we are doing XML output: req.content_type = "text/xml" req.send_http_header() req.write("""<?xml version="1.0" encoding="UTF-8"?>\n""") if of.startswith("xm"): req.write("""<collection xmlns="http://www.loc.gov/MARC21/slim">\n""") else: req.write("""<collection>\n""") elif of.startswith('t') or str(of[0:3]).isdigit(): # we are doing plain text output: req.content_type = "text/plain" req.send_http_header() elif of == "id": # we are passing list of recIDs pass else: # we are doing HTML output: req.content_type = "text/html" req.send_http_header() # detect user: try: uid = getUid(req) req.write(create_header(cc, as, create_user_infobox(uid))) except: # ignore user personalisation, needed e.g. for command-line req.write(create_header(cc, as)) if sysnb or id>0: ## 1 - detailed record display if sysnb: # ALEPH sysnb is passed, so deduce MySQL id for the record: id = get_mysql_recid_from_aleph_sysno(sysnb) if of=="hb": of = "hd" if record_exists(id): if idb<=id: # sanity check idb=id+1 print_records(req, range(id,idb), -1, -9999, of, ot) else: # record does not exist if of.startswith("h"): (cc, colls_to_display, colls_to_search) = wash_colls(cc, c, sc) p = wash_pattern(p) f = wash_field(f) req.write(create_search_box(cc, colls_to_display, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, d1y, d1m, d1d, d2y, d2m, d2d, search)) print_warning(req, "Requested record does not seem to exist.", None, "<p>") elif search == "Browse": ## 2 - browse needed (cc, colls_to_display, colls_to_search) = wash_colls(cc, c, sc) p = wash_pattern(p) f = wash_field(f) # write search box: if of.startswith("h"): req.write(create_search_box(cc, colls_to_display, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, d1y, d1m, d1d, d2y, d2m, d2d, search)) if as==1 or (p1 or p2 or p3): browse_pattern(req, colls_to_search, p1, f1, rg) browse_pattern(req, colls_to_search, p2, f2, rg) browse_pattern(req, colls_to_search, p3, f3, rg) else: browse_pattern(req, colls_to_search, p, f, rg) else: ## 3 - search needed # wash passed collection arguments: (cc, colls_to_display, colls_to_search) = wash_colls(cc, c, sc) p = wash_pattern(p) f = wash_field(f) # write search box: if of.startswith("h"): req.write(create_search_box(cc, colls_to_display, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, d1y, d1m, d1d, d2y, d2m, d2d, search)) # run search: t1 = os.times()[4] if as == 1 or (p1 or p2 or p3): # 3A - advanced search results_final = search_pattern(req, "", "", colls_to_search) if p1: results_tmp = search_pattern(req, p1, f1, colls_to_search, m1) for coll in colls_to_search: # join results for first advanced search boxen results_final[coll].intersect(results_tmp[coll]) if p2: results_tmp = search_pattern(req, p2, f2, colls_to_search, m2) for coll in colls_to_search: # join results for first and second advanced search boxen if op1 == "a": # add results_final[coll].intersect(results_tmp[coll]) elif op1 == "o": # or results_final[coll].union(results_tmp[coll]) elif op1 == "n": # not results_final[coll].difference(results_tmp[coll]) else: print_warning(req, "Invalid set operation %s." % op1, "Error") if p3: results_tmp = search_pattern(req, p3, f3, colls_to_search, m3) for coll in colls_to_search: # join results for second and third advanced search boxen if op2 == "a": # add results_final[coll].intersect(results_tmp[coll]) elif op2 == "o": # or results_final[coll].union(results_tmp[coll]) elif op2 == "n": # not results_final[coll].difference(results_tmp[coll]) else: print_warning(req, "Invalid set operation %s." % op1, "Error") for coll in colls_to_search: results_final[coll].calculate_nbhits() else: # 3B - simple search search_cache_key = p+"@"+f+"@"+string.join(colls_to_search,",") if search_cache.has_key(search_cache_key): # is the result in search cache? results_final = search_cache[search_cache_key] else: results_final = search_pattern(req, p, f, colls_to_search) search_cache[search_cache_key] = results_final if len(search_cache) > cfg_search_cache_size: # is the cache full? (sanity cleaning) search_cache.clear() # search done; was there a time restriction? if yes, apply it now: if day1 != "": results_of_time_restriction = search_in_bibrec(day1, day2) for coll in colls_to_search: results_final[coll].intersect(results_of_time_restriction) results_final[coll].calculate_nbhits() t2 = os.times()[4] cpu_time = t2 - t1 # find total number of records found in each collection results_final_nb_total = 0 results_final_nb = {} for coll in colls_to_search: results_final_nb[coll] = results_final[coll]._nbhits results_final_nb_total += results_final_nb[coll] # was there at least one hit? if results_final_nb_total == 0: # nope, so try similar queries: if of.startswith('h'): print_warning(req, "No match found. Trying similar queries...", "", "<p>","<p>") req.write("<p>") if as==1 or (p1 or p2 or p3): if p1: search_pattern(req, p1, f1, colls_to_search, m1, 1) if p2: search_pattern(req, p2, f2, colls_to_search, m2, 1) if p3: search_pattern(req, p3, f3, colls_to_search, m3, 1) else: search_pattern(req, p, f, colls_to_search, None, 1) else: # yes, some hits found, so print results overview: if of == "id": # we have been asked to return list of recIDs results_final_for_all_colls = HitList() for coll in colls_to_search: results_final_for_all_colls.union(results_final[coll]) return results_final_for_all_colls.items() elif of.startswith("h"): req.write(print_results_overview(colls_to_search, results_final_nb_total, results_final_nb, cpu_time)) # print records: if len(colls_to_search)>1: cpu_time = -1 # we do not want to have search time printed on each collection for coll in colls_to_search: if results_final[coll]._nbhits: if of.startswith("h"): req.write(print_search_info(p, f, sf, so, sp, of, ot, coll, results_final_nb[coll], jrec, rg, as, p1, p2, p3, f1, f2, f3, m1, m2, m3, op1, op2, d1y, d1m, d1d, d2y, d2m, d2d, cpu_time)) results_final_sorted = results_final[coll].items() if sf: results_final_sorted = sort_records(req, results_final_sorted, sf, so, sp) print_records(req, results_final_sorted, jrec, rg, of, ot) if of.startswith("h"): req.write(print_search_info(p, f, sf, so, sp, of, ot, coll, results_final_nb[coll], jrec, rg, as, p1, p2, p3, f1, f2, f3, m1, m2, m3, op1, op2, d1y, d1m, d1d, d2y, d2m, d2d, cpu_time, 1)) # log query: try: log_query(req.get_remote_host(), req.args, uid) except: # do not log query if req is None (used by CLI interface) pass log_query_info("ss", p, f, colls_to_search, results_final_nb_total) # 4 -- write footer: if of.startswith('h'): req.write(create_footer()) elif of.startswith('x'): req.write("""</collection>\n""") # 5 - return value if of == "id": return [] else: return "\n" | 0aec736283882ec36ab3010d663d9be625f4d852 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/0aec736283882ec36ab3010d663d9be625f4d852/search_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
2293,
67,
3072,
12,
3658,
33,
7036,
16,
4946,
33,
71,
2377,
529,
16,
276,
33,
7036,
16,
293,
1546,
3113,
284,
1546,
3113,
14524,
1546,
2163,
3113,
9033,
1546,
3113,
1427,
154... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
2293,
67,
3072,
12,
3658,
33,
7036,
16,
4946,
33,
71,
2377,
529,
16,
276,
33,
7036,
16,
293,
1546,
3113,
284,
1546,
3113,
14524,
1546,
2163,
3113,
9033,
1546,
3113,
1427,
154... |
display_art_combo.connect('changed', self.prefs_config_widget_active, 'covers_pref') | art_combo.connect('changed', self._config_widget_active, 'covers_pref') | def display_tab(self, prefs_stylized_toggled, prefs_art_toggled, prefs_playback_toggled, prefs_progress_toggled, prefs_statusbar_toggled, prefs_lyrics_toggled, trayicon_available): """Construct and layout the display tab""" displaylabel = ui.label(markup='<b>' + _('Display') + '</b>') display_frame = gtk.Frame() display_frame.set_label_widget(displaylabel) display_frame.set_shadow_type(gtk.SHADOW_NONE) | 7d41f2105c0d58643150b6472b6b9676150f38e3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2312/7d41f2105c0d58643150b6472b6b9676150f38e3/preferences.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2562,
67,
7032,
12,
2890,
16,
15503,
67,
334,
93,
80,
1235,
67,
88,
23972,
1259,
16,
15503,
67,
485,
67,
88,
23972,
1259,
16,
15503,
67,
1601,
823,
67,
88,
23972,
1259,
16,
15503,
67... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2562,
67,
7032,
12,
2890,
16,
15503,
67,
334,
93,
80,
1235,
67,
88,
23972,
1259,
16,
15503,
67,
485,
67,
88,
23972,
1259,
16,
15503,
67,
1601,
823,
67,
88,
23972,
1259,
16,
15503,
67... |
print "INSERT INTO documentation_objects VALUES('%s', '%s');" % (quote(object['object']), quote(object['description'])) | print "REPLACE INTO documentation_objects VALUES('%s', '%s');" % (quote(object['object']), quote(object['description'])) | def quote(text): return text.replace("'", "\\'") | 60ce104269e46004493ef24383298a5598851163 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/60ce104269e46004493ef24383298a5598851163/generate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3862,
12,
955,
4672,
327,
977,
18,
2079,
29823,
3113,
1548,
3730,
7923,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3862,
12,
955,
4672,
327,
977,
18,
2079,
29823,
3113,
1548,
3730,
7923,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
>>> type( result ) is expectedResultType | >>> type(result) is expectedResultType | def resolveMUITimeZone( spec ): """Resolve a multilingual user interface resource for the time zone name >>> result = resolveMUITimeZone( '@tzres.dll,-110' ) >>> expectedResultType = [type(None),unicode][sys.getwindowsversion() >= (6,)] >>> type( result ) is expectedResultType True spec should be of the format @path,-stringID[;comment] see http://msdn2.microsoft.com/en-us/library/ms725481.aspx for details """ pattern = re.compile( '@(?P<dllname>.*),-(?P<index>\d+)(?:;(?P<comment>.*))?' ) matcher = pattern.match( spec ) assert matcher, 'Could not parse MUI spec' try: handle = DLLCache[ matcher.groupdict()[ 'dllname' ] ] result = win32api.LoadString( handle, int( matcher.groupdict()[ 'index' ] ) ) except win32api.error, e: result = None return result | c68039a3f4004e3fe46621e4c6512fd2401398fc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/677/c68039a3f4004e3fe46621e4c6512fd2401398fc/win32timezone.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2245,
49,
5370,
16760,
12,
857,
262,
30,
3536,
8460,
279,
1778,
25853,
729,
1560,
1058,
364,
326,
813,
4157,
508,
4080,
563,
273,
2245,
49,
5370,
16760,
12,
4622,
12994,
455,
18,
27670,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2245,
49,
5370,
16760,
12,
857,
262,
30,
3536,
8460,
279,
1778,
25853,
729,
1560,
1058,
364,
326,
813,
4157,
508,
4080,
563,
273,
2245,
49,
5370,
16760,
12,
4622,
12994,
455,
18,
27670,
... |
assert_almost_equal_spec(y[i], y_r[i]) | assert_almost_equal(y[i], y_r[i]) | def test_simple(self): x = np.array([1+1j, 0+2j, 1+2j, np.inf, np.nan]) y_r = x ** 2 y = np.power(x, 2) for i in range(len(x)): assert_almost_equal_spec(y[i], y_r[i]) | 8b1f7849329ff9e20b8d222e88356569aa585393 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14925/8b1f7849329ff9e20b8d222e88356569aa585393/test_umath_complex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9647,
12,
2890,
4672,
619,
273,
1130,
18,
1126,
3816,
21,
15,
21,
78,
16,
374,
15,
22,
78,
16,
404,
15,
22,
78,
16,
1130,
18,
10625,
16,
1130,
18,
13569,
5717,
677,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9647,
12,
2890,
4672,
619,
273,
1130,
18,
1126,
3816,
21,
15,
21,
78,
16,
374,
15,
22,
78,
16,
404,
15,
22,
78,
16,
1130,
18,
10625,
16,
1130,
18,
13569,
5717,
677,
67,
... |
ops.extend(controller.update_function_ops(new_module, | new_function = controller.create_function(new_module, | def replace_generic(controller, pipeline, old_module, new_module, function_remap={}, src_port_remap={}, dst_port_remap={}, annotation_remap={}): ops = [] ops.extend(controller.delete_module_list_ops(pipeline, [old_module.id])) ops.append(('add', new_module)) for annotation in old_module.annotations: if annotation.key not in annotation_remap: annotation_key = annotation.key else: remap = annotation_remap[annotation.key] if remap is None: # don't add the annotation back in continue elif type(remap) != type(""): ops.extend(remap(annotation)) continue else: annotation_key = remap | a86f147e8adf8765e48f01a4a74e983d518ae3a3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/a86f147e8adf8765e48f01a4a74e983d518ae3a3/upgradeworkflow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1453,
67,
13540,
12,
5723,
16,
5873,
16,
1592,
67,
2978,
16,
394,
67,
2978,
16,
445,
67,
266,
1458,
28793,
1705,
67,
655,
67,
266,
1458,
28793,
3046,
67,
655,
67,
266,
1458,
28793,
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,
1453,
67,
13540,
12,
5723,
16,
5873,
16,
1592,
67,
2978,
16,
394,
67,
2978,
16,
445,
67,
266,
1458,
28793,
1705,
67,
655,
67,
266,
1458,
28793,
3046,
67,
655,
67,
266,
1458,
28793,
3... |
u = user.User(self.request, user.getUserId(self.request, username)) | u = user.User(request, user.getUserId(request, username)) | def _do_recover(request): _ = request.getText form = request.form if not request.cfg.mail_enabled: return _("""This wiki is not enabled for mail processing. | 428f89ce4f01ce5bae09341680f3ba7e9b303763 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/888/428f89ce4f01ce5bae09341680f3ba7e9b303763/recoverpass.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2896,
67,
266,
3165,
12,
2293,
4672,
389,
273,
590,
18,
588,
1528,
646,
273,
590,
18,
687,
309,
486,
590,
18,
7066,
18,
4408,
67,
5745,
30,
327,
389,
2932,
3660,
2503,
9050,
353... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2896,
67,
266,
3165,
12,
2293,
4672,
389,
273,
590,
18,
588,
1528,
646,
273,
590,
18,
687,
309,
486,
590,
18,
7066,
18,
4408,
67,
5745,
30,
327,
389,
2932,
3660,
2503,
9050,
353... |
self.Bind(wx.EVT_TASKBAR_CLICK, self.raiseParent) self.Bind(wx.EVT_TASKBAR_LEFT_UP, self.raiseParent) self.Bind(wx.EVT_TASKBAR_RIGHT_DOWN, self.raiseParent) self.SetIcon(DV.icon) | self.Bind(wx.EVT_TASKBAR_CLICK, self.onMenu) if DV.os == 'nt': self.Bind(wx.EVT_TASKBAR_LEFT_UP, self.raiseParent) | def __init__(self, parent): wx.TaskBarIcon.__init__(self) Damnlog('DamnTrayIcon initialized with parent window',parent) self.parent = parent self.parent.Show(False) self.parent.Iconize(True) # Releases system memory self.Bind(wx.EVT_TASKBAR_LEFT_DCLICK, self.raiseParent) self.Bind(wx.EVT_TASKBAR_CLICK, self.raiseParent) self.Bind(wx.EVT_TASKBAR_LEFT_UP, self.raiseParent) self.Bind(wx.EVT_TASKBAR_RIGHT_DOWN, self.raiseParent) self.SetIcon(DV.icon) Damnlog('DamnTrayIcon ready.') self.timer = -1 | b7d25df46cda9abe5d9a3b14b5e4ff8eca58617b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11142/b7d25df46cda9abe5d9a3b14b5e4ff8eca58617b/DamnVid.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
4672,
7075,
18,
2174,
5190,
5554,
16186,
2738,
972,
12,
2890,
13,
463,
301,
82,
1330,
2668,
40,
301,
82,
56,
435,
5554,
6454,
598,
982,
2742,
2187,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
4672,
7075,
18,
2174,
5190,
5554,
16186,
2738,
972,
12,
2890,
13,
463,
301,
82,
1330,
2668,
40,
301,
82,
56,
435,
5554,
6454,
598,
982,
2742,
2187,
... |
"verify that whichdb correctly sniffs the known hash v2 file" | def test_whichdb(self): "verify that whichdb correctly sniffs the known hash v2 file" self.assertEqual(whichdb.whichdb(findfile("185test.db")), "bsddb185") | 91ebf1ddb720d4a8920255c1f28ce99c6ca5caac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/91ebf1ddb720d4a8920255c1f28ce99c6ca5caac/test_bsddb185.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
12784,
1966,
12,
2890,
4672,
225,
365,
18,
11231,
5812,
12,
12784,
1966,
18,
12784,
1966,
12,
4720,
768,
2932,
30489,
3813,
18,
1966,
7923,
3631,
315,
2038,
449,
70,
30489,
792... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1842,
67,
12784,
1966,
12,
2890,
4672,
225,
365,
18,
11231,
5812,
12,
12784,
1966,
18,
12784,
1966,
12,
4720,
768,
2932,
30489,
3813,
18,
1966,
7923,
3631,
315,
2038,
449,
70,
30489,
792... | |
if colspans.has_key((j, i)): | if (j, i) in colSpanCells: | def _calc_width(self,availWidth,W=None): #comments added by Andy to Robin's slightly #terse variable names if not W: W = _calc_pc(self._argW,availWidth) #widths array #print 'widths array = %s' % str(self._colWidths) canv = getattr(self,'canv',None) saved = None | ed9b89c7e69c64a7ae0be13947d06bddc187b424 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ed9b89c7e69c64a7ae0be13947d06bddc187b424/tables.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
12448,
67,
2819,
12,
2890,
16,
842,
671,
2384,
16,
59,
33,
7036,
4672,
468,
9231,
3096,
635,
7835,
93,
358,
19686,
267,
1807,
21980,
468,
387,
307,
2190,
1257,
309,
486,
678,
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,
389,
12448,
67,
2819,
12,
2890,
16,
842,
671,
2384,
16,
59,
33,
7036,
4672,
468,
9231,
3096,
635,
7835,
93,
358,
19686,
267,
1807,
21980,
468,
387,
307,
2190,
1257,
309,
486,
678,
30,
... |
_run(mode, verbose, force, args, prefargs) | if mode == 'version': print 'Pimp version %s; module name is %s' % (PIMP_VERSION, __name__) else: _run(mode, verbose, force, args, prefargs) if __name__ != 'pimp_update': try: import pimp_update except ImportError: pass else: if pimp_update.PIMP_VERSION <= PIMP_VERSION: import warnings warnings.warn("pimp_update is version %s, not newer than pimp version %s" % (pimp_update.PIMP_VERSION, PIMP_VERSION)) else: from pimp_update import * | def _help(): print "Usage: pimp [options] -s [package ...] List installed status" print " pimp [options] -l [package ...] Show package information" print " pimp [options] -i package ... Install packages" print " pimp -d Dump database to stdout" print "Options:" print " -v Verbose" print " -f Force installation" print " -D dir Set destination directory (default: site-packages)" sys.exit(1) | 005fe6f20a68475eb007be99622a42047de0bdcf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/005fe6f20a68475eb007be99622a42047de0bdcf/pimp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5201,
13332,
1172,
315,
5357,
30,
293,
14532,
306,
2116,
65,
300,
87,
306,
5610,
1372,
65,
225,
987,
5876,
1267,
6,
1172,
315,
4202,
293,
14532,
306,
2116,
65,
300,
80,
306,
5610,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5201,
13332,
1172,
315,
5357,
30,
293,
14532,
306,
2116,
65,
300,
87,
306,
5610,
1372,
65,
225,
987,
5876,
1267,
6,
1172,
315,
4202,
293,
14532,
306,
2116,
65,
300,
80,
306,
5610,... |
QMessageBox.warning( None, "C4.5 plug-in", 'File c45.dll not found! For details, see: http://magix.fri.uni-lj.si/orange/doc/reference/C45Learner.asp', QMessageBox.Ok) | QMessageBox.warning(None, "Missing C4.5 plug-in", "C4.5 classifier requires a plug-in which needs to be built separately by the user due to copyright issues.\nSee: http://www.ailab.si/orange/doc/reference/C45Learner.htm for detailed instructions" , QMessageBox.Ok) | def setLearner(self): try: self.learner = orange.C45Learner(gainRatio=not self.infoGain, subset=self.subset, probThresh=self.probThresh, minObjs=self.useMinObjs and self.minObjs or 0, prune=self.prune, cf=self.cf/100., batch = not self.iterative, window=self.manualWindow and self.window or 0, increment=self.manualIncrement and self.increment or 0, trials=self.trials, convertToOrange = self.convertToOrange, storeExamples = 1) except: QMessageBox.warning( None, "C4.5 plug-in", 'File c45.dll not found! For details, see: http://magix.fri.uni-lj.si/orange/doc/reference/C45Learner.asp', QMessageBox.Ok) return | 04d9f49d69390f290af6b7645701e48242b4bd7d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6366/04d9f49d69390f290af6b7645701e48242b4bd7d/OWC45Tree.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
1682,
24834,
12,
2890,
4672,
775,
30,
365,
18,
298,
24834,
273,
578,
726,
18,
39,
7950,
1682,
24834,
12,
25540,
8541,
33,
902,
365,
18,
1376,
43,
530,
16,
7931,
33,
2890,
18,
15... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
1682,
24834,
12,
2890,
4672,
775,
30,
365,
18,
298,
24834,
273,
578,
726,
18,
39,
7950,
1682,
24834,
12,
25540,
8541,
33,
902,
365,
18,
1376,
43,
530,
16,
7931,
33,
2890,
18,
15... |
g = self.__class__(s, self._mangle_from_, self.__maxheaderlen) | g = self.clone(s) | def _handle_message_delivery_status(self, msg): # We can't just write the headers directly to self's file object # because this will leave an extra newline between the last header # block and the boundary. Sigh. blocks = [] for part in msg.get_payload(): s = StringIO() g = self.__class__(s, self._mangle_from_, self.__maxheaderlen) g.flatten(part, unixfrom=0) text = s.getvalue() lines = text.split('\n') # Strip off the unnecessary trailing empty line if lines and lines[-1] == '': blocks.append(NL.join(lines[:-1])) else: blocks.append(text) # Now join all the blocks with an empty line. This has the lovely # effect of separating each block with an empty line, but not adding # an extra one after the last one. self._fp.write(NL.join(blocks)) | 9da64eb307eacf1137c4ed86bae0736aad6f8069 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/9da64eb307eacf1137c4ed86bae0736aad6f8069/Generator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4110,
67,
2150,
67,
15703,
67,
2327,
12,
2890,
16,
1234,
4672,
468,
1660,
848,
1404,
2537,
1045,
326,
1607,
5122,
358,
365,
1807,
585,
733,
468,
2724,
333,
903,
8851,
392,
2870,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4110,
67,
2150,
67,
15703,
67,
2327,
12,
2890,
16,
1234,
4672,
468,
1660,
848,
1404,
2537,
1045,
326,
1607,
5122,
358,
365,
1807,
585,
733,
468,
2724,
333,
903,
8851,
392,
2870,
9... |
folderContext = self if not self.isPrincipiaFolderish: folderContext = self.aq_parent | folderContext = aq_inner(self) if not folderContext.isPrincipiaFolderish: folderContext = aq_parent(folderContext) | def toRelativePath(self, panelObjectPath): """ regenerate panelObjectPath, make it a relative path. path may be relative to this contentpanels or relate to the portal. - if panelObjectPath == '.', it means contentpanels it self - if panelObjectPath start with './', it means relative to the folderish context of this contentpanels - else, it means rlative to portal see also: getPanelObject """ panelContent = self.getPanelObject(panelObjectPath) if panelContent is None: return '.' | 5f673a59a132e227025fc2f72984328399fe606d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1807/5f673a59a132e227025fc2f72984328399fe606d/ContentPanels.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
16519,
12,
2890,
16,
6594,
921,
743,
4672,
3536,
20821,
6594,
921,
743,
16,
1221,
518,
279,
3632,
589,
18,
589,
2026,
506,
3632,
358,
333,
913,
7355,
10558,
578,
1279,
340,
358,
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,
358,
16519,
12,
2890,
16,
6594,
921,
743,
4672,
3536,
20821,
6594,
921,
743,
16,
1221,
518,
279,
3632,
589,
18,
589,
2026,
506,
3632,
358,
333,
913,
7355,
10558,
578,
1279,
340,
358,
3... |
self.body.append(self.starttag(node, 'dt', '')) | self.bodyOne = True self.visit_paragraph(node) self.body.append(self.start_charstyle % 'Strong Emphasis') | def visit_term(self, node): self.body.append(self.starttag(node, 'dt', '')) | 4f3175cae1eee1640728f93c57e26392c3a44d52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1278/4f3175cae1eee1640728f93c57e26392c3a44d52/OOwriter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
6408,
12,
2890,
16,
756,
4672,
365,
18,
3432,
18,
6923,
12,
2890,
18,
1937,
2692,
12,
2159,
16,
296,
7510,
2187,
875,
3719,
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,
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,
3757,
67,
6408,
12,
2890,
16,
756,
4672,
365,
18,
3432,
18,
6923,
12,
2890,
18,
1937,
2692,
12,
2159,
16,
296,
7510,
2187,
875,
3719,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
class PopupInfoWindow(wx.PopupWindow): """Adds a bit of text and mouse movement to the wx.PopupWindow""" | class PopupInfoWindow(wx.TipWindow): | def __init__(self, parent): style = wx.LC_REPORT|wx.LC_HRULES|wx.LC_VRULES prefix = 'spew' minid = 0 maxid = 15 rightalign = [SPEW_UP, SPEW_DOWN, SPEW_DLSIZE, SPEW_ULSIZE, SPEW_PEERPROGRESS, SPEW_PEERSPEED] centeralign = [SPEW_UNCHOKE, SPEW_LR, SPEW_INTERESTED, SPEW_CHOKING, SPEW_INTERESTING, SPEW_CHOKED, SPEW_SNUBBED] | d27ca84d609b7bdec5a280b89e15fce313d9ba8f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9686/d27ca84d609b7bdec5a280b89e15fce313d9ba8f/abcdetailframe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
4672,
2154,
273,
7075,
18,
13394,
67,
22710,
96,
27226,
18,
13394,
67,
44,
14920,
55,
96,
27226,
18,
13394,
67,
10986,
5595,
55,
225,
1633,
273,
296... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
4672,
2154,
273,
7075,
18,
13394,
67,
22710,
96,
27226,
18,
13394,
67,
44,
14920,
55,
96,
27226,
18,
13394,
67,
10986,
5595,
55,
225,
1633,
273,
296... |
return list( flatten_iter( nested_iter ) ) def flatten_iter( nested_iter, ignore_types = ( basestring, ) ): if isinstance( nested_iter, ignore_types ): return ( nested_iter, ) try: return chain( itertools.imap( flatten_iter, nested_iter ) ) except TypeError: return nested_iter | return list(iflatten(subject, iterable_test)) | def flatten( nested_iter, ignore_types = ( basestring, ) ): """flatten an iterable with possible nested iterables. Taken from the recipes in the itertools documentation, but improved to support multiple level lists and to maximize on-demand processing efficiency >>> flatten( ['a','b',['c','d',['e','f'],'g'],'h'] ) == ['a','b','c','d','e','f','g','h'] True Note this will normally ignore string types as iterables. Any set of iterables can be ignored by passing the set as ignore_types. >>> flatten( ['ab', 'c'] ) ['ab', 'c'] >>> flatten( ['ab', 'c'], () ) ['a', 'b', 'c'] """ return list( flatten_iter( nested_iter ) ) | 6d45df677efee32c2b562fa180aa20618e2d77b3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1110/6d45df677efee32c2b562fa180aa20618e2d77b3/itools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5341,
12,
4764,
67,
2165,
16,
2305,
67,
2352,
273,
261,
10699,
16,
262,
262,
30,
3536,
16940,
392,
6087,
598,
3323,
4764,
27447,
18,
399,
7940,
628,
326,
5863,
281,
316,
326,
13315,
73... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5341,
12,
4764,
67,
2165,
16,
2305,
67,
2352,
273,
261,
10699,
16,
262,
262,
30,
3536,
16940,
392,
6087,
598,
3323,
4764,
27447,
18,
399,
7940,
628,
326,
5863,
281,
316,
326,
13315,
73... |
if attrsD['rel'] == 'enclosure': self._start_enclosure(attrsD) | def _start_link(self, attrsD): attrsD.setdefault('rel', 'alternate') attrsD.setdefault('type', 'text/html') attrsD = self._itsAnHrefDamnIt(attrsD) if attrsD.has_key('href'): attrsD['href'] = self.resolveURI(attrsD['href']) expectingText = self.infeed or self.inentry or self.insource context = self._getContext() context.setdefault('links', []) context['links'].append(FeedParserDict(attrsD)) if attrsD['rel'] == 'enclosure': self._start_enclosure(attrsD) if attrsD.has_key('href'): expectingText = 0 if (attrsD.get('rel') == 'alternate') and (self.mapContentType(attrsD.get('type')) in self.html_types): context['link'] = attrsD['href'] else: self.push('link', expectingText) | 44482af2baebba8741223b8967e4efeaf8365c45 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/44482af2baebba8741223b8967e4efeaf8365c45/feedparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1937,
67,
1232,
12,
2890,
16,
3422,
40,
4672,
3422,
40,
18,
542,
1886,
2668,
2878,
2187,
296,
16025,
340,
6134,
3422,
40,
18,
542,
1886,
2668,
723,
2187,
296,
955,
19,
2620,
6134,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1937,
67,
1232,
12,
2890,
16,
3422,
40,
4672,
3422,
40,
18,
542,
1886,
2668,
2878,
2187,
296,
16025,
340,
6134,
3422,
40,
18,
542,
1886,
2668,
723,
2187,
296,
955,
19,
2620,
6134,... | |
label = "%s (%s)" % (element.name, element.label) | label = element.label | def visitRackmount(self, element): """ @param element the rackmount element """ | 4059895ae979e45b2af6c8bab14cbd78094b0d17 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5639/4059895ae979e45b2af6c8bab14cbd78094b0d17/rack2cairo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
54,
484,
4778,
12,
2890,
16,
930,
4672,
3536,
632,
891,
930,
326,
19495,
4778,
930,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
54,
484,
4778,
12,
2890,
16,
930,
4672,
3536,
632,
891,
930,
326,
19495,
4778,
930,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
navtrail_previous_links = bibformatadminlib.getnavtrail(''' > <a class=navtrail href="%s/admin/bibformat/bibformatadmin.py/kb_manage?ln=%s">%s</a> > %s''' % (config.weburl, ln, _("Manage Knowledge Bases"), _("Delete Knowledge Base"))) | navtrail_previous_links = bibformatadminlib.getnavtrail(''' > <a class="navtrail" href="%s/admin/bibformat/bibformatadmin.py/kb_manage?ln=%s">%s</a> > %s''' % (config.weburl, ln, _("Manage Knowledge Bases"), _("Delete Knowledge Base"))) | def kb_delete(req, kb, ln=config.cdslang, chosen_option="", sortby="to"): """ Deletes an existing kb @param kb the kb id to delete """ ln = wash_language(ln) _ = gettext_set_language(ln) navtrail_previous_links = bibformatadminlib.getnavtrail(''' > <a class=navtrail href="%s/admin/bibformat/bibformatadmin.py/kb_manage?ln=%s">%s</a> > %s''' % (config.weburl, ln, _("Manage Knowledge Bases"), _("Delete Knowledge Base"))) try: uid = getUid(req) except MySQLdb.Error, e: return error_page(req) (auth_code, auth_msg) = check_user(req, 'cfgbibformat') if not auth_code: kb_id = wash_url_argument(kb, 'int') kb_name = bibformatadminlib.get_kb_name(kb_id) if kb_name is None: return page(title=_("Unknown Knowledge Base"), body = "", language=ln, navtrail = navtrail_previous_links, errors = [("ERR_BIBFORMAT_KB_ID_UNKNOWN", kb)], lastupdated=__lastupdated__, req=req) #Ask confirmation to user if not already done chosen_option = wash_url_argument(chosen_option, 'str') if chosen_option == "": return dialog_box(req=req, ln=ln, title="Delete %s" % kb_name, message="""Are you sure you want to delete knowledge base <i>%s</i>?""" % kb_name, navtrail=navtrail_previous_links, options=[_("Cancel"), _("Delete")]) elif chosen_option==_("Delete"): bibformatadminlib.delete_kb(kb_name) redirect_to_url(req, "kb_manage?ln=%(ln)s" % {'ln':ln}) else: navtrail_previous_links = bibformatadminlib.getnavtrail(''' > <a class=navtrail href="%s/admin/bibformat/bibformatadmin.py/kb_manage">%s</a>'''%(config.weburl, _("Manage Knowledge Bases"))) return page_not_authorized(req=req, text=auth_msg, navtrail=navtrail_previous_links) | e3c65e7c4a0899b02ece5dff48dab4e0925dd99f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2763/e3c65e7c4a0899b02ece5dff48dab4e0925dd99f/bibformatadmin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9182,
67,
3733,
12,
3658,
16,
9182,
16,
7211,
33,
1425,
18,
4315,
2069,
539,
16,
10447,
67,
3482,
1546,
3113,
1524,
1637,
1546,
869,
6,
4672,
3536,
17973,
392,
2062,
9182,
225,
632,
89... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9182,
67,
3733,
12,
3658,
16,
9182,
16,
7211,
33,
1425,
18,
4315,
2069,
539,
16,
10447,
67,
3482,
1546,
3113,
1524,
1637,
1546,
869,
6,
4672,
3536,
17973,
392,
2062,
9182,
225,
632,
89... |
self["SeekActions"] = InfoBarSeekActionMap(self, actionmap, | self["SeekActions"] = InfoBarSeekActionMap(self, actionmap, | def action(self, contexts, action): print "action:", action if action[:5] == "seek:": time = int(action[5:]) self.screen.seekRelative(time * 90000) if config.usage.show_infobar_on_skip.value: self.screen.showAfterSeek() return 1 else: return HelpableActionMap.action(self, contexts, action) | fb1e03cf013bb255146c445e5f2c748bab21b6d8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6652/fb1e03cf013bb255146c445e5f2c748bab21b6d8/InfoBarGenerics.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1301,
12,
2890,
16,
5781,
16,
1301,
4672,
1172,
315,
1128,
2773,
16,
1301,
309,
1301,
10531,
25,
65,
422,
315,
16508,
2773,
30,
813,
273,
509,
12,
1128,
63,
25,
30,
5717,
365,
18,
92... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1301,
12,
2890,
16,
5781,
16,
1301,
4672,
1172,
315,
1128,
2773,
16,
1301,
309,
1301,
10531,
25,
65,
422,
315,
16508,
2773,
30,
813,
273,
509,
12,
1128,
63,
25,
30,
5717,
365,
18,
92... |
if options.addpfx.get().lstrip()=='BOTH' and isec==58: | if options.addpfx.get().lstrip()=='BOTH' and isec==59: TxFirst.set(1-TxFirst.get()) if options.addpfx.get().lstrip()=='BOTH' and \ mode=='JTMS' and isec==29: | def update(): global root_geom,isec0,naz,nel,ndmiles,ndkm,nhotaz,nhotabetter,nopen, \ im,pim,cmap0,isync,isyncMS,isync6m,isync65,isync_save,idsec, \ first,itol,txsnrdb,tx6alt utc=time.gmtime(time.time()+0.1*idsec) isec=utc[5] if isec != isec0: #Do once per second isec0=isec t=time.strftime('%Y %b %d\n%H:%M:%S',utc) Audio.gcom2.utcdate=t[:12] Audio.gcom2.iyr=utc[0] Audio.gcom2.imo=utc[1] Audio.gcom2.ida=utc[2] Audio.gcom2.ihr=utc[3] Audio.gcom2.imi=utc[4] Audio.gcom2.isc=utc[5] ldate.configure(text=t) root_geom=root.geometry() utchours=utc[3]+utc[4]/60.0 + utc[5]/3600.0 naz,nel,ndmiles,ndkm,nhotaz,nhotabetter=Audio.azdist0( \ options.MyGrid.get().upper(),HisGrid.get().upper(),utchours) azdist() g.nfreq=nfreq.get() if options.addpfx.get().lstrip()=='BOTH' and isec==58: TxFirst.set(1-TxFirst.get()) if Audio.gcom2.ndecoding==0: g.AzSun,g.ElSun,g.AzMoon,g.ElMoon,g.AzMoonB,g.ElMoonB,g.ntsky, \ g.ndop,g.ndop00,g.dbMoon,g.RAMoon,g.DecMoon,g.HA8,g.Dgrd, \ g.sd,g.poloffset,g.MaxNR,g.dfdt,g.dfdt0,g.RaAux,g.DecAux, \ g.AzAux,g.ElAux = Audio.astro0(utc[0],utc[1],utc[2], \ utchours,nfreq.get(),options.MyGrid.get().upper(), \ options.auxra.get()+(' '*9)[:9], \ options.auxdec.get()+(' '*9)[:9]) if len(HisGrid.get().strip())<4: g.ndop=g.ndop00 g.dfdt=g.dfdt0 Audio.gcom2.ntx2=0 if ntx.get()==1 and noshjt65.get()==1: Audio.gcom2.ntx2=1 if mode.get()[:4]=='JT64' or mode.get()[:3]=='JT8': graph2.delete(ALL) graph2.create_text(80,13,anchor=CENTER,text="Moon",font=g2font) graph2.create_text(13,37,anchor=W, text="Az: %6.2f" % g.AzMoon,font=g2font) graph2.create_text(13,61,anchor=W, text="El: %6.2f" % g.ElMoon,font=g2font) graph2.create_text(13,85,anchor=W, text="Dop:%6d" % g.ndop,font=g2font) graph2.create_text(13,109,anchor=W,text="Dgrd:%5.1f" % g.Dgrd,font=g2font) if (mode.get()[:4]=='JT64' or mode.get()[:3]=='JT8' or \ mode.get()[:5]=='Iscat') and g.freeze_decode: itol=2 ltol.configure(text='Tol '+str(50)) Audio.gcom2.dftolerance=50 nfreeze.set(1) Audio.gcom2.nfreeze=1 if Audio.gcom2.monitoring: Audio.gcom2.ndecoding=1 Audio.gcom2.nagain=0 else: Audio.gcom2.ndecoding=4 Audio.gcom2.nagain=1 g.freeze_decode=0 n=-99 g.rms=g.rms+0.001 if g.rms > 0: n=int(20.0*log10(g.rms/770.0+0.01)) else: print "RMS noise:", g.rms, " out of range." t="Rx noise:%3d dB" % (n,) if n>=-10 and n<=10: msg4.configure(text=t,bg='gray85') else: msg4.configure(text=t,bg='red') t=g.ftnstr(Audio.gcom2.decodedfile) | a756e6a22ac9bef80191b2c2a1ce1c168d584cd7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2394/a756e6a22ac9bef80191b2c2a1ce1c168d584cd7/wsjt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
13332,
2552,
1365,
67,
10049,
16,
291,
557,
20,
16,
82,
1561,
16,
3084,
16,
4880,
81,
1449,
16,
82,
2883,
81,
16,
82,
15224,
1561,
16,
82,
15224,
378,
11214,
16,
82,
3190,
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,
1089,
13332,
2552,
1365,
67,
10049,
16,
291,
557,
20,
16,
82,
1561,
16,
3084,
16,
4880,
81,
1449,
16,
82,
2883,
81,
16,
82,
15224,
1561,
16,
82,
15224,
378,
11214,
16,
82,
3190,
16,
... |
self.ccAddLayerAction.setIconSet(QIconSet(self.image26)) | self.ccAddLayerAction.setIconSet(QIconSet(self.image20)) | def __init__(self,parent = None,name = None,fl = 0): QMainWindow.__init__(self,parent,name,fl) self.statusBar() | 2bdc60455ab85cd2792604c15ae9034d3632b0df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/2bdc60455ab85cd2792604c15ae9034d3632b0df/MainWindowUI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2938,
273,
599,
16,
529,
273,
599,
16,
2242,
273,
374,
4672,
2238,
6376,
3829,
16186,
2738,
972,
12,
2890,
16,
2938,
16,
529,
16,
2242,
13,
365,
18,
23... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2938,
273,
599,
16,
529,
273,
599,
16,
2242,
273,
374,
4672,
2238,
6376,
3829,
16186,
2738,
972,
12,
2890,
16,
2938,
16,
529,
16,
2242,
13,
365,
18,
23... |
keywords=dict((k, (fn2index[v[0]],) + v[1:]) for k, v in self.get_keyword_map().iteritems()), | descrefs=self.get_descrefs(fn2index), modules=self.get_modules(fn2index), | def freeze(self): """Create a usable data structure for serializing.""" filenames = self._titles.keys() titles = self._titles.values() fn2index = dict((f, i) for (i, f) in enumerate(filenames)) return dict( filenames=filenames, titles=titles, terms=dict((k, [fn2index[fn] for fn in v]) for (k, v) in self._mapping.iteritems()), keywords=dict((k, (fn2index[v[0]],) + v[1:]) for k, v in self.get_keyword_map().iteritems()), desctypes=dict((v, k) for (k, v) in self._desctypes.items()), ) | 0cc9cc5eaab5f76da7e3e52a5f0891dc3e6a2e14 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5532/0cc9cc5eaab5f76da7e3e52a5f0891dc3e6a2e14/search.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16684,
12,
2890,
4672,
3536,
1684,
279,
15603,
501,
3695,
364,
2734,
6894,
12123,
9066,
273,
365,
6315,
17643,
18,
2452,
1435,
14693,
273,
365,
6315,
17643,
18,
2372,
1435,
2295,
22,
1615,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16684,
12,
2890,
4672,
3536,
1684,
279,
15603,
501,
3695,
364,
2734,
6894,
12123,
9066,
273,
365,
6315,
17643,
18,
2452,
1435,
14693,
273,
365,
6315,
17643,
18,
2372,
1435,
2295,
22,
1615,... |
self.view = views.items.filterWithIndex(indexes.itemsByChannelFolder, folder) | self.view = views.items.filterWithIndex( indexes.itemsByChannelFolder, folder).filter(filters.uniqueItems) | def __init__(self, folder): self.view = views.items.filterWithIndex(indexes.itemsByChannelFolder, folder) self.id = folder.id ItemTrackerBase.__init__(self) | ff5a09d10dd1f911803ffa72cc14fff392f85767 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12354/ff5a09d10dd1f911803ffa72cc14fff392f85767/messagehandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3009,
4672,
365,
18,
1945,
273,
7361,
18,
3319,
18,
2188,
1190,
1016,
12,
5596,
18,
3319,
858,
2909,
3899,
16,
3009,
2934,
2188,
12,
6348,
18,
6270,
3126... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
2738,
972,
12,
2890,
16,
3009,
4672,
365,
18,
1945,
273,
7361,
18,
3319,
18,
2188,
1190,
1016,
12,
5596,
18,
3319,
858,
2909,
3899,
16,
3009,
2934,
2188,
12,
6348,
18,
6270,
3126... |
doc = doc and '<tt>%s</tt>' % doc return '<dl><dt>%s<dd>%s</dl>\n' % (decl, self.small(doc)) | doc = doc and '<dd>' + self.small('<tt>%s</tt>' % doc) return '<dl><dt>%s%s</dl>\n' % (decl, doc) | def docroutine(self, object, name=None, funcs={}, classes={}, methods={}, cl=None): """Produce HTML documentation for a function or method object.""" realname = object.__name__ name = name or realname anchor = (cl and cl.__name__ or '') + '-' + name note = '' skipdocs = 0 if inspect.ismethod(object): if cl: if object.im_class is not cl: base = object.im_class url = '#%s-%s' % (base.__name__, name) basename = base.__name__ if base.__module__ != cl.__module__: url = base.__module__ + '.html' + url basename = base.__module__ + '.' + basename note = ' from <a href="%s">%s</a>' % (url, basename) skipdocs = 1 else: note = (object.im_self and ' method of ' + self.repr(object.im_self) or ' unbound %s method' % object.im_class.__name__) object = object.im_func | 4483cbd7eb6854684bc5af9c43d558ab8a2bcacf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/4483cbd7eb6854684bc5af9c43d558ab8a2bcacf/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
22640,
12,
2890,
16,
733,
16,
508,
33,
7036,
16,
15630,
28793,
3318,
28793,
2590,
28793,
927,
33,
7036,
4672,
3536,
25884,
3982,
7323,
364,
279,
445,
578,
707,
733,
12123,
2863,
529... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
22640,
12,
2890,
16,
733,
16,
508,
33,
7036,
16,
15630,
28793,
3318,
28793,
2590,
28793,
927,
33,
7036,
4672,
3536,
25884,
3982,
7323,
364,
279,
445,
578,
707,
733,
12123,
2863,
529... |
gLogger.info("[%s] MigratingToMigrated: Found no 'Migrating' files." % se) | gLogger.info( "[%s] MigratingToMigrated: Found no 'Migrating' files." % se ) | def MigratingToMigrated(self,se): """ Obtain the active files from the migration monitoring db and check their status """ # First get the migrating files from the database gLogger.info("[%s] MigratingToMigrated: Attempting to obtain 'Migrating' files." % se) res = self.__getFiles(se,'Migrating') if not res['OK']: gLogger.error("[%s] MigratingToMigrated: Failed to get 'Migrating' files." % se, res['Message']) return res pfnIDs = res['Value']['PFNIDs'] if not pfnIDs: gLogger.info("[%s] MigratingToMigrated: Found no 'Migrating' files." % se) return S_OK() migratingFiles = res['Value']['MigratingFiles'] gLogger.info("[%s] MigratingToMigrated: Found %d 'Migrating' files." % (se, len(pfnIDs))) gMonitor.addMark("MigratingFiles%s" % se,len(pfnIDs)) gLogger.info("[%s] MigratingToMigrated: Obtaining physical file metadata for 'Migrating' files." % se) startTime = datetime.datetime.utcnow() res = self.__getMigratedFiles(se,pfnIDs.keys()) if not res['OK']: gLogger.error("[%s] MigratingToMigrated: Failed to get 'Migrating' file metadata." % se, res['Message']) return res assumedEndTime = datetime.datetime.utcnow()-((datetime.datetime.utcnow()-startTime)/2) # Assumed that the files are found migrated midway through obtaining the metadata previousMonitorTime = self.lastMonitors[se] self.lastMonitors[se] = datetime.datetime.utcnow() terminal = res['Value']['Terminal'] migrated = res['Value']['Migrated'] | 9a22336d92a455ef5a2bab49d70e2e3a11f3d910 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/9a22336d92a455ef5a2bab49d70e2e3a11f3d910/MigrationMonitoringAgent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
490,
2757,
1776,
774,
25483,
690,
12,
2890,
16,
307,
4672,
3536,
24850,
326,
2695,
1390,
628,
326,
6333,
16309,
1319,
471,
866,
3675,
1267,
3536,
468,
5783,
336,
326,
4196,
1776,
1390,
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,
490,
2757,
1776,
774,
25483,
690,
12,
2890,
16,
307,
4672,
3536,
24850,
326,
2695,
1390,
628,
326,
6333,
16309,
1319,
471,
866,
3675,
1267,
3536,
468,
5783,
336,
326,
4196,
1776,
1390,
6... |
if action != _("Browse") and p1: | if action != _("Browse") and pl: | def tmpl_search_box(self, ln, weburl, as, cc, cc_intl, ot, sp, action, fieldslist, f1, f2, f3, m1, m2, m3, p1, p2, p3, op1, op2, rm, p, f, coll_selects, d1y, d2y, d1m, d2m, d1d, d2d, sort_formats, sf, so, ranks, sc, rg, formats, of): """ Displays the *Nearest search terms* box | 8709b84a273b903beeb7625798cd1dae27009de6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/8709b84a273b903beeb7625798cd1dae27009de6/websearch_templates.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10720,
67,
3072,
67,
2147,
12,
2890,
16,
7211,
16,
3311,
718,
16,
487,
16,
4946,
16,
4946,
67,
474,
80,
16,
15835,
16,
1694,
16,
1301,
16,
1466,
1098,
16,
284,
21,
16,
284,
22,
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,
10720,
67,
3072,
67,
2147,
12,
2890,
16,
7211,
16,
3311,
718,
16,
487,
16,
4946,
16,
4946,
67,
474,
80,
16,
15835,
16,
1694,
16,
1301,
16,
1466,
1098,
16,
284,
21,
16,
284,
22,
16,... |
if ' ' in script: | if self.split_cmd and ' ' in script: | def run(self, script, *args, **kw): """ Run the command, with the given arguments. The ``script`` argument can have space-separated arguments, or you can use the positional arguments. | f858820cb544ceddbfc6e8a8a20f52e4ad6c8a39 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8710/f858820cb544ceddbfc6e8a8a20f52e4ad6c8a39/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
16,
2728,
16,
380,
1968,
16,
2826,
9987,
4672,
3536,
1939,
326,
1296,
16,
598,
326,
864,
1775,
18,
225,
1021,
12176,
4263,
10335,
1237,
848,
1240,
3476,
17,
24622,
1775,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
16,
2728,
16,
380,
1968,
16,
2826,
9987,
4672,
3536,
1939,
326,
1296,
16,
598,
326,
864,
1775,
18,
225,
1021,
12176,
4263,
10335,
1237,
848,
1240,
3476,
17,
24622,
1775,
... |
self.editor.InsertText(self.editor.GetCurrentPos(), quote(relative_uri(self.htmlfile(source), target))) | self.editor.InsertText( self.editor.GetCurrentPos(), quote(relative_path(self.htmlfile(source), target))) | def on_insert_path(self, event): if self.project <> None: item = self.activeitem if item != self.root: source = self.tree.GetItemText(item) dlg = wxFileDialog (self, "Choose file", self.project.directory, '', '*.*', wxOPEN|wxFILE_MUST_EXIST) if dlg.ShowModal() == wxID_OK: target = dlg.GetPath() self.editor.InsertText(self.editor.GetCurrentPos(), quote(relative_uri(self.htmlfile(source), target))) dlg.Destroy() else: customMsgBox(self, 'No file selected.', 'wakeup') | 3ba07fe9c5b636ef447aa47e40d9f258c1d32e0a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1278/3ba07fe9c5b636ef447aa47e40d9f258c1d32e0a/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
6387,
67,
803,
12,
2890,
16,
871,
4672,
309,
365,
18,
4406,
2813,
599,
30,
761,
273,
365,
18,
3535,
1726,
309,
761,
480,
365,
18,
3085,
30,
1084,
273,
365,
18,
3413,
18,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
6387,
67,
803,
12,
2890,
16,
871,
4672,
309,
365,
18,
4406,
2813,
599,
30,
761,
273,
365,
18,
3535,
1726,
309,
761,
480,
365,
18,
3085,
30,
1084,
273,
365,
18,
3413,
18,
9... |
keys = tokens.keys() | keys = list(tokens.keys()) | def main(): import re import sys args = sys.argv[1:] inFileName = args and args[0] or "Include/token.h" outFileName = "Lib/token.py" if len(args) > 1: outFileName = args[1] try: fp = open(inFileName) except IOError as err: sys.stdout.write("I/O error: %s\n" % str(err)) sys.exit(1) lines = fp.read().split("\n") fp.close() prog = re.compile( "#define[ \t][ \t]*([A-Z0-9][A-Z0-9_]*)[ \t][ \t]*([0-9][0-9]*)", re.IGNORECASE) tokens = {} for line in lines: match = prog.match(line) if match: name, val = match.group(1, 2) val = int(val) tokens[val] = name # reverse so we can sort them... keys = tokens.keys() keys.sort() # load the output skeleton from the target: try: fp = open(outFileName) except IOError as err: sys.stderr.write("I/O error: %s\n" % str(err)) sys.exit(2) format = fp.read().split("\n") fp.close() try: start = format.index("#--start constants--") + 1 end = format.index("#--end constants--") except ValueError: sys.stderr.write("target does not contain format markers") sys.exit(3) lines = [] for val in keys: lines.append("%s = %d" % (tokens[val], val)) format[start:end] = lines try: fp = open(outFileName, 'w') except IOError as err: sys.stderr.write("I/O error: %s\n" % str(err)) sys.exit(4) fp.write("\n".join(format)) fp.close() | e06feb6ec93d6aad0b0d9487b4094324eb14d2ce /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/e06feb6ec93d6aad0b0d9487b4094324eb14d2ce/token.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
1930,
283,
1930,
2589,
833,
273,
2589,
18,
19485,
63,
21,
26894,
316,
4771,
273,
833,
471,
833,
63,
20,
65,
578,
315,
8752,
19,
2316,
18,
76,
6,
596,
4771,
273,
315,
566... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
1930,
283,
1930,
2589,
833,
273,
2589,
18,
19485,
63,
21,
26894,
316,
4771,
273,
833,
471,
833,
63,
20,
65,
578,
315,
8752,
19,
2316,
18,
76,
6,
596,
4771,
273,
315,
566... |
def __init__(self, polynomial, name=None, check=True, embedding=None, latex_name=None): | def __init__(self, polynomial, name=None, latex_name=None, check=True, embedding=None): | def __init__(self, polynomial, name=None, check=True, embedding=None, latex_name=None): """ Create a quadratic number field. EXAMPLES:: sage: k.<a> = QuadraticField(5, check=False); k Number Field in a with defining polynomial x^2 - 5 Don't do this:: sage: k.<a> = QuadraticField(4, check=False); k Number Field in a with defining polynomial x^2 - 4 | 6d9aae795dc714b459dfe86a8e73ff40a00a49c0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/6d9aae795dc714b459dfe86a8e73ff40a00a49c0/number_field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
16991,
16,
508,
33,
7036,
16,
25079,
67,
529,
33,
7036,
16,
866,
33,
5510,
16,
15853,
33,
7036,
4672,
3536,
1788,
279,
26146,
1300,
652,
18,
225,
5675,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16991,
16,
508,
33,
7036,
16,
25079,
67,
529,
33,
7036,
16,
866,
33,
5510,
16,
15853,
33,
7036,
4672,
3536,
1788,
279,
26146,
1300,
652,
18,
225,
5675,
... |
if reg in _REGMAP: return idaapi.splitSRarea1(ea, _REGMAP[reg], value, tag) | reg = idaapi.str2reg(reg); if reg >= 0: return idaapi.splitSRarea1(ea, reg, value, tag) | def SetRegEx(ea, reg, value, tag): """ Set value of a segment register. @param ea: linear address @param reg: name of a register, like "cs", "ds", "es", etc. @param value: new value of the segment register. @param tag: of SR_... constants @note: IDA keeps tracks of all the points where segment register change their values. This function allows you to specify the correct value of a segment register if IDA is not able to find the corrent value. See also SetReg() compatibility macro. """ if reg in _REGMAP: return idaapi.splitSRarea1(ea, _REGMAP[reg], value, tag) else: return False | 7f19a023f9ec250341eb0a0b11d72bd271383753 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6984/7f19a023f9ec250341eb0a0b11d72bd271383753/idc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1000,
1617,
424,
12,
24852,
16,
960,
16,
460,
16,
1047,
4672,
3536,
1000,
460,
434,
279,
3267,
1744,
18,
225,
632,
891,
24164,
30,
9103,
1758,
632,
891,
960,
30,
508,
434,
279,
1744,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1000,
1617,
424,
12,
24852,
16,
960,
16,
460,
16,
1047,
4672,
3536,
1000,
460,
434,
279,
3267,
1744,
18,
225,
632,
891,
24164,
30,
9103,
1758,
632,
891,
960,
30,
508,
434,
279,
1744,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.