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 |
|---|---|---|---|---|---|---|
if config.get(options.SHOW_TRAYICON) and trayicon.trayicon_is_supported: self.trayicon = trayicon.Trayicon( resources.sharePath("pixmaps/miro-24x24.png"), self) self.trayicon.set_visible(True) | if trayicon.trayicon_is_supported: if config.get(options.SHOW_TRAYICON): self.trayicon = trayicon.Trayicon(resources.sharePath("pixmaps/miro-24x24.png"), self) self.trayicon.set_visible(True) config.add_change_callback(self.on_trayicon_pref_changed) | def build_window(self): Application.build_window(self) self.window.connect('save-dimensions', self.set_main_window_dimensions) self.window.connect('save-maximized', self.set_main_window_maximized) | 77d841b9bcc33fd0f9640b4eaf6655df1dcaeebf /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12354/77d841b9bcc33fd0f9640b4eaf6655df1dcaeebf/application.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
5668,
12,
2890,
4672,
4257,
18,
3510,
67,
5668,
12,
2890,
13,
365,
18,
5668,
18,
3612,
2668,
5688,
17,
14797,
2187,
365,
18,
542,
67,
5254,
67,
5668,
67,
14797,
13,
365,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
5668,
12,
2890,
4672,
4257,
18,
3510,
67,
5668,
12,
2890,
13,
365,
18,
5668,
18,
3612,
2668,
5688,
17,
14797,
2187,
365,
18,
542,
67,
5254,
67,
5668,
67,
14797,
13,
365,
18... |
page_html = html_part.get_payload(decode=True) | def parseHTML(metas): new_metas = copy.deepcopy(metas) for cpage in metas: for html_part in metas[cpage]["html"]: page_html = html_part.get_payload(decode=True) parser = html() try: parser.feed(page_html) except: print "ERROR: HTML parse error." else: parser.close() # force processing all data new_metas[cpage]["text"].add(parser.get_plaintext()) return new_metas | e49b1bb14b8b38c6bfa4d97373de2478166ed97e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/888/e49b1bb14b8b38c6bfa4d97373de2478166ed97e/emailutils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
4870,
12,
10578,
345,
4672,
394,
67,
10578,
345,
273,
1610,
18,
16589,
3530,
12,
10578,
345,
13,
364,
276,
2433,
316,
21232,
30,
364,
1729,
67,
2680,
316,
21232,
63,
71,
2433,
63... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
4870,
12,
10578,
345,
4672,
394,
67,
10578,
345,
273,
1610,
18,
16589,
3530,
12,
10578,
345,
13,
364,
276,
2433,
316,
21232,
30,
364,
1729,
67,
2680,
316,
21232,
63,
71,
2433,
63... | |
if str(rev) != id: raise "mismatch" | if str(rev) != id: raise ValueError if rev < 0: rev = self.count() + rev if rev < 0 or rev >= self.count: raise ValueError | def lookup(self, id): try: rev = int(id) if str(rev) != id: raise "mismatch" return self.node(rev) except: c = [] for n in self.nodemap: if id in hex(n): c.append(n) if len(c) > 1: raise KeyError("Ambiguous identifier") if len(c) < 1: raise KeyError("No match found") return c[0] return None | ca71448c6e616d80a3fc19d10d79445bb8c39126 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/ca71448c6e616d80a3fc19d10d79445bb8c39126/revlog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3689,
12,
2890,
16,
612,
4672,
775,
30,
5588,
273,
509,
12,
350,
13,
309,
609,
12,
9083,
13,
480,
612,
30,
1002,
2068,
309,
5588,
411,
374,
30,
5588,
273,
365,
18,
1883,
1435,
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,
3689,
12,
2890,
16,
612,
4672,
775,
30,
5588,
273,
509,
12,
350,
13,
309,
609,
12,
9083,
13,
480,
612,
30,
1002,
2068,
309,
5588,
411,
374,
30,
5588,
273,
365,
18,
1883,
1435,
397,
... |
specification | specification. | def created_bundle_streams(spec): """ Helper context manager that creates bundle streams according to specification spec is a list of dictionaries with the following keys: user: string indicating user name to create [optional] group: string indicating group name to create [optional] slug: slug-like name [optional] name: name of the stream to create [optional] yields: list of created bundle streams """ bundle_streams = [] for stream_args in spec: initargs = { 'user': None, 'group': None, 'slug': stream_args.get('slug', ''), 'name': stream_args.get('name', '')} username = stream_args.get('user') if username: user = User.objects.get_or_create(username=username)[0] initargs['user'] = user groupname = stream_args.get('group') if groupname: group = Group.objects.get_or_create(name=groupname)[0] initargs['group'] = group bundle_stream = BundleStream.objects.create(**initargs) bundle_stream.save() bundle_streams.append(bundle_stream) yield bundle_streams | b596b5d95c68a4bdf0ea7b360b1603052860405e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7382/b596b5d95c68a4bdf0ea7b360b1603052860405e/fixtures.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2522,
67,
9991,
67,
16320,
12,
2793,
4672,
3536,
9705,
819,
3301,
716,
3414,
3440,
8205,
4888,
358,
7490,
18,
225,
857,
353,
279,
666,
434,
16176,
598,
326,
3751,
1311,
30,
729,
30,
53... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2522,
67,
9991,
67,
16320,
12,
2793,
4672,
3536,
9705,
819,
3301,
716,
3414,
3440,
8205,
4888,
358,
7490,
18,
225,
857,
353,
279,
666,
434,
16176,
598,
326,
3751,
1311,
30,
729,
30,
53... |
pkt.set_field('tcp.sport', self.sport) | sport = self.sport pkt.set_fields('ip', { 'dst' : self.dip, 'src' : sip}) pkt.set_fields('tcp', { 'sport' : sport, 'dport' : self.dport, 'flags' : TH_SYN, 'seq' : randint(0, 2L**32-1)}) | def __thread_main(self): try: log.debug('Entered in __thread_main') | bf2fda7bf8e31675ee7d64613b7db24cea0347c1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11468/bf2fda7bf8e31675ee7d64613b7db24cea0347c1/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
5930,
67,
5254,
12,
2890,
4672,
775,
30,
613,
18,
4148,
2668,
10237,
329,
316,
1001,
5930,
67,
5254,
6134,
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,
5930,
67,
5254,
12,
2890,
4672,
775,
30,
613,
18,
4148,
2668,
10237,
329,
316,
1001,
5930,
67,
5254,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
def flatten (img_list) : | def flatten (img_list, alpha = False) : | def flatten (img_list) : """Concatenate all images into a single image Use alpha to blend images one on top of each other .. warning:: all images must have the same shape either 2D or 3D and an alpha channel .. warning:: the resulting image has no alpha channel :Parameters: - `img_list` (list of NxM(xP)x4 array of uint8) :Returns Type: NxM(xP)x3 array of uint8 """ R = img_list[0][...,0] G = img_list[0][...,1] B = img_list[0][...,2] for lay in img_list[1:] : alpha = lay[...,3] / 255. ialpha = 1. - alpha R = R * ialpha + lay[...,0] * alpha G = G * ialpha + lay[...,1] * alpha B = B * ialpha + lay[...,2] * alpha return rollaxis(array([R,G,B],img_list[0].dtype),0,len(img_list[0].shape) ) | 3ae94eee765b4a7b30650a3bc7bee2b2c39262a0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4914/3ae94eee765b4a7b30650a3bc7bee2b2c39262a0/basic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5341,
261,
6081,
67,
1098,
16,
4190,
273,
1083,
13,
294,
3536,
21432,
340,
777,
4602,
1368,
279,
2202,
1316,
225,
2672,
4190,
358,
24052,
4602,
1245,
603,
1760,
434,
1517,
1308,
225,
611... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5341,
261,
6081,
67,
1098,
16,
4190,
273,
1083,
13,
294,
3536,
21432,
340,
777,
4602,
1368,
279,
2202,
1316,
225,
2672,
4190,
358,
24052,
4602,
1245,
603,
1760,
434,
1517,
1308,
225,
611... |
line = escape(line).replace('\0', '<del>') \ .replace('\1', '</del>') f[i] = Markup(space_re.sub(htmlify, line)) | line = escape(line) line = '<del>'.join([space_re.sub(htmlify, seg) for seg in line.split('\0')]) line = line.replace('\1', '</del>') f[i] = Markup(line) | def htmlify(match): div, mod = divmod(len(match.group(0)), 2) return div * ' ' + mod * ' ' | c4c361abd15a447c08f3f8053f26a4d55c66159f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9317/c4c361abd15a447c08f3f8053f26a4d55c66159f/patch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1729,
1164,
12,
1916,
4672,
3739,
16,
681,
273,
26105,
12,
1897,
12,
1916,
18,
1655,
12,
20,
13,
3631,
576,
13,
327,
3739,
380,
5183,
10600,
31,
296,
397,
681,
380,
5183,
10600,
4359,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1729,
1164,
12,
1916,
4672,
3739,
16,
681,
273,
26105,
12,
1897,
12,
1916,
18,
1655,
12,
20,
13,
3631,
576,
13,
327,
3739,
380,
5183,
10600,
31,
296,
397,
681,
380,
5183,
10600,
4359,
... |
types_addFileRecords = [[ListType,TupleType]] def export_addFileRecords(self,fileTuples): | types_addFileRecords = [[ListType, TupleType]] def export_addFileRecords( self, fileTuples ): | def export_addFileRecord(self,lfn,status,minor,date,source): """ Add a logging record for the given file """ if type(lfn) == StringType: lfns = [lfn] else: lfns = lfn result = logDB.addFileRecord(lfns,status,minor,date,source) return result | 4797b8c582dfd807acec37afc8310baba2b3d395 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/4797b8c582dfd807acec37afc8310baba2b3d395/DataLoggingHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3359,
67,
1289,
812,
2115,
12,
2890,
16,
80,
4293,
16,
2327,
16,
17364,
16,
712,
16,
3168,
4672,
3536,
1436,
279,
2907,
1409,
364,
326,
864,
585,
3536,
309,
618,
12,
80,
4293,
13,
42... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3359,
67,
1289,
812,
2115,
12,
2890,
16,
80,
4293,
16,
2327,
16,
17364,
16,
712,
16,
3168,
4672,
3536,
1436,
279,
2907,
1409,
364,
326,
864,
585,
3536,
309,
618,
12,
80,
4293,
13,
42... |
"""get all constant value nodes in expression subtree. This is the default implementation which returns an empty list.""" | """Return all constant value nodes in expression subtree. This is the default implementation which returns an empty list. @return: a list of value nodes in the subtree rooted at this node @rtype: C{list} """ | def getValueNodes(self) : """get all constant value nodes in expression subtree. This | 003b19b23e2f636663b2416183d5f877256908d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1770/003b19b23e2f636663b2416183d5f877256908d5/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2366,
3205,
12,
2890,
13,
294,
3536,
588,
777,
5381,
460,
2199,
316,
2652,
12773,
18,
1220,
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... | [
1,
1,
1,
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,
2366,
3205,
12,
2890,
13,
294,
3536,
588,
777,
5381,
460,
2199,
316,
2652,
12773,
18,
1220,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
print 'listening now' | def testListening(self): | e56dcf564dc442d95c85eb44f592b6672bad21ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8962/e56dcf564dc442d95c85eb44f592b6672bad21ad/test_q2q.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
31594,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
31594,
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,
... | |
def wrap(self,availWidth,availHeight): | def wrap(self, availWidth, availHeight): | def wrap(self,availWidth,availHeight): maxWf = 0 self.wfs = [] self.hfs = [] self.horizontalRuleOffsets = [] totalHf = self._getVOffset() for f in self.fs: wf, hf = f.wrap(availWidth,availHeight) totalHf += hf maxWf = max(maxWf, wf) self.wfs.append(wf) self.hfs.append(hf) self.paraHeights = [] self._offsets = [] for p in self.ps: if isinstance(p, HRFlowable): self.paraHeights.append(1) # fixme: whats the acutal height of a HRFlowable? self._offsets.append(0) if (totalHf - (sum(self.paraHeights))) > 0: # behave like the associated heading self.horizontalRuleOffsets.append(maxWf) else: self.horizontalRuleOffsets.append(0) continue fullWidth = availWidth - p.style.leftIndent - p.style.rightIndent floatWidth = fullWidth - maxWf nfloatLines = max(0, int((totalHf - (sum(self.paraHeights)))/p.style.leading)) p.width = 0 if hasattr(p, 'blPara'): del p.blPara p.blPara = p.breakLines(nfloatLines*[floatWidth] + [fullWidth]) if self.figAlign=='left': self._offsets.append([maxWf]*(nfloatLines) + [0]) if hasattr(p, 'style'): autoLeading = getattr(p.style, 'autoLeading') else: autoLeading = '' if hasattr(p, 'style') and autoLeading == 'max' and p.blPara.kind == 1: pHeight = 0 for l in p.blPara.lines: pHeight += max(l.ascent - l.descent, p.style.leading) * 1.025 #magic factor! autoLeading==max increases line-height else: if autoLeading=='max': pHeight = len(p.blPara.lines)*max(p.style.leading, 1.2*p.style.fontSize) # used to be 1.2 instead of 1.0 else: pHeight = len(p.blPara.lines)*p.style.leading self.paraHeights.append(pHeight + p.style.spaceBefore + p.style.spaceAfter) | 3316e8e5f6eb0f7ae626ef1a48daf876d33151f4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12390/3316e8e5f6eb0f7ae626ef1a48daf876d33151f4/customflowables.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2193,
12,
2890,
16,
15783,
2384,
16,
15783,
2686,
4672,
943,
59,
74,
273,
374,
365,
18,
91,
2556,
273,
5378,
365,
18,
76,
2556,
273,
5378,
365,
18,
18396,
2175,
13830,
273,
5378,
2078,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2193,
12,
2890,
16,
15783,
2384,
16,
15783,
2686,
4672,
943,
59,
74,
273,
374,
365,
18,
91,
2556,
273,
5378,
365,
18,
76,
2556,
273,
5378,
365,
18,
18396,
2175,
13830,
273,
5378,
2078,... |
if job.backend._name == 'LCG': | if job.backend._name in [ 'LCG' ]: | def retrieve(self, type=None, name=None, **options ): """Retrieve files listed in outputdata and registered in output from remote SE to local filesystem in background thread""" from Ganga.GPIDev.Lib.Job import Job from GangaAtlas.Lib.ATLASDataset import Download import os, threading | 60e3471604e85c56754aefe032e708e83b749990 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1488/60e3471604e85c56754aefe032e708e83b749990/DQ2Dataset.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4614,
12,
2890,
16,
618,
33,
7036,
16,
508,
33,
7036,
16,
2826,
2116,
262,
30,
3536,
5767,
1390,
12889,
316,
876,
892,
471,
4104,
316,
876,
628,
2632,
3174,
358,
1191,
6496,
316,
5412,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4614,
12,
2890,
16,
618,
33,
7036,
16,
508,
33,
7036,
16,
2826,
2116,
262,
30,
3536,
5767,
1390,
12889,
316,
876,
892,
471,
4104,
316,
876,
628,
2632,
3174,
358,
1191,
6496,
316,
5412,... |
preparse -- if True, then produce code to be evaluated with | - ``preparse`` -- if True, then produce code to be evaluated with | def explain_pickle(pickle=None, file=None, compress=True, **kwargs): r""" Explain a pickle. (That is, produce source code such that evaluating the code is equivalent to loading the pickle.) Feeding the result of explain_pickle to sage_eval should be totally equivalent to loading the pickle with cPickle. INPUTS: pickle -- the pickle to explain, as a string (default: None) file -- a filename of a pickle (default: None) compress -- if False, don't attempt to decompress the pickle (default: True) in_current_sage -- if True, produce potentially simpler code that is tied to the current version of Sage. (default: False) default_assumptions -- if True, produce potentially simpler code that assumes that generic unpickling code will be used. This code may not actually work. (default: False) eval -- if True, then evaluate the resulting code and return the evaluated result. (default: False) preparse -- if True, then produce code to be evaluated with Sage's preparser; if False, then produce standard Python code; if None, then produce code that will work either with or without the preparser. (default: True) pedantic -- if True, then carefully ensures that the result has at least as much sharing as the result of cPickle (it may have more, for immutable objects). (default: False) Exactly one of pickle (a string containing a pickle) or file (the filename of a pickle) must be provided. EXAMPLES: sage: explain_pickle(dumps({('a', 'b'): [1r, 2r]})) {('a', 'b'):[1r, 2r]} sage: explain_pickle(dumps(RR(pi)), in_current_sage=True) from sage.rings.real_mpfr import __create__RealNumber_version0 from sage.rings.real_mpfr import __create__RealField_version0 __create__RealNumber_version0(__create__RealField_version0(53r, False, 'RNDN'), '3.4gvml245kc0@0', 32r) sage: s = 'hi' sage: explain_pickle(dumps((s, s))) ('hi', 'hi') sage: explain_pickle(dumps((s, s)), pedantic=True) si = 'hi' (si, si) sage: explain_pickle(dumps(5r)) 5r sage: explain_pickle(dumps(5r), preparse=False) 5 sage: explain_pickle(dumps(5r), preparse=None) int(5) sage: explain_pickle(dumps(22/7)) pg_make_rational = unpickle_global('sage.rings.rational', 'make_rational') pg_make_rational('m/7') sage: explain_pickle(dumps(22/7), in_current_sage=True) from sage.rings.rational import make_rational make_rational('m/7') sage: explain_pickle(dumps(22/7), default_assumptions=True) from sage.rings.rational import make_rational make_rational('m/7') """ if pickle is not None: p = pickle elif file is not None: p = open(file).read() else: raise ValueError, "Either pickle or file must be specified" if compress: try: p = comp.decompress(p) except Exception, msg1: try: p = comp_other.decompress(p) except Exception, msg2: # Maybe data is uncompressed? pass return explain_pickle_string(p, **kwargs) | a4aad1557cdf06ed8562711534ca467dff85c855 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/a4aad1557cdf06ed8562711534ca467dff85c855/explain_pickle.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19765,
67,
20847,
12,
20847,
33,
7036,
16,
585,
33,
7036,
16,
8099,
33,
5510,
16,
2826,
4333,
4672,
436,
8395,
1312,
7446,
279,
13379,
18,
225,
261,
18163,
353,
16,
11402,
1084,
981,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19765,
67,
20847,
12,
20847,
33,
7036,
16,
585,
33,
7036,
16,
8099,
33,
5510,
16,
2826,
4333,
4672,
436,
8395,
1312,
7446,
279,
13379,
18,
225,
261,
18163,
353,
16,
11402,
1084,
981,
4... |
print 'adding', str(port[0]), port[1] | def listStaticEntities(self): ret = [] for port in getattr(self.app, '%sPorts' % self.ptype): print 'adding', str(port[0]), port[1] ret.append((str(port[0]), port[1])) return ret | a89bb9bed3432c6ebe1055f95383769e6545c156 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a89bb9bed3432c6ebe1055f95383769e6545c156/app.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
5788,
8108,
12,
2890,
4672,
325,
273,
5378,
364,
1756,
316,
3869,
12,
2890,
18,
2910,
16,
1995,
87,
11107,
11,
738,
365,
18,
27672,
4672,
325,
18,
6923,
12443,
701,
12,
655,
63,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
5788,
8108,
12,
2890,
4672,
325,
273,
5378,
364,
1756,
316,
3869,
12,
2890,
18,
2910,
16,
1995,
87,
11107,
11,
738,
365,
18,
27672,
4672,
325,
18,
6923,
12443,
701,
12,
655,
63,
... | |
logger.debug("setting %s to '%s'" % (k, str(v))) | def getPath(executable): """ If the given file is found as-is (because the path is included), return None. Else, search the exe in $PATH, and return the path to it if found. """ if os.path.isfile(executable): return None else: paths = os.environ['PATH'].split(os.pathsep) for p in paths: f = os.path.join(p, executable) if os.path.isfile(f): return p return None | fe03ec5299c8813fff01b147eb5e7a000b215aa8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1488/fe03ec5299c8813fff01b147eb5e7a000b215aa8/JEMMonitoringServiceHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4339,
12,
17751,
4672,
3536,
971,
326,
864,
585,
353,
1392,
487,
17,
291,
261,
26274,
326,
589,
353,
5849,
3631,
327,
599,
18,
16289,
16,
1623,
326,
15073,
316,
271,
4211,
16,
471,
327... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4339,
12,
17751,
4672,
3536,
971,
326,
864,
585,
353,
1392,
487,
17,
291,
261,
26274,
326,
589,
353,
5849,
3631,
327,
599,
18,
16289,
16,
1623,
326,
15073,
316,
271,
4211,
16,
471,
327... | |
assert self.target_name in ("ls_wunit_k1","ls_wunit_k2","ls_wunit_kunit", "ls_wexp_k1" ,"ls_wexp_k2" ,"ls_wexp_kunit", "ls_wff_k1" ,"ls_wff_k2" ,"ls_wff_kunit", "lsm_k1" ,"lsm_k2" ,"lsm_kunit", "ml","mlhl") | assert self.target_name in ( "ls_wunit_k1","ls_wunit_k2","ls_wunit_kunit","ls_wunit_k1_fixed", "ls_wunit_k1ask3_fixed", "ls_wexp_k1" ,"ls_wexp_k2" ,"ls_wexp_kunit", "ls_wff_k1" ,"ls_wff_k2" ,"ls_wff_kunit","ls_wff_k1_fixed", "ls_wff_k1ask3_fixed", "lsm_k1" ,"lsm_k2" ,"lsm_kunit", "ml","mlhl") | def __init__(self, target_name, f_obs, flags, abcd = None, weights = None, use_sigmas_as_weights = False, scale_factor = 0): adopt_init_args(self, locals()) assert self.target_name in ("ls_wunit_k1","ls_wunit_k2","ls_wunit_kunit", "ls_wexp_k1" ,"ls_wexp_k2" ,"ls_wexp_kunit", "ls_wff_k1" ,"ls_wff_k2" ,"ls_wff_kunit", "lsm_k1" ,"lsm_k2" ,"lsm_kunit", "ml","mlhl") assert self.f_obs.data().size() == self.flags.size() if(self.flags.count(True) > 0): self.f_obs_w = self.f_obs.select(~self.flags) self.f_obs_t = self.f_obs.select( self.flags) else: self.f_obs_w = self.f_obs self.f_obs_t = self.f_obs if(self.target_name == "mlhl"): assert self.abcd is not None if(self.abcd is not None): if(self.target_name == "mlhl"): if(self.flags.count(True) > 0): self.abcd_w = self.abcd.select(~self.flags) self.abcd_t = self.abcd.select( self.flags) else: self.abcd_w = self.abcd self.abcd_t = self.abcd else: self.abcd_w, self.abcd_t = None, None else: self.abcd_w, self.abcd_t = None, None if(self.weights is not None): assert self.target_name.count("ls")+self.target_name.count("k") == 2 if(self.flags.count(True) > 0): self.weights_w = self.weights.select(~self.flags) self.weights_t = self.weights.select( self.flags) else: self.weights_w = self.weights self.weights_t = self.weights else: self.weights_w, self.weights_t = None, None | 082c0769ffd6e9832016293c38a1c2d981e8374a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/696/082c0769ffd6e9832016293c38a1c2d981e8374a/target_functors.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1018,
67,
529,
16,
284,
67,
10992,
16,
2943,
16,
1223,
4315,
10402,
273,
599,
16,
5376,
7734,
273,
599,
16,
999,
67,
7340,
15260,
67,
345,
67,
9727,
22... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1018,
67,
529,
16,
284,
67,
10992,
16,
2943,
16,
1223,
4315,
10402,
273,
599,
16,
5376,
7734,
273,
599,
16,
999,
67,
7340,
15260,
67,
345,
67,
9727,
22... |
keys.append(x[1].get(attr, None).lower()) | keys.append(x[1].get(attr, '').lower()) | def getkey(x): keys = [] for k in ordering: attr = self.model._meta.get_field(k).db_column keys.append(x[1].get(attr, None).lower()) return keys | 019971d21b837b21f8e9f6d831d1567d788a79e3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12933/019971d21b837b21f8e9f6d831d1567d788a79e3/query.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
856,
12,
92,
4672,
1311,
273,
5378,
364,
417,
316,
9543,
30,
1604,
273,
365,
18,
2284,
6315,
3901,
18,
588,
67,
1518,
12,
79,
2934,
1966,
67,
2827,
1311,
18,
6923,
12,
92,
63,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
856,
12,
92,
4672,
1311,
273,
5378,
364,
417,
316,
9543,
30,
1604,
273,
365,
18,
2284,
6315,
3901,
18,
588,
67,
1518,
12,
79,
2934,
1966,
67,
2827,
1311,
18,
6923,
12,
92,
63,
... |
self.commit() | self._commit() | def __init__(self, categories=None, parser_ids=None): PatternMatching.__init__(self) | f1083c2cb356c8caf500746eaf912566273204d4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9327/f1083c2cb356c8caf500746eaf912566273204d4/pattern.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
6477,
33,
7036,
16,
2082,
67,
2232,
33,
7036,
4672,
6830,
9517,
16186,
2738,
972,
12,
2890,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
6477,
33,
7036,
16,
2082,
67,
2232,
33,
7036,
4672,
6830,
9517,
16186,
2738,
972,
12,
2890,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
timeDiff = submitTime-assumedEndTime migrationTime = (timeDiff.days * 86400) + (timeDiff.seconds) + (timeDiff.microseconds/1000000.0) gMonitor.addMark("MigrationTime%s" % se,migrationTime) gDataStoreClient.addRegister(self.__initialiseAccountingObject('MigrationTime', se, submitTime, assumedEndTime, size)) gDataStoreClient.addRegister(self.__initialiseAccountingObject('MigrationThroughput', se, previousMonitorTime, assumedEndTime, size)) oDataOperation = self.__initialiseAccountingObject('MigrationSuccess', se, submitTime, assumedEndTime, size) | timeDiff = submitTime - assumedEndTime migrationTime = ( timeDiff.days * 86400 ) + ( timeDiff.seconds ) + ( timeDiff.microseconds / 1000000.0 ) gMonitor.addMark( "MigrationTime%s" % se, migrationTime ) gDataStoreClient.addRegister( self.__initialiseAccountingObject( 'MigrationTime', se, submitTime, assumedEndTime, size ) ) gDataStoreClient.addRegister( self.__initialiseAccountingObject( 'MigrationThroughput', se, previousMonitorTime, assumedEndTime, size ) ) oDataOperation = self.__initialiseAccountingObject( 'MigrationSuccess', se, submitTime, assumedEndTime, size ) | def __updateMigrationAccounting(self,se,migratingFiles,matchingFiles,mismatchingFiles,assumedEndTime,previousMonitorTime): """ Create accounting messages for the overall throughput observed and the total migration time for the files """ allMigrated = matchingFiles+mismatchingFiles gMonitor.addMark("MigratedFiles%s" % se,len(allMigrated)) gMonitor.addMark("TotalMigratedFiles%s" % se,len(allMigrated)) lfnFileID = {} sizesToObtain = [] for fileID in allMigrated: if not migratingFiles[fileID]['Size']: lfn = migratingFiles[fileID]['LFN'] sizesToObtain.append(lfn) lfnFileID[lfn] = fileID if sizesToObtain: res = self.ReplicaManager.getCatalogFileSize(sizesToObtain) if not res['OK']: gLogger.error("[%s] __updateMigrationAccounting: Failed to obtain file sizes" % se) return res for lfn,error in res['Value']['Failed'].items(): gLogger.error("[%s] __updateAccounting: Failed to get file size" % se,"%s %s" % (lfn,error)) migratingFiles[lfnFileID[lfn]]['Size'] = 0 for lfn,size in res['Value']['Successful'].items(): migratingFiles[lfnFileID[lfn]]['Size'] = size totalSize = 0 for fileID in allMigrated: size = migratingFiles[fileID]['Size'] totalSize += size submitTime = migratingFiles[fileID]['SubmitTime'] timeDiff = submitTime-assumedEndTime migrationTime = (timeDiff.days * 86400) + (timeDiff.seconds) + (timeDiff.microseconds/1000000.0) gMonitor.addMark("MigrationTime%s" % se,migrationTime) gDataStoreClient.addRegister(self.__initialiseAccountingObject('MigrationTime', se, submitTime, assumedEndTime, size)) gDataStoreClient.addRegister(self.__initialiseAccountingObject('MigrationThroughput', se, previousMonitorTime, assumedEndTime, size)) oDataOperation = self.__initialiseAccountingObject('MigrationSuccess', se, submitTime, assumedEndTime, size) if fileID in mismatchingFiles: oDataOperation.setValueByKey('TransferOK',0) oDataOperation.setValueByKey('FinalStatus','Failed') gDataStoreClient.addRegister(oDataOperation) gMonitor.addMark("TotalMigratedSize%s" % se,totalSize) gMonitor.addMark("ChecksumMismatches%s" % se,len(mismatchingFiles)) gMonitor.addMark("TotalChecksumMismatches%s" % se,len(mismatchingFiles)) gMonitor.addMark("ChecksumMatches%s" % se,len(matchingFiles)) gMonitor.addMark("TotalChecksumMatches%s" % se,len(matchingFiles)) if allMigrated: gLogger.info('[%s] __updateMigrationAccounting: Attempting to send accounting message...' % se) return gDataStoreClient.commit() return S_OK() | d0365a9152f6e7105162edd475d5401448bfdaed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/d0365a9152f6e7105162edd475d5401448bfdaed/MigrationMonitoringAgent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2725,
10224,
3032,
310,
12,
2890,
16,
307,
16,
81,
2757,
1776,
2697,
16,
16271,
2697,
16,
11173,
16271,
2697,
16,
428,
379,
329,
25255,
16,
11515,
7187,
950,
4672,
3536,
1788,
2236... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2725,
10224,
3032,
310,
12,
2890,
16,
307,
16,
81,
2757,
1776,
2697,
16,
16271,
2697,
16,
11173,
16271,
2697,
16,
428,
379,
329,
25255,
16,
11515,
7187,
950,
4672,
3536,
1788,
2236... |
if key == IHEOL: | if key == "IHEOL": | def getcourse(isprobe, akey): "Get a course and distance from the user." key = 0 dquad = copy.copy(game.quadrant) navmode = "unspecified" itemp = "curt" dsect = coord() iprompt = False if game.landed and not isprobe: prout(_("Dummy! You can't leave standard orbit until you")) proutn(_("are back aboard the ship.")) scanner.chew() return False while navmode == "unspecified": if damaged(DNAVSYS): if isprobe: prout(_("Computer damaged; manual navigation only")) else: prout(_("Computer damaged; manual movement only")) scanner.chew() navmode = "manual" key = IHEOL break if isprobe and akey != -1: # For probe launch, use pre-scanned value first time key = akey akey = -1 else: key = scanner.next() if key == IHEOL: proutn(_("Manual or automatic- ")) iprompt = True scanner.chew() elif key == IHALPHA: if scanner.sees("manual"): navmode = "manual" key = scanner.next() break elif scanner.sees("automatic"): navmode = "automatic" key = scanner.next() break else: huh() scanner.chew() return False else: # numeric if isprobe: prout(_("(Manual navigation assumed.)")) else: prout(_("(Manual movement assumed.)")) navmode = "manual" break if navmode == "automatic": while key == IHEOL: if isprobe: proutn(_("Target quadrant or quadrant§or- ")) else: proutn(_("Destination sector or quadrant§or- ")) scanner.chew() iprompt = True key = scanner.next() if key != IHREAL: huh() return False xi = int(round(scanner.real))-1 key = scanner.next() if key != IHREAL: huh() return False xj = int(round(scanner.real))-1 key = scanner.next() if key == IHREAL: # both quadrant and sector specified xk = int(round(scanner.real))-1 key = scanner.next() if key != IHREAL: huh() return False xl = int(round(scanner.real))-1 dquad.i = xi dquad.j = xj dsect.i = xk dsect.j = xl else: # only one pair of numbers was specified if isprobe: # only quadrant specified -- go to center of dest quad dquad.i = xi dquad.j = xj dsect.j = dsect.i = 4 # preserves 1-origin behavior else: # only sector specified dsect.i = xi dsect.j = xj itemp = "normal" if not VALID_QUADRANT(dquad.i,dquad.j) or not VALID_SECTOR(dsect.i,dsect.j): huh() return False skip(1) if not isprobe: if itemp > "curt": if iprompt: prout(_("Helmsman Sulu- \"Course locked in for Sector %s.\"") % dsect) else: prout(_("Ensign Chekov- \"Course laid in, Captain.\"")) # the actual deltas get computed here delta = coord() delta.i = dquad.j-game.quadrant.j + 0.1*(dsect.j-game.sector.j) delta.j = game.quadrant.i-dquad.i + 0.1*(game.sector.i-dsect.i) else: # manual while key == IHEOL: proutn(_("X and Y displacements- ")) scanner.chew() iprompt = True key = scanner.next() itemp = "verbose" if key != IHREAL: huh() return False delta.j = scanner.real key = scanner.next() if key != IHREAL: huh() return False delta.i = scanner.real # Check for zero movement if delta.i == 0 and delta.j == 0: scanner.chew() return False if itemp == "verbose" and not isprobe: skip(1) prout(_("Helmsman Sulu- \"Aye, Sir.\"")) # Course actually laid in. game.dist = delta.distance() game.direc = delta.bearing() if game.direc < 0.0: game.direc += 12.0 scanner.chew() return True | af15867a294e48006eba4fd9997cae401ccbfb05 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3176/af15867a294e48006eba4fd9997cae401ccbfb05/sst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
5566,
12,
291,
27230,
16,
279,
856,
4672,
315,
967,
279,
4362,
471,
3888,
628,
326,
729,
1199,
498,
273,
374,
302,
21733,
273,
1610,
18,
3530,
12,
13957,
18,
21733,
6890,
13,
8775... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5566,
12,
291,
27230,
16,
279,
856,
4672,
315,
967,
279,
4362,
471,
3888,
628,
326,
729,
1199,
498,
273,
374,
302,
21733,
273,
1610,
18,
3530,
12,
13957,
18,
21733,
6890,
13,
8775... |
ScipyTest = NumpyTest | class ScipyTest(NumpyTest): def __init__(self, package=None): warnings.warn("ScipyTest is now called NumpyTest; please update your code", DeprecationWarning) NumpyTest.__init__(self, package) | def info(self, message): print>>sys.stdout, message sys.stdout.flush() | d84df7beb09f4a3a80b721102d9705e9661fc47a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/14925/d84df7beb09f4a3a80b721102d9705e9661fc47a/numpytest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1123,
12,
2890,
16,
883,
4672,
1172,
9778,
9499,
18,
10283,
16,
883,
2589,
18,
10283,
18,
11330,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1123,
12,
2890,
16,
883,
4672,
1172,
9778,
9499,
18,
10283,
16,
883,
2589,
18,
10283,
18,
11330,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
self.dsage_server = DSageServer(self.jobdb, self.workerdb, self.clientdb, log_level=5) | self.dsage_server = DSageServer(self.jobdb,self.workerdb, self.clientdb, log_level=5) | def setUp(self): Session = init_db(self.test_db.name) self.jobdb = JobDatabase(Session) self.workerdb = WorkerDatabase(Session) self.clientdb = ClientDatabase(Session) self.dsage_server = DSageServer(self.jobdb, self.workerdb, self.clientdb, log_level=5) self.realm = Realm(self.dsage_server) self.p = _SSHKeyPortalRoot(portal.Portal(self.realm)) self.p.portal.registerChecker( PublicKeyCredentialsCheckerDB(self.clientdb)) self.client_factory = pb.PBServerFactory(self.p) self.hostname = 'localhost' self.server = reactor.listenTCP(0, self.client_factory) self.port = self.server.getHost().port | 5920cf9d72f3d8026091ab24bf767e3a12f7d452 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/5920cf9d72f3d8026091ab24bf767e3a12f7d452/test_remote.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
12,
2890,
4672,
3877,
273,
1208,
67,
1966,
12,
2890,
18,
3813,
67,
1966,
18,
529,
13,
365,
18,
4688,
1966,
273,
3956,
4254,
12,
2157,
13,
365,
18,
10124,
1966,
273,
11016,
4254,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3877,
273,
1208,
67,
1966,
12,
2890,
18,
3813,
67,
1966,
18,
529,
13,
365,
18,
4688,
1966,
273,
3956,
4254,
12,
2157,
13,
365,
18,
10124,
1966,
273,
11016,
4254,... |
ring equipped with an action of operators T_m for all positive integers m coprime to some integer n (the level), which satisfy `T_r T_s = T_{rs}` for r,s coprime, and for powers of a prime p, `T_{p^r} = T_{p} T_{p^{r-1}} - | ring equipped with an action of operators `T_m` for all positive integers `m` coprime to some integer `n`(the level), which satisfy `T_r T_s = T_{rs}` for `r,s` coprime, and for powers of a prime `p`, `T_{p^r} = T_{p} T_{p^{r-1}} - | def is_HeckeModule(x): r""" Return True if x is a Hecke module. EXAMPLES:: sage: from sage.modular.hecke.module import is_HeckeModule sage: is_HeckeModule(ModularForms(Gamma0(7), 4)) True sage: is_HeckeModule(QQ^3) False sage: is_HeckeModule(J0(37).homology()) True """ return isinstance(x, HeckeModule_generic) | 626e7a3867af44ed7e2e05c2445f512cf64bcc9b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/626e7a3867af44ed7e2e05c2445f512cf64bcc9b/module.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
44,
762,
73,
3120,
12,
92,
4672,
436,
8395,
2000,
1053,
309,
619,
353,
279,
670,
762,
73,
1605,
18,
225,
5675,
8900,
11386,
2866,
225,
272,
410,
30,
628,
272,
410,
18,
1711,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
44,
762,
73,
3120,
12,
92,
4672,
436,
8395,
2000,
1053,
309,
619,
353,
279,
670,
762,
73,
1605,
18,
225,
5675,
8900,
11386,
2866,
225,
272,
410,
30,
628,
272,
410,
18,
1711,... |
self.tk.call(self._w, 'dropsite', 'set', index) | self.tk.call(self._w, 'dropsite', 'set', index) | def dropsite_set(self, index): | 0049f0036898e656085d5c214ba07642a9c25a6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0049f0036898e656085d5c214ba07642a9c25a6e/Tix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29535,
1137,
67,
542,
12,
2890,
16,
770,
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,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29535,
1137,
67,
542,
12,
2890,
16,
770,
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,
... |
class PLNationalBusinessRegisterField(RegexField): | class PLREGONField(RegexField): | def has_valid_checksum(self, number): """ Calculates a checksum with the provided algorithm. """ multiple_table = (6, 5, 7, 2, 3, 4, 5, 6, 7) result = 0 for i in range(len(number)-1): result += int(number[i]) * multiple_table[i] | f462011445a126f75033889802fc5073d796e1fb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9988/f462011445a126f75033889802fc5073d796e1fb/forms.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
711,
67,
877,
67,
15149,
12,
2890,
16,
1300,
4672,
3536,
26128,
279,
6697,
598,
326,
2112,
4886,
18,
3536,
3229,
67,
2121,
273,
261,
26,
16,
1381,
16,
2371,
16,
576,
16,
890,
16,
105... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
711,
67,
877,
67,
15149,
12,
2890,
16,
1300,
4672,
3536,
26128,
279,
6697,
598,
326,
2112,
4886,
18,
3536,
3229,
67,
2121,
273,
261,
26,
16,
1381,
16,
2371,
16,
576,
16,
890,
16,
105... |
f = codecs.open(masterfile, 'w', encoding='utf-8') | f = open(masterfile, 'w', encoding='utf-8') | def inner_main(args): d = {} texescape.init() if not color_terminal(): nocolor() print bold('Welcome to the Sphinx %s quickstart utility.') % __version__ print ''' | 002bf6b2a886357632099dce76b0a7e59df6c89d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7032/002bf6b2a886357632099dce76b0a7e59df6c89d/quickstart.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3443,
67,
5254,
12,
1968,
4672,
302,
273,
2618,
16573,
6939,
18,
2738,
1435,
225,
309,
486,
2036,
67,
15979,
13332,
30601,
355,
280,
1435,
225,
1172,
13068,
2668,
59,
16312,
358,
326,
34... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3443,
67,
5254,
12,
1968,
4672,
302,
273,
2618,
16573,
6939,
18,
2738,
1435,
225,
309,
486,
2036,
67,
15979,
13332,
30601,
355,
280,
1435,
225,
1172,
13068,
2668,
59,
16312,
358,
326,
34... |
reactor.callFromThread(reactor.callLater, timeout, self._publish) | reactor.callFromThread(reactor.callLater, timeout, self._subscribe) | def _NH_SIPSubscriptionChangedState(self, notification): route = notification.sender.route if notification.data.state.lower() in ('active', 'accepted'): self._subscription_routes = None self._subscription_wait = 0.5 if not self.success: self.output.put('Subscription succeeded at %s:%d;transport=%s' % (route.address, route.port, route.transport)) self.success = True elif notification.data.state.lower() == 'pending': self._subscription_routes = None self._subscription_wait = 0.5 self.output.put('Subscription is pending at %s:%d;transport=%s' % (route.address, route.port, route.transport)) elif notification.data.state.lower() == 'terminated': self.subscription = None if hasattr(notification.data, 'code'): status = ': %d %s' % (notification.data.code, notification.data.reason) else: status = '' self.output.put('Unsubscribed from %s:%d;transport=%s%s' % (route.address, route.port, route.transport, status)) if self.stopping or getattr(notification.data, 'code', None) in (None, 401, 403, 407): if hasattr(notification.data, 'code') and notification.data.code / 100 == 2: self.success = True self.stop() else: self.success = False if not self._subscription_routes or time() > self._subscription_timeout: self._subscription_wait = min(self._subscription_wait*2, 30) timeout = random.uniform(self._subscription_wait, 2*self._subscription_wait) reactor.callFromThread(reactor.callLater, timeout, self._publish) else: self.subscription = Subscription(self.account.credentials, self.target, "presence", route=self._subscription_routes.popleft(), expires=self.account.presence.subscribe_interval) notification_center = NotificationCenter() notification_center.add_observer(self, sender=self.subscription) self.subscription.subscribe() | 66b848db6eebc62ca8f11e2ef8aa97c5719ea869 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3449/66b848db6eebc62ca8f11e2ef8aa97c5719ea869/sip_subscribe_presence.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
50,
44,
67,
17739,
6663,
5033,
1119,
12,
2890,
16,
3851,
4672,
1946,
273,
3851,
18,
15330,
18,
5547,
309,
3851,
18,
892,
18,
2019,
18,
8167,
1435,
316,
7707,
3535,
2187,
296,
2384... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
50,
44,
67,
17739,
6663,
5033,
1119,
12,
2890,
16,
3851,
4672,
1946,
273,
3851,
18,
15330,
18,
5547,
309,
3851,
18,
892,
18,
2019,
18,
8167,
1435,
316,
7707,
3535,
2187,
296,
2384... |
(status, me) = getFavorite(favname) | (status, me) = self.getFavorite(favname) | def adjustPriority(self, favname, mod=0): save = [] mod = int(mod) (status, me) = getFavorite(favname) oldprio = int(me.priority) newprio = oldprio + mod _debug_('ap: mod=%s\n' % mod) sr = self.getScheduledRecordings() favs = sr.getFavorites().values() sys.stderr.write('adjusting prio of '+favname+'\n') for fav in favs: fav.priority = int(fav.priority) if fav.name == me.name: _debug_('MATCH') fav.priority = newprio _debug_('moved prio of %s: %s => %s\n' % (fav.name, oldprio, newprio)) continue if mod < 0: if fav.priority < newprio or fav.priority > oldprio: _debug_('fp: %s, old: %s, new: %s\n' % (fav.priority, oldprio, newprio)) _debug_('skipping: %s\n' % fav.name) continue fav.priority = fav.priority + 1 _debug_('moved prio of %s: %s => %s\n' % (fav.name, fav.priority-1, fav.priority)) if mod > 0: if fav.priority > newprio or fav.priority < oldprio: _debug_('skipping: %s\n' % fav.name) continue fav.priority = fav.priority - 1 _debug_('moved prio of %s: %s => %s\n' % (fav.name, fav.priority+1, fav.priority)) sr.setFavoritesList(favs) self.saveScheduledRecordings(sr) | 89c77ae3ee99f0b0c92d043f2b843b3eece06163 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/89c77ae3ee99f0b0c92d043f2b843b3eece06163/recordserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5765,
8183,
12,
2890,
16,
18180,
529,
16,
681,
33,
20,
4672,
1923,
273,
5378,
681,
273,
509,
12,
1711,
13,
261,
2327,
16,
1791,
13,
273,
365,
18,
588,
31745,
1137,
12,
19731,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5765,
8183,
12,
2890,
16,
18180,
529,
16,
681,
33,
20,
4672,
1923,
273,
5378,
681,
273,
509,
12,
1711,
13,
261,
2327,
16,
1791,
13,
273,
365,
18,
588,
31745,
1137,
12,
19731,
529,
13... |
e1 = time.clock(); | e1 = timer(); | def step(self,steps=1): sz = len(self.pop) replace = int(self.settings['p_replace'] * len(self.pop)) p_crossover = self.settings['p_cross'] for st in range(steps): b = time.clock() for i in range(0,replace,2): mom,dad= self.pop.select(2) self.stats['selections'] = self.stats['selections'] + 2 if flip_coin(p_crossover): try: bro,sis = self.crossover((mom,dad)) self.stats['crossovers'] = self.stats['crossovers'] + 2 self.pop.append(bro); self.pop.append(sis) except ValueError: #crossover failed - just act as if this iteration never happened i = i - 2 #print 'crossover failure - ignoring and continuing' else: self.pop.append(mom.clone());self.pop.append(dad.clone()); if replace % 2: #we did one to many - remove the last individual del self.pop[-1] self.stats['crossovers'] = self.stats['crossovers'] - 1 e1 = time.clock(); self.stats['mutations'] = self.stats['mutations'] + self.pop[sz:].mutate() | 8418b2938a491bb6a337b1fba872055375ef3547 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/8418b2938a491bb6a337b1fba872055375ef3547/algorithm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2235,
12,
2890,
16,
8986,
33,
21,
4672,
11262,
273,
562,
12,
2890,
18,
5120,
13,
1453,
273,
509,
12,
2890,
18,
4272,
3292,
84,
67,
2079,
3546,
380,
562,
12,
2890,
18,
5120,
3719,
293... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2235,
12,
2890,
16,
8986,
33,
21,
4672,
11262,
273,
562,
12,
2890,
18,
5120,
13,
1453,
273,
509,
12,
2890,
18,
4272,
3292,
84,
67,
2079,
3546,
380,
562,
12,
2890,
18,
5120,
3719,
293... |
self.resize_event (_x, _y, _w, _h) | self.resize_event (viewport[0], viewport[1], viewport[2], viewport[3]) | def save (self, filename=None, zoom=2): """ Save figure in a file as a bitmap Function signature ------------------ save (filename, zoom) | 85ae2881959dcc546697f3a6eed054b7dcd6198d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12213/85ae2881959dcc546697f3a6eed054b7dcd6198d/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
261,
2890,
16,
1544,
33,
7036,
16,
7182,
33,
22,
4672,
3536,
7074,
7837,
316,
279,
585,
487,
279,
9389,
225,
4284,
3372,
12146,
17,
225,
1923,
261,
3459,
16,
7182,
13,
2,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
261,
2890,
16,
1544,
33,
7036,
16,
7182,
33,
22,
4672,
3536,
7074,
7837,
316,
279,
585,
487,
279,
9389,
225,
4284,
3372,
12146,
17,
225,
1923,
261,
3459,
16,
7182,
13,
2,
-100,
... |
else | else: | def __init__(data = None) if data == None: quickfix.StringField.__init__(self, 874) else quickfix.StringField.__init__(self, 874, 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,
780,
974,
16186,
2738,
972,
12,
2890,
16,
1725,
5608,
13,
469,
30,
9549,
904,
18,
780,
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,
780,
974,
16186,
2738,
972,
12,
2890,
16,
1725,
5608,
13,
469,
30,
9549,
904,
18,
780,
974,
16186,
2738... |
if isinstance(l,list): return ret elif isinstance(l,tuple): return tuple(ret) elif is_Matrix(l): return Matrix(GF(2), l.ncols(), l.nrows()*self.e, ret).transpose() | if isinstance(l, list): return ret elif isinstance(l, tuple): return tuple(ret) elif is_Matrix(l): return Matrix(GF(2), l.ncols(), l.nrows()*self.e, ret).transpose() | def phi(self, l, diffusion_matrix=False): r""" Given a list/matrix of elements in $GF(2^n)$ return a matching list/matrix of elements in $GF(2)$. | cd82551727ddbae04c5b28f55b59ec14654a84ab /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/cd82551727ddbae04c5b28f55b59ec14654a84ab/sr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7706,
12,
2890,
16,
328,
16,
3122,
7063,
67,
5667,
33,
8381,
4672,
436,
8395,
16803,
279,
666,
19,
5667,
434,
2186,
316,
271,
43,
42,
12,
22,
66,
82,
21877,
327,
279,
3607,
666,
19,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7706,
12,
2890,
16,
328,
16,
3122,
7063,
67,
5667,
33,
8381,
4672,
436,
8395,
16803,
279,
666,
19,
5667,
434,
2186,
316,
271,
43,
42,
12,
22,
66,
82,
21877,
327,
279,
3607,
666,
19,
... |
eventhandler.post_event(Event(OSD_MESSAGE, arg=osd_message)) | eventhandler.post(Event(OSD_MESSAGE, arg=osd_message)) | def delete_submenu(self, refresh=True, reload=False, osd_message=''): """ Delete the last menu if it is a submenu. Also refresh or reload the new menu if the attributes are set to True. If osd_message is set, this message will be send if the current menu is no submenu """ if len(self.menustack) > 1 and self.menustack[-1].submenu: self.back_one_menu(refresh) elif len(self.menustack) > 1 and osd_message: eventhandler.post_event(Event(OSD_MESSAGE, arg=osd_message)) | 1da4b7a0a27baca173d607f25a760aef4501a5a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/1da4b7a0a27baca173d607f25a760aef4501a5a7/stack.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
67,
1717,
5414,
12,
2890,
16,
4460,
33,
5510,
16,
7749,
33,
8381,
16,
1140,
72,
67,
2150,
2218,
11,
4672,
3536,
2504,
326,
1142,
3824,
309,
518,
353,
279,
27539,
18,
8080,
4460,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
67,
1717,
5414,
12,
2890,
16,
4460,
33,
5510,
16,
7749,
33,
8381,
16,
1140,
72,
67,
2150,
2218,
11,
4672,
3536,
2504,
326,
1142,
3824,
309,
518,
353,
279,
27539,
18,
8080,
4460,
... |
if examples.domain.classVar.varType == orange.VarTypes.Continuous: print "CN2 can learn only on discrete class!" return | supervisedClassCheck(examples) | def __call__(self, examples, weight=0): if examples.domain.classVar.varType == orange.VarTypes.Continuous: print "CN2 can learn only on discrete class!" return rules = orange.RuleList() self.ruleStopping.apriori = orange.Distribution(examples.domain.classVar,examples) progress=getattr(self,"progressCallback",None) if progress: progress.start = 0.0 progress.end = 0.0 distrib = orange.Distribution(examples.domain.classVar, examples, weight) distrib.normalize() for targetClass in examples.domain.classVar: if progress: progress.start = progress.end progress.end += distrib[targetClass] self.targetClass = targetClass cl = orange.RuleLearner.__call__(self,examples,weight) for r in cl.rules: rules.append(r) if progress: progress(1.0,None) return CN2UnorderedClassifier(rules, examples, weight) | dc01b88d50788f05a050bd14c759a1cb668a2586 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6366/dc01b88d50788f05a050bd14c759a1cb668a2586/orngCN2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
10991,
16,
3119,
33,
20,
4672,
2240,
26779,
797,
1564,
12,
16858,
13,
225,
2931,
273,
578,
726,
18,
2175,
682,
1435,
365,
18,
5345,
21994,
18,
438,
2432,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
10991,
16,
3119,
33,
20,
4672,
2240,
26779,
797,
1564,
12,
16858,
13,
225,
2931,
273,
578,
726,
18,
2175,
682,
1435,
365,
18,
5345,
21994,
18,
438,
2432,... |
def _set_value(self, value): self._value_to_set = value if self._set_hid is None: self._set_hid = gobject.timeout_add(self._delay, self._do_set_value) def _do_set_value(self): | def _set_value(self): | def _set_value(self, value): self._value_to_set = value if self._set_hid is None: self._set_hid = gobject.timeout_add(self._delay, self._do_set_value) | 4034ffa2c6e15c036cdf4d0a3d66f8b8c530ed74 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6471/4034ffa2c6e15c036cdf4d0a3d66f8b8c530ed74/slider.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
542,
67,
1132,
12,
2890,
16,
460,
4672,
365,
6315,
1132,
67,
869,
67,
542,
273,
460,
309,
365,
6315,
542,
67,
76,
350,
353,
599,
30,
365,
6315,
542,
67,
76,
350,
273,
314,
161... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
542,
67,
1132,
12,
2890,
16,
460,
4672,
365,
6315,
1132,
67,
869,
67,
542,
273,
460,
309,
365,
6315,
542,
67,
76,
350,
353,
599,
30,
365,
6315,
542,
67,
76,
350,
273,
314,
161... |
log.info(" %s -> %s", action, filename) | if action in ['U']: log.debug(" %s -> %s", action, filename) else: log.info(" %s -> %s", action, filename) | def _zipChanges(directory, infolist): # gets the dates of the files in the zip archive infos = {} for i in infolist: fn = i.filename if fn.endswith(".pyc"): fn = fn[:-1] infos[fn] = i.date_time # gets the changes added = [] modified = [] untouched = [] removed = [] all_files = set() log = logging.getLogger("zipdir") dirlen = len(directory) + 1 for root, _dirs, files in os.walk(directory): arcdir = root[dirlen:] for f in files: ext = os.path.splitext(f)[1] if ext == ".py": # extensions that can enter the zip file filename = os.path.join(arcdir, f) all_files.add(filename) if filename not in infos: action = "A" added.append(filename) else: filetime = time.localtime(os.stat(os.path.join(directory,filename))[stat.ST_MTIME])[:6] if filetime > infos[filename]: action = "M" modified.append(filename) else: action = "U" untouched.append(filename) log.info(" %s -> %s", action, filename) elif ext not in [".pyc", ".pyo", ".stamp", ".cmtref"]: # extensions that can be ignored raise ZipdirError("Cannot add '%s' to the zip file, only '.py' are allowed." % os.path.join(arcdir, f)) # check for removed files for filename in infos: if filename not in all_files: removed.append(filename) log.info(" %s -> %s", "R", filename) return (added, modified, untouched, removed) | 93e5c615b106687a85b1b7e130f9960bdbf94b21 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9140/93e5c615b106687a85b1b7e130f9960bdbf94b21/ZipPythonDir.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4450,
7173,
12,
5149,
16,
8286,
355,
376,
4672,
468,
5571,
326,
7811,
434,
326,
1390,
316,
326,
3144,
5052,
10626,
273,
2618,
364,
277,
316,
8286,
355,
376,
30,
2295,
273,
277,
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,
389,
4450,
7173,
12,
5149,
16,
8286,
355,
376,
4672,
468,
5571,
326,
7811,
434,
326,
1390,
316,
326,
3144,
5052,
10626,
273,
2618,
364,
277,
316,
8286,
355,
376,
30,
2295,
273,
277,
18... |
self._show_private = 0 | def write(self, directory=None, progress_callback=None): """ Write the documentation to the given directory. | dad6dd09c82d3878a78d977cc13da79d4420db2b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/dad6dd09c82d3878a78d977cc13da79d4420db2b/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
1867,
33,
7036,
16,
4007,
67,
3394,
33,
7036,
4672,
3536,
2598,
326,
7323,
358,
326,
864,
1867,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
1867,
33,
7036,
16,
4007,
67,
3394,
33,
7036,
4672,
3536,
2598,
326,
7323,
358,
326,
864,
1867,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... | |
parser.add_option("--python-includes", dest="py_incpath", help="Python include directory") | parser.add_option("--python-includes", dest="py_incpath", help="Python include path") | def main(): # Options for qmake DEFINES = "" CONFIG = "" # Setup command line parser parser = OptionParser(version="%prog 0.2") parser.add_option("--dsp", action="store_true", dest="dsp", help="also Generate Visual Studio project files") parser.add_option("--nocolor", action="store_true", dest="nocolor", help="disable color output support on this script") parser.add_option("--python-includes", dest="py_incpath", help="Python include directory") parser.add_option("--python-libraries", dest="py_libpath", help="Python library path") parser.add_option("--qt-directory", dest="qt_dir", help="Base directory of Qt") parser.add_option("--static", action="store_true", dest="staticlink", help="Build wokfpack using static libraries") parser.add_option("--enable-debug", action="store_true", dest="enable_debug", help="Enables basic debugging support.") parser.add_option("--enable-aidebug", action="store_true", dest="enable_aidebug", help="Enabled debugging of NPC AI.") parser.add_option("--enable-mysql", action="store_true", dest="enable_mysql", help="Enables MySQL support.") parser.add_option("--disable-translation", action="store_true", dest="disable_translation", help="Disable non-English language support.") (options, args) = parser.parse_args() if options.nocolor or sys.platform == "win32": nocolor() checkPython(options, True, not (sys.platform == "darwin") ) if options.enable_mysql: CONFIG += "mysql " DEFINES += "MYSQL_DRIVER " checkMySQL(options) checkQt() if options.disable_translation: DEFINES += "QT_NO_TRANSLATION " # Create config.pri global py_libpath global py_libfile global py_incpath global qt_qmake global mysql_libpath global mysql_libfile global mysql_incpath config = file("config.pri", "w") config.write("# WARNING: This file was automatically generated by configure.py\n") config.write("# any changes to this file will be lost!\n") # Build Python LIBS and Includes if sys.platform == "darwin": # MacPython is build as a Framework, not a library :/ PY_LIBDIR = distutils.sysconfig.get_config_vars("LINKFORSHARED")[0] PY_LIBDIR += " -flat_namespace" else: PY_LIBDIR = buildLibLine( py_libpath, py_libfile ) config.write("PY_LIBDIR = %s\n" % PY_LIBDIR) config.write("PY_INCDIR = %s\n" % py_incpath ) # Build MySQL Libs and Includes MySQL_LIBDIR = buildLibLine( mysql_libpath, mysql_libfile ) config.write("MySQL_INCDIR = %s\n" % mysql_incpath ) config.write("MySQL_LIBDIR = %s\n" % MySQL_LIBDIR ) # if --debug if options.enable_debug: DEFINES += "_DEBUG " CONFIG += "debug warn_on " else: CONFIG += "release warn_off " # if --aidebug if options.enable_aidebug: DEFINES += "_AIDEBUG " config.write("DEFINES += %s\n" % DEFINES) config.write("CONFIG += %s\n" % CONFIG) config.write("LIBS += $$PY_LIBDIR $$MySQL_LIBDIR \n") config.write("INCLUDEPATH += $$PY_INCDIR $$MySQL_INCDIR \n") config.close() sys.stdout.write(green("Generating makefile...")) sys.stdout.flush() os.spawnv(os.P_WAIT, qt_qmake, [qt_qmake, "wolfpack.pro"]) if options.dsp: sys.stdout.write("Generating Visual Studio project files...\n") os.spawnv(os.P_WAIT, qt_qmake, [qt_qmake, "wolfpack.pro", "-t vcapp"]) sys.stdout.write(bold("Done\n")) sys.stdout.write(bold("Configure finished. Please run 'make' now.\n")) | d941256082445e4067ba7bbfd19725f6d2fd0a35 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/d941256082445e4067ba7bbfd19725f6d2fd0a35/configure.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
468,
5087,
364,
1043,
6540,
25957,
3740,
55,
273,
1408,
9128,
273,
1408,
225,
468,
10939,
1296,
980,
2082,
2082,
273,
18862,
12,
1589,
11613,
14654,
374,
18,
22,
7923,
2082,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
468,
5087,
364,
1043,
6540,
25957,
3740,
55,
273,
1408,
9128,
273,
1408,
225,
468,
10939,
1296,
980,
2082,
2082,
273,
18862,
12,
1589,
11613,
14654,
374,
18,
22,
7923,
2082,
... |
Morecmds is a sequence of LaTex commands (without backslashes) that | Morecmds is a sequence of LaTeX commands (without backslashes) that | def checkit(source, opts, morecmds=[]): """Check the LaTex formatting in a sequence of lines. Opts is a mapping of options to option values if any: -m munge parenthesis and brackets -f forward slash warnings to be skipped -d delimiters only checking -v verbose listing on delimiters -s lineno: linenumber to start scan (default is 1). Morecmds is a sequence of LaTex commands (without backslashes) that are to be considered valid in the scan. """ texcmd = re.compile(r'\\[A-Za-z]+') validcmds = sets.Set(cmdstr.split()) for cmd in morecmds: validcmds.add('\\' + cmd) openers = [] # Stack of pending open delimiters if '-m' in opts: pairmap = {']':'[(', ')':'(['} # Munged openers else: pairmap = {']':'[', ')':'('} # Normal opener for a given closer openpunct = sets.Set('([') # Set of valid openers delimiters = re.compile(r'\\(begin|end){([_a-zA-Z]+)}|([()\[\]])') startline = int(opts.get('-s', '1')) lineno = 0 for lineno, line in izip(count(startline), islice(source, startline-1, None)): line = line.rstrip() if '-f' not in opts and '/' in line: # Warn whenever forward slashes encountered line = line.rstrip() print 'Warning, forward slash on line %d: %s' % (lineno, line) if '-d' not in opts: # Validate commands nc = line.find(r'\newcommand') if nc != -1: start = line.find('{', nc) end = line.find('}', start) validcmds.add(line[start+1:end]) for cmd in texcmd.findall(line): if cmd not in validcmds: print r'Warning, unknown tex cmd on line %d: \%s' % (lineno, cmd) # Check balancing of open/close markers (parens, brackets, etc) for begend, name, punct in delimiters.findall(line): if '-v' in opts: print lineno, '|', begend, name, punct, if begend == 'begin' and '-d' not in opts: openers.append((lineno, name)) elif punct in openpunct: openers.append((lineno, punct)) elif begend == 'end' and '-d' not in opts: matchclose(lineno, name, openers, pairmap) elif punct in pairmap: matchclose(lineno, punct, openers, pairmap) if '-v' in opts: print ' --> ', openers for lineno, symbol in openers: print "Unmatched open delimiter '%s' on line %d", (symbol, lineno) print 'Done checking %d lines.' % (lineno,) return 0 | 55b90d0e44a443ac52b870ca5d4405d432ce54ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/55b90d0e44a443ac52b870ca5d4405d432ce54ee/texcheck.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
305,
12,
3168,
16,
1500,
16,
1898,
24680,
33,
8526,
4672,
3536,
1564,
326,
21072,
16733,
10407,
316,
279,
3102,
434,
2362,
18,
225,
25769,
353,
279,
2874,
434,
702,
358,
1456,
924,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
305,
12,
3168,
16,
1500,
16,
1898,
24680,
33,
8526,
4672,
3536,
1564,
326,
21072,
16733,
10407,
316,
279,
3102,
434,
2362,
18,
225,
25769,
353,
279,
2874,
434,
702,
358,
1456,
924,
... |
self.log(3, "invalidated cache for", len(invList), "troves") | def setTroveSigs(self, authToken, clientVersion, infoList): # return the number of signatures which have changed self.log(2, infoList) # this requires mirror access and write access for that trove if not self.auth.check(authToken, mirror=True): raise errors.InsufficientPermission # batch permission check for writing if False in self.auth.batchCheck(authToken, [ (n,self.toVersion(v)) for (n,v,f), s in infoList], write=True): raise errors.InsufficientPermission cu = self.db.cursor() updateCount = 0 | 4f7aa7b4039f545e189813c6f9e2b9c5cf68f7fc /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8747/4f7aa7b4039f545e189813c6f9e2b9c5cf68f7fc/netserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
56,
303,
537,
8267,
87,
12,
2890,
16,
24050,
16,
1004,
1444,
16,
1123,
682,
4672,
468,
327,
326,
1300,
434,
14862,
1492,
1240,
3550,
365,
18,
1330,
12,
22,
16,
1123,
682,
13,
46... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
56,
303,
537,
8267,
87,
12,
2890,
16,
24050,
16,
1004,
1444,
16,
1123,
682,
4672,
468,
327,
326,
1300,
434,
14862,
1492,
1240,
3550,
365,
18,
1330,
12,
22,
16,
1123,
682,
13,
46... | |
u = u''.join(map(unichr, xrange(128))) for encoding in ('ascii',): self.assertEqual(unicode(u.encode(encoding),encoding), u) | for c in xrange(128): u = unichr(c) for encoding in ('ascii',): self.assertEqual(unicode(u.encode(encoding),encoding), u) | def test_codecs(self): # Encoding self.assertEqual(u'hello'.encode('ascii'), 'hello') self.assertEqual(u'hello'.encode('utf-7'), 'hello') self.assertEqual(u'hello'.encode('utf-8'), 'hello') self.assertEqual(u'hello'.encode('utf8'), 'hello') self.assertEqual(u'hello'.encode('utf-16-le'), 'h\000e\000l\000l\000o\000') self.assertEqual(u'hello'.encode('utf-16-be'), '\000h\000e\000l\000l\000o') self.assertEqual(u'hello'.encode('latin-1'), 'hello') | 38c70e601d470b2de8cf9228de15540fbee65313 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/38c70e601d470b2de8cf9228de15540fbee65313/test_unicode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
710,
2143,
12,
2890,
4672,
468,
13400,
365,
18,
11231,
5812,
12,
89,
11,
23711,
10332,
3015,
2668,
9184,
19899,
296,
23711,
6134,
365,
18,
11231,
5812,
12,
89,
11,
23711,
10332... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
710,
2143,
12,
2890,
4672,
468,
13400,
365,
18,
11231,
5812,
12,
89,
11,
23711,
10332,
3015,
2668,
9184,
19899,
296,
23711,
6134,
365,
18,
11231,
5812,
12,
89,
11,
23711,
10332... |
cont.default_nib = lambda c,x,y,t,theta: follow_curveset_nib(c,x,y,t,theta,tcurves,c.i,len(curves),8) c0.nib = lambda c,x,y,t,theta: (lambda x1,x2: ((lambda k: (8, 0, 0, k))(5*((x-min(x1,x2))/abs(x2-x1)))))(c.compute_x(0),c.compute_x(1)) c4.nib = lambda c,x,y,t,theta: (lambda x1,x2: ((lambda k: (8, 0, k, 0))(5*((max(x1,x2)-x)/abs(x2-x1)))))(c.compute_x(0),c.compute_x(1)) cont.before = "529 0 translate 4 3 div 1 scale -529 0 translate" | curves[i].nib = lambda c,x,y,t,theta: follow_curveset_nib(c,x,y,t,theta,tcurves,c.i,len(curves),8) c3.nib = lambda c,x,y,t,theta: (lambda x1,x2: ((lambda k: (8, 0, 0, k))(9*((x-min(x1,x2))/abs(x2-x1)))))(c.compute_x(0),c.compute_x(1)) c7.nib = lambda c,x,y,t,theta: (lambda x1,x2: ((lambda k: (8, 0, k, 0))(9*((max(x1,x2)-x)/abs(x2-x1)))))(c.compute_x(0),c.compute_x(1)) | def tmpfn(): # eight # The traditional 8 just contains _too_ many ellipse-like curves # to draw sensibly using involutes, so I resorted to scaling the # x-axis down by 3/4 so that the ellipses became more circular, # and then scaling back up again when drawing the output. # Secondary curve set cont = GlyphContext() # Saved data from gui.py c0 = CircleInvolute(cont, 549, 365, 0.903738, -0.428086, 529, 255, -1, 0) c1 = CircleInvolute(cont, 529, 255, -1, 0, 497, 288, 0.242536, 0.970143) c2 = CircleInvolute(cont, 497, 288, 0.242536, 0.970143, 561, 353, 0.877896, 0.478852) c3 = CircleInvolute(cont, 561, 353, 0.877896, 0.478852, 529, 469, -1, 0) c4 = CircleInvolute(cont, 529, 469, -1, 0, 497, 353, 0.877896, -0.478852) c0.weld_to(1, c1, 0) c1.weld_to(1, c2, 0) c2.weld_to(1, c3, 0) c3.weld_to(1, c4, 0) # End saved data tcurves = c0,c1,c2,c3,c4 # Primary curve set cont = GlyphContext() # Saved data from gui.py c0 = CircleInvolute(cont, 549, 365, 0.903738, -0.428086, 529, 255, -1, 0) c1 = CircleInvolute(cont, 529, 255, -1, 0, 509, 365, 0.903738, 0.428086) c2 = CircleInvolute(cont, 509, 365, 0.903738, 0.428086, 565, 429, 0.0499376, 0.998752) c3 = CircleInvolute(cont, 565, 429, 0.0499376, 0.998752, 529, 469, -1, 0) c4 = CircleInvolute(cont, 529, 469, -1, 0, 497, 353, 0.877896, -0.478852) c0.weld_to(1, c1, 0) c1.weld_to(1, c2, 0) c2.weld_to(1, c3, 0) c3.weld_to(1, c4, 0) # End saved data curves = c0,c1,c2,c3,c4 for i in range(len(curves)): curves[i].i = i cont.default_nib = lambda c,x,y,t,theta: follow_curveset_nib(c,x,y,t,theta,tcurves,c.i,len(curves),8) c0.nib = lambda c,x,y,t,theta: (lambda x1,x2: ((lambda k: (8, 0, 0, k))(5*((x-min(x1,x2))/abs(x2-x1)))))(c.compute_x(0),c.compute_x(1)) c4.nib = lambda c,x,y,t,theta: (lambda x1,x2: ((lambda k: (8, 0, k, 0))(5*((max(x1,x2)-x)/abs(x2-x1)))))(c.compute_x(0),c.compute_x(1)) cont.before = "529 0 translate 4 3 div 1 scale -529 0 translate" return cont | 93d356448592d11a5bba0f5c8e4d1be47b9caa65 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7420/93d356448592d11a5bba0f5c8e4d1be47b9caa65/glyphs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1853,
4293,
13332,
468,
425,
750,
225,
468,
1021,
1284,
1460,
287,
1725,
2537,
1914,
389,
16431,
67,
4906,
26838,
17,
5625,
24106,
468,
358,
3724,
15390,
24755,
1450,
29876,
993,
16,
1427,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1853,
4293,
13332,
468,
425,
750,
225,
468,
1021,
1284,
1460,
287,
1725,
2537,
1914,
389,
16431,
67,
4906,
26838,
17,
5625,
24106,
468,
358,
3724,
15390,
24755,
1450,
29876,
993,
16,
1427,... |
self.logging.warning( \ | logging.warning( \ | def applySelectionPolicy(self, fileList, parameters, forceMerge = False): """ _applySelectionPolicy_ | 6f0af9850debeae251b2bf717f1d2c06f14d3929 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8887/6f0af9850debeae251b2bf717f1d2c06f14d3929/SizePolicy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
6233,
2582,
12,
2890,
16,
18645,
16,
1472,
16,
2944,
6786,
273,
1083,
4672,
3536,
389,
9010,
6233,
2582,
67,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
6233,
2582,
12,
2890,
16,
18645,
16,
1472,
16,
2944,
6786,
273,
1083,
4672,
3536,
389,
9010,
6233,
2582,
67,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
self._num_files = (len([d for d in self.valdocs if isinstance(d, ClassDoc)]) + 2*len([d for d in self.valdocs if isinstance(d, ModuleDoc)]) + 9) | self._num_files = len(self.class_list) + 2*len(self.module_list) + 9 | def __init__(self, docindex, **kwargs): """ Construct a new HTML writer, using the given documentation index. @param docmap: The documentation index. @type prj_name: C{string} @keyword prj_name: The name of the project. Defaults to none. @type prj_url: C{string} @keyword prj_url: The target for the project hopeage link on the navigation bar. If C{prj_url} is not specified, then no hyperlink is created. @type prj_link: C{string} @keyword prj_link: The label for the project link on the navigation bar. This link can contain arbitrary HTML code (e.g. images). By default, a label is constructed from C{prj_name}. @type top_page: C{string} @keyword top_page: The top page for the documentation. This is the default page shown main frame, when frames are enabled. C{top} can be a URL, the name of a module, the name of a class, or one of the special strings C{"trees.html"}, C{"indices.html"}, or C{"help.html"}. By default, the top-level package or module is used, if there is one; otherwise, C{"trees"} is used. @type css: C{string} @keyword css: The CSS stylesheet file. If C{css} is a file name, then the specified file's conents will be used. Otherwise, if C{css} is the name of a CSS stylesheet in L{epydoc.docwriter.html_css}, then that stylesheet will be used. Otherwise, an error is reported. If no stylesheet is specified, then the default stylesheet is used. @type help_file: C{string} @keyword help_file: The name of the help file. If no help file is specified, then the default help file will be used. @type show_private: C{boolean} @keyword show_private: Whether to create documentation for private objects. By default, private objects are documented. @type show_frames: C{boolean}) @keyword show_frames: Whether to create a frames-based table of contents. By default, it is produced. @type show_imports: C{boolean} @keyword show_imports: Whether or not to display lists of imported functions and classes. By default, they are not shown. @type variable_maxlines: C{int} @keyword variable_maxlines: The maximum number of lines that should be displayed for the value of a variable in the variable details section. By default, 8 lines are displayed. @type variable_linelength: C{int} @keyword variable_linelength: The maximum line length used for displaying the values of variables in the variable details sections. If a line is longer than this length, then it will be wrapped to the next line. The default line length is 70 characters. @type variable_summary_linelength: C{int} @keyword variable_summary_linelength: The maximum line length used for displaying the values of variables in the summary section. If a line is longer than this length, then it will be truncated. The default is 40 characters. @type variable_tooltip_linelength: C{int} @keyword variable_tooltip_linelength: The maximum line length used for tooltips for the values of variables. If a line is longer than this length, then it will be truncated. The default is 600 characters. @type property_function_linelength: C{int} @keyword property_function_linelength: The maximum line length used to dispaly property functions (C{fget}, C{fset}, and C{fdel}) that contain something other than a function object. The default length is 40 characters. @type inheritance: C{string} @keyword inheritance: How inherited objects should be displayed. If C{inheritance='grouped'}, then inherited objects are gathered into groups; if C{inheritance='listed'}, then inherited objects are listed in a short list at the end of their group; if C{inheritance='included'}, then inherited objects are mixed in with non-inherited objects. The default is 'grouped'. @type include_sourcecode: C{boolean} @param include_sourcecode: If true, then generate colorized source code files for each python module. """ self.docindex = docindex # Process keyword arguments. self._show_private = kwargs.get('show_private', 1) """Should private docs be included?""" | 28d88ae14617650a4a829fae94668100dc4e2b05 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/28d88ae14617650a4a829fae94668100dc4e2b05/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
997,
1615,
16,
2826,
4333,
4672,
3536,
14291,
279,
394,
3982,
2633,
16,
1450,
326,
864,
7323,
770,
18,
225,
632,
891,
997,
1458,
30,
1021,
7323,
770,
18,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
997,
1615,
16,
2826,
4333,
4672,
3536,
14291,
279,
394,
3982,
2633,
16,
1450,
326,
864,
7323,
770,
18,
225,
632,
891,
997,
1458,
30,
1021,
7323,
770,
18,... |
'cvv' : str(data.credit_card.ccv), | 'cvv' : data.credit_card.ccv, | def prepareData(self, data): self.order = data # See tclink developer's guide for additional fields and info # convert amount to cents, no decimal point amount = str(data.balance).replace ('.', '') | 9890d1fffb02d5878b8c2afce339223835517edf /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/171/9890d1fffb02d5878b8c2afce339223835517edf/processor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
751,
12,
2890,
16,
501,
4672,
365,
18,
1019,
273,
501,
468,
2164,
268,
830,
754,
8751,
1807,
7343,
364,
3312,
1466,
471,
1123,
468,
1765,
3844,
358,
276,
4877,
16,
1158,
6970,
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,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
751,
12,
2890,
16,
501,
4672,
365,
18,
1019,
273,
501,
468,
2164,
268,
830,
754,
8751,
1807,
7343,
364,
3312,
1466,
471,
1123,
468,
1765,
3844,
358,
276,
4877,
16,
1158,
6970,
16... |
sage: cmp(Mod(2,5), SR(3)) | sage: cmp(Mod(2,5), SR(3) ) | def __cmp__(self, right): """ Compares self and right. | 61570ec939f5d28f1d473a6111bc69678d16e9b5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/61570ec939f5d28f1d473a6111bc69678d16e9b5/calculus.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9625,
972,
12,
2890,
16,
2145,
4672,
3536,
5427,
4807,
365,
471,
2145,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9625,
972,
12,
2890,
16,
2145,
4672,
3536,
5427,
4807,
365,
471,
2145,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
SPEED_MIN = 16.0 SPEED_MAX = 40.0 | SPEED_MIN = 4.0 SPEED_MAX = 32.0 | def get_entry_pos(self, cell): col = cell % 8 x = col * CELL_SIZE + (CELL_SIZE - STONE_SIZE) y = CELL_SIZE * 8 - 8 * CELL_SIZE return (x, y) | 5374288475bdb9491fdf28b220a1945c185e1b42 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4842/5374288475bdb9491fdf28b220a1945c185e1b42/match3.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4099,
67,
917,
12,
2890,
16,
2484,
4672,
645,
273,
2484,
738,
1725,
619,
273,
645,
380,
385,
21943,
67,
4574,
397,
261,
27752,
67,
4574,
300,
2347,
5998,
67,
4574,
13,
677,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4099,
67,
917,
12,
2890,
16,
2484,
4672,
645,
273,
2484,
738,
1725,
619,
273,
645,
380,
385,
21943,
67,
4574,
397,
261,
27752,
67,
4574,
300,
2347,
5998,
67,
4574,
13,
677,
... |
node.type.element_type = self._resolve(element_type[0]) | node.type.element_type = self._resolve(element_type[0], parent) | def _apply_annotations_element_type(self, parent, node, options): element_type_opt = options.get(OPT_ELEMENT_TYPE) element_type = element_type_opt.flat() if isinstance(node.type, ast.List): assert len(element_type) == 1 node.type.element_type = self._resolve(element_type[0]) elif isinstance(node.type, ast.Map): assert len(element_type) == 2 node.type.key_type = self._resolve(element_type[0]) node.type.value_type = self._resolve(element_type[1]) elif isinstance(node.type, ast.Array): node.type.element_type = self._resolve(element_type[0]) else: message.warn_node(parent, "Unknown container %r for element-type annotation" % (node.type, )) | 4577bf1a7f6dc33d1ff566ae8d1360f1fde769f9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2770/4577bf1a7f6dc33d1ff566ae8d1360f1fde769f9/maintransformer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9010,
67,
14670,
67,
2956,
67,
723,
12,
2890,
16,
982,
16,
756,
16,
702,
4672,
930,
67,
723,
67,
3838,
273,
702,
18,
588,
12,
15620,
67,
10976,
67,
2399,
13,
930,
67,
723,
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,
389,
9010,
67,
14670,
67,
2956,
67,
723,
12,
2890,
16,
982,
16,
756,
16,
702,
4672,
930,
67,
723,
67,
3838,
273,
702,
18,
588,
12,
15620,
67,
10976,
67,
2399,
13,
930,
67,
723,
273... |
if cmd in seenCommands or \ | if cmd in commands or \ | def _getCommandsDict(self): if self._maxlevel is not None: self._console.debug('AUTODOC: get commands with level <= %s' % self._maxlevel) seenCommands = set() commands = [] for cmd in self._adminPlugin._commands.values(): if cmd in seenCommands or \ cmd.level is None: continue if self._maxlevel is not None and cmd.level[0] > self._maxlevel: continue #self._console.debug('AUTODOC: making command doc for %s'%cmd.command) seenCommands.add(cmd) tmp = {} tmp['name'] = cmd.prefix + cmd.command tmp['alias'] = "" if cmd.alias is not None and cmd.alias != '' : tmp['alias'] = cmd.prefix + cmd.alias tmp['plugin'] = re.sub('Plugin$', '', cmd.plugin.__class__.__name__) tmp['description'] = escape(cmd.help) tmp['minlevel'] = str(cmd.level[0]) tmp['maxlevel'] = str(cmd.level[1]) commands.append(tmp) def commands_compare(x, y): if x['plugin'] < y['plugin']: return -1 elif x['plugin'] > y['plugin']: return 1 | e1a456a8de09153e4665a25581eed6082374415d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12909/e1a456a8de09153e4665a25581eed6082374415d/documentationBuilder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
9127,
5014,
12,
2890,
4672,
309,
365,
6315,
1896,
2815,
353,
486,
599,
30,
365,
6315,
8698,
18,
4148,
2668,
37,
1693,
2311,
39,
30,
336,
4364,
598,
1801,
1648,
738,
87,
11,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
9127,
5014,
12,
2890,
4672,
309,
365,
6315,
1896,
2815,
353,
486,
599,
30,
365,
6315,
8698,
18,
4148,
2668,
37,
1693,
2311,
39,
30,
336,
4364,
598,
1801,
1648,
738,
87,
11,
... |
ans = self._rescale(exp_min, context.rounding) if ans != self: | digits = len(self._int) + self._exp - exp_min if digits < 0: self = _dec_from_triple(self._sign, '1', exp_min-1) digits = 0 this_function = getattr(self, self._pick_rounding_function[context.rounding]) changed = this_function(digits) coeff = self._int[:digits] or '0' if changed == 1: coeff = str(int(coeff)+1) ans = _dec_from_triple(self._sign, coeff, exp_min) if changed: | def _fix(self, context): """Round if it is necessary to keep self within prec precision. | 2ec7415db5ad63c4e4b27ee793214071454f6fe5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/2ec7415db5ad63c4e4b27ee793214071454f6fe5/decimal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
904,
12,
2890,
16,
819,
4672,
3536,
11066,
309,
518,
353,
4573,
358,
3455,
365,
3470,
13382,
6039,
18,
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,
389,
904,
12,
2890,
16,
819,
4672,
3536,
11066,
309,
518,
353,
4573,
358,
3455,
365,
3470,
13382,
6039,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
def _filter_svn(self, line): return (Logger.INFO, line) | def untar_file(self, filename, location): """Untar the file (tar file located at filename) to the destination location""" if not os.path.exists(location): os.makedirs(location) if filename.lower().endswith('.gz') or filename.lower().endswith('.tgz'): mode = 'r:gz' elif filename.lower().endswith('.bz2'): mode = 'r:bz2' elif filename.lower().endswith('.tar'): mode = 'r' else: logger.warn('Cannot determine compression type for file %s' % filename) mode = 'r:*' tar = tarfile.open(filename, mode) try: leading = has_leading_dir([member.name for member in tar.getmembers()]) for member in tar.getmembers(): fn = member.name if leading: fn = split_leading_dir(fn)[1] path = os.path.join(location, fn) if member.isdir(): if not os.path.exists(path): os.makedirs(path) else: try: fp = tar.extractfile(member) except KeyError, e: # Some corrupt tar files seem to produce this # (specifically bad symlinks) logger.warn( 'In the tar file %s the member %s is invalid: %s' % (filename, member.name, e)) continue if not os.path.exists(os.path.dirname(path)): os.makedirs(os.path.dirname(path)) destfp = open(path, 'wb') try: shutil.copyfileobj(fp, destfp) finally: destfp.close() fp.close() finally: tar.close() | 404ce4d68b7ccae8baf7b8e9c98d76c7210aa5aa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12982/404ce4d68b7ccae8baf7b8e9c98d76c7210aa5aa/pip.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
640,
11718,
67,
768,
12,
2890,
16,
1544,
16,
2117,
4672,
3536,
57,
496,
297,
326,
585,
261,
11718,
585,
13801,
622,
1544,
13,
358,
326,
2929,
2117,
8395,
309,
486,
1140,
18,
803,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
640,
11718,
67,
768,
12,
2890,
16,
1544,
16,
2117,
4672,
3536,
57,
496,
297,
326,
585,
261,
11718,
585,
13801,
622,
1544,
13,
358,
326,
2929,
2117,
8395,
309,
486,
1140,
18,
803,
18,
... | |
self.modifySeparateAction.setIconSet(QIconSet(self.image51)) | self.modifySeparateAction.setIconSet(QIconSet(self.image47)) | def __init__(self,parent = None,name = None,fl = 0): QMainWindow.__init__(self,parent,name,fl) self.statusBar() | 2bdc60455ab85cd2792604c15ae9034d3632b0df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/2bdc60455ab85cd2792604c15ae9034d3632b0df/MainWindowUI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2938,
273,
599,
16,
529,
273,
599,
16,
2242,
273,
374,
4672,
2238,
6376,
3829,
16186,
2738,
972,
12,
2890,
16,
2938,
16,
529,
16,
2242,
13,
365,
18,
23... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2938,
273,
599,
16,
529,
273,
599,
16,
2242,
273,
374,
4672,
2238,
6376,
3829,
16186,
2738,
972,
12,
2890,
16,
2938,
16,
529,
16,
2242,
13,
365,
18,
23... |
headers = {"Content-type": "application/x-www-form-urlencoded", "User-agent" : "WikipediaFS"} conn = ExtendedHTTPConnection(self.host, self.port, self.https) if self.httpauth_username and self.httpauth_password: conn.http_auth(self.httpauth_username, self.httpauth_password) | def getCookieString(self): """ Gets user's cookie string. It will then have to be passed to an Article. """ | 8053783209194a2f333bce2e624aaa02c0d8a987 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11461/8053783209194a2f333bce2e624aaa02c0d8a987/user.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24643,
780,
12,
2890,
4672,
3536,
11881,
729,
1807,
3878,
533,
18,
2597,
903,
1508,
1240,
358,
506,
2275,
358,
392,
17889,
18,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24643,
780,
12,
2890,
4672,
3536,
11881,
729,
1807,
3878,
533,
18,
2597,
903,
1508,
1240,
358,
506,
2275,
358,
392,
17889,
18,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
ts.get_available_actions(self.req, | self._ts_get_available_actions(ts, | def test_available_actions_chgprop_only(self): # CHGPROP is not enough for changing a ticket's state (#3289) ts = TicketSystem(self.env) self.perm.grant_permission('anonymous', 'TICKET_CHGPROP') self.req.perm = perm.PermissionCache(self.env) self.assertEqual(['leave'], ts.get_available_actions(self.req, {'status': 'new'})) self.assertEqual(['leave'], ts.get_available_actions(self.req, {'status': 'assigned'})) self.assertEqual(['leave'], ts.get_available_actions(self.req, {'status': 'accepted'})) self.assertEqual(['leave'], ts.get_available_actions(self.req, {'status': 'reopened'})) self.assertEqual(['leave'], ts.get_available_actions(self.req, {'status': 'closed'})) | 4b1c974fc51a3689f934bd513f21feadc4fe0a2a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9317/4b1c974fc51a3689f934bd513f21feadc4fe0a2a/api.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5699,
67,
4905,
67,
343,
75,
5986,
67,
3700,
12,
2890,
4672,
468,
6469,
43,
15811,
353,
486,
7304,
364,
12770,
279,
9322,
1807,
919,
23885,
1578,
6675,
13,
3742,
273,
22023,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5699,
67,
4905,
67,
343,
75,
5986,
67,
3700,
12,
2890,
4672,
468,
6469,
43,
15811,
353,
486,
7304,
364,
12770,
279,
9322,
1807,
919,
23885,
1578,
6675,
13,
3742,
273,
22023,
... |
dprint("index=%d, before: %d" % (index, self.GetNumLists())) | self.dprint("index=%d, before: %d" % (index, self.GetNumLists())) self.viewing = index | def DeleteAfter(self, index): dprint("index=%d, before: %d" % (index, self.GetNumLists())) index += 1 while index < self.GetNumLists(): self.DeleteList(index) dprint("after: %d" % self.GetNumLists()) self.resetSize() | 83d6f4a718588b9b4fd3dc0b49383aaa47f1ca47 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11522/83d6f4a718588b9b4fd3dc0b49383aaa47f1ca47/nextpanel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2504,
4436,
12,
2890,
16,
770,
4672,
365,
18,
72,
1188,
2932,
1615,
5095,
72,
16,
1865,
30,
738,
72,
6,
738,
261,
1615,
16,
365,
18,
967,
2578,
7432,
1435,
3719,
365,
18,
1945,
310,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2504,
4436,
12,
2890,
16,
770,
4672,
365,
18,
72,
1188,
2932,
1615,
5095,
72,
16,
1865,
30,
738,
72,
6,
738,
261,
1615,
16,
365,
18,
967,
2578,
7432,
1435,
3719,
365,
18,
1945,
310,
... |
"""Draws a string right-aligned with the y coordinate. I | """Draws a string right-aligned with the x coordinate. I | def drawCentredString(self, x, y, text): """Draws a string right-aligned with the y coordinate. I am British so the spelling is correct, OK?""" width = self.stringWidth(text, self._fontname, self._fontsize) t = self.beginText(x - 0.5*width, y) t.textLine(text) self.drawText(t) | af52461e47fce33b697e3ddb31add12d77d0f534 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/af52461e47fce33b697e3ddb31add12d77d0f534/canvas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
15897,
1118,
780,
12,
2890,
16,
619,
16,
677,
16,
977,
4672,
3536,
25113,
279,
533,
2145,
17,
20677,
598,
326,
619,
7799,
18,
225,
467,
2125,
605,
583,
1468,
1427,
326,
22377,
31... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
15897,
1118,
780,
12,
2890,
16,
619,
16,
677,
16,
977,
4672,
3536,
25113,
279,
533,
2145,
17,
20677,
598,
326,
619,
7799,
18,
225,
467,
2125,
605,
583,
1468,
1427,
326,
22377,
31... |
if hue<0.0: hue=0.0 if hue>1.0: hue=1.0 return colorsys.hsv_to_rgb(0.667-0.677*hue, saturation, value) | hue = 0.666*(1.0-hue) if hue < 0.0: hue = 0.0 if hue > 0.666: hue = 0.666 return colorsys.hsv_to_rgb(hue, saturation, value) | def getRainbowColor(self, hue, saturation, value): """ Gets a color of a hue range limited to 0 - 0.667 (red - blue) """ if hue<0.0: hue=0.0 if hue>1.0: hue=1.0 return colorsys.hsv_to_rgb(0.667-0.677*hue, saturation, value) | 1ea3d0895e8c6154e79ed08bf2c7d573e1a134cd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/1ea3d0895e8c6154e79ed08bf2c7d573e1a134cd/DnaCylinderChunks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4170,
530,
70,
543,
2957,
12,
2890,
16,
16846,
16,
22824,
16,
460,
4672,
3536,
11881,
279,
2036,
434,
279,
16846,
1048,
13594,
358,
374,
300,
374,
18,
6028,
27,
261,
1118,
300,
8024,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4170,
530,
70,
543,
2957,
12,
2890,
16,
16846,
16,
22824,
16,
460,
4672,
3536,
11881,
279,
2036,
434,
279,
16846,
1048,
13594,
358,
374,
300,
374,
18,
6028,
27,
261,
1118,
300,
8024,
1... |
A->A B->G C->A D->G E->G F->A G->G H->G I->A J->G K->A L->A M->G | A->A B->G C->A D->G E->G F->A G->G H->G I->A J->G K->A L->A M->G | ... def __str__(self): | 7bada064f17fe94764857ba822d8ce942b636aca /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/7bada064f17fe94764857ba822d8ce942b636aca/test_generators.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1372,
377,
1652,
1001,
701,
972,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1372,
377,
1652,
1001,
701,
972,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
def _class_tree_item(self, uid, filter_private, depth=0): """ Helper function for L{_write_class_tree}. """ if uid is None: return if filter_private and uid.is_private(): return '' doc = self._docmap.get(uid, None) str = ' '*depth + '<li> <b>' + self._uid_to_href(uid)+'</b>' if doc and doc.descr(): str += ': <i>' + self._summary(doc, uid) + '</i>' str += '\n' if doc and doc.subclasses(): str += ' '*depth + ' <ul>\n' children = [l.target() for l in doc.subclasses()] if filter_private: children = [c for c in children if c.is_public()] for child in children: str += self._class_tree_item(child, filter_private, depth+4) str += ' '*depth + ' </ul>\n' return str | def _base_tree(self, uid, width=None, postfix=''): """ @return: The HTML code for a class's base tree. The tree is drawn 'upside-down' and right justified, to allow for multiple inheritance. @rtype: C{string} """ if not self._docmap.has_key(uid): return '' if width == None: width = self._find_tree_width(uid) bases = self._docmap[uid].bases() if postfix == '': str = ' '*(width-2) + '<b>'+uid.shortname()+'</b>\n' else: str = '' for i in range(len(bases)-1, -1, -1): base = bases[i] str = (' '*(width-4-len(base.name())) + self._link_to_html(base)+' --+'+postfix+'\n' + ' '*(width-4) + ' |'+postfix+'\n' + str) (t,w) = (base.target(), width) if i != 0: str = (self._base_tree(t, w-4, ' |'+postfix)+str) else: str = (self._base_tree(t, w-4, ' '+postfix)+str) ss = re.sub('<[^<>]+>','',str) return str | dad6dd09c82d3878a78d977cc13da79d4420db2b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/dad6dd09c82d3878a78d977cc13da79d4420db2b/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1969,
67,
3413,
12,
2890,
16,
4555,
16,
1835,
33,
7036,
16,
18923,
2218,
11,
4672,
3536,
632,
2463,
30,
1021,
3982,
981,
364,
279,
667,
1807,
1026,
2151,
18,
225,
1021,
2151,
353,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1969,
67,
3413,
12,
2890,
16,
4555,
16,
1835,
33,
7036,
16,
18923,
2218,
11,
4672,
3536,
632,
2463,
30,
1021,
3982,
981,
364,
279,
667,
1807,
1026,
2151,
18,
225,
1021,
2151,
353,... | |
mtype = "x-bit" | mtype = "%s-bit" % self.unknown | def machinearch(self): output = os.uname()[4] if output == "x86_64": mtype = "64-bit" elif re.match(r'i686|i386', output): mtype = "32-bit" else: mtype = "x-bit" return mtype | 20fb39d86c935c862264737a61758ade376031d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13895/20fb39d86c935c862264737a61758ade376031d3/ubuntu-gr_forum_signature.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5228,
991,
12,
2890,
4672,
876,
273,
1140,
18,
318,
339,
1435,
63,
24,
65,
309,
876,
422,
315,
92,
5292,
67,
1105,
6877,
22189,
273,
315,
1105,
17,
3682,
6,
1327,
283,
18,
1916,
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,
5228,
991,
12,
2890,
4672,
876,
273,
1140,
18,
318,
339,
1435,
63,
24,
65,
309,
876,
422,
315,
92,
5292,
67,
1105,
6877,
22189,
273,
315,
1105,
17,
3682,
6,
1327,
283,
18,
1916,
12,
... |
if config.zero: | if config.zero and chart_min-config.y_margin[0] < 0: | def render(self,data={}, context={}): | aa992bf3c3c1db05a456ad854df1f14f6a93471d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3323/aa992bf3c3c1db05a456ad854df1f14f6a93471d/chart.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
892,
28793,
819,
12938,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
892,
28793,
819,
12938,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
config.addOption('heartbeat_frequence', '30', "Heartbeat frequence config variable") | config.addOption('heartbeat_frequency', '30', "Heartbeat frequency config variable") | def get_status(f): """Give (pid,queue,actualCE,exit code) for job""" | 3af82b6a79c2651ff8f255bf7f969dad33937543 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1488/3af82b6a79c2651ff8f255bf7f969dad33937543/Batch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2327,
12,
74,
4672,
3536,
43,
688,
261,
6610,
16,
4000,
16,
18672,
1441,
16,
8593,
981,
13,
364,
1719,
8395,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2327,
12,
74,
4672,
3536,
43,
688,
261,
6610,
16,
4000,
16,
18672,
1441,
16,
8593,
981,
13,
364,
1719,
8395,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
track.roads[1].add_car(Car([], track.roads[2]), 80) track.roads[1].add_car(Car([], track.roads[1]), 30) track.roads[1].add_car(Car([], track.roads[1]), 130) | track.roads[6].add_car(Car([], track.roads[6]), 500) track.roads[6].add_car(Car([], track.roads[6]), 30) track.roads[6].add_car(Car([], track.roads[6]), 10) | def update(self, rang): """ Updates the car speed and position, manages blocked pathways and queues. rang (int) : position on the road (0 : last in) """ | 9c3560fdc6a72ed356876ee059ee66056da32e76 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4798/9c3560fdc6a72ed356876ee059ee66056da32e76/init.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
16,
436,
539,
4672,
3536,
15419,
326,
5926,
8632,
471,
1754,
16,
20754,
281,
14547,
589,
3052,
471,
11897,
18,
436,
539,
565,
261,
474,
13,
282,
294,
282,
1754,
603,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1089,
12,
2890,
16,
436,
539,
4672,
3536,
15419,
326,
5926,
8632,
471,
1754,
16,
20754,
281,
14547,
589,
3052,
471,
11897,
18,
436,
539,
565,
261,
474,
13,
282,
294,
282,
1754,
603,
32... |
if v not in verts: verts.append(v) | if v not in verts: verts.add(v) | def __init__(self, data=None, pos=None, loops=None, format=None, boundary=[], weighted=None, implementation='networkx', sparse=True, vertex_labels=True, **kwds): """ TESTS:: | f18927082f20c274175cdc4b0faac157e1c0a697 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/f18927082f20c274175cdc4b0faac157e1c0a697/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
501,
33,
7036,
16,
949,
33,
7036,
16,
14075,
33,
7036,
16,
740,
33,
7036,
16,
7679,
22850,
6487,
13747,
33,
7036,
16,
4471,
2218,
5185,
92,
2187,
9387,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
501,
33,
7036,
16,
949,
33,
7036,
16,
14075,
33,
7036,
16,
740,
33,
7036,
16,
7679,
22850,
6487,
13747,
33,
7036,
16,
4471,
2218,
5185,
92,
2187,
9387,
... |
'title:Dysfunction or author:Laurie': set([348, 444]), | 'title:Dysfunction OR author:Laurie': set([348, 444]), | def universal_set(self): ''' Should return the set of all matches. ''' return set([]) | e4b0e9f5186874eac5b874627e01d8e31d865487 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/e4b0e9f5186874eac5b874627e01d8e31d865487/search_query_parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26182,
67,
542,
12,
2890,
4672,
9163,
9363,
327,
326,
444,
434,
777,
1885,
18,
9163,
327,
444,
3816,
5717,
225,
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,
26182,
67,
542,
12,
2890,
4672,
9163,
9363,
327,
326,
444,
434,
777,
1885,
18,
9163,
327,
444,
3816,
5717,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
context) | context) | def check_type(field_type): if field_type == 'float': return 0.0 elif field_type == 'integer': return 0 elif field_type == 'boolean': return False return '' | 19c6bf3cbf9c418ef8f4c3664582e8a20fbf6749 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/19c6bf3cbf9c418ef8f4c3664582e8a20fbf6749/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
723,
12,
1518,
67,
723,
4672,
309,
652,
67,
723,
422,
296,
5659,
4278,
327,
374,
18,
20,
1327,
652,
67,
723,
422,
296,
7745,
4278,
327,
374,
1327,
652,
67,
723,
422,
296,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
723,
12,
1518,
67,
723,
4672,
309,
652,
67,
723,
422,
296,
5659,
4278,
327,
374,
18,
20,
1327,
652,
67,
723,
422,
296,
7745,
4278,
327,
374,
1327,
652,
67,
723,
422,
296,
... |
elif hasattr(self, 'undocheck') and self.undocheck.GetValue(): Globals.options.undo = 'check' | elif hasattr(self, 'undoRepair') and self.undoRepair.GetValue(): Globals.options.undo = 'repair' | def onButton(self, event): buttonID = event.GetEventObject().GetId() if hasattr(self, 'create'): Globals.options.create = self.create.GetValue() if hasattr(self, 'refreshui') and self.refreshui.GetValue(): Globals.options.refreshui = True Globals.options.repair = True Globals.options.recover = True | 0cb12456c7e35abfe84ac89d67e91e44b70a77a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/0cb12456c7e35abfe84ac89d67e91e44b70a77a1/StartupOptionsDialog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
3616,
12,
2890,
16,
871,
4672,
3568,
734,
273,
871,
18,
967,
1133,
921,
7675,
967,
548,
1435,
309,
3859,
12,
2890,
16,
296,
2640,
11,
4672,
18901,
1031,
18,
2116,
18,
2640,
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,
603,
3616,
12,
2890,
16,
871,
4672,
3568,
734,
273,
871,
18,
967,
1133,
921,
7675,
967,
548,
1435,
309,
3859,
12,
2890,
16,
296,
2640,
11,
4672,
18901,
1031,
18,
2116,
18,
2640,
273,
... |
runs.append((p, n)) | runsappend((p, n)) | def _optimize_charset(charset, fixup): # internal: optimize character set out = [] charmap = [False]*256 try: for op, av in charset: if op is NEGATE: out.append((op, av)) elif op is LITERAL: charmap[fixup(av)] = True elif op is RANGE: for i in range(fixup(av[0]), fixup(av[1])+1): charmap[i] = True elif op is CATEGORY: # XXX: could append to charmap tail return charset # cannot compress except IndexError: # character set contains unicode characters return _optimize_unicode(charset, fixup) # compress character map i = p = n = 0 runs = [] for c in charmap: if c: if n == 0: p = i n = n + 1 elif n: runs.append((p, n)) n = 0 i = i + 1 if n: runs.append((p, n)) if len(runs) <= 2: # use literal/range for p, n in runs: if n == 1: out.append((LITERAL, p)) else: out.append((RANGE, (p, p+n-1))) if len(out) < len(charset): return out else: # use bitmap data = _mk_bitmap(charmap) out.append((CHARSET, data)) return out return charset | 01c9f8c35f583338e3638906ceeef9d2f29a0254 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/01c9f8c35f583338e3638906ceeef9d2f29a0254/sre_compile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
29155,
67,
9999,
12,
9999,
16,
2917,
416,
4672,
468,
2713,
30,
10979,
3351,
444,
596,
273,
5378,
1149,
1458,
273,
306,
8381,
5772,
5034,
775,
30,
364,
1061,
16,
1712,
316,
4856,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
29155,
67,
9999,
12,
9999,
16,
2917,
416,
4672,
468,
2713,
30,
10979,
3351,
444,
596,
273,
5378,
1149,
1458,
273,
306,
8381,
5772,
5034,
775,
30,
364,
1061,
16,
1712,
316,
4856,
3... |
change = '0' | if default_lastchange and os.path.exists(default_lastchange): change = open(default_lastchange, 'r').read().strip() else: change = '0' | def fetch_change(): """ Returns the last change, from some appropriate revision control system. """ change = svn_fetch_revision() if not change and sys.platform in ('linux2',): change = git_fetch_id() if not change: change = '0' return change | 618c071b507f071ebb5591e4427f2d63b4fab538 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/618c071b507f071ebb5591e4427f2d63b4fab538/lastchange.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2158,
67,
3427,
13332,
3536,
2860,
326,
1142,
2549,
16,
628,
2690,
5505,
6350,
3325,
2619,
18,
3536,
2549,
273,
5893,
82,
67,
5754,
67,
13057,
1435,
309,
486,
2549,
471,
2589,
18,
9898,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2158,
67,
3427,
13332,
3536,
2860,
326,
1142,
2549,
16,
628,
2690,
5505,
6350,
3325,
2619,
18,
3536,
2549,
273,
5893,
82,
67,
5754,
67,
13057,
1435,
309,
486,
2549,
471,
2589,
18,
9898,
... |
if text.split(" ")[1] and text.split(" ")[1] == "ping": | if text.split(" ")[1] and text.split(" ")[1] == "top5": | def on_pubmsg(self, connection, event): text = event.arguments()[0] # Debugging output print "SOURCE: " + event.source(); print "TARGET: " + event.target(); for argument in event.arguments(): print argument + ", " | c98afd114e16d9434b6721543959cdcc2656dfda /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11257/c98afd114e16d9434b6721543959cdcc2656dfda/PieRC_Bot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
10174,
3576,
12,
2890,
16,
1459,
16,
871,
4672,
977,
273,
871,
18,
7099,
1435,
63,
20,
65,
225,
468,
4015,
1998,
876,
1172,
315,
6537,
30,
315,
397,
871,
18,
3168,
5621,
117... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
10174,
3576,
12,
2890,
16,
1459,
16,
871,
4672,
977,
273,
871,
18,
7099,
1435,
63,
20,
65,
225,
468,
4015,
1998,
876,
1172,
315,
6537,
30,
315,
397,
871,
18,
3168,
5621,
117... |
try: xfsz = signal.SIFXFSZ except AttributeError: pass else: signal.signal(xfsz, signal.SIG_IGN) signal.signal(signal.SIGTERM, lambda sig, frame: shutdown(storages)) signal.signal(signal.SIGHUP, lambda sig, frame: shutdown(storages, 0)) try: | if hasattr(signal, 'SIGXFSZ'): signal.signal(signal.SIGXFSZ, signal.SIG_IGN) if hasattr(signal, 'SIGTERM'): signal.signal(signal.SIGTERM, lambda sig, frame: shutdown(storages)) if hasattr(signal, 'SIGHUP'): signal.signal(signal.SIGHUP, lambda sig, frame: shutdown(storages, 0)) if hasattr(signal, 'SIGUSR2'): | def setup_signals(storages): try: import signal except ImportError: return try: xfsz = signal.SIFXFSZ except AttributeError: pass else: signal.signal(xfsz, signal.SIG_IGN) signal.signal(signal.SIGTERM, lambda sig, frame: shutdown(storages)) signal.signal(signal.SIGHUP, lambda sig, frame: shutdown(storages, 0)) try: signal.signal(signal.SIGUSR2, rotate_logs_handler) except: pass | 6827c2809d8f5e12cd2e9e16d948fed3d3d6c8d3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/6827c2809d8f5e12cd2e9e16d948fed3d3d6c8d3/start.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
67,
29659,
12,
334,
280,
1023,
4672,
775,
30,
1930,
4277,
1335,
11308,
30,
327,
225,
309,
3859,
12,
10420,
16,
296,
18513,
60,
4931,
62,
11,
4672,
4277,
18,
10420,
12,
10420,
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,
67,
29659,
12,
334,
280,
1023,
4672,
775,
30,
1930,
4277,
1335,
11308,
30,
327,
225,
309,
3859,
12,
10420,
16,
296,
18513,
60,
4931,
62,
11,
4672,
4277,
18,
10420,
12,
10420,
18,... |
if widget.get_active() == False: return True | if widget != None: if widget.get_active() == False: return True | def online(self, widget, data=None): if widget.get_active() == False: return True # Disable changing username and passwd before login. self.e_user.set_editable(False) self.e_passwd.set_editable(False) # Get account information. self.account[0] = self.e_user.get_text() self.account[2] = self.e_passwd.get_text() self.account[3] = self.e_server.get_text() casnetconf.ops['-u'] = self.account[0] casnetconf.ops['-d'] = self.account[1] casnetconf.ops['-p'] = self.account[2] casnetconf.ops['-ip'] = self.account[3] casnetconf.ops['-m'] = self.account[4] casnetconf.ops['-r'] = self.account[5] casnetconf.ops['-a'] = self.account[6] casnetconf.ops['-ar'] = self.account[7] casnetconf.ops['-al'] = self.account[8] # Store account information to account file. casnetconf.write_ops() # Login (ret, retstr) = casnet.login(self.account) if ret == False: self.pop_dialog('登录错误', retstr) return False # Online (ret, retstr) = casnet.online(self.account[4]) if ret == False and retstr.find('Online at other IP!') != -1: casnet.forceoff(self.account) (ret, retstr) = casnet.login(self.account) if ret == False: self.pop_dialog('连线错误', retstr) self.status = 0 return False # Auto reconnect. if self.account[7] == '1' and self.ar_thread == None: self.ar_thread = ARThread(self) self.ar_thread.start() self.status = 1 # Get account statistics information. self.stat(None, None) self.b_offline.set_active(False) return True | 57715c99c1b54a438ee666fe6ad9a72d368d3b47 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4851/57715c99c1b54a438ee666fe6ad9a72d368d3b47/casnet-gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12365,
12,
2890,
16,
3604,
16,
501,
33,
7036,
4672,
309,
3604,
480,
599,
30,
309,
3604,
18,
588,
67,
3535,
1435,
422,
1083,
30,
327,
1053,
468,
10639,
12770,
2718,
471,
19093,
1865,
39... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12365,
12,
2890,
16,
3604,
16,
501,
33,
7036,
4672,
309,
3604,
480,
599,
30,
309,
3604,
18,
588,
67,
3535,
1435,
422,
1083,
30,
327,
1053,
468,
10639,
12770,
2718,
471,
19093,
1865,
39... |
include "meta.rnc" | include "meta-vnu.rnc" | def buildSchemaDrivers(): schemaDir = os.path.join(buildRoot, "syntax", "relaxng") legacyRnc = os.path.join(os.path.join(buildRoot, "validator", "schema", "legacy", "legacy.rnc")) buildSchemaDriverHtmlCore(schemaDir) buildSchemaDriverHtml5(schemaDir) buildSchemaDriverHtml5Aria(schemaDir) buildSchemaDriverXhtmlCore(schemaDir) buildSchemaDriverXhtmlCorePlusWf2(schemaDir) buildSchemaDriverXhtml5html(schemaDir) buildSchemaDriverXhtml5xhtml(schemaDir) buildSchemaDriverXhtml5Aria(schemaDir) removeIfExists(os.path.join(schemaDir, "legacy.rnc")) shutil.copy(legacyRnc, schemaDir) | 4a26bd57c8e08fc6534bdd1e7fe1602267bc04ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13711/4a26bd57c8e08fc6534bdd1e7fe1602267bc04ea/build.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
3078,
26310,
13332,
1963,
1621,
273,
1140,
18,
803,
18,
5701,
12,
3510,
2375,
16,
315,
14308,
3113,
315,
2878,
651,
3368,
7923,
8866,
54,
14202,
273,
1140,
18,
803,
18,
5701,
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,
1361,
3078,
26310,
13332,
1963,
1621,
273,
1140,
18,
803,
18,
5701,
12,
3510,
2375,
16,
315,
14308,
3113,
315,
2878,
651,
3368,
7923,
8866,
54,
14202,
273,
1140,
18,
803,
18,
5701,
12,
... |
vtx.append([matrix*vert.co,vert.normal]) | vtx.append([vert.co*matrix,vert.normal]) | def export_msh(filepath,convert_coords): nonormal=False if os.path.splitext(filepath)[1]=="": filepath=filepath+".msh" file=open(filepath,"w") file.write("MSHX1\n") ngroups=0 for obj in bpy.context.selected_objects: if obj.type=='MESH': ngroups=ngroups+1 file.write("GROUPS {}\n".format(ngroups)) mtrls={} txtrs={} for obj in bpy.context.selected_objects: if obj.type=='MESH': matrix=obj.matrix_world me=obj.data n=0 vtx=[] faces=[] file.write("LABEL {}\n".format(obj.name)) # Adding materials and textures if len(obj.material_slots)!=0: mat=obj.material_slots[0].material if not (mat.name in mtrls): print("Mew material:",mat.name) mtrls[mat.name]=len(mtrls) file.write("MATERIAL {}\n".format(mtrls[mat.name]+1)) #.msh material idxs start from 1 if mat.texture_slots[0]!=None: tex=mat.texture_slots[0].texture if tex.type=="IMAGE": #Texture type must be image if not(tex.name in txtrs): print("New texture:",tex.name) txtrs[tex.name]=len(txtrs) file.write("TEXTURE {}\n".format(txtrs[tex.name]+1))#.msh tex idxs start from 1 else: print("Non-image texture") file.write("TEXTURE 0\n") else: #no tex slots in material file.write("TEXTURE 0\n") else: #no material slots in mesh object file.write("MATERIAL 0\n") #preparing vertices array: coords and normal for vert in me.vertices: vtx.append([matrix*vert.co,vert.normal]) has_uv=True; if len(me.uv_textures)==0: has_uv=False; print("Mesh ",obj.name,"has not UV map" ) #Creating faces array and finishing vtx array with UVs for n in range(len(me.faces)): face=me.faces[n] if has_uv:# 3 UVs changeface=False fc=[]#face to add for i in range(len(face.vertices)): uvs=me.uv_textures[0].data[n].uv_raw[(2*i):(2*i+2)] idx_vert=face.vertices[i] if len(vtx[idx_vert])==2: #no UVs yet, add idx_vert to fc and uvs to vert vtx[idx_vert].append(uvs) fc.append(idx_vert) else: if vtx[idx_vert][2]==uvs:#UVs are equal, just add idx_vert to fc #print("uvs equal") fc.append(idx_vert) else: #uvs differ, add new vtx and use new idx_vert vtx.append([vtx[idx_vert][0],vtx[idx_vert][1],uvs]) fc.append(len(vtx)-1) #Add resulting fc faces.append(fc[:3]) if len(fc)==4: faces.append([fc[2],fc[3],fc[0]]) else:#export just faces without uv faces.append(face.vertices[:3]) #first (or alone) triangle if len(face.vertices)==4: #2nd triangle if face is quad #print("!!!tetragon!!!") faces.append([face.vertices[2],face.vertices[3],face.vertices[0]]) #else: # print("triangle") print("====Mesh Geometry Summary====") if VERBOSE_OUT: for v in vtx: print(v) print("---") print(faces) print("vtx: ",len(vtx)," faces:",len(faces)) #write GEOM section if nonormal: file.write("NONORMAL\n") file.write("GEOM {} {}\n".format(len(vtx),len(faces))) if convert_coords: for v in vtx: file.write("{} {} {}".format(-v[0][0],v[0][2],-v[0][1])) if not nonormal: #I think normal coords should be converted too file.write(" {} {} {}".format(-v[1][0],v[1][2],-v[1][1])) if has_uv: file.write(" {} {}".format(v[2][0],1-v[2][1])) file.write("\n") for f in faces: file.write("{} {} {}\n".format(f[0],f[2],f[1])) else: for v in vtx: file.write("{} {} {}".format(v[0][0],v[0][1],v[0][2])) if not nonormal: file.write(" {} {} {}".format(v[1][0],v[1][1],v[1][2])) if has_uv: file.write(" {} {}".format(v[2][0],1-v[2][1])) file.write("\n") for f in faces: file.write("{} {} {}\n".format(f[0],f[1],f[2])) #write other sections print("===Materials summary====") print(mtrls) print("===Textures summary=====") print(txtrs) #===Write MATERIALS section===== file.write("MATERIALS {}\n".format(len(mtrls))) #just mtrls sorted by values temp_m=sorted(mtrls.items(),key=lambda x: x[1]) for m in temp_m: file.write("{}\n".format(m[0])) for m in temp_m: file.write("MATERIAL {}\n".format(m[0])) mat=bpy.data.materials[m[0]] dc=mat.diffuse_color file.write("{} {} {} {}\n".format(dc[0],dc[1],dc[2],mat.alpha)) file.write("{} {} {} {}\n".format(dc[0],dc[1],dc[2],mat.alpha)) sc=mat.specular_color file.write("{} {} {} {} {}\n".format(sc[0],sc[1],sc[2],mat.specular_alpha,mat.specular_hardness)) file.write("{} {} {} {}\n".format(dc[0]*mat.emit,dc[1]*mat.emit,dc[2]*mat.emit,mat.alpha)) #=====Write TEXTURES section ====== file.write("TEXTURES {}\n".format(len(txtrs))) v=os.path.split(filepath) mshdir=v[0] mshname=os.path.splitext(v[1])[0] texdir=mshname+"tex" texpath=os.path.join(mshdir,texdir) temp_t=sorted(txtrs.items(),key=lambda x: x[1]) for t in temp_t: tex=bpy.data.textures[t[0]] img_fp=tex.image.filepath tex_fname="" if img_fp=="Untitled": #new name from tex name tex_fname=tex.name+"."+tex.image.file_format.lower() tex.image.save_render(os.path.join(texpath,tex_fname)) else: #image file is already saved on disk tex_fname=os.path.split(img_fp)[1] if tex.image.file_format=="":#if no format (dds) it will be saved as png. tex_fname=os.path.splitext(tex_fname)[0]+".png" tex.image.save_render(os.path.join(texpath,tex_fname)) file.write("{}\n".format(ntpath.join(texdir,os.path.splitext(tex_fname)[0]+".dds"))) #local dir + fname+'dds' file.close() | 20ccd61bd31aad967d09ed22d0533761affd3f8c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10993/20ccd61bd31aad967d09ed22d0533761affd3f8c/io_orbiter_msh.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3359,
67,
81,
674,
12,
10561,
16,
6283,
67,
9076,
4672,
225,
1661,
1687,
33,
8381,
225,
309,
1140,
18,
803,
18,
4939,
408,
12,
10561,
25146,
21,
65,
631,
3660,
30,
3608,
33,
10561,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3359,
67,
81,
674,
12,
10561,
16,
6283,
67,
9076,
4672,
225,
1661,
1687,
33,
8381,
225,
309,
1140,
18,
803,
18,
4939,
408,
12,
10561,
25146,
21,
65,
631,
3660,
30,
3608,
33,
10561,
9... |
self.__raising_exceptions = raising_exceptions | self.__raising_exceptions = not USE_SILENT_EXCEPTIONS | def __init__(self, parent = None, raising_exceptions = False): self.__errors = [] self.__raising_exceptions = raising_exceptions #An Exceptionable parent to mirror all the errors to automatically. self._parent = parent | ec1304614ea5bc838c2f5bb83444fc59ac9c26d8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9926/ec1304614ea5bc838c2f5bb83444fc59ac9c26d8/pylast.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
273,
599,
16,
28014,
67,
11855,
273,
1083,
4672,
365,
16186,
4324,
273,
5378,
365,
16186,
354,
13734,
67,
11855,
273,
486,
14988,
67,
2320,
900,
1784,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
273,
599,
16,
28014,
67,
11855,
273,
1083,
4672,
365,
16186,
4324,
273,
5378,
365,
16186,
354,
13734,
67,
11855,
273,
486,
14988,
67,
2320,
900,
1784,... |
self.request.user = save_user page.clean_acl_cache() | else: self.msg += u"%(pagename)s added \n" % {"pagename": pagename} page.clean_acl_cache() | def do_addrevision(self, filename, pagename, author=u"Scripting Subsystem", comment=u"", trivial=u"No"): """ Adds a revision to a page. | bf523fc55cacc31d578596a4aeb9c83e3573c6d7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/888/bf523fc55cacc31d578596a4aeb9c83e3573c6d7/packages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
1289,
13057,
12,
2890,
16,
1544,
16,
4262,
1069,
16,
2869,
33,
89,
6,
3651,
310,
2592,
4299,
3113,
2879,
33,
89,
6,
3113,
433,
20109,
33,
89,
6,
2279,
6,
4672,
3536,
15605,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
741,
67,
1289,
13057,
12,
2890,
16,
1544,
16,
4262,
1069,
16,
2869,
33,
89,
6,
3651,
310,
2592,
4299,
3113,
2879,
33,
89,
6,
3113,
433,
20109,
33,
89,
6,
2279,
6,
4672,
3536,
15605,
... |
format_re = re.compile(r'(?P<repeat> *[(]?[ ,0-9]*[)]? *)(?P<dtype>[><|A-Za-z0-9.]*)') | format_re = re.compile(r'(?P<order1>[<>|=]?)(?P<repeats> *[(]?[ ,0-9]*[)]? *)(?P<order2>[<>|=]?)(?P<dtype>[A-Za-z0-9.]*)') | def _split(input): """Split the input formats string into field formats without splitting the tuple used to specify multi-dimensional arrays.""" newlist = [] hold = '' for element in input.split(','): if hold != '': item = hold + ',' + element else: item = element left = item.count('(') right = item.count(')') # if the parenthesis is not balanced, hold the string if left > right : hold = item # when balanced, append to the output list and reset the hold elif left == right: newlist.append(item.strip()) hold = '' # too many close parenthesis is unacceptable else: raise SyntaxError, item # if there is string left over in hold if hold != '': raise SyntaxError, hold return newlist | 8959e33dfc7c2eef00cfdca74d3b750675cfc79d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/8959e33dfc7c2eef00cfdca74d3b750675cfc79d/_internal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4939,
12,
2630,
4672,
3536,
5521,
326,
810,
6449,
533,
1368,
652,
6449,
2887,
20347,
326,
3193,
1399,
358,
4800,
3309,
17,
31236,
5352,
12123,
225,
394,
1098,
273,
5378,
6887,
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,
389,
4939,
12,
2630,
4672,
3536,
5521,
326,
810,
6449,
533,
1368,
652,
6449,
2887,
20347,
326,
3193,
1399,
358,
4800,
3309,
17,
31236,
5352,
12123,
225,
394,
1098,
273,
5378,
6887,
273,
... |
return {} | return {} | def _locks(self, create=True): if self.__locks is not None: return self.__locks | a298b0dd6e13a85ae51696fcaccf9e139fb5cc7d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12235/a298b0dd6e13a85ae51696fcaccf9e139fb5cc7d/lockable.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
23581,
12,
2890,
16,
752,
33,
5510,
4672,
309,
365,
16186,
23581,
353,
486,
599,
30,
327,
365,
16186,
23581,
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,
389,
23581,
12,
2890,
16,
752,
33,
5510,
4672,
309,
365,
16186,
23581,
353,
486,
599,
30,
327,
365,
16186,
23581,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
return Announcements.objects.order_by('-date_fetched')[:200] | return Announcements.objects.order_by('-date_fetched')[:30] | def items(self): return Announcements.objects.order_by('-date_fetched')[:200] | 5e6f21ea81a60c3f58d9d541242fba15c9713bdd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11011/5e6f21ea81a60c3f58d9d541242fba15c9713bdd/feeds.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1516,
12,
2890,
4672,
327,
24936,
8386,
1346,
18,
6911,
18,
1019,
67,
1637,
2668,
17,
712,
67,
5754,
329,
6134,
10531,
6976,
65,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1516,
12,
2890,
4672,
327,
24936,
8386,
1346,
18,
6911,
18,
1019,
67,
1637,
2668,
17,
712,
67,
5754,
329,
6134,
10531,
6976,
65,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
body, content_type = encode_multipart_formdata(fields) | body, content_type = encode_multipart_formdata(fields or {}) | def post_url(self, url, fields={}, headers={}, retries=3, redirect=True): """ Wrapper for performing POST with urlopen (see urlopen for more details). | 4963f6dd0cd2f0b03e268b15e7d0fe2f7801fbdd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12281/4963f6dd0cd2f0b03e268b15e7d0fe2f7801fbdd/connectionpool.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1603,
67,
718,
12,
2890,
16,
880,
16,
1466,
28793,
1607,
28793,
9453,
33,
23,
16,
3136,
33,
5510,
4672,
3536,
18735,
364,
14928,
5485,
598,
19613,
261,
5946,
19613,
364,
1898,
3189,
2934... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
718,
12,
2890,
16,
880,
16,
1466,
28793,
1607,
28793,
9453,
33,
23,
16,
3136,
33,
5510,
4672,
3536,
18735,
364,
14928,
5485,
598,
19613,
261,
5946,
19613,
364,
1898,
3189,
2934... |
def tag(ui, repo, name, rev=None, **opts): | def tag(ui, repo, name, rev_=None, **opts): | def tag(ui, repo, name, rev=None, **opts): """add a tag for the current tip or a given revision Name a particular revision using <name>. Tags are used to name particular revisions of the repository and are very useful to compare different revision, to go back to significant earlier versions or to mark branch points as releases, etc. If no revision is given, the tip is used. To facilitate version control, distribution, and merging of tags, they are stored as a file named ".hgtags" which is managed similarly to other project files and can be hand-edited if necessary. """ if name == "tip": raise util.Abort(_("the name 'tip' is reserved")) if 'rev' in opts: rev = opts['rev'] if rev: r = hex(repo.lookup(rev)) else: r = hex(repo.changelog.tip()) disallowed = (revrangesep, '\r', '\n') for c in disallowed: if name.find(c) >= 0: raise util.Abort(_("%s cannot be used in a tag name") % repr(c)) if opts['local']: repo.opener("localtags", "a").write("%s %s\n" % (r, name)) return (c, a, d, u) = repo.changes() for x in (c, a, d, u): if ".hgtags" in x: raise util.Abort(_("working copy of .hgtags is changed " "(please commit .hgtags manually)")) repo.wfile(".hgtags", "ab").write("%s %s\n" % (r, name)) if repo.dirstate.state(".hgtags") == '?': repo.add([".hgtags"]) message = (opts['message'] or _("Added tag %s for changeset %s") % (name, r)) try: repo.commit([".hgtags"], message, opts['user'], opts['date']) except ValueError, inst: raise util.Abort(str(inst)) | 82b6f180a572b3079d92b7fa1aad0a62a33b04a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/82b6f180a572b3079d92b7fa1aad0a62a33b04a8/commands.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1047,
12,
4881,
16,
3538,
16,
508,
16,
5588,
67,
33,
7036,
16,
2826,
4952,
4672,
3536,
1289,
279,
1047,
364,
326,
783,
9529,
578,
279,
864,
6350,
225,
1770,
279,
6826,
6350,
1450,
411,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1047,
12,
4881,
16,
3538,
16,
508,
16,
5588,
67,
33,
7036,
16,
2826,
4952,
4672,
3536,
1289,
279,
1047,
364,
326,
783,
9529,
578,
279,
864,
6350,
225,
1770,
279,
6826,
6350,
1450,
411,... |
if event.GetOldSelection() != event.GetSelection(): self.editor.setupToolBar(viewIdx = event.GetSelection()) | viewIdx = event.GetSelection() if event.GetOldSelection() != viewIdx: self.editor.setupToolBar(viewIdx=viewIdx) view = self.getActiveView(viewIdx) if hasattr(view, 'OnPageActivated'): view.OnPageActivated(event) | def OnPageChange(self, event): if event.GetOldSelection() != event.GetSelection(): self.editor.setupToolBar(viewIdx = event.GetSelection()) event.Skip() | 7176bad8ff0a35af8625b72eec1b81f73c6702d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/7176bad8ff0a35af8625b72eec1b81f73c6702d0/Editor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
1964,
3043,
12,
2890,
16,
871,
4672,
1476,
4223,
273,
871,
18,
967,
6233,
1435,
309,
871,
18,
967,
7617,
6233,
1435,
480,
1476,
4223,
30,
365,
18,
9177,
18,
8401,
6364,
5190,
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,
2755,
1964,
3043,
12,
2890,
16,
871,
4672,
1476,
4223,
273,
871,
18,
967,
6233,
1435,
309,
871,
18,
967,
7617,
6233,
1435,
480,
1476,
4223,
30,
365,
18,
9177,
18,
8401,
6364,
5190,
12,... |
self.isAirborne = 0 if self.__jumpButton: | self.isAirborne = 0 elif self.__jumpButton: | def handleAvatarControls(self, task): """ Check on the arrow keys and update the avatar. """ if self.wantAvatarPhysicsIndicator: onScreenDebug.append("localToon pos = %s\n"%(toonbase.localToon.getPos().pPrintValues(),)) onScreenDebug.append("localToon h = % 10.4f\n"%(toonbase.localToon.getH(),)) #onScreenDebug.append("localToon name = %s\n"%(toonbase.localToon.getName(),)) onScreenDebug.append("localToon anim = %s\n"%(toonbase.localToon.animFSM.getCurrentState().getName(),)) #assert(self.debugPrint("handleAvatarControls(task=%s)"%(task,))) physObject=self.actorNode.getPhysicsObject() #rotAvatarToPhys=Mat3.rotateMatNormaxis(-self.avatarNodePath.getH(), Vec3.up()) #rotPhysToAvatar=Mat3.rotateMatNormaxis(self.avatarNodePath.getH(), Vec3.up()) contact=self.actorNode.getContactVector() # hack fix for falling through the floor: if contact==Vec3.zero() and self.avatarNodePath.getZ()<-50.0: # reset: # DCR: don't reset X and Y; allow player to move self.avatarNodePath.setZ(50.0) self.resetPhys() | 3e8fcc731aa0a15d72da33dbee7f72128446b809 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8543/3e8fcc731aa0a15d72da33dbee7f72128446b809/PhysicsWalker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
23999,
16795,
12,
2890,
16,
1562,
4672,
3536,
2073,
603,
326,
12274,
1311,
471,
1089,
326,
16910,
18,
3536,
309,
365,
18,
17369,
23999,
3731,
1900,
2102,
13140,
30,
603,
7956,
2829,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
23999,
16795,
12,
2890,
16,
1562,
4672,
3536,
2073,
603,
326,
12274,
1311,
471,
1089,
326,
16910,
18,
3536,
309,
365,
18,
17369,
23999,
3731,
1900,
2102,
13140,
30,
603,
7956,
2829,
... |
else: self.layeredCurves[layer] += [c] | else: self.layeredCurves[layer] += [c] | def _addCurve(self, layer, c): """ Add curve into its own layer, update the bbox """ self.havelist = 0 if not layer in self.layeredCurves: bbox = BBox() self.layeredCurves[layer] = [bbox, c] else: self.layeredCurves[layer] += [c] self.layeredCurves[layer][0].merge(c.bbox) | be7153ce421a674e97de640e3063c3bb1bccf4a9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/be7153ce421a674e97de640e3063c3bb1bccf4a9/shape.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1289,
9423,
12,
2890,
16,
3018,
16,
276,
4672,
3536,
1436,
8882,
1368,
2097,
4953,
3018,
16,
1089,
326,
8472,
3536,
365,
18,
76,
842,
5449,
273,
374,
225,
309,
486,
3018,
316,
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,
389,
1289,
9423,
12,
2890,
16,
3018,
16,
276,
4672,
3536,
1436,
8882,
1368,
2097,
4953,
3018,
16,
1089,
326,
8472,
3536,
365,
18,
76,
842,
5449,
273,
374,
225,
309,
486,
3018,
316,
365... |
print '(intoRDF) Error proccesing messages: ' + str(detail) | print 'Error proccesing messages: ' + str(detail) | def intoRDF(self, message, n): self.msg = message self.template = Template() self.tpl = self.template.get('rdf_message') | 8a88ddb68024c9a8cd1383a7b6e90e0791d40ee7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/8a88ddb68024c9a8cd1383a7b6e90e0791d40ee7/publisher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1368,
30137,
12,
2890,
16,
883,
16,
290,
4672,
365,
18,
3576,
273,
883,
365,
18,
3202,
273,
5035,
1435,
365,
18,
10933,
273,
365,
18,
3202,
18,
588,
2668,
19299,
67,
2150,
6134,
2,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1368,
30137,
12,
2890,
16,
883,
16,
290,
4672,
365,
18,
3576,
273,
883,
365,
18,
3202,
273,
5035,
1435,
365,
18,
10933,
273,
365,
18,
3202,
18,
588,
2668,
19299,
67,
2150,
6134,
2,
-... |
oldkey = encode_page(pagename + '?' + key) | oldkey = pagename + '?' + key | def wr(fmt, *args): args = tuple(map(form_escape, args)) request.write(fmt % args) | c2148eb66c33fcf5a92c14f41e031aab1e949385 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/888/c2148eb66c33fcf5a92c14f41e031aab1e949385/MetaEdit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12408,
12,
8666,
16,
380,
1968,
4672,
833,
273,
3193,
12,
1458,
12,
687,
67,
6939,
16,
833,
3719,
590,
18,
2626,
12,
8666,
738,
833,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12408,
12,
8666,
16,
380,
1968,
4672,
833,
273,
3193,
12,
1458,
12,
687,
67,
6939,
16,
833,
3719,
590,
18,
2626,
12,
8666,
738,
833,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.log_message(*args) | self.log_message(format, *args) | def log_error(self, *args): """Log an error. | 354133df7067bb1740e940233e5270e7d2d88c19 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/354133df7067bb1740e940233e5270e7d2d88c19/BaseHTTPServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
613,
67,
1636,
12,
2890,
16,
380,
1968,
4672,
3536,
1343,
392,
555,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
613,
67,
1636,
12,
2890,
16,
380,
1968,
4672,
3536,
1343,
392,
555,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
ws = Workspace.objects.get(pk = 1) | ws = DAMWorkspace.objects.get(pk = 1) | def test_create_category(self): ws = Workspace.objects.get(pk = 1) label = 'test_category' parent_node = Node.objects.get(pk = 3) params = self.get_final_parameters({ 'parent_id':parent_node.pk, 'label':label, 'type': 'category' }) response = self.client.post('/api/keyword/new/', params, ) resp_dict = json.loads(response.content) new_node = Node.objects.get(pk = resp_dict['id']) self.assertTrue(new_node.parent == parent_node) self.assertTrue(new_node.workspace == parent_node.workspace) self.assertTrue(new_node.label == label) self.assertTrue(new_node.type == 'keyword') self.assertTrue(new_node.cls== 'category') | 774c03fcc85d5555c72b71c04da9a7d1a510e957 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4589/774c03fcc85d5555c72b71c04da9a7d1a510e957/tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2640,
67,
4743,
12,
2890,
4672,
225,
4945,
273,
463,
2192,
8241,
18,
6911,
18,
588,
12,
5465,
273,
404,
13,
1433,
273,
296,
3813,
67,
4743,
11,
982,
67,
2159,
273,
2029,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2640,
67,
4743,
12,
2890,
4672,
225,
4945,
273,
463,
2192,
8241,
18,
6911,
18,
588,
12,
5465,
273,
404,
13,
1433,
273,
296,
3813,
67,
4743,
11,
982,
67,
2159,
273,
2029,
18... |
line number is only used for issuing warnings and errors. | line number is only used for issuing errors. | def _add_list(doc, bullet_token, stack, indent_stack, errors, warnings): """ Add a new list item or field to the DOM tree, with the given bullet or field tag. When necessary, create the associated list. """ # Determine what type of bullet it is. if bullet_token.contents[-1] == '-': list_type = 'ulist' elif bullet_token.contents[-1] == '.': list_type = 'olist' elif bullet_token.contents[-1] == ':': list_type = 'fieldlist' else: raise AssertionError('Bad Bullet: %r' % bullet_token.contents) # Is this a new list? newlist = 0 if stack[-1].tagName != list_type: newlist = 1 elif list_type == 'olist' and stack[-1].tagName == 'olist': old_listitem = stack[-1].childNodes[-1] old_bullet = old_listitem.getAttribute("bullet").split('.')[:-1] new_bullet = bullet_token.contents.split('.')[:-1] if (new_bullet[:-1] != old_bullet[:-1] or int(new_bullet[-1]) != int(old_bullet[-1])+1): newlist = 1 # Create the new list. if newlist: if stack[-1].tagName in ('ulist', 'olist', 'fieldlist'): stack.pop() indent_stack.pop() if (list_type != 'fieldlist' and indent_stack[-1] is not None and bullet_token.indent == indent_stack[-1]): # Ignore this error if there's text on the same line as # the comment-opening quote -- epydoc can't reliably # determine the indentation for that line. if bullet_token.startline != 1 or bullet_token.indent != 0: estr = "Lists must be indented." errors.append(StructuringError(estr, bullet_token)) if list_type == 'fieldlist': # Fieldlist should be at the top-level. for tok in stack[2:]: if tok.tagName != "section": estr = "Fields must be at the top level." errors.append(StructuringError(estr, bullet_token)) break stack[2:] = [] indent_stack[2:] = [] # Add the new list. lst = doc.createElement(list_type) stack[-1].appendChild(lst) stack.append(lst) indent_stack.append(bullet_token.indent) if list_type == 'olist': start = bullet_token.contents.split('.')[:-1] if start != '1': lst.setAttribute("start", start[-1]) # Fields are treated somewhat specially: A "fieldlist" # node is created to make the parsing simpler, but fields # are adjoined directly into the "epytext" node, not into # the "fieldlist" node. if list_type == 'fieldlist': li = doc.createElement("field") token_words = bullet_token.contents[1:-1].split(None, 1) tag_elt = doc.createElement("tag") tag_elt.appendChild(doc.createTextNode(token_words[0])) li.appendChild(tag_elt) if len(token_words) > 1: arg_elt = doc.createElement("arg") arg_elt.appendChild(doc.createTextNode(token_words[1])) li.appendChild(arg_elt) else: li = doc.createElement("li") if list_type == 'olist': li.setAttribute("bullet", bullet_token.contents) # Add the bullet. stack[-1].appendChild(li) stack.append(li) indent_stack.append(None) | 7bf7c136593a0f12e906094a55f7b8f591c5abaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/7bf7c136593a0f12e906094a55f7b8f591c5abaf/epytext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1289,
67,
1098,
12,
2434,
16,
31650,
67,
2316,
16,
2110,
16,
3504,
67,
3772,
16,
1334,
16,
5599,
4672,
3536,
1436,
279,
394,
666,
761,
578,
652,
358,
326,
4703,
2151,
16,
598,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1289,
67,
1098,
12,
2434,
16,
31650,
67,
2316,
16,
2110,
16,
3504,
67,
3772,
16,
1334,
16,
5599,
4672,
3536,
1436,
279,
394,
666,
761,
578,
652,
358,
326,
4703,
2151,
16,
598,
3... |
for ch in guide.chan_list: for prog in ch.programs: | for ch in get_channels().get_all(): for prog in ch.epg.programs: | def when_listings_expire(): guide = get_guide() last = 0 left = 0 for ch in guide.chan_list: for prog in ch.programs: if prog.start > last: last = prog.start if last > 0: now = time.time() if last > now: left = int(last - now) # convert to hours left /= 3600 return left | dd1a33a2aa06983745ebc387b1d98370bf4ee2dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/dd1a33a2aa06983745ebc387b1d98370bf4ee2dd/tv_util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1347,
67,
1098,
899,
67,
14070,
13332,
225,
7343,
273,
336,
67,
12118,
1435,
1142,
273,
374,
2002,
273,
374,
225,
364,
462,
316,
336,
67,
9114,
7675,
588,
67,
454,
13332,
364,
11243,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1347,
67,
1098,
899,
67,
14070,
13332,
225,
7343,
273,
336,
67,
12118,
1435,
1142,
273,
374,
2002,
273,
374,
225,
364,
462,
316,
336,
67,
9114,
7675,
588,
67,
454,
13332,
364,
11243,
3... |
child_stdout.close() child_stderr.close() | def executeAndGetOutput( cmd ): try: import subprocess p = subprocess.Popen( "%s" % cmd, shell = True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds = True ) outData = p.stdout.read().strip() p.wait() except ImportError: import popen2 p3 = popen2.Popen3( "%s" % cmd ) outData = p3.fromchild.read().strip() p3.wait() return outData | 1a7b7cca18e6d874645147d6c501823d311ed3bc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12864/1a7b7cca18e6d874645147d6c501823d311ed3bc/dirac-pilot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
14042,
1447,
12,
1797,
262,
30,
775,
30,
1930,
6652,
293,
273,
6652,
18,
52,
3190,
12,
2213,
87,
6,
738,
1797,
16,
5972,
273,
1053,
16,
3909,
33,
1717,
2567,
18,
27602,
16,
451... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
14042,
1447,
12,
1797,
262,
30,
775,
30,
1930,
6652,
293,
273,
6652,
18,
52,
3190,
12,
2213,
87,
6,
738,
1797,
16,
5972,
273,
1053,
16,
3909,
33,
1717,
2567,
18,
27602,
16,
451... | |
func_entry.setAttribute("index", "index") | func_entry.setAttribute("index", "yes") | def fixup_bifuncindexes_chunk(container): removes = [] entries = find_all_elements(container, "bifuncindex") function_entries = find_all_elements(container, "function") for entry in entries: function_name = entry.getAttribute("name") found = 0 for func_entry in function_entries: t2 = func_entry.childNodes[0].data if t2[-2:] != "()": continue t2 = t2[:-2] if t2 == function_name: func_entry.setAttribute("index", "index") func_entry.setAttribute("module", "__builtin__") if not found: removes.append(entry) found = 1 for entry in removes: container.removeChild(entry) | 080c1b5af693afd471728e7fa66f744a61e75ed4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/080c1b5af693afd471728e7fa66f744a61e75ed4/docfixer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
416,
67,
70,
430,
551,
11265,
67,
6551,
12,
3782,
4672,
7157,
273,
5378,
3222,
273,
1104,
67,
454,
67,
6274,
12,
3782,
16,
315,
70,
430,
551,
1615,
7923,
445,
67,
8219,
273,
11... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
416,
67,
70,
430,
551,
11265,
67,
6551,
12,
3782,
4672,
7157,
273,
5378,
3222,
273,
1104,
67,
454,
67,
6274,
12,
3782,
16,
315,
70,
430,
551,
1615,
7923,
445,
67,
8219,
273,
11... |
ts = time.asctime(time.localtime(time.time())) if DEBUG: self.write('-' * 79 + '\n') if DEBUG: self.write('Starting %s at %s\n' % (logtype, ts)) | def __init__(self, logtype='(unknown)'): self.lineno = 1 self.logtype = logtype try: appname = os.path.splitext(os.path.basename(sys.argv[0]))[0] logfile = '%s/internal-%s-%s.log' % (LOGDIR, appname, os.getuid()) self.fp = open(logfile, 'a') if DEBUG: print 'Logging info in %s' % logfile except IOError: print 'Could not open logfile: %s' % logfile self.fp = open('/dev/null','a') self.softspace = 0 ts = time.asctime(time.localtime(time.time())) if DEBUG: self.write('-' * 79 + '\n') if DEBUG: self.write('Starting %s at %s\n' % (logtype, ts)) | f40e735c7f611f29217523ead3b918acbea96d2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/f40e735c7f611f29217523ead3b918acbea96d2d/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
613,
723,
2218,
12,
8172,
2506,
4672,
365,
18,
17782,
273,
404,
365,
18,
1330,
723,
273,
613,
723,
775,
30,
22323,
273,
1140,
18,
803,
18,
4939,
408,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
613,
723,
2218,
12,
8172,
2506,
4672,
365,
18,
17782,
273,
404,
365,
18,
1330,
723,
273,
613,
723,
775,
30,
22323,
273,
1140,
18,
803,
18,
4939,
408,
1... | |
StrLenField("FileName", "\xff", length_from=lambda x:x.ByteCount), | StrLenField("FileName", b"\xff", length_from=lambda x:x.ByteCount), | def lengthfrom_Pad1(self): if self.DataOffset == 0: return 0 r = self.underlayer.size() # underlayer size removed r += 5 # 5 byte vars r += 11*2 # 11 words r += 4 # 1 int r += self.SetupCount*2 # SetupCount words r += len(self.Pad) # Pad length r += self.ParamCount # ParamCount arguments return self.DataOffset - r | 273040f5e59a0537bf5a4d92ae00380481a977a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8801/273040f5e59a0537bf5a4d92ae00380481a977a7/smbfields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
769,
2080,
67,
14878,
21,
12,
2890,
4672,
309,
365,
18,
751,
2335,
422,
374,
30,
327,
374,
436,
273,
365,
18,
9341,
6363,
18,
1467,
1435,
202,
7,
3613,
6363,
963,
3723,
436,
1011,
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,
769,
2080,
67,
14878,
21,
12,
2890,
4672,
309,
365,
18,
751,
2335,
422,
374,
30,
327,
374,
436,
273,
365,
18,
9341,
6363,
18,
1467,
1435,
202,
7,
3613,
6363,
963,
3723,
436,
1011,
13... |
return [[(self.getDescriptorByName(v.strip()).module, | return [[(self.getDescriptorByName(v).module, | def makeSpec(self, port, specStr, localRegistry=None, loose=True): """Parses a string representation of a port spec and returns | 6897058998006b10e90ec33ea5e2a39dbce92d1d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6341/6897058998006b10e90ec33ea5e2a39dbce92d1d/module_registry.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
1990,
12,
2890,
16,
1756,
16,
857,
1585,
16,
1191,
4243,
33,
7036,
16,
28393,
33,
5510,
4672,
3536,
6656,
279,
533,
4335,
434,
279,
1756,
857,
471,
1135,
2,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
1990,
12,
2890,
16,
1756,
16,
857,
1585,
16,
1191,
4243,
33,
7036,
16,
28393,
33,
5510,
4672,
3536,
6656,
279,
533,
4335,
434,
279,
1756,
857,
471,
1135,
2,
-100,
-100,
-100,
-10... |
try: from os import popen3 except NameError: | if hasattr(os, "popen3"): def popen3(cmd, mode='t', bufsize=-1): """Execute the shell command 'cmd' in a sub-process. If 'bufsize' is specified, it sets the buffer size for the I/O pipes. The file objects (child_stdout, child_stdin, child_stderr) are returned.""" w, r, e = os.popen3(cmd, mode, bufsize) return r, w, e else: | def popen2(cmd, mode='t', bufsize=-1): """Execute the shell command 'cmd' in a sub-process. If 'bufsize' is specified, it sets the buffer size for the I/O pipes. The file objects (child_stdout, child_stdin) are returned.""" if type(mode) is type(0) and bufsize == -1: bufsize = mode mode = 't' assert mode in ('t', 'b') _cleanup() inst = Popen3(cmd, 0, bufsize) return inst.fromchild, inst.tochild | 8e49bfbd24ae626628ac43cdc01d4f2dc0368963 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8e49bfbd24ae626628ac43cdc01d4f2dc0368963/popen2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30925,
22,
12,
4172,
16,
1965,
2218,
88,
2187,
1681,
1467,
29711,
21,
4672,
3536,
5289,
326,
5972,
1296,
296,
4172,
11,
316,
279,
720,
17,
2567,
18,
225,
971,
296,
4385,
1467,
11,
353,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30925,
22,
12,
4172,
16,
1965,
2218,
88,
2187,
1681,
1467,
29711,
21,
4672,
3536,
5289,
326,
5972,
1296,
296,
4172,
11,
316,
279,
720,
17,
2567,
18,
225,
971,
296,
4385,
1467,
11,
353,... |
print >> sys.stderr, "You do not have a dbm module available " \ | print >> sys.stderr, "\nYou do not have a dbm module available " \ | def open_storage(data_source_name, useDB=True, mode=None): """Return a storage object appropriate to the given parameters. By centralizing this code here, all the applications will behave the same given the same options. If useDB is false, a pickle will be used, otherwise if the data source name includes "::", whatever is before that determines the type of database. If the source name doesn't include "::", then a DBDictClassifier is used.""" if useDB: if data_source_name.find('::') != -1: db_type, rest = data_source_name.split('::', 1) if _storage_types.has_key(db_type.lower()): klass, supports_mode = _storage_types[db_type.lower()] data_source_name = rest else: raise NoSuchClassifierError(db_type) else: klass, supports_mode = _storage_types["dbm"] else: klass, supports_mode = _storage_types["pickle"] try: if supports_mode and mode is not None: return klass(data_source_name, mode) else: return klass(data_source_name) except dbmstorage.error, e: if str(e) == "No dbm modules available!": # We expect this to hit a fair few people, so warn them nicely, # rather than just printing the trackback. print >> sys.stderr, "You do not have a dbm module available " \ "to use. You need to either use a pickle (see the FAQ)" \ ", use Python 2.3 (or above), or install a dbm module " \ "such as bsddb (see http://sf.net/projects/pybsddb)." import sys sys.exit() | 1a69889ab4aaaca1f7beb9165fe419fd7949d80c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6126/1a69889ab4aaaca1f7beb9165fe419fd7949d80c/storage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
5697,
12,
892,
67,
3168,
67,
529,
16,
999,
2290,
33,
5510,
16,
1965,
33,
7036,
4672,
3536,
990,
279,
2502,
733,
5505,
358,
326,
864,
1472,
18,
225,
2525,
18291,
6894,
333,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
5697,
12,
892,
67,
3168,
67,
529,
16,
999,
2290,
33,
5510,
16,
1965,
33,
7036,
4672,
3536,
990,
279,
2502,
733,
5505,
358,
326,
864,
1472,
18,
225,
2525,
18291,
6894,
333,
... |
while nextPartition: if nextPartition.type & parted.PARTITION_FREESPACE: maxLength += nextPartition.geometry.length | for partition in self.disk.partitions.values(): if partition.type & parted.PARTITION_FREESPACE: maxLength += partition.geometry.length | def getMaxAvailableSize(self, unit="MB"): """Return the maximum size this Partition can grow to by looking at contiguous freespace partitions. The size is returned in the unit specified (default is megabytes). The unit is a string corresponding to one of the following abbreviations: b (bytes), KB (kilobytes), MB (megabytes), GB (gigabytes), TB (terabytes). An invalid unit string will raise a SyntaxError exception.""" lunit = unit.lower() | 5662b436212af83804a692e8b44af1081f32af2c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5978/5662b436212af83804a692e8b44af1081f32af2c/partition.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7288,
5268,
1225,
12,
2890,
16,
2836,
1546,
7969,
6,
4672,
3536,
990,
326,
4207,
963,
333,
12598,
848,
13334,
358,
635,
7849,
622,
26928,
284,
5312,
909,
10060,
18,
225,
1021,
963,
353,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7288,
5268,
1225,
12,
2890,
16,
2836,
1546,
7969,
6,
4672,
3536,
990,
326,
4207,
963,
333,
12598,
848,
13334,
358,
635,
7849,
622,
26928,
284,
5312,
909,
10060,
18,
225,
1021,
963,
353,
... |
AbelianGroup( 2, [0, 0]) | Abelian Group isomorphic to Z x Z | def __init__(self, ambient, gens, names="f"): """ | 82feb7d5287b66fa860c45cb0b160fbe7aa67b0a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9417/82feb7d5287b66fa860c45cb0b160fbe7aa67b0a/abelian_group.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
13232,
1979,
16,
314,
773,
16,
1257,
1546,
74,
6,
4672,
3536,
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,
2738,
972,
12,
2890,
16,
13232,
1979,
16,
314,
773,
16,
1257,
1546,
74,
6,
4672,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
request.session.secret_key = self.cfg['secret_key'] | request.session.secret_key = self.secret_key | def dispatch_wsgi(self, environ, start_response): """This method is the internal WSGI request and is overridden by middlewares applied with :meth:`add_middleware`. It handles the actual request dispatching. """ # Create a new request object, register it with the application # and all the other stuff on the current thread but initialize # it afterwards. We do this so that the request object can query # the database in the initialization method. request = object.__new__(Request) local.request = request local.page_metadata = [] local.request_locals = {} request.__init__(environ, self) | 5e0770441a753b02f33627709be030b945d222d5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12815/5e0770441a753b02f33627709be030b945d222d5/application.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3435,
67,
28539,
12,
2890,
16,
5473,
16,
787,
67,
2740,
4672,
3536,
2503,
707,
353,
326,
2713,
7649,
13797,
590,
471,
353,
11000,
635,
16123,
6754,
598,
294,
27305,
28288,
1289,
67,
1735... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3435,
67,
28539,
12,
2890,
16,
5473,
16,
787,
67,
2740,
4672,
3536,
2503,
707,
353,
326,
2713,
7649,
13797,
590,
471,
353,
11000,
635,
16123,
6754,
598,
294,
27305,
28288,
1289,
67,
1735... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.