rem stringlengths 1 226k | add stringlengths 0 227k | context stringlengths 6 326k | meta stringlengths 143 403 | input_ids listlengths 256 256 | attention_mask listlengths 256 256 | labels listlengths 128 128 |
|---|---|---|---|---|---|---|
return "Torsion quotient of %s by %s" % (self.V(), self.W()) | return "Quotient with torsion of %s by %s" % (self.V(), self.W()) | def _repr_(self): r""" Return a string representation of ``self``. | 2ecb64877587a338c723df487639345b09bed118 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/2ecb64877587a338c723df487639345b09bed118/toric_lattice.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
12715,
67,
12,
2890,
4672,
436,
8395,
2000,
279,
533,
4335,
434,
12176,
2890,
68,
8338,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
12715,
67,
12,
2890,
4672,
436,
8395,
2000,
279,
533,
4335,
434,
12176,
2890,
68,
8338,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.digits = 1 | self.digits = 0 | def __init__ (self, callback, lower, upper, integer): gtk.VBox.__init__ (self) diff = upper - lower self.isInteger = integer if integer: step = 1 page = (diff+4) / 5 self.digits = 1 else: self.digits = -int(math.floor(math.log10(diff) + 0.5)) + 3 step = math.pow(10, -self.digits + 1) page = step * 10 if self.digits < 0: self.digits = 0 self.callback = callback self.adjustment = gtk.Adjustment (lower, lower, upper, step, page) self.spinner = gtk.SpinButton (self.adjustment, step, self.digits) self.spinner.set_numeric (TRUE) self.spinner.show() self.pack_start (self.spinner, FALSE, FALSE, 0) if not integer or diff >= 20: self.slider = gtk.HScale (self.adjustment) self.slider.set_size_request (200, -1) self.slider.set_draw_value (FALSE) self.slider.show() self.pack_start (self.slider, FALSE, FALSE, 0) self.adjConn = self.adjustment.connect ("value-changed", callback) | d189593b27596492c1a1e5cd0bf35d77a4719009 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4580/d189593b27596492c1a1e5cd0bf35d77a4719009/driconf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
2890,
16,
1348,
16,
2612,
16,
3854,
16,
3571,
4672,
22718,
18,
58,
3514,
16186,
2738,
972,
261,
2890,
13,
3122,
273,
3854,
300,
2612,
365,
18,
291,
4522,
273,
357... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
2890,
16,
1348,
16,
2612,
16,
3854,
16,
3571,
4672,
22718,
18,
58,
3514,
16186,
2738,
972,
261,
2890,
13,
3122,
273,
3854,
300,
2612,
365,
18,
291,
4522,
273,
357... |
do_replacement(id, ' ',false); | do_replacement(id, ' ',false); | def javascript(): s = async_lib() s+= r""" | 40481c1b15104046a00992f4301d508a3d319d6e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/40481c1b15104046a00992f4301d508a3d319d6e/js.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11341,
13332,
272,
273,
4326,
67,
2941,
1435,
272,
15,
33,
436,
8395,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11341,
13332,
272,
273,
4326,
67,
2941,
1435,
272,
15,
33,
436,
8395,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
super(HttpDaemon, self).__init__(interface, port, handler=SecureMultiHandler2) | super(HttpSDaemon, self).__init__(interface, port, handler=SecureMultiHandler2) | def __init__(self, interface, port): try: super(HttpDaemon, self).__init__(interface, port, handler=SecureMultiHandler2) except SSLError, e: netsvc.Logger().notifyChannel( 'httpd-ssl', netsvc.LOG_CRITICAL, "Can not load the certificate and/or the private key files") raise | 0487af990e18919eee5c8bf716776c759fe420a3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/0487af990e18919eee5c8bf716776c759fe420a3/http_server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1560,
16,
1756,
4672,
775,
30,
2240,
12,
2940,
9903,
8636,
16,
365,
2934,
972,
2738,
972,
12,
5831,
16,
1756,
16,
1838,
33,
12834,
5002,
1503,
22,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1560,
16,
1756,
4672,
775,
30,
2240,
12,
2940,
9903,
8636,
16,
365,
2934,
972,
2738,
972,
12,
5831,
16,
1756,
16,
1838,
33,
12834,
5002,
1503,
22,
13,
... |
port_util.gbps_transmitted = AVG_PKT_SIZE * \ | port_util.bps_transmitted = AVG_PKT_SIZE * \ | def get_latest_port_gbps(self, time_consistent=True): port_utilizations = [] # Look at the latest reply epoch # For each switch get any snapshot that is ready with # collected for the latest reply epoch # Go through that snapshot and pull out the port # info # Create portutilization instance: # [dpid,port,gbps_transmitted,gbps_received] for dpid in self.switches: # Get the latest snapshot for each switch latest_snapshot = self.get_latest_switch_stats(dpid) # If there's a recent snapshot see if it's ready (complete) # AND for the most recent collection epoch if latest_snapshot != None and latest_snapshot.ready(): #lg.debug( "found latest snapshot for dpid 0x%x" % (dpid) ) # If we want the snapshots to all be from the same # most recent collection epoch then ignore the ones that aren't if time_consistent and (latest_snapshot.collection_epoch != \ self.max_stats_reply_epoch): #lg.debug( "Consistent time required, skipping snaphost" ) continue #if latest_snapshot.ready() and \ #latest_snapshot.collection_epoch\ #== self.max_stats_reply_epoch: # Now go thru the snapshot's port info and # create port utilization instances and # add them to the list for port in latest_snapshot.port_info: portinfo = latest_snapshot.port_info[port] port_util = PortUtilization() port_util.dpid = dpid port_util.port = portinfo.port_number if not FAKE_BPS_FROM_PKTS: port_util.gbps_transmitted = \ portinfo.estimate_bits_sent_per_sec()/1e9 port_util.gbps_received = \ portinfo.estimate_bits_received_per_sec()/1e9 else: port_util.gbps_transmitted = AVG_PKT_SIZE * \ portinfo.estimate_packets_sent_per_sec() port_util.gbps_received = AVG_PKT_SIZE * \ portinfo.estimate_packets_received_per_sec() port_utilizations.append(port_util) else: pass | 7ac8a1fbddf31c441a2860afea03f1182e25f717 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11602/7ac8a1fbddf31c441a2860afea03f1182e25f717/monitoring.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
13550,
67,
655,
67,
4490,
1121,
12,
2890,
16,
813,
67,
16952,
33,
5510,
4672,
1756,
67,
1367,
7089,
273,
5378,
468,
10176,
622,
326,
4891,
4332,
7632,
468,
2457,
1517,
1620,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
13550,
67,
655,
67,
4490,
1121,
12,
2890,
16,
813,
67,
16952,
33,
5510,
4672,
1756,
67,
1367,
7089,
273,
5378,
468,
10176,
622,
326,
4891,
4332,
7632,
468,
2457,
1517,
1620,
3... |
self.suits.append(SuitStack(self, i)) | x = x + XSPACING self.suits.append(SuitStack(x, y, self)) x = MARGIN y = y + YSPACING | def __init__(self, master): | 1b2b53a25d27d96f60926802226dd375767cb3b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1b2b53a25d27d96f60926802226dd375767cb3b2/solitaire.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4171,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4171,
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... |
def md5_check(file, checksum): | def md5_check(self, file, checksum): | def md5_check(file, checksum): data = open(file, 'rb') #local = md5_string(data) if checksum == md5_string(data): return True return False | 43ad714260de26301e9353209005b0a6d420abe3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12499/43ad714260de26301e9353209005b0a6d420abe3/pypt_core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3481,
25,
67,
1893,
12,
2890,
16,
585,
16,
6697,
4672,
501,
273,
1696,
12,
768,
16,
296,
6731,
6134,
468,
3729,
273,
3481,
25,
67,
1080,
12,
892,
13,
309,
6697,
422,
3481,
25,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3481,
25,
67,
1893,
12,
2890,
16,
585,
16,
6697,
4672,
501,
273,
1696,
12,
768,
16,
296,
6731,
6134,
468,
3729,
273,
3481,
25,
67,
1080,
12,
892,
13,
309,
6697,
422,
3481,
25,
67,
... |
self.currentSlotItem().delete_cb() | if self.currentSlotItem(): self.currentSlotItem().delete_cb() | def slotListKeyReleaseEvent(self,e): if e.key() == Qt.Key_Delete: e.accept() self.currentSlotItem().delete_cb() else: e.ignore() | 5562b04588fc91c636757cb75f4cd6e3b6ec0e09 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12631/5562b04588fc91c636757cb75f4cd6e3b6ec0e09/swine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4694,
682,
653,
7391,
1133,
12,
2890,
16,
73,
4672,
309,
425,
18,
856,
1435,
422,
7354,
18,
653,
67,
2613,
30,
425,
18,
9436,
1435,
309,
365,
18,
2972,
8764,
1180,
13332,
365,
18,
29... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4694,
682,
653,
7391,
1133,
12,
2890,
16,
73,
4672,
309,
425,
18,
856,
1435,
422,
7354,
18,
653,
67,
2613,
30,
425,
18,
9436,
1435,
309,
365,
18,
2972,
8764,
1180,
13332,
365,
18,
29... |
continue if line == '{': skip_next_line = True | def CheckChange(input_api, output_api): """Checks the memcheck suppressions files for bad data.""" errors = [] skip_next_line = False func_re = input_api.re.compile('[a-z_.]+\(.+\)$') for f, line_num, line in input_api.RightHandSideLines(lambda x: x.LocalPath().endswith('.txt')): line = line.lstrip() if line.startswith('#') or not line: continue if skip_next_line: skip_next_line = False continue if (line.startswith('fun:') or line.startswith('obj:') or line.startswith('Memcheck:') or line == '}' or line == '...'): continue if func_re.match(line): continue if line == '{': skip_next_line = True continue errors.append('"%s" is probably wrong: %s line %s' % (line, f.LocalPath(), line_num)) if errors: return [output_api.PresubmitError('\n'.join(errors))] return [] | 515cd121c6eefe82e0017073815cb5ceecf0d030 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/515cd121c6eefe82e0017073815cb5ceecf0d030/PRESUBMIT.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2073,
3043,
12,
2630,
67,
2425,
16,
876,
67,
2425,
4672,
3536,
4081,
326,
1663,
1893,
1169,
5012,
1390,
364,
5570,
501,
12123,
1334,
273,
5378,
2488,
67,
4285,
67,
1369,
273,
1083,
1326,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2073,
3043,
12,
2630,
67,
2425,
16,
876,
67,
2425,
4672,
3536,
4081,
326,
1663,
1893,
1169,
5012,
1390,
364,
5570,
501,
12123,
1334,
273,
5378,
2488,
67,
4285,
67,
1369,
273,
1083,
1326,... | |
self.writer.chdir(filename) | if not self.writer.chdir(filename): raise ExtractError("<b>Cannot change to directory !</b>%s"%filename) | def browse_file(self, sector, offset=0): if self.canceled: return # jump to sector self.iso.seek(sector*2048+offset, SEEK_SET) # read file header ltable, rtable, newsector, filesize, attributes, filename_size \ = read_unpack(self.iso, "<HHLLBB") # read file name filename = self.iso.read(filename_size) self.files = self.files + 1 if attributes & FILE_DIR > 0: if filename_size > 0: # browse folder self.writer.mkdir(filename) self.writer.chdir(filename) self.browse_file(newsector) self.writer.chdir("..") else: # write file self.size = self.size + filesize self.write_file(filename,filesize,newsector); if rtable > 0: self.browse_file(sector,rtable*4) if ltable > 0: self.browse_file(sector,ltable*4) | 6be862b22ae50f3bd49f576b2ef21e49e77c4feb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2692/6be862b22ae50f3bd49f576b2ef21e49e77c4feb/gxiso.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21670,
67,
768,
12,
2890,
16,
16323,
16,
1384,
33,
20,
4672,
225,
309,
365,
18,
10996,
329,
30,
327,
225,
468,
11833,
358,
16323,
365,
18,
9699,
18,
16508,
12,
5709,
280,
14,
21573,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21670,
67,
768,
12,
2890,
16,
16323,
16,
1384,
33,
20,
4672,
225,
309,
365,
18,
10996,
329,
30,
327,
225,
468,
11833,
358,
16323,
365,
18,
9699,
18,
16508,
12,
5709,
280,
14,
21573,
... |
return dict(text=pyndorama.processaQuery(query), | place = pyndorama.currentPlace IN_DEBUG_MODE = 0 if IN_DEBUG_MODE: from xml.sax.saxutils import escape def meandmyattr(obj, attr): return escape("%10s | %s" % (attr, getattr(place, attr, ''))) debug = '\n'.join(meandmyattr(place, attr) for attr in dir(place) \ if not attr.startswith('__')) else: debug = '' if aventura.YOU_CAN_SEE not in text: notice = text else: notice = '' return dict(text=text, | def acao(self, query): pyndorama = session.get('pyndorama') if not pyndorama: flash(u"Para jogar o Pyndorama você deve habilitar os cookies de "\ u"seu navegador.") raise redirect('/') | 8c31bd6e5db1dd9cbad05b5f21c3f861795adc09 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4801/8c31bd6e5db1dd9cbad05b5f21c3f861795adc09/controllers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1721,
6033,
12,
2890,
16,
843,
4672,
293,
878,
72,
280,
20789,
273,
1339,
18,
588,
2668,
84,
878,
72,
280,
20789,
6134,
309,
486,
293,
878,
72,
280,
20789,
30,
9563,
12,
89,
6,
23529... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1721,
6033,
12,
2890,
16,
843,
4672,
293,
878,
72,
280,
20789,
273,
1339,
18,
588,
2668,
84,
878,
72,
280,
20789,
6134,
309,
486,
293,
878,
72,
280,
20789,
30,
9563,
12,
89,
6,
23529... |
[compile.In(rng_R, value=numpy.random.RandomState(55), update=post_r, mutable=True)], | [compile.In(rng_R, value=numpy.random.RandomState(utt.fetch_seed()), update=post_r, mutable=True)], | def test_permutation(self): """Test that raw_random.permutation generates the same results as numpy.""" rng_R = random_state_type() post_r, out = permutation(rng_R, size=(9,), n=6) print 'OUT NDIM', out.ndim f = compile.function( [compile.In(rng_R, value=numpy.random.RandomState(55), update=post_r, mutable=True)], [out], accept_inplace=True) | d5701303093e5943cc4df89bc18c7fecc19b0be2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/d5701303093e5943cc4df89bc18c7fecc19b0be2/test_raw_random.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
12160,
9245,
12,
2890,
4672,
3536,
4709,
716,
1831,
67,
9188,
18,
12160,
9245,
6026,
326,
1967,
1686,
487,
3972,
12123,
11418,
67,
54,
273,
2744,
67,
2019,
67,
723,
1435,
1603,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12160,
9245,
12,
2890,
4672,
3536,
4709,
716,
1831,
67,
9188,
18,
12160,
9245,
6026,
326,
1967,
1686,
487,
3972,
12123,
11418,
67,
54,
273,
2744,
67,
2019,
67,
723,
1435,
1603,... |
label = _('Edit group %s') % group_name | label = _('Edit group %s') % cgi.escape(group_name) | def tmpl_display_input_group_info(self, group_name, group_description, join_policy, act_type="create", grpID="", warnings=[], ln=cdslang): """ Display group data when creating or updating a group: Name, description, join_policy. Parameters: - 'ln' *string* - The language to display the interface in - 'group_name' *string* - name of the group - 'group_description' *string* - description of the group - 'join_policy' *string* - join policy - 'act_type' *string* - info about action : create or edit(update) - 'grpID' *string* - ID of the group(not null in case of group editing) - 'warnings' *list* - Display warning if values are not correct """ _ = gettext_set_language(ln) #default hidden_id ="" form_name = "create_group" action = weburl + '/yourgroups/create' button_label = _("Create new group") button_name = "create_button" label = _("Create new group") delete_text = "" if act_type == "update": form_name = "update_group" action = weburl + '/yourgroups/edit' button_label = _("Update group") button_name = "update" label = _('Edit group %s') % group_name delete_text = """<input type="submit" value="%s" class="formbutton" name="%s"/>""" delete_text %= (_("Delete group"),"delete") if grpID != "": hidden_id = """<input type="hidden" name="grpID" value="%s"/>""" hidden_id %= grpID out = self.tmpl_warning(warnings) out += """ | 1698a6b6bb0b49da6f425aef6c66e22f776560a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/1698a6b6bb0b49da6f425aef6c66e22f776560a9/websession_templates.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10720,
67,
5417,
67,
2630,
67,
1655,
67,
1376,
12,
2890,
16,
1041,
67,
529,
16,
1041,
67,
3384,
16,
1233,
67,
5086,
16,
1328,
67,
723,
1546,
2640,
3113,
14295,
734,
1546,
3113,
5599,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5417,
67,
2630,
67,
1655,
67,
1376,
12,
2890,
16,
1041,
67,
529,
16,
1041,
67,
3384,
16,
1233,
67,
5086,
16,
1328,
67,
723,
1546,
2640,
3113,
14295,
734,
1546,
3113,
5599,
... |
if status == 'FYI' or item.anyTime: status = 'CANCELLED' | if status == 'FYI' or (not item.allDay and item.anyTime): status = 'CANCELLED' | def makeDateTimeValue(dt, asDate=False): if asDate: return dt.date() elif dt.tzinfo is ICUtzinfo.floating: return dt.replace(tzinfo=None) else: return dt | 1e05c904bccd41c97d17a918f55ab2dc8b2e368d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/1e05c904bccd41c97d17a918f55ab2dc8b2e368d/ICalendar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
5096,
620,
12,
7510,
16,
487,
1626,
33,
8381,
4672,
309,
487,
1626,
30,
327,
3681,
18,
712,
1435,
1327,
3681,
18,
12994,
1376,
353,
28009,
12994,
1376,
18,
5659,
310,
30,
327,
36... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
5096,
620,
12,
7510,
16,
487,
1626,
33,
8381,
4672,
309,
487,
1626,
30,
327,
3681,
18,
712,
1435,
1327,
3681,
18,
12994,
1376,
353,
28009,
12994,
1376,
18,
5659,
310,
30,
327,
36... |
dprint("char: %d" % evt.GetKeyCode()) | def OnKeyDown(self, evt): """Helper event processing loop to be called from the Frame's EVT_KEY_DOWN callback. This is needed because there's no other way to cancel a bad multi-key keystroke. EVT_MENU won't be called at all on an unrecognized keystroke but EVT_KEY_DOWN will will always be called, so we use this to preemptively check to see if the keystroke will be accepted or not and set appropriate flags for later use. @param evt: the CommandEvent instance from the EVT_MENU callback """ dprint("char=%s, unichar=%s, multiplier=%d, id=%s" % (evt.GetKeyCode(), evt.GetUnicodeKey(), self.root.repeat_value, evt.GetId())) if self.root.quoted_next: dprint("Quoted next; skipping OnKeyDown to be processed by OnChar") evt.Skip() return if self.root.meta_next and self.root.current_level == self.root: # digit processing is only available at the root level dprint("char: %d" % evt.GetKeyCode()) if evt.GetKeyCode() in self.digit_keycode: # digit processing after the ESC key is available in a special # sublevel of ESC. If digits are instead included in the root # level, the digits will never get sent to the application's # OnChar event because they'll be processed by the root # accelerator table self.setAcceleratorTable(self.id_next_level[self.esc_keystroke.id]) self.root.meta_next = False self.root.processing_esc_digit = True else: # If we run into anything else while we're processing a digit # string, stop the digit processing and reset the accelerator # table to the root self.setAcceleratorTable() self.root.processing_esc_digit = False elif self.root.processing_esc_digit and evt.GetKeyCode() not in self.digit_keycode: # A non-digit character during digit processing will reset the # accelerator table back to the root so we can then find out the # command to which the digits will be applied. self.processing_esc_digit = False self.setAcceleratorTable() if not self.root.current_level.isValidAccelerator(evt): # If the keystroke isn't valid for the current level but would # be recognized by the root level, we have to skip it because # we're about to reset the current level to the root level and # the keystroke would be processed by the root level if self.root.isValidAccelerator(evt): self.root.skipNext() | 06dbd30848e3f3b419df2c1574810e7baa52289b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11522/06dbd30848e3f3b419df2c1574810e7baa52289b/multikey.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
653,
4164,
12,
2890,
16,
6324,
4672,
3536,
2276,
871,
4929,
2798,
358,
506,
2566,
628,
326,
8058,
1807,
27917,
67,
3297,
67,
12711,
1348,
18,
225,
1220,
353,
3577,
2724,
1915,
1807... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
653,
4164,
12,
2890,
16,
6324,
4672,
3536,
2276,
871,
4929,
2798,
358,
506,
2566,
628,
326,
8058,
1807,
27917,
67,
3297,
67,
12711,
1348,
18,
225,
1220,
353,
3577,
2724,
1915,
1807... | |
selected_fields = 'phrase' | selected_fields = 'phrase', min_freq = 1 | def __init__(self): if NetworkBuzzDBHandler.__single is not None: raise RuntimeError, "NetworkBuzzDBHandler is singleton" NetworkBuzzDBHandler.__single = self db = SQLiteCacheDB.getInstance() BasicDBHandler.__init__(self,db, 'TermFrequency') from Tribler.Core.Tag.Extraction import TermExtraction self.extractor = TermExtraction.getInstance() | 58fb3cd5b3f364d97898c7feac011df45180211b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9686/58fb3cd5b3f364d97898c7feac011df45180211b/SqliteCacheDBHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
309,
5128,
38,
9510,
2290,
1503,
16186,
7526,
353,
486,
599,
30,
1002,
7265,
16,
315,
3906,
38,
9510,
2290,
1503,
353,
6396,
6,
5128,
38,
9510,
2290,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
309,
5128,
38,
9510,
2290,
1503,
16186,
7526,
353,
486,
599,
30,
1002,
7265,
16,
315,
3906,
38,
9510,
2290,
1503,
353,
6396,
6,
5128,
38,
9510,
2290,
1... |
if binary in binaries[arch][0]: | if binary in binaries[parch][0]: | def doop_source(self, pkg): """Apply a change to the testing distribution as requested by `pkg` | b0ef0af3487c34142dce19457921f7cceb8b113e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2784/b0ef0af3487c34142dce19457921f7cceb8b113e/britney.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
556,
67,
3168,
12,
2890,
16,
3475,
4672,
3536,
7001,
279,
2549,
358,
326,
7769,
7006,
487,
3764,
635,
1375,
10657,
68,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
556,
67,
3168,
12,
2890,
16,
3475,
4672,
3536,
7001,
279,
2549,
358,
326,
7769,
7006,
487,
3764,
635,
1375,
10657,
68,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
return False, u'Socket Error: %s' % arg except UnicodeEncodeError, arg: return False, u'Non-ASCII Characters in URL: %s' % arg | return False, u'Socket Error: %s' % arg[1] | def check(self, useHEAD = True): """ Returns True and the server status message if the page is alive. Otherwise returns false """ try: wasRedirected = self.resolveRedirect(useHEAD = useHEAD) except UnicodeError, arg: return False, u'Encoding Error: %s' % arg except httplib.error, arg: return False, u'HTTP Error: %s' % arg except socket.error, arg: return False, u'Socket Error: %s' % arg #except UnicodeEncodeError, arg: # return False, u'Non-ASCII Characters in URL: %s' % arg if wasRedirected: if self.url in self.redirectChain: if useHEAD: # Some servers don't seem to handle HEAD requests properly, # which leads to a cyclic list of redirects. # We simply start from the beginning, but this time, # we don't use HEAD, but GET requests. redirChecker = LinkChecker(self.redirectChain[0], serverEncoding = self.serverEncoding) return redirChecker.check(useHEAD = False) else: return False, u'HTTP Redirect Loop: %s' % ' -> '.join(self.redirectChain + [self.url]) elif len(self.redirectChain) >= 19: if useHEAD: # Some servers don't seem to handle HEAD requests properly, # which leads to a long (or infinite) list of redirects. # We simply start from the beginning, but this time, # we don't use HEAD, but GET requests. redirChecker = LinkChecker(self.redirectChain[0], serverEncoding = self.serverEncoding) return redirChecker.check(useHEAD = False) else: return False, u'Long Chain of Redirects: %s' % ' -> '.join(self.redirectChain + [self.url]) else: redirChecker = LinkChecker(self.url, self.redirectChain, self.serverEncoding) return redirChecker.check(useHEAD = useHEAD) else: try: conn = self.getConnection() except httplib.error, arg: return False, u'HTTP Error: %s' % arg try: conn.request('GET', '%s%s' % (self.path, self.query), None, self.header) except socket.error, arg: return False, u'Socket Error: %s' % arg except UnicodeEncodeError, arg: return False, u'Non-ASCII Characters in URL: %s' % arg try: response = conn.getresponse() except Exception, arg: return False, u'Error: %s' % arg # read the server's encoding, in case we need it later self.readEncodingFromResponse(response) # site down if the server status is between 400 and 499 siteDown = response.status in range(400, 500) return not siteDown, '%s %s' % (response.status, response.reason) | a4ba360b6d862b94347384cbf06ca957542789a0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/a4ba360b6d862b94347384cbf06ca957542789a0/weblinkchecker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
12,
2890,
16,
999,
12458,
273,
1053,
4672,
3536,
2860,
1053,
471,
326,
1438,
1267,
883,
309,
326,
1363,
353,
13714,
18,
5272,
1135,
629,
3536,
775,
30,
1703,
5961,
329,
273,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
12,
2890,
16,
999,
12458,
273,
1053,
4672,
3536,
2860,
1053,
471,
326,
1438,
1267,
883,
309,
326,
1363,
353,
13714,
18,
5272,
1135,
629,
3536,
775,
30,
1703,
5961,
329,
273,
365,
... |
this = LX.fol.RDF(toLX(store, s[SUBJ], maxDepth-1, kb=kb, terms=iTerms), | this = LX.logic.RDF(toLX(store, s[SUBJ], maxDepth-1, kb=kb, terms=iTerms), | def toLX(store, formula, maxDepth=4, kb=None, kbMode=0, terms={}): """Convert a llyn.formula to an LX.Formula and return it, or to one or more LX.Formulas and add them to an LX.KB; also convert a non-formula into an LX.Term. If a kb is specified, the conjoined parts of the formula (or just the formula itself, if there are no conjoined parts) will be added to it, instead of being returned. For document top-level formulas this is often the appropriate usage. kbMode means we DONT return a formula, we just add the formulas to the KB. """ if not isinstance(formula, llyn.Formula): # if it's not a formula try: # and its not a scoped variable return terms[formula] except KeyError: # then it's a constant! toLXVar(store, formula, terms, makeWith=LX.fol.Constant) kb.interpret(terms[formula], LX.URIRef2(formula.uriref())) return terms[formula] #iTerms = terms.copy() iTerms = terms # need this for proper URI-merging, though maybe its wrong sometimes. if kbMode: assert(kb != None) for v in formula.existentials(): toLXVar(store, v, iTerms, makeWith=LX.fol.ExiVar) for v in formula.universals(): toLXVar(store, v, iTerms, makeWith=LX.fol.UniVar) result = None if maxDepth < 0: raise RuntimeError, "Formulas too deeply nested, probably looping" for s in formula: #print "statement", s if s[PRED] is store.forAll or s[PRED] is store.forSome: if s[SUBJ] is formula: continue # BUG: this construction may be obsolete; it loses var declarations # as in { } log:forall :x. this = toLX(store, s[SUBJ], maxDepth-1, kb=kb, terms=iTerms) elif s[PRED] is store.implies: this = LX.fol.IMPLIES(toLX(store, s[SUBJ], maxDepth-1, kb=kb, terms=iTerms), toLX(store, s[OBJ], maxDepth-1, kb=kb, terms=iTerms)) elif s[PRED] is store.means: this = LX.fol.MEANS(toLX(store, s[SUBJ], maxDepth-1, kb=kb, terms=iTerms), toLX(store, s[OBJ], maxDepth-1, kb=kb, terms=iTerms)) elif s[PRED] is store.type and s[OBJ] is store.Truth: this = toLX(store, s[SUBJ], maxDepth-1, kb=kb, terms=iTerms) elif s[PRED] is store.type and s[OBJ] is store.Falsehood: this = LX.fol.NOT(toLX(store, s[SUBJ], maxDepth-1, kb=kb, terms=iTerms)) else: this = LX.fol.RDF(toLX(store, s[SUBJ], maxDepth-1, kb=kb, terms=iTerms), toLX(store, s[PRED], maxDepth-1, kb=kb, terms=iTerms), toLX(store, s[OBJ], maxDepth-1, kb=kb, terms=iTerms)) if kbMode: kb.add(this) else: if result is None: result = this else: result = LX.fol.AND(result, this) if kbMode: for v in formula.existentials(): kb.exivars.append(iTerms[v]) for v in formula.universals(): kb.univars.append(iTerms[v]) return None else: for v in formula.existentials(): result = LX.fol.EXISTS(iTerms[v], result) for v in formula.universals(): result = LX.fol.FORALL(iTerms[v], result) return result | 66b3c3f5eeb83040e2705d6aa104fbf4fec4663c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3308/66b3c3f5eeb83040e2705d6aa104fbf4fec4663c/llynInterface.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
48,
60,
12,
2233,
16,
8013,
16,
22074,
33,
24,
16,
9182,
33,
7036,
16,
9182,
2309,
33,
20,
16,
6548,
12938,
4672,
3536,
2723,
279,
328,
715,
82,
18,
18203,
358,
392,
511,
60,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
48,
60,
12,
2233,
16,
8013,
16,
22074,
33,
24,
16,
9182,
33,
7036,
16,
9182,
2309,
33,
20,
16,
6548,
12938,
4672,
3536,
2723,
279,
328,
715,
82,
18,
18203,
358,
392,
511,
60,
... |
selectSQL += " FROM `bucket%s`" % typeName selectSQL += " WHERE `bucket%s`.`startTime` <= '%s' AND" % ( typeName, timeLimit.strftime( "%Y-%m-%d %H:%M:%S" ) ) selectSQL += " `bucket%s`.`bucketLength` = %s" % ( typeName, bucketLength ) | selectSQL += " FROM `%s`" % tableName selectSQL += " WHERE `%s`.`startTime` <= '%s' AND" % ( tableName, timeLimit.strftime( "%Y-%m-%d %H:%M:%S" ) ) selectSQL += " `%s`.`bucketLength` = %s" % ( tableName, bucketLength ) | def __selectForCompactBuckets(self, typeName, timeLimit, bucketLength, nextBucketLength, connObj = False ): """ Nasty SQL query to get ideal buckets using grouping by date calculations and adding value contents """ selectSQL = "SELECT " sqlSelectList = [] for field in self.dbCatalog[ typeName ][ 'keys' ]: sqlSelectList.append( "`bucket%s`.`%s`" % ( typeName, field ) ) for field in self.dbCatalog[ typeName ][ 'values' ]: sqlSelectList.append( "SUM( `bucket%s`.`%s` )" % ( typeName, field ) ) sqlSelectList.append( "MIN( `bucket%s`.`startTime` )" % typeName) sqlSelectList.append( "MAX( `bucket%s`.`startTime` )" % typeName) selectSQL += ", ".join( sqlSelectList ) selectSQL += " FROM `bucket%s`" % typeName selectSQL += " WHERE `bucket%s`.`startTime` <= '%s' AND" % ( typeName, timeLimit.strftime( "%Y-%m-%d %H:%M:%S" ) ) selectSQL += " `bucket%s`.`bucketLength` = %s" % ( typeName, bucketLength ) #HACK: Horrible constant to overcome the fact that MySQL defines epoch 0 as 13:00 and *nix define epoch as 01:00 #43200 is half a day sqlGroupList = [ "CONVERT( ( UNIX_TIMESTAMP( `bucket%s`.`startTime` ) - 43200 )/%s, SIGNED )" % ( typeName, nextBucketLength ) ] for field in self.dbCatalog[ typeName ][ 'keys' ]: sqlGroupList.append( "`bucket%s`.`%s`" % ( typeName, field ) ) selectSQL += " GROUP BY %s" % ", ".join( sqlGroupList ) return self._query( selectSQL, 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,
4025,
1290,
16863,
14517,
12,
2890,
16,
8173,
16,
813,
3039,
16,
2783,
1782,
16,
1024,
4103,
1782,
16,
1487,
2675,
273,
1083,
262,
30,
3536,
423,
689,
93,
3063,
843,
358,
336,
23... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
4025,
1290,
16863,
14517,
12,
2890,
16,
8173,
16,
813,
3039,
16,
2783,
1782,
16,
1024,
4103,
1782,
16,
1487,
2675,
273,
1083,
262,
30,
3536,
423,
689,
93,
3063,
843,
358,
336,
23... |
if err.code == 403 and uri.startwith('http://en.wikipedia.org/'): | if err.code == 403 and uri.startswith('http://en.wikipedia.org/'): | def resolve(self, uri): try: f = urlopen(uri) f.close() except HTTPError, err: if err.code == 403 and uri.startwith('http://en.wikipedia.org/'): # Wikipedia blocks requests from urllib User-Agent return 0 return (2, str(err)) except Exception, err: return (2, str(err)) if f.url.rstrip('/') == uri.rstrip('/'): return (0, 0) else: return (1, f.url) | 15d0db5057b43e206295c81415f1afdeac64db13 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7032/15d0db5057b43e206295c81415f1afdeac64db13/builder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2245,
12,
2890,
16,
2003,
4672,
775,
30,
284,
273,
19613,
12,
1650,
13,
284,
18,
4412,
1435,
1335,
14415,
16,
393,
30,
309,
393,
18,
710,
422,
14393,
471,
2003,
18,
17514,
1918,
2668,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2245,
12,
2890,
16,
2003,
4672,
775,
30,
284,
273,
19613,
12,
1650,
13,
284,
18,
4412,
1435,
1335,
14415,
16,
393,
30,
309,
393,
18,
710,
422,
14393,
471,
2003,
18,
17514,
1918,
2668,
... |
code=self.docmd("noop") return code | return self.docmd("noop") | def noop(self): """SMTP 'noop' command -- doesn't do anything :>""" code=self.docmd("noop") return code | 296e14301a7aa23a5ee2bfaa1210af54e594cbbf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/296e14301a7aa23a5ee2bfaa1210af54e594cbbf/smtplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17065,
12,
2890,
4672,
3536,
55,
14636,
296,
2135,
556,
11,
1296,
1493,
3302,
1404,
741,
6967,
294,
2984,
3660,
981,
33,
2890,
18,
2434,
1264,
2932,
2135,
556,
7923,
327,
981,
2,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
17065,
12,
2890,
4672,
3536,
55,
14636,
296,
2135,
556,
11,
1296,
1493,
3302,
1404,
741,
6967,
294,
2984,
3660,
981,
33,
2890,
18,
2434,
1264,
2932,
2135,
556,
7923,
327,
981,
2,
-100,
... |
""" | r""" | def FuzzyBallGraph(self, partition, q): """ Construct a Fuzzy Ball graph with the integer partition ``partition`` and ``q`` extra vertices. | 51ff5d9a7fa20a4153bbc1b635dc35c50c555d89 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/51ff5d9a7fa20a4153bbc1b635dc35c50c555d89/graph_generators.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
478,
13903,
38,
454,
4137,
12,
2890,
16,
3590,
16,
1043,
4672,
436,
8395,
14291,
279,
478,
13903,
605,
454,
2667,
598,
326,
3571,
3590,
12176,
10534,
10335,
471,
12176,
85,
10335,
2870,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
478,
13903,
38,
454,
4137,
12,
2890,
16,
3590,
16,
1043,
4672,
436,
8395,
14291,
279,
478,
13903,
605,
454,
2667,
598,
326,
3571,
3590,
12176,
10534,
10335,
471,
12176,
85,
10335,
2870,
... |
parm = '' for (k,v) in kwargs.items(): parm += str(k) + '=' + str(v) + ', ' opt = '''pyExec(exposePop=1, %s stmts=r\'\'\'CollectValue(pop, gen, expr="""%s""", name="""%s""")\'\'\')''' \ % ( parm, expr, name) return eval(opt) | parm = '' for (k,v) in kwargs.items(): parm += str(k) + '=' + str(v) + ', ' opt = '''pyExec(exposePop=1, %s stmts=r\'\'\'CollectValue(pop, gen, expr="""%s""", name="""%s""")\'\'\')''' \ % ( parm, expr, name) return eval(opt) | def collector(name, expr, **kwargs): # deal with additional arguments parm = '' for (k,v) in kwargs.items(): parm += str(k) + '=' + str(v) + ', ' # pyEval( exposePop=1, param?, stmts=""" # Collect(pop, expr, name) # """) opt = '''pyExec(exposePop=1, %s stmts=r\'\'\'CollectValue(pop, gen, expr="""%s""", name="""%s""")\'\'\')''' \ % ( parm, expr, name) #print opt return eval(opt) | 221d6e46bb102816794d97211e9ea83f19d74d6c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/221d6e46bb102816794d97211e9ea83f19d74d6c/simuUtil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8543,
12,
529,
16,
3065,
16,
2826,
4333,
4672,
468,
10490,
598,
3312,
1775,
19924,
273,
875,
364,
261,
79,
16,
90,
13,
316,
1205,
18,
3319,
13332,
19924,
1011,
609,
12,
79,
13,
397,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8543,
12,
529,
16,
3065,
16,
2826,
4333,
4672,
468,
10490,
598,
3312,
1775,
19924,
273,
875,
364,
261,
79,
16,
90,
13,
316,
1205,
18,
3319,
13332,
19924,
1011,
609,
12,
79,
13,
397,
... |
glDepthFunc(saveDepthFunc) | glDepthFunc(saveDepthFunc) | def do_glselect_if_wanted(self): #bruce 070919 split this out """ Do the glRenderMode(GL_SELECT) drawing, and/or the glname-color drawing for shader primitives, used to guess which object might be under the mouse, for one drawing frame, if desired for this frame. Report results by storing candidate mouseover objects in self.glselect_dict. | c5c7619a9e5b2a32d1e8cbdab503acb68cd2abdf /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11221/c5c7619a9e5b2a32d1e8cbdab503acb68cd2abdf/GLPane_highlighting_methods.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
7043,
4025,
67,
430,
67,
25861,
12,
2890,
4672,
468,
2848,
3965,
10934,
5908,
3657,
1416,
333,
596,
3536,
2256,
326,
5118,
3420,
2309,
12,
11261,
67,
4803,
13,
16327,
16,
471,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
7043,
4025,
67,
430,
67,
25861,
12,
2890,
4672,
468,
2848,
3965,
10934,
5908,
3657,
1416,
333,
596,
3536,
2256,
326,
5118,
3420,
2309,
12,
11261,
67,
4803,
13,
16327,
16,
471,
... |
hardhatlib.copyFile("chandler_bin", buildenv['root'] + \ os.sep + "debug") hardhatlib.copyFile("chandler", buildenv['root'] + \ os.sep + "debug") os.chdir("../../..") | hardhatlib.copyFile("chandler_bin", buildenv['root'] + \ os.sep + version) hardhatlib.copyFile("chandler", buildenv['root'] + \ os.sep + version) os.chdir("../../../..") | def build(buildenv): # Build the linux launcher program if buildenv['os'] == 'posix': os.chdir("distrib/linux/launcher") if buildenv['version'] == 'release': hardhatlib.executeCommand( buildenv, info['name'], [buildenv['make']], "Making launcher programs") hardhatlib.copyFile("chandler_bin", buildenv['root'] + \ os.sep + "release") hardhatlib.copyFile("chandler", buildenv['root'] + \ os.sep + "release") if buildenv['version'] == 'debug': hardhatlib.executeCommand( buildenv, info['name'], [buildenv['make'], "DEBUG=1"], "Making launcher programs") hardhatlib.copyFile("chandler_bin", buildenv['root'] + \ os.sep + "debug") hardhatlib.copyFile("chandler", buildenv['root'] + \ os.sep + "debug") os.chdir("../../..") # Build the windows launcher program if buildenv['os'] == 'win': version = buildenv['version'] try: os.remove('output.txt') except: pass hardhatlib.executeCommand(buildenv, info['name'], [ buildenv['compiler'], 'distrib/win/launcher/launcher.sln', '/build', version.capitalize(), '/out', 'output.txt' ], 'Building launcher ' + version, 0, 'output.txt') # Build UUID Extension and install it os.chdir(os.path.join("model","util","ext")) if buildenv['version'] == 'release': hardhatlib.executeCommand(buildenv, info['name'], [buildenv['python'], 'setup.py', 'build', '--build-base=build_release', 'install'], "Building and installing UUIDext release") if buildenv['version'] == 'debug': hardhatlib.executeCommand(buildenv, info['name'], [buildenv['python_d'], 'setup.py', 'build', '--build-base=build_debug', '--debug', 'install', '--force'], "Building and installing UUIDext debug") os.chdir("../../..") os.chdir("distrib") if buildenv['os'] == 'posix' or buildenv['os'] == 'osx': if buildenv['os'] == 'posix': os.chdir("linux") if buildenv['os'] == 'osx': os.chdir("osx") if buildenv['version'] == 'release': hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Copying RunRelease to release") hardhatlib.copyFile("RunRelease", buildenv['root'] + \ os.sep + "release") hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Copying RunPython to release") hardhatlib.copyFile("RunPythonRelease", buildenv['root'] + \ os.sep + "release") os.rename( buildenv['root']+os.sep+"release"+os.sep+"RunPythonRelease", buildenv['root']+os.sep+"release"+os.sep+"RunPython" ) if buildenv['version'] == 'debug': hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Copying RunDebug to debug") hardhatlib.copyFile("RunDebug", buildenv['root'] + \ os.sep + "debug") hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Copying RunPython to debug") hardhatlib.copyFile("RunPythonDebug", buildenv['root'] + \ os.sep + "debug") os.rename( buildenv['root']+os.sep+"debug"+os.sep+"RunPythonDebug", buildenv['root']+os.sep+"debug"+os.sep+"RunPython" ) if buildenv['os'] == 'win': os.chdir("win") if buildenv['version'] == 'release': hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Copying MSVCI70.DLL to release/bin") hardhatlib.copyFile("msvci70.dll", buildenv['root'] + \ os.sep + "release" + os.sep + "bin") hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Copying MSVCP70.DLL to release/bin") hardhatlib.copyFile("msvcp70.dll", buildenv['root'] + \ os.sep + "release" + os.sep + "bin") hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Copying MSVCR70.DLL to release/bin") hardhatlib.copyFile("msvcr70.dll", buildenv['root'] + \ os.sep + "release" + os.sep + "bin") hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Copying RunRelease.bat to release") hardhatlib.copyFile("RunRelease.bat", buildenv['root'] + \ os.sep + "release") if buildenv['version'] == 'debug': hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Copying MSVCI70D.DLL to debug/bin") hardhatlib.copyFile("msvci70d.dll", buildenv['root'] + \ os.sep + "debug" + os.sep + "bin") hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Copying MSVCP70D.DLL to debug/bin") hardhatlib.copyFile("msvcp70d.dll", buildenv['root'] + \ os.sep + "debug" + os.sep + "bin") hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Copying MSVCR70D.DLL to debug/bin") hardhatlib.copyFile("msvcr70d.dll", buildenv['root'] + \ os.sep + "debug" + os.sep + "bin") hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Copying MSVCRTD.DLL to debug/bin") hardhatlib.copyFile("msvcrtd.dll", buildenv['root'] + \ os.sep + "debug" + os.sep + "bin") hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Copying RunDebug.bat to debug") hardhatlib.copyFile("RunDebug.bat", buildenv['root'] + \ os.sep + "debug") | 8f8f736dd8fef202e5bf7bb36537579a3dacd62c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/8f8f736dd8fef202e5bf7bb36537579a3dacd62c/__hardhat__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
12,
3510,
3074,
4672,
225,
468,
3998,
326,
19725,
26618,
5402,
309,
1361,
3074,
3292,
538,
3546,
422,
296,
24463,
4278,
1140,
18,
343,
1214,
2932,
2251,
665,
19,
20132,
19,
20738,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
12,
3510,
3074,
4672,
225,
468,
3998,
326,
19725,
26618,
5402,
309,
1361,
3074,
3292,
538,
3546,
422,
296,
24463,
4278,
1140,
18,
343,
1214,
2932,
2251,
665,
19,
20132,
19,
20738,
... |
p += s[pos] | p += unichr(ord(s[pos])) | def PyUnicode_DecodeRawUnicodeEscape(s, size, errors): if (size == 0): return u'' pos = 0 p = [] while (pos < len(s)): ch = s[pos] #/* Non-escape characters are interpreted as Unicode ordinals */ if (ch != '\\'): p += unichr(ord(ch)) pos += 1 continue startinpos = pos | b1d45cd4e340d4249c68d0ef7b495d64be675e11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/b1d45cd4e340d4249c68d0ef7b495d64be675e11/app_codecs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4707,
16532,
67,
6615,
4809,
16532,
8448,
12,
87,
16,
963,
16,
1334,
4672,
225,
309,
261,
1467,
422,
374,
4672,
327,
582,
6309,
949,
273,
374,
293,
273,
5378,
1323,
261,
917,
411,
562,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4707,
16532,
67,
6615,
4809,
16532,
8448,
12,
87,
16,
963,
16,
1334,
4672,
225,
309,
261,
1467,
422,
374,
4672,
327,
582,
6309,
949,
273,
374,
293,
273,
5378,
1323,
261,
917,
411,
562,... |
from sphinx.textwriter import TextWriter | from sphinx.writers.text import TextWriter | def issue_role(typ, rawtext, text, lineno, inliner, options={}, content=[]): issue = utils.unescape(text) text = 'issue ' + issue refnode = nodes.reference(text, text, refuri=ISSUE_URI % issue) return [refnode], [] | 51d8fd1a347d0766b384d274122c6d65eee3d066 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/51d8fd1a347d0766b384d274122c6d65eee3d066/pyspecific.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5672,
67,
4615,
12,
12846,
16,
1831,
955,
16,
977,
16,
7586,
16,
316,
7511,
264,
16,
702,
28793,
913,
33,
8526,
4672,
5672,
273,
2990,
18,
318,
6939,
12,
955,
13,
977,
273,
296,
1388... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5672,
67,
4615,
12,
12846,
16,
1831,
955,
16,
977,
16,
7586,
16,
316,
7511,
264,
16,
702,
28793,
913,
33,
8526,
4672,
5672,
273,
2990,
18,
318,
6939,
12,
955,
13,
977,
273,
296,
1388... |
m = _load_example_standard_model('vdp', 'VDP_pack_VDP_Opt') | m = _load_example_standard_model('VDP_pack_VDP_Opt') m.reset() | def test_plot_control_solutions(): """ Testing plot_control_solutions(...)""" m = _load_example_standard_model('vdp', 'VDP_pack_VDP_Opt') grid = [(0, 0.1), (0.1, 0.2), (0.2, 0.3), (0.3, 0.4), (0.4, 0.5), (0.5, 0.6), (0.6, 0.7), (0.7, 0.8), (0.8, 0.9), (0.9, 1.0),] us = N.array([1, 1, 1, 1]*len(grid)) plot_control_solutions(m, grid, us) | b50b5a0d061f9da771e0a0c30212562fc234a8cc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7711/b50b5a0d061f9da771e0a0c30212562fc234a8cc/shooting.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
4032,
67,
7098,
67,
18281,
6170,
13332,
3536,
7766,
310,
3207,
67,
7098,
67,
18281,
6170,
6173,
3660,
312,
273,
389,
945,
67,
8236,
67,
10005,
67,
2284,
2668,
58,
8640,
67,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
4032,
67,
7098,
67,
18281,
6170,
13332,
3536,
7766,
310,
3207,
67,
7098,
67,
18281,
6170,
6173,
3660,
312,
273,
389,
945,
67,
8236,
67,
10005,
67,
2284,
2668,
58,
8640,
67,
2... |
print "value", number | def num_field(self,emission,source,param): print "existence", emission.part_exists(param) number = emission.part_text_get(param) print "value", number if number == None or len(number) == 0: self.load_phone_book( emission, source, param) else : print "number found" self.add_contact( emission, source, param) print "num_field" | 01c25941dcc46b5166dcddd3aeed3ae3b26b48e6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4712/01c25941dcc46b5166dcddd3aeed3ae3b26b48e6/paroli-dialer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
818,
67,
1518,
12,
2890,
16,
351,
19710,
16,
3168,
16,
891,
4672,
1172,
315,
7398,
802,
3113,
801,
19710,
18,
2680,
67,
1808,
12,
891,
13,
1300,
273,
801,
19710,
18,
2680,
67,
955,
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,
818,
67,
1518,
12,
2890,
16,
351,
19710,
16,
3168,
16,
891,
4672,
1172,
315,
7398,
802,
3113,
801,
19710,
18,
2680,
67,
1808,
12,
891,
13,
1300,
273,
801,
19710,
18,
2680,
67,
955,
6... | |
dummy = (0, 0, 0, 0, 0) | dummy = (0, 0, 0, 0, 0, 0) | def makeunicodedata(unicode, trace): dummy = (0, 0, 0, 0, 0) table = [dummy] cache = {0: dummy} index = [0] * len(unicode.chars) FILE = "Modules/unicodedata_db.h" print "--- Preparing", FILE, "..." # 1) database properties for char in unicode.chars: record = unicode.table[char] if record: # extract database properties category = CATEGORY_NAMES.index(record[2]) combining = int(record[3]) bidirectional = BIDIRECTIONAL_NAMES.index(record[4]) mirrored = record[9] == "Y" eastasianwidth = EASTASIANWIDTH_NAMES.index(record[15]) item = ( category, combining, bidirectional, mirrored, eastasianwidth ) # add entry to index and item tables i = cache.get(item) if i is None: cache[item] = i = len(table) table.append(item) index[char] = i # 2) decomposition data decomp_data = [0] decomp_prefix = [""] decomp_index = [0] * len(unicode.chars) decomp_size = 0 comp_pairs = [] comp_first = [None] * len(unicode.chars) comp_last = [None] * len(unicode.chars) for char in unicode.chars: record = unicode.table[char] if record: if record[5]: decomp = record[5].split() if len(decomp) > 19: raise Exception, "character %x has a decomposition too large for nfd_nfkd" % char # prefix if decomp[0][0] == "<": prefix = decomp.pop(0) else: prefix = "" try: i = decomp_prefix.index(prefix) except ValueError: i = len(decomp_prefix) decomp_prefix.append(prefix) prefix = i assert prefix < 256 # content decomp = [prefix + (len(decomp)<<8)] +\ map(lambda s: int(s, 16), decomp) # Collect NFC pairs if not prefix and len(decomp) == 3 and \ char not in unicode.exclusions and \ unicode.table[decomp[1]][3] == "0": p, l, r = decomp comp_first[l] = 1 comp_last[r] = 1 comp_pairs.append((l,r,char)) try: i = decomp_data.index(decomp) except ValueError: i = len(decomp_data) decomp_data.extend(decomp) decomp_size = decomp_size + len(decomp) * 2 else: i = 0 decomp_index[char] = i f = l = 0 comp_first_ranges = [] comp_last_ranges = [] prev_f = prev_l = None for i in unicode.chars: if comp_first[i] is not None: comp_first[i] = f f += 1 if prev_f is None: prev_f = (i,i) elif prev_f[1]+1 == i: prev_f = prev_f[0],i else: comp_first_ranges.append(prev_f) prev_f = (i,i) if comp_last[i] is not None: comp_last[i] = l l += 1 if prev_l is None: prev_l = (i,i) elif prev_l[1]+1 == i: prev_l = prev_l[0],i else: comp_last_ranges.append(prev_l) prev_l = (i,i) comp_first_ranges.append(prev_f) comp_last_ranges.append(prev_l) total_first = f total_last = l comp_data = [0]*(total_first*total_last) for f,l,char in comp_pairs: f = comp_first[f] l = comp_last[l] comp_data[f*total_last+l] = char print len(table), "unique properties" print len(decomp_prefix), "unique decomposition prefixes" print len(decomp_data), "unique decomposition entries:", print decomp_size, "bytes" print total_first, "first characters in NFC" print total_last, "last characters in NFC" print len(comp_pairs), "NFC pairs" print "--- Writing", FILE, "..." fp = open(FILE, "w") print >>fp, "/* this file was generated by %s %s */" % (SCRIPT, VERSION) print >>fp print >>fp, '#define UNIDATA_VERSION "%s"' % UNIDATA_VERSION print >>fp, "/* a list of unique database records */" print >>fp, \ "const _PyUnicode_DatabaseRecord _PyUnicode_Database_Records[] = {" for item in table: print >>fp, " {%d, %d, %d, %d, %d}," % item print >>fp, "};" print >>fp print >>fp, "/* Reindexing of NFC first characters. */" print >>fp, "#define TOTAL_FIRST",total_first print >>fp, "#define TOTAL_LAST",total_last print >>fp, "struct reindex{int start;short count,index;};" print >>fp, "static struct reindex nfc_first[] = {" for start,end in comp_first_ranges: print >>fp," { %d, %d, %d}," % (start,end-start,comp_first[start]) print >>fp," {0,0,0}" print >>fp,"};\n" print >>fp, "static struct reindex nfc_last[] = {" for start,end in comp_last_ranges: print >>fp," { %d, %d, %d}," % (start,end-start,comp_last[start]) print >>fp," {0,0,0}" print >>fp,"};\n" # FIXME: <fl> the following tables could be made static, and # the support code moved into unicodedatabase.c print >>fp, "/* string literals */" print >>fp, "const char *_PyUnicode_CategoryNames[] = {" for name in CATEGORY_NAMES: print >>fp, " \"%s\"," % name print >>fp, " NULL" print >>fp, "};" print >>fp, "const char *_PyUnicode_BidirectionalNames[] = {" for name in BIDIRECTIONAL_NAMES: print >>fp, " \"%s\"," % name print >>fp, " NULL" print >>fp, "};" print >>fp, "const char *_PyUnicode_EastAsianWidthNames[] = {" for name in EASTASIANWIDTH_NAMES: print >>fp, " \"%s\"," % name print >>fp, " NULL" print >>fp, "};" print >>fp, "static const char *decomp_prefix[] = {" for name in decomp_prefix: print >>fp, " \"%s\"," % name print >>fp, " NULL" print >>fp, "};" # split record index table index1, index2, shift = splitbins(index, trace) print >>fp, "/* index tables for the database records */" print >>fp, "#define SHIFT", shift Array("index1", index1).dump(fp, trace) Array("index2", index2).dump(fp, trace) # split decomposition index table index1, index2, shift = splitbins(decomp_index, trace) print >>fp, "/* decomposition data */" Array("decomp_data", decomp_data).dump(fp, trace) print >>fp, "/* index tables for the decomposition data */" print >>fp, "#define DECOMP_SHIFT", shift Array("decomp_index1", index1).dump(fp, trace) Array("decomp_index2", index2).dump(fp, trace) index, index2, shift = splitbins(comp_data, trace) print >>fp, "/* NFC pairs */" print >>fp, "#define COMP_SHIFT", shift Array("comp_index", index).dump(fp, trace) Array("comp_data", index2).dump(fp, trace) # Generate delta tables for old versions for version, table, normalization in unicode.changed: cversion = version.replace(".","_") records = [table[0]] cache = {table[0]:0} index = [0] * len(table) for i, record in enumerate(table): try: index[i] = cache[record] except KeyError: index[i] = cache[record] = len(records) records.append(record) index1, index2, shift = splitbins(index, trace) print >>fp, "static const change_record change_records_%s[] = {" % cversion for record in records: print >>fp, "\t{ %s }," % ", ".join(map(str,record)) print >>fp, "};" Array("changes_%s_index" % cversion, index1).dump(fp, trace) Array("changes_%s_data" % cversion, index2).dump(fp, trace) print >>fp, "static const change_record* get_change_%s(Py_UCS4 n)" % cversion print >>fp, "{" print >>fp, "\tint index;" print >>fp, "\tif (n >= 0x110000) index = 0;" print >>fp, "\telse {" print >>fp, "\t\tindex = changes_%s_index[n>>%d];" % (cversion, shift) print >>fp, "\t\tindex = changes_%s_data[(index<<%d)+(n & %d)];" % \ (cversion, shift, ((1<<shift)-1)) print >>fp, "\t}" print >>fp, "\treturn change_records_%s+index;" % cversion print >>fp, "}\n" print >>fp, "static Py_UCS4 normalization_%s(Py_UCS4 n)" % cversion print >>fp, "{" print >>fp, "\tswitch(n) {" for k, v in normalization: print >>fp, "\tcase %s: return 0x%s;" % (hex(k), v) print >>fp, "\tdefault: return 0;" print >>fp, "\t}\n}\n" fp.close() | 1a1a16dadbe641a2f5cf09a8c8257f03d8f90642 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8125/1a1a16dadbe641a2f5cf09a8c8257f03d8f90642/makeunicodedata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
9124,
892,
12,
9124,
16,
2606,
4672,
225,
9609,
273,
261,
20,
16,
374,
16,
374,
16,
374,
16,
374,
16,
374,
13,
1014,
273,
306,
21050,
65,
1247,
273,
288,
20,
30,
9609,
97,
77... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
9124,
892,
12,
9124,
16,
2606,
4672,
225,
9609,
273,
261,
20,
16,
374,
16,
374,
16,
374,
16,
374,
16,
374,
13,
1014,
273,
306,
21050,
65,
1247,
273,
288,
20,
30,
9609,
97,
77... |
where inv.state in ('open','paid') and inv_line.product_id is not null and inv_country.intrastat=true group by inv.period_id,intrastat.id,inv.type,pt.intrastat_id, inv_country.code,inv.number, inv.currency_id | where inv.state in ('open','paid') and inv_line.product_id is not null and inv_country.intrastat=true group by inv.period_id,intrastat.id,inv.type,pt.intrastat_id, inv_country.code,inv.number, inv.currency_id | def init(self, cr): cr.execute(""" create or replace view report_intrastat as ( | 674be36fa911a19db20d1cc418a92f3e7b210b09 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/674be36fa911a19db20d1cc418a92f3e7b210b09/report_intrastat.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
12,
2890,
16,
4422,
4672,
4422,
18,
8837,
2932,
3660,
752,
578,
1453,
1476,
2605,
67,
267,
313,
689,
270,
487,
261,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
12,
2890,
16,
4422,
4672,
4422,
18,
8837,
2932,
3660,
752,
578,
1453,
1476,
2605,
67,
267,
313,
689,
270,
487,
261,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
result += mediawiki_style | result.append(mediawiki_style) | def _tohtml(self, article): t0 = time.time() if self.stop_requested: raise ArticleLoadStopRequested | 1dd07913622ee2aa2f1a7b94f9cefba558a3a4a9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14305/1dd07913622ee2aa2f1a7b94f9cefba558a3a4a9/qtui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
869,
2620,
12,
2890,
16,
7559,
4672,
268,
20,
273,
813,
18,
957,
1435,
309,
365,
18,
5681,
67,
19065,
30,
1002,
17889,
2563,
4947,
11244,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
869,
2620,
12,
2890,
16,
7559,
4672,
268,
20,
273,
813,
18,
957,
1435,
309,
365,
18,
5681,
67,
19065,
30,
1002,
17889,
2563,
4947,
11244,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
adjust+= 1 return op1, op2, adjust if len(op1.int) > len(op2.int) + 1: diff = len(op1.int) - len(op2.int) - 1 op2.int.extend([0]*diff) op2.exp -= diff adjust -= diff if len(op1.int) == len(op2.int)+1 and op1.int > op2.int: op2.int.append(0) | adjust += 1 while op1.int >= (10 * op2.int): op2.int *= 10 | def _adjust_coefficients(op1, op2): """Adjust op1, op2 so that op2.int+[0] > op1.int >= op2.int. Returns the adjusted op1, op2 as well as the change in op1.exp-op2.exp. Used on _WorkRep instances during division. """ adjust = 0 #If op1 is smaller, get it to same size if len(op2.int) > len(op1.int): diff = len(op2.int) - len(op1.int) op1.int.extend([0]*diff) op1.exp -= diff adjust = diff #Same length, wrong order if len(op1.int) == len(op2.int) and op1.int < op2.int: op1.int.append(0) op1.exp -= 1 adjust+= 1 return op1, op2, adjust if len(op1.int) > len(op2.int) + 1: diff = len(op1.int) - len(op2.int) - 1 op2.int.extend([0]*diff) op2.exp -= diff adjust -= diff if len(op1.int) == len(op2.int)+1 and op1.int > op2.int: op2.int.append(0) op2.exp -= 1 adjust -= 1 return op1, op2, adjust | 1a63da64df2af26e1f050749c19281f1de9084fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1a63da64df2af26e1f050749c19281f1de9084fa/decimal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
13362,
67,
8075,
12344,
12,
556,
21,
16,
1061,
22,
4672,
3536,
10952,
1061,
21,
16,
1061,
22,
1427,
716,
1061,
22,
18,
474,
15,
63,
20,
65,
405,
1061,
21,
18,
474,
1545,
1061,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
13362,
67,
8075,
12344,
12,
556,
21,
16,
1061,
22,
4672,
3536,
10952,
1061,
21,
16,
1061,
22,
1427,
716,
1061,
22,
18,
474,
15,
63,
20,
65,
405,
1061,
21,
18,
474,
1545,
1061,
... |
('n', 'name', '', _('merge queue name (DEPRECATED)'))], _('hg qpush [-f] [-l] [-a] [-m] [-n NAME] [PATCH | INDEX]')), | ('n', 'name', '', _('merge queue name (DEPRECATED)')), ('', 'move', None, _('reorder patch series and apply only the patch'))], _('hg qpush [-f] [-l] [-a] [-m] [-n NAME] [--move] [PATCH | INDEX]')), | def uisetup(ui): mqopt = [('', 'mq', None, _("operate on patch repository"))] extensions.wrapcommand(commands.table, 'import', mqimport) entry = extensions.wrapcommand(commands.table, 'init', mqinit) entry[1].extend(mqopt) norepo = commands.norepo.split(" ") for cmd in commands.table.keys(): cmd = cmdutil.parsealiases(cmd)[0] if cmd in norepo: continue entry = extensions.wrapcommand(commands.table, cmd, mqcommand) entry[1].extend(mqopt) | d9ca42829e5a3676d3fb8db6c01318bcee5bd73c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11312/d9ca42829e5a3676d3fb8db6c01318bcee5bd73c/mq.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
582,
291,
278,
416,
12,
4881,
4672,
18327,
3838,
273,
306,
2668,
2187,
296,
11636,
2187,
599,
16,
389,
2932,
4063,
340,
603,
4729,
3352,
6,
3719,
65,
225,
4418,
18,
4113,
3076,
12,
784... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
582,
291,
278,
416,
12,
4881,
4672,
18327,
3838,
273,
306,
2668,
2187,
296,
11636,
2187,
599,
16,
389,
2932,
4063,
340,
603,
4729,
3352,
6,
3719,
65,
225,
4418,
18,
4113,
3076,
12,
784... |
if _debug: print "\t%s: Called Scene.place()" % rendererName | debugMsg("Called Scene.place()") if obj is None: raise ValueError, "You must specify an object to place" | def place(self, obj): """ Place an object within a scene | d93bfdcd3bd0a6bbc36a3723be3891c95ae2eff8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8476/d93bfdcd3bd0a6bbc36a3723be3891c95ae2eff8/scene.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3166,
12,
2890,
16,
1081,
4672,
3536,
13022,
392,
733,
3470,
279,
9065,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3166,
12,
2890,
16,
1081,
4672,
3536,
13022,
392,
733,
3470,
279,
9065,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
global first_warning PROCESSOR = os.uname()[-1] bober_is_good = 'x86' in PROCESSOR if k is not None: algorithm = 'gap' elif algorithm == 'default': if bober_is_good: | if algorithm == 'default': if k is None: | def number_of_partitions(n,k=None, algorithm='default'): r""" Returns the size of partitions_list(n,k). INPUT: n -- an integer k -- (default: None); if specified, instead returns the cardinality of the set of all (unordered) partitions of the positive integer n into sums with k summands. algorithm -- (default: 'default') 'default' -- if k is given use Gap. Otherwise, on x86 when n > 3000, use 'bober' On non x86 use 'pari'. 'bober' -- use Jonathon Bober's implementation 'gap' -- use GAP (VERY *slow*) 'pari' -- use PARI. Speed seems the same as GAP until $n$ is in the thousands, in which case PARI is faster. *But* PARI has a bug, e.g., on 64-bit Linux PARI-2.3.2 outputs numbpart(147007)%1000 as 536, but it should be 533!. So do not use this option. IMPLEMENTATION: Wraps GAP's NrPartitions or PARI's numbpart function. Use the function \code{partitions(n)} to return a generator over all partitions of $n$. It is possible to associate with every partition of the integer n a conjugacy class of permutations in the symmetric group on n points and vice versa. Therefore p(n) = NrPartitions(n) is the number of conjugacy classes of the symmetric group on n points. EXAMPLES: sage: v = list(partitions(5)); v [(1, 1, 1, 1, 1), (1, 1, 1, 2), (1, 2, 2), (1, 1, 3), (2, 3), (1, 4), (5,)] sage: len(v) 7 sage: number_of_partitions(5, algorithm='gap') 7 sage: number_of_partitions(5, algorithm='pari') 7 sage: number_of_partitions(5, algorithm='bober') 7 The input must be a nonnegative integer or a ValueError is raised. sage: number_of_partitions(-5) Traceback (most recent call last): ... ValueError: n (=-5) must be a nonnegative integer sage: number_of_partitions(10,2) 5 sage: number_of_partitions(10) 42 sage: number_of_partitions(3) 3 sage: number_of_partitions(10) 42 sage: number_of_partitions(3, algorithm='pari') 3 sage: number_of_partitions(10, algorithm='pari') 42 sage: number_of_partitions(40) 37338 sage: number_of_partitions(100) 190569292 sage: number_of_partitions(100000) 27493510569775696512677516320986352688173429315980054758203125984302147328114964173055050741660736621590157844774296248940493063070200461792764493033510116079342457190155718943509725312466108452006369558934464248716828789832182345009262853831404597021307130674510624419227311238999702284408609370935531629697851569569892196108480158600569421098519 A generating function for p(n) is given by the reciprocal of Euler's function: \[ \sum_{n=0}^\infty p(n)x^n = \prod_{k=1}^\infty \left(\frac {1}{1-x^k} \right). \] We use SAGE to verify that the first several coefficients do instead agree: sage: q = PowerSeriesRing(QQ, 'q', default_prec=9).gen() sage: prod([(1-q^k)^(-1) for k in range(1,9)]) ## partial product of 1 + q + 2*q^2 + 3*q^3 + 5*q^4 + 7*q^5 + 11*q^6 + 15*q^7 + 22*q^8 + O(q^9) sage: [number_of_partitions(k) for k in range(2,10)] [2, 3, 5, 7, 11, 15, 22, 30] REFERENCES: http://en.wikipedia.org/wiki/Partition_%28number_theory%29 TESTS: sage: n = 500 + randint(0,500) sage: number_of_partitions( n - (n % 385) + 369) % 385 == 0 True sage: n = 1500 + randint(0,1500) sage: number_of_partitions( n - (n % 385) + 369) % 385 == 0 True sage: n = 1000000 + randint(0,1000000) sage: number_of_partitions( n - (n % 385) + 369) % 385 == 0 True sage: n = 1000000 + randint(0,1000000) sage: number_of_partitions( n - (n % 385) + 369) % 385 == 0 True sage: n = 1000000 + randint(0,1000000) sage: number_of_partitions( n - (n % 385) + 369) % 385 == 0 True sage: n = 1000000 + randint(0,1000000) sage: number_of_partitions( n - (n % 385) + 369) % 385 == 0 True sage: n = 1000000 + randint(0,1000000) sage: number_of_partitions( n - (n % 385) + 369) % 385 == 0 True sage: n = 1000000 + randint(0,1000000) sage: number_of_partitions( n - (n % 385) + 369) % 385 == 0 True sage: n = 100000000 + randint(0,100000000) # takes a long time sage: number_of_partitions( n - (n % 385) + 369) % 385 == 0 True sage: n = 100000000 + randint(0,100000000) # takes a long time sage: number_of_partitions( n - (n % 385) + 369) % 385 == 0 True sage: n = 100000000 + randint(0,100000000) # takes a long time sage: number_of_partitions( n - (n % 385) + 369) % 385 == 0 True Another consistency test for n up to 500: sage: len([n for n in [1..500] if number_of_partitions(n) != number_of_partitions(n,algorithm='pari')]) 0 """ n = ZZ(n) if n < 0: raise ValueError, "n (=%s) must be a nonnegative integer"%n elif n == 0: return ZZ(1) global first_warning PROCESSOR = os.uname()[-1] bober_is_good = 'x86' in PROCESSOR if k is not None: algorithm = 'gap' elif algorithm == 'default': if bober_is_good: algorithm = 'bober' elif PROCESSOR in ['x86', 'Power Macintosh']: algorithm = 'pari' else: algorithm = 'gap' if algorithm == 'gap': if k is None: ans=gap.eval("NrPartitions(%s)"%(ZZ(n))) else: ans=gap.eval("NrPartitions(%s,%s)"%(ZZ(n),ZZ(k))) return ZZ(ans) if k is not None: raise ValueError, "only the GAP algorithm works if k is specified." if algorithm == 'bober': if not bober_is_good: if first_warning: print "*WARNING*: bober's implementation is broken on this platform or this size of n." first_warning=False return partitions_ext.number_of_partitions(n) elif algorithm == 'pari': if n > 3000 and 'x86_64' in PROCESSOR: if first_warning: print "*WARNING*: Pari's numbpart is very buggy on x86_64 (fixed in svn, so don't report to pari-dev)" first_warning = False return ZZ(pari(ZZ(n)).numbpart()) raise ValueError, "unknown algorithm '%s'"%algorithm | 32b7e3e34ee2ff937faae0230b8ebf39b731bf5b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/32b7e3e34ee2ff937faae0230b8ebf39b731bf5b/combinat.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1300,
67,
792,
67,
21275,
12,
82,
16,
79,
33,
7036,
16,
4886,
2218,
1886,
11,
4672,
436,
8395,
2860,
326,
963,
434,
10060,
67,
1098,
12,
82,
16,
79,
2934,
225,
12943,
30,
290,
1493,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1300,
67,
792,
67,
21275,
12,
82,
16,
79,
33,
7036,
16,
4886,
2218,
1886,
11,
4672,
436,
8395,
2860,
326,
963,
434,
10060,
67,
1098,
12,
82,
16,
79,
2934,
225,
12943,
30,
290,
1493,
... |
if url is None: | if (url is None and hasattr(linker, 'docindex') and linker.docindex.find(identifier, self.container) is None): | def specialize_valdoc_node(node, val_doc, context, url): """ Update the style attributes of `node` to reflext its type and context. """ # We can only use html-style nodes if dot_version>2. dot_version = get_dot_version() # If val_doc or context is a variable, get its value. if isinstance(val_doc, VariableDoc) and val_doc.value is not UNKNOWN: val_doc = val_doc.value if isinstance(context, VariableDoc) and context.value is not UNKNOWN: context = context.value # Set the URL. (Do this even if it points to the page we're # currently on; otherwise, the tooltip is ignored.) node['href'] = url or NOOP_URL if url is None: node['fillcolor'] = UNDOCUMENTED_BG node['style'] = 'filled' if isinstance(val_doc, ModuleDoc) and dot_version >= [2]: node['shape'] = 'plaintext' if val_doc == context: color = SELECTED_BG else: color = MODULE_BG node['tooltip'] = node['label'] node['html_label'] = MODULE_NODE_HTML % (color, color, url, val_doc.canonical_name, node['label']) node['width'] = node['height'] = 0 node.port = 'body' elif isinstance(val_doc, RoutineDoc): node['shape'] = 'box' node['style'] = 'rounded' node['width'] = 0 node['height'] = 0 node['label'] = '%s()' % node['label'] node['tooltip'] = node['label'] if val_doc == context: node['fillcolor'] = SELECTED_BG node['style'] = 'filled,rounded,bold' else: node['shape'] = 'box' node['width'] = 0 node['height'] = 0 node['tooltip'] = node['label'] if val_doc == context: node['fillcolor'] = SELECTED_BG node['style'] = 'filled,bold' | df1d51214c7e1eac51ad3465cf4deba34a9e059f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11420/df1d51214c7e1eac51ad3465cf4deba34a9e059f/dotgraph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
857,
1710,
67,
1125,
2434,
67,
2159,
12,
2159,
16,
1244,
67,
2434,
16,
819,
16,
880,
4672,
3536,
2315,
326,
2154,
1677,
434,
1375,
2159,
68,
358,
1278,
4149,
88,
2097,
618,
471,
819,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
857,
1710,
67,
1125,
2434,
67,
2159,
12,
2159,
16,
1244,
67,
2434,
16,
819,
16,
880,
4672,
3536,
2315,
326,
2154,
1677,
434,
1375,
2159,
68,
358,
1278,
4149,
88,
2097,
618,
471,
819,
... |
del resourceDict['GridCE'] | del resourceDict['Site'] | def newSelectJob(self, resourceJDL): """ Main job selection function to find the highest priority job matching the resource capacity """ | df58cfb50ca17c82526ec6cd541e026d53e35192 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/df58cfb50ca17c82526ec6cd541e026d53e35192/MatcherHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
3391,
2278,
12,
2890,
16,
1058,
46,
8914,
4672,
3536,
12740,
1719,
4421,
445,
358,
1104,
326,
9742,
4394,
1719,
3607,
326,
1058,
7519,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
3391,
2278,
12,
2890,
16,
1058,
46,
8914,
4672,
3536,
12740,
1719,
4421,
445,
358,
1104,
326,
9742,
4394,
1719,
3607,
326,
1058,
7519,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
elif next_tag is _dot and _PREC_CALL >= min_precedence: | elif next_tag is _dot and _PREC_CALL > min_precedence: | def parse_expression(pstate, min_precedence=0): pstate.expect_not_end() | bc9af223f762c9af10a8ad354fe038d20058bf40 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12571/bc9af223f762c9af10a8ad354fe038d20058bf40/parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
8692,
12,
84,
2019,
16,
1131,
67,
1484,
24092,
33,
20,
4672,
293,
2019,
18,
12339,
67,
902,
67,
409,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
8692,
12,
84,
2019,
16,
1131,
67,
1484,
24092,
33,
20,
4672,
293,
2019,
18,
12339,
67,
902,
67,
409,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
count = int(float((end-start)/step)) | count = int(math.ceil((float((end-start)/step)))) | def generic_xsrange(start, end, step): sign = 1 if step > 0 else -1 # In order for range to make sense, start, end, and step must lie in a 1-dim real subspace... count = int(float((end-start)/step)) if count <= 0: return # we assume that a+b*c = a + b + ... + b if not (start + (count+1) * step)*sign > end*sign: # we won't get there by adding, perhaps comparison in the ring is bad # rather than enter an infinite loop, do something sensible # the 'not' is hear because incomparable items return False for k in xrange(count): yield start + k*step elif step > 0: while start < end: yield start start += step elif step < 0: while start > end: yield start start += step else: raise ValueError, "step must not be 0" | b0407bebdcafbc7357b33c8faa600978ff6cc467 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/b0407bebdcafbc7357b33c8faa600978ff6cc467/misc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5210,
67,
13713,
3676,
12,
1937,
16,
679,
16,
2235,
4672,
1573,
273,
404,
309,
2235,
405,
374,
469,
300,
21,
468,
657,
1353,
364,
1048,
358,
1221,
12764,
16,
787,
16,
679,
16,
471,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5210,
67,
13713,
3676,
12,
1937,
16,
679,
16,
2235,
4672,
1573,
273,
404,
309,
2235,
405,
374,
469,
300,
21,
468,
657,
1353,
364,
1048,
358,
1221,
12764,
16,
787,
16,
679,
16,
471,
2... |
self.visited = [] | visited = [] def recurse_get_tree(node): if node.id not in visited: if node.parent == None or node.parent in visited: visited.append(node.id) ret_dict = {} ret_dict[node] = [] if hasattr(node, 'children'): ret_dict[node] = map(recurse_get_tree, node.children) return ret_dict | def get_tree(self): """ Get tree as a list of dictionaries ordered by weight """ nodes = self.get_tree_nodes() data = [] for node in nodes: node.children = self.get_node_children(node.id) self.visited = [] for node in nodes: res = self.__get_tree_rec(node) if res: data.append(res) del(self.visited) return data | dd87cc19a8e86cac6256d5aace906b4d19a764ad /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3287/dd87cc19a8e86cac6256d5aace906b4d19a764ad/RefTree.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3413,
12,
2890,
4672,
3536,
968,
2151,
487,
279,
666,
434,
16176,
5901,
635,
3119,
3536,
2199,
273,
365,
18,
588,
67,
3413,
67,
4690,
1435,
501,
273,
5378,
364,
756,
316,
2199... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3413,
12,
2890,
4672,
3536,
968,
2151,
487,
279,
666,
434,
16176,
5901,
635,
3119,
3536,
2199,
273,
365,
18,
588,
67,
3413,
67,
4690,
1435,
501,
273,
5378,
364,
756,
316,
2199... |
molecule.atoms_extra = self.current_extra | molecule.atoms_extra = self.current_atoms_extra | def endElement(self, name): #print "END", name if name == 'molecule': if len(self.current_numbers) > 0: self.current_coordinates = numpy.array(self.current_coordinates)*angstrom molecule = Molecule(self.current_numbers, self.current_coordinates, self.current_title) molecule.extra = self.current_extra molecule.atoms_extra = self.current_extra | ada6476048a36baf5eae0cc31746bbfdffece0e5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11053/ada6476048a36baf5eae0cc31746bbfdffece0e5/cml.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14840,
12,
2890,
16,
508,
4672,
468,
1188,
315,
4415,
3113,
508,
309,
508,
422,
296,
81,
10545,
4278,
309,
562,
12,
2890,
18,
2972,
67,
13851,
13,
405,
374,
30,
365,
18,
2972,
67,
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,
14840,
12,
2890,
16,
508,
4672,
468,
1188,
315,
4415,
3113,
508,
309,
508,
422,
296,
81,
10545,
4278,
309,
562,
12,
2890,
18,
2972,
67,
13851,
13,
405,
374,
30,
365,
18,
2972,
67,
16... |
return "CC_PACKET:= " + common_var["Compiler"].get() | return "CC_PACKET=" + common_var["Compiler"].get() | def repl_compil(m): return "CC_PACKET:= " + common_var["Compiler"].get() | 6385f0785811600dab651549032609c9c60f04f1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2128/6385f0785811600dab651549032609c9c60f04f1/configure.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6831,
67,
2919,
330,
12,
81,
4672,
327,
315,
6743,
67,
12231,
1584,
1546,
397,
2975,
67,
1401,
9614,
9213,
6,
8009,
588,
1435,
225,
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,
0,
0,
0,
0,
0,
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,
6831,
67,
2919,
330,
12,
81,
4672,
327,
315,
6743,
67,
12231,
1584,
1546,
397,
2975,
67,
1401,
9614,
9213,
6,
8009,
588,
1435,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
cookie = makeCookie(request, u.id, maxage, expires) | cookie = makeCookie(request, cookie_name, cookie_string, maxage, expires) | def setCookie(request, u): """ Set cookie for the user obj u cfg.cookie_lifetime and the user 'remember_me' setting set the lifetime of the cookie. lifetime in int hours, see table: value cookie lifetime ---------------------------------------------------------------- = 0 forever, ignoring user 'remember_me' setting > 0 n hours, or forever if user checked 'remember_me' < 0 -n hours, ignoring user 'remember_me' setting """ # Calculate cookie maxage and expires lifetime = int(request.cfg.cookie_lifetime) * 3600 forever = 10*365*24*3600 # 10 years now = time.time() if not lifetime: maxage = forever elif lifetime > 0: if u.remember_me: maxage = forever else: maxage = lifetime elif lifetime < 0: maxage = (-lifetime) expires = now + maxage cookie = makeCookie(request, u.id, maxage, expires) # Set cookie request.setHttpHeader(cookie) # IMPORTANT: Prevent caching of current page and cookie request.disableHttpCaching() | 52d72a54d36dd3229ef30015f18438b64a2efc64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/888/52d72a54d36dd3229ef30015f18438b64a2efc64/auth.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26793,
12,
2293,
16,
582,
4672,
3536,
1000,
3878,
364,
326,
729,
1081,
582,
225,
2776,
18,
8417,
67,
17155,
471,
326,
729,
296,
28155,
67,
3501,
11,
3637,
444,
326,
12486,
434,
326,
38... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26793,
12,
2293,
16,
582,
4672,
3536,
1000,
3878,
364,
326,
729,
1081,
582,
225,
2776,
18,
8417,
67,
17155,
471,
326,
729,
296,
28155,
67,
3501,
11,
3637,
444,
326,
12486,
434,
326,
38... |
self.assertEqual(w.total_special, 0) self.assertEqual(w.total_errors, 0) self.assertEqual(w.total_deleted, 2) | self.assertEqual(worker.total_special, 0) self.assertEqual(worker.total_errors, 0) self.assertEqual(worker.total_deleted, 2) | def test_multiple_options(self): """Test one cleaner with two options""" ui = CLI.CliCallback() (fd, filename1) = tempfile.mkstemp('bleachbit-test') os.close(fd) self.assert_(os.path.exists(filename1)) (fd, filename2) = tempfile.mkstemp('bleachbit-test') os.close(fd) self.assert_(os.path.exists(filename2)) | b8320463fd914a7037e300abf46df0a699148b3f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7853/b8320463fd914a7037e300abf46df0a699148b3f/TestWorker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9622,
67,
2116,
12,
2890,
4672,
3536,
4709,
1245,
25933,
598,
2795,
702,
8395,
5915,
273,
8276,
18,
12265,
2428,
1435,
261,
8313,
16,
1544,
21,
13,
273,
13275,
18,
24816,
19781... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9622,
67,
2116,
12,
2890,
4672,
3536,
4709,
1245,
25933,
598,
2795,
702,
8395,
5915,
273,
8276,
18,
12265,
2428,
1435,
261,
8313,
16,
1544,
21,
13,
273,
13275,
18,
24816,
19781... |
struct = 3 | struct = 7 | def GetValues(self): name = self.IndexName.GetValue() index = int(self.Index.GetValue(), 16) if self.radioButton1.GetValue(): struct = 1 number = None elif self.radioButton2.GetValue(): struct = 3 number = int(self.Number.GetValue()) elif self.radioButton3.GetValue(): struct = 7 number = int(self.Number.GetValue()) return index, name, struct, number | 1a6aace7b6747da8083b4daf8d638cbc84d696a3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/116/1a6aace7b6747da8083b4daf8d638cbc84d696a3/commondialogs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
1972,
12,
2890,
4672,
508,
273,
365,
18,
29276,
18,
967,
620,
1435,
770,
273,
509,
12,
2890,
18,
1016,
18,
967,
620,
9334,
2872,
13,
309,
365,
18,
17006,
3616,
21,
18,
967,
620,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
1972,
12,
2890,
4672,
508,
273,
365,
18,
29276,
18,
967,
620,
1435,
770,
273,
509,
12,
2890,
18,
1016,
18,
967,
620,
9334,
2872,
13,
309,
365,
18,
17006,
3616,
21,
18,
967,
620,... |
this = apply(_quickfix.new_AllowableOneSidednessValue, args) | this = _quickfix.new_AllowableOneSidednessValue(*args) | def __init__(self, *args): this = apply(_quickfix.new_AllowableOneSidednessValue, args) try: self.this.append(this) except: self.this = this | 7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
31508,
3335,
55,
13898,
4496,
620,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
31508,
3335,
55,
13898,
4496,
620,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,... |
self.dbg('%s: %s', name, path) | self.info('%s: %s', name, path) | def markTag(self, name, tag, path, tagFile=None): # commonly, a tagdescription will nominate a file to be # tagged, but it will also be set explicitly in the recipe, # and therefore markTag will be called twice. if (len(tag.split()) > 1 or not tag.replace('-', '').replace('_', '').isalnum()): # handlers for multiple tags require strict tag names: # no whitespace, only alphanumeric plus - and _ characters self.error('illegal tag name %s for file %s' %(tag, path)) return tags = self.recipe.autopkg.pathMap[path].tags if tag not in tags: self.dbg('%s: %s', name, path) tags.set(tag) if tagFile: for trove in self.db.iterTrovesByPath(tagFile.tagFile): troveName = trove.getName() if troveName not in self.recipe.buildRequires: # XXX should be error, change after bootstrap self.warn("%s assigned by %s to file %s, so add '%s'" ' to buildRequires or call r.TagSpec()' %(tag, tagFile.tagFile, path, troveName)) | 127a4db6683a2662d5c12a5fedf28da3a4c43c2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/127a4db6683a2662d5c12a5fedf28da3a4c43c2c/packagepolicy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2267,
1805,
12,
2890,
16,
508,
16,
1047,
16,
589,
16,
1047,
812,
33,
7036,
4672,
468,
2975,
715,
16,
279,
1047,
3384,
903,
12457,
3322,
279,
585,
358,
506,
468,
12503,
16,
1496,
518,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2267,
1805,
12,
2890,
16,
508,
16,
1047,
16,
589,
16,
1047,
812,
33,
7036,
4672,
468,
2975,
715,
16,
279,
1047,
3384,
903,
12457,
3322,
279,
585,
358,
506,
468,
12503,
16,
1496,
518,
... |
debug(PROXY, 'Proxy: reserve_server %s %s', str(addr), str(server)) | debug(PROXY, 'pool reserve %s %s', str(addr), str(server)) | def reserve_server (self, addr): for server,status in self.map.get(addr, {}).items(): if status[0] == 'available': # Let's reuse this one self.map[addr][server] = ('busy', ) debug(PROXY, 'Proxy: reserve_server %s %s', str(addr), str(server)) return server return None | 8fa004b39b4a5c3551e8d2294d084af9e0055974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/8fa004b39b4a5c3551e8d2294d084af9e0055974/ServerPool.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20501,
67,
3567,
261,
2890,
16,
3091,
4672,
364,
1438,
16,
2327,
316,
365,
18,
1458,
18,
588,
12,
4793,
16,
2618,
2934,
3319,
13332,
309,
1267,
63,
20,
65,
422,
296,
5699,
4278,
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,
20501,
67,
3567,
261,
2890,
16,
3091,
4672,
364,
1438,
16,
2327,
316,
365,
18,
1458,
18,
588,
12,
4793,
16,
2618,
2934,
3319,
13332,
309,
1267,
63,
20,
65,
422,
296,
5699,
4278,
468,
... |
import doctest, test_support, test_generators | import doctest from test import test_support, test_generators | def test_main(verbose=None): import doctest, test_support, test_generators if 0: # change to 1 to run forever (to check for leaks) while 1: doctest.master = None test_support.run_doctest(test_generators, verbose) print ".", else: test_support.run_doctest(test_generators, verbose) | e45d59841e57ddcd31a7a0fb570f345b80c8796f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6753/e45d59841e57ddcd31a7a0fb570f345b80c8796f/test_generators.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5254,
12,
11369,
33,
7036,
4672,
1930,
31263,
395,
628,
1842,
1930,
1842,
67,
13261,
16,
1842,
67,
25959,
309,
374,
30,
282,
468,
2549,
358,
404,
358,
1086,
21238,
261,
869,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5254,
12,
11369,
33,
7036,
4672,
1930,
31263,
395,
628,
1842,
1930,
1842,
67,
13261,
16,
1842,
67,
25959,
309,
374,
30,
282,
468,
2549,
358,
404,
358,
1086,
21238,
261,
869,
... |
if allowwait: drawwait() | def draw(F, view=None,bbox='auto', color='prop',colormap=None,alpha=0.5, mode=None,linewidth=None,shrink=None,marksize=None, wait=True,clear=None,allviews=False): """Draw object(s) with specified settings and direct camera to it. The first argument is an object to be drawn. All other arguments are settings that influence how the object is being drawn. F is either a Formex or a TriSurface object, or a name of such object (global or exported), or a list thereof. If F is a list, the draw() function is called repeatedly with each of ithe items of the list as first argument and with the remaining arguments unchanged. view is either the name of a defined view or 'last' or None. Predefined views are 'front','back','top','bottom','left','right','iso'. With view=None the camera settings remain unchanged (but might be changed interactively through the user interface). This may make the drawn object out of view! With view='last', the camera angles will be set to the same camera angles as in the last draw operation, undoing any interactive changes. The initial default view is 'front' (looking in the -z direction). bbox specifies the 3D volume at which the camera will be aimed (using the angles set by view). The camera position wil be set so that the volume comes in view using the current lens (default 45 degrees). bbox is a list of two points or compatible (array with shape (2,3)). Setting the bbox to a volume not enclosing the object may make the object invisible on the canvas. The default bbox='auto' will use the bounding box of the objects getting drawn (object.bbox()), thus ensuring that the camera will focus on the shown object. With bbox=None, the camera's target volume remains unchanged. color,colormap,linewidth,alpha,marksize are passed to the creation of the 3D actor. shrink is a floating point shrink factor that will be applied to object before drawing it. If the Formex has properties and a color list is specified, then the the properties will be used as an index in the color list and each member will be drawn with the resulting color. If color is one color value, the whole Formex will be drawn with that color. Finally, if color=None is specified, the whole Formex is drawn in black. Each draw action activates a locking mechanism for the next draw action, which will only be allowed after drawdelay seconds have elapsed. This makes it easier to see subsequent images and is far more elegant that an explicit sleep() operation, because all script processing will continue up to the next drawing instruction. The value of drawdelay is set in the config, or 2 seconds by default. The user can disable the wait cycle for the next draw operation by specifying wait=False. Setting drawdelay=0 will disable the waiting mechanism for all subsequent draw statements (until set >0 again). """ global allowwait if allowwait: drawwait() if type(F) == list: actor = [] nowait = False for Fi in F: if Fi == F[-1]: nowait = wait actor.append(draw(Fi,view,bbox, color,colormap,alpha, mode,linewidth,shrink,marksize, wait,clear,allviews)) if Fi == F[0]: clear = False view = None return actor if type(F) == str: F = named(F) if F is None: return None if not (isinstance(F,formex.Formex) or isinstance(F,surface.TriSurface) or isinstance(F,tools.Plane)): raise RuntimeError,"draw() can not draw objects of type %s" % type(F) if clear is None: clear = DrawOptions.get('clear',False) if clear: clear_canvas() if view is not None and view != 'last': GD.debug("SETTING VIEW to %s" % view) setView(view) if shrink is None: shrink = DrawOptions.get('shrink',None) if marksize is None: marksize = DrawOptions.get('marksize',GD.cfg.get('marksize',5.0)) # Create the colors if color == 'prop': if hasattr(F,'p'): color = F.p else: color = colors.black elif color == 'random': # create random colors color = numpy.random.random((F.nelems(),3),dtype=float32) GD.gui.setBusy() if shrink is not None: #GD.debug("DRAWING WITH SHRINK = %s" % shrink) F = _shrink(F,shrink) try: if isinstance(F,formex.Formex): if F.nelems() == 0: return None actor = actors.FormexActor(F,color=color,colormap=colormap,alpha=alpha,mode=mode,linewidth=linewidth,marksize=marksize) elif isinstance(F,surface.TriSurface): if F.nelems() == 0: return None actor = actors.TriSurfaceActor(F,color=color,colormap=colormap,alpha=alpha,mode=mode,linewidth=linewidth) elif isinstance(F,tools.Plane): return drawPlane(F.point(),F.normal(),F.size()) GD.canvas.addActor(actor) if view is not None or bbox is not None: #GD.debug("CHANGING VIEW to %s" % view) if view == 'last': view = DrawOptions['view'] if bbox == 'auto': bbox = F.bbox() #GD.debug("SET CAMERA TO: bbox=%s, view=%s" % (bbox,view)) GD.canvas.setCamera(bbox,view) #setView(view) GD.canvas.update() GD.app.processEvents() #GD.debug("AUTOSAVE %s" % image.autoSaveOn()) if image.autoSaveOn(): image.saveNext() if allowwait and wait: ## if stepmode: ## drawblock() ## else: drawlock() finally: GD.gui.setBusy(False) return actor | 674bbe4f83a61b08eb79cd0f0038a26ceb2a9e31 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2499/674bbe4f83a61b08eb79cd0f0038a26ceb2a9e31/draw.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
12,
42,
16,
1476,
33,
7036,
16,
20737,
2218,
6079,
2187,
2036,
2218,
5986,
2187,
1293,
18804,
33,
7036,
16,
5429,
33,
20,
18,
25,
16,
1965,
33,
7036,
16,
7511,
14434,
33,
7036,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
12,
42,
16,
1476,
33,
7036,
16,
20737,
2218,
6079,
2187,
2036,
2218,
5986,
2187,
1293,
18804,
33,
7036,
16,
5429,
33,
20,
18,
25,
16,
1965,
33,
7036,
16,
7511,
14434,
33,
7036,
... | |
etemp = e e = d | dx_temp = deltax deltax= rat | def brent(func, args=(), brack=None, tol=1.48e-8, full_output=0, maxiter=500): """ Given a function of one-variable and a possible bracketing interval, return the minimum of the function isolated to a fractional precision of tol. A bracketing interval is a triple (a,b,c) where (a<b<c) and func(b) < func(a),func(c). If bracket is two numbers then they are assumed to be a starting interval for a downhill bracket search (see bracket) Uses inverse interpolation when possible to speed up convergence. """ _mintol = 1.0e-11 _cg = 0.3819660 if brack is None: xa,xb,xc,fa,fb,fc,funcalls = bracket(func, args=args) elif len(brack) == 2: xa,xb,xc,fa,fb,fc,funcalls = bracket(func, xa=brack[0], xb=brack[1], args=args) elif len(brack) == 3: xa,xb,xc = brack if (xa > xc): # swap so xa < xc can be assumed dum = xa; xa=xc; xc=dum assert ((xa < xb) and (xb < xc)), "Not a bracketing interval." fa = apply(func, (xa,)+args) fb = apply(func, (xb,)+args) fc = apply(func, (xc,)+args) assert ((fb<fa) and (fb < fc)), "Not a bracketing interval." funcalls = 3 else: raise ValuError, "Bracketing interval must be length 2 or 3 sequence." x=w=v=xb fw=fv=fx=apply(func, (x,)+args) if (xa < xc): a = xa; b = xc else: a = xc; b = xa e = 0.0 funcalls = 1 iter = 0 while (iter < maxiter): tol1 = tol*abs(x) + _mintol tol2 = 2.0*tol1 xmid = 0.5*(a+b) if abs(x-xmid) < (tol2-0.5*(b-a)): # check for convergence xmin=x; fval=fx break if (abs(e) <= tol1): # do a parabolic fit if (x>=xmid): e=a-x else: e=b-x d = _cg*e else: tmp1 = (x-w)*(fx-fv) tmp2 = (x-v)*(fx-fw) p = (x-v)*tmp2 - (x-w)*tmp1; tmp2 = 2.0*(tmp2-tmp1) if (tmp2 > 0.0): p = -p tmp2 = abs(tmp2) etemp = e e = d # check parabolic fit if ((p > tmp2*(a-x)) and (p < tmp2*(b-x)) and (abs(p) < abs(0.5*tmp2*etemp))): d = p*1.0/tmp2 # if it's good use it. u = x + d if ((u-a) < tol2 or (b-u) < tol2): if xmid-x >= 0: d = tol1 else: d = -tol1 else: if (x>=xmid): e=a-x # if it's bad do a golden section step else: e=b-x d = _cg*e if (abs(d) < tol1): if d >= 0: u = x + tol1 else: u = x - tol1 else: u = x + d fu = apply(func, (u,)+args) funcalls += 1 if (fu > fx): if (u<x): a=u else: b=u if (fu<=fw) or (w==x): v=w; w=u; fv=fw; fw=fu elif (fu<=fv) or (v==x) or (v==w): v=u; fv=fu else: if (u >= x): a = x else: b = x v=w; w=x; x=u fv=fw; fw=fx; fx=fu xmin = x fval = fx if full_output: return xmin, fval, iter, funcalls else: return xmin | 151bc0cf429941b974cff683950f0c18642f7da4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/151bc0cf429941b974cff683950f0c18642f7da4/optimize.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
324,
547,
12,
644,
16,
833,
33,
9334,
16430,
363,
33,
7036,
16,
6085,
33,
21,
18,
8875,
73,
17,
28,
16,
1983,
67,
2844,
33,
20,
16,
25743,
33,
12483,
4672,
3536,
16803,
279,
445,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
324,
547,
12,
644,
16,
833,
33,
9334,
16430,
363,
33,
7036,
16,
6085,
33,
21,
18,
8875,
73,
17,
28,
16,
1983,
67,
2844,
33,
20,
16,
25743,
33,
12483,
4672,
3536,
16803,
279,
445,
4... |
except socket.error as msg: | except socket.error as err: msg = err | def connect(self, host = '', port = 0): '''Connect to host. Arguments are: - host: hostname to connect to (string, default previous host) - port: port to connect to (integer, default previous port)''' if host: self.host = host if port: self.port = port msg = "getaddrinfo returns an empty list" for res in socket.getaddrinfo(self.host, self.port, 0, socket.SOCK_STREAM): af, socktype, proto, canonname, sa = res try: self.sock = socket.socket(af, socktype, proto) self.sock.connect(sa) except socket.error as msg: if self.sock: self.sock.close() self.sock = None continue break if not self.sock: raise socket.error, msg self.af = af self.file = self.sock.makefile('rb') self.welcome = self.getresp() return self.welcome | 052e40c6e83ef222a079d9d58fd346301f113fe1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/052e40c6e83ef222a079d9d58fd346301f113fe1/ftplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3077,
12,
2890,
16,
1479,
273,
10226,
1756,
273,
374,
4672,
9163,
5215,
358,
1479,
18,
225,
13599,
854,
30,
300,
1479,
30,
5199,
358,
3077,
358,
261,
1080,
16,
805,
2416,
1479,
13,
300... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3077,
12,
2890,
16,
1479,
273,
10226,
1756,
273,
374,
4672,
9163,
5215,
358,
1479,
18,
225,
13599,
854,
30,
300,
1479,
30,
5199,
358,
3077,
358,
261,
1080,
16,
805,
2416,
1479,
13,
300... |
ret.append(rpm) | ret.setdefault(rpm, [ ]).append((name, f, v)) | def search(self, name, flag, version): # s/Conflicts/Obsoletes/ in ObsoletesList """Return a list of RpmPackage's with Conflicts: matching (name, RPMSENSE_* flag, EVR string).""" | 2169adb8d2c203f5b4c5934ddc8b49350a118270 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/2169adb8d2c203f5b4c5934ddc8b49350a118270/lists.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
12,
2890,
16,
508,
16,
2982,
16,
1177,
4672,
468,
272,
19,
30897,
19,
27637,
355,
278,
281,
19,
316,
531,
2038,
355,
278,
281,
682,
3536,
990,
279,
666,
434,
534,
7755,
2261,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
12,
2890,
16,
508,
16,
2982,
16,
1177,
4672,
468,
272,
19,
30897,
19,
27637,
355,
278,
281,
19,
316,
531,
2038,
355,
278,
281,
682,
3536,
990,
279,
666,
434,
534,
7755,
2261,
1... |
def getUrlFromRSS(pURL,pItem=0): """ Get the BBC's Day in Images URL from the RSS | def getUrlsFromRSS(pURL,pItem=0): """ Get the BBC's Day in Images URL from the RSS | def getUrlFromRSS(pURL,pItem=0): """ Get the BBC's Day in Images URL from the RSS pItem indicates which entry item one would like """ try: url_info = urllib2.urlopen(pURL) xmldoc = minidom.parse(url_info) return str(xmldoc.getElementsByTagName("item")[pItem].getElementsByTagName("link")[0].firstChild.wholeText) except: print "Error getting the URL from the RSS" raise | 1fd429a31aa3b31f3a004f7d0bca1e65ecd1fabd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10412/1fd429a31aa3b31f3a004f7d0bca1e65ecd1fabd/todaysimages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8928,
87,
1265,
31211,
12,
84,
1785,
16,
84,
1180,
33,
20,
4672,
3536,
968,
326,
605,
16283,
1807,
13735,
316,
23022,
1976,
628,
326,
31481,
225,
293,
1180,
8527,
1492,
1241,
761,
1245,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8928,
87,
1265,
31211,
12,
84,
1785,
16,
84,
1180,
33,
20,
4672,
3536,
968,
326,
605,
16283,
1807,
13735,
316,
23022,
1976,
628,
326,
31481,
225,
293,
1180,
8527,
1492,
1241,
761,
1245,
... |
repack_info, sbox_path=SBOX_PATH, sbox_home=SBOX_HOME): super(RepackMaemo, self).__init__(build, partner_dir, build_dir, working_dir, final_dir, repack_info) | platform_formatted, repack_info, sbox_path=SBOX_PATH, sbox_home=SBOX_HOME): super(RepackMaemo, self).__init__(build, partner_dir, build_dir, working_dir, final_dir, platform_formatted, repack_info) | def __init__(self, build, partner_dir, build_dir, working_dir, final_dir, repack_info, sbox_path=SBOX_PATH, sbox_home=SBOX_HOME): super(RepackMaemo, self).__init__(build, partner_dir, build_dir, working_dir, final_dir, repack_info) self.sbox_path = sbox_path self.sbox_home = sbox_home self.tmpdir = "%s/tmp_deb" % self.base_dir self.platform = platform_formatted | 8345bd04fc746d831846644290606cce5844b5a8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10262/8345bd04fc746d831846644290606cce5844b5a8/partner-repacks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1361,
16,
19170,
67,
1214,
16,
1361,
67,
1214,
16,
5960,
67,
1214,
16,
727,
67,
1214,
16,
4072,
67,
14897,
16,
2071,
484,
67,
1376,
16,
272,
2147,
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,
1001,
2738,
972,
12,
2890,
16,
1361,
16,
19170,
67,
1214,
16,
1361,
67,
1214,
16,
5960,
67,
1214,
16,
727,
67,
1214,
16,
4072,
67,
14897,
16,
2071,
484,
67,
1376,
16,
272,
2147,
67,
... |
if True: | def _params_allgood(ishape, kshape, mode, subsample=(1,1), img_stride=(1,1), kern_stride=(1,1), version=-1, verbose=0, random=True, print_=None, id=None, rtol=1e-5, atol = 1e-8, nb_iter=0, ones=False): if ones: assert not random npy_img = numpy.asarray(numpy.ones(ishape), dtype='float32') npy_kern = -numpy.asarray(numpy.ones(kshape), dtype='float32') elif random: npy_img = numpy.asarray(numpy.random.rand(*ishape), dtype='float32') npy_kern = numpy.asarray(numpy.random.rand(*kshape), dtype='float32') else: npy_img = numpy.asarray(numpy.arange(numpy.prod(ishape)).reshape(ishape), dtype='float32')+1 npy_kern = -(numpy.asarray(numpy.arange(numpy.prod(kshape)).reshape(kshape), dtype='float32')+1) img = cuda_ndarray.CudaNdarray(npy_img) kern = cuda_ndarray.CudaNdarray(npy_kern) #we take the stride after the transfert as we make c_contiguous data on the GPU. img=img[:,:,::img_stride[0],::img_stride[1]] kern=kern[:,:,::kern_stride[0],::kern_stride[1]] npy_img = npy_img[:,:,::img_stride[0],::img_stride[1]] npy_kern = npy_kern[:,:,::kern_stride[0],::kern_stride[1]] t2 = None rval = True try: if True: t0 = time.time() cpuval = py_conv_scipy(npy_img, npy_kern, mode, subsample) t1 = time.time() i = cuda_tensor4() k = cuda_tensor4() op = theano.sandbox.cuda.blas.GpuConv(border_mode=mode,subsample=subsample, version=version, verbose=verbose)(i,k) | 7e22b0d289e059a9fda0ea25f10ba979f8dd5288 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/7e22b0d289e059a9fda0ea25f10ba979f8dd5288/test_conv_cuda_ndarray.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2010,
67,
454,
19747,
12,
1468,
1273,
16,
417,
4867,
16,
1965,
16,
720,
6358,
28657,
21,
16,
21,
3631,
3774,
67,
27937,
28657,
21,
16,
21,
3631,
24579,
67,
27937,
28657,
21,
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,
389,
2010,
67,
454,
19747,
12,
1468,
1273,
16,
417,
4867,
16,
1965,
16,
720,
6358,
28657,
21,
16,
21,
3631,
3774,
67,
27937,
28657,
21,
16,
21,
3631,
24579,
67,
27937,
28657,
21,
16,
... | |
0.9092974 | 0.90929741 | def function_call(self, function, args=None, kwds=None): """ Calls the Lisp function with given args and kwds. For Lisp functions, the kwds are ignored. | b632467e5ca0a0b91320f57f8c4c3d90b498427e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/b632467e5ca0a0b91320f57f8c4c3d90b498427e/lisp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
445,
67,
1991,
12,
2890,
16,
445,
16,
833,
33,
7036,
16,
17149,
33,
7036,
4672,
3536,
23665,
326,
511,
23831,
445,
598,
864,
833,
471,
17149,
18,
2457,
511,
23831,
4186,
16,
326,
17149... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
445,
67,
1991,
12,
2890,
16,
445,
16,
833,
33,
7036,
16,
17149,
33,
7036,
4672,
3536,
23665,
326,
511,
23831,
445,
598,
864,
833,
471,
17149,
18,
2457,
511,
23831,
4186,
16,
326,
17149... |
[399, []] | [399, [convert_mathdots]] | def revert_mathdots(document): " Load mathdots if used in the document " while True: i = find_token(document.header, "\\use_mathdots" , 0) if i != -1: add_to_preamble(document, ["% this command was inserted by lyx2lyx"]) add_to_preamble(document, ["\\usepackage{mathdots}"]) del document.header[i] break | c1a97abe374d2b5bf8df2d2844f75de39bee9069 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7514/c1a97abe374d2b5bf8df2d2844f75de39bee9069/lyx_2_0.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15226,
67,
15949,
72,
6968,
12,
5457,
4672,
315,
4444,
4233,
72,
6968,
309,
1399,
316,
326,
1668,
315,
1323,
1053,
30,
277,
273,
1104,
67,
2316,
12,
5457,
18,
3374,
16,
8422,
1202,
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,
15226,
67,
15949,
72,
6968,
12,
5457,
4672,
315,
4444,
4233,
72,
6968,
309,
1399,
316,
326,
1668,
315,
1323,
1053,
30,
277,
273,
1104,
67,
2316,
12,
5457,
18,
3374,
16,
8422,
1202,
67,... |
sage: x = MPolynomialRing(RationalField(),3).gens() | sage: x = MPolynomialRing(RationalField(),'x',3).gens() | def __call__(self, *x): """ Evaluate the fraction at the given arguments. This assumes that a call function is defined for the numerator and denominator. | 8295627341a343c5e0857f214e62f90908572892 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9417/8295627341a343c5e0857f214e62f90908572892/fraction_field_element.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
380,
92,
4672,
3536,
18176,
326,
8330,
622,
326,
864,
1775,
18,
225,
1220,
13041,
716,
279,
745,
445,
353,
2553,
364,
326,
16730,
471,
15030,
18,
2,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
380,
92,
4672,
3536,
18176,
326,
8330,
622,
326,
864,
1775,
18,
225,
1220,
13041,
716,
279,
745,
445,
353,
2553,
364,
326,
16730,
471,
15030,
18,
2,
-100... |
if isinstance(arg1, Graph): if len(args) == 0: | import networkx if isinstance(arg1, BipartiteGraph): Graph.__init__(self, arg1, *args, **kwds) self.left, self.right = arg1.left, arg1.right elif isinstance(arg1, (networkx.XGraph, networkx.Graph)): Graph.__init__(self, arg1, *args, **kwds) if hasattr(arg1, 'node_type'): self.left = [] self.right = [] for v in arg1.nodes_iter(): if arg1.node_type[v] == 'Bottom': self.left.append(v) elif arg1.node_type[v] == 'Top': self.right.append(v) else: raise TypeError("NetworkX node_type defies bipartite assumtion (is not 'Top' or 'Bottom')") else: | def __init__(self, *args, **kwds): r""" Bipartite graph. | 2e5ef1f6088cb1066cff8463ebd5b8e67656385f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/2e5ef1f6088cb1066cff8463ebd5b8e67656385f/bipartite_graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
25577,
4672,
436,
8395,
605,
5762,
1137,
2667,
18,
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,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
25577,
4672,
436,
8395,
605,
5762,
1137,
2667,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
response = c.get(url % "DoesNotExist") | response = c.get(url % "-4") | def test_view_cluster_options(self): """ Test retrieving list of options a cluster has for vms """ url = '/vm/add/options/%s/' args = cluster.slug # anonymous user response = c.post(url % args, follow=True) self.assertEqual(200, response.status_code) self.assertTemplateUsed(response, 'registration/login.html') # unauthorized user self.assert_(c.login(username=user.username, password='secret')) response = c.get(url % args) self.assertEqual(403, response.status_code) # invalid cluster response = c.get(url % "DoesNotExist") self.assertEqual(404, response.status_code) # authorized (create_vm) grant(user, 'create_vm', cluster) response = c.get(url % args) self.assertEqual(200, response.status_code) self.assertEqual('application/json', response['content-type']) content = json.loads(response.content) self.assertEqual(['gtest1.osuosl.bak', 'gtest2.osuosl.bak'], content['nodes']) self.assertEqual(['image+debian-osgeo', 'image+ubuntu-lucid'], content['os']) user.revoke_all(cluster) # authorized (cluster admin) grant(user, 'admin', cluster) response = c.get(url % args) self.assertEqual(200, response.status_code) self.assertEqual('application/json', response['content-type']) content = json.loads(response.content) self.assertEqual(['gtest1.osuosl.bak', 'gtest2.osuosl.bak'], content['nodes']) self.assertEqual(['image+debian-osgeo', 'image+ubuntu-lucid'], content['os']) user.revoke_all(cluster) # authorized (superuser) user.is_superuser = True user.save() response = c.get(url % args) self.assertEqual(200, response.status_code) self.assertEqual('application/json', response['content-type']) content = json.loads(response.content) self.assertEqual(['gtest1.osuosl.bak', 'gtest2.osuosl.bak'], content['nodes']) self.assertEqual(['image+debian-osgeo', 'image+ubuntu-lucid'], content['os']) | 1fa6802707494a8b5d7f215d89ccaa6f674fb007 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10509/1fa6802707494a8b5d7f215d89ccaa6f674fb007/virtual_machine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1945,
67,
7967,
67,
2116,
12,
2890,
4672,
3536,
7766,
17146,
666,
434,
702,
279,
2855,
711,
364,
23731,
3536,
880,
273,
1173,
3489,
19,
1289,
19,
2116,
5258,
87,
2473,
833,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1945,
67,
7967,
67,
2116,
12,
2890,
4672,
3536,
7766,
17146,
666,
434,
702,
279,
2855,
711,
364,
23731,
3536,
880,
273,
1173,
3489,
19,
1289,
19,
2116,
5258,
87,
2473,
833,
2... |
subsubcm=ContentMetadata(subsubelem, cm) | subsubcm=ContentMetadata(subsubelem, subcm) | def _buildMetadata(self): ''' set up capabilities metadata objects ''' #serviceIdentification metadata serviceelem=self._capabilities.find('Service') self.identification=ServiceIdentification(serviceelem, self.version) #serviceProvider metadata self.provider=ServiceProvider(serviceelem) #serviceOperations metadata self.operations=[] for elem in self._capabilities.find('Capability/Request')[:]: self.operations.append(OperationMetadata(elem)) #serviceContents metadata: our assumption is that services use a top-level #layer as a metadata organizer, nothing more. self.contents={} caps = self._capabilities.find('Capability') for elem in caps.findall('Layer'): cm=ContentMetadata(elem) self.contents[cm.id]=cm for subelem in elem.findall('Layer'): subcm=ContentMetadata(subelem, cm) self.contents[subcm.id]=subcm #added another layer of nesting - should really be recursive though... for subsubelem in subelem.findall('Layer'): subsubcm=ContentMetadata(subsubelem, cm) self.contents[subsubcm.id]=subsubcm #exceptions self.exceptions = [f.text for f \ in self._capabilities.findall('Capability/Exception/Format')] | a13ca54b031aae98a87d17421c0fdf38aa3e59c0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11708/a13ca54b031aae98a87d17421c0fdf38aa3e59c0/wms.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3510,
2277,
12,
2890,
4672,
9163,
444,
731,
12359,
1982,
2184,
9163,
225,
468,
3278,
24371,
1982,
1156,
10037,
33,
2890,
6315,
22140,
18,
4720,
2668,
1179,
6134,
365,
18,
6392,
1480,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3510,
2277,
12,
2890,
4672,
9163,
444,
731,
12359,
1982,
2184,
9163,
225,
468,
3278,
24371,
1982,
1156,
10037,
33,
2890,
6315,
22140,
18,
4720,
2668,
1179,
6134,
365,
18,
6392,
1480,
... |
], | ] | def __init__(self): sql_up = [ | 1788f8f226d095d17c13658bb193fd9fadb1b46b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9909/1788f8f226d095d17c13658bb193fd9fadb1b46b/050_flatpage_about_page.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
1847,
67,
416,
273,
306,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
1847,
67,
416,
273,
306,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.view.connect_object('destroy', gtk.Menu.destroy, self.menu) self.view.connect_object('destroy', PlayList._destroy, self) | self.connect_object('destroy', gtk.Menu.destroy, self.menu) | def __init__(self, view, name): self.name = 'playlist_' + PlayList.normalize_name(name) self.key = '~#' + self.name model = self.model = gtk.ListStore(object) super(PlayList, self).__init__(view, 400) | 68083c738a5c22a2d7652675c6efe895a6f082e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4764/68083c738a5c22a2d7652675c6efe895a6f082e4/widgets.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1476,
16,
508,
4672,
365,
18,
529,
273,
296,
1601,
1098,
4623,
397,
19592,
682,
18,
12237,
67,
529,
12,
529,
13,
365,
18,
856,
273,
10091,
10038,
397,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1476,
16,
508,
4672,
365,
18,
529,
273,
296,
1601,
1098,
4623,
397,
19592,
682,
18,
12237,
67,
529,
12,
529,
13,
365,
18,
856,
273,
10091,
10038,
397,
... |
x = len(getattr(pkt, self.fld))-self.shift | f = pkt.fields_desc[pkt.fields_desc.index(self.fld)] v = f.i2m(pkt,getattr(pkt, self.fld)) x = len(v)-self.shift | def i2m(self, pkt, x): if x is None: x = len(getattr(pkt, self.fld))-self.shift return x | d8526442cb16fd0c5b073bf8f49565fe55719464 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7311/d8526442cb16fd0c5b073bf8f49565fe55719464/scapy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
277,
22,
81,
12,
2890,
16,
11536,
16,
619,
4672,
309,
619,
353,
599,
30,
284,
273,
11536,
18,
2821,
67,
5569,
63,
5465,
88,
18,
2821,
67,
5569,
18,
1615,
12,
2890,
18,
19794,
25887,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
277,
22,
81,
12,
2890,
16,
11536,
16,
619,
4672,
309,
619,
353,
599,
30,
284,
273,
11536,
18,
2821,
67,
5569,
63,
5465,
88,
18,
2821,
67,
5569,
18,
1615,
12,
2890,
18,
19794,
25887,
... |
connector.connect() | if isinstance(reason.value, CertificateError): self.delayed = reactor.callLater(Config.certificate_reconnect_delay, connector.connect) else: connector.connect() | def clientConnectionLost(self, connector, reason): log.error('Connection lost to dispatcher "%s:%d": %s' % (self.host[0], self.host[1], reason.getErrorMessage())) if self.parent.connector_needs_reconnect(connector): connector.connect() | 9b878174bee09214f07de5c5a0d4b085897c1b83 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3445/9b878174bee09214f07de5c5a0d4b085897c1b83/relay.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1004,
1952,
19024,
12,
2890,
16,
8703,
16,
3971,
4672,
613,
18,
1636,
2668,
1952,
13557,
358,
7393,
2213,
87,
5319,
72,
6877,
738,
87,
11,
738,
261,
2890,
18,
2564,
63,
20,
6487,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1004,
1952,
19024,
12,
2890,
16,
8703,
16,
3971,
4672,
613,
18,
1636,
2668,
1952,
13557,
358,
7393,
2213,
87,
5319,
72,
6877,
738,
87,
11,
738,
261,
2890,
18,
2564,
63,
20,
6487,
365,
... |
self.logger.debug("Common.detectNewPackages : detecting new packages...") | self.logger.debug1("Common.detectNewPackages : detecting new packages...") | def detectNewPackages(self): if self.working: self.logger.debug("Common.detectNewPackages : already working") return False try: self.working = True self.working_pkgs = {} self.logger.debug("Common.detectNewPackages : detecting new packages...") self._detectPackages(True) self.logger.debug("Common.detectNewPackages : detecting removed or edited packages...") self._detectRemovedAndEditedPackages() self.logger.debug("Common.detectNewPackages : build reverse list...") self._buildReverse() self.logger.debug("Common.detectNewPackages : build file list...") self._buildFileList() self.logger.debug("Common.detectNewPackages : done") self.working = False return True except Exception, e: self.working = False self.logger.error("Common.detectNewPackages : an exception happened") self.logger.info(e) return False | 59696bab1d14fc51c0f2e2646895d01b0ac2056a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5988/59696bab1d14fc51c0f2e2646895d01b0ac2056a/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5966,
1908,
11425,
12,
2890,
4672,
309,
365,
18,
20478,
30,
365,
18,
4901,
18,
4148,
2932,
6517,
18,
16518,
1908,
11425,
294,
1818,
5960,
7923,
327,
1083,
775,
30,
365,
18,
20478,
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,
5966,
1908,
11425,
12,
2890,
4672,
309,
365,
18,
20478,
30,
365,
18,
4901,
18,
4148,
2932,
6517,
18,
16518,
1908,
11425,
294,
1818,
5960,
7923,
327,
1083,
775,
30,
365,
18,
20478,
273,
... |
t.AddRow([Bold('Subject:'), subject]) | t.AddCellInfo(row+2, col-1, align='right') | def PrintPostRequest(mlist, id, info, total, count, form): # For backwards compatibility with pre 2.0beta3 if len(info) == 5: ptime, sender, subject, reason, filename = info else: ptime, sender, subject, reason, filename, msgdata = info form.AddItem('<hr>') msg = 'Posting Held for Approval' if total <> 1: msg = msg + ' (%d of %d)' % (count, total) form.AddItem(Center(Header(2, msg))) try: fp = open(os.path.join(mm_cfg.DATA_DIR, filename)) text = fp.read(mm_cfg.ADMINDB_PAGE_TEXT_LIMIT) fp.close() except IOError, (code, msg): if code == ENOENT: form.AddItem('<em>Message with id #%d was lost.' % id) form.AddItem('<p>') # TBD: kludge to remove id from requests.db. value==2 means # discard the message. try: mlist.HandleRequest(id, 2, None) except Errors.LostHeldMessage: pass return raise t = Table(cellspacing=0, cellpadding=0) t.AddRow([Bold('From:'), sender]) t.AddRow([Bold('Reason:'), reason]) t.AddRow([Bold('Subject:'), subject]) t.AddRow([ Bold('Action:'), RadioButtonArray(id, ("Approve", "Reject", "Discard (eg, spam)")) ]) t.AddRow([ Bold('If you reject this post, explain (optional):'), TextArea('comment-%d' % id, rows=4, cols=60, text=("Please do *not* post administrative requests" " to the mailing list! If you wish to subscribe," " visit %s or send a 'help' message to the" " the request address, %s , for instructions" % (mlist.GetAbsoluteScriptURL('listinfo'), mlist.GetRequestEmail()))) ]) row, col = t.GetCurrentRowIndex(), t.GetCurrentCellIndex() t.AddCellInfo(row, col, colspan=3) t.AddRow([Bold('Message Excerpt:'), TextArea('fulltext-%d' % id, text, rows=10, cols=60)]) row, col = t.GetCurrentRowIndex(), t.GetCurrentCellIndex() t.AddCellInfo(row, col, colspan=3) form.AddItem(t) form.AddItem('<p>') | 0e0816f35de4f619d87b3444d07ec6d696c1b681 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/0e0816f35de4f619d87b3444d07ec6d696c1b681/admindb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3038,
3349,
691,
12,
781,
376,
16,
612,
16,
1123,
16,
2078,
16,
1056,
16,
646,
4672,
468,
2457,
12727,
8926,
598,
675,
576,
18,
20,
5758,
23,
309,
562,
12,
1376,
13,
422,
1381,
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,
3038,
3349,
691,
12,
781,
376,
16,
612,
16,
1123,
16,
2078,
16,
1056,
16,
646,
4672,
468,
2457,
12727,
8926,
598,
675,
576,
18,
20,
5758,
23,
309,
562,
12,
1376,
13,
422,
1381,
30,
... |
dc.SetBrush(styles.selectionBrush) dc.SetPen(wx.Pen(styles.blockItem.getEventOutlineColor(selectedBox.GetItem()))) | eventColors = styles.blockItem.getEventColors(selectedBox.GetItem()) dc.SetPen(wx.Pen(eventColors.selectedOutlineColor)) brush = styles.GetGradientBrush(eventColors.selectedGradientLeft, eventColors.selectedGradientRight) dc.SetBrush(brush) dc.SetTextForeground(eventColors.selectedTextColor) | def PrintStackEntry(entry): print " " + entry[2] + " @ " + entry[0][30:] + ":" + str(entry[1]) | 25ddad0361cdcff8c6c9b1849cc3d6061261e934 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/25ddad0361cdcff8c6c9b1849cc3d6061261e934/CalendarCanvas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3038,
2624,
1622,
12,
4099,
4672,
1172,
315,
565,
315,
397,
1241,
63,
22,
65,
397,
315,
632,
315,
397,
1241,
63,
20,
6362,
5082,
26894,
397,
6153,
397,
609,
12,
4099,
63,
21,
5717,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3038,
2624,
1622,
12,
4099,
4672,
1172,
315,
565,
315,
397,
1241,
63,
22,
65,
397,
315,
632,
315,
397,
1241,
63,
20,
6362,
5082,
26894,
397,
6153,
397,
609,
12,
4099,
63,
21,
5717,
2... |
str += ' <dd><code>'+`func`+'</code>' | str += ' <dd><code>%s</code>' % func | def _func_details(self, functions, cls, heading='Function Details'): """ @return: The HTML code for a function details table. This is used by L{_module_to_html} to describe the functions in a module; and by L{_class_to_html} to describe member functions. @rtype: C{string} """ functions = self._sort(functions) if len(functions) == 0: return '' str = self._table_header(heading, 'details')+'</table>\n' | 36aef14a0edb4bd18076686105d0e4e6c7c10c23 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/36aef14a0edb4bd18076686105d0e4e6c7c10c23/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
644,
67,
6395,
12,
2890,
16,
4186,
16,
2028,
16,
11053,
2218,
2083,
21897,
11,
4672,
3536,
632,
2463,
30,
1021,
3982,
981,
364,
279,
445,
3189,
1014,
18,
225,
1220,
353,
1399,
635... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
644,
67,
6395,
12,
2890,
16,
4186,
16,
2028,
16,
11053,
2218,
2083,
21897,
11,
4672,
3536,
632,
2463,
30,
1021,
3982,
981,
364,
279,
445,
3189,
1014,
18,
225,
1220,
353,
1399,
635... |
matchstart = match.start(self.groups.initial.start) matchend = match.end(self.groups.initial.start) | matchstart = match.start('start') matchend = match.end('start') | def inline_obj(self, match, lineno, pattern, nodeclass, restore_backslashes=0): string = match.string matchstart = match.start(self.groups.initial.start) matchend = match.end(self.groups.initial.start) if self.quoted_start(match): return (string[:matchend], [], string[matchend:], [], '') endmatch = pattern.search(string[matchend:]) if endmatch and endmatch.start(1): # 1 or more chars text = unescape(endmatch.string[:endmatch.start(1)], restore_backslashes) rawsource = unescape(string[matchstart:matchend+endmatch.end(1)], 1) return (string[:matchstart], [nodeclass(rawsource, text)], string[matchend:][endmatch.end(1):], [], endmatch.group(1)) msg = self.reporter.warning( 'Inline %s start-string without end-string ' 'at line %s.' % (nodeclass.__name__, lineno)) text = unescape(string[matchstart:matchend], 1) rawsource = unescape(string[matchstart:matchend], 1) prb = self.problematic(text, rawsource, msg) return string[:matchstart], [prb], string[matchend:], [msg], '' | 039645ec5706bfe06b64e66663e62db9bc1abf30 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/039645ec5706bfe06b64e66663e62db9bc1abf30/states.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6370,
67,
2603,
12,
2890,
16,
845,
16,
7586,
16,
1936,
16,
756,
1106,
16,
5217,
67,
823,
13675,
33,
20,
4672,
533,
273,
845,
18,
1080,
845,
1937,
273,
845,
18,
1937,
2668,
1937,
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,
6370,
67,
2603,
12,
2890,
16,
845,
16,
7586,
16,
1936,
16,
756,
1106,
16,
5217,
67,
823,
13675,
33,
20,
4672,
533,
273,
845,
18,
1080,
845,
1937,
273,
845,
18,
1937,
2668,
1937,
6134... |
"""Try to apply the pattern at the start of the string, returning a MatchObject instance, or None if no match was found.""" | """match(string[, pos][, endpos]) -> MatchObject or None If zero or more characters at the beginning of string match this regular expression, return a corresponding MatchObject instance. Return None if the string does not match the pattern; note that this is different from a zero-length match. Note: If you want to locate a match anywhere in string, use search() instead. The optional second parameter pos gives an index in the string where the search is to start; it defaults to 0. This is not completely equivalent to slicing the string; the '' pattern character matches at the real beginning of the string and at positions just after a newline, but not necessarily at the index where the search is to start. The optional parameter endpos limits how far the string will be searched; it will be as if the string is endpos characters long, so only the characters from pos to endpos will be searched for a match. """ | def match(self, string, pos=0, endpos=None): """Try to apply the pattern at the start of the string, returning a MatchObject instance, or None if no match was found.""" | a8455127e04ef3208b74f39e35bd42c1bd2b50c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/a8455127e04ef3208b74f39e35bd42c1bd2b50c3/re.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
845,
12,
2890,
16,
533,
16,
949,
33,
20,
16,
679,
917,
33,
7036,
4672,
3536,
7833,
358,
2230,
326,
1936,
622,
326,
787,
434,
326,
533,
16,
5785,
279,
4639,
921,
791,
16,
578,
599,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
845,
12,
2890,
16,
533,
16,
949,
33,
20,
16,
679,
917,
33,
7036,
4672,
3536,
7833,
358,
2230,
326,
1936,
622,
326,
787,
434,
326,
533,
16,
5785,
279,
4639,
921,
791,
16,
578,
599,
... |
use_list = [ 'my_%s => %s' % (x.name,x.name) for x in subts+functs] | use_list = [ 'quippy_%s => %s' % (x.name,x.name) for x in subts+functs] | def no_c_ptr(sub): for arg in sub.arguments: if arg.type.lower() == 'type(c_ptr)': return False | eee528902aec7e9c3a06b70646ae7dfb085e9987 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8914/eee528902aec7e9c3a06b70646ae7dfb085e9987/f2py_wrapper_gen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1158,
67,
71,
67,
6723,
12,
1717,
4672,
364,
1501,
316,
720,
18,
7099,
30,
309,
1501,
18,
723,
18,
8167,
1435,
422,
296,
723,
12,
71,
67,
6723,
2506,
30,
327,
1083,
2,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1158,
67,
71,
67,
6723,
12,
1717,
4672,
364,
1501,
316,
720,
18,
7099,
30,
309,
1501,
18,
723,
18,
8167,
1435,
422,
296,
723,
12,
71,
67,
6723,
2506,
30,
327,
1083,
2,
-100,
-100,
... |
pretend = False): self.__root = wrapper.get_root() | pretend = False, root = ''): self.__root = root | def __init__(self, installdir, package = '', version = '', permission = PermissionMap('0600'), dbfile = '.webapp', verbose = False, pretend = False): | 7d2327b42aaad683c874f91228bb1b5116af62e3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10458/7d2327b42aaad683c874f91228bb1b5116af62e3/content.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3799,
1214,
16,
2181,
565,
273,
10226,
1177,
565,
273,
10226,
4132,
273,
8509,
863,
2668,
7677,
713,
19899,
1319,
768,
377,
273,
2418,
4875,
2910,
2187,
39... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3799,
1214,
16,
2181,
565,
273,
10226,
1177,
565,
273,
10226,
4132,
273,
8509,
863,
2668,
7677,
713,
19899,
1319,
768,
377,
273,
2418,
4875,
2910,
2187,
39... |
tolF = 0.05 | tolF = 0.10 | def compare_metrics ( g1_ij, g2_ij ): """Compare two metrics and return a measure of aggreement, namely the 3-tuple ( maxrel, rel2norm, reldet ), where - maxrel: is the largest relative difference in any component - rel2norm: is the 2-norm of the difference-matrix divided by the 2-norm of the second matrix - reldet: is the relative difference in determinants """ dg_ij = g1_ij - g2_ij maxrel = abs ( dg_ij / g2_ij ).max() rel2norm = sqrt ( norm( dg_ij, 2 ) / norm ( g2_ij, 2 ) ); detg1 = det(g1_ij) detg2 = det(g2_ij) if debug: print ("det(g1) = %g, det(g2) = %g" % ( detg1, detg2 ) ) print ("cond(g1)= %g, cond(g2) = %g" % ( cond(g1_ij), cond(g2_ij) ) ) reldet = abs(detg1 - detg2) / abs ( detg2 ) return ( maxrel, rel2norm, reldet ) | 8a46dc3e786dff85fd7f83c91f250b6905586db2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/8a46dc3e786dff85fd7f83c91f250b6905586db2/testMetricCodes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3400,
67,
9597,
261,
314,
21,
67,
8302,
16,
314,
22,
67,
8302,
262,
30,
3536,
8583,
2795,
4309,
471,
327,
279,
6649,
434,
10421,
10606,
16,
15135,
2357,
326,
890,
17,
8052,
261,
943,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3400,
67,
9597,
261,
314,
21,
67,
8302,
16,
314,
22,
67,
8302,
262,
30,
3536,
8583,
2795,
4309,
471,
327,
279,
6649,
434,
10421,
10606,
16,
15135,
2357,
326,
890,
17,
8052,
261,
943,
... |
return self.request.response.redirect(aq_parent(aq_inner(self.context)).absolute_url()) | return self.request.response.redirect(aq_parent(aq_inner(context)).absolute_url()) | def __call__(self): | f088cb946e301737ef8c848c7891dfbdfe4abf56 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12197/f088cb946e301737ef8c848c7891dfbdfe4abf56/comments.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
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,... | [
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,
1001,
1991,
972,
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,
-1... |
self._lastRun = int(time.time()) | self._lastRun = startTime | def work(self, ldapConnection): """ Find matching LDAP entries and fire off the helper """ logger = logging.getLogger(splat.LOG_NAME) failure = False | 605ca1fbe33f4c9f2e79ea1e6ce1bd917ea2f241 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3476/605ca1fbe33f4c9f2e79ea1e6ce1bd917ea2f241/plugin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1440,
12,
2890,
16,
8079,
1952,
4672,
3536,
4163,
3607,
11916,
3222,
471,
4452,
3397,
326,
4222,
3536,
1194,
273,
2907,
18,
588,
3328,
12,
13106,
270,
18,
4842,
67,
1985,
13,
5166,
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,
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,
1440,
12,
2890,
16,
8079,
1952,
4672,
3536,
4163,
3607,
11916,
3222,
471,
4452,
3397,
326,
4222,
3536,
1194,
273,
2907,
18,
588,
3328,
12,
13106,
270,
18,
4842,
67,
1985,
13,
5166,
273,
... |
item = wxWindow.GetItemFromUri(uri) if item != None: wxWindow.SetItemBold(item, isBold) return true return false class URLTreeEntry: | return wxWindow.SetUriBold(uri) class URLTreeEntry(Persistent): | def SetUriBold(self, uri, isBold=true): """ Sets whether or not the item representing the uri should be bold. Will also expand any ancestors of the item representing the supplied uri. Returns true if the bold state of the item was successfully set, false otherwise. """ wxWindow = app.association[id(self)] item = wxWindow.GetItemFromUri(uri) if item != None: wxWindow.SetItemBold(item, isBold) return true return false | 8ba1416afb227f716ae1f5a7e816a907c946e55f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/8ba1416afb227f716ae1f5a7e816a907c946e55f/SideBar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1000,
3006,
38,
1673,
12,
2890,
16,
2003,
16,
27057,
1673,
33,
3767,
4672,
3536,
11511,
2856,
578,
486,
326,
761,
5123,
326,
2003,
1410,
506,
13068,
18,
9980,
2546,
4542,
1281,
14322,
43... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1000,
3006,
38,
1673,
12,
2890,
16,
2003,
16,
27057,
1673,
33,
3767,
4672,
3536,
11511,
2856,
578,
486,
326,
761,
5123,
326,
2003,
1410,
506,
13068,
18,
9980,
2546,
4542,
1281,
14322,
43... |
self.tk.call(self._w, 'disable', name) | self.tk.call(self._w, 'disable', name) | def disable(self, name): | 86af7ef7e3f4448abc89aa941517a84075d99a38 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/86af7ef7e3f4448abc89aa941517a84075d99a38/Tix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4056,
12,
2890,
16,
508,
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,
... | [
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,
4056,
12,
2890,
16,
508,
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... |
if not xmax: | if xmax is None: | def __init__(self, v, xmin=None, xmax=None, ymin=None, ymax=None, **kwds): w = [] for x in v: if not isinstance(x, plot.Graphics): x = plot.plot(x, xmin=xmin, xmax=xmax) w.append(x) if len(w) == 0: w = [plot.Graphics()] self.__frames = w G = w[0] if not xmin: xmin = G.xmin() if not xmax: xmax = G.xmax() if not ymin: ymin = G.ymin() if not ymax: ymax = G.ymax() self.__xmin = xmin self.__xmax = xmax self.__ymin = ymin self.__ymax = ymax self.__kwds = kwds | 5139f1c6248e9d769ebe1a883a8fd1e5d0743ea4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/5139f1c6248e9d769ebe1a883a8fd1e5d0743ea4/animate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
331,
16,
13777,
33,
7036,
16,
14016,
33,
7036,
16,
15763,
33,
7036,
16,
15275,
33,
7036,
16,
2826,
25577,
4672,
341,
273,
5378,
364,
619,
316,
331,
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,
1001,
2738,
972,
12,
2890,
16,
331,
16,
13777,
33,
7036,
16,
14016,
33,
7036,
16,
15763,
33,
7036,
16,
15275,
33,
7036,
16,
2826,
25577,
4672,
341,
273,
5378,
364,
619,
316,
331,
30,
... |
def fn(): | def fn(n): | def fn(): s = const('hello') z = const('h') return s[:-1]+z[:-1] | b1e08c65fc6c170b763c5a162ad9f26731f932bd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6934/b1e08c65fc6c170b763c5a162ad9f26731f932bd/test_rstr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2295,
12,
82,
4672,
272,
273,
1866,
2668,
23711,
6134,
998,
273,
1866,
2668,
76,
6134,
327,
272,
10531,
17,
21,
3737,
94,
10531,
17,
21,
65,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
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,
2295,
12,
82,
4672,
272,
273,
1866,
2668,
23711,
6134,
998,
273,
1866,
2668,
76,
6134,
327,
272,
10531,
17,
21,
3737,
94,
10531,
17,
21,
65,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
for src_name in src_names: | for src_name in sorted(src_names): | def do_update(self, subcmd, opts, startdir): """${cmd_name}: Update the hash pieces that are included in metalinks | 82d3af8dbb76b9e6af5d6a4b59b7b58ed8e5937b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3890/82d3af8dbb76b9e6af5d6a4b59b7b58ed8e5937b/metalink-hasher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
2725,
12,
2890,
16,
720,
4172,
16,
1500,
16,
787,
1214,
4672,
3536,
18498,
4172,
67,
529,
6713,
2315,
326,
1651,
10167,
716,
854,
5849,
316,
5100,
16194,
87,
2,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
2725,
12,
2890,
16,
720,
4172,
16,
1500,
16,
787,
1214,
4672,
3536,
18498,
4172,
67,
529,
6713,
2315,
326,
1651,
10167,
716,
854,
5849,
316,
5100,
16194,
87,
2,
-100,
-100,
-1... |
if not host: return addinfo(open(file, 'r'), noheaders()) | if not host: return addinfo(open(_fixpath(file), 'r'), noheaders()) | def open_local_file(self, url): host, file = splithost(url) if not host: return addinfo(open(file, 'r'), noheaders()) host, port = splitport(host) if not port and socket.gethostbyname(host) in ( localhost(), thishost()): file = unquote(file) return addinfo(open(file, 'r'), noheaders()) raise IOError, ('local file error', 'not on local host') | 1f5866ca1ac0258d5d39ac20bedd35891c9959d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/1f5866ca1ac0258d5d39ac20bedd35891c9959d0/urllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
3729,
67,
768,
12,
2890,
16,
880,
4672,
1479,
16,
585,
273,
6121,
483,
669,
12,
718,
13,
309,
486,
1479,
30,
327,
527,
1376,
12,
3190,
24899,
904,
803,
12,
768,
3631,
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,
1696,
67,
3729,
67,
768,
12,
2890,
16,
880,
4672,
1479,
16,
585,
273,
6121,
483,
669,
12,
718,
13,
309,
486,
1479,
30,
327,
527,
1376,
12,
3190,
24899,
904,
803,
12,
768,
3631,
296,
... |
dest = os.path.join(self.basedir, hp).encode(sys.getfilesystemencoding() or 'utf-8') | dest = os.path.join(self.tmpdir, filename).encode(sys.getfilesystemencoding() or 'utf-8') | def getPath(self, name, width=None): if not name: return None name = name[:1].upper()+name[1:] hp = hashpath(name) | 2e2e0c65e72dd4ba00812393df172f789e8b919b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12391/2e2e0c65e72dd4ba00812393df172f789e8b919b/netdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4339,
12,
2890,
16,
508,
16,
1835,
33,
7036,
4672,
309,
486,
508,
30,
327,
599,
508,
273,
508,
10531,
21,
8009,
5797,
1435,
15,
529,
63,
21,
26894,
225,
16460,
273,
1651,
803,
12,
52... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4339,
12,
2890,
16,
508,
16,
1835,
33,
7036,
4672,
309,
486,
508,
30,
327,
599,
508,
273,
508,
10531,
21,
8009,
5797,
1435,
15,
529,
63,
21,
26894,
225,
16460,
273,
1651,
803,
12,
52... |
if ';' in value: value = value.split(';', 1)[0] | def parse(self, *args, **kwargs): """ return the time value (in seconds since 1970) """ value = self.__call__(*args, **kwargs) if ';' in value: value = value.split(';', 1)[0] if value: try: return mktime_tz(parsedate_tz(value)) except TypeError: raise HTTPBadRequest(( "Received an ill-formed timestamp for %s: %s\r\n") % (self.name, value)) else: return None | bdd29963acb62b3770e0fd7cf85109843afc77fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/bdd29963acb62b3770e0fd7cf85109843afc77fd/httpheaders.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
380,
1968,
16,
2826,
4333,
4672,
3536,
327,
326,
813,
460,
261,
267,
3974,
3241,
5342,
7301,
13,
3536,
460,
273,
365,
16186,
1991,
972,
30857,
1968,
16,
2826,
4333,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
380,
1968,
16,
2826,
4333,
4672,
3536,
327,
326,
813,
460,
261,
267,
3974,
3241,
5342,
7301,
13,
3536,
460,
273,
365,
16186,
1991,
972,
30857,
1968,
16,
2826,
4333,
... | |
assert ref.scheme == 'http' assert ref.authority == 'example.com' assert ref.path == '/a/b/c' assert ref.query == 'query' assert ref.fragment == 'fragment' | self.assertEqual(ref.scheme, 'http') self.assertEqual(ref.authority, 'example.com') self.assertEqual(ref.path, '/a/b/c') self.assertEqual(ref.query, 'query') self.assertEqual(ref.fragment, 'fragment') | def test_full(self): ref = 'http://example.com/a/b/c?query#fragment' ref = uri.Reference(ref) assert ref.scheme == 'http' assert ref.authority == 'example.com' assert ref.path == '/a/b/c' assert ref.query == 'query' assert ref.fragment == 'fragment' | 10e3494b023699fdcb2cbe973f15ae8a062173c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/10e3494b023699fdcb2cbe973f15ae8a062173c1/test_uri.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2854,
12,
2890,
4672,
1278,
273,
296,
2505,
2207,
8236,
18,
832,
19,
69,
19,
70,
19,
71,
35,
2271,
7,
11956,
11,
1278,
273,
2003,
18,
2404,
12,
1734,
13,
1815,
1278,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2854,
12,
2890,
4672,
1278,
273,
296,
2505,
2207,
8236,
18,
832,
19,
69,
19,
70,
19,
71,
35,
2271,
7,
11956,
11,
1278,
273,
2003,
18,
2404,
12,
1734,
13,
1815,
1278,
18,
... |
if verbose: print 'unpack sequence too short, wrong error' try: a, b, c = BadSeq() raise TestFailed except BozoError: pass | Unpacking a sequence where the test for too long raises a different kind of error >>> class BozoError(Exception): ... pass ... >>> class BadSeq: ... def __getitem__(self, i): ... if i >= 0 and i < 3: ... return i ... elif i == 3: ... raise BozoError ... else: ... raise IndexError ... Trigger code while not expecting an IndexError (unpack sequence too long, wrong error) >>> a, b, c, d, e = BadSeq() Traceback (most recent call last): ... BozoError Trigger code while expecting an IndexError (unpack sequence too short, wrong error) >>> a, b, c = BadSeq() Traceback (most recent call last): ... BozoError """ __test__ = {'doctests' : doctests} def test_main(verbose=False): import sys from test import test_support from test import test_unpack test_support.run_doctest(test_unpack, verbose) if __name__ == "__main__": test_main(verbose=True) | def __getitem__(self, i): if i >= 0 and i < 3: return i elif i == 3: raise BozoError else: raise IndexError | 989a9d01aa1cbad29606c3b177b5c247a75fefc0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/989a9d01aa1cbad29606c3b177b5c247a75fefc0/test_unpack.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
277,
4672,
309,
277,
1545,
374,
471,
277,
411,
890,
30,
327,
277,
1327,
277,
422,
890,
30,
1002,
605,
11142,
83,
668,
469,
30,
1002,
10195,
2,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
277,
4672,
309,
277,
1545,
374,
471,
277,
411,
890,
30,
327,
277,
1327,
277,
422,
890,
30,
1002,
605,
11142,
83,
668,
469,
30,
1002,
10195,
2,
-100,
-... |
Maxima 5.16.2 http://maxima.sourceforge.net | Maxima 5.16.3 http://maxima.sourceforge.net | def maxima_console(): """ Spawn a new Maxima command-line session. EXAMPLES: sage: from sage.interfaces.maxima import maxima_console sage: maxima_console() # not tested Maxima 5.16.2 http://maxima.sourceforge.net ... """ os.system('maxima') | 96739341641dd031ea13b5d1959ba42d488b04f5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/96739341641dd031ea13b5d1959ba42d488b04f5/maxima.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
943,
13888,
67,
8698,
13332,
3536,
5878,
9533,
279,
394,
4238,
13888,
1296,
17,
1369,
1339,
18,
225,
5675,
8900,
11386,
30,
272,
410,
30,
628,
272,
410,
18,
15898,
18,
1896,
13888,
1930,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
943,
13888,
67,
8698,
13332,
3536,
5878,
9533,
279,
394,
4238,
13888,
1296,
17,
1369,
1339,
18,
225,
5675,
8900,
11386,
30,
272,
410,
30,
628,
272,
410,
18,
15898,
18,
1896,
13888,
1930,... |
.. [CB07] Nicolas T\. Courtois, Gregory V\. Bard *Algebraic Cryptanalysis of the Data Encryption Standard*; Cryptography and Coding -- 11th IMA International Conference; 2007; available at http://eprint.iacr.org/2006/402 | .. [CBJ07] Gregory V\. Bard, and Nicolas T\. Courtois, and Chris Jefferson. *Efficient Methods for Conversion and Solution of Sparse Systems of Low-Degree Multivariate Polynomials over GF(2) via SAT-Solvers*. Cryptology ePrint Archive: Report 2007/024. available at http://eprint.iacr.org/2007/024 | def eliminate_linear_variables(self, maxlength=3, skip=lambda lm,tail: False): """ Return a new system where "linear variables" are eliminated. | 71ea588c33eb90a29e0856669b0e8d3a3b9b2e8c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/71ea588c33eb90a29e0856669b0e8d3a3b9b2e8c/mpolynomialsystem.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29529,
67,
12379,
67,
7528,
12,
2890,
16,
943,
2469,
33,
23,
16,
2488,
33,
14661,
14966,
16,
13101,
30,
1083,
4672,
3536,
2000,
279,
394,
2619,
1625,
315,
12379,
3152,
6,
854,
19229,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
29529,
67,
12379,
67,
7528,
12,
2890,
16,
943,
2469,
33,
23,
16,
2488,
33,
14661,
14966,
16,
13101,
30,
1083,
4672,
3536,
2000,
279,
394,
2619,
1625,
315,
12379,
3152,
6,
854,
19229,
7... |
if is_hyper_threaded(): threads = threads / get_hyper_thread_count() | def trigger_ebizzy (stress, duration, background, pinned): ''' Triggers ebizzy workload for sched_mc=1 testing ''' try: if stress == "thread": threads = get_hyper_thread_count() if stress == "partial": threads = cpu_count / socket_count if is_hyper_threaded(): threads = threads / get_hyper_thread_count() if stress == "full": threads = cpu_count if stress == "single_job": threads = 1 duration = 180 olddir = os.getcwd() path = '%s/utils/benchmark' % os.environ['LTPROOT'] os.chdir(path) wklds_avlbl = list() workload = "ebizzy" workload_dir = "" # Use the latest version of similar workload available for file_name in os.listdir('.'): if file_name.find(workload) != -1: wklds_avlbl.append(file_name) wklds_avlbl.sort() workload_dir = wklds_avlbl[len(wklds_avlbl)-1] if workload_dir != "": new_path = os.path.join(path,"%s" % workload_dir) get_proc_data(stats_start) try: os.chdir(new_path) if background == "yes": succ = os.system('./ebizzy -t%s -s4096 -S %s >/dev/null &' % (threads, duration)) else: if pinned == "yes": succ = os.system('taskset -c %s ./ebizzy -t%s -s4096 -S %s >/dev/null' % (cpu_count -1, threads, duration)) else: succ = os.system('./ebizzy -t%s -s4096 -S %s >/dev/null' % (threads, duration)) if succ == 0: print "INFO: ebizzy workload triggerd" os.chdir(olddir) get_proc_data(stats_stop) else: print "INFO: ebizzy workload triggerd failed" os.chdir(olddir) get_proc_data(stats_stop) sys.exit(1) except Exception, details: print "Ebizzy workload trigger failed ", details sys.exit(1) except Exception, details: print "Ebizzy workload trigger failed ", details sys.exit(1) | bde0088285dcc63685bddce865f205b2c4a8bbe0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11457/bde0088285dcc63685bddce865f205b2c4a8bbe0/sched_mc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3080,
67,
24008,
452,
21832,
261,
334,
663,
16,
3734,
16,
5412,
16,
26193,
4672,
9163,
840,
8060,
20371,
452,
21832,
1440,
945,
364,
23964,
67,
13952,
33,
21,
7769,
9163,
775,
30,
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,
3080,
67,
24008,
452,
21832,
261,
334,
663,
16,
3734,
16,
5412,
16,
26193,
4672,
9163,
840,
8060,
20371,
452,
21832,
1440,
945,
364,
23964,
67,
13952,
33,
21,
7769,
9163,
775,
30,
309,
... | |
a : array_like of string_ or unicode_ | a : array_like of str or unicode | def str_len(a): """ Return len(a) element-wise. Parameters ---------- a : array_like of string_ or unicode_ Returns ------- out : ndarray Output array of integers See also -------- __builtin__.len """ return _vec_string(a, integer, '__len__') | 05324d0e986a1012a342e2650b3883e13a285029 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14925/05324d0e986a1012a342e2650b3883e13a285029/defchararray.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
609,
67,
1897,
12,
69,
4672,
3536,
2000,
562,
12,
69,
13,
930,
17,
2460,
18,
225,
7012,
12181,
279,
294,
526,
67,
5625,
434,
609,
578,
5252,
225,
2860,
18365,
596,
294,
8304,
3633,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
609,
67,
1897,
12,
69,
4672,
3536,
2000,
562,
12,
69,
13,
930,
17,
2460,
18,
225,
7012,
12181,
279,
294,
526,
67,
5625,
434,
609,
578,
5252,
225,
2860,
18365,
596,
294,
8304,
3633,
5... |
specific = regcompile('(.*/)(?P<filename>[\w.]+)\.((H_(?P<hostname>\S+))|(B(?P<bprio>\d+)_(?P<bundle>\S+))|(A(?P<aprio>\d+)_(?P<attr>\S+))|(I(?P<iprio>\d+)_(?P<image>\S+))|(C(?P<cprio>\d+)_(?P<class>\S+)))(\.(?P<op>cat|udiff))?$') info = regcompile('^owner:(\s)*(?P<owner>\w+)|group:(\s)*(?P<group>\w+)|perms:(\s)*(?P<perms>\w+)|encoding:(\s)*(?P<encoding>\w+)|(?P<paranoid>paranoid(\s)*)$') | specific = regcompile('(.*/)(?P<filename>[\w.]+)\.((H_(?P<hostname>\S+))|' + '(B(?P<bprio>\d+)_(?P<bundle>\S+))|(A(?P<aprio>\d+)_(?P<attr>\S+))|' + '(I(?P<iprio>\d+)_(?P<image>\S+))|(C(?P<cprio>\d+)_(?P<class>\S+)))' + '(\.(?P<op>cat|udiff))?$') info = regcompile('^owner:(\s)*(?P<owner>\w+)|group:(\s)*(?P<group>\w+)|' + 'perms:(\s)*(?P<perms>\w+)|encoding:(\s)*(?P<encoding>\w+)|' + '(?P<paranoid>paranoid(\s)*)$') | def __cmp__(self, other): fields = ['all', 'image', 'classes', 'bundles', 'attributes', 'hostname'] try: most1 = [index for index in range(len(fields)) if getattr(self, fields[index])][0] except IndexError: most1 = 0 try: most2 = [index for index in range(len(fields)) if getattr(other, fields[index])][0] except IndexError: most2 = 0 return most1 - most2 | d95d4eea0cb84903bf9b68fe0f5821bfe5d4a183 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11867/d95d4eea0cb84903bf9b68fe0f5821bfe5d4a183/Cfg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9625,
972,
12,
2890,
16,
1308,
4672,
1466,
273,
10228,
454,
2187,
296,
2730,
2187,
296,
4701,
2187,
296,
22773,
2187,
296,
4350,
2187,
296,
10358,
3546,
775,
30,
4486,
21,
273,
306... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9625,
972,
12,
2890,
16,
1308,
4672,
1466,
273,
10228,
454,
2187,
296,
2730,
2187,
296,
4701,
2187,
296,
22773,
2187,
296,
4350,
2187,
296,
10358,
3546,
775,
30,
4486,
21,
273,
306... |
locale.setlocale(locale.LC_ALL, loc) | continue | def resetlocale(): # locale.resetlocale is bugged with some locales. loc = locale.getdefaultlocale()[0] try: ln = locale._build_localename((loc, 'utf8')) locale.setlocale(locale.LC_ALL, ln) except locale.Error: enc = locale.getpreferredencoding() ln = locale._build_localename((loc, enc)) try: locale.setlocale(locale.LC_ALL, ln) except locale.Error: locale.setlocale(locale.LC_ALL, loc) | 56a68ebf4a784ceec370abe5b93cfc74cbb83c12 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/56a68ebf4a784ceec370abe5b93cfc74cbb83c12/translate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2715,
6339,
13332,
468,
2573,
18,
6208,
6339,
353,
7934,
2423,
598,
2690,
6922,
18,
1515,
273,
2573,
18,
588,
1886,
6339,
1435,
63,
20,
65,
775,
30,
7211,
273,
2573,
6315,
3510,
67,
37... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2715,
6339,
13332,
468,
2573,
18,
6208,
6339,
353,
7934,
2423,
598,
2690,
6922,
18,
1515,
273,
2573,
18,
588,
1886,
6339,
1435,
63,
20,
65,
775,
30,
7211,
273,
2573,
6315,
3510,
67,
37... |
errorOut = temp.getvalue() if not successRe.search(errorOut): self.fail("unexpected stderr output: %r" % errorOut) | errorOut = temp.getvalue() if not successRe.search(errorOut): self.fail("unexpected stderr output: %r" % errorOut) | def verifyStderr(self, method, successRe): """ Call method() while capturing sys.stderr output internally and call self.fail() if successRe.search() does not match the stderr output. This is used to test for uncatchable exceptions. """ stdErr = sys.stderr sys.stderr = StringIO() try: method() finally: temp = sys.stderr sys.stderr = stdErr errorOut = temp.getvalue() if not successRe.search(errorOut): self.fail("unexpected stderr output: %r" % errorOut) | fc45693524fc1c94ea38d93480acb1677ba300c5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/fc45693524fc1c94ea38d93480acb1677ba300c5/test_compare.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3929,
31781,
12,
2890,
16,
707,
16,
2216,
426,
4672,
3536,
3049,
707,
1435,
1323,
28789,
2589,
18,
11241,
876,
12963,
471,
745,
365,
18,
6870,
1435,
309,
2216,
426,
18,
3072,
1435,
1552,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3929,
31781,
12,
2890,
16,
707,
16,
2216,
426,
4672,
3536,
3049,
707,
1435,
1323,
28789,
2589,
18,
11241,
876,
12963,
471,
745,
365,
18,
6870,
1435,
309,
2216,
426,
18,
3072,
1435,
1552,... |
return '%s@%s' % (self._internal_name, self.host_name) | return '%s@%s' % (self._internal_name, self.host_name) | def GetListEmail(self): | d4117e2559487604b13fa55121d903681fad00c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/d4117e2559487604b13fa55121d903681fad00c3/MailList.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
682,
4134,
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,
... | [
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,
968,
682,
4134,
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,
-10... |
'export I_MPI_DEBUG=2', 'export I_MPI_DEVICE=rmda:OpenIB-cma', | def str_prerun(self): msgs = [ 'export I_MPI_DEBUG=2', 'export I_MPI_DEVICE=rmda:OpenIB-cma', ] msgs.append(super(OscGlenn, self).str_prerun) return '\n'.join(msgs) | 7d70edda223b4b6d166fba37d4aa0469f2b5559d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/931/7d70edda223b4b6d166fba37d4aa0469f2b5559d/batch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
609,
67,
683,
19780,
12,
2890,
4672,
8733,
273,
306,
282,
308,
8733,
18,
6923,
12,
9565,
12,
51,
1017,
43,
1897,
82,
16,
365,
2934,
701,
67,
683,
19780,
13,
327,
2337,
82,
10332,
570... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
609,
67,
683,
19780,
12,
2890,
4672,
8733,
273,
306,
282,
308,
8733,
18,
6923,
12,
9565,
12,
51,
1017,
43,
1897,
82,
16,
365,
2934,
701,
67,
683,
19780,
13,
327,
2337,
82,
10332,
570... | |
else: | elif s.circ_id == 0: | def stream_status_event(self, s): output = [s.event_name, str(s.strm_id), s.status, str(s.circ_id), s.target_host, str(s.target_port)] if s.reason: output.append("REASON=" + s.reason) if s.remote_reason: output.append("REMOTE_REASON=" + s.remote_reason) if s.purpose: output.append("PURPOSE=" + s.purpose) plog("DEBUG", " ".join(output)) if not re.match(r"\d+.\d+.\d+.\d+", s.target_host): s.target_host = "255.255.255.255" # ignore DNS for exit policy check | eb10d25675a70cbaa7f6ba2a2f87b1b27842c3d8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3224/eb10d25675a70cbaa7f6ba2a2f87b1b27842c3d8/PathSupport.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1407,
67,
2327,
67,
2575,
12,
2890,
16,
272,
4672,
876,
273,
306,
87,
18,
2575,
67,
529,
16,
609,
12,
87,
18,
701,
81,
67,
350,
3631,
272,
18,
2327,
16,
609,
12,
87,
18,
11614,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1407,
67,
2327,
67,
2575,
12,
2890,
16,
272,
4672,
876,
273,
306,
87,
18,
2575,
67,
529,
16,
609,
12,
87,
18,
701,
81,
67,
350,
3631,
272,
18,
2327,
16,
609,
12,
87,
18,
11614,
7... |
def __init__(self, simopts=None, inputs=None, outputs=None): self.getBasename() | def __init__(self, dir=None, test=None, simopts=None, inputs=None, outputs=None): self.dirname = dir self.shortname = test self.testname = testname = "test_" + test self.midname = midname = os.sep.join(["tests", dir, testname]) self.basename = os.sep.join([os.getcwd(), midname]) | def __init__(self, simopts=None, inputs=None, outputs=None): self.getBasename() if inputs == None: inputs = self.DEFAULT_INPUTS if simopts == None: simopts = self.DEFAULT_SIMOPTS if outputs == None: outputs = self.DEFAULT_OUTPUTS self.inputs = inputs self.outputs = outputs # not using this yet self.runInSandbox(simopts) assert self.exitvalue == 0 | d4548954f0b2ec61c249ce8e1b4af97c07a52a78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/d4548954f0b2ec61c249ce8e1b4af97c07a52a78/tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1577,
33,
7036,
16,
1842,
33,
7036,
16,
3142,
4952,
33,
7036,
16,
4540,
33,
7036,
16,
6729,
33,
7036,
4672,
225,
365,
18,
12287,
273,
1577,
365,
18,
28... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1577,
33,
7036,
16,
1842,
33,
7036,
16,
3142,
4952,
33,
7036,
16,
4540,
33,
7036,
16,
6729,
33,
7036,
4672,
225,
365,
18,
12287,
273,
1577,
365,
18,
28... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.