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 |
|---|---|---|---|---|---|---|
stack.append((tag_name, attributes, None)) | stack.append((tag_name, attributes, None)) | def pre_stream(stream , tag_uri, tag_name, attributes, pdf_stylesheet): stack = [] story = [] styles = getSampleStyleSheet() styleN = styles['Normal'] content = [] has_content = False stack.append((tag_name, attributes, None)) while True: event, value, line_number = stream_next(stream) if event == None: break #### START ELEMENT #### if event == START_ELEMENT: print WARNING_DTD % ('document', line_number, tag_name) stack.append((tag_name, attributes, None)) #### END ELEMENT #### elif event == END_ELEMENT: tag_uri, tag_name = value if tag_name == 'pre': return create_preformatted(pdf_stylesheet, {}, stack.pop(), content) else: print WARNING_DTD % ('document', line_number, tag_name) # unknown tag stack.append((tag_name, attributes, None)) #### TEXT ELEMENT #### elif event == TEXT: if stack: # we dont strip the string --> preformatted widget value = XML.encode(Unicode.decode(value, encoding)) # entities content.append(value) | fc0ed9558daebdc59e52053465cd8f2b7822b279 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12681/fc0ed9558daebdc59e52053465cd8f2b7822b279/rml2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
675,
67,
3256,
12,
3256,
269,
1047,
67,
1650,
16,
1047,
67,
529,
16,
1677,
16,
8169,
67,
19403,
4672,
2110,
273,
5378,
17285,
273,
5378,
5687,
273,
26078,
2885,
8229,
1435,
2154,
50,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
675,
67,
3256,
12,
3256,
269,
1047,
67,
1650,
16,
1047,
67,
529,
16,
1677,
16,
8169,
67,
19403,
4672,
2110,
273,
5378,
17285,
273,
5378,
5687,
273,
26078,
2885,
8229,
1435,
2154,
50,
2... |
m = self.atoms.get_momenta() return sum(m) | return self.atoms.get_momenta().sum(0) | def get_center_of_mass_momentum(self): "Get the center of mass momentum." m = self.atoms.get_momenta() return sum(m) | 0f3c4aa5713483fc2a6d3f3058ac9bdd7fc7b57c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1380/0f3c4aa5713483fc2a6d3f3058ac9bdd7fc7b57c/npt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5693,
67,
792,
67,
10424,
67,
22027,
379,
12,
2890,
4672,
315,
967,
326,
4617,
434,
8039,
10382,
379,
1199,
312,
273,
365,
18,
14937,
18,
588,
67,
22027,
69,
1435,
327,
2142,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
336,
67,
5693,
67,
792,
67,
10424,
67,
22027,
379,
12,
2890,
4672,
315,
967,
326,
4617,
434,
8039,
10382,
379,
1199,
312,
273,
365,
18,
14937,
18,
588,
67,
22027,
69,
1435,
327,
2142,
... |
raise PatchError("bad hunk | raise PatchError(_("bad hunk (self.number, x)) | def read_context_hunk(self, lr): self.desc = lr.readline() m = contextdesc.match(self.desc) if not m: raise PatchError("bad hunk #%d" % self.number) foo, self.starta, foo2, aend, foo3 = m.groups() self.starta = int(self.starta) if aend == None: aend = self.starta self.lena = int(aend) - self.starta if self.starta: self.lena += 1 for x in xrange(self.lena): l = lr.readline() if l.startswith('---'): lr.push(l) break s = l[2:] if l.startswith('- ') or l.startswith('! '): u = '-' + s elif l.startswith(' '): u = ' ' + s else: raise PatchError("bad hunk #%d old text line %d" % (self.number, x)) self.a.append(u) self.hunk.append(u) | 252c8d85581f2987e5c62ae7983c3003cc9e5438 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11312/252c8d85581f2987e5c62ae7983c3003cc9e5438/patch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
2472,
67,
76,
1683,
12,
2890,
16,
12226,
4672,
365,
18,
5569,
273,
12226,
18,
896,
1369,
1435,
312,
273,
819,
5569,
18,
1916,
12,
2890,
18,
5569,
13,
309,
486,
312,
30,
1002... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
2472,
67,
76,
1683,
12,
2890,
16,
12226,
4672,
365,
18,
5569,
273,
12226,
18,
896,
1369,
1435,
312,
273,
819,
5569,
18,
1916,
12,
2890,
18,
5569,
13,
309,
486,
312,
30,
1002... |
for status in self._message.status: was_selected = False had_item = False if (self._name_to_id.has_key(status.name)): id = self._name_to_id[status.name] had_item = True if (self._tree_control.GetSelection() == id): was_selected = True | for message in self._messages: for status in message.status: was_selected = False had_item = False if (self._name_to_id.has_key(status.name)): id = self._name_to_id[status.name] had_item = True if (self._tree_control.GetSelection() == id): was_selected = True self._tree_control.Delete(id) | def new_message(self): self._mutex.acquire() had_errors = False for status in self._message.status: was_selected = False had_item = False if (self._name_to_id.has_key(status.name)): id = self._name_to_id[status.name] had_item = True if (self._tree_control.GetSelection() == id): was_selected = True self._tree_control.Delete(id) self.create_item(status, was_selected, had_item == False) if (status.level == 2 and (not had_item)): had_errors = True self._mutex.release() if (had_errors and self._new_errors_callback != None): self._new_errors_callback() self.Refresh() | cd5bd36facfac4319952f35e8d299d4046f79a6e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10233/cd5bd36facfac4319952f35e8d299d4046f79a6e/monitor_panel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
67,
2150,
12,
2890,
4672,
365,
6315,
29946,
18,
1077,
1039,
1435,
225,
9323,
67,
4324,
273,
1083,
225,
364,
883,
316,
365,
6315,
6833,
30,
364,
1267,
316,
883,
18,
2327,
30,
1703,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
67,
2150,
12,
2890,
4672,
365,
6315,
29946,
18,
1077,
1039,
1435,
225,
9323,
67,
4324,
273,
1083,
225,
364,
883,
316,
365,
6315,
6833,
30,
364,
1267,
316,
883,
18,
2327,
30,
1703,... |
timeout = int(timeout*1000) | if timeout is not None: timeout = int(timeout*1000) | def poll2 (timeout=0.0, map=None): import poll if map is None: map=socket_map # timeout is in milliseconds timeout = int(timeout*1000) if map: l = [] for fd, obj in map.items(): flags = 0 if obj.readable(): flags = poll.POLLIN if obj.writable(): flags = flags | poll.POLLOUT if flags: l.append ((fd, flags)) r = poll.poll (l, timeout) for fd, flags in r: try: obj = map[fd] try: if (flags & poll.POLLIN): obj.handle_read_event() if (flags & poll.POLLOUT): obj.handle_write_event() except ExitNow: raise ExitNow except: obj.handle_error() except KeyError: pass | 4d13fa4982c96d72a875ae82cd0ec0c978f8007c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/4d13fa4982c96d72a875ae82cd0ec0c978f8007c/asyncore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7672,
22,
261,
4538,
33,
20,
18,
20,
16,
852,
33,
7036,
4672,
1930,
7672,
309,
852,
353,
599,
30,
852,
33,
7814,
67,
1458,
468,
2021,
353,
316,
10993,
430,
2021,
353,
486,
599,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7672,
22,
261,
4538,
33,
20,
18,
20,
16,
852,
33,
7036,
4672,
1930,
7672,
309,
852,
353,
599,
30,
852,
33,
7814,
67,
1458,
468,
2021,
353,
316,
10993,
430,
2021,
353,
486,
599,
30,
... |
self.assertEqual(-0x7fffffff, -2147483647) | if platform_long_is_32_bits: self.assertEqual(-0x7fffffff, -2147483647) else: self.assertEqual(-0x7fffffffffffffff, -9223372036854775807) | def test_hex_baseline(self): # Baseline tests self.assertEqual(0x0, 0) self.assertEqual(0x10, 16) self.assertEqual(0x7fffffff, 2147483647) # Ditto with a minus sign and parentheses self.assertEqual(-(0x0), 0) self.assertEqual(-(0x10), -16) self.assertEqual(-(0x7fffffff), -2147483647) # Ditto with a minus sign and NO parentheses self.assertEqual(-0x0, 0) self.assertEqual(-0x10, -16) self.assertEqual(-0x7fffffff, -2147483647) | 9f9d6e6c1d506067db8a1309e91d568018bef591 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/9f9d6e6c1d506067db8a1309e91d568018bef591/test_hexoct.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
7118,
67,
27818,
12,
2890,
4672,
468,
605,
345,
3027,
7434,
365,
18,
11231,
5812,
12,
20,
92,
20,
16,
374,
13,
365,
18,
11231,
5812,
12,
20,
92,
2163,
16,
2872,
13,
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,
1842,
67,
7118,
67,
27818,
12,
2890,
4672,
468,
605,
345,
3027,
7434,
365,
18,
11231,
5812,
12,
20,
92,
20,
16,
374,
13,
365,
18,
11231,
5812,
12,
20,
92,
2163,
16,
2872,
13,
365,
... |
(x^2 - 15*x - 18) * x | x * (x^2 - 15*x - 18) | def fcp(x, var='x'): """ Return the factorization of the characteristic polynomial of x. EXAMPLES: sage: M = MatrixSpace(QQ,3,3) sage: A = M([1,2,3,4,5,6,7,8,9]) sage: fcp(A, 'x') (x^2 - 15*x - 18) * x """ try: return x.fcp(var) except AttributeError: return factor(charpoly(x, var)) | 33bced5ab60b527f90cccf90f0cf4f0c8ed6fa37 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/33bced5ab60b527f90cccf90f0cf4f0c8ed6fa37/functional.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
4057,
12,
92,
16,
569,
2218,
92,
11,
4672,
3536,
2000,
326,
5578,
1588,
434,
326,
23158,
16991,
434,
619,
18,
225,
5675,
8900,
11386,
30,
272,
410,
30,
490,
273,
7298,
3819,
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,
284,
4057,
12,
92,
16,
569,
2218,
92,
11,
4672,
3536,
2000,
326,
5578,
1588,
434,
326,
23158,
16991,
434,
619,
18,
225,
5675,
8900,
11386,
30,
272,
410,
30,
490,
273,
7298,
3819,
12,
... |
msg += "\n%s" % self.context.currentRecord.srcline | msg += "\n%s" % self.context.srcline | def warn(self, text, source=True): msg = "" if source: msg = "%s, line %d (%d), " % (self.context.currentRecord.srcfile, self.context.currentRecord.linenum, self.context.global_linenum) msg += "warning: %s" % (text) if source: msg += "\n%s" % self.context.currentRecord.srcline print >>sys.stderr, msg self.log(2, msg) self.context.warnings += 1 | f729bf293a24574bf4c73fe4fdd36424549e0262 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8152/f729bf293a24574bf4c73fe4fdd36424549e0262/assembler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1894,
12,
2890,
16,
977,
16,
1084,
33,
5510,
4672,
1234,
273,
1408,
309,
1084,
30,
1234,
273,
2213,
87,
16,
980,
738,
72,
6142,
72,
3631,
315,
738,
261,
2890,
18,
2472,
18,
2972,
211... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1894,
12,
2890,
16,
977,
16,
1084,
33,
5510,
4672,
1234,
273,
1408,
309,
1084,
30,
1234,
273,
2213,
87,
16,
980,
738,
72,
6142,
72,
3631,
315,
738,
261,
2890,
18,
2472,
18,
2972,
211... |
ALGORITHM: Uses scipy.optimize.leastsq which in turn uses MINPACK’s lmdif and lmder algorithms. | ALGORITHM: Uses scipy.optimize.leastsq which in turn uses MINPACK's lmdif and lmder algorithms. | sage: def f(x, a, b, c): return a * sin(b * x - c) | 7ae4aa6a7f4f0b8f9cefffe57f7ee37391533fd5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/7ae4aa6a7f4f0b8f9cefffe57f7ee37391533fd5/optimize.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
272,
410,
30,
1652,
284,
12,
92,
16,
279,
16,
324,
16,
276,
4672,
327,
279,
380,
5367,
12,
70,
380,
619,
300,
276,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
272,
410,
30,
1652,
284,
12,
92,
16,
279,
16,
324,
16,
276,
4672,
327,
279,
380,
5367,
12,
70,
380,
619,
300,
276,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
expanded.add(self.groupTreeCtrl.GetPyData(item)) | expanded.add(self.groupTreeCtrl.GetPyData(item)[1]) | def _refresh(self): # Get the tree from the server try: group_tree = self.client.getGroupTree() except SchoolToolError, e: self.SetStatusText(str(e)) group_tree = [] else: self.SetStatusText(self.client.status) | 7a970a1ab85c914789914ae7bec4734ebf27787f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7127/7a970a1ab85c914789914ae7bec4734ebf27787f/wxclient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9144,
12,
2890,
4672,
468,
968,
326,
2151,
628,
326,
1438,
775,
30,
1041,
67,
3413,
273,
365,
18,
2625,
18,
588,
1114,
2471,
1435,
1335,
348,
343,
1371,
6364,
668,
16,
425,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9144,
12,
2890,
4672,
468,
968,
326,
2151,
628,
326,
1438,
775,
30,
1041,
67,
3413,
273,
365,
18,
2625,
18,
588,
1114,
2471,
1435,
1335,
348,
343,
1371,
6364,
668,
16,
425,
30,
... |
elif opt == 'no-update-profile': | elif opt == '--no-update-profile': | def main(argv): username = "admin" password = "admin" url = "http://localhost:8080/share" include_users = None skip_users = [ 'System' ] set_dashboards = True set_prefs = True update_profile = True set_avatars = True _debug = 0 if len(argv) > 0: # File name to load users from, or '-' for stdin filename = argv[0] # TODO Support stdin as input mechanism else: usage() sys.exit(1) try: opts, args = getopt.getopt(argv[1:], "hdu:p:U:", ["help", "username=", "password=", "url=", "users=", "skip-users=", "no-dashboards", "no-preferences", "no-update-profile", "no-avatars"]) except getopt.GetoptError, e: usage() sys.exit(1) for opt, arg in opts: if opt in ("-h", "--help"): usage() sys.exit() elif opt == '-d': _debug = 1 elif opt in ("-u", "--username"): username = arg elif opt in ("-p", "--password"): password = arg elif opt in ("-U", "--url"): url = arg elif opt == "--users": include_users = arg.split(',') elif opt == "--skip-users": skip_users = arg.split(',') elif opt == 'no-dashboards': set_dashboards = False elif opt == 'no-preferences': set_prefs = False elif opt == 'no-update-profile': update_profile = False elif opt == 'no-avatars': set_avatars = False sc = alfresco.ShareClient(url, debug=_debug) print "Log in (%s)" % (username) loginres = sc.doLogin(username, password) if not loginres['success']: print "Could not log in using specified credentials" sys.exit(1) users = json.loads(open(filename).read())['people'] for u in users: if include_users is not None and u['userName'] not in include_users: users.remove(u) elif u['userName'] in skip_users: users.remove(u) # Work around bug where create/update user calls do not accept null values # Create call does not like jobtitle being null; webtier update profile does not tolerate any being null for k in u.keys(): if u[k] is None: u[k] = "" if 'password' not in u: u['password'] = u['userName'] try: print "Create %s user(s)" % (len(users)) sc.createUsers(users, skip_users=skip_users) # Set user preferences for u in users: if 'preferences' in u and len(u['preferences']) > 0 and set_prefs: print "Setting preferences for user '%s'" % (u['userName']) sc.setUserPreferences(u['userName'], u['preferences']) finally: print "Log out (%s)" % (username) sc.doLogout() #TODO Check if a profile image or dashboard config is available before logging in thisdir = os.path.dirname(filename) for u in users: print "Log in (%s)" % (u['userName']) sc.doLogin(u['userName'], u['password']) try: # Add profile image if set_avatars: print "Setting profile image for user '%s'" % (u['userName']) if 'avatar' in u: try: sc.setProfileImage(u['userName'], thisdir + os.sep + str(u['avatar'])) except IOError, e: if e.errno == 2: # Ignore file not found errors pass else: raise e # Update user profile if update_profile: print "Updating profile information for user '%s'" % (u['userName']) sc.updateUserDetails(u) # Update dashboard if 'dashboardConfig' in u and set_dashboards: print "Updating dashboard configuration for user '%s'" % (u['userName']) sc.updateUserDashboardConfig(u) finally: print "Log out (%s)" % (u['userName']) sc.doLogout() | dcbf012c57656f19de039298576af4487bd41845 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8296/dcbf012c57656f19de039298576af4487bd41845/bootstrap-users.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
4672,
225,
2718,
273,
315,
3666,
6,
2201,
273,
315,
3666,
6,
880,
273,
315,
2505,
2207,
13014,
30,
3672,
3672,
19,
14419,
6,
2341,
67,
5577,
273,
599,
2488,
67,
5577,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
4672,
225,
2718,
273,
315,
3666,
6,
2201,
273,
315,
3666,
6,
880,
273,
315,
2505,
2207,
13014,
30,
3672,
3672,
19,
14419,
6,
2341,
67,
5577,
273,
599,
2488,
67,
5577,
... |
def decodeGivenEventualEncoding(self, eventualEncoding): | def __str__(self, encoding=DEFAULT_OUTPUT_ENCODING): | def decodeGivenEventualEncoding(self, eventualEncoding): return u'<![CDATA[' + self + u']]>' | 7300e101f39b7a1a436c6765d140c987cbc58a45 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/7300e101f39b7a1a436c6765d140c987cbc58a45/BeautifulSoup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2495,
6083,
1133,
1462,
4705,
12,
2890,
16,
871,
1462,
4705,
4672,
327,
582,
11,
5586,
63,
18375,
3292,
397,
365,
397,
582,
3546,
65,
1870,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2495,
6083,
1133,
1462,
4705,
12,
2890,
16,
871,
1462,
4705,
4672,
327,
582,
11,
5586,
63,
18375,
3292,
397,
365,
397,
582,
3546,
65,
1870,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
rconfig.environ = environ | rconfig.environ = environ | def app (environ, start_response): '''A WSGI application.''' try: request = Request (environ) # The requested path. routes expects a utf-8 encoded str object. url = urllib.unquote (environ['PATH_INFO'][len (environ['SCRIPT_NAME']):]) rconfig = routes.request_config () rconfig.mapper = m # why? #rconfig.redirect = ? rconfig.environ = environ # means we dont' have to set the other properties try: route = m.match (url) if route == None: raise Http404 () try: view = globals ()[route.pop ('controller')] except KeyError: raise Exception ('Could not find controller "%s"' % (route['controller'])) route.pop ('action') # we don't use this r = view (request, **route) if not isinstance (r, Response): raise Exception ('Expected Response, got %s' % (type (r))) except Http404, e: r = ResponseNotFound ('not found\n') start_response (r.status, r._Response__headers) return r.data except Exception, e: traceback.print_exc (file = environ['wsgi.errors']) #start_response ('500 Internal Server Error', [('content-type', 'text/plain')], sys.exc_info ()) #return ['internal server error\n'] from cStringIO import StringIO s = StringIO () cgitb.Hook (file = s).handle () s.seek (0) start_response ('500 Internal Server Error', [('content-type', 'text/html')], sys.exc_info ()) return [s.read ()] | f230673a3c494d15cb1e8789e53507754ca76771 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7252/f230673a3c494d15cb1e8789e53507754ca76771/web.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
595,
261,
28684,
16,
787,
67,
2740,
4672,
9163,
37,
7649,
13797,
2521,
1093,
6309,
775,
30,
590,
273,
1567,
261,
28684,
13,
468,
1021,
3764,
589,
18,
4912,
10999,
279,
7718,
17,
28,
37... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
595,
261,
28684,
16,
787,
67,
2740,
4672,
9163,
37,
7649,
13797,
2521,
1093,
6309,
775,
30,
590,
273,
1567,
261,
28684,
13,
468,
1021,
3764,
589,
18,
4912,
10999,
279,
7718,
17,
28,
37... |
" --gps-start-time "+str(start)+\ " --gps-end-time "+str(end)+\ | " --gps-start-time "+str(int(start))+\ " --gps-end-time "+str(int(end))+\ | def grab_segments(start,end,flag): """ Returns a segmentlist containing the segments during which the given flag was active in the given period. """ #== construct segment query segment_cmd = "ligolw_segment_query --query-segments"+\ " --segment_url https://segdb.ligo.caltech.edu"+\ " --include-segments "+flag+\ " --gps-start-time "+str(start)+\ " --gps-end-time "+str(end)+\ ''' | ligolw_print -t segment -c start_time -c end_time --delimiter " "''' #== run segment query segs = GetCommandOutput(segment_cmd) #== construct segments as structure seglist=[] segs=segs.split('\n') for seg in segs: if seg=='': continue try: [seg_start,seg_end]=seg.split(' ') seglist.append(segment(int(seg_start),int(seg_end))) except: continue seglist = segmentlist([seglist]) return seglist | 60b65a7e57d28ab398b5333cb2466dd1465e30c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/60b65a7e57d28ab398b5333cb2466dd1465e30c8/dqSegmentUtils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11086,
67,
12838,
12,
1937,
16,
409,
16,
6420,
4672,
3536,
2860,
279,
3267,
1098,
4191,
326,
5155,
4982,
1492,
326,
864,
2982,
1703,
2695,
316,
326,
864,
3879,
18,
3536,
225,
468,
631,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11086,
67,
12838,
12,
1937,
16,
409,
16,
6420,
4672,
3536,
2860,
279,
3267,
1098,
4191,
326,
5155,
4982,
1492,
326,
864,
2982,
1703,
2695,
316,
326,
864,
3879,
18,
3536,
225,
468,
631,
... |
""" rep = self._group._gap_().ConjugacyClass(g).Representative() reps = [x.Representative() for x in gap(self._group).ConjugacyClasses()] return self._base_ring(self._gap_classfunction[reps.index(rep)+1]) | sage: G = SymmetricGroup(3) sage: h = G((2,3)) sage: triv = G.trivial_character() sage: triv(h) 1 """ return self._base_ring(gap(g)._operation("^", self._gap_classfunction)) | def __call__(self, g): """ Evaluate the character on the group element g. Returns an error if g is not in G. EXAMPLES: sage: G = GL(2,7) sage: values = list(gap(G).CharacterTable().Irr()[2]) sage: chi = ClassFunction(G, values) sage: z = G([[3,0],[0,3]]); z [3 0] [0 3] sage: chi(z) 1 sage: G = GL(2,3) sage: chi = G.irreducible_characters()[3] sage: g = G.conjugacy_class_representatives()[6] sage: chi(g) zeta8^3 + zeta8 """ rep = self._group._gap_().ConjugacyClass(g).Representative() reps = [x.Representative() for x in gap(self._group).ConjugacyClasses()] return self._base_ring(self._gap_classfunction[reps.index(rep)+1]) | 6eface29621553474e9d5371d318849e3c7a26aa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/6eface29621553474e9d5371d318849e3c7a26aa/class_function.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
314,
4672,
3536,
18176,
326,
3351,
603,
326,
1041,
930,
314,
18,
2860,
392,
555,
309,
314,
353,
486,
316,
611,
18,
225,
5675,
8900,
11386,
30,
272,
410,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
314,
4672,
3536,
18176,
326,
3351,
603,
326,
1041,
930,
314,
18,
2860,
392,
555,
309,
314,
353,
486,
316,
611,
18,
225,
5675,
8900,
11386,
30,
272,
410,
... |
print "export LD_LIBRARY_PATH="+BuildPkg.libdir print "export PYTHONPATH="+BuildPkg.libdir | print "export LD_LIBRARY_PATH="+BuildPkg.libdir+":$LD_LIBRARY_PATH" print "export PYTHONPATH="+BuildPkg.libdir+":$PYTHONPATH" | def main(): parser = OptionParser() parser.add_option("--build (default)", action="store_true", dest="build", help="Build sources.") parser.add_option("--test", action="store_true", dest="test", help="Run tests.") parser.add_option("--update", action="store_true", dest="update", help="Update sources from the subversion repository.") parser.add_option("--submit", action="store_true", dest="submit", help="Submit test and build results.") parser.add_option("--all", action="store_true", dest="all", help="Removes build directory then builds config and config-pkgs.") parser.add_option("-v", "--verbose", action="store_true", dest="verbose", help="verbose output") parser.add_option("--nocolor", action="store_true", dest="nocolor", help="Disable color output.") parser.add_option("--nightly", action="store_true", dest="nightly", help="Do nightly build and test.") (options, args) = parser.parse_args() build_utils.verbose = options.verbose srcpath = os.path.abspath(os.path.dirname(sys.argv[0])) if options.nocolor: build_utils.clear_colors() if options.nightly: options.all = options.update = options.test = options.submit = True if options.all: options.build = True cname = '' if len(args) == 1: cname = args[0] packages = options.all if cname.endswith('-pkgs'): where = cname.find("-pkgs") cname = cname[0:where] packages = True sources = False else: sources = True if cname == '' or not config.read(srcpath, cname, sources, packages): usage() if options.all: os.system("/bin/rm -rf %s" % os.path.join(os.getcwd(), "build-%s" % cname)) BuildPkg.setup(cname, srcpath) build_utils.run_commands('before',0) fix_path('PATH', BuildPkg.bindir, 1, 0) fix_path('PYTHONPATH', BuildPkg.libdir, 1, 0) fix_path('LD_LIBRARY_PATH', BuildPkg.libdir, 1, 0) os.environ['MEMOSA_HOME'] = BuildPkg.blddir bs = be = ts = te = 0 # if no options, default to build if not options.build and not options.test and not options.submit and not options.update: options.build = True if options.build: # Remove all test results. They are now invalid os.system("/bin/rm -f %s/*.xml" % BuildPkg.logdir) # UPDATE if options.update: update.update(BuildPkg, cname, options.nightly) # BUILDING build_failed = 0 if options.build: bs = time.time() open(BuildPkg.logdir+'/StartBuildTime','w').write(str(bs)) for p in BuildPkg.packages: x = config.config(p.name,'Build') if x == '' or not eval(x): build_utils.debug ("Skipping " + p.name) continue try: p.configure() p.build() p.install() except: build_failed = 1 break be = time.time() open(BuildPkg.logdir+'/EndBuildTime','w').write(str(be)) # Reread config file because we don't test or report compile errors on packages, only memosa sources if packages: config.read(srcpath, cname, True, False) # TESTING if not build_failed and options.test and not pbs.start(BuildPkg, cname): ts = time.time() open(BuildPkg.logdir+'/StartTestTime','w').write(str(ts)) try: testing.run_all_tests(BuildPkg) except: pass te = time.time() open(BuildPkg.logdir+'/EndTestTime','w').write(str(te)) # SUBMIT if options.submit: cdash.submit(BuildPkg, cname, sys.argv, options.nightly) build_utils.run_commands('after',0) if options.build and not build_failed: f = open(os.path.join(BuildPkg.topdir, 'env.sh'), 'w') print >>f, "export LD_LIBRARY_PATH="+BuildPkg.libdir print >>f, "export PYTHONPATH="+BuildPkg.libdir print >>f, "export PATH=%s:$PATH" % BuildPkg.bindir f.close print "\nDONE\nYou need to do the following to use the build." print "export LD_LIBRARY_PATH="+BuildPkg.libdir print "export PYTHONPATH="+BuildPkg.libdir print "export PATH=%s:$PATH" % BuildPkg.bindir print "OR source env.sh" fix_path('LD_LIBRARY_PATH', BuildPkg.libdir, 1, 1) fix_path('PYTHONPATH', BuildPkg.libdir, 1, 1) fix_path('PATH', BuildPkg.bindir, 1, 1) | bc2bb4be291670fa1da4487f1f19d664d92d44fe /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5963/bc2bb4be291670fa1da4487f1f19d664d92d44fe/make.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
225,
2082,
273,
18862,
1435,
2082,
18,
1289,
67,
3482,
2932,
413,
3510,
261,
1886,
2225,
16,
1301,
1546,
2233,
67,
3767,
3113,
1570,
1546,
3510,
3113,
2809,
1546,
3116,
5550,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
225,
2082,
273,
18862,
1435,
2082,
18,
1289,
67,
3482,
2932,
413,
3510,
261,
1886,
2225,
16,
1301,
1546,
2233,
67,
3767,
3113,
1570,
1546,
3510,
3113,
2809,
1546,
3116,
5550,
... |
[ob[field] for ob in obs], | [ob[fieldString] for ob in obs], | def __init__(self, xSize, ySize, xPadding, yPadding, xOffset, yOffset, xMin, xMax, yMin, yMax, xbin, ybin, xText, yText, ref, residue, querySet): | ad439b9482d995dc4c6b1723d32515ef05247abd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6163/ad439b9482d995dc4c6b1723d32515ef05247abd/ConfDistFuncs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
619,
1225,
16,
677,
1225,
16,
619,
9485,
16,
677,
9485,
16,
619,
2335,
16,
677,
2335,
16,
619,
2930,
16,
619,
2747,
16,
677,
2930,
16,
677,
2747,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
619,
1225,
16,
677,
1225,
16,
619,
9485,
16,
677,
9485,
16,
619,
2335,
16,
677,
2335,
16,
619,
2930,
16,
619,
2747,
16,
677,
2930,
16,
677,
2747,
16,
... |
field, field, milestone) | sql_escape(field), sql_escape(field), sql_escape(milestone)) | def get_tickets_for_milestone(env, db, milestone, field='component'): custom = field not in Ticket.std_fields cursor = db.cursor() sql = 'SELECT ticket.id AS id, ticket.status AS status, ' if custom: sql += 'ticket_custom.value AS %s ' \ 'FROM ticket LEFT OUTER JOIN ticket_custom ON id = ticket ' \ 'WHERE name = \'%s\' AND milestone = \'%s\'' % ( field, field, milestone) else: sql += 'ticket.%s AS %s FROM ticket WHERE milestone = \'%s\'' % ( field, field, milestone) cursor.execute(sql) tickets = [] while 1: row = cursor.fetchone() if not row: break ticket = { 'id': int(row['id']), 'status': row['status'], field: row[field] } tickets.append(ticket) return tickets | 42a161109cba100ba22cdd6f8b88abf7140638f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/42a161109cba100ba22cdd6f8b88abf7140638f8/Milestone.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
6470,
2413,
67,
1884,
67,
81,
18270,
12,
3074,
16,
1319,
16,
28664,
16,
652,
2218,
4652,
11,
4672,
1679,
273,
652,
486,
316,
22023,
18,
5084,
67,
2821,
3347,
273,
1319,
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,
336,
67,
6470,
2413,
67,
1884,
67,
81,
18270,
12,
3074,
16,
1319,
16,
28664,
16,
652,
2218,
4652,
11,
4672,
1679,
273,
652,
486,
316,
22023,
18,
5084,
67,
2821,
3347,
273,
1319,
18,
... |
Return the ideal with given gens over `\mathbf{Z}`. | Return the ideal with given gens over `\ZZ`. | def left_ideal(self, gens, check=True): r""" Return the ideal with given gens over `\mathbf{Z}`. | 1fe7e945a5e69662d3b79300c558387c31fea323 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/1fe7e945a5e69662d3b79300c558387c31fea323/quaternion_algebra.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2002,
67,
831,
287,
12,
2890,
16,
314,
773,
16,
866,
33,
5510,
4672,
436,
8395,
2000,
326,
23349,
598,
864,
314,
773,
1879,
1375,
64,
15949,
17156,
95,
62,
97,
8338,
2,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2002,
67,
831,
287,
12,
2890,
16,
314,
773,
16,
866,
33,
5510,
4672,
436,
8395,
2000,
326,
23349,
598,
864,
314,
773,
1879,
1375,
64,
15949,
17156,
95,
62,
97,
8338,
2,
-100,
-100,
-... |
def maybeBreak(self, iff=True, frameCount=1,displayPrefix=''): if self.shouldBreak(iff): | def maybeBreak(self, iff=True, test=None, frameCount=1, displayPrefix=''): if self.shouldBreak(iff=iff, test=test): | def maybeBreak(self, iff=True, frameCount=1,displayPrefix=''): if self.shouldBreak(iff): self.doBreak(frameCount=frameCount+1,displayPrefix=displayPrefix) | 3541d8d2ba2ad7bc9c6e220d903f141fed6f302d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7242/3541d8d2ba2ad7bc9c6e220d903f141fed6f302d/PythonUtil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6944,
7634,
12,
2890,
16,
21437,
33,
5510,
16,
1842,
33,
7036,
16,
2623,
1380,
33,
21,
16,
2562,
2244,
2218,
11,
4672,
309,
365,
18,
13139,
7634,
12,
3048,
33,
3048,
16,
1842,
33,
38... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6944,
7634,
12,
2890,
16,
21437,
33,
5510,
16,
1842,
33,
7036,
16,
2623,
1380,
33,
21,
16,
2562,
2244,
2218,
11,
4672,
309,
365,
18,
13139,
7634,
12,
3048,
33,
3048,
16,
1842,
33,
38... |
if self.document_class in ('book', 'report', 'scrartcl', 'scrbook'): | if self.document_class in ('book', 'report', 'scrreprt', 'scrbook'): | def section(self, level): """ Return the section name at the given level for the specific document class. | abbf3bf2dc7d274e37010ec1a063bc32f4361ff5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1278/abbf3bf2dc7d274e37010ec1a063bc32f4361ff5/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2442,
12,
2890,
16,
1801,
4672,
3536,
2000,
326,
2442,
508,
622,
326,
864,
1801,
364,
326,
2923,
1668,
667,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2442,
12,
2890,
16,
1801,
4672,
3536,
2000,
326,
2442,
508,
622,
326,
864,
1801,
364,
326,
2923,
1668,
667,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
fe.f.fig2dev(lang = eps) | fe.f.fig2dev(lang = "eps") | def saveEPS(self, basepath, *args, **kwargs): """display.saveEPS(basepath, geometry=None, scale=None) | c0ad2181e81666dffe105b07d4c3927ef5383839 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10394/c0ad2181e81666dffe105b07d4c3927ef5383839/mapdisplay.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
41,
5857,
12,
2890,
16,
23853,
16,
380,
1968,
16,
2826,
4333,
4672,
3536,
5417,
18,
5688,
41,
5857,
12,
1969,
803,
16,
5316,
33,
7036,
16,
3159,
33,
7036,
13,
2,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1923,
41,
5857,
12,
2890,
16,
23853,
16,
380,
1968,
16,
2826,
4333,
4672,
3536,
5417,
18,
5688,
41,
5857,
12,
1969,
803,
16,
5316,
33,
7036,
16,
3159,
33,
7036,
13,
2,
-100,
-100,
-1... |
dict["Mask"] = PDFArray(self.mask) | if self.mask=='auto': if PILImage.info.has_key("transparency") : transparency = PILImage.info["transparency"] * 3 (tred, tgreen, tblue) = map(ord, PILImage.palette.data[transparency:transparency+3]) self.mask = (tred, tred, tgreen, tgreen, tblue, tblue) dict["Mask"] = PDFArray(self.mask) else: dict["Mask"] = PDFArray(self.mask) | def format(self, document): S = PDFStream() S.content = self.streamContent dict = S.dictionary dict["Type"] = PDFName("XObject") dict["Subtype"] = PDFName("Image") dict["Width"] = self.width dict["Height"] = self.height dict["BitsPerComponent"] = self.bitsPerComponent dict["ColorSpace"] = PDFName(self.colorSpace) dict["Filter"] = PDFArray( [PDFName('ASCII85Decode'), PDFName('FlateDecode')]) dict["Length"] = len(self.streamContent) if self.mask: dict["Mask"] = PDFArray(self.mask) return S.format(document) | 165f597d1c3177ed3af75f4afc9562e6bb26b4c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/165f597d1c3177ed3af75f4afc9562e6bb26b4c1/pdfdoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
12,
2890,
16,
1668,
4672,
348,
273,
12667,
1228,
1435,
348,
18,
1745,
273,
365,
18,
3256,
1350,
225,
2065,
273,
348,
18,
15556,
2065,
9614,
559,
11929,
273,
12667,
461,
2932,
60,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
12,
2890,
16,
1668,
4672,
348,
273,
12667,
1228,
1435,
348,
18,
1745,
273,
365,
18,
3256,
1350,
225,
2065,
273,
348,
18,
15556,
2065,
9614,
559,
11929,
273,
12667,
461,
2932,
60,
... |
return self.abandon.ext(msgid,None,None) | return self.abandon_ext(msgid,None,None) | def abandon(self,msgid): return self.abandon.ext(msgid,None,None) | 723266cb66c35f41d6e87a4e2b5bb9881729ccad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4610/723266cb66c35f41d6e87a4e2b5bb9881729ccad/ldapobject.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1223,
464,
265,
12,
2890,
16,
3576,
350,
4672,
327,
365,
18,
378,
464,
265,
18,
408,
12,
3576,
350,
16,
7036,
16,
7036,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1223,
464,
265,
12,
2890,
16,
3576,
350,
4672,
327,
365,
18,
378,
464,
265,
18,
408,
12,
3576,
350,
16,
7036,
16,
7036,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
scfg.chan_umodes.friendly[old_infoindex], scfg.chan_umodes.friendly[new_infoindex])) | friendly_change)) | def setChannelUserModes(self, whoset, u, changes): # changes: dict of {mode -> on_off} if u not in self.chanusers: LOG.error("setChannelUserModes: %r not in channel." % u) return | 28552e6b9686a6e16c9ab7f9b816efbb53081fa9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11503/28552e6b9686a6e16c9ab7f9b816efbb53081fa9/bridge_server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
2909,
1299,
18868,
12,
2890,
16,
600,
538,
278,
16,
582,
16,
3478,
4672,
468,
3478,
30,
2065,
434,
288,
3188,
317,
603,
67,
3674,
97,
309,
582,
486,
316,
365,
18,
7472,
5577,
30... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
2909,
1299,
18868,
12,
2890,
16,
600,
538,
278,
16,
582,
16,
3478,
4672,
468,
3478,
30,
2065,
434,
288,
3188,
317,
603,
67,
3674,
97,
309,
582,
486,
316,
365,
18,
7472,
5577,
30... |
r'([-\w_]+)|(>=)|>|\+|\*|/' | r'([-\w_\.]+)|(>=)|>|\+|\*|/' | def t_NAME(t): r'([-\w_]+)|(>=)|>|\+|\*|/' try: t.value = int(t.value) t.type = 'NUM' return t except ValueError: # not a number if t.value.lower() == 'or': t.type = 'OR' elif t.value.lower() == 'not': t.type = 'NOT' | e97b2dd74b4abb2bb757308ada375b5cbb3c3f4c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7008/e97b2dd74b4abb2bb757308ada375b5cbb3c3f4c/gdllex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
67,
1985,
12,
88,
4672,
436,
11,
3816,
6943,
91,
67,
5834,
7941,
96,
12,
34,
33,
14047,
34,
8960,
15,
8960,
14,
96,
2473,
225,
775,
30,
268,
18,
1132,
273,
509,
12,
88,
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,
268,
67,
1985,
12,
88,
4672,
436,
11,
3816,
6943,
91,
67,
5834,
7941,
96,
12,
34,
33,
14047,
34,
8960,
15,
8960,
14,
96,
2473,
225,
775,
30,
268,
18,
1132,
273,
509,
12,
88,
18,
... |
2.6926198853 - 0.020386029602*I | 2.69261988 - 0.0203860296*I | def value(self, s, L=''): r""" Return $L(s)$ for $s$ a complex number. | 3439bf1261f4d906a8f8f8452f7f4b0d582f4af1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9417/3439bf1261f4d906a8f8f8452f7f4b0d582f4af1/lcalc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
460,
12,
2890,
16,
272,
16,
511,
2218,
11,
4672,
436,
8395,
2000,
271,
48,
12,
87,
21877,
364,
271,
87,
8,
279,
7233,
1300,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
460,
12,
2890,
16,
272,
16,
511,
2218,
11,
4672,
436,
8395,
2000,
271,
48,
12,
87,
21877,
364,
271,
87,
8,
279,
7233,
1300,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
print "Available tools are:" | print "Tools:" | def create_tooldoc(tool_name): description = 'HTML generator for Robot Framework Tool Documentation.' stylesheet_path = os.path.join(BASEDIR, '..', 'doc', 'userguide', 'src', 'userguide.css') base_path = os.path.join(tool_name, 'doc', tool_name) arguments = [ '--time', '--stylesheet-path=%s' % stylesheet_path, base_path + '.txt', base_path + '.html' ] publish_cmdline(writer_name='html', description=description, argv=arguments) print os.path.abspath(arguments[-1]) | 63e82b02142bd02f2a94aae55a9961ea7649973a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7408/63e82b02142bd02f2a94aae55a9961ea7649973a/tooldoc2html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
869,
1673,
504,
12,
6738,
67,
529,
4672,
2477,
273,
296,
4870,
4456,
364,
19686,
352,
13472,
13288,
20495,
1093,
13820,
67,
803,
273,
1140,
18,
803,
18,
5701,
12,
8369,
4537,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
869,
1673,
504,
12,
6738,
67,
529,
4672,
2477,
273,
296,
4870,
4456,
364,
19686,
352,
13472,
13288,
20495,
1093,
13820,
67,
803,
273,
1140,
18,
803,
18,
5701,
12,
8369,
4537,
... |
raise Redirect, url | raise exceptions.Redirect, url | def handle(self): """Perform an edit of an item in the database. | 7b35d0c71d26a7290bec5255325716330d7a66bf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/7b35d0c71d26a7290bec5255325716330d7a66bf/actions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
12,
2890,
4672,
3536,
4990,
392,
3874,
434,
392,
761,
316,
326,
2063,
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,
1640,
12,
2890,
4672,
3536,
4990,
392,
3874,
434,
392,
761,
316,
326,
2063,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
else | else: | def __init__(data = None) if data == None: quickfix.StringField.__init__(self, 467) else quickfix.StringField.__init__(self, 467, 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,
1059,
9599,
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,
1059,
9599,
13,
469,
30,
9549,
904,
18,
780,
974,
16186,
2738... |
sys.exit(0) | def _help(arg): """ Display a speficied help message, and exit. @param arg: The name of the help message to display. Currently, only C{"css"} and C{"usage"} are recognized. @type arg: C{string} @rtype: C{None} """ arg = arg.strip().lower() if arg == 'css': from epydoc.css import STYLESHEETS print '\nThe following built-in CSS stylesheets are available:' names = STYLESHEETS.keys() names.sort() maxlen = max(*[len(name) for name in names]) format = ' %'+`-maxlen-1`+'s %s' for name in names: print format % (name, STYLESHEETS[name][1]) print sys.exit(0) elif arg == 'version': _version() elif arg in ('docformat', 'doc_format', 'doc-format'): print '\n__docformat__ is a module variable that specifies the markup' print 'language for the docstrings in a module. Its value is a ' print 'string, consisting the name of a markup language, optionally ' print 'followed by a language code (such as "en" for English). Epydoc' print 'currently recognizes the following markup language names:' import objdoc for format in objdoc.KNOWN_DOCFORMATS: print ' - %s' % format print sys.exit(0) else: _usage(0) | 5397b1945fdf3feb9813ef60349d76c37defaafe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/5397b1945fdf3feb9813ef60349d76c37defaafe/cli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5201,
12,
3175,
4672,
3536,
9311,
279,
17785,
74,
335,
2092,
2809,
883,
16,
471,
2427,
18,
225,
632,
891,
1501,
30,
1021,
508,
434,
326,
2809,
883,
358,
2562,
18,
225,
15212,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5201,
12,
3175,
4672,
3536,
9311,
279,
17785,
74,
335,
2092,
2809,
883,
16,
471,
2427,
18,
225,
632,
891,
1501,
30,
1021,
508,
434,
326,
2809,
883,
358,
2562,
18,
225,
15212,
16,
... | |
class Translator(TranslationContext): def __init__(self, func, **flowing_flags): super(Translator, self).__init__(**flowing_flags) self.entrypoint = func def __getstate__(self): XXX return self.entrypoint, self.functions, self.__dict__ def __setstate__(self, args): XXX assert len(args) == 3 self.__dict__.update(args[2]) assert args[0] is self.entrypoint and args[1] is self.functions def gv(self): """Shows the control flow graph -- requires 'dot' and 'gv'.""" import os from pypy.translator.tool.make_dot import make_dot, make_dot_graphs graphs = [] for graph in self.graphs: graphs.append((graph.name, graph)) dest = make_dot_graphs(self.entrypoint.__name__, graphs) os.system('gv %s' % str(dest)) def simplify(self, passes=True): """Simplifies all the control flow graphs.""" for graph in self.graphs: simplify_graph(graph, passes) def annotate(self, input_args_types, policy=None): """annotate(self, input_arg_types) -> Annotator Provides type information of arguments. Returns annotator. """ annotator = self.buildannotator(policy) annotator.build_types(self.entrypoint, input_args_types) return annotator def specialize(self, **flags): rtyper = self.buildrtyper( type_system=flags.pop("type_system", "lltype")) rtyper.specialize(**flags) def backend_optimizations(self, **kwds): from pypy.translator.backendopt.all import backend_optimizations backend_optimizations(self, **kwds) def source(self): """Returns original Python source. Returns <interactive> for functions written during the interactive session. """ FIX_ME return self.entrypointgraph.source def pyrex(self, input_arg_types=None, func=None): """pyrex(self[, input_arg_types][, func]) -> Pyrex translation Returns Pyrex translation. If input_arg_types is provided, returns type annotated translation. Subsequent calls are not affected by this. """ FIX_ME from pypy.translator.pyrex.genpyrex import GenPyrex return self.generatecode(GenPyrex, input_arg_types, func) def cl(self, input_arg_types=None, func=None): """cl(self[, input_arg_types][, func]) -> Common Lisp translation Returns Common Lisp translation. If input_arg_types is provided, returns type annotated translation. Subsequent calls are not affected by this. """ FIX_ME from pypy.translator.gencl import GenCL return self.generatecode(GenCL, input_arg_types, func) def c(self): """c(self) -> C (CPython) translation Returns C (CPython) translation. """ FIX_ME from pypy.translator.c import genc from cStringIO import StringIO f = StringIO() database, ignored = genc.translator2database(self) genc.gen_readable_parts_of_main_c_file(f, database) return f.getvalue() def llvm(self): """llvm(self) -> LLVM translation Returns LLVM translation. """ FIX_ME from pypy.translator.llvm.genllvm import GenLLVM if self.annotator is None: raise ValueError, "function has to be annotated." gen = GenLLVM(self) filename = gen.gen_llvm_source() f = open(str(filename), "r") result = f.read() f.close() return result def generatecode(self, gencls, input_arg_types, func): if input_arg_types is None: ann = self.annotator else: from pypy.annotation.annrpython import RPythonAnnotator ann = RPythonAnnotator(self) if func is None: codes = [self.generatecode1(gencls, input_arg_types, self.entrypoint, ann)] for func in self.functions: if func is not self.entrypoint: code = self.generatecode1(gencls, None, func, ann, public=False) codes.append(code) else: codes = [self.generatecode1(gencls, input_arg_types, func, ann)] code = self.generateglobaldecl(gencls, func, ann) if code: codes.insert(0, code) return '\n\n def generatecode1(self, gencls, input_arg_types, func, ann, public=True): graph = self.getflowgraph(func) g = gencls(graph) g.by_the_way_the_function_was = func if input_arg_types is not None: ann.build_types(graph, input_arg_types, func) if ann is not None: g.setannotator(ann) return g.emitcode(public) def generateglobaldecl(self, gencls, func, ann): graph = self.getflowgraph(func) g = gencls(graph) if ann is not None: g.setannotator(ann) return g.globaldeclarations() def pyrexcompile(self): """Returns compiled function, compiled using Pyrex. """ FIX_ME from pypy.translator.tool.cbuild import make_module_from_pyxstring from pypy.tool.udir import udir name = self.entrypoint.func_name pyxcode = self.pyrex() mod = make_module_from_pyxstring(name, udir, pyxcode) return getattr(mod, name) def compile(self, compiler='c', **kw): compiler += 'compile' if hasattr(self, compiler): compiler = getattr(self,compiler) return compiler(**kw) else: raise NotImplementedError, "Compiler not known", compiler def ccompile(self, really_compile=True, standalone=False, gcpolicy=None): """Returns compiled function (living in a new C-extension module), compiled using the C generator. """ FIX_ME cbuilder = self.cbuilder(standalone=standalone, gcpolicy=gcpolicy) c_source_filename = cbuilder.generate_source() if not really_compile: return c_source_filename cbuilder.compile() if standalone: return cbuilder.executable_name cbuilder.import_module() return cbuilder.get_entry_point() def cbuilder(self, standalone=False, gcpolicy=None, thread_enabled=False): FIX_ME from pypy.translator.c import genc if standalone: return genc.CStandaloneBuilder(self, gcpolicy=gcpolicy, thread_enabled=thread_enabled) else: return genc.CExtModuleBuilder(self, gcpolicy=gcpolicy, thread_enabled=thread_enabled) def llvmcompile(self, really_compile=True, standalone=False, optimize=True, exe_name=None, gcpolicy=None): """llvmcompile(self, really_compile=True, standalone=False, optimize=True) -> LLVM translation Returns LLVM translation with or without optimization. """ FIX_ME from pypy.translator.llvm import genllvm if self.annotator is None: raise ValueError, "function has to be annotated." if standalone: if not exe_name: exe_name = self.entrypoint.__name__ else: exe_name = None return genllvm.genllvm(self, really_compile=really_compile, standalone=standalone, optimize=optimize, exe_name=exe_name, gcpolicy=gcpolicy) def asmcompile(self, processor='virt'): FIX_ME from pypy.translator.asm import genasm assert processor in ['ppc', 'virt', 'virtfinite'] assert self.rtyper is not None, 'must specialize' graph = graphof(self, self.entrypoint) return genasm.genasm(graph, processor) def call(self, *args): """Calls underlying Python function.""" return self.entrypoint(*args) def dis(self): """Disassembles underlying Python function to bytecodes.""" from dis import dis dis(self.entrypoint) | def graphof(translator, func): result = [] for graph in translator.graphs: if getattr(graph, 'func', None) is func: result.append(graph) assert len(result) == 1 return result[0] | 9caab5385b719397e221160507ac08436621f559 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/9caab5385b719397e221160507ac08436621f559/translator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2667,
792,
12,
17879,
16,
1326,
4672,
563,
273,
5378,
364,
2667,
316,
8333,
18,
30016,
30,
309,
3869,
12,
4660,
16,
296,
644,
2187,
599,
13,
353,
1326,
30,
563,
18,
6923,
12,
4660,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2667,
792,
12,
17879,
16,
1326,
4672,
563,
273,
5378,
364,
2667,
316,
8333,
18,
30016,
30,
309,
3869,
12,
4660,
16,
296,
644,
2187,
599,
13,
353,
1326,
30,
563,
18,
6923,
12,
4660,
1... | |
audioDecoder = 'a52dec name=%s ! audioconvert ! audioscale !' \ % sinkName | audioDecoder = 'seamless-a52dec name=%s ! audioconvert ! ' \ 'audioscale !' % sinkName | def __init__(self, options, name="player"): gst.Thread.__init__(self, name) | fd2fd8a6006a60b0e31b0840b2d4e4f0e6174a41 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5222/fd2fd8a6006a60b0e31b0840b2d4e4f0e6174a41/dvdplayer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
702,
16,
508,
1546,
14872,
6,
4672,
314,
334,
18,
3830,
16186,
2738,
972,
12,
2890,
16,
508,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
702,
16,
508,
1546,
14872,
6,
4672,
314,
334,
18,
3830,
16186,
2738,
972,
12,
2890,
16,
508,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
agentSite = classAdAgent.getAttributeString('Site')[0] agentRequirements = classAdAgent.get_expression("Requirements") if not agentRequirements: classAdAgent.insertAttributeBool("Requirements", 'True') fields = agentRequirements.split() | agentSite = classAdAgent.getAttributeString('Site') if not classAdAgent.lookupAttribute("Requirements"): classAdAgent.insertAttributeBool("Requirements", True) agentRequirements = classAdAgent.get_expression("Requirements") else: agentRequirements = classAdAgent.get_expression("Requirements") | def selectJob(self, resourceJDL): """ Main job selection function to find the highest priority job matching the resource capacity """ | efa72d039ea8335d5706043f0e4af017355dbdd3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12864/efa72d039ea8335d5706043f0e4af017355dbdd3/MatcherHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2027,
2278,
12,
2890,
16,
1058,
46,
8914,
4672,
3536,
12740,
1719,
4421,
445,
358,
1104,
326,
9742,
4394,
1719,
3607,
326,
1058,
7519,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2027,
2278,
12,
2890,
16,
1058,
46,
8914,
4672,
3536,
12740,
1719,
4421,
445,
358,
1104,
326,
9742,
4394,
1719,
3607,
326,
1058,
7519,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
log('%s not found, skipping startup performance tests' % t) log('NOTE: %s is not part of OS X, you need to compile one' + \ | log('gtime not found, skipping startup performance tests') log('NOTE: gtime is not part of OS X, you need to compile one' + \ | def runPerfTests(options, tests=None): """ Run the Performance Test Suite >>> options = parseOptions() >>> checkOptions(options) >>> options.dryrun = True >>> options.verbose = True >>> options.modes = ['debug'] >>> runPerfTests(options) Skipping Performance Tests - release mode not specified False >>> options.modes = ['release'] >>> runPerfTests(options) /.../release/RunChandler... --catch=tests --profileDir=.../test_profile --parcelPath=.../tools/QATestScripts/DataFiles --catsPerfLog=.../test_profile/time.log --scriptFile=tools/QATestScripts/Performance/PerfImportCalendar.py --create PerfImportCalendar.py | 0.00 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + ... /.../release/RunChandler --catch=tests --profileDir=.../test_profile --parcelPath=.../tools/QATestScripts/DataFiles --catsPerfLog=.../test_profile/time.log --scriptFile=tools/QATestScripts/Performance/PerfLargeDataResizeCalendar.py --restore=.../test_profile/__repository__.001 PerfLargeDataResizeCalendar.py | 0.00 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + ... Creating repository for startup time tests ... Startup ... ... Creating repository for startup time tests ... Startup_with_large_calendar ... ... Showing performance log in 5 seconds, Ctrl+C to stop tests - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + False """ failed = False savePWD = os.getcwd() try: if 'release' in options.modes: delayedLogger = DelayedLogger() if not options.dryrun: os.chdir(options.chandlerHome) if tests is None: for item in glob.glob(os.path.join(options.profileDir, '__repository__.0*')): if os.path.isdir(item): build_lib.rmdirs(item) else: os.remove(item) testlist = [] testlistLarge = [] if tests is None: testlistStartup = ['startup', 'startup_large'] for item in glob.glob(os.path.join(options.chandlerHome, 'tools', 'QATestScripts', 'Performance', 'Perf*.py')): if 'PerfLargeData' in item: testlistLarge.append(item) else: testlist.append(item) else: testlistStartup = [] for item in tests: if 'PerfLargeData' in item: testlistLarge.append(item) elif item in ('startup', 'startup_large'): testlistStartup.append(item) else: testlist.append(item) # small repo tests if testlist: failed = runScriptPerfTests(options, testlist, logger=delayedLogger) # large repo tests if testlistLarge and (not failed or options.noStop): if runScriptPerfTests(options, testlistLarge, largeData=True, logger=delayedLogger): failed = True # startup tests if testlistStartup and (not failed or options.noStop): if os.name == 'nt' or sys.platform == 'cygwin': t = 'time.exe' elif sys.platform == 'darwin': t = build_lib.getCommand(['which', 'gtime']) if not t: log('%s not found, skipping startup performance tests' % t) log('NOTE: %s is not part of OS X, you need to compile one' + \ 'yourself (get source from http://directory.fsf.org/time.html)' + \ 'or get it from darwinports project.' % t) else: t = '/usr/bin/time' if os.path.isfile(t): if 'startup' in testlistStartup and runStartupPerfTests(options, t, logger=delayedLogger): failed = True if not failed: # Don't continue even if noStop, almost certain these won't work if 'startup_large' in testlistStartup and runStartupPerfTests(options, t, largeData=True, logger=delayedLogger): failed = True else: log('%s not found, skipping startup performance tests' % t) if not tests: log('Showing performance log in 5 seconds, Ctrl+C to stop tests') if not options.dryrun: try: time.sleep(5) except KeyboardInterrupt: sys.exit(0) log('- + ' * 15) delayedLogger.logAll() else: log('Skipping Performance Tests - release mode not specified') finally: os.chdir(savePWD) return failed | 58706c198c72ae85bd163dd339d4081bdd26b7be /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/58706c198c72ae85bd163dd339d4081bdd26b7be/rt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
22016,
14650,
12,
2116,
16,
7434,
33,
7036,
4672,
3536,
1939,
326,
11217,
1359,
7766,
348,
9519,
225,
4080,
702,
273,
1109,
1320,
1435,
4080,
866,
1320,
12,
2116,
13,
4080,
702,
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,
1086,
22016,
14650,
12,
2116,
16,
7434,
33,
7036,
4672,
3536,
1939,
326,
11217,
1359,
7766,
348,
9519,
225,
4080,
702,
273,
1109,
1320,
1435,
4080,
866,
1320,
12,
2116,
13,
4080,
702,
18... |
segmentListStart = segmentList.__getitem__(1).start() | segmentListStart = segmentList.__getitem__(0).start() | def getQscanBackgroundTimes(cp, opts, ifo, dq_url_pattern, segFile): times = [] fileName = '' if cp.has_option('followup-background-qscan-times',ifo+'range'): rangeString = string.strip(cp.get('followup-background-qscan-times',ifo+'range')) else: rangeString = '' if cp.has_option('followup-background-qscan-times',ifo+'segment-list'): segmentListFile = string.strip(cp.get('followup-background-qscan-times',ifo+'segment-list')) else: segmentListFile = '' if cp.has_option('followup-background-qscan-times',ifo+'time-list'): timeListFile = string.strip(cp.get('followup-background-qscan-times',ifo+'time-list')) else: timeListFile = '' if len(rangeString) == 0 and len(segmentListFile) == 0 and len(timeListFile) == 0: print "No qscan background specified for " + ifo else: # Generate the list of science segments (excluding cat 1 vetoes) if a time range is provided in the ini file if not len(rangeString) == 0: epochStart = rangeString.split(',')[0] epochEnd = rangeString.split(',')[1] opts.gps_start_time = int(epochStart) opts.gps_end_time = int(epochEnd) opts.use_available_data = False opts.run_data_quality = False # overwrite the ini file if the field "analyze" in section [segments] exist... cp.set("segments", "analyze", "Science") inspiralutils.findSegmentsToAnalyze(cp,opts,ifo,dq_url_pattern,segFile) segmentListFile = segFile[ifo] # Use the segment list if provided, and generate a list of random times if not len(segmentListFile) == 0: segmentList = pipeline.ScienceData() segmentMin = cp.getint('followup-background-qscan-times','segment-min-len') segmentList.read(segmentListFile,segmentMin) segmentListLength = segmentList.__len__() segmentListStart = segmentList.__getitem__(1).start() segmentListEnd = segmentList.__getitem__(segmentListLength - 1).end() seed = cp.getint('followup-background-qscan-times','random-seed') statistics = cp.getint('followup-background-qscan-times','background-statistics') random.seed(seed) counter = 0 times = [] while counter < statistics: gps = float(segmentListStart) + float(segmentListEnd - segmentListStart)*random.random() testList = copy.deepcopy(segmentList) secondList = [pipeline.ScienceSegment(tuple([0,int(gps),int(gps)+1,1]))] if testList.intersection(secondList): times.append(gps) counter = counter + 1 else: continue # Save the list of times in a file (for possibly re-using it later) timeList = floatToStringList(times) fileName = "timeList-" + ifo + "-" + repr(seed) + "-" + repr(statistics) + "-" + repr(segmentListStart) + "-" + repr(segmentListEnd) + ".txt" saveRandomTimes(timeList,fileName) # Use the time-list file if provided if len(segmentListFile) == 0 and not len(timeListFile) == 0: timeList = listFromFile(timeListFile) fileName = timeListFile if not timeList: print >> sys.stderr, "the list of times in file " + timeListFile + " could not be found" sys.exit(1) times = stringToFloatList(timeList) return times, fileName | e6c4c3774ddb936854295be20ed94c625e83e873 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5758/e6c4c3774ddb936854295be20ed94c625e83e873/fu_utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23413,
9871,
8199,
10694,
12,
4057,
16,
1500,
16,
21479,
16,
20803,
67,
718,
67,
4951,
16,
2291,
812,
4672,
4124,
273,
5378,
3968,
273,
875,
225,
309,
3283,
18,
5332,
67,
3482,
2668,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23413,
9871,
8199,
10694,
12,
4057,
16,
1500,
16,
21479,
16,
20803,
67,
718,
67,
4951,
16,
2291,
812,
4672,
4124,
273,
5378,
3968,
273,
875,
225,
309,
3283,
18,
5332,
67,
3482,
2668,
1... |
self.logger.debug('Setting state to true for pkg %s' % (entry.get('name'))) | self.logger.debug('Setting state to true for pkg %s' % \ (entry.get('name'))) | def Install(self, packages, states): """ Run a one-pass install, followed by single pkg installs in case of failure. """ self.logger.info("Trying single pass package install for pkgtype %s" % \ self.pkgtype) | decb4dd187c808e2f1c0ff7040e914abc7adeae2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/decb4dd187c808e2f1c0ff7040e914abc7adeae2/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10284,
12,
2890,
16,
5907,
16,
5493,
4672,
3536,
1939,
279,
1245,
17,
5466,
3799,
16,
10860,
635,
2202,
3475,
31011,
316,
648,
434,
5166,
18,
3536,
365,
18,
4901,
18,
1376,
2932,
18038,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10284,
12,
2890,
16,
5907,
16,
5493,
4672,
3536,
1939,
279,
1245,
17,
5466,
3799,
16,
10860,
635,
2202,
3475,
31011,
316,
648,
434,
5166,
18,
3536,
365,
18,
4901,
18,
1376,
2932,
18038,
... |
total = '%.2f'%(tsum[f]) txt = str(total or '') else : txt = str(tsum[f] or '') | prec = '%.' + str(tools.config['price_accuracy']) + 'f' total = prec%(tsum[f]) txt = str(total or '') col.set('tree','float') else: txt = str(tsum[f] or '') | def _append_node(name, text): n = etree.Element(name) n.text = text config.append(n) | f103438485b11e84b5534d0115056b7083878c22 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12853/f103438485b11e84b5534d0115056b7083878c22/ps_list.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6923,
67,
2159,
12,
529,
16,
977,
4672,
290,
273,
12031,
18,
1046,
12,
529,
13,
290,
18,
955,
273,
977,
642,
18,
6923,
12,
82,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6923,
67,
2159,
12,
529,
16,
977,
4672,
290,
273,
12031,
18,
1046,
12,
529,
13,
290,
18,
955,
273,
977,
642,
18,
6923,
12,
82,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if linkmatch: if not lit_val in links[key]: continue | def can_be_read(name): return request.user.may.read(name) | 31815a99ea38e84014fb4a22176fe9d6df42af23 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/888/31815a99ea38e84014fb4a22176fe9d6df42af23/editing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
848,
67,
2196,
67,
896,
12,
529,
4672,
327,
590,
18,
1355,
18,
24877,
18,
896,
12,
529,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
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,
848,
67,
2196,
67,
896,
12,
529,
4672,
327,
590,
18,
1355,
18,
24877,
18,
896,
12,
529,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... | |
def keyRightCallback(self, configPath): currentConfigPath = self["config"].getCurrent()[1].parent.getConfigPath() if (currentConfigPath == configPath): self.keyRight() | config.timerentry.weekday = configElement_nonSave("config.timerentry.weekday", configDateTime, time(), ("%A", 86400)) | def keyRightCallback(self, configPath): currentConfigPath = self["config"].getCurrent()[1].parent.getConfigPath() # check if we are still on the same config entry if (currentConfigPath == configPath): self.keyRight() | aceb62aeebc259a4da520b303a31a6a174d9400a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/aceb62aeebc259a4da520b303a31a6a174d9400a/TimerEntry.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
498,
4726,
2428,
12,
2890,
16,
16012,
4672,
783,
22341,
273,
365,
9614,
1425,
6,
8009,
588,
3935,
1435,
63,
21,
8009,
2938,
18,
588,
22341,
1435,
468,
866,
309,
732,
854,
4859,
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,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
498,
4726,
2428,
12,
2890,
16,
16012,
4672,
783,
22341,
273,
365,
9614,
1425,
6,
8009,
588,
3935,
1435,
63,
21,
8009,
2938,
18,
588,
22341,
1435,
468,
866,
309,
732,
854,
4859,
603,
32... |
def _get_namespace(self): return self.__namespace or default_namespace | def _get_namespace(self): if isinstance(self.__namespace, N.ndarray): return self.__namespace else: return self.__namespace or default_namespace | def _get_namespace(self): return self.__namespace or default_namespace | 58d9f655e8cd3933b0b78fa33758e7170e41e0aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/58d9f655e8cd3933b0b78fa33758e7170e41e0aa/formula.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
4937,
12,
2890,
4672,
225,
327,
365,
16186,
4937,
578,
805,
67,
4937,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
4937,
12,
2890,
4672,
225,
327,
365,
16186,
4937,
578,
805,
67,
4937,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
def revertButton_clicked(self, widget): | def revertButton_clicked(self, widget=None): | def revertButton_clicked(self, widget): self.check_if_changed() self.import_mode = False widget.hide() self.load_contacts() | d146007907c6581d8d80f2f60d1a7f1efdee1728 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2651/d146007907c6581d8d80f2f60d1a7f1efdee1728/arkadas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15226,
3616,
67,
7475,
329,
12,
2890,
16,
3604,
33,
7036,
4672,
365,
18,
1893,
67,
430,
67,
6703,
1435,
365,
18,
5666,
67,
3188,
273,
1083,
3604,
18,
11248,
1435,
365,
18,
945,
67,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
15226,
3616,
67,
7475,
329,
12,
2890,
16,
3604,
33,
7036,
4672,
365,
18,
1893,
67,
430,
67,
6703,
1435,
365,
18,
5666,
67,
3188,
273,
1083,
3604,
18,
11248,
1435,
365,
18,
945,
67,
2... |
if self.data_type=='string': return wsq(str(value)) if self.data_type=='bool': return wsq(bool2tf(value)) if self.data_type=='date': return wsq(str(value)) if self.data_type=='time': return wsq(str(value)) if self.data_type=='created': return wsq(str(value)) if self.data_type=='updated': return wsq(now_string()) if self.data_type=='creator': return wsq(value) if self.data_type=='updater': return wsq(value) print 'ERROR: Unrecognized data type definition' print 'Data= ' + str(key) print 'Data Type (INVALID): ' + str(data_type) sys.exit(1) | elif self.data_type=='string': return wsq(str(value)) elif self.data_type=='bool': return wsq(bool2tf(value)) elif self.data_type=='date': return wsq(str(value)) elif self.data_type=='time': return wsq(str(value)) elif self.data_type=='created': return wsq(str(value)) elif self.data_type=='updated': return wsq(now_string()) elif self.data_type=='creator': return wsq(value) elif self.data_type=='updater': return wsq(value) else : raise UnknownFieldType('Unrecognized data type definition ' 'data= %s invalid type=%s' % (key,self.data_type)) | def attr_to_field(self, value): if self.data_type in ('sequence', 'int', 'float'): if self.nullable==1 and value==0: return 'NULL' else: return str(value) if self.data_type=='string': return wsq(str(value)) if self.data_type=='bool': return wsq(bool2tf(value)) if self.data_type=='date': return wsq(str(value)) if self.data_type=='time': return wsq(str(value)) if self.data_type=='created': return wsq(str(value)) if self.data_type=='updated': return wsq(now_string()) if self.data_type=='creator': return wsq(value) if self.data_type=='updater': return wsq(value) print 'ERROR: Unrecognized data type definition' print 'Data= ' + str(key) print 'Data Type (INVALID): ' + str(data_type) sys.exit(1) | 786f0660cc94d22dfb25275f61de54a927e70323 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6947/786f0660cc94d22dfb25275f61de54a927e70323/base.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1604,
67,
869,
67,
1518,
12,
2890,
16,
460,
4672,
309,
365,
18,
892,
67,
723,
316,
7707,
6178,
2187,
296,
474,
2187,
296,
5659,
11,
4672,
309,
365,
18,
20247,
631,
21,
471,
460,
631,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1604,
67,
869,
67,
1518,
12,
2890,
16,
460,
4672,
309,
365,
18,
892,
67,
723,
316,
7707,
6178,
2187,
296,
474,
2187,
296,
5659,
11,
4672,
309,
365,
18,
20247,
631,
21,
471,
460,
631,... |
<link rel="icon" type="image/png" href="%simages/favicon.png"/> | <link rel="shortcut icon" type="image/png" href="%simages/favicon.png"/> | def producehtml(name, debug): ui = pages.UIs[name] js = jslist(name, debug) css = csslist(name, debug, gen=True) csshtml = "\n".join(" <link rel=\"stylesheet\" href=\"%s%s\" type=\"text/css\"/>" % (config.STATIC_BASE_URL, x) for x in css) jshtml = "\n".join(" <script type=\"text/javascript\" src=\"%s%s\"></script>" % (config.STATIC_BASE_URL, x) for x in js) div = ui.get("div", "") customjs = ui.get("customjs", "") return """%s | 14ab38640e5d128a1c3169632eaae2c36b7122fe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3337/14ab38640e5d128a1c3169632eaae2c36b7122fe/pagegen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11402,
2620,
12,
529,
16,
1198,
4672,
5915,
273,
4689,
18,
57,
2520,
63,
529,
65,
3828,
273,
3828,
1098,
12,
529,
16,
1198,
13,
3747,
273,
3747,
1098,
12,
529,
16,
1198,
16,
3157,
33... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11402,
2620,
12,
529,
16,
1198,
4672,
5915,
273,
4689,
18,
57,
2520,
63,
529,
65,
3828,
273,
3828,
1098,
12,
529,
16,
1198,
13,
3747,
273,
3747,
1098,
12,
529,
16,
1198,
16,
3157,
33... |
memcl = (result[1]) | memcl = (int(result[1])) | def init(self): self.resize(250, 400) self.connect(Plasma.Theme.defaultTheme(), SIGNAL("themeChanged()"), self.themeChanged) #load value from default theme, make this widget suit it theme = Plasma.Theme.defaultTheme() t_textcolor = theme.color(Plasma.Theme.TextColor) #load config cg = self.config() d_refreshtime = cg.readEntry("refreshtime", 2).toInt() d_bgStyle = cg.readEntry("bgStyle", 1) self.d_tempUnit = cg.readEntry("tempUnit", 1) if self.d_tempUnit == 0: self.tempunit = u'℃' elif self.d_tempUnit == 1: self.tempunit = 'F' else: self.tempunit = u'℃' self.setHasConfigurationInterface(False) self.setAspectRatioMode(Plasma.IgnoreAspectRatio) self.theme = Plasma.Svg(self) self.theme.setImagePath("widgets/background") if d_bgStyle == 0: self.setBackgroundHints(Plasma.Applet.NoBackground) elif d_bgStyle == 1: self.setBackgroundHints(Plasma.Applet.StandardBackground) elif d_bgStyle == 2: self.setBackgroundHints(Plasma.Applet.TranslucentBackground) else: self.setBackgroundHints(Plasma.Applet.StandardBackground) #self.icon = Plasma.IconWidget() result = self.getresult() | 643cf0f6efe0e17603ca04d4e90266d0f1e9b221 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8865/643cf0f6efe0e17603ca04d4e90266d0f1e9b221/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
12,
2890,
4672,
365,
18,
15169,
12,
26520,
16,
7409,
13,
365,
18,
3612,
12,
1749,
345,
2540,
18,
8335,
18,
1886,
8335,
9334,
12057,
1013,
2932,
7997,
5033,
10031,
3631,
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,
1208,
12,
2890,
4672,
365,
18,
15169,
12,
26520,
16,
7409,
13,
365,
18,
3612,
12,
1749,
345,
2540,
18,
8335,
18,
1886,
8335,
9334,
12057,
1013,
2932,
7997,
5033,
10031,
3631,
365,
18,
... |
if has_artifact_access('read', ticket_for_num[tn])()] | if tn in ticket_for_num and has_artifact_access('read', ticket_for_num[tn])()] | def paged_query(self, q, limit=None, page=0, sort=None, **kw): """Query tickets, sorting and paginating the result. | 1b5b70eb18624a9a3acb4697be970777c309655e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1036/1b5b70eb18624a9a3acb4697be970777c309655e/tracker_main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4262,
329,
67,
2271,
12,
2890,
16,
1043,
16,
1800,
33,
7036,
16,
1363,
33,
20,
16,
1524,
33,
7036,
16,
2826,
9987,
4672,
3536,
1138,
24475,
16,
9602,
471,
4262,
267,
1776,
326,
563,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4262,
329,
67,
2271,
12,
2890,
16,
1043,
16,
1800,
33,
7036,
16,
1363,
33,
20,
16,
1524,
33,
7036,
16,
2826,
9987,
4672,
3536,
1138,
24475,
16,
9602,
471,
4262,
267,
1776,
326,
563,
... |
self.matching_blocks = matching_blocks = [] | def get_matching_blocks(self): """Return list of triples describing matching subsequences. | d57a82e425c5a1c74964bc986f4891c398abc093 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/d57a82e425c5a1c74964bc986f4891c398abc093/difflib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
16271,
67,
7996,
12,
2890,
4672,
3536,
990,
666,
434,
22388,
16868,
3607,
720,
17190,
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,... | [
1,
1,
1,
1,
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,
336,
67,
16271,
67,
7996,
12,
2890,
4672,
3536,
990,
666,
434,
22388,
16868,
3607,
720,
17190,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
self._addParameter(self.workflow,'JobConfigArgs','JDL',cfgString,description) return S_OK() def setMode(self,mode): | self._addParameter( self.workflow, 'JobConfigArgs', 'JDL', cfgString, description ) return S_OK() def setMode( self, mode ): | def setConfigArgs(self,cfgString): """Developer function. Allow to pass arbitrary settings to the payload configuration service environment. """ if not type(cfgString)==type(" "): return self._reportError('Expected string for DIRAC Job Config Args',**{'cfgString':cfgString}) description = 'User specified cfg settings' self._addParameter(self.workflow,'JobConfigArgs','JDL',cfgString,description) return S_OK() | 50b3322668816ba92ea3f9b253d993dc34c53a21 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/50b3322668816ba92ea3f9b253d993dc34c53a21/Job.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15517,
2615,
12,
2890,
16,
7066,
780,
4672,
3536,
28145,
445,
18,
7852,
358,
1342,
11078,
1947,
358,
326,
2385,
1664,
1156,
3330,
18,
3536,
309,
486,
618,
12,
7066,
780,
13,
631,
723,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15517,
2615,
12,
2890,
16,
7066,
780,
4672,
3536,
28145,
445,
18,
7852,
358,
1342,
11078,
1947,
358,
326,
2385,
1664,
1156,
3330,
18,
3536,
309,
486,
618,
12,
7066,
780,
13,
631,
723,
... |
def collapseLeftArea(self): | def collapseLeftArea(self, hideLeftArea = True): | def collapseLeftArea(self): """ Collapse the left area. """ self._previous_pwLeftAreaWidth = self.pwLeftArea.width() self.pwLeftArea.setFixedWidth(0) self.pwSplitter.setMaximumWidth(self.pwLeftArea.width()) | 768028589b20c831bb59b141074536c76c7b2736 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/768028589b20c831bb59b141074536c76c7b2736/Ui_PartWindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13627,
3910,
5484,
12,
2890,
16,
6853,
3910,
5484,
273,
1053,
4672,
3536,
1558,
14820,
326,
2002,
5091,
18,
3536,
365,
6315,
11515,
67,
14921,
3910,
5484,
2384,
273,
365,
18,
14921,
3910,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13627,
3910,
5484,
12,
2890,
16,
6853,
3910,
5484,
273,
1053,
4672,
3536,
1558,
14820,
326,
2002,
5091,
18,
3536,
365,
6315,
11515,
67,
14921,
3910,
5484,
2384,
273,
365,
18,
14921,
3910,
... |
self.rAssertAlmostEqual(cmath.pi, pi_expected, 9, | self.assertAlmostEqual(cmath.pi, pi_expected, 9, | def test_constants(self): e_expected = 2.71828182845904523536 pi_expected = 3.14159265358979323846 self.rAssertAlmostEqual(cmath.pi, pi_expected, 9, "cmath.pi is %s; should be %s" % (cmath.pi, pi_expected)) self.rAssertAlmostEqual(cmath.e, e_expected, 9, "cmath.e is %s; should be %s" % (cmath.e, e_expected)) | 7b437d780f683487eddab49a7333c01d84985c15 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8125/7b437d780f683487eddab49a7333c01d84985c15/test_cmath.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
13358,
12,
2890,
4672,
425,
67,
3825,
273,
576,
18,
27,
2643,
6030,
28246,
5193,
6162,
3028,
25,
30803,
5718,
4790,
67,
3825,
273,
890,
18,
3461,
24872,
30281,
4763,
6675,
7235... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
13358,
12,
2890,
4672,
425,
67,
3825,
273,
576,
18,
27,
2643,
6030,
28246,
5193,
6162,
3028,
25,
30803,
5718,
4790,
67,
3825,
273,
890,
18,
3461,
24872,
30281,
4763,
6675,
7235... |
setup_factory = SetupSingleChoiceList | setup_factory = _SetupSingleChoiceList | def get_items(self, dlg): vbox = find_child_widget(dlg, "items") counter = 0 for radio in vbox.get_children(): if radio.get_active(): break counter += 1 assert radio.get_active() for radio in vbox.get_children(): vbox.remove(radio) radio.destroy() | 0c0d33f43620369fb91c3eb94fcd412bb75c28f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2366/0c0d33f43620369fb91c3eb94fcd412bb75c28f9/hig.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3319,
12,
2890,
16,
25840,
4672,
331,
2147,
273,
1104,
67,
3624,
67,
6587,
12,
5761,
75,
16,
315,
3319,
7923,
3895,
273,
374,
364,
13512,
316,
331,
2147,
18,
588,
67,
5906,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3319,
12,
2890,
16,
25840,
4672,
331,
2147,
273,
1104,
67,
3624,
67,
6587,
12,
5761,
75,
16,
315,
3319,
7923,
3895,
273,
374,
364,
13512,
316,
331,
2147,
18,
588,
67,
5906,
... |
print 'clearing', fn, line | def evt_breakpointclear(self, line, fn=None): line = '%s' % line print 'clearing', fn, line if not fn: fn = self.fn if fn: self.clear_breakpoint(fn, line) | 2783e192c3292cfb508c80365c67f293cce41b92 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2233/2783e192c3292cfb508c80365c67f293cce41b92/pida_debugger.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6324,
67,
8820,
1153,
8507,
12,
2890,
16,
980,
16,
2295,
33,
7036,
4672,
980,
273,
1995,
87,
11,
738,
980,
309,
486,
2295,
30,
2295,
273,
365,
18,
4293,
309,
2295,
30,
365,
18,
8507,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6324,
67,
8820,
1153,
8507,
12,
2890,
16,
980,
16,
2295,
33,
7036,
4672,
980,
273,
1995,
87,
11,
738,
980,
309,
486,
2295,
30,
2295,
273,
365,
18,
4293,
309,
2295,
30,
365,
18,
8507,... | |
sage: numerical_integral(f, -4, 4) | sage: numerical_integral(f, -4, 4) | def integral(f, *args, **kwds): """ The integral of f. EXAMPLES: sage: integral(sin(x), x) -cos(x) sage: integral(sin(x)^2, x, pi, 123*pi/2) 121*pi/4 sage: integral( sin(x), x, 0, pi) 2 We integrate a symbolic function: sage: f(x,y) = x*y/z + sin(z) sage: integral(f, z) (x, y) |--> x*y*log(z) - cos(z) sage: assume(b-a>0) sage: integral( sin(x), x, a, b) cos(a) - cos(b) sage: forget() sage: print integral(x/(x^3-1), x) 2 x + 1 2 atan(-------) log(x + x + 1) sqrt(3) log(x - 1) - --------------- + ------------- + ---------- 6 sqrt(3) 3 sage: print integral( exp(-x^2), x ) sqrt( pi) erf(x) ---------------- 2 We define the Gaussian, plot and integrate it numerically and symbolically: sage: f(x) = 1/(sqrt(2*pi)) * e^(-x^2/2) sage: P = plot(f, -4, 4, hue=0.8, thickness=2) sage: P.save('sage.png', ymin=0, ymax=0.4) sage: numerical_integral(f, -4, 4) (0.99993665751633376, 1.1101527003413533e-14) sage: integrate(f, x) x |--> erf(x/sqrt(2))/2 You can have SAGE calculate multiple integrals. For example, consider the function $exp(y^2)$ on the region between the lines $x=y$, $x=1$, and $y=0$. We find the value of the integral on this region using the command: sage: area = integral(integral(exp(y^2),x,0,y),y,0,1); area e/2 - 1/2 sage: float(area) 0.85914091422952255 We compute the line integral of sin(x) along the arc of the curve $x=y^4$ from $(1,-1)$ to $(1,1)$: sage: (x,y) = (t^4,t) sage: (dx,dy) = (diff(x,t), diff(y,t)) sage: integral(sin(x)*dx, t,-1, 1) 0 sage: restore('x,y') # restore the symbolic variables x and y SAGE is unable to do anything with the following integral: sage: print integral( exp(-x^2)*log(x), x ) / 2 [ - x I e log(x) dx ] / SAGE does not know how to compute this integral either. sage: print integral( exp(-x^2)*ln(x), x, 0, oo) inf / 2 [ - x I e log(x) dx ] / 0 This definite integral is easy: sage: integral( ln(x)/x, x, 1, 2) log(2)^2/2 SAGE can't do this elliptic integral (yet): sage: integral(1/sqrt(2*t^4 - 3*t^2 - 2), t, 2, 3) integrate(1/(sqrt(2*t^4 - 3*t^2 - 2)), t, 2, 3) A double integral: sage: integral(integral(x*y^2, x, 0, y), y, -2, 2) 32/5 This illustrates using assumptions: sage: integral(abs(x), x, 0, 5) 25/2 sage: integral(abs(x), x, 0, a) integrate(abs(x), x, 0, a) sage: assume(a>0) sage: integral(abs(x), x, 0, a) a^2/2 sage: forget() # forget the assumptions. We integrate and differentiate a huge mess: sage: f = (x^2-1+3*(1+x^2)^(1/3))/(1+x^2)^(2/3)*x/(x^2+2)^2 sage: g = integral(f, x) sage: h = f - diff(g, x) Numerically h is 0, but the symbolic equality checker unfortunately can't tell for sure: sage: [float(h(i)) for i in range(5)] # random low-order bits [0.0, -1.1102230246251565e-16, -8.3266726846886741e-17, -4.163336342344337e-17, -6.9388939039072284e-17] sage: bool(h == 0) False """ try: return f.integral(*args, **kwds) except AttributeError: pass if not isinstance(f, SymbolicExpression): f = SR(f) return f.integral(*args, **kwds) | 28eea7f0c4eb6b2463fa0139af49e2c9c3afbef1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/28eea7f0c4eb6b2463fa0139af49e2c9c3afbef1/functional.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21423,
12,
74,
16,
380,
1968,
16,
2826,
25577,
4672,
3536,
1021,
21423,
434,
284,
18,
225,
5675,
8900,
11386,
30,
272,
410,
30,
21423,
12,
21861,
12,
92,
3631,
619,
13,
300,
14445,
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,
21423,
12,
74,
16,
380,
1968,
16,
2826,
25577,
4672,
3536,
1021,
21423,
434,
284,
18,
225,
5675,
8900,
11386,
30,
272,
410,
30,
21423,
12,
21861,
12,
92,
3631,
619,
13,
300,
14445,
12,... |
self.statusicon.set_from_stock('sonata_play') | self.statusicon.set_from_file(self.find_path('sonata_play.png')) | def handle_change_status(self): # Called when one of the following items are changed: # 1. Current playlist (song added, removed, etc) # 2. Repeat/random/xfade/volume # 3. Currently selected song in playlist # 4. Status (playing/paused/stopped) # 5. Playlistqueue if self.status == None: # clean up and bail out self.update_progressbar() self.update_cursong() self.update_wintitle() self.update_album_art() self.update_statusbar() return | df11b4bbe442a5157537daa280f590f96906e0fc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2312/df11b4bbe442a5157537daa280f590f96906e0fc/sonata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
3427,
67,
2327,
12,
2890,
4672,
468,
11782,
1347,
1245,
434,
326,
3751,
1516,
854,
3550,
30,
468,
225,
404,
18,
6562,
16428,
261,
816,
75,
3096,
16,
3723,
16,
5527,
13,
468,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
3427,
67,
2327,
12,
2890,
4672,
468,
11782,
1347,
1245,
434,
326,
3751,
1516,
854,
3550,
30,
468,
225,
404,
18,
6562,
16428,
261,
816,
75,
3096,
16,
3723,
16,
5527,
13,
468,
... |
self.__todo = ListPanel(mp, "To check", self.showinfo) self.__done = ListPanel(mp, "Checked", self.showinfo) self.__bad = ListPanel(mp, "Bad links", self.showinfo) self.__errors = ListPanel(mp, "Pages w/ bad links", self.showinfo) | self.__todo = ListPanel(mp, "To check", self, self.showinfo) self.__done = ListPanel(mp, "Checked", self, self.showinfo) self.__bad = ListPanel(mp, "Bad links", self, self.showinfo) self.__errors = ListPanel(mp, "Pages w/ bad links", self, self.showinfo) | def __init__(self, parent, root=webchecker.DEFROOT): self.__parent = parent | 2ebde6d1fb628c2812a1c10ff496f785bfd5d202 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2ebde6d1fb628c2812a1c10ff496f785bfd5d202/wcgui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
1365,
33,
4875,
19243,
18,
12904,
9185,
4672,
365,
16186,
2938,
273,
982,
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,
2738,
972,
12,
2890,
16,
982,
16,
1365,
33,
4875,
19243,
18,
12904,
9185,
4672,
365,
16186,
2938,
273,
982,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
results = results + \ _("No one can subscribe to the digest of this list!") | results += _("No one can subscribe to the digest of this list!") | def process_form(mlist, doc): form = cgi.FieldStorage() error = 0 results = '' # Preliminaries done, actual processing of the form input below. if form.has_key("language"): language = form["language"].value else: language = mlist.preferred_language os.environ['LANG'] = language if form.has_key("UserOptions") or \ form.has_key("info") and \ not form.has_key("email"): # then # Go to user options section. if not form.has_key("info"): doc.AddItem(Header(2, _("Error"))) doc.AddItem(Bold(_("You must supply your email address."))) doc.AddItem(mlist.GetMailmanFooter()) print doc.Format(bgcolor="#ffffff") return addr = form['info'].value member = mlist.FindUser(addr) if not member: doc.AddItem(Header(2, _("Error"))) doc.AddItem(Bold(_("%s has no subscribed addr <i>%s</i>.") % (mlist.real_name, addr))) doc.AddItem(mlist.GetMailmanFooter()) print doc.Format(bgcolor="#ffffff") return call_script(mlist, member, 'options') # should never get here! assert 0 if not form.has_key("email"): error = 1 results = results + _("You must supply a valid email address.<br>") # # define email so we don't get a NameError below # with if email == mlist.GetListEmail() -scott # email = "" else: email = form["email"].value remote = remote_addr() if email == mlist.GetListEmail(): error = 1 if remote: remote = _("Web site ") + remote else: remote = _("unidentified origin") badremote = "\n\tfrom " + remote syslog("mischief", "Attempt to self subscribe %s:%s" % (email, badremote)) results = results + _("You must not subscribe a list to itself!<br>") if not form.has_key("pw") or not form.has_key("pw-conf"): error = 1 results = (results + _("You must supply a valid password, and confirm it.<br>")) else: pw = form["pw"].value pwc = form["pw-conf"].value if not error and pw <> pwc: error = 1 results = results + _("Your passwords did not match.<br>") if form.has_key("digest"): try: digest = int(form['digest'].value) except ValueError: # TBD: Hmm, this shouldn't happen digest = 0 else: digest = mlist.digest_is_default if not mlist.digestable: digest = 0 elif not mlist.nondigestable: digest = 1 if not error: try: if mlist.FindUser(email): raise Errors.MMAlreadyAMember, email if digest: digesting = " digest" else: digesting = "" mlist.AddMember(email, pw, digest, remote, language) # # check for all the errors that mlist.AddMember can throw # options on the web page for this cgi # except Errors.MMBadEmailError: results = results + (_("Mailman won't accept the given email " "address as a valid address. (Does it " "have an @ in it???)<p>")) except Errors.MMListError: results = results + (_("The list is not fully functional, and " "can not accept subscription requests.<p>")) except Errors.MMSubscribeNeedsConfirmation: results = results + (_("Confirmation from your email address is " "required, to prevent anyone from " "subscribing you without permission. " "Instructions are being " "sent to you at %s. Please note your " "subscription will not start until you " "confirm your subscription.") % email) except Errors.MMNeedApproval, x: results = results + (_("Subscription was <em>deferred</em> " "because %s. Your request has been " "forwarded to the list administrator. " "You will receive email informing you " "of the moderator's decision when they " "get to your request.<p>") % x) except Errors.MMHostileAddress: results = results + (_("Your subscription is not allowed because " "the email address you gave is insecure.<p>")) except Errors.MMAlreadyAMember: results = results + _("You are already subscribed!<p>") # # these shouldn't happen, but if someone's futzing with the cgi # they might -scott # except Errors.MMCantDigestError: results = results + \ _("No one can subscribe to the digest of this list!") except Errors.MMMustDigestError: results = results + \ _("This list only supports digest subscriptions!") else: results = results + \ _("You have been successfully subscribed to %s.") % \ (mlist.real_name) PrintResults(mlist, results, doc, language) | b121e4076f4c5d170d07eefd6361b44bbafc2f9f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/b121e4076f4c5d170d07eefd6361b44bbafc2f9f/subscribe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
687,
12,
781,
376,
16,
997,
4672,
646,
273,
276,
10052,
18,
974,
3245,
1435,
555,
273,
374,
1686,
273,
875,
225,
468,
453,
2878,
381,
267,
5646,
2731,
16,
3214,
4929,
434,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
687,
12,
781,
376,
16,
997,
4672,
646,
273,
276,
10052,
18,
974,
3245,
1435,
555,
273,
374,
1686,
273,
875,
225,
468,
453,
2878,
381,
267,
5646,
2731,
16,
3214,
4929,
434,
... |
def SetContactMethods(self, contactMethods): self.setRdfAttribute(chandler.contactMethods, contactMethods, ContactEntityItem.rdfs) | def SetContactMethods(self, contactMethod): self.setRdfAttribute(chandler.contactMethods, contactMethod, ContactEntityItem.rdfs) | def SetContactMethods(self, contactMethods): self.setRdfAttribute(chandler.contactMethods, contactMethods, ContactEntityItem.rdfs) | 1ce5a17850e37f385c7c1c655c53cae2ed28e943 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/1ce5a17850e37f385c7c1c655c53cae2ed28e943/ContactEntityItem.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1000,
6567,
4712,
12,
2890,
16,
5388,
1305,
4672,
365,
18,
542,
27616,
1499,
12,
343,
464,
749,
18,
8994,
4712,
16,
5388,
1305,
16,
13329,
1943,
1180,
18,
86,
12381,
13,
225,
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,
1000,
6567,
4712,
12,
2890,
16,
5388,
1305,
4672,
365,
18,
542,
27616,
1499,
12,
343,
464,
749,
18,
8994,
4712,
16,
5388,
1305,
16,
13329,
1943,
1180,
18,
86,
12381,
13,
225,
2,
-100,
... |
return {} | layout = {} cls.dprint("%s: layout=%s" % (url, layout)) return layout | def getLayoutSubsequent(cls, major_mode_keyword, url): #dprint("getLayoutSubsequent") ukey = unicode(url) if major_mode_keyword in cls.layout: try: key = str(url) # Convert old style string keyword to unicode keyword if key in cls.layout[major_mode_keyword]: cls.layout[major_mode_keyword][ukey] = cls.layout[major_mode_keyword][key] del cls.layout[major_mode_keyword][key] except UnicodeEncodeError: pass try: return cls.layout[major_mode_keyword][ukey] except KeyError: return {} | 82cadc0259af62e12f609221a12afb4db898cba4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/82cadc0259af62e12f609221a12afb4db898cba4/major.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17670,
1676,
9116,
12,
6429,
16,
7888,
67,
3188,
67,
11041,
16,
880,
4672,
468,
72,
1188,
2932,
588,
3744,
1676,
9116,
7923,
582,
856,
273,
5252,
12,
718,
13,
309,
7888,
67,
3188,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17670,
1676,
9116,
12,
6429,
16,
7888,
67,
3188,
67,
11041,
16,
880,
4672,
468,
72,
1188,
2932,
588,
3744,
1676,
9116,
7923,
582,
856,
273,
5252,
12,
718,
13,
309,
7888,
67,
3188,
67,
... |
epoch = '' | epoch = '0' | def parse(v): if ':' in v: epoch, v = v.split(':', 1) else: epoch = '' if '-' in v: upstream_version, debian_revision = v.rsplit('-', 1) else: upstream_version = v debian_revision = '' return epoch, upstream_version, debian_revision | 472f35169d4662e1e6c82ca0b53e79ee29170ae7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/472f35169d4662e1e6c82ca0b53e79ee29170ae7/debversion.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
90,
4672,
309,
3921,
316,
331,
30,
7632,
16,
331,
273,
331,
18,
4939,
2668,
30,
2187,
404,
13,
469,
30,
7632,
273,
296,
20,
11,
225,
309,
4014,
316,
331,
30,
13505,
67,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
90,
4672,
309,
3921,
316,
331,
30,
7632,
16,
331,
273,
331,
18,
4939,
2668,
30,
2187,
404,
13,
469,
30,
7632,
273,
296,
20,
11,
225,
309,
4014,
316,
331,
30,
13505,
67,
1... |
output.start(len(self.testCases)) for testCase, method in self.testCases: try: testCase.setUp() method() testCase.tearDown() except AssertionError, e: output.reportFailure(testCase, method, sys.exc_info()) except KeyError: break except: output.reportError(testCase, method, sys.exc_info()) else: output.reportSuccess(testCase, method) | output.start(self.numTests) testClasses = self.testClasses.keys() testClasses.sort() for testClass in testClasses: testCase = testClass() for method in self.testClasses[testClass]: try: testCase.setUp() method(testCase) testCase.tearDown() except AssertionError, e: output.reportFailure(testClass, method, sys.exc_info()) except KeyboardInterrupt: pass except: output.reportError(testClass, method, sys.exc_info()) else: output.reportSuccess(testClass, method) | def run(self, output): | 5e3758d35a6809c31c90a4ec1d96f7b2e095b8b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/5e3758d35a6809c31c90a4ec1d96f7b2e095b8b0/unittest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
16,
876,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
16,
876,
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... |
for line in file(f).read().split(';'): | for line in file_open(f).read().split(';'): | def init_db(cr): import addons f = addons.get_module_resource('base', 'base.sql') for line in file(f).read().split(';'): if (len(line)>0) and (not line.isspace()): cr.execute(line) cr.commit() for i in addons.get_modules(): terp_file = addons.get_module_resource(i, '__terp__.py') mod_path = addons.get_module_path(i) if not mod_path: continue info = False if os.path.isfile(terp_file) and not os.path.isfile(mod_path+'.zip'): info = eval(file(terp_file).read()) elif zipfile.is_zipfile(mod_path+'.zip'): zfile = zipfile.ZipFile(mod_path+'.zip') i = os.path.splitext(i)[0] info = eval(zfile.read(os.path.join(i, '__terp__.py'))) if info: categs = info.get('category', 'Uncategorized').split('/') p_id = None while categs: if p_id is not None: cr.execute('select id \ from ir_module_category \ where name=%s and parent_id=%s', (categs[0], p_id)) else: cr.execute('select id \ from ir_module_category \ where name=%s and parent_id is NULL', (categs[0],)) c_id = cr.fetchone() if not c_id: cr.execute('select nextval(\'ir_module_category_id_seq\')') c_id = cr.fetchone()[0] cr.execute('insert into ir_module_category \ (id, name, parent_id) \ values (%s, %s, %s)', (c_id, categs[0], p_id)) else: c_id = c_id[0] p_id = c_id categs = categs[1:] active = info.get('active', False) installable = info.get('installable', True) if installable: if active: state = 'to install' else: state = 'uninstalled' else: state = 'uninstallable' cr.execute('select nextval(\'ir_module_module_id_seq\')') id = cr.fetchone()[0] cr.execute('insert into ir_module_module \ (id, author, website, name, shortdesc, description, \ category_id, state) \ values (%s, %s, %s, %s, %s, %s, %s, %s)', ( id, info.get('author', ''), info.get('website', ''), i, info.get('name', False), info.get('description', ''), p_id, state)) dependencies = info.get('depends', []) for d in dependencies: cr.execute('insert into ir_module_module_dependency \ (module_id,name) values (%s, %s)', (id, d)) cr.commit() | eca70f3464ad8de8f93c5017261b62f1c7a9806a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12853/eca70f3464ad8de8f93c5017261b62f1c7a9806a/misc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
67,
1966,
12,
3353,
4672,
1930,
31439,
284,
273,
31439,
18,
588,
67,
2978,
67,
3146,
2668,
1969,
2187,
296,
1969,
18,
4669,
6134,
364,
980,
316,
585,
67,
3190,
12,
74,
2934,
896,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
67,
1966,
12,
3353,
4672,
1930,
31439,
284,
273,
31439,
18,
588,
67,
2978,
67,
3146,
2668,
1969,
2187,
296,
1969,
18,
4669,
6134,
364,
980,
316,
585,
67,
3190,
12,
74,
2934,
896,... |
def __init__(self, host, port=30000): | def __init__(self, host, port=30010): | def __init__(self, host, port=30000): """ Open a connection to a LDRdataFindServer and return an instance of class LDRdataFindClient. One of the public methods can then be called to send a request to the server. | a202f1387322e0a94f6f1dacb5d6de68d0ed2f7f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3589/a202f1387322e0a94f6f1dacb5d6de68d0ed2f7f/LDRdataFindClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1479,
16,
1756,
33,
19249,
2163,
4672,
3536,
3502,
279,
1459,
358,
279,
511,
6331,
892,
3125,
2081,
471,
327,
392,
791,
434,
667,
511,
6331,
892,
3125,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1479,
16,
1756,
33,
19249,
2163,
4672,
3536,
3502,
279,
1459,
358,
279,
511,
6331,
892,
3125,
2081,
471,
327,
392,
791,
434,
667,
511,
6331,
892,
3125,
1... |
s = s.replace(x[0], x[1]) | s = re.sub(x[0], x[1], s) | def encode(self, s): """ Encode special characters found in string I{s}. @param s: A string to encode. @type s: str @return: The encoded string. @rtype: str """ if isinstance(s, basestring) and self.needsEncoding(s): for x in self.encodings: s = s.replace(x[0], x[1]) return s | 77384bfaa4f277bf1d8c03a2d6ea3a9a5f3435ef /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5930/77384bfaa4f277bf1d8c03a2d6ea3a9a5f3435ef/enc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2017,
12,
2890,
16,
272,
4672,
3536,
6240,
4582,
3949,
1392,
316,
533,
467,
95,
87,
5496,
632,
891,
272,
30,
432,
533,
358,
2017,
18,
632,
723,
272,
30,
609,
632,
2463,
30,
1021,
374... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2017,
12,
2890,
16,
272,
4672,
3536,
6240,
4582,
3949,
1392,
316,
533,
467,
95,
87,
5496,
632,
891,
272,
30,
432,
533,
358,
2017,
18,
632,
723,
272,
30,
609,
632,
2463,
30,
1021,
374... |
super(ClonableCoroutine, self).goodbye() | InterpClonableCoroutine.goodbye(self) | def goodbye(self): if we_are_translated(): super(ClonableCoroutine, self).goodbye() else: ec = self.space.getexecutioncontext() ec.subcontext_leave(self) | 5d05cc2e20cfa7190f8e1f979de4e1bc5a388f62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/5d05cc2e20cfa7190f8e1f979de4e1bc5a388f62/interp_clonable.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7494,
1637,
73,
12,
2890,
4672,
309,
732,
67,
834,
67,
22899,
13332,
5294,
84,
2009,
265,
429,
6217,
8983,
18,
19747,
1637,
73,
12,
2890,
13,
469,
30,
6557,
273,
365,
18,
2981,
18,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7494,
1637,
73,
12,
2890,
4672,
309,
732,
67,
834,
67,
22899,
13332,
5294,
84,
2009,
265,
429,
6217,
8983,
18,
19747,
1637,
73,
12,
2890,
13,
469,
30,
6557,
273,
365,
18,
2981,
18,
5... |
description = to_unicode(inspect.getdoc(component)) | description = inspect.getdoc(component) | def _render_view(self, req): plugins = {} plugins_dir = os.path.realpath(os.path.join(self.env.path, 'plugins')) plugins_dir = os.path.normcase(plugins_dir) # needs to match loader.py | a19afbf9389754dc9ae5bef27420e6906a9c1195 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2831/a19afbf9389754dc9ae5bef27420e6906a9c1195/web_ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5902,
67,
1945,
12,
2890,
16,
1111,
4672,
4799,
273,
2618,
4799,
67,
1214,
273,
1140,
18,
803,
18,
7688,
803,
12,
538,
18,
803,
18,
5701,
12,
2890,
18,
3074,
18,
803,
16,
296,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5902,
67,
1945,
12,
2890,
16,
1111,
4672,
4799,
273,
2618,
4799,
67,
1214,
273,
1140,
18,
803,
18,
7688,
803,
12,
538,
18,
803,
18,
5701,
12,
2890,
18,
3074,
18,
803,
16,
296,
... |
x = max(min(self.GetViewStart()[0] * scale / self.scaling + 1, | origin = [x * self.scroll_amount for x in self.GetViewStart()] x = max(min(origin[0] * scale / scaling + 1, | def scale(self, scale=None): scroll_amount = self.scroll_amount if scale == None: scale = self.scaling w = self.width * scale - 1 h = self.height * scale - 1 x = max(min(self.GetViewStart()[0] * scale / self.scaling + 1, w - self.GetSize().x) - 2, 0) y = max(min(self.GetViewStart()[1] * scale / self.scaling + 1, h - self.GetSize().y) - 2, 0) self.scaling = scale self.SetScrollbars(scroll_amount, scroll_amount, floor(w / scroll_amount), floor(h / scroll_amount), x, y) self.Refresh(0, rect=wxRect(0, 0, self.GetSize().x, self.GetSize().y)) | 6eb1cae57ca1773babed2c1c4d12cf475259fce5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/6eb1cae57ca1773babed2c1c4d12cf475259fce5/gamera_display.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3159,
12,
2890,
16,
3159,
33,
7036,
4672,
5532,
67,
8949,
273,
365,
18,
12033,
67,
8949,
309,
3159,
422,
599,
30,
3159,
273,
365,
18,
24576,
341,
273,
365,
18,
2819,
380,
3159,
300,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3159,
12,
2890,
16,
3159,
33,
7036,
4672,
5532,
67,
8949,
273,
365,
18,
12033,
67,
8949,
309,
3159,
422,
599,
30,
3159,
273,
365,
18,
24576,
341,
273,
365,
18,
2819,
380,
3159,
300,
... |
"WHERE name != '' ORDER BY name" % by) | "WHERE IFNULL(name,'') != '' ORDER BY name" % by) | def get_groups(self, by='component'): cursor = self.db.cursor () groups = [] if by in ['status', 'resolution', 'severity', 'priority']: cursor.execute("SELECT name FROM enum WHERE type = %s " "AND name != '' ORDER BY value", by) elif by in ['component', 'milestone', 'version']: cursor.execute("SELECT name FROM %s " "WHERE name != '' ORDER BY name" % by) elif by == 'owner': cursor.execute("SELECT DISTINCT owner AS name FROM ticket " "ORDER BY owner") elif by not in Ticket.std_fields: fields = get_custom_fields(self.env) field = [f for f in fields if f['name'] == by] if not field: return [] return [o for o in field[0]['options'] if o != ''] while 1: row = cursor.fetchone() if not row: break groups.append(row['name']) return groups | d95d4c5c2c377d42ef48039a5a4aebe475bde190 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/d95d4c5c2c377d42ef48039a5a4aebe475bde190/Milestone.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4650,
12,
2890,
16,
635,
2218,
4652,
11,
4672,
3347,
273,
365,
18,
1966,
18,
9216,
1832,
3252,
273,
5378,
309,
635,
316,
10228,
2327,
2187,
296,
19182,
2187,
296,
27341,
2187,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4650,
12,
2890,
16,
635,
2218,
4652,
11,
4672,
3347,
273,
365,
18,
1966,
18,
9216,
1832,
3252,
273,
5378,
309,
635,
316,
10228,
2327,
2187,
296,
19182,
2187,
296,
27341,
2187,
... |
groupData = [] | terms = [] | def getGroupIds(context): site = getSite() groups_tool = getToolByName(site, 'portal_groups') groups = groups_tool.listGroups() # Get group id, title tuples for each, omitting virtual group 'AuthenticatedUsers' groupData = [] for g in groups: if g.id == 'AuthenticatedUsers': continue is_zope_manager = getSecurityManager().checkPermission(ManagePortal, context) if 'Manager' in g.getRoles() and not is_zope_manager: continue groupData.append(('%s (%s)' % (g.getGroupTitleOrName(), g.id), g.id)) # Sort by title groupData.sort(key=lambda x: normalizeString(x[0])) return SimpleVocabulary.fromItems(groupData) | c968dd0ca9e5067be3fc54687d90bac10e9b490e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12186/c968dd0ca9e5067be3fc54687d90bac10e9b490e/register.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11751,
2673,
12,
2472,
4672,
2834,
273,
11021,
1435,
3252,
67,
6738,
273,
336,
6364,
5911,
12,
4256,
16,
296,
24386,
67,
4650,
6134,
3252,
273,
3252,
67,
6738,
18,
1098,
3621,
1435,
468,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11751,
2673,
12,
2472,
4672,
2834,
273,
11021,
1435,
3252,
67,
6738,
273,
336,
6364,
5911,
12,
4256,
16,
296,
24386,
67,
4650,
6134,
3252,
273,
3252,
67,
6738,
18,
1098,
3621,
1435,
468,... |
"""Ensure RandomStreams.shuffle_row_elements generates right results""" | """Test that RandomStreams.shuffle_row_elements generates the right results""" | def test_shuffle_row_elements(self): """Ensure RandomStreams.shuffle_row_elements generates right results""" # Check over two calls to see if the random state is correctly updated. # On matrices, for each row, the elements of that row should be # shuffled. # Note that this differs from numpy.random.shuffle, where all the # elements of the matrix are shuffled. mm = Module() mm.random = RandomStreams(utt.fetch_seed()) m_input = tensor.dmatrix() mm.f = Method([m_input], mm.random.shuffle_row_elements(m_input)) mmade = mm.make() mmade.random.initialize() | 32fafac1df3e55779a468361ef30f6a00000f984 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/32fafac1df3e55779a468361ef30f6a00000f984/test_randomstreams.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
31980,
67,
492,
67,
6274,
12,
2890,
4672,
3536,
4709,
716,
8072,
10301,
18,
31980,
67,
492,
67,
6274,
6026,
326,
2145,
1686,
8395,
468,
2073,
1879,
2795,
4097,
358,
2621,
309,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
31980,
67,
492,
67,
6274,
12,
2890,
4672,
3536,
4709,
716,
8072,
10301,
18,
31980,
67,
492,
67,
6274,
6026,
326,
2145,
1686,
8395,
468,
2073,
1879,
2795,
4097,
358,
2621,
309,
... |
def show(self, filename=""): if not filename: filename = '/tmp/sage.png' | def show(self, filename=None): if filename is None: filename = sage.misc.misc.tmp_filename() + '.png' | def show(self, filename=""): | faf30e8cc96f1efccdd51cd7a40b609b7414a021 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9417/faf30e8cc96f1efccdd51cd7a40b609b7414a021/plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
12,
2890,
16,
1544,
1546,
6,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
12,
2890,
16,
1544,
1546,
6,
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,
... |
u'f\xf6\xf6' | 'f\xf6\xf6' | def test_testfile(): r""" | 18642825f83b5c51e5a766db3ce89334a635adfa /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/18642825f83b5c51e5a766db3ce89334a635adfa/test_doctest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
3813,
768,
13332,
436,
8395,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
3813,
768,
13332,
436,
8395,
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,
-1... |
ctx.prec += asymp_extraprec def h(a1,a2,b1,b2): X = a1+a2-b1-b2 A2 = a1+a2 B2 = b1+b2 c = {} c[0] = ctx.one c[1] = (A2-1)*X+b1*b2-a1*a2 s1 = 0 k = 0 tprev = 0 while 1: if k not in c: uu1 = 1-B2+2*a1+a1**2+2*a2+a2**2-A2*B2+a1*a2+b1*b2+(2*B2-3*(A2+1))*k+2*k**2 uu2 = (k-A2+b1-1)*(k-A2+b2-1)*(k-X-2) c[k] = ctx.one/k * (uu1*c[k-1]-uu2*c[k-2]) t1 = c[k] * z**(-k) if abs(t1) < 0.1*ctx.eps: break if k > 5 and abs(tprev) / abs(t1) < 1.5: raise NoConvergence s1 += t1 tprev = t1 k += 1 S = ctx.exp(z)*s1 T1 = [z,S], [X,1], [b1,b2],[a1,a2],[],[],0 T2 = [-z],[-a1],[b1,b2,a2-a1],[a2,b1-a1,b2-a1],[a1,a1-b1+1,a1-b2+1],[a1-a2+1],-1/z T3 = [-z],[-a2],[b1,b2,a1-a2],[a1,b1-a2,b2-a2],[a2,a2-b1+1,a2-b2+1],[-a1+a2+1],-1/z return T1, T2, T3 v = hypercomb(h, [a1,a2,b1,b2]) if sum(ctx.is_real_type(u) for u in [a1,a2,b1,b2,z]) == 5: v = ctx.re(v) return v except NoConvergence: pass | try: ctx.prec += asymp_extraprec def h(a1,a2,b1,b2): X = a1+a2-b1-b2 A2 = a1+a2 B2 = b1+b2 c = {} c[0] = ctx.one c[1] = (A2-1)*X+b1*b2-a1*a2 s1 = 0 k = 0 tprev = 0 while 1: if k not in c: uu1 = 1-B2+2*a1+a1**2+2*a2+a2**2-A2*B2+a1*a2+b1*b2+(2*B2-3*(A2+1))*k+2*k**2 uu2 = (k-A2+b1-1)*(k-A2+b2-1)*(k-X-2) c[k] = ctx.one/k * (uu1*c[k-1]-uu2*c[k-2]) t1 = c[k] * z**(-k) if abs(t1) < 0.1*ctx.eps: break if k > 5 and abs(tprev) / abs(t1) < 1.5: raise NoConvergence s1 += t1 tprev = t1 k += 1 S = ctx.exp(z)*s1 T1 = [z,S], [X,1], [b1,b2],[a1,a2],[],[],0 T2 = [-z],[-a1],[b1,b2,a2-a1],[a2,b1-a1,b2-a1],[a1,a1-b1+1,a1-b2+1],[a1-a2+1],-1/z T3 = [-z],[-a2],[b1,b2,a1-a2],[a1,b1-a2,b2-a2],[a2,a2-b1+1,a2-b2+1],[-a1+a2+1],-1/z return T1, T2, T3 v = hypercomb(h, [a1,a2,b1,b2]) if sum(ctx.is_real_type(u) for u in [a1,a2,b1,b2,z]) == 5: v = ctx.re(v) return v except NoConvergence: pass | def hyp2f2(ctx,a1,a2,b1,b2,z,**kwargs): a1r, a1f, a1c, a1 = ctx._hyp_parse_param(a1) a2r, a2f, a2c, a2 = ctx._hyp_parse_param(a2) b1r, b1f, b1c, b1 = ctx._hyp_parse_param(b1) b2r, b2f, b2c, b2 = ctx._hyp_parse_param(b2) z = ctx.convert(z) absz = abs(z) magz = ctx.mag(z) orig = ctx.prec # Asymptotic expansion is ~ exp(z) asymp_extraprec = magz # Asymptotic series is in terms of 3F1 can_use_asymptotic = (not kwargs.get('force_series')) and \ (ctx.mag(absz) > 3) #and \ #(ctx.sqrt(absz) > 1.5*orig) #(ctx.sqrt(absz) > 1.5*orig) #and \ #ctx._hyp_check_convergence([a1, a1-b1+1, a1-b2+1], [a1-a2+1], # 1/absz, orig+40+asymp_extraprec) # TODO: much of the following could be shared with 2F3 instead of # copypasted if can_use_asymptotic: #print "using asymp" try: ctx.prec += asymp_extraprec # http://functions.wolfram.com/HypergeometricFunctions/ # Hypergeometric2F2/06/02/02/0002/ def h(a1,a2,b1,b2): X = a1+a2-b1-b2 A2 = a1+a2 B2 = b1+b2 c = {} c[0] = ctx.one c[1] = (A2-1)*X+b1*b2-a1*a2 s1 = 0 k = 0 tprev = 0 while 1: if k not in c: uu1 = 1-B2+2*a1+a1**2+2*a2+a2**2-A2*B2+a1*a2+b1*b2+(2*B2-3*(A2+1))*k+2*k**2 uu2 = (k-A2+b1-1)*(k-A2+b2-1)*(k-X-2) c[k] = ctx.one/k * (uu1*c[k-1]-uu2*c[k-2]) t1 = c[k] * z**(-k) if abs(t1) < 0.1*ctx.eps: #print "Convergence :)" break # Quit if the series doesn't converge quickly enough if k > 5 and abs(tprev) / abs(t1) < 1.5: #print "No convergence :(" raise NoConvergence s1 += t1 tprev = t1 k += 1 S = ctx.exp(z)*s1 T1 = [z,S], [X,1], [b1,b2],[a1,a2],[],[],0 T2 = [-z],[-a1],[b1,b2,a2-a1],[a2,b1-a1,b2-a1],[a1,a1-b1+1,a1-b2+1],[a1-a2+1],-1/z T3 = [-z],[-a2],[b1,b2,a1-a2],[a1,b1-a2,b2-a2],[a2,a2-b1+1,a2-b2+1],[-a1+a2+1],-1/z return T1, T2, T3 v = hypercomb(h, [a1,a2,b1,b2]) if sum(ctx.is_real_type(u) for u in [a1,a2,b1,b2,z]) == 5: v = ctx.re(v) return v except NoConvergence: pass finally: ctx.prec = orig #print "not using asymp" return ctx.hypsum(a1r+a2r, a1f+a2f, a1c+a2c, b1r+b2r, b1f+b2f, b1c+b2c, z) | 74eca90720b3a15c322c60f6089a3be4f5dc8227 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11851/74eca90720b3a15c322c60f6089a3be4f5dc8227/functions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16117,
22,
74,
22,
12,
5900,
16,
69,
21,
16,
69,
22,
16,
70,
21,
16,
70,
22,
16,
94,
16,
636,
4333,
4672,
279,
21,
86,
16,
279,
21,
74,
16,
279,
21,
71,
16,
279,
21,
273,
110... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16117,
22,
74,
22,
12,
5900,
16,
69,
21,
16,
69,
22,
16,
70,
21,
16,
70,
22,
16,
94,
16,
636,
4333,
4672,
279,
21,
86,
16,
279,
21,
74,
16,
279,
21,
71,
16,
279,
21,
273,
110... |
query = '(%s OR %s IS NULL)' % (query, left) | query = '(%s OR %s.%s IS NULL)' % (query, table._table, left) | def __leaf_to_sql(self, leaf, table): if leaf == self.__DUMMY_LEAF: return ('(1=1)', []) left, operator, right = leaf | b18b81344ffa3c4a5c61fe8c6bfda877a9606e7a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/b18b81344ffa3c4a5c61fe8c6bfda877a9606e7a/expression.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
12070,
67,
869,
67,
4669,
12,
2890,
16,
7839,
16,
1014,
4672,
309,
7839,
422,
365,
16186,
40,
2799,
22114,
67,
900,
6799,
30,
327,
7707,
12,
21,
33,
21,
13,
2187,
5378,
13,
200... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
12070,
67,
869,
67,
4669,
12,
2890,
16,
7839,
16,
1014,
4672,
309,
7839,
422,
365,
16186,
40,
2799,
22114,
67,
900,
6799,
30,
327,
7707,
12,
21,
33,
21,
13,
2187,
5378,
13,
200... |
print x, y, z | print x, y, sortdict(z) | def g(x, *y, **z): print x, y, z | 23ea25473209b6ebaddfdaedecd2a1f42a4c674b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/23ea25473209b6ebaddfdaedecd2a1f42a4c674b/test_extcall.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
314,
12,
92,
16,
380,
93,
16,
2826,
94,
4672,
1172,
619,
16,
677,
16,
1524,
1576,
12,
94,
13,
225,
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,
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,
314,
12,
92,
16,
380,
93,
16,
2826,
94,
4672,
1172,
619,
16,
677,
16,
1524,
1576,
12,
94,
13,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
print len(cmap), inputFile.name | def __init__(self, cmap=None, inputFile=None, N_nodes=None): """Initialize a node partition. | b7614dcf5bf4ab0bdb96c7727a04e29bdab2c1b9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/768/b7614dcf5bf4ab0bdb96c7727a04e29bdab2c1b9/communities.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
11136,
33,
7036,
16,
22014,
33,
7036,
16,
423,
67,
4690,
33,
7036,
4672,
3536,
7520,
279,
756,
3590,
18,
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,
0,
0,
0,
0,
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,
11136,
33,
7036,
16,
22014,
33,
7036,
16,
423,
67,
4690,
33,
7036,
4672,
3536,
7520,
279,
756,
3590,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
self.__isDone = False | def start(self): self.__runningAnims = self.__anims[:] for anim in self.__runningAnims: stopHandler = lambda anim=anim: self.__animStopped(anim) anim.setHandler(onStop = stopHandler, onAbort = stopHandler) anim.start() self.__isDone = False | 2e079fa33905388e12f79ec352f98eb7eb3424b2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7300/2e079fa33905388e12f79ec352f98eb7eb3424b2/anim.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
4672,
365,
16186,
8704,
979,
12097,
273,
365,
16186,
304,
12097,
10531,
65,
364,
10536,
316,
365,
16186,
8704,
979,
12097,
30,
2132,
1503,
273,
3195,
10536,
33,
304,
381,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
4672,
365,
16186,
8704,
979,
12097,
273,
365,
16186,
304,
12097,
10531,
65,
364,
10536,
316,
365,
16186,
8704,
979,
12097,
30,
2132,
1503,
273,
3195,
10536,
33,
304,
381,
... | |
for key, val in form.items(): del form[key] form[key.encode('utf8')] = val.encode('utf8') | def http_request(self, path_name=None, cookie_string=None, form={}, full_path=None): if not full_path and self.config['cb_single_url']: full_path = self.config['cb_single_url'] if full_path: u = urlparse.urlparse(full_path) host = u.hostname port = u.port or 80 path = u.path if u.query: path += '?' + u.query else: | 017e1096cd4673b496e9bbb2ebfe652c272960f0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13219/017e1096cd4673b496e9bbb2ebfe652c272960f0/server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1062,
67,
2293,
12,
2890,
16,
589,
67,
529,
33,
7036,
16,
3878,
67,
1080,
33,
7036,
16,
646,
28793,
1983,
67,
803,
33,
7036,
4672,
309,
486,
1983,
67,
803,
471,
365,
18,
1425,
3292,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1062,
67,
2293,
12,
2890,
16,
589,
67,
529,
33,
7036,
16,
3878,
67,
1080,
33,
7036,
16,
646,
28793,
1983,
67,
803,
33,
7036,
4672,
309,
486,
1983,
67,
803,
471,
365,
18,
1425,
3292,
... | |
lines = msg.body.split('\n') | lines = body.split('\n') | def ParseMailCommands(self, msg): # Break any infloops. If this has come from a Mailman server then # it'll have this header. It's still possible to infloop between two # servers because there's no guaranteed way to know it came from a # bot. if msg.get('x-beenthere') or msg.get('list-id'): return # check the autoresponse stuff if self.autorespond_requests: # TBD: this is a hack and is not safe with respect to errors in # the Replybot module. It should be redesigned to work with the # robust delivery scheme. from Mailman.Handlers import Replybot Replybot.process(self, msg, msgdata={'torequest':1}) if self.autorespond_requests == 1: # Yes, auto-respond and discard return | bfed9ae359e2eea17ad856f6284f7870ede7b63f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/bfed9ae359e2eea17ad856f6284f7870ede7b63f/MailCommandHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2884,
6759,
9127,
12,
2890,
16,
1234,
4672,
468,
17030,
1281,
8286,
383,
4473,
18,
225,
971,
333,
711,
12404,
628,
279,
11542,
4728,
1438,
1508,
468,
518,
5614,
1240,
333,
1446,
18,
225,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2884,
6759,
9127,
12,
2890,
16,
1234,
4672,
468,
17030,
1281,
8286,
383,
4473,
18,
225,
971,
333,
711,
12404,
628,
279,
11542,
4728,
1438,
1508,
468,
518,
5614,
1240,
333,
1446,
18,
225,... |
self['progressbar'].set_format_string(str(value)) | self['progressbar'].set_format_string(str(aValue)) | def update( self ): aString = str( self.theFullPN()[ID] ) aString += ':\n' + str( self.theFullPN()[PROPERTY] ) self.theIDEntry.set_text ( aString ) | d6afe4061131c3989292a58918940112ac0c8b2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12724/d6afe4061131c3989292a58918940112ac0c8b2d/BargraphWindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
365,
262,
30,
225,
279,
780,
273,
609,
12,
365,
18,
5787,
5080,
15124,
1435,
63,
734,
65,
262,
279,
780,
1011,
4290,
64,
82,
11,
397,
609,
12,
365,
18,
5787,
5080,
15124,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
365,
262,
30,
225,
279,
780,
273,
609,
12,
365,
18,
5787,
5080,
15124,
1435,
63,
734,
65,
262,
279,
780,
1011,
4290,
64,
82,
11,
397,
609,
12,
365,
18,
5787,
5080,
15124,
... |
self.dispVdWAction.setIconSet(QIconSet(self.image65)) | self.dispVdWAction.setIconSet(QIconSet(self.image64)) | def __init__(self,parent = None,name = None,fl = 0): QMainWindow.__init__(self,parent,name,fl) self.statusBar() | e48e859515237593d94b403a9c0a7295e08c31f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/e48e859515237593d94b403a9c0a7295e08c31f2/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... |
if time_inactive > 5.0 and not xiso.paused: | if upload and time_inactive > 5.0 and not xiso.paused: | def extract_xiso(self): self.extracted_filename = None # get infos from ui drives = ["/c/","/e/","/f/","/g/"] filename = self.ui_entry_xiso.get_text() local_folder = self.ui_entry_folder.get_text() ftp_folder = drives[self.ui_combobox_xbox_drive.get_active()] + \ self.ui_entry_xbox_folder.get_text() | 39964478212b176a703725d180a4592ad79d1012 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2692/39964478212b176a703725d180a4592ad79d1012/gxiso.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
67,
5674,
83,
12,
2890,
4672,
365,
18,
8004,
329,
67,
3459,
273,
599,
225,
468,
336,
10626,
628,
5915,
5081,
3606,
273,
8247,
19,
71,
19,
15937,
19,
73,
19,
15937,
19,
74,
19,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
67,
5674,
83,
12,
2890,
4672,
365,
18,
8004,
329,
67,
3459,
273,
599,
225,
468,
336,
10626,
628,
5915,
5081,
3606,
273,
8247,
19,
71,
19,
15937,
19,
73,
19,
15937,
19,
74,
19,
... |
if ( values[0] == '-1' ): retValue[0]=min else: retValue[0]=values[0] if (values[1] == '-1' ): retValue[1]=max else: retValue[1]=values[1] | if ( values[0] == '-1' ): retValue[0]=min else: retValue[0]=values[0] if (values[1] == '-1' ): retValue[1]=max else: retValue[1]=values[1] | def __parse_spectral( spectString='', min=0, max=0 ): retValue=[ min, max ] #print "min: ", min #print "max: ", max values=spectString.split('~') if ( len(values)==2 ): # We have a min and max value if ( values[0] == '-1' ): retValue[0]=min else: retValue[0]=values[0] if (values[1] == '-1' ): retValue[1]=max else: retValue[1]=values[1] elif ( len(values)==1 ): # We probably have a <, <=, > or >= sign if ( values[0].startswith( '<=') ): retValue[0]=min retValue[1]=values[0][2:] elif ( values[0].startswith( '<') ): retValue[0]=min ## NOTE when we support non-pixel values this will need ## to change!!! We are assuming things will fail later ## if the return values aren't integers, which non-pixel ## values won't be integers. retValue[0]=min retValue[1]=values[0][1:] if ( retValue[1].isdigit() ): retValue[1] = str( int(retValue[1])-1 ) elif( values[0].startswith( '>=') ): retValue[0]=values[0][2:] retValue[1]=max elif( values[0].startswith( '>') ): ## NOTE when we support non-pixel values this will need ## to change!!! We are assuming things will fail later ## if the return values aren't integers, which non-pixel ## values won't be integers. retValue[0]=values[0][1:] if ( retValue[0].isdigit() ): retValue[0] = str( int(retValue[0])+1 ) retValue[1]=max elif( values[0]== '-1' ): retValue[0]=min retValue[1]=max else: # We have a single spectral value. try: value=int(values[0]) except: raise Exception, "Invalid spectral specification "\ +str( values[0] ) if ( int(values[0]) >= int(min) and int(values[0]) <= int(max) ): retValue[0]=retValue[1]=values[0] else: raise Exception, "Invalid spectral specification "\ +str( values[0] ) return retValue else: raise Exception, "Invalid spectral coordinate value: "+str(values) return retValue ## Do a sanity checks to make sure we are in the proper range. ## TODO add warning's when we adjust to min or max value. if ( int(retValue[1]) > int(max) ): retValue[1] = str(max); if ( int(retValue[0]) < int(min) ): retValue[0]= str(min); if ( int(retValue[0]) > int(max) or int(retValue[1]) < int(min) or int(min) > int(max) ): raise Exception, "The specified channel range is invalid: " + str(retValue[0]) + " to " + str(retValue[1]) + ".\nExpected values in the range " + str(min) + "to" + str(max) if ( not retValue[0].isdigit() or not retValue[1].isdigit() ): print "Sorry! Only pixel values supported at this time."+"\n\t Values given were: "+str(retValue) raise Exception, "Sorry! Only pixel values supported at this time."+"\n\t Values given were: "+str(retValue) if ( retValue[0].isdigit() ): #retValue[0]+='pix' retValue[0]=int(retValue[0]) if ( retValue[1].isdigit() ): #retValue[1]+='pix' retValue[1]=int(retValue[1]) # If we make it here all is good!!! return retValue | a69d01757f03ee69e74cf5758fa605dd04201481 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2098/a69d01757f03ee69e74cf5758fa605dd04201481/imregion.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2670,
67,
87,
21449,
12,
23242,
780,
2218,
2187,
1131,
33,
20,
16,
943,
33,
20,
262,
30,
21236,
22850,
1131,
16,
943,
308,
468,
1188,
315,
1154,
30,
3104,
1131,
468,
1188,
315,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2670,
67,
87,
21449,
12,
23242,
780,
2218,
2187,
1131,
33,
20,
16,
943,
33,
20,
262,
30,
21236,
22850,
1131,
16,
943,
308,
468,
1188,
315,
1154,
30,
3104,
1131,
468,
1188,
315,
... |
def same_c_signature_as_resolved_type(self, other_type, as_cmethod): | def same_c_signature_as_resolved_type(self, other_type, as_cmethod = 0): | def same_c_signature_as_resolved_type(self, other_type, as_cmethod): #print "CFuncType.same_c_signature_as_resolved_type:", \ # self, other_type, "as_cmethod =", as_cmethod ### if other_type is error_type: return 1 if not other_type.is_cfunction: return 0 nargs = len(self.args) if nargs <> len(other_type.args): return 0 # When comparing C method signatures, the first argument # is exempt from compatibility checking (the proper check # is performed elsewhere). for i in range(as_cmethod, nargs): if not self.args[i].type.same_as( other_type.args[i].type): return 0 if self.has_varargs <> other_type.has_varargs: return 0 if not self.return_type.same_as(other_type.return_type): return 0 if not self.same_calling_convention_as(other_type): return 0 if self.nogil <> other_type.nogil: return 0 return 1 | ab9b3aa206b1e1fca31362459f381a926cc326b7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2099/ab9b3aa206b1e1fca31362459f381a926cc326b7/PyrexTypes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1967,
67,
71,
67,
8195,
67,
345,
67,
11792,
67,
723,
12,
2890,
16,
1308,
67,
723,
16,
487,
67,
71,
2039,
273,
374,
4672,
468,
1188,
315,
39,
2622,
559,
18,
14307,
67,
71,
67,
8195,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1967,
67,
71,
67,
8195,
67,
345,
67,
11792,
67,
723,
12,
2890,
16,
1308,
67,
723,
16,
487,
67,
71,
2039,
273,
374,
4672,
468,
1188,
315,
39,
2622,
559,
18,
14307,
67,
71,
67,
8195,... |
self.start() | log.msg(msg) | def kill_sage(self): try: pid = self.sage.pid() cmd = 'kill -9 -%s'%pid os.system(cmd) self.start() except Exception, msg: self.start() | 24e96da265978e450e8d89068efd3326da5ed2b8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/24e96da265978e450e8d89068efd3326da5ed2b8/dsage_worker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8673,
67,
87,
410,
12,
2890,
4672,
775,
30,
4231,
273,
365,
18,
87,
410,
18,
6610,
1435,
1797,
273,
296,
16418,
300,
29,
300,
9,
87,
11,
9,
6610,
1140,
18,
4299,
12,
4172,
13,
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,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8673,
67,
87,
410,
12,
2890,
4672,
775,
30,
4231,
273,
365,
18,
87,
410,
18,
6610,
1435,
1797,
273,
296,
16418,
300,
29,
300,
9,
87,
11,
9,
6610,
1140,
18,
4299,
12,
4172,
13,
365,... |
if hebergementType and hebergementType != -1: | if hebergementType and str(hebergementType) != '-1': | def action_search(self, action, data): wrapper = getSAWrapper('gites_wallons') session = wrapper.session hebergementTable = wrapper.getMapper('hebergement') proprioTable = wrapper.getMapper('proprio') reservationsTable = wrapper.getMapper('reservation_proprio') provincesTable = wrapper.getMapper('province') communeTable = wrapper.getMapper('commune') episTable = wrapper.getMapper('link_hebergement_epis') hebergementType = data.get('hebergementType') provinces = data.get('provinces') communeLocalite = data.get('communes') classification = data.get('classification') capacityMin = data.get('capacityMin') roomAmount = data.get('roomAmount') checkAnimals = data.get('animals') checkSmokers = data.get('smokers') fromDate = data.get('fromDate') toDate = data.get('toDate') seeResults = self.request.form.has_key('form.seeResults') | 38eef8508577bf719b5dde1d54beeb8418fb1ea1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10188/38eef8508577bf719b5dde1d54beeb8418fb1ea1/SearchHebergement.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1301,
67,
3072,
12,
2890,
16,
1301,
16,
501,
4672,
4053,
273,
1322,
37,
3611,
2668,
75,
2997,
67,
8019,
7008,
6134,
1339,
273,
4053,
18,
3184,
3904,
31317,
820,
1388,
273,
4053,
18,
58... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1301,
67,
3072,
12,
2890,
16,
1301,
16,
501,
4672,
4053,
273,
1322,
37,
3611,
2668,
75,
2997,
67,
8019,
7008,
6134,
1339,
273,
4053,
18,
3184,
3904,
31317,
820,
1388,
273,
4053,
18,
58... |
self.fail("Timeout") | self.fail("Timeout on key=%s, event=%s" % (key, event)) | def _wait_until(self, key, event): max = 50 # 5 seconds max while not exists(join(self.tempdir, key + event)) and max: time.sleep(0.1) max -= 1 if not max: self.fail("Timeout") | bd40605b145a92a46d22a2054109138e5b836757 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10197/bd40605b145a92a46d22a2054109138e5b836757/tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7048,
67,
12198,
12,
2890,
16,
498,
16,
871,
4672,
943,
273,
6437,
468,
1381,
3974,
943,
1323,
486,
1704,
12,
5701,
12,
2890,
18,
5814,
1214,
16,
498,
397,
871,
3719,
471,
943,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7048,
67,
12198,
12,
2890,
16,
498,
16,
871,
4672,
943,
273,
6437,
468,
1381,
3974,
943,
1323,
486,
1704,
12,
5701,
12,
2890,
18,
5814,
1214,
16,
498,
397,
871,
3719,
471,
943,
... |
self.respond("503 Login with USER first") return | self.respond("503 Login with USER first.") return | def ftp_PASS(self, line): # TODO - brute force protection: 'freeze'/'sleep' (without blocking the main loop) # PI for a certain amount of time if authentication fails. if not self.username: self.respond("503 Login with USER first") return if self.username == 'anonymous': line = '' if self.authorizer.has_user(self.username): if self.authorizer.validate_authentication(self.username, line): if not self.msg_login: self.respond("230 User %s logged in." %self.username) else: self.push("230-%s\r\n" %self.msg_login) self.respond("230 Welcome.") self.authenticated = True self.max_login_attempts[1] = 0 self.fs.root = self.authorizer.get_home_dir(self.username) self.log("User %s logged in." %self.username) else: self.max_login_attempts[1] += 1 if self.max_login_attempts[0] == self.max_login_attempts[1]: self.log("Maximum login attempts. Disconnecting.") self.respond("530 Maximum login attempts. Disconnecting.") self.close() else: self.respond("530 Authentication failed.") self.username = "" else: if self.username.lower() == 'anonymous': self.respond("530 Anonymous access not allowed.") self.log('Authentication failed: anonymous access not allowed.') else: self.respond("530 Authentication failed.") self.log('Authentication failed: unknown username "%s".' %self.username) self.username = "" | cb01c49a66d7848781b76239960b060d1d7dcf4e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7236/cb01c49a66d7848781b76239960b060d1d7dcf4e/FTPServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13487,
67,
10884,
12,
2890,
16,
980,
4672,
468,
2660,
300,
5186,
624,
2944,
17862,
30,
296,
29631,
11,
2473,
19607,
11,
261,
13299,
9445,
326,
2774,
2798,
13,
468,
282,
7024,
364,
279,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13487,
67,
10884,
12,
2890,
16,
980,
4672,
468,
2660,
300,
5186,
624,
2944,
17862,
30,
296,
29631,
11,
2473,
19607,
11,
261,
13299,
9445,
326,
2774,
2798,
13,
468,
282,
7024,
364,
279,
... |
elif type(signature) == StringType and len(signature) == 4: | elif isinstance(signature, str) and len(signature) == 4: | def __init__(self, signature=None, start=0, timeout=0): """Create a communication channel with a particular application. | f9b95d4dda8ced9e1179ff54757ff27bb6abd6f3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/f9b95d4dda8ced9e1179ff54757ff27bb6abd6f3/aetools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3372,
33,
7036,
16,
787,
33,
20,
16,
2021,
33,
20,
4672,
3536,
1684,
279,
18279,
1904,
598,
279,
6826,
2521,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3372,
33,
7036,
16,
787,
33,
20,
16,
2021,
33,
20,
4672,
3536,
1684,
279,
18279,
1904,
598,
279,
6826,
2521,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
l = list(FileIterator(DATADIR)) self.assertEquals(l, []) | try: l = list(FileIterator([DATADIR])) except: self.fail("Exception while iterating on %s"%DATADIR) | def testDontChokeOnWeirdFilename(self): """we should iter without pain on everything in DATADIR, including the file whose name begins with an â """ l = list(FileIterator(DATADIR)) self.assertEquals(l, []) | 4d7cfafec9edaa4d695d0eb576d4bc7e85e44697 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2259/4d7cfafec9edaa4d695d0eb576d4bc7e85e44697/test_fileiteration.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
40,
1580,
782,
3056,
1398,
3218,
6909,
5359,
12,
2890,
4672,
3536,
1814,
1410,
1400,
2887,
293,
530,
603,
7756,
316,
12364,
1880,
7937,
16,
6508,
326,
585,
8272,
508,
17874,
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,
1842,
40,
1580,
782,
3056,
1398,
3218,
6909,
5359,
12,
2890,
4672,
3536,
1814,
1410,
1400,
2887,
293,
530,
603,
7756,
316,
12364,
1880,
7937,
16,
6508,
326,
585,
8272,
508,
17874,
598,
3... |
name = model.get_value(l_iter, 2) | try: name = model.get_value(l_iter, 2) except TypeError: return | def add_to_install_queue(self, widget, data=None): tree = self.gld.get_widget("pacs_tree") model, l_iter = tree.get_selection().get_selected() | ea6ae93eb39d190f438ac5155c32698b37671016 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2654/ea6ae93eb39d190f438ac5155c32698b37671016/gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
869,
67,
5425,
67,
4000,
12,
2890,
16,
3604,
16,
501,
33,
7036,
4672,
2151,
273,
365,
18,
75,
1236,
18,
588,
67,
6587,
2932,
84,
28965,
67,
3413,
7923,
938,
16,
328,
67,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
869,
67,
5425,
67,
4000,
12,
2890,
16,
3604,
16,
501,
33,
7036,
4672,
2151,
273,
365,
18,
75,
1236,
18,
588,
67,
6587,
2932,
84,
28965,
67,
3413,
7923,
938,
16,
328,
67,
2... |
elif issubclass(error, xml.dom.DOMException): | elif issubclass(error, xml.dom.DOMException): | def __handle(self, msg=u'', token=None, error=xml.dom.SyntaxErr, neverraise=False, args=None): """ handles all calls logs or raises exception """ line, col = None, None if token: if isinstance(token, tuple): value, line, col = token[1], token[2], token[3] else: value, line, col = token.value, token.line, token.col msg = u'%s [%s:%s: %s]' % ( msg, line, col, value) | 4af8f1c5682e75d543bf97521a7508d5e34f08c2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9125/4af8f1c5682e75d543bf97521a7508d5e34f08c2/errorhandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
4110,
12,
2890,
16,
1234,
33,
89,
11,
2187,
1147,
33,
7036,
16,
555,
33,
2902,
18,
9859,
18,
8070,
2524,
16,
5903,
11628,
33,
8381,
16,
833,
33,
7036,
4672,
3536,
7372,
777,
40... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4110,
12,
2890,
16,
1234,
33,
89,
11,
2187,
1147,
33,
7036,
16,
555,
33,
2902,
18,
9859,
18,
8070,
2524,
16,
5903,
11628,
33,
8381,
16,
833,
33,
7036,
4672,
3536,
7372,
777,
40... |
os.environ['TZ'] = 'Europe/Helsinki' time.tzset() | if hasattr(time, 'tzset'): os.environ['TZ'] = 'Europe/Helsinki' time.tzset() | def setup(self): os.environ['TZ'] = 'Europe/Helsinki' time.tzset() | 88140decb948b3da4f020f7cfeb25c2a905d7c7e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1127/88140decb948b3da4f020f7cfeb25c2a905d7c7e/testutil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
12,
2890,
4672,
1140,
18,
28684,
3292,
21647,
3546,
273,
296,
29197,
19,
44,
10558,
754,
77,
11,
813,
18,
12994,
542,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
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,
3875,
12,
2890,
4672,
1140,
18,
28684,
3292,
21647,
3546,
273,
296,
29197,
19,
44,
10558,
754,
77,
11,
813,
18,
12994,
542,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
self.latestInfo = info | self._latestInfo = info | def _loadInfo(self, limit = 1): params = { 'action': 'query', 'prop': 'imageinfo', 'titles': self.title(), 'iiprop': ['timestamp', 'user', 'comment', 'url', 'size', 'dimensions', 'sha1', 'mime', 'metadata', 'archivename', 'bitdepth'], 'iilimit': limit, } try: data = query.GetData(params, self.site()) except NotImplementedError: output("API not work, loading page HTML.") self.getImagePageHtml() return if 'error' in data: raise RuntimeError("%s" %data['error']) count = 0 if data['query']['pages'].values()[0]["imagerepository"] == "shared": self._local = False else: self._local = True infos = [] while True: for info in data['query']['pages'].values()[0]['imageinfo']: count += 1 if count == 1 and 'iistart' not in params: # count 1 and no iicontinue mean first image revision is latest. self.latestInfo = info infos.append(info) if count >= limit: break if count < limit and 'query-continue' in data: params['iistart'] = data['query-continue']['imageinfo']['iistart'] else: break self._infoLoaded = True if limit > 1: return infos | bac3828695dade5ead778d1c52a348dbd0e0e42a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/bac3828695dade5ead778d1c52a348dbd0e0e42a/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
945,
966,
12,
2890,
16,
1800,
273,
404,
4672,
859,
273,
288,
296,
1128,
4278,
296,
2271,
2187,
296,
5986,
4278,
296,
2730,
1376,
2187,
296,
17643,
4278,
365,
18,
2649,
9334,
296,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
945,
966,
12,
2890,
16,
1800,
273,
404,
4672,
859,
273,
288,
296,
1128,
4278,
296,
2271,
2187,
296,
5986,
4278,
296,
2730,
1376,
2187,
296,
17643,
4278,
365,
18,
2649,
9334,
296,
... |
elif dep.module_id.state == 'uninstalled': to_install.add(dep.module_id.id) | def button_upgrade(self, cr, uid, ids, context=None): depobj = self.pool.get('ir.module.module.dependency') todo = self.browse(cr, uid, ids, context=context) to_install = set() i = 0 while i<len(todo): mod = todo[i] i += 1 if mod.state not in ('installed','to upgrade'): raise orm.except_orm(_('Error'), _("Can not upgrade module '%s'. It is not installed.") % (mod.name,)) iids = depobj.search(cr, uid, [('name', '=', mod.name)], context=context) for dep in depobj.browse(cr, uid, iids, context=context): if dep.module_id.state=='installed': todo.append(dep.module_id) elif dep.module_id.state == 'uninstalled': to_install.add(dep.module_id.id) self.write(cr,uid, map(lambda x: x.id, todo), {'state':'to upgrade'}, context=context) self.button_install(cr, uid, list(to_install)) return True | 080e0dc652d8e70d91dbb5fcc33d95b2899da251 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7397/080e0dc652d8e70d91dbb5fcc33d95b2899da251/module.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3568,
67,
15097,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
443,
1631,
441,
273,
365,
18,
6011,
18,
588,
2668,
481,
18,
2978,
18,
2978,
18,
15896,
6134,
10621,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3568,
67,
15097,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
443,
1631,
441,
273,
365,
18,
6011,
18,
588,
2668,
481,
18,
2978,
18,
2978,
18,
15896,
6134,
10621,
... | |
content = str(self.classCustomLineEdit.text()).replace(":", " ").replace(",", " ").replace("-", " ").split() | content = self.customClassSplits.replace(":", " ").replace(",", " ").replace("-", " ").split() | def discretizeClass(self): if self.originalData: discType = self.classDiscretization classVar = self.originalData.domain.classVar if discType == 2: try: content = str(self.classCustomLineEdit.text()).replace(":", " ").replace(",", " ").replace("-", " ").split() customs = dict.fromkeys([float(x) for x in content]).keys() # remove duplicates (except 8.0, 8.000 ...) customs.sort() except: customs = [] | bcba59e5cf4e078092c13dacca2737459e977ced /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6366/bcba59e5cf4e078092c13dacca2737459e977ced/OWDiscretize.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19169,
1349,
554,
797,
12,
2890,
4672,
309,
365,
18,
8830,
751,
30,
19169,
559,
273,
365,
18,
1106,
28912,
1349,
1588,
667,
1537,
273,
365,
18,
8830,
751,
18,
4308,
18,
1106,
1537,
225... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19169,
1349,
554,
797,
12,
2890,
4672,
309,
365,
18,
8830,
751,
30,
19169,
559,
273,
365,
18,
1106,
28912,
1349,
1588,
667,
1537,
273,
365,
18,
8830,
751,
18,
4308,
18,
1106,
1537,
225... |
self._bgSelectionEndTime) | self._bgSelectionEndTime, self.dayWidth) | def DrawBackground(self, dc): styles = self.parent self._doDrawingCalculations() | 40d1ecfbe5cf8d06010266900c1b6edbd2528aa0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/40d1ecfbe5cf8d06010266900c1b6edbd2528aa0/CalendarCanvas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10184,
8199,
12,
2890,
16,
6744,
4672,
5687,
273,
365,
18,
2938,
365,
6315,
2896,
26885,
4844,
1012,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
10184,
8199,
12,
2890,
16,
6744,
4672,
5687,
273,
365,
18,
2938,
365,
6315,
2896,
26885,
4844,
1012,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if bdb.version() > (4,7): | if hasattr(self.env, "log_set_config"): | def __init__(self, path, name, duplicates=False): self.path = path self.dbpath = os.path.join(self.path, name) if not os.path.isdir(self.path): os.makedirs(self.path) self.env = bdb.DBEnv() self.env.set_tx_max(self.max_txns) self.env.set_lk_max_lockers(self.max_txns*2) self.env.set_lk_max_locks(self.max_txns*2) self.env.set_lk_max_objects(self.max_txns*2) self.env.set_flags(bdb.DB_TXN_NOSYNC, True) if bdb.version() > (4,7): self.env.log_set_config(bdb.DB_LOG_AUTO_REMOVE, True) self.env.open(self.path, bdb.DB_CREATE | bdb.DB_INIT_LOCK | bdb.DB_INIT_LOG | bdb.DB_INIT_MPOOL | bdb.DB_INIT_TXN | bdb.DB_RECOVER | bdb.DB_THREAD) self.db = bdb.DB(self.env) if duplicates: self.db.set_flags(bdb.DB_DUPSORT) if bdb.version() > (4,1): txn = self.env.txn_begin() self.db.open(self.dbpath, name, flags=bdb.DB_CREATE|bdb.DB_THREAD, dbtype=bdb.DB_BTREE, txn=txn) txn.commit() else: self.db.open(self.dbpath, name, flags=bdb.DB_CREATE|bdb.DB_THREAD, dbtype=bdb.DB_BTREE) | 29dcac664c3f2fbc9009978e949ae467280aa521 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11095/29dcac664c3f2fbc9009978e949ae467280aa521/bdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
589,
16,
508,
16,
11211,
33,
8381,
4672,
365,
18,
803,
273,
589,
365,
18,
1966,
803,
273,
1140,
18,
803,
18,
5701,
12,
2890,
18,
803,
16,
508,
13,
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,
589,
16,
508,
16,
11211,
33,
8381,
4672,
365,
18,
803,
273,
589,
365,
18,
1966,
803,
273,
1140,
18,
803,
18,
5701,
12,
2890,
18,
803,
16,
508,
13,
22... |
parse_warnings = self._parse_warnings parse_errors = self._parse_errors field_warnings = self._field_warnings if self._docformat == 'epytext': pdoc = epytext.parse(docstring, parse_errors, parse_warnings) elif self._docformat == 'javadoc': import epydoc.javadoc as javadoc pdoc = javadoc.parse(docstring, field_warnings) elif self._docformat == 'restructuredtext': already_imported = sys.modules.has_key('epydoc.rst') try: import epydoc.rst as rst pdoc = rst.parse(docstring) except ImportError: if not already_imported: estr = 'ReStructuredText is not installed; ' estr += 'parsing docstring as plaintext.' parse_errors.append(estr) self._descr = epytext.parse_as_literal(docstring) return except Exception, e: estr = 'Error parsing ReStructuredText docstring: %s' % e parse_errors.append(estr) self._descr = epytext.parse_as_literal(docstring) return else: self._descr = epytext.parse_as_literal(docstring) return if parse_errors: self._descr = epytext.parse_as_literal(docstring) return if (pdoc.hasChildNodes() and pdoc.childNodes[0].hasChildNodes() and pdoc.childNodes[0].childNodes[-1].hasChildNodes() and pdoc.childNodes[0].childNodes[-1].tagName == 'fieldlist'): fields = pdoc.childNodes[0].childNodes[-1].childNodes pdoc.childNodes[0].removeChild(pdoc.childNodes[0].childNodes[-1]) for field in fields: tag = field.childNodes[0].childNodes[0].data.lower() field.removeChild(field.childNodes[0]) if field.childNodes and field.childNodes[0].tagName == 'arg': arg = field.childNodes[0].childNodes[0].data field.removeChild(field.childNodes[0]) else: arg = None field.tagName = 'epytext' self._process_field(tag, arg, field, field_warnings) if pdoc.hasChildNodes() and pdoc.childNodes[0].hasChildNodes(): self._descr = pdoc else: self._descr = None | errors = [] parsed_docstring = markup.parse(docstring, self._docformat, errors) self._parse_errors = [e for e in errors if e.is_fatal()] self._parse_warnings = [e for e in errors if not e.is_fatal()] descr, fields = parsed_docstring.split_fields() self._descr = descr for field in fields: self._process_field(field.tag(), field.arg(), field.body(), self._field_warnings) | def __parse_docstring(self, docstring): # Parse the documentation, and store any errors or warnings. parse_warnings = self._parse_warnings parse_errors = self._parse_errors field_warnings = self._field_warnings | 7140f1248773f589eaa5826bd2b3d64a09ab01f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/7140f1248773f589eaa5826bd2b3d64a09ab01f2/objdoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2670,
67,
24675,
12,
2890,
16,
14525,
4672,
468,
2884,
326,
7323,
16,
471,
1707,
1281,
1334,
578,
5599,
18,
1109,
67,
12103,
273,
365,
6315,
2670,
67,
12103,
1109,
67,
4324,
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,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2670,
67,
24675,
12,
2890,
16,
14525,
4672,
468,
2884,
326,
7323,
16,
471,
1707,
1281,
1334,
578,
5599,
18,
1109,
67,
12103,
273,
365,
6315,
2670,
67,
12103,
1109,
67,
4324,
273,
... |
manifest.append((os.path.join(bp, 'images/', i), 'image/jpg')) | manifest.append((os.path.join(bp, 'images/', i), 'image/jpeg')) | def create_opf(self, htmlfile, guide=None): mi = self.book_header.exth.mi opf = OPFCreator(os.path.dirname(htmlfile), mi) if hasattr(self.book_header.exth, 'cover_offset'): opf.cover = 'images/%05d.jpg'%(self.book_header.exth.cover_offset+1) manifest = [(htmlfile, 'text/x-oeb1-document')] bp = os.path.dirname(htmlfile) for i in getattr(self, 'image_names', []): manifest.append((os.path.join(bp, 'images/', i), 'image/jpg')) opf.create_manifest(manifest) opf.create_spine([os.path.basename(htmlfile)]) toc = None if guide is not None: opf.create_guide(guide) for ref in opf.guide: if ref.type.lower() == 'toc': toc = ref.href() if toc: index = self.processed_html.find('<a id="%s" name="%s"'%(toc.partition('#')[-1], toc.partition('#')[-1])) tocobj = None ent_pat = re.compile(r'&(\S+?);') if index > -1: raw = '<html><body>'+self.processed_html[index:] root = html.fromstring(raw) tocobj = TOC() for a in root.xpath('//a[@href]'): try: text = u' '.join([t.strip() for t in a.xpath('descendant::text()')]) except: text = '' text = ent_pat.sub(entity_to_unicode, text) if a.get('href', '').startswith('#'): tocobj.add_item(toc.partition('#')[0], a.attrib['href'][1:], text) if tocobj is not None: opf.set_toc(tocobj) return opf | 2326873b7c8bfc11478b59c7c8ec10d4776e99c6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9125/2326873b7c8bfc11478b59c7c8ec10d4776e99c6/reader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
556,
74,
12,
2890,
16,
1729,
768,
16,
7343,
33,
7036,
4672,
12837,
273,
365,
18,
3618,
67,
3374,
18,
408,
76,
18,
9197,
1061,
74,
273,
7247,
42,
10636,
12,
538,
18,
803,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
556,
74,
12,
2890,
16,
1729,
768,
16,
7343,
33,
7036,
4672,
12837,
273,
365,
18,
3618,
67,
3374,
18,
408,
76,
18,
9197,
1061,
74,
273,
7247,
42,
10636,
12,
538,
18,
803,
1... |
debug("SFTP'ing %s to %s:%s" % (local_filepath, hostname, remote_filepath)) | debug("SFTP'ing %s to the server as %s" % (local_filepath, remote_filepath)) | def sftpPut(transport, local_filepath, remote_filepath): """Uses SFTP to transfer a local file (local_filepath) to a remote server at the specified path (remote_filepath) using the given Paramiko transport object.""" debug("Opening an SFTP channel...") sftp = transport.open_sftp() filename = os.path.basename(local_filepath) if filename not in remote_filepath: remote_filepath = os.path.normpath(remote_filepath + "/" + filename) debug("SFTP'ing %s to %s:%s" % (local_filepath, hostname, remote_filepath)) sftp.put(local_filepath, remote_filepath) | b986f87456c68f9f6506070171008c62c0cb9aaf /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11566/b986f87456c68f9f6506070171008c62c0cb9aaf/sshpt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26221,
6426,
12,
13049,
16,
1191,
67,
10561,
16,
2632,
67,
10561,
4672,
3536,
15128,
348,
17104,
358,
7412,
279,
1191,
585,
261,
3729,
67,
10561,
13,
358,
279,
2632,
1438,
622,
326,
1269... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26221,
6426,
12,
13049,
16,
1191,
67,
10561,
16,
2632,
67,
10561,
4672,
3536,
15128,
348,
17104,
358,
7412,
279,
1191,
585,
261,
3729,
67,
10561,
13,
358,
279,
2632,
1438,
622,
326,
1269... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.