rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
raise_opts = ["", "-raise"] | raise_opts = ["-noraise", ""] | def open(self, url, new=0, autoraise=True): if new == 0: action = self.remote_action elif new == 1: action = self.remote_action_newwin elif new == 2: if self.remote_action_newtab is None: action = self.remote_action_newwin else: action = self.remote_action_newtab else: raise Error("Bad 'new' parameter to open(); " + "expected 0, 1, or 2, got %s" % new) | 93fb83ffc26a312f00fd2881ddd71c64f6fdaa9f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/93fb83ffc26a312f00fd2881ddd71c64f6fdaa9f/webbrowser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
2890,
16,
880,
16,
394,
33,
20,
16,
2059,
10610,
784,
33,
5510,
4672,
309,
394,
422,
374,
30,
1301,
273,
365,
18,
7222,
67,
1128,
1327,
394,
422,
404,
30,
1301,
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,
1696,
12,
2890,
16,
880,
16,
394,
33,
20,
16,
2059,
10610,
784,
33,
5510,
4672,
309,
394,
422,
374,
30,
1301,
273,
365,
18,
7222,
67,
1128,
1327,
394,
422,
404,
30,
1301,
273,
365,
... |
8005551212 < I think you are are dummy user. | 8005551212 < I think you are are dummy. | def testScript(self): a = """ 8005551219 > llin register 20 dl secret crummy user 8005551219 < Hello cuser! You are now registered as Distribution point team leader at KANO State. """ self.runScript(a) # this should succeed because we just created him Reporter.objects.get(alias="cuser") dict = {"alias":"fail"} # make sure checking a non-existant user fails self.assertRaises(Reporter.DoesNotExist, Reporter.objects.get, **dict) | f47a45ce40c2d07eef6e7d34514c9541ea3d902b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11809/f47a45ce40c2d07eef6e7d34514c9541ea3d902b/tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
3651,
12,
2890,
4672,
279,
273,
3536,
1725,
713,
2539,
13757,
3657,
405,
6579,
267,
1744,
4200,
8910,
4001,
4422,
379,
4811,
729,
1725,
713,
2539,
13757,
3657,
411,
20889,
276,
1355,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3651,
12,
2890,
4672,
279,
273,
3536,
1725,
713,
2539,
13757,
3657,
405,
6579,
267,
1744,
4200,
8910,
4001,
4422,
379,
4811,
729,
1725,
713,
2539,
13757,
3657,
411,
20889,
276,
1355,... |
def add_error_message(doc, errmsg, tag='Error: ', *args): if tag: tag = _(tag) doc.AddItem(Header(3, Bold(FontAttr( tag, color=mm_cfg.WEB_ERROR_COLOR, size="+2")).Format() + Italic(errmsg % args).Format())) | def add_error_message(doc, errmsg, tag='Error: ', *args): # Don't translate the tag if it's the empty string if tag: tag = _(tag) doc.AddItem(Header(3, Bold(FontAttr( tag, color=mm_cfg.WEB_ERROR_COLOR, size="+2")).Format() + Italic(errmsg % args).Format())) | 1b0a7186ef948b504ed35356bdee74957c65566d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/1b0a7186ef948b504ed35356bdee74957c65566d/options.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
1636,
67,
2150,
12,
2434,
16,
17460,
16,
1047,
2218,
668,
30,
2265,
380,
1968,
4672,
468,
7615,
1404,
4204,
326,
1047,
309,
518,
1807,
326,
1008,
533,
309,
1047,
30,
1047,
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,
527,
67,
1636,
67,
2150,
12,
2434,
16,
17460,
16,
1047,
2218,
668,
30,
2265,
380,
1968,
4672,
468,
7615,
1404,
4204,
326,
1047,
309,
518,
1807,
326,
1008,
533,
309,
1047,
30,
1047,
273... | |
CONFIG = {'fullscreen':False, 'maximised':False, 'borderless':False, 'enable_real_transparency':True, 'hidden':False} | CONFIG = {'fullscreen':False, 'maximised':False, 'borderless':False, 'enable_real_transparency':True, 'hidden':False, 'keybindings':{'hide_window': '<Super>a', } } | def set_real_transparency(self, value): screen = self.get_screen() if value: colormap = screen.get_rgba_colormap() else: colormap = screen.get_rgb_colormap() | 50fe4169ef4b78a2f72eb6701ffa00415cb03a78 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6502/50fe4169ef4b78a2f72eb6701ffa00415cb03a78/window.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
7688,
67,
2338,
18258,
12,
2890,
16,
460,
4672,
5518,
273,
365,
18,
588,
67,
9252,
1435,
309,
460,
30,
24806,
273,
5518,
18,
588,
67,
26198,
67,
1293,
18804,
1435,
469,
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,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
7688,
67,
2338,
18258,
12,
2890,
16,
460,
4672,
5518,
273,
365,
18,
588,
67,
9252,
1435,
309,
460,
30,
24806,
273,
5518,
18,
588,
67,
26198,
67,
1293,
18804,
1435,
469,
30,
... |
m=re.match(r'(?P<feature>[A-Za-z0-9][A-Za-z0-9\-]*)',each) | m=re.match(r'(?P<feature>[A-Za-z0-9][A-Za-z0-9\-]*) ?',each) | def ehlo(self, name=''): """ SMTP 'ehlo' command. Hostname to send for this command defaults to the FQDN of the local host. """ self.esmtp_features = {} self.putcmd("ehlo", name or self.local_hostname) (code,msg)=self.getreply() # According to RFC1869 some (badly written) # MTA's will disconnect on an ehlo. Toss an exception if # that happens -ddm if code == -1 and len(msg) == 0: self.close() raise SMTPServerDisconnected("Server not connected") self.ehlo_resp=msg if code != 250: return (code,msg) self.does_esmtp=1 #parse the ehlo response -ddm resp=self.ehlo_resp.split('\n') del resp[0] for each in resp: m=re.match(r'(?P<feature>[A-Za-z0-9][A-Za-z0-9\-]*)',each) if m: feature=m.group("feature").lower() params=m.string[m.end("feature"):].strip() self.esmtp_features[feature]=params return (code,msg) | f64fb3766ea1bf2a3dd8a0f98b7a689336201509 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f64fb3766ea1bf2a3dd8a0f98b7a689336201509/smtplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20124,
383,
12,
2890,
16,
508,
2218,
11,
4672,
3536,
18102,
296,
73,
76,
383,
11,
1296,
18,
17423,
358,
1366,
364,
333,
1296,
3467,
358,
326,
23127,
8609,
434,
326,
1191,
1479,
18,
353... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20124,
383,
12,
2890,
16,
508,
2218,
11,
4672,
3536,
18102,
296,
73,
76,
383,
11,
1296,
18,
17423,
358,
1366,
364,
333,
1296,
3467,
358,
326,
23127,
8609,
434,
326,
1191,
1479,
18,
353... |
if fs is self: | if fs is self or fs is None: | def getsyspath(self, path, allow_none=False): fs, mount_path, delegate_path = self._delegate(path) if fs is self: if allow_none: return None else: raise NoSysPathError(path=path) return fs.getsyspath(delegate_path, allow_none=allow_none) | 77d923e1f2d3c392194393a0801769f7e1368e7e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5578/77d923e1f2d3c392194393a0801769f7e1368e7e/mountfs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5571,
1900,
803,
12,
2890,
16,
589,
16,
1699,
67,
6102,
33,
8381,
4672,
2662,
16,
5344,
67,
803,
16,
7152,
67,
803,
273,
365,
6315,
22216,
12,
803,
13,
309,
2662,
353,
365,
578,
2662... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5571,
1900,
803,
12,
2890,
16,
589,
16,
1699,
67,
6102,
33,
8381,
4672,
2662,
16,
5344,
67,
803,
16,
7152,
67,
803,
273,
365,
6315,
22216,
12,
803,
13,
309,
2662,
353,
365,
578,
2662... |
hints.append("The owner will change to %s" % req.authname) | hints.append(_("The owner will change to %s") % req.authname) | def render_ticket_action_control(self, req, ticket, action): from trac.ticket import model | 4557ba248139b9944b399be700bb3f2c65df45fd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9317/4557ba248139b9944b399be700bb3f2c65df45fd/default_workflow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
16282,
67,
1128,
67,
7098,
12,
2890,
16,
1111,
16,
9322,
16,
1301,
4672,
628,
1284,
71,
18,
16282,
1930,
938,
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,
1743,
67,
16282,
67,
1128,
67,
7098,
12,
2890,
16,
1111,
16,
9322,
16,
1301,
4672,
628,
1284,
71,
18,
16282,
1930,
938,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
total = 0 | total = 0 | def generate_report(): ''' Generate report of CPU utilization ''' cpu_labels = ('cpu', 'user', 'nice', 'system', 'idle', 'iowait', 'irq', 'softirq', 'x', 'y') if (not os.path.exists('/procstat')): os.mkdir('/procstat') reportfile = open('/procstat/cpu-utilisation', 'a') debugfile = open('/procstat/cpu-utilisation.debug', 'a') for l in stats_stop: percentage_list = [] total = 0 for i in range(1, len(stats_stop[l])): stats_stop[l][i] = int(stats_stop[l][i]) - int(stats_start[l][i]) total += stats_stop[l][i] percentage_list.append(l) for i in range(1, len(stats_stop[l])): percentage_list.append(float(stats_stop[l][i])*100/total) stats_percentage[l] = percentage_list for i in range(0, len(cpu_labels)): print >> debugfile, cpu_labels[i], '\t', print >> debugfile for l in sorted(stats_stop.keys()): print >> debugfile, l, '\t', for i in range(1, len(stats_stop[l])): print >> debugfile, stats_stop[l][i], '\t', print >> debugfile for i in range(0, len(cpu_labels)): print >> reportfile, cpu_labels[i], '\t', print >> reportfile for l in sorted(stats_percentage.keys()): print >> reportfile, l, '\t', for i in range(1, len(stats_percentage[l])): print >> reportfile, " %3.4f" % stats_percentage[l][i], print >> reportfile #Now get the package ID information print >> debugfile, "cpu_map: ", cpu_map keyvalfile = open('/procstat/keyval', 'a') print >> keyvalfile, "nr_packages=%d" % len(cpu_map) print >> keyvalfile, "system-idle=%3.4f" % stats_percentage['cpu'][4]) for pkg in sorted(cpu_map.keys()): total_idle = 0 total = 0 for cpu in cpu_map[pkg]: total_idle += stats_stop["cpu%d" % cpu][4] for i in range(1, len(stats_stop["cpu%d" % cpu])): total += stats_stop["cpu%d" % cpu][i] print >> reportfile, "Package: ", pkg, "Idle %3.4f%%" \ % (float(total_idle)*100/total) print >> keyvalfile, "package-%s=%3.4f" % \ (pkg, (float(total_idle)*100/total)) #Add record delimiter '\n' before closing these files print >> debugfile debugfile.close() print >> reportfile reportfile.close() print >> keyvalfile keyvalfile.close() | 8df8484c51591f3064cbb520dc7cca26f2ba5932 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11457/8df8484c51591f3064cbb520dc7cca26f2ba5932/sched_mc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
6006,
13332,
9163,
6654,
2605,
434,
12154,
1709,
1588,
9163,
8326,
67,
5336,
273,
7707,
11447,
2187,
296,
1355,
2187,
296,
82,
1812,
2187,
296,
4299,
2187,
296,
20390,
2187,
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,
2103,
67,
6006,
13332,
9163,
6654,
2605,
434,
12154,
1709,
1588,
9163,
8326,
67,
5336,
273,
7707,
11447,
2187,
296,
1355,
2187,
296,
82,
1812,
2187,
296,
4299,
2187,
296,
20390,
2187,
296,... |
self.reader = PacketReader(self.conn, self.socketCondition) self.writer = PacketWriter(self.conn, self.socketCondition) | self.reader = PacketReader(self.socket, self.socketCondition) self.writer = PacketWriter(self.socket, self.socketCondition) self.socket.settimeout(10) self.socket.send(HANDSHAKE_STRING) | def start(self): self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: self.socket.bind((self.host, self.port)) except socket.error: print socket.error quit() | e31bc9a2c87a67a97d76f41fc1eb65d098c86d2a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11436/e31bc9a2c87a67a97d76f41fc1eb65d098c86d2a/crossfire_test_client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
4672,
365,
18,
7814,
273,
2987,
18,
7814,
12,
7814,
18,
6799,
67,
18819,
16,
2987,
18,
3584,
3507,
67,
13693,
13,
775,
30,
365,
18,
7814,
18,
4376,
12443,
2890,
18,
25... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
4672,
365,
18,
7814,
273,
2987,
18,
7814,
12,
7814,
18,
6799,
67,
18819,
16,
2987,
18,
3584,
3507,
67,
13693,
13,
775,
30,
365,
18,
7814,
18,
4376,
12443,
2890,
18,
25... |
data_bytes, tag = struct.unpack('!I4s', self.file.read(8)) | try: data_bytes, tag = struct.unpack('!I4s', self.file.read(8)) except struct.error: raise ValueError('Chunk too short for header') | def read_chunk(self): """ Read a PNG chunk from the input file, return tag name and data. """ # http://www.w3.org/TR/PNG/#5Chunk-layout data_bytes, tag = struct.unpack('!I4s', self.file.read(8)) data = self.file.read(data_bytes) checksum = struct.unpack('!i', self.file.read(4))[0] verify = zlib.crc32(tag) verify = zlib.crc32(data, verify) if checksum != verify: raise ValueError("checksum error in %s chunk: %x != %x" % (tag, checksum, verify)) return tag, data | 0211944d5afaf519157507193630585f8d2a7bd6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3111/0211944d5afaf519157507193630585f8d2a7bd6/png.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
6551,
12,
2890,
4672,
3536,
2720,
279,
22476,
2441,
628,
326,
810,
585,
16,
327,
1047,
508,
471,
501,
18,
3536,
468,
1062,
2207,
5591,
18,
91,
23,
18,
3341,
19,
4349,
19,
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,
855,
67,
6551,
12,
2890,
4672,
3536,
2720,
279,
22476,
2441,
628,
326,
810,
585,
16,
327,
1047,
508,
471,
501,
18,
3536,
468,
1062,
2207,
5591,
18,
91,
23,
18,
3341,
19,
4349,
19,
23... |
except ValueError, e: | except Exception, e: | def check_urls(archive_id=None): ftp_check = FtpChecker() http_check = HttpChecker() pat = re.compile(r"((?:f|ht)tps?://\S+)") con = connect_to_db() cur = con.cursor() if archive_id is None: cur.execute("select me.Element_ID, Content from METADATA_ELEM me left join INTEGRITY_CHECK ic on me.Element_ID=ic.Object_ID where Content regexp '(f|ht)tps?://.*' and (IntegrityChecked is null or timestampdiff(day,IntegrityChecked,now())<1) order by rand()") else: cur.execute("select me.Element_ID, Content from METADATA_ELEM me left join ARCHIVED_ITEM ai on me.Item_ID=ai.Item_ID left join INTEGRITY_CHECK ic on me.Element_ID=ic.Object_ID where ai.Archive_ID=%s and Content regexp '(f|ht)tps?://.*' and (IntegrityChecked is null or timestampdiff(day,IntegrityChecked,now())<1) order by rand()", archive_id) for row in cur.fetchall(): url = pat.search(row[1]).group(1) log('checking: %s' % url) sqls = [("delete from INTEGRITY_CHECK where Object_ID=%s and (Problem_Code='RNA' or Problem_Code='RNF')", (row[0],))] if url.startswith('ftp'): res = ftp_check(url) if not res: sql = "insert into INTEGRITY_CHECK (Object_ID, Value, Problem_Code) values (%s, %s, 'RNA')" sqls.append((sql,row)) elif url.startswith('http'): try: res = http_check(url) except ValueError, e: log("%s" % e) continue if res != '200': if res == '404': sql = "insert into INTEGRITY_CHECK (Object_ID, Value, Problem_Code) values (%s, %s, 'RNF')" sqls.append((sql, row)) else: sql = "insert into INTEGRITY_CHECK (Object_ID, Value, Problem_Code) values (%s, %s, 'RNA')" sqls.append((sql, row)) else: sql = "insert into INTEGRITY_CHECK (Object_ID, Value, Problem_Code) values (%s, %s, 'RNF')" sqls.append((sql, row)) for sql, args in sqls: cur.execute(sql, args) con.commit() cur.close() con.close() | 2cce321f8396233d57c4f27cf4488acf38fbae8d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8937/2cce321f8396233d57c4f27cf4488acf38fbae8d/integrity.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
10518,
12,
10686,
67,
350,
33,
7036,
4672,
13487,
67,
1893,
273,
478,
6834,
8847,
1435,
1062,
67,
1893,
273,
2541,
8847,
1435,
225,
9670,
273,
283,
18,
11100,
12,
86,
6,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
10518,
12,
10686,
67,
350,
33,
7036,
4672,
13487,
67,
1893,
273,
478,
6834,
8847,
1435,
1062,
67,
1893,
273,
2541,
8847,
1435,
225,
9670,
273,
283,
18,
11100,
12,
86,
6,
12,
... |
newid = struct.pack('ll', random.randint(0, 2147483647) | 0x01010101, random.randint(0, 2147483647) | 0x01010101) | blist = [] for x in xrange(_rowid_str_len): blist.append(random.randint(1,255)) newid = struct.pack('B'*_rowid_str_len, *blist) | def __new_rowid(self, table, txn) : """Create a new unique row identifier""" unique = 0 while not unique: # Generate a random 64-bit row ID string # (note: this code has <56 bits of randomness # but it's plenty for our database id needs!) # The | 0x01010101 is to ensure no null bytes are in the value newid = struct.pack('ll', random.randint(0, 2147483647) | 0x01010101, random.randint(0, 2147483647) | 0x01010101) | 59b9d28804ad717d72addc470ad7b76c6697fd47 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/59b9d28804ad717d72addc470ad7b76c6697fd47/dbtables.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2704,
67,
492,
350,
12,
2890,
16,
1014,
16,
7827,
13,
294,
3536,
1684,
279,
394,
3089,
1027,
2756,
8395,
3089,
273,
374,
1323,
486,
3089,
30,
468,
6654,
279,
2744,
5178,
17,
3682... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2704,
67,
492,
350,
12,
2890,
16,
1014,
16,
7827,
13,
294,
3536,
1684,
279,
394,
3089,
1027,
2756,
8395,
3089,
273,
374,
1323,
486,
3089,
30,
468,
6654,
279,
2744,
5178,
17,
3682... |
fn = gtlib.gt_feature_node_new(description, seq_str) | fn = gtlib.gt_sequence_node_new(description, seq_str) | def create_new(cls, description, sequence): seq_str = Str(sequence) fn = gtlib.gt_feature_node_new(description, seq_str) n = cls.create_from_ptr(fn, True) return n | 82cb33beb64d6cc513fa32690c1e63ef5d5369fd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8905/82cb33beb64d6cc513fa32690c1e63ef5d5369fd/sequence_node.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
2704,
12,
6429,
16,
2477,
16,
3102,
4672,
3833,
67,
701,
273,
3978,
12,
6178,
13,
2295,
273,
9879,
2941,
18,
4521,
67,
6178,
67,
2159,
67,
2704,
12,
3384,
16,
3833,
67,
701,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
2704,
12,
6429,
16,
2477,
16,
3102,
4672,
3833,
67,
701,
273,
3978,
12,
6178,
13,
2295,
273,
9879,
2941,
18,
4521,
67,
6178,
67,
2159,
67,
2704,
12,
3384,
16,
3833,
67,
701,... |
result = UnitArray(units.convert(self.view(numpy.ndarray), self.units, new_units)) | result = self.__class__(units.convert(self.view(numpy.ndarray), self.units, new_units)) | def as_units(self, new_units): """ Convert UnitArray from its current units to a new set of units. | 8f2cbdcf1b93560ecf216c0ec0cf255fc49aef14 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13168/8f2cbdcf1b93560ecf216c0ec0cf255fc49aef14/unit_array.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
487,
67,
7705,
12,
2890,
16,
394,
67,
7705,
4672,
3536,
4037,
8380,
1076,
628,
2097,
783,
4971,
358,
279,
394,
444,
434,
4971,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
487,
67,
7705,
12,
2890,
16,
394,
67,
7705,
4672,
3536,
4037,
8380,
1076,
628,
2097,
783,
4971,
358,
279,
394,
444,
434,
4971,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
fp=image.fp | fp=im._image.fp | def loadImageFromSRC(self, im): "Extracts the stream, width and height" if im._image.format=='JPEG': fp=image.fp fp.seek(0) self.loadImageFromJPEG(fp) else: zlib = import_zlib() if not zlib: return self.width, self.height = im.getSize() raw = im.getRGBData() assert(len(raw) == self.width*self.height, "Wrong amount of data for image") self.streamContent = pdfutils._AsciiBase85Encode(zlib.compress(raw)) self.colorSpace = 'DeviceRGB' self.bitsPerComponent = 8 self._filters = 'ASCII85Decode','FlateDecode' #'A85','Fl' self._checkTransparency(im) | 868d92587d4e5808df5de88939b2b7e55aeb9764 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/868d92587d4e5808df5de88939b2b7e55aeb9764/pdfdoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
2040,
1265,
28413,
12,
2890,
16,
709,
4672,
315,
12809,
326,
1407,
16,
1835,
471,
2072,
6,
309,
709,
6315,
2730,
18,
2139,
18920,
28698,
4278,
4253,
33,
381,
6315,
2730,
18,
7944,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
2040,
1265,
28413,
12,
2890,
16,
709,
4672,
315,
12809,
326,
1407,
16,
1835,
471,
2072,
6,
309,
709,
6315,
2730,
18,
2139,
18920,
28698,
4278,
4253,
33,
381,
6315,
2730,
18,
7944,
... |
def __read_slices(self): | print "Done." def __read_slices(self,override): | def __read_slices(self): ''' Read all the slices and organize them in the hdf5 file I assume that format is native, and not an oldfile format ''' if self.__creating: fvid=file(self.workdir+'video.in','r') names=[] while 1: tmp=fvid.readline().strip() if tmp=='': break names+=[tmp] fvid.close() self.data.create_dataset('slices_names',data=names) self.nbslices=len(names) createtime=True for i in range(self.nbslices): for j in range(self.param['dim/nproc'][0]): createtime=self.__read_slice(timeslice=createtime,field=i,extension='xy',proc=j) createtime=self.__read_slice(timeslice=createtime,field=i,extension='xy2',proc=j) createtime=self.__read_slice(timeslice=createtime,field=i,extension='xz',proc=j) createtime=self.__read_slice(timeslice=createtime,field=i,extension='yz',proc=j) | bf1a599ad9cde581f4679533ab3c54c55f5e9732 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1377/bf1a599ad9cde581f4679533ab3c54c55f5e9732/hdf5.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1172,
315,
7387,
1199,
1652,
1001,
896,
67,
21562,
12,
2890,
16,
10601,
4672,
9163,
2720,
777,
326,
12390,
471,
15501,
554,
2182,
316,
326,
24217,
25,
585,
467,
6750,
716,
740,
353,
6448,
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,
1172,
315,
7387,
1199,
1652,
1001,
896,
67,
21562,
12,
2890,
16,
10601,
4672,
9163,
2720,
777,
326,
12390,
471,
15501,
554,
2182,
316,
326,
24217,
25,
585,
467,
6750,
716,
740,
353,
6448,
16,
... |
return file | if response == gtk.RESPONSE_OK: return file return None | def _FileChooser (): ''' File selection dialog. ''' xml = gtk.glade.XML ("data/filechooser.glade") dialog = xml.get_widget ("filechooserdialog") response = dialog.run () file = dialog.get_filename () dialog.destroy () return file | 758d536e8dc39c75f482c419195809337ecb61af /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6757/758d536e8dc39c75f482c419195809337ecb61af/Gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
812,
17324,
1832,
30,
9163,
1387,
4421,
6176,
18,
9163,
2025,
273,
22718,
18,
7043,
2486,
18,
4201,
7566,
892,
19,
768,
2599,
13164,
18,
7043,
2486,
7923,
6176,
273,
2025,
18,
588,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
812,
17324,
1832,
30,
9163,
1387,
4421,
6176,
18,
9163,
2025,
273,
22718,
18,
7043,
2486,
18,
4201,
7566,
892,
19,
768,
2599,
13164,
18,
7043,
2486,
7923,
6176,
273,
2025,
18,
588,
... |
* conditions is a dictionary keyed on column names | * conditions - a dictionary keyed on column names | def Select(self, table, columns, conditions={}): """Select(table, conditions) - retrieve specific row data Returns a list of row column->value mapping dictionaries. * columns is a list of which column data to return. If columns is None, all columns will be returned. * conditions is a dictionary keyed on column names containing callable conditions expecting the data string as an argument and returning a boolean. """ try: if not self.__tablecolumns.has_key(table): self.__load_column_info(table) if columns is None: columns = self.__tablecolumns[table] matching_rowids = self.__Select(table, columns, conditions) except DBError, dberror: raise TableDBError, dberror[1] # return the matches as a list of dictionaries return matching_rowids.values() | ff7d991a07f21a0a368f422efcf17b27c363e1d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ff7d991a07f21a0a368f422efcf17b27c363e1d2/dbtables.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6766,
12,
2890,
16,
1014,
16,
2168,
16,
4636,
12938,
4672,
3536,
3391,
12,
2121,
16,
4636,
13,
300,
4614,
2923,
1027,
501,
2860,
279,
666,
434,
1027,
1057,
2122,
1132,
2874,
16176,
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,
6766,
12,
2890,
16,
1014,
16,
2168,
16,
4636,
12938,
4672,
3536,
3391,
12,
2121,
16,
4636,
13,
300,
4614,
2923,
1027,
501,
2860,
279,
666,
434,
1027,
1057,
2122,
1132,
2874,
16176,
18,
... |
return bessel_J(nu,z) | return bessel_Y(nu,z,algorithm=s,prec=p) | def __call__(self,z): nu = self.order() t = self.type() s = self.system() p = self.prec() if t == "I": return bessel_I(nu,z,s,p) if t == "J": return bessel_J(nu,z,s,p) if t == "K": return bessel_K(nu,z,p) if t == "Y": return bessel_J(nu,z) | 6634f9ab85d7944da6788aaab93ffaa3f22ce5ac /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/6634f9ab85d7944da6788aaab93ffaa3f22ce5ac/special.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
94,
4672,
9244,
273,
365,
18,
1019,
1435,
268,
273,
365,
18,
723,
1435,
272,
273,
365,
18,
4299,
1435,
293,
273,
365,
18,
4036,
1435,
309,
268,
422,
31... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
94,
4672,
9244,
273,
365,
18,
1019,
1435,
268,
273,
365,
18,
723,
1435,
272,
273,
365,
18,
4299,
1435,
293,
273,
365,
18,
4036,
1435,
309,
268,
422,
31... |
opts, args = getopt.getopt(sys.argv[1:], 'hvgqxsrf:lu:t:', | opts, args = getopt.getopt(sys.argv[1:], 'hvgqxsrf:lu:t:T', | def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0, exclude=0, single=0, randomize=0, fromfile=None, findleaks=0, use_resources=None): """Execute a test suite. This also parses command-line options and modifies its behavior accordingly. tests -- a list of strings containing test names (optional) testdir -- the directory in which to look for tests (optional) Users other than the Python test suite will certainly want to specify testdir; if it's omitted, the directory containing the Python test suite is searched for. If the tests argument is omitted, the tests listed on the command-line will be used. If that's empty, too, then all *.py files beginning with test_ will be used. The other default arguments (verbose, quiet, generate, exclude, single, randomize, findleaks, and use_resources) allow programmers calling main() directly to set the values that would normally be set by flags on the command line. """ test_support.record_original_stdout(sys.stdout) try: opts, args = getopt.getopt(sys.argv[1:], 'hvgqxsrf:lu:t:', ['help', 'verbose', 'quiet', 'generate', 'exclude', 'single', 'random', 'fromfile', 'findleaks', 'use=', 'threshold=']) except getopt.error, msg: usage(2, msg) # Defaults if use_resources is None: use_resources = [] for o, a in opts: if o in ('-h', '--help'): usage(0) elif o in ('-v', '--verbose'): verbose += 1 elif o in ('-q', '--quiet'): quiet = 1; verbose = 0 elif o in ('-g', '--generate'): generate = 1 elif o in ('-x', '--exclude'): exclude = 1 elif o in ('-s', '--single'): single = 1 elif o in ('-r', '--randomize'): randomize = 1 elif o in ('-f', '--fromfile'): fromfile = a elif o in ('-l', '--findleaks'): findleaks = 1 elif o in ('-t', '--threshold'): import gc gc.set_threshold(int(a)) elif o in ('-u', '--use'): u = [x.lower() for x in a.split(',')] for r in u: if r == 'all': use_resources[:] = RESOURCE_NAMES continue remove = False if r[0] == '-': remove = True r = r[1:] if r not in RESOURCE_NAMES: usage(1, 'Invalid -u/--use option: ' + a) if remove: if r in use_resources: use_resources.remove(r) elif r not in use_resources: use_resources.append(r) if generate and verbose: usage(2, "-g and -v don't go together!") if single and fromfile: usage(2, "-s and -f don't go together!") good = [] bad = [] skipped = [] resource_denieds = [] if findleaks: try: import gc except ImportError: print 'No GC available, disabling findleaks.' findleaks = 0 else: # Uncomment the line below to report garbage that is not # freeable by reference counting alone. By default only # garbage that is not collectable by the GC is reported. #gc.set_debug(gc.DEBUG_SAVEALL) found_garbage = [] if single: from tempfile import gettempdir filename = os.path.join(gettempdir(), 'pynexttest') try: fp = open(filename, 'r') next = fp.read().strip() tests = [next] fp.close() except IOError: pass if fromfile: tests = [] fp = open(fromfile) for line in fp: guts = line.split() # assuming no test has whitespace in its name if guts and not guts[0].startswith('#'): tests.extend(guts) fp.close() # Strip .py extensions. if args: args = map(removepy, args) if tests: tests = map(removepy, tests) stdtests = STDTESTS[:] nottests = NOTTESTS[:] if exclude: for arg in args: if arg in stdtests: stdtests.remove(arg) nottests[:0] = args args = [] tests = tests or args or findtests(testdir, stdtests, nottests) if single: tests = tests[:1] if randomize: random.shuffle(tests) test_support.verbose = verbose # Tell tests to be moderately quiet test_support.use_resources = use_resources save_modules = sys.modules.keys() for test in tests: if not quiet: print test sys.stdout.flush() ok = runtest(test, generate, verbose, quiet, testdir) if ok > 0: good.append(test) elif ok == 0: bad.append(test) else: skipped.append(test) if ok == -2: resource_denieds.append(test) if findleaks: gc.collect() if gc.garbage: print "Warning: test created", len(gc.garbage), print "uncollectable object(s)." # move the uncollectable objects somewhere so we don't see # them again found_garbage.extend(gc.garbage) del gc.garbage[:] # Unload the newly imported modules (best effort finalization) for module in sys.modules.keys(): if module not in save_modules and module.startswith("test."): test_support.unload(module) # The lists won't be sorted if running with -r good.sort() bad.sort() skipped.sort() if good and not quiet: if not bad and not skipped and len(good) > 1: print "All", print count(len(good), "test"), "OK." if verbose: print "CAUTION: stdout isn't compared in verbose mode:" print "a test that passes in verbose mode may fail without it." if bad: print count(len(bad), "test"), "failed:" printlist(bad) if skipped and not quiet: print count(len(skipped), "test"), "skipped:" printlist(skipped) e = _ExpectedSkips() plat = sys.platform if e.isvalid(): surprise = set(skipped) - e.getexpected() - set(resource_denieds) if surprise: print count(len(surprise), "skip"), \ "unexpected on", plat + ":" printlist(surprise) else: print "Those skips are all expected on", plat + "." else: print "Ask someone to teach regrtest.py about which tests are" print "expected to get skipped on", plat + "." if single: alltests = findtests(testdir, stdtests, nottests) for i in range(len(alltests)): if tests[0] == alltests[i]: if i == len(alltests) - 1: os.unlink(filename) else: fp = open(filename, 'w') fp.write(alltests[i+1] + '\n') fp.close() break else: os.unlink(filename) sys.exit(len(bad) > 0) | 1a5ffc9a430cf54038f88d81f49479e4f301c290 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/1a5ffc9a430cf54038f88d81f49479e4f301c290/regrtest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
16341,
33,
7036,
16,
1842,
1214,
33,
7036,
16,
3988,
33,
20,
16,
10902,
33,
20,
16,
2103,
33,
20,
16,
4433,
33,
20,
16,
2202,
33,
20,
16,
2744,
554,
33,
20,
16,
628,
76... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
16341,
33,
7036,
16,
1842,
1214,
33,
7036,
16,
3988,
33,
20,
16,
10902,
33,
20,
16,
2103,
33,
20,
16,
4433,
33,
20,
16,
2202,
33,
20,
16,
2744,
554,
33,
20,
16,
628,
76... |
xml_id = 'action_invoice_tree8' | xml_id = 'action_invoice_tree2' | def _create_invoice(obj, cr, uid, data, context): if data['form'].get('new_picking', False): data['id'] = data['form']['new_picking'] data['ids'] = [data['form']['new_picking']] pool = pooler.get_pool(cr.dbname) picking_obj = pooler.get_pool(cr.dbname).get('stock.picking') mod_obj = pool.get('ir.model.data') act_obj = pool.get('ir.actions.act_window') type = data['form']['type'] context['date_inv'] = data['form']['invoice_date'] res = picking_obj.action_invoice_create(cr, uid, data['ids'], journal_id = data['form']['journal_id'], group=data['form']['group'], type=type, context= context) invoice_ids = res.values() if not invoice_ids: raise wizard.except_wizard(_('Error'), _('Invoice is not created')) if type == 'out_invoice': xml_id = 'action_invoice_tree5' elif type == 'in_invoice': xml_id = 'action_invoice_tree8' elif type == 'out_refund': xml_id = 'action_invoice_tree10' else: xml_id = 'action_invoice_tree12' result = mod_obj._get_id(cr, uid, 'account', xml_id) id = mod_obj.read(cr, uid, result, ['res_id']) result = act_obj.read(cr, uid, id['res_id']) result['res_id'] = invoice_ids return result | 9465f58df63b1450858837a380ef993442a757d5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9465f58df63b1450858837a380ef993442a757d5/wizard_invoice_onshipping.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2640,
67,
16119,
12,
2603,
16,
4422,
16,
4555,
16,
501,
16,
819,
4672,
309,
501,
3292,
687,
29489,
588,
2668,
2704,
67,
11503,
310,
2187,
1083,
4672,
501,
3292,
350,
3546,
273,
50... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2640,
67,
16119,
12,
2603,
16,
4422,
16,
4555,
16,
501,
16,
819,
4672,
309,
501,
3292,
687,
29489,
588,
2668,
2704,
67,
11503,
310,
2187,
1083,
4672,
501,
3292,
350,
3546,
273,
50... |
number = int(self.number) | try: number = int(self.number) except: return | def numberTranslate(self): hundredsNumber = 0 thousandsNumber = 0 hundredsString = "" thousandsString = "" resultString = "" | bd39c9edb4b3514f308bd95b5b631eb80605db25 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/bd39c9edb4b3514f308bd95b5b631eb80605db25/catalog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1300,
12818,
12,
2890,
4672,
366,
1074,
15422,
1854,
273,
374,
286,
24810,
1854,
273,
374,
366,
1074,
15422,
780,
273,
1408,
286,
24810,
780,
273,
1408,
563,
780,
273,
1408,
2,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1300,
12818,
12,
2890,
4672,
366,
1074,
15422,
1854,
273,
374,
286,
24810,
1854,
273,
374,
366,
1074,
15422,
780,
273,
1408,
286,
24810,
780,
273,
1408,
563,
780,
273,
1408,
2,
-100,
-10... |
res_id = ir_model_data_obj.read(cr, uid, [id], ['res_id'])[0]['res_id'] | res_res_id = ir_model_data_obj.read(cr, uid, [id], ['res_id']) if res_res_id: res_id = res_res_id[0]['res_id'] | def process_liness(self, datas, prefix, fields_def, position=0): line = datas[position] row = {} translate = {} todo = [] warning = '' data_id = False # # Import normal fields # for i in range(len(fields)): if i >= len(line): raise Exception(_('Please check that all your lines have %d columns.') % (len(fields),)) field = fields[i] if field == ["id"]: data_id = line[i] continue if (len(field)==len(prefix)+1) and field[len(prefix)].endswith(':id'): res_id = False if line[i]: if fields_def[field[len(prefix)][:-3]]['type']=='many2many': res_id = [] for word in line[i].split(','): if '.' in word: module, xml_id = word.rsplit('.', 1) else: module, xml_id = current_module, word ir_model_data_obj = self.pool.get('ir.model.data') id = ir_model_data_obj._get_id(cr, uid, module, xml_id) res_id2 = ir_model_data_obj.read(cr, uid, [id], ['res_id'])[0]['res_id'] if res_id2: res_id.append(res_id2) if len(res_id): res_id = [(6, 0, res_id)] else: if '.' in line[i]: module, xml_id = line[i].rsplit('.', 1) else: module, xml_id = current_module, line[i] ir_model_data_obj = self.pool.get('ir.model.data') id = ir_model_data_obj._get_id(cr, uid, module, xml_id) res_id = ir_model_data_obj.read(cr, uid, [id], ['res_id'])[0]['res_id'] row[field[0][:-3]] = res_id or False continue if (len(field) == len(prefix)+1) and \ len(field[len(prefix)].split(':lang=')) == 2: f, lang = field[len(prefix)].split(':lang=') translate.setdefault(lang, {})[f]=line[i] or False continue if (len(field) == len(prefix)+1) and \ (prefix == field[0:len(prefix)]): if fields_def[field[len(prefix)]]['type'] == 'integer': res = line[i] and int(line[i]) elif fields_def[field[len(prefix)]]['type'] == 'boolean': res = line[i] and eval(line[i]) elif fields_def[field[len(prefix)]]['type'] == 'float': res = line[i] and float(line[i]) elif fields_def[field[len(prefix)]]['type'] == 'selection': res = False if isinstance(fields_def[field[len(prefix)]]['selection'], (tuple, list)): sel = fields_def[field[len(prefix)]]['selection'] else: sel = fields_def[field[len(prefix)]]['selection'](self, cr, uid, context) for key, val in sel: if str(key) == line[i]: res = key if line[i] and not res: logger.notifyChannel("import", netsvc.LOG_WARNING, "key '%s' not found in selection field '%s'" % \ (line[i], field[len(prefix)])) elif fields_def[field[len(prefix)]]['type']=='many2one': res = False if line[i]: relation = fields_def[field[len(prefix)]]['relation'] res2 = self.pool.get(relation).name_search(cr, uid, line[i], [], operator='=') res = (res2 and res2[0][0]) or False if not res: warning += ('Relation not found: ' + line[i] + \ ' on ' + relation + ' !\n') logger.notifyChannel("import", netsvc.LOG_WARNING, 'Relation not found: ' + line[i] + \ ' on ' + relation + ' !\n') elif fields_def[field[len(prefix)]]['type']=='many2many': res = [] if line[i]: relation = fields_def[field[len(prefix)]]['relation'] for word in line[i].split(','): res2 = self.pool.get(relation).name_search(cr, uid, word, [], operator='=') res3 = (res2 and res2[0][0]) or False if not res3: warning += ('Relation not found: ' + \ line[i] + ' on '+relation + ' !\n') logger.notifyChannel("import", netsvc.LOG_WARNING, 'Relation not found: ' + line[i] + \ ' on '+relation + ' !\n') else: res.append(res3) if len(res): res = [(6, 0, res)] else: res = line[i] or False row[field[len(prefix)]] = res elif (prefix==field[0:len(prefix)]): if field[0] not in todo: todo.append(field[len(prefix)]) # # Import one2many fields # nbrmax = 1 for field in todo: newfd = self.pool.get(fields_def[field]['relation']).fields_get( cr, uid, context=context) res = process_liness(self, datas, prefix + [field], newfd, position) (newrow, max2, w2, translate2, data_id2) = res nbrmax = max(nbrmax, max2) warning = warning + w2 reduce(lambda x, y: x and y, newrow) row[field] = (reduce(lambda x, y: x or y, newrow.values()) and \ [(0, 0, newrow)]) or [] i = max2 while (position+i)<len(datas): ok = True for j in range(len(fields)): field2 = fields[j] if (len(field2) <= (len(prefix)+1)) and datas[position+i][j]: ok = False if not ok: break | 05b73164910d9f3ac2af5f6226ae149483fe1677 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7397/05b73164910d9f3ac2af5f6226ae149483fe1677/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
80,
6336,
12,
2890,
16,
5386,
16,
1633,
16,
1466,
67,
536,
16,
1754,
33,
20,
4672,
980,
273,
5386,
63,
3276,
65,
1027,
273,
2618,
4204,
273,
2618,
10621,
273,
5378,
3436,
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,
1207,
67,
80,
6336,
12,
2890,
16,
5386,
16,
1633,
16,
1466,
67,
536,
16,
1754,
33,
20,
4672,
980,
273,
5386,
63,
3276,
65,
1027,
273,
2618,
4204,
273,
2618,
10621,
273,
5378,
3436,
2... |
fmt='[%(asctime)s %(levelname)-5.5s] %(message)s', | fmt='%(asctime)s %(levelname)-5.5s| %(message)s', | def filter(self, record): return record.levelno < self.level | f1686a27bf9efaf3f3e988bfe7732621c4f29bd3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12268/f1686a27bf9efaf3f3e988bfe7732621c4f29bd3/logging_config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1034,
12,
2890,
16,
1409,
4672,
327,
1409,
18,
2815,
2135,
411,
365,
18,
2815,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1034,
12,
2890,
16,
1409,
4672,
327,
1409,
18,
2815,
2135,
411,
365,
18,
2815,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
return pretty | return pretty.strip() | def compile(node, enableDebug=False): global indent global pretty indent = 0 pretty = "" compileNode(node, enableDebug) return pretty | 9899d5c45563dd4f9057d173402244e0cf855c51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5718/9899d5c45563dd4f9057d173402244e0cf855c51/prettyprint.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4074,
12,
2159,
16,
4237,
2829,
33,
8381,
4672,
225,
2552,
3504,
2552,
7517,
225,
3504,
273,
374,
7517,
273,
1408,
225,
4074,
907,
12,
2159,
16,
4237,
2829,
13,
225,
327,
7517,
18,
640... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4074,
12,
2159,
16,
4237,
2829,
33,
8381,
4672,
225,
2552,
3504,
2552,
7517,
225,
3504,
273,
374,
7517,
273,
1408,
225,
4074,
907,
12,
2159,
16,
4237,
2829,
13,
225,
327,
7517,
18,
640... |
try: logSys.debug("Creating PID file %s" % Server.PID_FILE) pidFile = open(Server.PID_FILE, 'w') pidFile.write("%s\n" % os.getpid()) pidFile.close() except IOError, e: logSys.error("Unable to create PID file: %s" % e) | def start(self, sock, force = False): logSys.info("Starting Fail2ban v" + version.version) # Creates a PID file. try: logSys.debug("Creating PID file %s" % Server.PID_FILE) pidFile = open(Server.PID_FILE, 'w') pidFile.write("%s\n" % os.getpid()) pidFile.close() except IOError, e: logSys.error("Unable to create PID file: %s" % e) # Install signal handlers signal.signal(signal.SIGTERM, self.__sigTERMhandler) signal.signal(signal.SIGINT, self.__sigTERMhandler) # First set the mask to only allow access to owner os.umask(0077) if self.__daemon: ret = self.__createDaemon() if ret: logSys.info("Daemon started") else: logSys.error("Could not create daemon") raise ServerInitializationError("Could not create daemon") # Start the communication logSys.debug("Starting communication") try: self.__asyncServer.start(sock, force) except AsyncServerException, e: logSys.error("Could not start server: %s", e) # Removes the PID file. try: logSys.debug("Remove PID file %s" % Server.PID_FILE) os.remove(Server.PID_FILE) except OSError, e: logSys.error("Unable to remove PID file: %s" % e) logSys.info("Exiting Fail2ban") | b174a2e8585678b8bb1d4dd7a0a678fce1f93fcf /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12171/b174a2e8585678b8bb1d4dd7a0a678fce1f93fcf/server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
16,
7313,
16,
2944,
273,
1083,
4672,
613,
12712,
18,
1376,
2932,
11715,
8911,
22,
21515,
331,
6,
397,
1177,
18,
1589,
13,
225,
468,
10210,
279,
14788,
585,
18,
7,
10284,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
16,
7313,
16,
2944,
273,
1083,
4672,
613,
12712,
18,
1376,
2932,
11715,
8911,
22,
21515,
331,
6,
397,
1177,
18,
1589,
13,
225,
468,
10210,
279,
14788,
585,
18,
7,
10284,... | |
value = value % d | value = value % vars | def get(self, section, option, raw=0, vars=None): """Get an option value for a given section. | c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
16,
2442,
16,
1456,
16,
1831,
33,
20,
16,
4153,
33,
7036,
4672,
3536,
967,
392,
1456,
460,
364,
279,
864,
2442,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
16,
2442,
16,
1456,
16,
1831,
33,
20,
16,
4153,
33,
7036,
4672,
3536,
967,
392,
1456,
460,
364,
279,
864,
2442,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.write(*msg) | self.write_err(*msg) | def warn(self, *msg): self.write(*msg) | d9875a2d1cec2daeeb3d3e58cec2da993ac42f10 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/d9875a2d1cec2daeeb3d3e58cec2da993ac42f10/ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1894,
12,
2890,
16,
380,
3576,
4672,
365,
18,
2626,
30857,
3576,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1894,
12,
2890,
16,
380,
3576,
4672,
365,
18,
2626,
30857,
3576,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.__axes_range[name] = float(l[name]) | axes_range[name] = float(l[name]) | def axes_range(self, xmin=None, xmax=None, ymin=None, ymax=None): """ Set the ranges of the $x$ and $y$ axes. | cb8ef50c324b324938121dd17f148aed10daf69f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/cb8ef50c324b324938121dd17f148aed10daf69f/plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6515,
67,
3676,
12,
2890,
16,
13777,
33,
7036,
16,
14016,
33,
7036,
16,
15763,
33,
7036,
16,
15275,
33,
7036,
4672,
3536,
1000,
326,
7322,
434,
326,
271,
92,
8,
471,
271,
93,
8,
6515... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6515,
67,
3676,
12,
2890,
16,
13777,
33,
7036,
16,
14016,
33,
7036,
16,
15763,
33,
7036,
16,
15275,
33,
7036,
4672,
3536,
1000,
326,
7322,
434,
326,
271,
92,
8,
471,
271,
93,
8,
6515... |
print "." | def score_alignment( scoring_scheme, a ): score = 0 ncomps = len( a.components ) for i in range( ncomps ): for j in range( i+1, ncomps ): score += score_texts( scoring_scheme, a.components[i].text, a.components[j].text ) print "." return score | 8dd8fe0c6ccc530df5bf18928af25fded457995f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2104/8dd8fe0c6ccc530df5bf18928af25fded457995f/score.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4462,
67,
14409,
12,
22958,
67,
9068,
16,
279,
262,
30,
4462,
273,
374,
290,
31532,
273,
562,
12,
279,
18,
8119,
262,
364,
277,
316,
1048,
12,
290,
31532,
262,
30,
364,
525,
316,
104... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4462,
67,
14409,
12,
22958,
67,
9068,
16,
279,
262,
30,
4462,
273,
374,
290,
31532,
273,
562,
12,
279,
18,
8119,
262,
364,
277,
316,
1048,
12,
290,
31532,
262,
30,
364,
525,
316,
104... | |
style = wx.NO_BORDER | wx.TE_PROCESS_ENTER | wx.TE_NO_VSCROLL | style = wx.NO_BORDER | wx.TE_NO_VSCROLL | def __init__(self, parent, defocusCallback=None, *arguments, **keywords): # Windows and Mac add an extra vertical scrollbar for TE_MULTILINE, # GTK doesn't. Further, if GTK is not multiline, then the single # line mode looks really wonky with a huge cursor. # # The undocumented flag TE_NO_VSCROLL solves these problems but # introduces another: text does not scroll at all on Mac and MSW. On # MSW, not only does the text not scroll, but you can't enter text # beyond the size of the editor if TE_NO_VSCROLL and TE_MULTILINE are # both set, so on Windows we stick with the a single line for now style = wx.NO_BORDER | wx.TE_PROCESS_ENTER | wx.TE_NO_VSCROLL if '__WXMSW__' not in wx.PlatformInfo: style |= wx.TE_MULTILINE | 2a95c352a896b027d6742a8f59ef15bc21a75304 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/2a95c352a896b027d6742a8f59ef15bc21a75304/CalendarCanvas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
1652,
4560,
2428,
33,
7036,
16,
380,
7099,
16,
2826,
11771,
4672,
225,
468,
8202,
471,
13217,
527,
392,
2870,
9768,
27123,
364,
25156,
67,
12845,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
1652,
4560,
2428,
33,
7036,
16,
380,
7099,
16,
2826,
11771,
4672,
225,
468,
8202,
471,
13217,
527,
392,
2870,
9768,
27123,
364,
25156,
67,
12845,
... |
surface.write_to_png(outfile) surface.finish() elif format == 'svg': surface = cairo.SVGSurface(outfile, paperwidth + frame_width*2, paperheight + frame_width*2) enclose_in_frame(lambda ctx: generator.render(ctx, paperwidth, paperheight), paperwidth, paperheight, title, surface, paperwidth + frame_width*2, paperheight + frame_width*2, frame_width) surface.finish() elif format == 'pdf': surface = cairo.PDFSurface(outfile, paperwidth + frame_width*2, paperheight + frame_width*2) enclose_in_frame(lambda ctx: generator.render(ctx, paperwidth, paperheight), paperwidth, paperheight, title, surface, paperwidth + frame_width*2, paperheight + frame_width*2, frame_width) surface.finish() elif format == 'ps': surface = cairo.PSSurface(outfile, paperwidth + frame_width*2, paperheight + frame_width*2) enclose_in_frame(lambda ctx: generator.render(ctx, paperwidth, paperheight), paperwidth, paperheight, title, surface, paperwidth + frame_width*2, paperheight + frame_width*2, frame_width) surface.finish() | def _render_one_prefix(self, title, output_prefix, format, paperwidth, paperheight): format = format.lower() frame_width = int(max(paperheight / 20., 30)) | 8b09151b1833450debb3177e948c23c1751f0dbe /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9326/8b09151b1833450debb3177e948c23c1751f0dbe/street_index.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5902,
67,
476,
67,
3239,
12,
2890,
16,
2077,
16,
876,
67,
3239,
16,
740,
16,
15181,
2819,
16,
15181,
4210,
4672,
740,
1377,
273,
740,
18,
8167,
1435,
2623,
67,
2819,
273,
509,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
389,
5902,
67,
476,
67,
3239,
12,
2890,
16,
2077,
16,
876,
67,
3239,
16,
740,
16,
15181,
2819,
16,
15181,
4210,
4672,
740,
1377,
273,
740,
18,
8167,
1435,
2623,
67,
2819,
273,
509,
1... | |
self | self, and possibly an embedding of self into $K$. | def galois_closure(self, names=None): """ Return number field $K$ that is the Galois closure of self, i.e., is generated by all roots of the defining polynomial of self | dc1f0628b1468cca54e10437450cf87a2f2ede95 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/dc1f0628b1468cca54e10437450cf87a2f2ede95/number_field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24902,
19606,
67,
20823,
12,
2890,
16,
1257,
33,
7036,
4672,
3536,
2000,
1300,
652,
271,
47,
8,
716,
353,
326,
611,
287,
19606,
7213,
434,
365,
16,
277,
18,
73,
12990,
353,
4374,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24902,
19606,
67,
20823,
12,
2890,
16,
1257,
33,
7036,
4672,
3536,
2000,
1300,
652,
271,
47,
8,
716,
353,
326,
611,
287,
19606,
7213,
434,
365,
16,
277,
18,
73,
12990,
353,
4374,
635,
... |
elif o + ':' in optmap: | elif optmap.has_key(o + ':'): | def command_line(self, argv, help_fn=None): import getopt help_fn = help_fn or self.help settings = {} optmap = { '-a': 'annotate', '-c': 'collect', '-d:': 'directory=', '-e': 'erase', '-h': 'help', '-i': 'ignore-errors', '-m': 'show-missing', '-p': 'parallel-mode', '-r': 'report', '-x': 'execute', '-o:': 'omit=', } short_opts = string.join(map(lambda o: o[1:], optmap.keys()), '') long_opts = optmap.values() options, args = getopt.getopt(argv, short_opts, long_opts) for o, a in options: if o in optmap: settings[optmap[o]] = 1 elif o + ':' in optmap: settings[optmap[o + ':']] = a elif o[2:] in long_opts: settings[o[2:]] = 1 elif o[2:] + '=' in long_opts: settings[o[2:]+'='] = a else: #pragma: no cover pass # Can't get here, because getopt won't return anything unknown. | 6554c74cd9574cf89b8acd0a0333651afacbfa8e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11312/6554c74cd9574cf89b8acd0a0333651afacbfa8e/coverage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1296,
67,
1369,
12,
2890,
16,
5261,
16,
2809,
67,
4293,
33,
7036,
4672,
1930,
336,
3838,
2809,
67,
4293,
273,
2809,
67,
4293,
578,
365,
18,
5201,
1947,
273,
2618,
2153,
1458,
273,
288,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1296,
67,
1369,
12,
2890,
16,
5261,
16,
2809,
67,
4293,
33,
7036,
4672,
1930,
336,
3838,
2809,
67,
4293,
273,
2809,
67,
4293,
578,
365,
18,
5201,
1947,
273,
2618,
2153,
1458,
273,
288,... |
return networkx.cliques.node_clique_number(self._nxg, nodes, with_labels, cliques) def cliques_number_of(self, nodes=None, cliques=None, with_labels=False): | return networkx.cliques.node_clique_number(self._nxg, vertices, with_labels, cliques) def cliques_number_of(self, vertices=None, cliques=None, with_labels=False): | def cliques_node_clique_number(self, nodes=None, with_labels=False, cliques=None): r""" Returns a list of sizes of the largest maximal cliques containing each node. (Returns a single value if only one input node). Currently only implemented for undirected graphs. Use to_undirected to convert a digraph to an undirected graph. (See examples below). INPUT: -- nodes - the nodes to inspect (default is entire graph) -- with_labels - (boolean) default False returns list as above True returns a dictionary keyed by node labels -- cliques - list of cliques (if already computed) EXAMPLES: sage: C = Graph('DJ{') sage: C.cliques_node_clique_number() [2, 4, 4, 4, 4] sage: E = C.cliques() sage: E [[4, 1, 2, 3], [4, 0]] sage: C.cliques_node_clique_number(cliques=E) [2, 4, 4, 4, 4] sage: F = graphs.Grid2dGraph(2,3) sage: F.cliques_node_clique_number(with_labels=True) {(0, 1): 2, (1, 2): 2, (0, 0): 2, (1, 1): 2, (1, 0): 2, (0, 2): 2} sage: F.cliques_node_clique_number(nodes=[(0, 1), (1, 2)]) [2, 2] sage: D = DiGraph({0:[1,2,3], 1:[2], 3:[0,1]}) sage.: D.show(figsize=[2,2]) sage: D.cliques_node_clique_number() Traceback (most recent call last): ... TypeError: Function defined for undirected graphs only. See documentation. sage: D = D.to_undirected() sage.: D.show(figsize=[2,2]) sage: D.cliques_node_clique_number() [3, 3, 3, 3] """ if (self.is_directed()): raise TypeError('Function defined for undirected graphs only. See documentation.') else: import networkx.cliques return networkx.cliques.node_clique_number(self._nxg, nodes, with_labels, cliques) | 7d819cbf1df622e9f76b4801233dbb334f44d362 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/7d819cbf1df622e9f76b4801233dbb334f44d362/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4942,
29896,
67,
2159,
67,
4857,
1857,
67,
2696,
12,
2890,
16,
2199,
33,
7036,
16,
598,
67,
5336,
33,
8381,
16,
4942,
29896,
33,
7036,
4672,
436,
8395,
2860,
279,
666,
434,
8453,
434,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4942,
29896,
67,
2159,
67,
4857,
1857,
67,
2696,
12,
2890,
16,
2199,
33,
7036,
16,
598,
67,
5336,
33,
8381,
16,
4942,
29896,
33,
7036,
4672,
436,
8395,
2860,
279,
666,
434,
8453,
434,
... |
self._timings = self.__default_timing.copy() | TimeConfig._timings = TimeConfig.__default_timing.copy() | def Defaults(self): "Set all timings to the default time" self._timings = self.__default_timing.copy() | cdf857784836048d1db60b6385971db4e4b6dacd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6953/cdf857784836048d1db60b6385971db4e4b6dacd/timings.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14159,
12,
2890,
4672,
315,
694,
777,
1658,
899,
358,
326,
805,
813,
6,
365,
6315,
8584,
899,
273,
365,
16186,
1886,
67,
8584,
310,
18,
3530,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14159,
12,
2890,
4672,
315,
694,
777,
1658,
899,
358,
326,
805,
813,
6,
365,
6315,
8584,
899,
273,
365,
16186,
1886,
67,
8584,
310,
18,
3530,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-10... |
def __resolveFileID(self,fileID): port = str(self.serviceInfoDict['Port']) loc = fileID.find(port) | def __resolveFileID( self, fileID ): port = str( self.serviceInfoDict['Port'] ) loc = fileID.find( port ) | def __resolveFileID(self,fileID): port = str(self.serviceInfoDict['Port']) loc = fileID.find(port) if loc >= 0: fileID = fileID[loc+len(port):] serviceName = self.serviceInfoDict['serviceName'] loc = fileID.find(serviceName) if loc >= 0: fileID = fileID[loc+len(serviceName):] loc = fileID.find('?=') if loc >= 0: fileID = fileID[loc+2:] while fileID[0] == '/': fileID = fileID[1:] return os.path.join( base_path, fileID ) | 9f0650a3e23eb441883664794fa6606e35b7f93c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/9f0650a3e23eb441883664794fa6606e35b7f93c/StorageElementHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
10828,
812,
734,
12,
365,
16,
585,
734,
262,
30,
1756,
273,
609,
12,
365,
18,
3278,
966,
5014,
3292,
2617,
3546,
262,
1515,
273,
585,
734,
18,
4720,
12,
1756,
262,
309,
1515,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10828,
812,
734,
12,
365,
16,
585,
734,
262,
30,
1756,
273,
609,
12,
365,
18,
3278,
966,
5014,
3292,
2617,
3546,
262,
1515,
273,
585,
734,
18,
4720,
12,
1756,
262,
309,
1515,
1... |
return -1 | raise SMTPDataError(code,repl) | def data(self,msg): """SMTP 'DATA' command -- sends message data to server. Automatically quotes lines beginning with a period per rfc821. """ self.putcmd("data") (code,repl)=self.getreply() if self.debuglevel >0 : print "data:", (code,repl) if code <> 354: return -1 else: self.send(quotedata(msg)) self.send("%s.%s" % (CRLF, CRLF)) (code,msg)=self.getreply() if self.debuglevel >0 : print "data:", (code,msg) return code | 7ce512fd70a64eb7cf9563bb31dd4291a44254dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/7ce512fd70a64eb7cf9563bb31dd4291a44254dd/smtplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
501,
12,
2890,
16,
3576,
4672,
3536,
55,
14636,
296,
4883,
11,
1296,
1493,
9573,
883,
501,
358,
1438,
18,
11809,
20271,
10681,
2362,
8435,
598,
279,
3879,
1534,
16590,
28,
5340,
18,
3536... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
501,
12,
2890,
16,
3576,
4672,
3536,
55,
14636,
296,
4883,
11,
1296,
1493,
9573,
883,
501,
358,
1438,
18,
11809,
20271,
10681,
2362,
8435,
598,
279,
3879,
1534,
16590,
28,
5340,
18,
3536... |
self.status_string = _("Activated for ")+self._timeDisplay(time) self.emit("activation-toggled", self.getActivated(), | if self.status_string == "": self.status_string = _("Activated for ")+self._timeDisplay(time) self.emit("activation-toggled", self.getActivated(), | def timedActivation(self, time, note=True): """Calls toggleActivated after the number of seconds specified by time has passed. """ message = (_("Timed activation set; ")+ _("Caffeine will prevent powersaving for the next ") + self._timeDisplay(time)) logging.info("Timed activation set for " + self._timeDisplay(time)) | 20e13bcc824bd4fbac04a2ef7c172843354bf8a9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7152/20e13bcc824bd4fbac04a2ef7c172843354bf8a9/core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7491,
14857,
12,
2890,
16,
813,
16,
4721,
33,
5510,
4672,
3536,
10125,
10486,
28724,
1839,
326,
1300,
434,
3974,
1269,
635,
813,
711,
2275,
18,
3536,
883,
273,
261,
67,
2932,
19336,
1002... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7491,
14857,
12,
2890,
16,
813,
16,
4721,
33,
5510,
4672,
3536,
10125,
10486,
28724,
1839,
326,
1300,
434,
3974,
1269,
635,
813,
711,
2275,
18,
3536,
883,
273,
261,
67,
2932,
19336,
1002... |
nnz = sum(ravel(s != 0.0)) | nnz = (s != 0.0).sum() | def __init__(self, arg1, dims=None, nzmax=100, dtype=None, copy=False): spmatrix.__init__(self) if isdense(arg1): self.dtype = getdtype(dtype, arg1) # Convert the dense array or matrix arg1 to CSC format if rank(arg1) == 1: # Convert to a row vector arg1 = arg1.reshape(1, arg1.shape[0]) if rank(arg1) == 2: #s = asarray(arg1) s = arg1 if s.dtype.char not in 'fdFD': # Use a double array as the source (but leave it alone) s = s*1.0 if (rank(s) == 2): M, N = s.shape dtype = s.dtype func = getattr(sparsetools, _transtabl[dtype.char]+'fulltocsc') ierr = irow = jcol = 0 nnz = sum(ravel(s != 0.0)) a = zeros((nnz,), self.dtype) rowa = zeros((nnz,), intc) ptra = zeros((N+1,), intc) while 1: a, rowa, ptra, irow, jcol, ierr = \ func(s, a, rowa, ptra, irow, jcol, ierr) if (ierr == 0): break nnz = nnz + ALLOCSIZE a = resize1d(a, nnz) rowa = resize1d(rowa, nnz) self.data = a self.rowind = rowa self.indptr = ptra self.shape = (M, N) else: raise ValueError, "dense array must have rank 1 or 2" elif isspmatrix(arg1): s = arg1 self.dtype = getdtype(dtype, s) if isinstance(s, csc_matrix): # do nothing but copy information self.shape = s.shape if copy: self.data = s.data.copy() self.rowind = s.rowind.copy() self.indptr = s.indptr.copy() else: self.data = s.data self.rowind = s.rowind self.indptr = s.indptr elif isinstance(s, csr_matrix): self.shape = s.shape func = getattr(sparsetools, s.ftype+'transp') self.data, self.rowind, self.indptr = \ func(s.shape[1], s.data, s.colind, s.indptr) else: temp = s.tocsc() self.data = temp.data self.rowind = temp.rowind self.indptr = temp.indptr self.shape = temp.shape elif type(arg1) == tuple: if isshape(arg1): self.dtype = getdtype(dtype, default=float) # It's a tuple of matrix dimensions (M, N) M, N = arg1 self.data = zeros((nzmax,), self.dtype) self.rowind = zeros((nzmax,), intc) self.indptr = zeros((N+1,), intc) self.shape = (M, N) else: try: # Try interpreting it as (data, ij) (s, ij) = arg1 assert isinstance(ij, ArrayType) and (rank(ij) == 2) and (shape(ij) == (len(s), 2)) except (AssertionError, TypeError, ValueError): try: # Try interpreting it as (data, rowind, indptr) (s, rowind, indptr) = arg1 self.dtype = getdtype(dtype, s) if copy: self.data = array(s) self.rowind = array(rowind) self.indptr = array(indptr) else: self.data = asarray(s) self.rowind = asarray(rowind) self.indptr = asarray(indptr) except: raise ValueError, "unrecognized form for csc_matrix constructor" else: # (data, ij) format self.dtype = getdtype(dtype, s) temp = coo_matrix((s, ij), dims=dims, dtype=dtype).tocsc() self.shape = temp.shape self.data = temp.data self.rowind = temp.rowind self.indptr = temp.indptr else: raise ValueError, "unrecognized form for csc_matrix constructor" | 468f8a0f15a095ee7fdb71e85da826492ec51f0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/468f8a0f15a095ee7fdb71e85da826492ec51f0c/sparse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1501,
21,
16,
9914,
33,
7036,
16,
15062,
1896,
33,
6625,
16,
3182,
33,
7036,
16,
1610,
33,
8381,
4672,
1694,
5667,
16186,
2738,
972,
12,
2890,
13,
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,
1001,
2738,
972,
12,
2890,
16,
1501,
21,
16,
9914,
33,
7036,
16,
15062,
1896,
33,
6625,
16,
3182,
33,
7036,
16,
1610,
33,
8381,
4672,
1694,
5667,
16186,
2738,
972,
12,
2890,
13,
309,
... |
security.check_super(password) | def exp_restore(self, db_name, data): security.check_super(password) logger = netsvc.Logger() | b64ee551baceda535d1315912c2187a5149dc36d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/b64ee551baceda535d1315912c2187a5149dc36d/web_services.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1329,
67,
13991,
12,
2890,
16,
1319,
67,
529,
16,
501,
4672,
1194,
273,
21954,
4227,
18,
3328,
1435,
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,
1329,
67,
13991,
12,
2890,
16,
1319,
67,
529,
16,
501,
4672,
1194,
273,
21954,
4227,
18,
3328,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
status, major, minor = out[:3] | status, major, minor, pe_size, stripes = out | def Attach(self): """Attach to an existing LV. | 38256320e6ea5afafa750302d43c90e7f0a852fe /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7542/38256320e6ea5afafa750302d43c90e7f0a852fe/bdev.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8659,
12,
2890,
4672,
3536,
4761,
358,
392,
2062,
29268,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8659,
12,
2890,
4672,
3536,
4761,
358,
392,
2062,
29268,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
imageinfo=Label(self.root, text=self.nP.titleWithoutNamespace()+' uploaded by '+uploader+'.') | imageinfo=Label(self.root, text='Uploaded by '+uploader+'.') | def __init__(self, nP, contenido, uploader, commonsconflict=0): self.root=Tk() #"%dx%d%+d%+d" % (width, height, xoffset, yoffset) #Always appear the same size and in the bottom-left corner self.root.geometry("600x200+100-100") self.nP=wikipedia.Page(six[1], 'Image:'+nP) self.root.title(self.nP.titleWithoutNamespace()) self.changename='' self.skip=0 uploader=uploader.decode('utf-8') scrollbar=Scrollbar(self.root, orient=VERTICAL) etiqueta=Label(self.root,text=u"Enter new name or leave blank.") imageinfo=Label(self.root, text=self.nP.titleWithoutNamespace()+' uploaded by '+uploader+'.') texto=Text(self.root) texto.insert(END, contenido.decode('utf-8')) texto.config(state=DISABLED, height=8, width=40, padx=0, pady=0, wrap=WORD, yscrollcommand=scrollbar.set) scrollbar.config(command=texto.yview) self.entrada=Entry(self.root) self.listado=Listbox(self.root, bg="white", height=5) self.plantillas=[] for chuleta in contenido.split('{{')[1:]: trytosplit=re.split(ur'(?:\}\}|\|)', chuleta) if trytosplit !=[]: plantilla=trytosplit[0] for char in ['}', ']', '{', '[']: if char in plantilla: plantilla='' if plantilla.lower()=='information': plantilla='' if plantilla !='': self.plantillas.append(plantilla) for plantilla in self.plantillas: self.listado.insert(END, plantilla) addB=Button(self.root, text="Add to AutoSkip", command=self.add2autoskip) browser=Button(self.root, text='View in browser', command=self.oib) saltar=Button(self.root, text="Skip", command=self.skipF) ok=Button(self.root, text="OK", command=self.okF) | 3544c7266aabc57fb0ad9f13cc0f9f47b922333d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/3544c7266aabc57fb0ad9f13cc0f9f47b922333d/imagecopy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
290,
52,
16,
466,
275,
22954,
16,
25062,
16,
24021,
20340,
33,
20,
4672,
365,
18,
3085,
33,
56,
79,
1435,
468,
28385,
13437,
9,
72,
9,
15,
72,
9,
15,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
290,
52,
16,
466,
275,
22954,
16,
25062,
16,
24021,
20340,
33,
20,
4672,
365,
18,
3085,
33,
56,
79,
1435,
468,
28385,
13437,
9,
72,
9,
15,
72,
9,
15,... |
self.read(name) def guess_type(self, url, strict=1): | self.read(name, strict) def add_type(self, type, ext, strict=True): """Add a mapping between a type and and extension. When the extension is already known, the new type will replace the old one. When the type is already known the extension will be added to the list of known extensions. If strict is true, information will be added to list of standard types, else to the list of non-standard types. """ self.types_map[strict][ext] = type exts = self.types_map_inv[strict].setdefault(type, []) if ext not in exts: exts.append(ext) def guess_type(self, url, strict=True): | def __init__(self, filenames=()): if not inited: init() self.encodings_map = encodings_map.copy() self.suffix_map = suffix_map.copy() self.types_map = types_map.copy() self.common_types = common_types.copy() for name in filenames: self.read(name) | 00f4afff414f17f11401025d4fd9f2f9f25f525b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/00f4afff414f17f11401025d4fd9f2f9f25f525b/mimetypes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
9066,
33,
1435,
4672,
309,
486,
1208,
329,
30,
1208,
1435,
365,
18,
1331,
369,
899,
67,
1458,
273,
24118,
67,
1458,
18,
3530,
1435,
365,
18,
8477,
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,
9066,
33,
1435,
4672,
309,
486,
1208,
329,
30,
1208,
1435,
365,
18,
1331,
369,
899,
67,
1458,
273,
24118,
67,
1458,
18,
3530,
1435,
365,
18,
8477,
67,
... |
state = LogFile.__getstate__(self) | state = BaseLogFile.__getstate__(self) | def __getstate__(self): state = LogFile.__getstate__(self) del state["size"] return state | 051d913db16cc13ba2712353038a7ab107b37d9a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/051d913db16cc13ba2712353038a7ab107b37d9a/logfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
2019,
972,
12,
2890,
4672,
919,
273,
3360,
19103,
16186,
588,
2019,
972,
12,
2890,
13,
1464,
919,
9614,
1467,
11929,
327,
919,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
2019,
972,
12,
2890,
4672,
919,
273,
3360,
19103,
16186,
588,
2019,
972,
12,
2890,
13,
1464,
919,
9614,
1467,
11929,
327,
919,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
"H62": atom_info("H", 0, "H'"), | "H62": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") | 46b20303e8ed53745807da84c39cb29f25aa3911 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/696/46b20303e8ed53745807da84c39cb29f25aa3911/residue_info.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1311,
12,
2890,
4672,
327,
7566,
2956,
67,
7175,
3113,
315,
285,
335,
67,
2019,
3113,
315,
31320,
310,
67,
1925,
7923,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1311,
12,
2890,
4672,
327,
7566,
2956,
67,
7175,
3113,
315,
285,
335,
67,
2019,
3113,
315,
31320,
310,
67,
1925,
7923,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
randomize = 1 | randomize = True | def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0, exclude=0, single=0, randomize=0, fromfile=None, findleaks=0, use_resources=None): """Execute a test suite. This also parses command-line options and modifies its behavior accordingly. tests -- a list of strings containing test names (optional) testdir -- the directory in which to look for tests (optional) Users other than the Python test suite will certainly want to specify testdir; if it's omitted, the directory containing the Python test suite is searched for. If the tests argument is omitted, the tests listed on the command-line will be used. If that's empty, too, then all *.py files beginning with test_ will be used. The other default arguments (verbose, quiet, generate, exclude, single, randomize, findleaks, and use_resources) allow programmers calling main() directly to set the values that would normally be set by flags on the command line. """ test_support.record_original_stdout(sys.stdout) try: opts, args = getopt.getopt(sys.argv[1:], 'hvgqxsrf:lu:t:', ['help', 'verbose', 'quiet', 'generate', 'exclude', 'single', 'random', 'fromfile', 'findleaks', 'use=', 'threshold=']) except getopt.error, msg: usage(2, msg) # Defaults if use_resources is None: use_resources = [] for o, a in opts: if o in ('-h', '--help'): usage(0) elif o in ('-v', '--verbose'): verbose += 1 elif o in ('-q', '--quiet'): quiet = 1; verbose = 0 elif o in ('-g', '--generate'): generate = 1 elif o in ('-x', '--exclude'): exclude = 1 elif o in ('-s', '--single'): single = 1 elif o in ('-r', '--randomize'): randomize = 1 elif o in ('-f', '--fromfile'): fromfile = a elif o in ('-l', '--findleaks'): findleaks = 1 elif o in ('-t', '--threshold'): import gc gc.set_threshold(int(a)) elif o in ('-u', '--use'): u = [x.lower() for x in a.split(',')] for r in u: if r == 'all': use_resources[:] = RESOURCE_NAMES continue remove = False if r[0] == '-': remove = True r = r[1:] if r not in RESOURCE_NAMES: usage(1, 'Invalid -u/--use option: ' + a) if remove: if r in use_resources: use_resources.remove(r) elif r not in use_resources: use_resources.append(r) if generate and verbose: usage(2, "-g and -v don't go together!") if single and fromfile: usage(2, "-s and -f don't go together!") good = [] bad = [] skipped = [] resource_denieds = [] if findleaks: try: import gc except ImportError: print 'No GC available, disabling findleaks.' findleaks = 0 else: # Uncomment the line below to report garbage that is not # freeable by reference counting alone. By default only # garbage that is not collectable by the GC is reported. #gc.set_debug(gc.DEBUG_SAVEALL) found_garbage = [] if single: from tempfile import gettempdir filename = os.path.join(gettempdir(), 'pynexttest') try: fp = open(filename, 'r') next = fp.read().strip() tests = [next] fp.close() except IOError: pass if fromfile: tests = [] fp = open(fromfile) for line in fp: guts = line.split() # assuming no test has whitespace in its name if guts and not guts[0].startswith('#'): tests.extend(guts) fp.close() # Strip .py extensions. if args: args = map(removepy, args) if tests: tests = map(removepy, tests) stdtests = STDTESTS[:] nottests = NOTTESTS[:] if exclude: for arg in args: if arg in stdtests: stdtests.remove(arg) nottests[:0] = args args = [] tests = tests or args or findtests(testdir, stdtests, nottests) if single: tests = tests[:1] if randomize: random.shuffle(tests) test_support.verbose = verbose # Tell tests to be moderately quiet test_support.use_resources = use_resources save_modules = sys.modules.keys() for test in tests: if not quiet: print test sys.stdout.flush() ok = runtest(test, generate, verbose, quiet, testdir) if ok > 0: good.append(test) elif ok == 0: bad.append(test) else: skipped.append(test) if ok == -2: resource_denieds.append(test) if findleaks: gc.collect() if gc.garbage: print "Warning: test created", len(gc.garbage), print "uncollectable object(s)." # move the uncollectable objects somewhere so we don't see # them again found_garbage.extend(gc.garbage) del gc.garbage[:] # Unload the newly imported modules (best effort finalization) for module in sys.modules.keys(): if module not in save_modules and module.startswith("test."): test_support.unload(module) # The lists won't be sorted if running with -r good.sort() bad.sort() skipped.sort() if good and not quiet: if not bad and not skipped and len(good) > 1: print "All", print count(len(good), "test"), "OK." if verbose: print "CAUTION: stdout isn't compared in verbose mode:" print "a test that passes in verbose mode may fail without it." if bad: print count(len(bad), "test"), "failed:" printlist(bad) if skipped and not quiet: print count(len(skipped), "test"), "skipped:" printlist(skipped) e = _ExpectedSkips() plat = sys.platform if e.isvalid(): surprise = set(skipped) - e.getexpected() - set(resource_denieds) if surprise: print count(len(surprise), "skip"), \ "unexpected on", plat + ":" printlist(surprise) else: print "Those skips are all expected on", plat + "." else: print "Ask someone to teach regrtest.py about which tests are" print "expected to get skipped on", plat + "." if single: alltests = findtests(testdir, stdtests, nottests) for i in range(len(alltests)): if tests[0] == alltests[i]: if i == len(alltests) - 1: os.unlink(filename) else: fp = open(filename, 'w') fp.write(alltests[i+1] + '\n') fp.close() break else: os.unlink(filename) sys.exit(len(bad) > 0) | 3feaba6409bd3f4dce920f7a4f22e9e9361f6c5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3feaba6409bd3f4dce920f7a4f22e9e9361f6c5f/regrtest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
16341,
33,
7036,
16,
1842,
1214,
33,
7036,
16,
3988,
33,
20,
16,
10902,
33,
20,
16,
2103,
33,
20,
16,
4433,
33,
20,
16,
2202,
33,
20,
16,
2744,
554,
33,
20,
16,
628,
76... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
16341,
33,
7036,
16,
1842,
1214,
33,
7036,
16,
3988,
33,
20,
16,
10902,
33,
20,
16,
2103,
33,
20,
16,
4433,
33,
20,
16,
2202,
33,
20,
16,
2744,
554,
33,
20,
16,
628,
76... |
core_state["history_position"] = min(0, max(len(core_state["history"]) - 1, old_pos + step)) | core_state["history_position"] = max(0, min(len(core_state["history"]) - 1, old_pos + step)) | def historyMove (core_state, step): """ Loads pages from forward (positive step) or backward (negative step) history and returns real number of steps if move was successful, 0 otherwise """ old_pos = core_state["history_position"] core_state["history_position"] = min(0, max(len(core_state["history"]) - 1, old_pos + step)) if core_state["history_position"] != old_pos and core_state["history_position"] >= 0: return core_state["history_position"] - old_pos else: return 0 | 2b470d8148ac64c0d7d1dabb01428b5dcb7f40fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2254/2b470d8148ac64c0d7d1dabb01428b5dcb7f40fb/hylt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4927,
7607,
261,
3644,
67,
2019,
16,
2235,
4672,
3536,
4444,
87,
4689,
628,
5104,
261,
21094,
2235,
13,
578,
12555,
261,
13258,
2235,
13,
4927,
471,
1135,
2863,
1300,
434,
6075,
309,
363... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4927,
7607,
261,
3644,
67,
2019,
16,
2235,
4672,
3536,
4444,
87,
4689,
628,
5104,
261,
21094,
2235,
13,
578,
12555,
261,
13258,
2235,
13,
4927,
471,
1135,
2863,
1300,
434,
6075,
309,
363... |
if urwid_old: | if urwid_ver < '0.9.8': | def cols(self, maxcol): l = len(self.get_text()[0]) r = len(self.info.get_text()[0]) lr = l + r mc = maxcol - 2 if lr <= mc: return l, r return l * mc // lr, r * mc // lr | 9d0fe6c8e939bacf85e4353fe8017a3af8da7803 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9327/9d0fe6c8e939bacf85e4353fe8017a3af8da7803/urwid_ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5347,
12,
2890,
16,
943,
1293,
4672,
328,
273,
562,
12,
2890,
18,
588,
67,
955,
1435,
63,
20,
5717,
436,
273,
562,
12,
2890,
18,
1376,
18,
588,
67,
955,
1435,
63,
20,
5717,
12226,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5347,
12,
2890,
16,
943,
1293,
4672,
328,
273,
562,
12,
2890,
18,
588,
67,
955,
1435,
63,
20,
5717,
436,
273,
562,
12,
2890,
18,
1376,
18,
588,
67,
955,
1435,
63,
20,
5717,
12226,
... |
keywords = {'package': None} | def do(self, macros): """ Do the build action | 804ac2ca2b1405e113b66aef503b713145494905 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/804ac2ca2b1405e113b66aef503b713145494905/build.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
12,
2890,
16,
24302,
4672,
3536,
2256,
326,
1361,
1301,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
12,
2890,
16,
24302,
4672,
3536,
2256,
326,
1361,
1301,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
1 + x/2 - (x^2/8) + x^3/16 - (5*x^4/128) + 7*x^5/256 | 1 + x/2 - x^2/8 + x^3/16 - (5*x^4/128) + 7*x^5/256 | def taylor(self, v, a, n): """ Expands self in a truncated Taylor or Laurent series in the variable v around the point a, containing terms through $(x - a)^n$. | b3ba17c1357de84983fbf0c3d95f1ba232a95810 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/b3ba17c1357de84983fbf0c3d95f1ba232a95810/calculus.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
528,
80,
280,
12,
2890,
16,
331,
16,
279,
16,
290,
4672,
3536,
7784,
5708,
365,
316,
279,
15282,
399,
528,
80,
280,
578,
511,
8377,
547,
4166,
316,
326,
2190,
331,
6740,
326,
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,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
528,
80,
280,
12,
2890,
16,
331,
16,
279,
16,
290,
4672,
3536,
7784,
5708,
365,
316,
279,
15282,
399,
528,
80,
280,
578,
511,
8377,
547,
4166,
316,
326,
2190,
331,
6740,
326,
16... |
msg = _('A confirmation message has been sent to %(newaddr)s') | msg = _('A confirmation message has been sent to %(newaddr)s. ') | def sigterm_handler(signum, frame, mlist=mlist): mlist.Unlock() sys.exit(0) | 121755f2405ccc4a84a71002548f14652034e8bc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/121755f2405ccc4a84a71002548f14652034e8bc/options.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3553,
6408,
67,
4176,
12,
2977,
379,
16,
2623,
16,
312,
1098,
33,
781,
376,
4672,
312,
1098,
18,
7087,
1435,
2589,
18,
8593,
12,
20,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3553,
6408,
67,
4176,
12,
2977,
379,
16,
2623,
16,
312,
1098,
33,
781,
376,
4672,
312,
1098,
18,
7087,
1435,
2589,
18,
8593,
12,
20,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def makepath(*paths): dir = os.path.abspath(os.path.join(*paths)) return dir, os.path.normcase(dir) def abs__file__(): """Set all module' __file__ attribute to an absolute path""" for m in sys.modules.values(): try: m.__file__ = os.path.abspath(m.__file__) except AttributeError: continue def removeduppaths(): """ Remove duplicate entries from sys.path along with making them absolute""" L = [] known_paths = {} for dir in sys.path: dir, dircase = makepath(dir) if not dircase in known_paths: L.append(dir) known_paths[dircase] = 1 sys.path[:] = L return known_paths def addbuilddir(): """Append ./build/lib.<platform> in case we're running in the build dir (especially for Guido :-)""" from distutils.util import get_platform s = "build/lib.%s-%.3s" % (get_platform(), sys.version) s = os.path.join(os.path.dirname(sys.path[-1]), s) sys.path.append(s) def _init_pathinfo(): """Return a set containing all existing directory entries from sys.path""" d = {} for dir in sys.path: try: if os.path.isdir(dir): dir, dircase = makepath(dir) d[dircase] = 1 except TypeError: continue return d def addpackage(sitedir, name, known_paths): """Add a new path to known_paths by combining sitedir and 'name' or execute sitedir if it starts with 'import'""" if known_paths is None: known_paths = _init_pathinfo() reset = 1 else: reset = 0 fullname = os.path.join(sitedir, name) try: f = open(fullname, "rU") except IOError: return try: for line in f: if line.startswith(" continue if line.startswith("import"): exec line continue line = line.rstrip() dir, dircase = makepath(sitedir, line) if not dircase in known_paths and os.path.exists(dir): sys.path.append(dir) known_paths[dircase] = 1 finally: f.close() if reset: known_paths = None return known_paths def addsitedir(sitedir, known_paths=None): """Add 'sitedir' argument to sys.path if missing and handle .pth files in 'sitedir'""" if known_paths is None: known_paths = _init_pathinfo() reset = 1 else: reset = 0 sitedir, sitedircase = makepath(sitedir) if not sitedircase in known_paths: sys.path.append(sitedir) try: names = os.listdir(sitedir) except os.error: return names.sort() for name in names: if name.endswith(os.extsep + "pth"): addpackage(sitedir, name, known_paths) if reset: known_paths = None return known_paths def addsitepackages(known_paths): """Add site-packages (and possibly site-python) to sys.path""" prefixes = [sys.prefix] if sys.exec_prefix != sys.prefix: prefixes.append(sys.exec_prefix) for prefix in prefixes: if prefix: if sys.platform in ('os2emx', 'riscos'): sitedirs = [os.path.join(prefix, "Lib", "site-packages")] elif os.sep == '/': sitedirs = [os.path.join(prefix, "lib", "python" + sys.version[:3], "site-packages"), os.path.join(prefix, "lib", "site-python")] else: sitedirs = [prefix, os.path.join(prefix, "lib", "site-packages")] if sys.platform == 'darwin': if 'Python.framework' in prefix: home = os.environ.get('HOME') if home: sitedirs.append( os.path.join(home, 'Library', 'Python', sys.version[:3], 'site-packages')) for sitedir in sys.path+sitedirs: if sitedir and os.path.isdir(sitedir): addsitedir(sitedir, known_paths) return None | def makepath(*paths): dir = os.path.abspath(os.path.join(*paths)) return dir, os.path.normcase(dir) | 38be8f74666898b94ba8f53e6d26aef8126c5f12 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8186/38be8f74666898b94ba8f53e6d26aef8126c5f12/site.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
803,
30857,
4481,
4672,
1577,
273,
1140,
18,
803,
18,
5113,
803,
12,
538,
18,
803,
18,
5701,
30857,
4481,
3719,
327,
1577,
16,
1140,
18,
803,
18,
7959,
3593,
12,
1214,
13,
225,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
803,
30857,
4481,
4672,
1577,
273,
1140,
18,
803,
18,
5113,
803,
12,
538,
18,
803,
18,
5701,
30857,
4481,
3719,
327,
1577,
16,
1140,
18,
803,
18,
7959,
3593,
12,
1214,
13,
225,
... | |
if item is None: | if item == -1: | def OnClick(self, event): item = self._getItem(event) if item is None: self.ExpandOrContract() return sidebarBPB = Block.Block.findBlockByName("SidebarBranchPointBlock") sidebarBPB.childrenBlocks.first().postEventByName ( 'SelectItemsBroadcast', {'items':[item]} ) self.Refresh() | 3c243b7c3ea8ea648f6ad1fdf2f320ede2d5c980 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/3c243b7c3ea8ea648f6ad1fdf2f320ede2d5c980/CalendarBlocks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
6563,
12,
2890,
16,
871,
4672,
761,
273,
365,
6315,
588,
1180,
12,
2575,
13,
309,
761,
422,
300,
21,
30,
365,
18,
12271,
1162,
8924,
1435,
327,
23364,
38,
20724,
273,
3914,
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,
2755,
6563,
12,
2890,
16,
871,
4672,
761,
273,
365,
6315,
588,
1180,
12,
2575,
13,
309,
761,
422,
300,
21,
30,
365,
18,
12271,
1162,
8924,
1435,
327,
23364,
38,
20724,
273,
3914,
18,
... |
notInstalledBranch != newBranch): if isPrimary: | localUpdateBranch != newBranch): if (localUpdateBranch, newBranch) == branchHint: pass elif not respectBranchAffinity or isPrimary: | # def _mergeGroupChanges -- main body begins here | cee395a7723b7c7354733797d8efaa27bfdc4e57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/cee395a7723b7c7354733797d8efaa27bfdc4e57/update.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
1652,
389,
2702,
1114,
7173,
1493,
2774,
1417,
17874,
2674,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
468,
1652,
389,
2702,
1114,
7173,
1493,
2774,
1417,
17874,
2674,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def ZpCA(p, prec = 20, print_mode = None, halt = 40, check=True): | def ZpCA(p, prec = twenty, print_mode = None, halt = forty, check=True): | def ZpCA(p, prec = 20, print_mode = None, halt = 40, check=True): return Zp(p=p, prec=prec, print_mode=print_mode, halt=halt, check=check, type = 'capped-abs') | b92340ea12db03897b3c1888cbbf80913f1ff7f8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/b92340ea12db03897b3c1888cbbf80913f1ff7f8/factory.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2285,
84,
3587,
12,
84,
16,
13382,
273,
2339,
319,
93,
16,
1172,
67,
3188,
273,
599,
16,
18389,
273,
364,
4098,
16,
866,
33,
5510,
4672,
327,
2285,
84,
12,
84,
33,
84,
16,
13382,
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,
2285,
84,
3587,
12,
84,
16,
13382,
273,
2339,
319,
93,
16,
1172,
67,
3188,
273,
599,
16,
18389,
273,
364,
4098,
16,
866,
33,
5510,
4672,
327,
2285,
84,
12,
84,
33,
84,
16,
13382,
3... |
db = None | def getFile(filename): """Helper function to return a file as a string""" fd = open(filename) s = fd.read() fd.close() return s | 3f0e828e686252b3a3705ffd89d210e0d2d7d980 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5056/3f0e828e686252b3a3705ffd89d210e0d2d7d980/server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6034,
12,
3459,
4672,
3536,
2276,
445,
358,
327,
279,
585,
487,
279,
533,
8395,
225,
5194,
273,
1696,
12,
3459,
13,
272,
273,
5194,
18,
896,
1435,
5194,
18,
4412,
1435,
327,
272,
282,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6034,
12,
3459,
4672,
3536,
2276,
445,
358,
327,
279,
585,
487,
279,
533,
8395,
225,
5194,
273,
1696,
12,
3459,
13,
272,
273,
5194,
18,
896,
1435,
5194,
18,
4412,
1435,
327,
272,
282,
... | |
return open(self._fn(self.module_path, resource_name), 'rb') | return StringIO(self.get_resource_string(manager, resource_name)) | def get_resource_stream(self, manager, resource_name): return open(self._fn(self.module_path, resource_name), 'rb') | 8fffda12af6b5121972e94016e5b1168814e77e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/495/8fffda12af6b5121972e94016e5b1168814e77e5/pkg_resources.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3146,
67,
3256,
12,
2890,
16,
3301,
16,
1058,
67,
529,
4672,
327,
1696,
12,
2890,
6315,
4293,
12,
2890,
18,
2978,
67,
803,
16,
1058,
67,
529,
3631,
296,
6731,
6134,
2,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3146,
67,
3256,
12,
2890,
16,
3301,
16,
1058,
67,
529,
4672,
327,
1696,
12,
2890,
6315,
4293,
12,
2890,
18,
2978,
67,
803,
16,
1058,
67,
529,
3631,
296,
6731,
6134,
2,
-100,... |
self.addDataToDB (['a', 'b', 'c']) | self.addDataToDB ([b'a', b'b', b'c']) | def bad_comparator (l, r): if l == r: # pass the set_bt_compare test return 0 raise RuntimeError("i'm a naughty comparison function") | 0060e41a3ce7bcb66b7a9a39fd4f3dd2f5a6f82a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/0060e41a3ce7bcb66b7a9a39fd4f3dd2f5a6f82a/test_compare.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5570,
67,
832,
2528,
261,
80,
16,
436,
4672,
309,
328,
422,
436,
30,
468,
1342,
326,
444,
67,
23602,
67,
9877,
1842,
327,
374,
1002,
7265,
2932,
77,
17784,
279,
290,
16510,
93,
5826,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5570,
67,
832,
2528,
261,
80,
16,
436,
4672,
309,
328,
422,
436,
30,
468,
1342,
326,
444,
67,
23602,
67,
9877,
1842,
327,
374,
1002,
7265,
2932,
77,
17784,
279,
290,
16510,
93,
5826,
... |
elif troveName.endswith(':source'): | elif n.endswith(':source'): | def formatInfo(self, trove): """ returns iteratore of format lines about this local trove """ # TODO: it'd be nice if this were set up to do arbitrary # formats... | 36086cd03e4561260f9d88131b76f161fe99e31d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/36086cd03e4561260f9d88131b76f161fe99e31d/display.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
966,
12,
2890,
16,
23432,
537,
4672,
3536,
1135,
1400,
270,
479,
434,
740,
2362,
2973,
333,
1191,
23432,
537,
3536,
468,
2660,
30,
518,
14271,
506,
13752,
309,
333,
4591,
444,
731,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
966,
12,
2890,
16,
23432,
537,
4672,
3536,
1135,
1400,
270,
479,
434,
740,
2362,
2973,
333,
1191,
23432,
537,
3536,
468,
2660,
30,
518,
14271,
506,
13752,
309,
333,
4591,
444,
731,
... |
self.discretizedAtts = [] for a in self.dataset.domain.attributes: if a.varType == orange.VarTypes.Continuous: self.discretizedAtts.append(a.name) | self.discretizedAtts = filter(lambda x: x.varType == orange.VarTypes.Continuous, self.dataset.domain.attributes) | def categorize(self): if self.dataset == None: return | dd1d765dc3e19161f4c3e8769c6d619e4b07ec77 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6366/dd1d765dc3e19161f4c3e8769c6d619e4b07ec77/OWCategorize.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31921,
554,
12,
2890,
4672,
309,
365,
18,
8682,
422,
599,
30,
327,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31921,
554,
12,
2890,
4672,
309,
365,
18,
8682,
422,
599,
30,
327,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
showIndent(outfile, level) outfile.write('content_ = [\n') for item_ in self.content_: item_.exportLiteral(outfile, level, name_) showIndent(outfile, level) outfile.write('],\n') showIndent(outfile, level) outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,)) | if self.AbstractSeqMatrix is not None: showIndent(outfile, level) outfile.write('AbstractSeqMatrix=model_.AbstractSeqMatrix(\n') self.AbstractSeqMatrix.exportLiteral(outfile, level) showIndent(outfile, level) outfile.write('),\n') | def exportLiteralChildren(self, outfile, level, name_): super(AbstractSeqs, self).exportLiteralChildren(outfile, level, name_) showIndent(outfile, level) outfile.write('content_ = [\n') for item_ in self.content_: item_.exportLiteral(outfile, level, name_) showIndent(outfile, level) outfile.write('],\n') showIndent(outfile, level) outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,)) | 9c12e50d449fa27d6f8f3415ece228ae97bb0266 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14016/9c12e50d449fa27d6f8f3415ece228ae97bb0266/_nexml.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3359,
6177,
4212,
12,
2890,
16,
8756,
16,
1801,
16,
508,
67,
4672,
2240,
12,
7469,
6926,
87,
16,
365,
2934,
6530,
6177,
4212,
12,
26050,
16,
1801,
16,
508,
67,
13,
2405,
7790,
12,
26... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3359,
6177,
4212,
12,
2890,
16,
8756,
16,
1801,
16,
508,
67,
4672,
2240,
12,
7469,
6926,
87,
16,
365,
2934,
6530,
6177,
4212,
12,
26050,
16,
1801,
16,
508,
67,
13,
2405,
7790,
12,
26... |
current_scores[category] = dict( | current_scores = dict( | def GetStats(request, test_set, output='html', opt_tests=None, use_memcache=True): """Returns the stats table. Args: request: a request object. test_set: a TestSet instance. output: Output type html or pickle or else you get a dict of params. opt_tests: list of tests. use_memcache: Use memcache or not. """ category = test_set.category logging.info('GetStats for %s' % category) version_level = request.GET.get('v', 'top') is_skip_static = request.GET.get('sc') # 'sc' for skip cache browser_param = request.GET.get('ua') results_str = request.GET.get('%s_results' % category, request.GET.get('results', None)) # allow "results" for user_tests. current_user_agent_string = request.META['HTTP_USER_AGENT'] visible_test_keys = [t.key for t in test_set.VisibleTests()] browsers = browser_param and browser_param.split(',') or None if browsers and '*' in browser_param: browsers = result_stats.CategoryBrowserManager.GetFilteredBrowsers( category, browsers) if (not is_skip_static and category in settings.STATIC_CATEGORIES and output in ('html', 'xhr')): # Use pickle'd data to which we can integrate a user's results. static_source = settings.STATIC_SOURCE_FORMAT % { 'category': category, 'version_level': version_level } if static_source.startswith('http'): logging.info('Loading stats from url: %s' % static_source) response = urlfetch.fetch(static_source) stats_data = pickle.loads(response.content) else: stats_data = pickle.load(open(static_source)) if not browsers: browsers = stats_data.keys() result_stats.CategoryBrowserManager.SortBrowsers(browsers) logging.info('Retrieved static stats: category=%s', category) else: if not browsers: browsers = result_stats.CategoryBrowserManager.GetBrowsers( category, version_level) if category == 'summary': stats_data = result_stats.SummaryStatsManager.GetStats(browsers) else: stats_data = result_stats.CategoryStatsManager.GetStats( test_set, browsers, visible_test_keys, use_memcache=use_memcache) # If the output is pickle, we are done and need to return a string. if output == 'pickle': return pickle.dumps(stats_data) current_scores = {} if category == 'summary': for sub_category in visible_test_keys: sub_test_set = all_test_sets.GetTestSet(sub_category) results_str = request.GET.get('%s_results' % sub_category) if results_str: results = sub_test_set.GetResults(results_str, ignore_key_errors=True) current_scores[sub_category] = dict( (test_key, result['raw_score']) for test_key, result in results.items()) elif results_str: results = test_set.GetResults(results_str, ignore_key_errors=True) current_scores[category] = dict( (test_key, result['raw_score']) for test_key, result in results.items()) # Set current_browser to one in browsers or add it if not found. current_browser = models.user_agent.UserAgent.factory(current_user_agent_string).pretty() for browser in browsers: if current_browser.startswith(browser): current_browser = browser break else: if current_scores: result_stats.CategoryBrowserManager.InsortBrowser( browsers, current_browser) # Adds the current results into the stats_data dict. if current_scores: if category == 'summary': # TODO(slamm): Refactor to avoid code duplication in results_stats.py. current_stats = {'results': {}} total_score = 0 for sub_category in visible_test_keys: sub_test_set = all_test_sets.GetTestSet(sub_category) test_keys = [t.key for t in sub_test_set.VisibleTests()] if sub_category in current_scores: stats = sub_test_set.GetStats(test_keys, current_scores[sub_category]) score = stats['summary_score'] if sub_category == 'acid3': display = stats['results']['score']['display'] else: display = stats['summary_display'] else: score = 0 display = '' current_stats['results'][sub_category] = { 'score': score, 'display': display } total_score += int(score) current_stats['summary_score'] = total_score / len(visible_test_keys) current_stats['summary_display'] = ( '%s/100' % current_stats['summary_score']) else: current_stats = test_set.GetStats(visible_test_keys, current_scores) browser_stats = stats_data.setdefault(current_browser, {}) browser_stats['current_results'] = current_stats['results'] browser_stats['current_score'] = current_stats['summary_score'] browser_stats['current_display'] = current_stats['summary_display'] params = { 'category': category, 'category_name': test_set.category_name, 'tests': opt_tests or test_set.VisibleTests(), 'v': version_level, 'output': output, 'ua_by_param': browser_param, 'user_agents': browsers, 'request_path': request.get_full_path(), 'current_user_agent': current_browser, 'stats': stats_data, 'params': test_set.default_params, 'results_uri_string': results_str } #logging.info("GetStats got params: %s", str(params)) if output in ['html', 'xhr']: return GetStatsDataTemplatized(params, 'table') elif output in ['csv', 'gviz']: return GetStatsDataTemplatized(params, output) elif output == 'gviz_data': return FormatStatsDataAsGviz(params, request.GET.get('tqx', '')) elif output == 'gviz_timeline_data': return FormatStatsDataAsGvizTimeLine(params, request.GET.get('tqx', '')) else: return params | 529368356eb9666ab5f86990b608f08afbb072b8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5745/529368356eb9666ab5f86990b608f08afbb072b8/util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
4195,
12,
2293,
16,
1842,
67,
542,
16,
876,
2218,
2620,
2187,
225,
2153,
67,
16341,
33,
7036,
16,
999,
67,
3917,
2493,
33,
5510,
4672,
3536,
1356,
326,
3177,
1014,
18,
6634,
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,
968,
4195,
12,
2293,
16,
1842,
67,
542,
16,
876,
2218,
2620,
2187,
225,
2153,
67,
16341,
33,
7036,
16,
999,
67,
3917,
2493,
33,
5510,
4672,
3536,
1356,
326,
3177,
1014,
18,
6634,
30,
... |
raise self.failureException, \ (msg or '%r == %r' % (first, second)) | raise self.failureException(msg or '%r == %r' % (first, second)) | def failIfEqual(self, first, second, msg=None): """Fail if the two objects are equal as determined by the '==' operator. """ if first == second: raise self.failureException, \ (msg or '%r == %r' % (first, second)) | 53a23f492fdb323f97d2bed8feb3634ca3947266 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/53a23f492fdb323f97d2bed8feb3634ca3947266/unittest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2321,
2047,
5812,
12,
2890,
16,
1122,
16,
2205,
16,
1234,
33,
7036,
4672,
3536,
3754,
309,
326,
2795,
2184,
854,
3959,
487,
11383,
635,
326,
22853,
3726,
18,
3536,
309,
1122,
422,
2205,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2321,
2047,
5812,
12,
2890,
16,
1122,
16,
2205,
16,
1234,
33,
7036,
4672,
3536,
3754,
309,
326,
2795,
2184,
854,
3959,
487,
11383,
635,
326,
22853,
3726,
18,
3536,
309,
1122,
422,
2205,
... |
orders = Order.objects.for_user() | orders = Order.objects.for_user() | def overview(request): orders = Order.objects.for_user() updateTimeout(request) return render_with_request(request, 'orders/list.html', {'title':'Ordrer', 'orders':orders}) | 9e79ed939083ef9313c7dad147d4a3956e606231 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12430/9e79ed939083ef9313c7dad147d4a3956e606231/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18471,
12,
2293,
4672,
11077,
273,
4347,
18,
6911,
18,
1884,
67,
1355,
1435,
1089,
2694,
12,
2293,
13,
327,
1743,
67,
1918,
67,
2293,
12,
2293,
16,
296,
9972,
19,
1098,
18,
2620,
2187,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18471,
12,
2293,
4672,
11077,
273,
4347,
18,
6911,
18,
1884,
67,
1355,
1435,
1089,
2694,
12,
2293,
13,
327,
1743,
67,
1918,
67,
2293,
12,
2293,
16,
296,
9972,
19,
1098,
18,
2620,
2187,... |
if self.mode in ("moo", "tachatte"): return self.generateWordUniq(new_thesaurus) elif self.mode == "shit": return self.generateWordRepeat(new_thesaurus) elif self.mode == "letter": return self.generateWordLetter(new_thesaurus) else: return self.generateWordRandom(new_thesaurus) def generateWordRepeat(self, new_thesaurus): | last = None tries = 1 while tries < 100: if self.mode in ("moo", "tachatte"): word = self.generateWordUniq() elif self.mode == "shit": word = self.generateWordRepeat() elif self.mode == "letter": word = self.generateWordLetter() else: word = self.generateWordRandom() if word not in self.thesaurus \ and word not in new_thesaurus: return word if word == last: break last = word tries = tries + 1 raise Exception("No more shit!") def generateWordRepeat(self): | def generateWord(self, word, new_thesaurus): if self.mode in ("moo", "tachatte"): return self.generateWordUniq(new_thesaurus) elif self.mode == "shit": return self.generateWordRepeat(new_thesaurus) elif self.mode == "letter": return self.generateWordLetter(new_thesaurus) else: return self.generateWordRandom(new_thesaurus) | 562905e2a6815b9950a501214d1feb649e21a1f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2280/562905e2a6815b9950a501214d1feb649e21a1f5/tachatte.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
3944,
12,
2890,
16,
2076,
16,
394,
67,
7915,
28659,
407,
4672,
309,
365,
18,
3188,
316,
7566,
81,
5161,
3113,
315,
88,
497,
270,
736,
6,
4672,
327,
365,
18,
7163,
3944,
984,
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,
2103,
3944,
12,
2890,
16,
2076,
16,
394,
67,
7915,
28659,
407,
4672,
309,
365,
18,
3188,
316,
7566,
81,
5161,
3113,
315,
88,
497,
270,
736,
6,
4672,
327,
365,
18,
7163,
3944,
984,
18... |
rffi.INT) linux_getpagesize = rffi.llexternal('getpagesize', [], rffi.INT) | rffi.INT, sandboxsafe=True, _nowrapper=True) linux_getpagesize = rffi.llexternal('getpagesize', [], rffi.INT, sandboxsafe=True, _nowrapper=True) | def arena_new_view(ptr): """Return a fresh memory view on an arena """ return Arena(ptr.arena.nbytes, False).getaddr(0) | 1ce4f1b4a85c2d2d5c8f3abfd3a2b4337ddcf7b9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6934/1ce4f1b4a85c2d2d5c8f3abfd3a2b4337ddcf7b9/llarena.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
854,
6582,
67,
2704,
67,
1945,
12,
6723,
4672,
3536,
990,
279,
12186,
3778,
1476,
603,
392,
854,
6582,
3536,
327,
432,
1187,
69,
12,
6723,
18,
834,
6582,
18,
82,
3890,
16,
1083,
2934,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
854,
6582,
67,
2704,
67,
1945,
12,
6723,
4672,
3536,
990,
279,
12186,
3778,
1476,
603,
392,
854,
6582,
3536,
327,
432,
1187,
69,
12,
6723,
18,
834,
6582,
18,
82,
3890,
16,
1083,
2934,
... |
if readData1 != srccontents or readData2 != srccontents: raise TestFailed, "Written data doesn't equal read data." | fp = open(TESTFN, "wb") fp.write(self.data) fp.close() | def zipTest(f, compression, srccontents): zip = zipfile.ZipFile(f, "w", compression) # Create the ZIP archive zip.write(srcname, "another"+os.extsep+"name") zip.write(srcname, srcname) zip.close() zip = zipfile.ZipFile(f, "r", compression) # Read the ZIP archive readData2 = zip.read(srcname) readData1 = zip.read("another"+os.extsep+"name") zip.close() if readData1 != srccontents or readData2 != srccontents: raise TestFailed, "Written data doesn't equal read data." | 3caf9c1edd0623231489d998a81511c9fa991f5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3caf9c1edd0623231489d998a81511c9fa991f5a/test_zipfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3144,
4709,
12,
74,
16,
9154,
16,
1705,
3980,
4672,
3144,
273,
18823,
18,
29394,
12,
74,
16,
315,
91,
3113,
9154,
13,
282,
468,
1788,
326,
18277,
5052,
3144,
18,
2626,
12,
4816,
529,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3144,
4709,
12,
74,
16,
9154,
16,
1705,
3980,
4672,
3144,
273,
18823,
18,
29394,
12,
74,
16,
315,
91,
3113,
9154,
13,
282,
468,
1788,
326,
18277,
5052,
3144,
18,
2626,
12,
4816,
529,
... |
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. | 24fca8adff596d4ebb01cec8c42aa0388feacb6a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/24fca8adff596d4ebb01cec8c42aa0388feacb6a/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... |
preOps = [ migrator(rate=[[0.8, 0.2], [0.4, 0.6]]), | preOps = migrator(rate=[[0.8, 0.2], [0.4, 0.6]]), postOps = [ | def InitByFreq(pop, *args, **kwargs): initByFreq(*args, **kwargs).apply(pop) | 505ded08bbab01d6828bb201d31e079f6d9e3b55 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/401/505ded08bbab01d6828bb201d31e079f6d9e3b55/userGuide.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4378,
858,
14485,
12,
5120,
16,
380,
1968,
16,
2826,
4333,
4672,
1208,
858,
14485,
30857,
1968,
16,
2826,
4333,
2934,
9010,
12,
5120,
13,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4378,
858,
14485,
12,
5120,
16,
380,
1968,
16,
2826,
4333,
4672,
1208,
858,
14485,
30857,
1968,
16,
2826,
4333,
2934,
9010,
12,
5120,
13,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fixtures = ['profile/user-paulproteus', 'profile/person-paulproteus'] | fixtures = ['user-paulproteus', 'person-paulproteus'] | def test_login_bad_password_web(self): url = 'http://openhatch.org/' url = make_twill_url(url) tc.go(url) tc.fv('login','login_username',"paulproteus") tc.fv('login','login_password',"not actually paulproteus's unbreakable password") tc.submit() tc.find("oops") | fd863f283a7ae5ce61350708d5c2fd0057591cda /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11976/fd863f283a7ae5ce61350708d5c2fd0057591cda/tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5819,
67,
8759,
67,
3664,
67,
4875,
12,
2890,
4672,
880,
273,
296,
2505,
2207,
3190,
76,
505,
18,
3341,
2473,
880,
273,
1221,
67,
11246,
737,
67,
718,
12,
718,
13,
1715,
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,
5819,
67,
8759,
67,
3664,
67,
4875,
12,
2890,
4672,
880,
273,
296,
2505,
2207,
3190,
76,
505,
18,
3341,
2473,
880,
273,
1221,
67,
11246,
737,
67,
718,
12,
718,
13,
1715,
18... |
return hash(self.message) ^ hash(self.attrs) | return hash(self.message) ^ hash(str(self.attrs)) | def __hash__(self): return hash(self.message) ^ hash(self.attrs) | ca3ffe5f7420f4cc5d894e56298800e17a171023 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/ca3ffe5f7420f4cc5d894e56298800e17a171023/printing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2816,
972,
12,
2890,
4672,
327,
1651,
12,
2890,
18,
2150,
13,
3602,
1651,
12,
2890,
18,
7039,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2816,
972,
12,
2890,
4672,
327,
1651,
12,
2890,
18,
2150,
13,
3602,
1651,
12,
2890,
18,
7039,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
raise OSError("Directory structure %s altered during processing: permissions changed during processing" % (dirlist)) | raise OSError("Directory structure %s altered during processing: permissions changed during processing" % (dir_list)) | def provide_dir_with_perms_then_exec(dir, function, perms, barrier_dir): # This function won't allow you to alter the root directories' # permissions: if your going to be changing the permissions on # your root directory, you probably need to do it more carefully # than with a python function! # sanitize path: dir = os.path.abspath(os.path.normpath(os.path.expanduser(dir))) # Check to see if we're already in the state we want to be in: try: targets_current_perms = get_perms(dir) targets_current_owner_uid = get_owner_uid(dir) except OSError, e: if e.errno == 2: # dir definitely doesn't exist. raise elif e.errno == 13: # don't have sufficient permissions to read the # permissions. dir_info_read = False else: dir_info_read = True if dir_info_read and targets_current_owner_uid != os.geteuid(): # We don't own the file: raise OSError("file %s not owned by this process's effective user: cannot proceed" % (dir)) elif dir_info_read and targets_current_perms & perms == perms: # This directory already has user bits set to at least perms, # so execute the given function: return function() # If we haven't exited the function already, we need to change the target dirs # permissions (or simply couldn't read the permissions!) # Get a list of all of the dirs parents: dir_list = dirtree(dir) if barrier_dir is not None: # sanitize path: barrier_dir = os.path.abspath(os.path.normpath(os.path.expanduser(barrier_dir))) # Check the barrier dir is one of the parents of dir: if not barrier_dir in dir_list[1:]: raise ValueError('argument barrier_dir must be a proper parent directory of argument dir') # Get a list of all the directories that lie between the # barrier dir and the target dir, including the barrier dir, # but excluding the target dir: barrier_dir_list = dirtree(barrier_dir) g = lambda d: (d == barrier_dir) or (not (d in barrier_dir_list or d == dir)) operable_parent_dirs = filter(g, dir_list) else: operable_parent_dirs = dir_list # Make sure we have at least wx permissions on parent: parents_old_states = _get_perms_on(operable_parent_dirs, perms=0300) # Now stat the target dir if we didn't manage previously: if not dir_info_read: try: targets_current_perms = get_perms(dir) targets_current_owner_uid = get_owner_uid(dir) except OSError, e: if e.errno == 2: # race condition: raise OSError("Directory structure altered during processing: %s removed during processing" % (dir)) elif e.errno == 13: # race condition: raise OSError("Directory structure %s altered during processing: permissions changed during processing" % (dirlist)) if targets_current_owner_uid != os.geteuid(): # We don't own this file and so can't chmod it: We # couldn't see this previously because we didn't # have permission to stat the dir. Undo the # permission changes we've already made and report # the error: _safely_chmod_dirlist(parents_old_states) raise OSError("file %s not owned by this process's effective user: cannot proceed" % (dir)) elif targets_current_perms & perms == perms: # We already have the perms we need. try: return_value = function() finally: _safely_chmod_dirlist(parents_old_states) return return_value # Now change the permissions of our target directory: try: os.chmod(dir, perms | targets_current_perms) except OSError: # race condition: raise OSError("Directory structure %s altered during processing: permissions changed during processing" % (dirlist)) try: # Now permissions are open, exec our function: return_value = function() finally: # Close up the permissions we had to open: _safely_chmod_dirlist([[dir, targets_current_perms]] + parents_old_states) # Return the input functions return value: return return_value | f2e996e8b4f5b6c517aa372183e2526963e02235 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/f2e996e8b4f5b6c517aa372183e2526963e02235/elmsubmit_misc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5615,
67,
1214,
67,
1918,
67,
15969,
67,
15991,
67,
4177,
12,
1214,
16,
445,
16,
13793,
16,
24651,
67,
1214,
4672,
468,
1220,
445,
8462,
1404,
1699,
1846,
358,
10182,
326,
1365,
6402,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5615,
67,
1214,
67,
1918,
67,
15969,
67,
15991,
67,
4177,
12,
1214,
16,
445,
16,
13793,
16,
24651,
67,
1214,
4672,
468,
1220,
445,
8462,
1404,
1699,
1846,
358,
10182,
326,
1365,
6402,
... |
for line in lines: if i == 1: | for line in lines: if i == 3: | def script_output(stdout): lines=[] whole_output = "" for line in stdout.readlines(): whole_output = whole_output + line p = re.compile('^[#][#]Print.*$',re.VERBOSE|re.DOTALL) if(p.match(line)): lines.append(line.rstrip().lstrip()) lines.sort() i =1 result = 1 for line in lines: if i == 1: p = re.compile(r""" (^[#][#] Print\[SendAction: \s* RULE \s* q5]: \s* \[foundOtherTable\(localhost:10000, \s* [0-9]+, \s* [0-9]+\)\]) """, re.VERBOSE) elif i == 2: p = re.compile(r""" (^[#][#] Print \[SendAction: \s* RULE \s* q3\]: \s* \[foundTable\(localhost:10000, \s* [0-9]+, \s* [0-9]+\)\]) """, re.VERBOSE) elif i == 3: p = re.compile(r""" (^[#][#] Print \[SendAction: \s* RULE \s* q3\]: \s* \[foundTable\(localhost:10000, \s* [0-9]+, \s* [0-9]+\)\]) """, re.VERBOSE) else: result = 0 break flag = p.match(line) if flag: i = i+1 else: result = 0 break if i>4 or i<4 or result == 0: print "Test failed" print "Port 10000 output:" print whole_output else: print "Test passed" | 19d939cbf12146e125cc6b53f834ea6b9d316279 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/929/19d939cbf12146e125cc6b53f834ea6b9d316279/tableExpiration.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2728,
67,
2844,
12,
10283,
4672,
2362,
33,
8526,
7339,
67,
2844,
273,
1408,
364,
980,
316,
3909,
18,
896,
3548,
13332,
7339,
67,
2844,
273,
7339,
67,
2844,
397,
980,
293,
273,
283,
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,
2728,
67,
2844,
12,
10283,
4672,
2362,
33,
8526,
7339,
67,
2844,
273,
1408,
364,
980,
316,
3909,
18,
896,
3548,
13332,
7339,
67,
2844,
273,
7339,
67,
2844,
397,
980,
293,
273,
283,
18,... |
(rc, size) = hpage_size() sysctls = setup_shm_sysctl(tot_pages * size) | limit = system_default_hpage_size * tot_pages | def stress_tests(): """ Run the set of stress tests. """ iterations = 10 # Number of iterations for looping tests # Don't update NRPAGES every time like above because we want to catch the # failures that happen when the kernel doesn't release all of the huge pages # after a stress test terminates (rc, nr_pages) = free_hpages() do_test(("mmap-gettest", repr(iterations), repr(nr_pages))) # mmap-cow needs a hugepages for each thread plus one extra do_test(("mmap-cow", repr(nr_pages-1), repr(nr_pages))) (rc, tot_pages) = total_hpages() (rc, size) = hpage_size() sysctls = setup_shm_sysctl(tot_pages * size) threads = 10 # Number of threads for shm-fork # Run shm-fork once using half available hugepages, then once using all # This is to catch off-by-ones or races in the kernel allocated that # can make allocating all hugepages a problem if nr_pages > 1: do_test(("shm-fork.sh", repr(threads), repr(nr_pages / 2))) do_test(("shm-fork.sh", repr(threads), repr(nr_pages))) do_test(("shm-getraw.sh", repr(nr_pages), "/dev/full")) restore_shm_sysctl(sysctls) | c5f56f187505f039ebb692a615fefe766830b210 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3715/c5f56f187505f039ebb692a615fefe766830b210/run_tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
384,
663,
67,
16341,
13332,
3536,
1939,
326,
444,
434,
384,
663,
7434,
18,
3536,
11316,
273,
1728,
202,
7,
3588,
434,
11316,
364,
25004,
7434,
225,
468,
7615,
1404,
1089,
423,
54,
11219,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
384,
663,
67,
16341,
13332,
3536,
1939,
326,
444,
434,
384,
663,
7434,
18,
3536,
11316,
273,
1728,
202,
7,
3588,
434,
11316,
364,
25004,
7434,
225,
468,
7615,
1404,
1089,
423,
54,
11219,... |
DeprecationWarning)): | DeprecationWarning), quite=True): | def test_issue4228(self): # Packing a long may yield either 32 or 64 bits with _check_py3k_warnings(("struct integer overflow masking is deprecated", DeprecationWarning)): x = struct.pack('L', -1)[:4] self.assertEqual(x, '\xff'*4) | 192f6782c6aa1cb1979aa6c494e01268f5aabab1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/192f6782c6aa1cb1979aa6c494e01268f5aabab1/test_struct.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
13882,
24,
3787,
28,
12,
2890,
4672,
468,
7930,
310,
279,
1525,
2026,
2824,
3344,
3847,
578,
5178,
4125,
598,
389,
1893,
67,
2074,
23,
79,
67,
12103,
12,
2932,
1697,
3571,
93... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
13882,
24,
3787,
28,
12,
2890,
4672,
468,
7930,
310,
279,
1525,
2026,
2824,
3344,
3847,
578,
5178,
4125,
598,
389,
1893,
67,
2074,
23,
79,
67,
12103,
12,
2932,
1697,
3571,
93... |
if order_by_time: return render_to_latex(self.baseDir()+'catalog_bytime.tex', context, extra) else: return render_to_latex(self.baseDir()+'catalog.tex', context, extra) | return render_to_latex(self.baseDir()+'catalog_%s.tex' % first_sort, context, extra) | def coursecatalog(self, request, tl, one, two, module, extra, prog): " This renders the course catalog in LaTeX. " | feba2a003e0009b06bf39b5711a84f8d0b664324 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12041/feba2a003e0009b06bf39b5711a84f8d0b664324/programprintables.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4362,
7199,
12,
2890,
16,
590,
16,
8332,
16,
1245,
16,
2795,
16,
1605,
16,
2870,
16,
11243,
4672,
315,
1220,
19567,
326,
4362,
6222,
316,
21072,
21575,
60,
18,
315,
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,
4362,
7199,
12,
2890,
16,
590,
16,
8332,
16,
1245,
16,
2795,
16,
1605,
16,
2870,
16,
11243,
4672,
315,
1220,
19567,
326,
4362,
6222,
316,
21072,
21575,
60,
18,
315,
2,
-100,
-100,
-100... |
choice = raw_input('Save your login (y/N)?') | choice = input('Save your login (y/N)?') | def send_metadata(self): ''' Send the metadata to the package index server. | 18d5662d185043e82271de9cd3fe9a25c1d2d1c3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/18d5662d185043e82271de9cd3fe9a25c1d2d1c3/register.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
4165,
12,
2890,
4672,
9163,
2479,
326,
1982,
358,
326,
2181,
770,
1438,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
4165,
12,
2890,
4672,
9163,
2479,
326,
1982,
358,
326,
2181,
770,
1438,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
self.scrollbar_background=clutter.Rectangle() | self.border = border if bar_image_path != None and os.path.exists(bar_image_path): self.scrollbar_background=clutter.Texture() self.scrollbar_background.set_from_file(bar_image_path) else: self.scrollbar_background=clutter.Rectangle() self.scrollbar_background.set_color('LightBlue') | def __init__(self): clutter.Actor.__init__(self) self.scrollbar_background=clutter.Rectangle() self.scrollbar_background.set_parent(self) self.scrollbar_background.set_color('LightBlue') self.scroller=clutter.Rectangle() self.scroller.set_color('Gray') self.scroller.set_parent(self) self.scroller.set_reactive(True) self.scroller.connect('button-press-event', self.on_scroll_press) self.scroller.connect('button-release-event', self.on_scroll_release) self.scroller.connect('motion-event', self.on_scroll_move) self.scroller_position = 0 self.last_event_y = None | 26fa15c71a9f14e6abdd60c21c681293f96ba26a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5279/26fa15c71a9f14e6abdd60c21c681293f96ba26a/scrollbar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
927,
18220,
18,
17876,
16186,
2738,
972,
12,
2890,
13,
365,
18,
8815,
273,
5795,
225,
309,
4653,
67,
2730,
67,
803,
480,
599,
471,
1140,
18,
803,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
927,
18220,
18,
17876,
16186,
2738,
972,
12,
2890,
13,
365,
18,
8815,
273,
5795,
225,
309,
4653,
67,
2730,
67,
803,
480,
599,
471,
1140,
18,
803,
18,
... |
changeid = self.repo.changelog.count() - 1 | changeid = repo.changelog.count() - 1 | def changectx(repo, req): if 'node' in req.form: changeid = req.form['node'][0] elif 'manifest' in req.form: changeid = req.form['manifest'][0] else: changeid = self.repo.changelog.count() - 1 try: ctx = repo.changectx(changeid) except RepoError: man = repo.manifest mn = man.lookup(changeid) ctx = repo.changectx(man.linkrev(mn)) return ctx | ff09592b8acbd748e5a062fcb6389df69fae9645 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11312/ff09592b8acbd748e5a062fcb6389df69fae9645/webutil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9435,
386,
92,
12,
7422,
16,
1111,
4672,
309,
296,
2159,
11,
316,
1111,
18,
687,
30,
2549,
350,
273,
1111,
18,
687,
3292,
2159,
3546,
63,
20,
65,
1327,
296,
14357,
11,
316,
1111,
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,
9435,
386,
92,
12,
7422,
16,
1111,
4672,
309,
296,
2159,
11,
316,
1111,
18,
687,
30,
2549,
350,
273,
1111,
18,
687,
3292,
2159,
3546,
63,
20,
65,
1327,
296,
14357,
11,
316,
1111,
18,... |
class NoExecs(quickfix.IntField): def __init__(self, data = None): if data == None: quickfix.IntField.__init__(self, 124) else: quickfix.IntField.__init__(self, 124, data) class ExpireTime(quickfix.UtcTimeStampField): def __init__(self, data = None): if data == None: quickfix.UtcTimeStampField.__init__(self, 126) else: quickfix.UtcTimeStampField.__init__(self, 126, data) class DKReason(quickfix.CharField): def __init__(self, data = None): if data == None: quickfix.CharField.__init__(self, 127) else: quickfix.CharField.__init__(self, 127, data) | def __init__(self, data = None): if data == None: quickfix.BoolField.__init__(self, 123) else: quickfix.BoolField.__init__(self, 123, data) | b195a30ce1679e0269bc776f2f6e3591488def1f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/b195a30ce1679e0269bc776f2f6e3591488def1f/quickfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
501,
273,
599,
4672,
309,
501,
422,
599,
30,
9549,
904,
18,
7464,
974,
16186,
2738,
972,
12,
2890,
16,
17335,
13,
469,
30,
9549,
904,
18,
7464,
974,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
501,
273,
599,
4672,
309,
501,
422,
599,
30,
9549,
904,
18,
7464,
974,
16186,
2738,
972,
12,
2890,
16,
17335,
13,
469,
30,
9549,
904,
18,
7464,
974,
16... | |
def write(self, cr, uid, ids,vals, *args, **kwargs): if 'date' in vals and vals['date']: | def write(self, cr, uid, ids, vals, *args, **kwargs): if isinstance(ids, (int, long)): ids = [ids] if vals.get('date', False): | def write(self, cr, uid, ids,vals, *args, **kwargs): if 'date' in vals and vals['date']: data_project = self.browse(cr, uid, ids) for prj in data_project: new_end_date = date(*time.strptime(vals['date'],'%Y-%m-%d')[:3]) if prj.date: old_end_date = date(*time.strptime(prj.date,'%Y-%m-%d')[:3]) for task in prj.tasks: if task.date_start: start_dt = (date(*time.strptime(str(task.date_start),'%Y-%m-%d %H:%M:%S')[:3])+(new_end_date-old_end_date)).strftime('%Y-%m-%d %H:%M:%S') if task.date_deadline: deadline_dt = (datetime(*time.strptime(str(task.date_deadline),'%Y-%m-%d')[:3])+(new_end_date-old_end_date)).strftime('%Y-%m-%d') self.pool.get('project.task').write(cr, uid, task.id, {'date_start':start_dt, 'date_deadline':deadline_dt}) else: self.pool.get('project.task').write(cr, uid, task.id, {'date_start':start_dt}) return super(project_project,self).write(cr, uid, ids, vals, *args, **kwargs) | 6a3807ad02582f94099dad259dec71efaefa2c49 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6a3807ad02582f94099dad259dec71efaefa2c49/project_retro_planning.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
5773,
16,
380,
1968,
16,
2826,
4333,
4672,
309,
1549,
12,
2232,
16,
261,
474,
16,
1525,
3719,
30,
3258,
273,
306,
2232,
65,
309,
577... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
5773,
16,
380,
1968,
16,
2826,
4333,
4672,
309,
1549,
12,
2232,
16,
261,
474,
16,
1525,
3719,
30,
3258,
273,
306,
2232,
65,
309,
577... |
"join fetch i.pixels where i.id = '%d'" % imageId) | "join fetch i.pixels where i.id = '%d'" % imageId, None) | def getThumbnail(self, session, imageId): #gateway = session.createGateway() thumbnailStore = session.createThumbnailStore() image = session.getQueryService().findByQuery( "select i from Image as i " \ "join fetch i.pixels where i.id = '%d'" % imageId) if image is None: return None pId = image.getPrimaryPixels().getId().getValue() pixelsIds = [pId] s = thumbnailStore.getThumbnailByLongestSideSet(rint(16), pixelsIds) self.assertEqual(1, len(s)) s = thumbnailStore.getThumbnailSet(rint(16), rint(16), pixelsIds) self.assertEqual(1, len(s)) thumbnailStore.setPixelsId(pId) t = thumbnailStore.getThumbnail(rint(16),rint(16)) self.assertNotEqual(None, t) t = thumbnailStore.getThumbnailByLongestSide(rint(16)) self.assertNotEqual(None, t) thumbnailStore.close() #gateway.close() return t | bd90fe108250df731fe0a414f2c695f61ef435ee /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12409/bd90fe108250df731fe0a414f2c695f61ef435ee/thumbnailPerms.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
16270,
12,
2890,
16,
1339,
16,
30225,
4672,
225,
468,
11127,
273,
1339,
18,
2640,
5197,
1435,
9134,
2257,
273,
1339,
18,
2640,
16270,
2257,
1435,
225,
1316,
273,
1339,
18,
588,
1138... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16270,
12,
2890,
16,
1339,
16,
30225,
4672,
225,
468,
11127,
273,
1339,
18,
2640,
5197,
1435,
9134,
2257,
273,
1339,
18,
2640,
16270,
2257,
1435,
225,
1316,
273,
1339,
18,
588,
1138... |
apply(getattr(self, name), params) | return apply(getattr(self, name), params) | def _run(self, name, params): if hasattr(self, name): apply(getattr(self, name), params) else: raise AttributeError, name | 3aede25d6fabceacd46cac5e2a79b9b66d6f0b8a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11058/3aede25d6fabceacd46cac5e2a79b9b66d6f0b8a/gimpplugin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2681,
12,
2890,
16,
508,
16,
859,
4672,
309,
3859,
12,
2890,
16,
508,
4672,
327,
2230,
12,
588,
1747,
12,
2890,
16,
508,
3631,
859,
13,
469,
30,
1002,
6394,
16,
508,
2,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2681,
12,
2890,
16,
508,
16,
859,
4672,
309,
3859,
12,
2890,
16,
508,
4672,
327,
2230,
12,
588,
1747,
12,
2890,
16,
508,
3631,
859,
13,
469,
30,
1002,
6394,
16,
508,
2,
-100,
... |
return parts[0], (parts[1] if len(parts)>1 else '') | className, classAttribute = parts[0], (parts[1] if len(parts)>1 else '') return className, classAttribute | def attemptSplitIdentifier(context, assembled): # try qooxdoo classes first className, classAttribute = self._splitQxClass(assembled) if className: return className, classAttribute | 0974e61586e7f0a51452e4d5f07967c85a895878 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5718/0974e61586e7f0a51452e4d5f07967c85a895878/Class.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4395,
5521,
3004,
12,
2472,
16,
20489,
1259,
4672,
468,
775,
1043,
83,
2409,
2896,
83,
3318,
1122,
2658,
16,
667,
1499,
273,
365,
6315,
4939,
53,
92,
797,
12,
345,
5747,
1259,
13,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4395,
5521,
3004,
12,
2472,
16,
20489,
1259,
4672,
468,
775,
1043,
83,
2409,
2896,
83,
3318,
1122,
2658,
16,
667,
1499,
273,
365,
6315,
4939,
53,
92,
797,
12,
345,
5747,
1259,
13,
309,... |
subprocess.Popen(['patch', '-d', swdir, '-i', patchpath]).wait() | args = ['patch', '-d', swdir, '-i', patchpath, '-p0'] ret = subprocess.Popen(args).wait() if ret != 0: print >> sys.stderr, \ "patch failed and returned %d." % ret print >> sys.stderr, \ "Command was: %s" % " ".join(args) sys.exit(1) | def install_sw(swname, swver, swarc, swdir, swurl, swidir, swhash): swarc = os.path.join(extern_dir, swarc) swdir = os.path.join(extern_dir, swdir) if not os.path.exists(extern_dir): os.mkdir(extern_dir) if not os.path.exists(swarc): print "downloading %s" % swname try: fname, hdr = urllib.urlretrieve(swurl, swarc) except IOError: pass if not os.path.exists(swarc) or \ (hdr.gettype() != "application/x-gzip" and hdr.gettype() != "application/x-tar"): print "Unable to retrieve %s.\nPlease retrieve the file " \ "and place it at: %s\n" % (swurl, swarc) # remove a partial download or error message from proxy remove_sw(swname) sys.exit(1) if not os.path.exists(swdir): if not hash_sw(swname, swarc, swhash): sys.exit(1) print "unpacking %s" % swname tar = tarfile.open(swarc) # extractall doesn't exist until python 2.5 for m in tar.getmembers(): tar.extract(m, extern_dir) tar.close() # If there are patches, apply them now. patchdir = os.path.join("patch", swname) already_patched = os.path.join(swdir, ".patched") if os.path.exists(patchdir) and not os.path.exists(already_patched): patches = os.listdir(patchdir) for p in patches: patchpath = os.path.join(os.path.pardir, os.path.pardir, patchdir, p) print "Applying %s to %s" % (p, swname) subprocess.Popen(['patch', '-d', swdir, '-i', patchpath]).wait() file(already_patched, "w").close() swinst_dir = os.path.join(root_dir, py_install_dir, swidir) if not os.path.exists(swinst_dir): print "installing %s" % swname args = ['python', 'setup.py', 'install', '--root=%s' % root_dir, '--install-lib=%s' % py_install_dir, '--install-data=%s' % py_install_dir] ret = subprocess.Popen(args, cwd = swdir).wait() if ret != 0: print "install failed and returned %d." % ret print "Command was: %s" % " ".join(args) sys.exit(1) | 9bc819427a499a7d71b623a3fb0a22db005026b4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12612/9bc819427a499a7d71b623a3fb0a22db005026b4/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3799,
67,
5328,
12,
5328,
529,
16,
1352,
502,
16,
272,
905,
71,
16,
1352,
1214,
16,
1352,
718,
16,
1352,
350,
481,
16,
1352,
2816,
4672,
272,
905,
71,
273,
1140,
18,
803,
18,
5701,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3799,
67,
5328,
12,
5328,
529,
16,
1352,
502,
16,
272,
905,
71,
16,
1352,
1214,
16,
1352,
718,
16,
1352,
350,
481,
16,
1352,
2816,
4672,
272,
905,
71,
273,
1140,
18,
803,
18,
5701,
... |
else: CompileHello_Case.runtest (self) | self.build_id = " --build-id=0x12345678 " error_rc, _, _ = self.runcmd_unchecked(self.compiler() + (self.build_id + " -o junk %s" % self.sourceFilename())) if error_rc != 0: self.build_id = "" CompileHello_Case.runtest (self) | def runtest(self): # Don't try to run the test if gdb is not installed error_rc, _, _ = self.runcmd_unchecked("gdb --help") if error_rc != 0: raise comfychair.NotRunError ('gdb could not be found on path') else: CompileHello_Case.runtest (self) | d1f537052a826bca3d0c79f992e8b1a5a41577b9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4521/d1f537052a826bca3d0c79f992e8b1a5a41577b9/testdistcc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
3813,
12,
2890,
4672,
468,
7615,
1404,
775,
358,
1086,
326,
1842,
309,
314,
1966,
353,
486,
5876,
555,
67,
1310,
16,
389,
16,
389,
273,
365,
18,
86,
551,
1264,
67,
5847,
2932,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
3813,
12,
2890,
4672,
468,
7615,
1404,
775,
358,
1086,
326,
1842,
309,
314,
1966,
353,
486,
5876,
555,
67,
1310,
16,
389,
16,
389,
273,
365,
18,
86,
551,
1264,
67,
5847,
2932,
... |
tests.append(('OPERATIONS', optests)) | def complex(a, b, complex=__builtins__.complex): c = zeros(a.shape, dtype=complex) c.real = a c.imag = b return c | 5a55ddd6f5dccf6a603d032b045d6859a6e2a4f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/5a55ddd6f5dccf6a603d032b045d6859a6e2a4f6/test_numexpr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7233,
12,
69,
16,
324,
16,
7233,
33,
972,
12406,
2679,
25648,
14259,
4672,
276,
273,
4922,
12,
69,
18,
4867,
16,
3182,
33,
14259,
13,
276,
18,
7688,
273,
279,
276,
18,
15374,
273,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7233,
12,
69,
16,
324,
16,
7233,
33,
972,
12406,
2679,
25648,
14259,
4672,
276,
273,
4922,
12,
69,
18,
4867,
16,
3182,
33,
14259,
13,
276,
18,
7688,
273,
279,
276,
18,
15374,
273,
32... | |
return [(coldef.groupdict()["name"], coldef.groupdict()["type"]) for coldef in re.finditer(_sql_coldef_pattern, coldefs) if coldef.groupdict()["name"] not in ("PRIMARY", "UNIQUE", "CHECK")] | return [(coldef.groupdict()["name"], coldef.groupdict()["type"]) for coldef in re.finditer(_sql_coldef_pattern, coldefs) if coldef.groupdict()["name"].upper() not in ("PRIMARY", "UNIQUE", "CHECK")] | return [(coldef.groupdict()["name"], coldef.groupdict()["type"]) for coldef in re.finditer(_sql_coldef_pattern, coldefs) if coldef.groupdict()["name"] not in ("PRIMARY", "UNIQUE", "CHECK")] | 8994913ae6ac57e8ee70b7fa9d9dde61fc8f3bb8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5758/8994913ae6ac57e8ee70b7fa9d9dde61fc8f3bb8/dbtables.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
327,
306,
12,
1293,
536,
18,
1655,
1576,
1435,
9614,
529,
6,
6487,
645,
536,
18,
1655,
1576,
1435,
9614,
723,
6,
5717,
364,
645,
536,
316,
283,
18,
4720,
2165,
24899,
4669,
67,
1293,
536,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
327,
306,
12,
1293,
536,
18,
1655,
1576,
1435,
9614,
529,
6,
6487,
645,
536,
18,
1655,
1576,
1435,
9614,
723,
6,
5717,
364,
645,
536,
316,
283,
18,
4720,
2165,
24899,
4669,
67,
1293,
536,
... |
results = os.path.join(atrun.autodir, 'results', 'default') | results = os.path.join(atrun.autodir, 'results', 'default') | def _do_run(self, control_file, results_dir, host, atrun, timeout): try: atrun.verify_machine() except: print "Verify machine failed on %s. Reinstalling" % \ host.hostname self.install(host) atrun.verify_machine() debug = os.path.join(results_dir, 'debug') try: os.makedirs(debug) except: pass | 7de56c56f0ac0ba4ac9f5411aa58bb607bd40895 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12268/7de56c56f0ac0ba4ac9f5411aa58bb607bd40895/autotest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2896,
67,
2681,
12,
2890,
16,
3325,
67,
768,
16,
1686,
67,
1214,
16,
1479,
16,
622,
2681,
16,
2021,
4672,
775,
30,
622,
2681,
18,
8705,
67,
9149,
1435,
1335,
30,
1172,
315,
8097... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2896,
67,
2681,
12,
2890,
16,
3325,
67,
768,
16,
1686,
67,
1214,
16,
1479,
16,
622,
2681,
16,
2021,
4672,
775,
30,
622,
2681,
18,
8705,
67,
9149,
1435,
1335,
30,
1172,
315,
8097... |
return http.Response(stream=s) | return HTMLResponse(stream=s) | def render(self, ctx=None): # Create a live Sage worksheet out of self.path and render it. doc_page_html = open(self.docpath).read() from docHTMLProcessor import SphinxHTMLProcessor doc_page = SphinxHTMLProcessor().process_doc_html(doc_page_html) | 39855fabbbbe971c1c1d64566b1625e9c1c6d482 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/39855fabbbbe971c1c1d64566b1625e9c1c6d482/twist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
1103,
33,
7036,
4672,
468,
1788,
279,
8429,
348,
410,
13622,
596,
434,
365,
18,
803,
471,
1743,
518,
18,
997,
67,
2433,
67,
2620,
273,
1696,
12,
2890,
18,
2434,
8... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
1103,
33,
7036,
4672,
468,
1788,
279,
8429,
348,
410,
13622,
596,
434,
365,
18,
803,
471,
1743,
518,
18,
997,
67,
2433,
67,
2620,
273,
1696,
12,
2890,
18,
2434,
8... |
< j_1 m_1 \; j_2 m_2 | j_3 m_3 > | \langle j_1 m_1 \; j_2 m_2 | j_3 m_3 \rangle | def clebsch_gordan(j_1, j_2, j_3, m_1, m_2, m_3, prec=None): r""" Calculates the Clebsch-Gordan coefficient `< j_1 m_1 \; j_2 m_2 | j_3 m_3 >`. INPUT: - ``j_1``, ``j_2``, ``j_3``, ``m_1``, ``m_2``, ``m_3`` - integer or half integer - ``prec`` - precision, default: None. Providing a precision can drastically speed up the calculation. OUTPUT: rational number times the square root of a rational number (if prec=None), or real number if a precision is given EXAMPLES:: sage: simplify(clebsch_gordan(3/2,1/2,2, 3/2,1/2,2)) 1 sage: clebsch_gordan(1.5,0.5,1, 1.5,-0.5,1) 1/2*sqrt(3) sage: clebsch_gordan(3/2,1/2,1, -1/2,1/2,0) -sqrt(1/6)*sqrt(3) NOTES: The Clebsch-Gordan coefficient will be evaluated via its relation to Wigner 3j symbols: .. math:: < j_1 m_1 \; j_2 m_2 | j_3 m_3 > =(-1)^{j_1-j_2+m_3} \sqrt{2j_3+1} \; Wigner3j(j_1,j_2,j_3,m_1,m_2,-m_3) See also the documentation on Wigner 3j symbols which exhibit much higher symmetry relations than the Clebsch-Gordan coefficient. REFERENCES: - [Edmonds74] 'Angular Momentum in Quantum Mechanics', A. R. Edmonds, Princeton University Press (1974) - [Rasch03] 'Efficient Storage Scheme for Pre-calculated Wigner 3j, 6j and Gaunt Coefficients', J. Rasch and A. C. H. Yu, SIAM J. Sci. Comput. Volume 25, Issue 4, pp. 1416-1428 (2003) AUTHORS: - Jens Rasch (2009-03-24): initial version """ res = (-1) ** (int(j_1 - j_2 + m_3)) * (2 * j_3 + 1).sqrt(prec) * \ wigner_3j(j_1, j_2, j_3, m_1, m_2, -m_3, prec) return res | c6a90d820f57455b2ff6063db98cb5e6f7a11f83 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/c6a90d820f57455b2ff6063db98cb5e6f7a11f83/wigner.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1619,
2038,
343,
67,
75,
517,
304,
12,
78,
67,
21,
16,
525,
67,
22,
16,
525,
67,
23,
16,
312,
67,
21,
16,
312,
67,
22,
16,
312,
67,
23,
16,
13382,
33,
7036,
4672,
436,
8395,
26... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1619,
2038,
343,
67,
75,
517,
304,
12,
78,
67,
21,
16,
525,
67,
22,
16,
525,
67,
23,
16,
312,
67,
21,
16,
312,
67,
22,
16,
312,
67,
23,
16,
13382,
33,
7036,
4672,
436,
8395,
26... |
dbg("debugserver: started thread") | def spawn(env): | 74ba678cb4a993882269388a280c38a426475b05 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6502/74ba678cb4a993882269388a280c38a426475b05/debugserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12560,
12,
3074,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12560,
12,
3074,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
elif (rnd<.41): | elif (rnd<.9): | def contractMissionsFor(fac,minsysaway,maxsysaway): fac=faction_ships.intToFaction(fac) enemies = list(faction_ships.enemies[fac]) script='' cursystem = VS.getSystemFile() thisfaction = VS.GetGalaxyFaction (cursystem) preferredfaction=None if (VS.GetRelation (fac,thisfaction)>0): preferredfaction=thisfaction#try to stay in this territory l=[] for i in range (minsysaway,maxsysaway+1): for j in getSystemsNAway(cursystem,i,preferredfaction): import dynamic_battle try: l = dynamic_battle.persystemattacklist except: l= [] for k in l: if (VS.GetRelation(fac,l[1][1])>0): generateDefendMission(j,l[1][0],l[1][1],l[0][0],l[0][1]) if preferredfaction: for k in faction_ships.enemies[faction_ships.factiondict[thisfaction]]: for m in fg_util.FGsInSystem(k,j[-1]): if (vsrandom.randrange(0,4)==0):#fixme betterthan 4 generateBountyMission(j,m,k) m = FGsInSystem ("merchant",j[-1]) nummerchant=len(m) m+=FGsInSystem (thisfaction,j[-1]) numthisfac=len(m) m+=FGsInSystem (fac,j[-1]) numescort = vsrandom.randrange(0,10) if (numescort>len(m)): numescort=len(m) for k in range(numescort): f = "merchant" if f>=nummerchant: f= thisfaction if f>=numthisfac: f = fac generateEscortMission(j,k,f) for k in range(vsrandom.randrange(1,4)): ###FIXME: choose a better number than 4. if (rnd<.18): # 18% - Patrol mission generatePatrolMission(maxsysaway, minsysaway,vsrandom.randrange(4,10)) elif (rnd<.41): # 23% - Cargo mission generateCargoMission(path,true) elif (fac=='pirates'): # 5% - Contraband mission (cargo contraband) generateCargoMission(path,false) else: # 5% - Scout mission (patrol one planet) generatePatrolMission(path,1) | 917e934f83ea781edca1e94264eaa8ce824151a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/917e934f83ea781edca1e94264eaa8ce824151a8/dynamic_mission.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6835,
27797,
1115,
1290,
12,
11639,
16,
1154,
9499,
26718,
16,
1896,
9499,
26718,
4672,
5853,
33,
507,
349,
67,
3261,
87,
18,
474,
774,
42,
1128,
12,
11639,
13,
570,
351,
606,
273,
666... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6835,
27797,
1115,
1290,
12,
11639,
16,
1154,
9499,
26718,
16,
1896,
9499,
26718,
4672,
5853,
33,
507,
349,
67,
3261,
87,
18,
474,
774,
42,
1128,
12,
11639,
13,
570,
351,
606,
273,
666... |
inviter = Inviter(self.context, self.request, userInfo, | ctx = get_the_actual_instance_from_zope(self.context) inviter = Inviter(ctx, self.request, userInfo, | def get_auditor_inviter(self, userInfo): print 'InviteEditProfileForm.get_auditor_inviter' print '\tsiteInfo %s' % self.siteInfo.name inviter = Inviter(self.context, self.request, userInfo, self.adminInfo, self.siteInfo, self.groupInfo) auditor = Auditor(self.siteInfo, self.groupInfo, self.adminInfo, userInfo) return (auditor, inviter) | bcf965e538debaa8a427d5a45a26a665e34b0823 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6252/bcf965e538debaa8a427d5a45a26a665e34b0823/invite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
24901,
1811,
67,
5768,
2165,
12,
2890,
16,
16753,
4672,
1172,
296,
22730,
4666,
4029,
1204,
18,
588,
67,
24901,
1811,
67,
5768,
2165,
11,
1172,
2337,
3428,
1137,
966,
738,
87,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
24901,
1811,
67,
5768,
2165,
12,
2890,
16,
16753,
4672,
1172,
296,
22730,
4666,
4029,
1204,
18,
588,
67,
24901,
1811,
67,
5768,
2165,
11,
1172,
2337,
3428,
1137,
966,
738,
87,
... |
current_item_index = 0 | def _fill_controls_with_data(self, start=None, end=None): """Initially fill the controls in the dialog with data.""" if self.event == None: self.chb_period.SetValue(False) self.chb_show_time.SetValue(False) text = "" category = None self.updatemode = False else: start = self.event.time_period.start_time end = self.event.time_period.end_time text = self.event.text category = self.event.category self.updatemode = True if start != None and end != None: show_time = (start.time() != time(0, 0, 0) or end.time() != time(0, 0, 0)) self.chb_show_time.SetValue(show_time) self.chb_period.SetValue(start != end) self.dtp_start.set_value(start) self.dtp_end.set_value(end) self.txt_text.SetValue(text) current_item_index = 0 # Category Choice selection_set = False for cat in sort_categories(self.timeline.get_categories()): self.lst_category.Append(cat.name, cat) if cat == category: self.lst_category.SetSelection(current_item_index) selection_set = True current_item_index += 1 if not selection_set: self.lst_category.SetSelection(0) self.chb_close_on_ok.SetValue(True) self.dtp_end.Enable(self.chb_period.IsChecked()) self.dtp_start.show_time(self.chb_show_time.IsChecked()) self.dtp_end.show_time(self.chb_show_time.IsChecked()) | c5f04660f7f3e7652bfe9eda8caa7c2c6936ae95 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5252/c5f04660f7f3e7652bfe9eda8caa7c2c6936ae95/gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5935,
67,
24350,
67,
1918,
67,
892,
12,
2890,
16,
787,
33,
7036,
16,
679,
33,
7036,
4672,
3536,
2570,
6261,
3636,
326,
11022,
316,
326,
6176,
598,
501,
12123,
309,
365,
18,
2575,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5935,
67,
24350,
67,
1918,
67,
892,
12,
2890,
16,
787,
33,
7036,
16,
679,
33,
7036,
4672,
3536,
2570,
6261,
3636,
326,
11022,
316,
326,
6176,
598,
501,
12123,
309,
365,
18,
2575,
... | |
if isinstance(C,numpy.ma.MaskedArray): | if hasattr(C,'_mask'): | def update(self): """Update the figure. Everything happens here. The current set of customized properties is interpreted, data slices are obtained from the data sources, default figure properties are set based on properties of the obtained data, and the figure is built and shown. """ # We are called whenever figure properties change. If we do not want to update now, # just register that an update is needed and exit. if not self.updating: self.dirty = True return | 445e190e81be4643be602742e9faa1a01d71fc54 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/381/445e190e81be4643be602742e9faa1a01d71fc54/plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
4672,
3536,
1891,
326,
7837,
18,
225,
26553,
10555,
2674,
18,
1021,
783,
444,
434,
29063,
1790,
353,
19898,
16,
501,
12390,
854,
12700,
628,
326,
501,
5550,
16,
805,
7837... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
4672,
3536,
1891,
326,
7837,
18,
225,
26553,
10555,
2674,
18,
1021,
783,
444,
434,
29063,
1790,
353,
19898,
16,
501,
12390,
854,
12700,
628,
326,
501,
5550,
16,
805,
7837... |
ftpobj.login(urlparts.username, urlparts.password) | ftpobj.login(username, password) | def __init__(self, url): self.infostring = "" self.url = url urlparts = urlparse.urlparse(url) self.scheme = urlparts.scheme if self.scheme == "http": # need to set default port here port = httplib.HTTP_PORT try: if urlparts.port != None: port = urlparts.port except ValueError: self.infostring += "Response: Bad URL\r\n" return conn = HTTPConnection(urlparts.hostname, port) try: conn.request("HEAD", url) except socket.error, error: #dir(error) self.infostring += "Response: Connection Error\r\n" return resp = conn.getresponse() # handle redirects here and set self.url count = 0 while (resp.status == httplib.MOVED_PERMANENTLY or resp.status == httplib.FOUND) and count < MAX_REDIRECTS: url = resp.getheader("location") print "Redirected: %s" % url conn.close() urlparts = urlparse.urlparse(url) # need to set default port here port = httplib.HTTP_PORT if urlparts.port != None: port = urlparts.port conn = HTTPConnection(urlparts.hostname, urlparts.port) conn.request("HEAD", url) resp = conn.getresponse() count += 1 | 11e341a39251f7d370f532a7d33cafe13dcf4211 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6425/11e341a39251f7d370f532a7d33cafe13dcf4211/metalink.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
880,
4672,
365,
18,
18227,
371,
273,
1408,
365,
18,
718,
273,
880,
880,
6019,
273,
15185,
18,
718,
2670,
12,
718,
13,
365,
18,
9068,
273,
880,
6019,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
880,
4672,
365,
18,
18227,
371,
273,
1408,
365,
18,
718,
273,
880,
880,
6019,
273,
15185,
18,
718,
2670,
12,
718,
13,
365,
18,
9068,
273,
880,
6019,
18... |
def SetRight( self, value ) : | def SetRight(self, value): | def SetRight( self, value ) : self.Right = value return self | 13865299ef9bc077be9a5eaa4326b7a30307d828 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3330/13865299ef9bc077be9a5eaa4326b7a30307d828/PropertySets.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1000,
4726,
12,
2890,
16,
460,
4672,
365,
18,
4726,
273,
460,
327,
365,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1000,
4726,
12,
2890,
16,
460,
4672,
365,
18,
4726,
273,
460,
327,
365,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
res = "%ld" % a | res = str(a) | def repr__Int(space, w_int1): a = w_int1.intval res = "%ld" % a return space.wrap(res) | 6249717cad6d9e35ec668cdd0b4b99dac1050e63 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/6249717cad6d9e35ec668cdd0b4b99dac1050e63/intobject.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8480,
972,
1702,
12,
2981,
16,
341,
67,
474,
21,
4672,
279,
273,
341,
67,
474,
21,
18,
474,
1125,
400,
273,
609,
12,
69,
13,
327,
3476,
18,
4113,
12,
455,
13,
225,
2,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8480,
972,
1702,
12,
2981,
16,
341,
67,
474,
21,
4672,
279,
273,
341,
67,
474,
21,
18,
474,
1125,
400,
273,
609,
12,
69,
13,
327,
3476,
18,
4113,
12,
455,
13,
225,
2,
-100,
-100,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.