rem stringlengths 1 226k | add stringlengths 0 227k | context stringlengths 6 326k | meta stringlengths 143 403 | input_ids listlengths 256 256 | attention_mask listlengths 256 256 | labels listlengths 128 128 |
|---|---|---|---|---|---|---|
pPlayer = getPlayer(self.userid) for weapon in pPlayer.getWeaponList(): | pWeapons = spe.getWeaponDict(self.userid) if not pWeapons: return for weapon in pWeapons: | def strip(self, levelStrip=False, exceptions=[]): ''' * Strips/removes all weapons from the player minus the knife and their current levels weapon. | 02e919b0ad47effe0963368576895a6db2c8596f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4555/02e919b0ad47effe0963368576895a6db2c8596f/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2569,
12,
2890,
16,
1801,
16632,
33,
8381,
16,
4798,
33,
8526,
4672,
9163,
380,
3978,
7146,
19,
2764,
10829,
777,
732,
438,
7008,
628,
326,
7291,
12647,
326,
15516,
24723,
471,
3675,
783... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2569,
12,
2890,
16,
1801,
16632,
33,
8381,
16,
4798,
33,
8526,
4672,
9163,
380,
3978,
7146,
19,
2764,
10829,
777,
732,
438,
7008,
628,
326,
7291,
12647,
326,
15516,
24723,
471,
3675,
783... |
except e: | except Exception, e: | def query(path): if os.path.exists(path): entries = os.path.join(path, ".svn", "entries") if os.path.exists(entries): # old (svn 1.3) XML style format try: tree = ElementTree.parse(entries) for entry in tree.findall("{svn:}entry"): revision = entry.get("revision") url = entry.get("url") if revision != None and url != None: url = url.split("/") folder = url[5] if folder in ["tags", "branches"]: folder = url[6] return revision, folder #return revision except e: pass # new (svn 1.4) file format content = filetool.read(entries) mtch = DIRINFO.search(content) if mtch: folder = mtch.group(2) if folder in ["tags", "branches"]: folder = mtch.group(3) revision = mtch.group(1) return revision, folder return None, None | 90e0dd413da8e6795865941f4f28503db0914359 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5718/90e0dd413da8e6795865941f4f28503db0914359/svninfo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
843,
12,
803,
4672,
309,
1140,
18,
803,
18,
1808,
12,
803,
4672,
3222,
273,
1140,
18,
803,
18,
5701,
12,
803,
16,
3552,
31505,
3113,
315,
8219,
7923,
225,
309,
1140,
18,
803,
18,
180... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
843,
12,
803,
4672,
309,
1140,
18,
803,
18,
1808,
12,
803,
4672,
3222,
273,
1140,
18,
803,
18,
5701,
12,
803,
16,
3552,
31505,
3113,
315,
8219,
7923,
225,
309,
1140,
18,
803,
18,
180... |
self.vboxlayout7.addLayout(self.hboxlayout7) | self.vboxlayout6.addLayout(self.hboxlayout7) | def setupUi(self, UserPrefsDialog): UserPrefsDialog.setObjectName("UserPrefsDialog") UserPrefsDialog.resize(QtCore.QSize(QtCore.QRect(0,0,609,642).size()).expandedTo(UserPrefsDialog.minimumSizeHint())) | 30deb2219e016847d91b37e801c50b75fbd1c3cf /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/30deb2219e016847d91b37e801c50b75fbd1c3cf/UserPrefsDialog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
13943,
12,
2890,
16,
2177,
1386,
2556,
6353,
4672,
2177,
1386,
2556,
6353,
18,
542,
16707,
2932,
1299,
1386,
2556,
6353,
7923,
2177,
1386,
2556,
6353,
18,
15169,
12,
23310,
4670,
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,
3875,
13943,
12,
2890,
16,
2177,
1386,
2556,
6353,
4672,
2177,
1386,
2556,
6353,
18,
542,
16707,
2932,
1299,
1386,
2556,
6353,
7923,
2177,
1386,
2556,
6353,
18,
15169,
12,
23310,
4670,
18,... |
date_published = models.IntegerField(blank=True) | date_published = models.CharField(maxlength=250, blank=True) | def quick_search(self, pattern): return super(MediaCollectionManager, self).get_query_set().filter( Q(title__icontains=pattern) | Q(creator__icontains=pattern) ) | f681344a89dfd0dfe86e90ff4d7f8588d2af7617 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12043/f681344a89dfd0dfe86e90ff4d7f8588d2af7617/models.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9549,
67,
3072,
12,
2890,
16,
1936,
4672,
327,
2240,
12,
5419,
2532,
1318,
16,
365,
2934,
588,
67,
2271,
67,
542,
7675,
2188,
12,
2238,
12,
2649,
972,
335,
1580,
4167,
33,
4951,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9549,
67,
3072,
12,
2890,
16,
1936,
4672,
327,
2240,
12,
5419,
2532,
1318,
16,
365,
2934,
588,
67,
2271,
67,
542,
7675,
2188,
12,
2238,
12,
2649,
972,
335,
1580,
4167,
33,
4951,
13,
... |
"""Lists teachers of this group""" | """List teachers of this group.""" | def teachersList(self): """Lists teachers of this group""" result = [(obj.title, getPath(obj), absoluteURL(self.request, obj)) for obj in getRelatedObjects(self.context, URITeacher)] result.sort() return result | b0db1e1a915235bc35c123b3d07c2c6a1f5bb36c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7127/b0db1e1a915235bc35c123b3d07c2c6a1f5bb36c/model.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6489,
497,
414,
682,
12,
2890,
4672,
3536,
682,
6489,
497,
414,
434,
333,
1041,
12123,
563,
273,
306,
12,
2603,
18,
2649,
16,
4339,
12,
2603,
3631,
4967,
1785,
12,
2890,
18,
2293,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6489,
497,
414,
682,
12,
2890,
4672,
3536,
682,
6489,
497,
414,
434,
333,
1041,
12123,
563,
273,
306,
12,
2603,
18,
2649,
16,
4339,
12,
2603,
3631,
4967,
1785,
12,
2890,
18,
2293,
16,
... |
matrix_string = '%s %d' % (matrix_string, matrix[j]) | matrix_string = '%s %f' % (matrix_string, matrix[j]) | def convert(self, matrix): self.reset() self.add_command_line('MAT') | 4a49dbbb4eac6fb6cf559653e539232e58dba682 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3290/4a49dbbb4eac6fb6cf559653e539232e58dba682/Mat2symop.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
12,
2890,
16,
3148,
4672,
365,
18,
6208,
1435,
365,
18,
1289,
67,
3076,
67,
1369,
2668,
24571,
6134,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1765,
12,
2890,
16,
3148,
4672,
365,
18,
6208,
1435,
365,
18,
1289,
67,
3076,
67,
1369,
2668,
24571,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
self.send(pack("!iiiii", PROT_VERSION, PKT_HELLO, 8, size[0], size[1])) version, = unpack("!i", self.recv(4)) if version > PROT_VERSION: print "Unsupported server version: %d", version sys.exit(-1) hello, len = unpack("!ii", self.recv(8)) if hello != PKT_HELLO or len != 0: print "Unexpected packet received" sys.exit(-1) while True: pkt_type, len = unpack("!ii", self.sock.recv(8)) if pkt_type == PKT_CURRSLIDE and len > 4: page_number = unpack("!i", self.sock.recv(4)) jpg_len, = unpack("!i", self.sock.recv(4)) slide_jpg = self.read_bytes(jpg_len) notes_len, = unpack("!i", self.sock.recv(4)) notes = str.decode(self.read_bytes(notes_len),'utf-8') f = cStringIO.StringIO() f.write(slide_jpg) f.seek(0) slide = pygame.image.load(f, 'img.jpg') f.close() self.ui.set_slide(slide, notes) | try: self.send(pack("!iiiii", PROT_VERSION, PKT_HELLO, 8, size[0], size[1])) version, = unpack("!i", self.recv(4)) if version > PROT_VERSION: print "Unsupported server version: %d", version sys.exit(-1) hello, len = unpack("!ii", self.recv(8)) if hello != PKT_HELLO or len != 0: print "Unexpected packet received" sys.exit(-1) while True: pkt_type, len = unpack("!ii", self.sock.recv(8)) if pkt_type == PKT_CURRSLIDE and len > 4: page_number = unpack("!i", self.sock.recv(4)) jpg_len, = unpack("!i", self.sock.recv(4)) slide_jpg = self.read_bytes(jpg_len) notes_len, = unpack("!i", self.sock.recv(4)) notes = str.decode(self.read_bytes(notes_len),'utf-8') f = cStringIO.StringIO() f.write(slide_jpg) f.seek(0) slide = pygame.image.load(f, 'img.jpg') f.close() self.ui.set_slide(slide, notes) except: print "Disconnected" pygame.event.post(Event(pygame.QUIT)) | def run(self): | 571640c83813b5ab1f297405a6ec6fab9e453edc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3598/571640c83813b5ab1f297405a6ec6fab9e453edc/xpressent-remote.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
self.assertEqual(err[-1], b'OK') | self.assertIn(b'OK', err) | def get_parse_out_err(p): return [b.splitlines() for b in p.communicate()] | f10c400b91e44c5c744f4ddc05d90933cba3a56b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/f10c400b91e44c5c744f4ddc05d90933cba3a56b/test_runner.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2670,
67,
659,
67,
370,
12,
84,
4672,
327,
306,
70,
18,
4939,
3548,
1435,
364,
324,
316,
293,
18,
5702,
318,
2659,
1435,
65,
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,
336,
67,
2670,
67,
659,
67,
370,
12,
84,
4672,
327,
306,
70,
18,
4939,
3548,
1435,
364,
324,
316,
293,
18,
5702,
318,
2659,
1435,
65,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
result = self.load(prepare) | result = self.load(prepare, ref=False) | def freeWait(self): """downloads html with the important informations """ self.html[1] = self.load(self.pyfile.url) self.no_download = True | c175b751e48f0b533cc11f99aa0c636c70b73bc8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9838/c175b751e48f0b533cc11f99aa0c636c70b73bc8/RapidshareCom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4843,
5480,
12,
2890,
4672,
3536,
7813,
87,
1729,
598,
326,
10802,
26978,
3536,
365,
18,
2620,
63,
21,
65,
273,
365,
18,
945,
12,
2890,
18,
2074,
768,
18,
718,
13,
365,
18,
2135,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4843,
5480,
12,
2890,
4672,
3536,
7813,
87,
1729,
598,
326,
10802,
26978,
3536,
365,
18,
2620,
63,
21,
65,
273,
365,
18,
945,
12,
2890,
18,
2074,
768,
18,
718,
13,
365,
18,
2135,
67,... |
self.append(self.read(len)) | self.append(str(self.read(len), "latin-1")) | def load_short_binstring(self): len = ord(self.read(1)) self.append(self.read(len)) | 32c5b86893d8cb9f5c422a7a2945f4f24f131503 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/32c5b86893d8cb9f5c422a7a2945f4f24f131503/pickle.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
6620,
67,
4757,
1080,
12,
2890,
4672,
562,
273,
4642,
12,
2890,
18,
896,
12,
21,
3719,
365,
18,
6923,
12,
2890,
18,
896,
12,
1897,
3719,
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,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
6620,
67,
4757,
1080,
12,
2890,
4672,
562,
273,
4642,
12,
2890,
18,
896,
12,
21,
3719,
365,
18,
6923,
12,
2890,
18,
896,
12,
1897,
3719,
2,
-100,
-100,
-100,
-100,
-100,
-1... |
df = lambda file, linkrel: self.doFile[0](file, linkrel, d['ext'], | df = lambda file, linkrel: self.doFile[0](file, linkrel, ext, | def generate_html(self, d): n = htmlDefault.copy() n.update(d) d = n if d['ext'] == "None": ext = "" else: ext = d['ext'] try: fp = open(d['template']) templ = microdom.parse(fp) except IOError, e: raise process.NoProcessorError(e.filename+": "+e.strerror) except sux.ParseError, e: raise process.NoProcessorError(str(e)) df = lambda file, linkrel: self.doFile[0](file, linkrel, d['ext'], d['baseurl'], templ) return df | 5d5a28ac3fa3f3ca37cc0cce9e03b64e59aec95a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/5d5a28ac3fa3f3ca37cc0cce9e03b64e59aec95a/default.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
2620,
12,
2890,
16,
302,
4672,
290,
273,
1729,
1868,
18,
3530,
1435,
290,
18,
2725,
12,
72,
13,
302,
273,
290,
309,
302,
3292,
408,
3546,
422,
315,
7036,
6877,
1110,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
2620,
12,
2890,
16,
302,
4672,
290,
273,
1729,
1868,
18,
3530,
1435,
290,
18,
2725,
12,
72,
13,
302,
273,
290,
309,
302,
3292,
408,
3546,
422,
315,
7036,
6877,
1110,
273,
1... |
entry.setProp ('name', FieldName) | entry.setProp('name', FieldName) | def makeTab (self, xmlObj, crud): kind_name= xmlObj.prop ('name') KindName= MakeFieldName (kind_name) kind = self.xot.tables[kind_name] | 615d4783694081a61062f380e45f479cfeadf918 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/615d4783694081a61062f380e45f479cfeadf918/CimarronXMLui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
5661,
261,
2890,
16,
2025,
2675,
16,
16031,
4672,
3846,
67,
529,
33,
2025,
2675,
18,
5986,
7707,
529,
6134,
5851,
461,
33,
4344,
7287,
261,
9224,
67,
529,
13,
3846,
273,
365,
18,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
5661,
261,
2890,
16,
2025,
2675,
16,
16031,
4672,
3846,
67,
529,
33,
2025,
2675,
18,
5986,
7707,
529,
6134,
5851,
461,
33,
4344,
7287,
261,
9224,
67,
529,
13,
3846,
273,
365,
18,... |
def alias(old,new): template.macros[old] = template.macros.get( new, standard_wikipage.macros[new]) alias("head","head") alias("linkpanel","linkpanel") alias("navpanel","navpanel") alias("quickaccesskeys","accesskeys") alias("quicklinks","wikilinks") alias("displaymodes","displaymodes") alias("editlinks","pagelinks") alias("logolink","logolink") alias("pagenameand","pagenameand") alias("pagename","pagenameand") alias("commentform","commentform") alias("pagemanagement","pagemanagementform") return template | def alias(old,new): template.macros[old] = template.macros.get( new, standard_wikipage.macros[new]) | a1649159b45e464fc2ff70925f37bfcf3e70f495 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5225/a1649159b45e464fc2ff70925f37bfcf3e70f495/UI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2308,
12,
1673,
16,
2704,
4672,
1542,
18,
5821,
6973,
63,
1673,
65,
273,
1542,
18,
5821,
6973,
18,
588,
12,
394,
16,
4529,
67,
11999,
625,
410,
18,
5821,
6973,
63,
2704,
5717,
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,
2308,
12,
1673,
16,
2704,
4672,
1542,
18,
5821,
6973,
63,
1673,
65,
273,
1542,
18,
5821,
6973,
18,
588,
12,
394,
16,
4529,
67,
11999,
625,
410,
18,
5821,
6973,
63,
2704,
5717,
2,
-10... | |
start = context.get_form_value('start', type=Integer, default=0) | start = context.get_form_value('batchstart', type=Integer, default=0) | def site_search(self, context): root = context.root | 900bac0f78b12961d9ce547c1323046c46bd1b20 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12681/900bac0f78b12961d9ce547c1323046c46bd1b20/website.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2834,
67,
3072,
12,
2890,
16,
819,
4672,
1365,
273,
819,
18,
3085,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2834,
67,
3072,
12,
2890,
16,
819,
4672,
1365,
273,
819,
18,
3085,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
def add_unique_to_list(self,username,list): | def store_list(self,list,listname): """Store list in DB""" if len(list)>0: self.insert_user_data(nick="%s (Target)" % self.client_id,data_type=listname,data=",".join(list),sessionid=-99) def add_unique_to_list(self,data,list): | def add_unique_to_list(self,username,list): #Add a unique entry to the list specified try: if (list.index(username)): #Already in the list pass except ValueError: #Don't have this one, so insert it list.append(username) #logging.log(logging.VERBOSE_DEBUG, "Appending to list:%s" % (list)) | 80596cb4e5bd83259bd52b61bb7dd6a3b3b8d784 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5568/80596cb4e5bd83259bd52b61bb7dd6a3b3b8d784/MSN.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1707,
67,
1098,
12,
2890,
16,
1098,
16,
1098,
529,
4672,
3536,
2257,
666,
316,
2383,
8395,
309,
562,
12,
1098,
13,
34,
20,
30,
225,
365,
18,
6387,
67,
1355,
67,
892,
12,
17091,
11613... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1707,
67,
1098,
12,
2890,
16,
1098,
16,
1098,
529,
4672,
3536,
2257,
666,
316,
2383,
8395,
309,
562,
12,
1098,
13,
34,
20,
30,
225,
365,
18,
6387,
67,
1355,
67,
892,
12,
17091,
11613... |
cmpstr1 = cmpstr1[i1:] cmpstr2 = cmpstr2[i2:] cn1 = len( cmpstr1 ) cn2 = len( cmpstr2 ) | def __compare_node( self, node1, node2, callback ): """Compare two nodes.""" | 93b2dc695fe501f9e0252ae41d6dd540e118d8cd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13212/93b2dc695fe501f9e0252ae41d6dd540e118d8cd/diff.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9877,
67,
2159,
12,
365,
16,
756,
21,
16,
756,
22,
16,
1348,
262,
30,
3536,
8583,
2795,
2199,
12123,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9877,
67,
2159,
12,
365,
16,
756,
21,
16,
756,
22,
16,
1348,
262,
30,
3536,
8583,
2795,
2199,
12123,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
if assume and self._op == operator.eq: return 'equal(%s, %s)'%(l, r) | if assume: if self._op == operator.eq: return 'equal(%s, %s)'%(l, r) elif self._op == operator.ne: return 'notequal(%s, %s)'%(l, r) | def _maxima_init_(self, maxima=maxima, assume=False): """ Return string representation for this symbolic equation in a form suitable for evaluation in Maxima. | 1e04537264f2e486d86d5fc67f910cc70a5fd4c7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/1e04537264f2e486d86d5fc67f910cc70a5fd4c7/equations.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1896,
13888,
67,
2738,
67,
12,
2890,
16,
943,
13888,
33,
1896,
13888,
16,
6750,
33,
8381,
4672,
3536,
2000,
533,
4335,
364,
333,
16754,
15778,
316,
279,
646,
10631,
364,
9873,
316,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
389,
1896,
13888,
67,
2738,
67,
12,
2890,
16,
943,
13888,
33,
1896,
13888,
16,
6750,
33,
8381,
4672,
3536,
2000,
533,
4335,
364,
333,
16754,
15778,
316,
279,
646,
10631,
364,
9873,
316,
... |
cache = self.PhotoSizeCache() | cache = PhotoSizeCache() | def remove_set(self): cache = self.PhotoSizeCache() for photosize in cache.sizes.values(): self.remove_size(photosize, False) try: os.removedirs(self.cache_path()) except: pass | 97d8ab46617aec21cd957429b4350e0ccc04fece /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10711/97d8ab46617aec21cd957429b4350e0ccc04fece/models.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
67,
542,
12,
2890,
4672,
1247,
273,
26867,
1225,
1649,
1435,
364,
18185,
554,
316,
1247,
18,
11914,
18,
2372,
13332,
365,
18,
4479,
67,
1467,
12,
29121,
554,
16,
1083,
13,
775,
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,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
67,
542,
12,
2890,
4672,
1247,
273,
26867,
1225,
1649,
1435,
364,
18185,
554,
316,
1247,
18,
11914,
18,
2372,
13332,
365,
18,
4479,
67,
1467,
12,
29121,
554,
16,
1083,
13,
775,
3... |
time_tag_list.append("e"+str(config.end)) | if config.bin: head_str = "eb" else: head_str = "e" time_tag_list.append(head_str+str(int(config.end))) | def run(config): """ This method is where the processing is done. @param config: Object containing the driver configuration information. @type config: L{hlr_utils.Configure} """ if config.data is None: raise RuntimeError("Need to pass a data filename to the driver "\ +"script.") so_axis = "time_of_flight" if config.verbose: print "Reading data file" d_som1 = dr_lib.add_files(config.data, Data_Paths=config.data_paths.toPath(), SO_Axis=so_axis, Verbose=config.verbose)[0] print "A:", config.start, config.end # Use start and end keywords to make slices (see online docs) d_som2 = dr_lib.integrate_spectra(d_som1, start=config.start, end=config.end, bin_index=config.bin) del d_som1 time_tag_list = [] if config.start is not None: time_tag_list.append("s"+str(config.start)) if config.end is not None: time_tag_list.append("e"+str(config.end)) time_tag = "_".join(time_tag_list) if time_tag == "": time_tag = None hlr_utils.write_file(config.output, "text/num-info", d_som2, output_ext="xys", data_ext=config.ext_replacement, path_replacement=config.path_replacement, verbose=config.verbose, message="xy sums", extra_tag=time_tag, units="counts") | 85aa363ec74082603802f1f344f626920c2bd4e3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/763/85aa363ec74082603802f1f344f626920c2bd4e3/xy_sum.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
1425,
4672,
3536,
1220,
707,
353,
1625,
326,
4929,
353,
2731,
18,
225,
632,
891,
642,
30,
1033,
4191,
326,
3419,
1664,
1779,
18,
632,
723,
642,
30,
511,
95,
76,
10826,
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,
1086,
12,
1425,
4672,
3536,
1220,
707,
353,
1625,
326,
4929,
353,
2731,
18,
225,
632,
891,
642,
30,
1033,
4191,
326,
3419,
1664,
1779,
18,
632,
723,
642,
30,
511,
95,
76,
10826,
67,
... |
self.log("found " + unicode(self.html_preprocess_sections) + | self.log("marked " + unicode(self.html_preprocess_sections) + | def chapter_head(self, match): chap = match.group('chap') title = match.group('title') if not title: self.html_preprocess_sections = self.html_preprocess_sections + 1 self.log("found " + unicode(self.html_preprocess_sections) + " chapters. - " + unicode(chap)) return '<h2>'+chap+'</h2>\n' else: self.html_preprocess_sections = self.html_preprocess_sections + 1 self.log("found " + unicode(self.html_preprocess_sections) + " chapters & titles. - " + unicode(chap) + ", " + unicode(title)) return '<h2>'+chap+'</h2>\n<h3>'+title+'</h3>\n' | 7b35480ce2acf9a947193f504fe26ac78fb8ca94 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/7b35480ce2acf9a947193f504fe26ac78fb8ca94/utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23580,
67,
1978,
12,
2890,
16,
845,
4672,
462,
438,
273,
845,
18,
1655,
2668,
343,
438,
6134,
2077,
273,
845,
18,
1655,
2668,
2649,
6134,
309,
486,
2077,
30,
365,
18,
2620,
67,
27545,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23580,
67,
1978,
12,
2890,
16,
845,
4672,
462,
438,
273,
845,
18,
1655,
2668,
343,
438,
6134,
2077,
273,
845,
18,
1655,
2668,
2649,
6134,
309,
486,
2077,
30,
365,
18,
2620,
67,
27545,
... |
"""This function Processes email and create record for given OpenERP model | """This function Processes email and create record for given OpenERP model | def process_email(self, cr, uid, model, message, attach=True, context=None): """This function Processes email and create record for given OpenERP model @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param model: OpenObject Model @param message: Email details @param attach: Email attachments @param context: A standard dictionary for contextual values""" model_pool = self.pool.get(model) if not context: context = {} res_id = False # Create New Record into particular model def create_record(msg): if hasattr(model_pool, 'message_new'): res_id = model_pool.message_new(cr, uid, msg, context) else: data = { 'name': msg.get('subject'), 'email_from': msg.get('from'), 'email_cc': msg.get('cc'), 'user_id': False, 'description': msg.get('body'), 'state' : 'draft', } data.update(self.get_partner(cr, uid, msg.get('from'), context=context)) res_id = model_pool.create(cr, uid, data, context=context) | ff0e181c263e871d5c1c3ae10c06c6a7a3f7da7b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ff0e181c263e871d5c1c3ae10c06c6a7a3f7da7b/mail_gateway.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
3652,
12,
2890,
16,
4422,
16,
4555,
16,
938,
16,
883,
16,
3306,
33,
5510,
16,
819,
33,
7036,
4672,
3536,
2503,
445,
4389,
281,
2699,
471,
752,
1409,
364,
864,
3502,
654,
52... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3652,
12,
2890,
16,
4422,
16,
4555,
16,
938,
16,
883,
16,
3306,
33,
5510,
16,
819,
33,
7036,
4672,
3536,
2503,
445,
4389,
281,
2699,
471,
752,
1409,
364,
864,
3502,
654,
52... |
checked=form_get(request, 'case'), id='case'), | checked=form_get(request, 'case', escaped=True), id='case'), | def advanced_ui(macro): """ Returns the code for the advanced search user interface @param macro: current macro instance """ _ = macro._ f = macro.formatter request = macro.request disabledIfMoinSearch = not request.cfg.xapian_search and \ ' disabled="disabled"' or '' search_boxes = ''.join([ f.table_row(1), f.table_cell(1, attrs={'rowspan': '5', 'class': 'searchfor'}), f.text(_('Search for items')), f.table_cell(0), ''.join([''.join([ f.table_row(1), f.table_cell(1), f.text(txt), f.table_cell(0), f.table_cell(1), f.rawHTML(input_field), f.table_cell(0), f.table_row(0), ]) for txt, input_field in ( (_('containing all the following terms'), '<input type="text" name="and_terms" size="30" value="%s">' % (form_get(request, 'and_terms') or form_get(request, 'value'))), (_('containing one or more of the following terms'), '<input type="text" name="or_terms" size="30" value="%s">' % form_get(request, 'or_terms')), (_('not containing the following terms'), '<input type="text" name="not_terms" size="30" value="%s">' % form_get(request, 'not_terms')), #('containing only one of the following terms', # '<input type="text" name="xor_terms" size="30" value="%s">' # % form_get(request, 'xor_terms')), # TODO: dropdown-box? (_('last modified since (e.g. last 2 weeks)'), '<input type="text" name="mtime" size="30" value="%s">' % form_get(request, 'mtime')), )]) ]) # category selection categories = form_get(request, 'categories') c_select = makeSelection('categories', [('', _('any category'))] + [(cat, '%s' % cat) for cat in getCategories(request)], categories, 3, True) # language selection searchedlang = form_get(request, 'language') langs = dict([(lang, lmeta['x-language-in-english']) for lang, lmeta in languages.items()]) userlang = macro.request.lang lang_select = makeSelection('language', [('', _('any language')), (userlang, langs[userlang])] + sorted(langs.items(), key=lambda i: i[1]), searchedlang, 3, True) # mimetype selection mimetype = form_get(request, 'mimetype') mt_select = makeSelection('mimetype', [('', _('any mimetype'))] + [(type, 'all %s files' % type) for type in getMimetypes()] + [(m[1], '*%s - %s' % m) for m in sorted(mimetypes.types_map.items())], mimetype, 3, True) # misc search options (checkboxes) search_options = ''.join([ ''.join([ f.table_row(1), f.table_cell(1, attrs={'class': 'searchfor'}), txt[0], f.table_cell(0), f.table_cell(1, colspan=2), unicode(txt[1]), txt[2], f.table_cell(0), f.table_row(0), ]) for txt in ( (_('Categories'), unicode(c_select), ''), (_('Language'), unicode(lang_select), ''), (_('File Type'), unicode(mt_select), ''), ('', html.INPUT(type='checkbox', name='titlesearch', value='1', checked=form_get(request, 'titlesearch'), id='titlesearch'), '<label for="titlesearch">%s</label>' % _('Search only in titles')), ('', html.INPUT(type='checkbox', name='case', value='1', checked=form_get(request, 'case'), id='case'), '<label for="case">%s</label>' % _('Case-sensitive search')), ('', html.INPUT(type='checkbox', name='excludeunderlay', value='1', checked=form_get(request, 'excludeunderlay'), id='excludeunderlay'), '<label for="excludeunderlay">%s</label>' % _('Exclude underlay')), ('', html.INPUT(type='checkbox', name='nosystemitems', value='1', checked=form_get(request, 'nosystemitems'), id='nosystempages'), '<label for="nosystempages">%s</label>' % _('No system items')), ('', html.INPUT(type='checkbox', name='historysearch', value='1', checked=form_get(request, 'historysearch'), disabled=(not request.cfg.xapian_search or not request.cfg.xapian_index_history), id='historysearch'), '<label for="historysearch">%s</label>' % _('Search in all page revisions')) ) ]) # the dialogue return f.rawHTML('\n'.join([ u'<form method="get" action="%s/%s">' % (macro.request.getScriptname(), wikiutil.quoteWikinameURL(macro.request.formatter.page.page_name)), u'<div>', u'<input type="hidden" name="action" value="fullsearch">', u'<input type="hidden" name="advancedsearch" value="1">', f.table(1, attrs={'tableclass': 'advancedsearch'}), search_boxes, search_options, f.table_row(1), f.table_cell(1, attrs={'class': 'submit', 'colspan': '3'}), u'<input type="submit" value="%s">' % _('Go get it!'), f.table_cell(0), f.table_row(0), f.table(0), u'</div>', u'</form>', ])) | 64bbbaa35e708345ab13c5f9e67c9054fad53cc7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/888/64bbbaa35e708345ab13c5f9e67c9054fad53cc7/AdvancedSearch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16111,
67,
4881,
12,
26448,
4672,
3536,
2860,
326,
981,
364,
326,
16111,
1623,
729,
1560,
225,
632,
891,
11522,
30,
783,
11522,
791,
3536,
389,
273,
11522,
6315,
284,
273,
11522,
18,
123... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16111,
67,
4881,
12,
26448,
4672,
3536,
2860,
326,
981,
364,
326,
16111,
1623,
729,
1560,
225,
632,
891,
11522,
30,
783,
11522,
791,
3536,
389,
273,
11522,
6315,
284,
273,
11522,
18,
123... |
namedColors[name] = value return namedColors | __namedColors[name] = value return __namedColors | def getAllNamedColors(): #returns a dictionary of all the named ones in the module # uses a singleton for efficiency import colors namedColors = {} for (name, value) in colors.__dict__.items(): if isinstance(value, Color): namedColors[name] = value return namedColors | 0b27b1794376ae69f5568d27adffe3d64cca6730 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0b27b1794376ae69f5568d27adffe3d64cca6730/colors.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5514,
7604,
12570,
13332,
468,
6154,
279,
3880,
434,
777,
326,
4141,
5945,
316,
326,
1605,
468,
4692,
279,
6396,
364,
30325,
1930,
5740,
4141,
12570,
273,
2618,
364,
261,
529,
16,
460,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5514,
7604,
12570,
13332,
468,
6154,
279,
3880,
434,
777,
326,
4141,
5945,
316,
326,
1605,
468,
4692,
279,
6396,
364,
30325,
1930,
5740,
4141,
12570,
273,
2618,
364,
261,
529,
16,
460,
1... |
def __init__(self, default_setup=True): | def __init__(self, default_setup = True): """ Initializes the Strings enumeration helper class @param default_setup: Set to True to use default setup (C strings, min len 5, ...) """ self.size = 0 | def __init__(self, default_setup=True): if default_setup: self.setup() self._si = idaapi.string_info_t() self.size = 0 | 15a72289f7818b9af9e54703db7915ed66e0e427 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4773/15a72289f7818b9af9e54703db7915ed66e0e427/idautils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
805,
67,
8401,
273,
1053,
4672,
3536,
10188,
3128,
326,
8139,
16836,
4222,
667,
225,
632,
891,
805,
67,
8401,
30,
1000,
358,
1053,
358,
999,
805,
3875,
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,
1001,
2738,
972,
12,
2890,
16,
805,
67,
8401,
273,
1053,
4672,
3536,
10188,
3128,
326,
8139,
16836,
4222,
667,
225,
632,
891,
805,
67,
8401,
30,
1000,
358,
1053,
358,
999,
805,
3875,
2... |
ans = ans._fix(context=context) | ans = ans._fix(context) | def __add__(self, other, context=None): """Returns self + other. | dab988dd23e6328dadfe8408cd96abf4b017380d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dab988dd23e6328dadfe8408cd96abf4b017380d/decimal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1289,
972,
12,
2890,
16,
1308,
16,
819,
33,
7036,
4672,
3536,
1356,
365,
397,
1308,
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,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1289,
972,
12,
2890,
16,
1308,
16,
819,
33,
7036,
4672,
3536,
1356,
365,
397,
1308,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
np.long('0x' + 'f'*i_width,16) | long('0x' + 'f'*i_width,16) | def check_intp(self,level=rlevel): """Ticket #99""" i_width = np.int_(0).nbytes*2 - 1 np.long('0x' + 'f'*i_width,16) self.failUnlessRaises(OverflowError,np.intp,'0x' + 'f'*(i_width+1),16) self.failUnlessRaises(ValueError,np.intp,'0x1',32) assert_equal(255,np.long('0xFF',16)) assert_equal(1024,np.long(1024)) | 4f9812e079bf6331f99b6ba2b18836ad7b707636 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/14925/4f9812e079bf6331f99b6ba2b18836ad7b707636/test_regression.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
474,
84,
12,
2890,
16,
2815,
33,
86,
2815,
4672,
3536,
13614,
468,
2733,
8395,
277,
67,
2819,
273,
1130,
18,
474,
67,
12,
20,
2934,
82,
3890,
14,
22,
300,
404,
1525,
2668,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
474,
84,
12,
2890,
16,
2815,
33,
86,
2815,
4672,
3536,
13614,
468,
2733,
8395,
277,
67,
2819,
273,
1130,
18,
474,
67,
12,
20,
2934,
82,
3890,
14,
22,
300,
404,
1525,
2668,
... |
state = stylePyStart | if ch in '\r\n': state = STYLE_INTERACTIVE_EOL else: state = stylePyStart | def ColorizeInteractiveCode(self, cdoc, styleStart, stylePyStart): lengthDoc = len(cdoc) if lengthDoc == 0: return state = styleStart chNext = cdoc[0] startSeg = 0 i = 0 lastState=state # debug only while i < lengthDoc: ch = chNext chNext = cdoc[i+1:i+2] | 7b02afc37bb0a2adec16623ebe1fda3f571d8c11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/992/7b02afc37bb0a2adec16623ebe1fda3f571d8c11/interact.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5563,
554,
26442,
1085,
12,
2890,
16,
276,
2434,
16,
2154,
1685,
16,
2154,
9413,
1685,
4672,
769,
1759,
273,
562,
12,
71,
2434,
13,
309,
769,
1759,
422,
374,
30,
327,
919,
273,
2154,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5563,
554,
26442,
1085,
12,
2890,
16,
276,
2434,
16,
2154,
1685,
16,
2154,
9413,
1685,
4672,
769,
1759,
273,
562,
12,
71,
2434,
13,
309,
769,
1759,
422,
374,
30,
327,
919,
273,
2154,
... |
using Tachyon ray tracer. | using the Tachyon ray tracer. | def tachyon_repr(self, render_params): """ Returns representation of the point suitable for plotting using Tachyon ray tracer. | ac565fa7b2ba6c3b1ae16697410547f7b11f5dcf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/ac565fa7b2ba6c3b1ae16697410547f7b11f5dcf/shapes2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
497,
93,
265,
67,
12715,
12,
2890,
16,
1743,
67,
2010,
4672,
3536,
2860,
4335,
434,
326,
1634,
10631,
364,
20947,
1450,
399,
497,
93,
265,
14961,
13109,
18,
2,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
497,
93,
265,
67,
12715,
12,
2890,
16,
1743,
67,
2010,
4672,
3536,
2860,
4335,
434,
326,
1634,
10631,
364,
20947,
1450,
399,
497,
93,
265,
14961,
13109,
18,
2,
-100,
-100,
-100,
-... |
WorkflowExists,firstrun=checkWorkflow(workflow) | WorkflowExists,firstrun,queuemode=checkWorkflow(workflow) if str(queuemode).lower() in ("true", "yes"): queuemode = True ms.publish("JobQueue:StartDebug","none") ms.commit() else: queuemode = False | def checkWorkflow(workflow): """ Check if the provided workflow already exists in WorkflowCache area """ WorkflowExists=False workflowBase = os.path.basename(workflow) RequestDir,firstrun = getRequestInjectorConfig() workflowCache="%s/WorkflowCache"%RequestDir if not os.path.exists(workflowCache): msg = "Error: there is no WorkflowCache area ==> %s"%workflowCache print msg sys.exit(1) workflowCacheFile = os.path.join(workflowCache, "%s"%workflowBase) if os.path.exists(workflowCacheFile): WorkflowExists=True msg=" Workflow %s already exists"%(workflowBase,) print msg else: msg=" Workflow %s is NEW since the %s doesn't exist"%(workflowBase,workflowCacheFile) print msg return WorkflowExists,firstrun | 52a91030b4fac266ed21b14674fd0377d5bef14a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8887/52a91030b4fac266ed21b14674fd0377d5bef14a/InjectProduction.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
8484,
12,
13815,
4672,
3536,
2073,
309,
326,
2112,
6095,
1818,
1704,
316,
11363,
1649,
5091,
3536,
11363,
4002,
33,
8381,
225,
6095,
2171,
273,
1140,
18,
803,
18,
13909,
12,
13815,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8484,
12,
13815,
4672,
3536,
2073,
309,
326,
2112,
6095,
1818,
1704,
316,
11363,
1649,
5091,
3536,
11363,
4002,
33,
8381,
225,
6095,
2171,
273,
1140,
18,
803,
18,
13909,
12,
13815,
... |
class EnumArgument(Argument): | class EnumBaseArgument(Argument): """Base calss for EnumArgument, IntArgument and BoolArgument""" def __init__(self, name, gl_type, type, gl_error): Argument.__init__(self, name, gl_type) self.local_type = type self.gl_error = gl_error name = type[len(gl_type):] self.enum_info = _ENUM_LISTS[name] def WriteValidationCode(self, file): file.Write(" if (!Validate%s(%s)) {\n" % (self.local_type, self.name)) file.Write(" SetGLError(%s);\n" % self.gl_error) file.Write(" return parse_error::kParseNoError;\n") file.Write(" }\n") def GetValidArg(self, offset, index): if 'valid' in self.enum_info: valid = self.enum_info['valid'] num_valid = len(valid) if index >= num_valid: index = num_valid - 1 return valid[index] return str(offset + 1) def GetValidGLArg(self, offset, index): return self.GetValidArg(offset, index) def GetNumInvalidValues(self): """returns the number of invalid values to be tested.""" if 'invalid' in self.enum_info: invalid = self.enum_info['invalid'] return len(invalid) return 0 def GetInvalidArg(self, offset, index): """returns an invalid value by index.""" if 'invalid' in self.enum_info: invalid = self.enum_info['invalid'] num_invalid = len(invalid) if index >= num_invalid: index = num_invalid - 1 return (invalid[index], "kParseNoError") return ("---ERROR1---", "kParseNoError") class EnumArgument(EnumBaseArgument): | def GetImmediateVersion(self): """Gets the immediate version of this argument.""" return self | 8a837bb40249dfd9f0a2736abdab4f64592c99db /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/8a837bb40249dfd9f0a2736abdab4f64592c99db/build_gles2_cmd_buffer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
22651,
1444,
12,
2890,
4672,
3536,
3002,
326,
14483,
1177,
434,
333,
1237,
12123,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
22651,
1444,
12,
2890,
4672,
3536,
3002,
326,
14483,
1177,
434,
333,
1237,
12123,
327,
365,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
shutil.move(RPM_SPEC, dest_spec) | shutil.copyfile(RPM_SPEC, dest_spec) | def run_rpm(): shutil.rmtree(PACKAGE_NAME) shutil.move(TARBALL, os.path.join(RPMBUILD_HOME, "SOURCES")) dest_spec = os.path.join(RPMBUILD_HOME, "SPECS", RPM_SPEC) shutil.move(RPM_SPEC, dest_spec) cmd = "rpmbuild -ba " + dest_spec safe_exec(cmd) | f92405ae22c50a96730129b94e2496921b919d78 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/310/f92405ae22c50a96730129b94e2496921b919d78/make_rpm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
86,
7755,
13332,
11060,
18,
86,
17371,
12,
19077,
67,
1985,
13,
11060,
18,
8501,
12,
56,
20926,
4685,
16,
1140,
18,
803,
18,
5701,
12,
54,
12728,
20215,
67,
14209,
16,
315,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
86,
7755,
13332,
11060,
18,
86,
17371,
12,
19077,
67,
1985,
13,
11060,
18,
8501,
12,
56,
20926,
4685,
16,
1140,
18,
803,
18,
5701,
12,
54,
12728,
20215,
67,
14209,
16,
315,
... |
The name of a set-up function. This is called before running the | A set-up function. This is called before running the | def DocFileSuite(*paths, **kw): """A unittest suite for one or more doctest files. The path to each doctest file is given as a string; the interpretation of that string depends on the keyword argument "module_relative". A number of options may be provided as keyword arguments: module_relative If "module_relative" is True, then the given file paths are interpreted as os-independent module-relative paths. By default, these paths are relative to the calling module's directory; but if the "package" argument is specified, then they are relative to that package. To ensure os-independence, "filename" should use "/" characters to separate path segments, and may not be an absolute path (i.e., it may not begin with "/"). If "module_relative" is False, then the given file paths are interpreted as os-specific paths. These paths may be absolute or relative (to the current working directory). package A Python package or the name of a Python package whose directory should be used as the base directory for module relative paths. If "package" is not specified, then the calling module's directory is used as the base directory for module relative filenames. It is an error to specify "package" if "module_relative" is False. setUp The name of a set-up function. This is called before running the tests in each file. The setUp function will be passed a DocTest object. The setUp function can access the test globals as the globs attribute of the test passed. tearDown The name of a tear-down function. This is called after running the tests in each file. The tearDown function will be passed a DocTest object. The tearDown function can access the test globals as the globs attribute of the test passed. globs A dictionary containing initial global variables for the tests. optionflags A set of doctest option flags expressed as an integer. """ suite = unittest.TestSuite() # We do this here so that _normalize_module is called at the right # level. If it were called in DocFileTest, then this function # would be the caller and we might guess the package incorrectly. if kw.get('module_relative', True): kw['package'] = _normalize_module(kw.get('package')) for path in paths: suite.addTest(DocFileTest(path, **kw)) return suite | edabf355f3608af9354ab9cea364a59185e2fcb3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/edabf355f3608af9354ab9cea364a59185e2fcb3/doctest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3521,
812,
13587,
30857,
4481,
16,
2826,
9987,
4672,
3536,
37,
2836,
3813,
11371,
364,
1245,
578,
1898,
31263,
395,
1390,
18,
225,
1021,
589,
358,
1517,
31263,
395,
585,
353,
864,
487,
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,
3521,
812,
13587,
30857,
4481,
16,
2826,
9987,
4672,
3536,
37,
2836,
3813,
11371,
364,
1245,
578,
1898,
31263,
395,
1390,
18,
225,
1021,
589,
358,
1517,
31263,
395,
585,
353,
864,
487,
2... |
if endIndex is not None and spokenIndex==endIndex: keepUpdating=keepReading=False while speech.isPaused: | while speech.isPaused and globalVars.keyCounter==startKeyCount: | def readTextHelper_generator(info,cursor): cursorIndexMap={} startKeyCount=globalVars.keyCounter cursorIndexMap.clear() reader=info.copy() if not reader.isCollapsed: readToLimit=True reader.collapse() else: readToLimit=False keepReading=True keepUpdating=True oldSpokenIndex=None endIndex=None while keepUpdating: if keepReading: bookmark=reader.bookmark index=hash(bookmark) reader.expand(textHandler.UNIT_READINGCHUNK) cursorIndexMap[index]=bookmark speech.speakFormattedText(reader,includeBlankText=False,index=index) if readToLimit: delta=reader.compareEnd(info) if delta>=0: keepReading=False endIndex=index else: reader.collapse(end=True) else: reader.collapse() delta=reader.moveByUnit(textHandler.UNIT_READINGCHUNK,1) if delta==0: keepReading=False endIndex=index spokenIndex=speech.getLastSpeechIndex() if spokenIndex!=oldSpokenIndex: oldSpokenIndex=spokenIndex bookmark=cursorIndexMap.get(spokenIndex,None) if bookmark is not None: updater=reader.obj.makeTextInfo(bookmark) if cursor==CURSOR_CARET: updater.updateCaret() if cursor!=CURSOR_CARET or globalVars.caretMovesReviewCursor: updater.obj.reviewPosition=updater if endIndex is not None and spokenIndex==endIndex: keepUpdating=keepReading=False while speech.isPaused: yield startKeyCount=globalVars.keyCounter if globalVars.keyCounter!=startKeyCount: speech.cancelSpeech() keepUpdating=keepReading=False yield | 7982a4510511c7f3430bbdfab904aaf8b2f99dbf /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9340/7982a4510511c7f3430bbdfab904aaf8b2f99dbf/sayAllHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
1528,
2276,
67,
8812,
12,
1376,
16,
9216,
4672,
3347,
1016,
863,
12938,
24822,
1380,
33,
6347,
5555,
18,
856,
4789,
3347,
1016,
863,
18,
8507,
1435,
2949,
33,
1376,
18,
3530,
1435,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1528,
2276,
67,
8812,
12,
1376,
16,
9216,
4672,
3347,
1016,
863,
12938,
24822,
1380,
33,
6347,
5555,
18,
856,
4789,
3347,
1016,
863,
18,
8507,
1435,
2949,
33,
1376,
18,
3530,
1435,
... |
message = msg['Subject'] | subject = msg['Subject'] | def extract(ui, fileobj): '''extract patch from data read from fileobj. patch can be a normal patch or contained in an email message. return tuple (filename, message, user, date, node, p1, p2). Any item in the returned tuple can be None. If filename is None, fileobj did not contain a patch. Caller must unlink filename when done.''' # attempt to detect the start of a patch # (this heuristic is borrowed from quilt) diffre = re.compile(r'^(?:Index:[ \t]|diff[ \t]|RCS file: |' + 'retrieving revision [0-9]+(\.[0-9]+)*$|' + '(---|\*\*\*)[ \t])', re.MULTILINE) fd, tmpname = tempfile.mkstemp(prefix='hg-patch-') tmpfp = os.fdopen(fd, 'w') try: msg = email.Parser.Parser().parse(fileobj) message = msg['Subject'] user = msg['From'] # should try to parse msg['Date'] date = None nodeid = None branch = None parents = [] if message: if message.startswith('[PATCH'): pend = message.find(']') if pend >= 0: message = message[pend+1:].lstrip() message = message.replace('\n\t', ' ') ui.debug('Subject: %s\n' % message) if user: ui.debug('From: %s\n' % user) diffs_seen = 0 ok_types = ('text/plain', 'text/x-diff', 'text/x-patch') for part in msg.walk(): content_type = part.get_content_type() ui.debug('Content-Type: %s\n' % content_type) if content_type not in ok_types: continue payload = part.get_payload(decode=True) m = diffre.search(payload) if m: hgpatch = False ignoretext = False ui.debug(_('found patch at byte %d\n') % m.start(0)) diffs_seen += 1 cfp = cStringIO.StringIO() if message: cfp.write(message) cfp.write('\n') for line in payload[:m.start(0)].splitlines(): if line.startswith('# HG changeset patch'): ui.debug(_('patch generated by hg export\n')) hgpatch = True # drop earlier commit message content cfp.seek(0) cfp.truncate() elif hgpatch: if line.startswith('# User '): user = line[7:] ui.debug('From: %s\n' % user) elif line.startswith("# Date "): date = line[7:] elif line.startswith("# Branch "): branch = line[9:] elif line.startswith("# Node ID "): nodeid = line[10:] elif line.startswith("# Parent "): parents.append(line[10:]) elif line == '---' and 'git-send-email' in msg['X-Mailer']: ignoretext = True if not line.startswith('# ') and not ignoretext: cfp.write(line) cfp.write('\n') message = cfp.getvalue() if tmpfp: tmpfp.write(payload) if not payload.endswith('\n'): tmpfp.write('\n') elif not diffs_seen and message and content_type == 'text/plain': message += '\n' + payload except: tmpfp.close() os.unlink(tmpname) raise tmpfp.close() if not diffs_seen: os.unlink(tmpname) return None, message, user, date, branch, None, None, None p1 = parents and parents.pop(0) or None p2 = parents and parents.pop(0) or None return tmpname, message, user, date, branch, nodeid, p1, p2 | a4b03186cd1738b0443cf4715ee3dc0a89ba0888 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11312/a4b03186cd1738b0443cf4715ee3dc0a89ba0888/patch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
12,
4881,
16,
17041,
4672,
9163,
8004,
4729,
628,
501,
855,
628,
17041,
18,
225,
4729,
848,
506,
279,
2212,
4729,
578,
7542,
316,
392,
2699,
883,
18,
225,
327,
3193,
261,
3459,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
12,
4881,
16,
17041,
4672,
9163,
8004,
4729,
628,
501,
855,
628,
17041,
18,
225,
4729,
848,
506,
279,
2212,
4729,
578,
7542,
316,
392,
2699,
883,
18,
225,
327,
3193,
261,
3459,
1... |
text = u'' | text, alt_text = u'', u'' | def get_text(self, tag, limit=None): css = self.tag_css(tag)[0] if (css.has_key('display') and css['display'].lower() == 'none') or \ (css.has_key('visibility') and css['visibility'].lower() == 'hidden'): return '' text = u'' for c in tag.contents: if limit != None and len(text) > limit: break if isinstance(c, HTMLConverter.IGNORED_TAGS): return u'' if isinstance(c, NavigableString): text += unicode(c) elif isinstance(c, Tag): if c.name.lower() == 'img' and c.has_key('alt'): text += c['alt'] return text text += self.get_text(c) return text | ab0c2accef65b9333482c42ad48b19e202c86c19 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9125/ab0c2accef65b9333482c42ad48b19e202c86c19/convert_from.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
955,
12,
2890,
16,
1047,
16,
1800,
33,
7036,
4672,
3747,
273,
365,
18,
2692,
67,
5212,
12,
2692,
25146,
20,
65,
309,
261,
5212,
18,
5332,
67,
856,
2668,
5417,
6134,
471,
374... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
955,
12,
2890,
16,
1047,
16,
1800,
33,
7036,
4672,
3747,
273,
365,
18,
2692,
67,
5212,
12,
2692,
25146,
20,
65,
309,
261,
5212,
18,
5332,
67,
856,
2668,
5417,
6134,
471,
374... |
month_name = _localized_name('%B', 12) month_abbr = _localized_name('%b', 12) | month_name = _localized_name('%B', 13) month_abbr = _localized_name('%b', 13) | def __len__(self): return self.len | 1b9c177c5de0cf0d2d506748209dc840b0eb48d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1b9c177c5de0cf0d2d506748209dc840b0eb48d9/calendar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1897,
972,
12,
2890,
4672,
327,
365,
18,
1897,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1897,
972,
12,
2890,
4672,
327,
365,
18,
1897,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self._calc() | def _splitRows(self,availHeight): self._calc() h = 0 n = 0 lim = len(self._rowHeights) while n<lim: hn = h + self._rowHeights[n] if hn>availHeight: break h = hn n = n + 1 | ae66273e476a2a8551ddca91699826510f3fe486 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ae66273e476a2a8551ddca91699826510f3fe486/tables.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4939,
4300,
12,
2890,
16,
842,
671,
2686,
4672,
366,
273,
374,
290,
273,
374,
20167,
273,
562,
12,
2890,
6315,
492,
2686,
87,
13,
1323,
290,
32,
7091,
30,
366,
82,
273,
366,
397... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4939,
4300,
12,
2890,
16,
842,
671,
2686,
4672,
366,
273,
374,
290,
273,
374,
20167,
273,
562,
12,
2890,
6315,
492,
2686,
87,
13,
1323,
290,
32,
7091,
30,
366,
82,
273,
366,
397... | |
for i, t in enumerate(tokens): | for t in tokens: | def check_singlular_opening_braces(tokens, lines, warnings): "Check for inappropriate { on a separate line" for i, t in enumerate(tokens): if t.bracelevel == 0 or t.typ != Token.punct or t.string != '{': continue prec = tokens[i-1] if t.line > prec.line and prec.typ == Token.punct \ and prec.string == ')': w = 'Opening brace on a separate line (col %d)' warnings.append((t.line, w % t.col)) | 6ef4f8f80b65ddd3424b5c94f1c8a2c566383415 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6176/6ef4f8f80b65ddd3424b5c94f1c8a2c566383415/check-coding-style.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
2470,
80,
2490,
67,
3190,
310,
67,
15397,
764,
12,
7860,
16,
2362,
16,
5599,
4672,
315,
1564,
364,
316,
438,
5986,
566,
340,
288,
603,
279,
9004,
980,
6,
364,
268,
316,
2430... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2470,
80,
2490,
67,
3190,
310,
67,
15397,
764,
12,
7860,
16,
2362,
16,
5599,
4672,
315,
1564,
364,
316,
438,
5986,
566,
340,
288,
603,
279,
9004,
980,
6,
364,
268,
316,
2430... |
if obj_id >= 0: | if obj_id >= 0 and obj_id is not False: | def sig_attach(self, widget=None): obj_id = self.id_get() if obj_id >= 0: win = Attachment(self.model, obj_id, self.window) win.run() else: self.message_info(_('No record selected!')) self.update_attachment_count(reload=True) return True | 0296c68790d547568a5a487283bd03a4905fd640 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9151/0296c68790d547568a5a487283bd03a4905fd640/form.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3553,
67,
7331,
12,
2890,
16,
3604,
33,
7036,
4672,
1081,
67,
350,
273,
365,
18,
350,
67,
588,
1435,
309,
1081,
67,
350,
1545,
374,
471,
1081,
67,
350,
353,
486,
1083,
30,
5657,
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,
3553,
67,
7331,
12,
2890,
16,
3604,
33,
7036,
4672,
1081,
67,
350,
273,
365,
18,
350,
67,
588,
1435,
309,
1081,
67,
350,
1545,
374,
471,
1081,
67,
350,
353,
486,
1083,
30,
5657,
273,... |
@type iindex: int | @type index: int | def top(self, index=1): """ Get the I{item} at the top of the stack where I{item} is a tuple as (I{type},I{resolved}). @param index: The index (0|1) into the tuple. {0=type, 1=resolved}. @type iindex: int @return: The top I{item}, else None. @rtype: I{type} """ if len(self.stack): return self.stack[-1][index] else: return None | 19aaeff9b9f40076ef897cdf18c92067cff89661 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5377/19aaeff9b9f40076ef897cdf18c92067cff89661/resolver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1760,
12,
2890,
16,
770,
33,
21,
4672,
3536,
968,
326,
467,
95,
1726,
97,
622,
326,
1760,
434,
326,
2110,
1625,
467,
95,
1726,
97,
353,
279,
3193,
487,
261,
45,
95,
723,
5779,
45,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1760,
12,
2890,
16,
770,
33,
21,
4672,
3536,
968,
326,
467,
95,
1726,
97,
622,
326,
1760,
434,
326,
2110,
1625,
467,
95,
1726,
97,
353,
279,
3193,
487,
261,
45,
95,
723,
5779,
45,
... |
return S_ERROR(res['Value']['Failed'][url]) else: return S_OK(res['Value']['Successful'][url]) except AttributeError,errMessage: | return S_ERROR( res['Value']['Failed'][url] ) else: return S_OK( res['Value']['Successful'][url] ) except AttributeError, errMessage: | def __executeOperation(self,url,method): """ Executes the requested functionality with the supplied url """ execString = "res = self.%s(url)" % method try: exec(execString) if not res['OK']: return S_ERROR(res['Message']) elif not res['Value']['Successful'].has_key(url): if not res['Value']['Failed'].has_key(url): if res['Value']['Failed'].values(): return S_ERROR(res['Value']['Failed'].values()[0]) elif res['Value']['Successful'].values(): return S_OK(res['Value']['Successful'].values()[0]) else: gLogger.error( 'Wrong Return structure', str(res['Value']) ) return S_ERROR( 'Wrong Return structure' ) return S_ERROR(res['Value']['Failed'][url]) else: return S_OK(res['Value']['Successful'][url]) except AttributeError,errMessage: exceptStr = "SRM2Storage.__executeOperation: Exception while perfoming %s." % method gLogger.exception(exceptStr,'',errMessage) return S_ERROR("%s%s" % (exceptStr,errMessage)) | 70e66af095cb6701e39b1e701e4a2ce4d012b4f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/70e66af095cb6701e39b1e701e4a2ce4d012b4f7/SRM2Storage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
8837,
2988,
12,
2890,
16,
718,
16,
2039,
4672,
3536,
3889,
993,
326,
3764,
14176,
598,
326,
4580,
880,
3536,
1196,
780,
273,
315,
455,
273,
365,
7866,
87,
12,
718,
2225,
738,
707... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8837,
2988,
12,
2890,
16,
718,
16,
2039,
4672,
3536,
3889,
993,
326,
3764,
14176,
598,
326,
4580,
880,
3536,
1196,
780,
273,
315,
455,
273,
365,
7866,
87,
12,
718,
2225,
738,
707... |
return None return ctime | return False return True | def path_valid(self, path, view): """Returns if a path is safe still valid (i.e. deemed collision free)""" if not (path[0] == self.position and path[-1] == self.goal): return None #must go between current position and goal ctime = 0 freeprob = 1.0 a1 = self.angle p1 = self.position | 0484f9f3f562dab318bf38b4cbce4815517c3c34 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9407/0484f9f3f562dab318bf38b4cbce4815517c3c34/units.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
589,
67,
877,
12,
2890,
16,
589,
16,
1476,
4672,
3536,
1356,
309,
279,
589,
353,
4183,
4859,
923,
261,
77,
18,
73,
18,
443,
351,
329,
17740,
4843,
15574,
309,
486,
261,
803,
63,
20,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
589,
67,
877,
12,
2890,
16,
589,
16,
1476,
4672,
3536,
1356,
309,
279,
589,
353,
4183,
4859,
923,
261,
77,
18,
73,
18,
443,
351,
329,
17740,
4843,
15574,
309,
486,
261,
803,
63,
20,
... |
write_message(" -Insert the format %s in bibfmt : DONE" % format , verbose=2) | write_message(" -Insert the format %s in bibfmt : DONE" % format_name , verbose=2) | def update_bibfmt_format(id_bibrec, marc, format): """Update the format in the table bibfmt""" # We check if the format is already in bibFmt found = find_record_format(id_bibrec, format) if int(found[0]) == 1: # Update the format # get the current time now = convert_datestruct_to_datetext(time.localtime()) # compress the marc value pickled_marc = compress(marc) query = """UPDATE bibfmt SET format = %s, last_updated = %s, value = %s WHERE id_bibrec = %s """ params = (format, now, pickled_marc, id_bibrec) try: row_id = run_sql(query, params) if row_id == None: write_message(" Failed: Error during update_bibfmt_format function", verbose=1, stream=sys.stderr) return 1 else: write_message(" -Update the format %s in bibfmt : DONE" % format , verbose=2) return 0 except Error, error: write_message(" Error during the update_bibfmt_format function : %s " % error, verbose=1, stream=sys.stderr) elif int(found[0]) > 1: write_message(" Failed: Same format %s found several time in bibfmt for the same record." % format, verbose=1, stream=sys.stderr) return 1 else: # Insert the format information in BibFMT res = insert_bibfmt(id_bibrec, marc, format) if res == None: write_message(" Failed: Error during insert_bibfmt", verbose=1, stream=sys.stderr) return 1 else: write_message(" -Insert the format %s in bibfmt : DONE" % format , verbose=2) return 0 | c01e7675eac4ac02844b96fe38be4646d43de28c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/c01e7675eac4ac02844b96fe38be4646d43de28c/bibupload.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
70,
495,
8666,
67,
2139,
12,
350,
67,
70,
495,
3927,
16,
312,
11828,
16,
740,
4672,
3536,
1891,
326,
740,
316,
326,
1014,
25581,
8666,
8395,
225,
468,
1660,
866,
309,
326,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
70,
495,
8666,
67,
2139,
12,
350,
67,
70,
495,
3927,
16,
312,
11828,
16,
740,
4672,
3536,
1891,
326,
740,
316,
326,
1014,
25581,
8666,
8395,
225,
468,
1660,
866,
309,
326,
... |
file.Write(" SetGLError(%s);\n" % self.gl_error) | file.Write(" SetGLError(%s, \"gl%s: %s %s\");\n" % (self.gl_error, func.original_name, self.name, self.gl_error)) | def WriteValidationCode(self, file): file.Write(" if (!Validate%s(%s)) {\n" % (self.local_type, self.name)) file.Write(" SetGLError(%s);\n" % self.gl_error) file.Write(" return error::kNoError;\n") file.Write(" }\n") | bda273cb982a1cc60958aa574bc939271a82f552 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/bda273cb982a1cc60958aa574bc939271a82f552/build_gles2_cmd_buffer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
4354,
1085,
12,
2890,
16,
585,
4672,
585,
18,
3067,
2932,
225,
309,
16051,
4270,
9,
87,
9275,
87,
3719,
18890,
82,
6,
738,
261,
2890,
18,
3729,
67,
723,
16,
365,
18,
529,
3719,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
4354,
1085,
12,
2890,
16,
585,
4672,
585,
18,
3067,
2932,
225,
309,
16051,
4270,
9,
87,
9275,
87,
3719,
18890,
82,
6,
738,
261,
2890,
18,
3729,
67,
723,
16,
365,
18,
529,
3719,... |
firstafter = s2.find(marker) + len(marker) | if firstafter < 0: firstafter = len(s2) else: firstafter += len(marker) | def replaceCategoryLinks(oldtext, new, site = None, addOnly = False): """Replace the category links given in the wikitext given in oldtext by the new links given in new. 'new' should be a list of Category objects. If addOnly is True, the old category won't be deleted and the category(s) given will be added (and so they won't replace anything). """ # Find a marker that is not already in the text. marker = '@@' while marker in oldtext: marker += '@' if site is None: site = getSite() if site.sitename() == 'wikipedia:de' and "{{Personendaten" in oldtext: raise Error('The PyWikipediaBot is no longer allowed to touch categories on the German Wikipedia on pages that contain the person data template because of the non-standard placement of that template. See http://de.wikipedia.org/wiki/Hilfe_Diskussion:Personendaten/Archiv/bis_2006#Position_der_Personendaten_am_.22Artikelende.22') s = categoryFormat(new, insite = site) if addOnly: s2 = oldtext else: s2 = removeCategoryLinks(oldtext, site = site, marker = marker) if s: separator = site.family.category_text_separator if site.language() in site.family.category_attop: newtext = s + separator + s2 else: # calculate what was after the categories links on the page firstafter = s2.find(marker) + len(marker) # Is there any text in the 'after' part that means we should keep it after? if "</noinclude>" in s2[firstafter:]: newtext = s2[:firstafter].replace(marker,'') + s + s2[firstafter:] elif site.language() in site.family.categories_last: newtext = s2.replace(marker,'').strip() + separator + s else: interwiki = getLanguageLinks(s2) s2 = removeLanguageLinks(s2.replace(marker,''), site) + separator + s newtext = replaceLanguageLinks(s2, interwiki, site) else: s2 = s2.replace(marker,'') return s2 return newtext.strip() | bb52a10e52ddc9b144266980d95741281073bbf6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/bb52a10e52ddc9b144266980d95741281073bbf6/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1453,
4457,
7100,
12,
1673,
955,
16,
394,
16,
2834,
273,
599,
16,
527,
3386,
273,
1083,
4672,
3536,
5729,
326,
3150,
4716,
864,
316,
326,
341,
1766,
305,
408,
864,
316,
1592,
955,
635,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1453,
4457,
7100,
12,
1673,
955,
16,
394,
16,
2834,
273,
599,
16,
527,
3386,
273,
1083,
4672,
3536,
5729,
326,
3150,
4716,
864,
316,
326,
341,
1766,
305,
408,
864,
316,
1592,
955,
635,... |
lines.append('%s "%s"' % (commandparams_info[name][2], argument[1:-1].replace('"', '\"'))) | lines.append('%s "%s"' % (commandparams_info[name][2], argument[1:-1].replace('"', '\\"'))) | def convert_commandparams(document): """ Convert \begin_inset LatexCommand \cmdname[opt1][opt2]{arg} \end_inset to \begin_inset LatexCommand cmdname name1 "opt1" name2 "opt2" name3 "arg" \end_inset name1, name2 and name3 can be different for each command. | d56de86b6af0eea59990991b75b6d0e746ee684d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7514/d56de86b6af0eea59990991b75b6d0e746ee684d/lyx_1_5.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
67,
3076,
2010,
12,
5457,
4672,
3536,
4037,
225,
521,
10086,
67,
267,
542,
11134,
338,
2189,
521,
4172,
529,
63,
3838,
21,
6362,
3838,
22,
7073,
3175,
97,
521,
409,
67,
267,
542,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
67,
3076,
2010,
12,
5457,
4672,
3536,
4037,
225,
521,
10086,
67,
267,
542,
11134,
338,
2189,
521,
4172,
529,
63,
3838,
21,
6362,
3838,
22,
7073,
3175,
97,
521,
409,
67,
267,
542,... |
draw.line(pointlist, fill='blue', width=2) trim = int(256/2) image = image.crop( tuple( [trim, trim] + map( lambda x: x-trim, image.size) ) ) | draw.line(pointlist, fill='black', width=1) if osize*osize < self.tiles['x']['count']*self.tiles['y']['count']: path = [ Tile.getPixelForCoord( self.pointsbounds[0], self.tilesbounds, imagesize), Tile.getPixelForCoord( self.pointsbounds[1], self.tilesbounds, imagesize) ] imagebox = [ [0,0], list(imagesize) ] if imagesize[0] > osize * 256: if path[1][0] - path [0][0] < imagesize[0] - 256: centrex = (path[1][0] - path [0][0])/2 + path[0][0] halfwidth = ((imagesize[0] - 256) / 2) imagebox[0][0] = centrex - halfwidth imagebox[1][0] = centrex + halfwidth if imagesize[1] > osize * 256: if path[1][1] - path [0][1] < imagesize[1] - 256: centrey = (path[1][1] - path [0][1])/2 + path[0][1] halfwidth = ((imagesize[1] - 256) / 2) imagebox[0][1] = centrey - halfwidth imagebox[1][1] = centrey + halfwidth imagebox = reduce(lambda x,y: x+y,imagebox) image = image.crop( imagebox ) | def drawTrack(self, filename): | 2b0ae4793cca6985c2bb04f17293a2fac4b6ab13 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3985/2b0ae4793cca6985c2bb04f17293a2fac4b6ab13/gpx2png.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
4402,
12,
2890,
16,
1544,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
4402,
12,
2890,
16,
1544,
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,
-10... |
line() | line("map-separator") | def compileNode(node, enableDebug=False): global indent global pretty if node.getChild("commentsBefore", False) != None: line() for comment in node.getChild("commentsBefore").children: # Additional new lines before big comment if comment.get("detail", False) == "multi": line() pretty += comment.get("text") # New line after singleline comment without line-ending if not comment.get("text").endswith("\n"): line() # Additional new lines after big comment elif comment.get("detail", False) == "multi": line() ################################################################## # Opening... ################################################################## if node.type == "map": if node.hasChildren(): line() pretty += "{" if node.hasChildren(): plus() line() elif node.type == "array": if node.hasChildren(): line() pretty += "[" if node.hasChildren(): plus() line() elif node.type == "block": line() pretty += "{" plus() line() elif node.type == "params": pretty += "(" elif node.type == "group": pretty += "(" elif node.type == "case": minus() line() pretty += "case " elif node.type == "catch": pretty += "catch" elif node.type == "finally": pretty += "finally" elif node.type == "delete": pretty += "delete " elif node.type == "break": pretty += "break" if node.get("label", False): pretty += " " + node.get("label", False) elif node.type == "continue": pretty += "continue" if node.get("label", False): pretty += " " + node.get("label", False) elif node.type == "elseStatement": line() pretty += "else" # This is a elseStatement without a block around (a set of {}) if not node.hasChild("block"): pretty += " " elif node.type == "switch" and node.get("switchType") == "case": pretty += "switch" elif node.type == "switch" and node.get("switchType") == "catch": pretty += "try" elif node.type == "throw": pretty += "throw " elif node.type == "instantiation": pretty += "new " elif node.type == "return": pretty += "return" if node.hasChildren(): pretty += " " elif node.type == "definitionList": pretty += "var " elif node.type == "default": minus() line() pretty += "default:" plus() line() elif node.type == "keyvalue": keyString = node.get("key") keyQuote = node.get("quotation", False) if keyQuote != None: # print "USE QUOTATION" if keyQuote == "doublequotes": keyString = '"' + keyString + '"' else: keyString = "'" + keyString + "'" elif keyString in config.JSPROTECTED or not KEY.match(keyString): print "ATTENTION: Auto protect key: %s" % keyString keyString = "\"" + keyString + "\"" pretty += keyString + " : " elif node.type == "expression": if node.parent.type == "loop": loopType = node.parent.get("loopType") if loopType == "DO": pretty += "while" # open expression block of IF/WHILE/DO-WHILE/FOR statements pretty += "(" elif node.parent.type == "catch": # open expression block of CATCH statement pretty += "(" elif node.parent.type == "switch" and node.parent.get("switchType") == "case": # open expression block of SWITCH statement pretty += "(" elif node.type == "loop": loopType = node.get("loopType") if loopType == "IF": pretty += "if" elif loopType == "WHILE": pretty += "while" elif loopType == "FOR": pretty += "for" elif loopType == "DO": pretty += "do" elif loopType == "WITH": pretty += "with" else: print "UNKNOWN LOOP TYPE: %s" % loopType elif node.type == "function": functionDeclHasParams = False pretty += "function" functionName = node.get("name", False) if functionName != None: pretty += " %s" % functionName elif node.type == "identifier": name = node.get("name", False) if name != None: pretty += name elif node.type == "call": callHasParams = False elif node.type == "definition": if node.parent.type != "definitionList": pretty += "var " pretty += node.get("identifier") elif node.type == "constant": if node.get("constantType") == "string": if node.get("detail") == "singlequotes": pretty += "'" else: pretty += '"' pretty += node.get("value") if node.get("detail") == "singlequotes": pretty += "'" else: pretty += '"' else: pretty += node.get("value") elif node.type == "third": if node.parent.type == "operation": if node.parent.get("operator") == "HOOK": pretty += " : " else: print "Unknown third argument... Not a hook" elif node.type == "labelTerminator": pretty += ":" ################################################################## # Children content ################################################################## if node.hasChildren(): childPosition = 1 childrenNumber = 0 # We need to ignore comment blocks # childrenNumber = len(node.children) for child in node.children: if child.type == "comment" or child.type == "commentsBefore": pass else: childrenNumber += 1 previousType = None for child in node.children: if child.type == "comment" or child.type == "commentsBefore": continue # Hints for close of node later if node.type == "call" and child.type == "params": callHasParams = True elif node.type == "function": if child.type == "params": functionDeclHasParams = True elif child.type == "body" and not functionDeclHasParams: # has no params before body, fix it here, and add body afterwards pretty += "()" functionDeclHasParams = True elif node.type == "definition" and child.type == "assignment": oper = child.get("operator", False) pretty += " " if oper != None: pretty += getTokenSource(oper) else: pretty += "=" pretty += " " elif node.type == "accessor" and child.type == "key": pretty += "[" elif node.type == "accessor" and child.type == "right": pretty += "." elif node.type == "loop" and node.get("loopType") == "FOR": if child.type == "first": pretty += "(" elif child.type == "statement": pretty += ")" else: if child.type == "second" and node.getChild("first", False) == None: pretty += "(" if child.type == "third" and node.getChild("first", False) == None and node.getChild("second", False) == None: pretty += "(" if not pretty.endswith(";") and not pretty.endswith("\n"): pretty += ";" elif node.type == "operation" and node.get("left", False) == "true": op = node.get("operator") if op == "TYPEOF": pretty += "typeof " elif op == None: print "BAD OPERATOR [A]: %s" % op else: pretty += getTokenSource(op) # Add child compileNode(child, enableDebug) if node.type == "operation" and child.type == "first" and node.get("left", False) != "true": op = node.get("operator") if op == "IN": pretty += " in " elif op == "INSTANCEOF": pretty += " instanceof " elif op == None: print "BAD OPERATOR [B]: %s" % op else: pretty += " " pretty += getTokenSource(op) pretty += " " elif node.type == "assignment" and child.type == "left": oper = node.get("operator", False) pretty += " " if oper != None: pretty += getTokenSource(oper) else: pretty += "=" pretty += " " elif node.type == "accessor" and child.type == "key": pretty += "]" # Separate children in parent list if childPosition < childrenNumber: if node.type == "variable": pretty += "." elif node.type == "map": pretty += ", " line() elif node.type == "array": pretty += ", " line() elif node.type == "definitionList": pretty += ", " elif node.type == "params": pretty += ", " elif node.type == "statementList": pretty += ", " separators = [ "block", "assignment", "call", "operation", "definition", "definitionList", "return", "break", "continue", "delete", "accessor", "instantiation", "throw", "variable", "function" ] not_after = [ "case", "default" ] not_in = [ "definitionList", "statementList", "params", "variable", "array" ] if node.type in [ "block", "file", "switch" ]: if not previousType in not_after: if child.type in separators: # pretty += "[[SEMI]]" semicolon() # not last child if childPosition == childrenNumber and node.type in [ "block", "switch", "file" ]: pass else: # pretty += "[[LINE]]" line() # Next... childPosition += 1 previousType = child.type ################################################################## # Closing... ################################################################## if node.type == "map": if node.hasChildren(): minus() line() pretty += "}" elif node.type == "array": if node.hasChildren(): minus() line() pretty += "]" elif node.type == "block": minus() line() pretty += "}" # Not it: # Function assignment if node.parent.type == "body" and node.parent.parent.type == "function" and node.parent.parent.parent.type == "right": pass else: line() elif node.type == "params": pretty += ")" elif node.type == "switch" and node.get("switchType") == "case": minus() minus() line() pretty += "}" # additional new line line() line() elif node.type == "group": pretty += ")" elif node.type == "case": pretty += ":" plus() line() elif node.type == "call" and not callHasParams: pretty += "()" elif node.type == "function" and not functionDeclHasParams: pretty += "()" elif node.type == "expression": if node.parent.type == "loop": pretty += ")" elif node.parent.type == "catch": pretty += ")" elif node.parent.type == "switch" and node.parent.get("switchType") == "case": pretty += ")" line() pretty += "{" plus() plus() elif node.type == "case": plus() line() | 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,
907,
12,
2159,
16,
4237,
2829,
33,
8381,
4672,
225,
2552,
3504,
2552,
7517,
282,
309,
756,
18,
588,
1763,
2932,
9231,
4649,
3113,
1083,
13,
480,
599,
30,
980,
2932,
1458,
17,
112... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4074,
907,
12,
2159,
16,
4237,
2829,
33,
8381,
4672,
225,
2552,
3504,
2552,
7517,
282,
309,
756,
18,
588,
1763,
2932,
9231,
4649,
3113,
1083,
13,
480,
599,
30,
980,
2932,
1458,
17,
112... |
type = lines[i][33:-3] | type = re.search(r"listof(\w*)", lines[i]).group(1)[:-1] | def change_listof(lines): i = 0 while 1: i = find_token(lines, "\\begin_inset LatexCommand \\listof", i) if i == -1: break type = lines[i][33:-3] lines[i] = "\\begin_inset FloatList "+type i = i+1 | d65166096449b4c58577df0ffda767f72a783e5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7514/d65166096449b4c58577df0ffda767f72a783e5a/lyxconvert_218.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2549,
67,
1098,
792,
12,
3548,
4672,
277,
273,
374,
1323,
404,
30,
277,
273,
1104,
67,
2316,
12,
3548,
16,
8422,
10086,
67,
267,
542,
11134,
338,
2189,
1736,
1098,
792,
3113,
277,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2549,
67,
1098,
792,
12,
3548,
4672,
277,
273,
374,
1323,
404,
30,
277,
273,
1104,
67,
2316,
12,
3548,
16,
8422,
10086,
67,
267,
542,
11134,
338,
2189,
1736,
1098,
792,
3113,
277,
13,
... |
if ZeroCoincs: parse_coinc(ZeroCoincs,ZeroTable,params) | if PlaygroundZeroCoincs: parse_coinc(PlaygroundZeroCoincs,PlaygroundZeroTable,params) if FullDataZeroCoincs: parse_coinc(FullDataZeroCoincs,FullDataZeroTable,params) | def split_seq(seq,p): newseq = [] n = len(seq) / p # min items per subsequence r = len(seq) % p # remaindered items b,e = 0l,n + min(1,r) # first split for i in range(p): newseq.append(seq[b:e]) r = max(0, r-1) b,e = e,e + n + min(1,r) # min(1,r) is always 1 or 0 return newseq | e2e8f2f958a1548507b14bab781a0ce0ae7f63b3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/e2e8f2f958a1548507b14bab781a0ce0ae7f63b3/pylal_ihope_to_randomforest_input.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1416,
67,
5436,
12,
5436,
16,
84,
4672,
394,
5436,
273,
5378,
290,
273,
562,
12,
5436,
13,
342,
293,
468,
1131,
1516,
1534,
720,
6178,
436,
273,
562,
12,
5436,
13,
738,
293,
468,
100... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1416,
67,
5436,
12,
5436,
16,
84,
4672,
394,
5436,
273,
5378,
290,
273,
562,
12,
5436,
13,
342,
293,
468,
1131,
1516,
1534,
720,
6178,
436,
273,
562,
12,
5436,
13,
738,
293,
468,
100... |
and query in e.affixes] | and (query in e.affixes or e.type == 'gismu' and e.word[0:4] == query)] | def query(query): query = query.replace('+', ' ') matches = set() entry = db.entries.get(query, None) if entry: matches.add(entry) glosses = [g for g in db.glosses if g.gloss == query or g.gloss == query.capitalize()] matches.update(g.entry for g in glosses) affix = [e for e in db.entries.itervalues() if e not in matches and query in e.affixes] matches.update(affix) classes = [e for e in db.entries.itervalues() if e.grammarclass == query or e.grammarclass and re.split(r'[0-9]', e.grammarclass)[0] == query] matches.update(classes) types = [e for e in db.entries.itervalues() if e.type == query] matches.update(types) regexquery = r'\b(%s|%s)\b' % (re.escape(query), re.escape(query.capitalize())) definitions = [e for e in db.entries.itervalues() if e not in matches and re.search(regexquery, e.definition)] matches.update(definitions) notes = [e for e in db.entries.itervalues() if e not in matches and e.notes and re.search(regexquery, e.notes)] matches.update(notes) if not entry and len(matches) == 1: redirect(matches.pop()) return del matches del regexquery return locals() | 278c4d3d11531219cd5d0c0f8827442a8d19e3f3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12705/278c4d3d11531219cd5d0c0f8827442a8d19e3f3/vlasisku.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
843,
12,
2271,
4672,
843,
273,
843,
18,
2079,
2668,
15,
2187,
296,
8624,
1885,
273,
444,
1435,
225,
1241,
273,
1319,
18,
8219,
18,
588,
12,
2271,
16,
599,
13,
309,
1241,
30,
1885,
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,
843,
12,
2271,
4672,
843,
273,
843,
18,
2079,
2668,
15,
2187,
296,
8624,
1885,
273,
444,
1435,
225,
1241,
273,
1319,
18,
8219,
18,
588,
12,
2271,
16,
599,
13,
309,
1241,
30,
1885,
18... |
backupHistory = filter(lambda x: x < entry.changeDates[-1], backupHistory) | backupHistory = filter(lambda x: x <= entry.changeDates[-1], backupHistory) | def getDirRestoreDates(repo, path): backupHistory = [ x.date for x in getBackupHistory(repo) ] if path != "/": (parentPath, dirName) = os.path.split(path) dirListing = getDirEntries(repo, parentPath) entries = filter(lambda x: x.name == dirName, dirListing) if not entries: raise DoesNotExistError entry = entries[0] # Don't allow restores before the dir existed backupHistory = filter(lambda x: x > entry.changeDates[0], backupHistory) if not entry.exists: # If the dir has been deleted, don't allow restores after its deletion backupHistory = filter(lambda x: x < entry.changeDates[-1], backupHistory) return backupHistory | 6ca77978954322ba7a378f32594c0d71f59eaa02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2223/6ca77978954322ba7a378f32594c0d71f59eaa02/librdiff.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26505,
10874,
15578,
12,
7422,
16,
589,
4672,
5114,
5623,
273,
306,
619,
18,
712,
364,
619,
316,
336,
6248,
5623,
12,
7422,
13,
308,
225,
309,
589,
480,
4016,
30,
261,
2938,
743,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26505,
10874,
15578,
12,
7422,
16,
589,
4672,
5114,
5623,
273,
306,
619,
18,
712,
364,
619,
316,
336,
6248,
5623,
12,
7422,
13,
308,
225,
309,
589,
480,
4016,
30,
261,
2938,
743,
16,
... |
listform = ListForm() | listform = ListForm(data) | def edit_list(request, group, list=None, is_admin=False, type='new'): """Edit list""" if request.method == 'POST': data = request.POST else: data = None if type == 'new': columnforms = [] listform = ListForm() for i in range(0,5): columnforms.append( ColumnForm(data, prefix='new%s'%i) ) elif type == 'edit': if list is None: raise Http404 listform = ListForm(data, instance=list) columnforms = [] for c in list.column_set.all(): columnforms.append( ColumnForm(data, instance=c, prefix=c.id) ) for i in range(0,3): columnforms.append( ColumnForm(data, prefix='new%s'%i) ) else: raise Exception('Unknown type for edit_list') if data and listform.is_valid(): forms_ok = True for column in columnforms: if not column.is_valid(): forms_ok = False break if forms_ok: list = listform.save(group=group) for column in columnforms: column.save(list=list) raise Exception() return render_to_response('reports/edit_list.html', { 'is_admin': is_admin, 'listform': listform, 'columnforms': columnforms, }, context_instance=RequestContext(request)) | ec5aa8a6750ca33f9e8406afd6c8b50ce08e347d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12178/ec5aa8a6750ca33f9e8406afd6c8b50ce08e347d/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3874,
67,
1098,
12,
2293,
16,
1041,
16,
666,
33,
7036,
16,
353,
67,
3666,
33,
8381,
16,
618,
2218,
2704,
11,
4672,
3536,
4666,
666,
8395,
309,
590,
18,
2039,
422,
296,
3798,
4278,
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,
3874,
67,
1098,
12,
2293,
16,
1041,
16,
666,
33,
7036,
16,
353,
67,
3666,
33,
8381,
16,
618,
2218,
2704,
11,
4672,
3536,
4666,
666,
8395,
309,
590,
18,
2039,
422,
296,
3798,
4278,
50... |
def handle_mediakey(self, *mmkeys): | def handle_mediakey(self, application, *mmkeys): if application != 'Miro': return | def handle_mediakey(self, *mmkeys): for key in mmkeys: if key == "Play": app.widgetapp.on_play_clicked() elif key == "Stop": app.widgetapp.on_stop_clicked() elif key == "Next": app.widgetapp.on_forward_clicked() elif key == "Previous": app.widgetapp.on_previous_clicked() | e768982876ae8b823e90d48ac1dbd691d2198c0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12354/e768982876ae8b823e90d48ac1dbd691d2198c0c/mediakeys.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
5660,
581,
402,
12,
2890,
16,
2521,
16,
380,
7020,
2452,
4672,
309,
2521,
480,
296,
49,
11373,
4278,
327,
364,
498,
316,
9740,
2452,
30,
309,
498,
422,
315,
11765,
6877,
595,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
5660,
581,
402,
12,
2890,
16,
2521,
16,
380,
7020,
2452,
4672,
309,
2521,
480,
296,
49,
11373,
4278,
327,
364,
498,
316,
9740,
2452,
30,
309,
498,
422,
315,
11765,
6877,
595,... |
"""The representation of a single weight EXAMPLES: sage: A2 = WeylCharacterRing(['A',2]) sage: a2 = WeightRing(A2) sage: a2([1,0,0]) a2(1,0,0) | """ Returns the representation of a single weight. EXAMPLES: sage: A2 = WeylCharacterRing(['A',2]) sage: a2 = WeightRing(A2) sage: a2([1,0,0]) a2(1,0,0) | def _wt_repr(self, k): """The representation of a single weight EXAMPLES: sage: A2 = WeylCharacterRing(['A',2]) sage: a2 = WeightRing(A2) sage: a2([1,0,0]) a2(1,0,0) """ hstring = str(k[0]) for i in range(1,self._lattice.n): hstring = hstring+","+str(k[i]) return self._prefix+"("+hstring+")" | 585641b32ec9003014ab40e39d632a05e840e883 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/585641b32ec9003014ab40e39d632a05e840e883/weyl_characters.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6046,
67,
12715,
12,
2890,
16,
417,
4672,
3536,
2860,
326,
4335,
434,
279,
2202,
3119,
18,
225,
5675,
8900,
11386,
30,
272,
410,
30,
432,
22,
273,
678,
402,
80,
7069,
10369,
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,
389,
6046,
67,
12715,
12,
2890,
16,
417,
4672,
3536,
2860,
326,
4335,
434,
279,
2202,
3119,
18,
225,
5675,
8900,
11386,
30,
272,
410,
30,
432,
22,
273,
678,
402,
80,
7069,
10369,
12,
... |
andi t3, t3, 2 or reg, reg, t3 | andi t4, t3, 2, flags=(EZF,) or reg, reg, t4 mov t1, t1, t3, flags=(nCEZF,) | def macroop BSF_R_P { rdip t7 mov t1, t1, t0, dataSize=8 ld t1, seg, riprel, disp # Determine if the input was zero, and also move it to a temp reg. and t1, t1, t1, flags=(ZF,) bri t0, label("end"), flags=(CZF,) # Zero out the result register mov reg, reg, t0 subi t2, t1, 1 xor t1, t2, t1 # Bit 6 srli t3, t1, 32, dataSize=8 andi t3, t3, 32 or reg, reg, t3 # Bit 5 srli t3, t1, 16, dataSize=8 andi t3, t3, 16 or reg, reg, t3 # Bit 4 srli t3, t1, 8, dataSize=8 andi t3, t3, 8 or reg, reg, t3 # Bit 3 srli t3, t1, 4, dataSize=8 andi t3, t3, 4 or reg, reg, t3 # Bit 2 srli t3, t1, 2, dataSize=8 andi t3, t3, 2 or reg, reg, t3 # Bit 1 srli t3, t1, 1, dataSize=8 andi t3, t3, 1 or reg, reg, t3 | 3e7c07fe3694f0322ad14a3f78d57cc10c7ca6f6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7385/3e7c07fe3694f0322ad14a3f78d57cc10c7ca6f6/bit_scan.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11522,
556,
605,
22395,
67,
54,
67,
52,
288,
225,
9437,
625,
268,
27,
5730,
268,
21,
16,
268,
21,
16,
268,
20,
16,
30216,
33,
28,
16916,
268,
21,
16,
2291,
16,
436,
625,
2878,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11522,
556,
605,
22395,
67,
54,
67,
52,
288,
225,
9437,
625,
268,
27,
5730,
268,
21,
16,
268,
21,
16,
268,
20,
16,
30216,
33,
28,
16916,
268,
21,
16,
2291,
16,
436,
625,
2878,
16,
... |
url = '<li><a href="/packages/' + str(p.id) + '">' + dep + '</a></li>' urls = urls + url return urls def sources_urlize(self): urls = '' for source in self.sources.split(' '): if re.search('://', source): url = '<li><a href="' + source + '">' + source + '</a></li>' else: url = '<li>' + source + '</li>' urls = urls + url return urls | urls.append( '<li><a href="/packages/%d">%s</a></li>' % (p.id,dep.depname)) return ''.join(urls) | def depends_urlize(self): urls = '' for dep in self.depends.split(' '): # shave off any version qualifiers nameonly = re.match(r"([a-z0-9-]+)", dep).group(1) try: p = Package.objects.filter(pkgname=nameonly)[0] except IndexError: # couldn't find a package in the DB -- it might be a virtual depend urls = urls + '<li>' + dep + '</li>' continue url = '<li><a href="/packages/' + str(p.id) + '">' + dep + '</a></li>' urls = urls + url return urls | 4d1977f24e062370efd307cbe51d4cd826828362 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11256/4d1977f24e062370efd307cbe51d4cd826828362/models.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10935,
67,
718,
554,
12,
2890,
4672,
6903,
273,
875,
364,
5993,
316,
365,
18,
27360,
18,
4939,
2668,
296,
4672,
468,
699,
836,
3397,
1281,
1177,
22848,
508,
3700,
273,
283,
18,
1916,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10935,
67,
718,
554,
12,
2890,
4672,
6903,
273,
875,
364,
5993,
316,
365,
18,
27360,
18,
4939,
2668,
296,
4672,
468,
699,
836,
3397,
1281,
1177,
22848,
508,
3700,
273,
283,
18,
1916,
1... |
opt['allowedTypes'] = [types.StringType] | opt['allowedTypes'] = [str] | def addOption(self, pos=-1, **kwargs): ''' Append an entry to the parameter specification list. Dictionary entries should be specified as keyword arguments such as ``name='option'``. More specifically, you can specify parameters ``name`` (required), ``label``, ``default`` (required), ``description``, ``validator``, ``type``, and ``separator``. This option will have a name specified by ``name`` and an initial default value specified by ``default``. | 0808dd362a5f2dd5d90d950500fd972461718062 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/401/0808dd362a5f2dd5d90d950500fd972461718062/simuOpt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12966,
12,
2890,
16,
949,
29711,
21,
16,
2826,
4333,
4672,
9163,
6181,
392,
1241,
358,
326,
1569,
7490,
666,
18,
16447,
3222,
1410,
506,
1269,
487,
4932,
1775,
4123,
487,
12176,
529,
221... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12966,
12,
2890,
16,
949,
29711,
21,
16,
2826,
4333,
4672,
9163,
6181,
392,
1241,
358,
326,
1569,
7490,
666,
18,
16447,
3222,
1410,
506,
1269,
487,
4932,
1775,
4123,
487,
12176,
529,
221... |
self.subentries = {} | self.subentries = {} | def __init__(self,wikilang,term): # wikilang here refers to the language of the Wiktionary self.wikilang=wikilang self.term=term self.subentries = {} # subentries is a dictionary of subentry objects indexed by wikilang self.sortedsubentries = [] | 76fb65714c4556da8aac1fdd25b68713e590c935 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/76fb65714c4556da8aac1fdd25b68713e590c935/wiktionary.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
11999,
330,
539,
16,
6408,
4672,
202,
7,
341,
1766,
330,
539,
2674,
21368,
358,
326,
2653,
434,
326,
678,
1766,
24252,
814,
365,
18,
11999,
330,
539,
33,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
11999,
330,
539,
16,
6408,
4672,
202,
7,
341,
1766,
330,
539,
2674,
21368,
358,
326,
2653,
434,
326,
678,
1766,
24252,
814,
365,
18,
11999,
330,
539,
33,... |
def testUndecodable(self): | def testUnencodable(self): | def testUndecodable(self): filename = support.TESTFN_UNENCODABLE + ".zip" z = ZipFile(filename, "w") zinfo = ZipInfo(TESTMOD + ".py", time.localtime(NOW)) zinfo.compress_type = self.compression z.writestr(zinfo, test_src) z.close() try: zipimport.zipimporter(filename) finally: os.remove(filename) | e9a54f6484de37f43b30e29e9a6b5a505f912e04 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/e9a54f6484de37f43b30e29e9a6b5a505f912e04/test_zipimport.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
984,
1331,
369,
429,
12,
2890,
4672,
1544,
273,
2865,
18,
16961,
19793,
67,
2124,
1157,
9086,
2782,
397,
3552,
4450,
6,
998,
273,
18364,
12,
3459,
16,
315,
91,
7923,
998,
1376,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
984,
1331,
369,
429,
12,
2890,
4672,
1544,
273,
2865,
18,
16961,
19793,
67,
2124,
1157,
9086,
2782,
397,
3552,
4450,
6,
998,
273,
18364,
12,
3459,
16,
315,
91,
7923,
998,
1376,
2... |
n = self._subwidget_name(name) if not n: raise TclError, "Subwidget " + name + " not child of " + self._name n = n[len(self._w)+1:] return self._nametowidget(n) | n = self._subwidget_name(name) if not n: raise TclError, "Subwidget " + name + " not child of " + self._name n = n[len(self._w)+1:] return self._nametowidget(n) | def subwidget(self, name): | b0e44d61d9e592e1acd6aa05eac9704ba5776f61 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/b0e44d61d9e592e1acd6aa05eac9704ba5776f61/Tix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
720,
6587,
12,
2890,
16,
508,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
720,
6587,
12,
2890,
16,
508,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
def _write(self, data): | def _write(self, data): | def _write(self, data): | f1d302d15f45741d8b0d5e81b4b0e5a61c6fa580 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/f1d302d15f45741d8b0d5e81b4b0e5a61c6fa580/binhex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2626,
12,
2890,
16,
501,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2626,
12,
2890,
16,
501,
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,... |
self.putline('.') | self.putline(b'.') | def post(self, f): """Process a POST command. Arguments: - f: file containing the article Returns: - resp: server response if successful""" | 933238ad85875df26c18a674f77afc1abaafb88e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8546/933238ad85875df26c18a674f77afc1abaafb88e/nntplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1603,
12,
2890,
16,
284,
4672,
3536,
2227,
279,
5485,
1296,
18,
225,
13599,
30,
300,
284,
30,
585,
4191,
326,
7559,
2860,
30,
300,
1718,
30,
1438,
766,
309,
6873,
8395,
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,
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,
1603,
12,
2890,
16,
284,
4672,
3536,
2227,
279,
5485,
1296,
18,
225,
13599,
30,
300,
284,
30,
585,
4191,
326,
7559,
2860,
30,
300,
1718,
30,
1438,
766,
309,
6873,
8395,
2,
-100,
-100,
... |
if verbose: print 'unpack string' a, b, c = 'one' if a != 'o' or b != 'n' or c != 'e': raise TestFailed | Unpack string... fun! | def __getitem__(self, i): if i >= 0 and i < 3: return i raise IndexError | 989a9d01aa1cbad29606c3b177b5c247a75fefc0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/989a9d01aa1cbad29606c3b177b5c247a75fefc0/test_unpack.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
277,
4672,
309,
277,
1545,
374,
471,
277,
411,
890,
30,
327,
277,
1002,
10195,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
277,
4672,
309,
277,
1545,
374,
471,
277,
411,
890,
30,
327,
277,
1002,
10195,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
elif args!=None: | elif len(args) != 0: | def execute(self, query, *args, **kwargs): """ an abstract database query - but more clever | 8b8fd292b53259be157dc10740fc8c306cf0e023 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8331/8b8fd292b53259be157dc10740fc8c306cf0e023/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
16,
843,
16,
380,
1968,
16,
2826,
4333,
4672,
3536,
392,
8770,
2063,
843,
300,
1496,
1898,
1619,
502,
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,
1836,
12,
2890,
16,
843,
16,
380,
1968,
16,
2826,
4333,
4672,
3536,
392,
8770,
2063,
843,
300,
1496,
1898,
1619,
502,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
if self.config.enablessl: | if self.config.enablessl: | def run(self, server_class=ThreadedHTTPServer, handler_class=InventoryServer): server_address = (self.bind, int(self.port)) if self.config.enablessl: self.logger.info("Starting server in ssl mode") server_class = SecureThreadedHTTPServer httpd = server_class(server_address, handler_class, self.config) else: httpd = server_class(server_address, handler_class) # Install SIGTERM handler signal.signal(signal.SIGTERM, self.handler) signal.signal(signal.SIGINT, self.handler) httpd.serve_forever() | 24cb2b73438c2235d9fe02a96cac14e3448cf2bb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5988/24cb2b73438c2235d9fe02a96cac14e3448cf2bb/server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
16,
1438,
67,
1106,
33,
1315,
20528,
3693,
2081,
16,
1838,
67,
1106,
33,
15059,
2081,
4672,
1438,
67,
2867,
273,
261,
2890,
18,
4376,
16,
509,
12,
2890,
18,
655,
3719,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
16,
1438,
67,
1106,
33,
1315,
20528,
3693,
2081,
16,
1838,
67,
1106,
33,
15059,
2081,
4672,
1438,
67,
2867,
273,
261,
2890,
18,
4376,
16,
509,
12,
2890,
18,
655,
3719,
... |
self.tree.openElements[-1].appendChild(element) | if self.tree.headPointer is not None and\ self.parser.phase == self.parser.phases["inHead"]: self.appendToHead(element) else: self.tree.openElements[-1].appendChild(element) | def startTagScript(self, name, attributes): element = self.tree.createElement(name, attributes) element._flags.append("parser-inserted") | 68e5292908c342cac5224497fa257ce9542cb3ba /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10463/68e5292908c342cac5224497fa257ce9542cb3ba/html5parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
1805,
3651,
12,
2890,
16,
508,
16,
1677,
4672,
930,
273,
365,
18,
3413,
18,
2640,
1046,
12,
529,
16,
1677,
13,
930,
6315,
7133,
18,
6923,
2932,
4288,
17,
6387,
329,
7923,
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,
787,
1805,
3651,
12,
2890,
16,
508,
16,
1677,
4672,
930,
273,
365,
18,
3413,
18,
2640,
1046,
12,
529,
16,
1677,
13,
930,
6315,
7133,
18,
6923,
2932,
4288,
17,
6387,
329,
7923,
2,
-10... |
cat_namespace = wikipedia.getSite().category_namespace() | cat_namespace = wikipedia.getSite().category_namespaces()[0] | def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' print "This bot has two modes: you can add a category link to all" print "pages mentioned in a List that is now in another wikipedia page" print "or you can add a category link to all pages that link to a" print "specific page. If you want the second, please give an empty" print "answer to the first question." listpage = wikipedia.input(u'Wikipedia page with list of pages to change:') if listpage: try: pl = wikipedia.PageLink(wikipedia.getSite(), listpage) except NoPage: wikipedia.output(u'The page ' + listpage + ' could not be loaded from the server.') sys.exit() pagenames = pl.links() else: refpage = wikipedia.input(u'Wikipedia page that is now linked to:') pl = wikipedia.PageLink(wikipedia.getSit(), refpage) pagenames = wikipedia.getReferences(pl) print " ==> %d pages to process"%len(pagenames) print newcat = wikipedia.input(u'Category to add (do not give namespace):') newcat = newcat[:1].capitalize() + newcat[1:] # get edit summary message wikipedia.setAction(wikipedia.translate(wikipedia.getSite(), msg_add) % newcat) cat_namespace = wikipedia.getSite().category_namespace() answer = '' for nm in pagenames: pl2 = wikipedia.PageLink(wikipedia.getSite(), nm) if answer != 'a': answer = '' while answer not in ('y','n','a'): answer = wikipedia.input(u'%s [y/n/a(ll)]:' % (pl2.aslink())) if answer == 'a': confirm = '' while confirm not in ('y','n'): confirm = wikipedia.input(u'This should be used if and only if you are sure that your links are correct! Are you sure? [y/n]:') if answer == 'y' or answer == 'a': try: cats = pl2.categories() except wikipedia.NoPage: wikipedia.output(u"%s doesn't exist yet. Ignoring."%(pl2.aslocallink())) pass except wikipedia.IsRedirectPage,arg: pl3 = wikipedia.PageLink(wikipedia.getSite(),arg.args[0]) wikipedia.output(u"WARNING: %s is redirect to [[%s]]. Ignoring."%(pl2.aslocallink(),pl3.aslocallink())) else: wikipedia.output(u"Current categories: %s" % cats) catpl = wikipedia.PageLink(wikipedia.getSite(), cat_namespace + ':' + newcat) if sort_by_last_name: catpl = sorted_by_last_name(catpl, pl2) if catpl in cats: wikipedia.output(u"%s already has %s"%(pl2.aslocallink(), catpl.aslocallink())) else: wikipedia.output(u'Adding %s' % catpl.aslocallink()) cats.append(catpl) text = pl2.get() text = wikipedia.replaceCategoryLinks(text, cats) pl2.put(text) | 84cc82cdafbaa3688f93585339ea6f61f02749e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/84cc82cdafbaa3688f93585339ea6f61f02749e0/category.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
4743,
12,
3804,
67,
1637,
67,
2722,
67,
529,
273,
1083,
4672,
9163,
432,
14386,
358,
8039,
17,
1289,
279,
3150,
358,
279,
666,
434,
4689,
18,
9163,
1172,
315,
2503,
2512,
711,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4743,
12,
3804,
67,
1637,
67,
2722,
67,
529,
273,
1083,
4672,
9163,
432,
14386,
358,
8039,
17,
1289,
279,
3150,
358,
279,
666,
434,
4689,
18,
9163,
1172,
315,
2503,
2512,
711,... |
self.SetToolBitmapSize(wx.Size(25,25)) | self._size = 25 | def __init__(self, parent): wx.ToolBar.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT|wx.TB_NODIVIDER) if sys.platform == 'darwin': self.SetToolBitmapSize(wx.Size(25,25)) else: self.SetToolBitmapSize(wx.Size(16,16)) self.parent = parent self.__init_items() self.__bind_events() | 7b2c767a7799f85e09921f72c3bc22f8711533e9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10228/7b2c767a7799f85e09921f72c3bc22f8711533e9/frame.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
4672,
7075,
18,
6364,
5190,
16186,
2738,
972,
12,
2890,
16,
982,
16,
300,
21,
16,
7075,
18,
1868,
2555,
16,
7075,
18,
1868,
1225,
16,
7075,
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,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
4672,
7075,
18,
6364,
5190,
16186,
2738,
972,
12,
2890,
16,
982,
16,
300,
21,
16,
7075,
18,
1868,
2555,
16,
7075,
18,
1868,
1225,
16,
7075,
18,
25... |
else | else: | def __init__(data = None) if data == None: quickfix.IntField.__init__(self, 203) else quickfix.IntField.__init__(self, 203, data) | 484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
1702,
974,
16186,
2738,
972,
12,
2890,
16,
4200,
23,
13,
469,
30,
9549,
904,
18,
1702,
974,
16186,
2738... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
1702,
974,
16186,
2738,
972,
12,
2890,
16,
4200,
23,
13,
469,
30,
9549,
904,
18,
1702,
974,
16186,
2738... |
else: self.event = itemOrEvent.itsItem | def __init__(self, bounds, itemOrEvent): """ @param bounds: the bounds of the item as drawn on the canvas. @type bounds: wx.Rect @param item: the item drawn on the canvas in these bounds @type itemOrEvent: C{Item} or C{EventStamp} """ # @@@ scaffolding: resize bounds is the lower 5 pixels self._bounds = bounds if isinstance(itemOrEvent, EventStamp): self.event = EventStamp(itemOrEvent) else: self.event = itemOrEvent.itsItem | ec483e015988d9e41c11dfe52832b4738dc73133 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/ec483e015988d9e41c11dfe52832b4738dc73133/CollectionCanvas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4972,
16,
761,
1162,
1133,
4672,
3536,
632,
891,
4972,
30,
326,
4972,
434,
326,
761,
487,
19377,
603,
326,
5953,
18,
632,
723,
4972,
30,
7075,
18,
6120,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4972,
16,
761,
1162,
1133,
4672,
3536,
632,
891,
4972,
30,
326,
4972,
434,
326,
761,
487,
19377,
603,
326,
5953,
18,
632,
723,
4972,
30,
7075,
18,
6120,
... | |
The upper hook length of a box (i,j) is defined by | The upper hook length of a box (i,j) in a partition $\kappa$ is defined by | def upper_hook_lengths(self, alpha): r""" Returns the upper hook lengths of the partition. When alpha == 1, these are just the normal hook lengths. | d2bea0c9898d10512ce54569c87e5b09be4cdba6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/d2bea0c9898d10512ce54569c87e5b09be4cdba6/partition.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3854,
67,
4476,
67,
14907,
12,
2890,
16,
4190,
4672,
436,
8395,
2860,
326,
3854,
3953,
10917,
434,
326,
3590,
18,
225,
5203,
4190,
422,
404,
16,
4259,
854,
2537,
326,
2212,
3953,
10917,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3854,
67,
4476,
67,
14907,
12,
2890,
16,
4190,
4672,
436,
8395,
2860,
326,
3854,
3953,
10917,
434,
326,
3590,
18,
225,
5203,
4190,
422,
404,
16,
4259,
854,
2537,
326,
2212,
3953,
10917,
... |
print subVars("Headings","branch-heading",linenum,enum) | print subVars("Headings","branch-heading") | def handleHeading(linenum,enum): global outline, parents v["%%"] = outline[linenum][0] children = getChildren(linenum) if enum == 1: print subVars("Headings","before-headings",linenum,enum) if children: print subVars("Headings","branch-heading",linenum,enum) parents.append([linenum,enum]) handleObjects(children) parents.pop() print subVars("Headings","after-headings",linenum,enum) else: print subVars("Headings","leaf-heading",linenum,enum) | 06415efd07e1e7445f08ac0ea608650310478422 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6154/06415efd07e1e7445f08ac0ea608650310478422/otl2tags.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
21867,
12,
7511,
7924,
16,
7924,
4672,
2552,
16363,
16,
6298,
225,
331,
9614,
11438,
11929,
273,
16363,
63,
7511,
7924,
6362,
20,
65,
2325,
273,
10268,
12,
7511,
7924,
13,
309,
279... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
21867,
12,
7511,
7924,
16,
7924,
4672,
2552,
16363,
16,
6298,
225,
331,
9614,
11438,
11929,
273,
16363,
63,
7511,
7924,
6362,
20,
65,
2325,
273,
10268,
12,
7511,
7924,
13,
309,
279... |
cygwin_path_fix = checkCygwinPath(srcdir) | windows_style_tex_paths = checkTeXPaths() | def removeTempFiles(): # Final clean-up if not lyx_keep_temps: removeFiles(['chkconfig.sed', 'chkconfig.vars', \ 'wrap_chkconfig.ltx', 'wrap_chkconfig.log', \ 'chklayouts.tex', 'missfont.log', 'chklatex.ltx', 'chklatex.log']) | 44a5cfc89ced180ed4411bf0f46d3df3756725e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7514/44a5cfc89ced180ed4411bf0f46d3df3756725e5/configure.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
7185,
2697,
13332,
468,
16269,
2721,
17,
416,
309,
486,
18519,
92,
67,
10102,
67,
874,
1121,
30,
1206,
2697,
12,
3292,
27038,
1425,
18,
730,
2187,
296,
27038,
1425,
18,
4699,
2187,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
7185,
2697,
13332,
468,
16269,
2721,
17,
416,
309,
486,
18519,
92,
67,
10102,
67,
874,
1121,
30,
1206,
2697,
12,
3292,
27038,
1425,
18,
730,
2187,
296,
27038,
1425,
18,
4699,
2187,... |
self.report_untrusted = self.configbool("ui", "report_untrusted", True) | self._reportuntrusted = self.configbool("ui", "report_untrusted", True) | def fixconfig(self, root=None): # translate paths relative to root (or home) into absolute paths root = root or os.getcwd() for c in self._tcfg, self._ucfg, self._ocfg: for n, p in c.items('paths'): if p and "://" not in p and not os.path.isabs(p): c.set("paths", n, os.path.normpath(os.path.join(root, p))) | 8b81a816b634ba5d27dd34720ad4de810a1d3f93 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11312/8b81a816b634ba5d27dd34720ad4de810a1d3f93/ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
1425,
12,
2890,
16,
1365,
33,
7036,
4672,
468,
4204,
2953,
3632,
358,
1365,
261,
280,
6382,
13,
1368,
4967,
2953,
1365,
273,
1365,
578,
1140,
18,
588,
11089,
1435,
364,
276,
316,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
1425,
12,
2890,
16,
1365,
33,
7036,
4672,
468,
4204,
2953,
3632,
358,
1365,
261,
280,
6382,
13,
1368,
4967,
2953,
1365,
273,
1365,
578,
1140,
18,
588,
11089,
1435,
364,
276,
316,
... |
local_sdp.media.append(self._init_audio(audio_rtp)) | local_sdp.media.append(self._init_audio(audio_rtp)) else: local_sdp.media[audio_sdp_index] = self._init_audio(audio_rtp) | def _add_audio_continue(self, audio_rtp, msrp_chat): self._lock.acquire() try: if self.state != "PROPOSING": return local_sdp = self._make_next_sdp(True, self.on_hold_by_local) audio_sdp_index = self._audio_sdp_index if audio_sdp_index == -1: audio_sdp_index = len(local_sdp.media) local_sdp.media.append(self._init_audio(audio_rtp)) if self.on_hold_by_local: local_sdp.media[audio_sdp_index].attributes.append(SDPAttribute("sendonly", "")) if audio_rtp.use_ice: local_sdp.connection.address = self.audio_transport.transport.local_rtp_address self._inv.set_offered_local_sdp(local_sdp) self._inv.send_reinvite() except SIPCoreError, e: self.proposed_audio = False self._cancel_media() self._change_state("ESTABLISHED") self.notification_center.post_notification("SCSessionRejectedStreamProposal", self, TimestampedNotificationData(proposer="local", reason=e.args[0])) finally: self._lock.release() | 9e9618034500c66f3e54f8b7203ca8cdfb292d6a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5703/9e9618034500c66f3e54f8b7203ca8cdfb292d6a/session.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1289,
67,
11509,
67,
17143,
12,
2890,
16,
7447,
67,
3797,
84,
16,
4086,
13832,
67,
10880,
4672,
365,
6315,
739,
18,
1077,
1039,
1435,
775,
30,
309,
365,
18,
2019,
480,
315,
3373,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1289,
67,
11509,
67,
17143,
12,
2890,
16,
7447,
67,
3797,
84,
16,
4086,
13832,
67,
10880,
4672,
365,
6315,
739,
18,
1077,
1039,
1435,
775,
30,
309,
365,
18,
2019,
480,
315,
3373,
... |
if value != output: | if value != output or type(value) is not type(output): | def test(method, input, output, *args): if verbose: print '%s.%s%s =? %s... ' % (repr(input), method, args, output), try: f = getattr(input, method) value = apply(f, args) except: value = sys.exc_type exc = sys.exc_info()[:2] else: exc = None if value != output: if verbose: print 'no' print '*',f, `input`, `output`, `value` if exc: print ' value == %s: %s' % (exc) else: if verbose: print 'yes' | 997dda61e6820d53c38b8261450be64d051e8259 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/997dda61e6820d53c38b8261450be64d051e8259/test_unicode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
12,
2039,
16,
810,
16,
876,
16,
380,
1968,
4672,
309,
3988,
30,
1172,
1995,
87,
7866,
87,
9,
87,
273,
35,
738,
87,
2777,
296,
738,
261,
12715,
12,
2630,
3631,
707,
16,
833,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
2039,
16,
810,
16,
876,
16,
380,
1968,
4672,
309,
3988,
30,
1172,
1995,
87,
7866,
87,
9,
87,
273,
35,
738,
87,
2777,
296,
738,
261,
12715,
12,
2630,
3631,
707,
16,
833,
1... |
message = translate(_(u'msg_stopped_timer', default=u'Stopped the timer')) | message = _(u'msg_stopped_timer', default=u'Stopped the timer') | def stop_timer(self): tracker = get_tracker(self.context) tracker.starttime = None zope = self.getCommandSet('zope') zope.refreshProvider('#startstop', 'xm.tracker.startstop') message = translate(_(u'msg_stopped_timer', default=u'Stopped the timer')) plone = self.getCommandSet("plone") plone.issuePortalMessage(message) | 92bd0351ae7a9b70e3efed0b809beae7df46e6a2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10445/92bd0351ae7a9b70e3efed0b809beae7df46e6a2/ksstracker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2132,
67,
12542,
12,
2890,
4672,
9745,
273,
336,
67,
16543,
12,
2890,
18,
2472,
13,
9745,
18,
1937,
957,
273,
599,
998,
1306,
273,
365,
18,
588,
2189,
694,
2668,
94,
1306,
6134,
998,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2132,
67,
12542,
12,
2890,
4672,
9745,
273,
336,
67,
16543,
12,
2890,
18,
2472,
13,
9745,
18,
1937,
957,
273,
599,
998,
1306,
273,
365,
18,
588,
2189,
694,
2668,
94,
1306,
6134,
998,
... |
def __init__(self,filename,fam): | def __init__(self, filename, fam): | def __init__(self,filename,fam): XMLFileBacked.__init__(self, filename) fam.AddMonitor(filename, self) | 663fd7648200f6806c0af46cf879014c1a3e3e9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11867/663fd7648200f6806c0af46cf879014c1a3e3e9e/Generator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1544,
16,
26688,
4672,
3167,
812,
2711,
329,
16186,
2738,
972,
12,
2890,
16,
1544,
13,
26688,
18,
986,
7187,
12,
3459,
16,
365,
13,
2,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
2738,
972,
12,
2890,
16,
1544,
16,
26688,
4672,
3167,
812,
2711,
329,
16186,
2738,
972,
12,
2890,
16,
1544,
13,
26688,
18,
986,
7187,
12,
3459,
16,
365,
13,
2,
-100,
-100,
-100,
... |
if d < l[1]: raise UnderflowError if d > l[2]: raise OverflowError else: if s == "nan": return fpconst.NaN elif s[0:3] in ("inf", "+inf"): return fpconst.PosInf elif s[0:3] == "-inf": return fpconst.NegInf if fpconst.isNaN(d): if s != 'nan': raise ValueError, "invalid %s: %s" % (t[1], s) elif fpconst.isNegInf(d): if s != '-inf': raise UnderflowError, "%s too small: %s" % (t[1], s) elif fpconst.isPosInf(d): if s != 'inf': raise OverflowError, "%s too large: %s" % (t[1], s) elif d < 0 and d < l[1]: raise UnderflowError, "%s too small: %s" % (t[1], s) elif d > 0 and ( d < l[0] or d > l[2] ): raise OverflowError, "%s too large: %s" % (t[1], s) elif d == 0: if type(self.zerofloatre) == StringType: self.zerofloatre = re.compile(self.zerofloatre) if self.zerofloatre.search(s): raise UnderflowError, "invalid %s: %s" % (t[1], s) | if fpconst.isNaN(d): if s[0:2] != 'nan': raise ValueError, "invalid %s: %s" % (t[1], s) elif fpconst.isNegInf(d): if s[0:3] != '-inf': raise UnderflowError, "%s too small: %s" % (t[1], s) elif fpconst.isPosInf(d): if s[0:2] != 'inf' and s[0:3] != '+inf': raise OverflowError, "%s too large: %s" % (t[1], s) elif d < 0 and d < l[1]: raise UnderflowError, "%s too small: %s" % (t[1], s) elif d > 0 and ( d < l[0] or d > l[2] ): raise OverflowError, "%s too large: %s" % (t[1], s) elif d == 0: if type(self.zerofloatre) == StringType: self.zerofloatre = re.compile(self.zerofloatre) if self.zerofloatre.search(s): raise UnderflowError, "invalid %s: %s" % (t[1], s) | def convertToBasicTypes(self, d, t, attrs, config=Config): dnn = d or '' | ec094af15af9be4e1f783c46d8dc80e6d99b321e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/14538/ec094af15af9be4e1f783c46d8dc80e6d99b321e/Parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8137,
8252,
2016,
12,
2890,
16,
302,
16,
268,
16,
3422,
16,
642,
33,
809,
4672,
8800,
82,
273,
302,
578,
875,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8137,
8252,
2016,
12,
2890,
16,
302,
16,
268,
16,
3422,
16,
642,
33,
809,
4672,
8800,
82,
273,
302,
578,
875,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
names = self.tk.split(self.tk.call(self._w, 'pages')) ret = [] for x in names: ret.append(self.subwidget(x)) return ret def raise_page(self, name): self.tk.call(self._w, 'raise', name) | names = self.tk.split(self.tk.call(self._w, 'pages')) ret = [] for x in names: ret.append(self.subwidget(x)) return ret def raise_page(self, name): self.tk.call(self._w, 'raise', name) | def pages(self): | 86af7ef7e3f4448abc89aa941517a84075d99a38 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/86af7ef7e3f4448abc89aa941517a84075d99a38/Tix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4689,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4689,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
del self._trackCache[self.trackIDList.pop(0)] | del self._trackCache[self._trackIDList.pop(0)] | def addTrackToCache(self, track): self._logger.debug("Adding track to cache.") if len(self._trackCache) > 10000: del self._trackCache[self.trackIDList.pop(0)] id = track.getID() self._trackCache[id] = track self._trackIDList.append(id) | 721c5669b78ca91f164838c617fd718f7b40d748 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8545/721c5669b78ca91f164838c617fd718f7b40d748/Track.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
4402,
774,
1649,
12,
2890,
16,
3298,
4672,
365,
6315,
4901,
18,
4148,
2932,
13962,
3298,
358,
1247,
1199,
13,
309,
562,
12,
2890,
6315,
4101,
1649,
13,
405,
12619,
30,
1464,
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,
527,
4402,
774,
1649,
12,
2890,
16,
3298,
4672,
365,
6315,
4901,
18,
4148,
2932,
13962,
3298,
358,
1247,
1199,
13,
309,
562,
12,
2890,
6315,
4101,
1649,
13,
405,
12619,
30,
1464,
365,
... |
'Lattice="10.880000 0.000000 0.000000 0.000000 10.880000 0.000000 0.000000 0.000000 10.880000" Properties=species:S:1:pos:R:3:Z:I:1\n', | 'dummy=1.00000000 Lattice="10.880000 0.000000 0.000000 0.000000 10.880000 0.000000 0.000000 0.000000 10.880000" Properties=species:S:1:pos:R:3:Z:I:1\n', | def setUp(self): self.at = supercell(diamond(5.44,14), 2,2,2) self.al = AtomsList([ supercell(diamond(5.44+0.01*x,14),2,2,2) for x in range(5) ]) | 382127aa2af8791d97535fb72c58c9c17033cb23 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8914/382127aa2af8791d97535fb72c58c9c17033cb23/test_atomslist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
12,
2890,
4672,
365,
18,
270,
273,
2240,
3855,
12,
3211,
301,
1434,
12,
25,
18,
6334,
16,
3461,
3631,
576,
16,
22,
16,
22,
13,
365,
18,
287,
273,
7149,
21576,
3816,
2240,
3855... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
12,
2890,
4672,
365,
18,
270,
273,
2240,
3855,
12,
3211,
301,
1434,
12,
25,
18,
6334,
16,
3461,
3631,
576,
16,
22,
16,
22,
13,
365,
18,
287,
273,
7149,
21576,
3816,
2240,
3855... |
if data["action"] in self.client.NOTIFY_ACTIONS_COMPLETE: self.notification.append( ["", "Revision %s" % data["revision"].number, ""] ) | try: if data["action"] in self.client.NOTIFY_ACTIONS_COMPLETE: self.notification.append( ["", "Revision %s" % data["revision"].number, ""] ) except AttributeError, e: pass | def notify(self, data): """ This method is called every time the VCS function wants to tell us something. It passes us a dictionary of useful information. When this method is called, it appends some useful data to the notifcation window. TODO: We need to implement this in a more VCS-agnostic way, since the supplied data dictionary is pysvn-dependent. I'm going to implement something in lib/vcs/svn.py soon. """ | cd01144e005467e841e568970d0c868243c62d56 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5119/cd01144e005467e841e568970d0c868243c62d56/action.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5066,
12,
2890,
16,
501,
4672,
3536,
1220,
707,
353,
2566,
3614,
813,
326,
776,
4596,
445,
14805,
358,
9276,
584,
5943,
18,
225,
2597,
11656,
584,
279,
3880,
434,
5301,
1779,
18,
225,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5066,
12,
2890,
16,
501,
4672,
3536,
1220,
707,
353,
2566,
3614,
813,
326,
776,
4596,
445,
14805,
358,
9276,
584,
5943,
18,
225,
2597,
11656,
584,
279,
3880,
434,
5301,
1779,
18,
225,
... |
message = self.timeleftstring(self.fractSec(left)) | h, m, s = self.fractSec(left) message = self.timeleftstring(h, m, s) | def pnotifier(self): if not self.gettime(self.timefile): return True time = self.gettime(self.timefile) index = int(strftime("%w")) left = self.limits[index] - time if left <= 0: self.notifier('Your time is up') return True message = self.timeleftstring(self.fractSec(left)) self.notifier(message) # if time left is less than 5 minutes, notify every minute if time < 300: gobject.timeout_add(1 * 60 * 1000, self.pnotifier) return False # if time left is less than 15 minutes, notify every 5 minutes if time < 900: gobject.timeout_add(5 * 60 * 1000, self.pnotifier) return False | 7b21c5d86feaafc6de69a693bebc3660e9dd9c75 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1574/7b21c5d86feaafc6de69a693bebc3660e9dd9c75/timekpr-client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
293,
902,
1251,
12,
2890,
4672,
309,
486,
365,
18,
588,
957,
12,
2890,
18,
957,
768,
4672,
327,
1053,
225,
813,
273,
365,
18,
588,
957,
12,
2890,
18,
957,
768,
13,
770,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
293,
902,
1251,
12,
2890,
4672,
309,
486,
365,
18,
588,
957,
12,
2890,
18,
957,
768,
4672,
327,
1053,
225,
813,
273,
365,
18,
588,
957,
12,
2890,
18,
957,
768,
13,
770,
273,
509,
1... |
self.__init__(atype=inventory.element, xyz=inventory.xyz, label=inventory.label, occupancy=inventory.occupancy) | atom = self.__class__( atype=inventory.element, xyz=inventory.xyz, label=inventory.label, occupancy=inventory.occupancy) self.__init__(atom) return | def __restoreFromInventory__(self, inventory): self.__init__(atype=inventory.element, xyz=inventory.xyz, label=inventory.label, occupancy=inventory.occupancy) | 4809e79914b922bbea5850bbd9771592a055d070 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/578/4809e79914b922bbea5850bbd9771592a055d070/Atom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
13991,
1265,
15059,
972,
12,
2890,
16,
13086,
4672,
365,
16186,
2738,
972,
12,
6361,
33,
26024,
18,
2956,
16,
14779,
33,
26024,
18,
17177,
16,
1433,
33,
26024,
18,
1925,
16,
18928,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
13991,
1265,
15059,
972,
12,
2890,
16,
13086,
4672,
365,
16186,
2738,
972,
12,
6361,
33,
26024,
18,
2956,
16,
14779,
33,
26024,
18,
17177,
16,
1433,
33,
26024,
18,
1925,
16,
18928,... |
sys.exit(True) | sys.exit(0) match_list = [] | def main(): parser = OptionParser(usage=u"%prog usage: ttvdb -hdruviomMPFBDS [parameters]\n <series name or 'series and season number' or 'series and season number and episode number'>\n\nFor details on using ttvdb with Mythvideo see the ttvdb wiki page at:\nhttp://www.mythtv.org/wiki/Ttvdb.py") parser.add_option( "-d", "--debug", action="store_true", default=False, dest="debug", help=u"Show debugging info") parser.add_option( "-r", "--raw", action="store_true",default=False, dest="raw", help=u"Dump raw data only") parser.add_option( "-u", "--usage", action="store_true", default=False, dest="usage", help=u"Display examples for executing the ttvdb script") parser.add_option( "-v", "--version", action="store_true", default=False, dest="version", help=u"Display version and author") parser.add_option( "-i", "--interactive", action="store_true", default=False, dest="interactive", help=u"Interaction mode (allows selection of a specific Series)") parser.add_option( "-c", "--configure", metavar="FILE", default="", dest="configure", help=u"Use configuration settings") parser.add_option( "-l", "--language", metavar="LANGUAGE", default=u'en', dest="language", help=u"Select data that matches the specified language fall back to english if nothing found (e.g. 'es' Español, 'de' Deutsch ... etc)") parser.add_option( "-n", "--num_seasons", action="store_true", default=False, dest="num_seasons", help=u"Return the season numbers for a series") parser.add_option( "-t", "--toprated", action="store_true", default=False, dest="toprated", help=u"Only return the top rated graphics for a TV Series") parser.add_option( "-m", "--mythvideo", action="store_true", default=False, dest="mythvideo", help=u"Conform to mythvideo standards when processing -M, -P, -F and -D") parser.add_option( "-M", "--list", action="store_true", default=False, dest="list", help=u"Get matching TV Series list") parser.add_option( "-P", "--poster", action="store_true", default=False, dest="poster", help=u"Get Series Poster URL(s)") parser.add_option( "-F", "--fanart", action="store_true", default=False, dest="fanart", help=u"Get Series fan art URL(s)") parser.add_option( "-B", "--backdrop", action="store_true", default=False, dest="banner", help=u"Get Series banner/backdrop URL(s)") parser.add_option( "-S", "--screenshot", action="store_true", default=False, dest="screenshot", help=u"Get Series episode screenshot URL") parser.add_option( "-D", "--data", action="store_true", default=False, dest="data", help=u"Get Series episode data") parser.add_option( "-N", "--numbers", action="store_true", default=False, dest="numbers", help=u"Get Season and Episode numbers") opts, series_season_ep = parser.parse_args() # Make everything unicode utf8 for index in range(len(series_season_ep)): series_season_ep[index] = unicode(series_season_ep[index], 'utf8') if opts.debug == True: print "opts", opts print "\nargs", series_season_ep # Process version command line requests if opts.version == True: sys.stdout.write("%s (%s) by %s\n" % ( __title__, __version__, __author__ )) sys.exit(True) # Process usage command line requests if opts.usage == True: sys.stdout.write(usage_txt) sys.exit(True) if len(series_season_ep) == 0: parser.error("! No series or series season episode supplied") sys.exit(False) # Default output format of season and episode numbers global season_and_episode_num, screenshot_request season_and_episode_num='S%02dE%02d' # Format output example "S04E12" if opts.numbers == False: if len(series_season_ep) > 1: if not _can_int(series_season_ep[1]): parser.error("! Season is not numeric") sys.exit(False) if len(series_season_ep) > 2: if not _can_int(series_season_ep[2]): parser.error("! Episode is not numeric") sys.exit(False) else: if len(series_season_ep) < 2: parser.error("! An Episode name must be included") sys.exit(False) if len(series_season_ep) == 3: season_and_episode_num = series_season_ep[2] # Override default output format if opts.screenshot: if len(series_season_ep) > 1: if not _can_int(series_season_ep[1]): parser.error("! Season is not numeric") sys.exit(False) if len(series_season_ep) > 2: if not _can_int(series_season_ep[2]): parser.error("! Episode is not numeric") sys.exit(False) if not len(series_season_ep) > 2: parser.error("! Option (-S), episode screenshot search requires Season and Episode numbers") sys.exit(False) screenshot_request = True if opts.debug == True: print series_season_ep if opts.debug == True: print "#"*20 print "# series_season_ep array(",series_season_ep,")" if opts.debug == True: print "#"*20 print "# Starting tvtvb" print "# Processing (%s) Series" % ( series_season_ep[0] ) # List of language from http://www.thetvdb.com/api/0629B785CE550C8D/languages.xml # Hard-coded here as it is realtively static, and saves another HTTP request, as # recommended on http://thetvdb.com/wiki/index.php/API:languages.xml valid_languages = ["da", "fi", "nl", "de", "it", "es", "fr","pl", "hu","el","tr", "ru","he","ja","pt","zh","cs","sl", "hr","ko","en","sv","no"] # Validate language as specified by user if opts.language: for lang in valid_languages: if opts.language == lang: break else: valid_langs = '' for lang in valid_languages: valid_langs+= lang+', ' valid_langs=valid_langs[:-2] sys.stdout.write("! Specified language(%s) must match one of the following languages supported by thetvdb.com wiki:\n (%s)\n" % (opts.language, valid_langs)) sys.exit(False) # Access thetvdb.com API with banners (Posters, Fanart, banners, screenshots) data retrieval enabled if opts.list ==True: t = tvdb_api.Tvdb(banners=False, debug = opts.debug, cache = cache_dir, custom_ui=returnAllSeriesUI, language = opts.language, apikey="0BB856A59C51D607") # thetvdb.com API key requested by MythTV) elif opts.interactive == True: t = tvdb_api.Tvdb(banners=True, debug=opts.debug, interactive=True, select_first=False, cache=cache_dir, actors = True, language = opts.language, apikey="0BB856A59C51D607") # thetvdb.com API key requested by MythTV) else: t = tvdb_api.Tvdb(banners=True, debug = opts.debug, cache = cache_dir, actors = True, language = opts.language, apikey="0BB856A59C51D607") # thetvdb.com API key requested by MythTV) # Determine if there is a SID or a series name to search with global SID SID = False if _can_int(series_season_ep[0]): # if it is numeric then assume it is a series ID number SID = True else: SID = False if opts.debug == True: print "# ..got tvdb mirrors" print "# Start to process series or series_season_ep" print "#"*20 global override override={} # Initialize series name override dictionary # If the user wants Series name overrides and a override file exists then create an overide dictionary if opts.configure != '': if opts.configure[0]=='~': opts.configure=os.path.expanduser("~")+opts.configure[1:] if os.path.exists(opts.configure) == 1: # Do overrides exist? initialize_override_dictionary(opts.configure) else: debuglog("! The specified override file (%s) does not exist" % opts.configure) sys.exit(False) if len(override) == 0: opts.configure = False # Turn off the override option as there is nothing to override # Check if a video name was passed and if so parse it for series name, season and episode numbers if len(series_season_ep) == 1: for r in name_parse: match = r.match(series_season_ep[0]) if match: seriesname, seasno, epno = match.groups() #remove ._- characters from name (- removed only if next to end of line) seriesname = re.sub("[\._]|\-(?=$)", " ", seriesname).strip() series_season_ep = [seriesname, seasno, epno] break # Matched - to the next file! # Fetch a list of matching series names if (opts.list ==True ): try: allSeries=t._getSeries(series_season_ep[0]) except tvdb_shownotfound: sys.exit(True) # No matching series for series_name_sid in allSeries: # list search results print u"%s:%s" % (series_name_sid['sid'], series_name_sid['name']) sys.exit(True) # The Series list option (-M) is the only option honoured when used # Verify that thetvdb.com has the desired series_season_ep. # Exit this module if series_season_ep is not found if opts.numbers == False and opts.num_seasons == False: seriesfound=searchseries(t, opts, series_season_ep) x=1 else: x=[] x.append(series_season_ep[0]) # Only use series name in check seriesfound=searchseries(t, opts, x) # Return the season numbers for a series if opts.num_seasons == True: season_numbers='' for x in seriesfound.keys(): season_numbers+='%d,' % x print season_numbers[:-1] sys.exit(True) # Option (-n) is the only option honoured when used # Dump information accessable for a Series and ONLY first season of episoded data if opts.debug == True: print "#"*20 print "# Starting Raw keys call" print "Lvl #1:" # Seasons for series x = t[series_season_ep[0]].keys() print t[series_season_ep[0]].keys() print "#"*20 print "Lvl #2:" # Episodes for each season for y in x: print t[series_season_ep[0]][y].keys() print "#"*20 print "Lvl #3:" # Keys for each episode within the 1st season z = t[series_season_ep[0]][1].keys() for aa in z: print t[series_season_ep[0]][1][aa].keys() print "#"*20 print "Lvl #4:" # Available data for each episode in 1st season for aa in z: codes = t[series_season_ep[0]][1][aa].keys() print "\n\nStart:" for c in codes: print "="*50 print 'Key Name=('+c+'):' print t[series_season_ep[0]][1][aa][c] print "="*50 print "#"*20 sys.exit (True) if opts.numbers == True: # Fetch and output season and episode numbers Getseries_episode_numbers(t, opts, series_season_ep) sys.exit(True) # The Numbers option (-N) is the only option honoured when used if opts.data or screenshot_request: # Fetch and output episode data if opts.mythvideo: if len(series_season_ep) != 3: print u"Season and Episode numbers required." else: Getseries_episode_data(t, opts, series_season_ep, language=opts.language) else: Getseries_episode_data(t, opts, series_season_ep, language=opts.language) # Fetch the requested graphics URL(s) if opts.debug == True: print "#"*20 print "# Checking if Posters, Fanart or Banners are available" print "#"*20 if opts.configure != "" and override.has_key(series_season_ep[0].lower()): banners_keys = search_for_series(t, override[series_season_ep[0].lower()][0])['_banners'].keys() else: banners_keys = search_for_series(t, series_season_ep[0])['_banners'].keys() banner= False poster= False fanart= False for x in banners_keys: # Determine what type of graphics is available if x == fanart_key: fanart=True elif x== poster_key: poster=True elif x==season_key or x==banner_key: banner=True # Make sure that some graphics URL(s) (Posters, FanArt or Banners) are available if ( fanart!=True and poster!=True and banner!=True ): sys.exit(True) if opts.debug == True: print "#"*20 print "# One or more of Posters, Fanart or Banners are available" print "#"*20 # Determine if graphic URL identification output is required if opts.data: # Along with episode data get all graphics opts.poster = True opts.fanart = True opts.banner = True single_option = True opts.toprated = False fanart, banner, poster = (True, True, True) else: y=0 single_option=True if opts.poster==True: y+=1 if opts.fanart==True: y+=1 if opts.banner==True: y+=1 # Determine if only top rated by thetvdb.com graphics has been requested: if opts.toprated == True: series_name='' if opts.configure != "" and override.has_key(series_season_ep[0].lower()): series_name=override[series_season_ep[0].lower()][0] # Override series name else: series_name=series_season_ep[0] # Leave the series name alone if opts.poster==True: if search_for_series(t, series_name)['poster'] != None: if single_option==True: print (search_for_series(t, series_name)['poster']).replace(http_find, http_replace) else: print u"Coverart:%s" % (search_for_series(t, series_name)['poster']).replace(http_find, http_replace) if opts.fanart==True: if search_for_series(t, series_name)['fanart'] != None: if single_option==True: print (search_for_series(t, series_name)['fanart']).replace(http_find, http_replace) else: print u"Fanart:%s" % (search_for_series(t, series_name)['fanart']).replace(http_find, http_replace) if opts.banner==True: if search_for_series(t, series_name)['banner'] != None: if single_option==True: print (search_for_series(t, series_name)['banner']).replace(http_find, http_replace) else: print u"Banner:%s" % (search_for_series(t, series_name)['banner']).replace(http_find, http_replace) sys.exit(True) # Only the top rated for a TV Series is returned if (poster==True and opts.poster==True and opts.raw!=True): # Get posters and send to stdout season_poster_found = False if opts.mythvideo: if len(series_season_ep) < 2: print u"Season and Episode numbers required." sys.exit(True) all_posters = u'Coverart:' all_empty = len(all_posters) for p in get_graphics(t, opts, series_season_ep, poster_type, single_option, opts.language): all_posters = all_posters+p+u',' season_poster_found = True if season_poster_found == False: # If there were no season posters get the series top poster series_name='' if opts.configure != "" and override.has_key(series_season_ep[0].lower()): series_name=override[series_season_ep[0].lower()][0] # Override series name else: series_name=series_season_ep[0] # Leave the series name alone for p in get_graphics(t, opts, [series_name], poster_type, single_option, opts.language): all_posters = all_posters+p+u',' if len(all_posters) > all_empty: if all_posters[-1] == u',': print all_posters[:-1] else: print all_posters if (fanart==True and opts.fanart==True and opts.raw!=True): # Get Fan Art and send to stdout all_fanart = u'Fanart:' all_empty = len(all_fanart) for f in get_graphics(t, opts, series_season_ep, fanart_type, single_option, opts.language): all_fanart = all_fanart+f+u',' if len(all_fanart) > all_empty: if all_fanart[-1] == u',': print all_fanart[:-1] else: print all_fanart if (banner==True and opts.banner==True and opts.raw!=True): # Also change to get ALL Series graphics season_banner_found = False if opts.mythvideo: if len(series_season_ep) < 2: print u"Season and Episode numbers required." sys.exit(True) all_banners = u'Banner:' all_empty = len(all_banners) for b in get_graphics(t, opts, series_season_ep, banner_type, single_option, opts.language): all_banners = all_banners+b+u',' season_banner_found = True if not season_banner_found: # If there were no season banner get the series top banner series_name='' if opts.configure != "" and override.has_key(series_season_ep[0].lower()): series_name=override[series_season_ep[0].lower()][0] # Override series name else: series_name=series_season_ep[0] # Leave the series name alone for b in get_graphics(t, opts, [series_name], banner_type, single_option, opts.language): all_banners = all_banners+b+u',' if len(all_banners) > all_empty: if all_banners[-1] == u',': print all_banners[:-1] else: print all_banners if opts.debug == True: print "#"*20 print "# Processing complete" print "#"*20 sys.exit(True) | 5be61520a0a3d60abf11f719e6c9c43d73baab36 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13713/5be61520a0a3d60abf11f719e6c9c43d73baab36/ttvdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
2082,
273,
18862,
12,
9167,
33,
89,
28385,
14654,
4084,
30,
3574,
90,
1966,
300,
16587,
89,
522,
362,
4566,
22201,
3948,
306,
3977,
13944,
82,
411,
10222,
508,
578,
296,
102... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
2082,
273,
18862,
12,
9167,
33,
89,
28385,
14654,
4084,
30,
3574,
90,
1966,
300,
16587,
89,
522,
362,
4566,
22201,
3948,
306,
3977,
13944,
82,
411,
10222,
508,
578,
296,
102... |
s0, t0 - texture coordinates of the centre of the filter | s, t - Texture box over which to filter | def filterEllipticGaussianAF(self, s0, t0, deltaX, deltaY, J, returnWeights=False): ''' Filter a portion of the texture using an elliptical gaussian filter, as described in Heckbert's 1989 thesis, "Fundamentals of Texture Mapping and Image Warping". This kind of filter is also called an EWA filter for "Elliptical Weighted Average". | 93bfbb8bc2e36b2f1ef7b44d21de3a8bc9fa1395 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11560/93bfbb8bc2e36b2f1ef7b44d21de3a8bc9fa1395/mipmap_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1034,
4958,
549,
21507,
43,
12086,
6799,
12,
2890,
16,
272,
20,
16,
268,
20,
16,
31329,
16,
29697,
16,
804,
16,
327,
16595,
33,
8381,
4672,
9163,
4008,
279,
14769,
434,
326,
11428,
145... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1034,
4958,
549,
21507,
43,
12086,
6799,
12,
2890,
16,
272,
20,
16,
268,
20,
16,
31329,
16,
29697,
16,
804,
16,
327,
16595,
33,
8381,
4672,
9163,
4008,
279,
14769,
434,
326,
11428,
145... |
* any RCS or CVS directories | * any RCS, CVS and .svn directories | def prune_file_list (self): """Prune off branches that might slip into the file list as created by 'read_template()', but really don't belong there: * the build tree (typically "build") * the release tree itself (only an issue if we ran "sdist" previously with --keep-temp, or it aborted) * any RCS or CVS directories """ build = self.get_finalized_command('build') base_dir = self.distribution.get_fullname() | 5677e123297d355838d9f56cc45058413e641b27 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/5677e123297d355838d9f56cc45058413e641b27/sdist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13293,
67,
768,
67,
1098,
261,
2890,
4672,
3536,
28404,
3397,
11483,
716,
4825,
272,
3169,
1368,
326,
585,
666,
487,
2522,
635,
296,
896,
67,
3202,
1435,
2187,
1496,
8654,
2727,
1404,
10... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13293,
67,
768,
67,
1098,
261,
2890,
4672,
3536,
28404,
3397,
11483,
716,
4825,
272,
3169,
1368,
326,
585,
666,
487,
2522,
635,
296,
896,
67,
3202,
1435,
2187,
1496,
8654,
2727,
1404,
10... |
@cache.all_if_anonymous() | @cache.response(vary=('user',)) | def show_pages_delete(request, page_id): page = Page.objects.get(page_id) if page is None: raise NotFound() csrf_protector = CSRFProtector() if request.method == 'POST': csrf_protector.assert_safe() if request.form.get('cancel'): return redirect(url_for('pages/write_page', page_id=page.page_id)) elif request.form.get('confirm'): db.delete(page) flash(_('The page %s was deleted successfully.') % escape(page.title), 'remove') db.commit() return redirect(url_for('pages/show_pages')) return render_admin_response('admin/delete_page.html', 'page.write', page=page, csrf_protector=csrf_protector, ) | 23bf113b3d6c4a8054212202f08e8de98f689a9f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12815/23bf113b3d6c4a8054212202f08e8de98f689a9f/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
67,
7267,
67,
3733,
12,
2293,
16,
1363,
67,
350,
4672,
1363,
273,
3460,
18,
6911,
18,
588,
12,
2433,
67,
350,
13,
309,
1363,
353,
599,
30,
1002,
7054,
1435,
19483,
67,
11815,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
67,
7267,
67,
3733,
12,
2293,
16,
1363,
67,
350,
4672,
1363,
273,
3460,
18,
6911,
18,
588,
12,
2433,
67,
350,
13,
309,
1363,
353,
599,
30,
1002,
7054,
1435,
19483,
67,
11815,
1... |
name = os.path.join(os.path.split(sys.argv[0])[0], 'data/test.htm') | name = os.path.join(self.cwd, 'data/test.htm') | def OnShowDefault(self, event): name = os.path.join(os.path.split(sys.argv[0])[0], 'data/test.htm') self.html.LoadPage(name) | ae920857a74f858f98d0d68f55f6a77de0d8f2cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12725/ae920857a74f858f98d0d68f55f6a77de0d8f2cf/wxHtmlWindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
5706,
1868,
12,
2890,
16,
871,
4672,
508,
273,
1140,
18,
803,
18,
5701,
12,
2890,
18,
11089,
16,
296,
892,
19,
3813,
18,
31180,
6134,
365,
18,
2620,
18,
2563,
1964,
12,
529,
13... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2755,
5706,
1868,
12,
2890,
16,
871,
4672,
508,
273,
1140,
18,
803,
18,
5701,
12,
2890,
18,
11089,
16,
296,
892,
19,
3813,
18,
31180,
6134,
365,
18,
2620,
18,
2563,
1964,
12,
529,
13... |
print "Error: replicate failed with exception: ", x | print "Error: replicate failed with exception: ", x | def do_replicate(self,args): """ Replicate a given file to a given SE usage: replicate <LFN> <SE> [<SourceSE>] """ argss = args.split() lfn = argss[0] lfn = self.getPath(path) se = argss[1] if len(args)>2: sourceSE=args[2] if len(args)>3: localCache=args[3] try: dirac = Dirac() result = dirac.replicate(args[0],args[1],sourceSE,printOutput=True) if not result['OK']: print 'Error: %s' %(result['Message']) else: print "File %s successfully replicated to the %s SE" % (lfn,se) except Exception, x: print "Error: replicate failed with exception: ", x | 4bf66b76461b76d4728a7a9097ad90c0477688b5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/4bf66b76461b76d4728a7a9097ad90c0477688b5/FileCatalogClientCLI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
266,
1780,
340,
12,
2890,
16,
1968,
4672,
3536,
868,
1780,
340,
279,
864,
585,
358,
279,
864,
3174,
225,
4084,
30,
28476,
411,
9105,
50,
34,
411,
1090,
34,
306,
32,
1830,
10... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
266,
1780,
340,
12,
2890,
16,
1968,
4672,
3536,
868,
1780,
340,
279,
864,
585,
358,
279,
864,
3174,
225,
4084,
30,
28476,
411,
9105,
50,
34,
411,
1090,
34,
306,
32,
1830,
10... |
class ImageDB(object): | class ImageDB(ZipWikiBase): | def getLicenses(self): if self.licenses is None: # ZIP file of old mwlib version does not contain licenses... try: self.licenses = metabook.get_licenses(self.metabook) except Exception, exc: log.ERROR('Could not fetch licenses: %s' % exc) self.licenses = [] return self.licenses | 3eef7b31a38c096d04f05419b663c667358280db /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12391/3eef7b31a38c096d04f05419b663c667358280db/zipwiki.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9014,
16548,
12,
2890,
4672,
309,
365,
18,
80,
16548,
353,
599,
30,
468,
18277,
585,
434,
1592,
14721,
2941,
1177,
1552,
486,
912,
26457,
2777,
775,
30,
365,
18,
80,
16548,
273,
5100,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9014,
16548,
12,
2890,
4672,
309,
365,
18,
80,
16548,
353,
599,
30,
468,
18277,
585,
434,
1592,
14721,
2941,
1177,
1552,
486,
912,
26457,
2777,
775,
30,
365,
18,
80,
16548,
273,
5100,
... |
supported_dists=('SuSE','debian','redhat','mandrake')): | supported_dists=('SuSE', 'debian', 'fedora', 'redhat', 'mandrake')): | def dist(distname='',version='',id='', supported_dists=('SuSE','debian','redhat','mandrake')): """ Tries to determine the name of the Linux OS distribution name. The function first looks for a distribution release file in /etc and then reverts to _dist_try_harder() in case no suitable files are found. Returns a tuple (distname,version,id) which default to the args given as parameters. """ try: etc = os.listdir('/etc') except os.error: # Probably not a Unix system return distname,version,id for file in etc: m = _release_filename.match(file) if m: _distname,dummy = m.groups() if _distname in supported_dists: distname = _distname break else: return _dist_try_harder(distname,version,id) f = open('/etc/'+file,'r') firstline = f.readline() f.close() m = _release_version.search(firstline) if m: _version,_id = m.groups() if _version: version = _version if _id: id = _id else: # Unkown format... take the first two words l = string.split(string.strip(firstline)) if l: version = l[0] if len(l) > 1: id = l[1] return distname,version,id | 47ebfd2f70daf5e6bb04ad9a7e6d3059eea9e980 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/47ebfd2f70daf5e6bb04ad9a7e6d3059eea9e980/platform.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2411,
12,
4413,
529,
2218,
2187,
1589,
2218,
2187,
350,
2218,
2187,
225,
3260,
67,
30467,
33,
2668,
17072,
1090,
2187,
296,
31888,
2779,
2187,
296,
74,
15534,
2187,
296,
1118,
11304,
2187,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2411,
12,
4413,
529,
2218,
2187,
1589,
2218,
2187,
350,
2218,
2187,
225,
3260,
67,
30467,
33,
2668,
17072,
1090,
2187,
296,
31888,
2779,
2187,
296,
74,
15534,
2187,
296,
1118,
11304,
2187,... |
fld_distinct= run_sql("SELECT distinct(id_field) FROM collection_field_fieldvalue WHERE type='seo' AND id_collection=%s ORDER by score desc" % colID) | fld_distinct = run_sql("SELECT distinct(id_field) FROM collection_field_fieldvalue WHERE type='seo' AND id_collection=%s ORDER by score desc" % colID) | def perform_showsearchoptions(colID, ln=cdslang, callback='yes', content='', confirm=-1): """show the sort and search options of this collection..""" colID = int(colID) col_dict = dict(get_def_name('', "collection")) fld_dict = dict(get_def_name('', "field")) fld_type = get_sort_nametypes() subtitle = """<a name="7">7. Modify search options for collection '%s'</a>   <small>[<a title="See guide" href="%s/admin/websearch/guide.html#3.7">?</a>]</small>""" % (col_dict[colID], weburl) output = """<dl> <dt>Field actions (not related to this collection)</dt> <dd>Go to the BibIndex interface to modify</dd> <dt>Collection specific actions <dd><a href="addexistingfield?colID=%s&ln=%s&fmeth=seo#7.2">Add field to collection</a></dd> </dl> """ % (colID, ln) header = ['', 'Fieldname', '', 'Fieldvalue', 'Actions'] actions = [] cdslang = get_languages() lang = dict(cdslang) fld_type_list = fld_type.items() fld_distinct= run_sql("SELECT distinct(id_field) FROM collection_field_fieldvalue WHERE type='seo' AND id_collection=%s ORDER by score desc" % colID) if len(fld_distinct) > 0: i = 0 for (id) in fld_distinct: col_fld = get_col_fld(colID, 'seo', id) #move = """<table cellspacing="1" cellpadding="0" border="0"><tr><td>""" move = "" if i != 0: move += """<a href="%s/admin/websearch/websearchadmin.py/switchfldscore?colID=%s&ln=%s&id_1=%s&id_2=%s&fmeth=seo&rand=%s#7"><img border="0" src="%s/img/smallup.gif" title="Move up"></a>""" % (weburl, colID, ln, id[0], fld_distinct[i - 1][0], random.randint(0, 1000), weburl) else: move += " " #move += "</td><td>" i += 1 if i != len(fld_distinct): move += '<a href="%s/admin/websearch/websearchadmin.py/switchfldscore?colID=%s&ln=%s&id_1=%s&id_2=%s&fmeth=seo&rand=%s#7"><img border="0" src="%s/img/smalldown.gif" title="Move down"></a>' % (weburl, colID, ln, id[0], fld_distinct[i][0], random.randint(0, 1000), weburl) #move += """</td></tr></table>""" j = 0 for (fldID, fldvID, stype, score, score_fieldvalue) in col_fld: fieldvalue = get_fld_value(fldvID) #move2 = """<table cellspacing="1" cellpadding="0" border="0"><tr><td>""" move2 = "" if j != 0: move2 += """<a href="%s/admin/websearch/websearchadmin.py/switchfldvaluescore?colID=%s&ln=%s&id_1=%s&id_fldvalue_1=%s&id_fldvalue_2=%s&rand=%s#7"><img border="0" src="%s/img/smallup.gif" title="Move up"></a>""" % (weburl, colID, ln, id[0], fldvID, col_fld[j - 1][1], random.randint(0, 1000), weburl) else: move2 += " " #move2 += "</td><td>" j += 1 if j != len(col_fld): move2 += """<a href="%s/admin/websearch/websearchadmin.py/switchfldvaluescore?colID=%s&ln=%s&id_1=%s&id_fldvalue_1=%s&id_fldvalue_2=%s&rand=%s#7"><img border="0" src="%s/img/smalldown.gif" title="Move down"></a>""" % (weburl, colID, ln, id[0], fldvID, col_fld[j][1], random.randint(0, 1000), weburl) #move2 += """</td></tr></table>""" if fieldvalue[0][1] != fieldvalue[0][2]: actions.append([move, "%s" % (j==1 and fld_dict[int(fldID)] or ' '), move2, "%s - %s" % (fieldvalue[0][1],fieldvalue[0][2])]) else: actions.append([move, "%s" % (j==1 and fld_dict[int(fldID)] or ' '), move2, "%s" % fieldvalue[0][1]]) move = '' for col in [(('Remove', 'removefield'),)]: actions[-1].append('<a href="%s/admin/websearch/websearchadmin.py/%s?colID=%s&ln=%s&fldID=%s&fldvID=%s&fmeth=seo#7.4">%s</a>' % (weburl, col[0][1], colID, ln, fldID, fldvID, col[0][0])) for (str, function) in col[1:]: actions[-1][-1] += ' / <a href="%s/admin/websearch/websearchadmin.py/%s?colID=%s&ln=%s&fldID=%s#7.5">%s</a>' % (weburl, function, colID, ln, fldID, fldvID, str) output += tupletotable(header=header, tuple=actions) else: output += """No search options exists for this collection""" output += content try: body = [output, extra] except NameError: body = [output] if callback: return perform_editcollection(colID, ln, "perform_showsearchoptions", addadminbox(subtitle, body)) else: return addadminbox(subtitle, body) | e02bf14cfa93e6c83692292855ee97a11d40e01d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/e02bf14cfa93e6c83692292855ee97a11d40e01d/websearchadminlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
4500,
3072,
2116,
12,
1293,
734,
16,
7211,
33,
4315,
2069,
539,
16,
1348,
2218,
9707,
2187,
913,
2218,
2187,
6932,
29711,
21,
4672,
3536,
4500,
326,
1524,
471,
1623,
702,
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,
3073,
67,
4500,
3072,
2116,
12,
1293,
734,
16,
7211,
33,
4315,
2069,
539,
16,
1348,
2218,
9707,
2187,
913,
2218,
2187,
6932,
29711,
21,
4672,
3536,
4500,
326,
1524,
471,
1623,
702,
434,
... |
for i, b in enumerate(widgets): | i = 0 for b in widgets: | def set_widget_initial_values(self, glade): self.quality_tabs.set_show_tabs(False) if self.get_int("same-folder-as-input"): w = glade.get_widget("same_folder_as_input") else: w = glade.get_widget("into_selected_folder") w.set_active(True) uri = filename_to_uri(self.get_string("selected-folder")) self.target_folder_chooser.set_uri(uri) self.update_selected_folder() w = glade.get_widget("create_subfolders") w.set_active(self.get_int("create-subfolders")) w = glade.get_widget("subfolder_pattern") model = w.get_model() model.clear() for pattern, desc in self.subfolder_patterns: i = model.append() model.set(i, 0, desc) w.set_active(self.get_int("subfolder-pattern-index")) | f17010db54490812e8d8fa5440cc3dcaf50520d6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2369/f17010db54490812e8d8fa5440cc3dcaf50520d6/soundconverter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
6587,
67,
6769,
67,
2372,
12,
2890,
16,
5118,
2486,
4672,
225,
365,
18,
16495,
67,
16056,
18,
542,
67,
4500,
67,
16056,
12,
8381,
13,
225,
309,
365,
18,
588,
67,
474,
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,
444,
67,
6587,
67,
6769,
67,
2372,
12,
2890,
16,
5118,
2486,
4672,
225,
365,
18,
16495,
67,
16056,
18,
542,
67,
4500,
67,
16056,
12,
8381,
13,
225,
309,
365,
18,
588,
67,
474,
2932,
... |
return content.replace("\r", "\n") | return content.replace("\r\n", "\n") | def convertDos2Unix(content): return content.replace("\r", "\n") | 751867df86cce5d9bd6164cc3f31b1cfb76ef098 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5718/751867df86cce5d9bd6164cc3f31b1cfb76ef098/util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
40,
538,
22,
18729,
12,
1745,
4672,
327,
913,
18,
2079,
31458,
86,
64,
82,
3113,
1548,
82,
7923,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
40,
538,
22,
18729,
12,
1745,
4672,
327,
913,
18,
2079,
31458,
86,
64,
82,
3113,
1548,
82,
7923,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
DocServer(address, callback).serve_forever() | DocServer(port, callback).serve_until_quit() except (KeyboardInterrupt, select.error): pass print 'server stopped' def gui(): """Graphical interface (starts web server and pops up a control window).""" class GUI: def __init__(self, window, port=7464): self.window = window self.server = None self.scanner = None import Tkinter self.server_frm = Tkinter.Frame(window) self.title_lbl = Tkinter.Label(self.server_frm, text='Starting server...\n ') self.open_btn = Tkinter.Button(self.server_frm, text='open browser', command=self.open, state='disabled') self.quit_btn = Tkinter.Button(self.server_frm, text='quit serving', command=self.quit, state='disabled') self.search_frm = Tkinter.Frame(window) self.search_lbl = Tkinter.Label(self.search_frm, text='Search for') self.search_ent = Tkinter.Entry(self.search_frm) self.search_ent.bind('<Return>', self.search) self.stop_btn = Tkinter.Button(self.search_frm, text='stop', pady=0, command=self.stop, state='disabled') if sys.platform == 'win32': self.stop_btn.pack(side='right') self.window.title('pydoc') self.window.protocol('WM_DELETE_WINDOW', self.quit) self.title_lbl.pack(side='top', fill='x') self.open_btn.pack(side='left', fill='x', expand=1) self.quit_btn.pack(side='right', fill='x', expand=1) self.server_frm.pack(side='top', fill='x') self.search_lbl.pack(side='left') self.search_ent.pack(side='right', fill='x', expand=1) self.search_frm.pack(side='top', fill='x') self.search_ent.focus_set() self.result_lst = Tkinter.Listbox(window, font=('helvetica', 8), height=6) self.result_lst.bind('<Button-1>', self.select) self.result_lst.bind('<Double-Button-1>', self.goto) self.result_scr = Tkinter.Scrollbar(window, orient='vertical', command=self.result_lst.yview) self.result_lst.config(yscrollcommand=self.result_scr.set) self.result_frm = Tkinter.Frame(window) self.goto_btn = Tkinter.Button(self.result_frm, text='go to selected', command=self.goto) self.hide_btn = Tkinter.Button(self.result_frm, text='hide results', command=self.hide) self.goto_btn.pack(side='left', fill='x', expand=1) self.hide_btn.pack(side='right', fill='x', expand=1) self.window.update() self.minwidth = self.window.winfo_width() self.minheight = self.window.winfo_height() self.bigminheight = (self.server_frm.winfo_reqheight() + self.search_frm.winfo_reqheight() + self.result_lst.winfo_reqheight() + self.result_frm.winfo_reqheight()) self.bigwidth, self.bigheight = self.minwidth, self.bigminheight self.expanded = 0 self.window.wm_geometry('%dx%d' % (self.minwidth, self.minheight)) self.window.wm_minsize(self.minwidth, self.minheight) import threading threading.Thread(target=serve, args=(port, self.ready)).start() def ready(self, server): self.server = server self.title_lbl.config( text='Python documentation server at\n' + server.url) self.open_btn.config(state='normal') self.quit_btn.config(state='normal') def open(self, event=None): import webbrowser webbrowser.open(self.server.url) def quit(self, event=None): if self.server: self.server.quit = 1 self.window.quit() def search(self, event=None): key = self.search_ent.get() self.stop_btn.pack(side='right') self.stop_btn.config(state='normal') self.search_lbl.config(text='Searching for "%s"...' % key) self.search_ent.forget() self.search_lbl.pack(side='left') self.result_lst.delete(0, 'end') self.goto_btn.config(state='disabled') self.expand() import threading if self.scanner: self.scanner.quit = 1 self.scanner = ModuleScanner() threading.Thread(target=self.scanner.run, args=(key, self.update, self.done)).start() def update(self, path, modname, desc): if modname[-9:] == '.__init__': modname = modname[:-9] + ' (package)' self.result_lst.insert('end', modname + ' - ' + (desc or '(no description)')) def stop(self, event=None): if self.scanner: self.scanner.quit = 1 self.scanner = None def done(self): self.scanner = None self.search_lbl.config(text='Search for') self.search_lbl.pack(side='left') self.search_ent.pack(side='right', fill='x', expand=1) if sys.platform != 'win32': self.stop_btn.forget() self.stop_btn.config(state='disabled') def select(self, event=None): self.goto_btn.config(state='normal') def goto(self, event=None): selection = self.result_lst.curselection() if selection: import webbrowser modname = split(self.result_lst.get(selection[0]))[0] webbrowser.open(self.server.url + modname + '.html') def collapse(self): if not self.expanded: return self.result_frm.forget() self.result_scr.forget() self.result_lst.forget() self.bigwidth = self.window.winfo_width() self.bigheight = self.window.winfo_height() self.window.wm_geometry('%dx%d' % (self.minwidth, self.minheight)) self.window.wm_minsize(self.minwidth, self.minheight) self.expanded = 0 def expand(self): if self.expanded: return self.result_frm.pack(side='bottom', fill='x') self.result_scr.pack(side='right', fill='y') self.result_lst.pack(side='top', fill='both', expand=1) self.window.wm_geometry('%dx%d' % (self.bigwidth, self.bigheight)) self.window.wm_minsize(self.minwidth, self.bigminheight) self.expanded = 1 def hide(self, event=None): self.stop() self.collapse() import Tkinter try: gui = GUI(Tkinter.Tk()) Tkinter.mainloop() | def server_activate(self): self.base.server_activate(self) if self.callback: self.callback() | c59006cf0425a2636c8284ef2601f7f489fad815 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/c59006cf0425a2636c8284ef2601f7f489fad815/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1438,
67,
10014,
12,
2890,
4672,
365,
18,
1969,
18,
3567,
67,
10014,
12,
2890,
13,
309,
365,
18,
3394,
30,
365,
18,
3394,
1435,
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,
1438,
67,
10014,
12,
2890,
4672,
365,
18,
1969,
18,
3567,
67,
10014,
12,
2890,
13,
309,
365,
18,
3394,
30,
365,
18,
3394,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
string.strip(line[5:]) + "\n" | line[5:].strip() + "\n" | def description(self, line): self.data.description = self.data.description + \ string.strip(line[5:]) + "\n" | ade8039411341728bf4bd4dc20b4f5d9433c8f82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7167/ade8039411341728bf4bd4dc20b4f5d9433c8f82/SProt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2477,
12,
2890,
16,
980,
4672,
365,
18,
892,
18,
3384,
273,
365,
18,
892,
18,
3384,
397,
521,
980,
63,
25,
30,
8009,
6406,
1435,
397,
1548,
82,
6,
225,
2,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2477,
12,
2890,
16,
980,
4672,
365,
18,
892,
18,
3384,
273,
365,
18,
892,
18,
3384,
397,
521,
980,
63,
25,
30,
8009,
6406,
1435,
397,
1548,
82,
6,
225,
2,
-100,
-100,
-100,
-100,
-... |
""" A mutable (unhashable) setlist that inherits from basesetlist. """ | """ A mutable (unhashable) setlist that inherits from basesetlist. >>> sl = setlist('abcde') >>> sl[0] = 5 >>> sl setlist((5, 'b', 'c', 'd', 'e')) >>> sl[-1] = 0 >>> sl setlist((5, 'b', 'c', 'd', 0)) >>> sl[1] = 'c' >>> sl setlist((5, 'b', 'c', 'd', 0)) >>> del sl[0] >>> sl setlist(('b', 'c', 'd', 0)) >>> del sl[-1] >>> sl setlist(('b', 'c', 'd')) >>> sl.pop() 'd' >>> sl.pop(0) 'b' >>> sl setlist(('c',)) >>> sl.insert(0, 'a') >>> sl setlist(('a', 'c')) >>> sl.insert(len(sl), 'e') >>> sl setlist(('a', 'c', 'e')) >>> sl.append('f') >>> sl setlist(('a', 'c', 'e', 'f')) >>> sl += ('g', 'h') >>> sl setlist(('a', 'c', 'e', 'f', 'g', 'h')) """ | def index(self, sub, start=0, end=-1): """ This runs in O(len(sub)) | 0479d0e6e0fff5104b463a62dcd9d0f78ec3e2cb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5397/0479d0e6e0fff5104b463a62dcd9d0f78ec3e2cb/collections_.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
770,
12,
2890,
16,
720,
16,
787,
33,
20,
16,
679,
29711,
21,
4672,
3536,
1220,
7597,
316,
531,
12,
1897,
12,
1717,
3719,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
770,
12,
2890,
16,
720,
16,
787,
33,
20,
16,
679,
29711,
21,
4672,
3536,
1220,
7597,
316,
531,
12,
1897,
12,
1717,
3719,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.