rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
INPUT:: | INPUT: | def NStarGraph(self,n): r''' Returns the n-star graph. | 964210a5192f4b56729c7c92c3aa648c59e61bea /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/964210a5192f4b56729c7c92c3aa648c59e61bea/graph_generators.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
423,
18379,
4137,
12,
2890,
16,
82,
4672,
436,
26418,
2860,
326,
290,
17,
10983,
2667,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
423,
18379,
4137,
12,
2890,
16,
82,
4672,
436,
26418,
2860,
326,
290,
17,
10983,
2667,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
i = 0 while i < len(line) and line[i].isspace(): i = i+1 list.append(' %s\n' % line.strip()) if offset is not None: s = ' ' for c in line[i:offset-1]: if c.isspace(): s = s + c else: s = s + ' ' list.append('%s^\n' % s) value = msg | if line is not None: i = 0 while i < len(line) and line[i].isspace(): i = i+1 list.append(' %s\n' % line.strip()) if offset is not None: s = ' ' for c in line[i:offset-1]: if c.isspace(): s = s + c else: s = s + ' ' list.append('%s^\n' % s) value = msg | def format_exception_only(etype, value): """Format the exception part of a traceback. The arguments are the exception type and value such as given by sys.last_type and sys.last_value. The return value is a list of strings, each ending in a newline. Normally, the list contains a single string; however, for SyntaxError exceptions, it contains several lines that (when printed) display detailed information about where the syntax error occurred. The message indicating which exception occurred is the always last string in the list. """ list = [] if type(etype) == types.ClassType: stype = etype.__name__ else: stype = etype if value is None: list.append(str(stype) + '\n') else: if etype is SyntaxError: try: msg, (filename, lineno, offset, line) = value except: pass else: if not filename: filename = "<string>" list.append(' File "%s", line %d\n' % (filename, lineno)) i = 0 while i < len(line) and line[i].isspace(): i = i+1 list.append(' %s\n' % line.strip()) if offset is not None: s = ' ' for c in line[i:offset-1]: if c.isspace(): s = s + c else: s = s + ' ' list.append('%s^\n' % s) value = msg s = _some_str(value) if s: list.append('%s: %s\n' % (str(stype), s)) else: list.append('%s\n' % str(stype)) return list | 0bb580d297bdc6ccb33fcd15e317a79112e77750 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0bb580d297bdc6ccb33fcd15e317a79112e77750/traceback.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
67,
4064,
67,
3700,
12,
5872,
16,
460,
4672,
3536,
1630,
326,
1520,
1087,
434,
279,
10820,
18,
225,
1021,
1775,
854,
326,
1520,
618,
471,
460,
4123,
487,
864,
635,
2589,
18,
2722,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
4064,
67,
3700,
12,
5872,
16,
460,
4672,
3536,
1630,
326,
1520,
1087,
434,
279,
10820,
18,
225,
1021,
1775,
854,
326,
1520,
618,
471,
460,
4123,
487,
864,
635,
2589,
18,
2722,... |
m = """You may only send %d messages every %s, and you have exceeded this limit. You may post again | m = """Members may only send %d messages every %s, and you have exceeded this limit; you may post again | def get_user_can_post(self, reasonNeeded=False): # Assume the user can post retval = (('', 1), True) | 9c426d70d4757fb85a350a676f4149162da23ad4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6274/9c426d70d4757fb85a350a676f4149162da23ad4/view.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1355,
67,
4169,
67,
2767,
12,
2890,
16,
3971,
11449,
33,
8381,
4672,
468,
15983,
326,
729,
848,
1603,
5221,
273,
261,
2668,
2187,
404,
3631,
1053,
13,
2,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1355,
67,
4169,
67,
2767,
12,
2890,
16,
3971,
11449,
33,
8381,
4672,
468,
15983,
326,
729,
848,
1603,
5221,
273,
261,
2668,
2187,
404,
3631,
1053,
13,
2,
-100,
-100,
-100,
-10... |
path = os.path.join(self.root_path, path) if not isinstance(path,unicode): if self.encoding is None: path = path.decode(sys.getfilesystemencoding()) else: path = path.decode(self.encoding) | path = os.path.join(self.root_path, path) path = self._decode_path(path) | def getsyspath(self, path, allow_none=False): path = relpath(normpath(path)).replace("/",os.sep) path = os.path.join(self.root_path, path) if not isinstance(path,unicode): if self.encoding is None: path = path.decode(sys.getfilesystemencoding()) else: path = path.decode(self.encoding) return path | d038e1ceaeca5373a3b97933becee420a1587588 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5579/d038e1ceaeca5373a3b97933becee420a1587588/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5571,
1900,
803,
12,
2890,
16,
589,
16,
1699,
67,
6102,
33,
8381,
4672,
589,
273,
14614,
12,
7959,
803,
12,
803,
13,
2934,
2079,
2932,
19,
3113,
538,
18,
10814,
13,
589,
273,
1140,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5571,
1900,
803,
12,
2890,
16,
589,
16,
1699,
67,
6102,
33,
8381,
4672,
589,
273,
14614,
12,
7959,
803,
12,
803,
13,
2934,
2079,
2932,
19,
3113,
538,
18,
10814,
13,
589,
273,
1140,
1... |
return resutl | return result | def read(self, chars=-1): if chars == -1 or chars > len(self.data): result = self.data self.data = '' if chars == -1: return result + self.stream.read() else: return result + self.stream.read(chars-len(result)) elif not self.data: return self.stream.read(chars) else: result = self.data[:chars] self.data = self.data[chars:] return resutl | abcb8cc1f628634403bf36afaea277adea27a396 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4487/abcb8cc1f628634403bf36afaea277adea27a396/inputstream.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
12,
2890,
16,
5230,
29711,
21,
4672,
309,
5230,
422,
300,
21,
578,
5230,
405,
562,
12,
2890,
18,
892,
4672,
563,
273,
365,
18,
892,
365,
18,
892,
273,
875,
309,
5230,
422,
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,
855,
12,
2890,
16,
5230,
29711,
21,
4672,
309,
5230,
422,
300,
21,
578,
5230,
405,
562,
12,
2890,
18,
892,
4672,
563,
273,
365,
18,
892,
365,
18,
892,
273,
875,
309,
5230,
422,
300,
... |
dcall_discard(self, 'requestBlocks_dcall') | def scheduleRequestBlocks(self): | 0ec4bd847cf391114bf6ee757244071c3ba8919b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12372/0ec4bd847cf391114bf6ee757244071c3ba8919b/dtella_bridgeclient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4788,
691,
6450,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4788,
691,
6450,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
[True, True, True] | [True, True, True] | def is_irreducible(self): """ Returns True if self is an irreducible character. | 67d654215599230a09c5cccc4e460acbf57b6338 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/67d654215599230a09c5cccc4e460acbf57b6338/weyl_characters.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
481,
1118,
5286,
1523,
12,
2890,
4672,
3536,
2860,
1053,
309,
365,
353,
392,
9482,
1118,
5286,
1523,
3351,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
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,
353,
67,
481,
1118,
5286,
1523,
12,
2890,
4672,
3536,
2860,
1053,
309,
365,
353,
392,
9482,
1118,
5286,
1523,
3351,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
if self.returncode == None: | if self.returncode is None: | def poll(self): """Check if child process has terminated. Returns returncode attribute.""" if self.returncode == None: try: pid, sts = os.waitpid(self.pid, os.WNOHANG) if pid == self.pid: self._handle_exitstatus(sts) except os.error: pass return self.returncode | 587e8b6e7deec97da104d8c9590d53e2cbdee4c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/587e8b6e7deec97da104d8c9590d53e2cbdee4c5/subprocess.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7672,
12,
2890,
4672,
3536,
1564,
309,
1151,
1207,
711,
14127,
18,
225,
2860,
18125,
1566,
12123,
309,
365,
18,
2463,
710,
353,
599,
30,
775,
30,
4231,
16,
27099,
273,
1140,
18,
7048,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
2890,
4672,
3536,
1564,
309,
1151,
1207,
711,
14127,
18,
225,
2860,
18125,
1566,
12123,
309,
365,
18,
2463,
710,
353,
599,
30,
775,
30,
4231,
16,
27099,
273,
1140,
18,
7048,
... |
self.collected_headings.append([0, self.request.include_id, None]) | self.collected_headings.append([0, self.request.uid_generator.include_id, None]) | def endContent(self): res = FormatterBase.endContent(self) self.collected_headings.append([0, self.request.include_id, None]) return res | 82ff18485df7b9447c6953113adba7d5b236416c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/888/82ff18485df7b9447c6953113adba7d5b236416c/TableOfContents.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
679,
1350,
12,
2890,
4672,
400,
273,
14924,
2171,
18,
409,
1350,
12,
2890,
13,
365,
18,
14676,
329,
67,
1978,
899,
18,
6923,
3816,
20,
16,
365,
18,
2293,
18,
1911,
67,
8812,
18,
6702... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
679,
1350,
12,
2890,
4672,
400,
273,
14924,
2171,
18,
409,
1350,
12,
2890,
13,
365,
18,
14676,
329,
67,
1978,
899,
18,
6923,
3816,
20,
16,
365,
18,
2293,
18,
1911,
67,
8812,
18,
6702... |
out_stream.write(txt.encode(self.opts.output_encoding, 'replace')) | out_stream.write(txt.encode(opts.output_encoding, 'replace')) | def convert(self, oeb_book, output_path, input_plugin, opts, log): writer = TxtWriter(TxtNewlines(opts.newline).newline, log) txt = writer.dump(oeb_book.spine) | ff42c7b8baa95c656eca9f7c296457a3ccdc7a42 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9125/ff42c7b8baa95c656eca9f7c296457a3ccdc7a42/output.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
12,
2890,
16,
320,
24008,
67,
3618,
16,
876,
67,
803,
16,
810,
67,
4094,
16,
1500,
16,
613,
4672,
2633,
273,
6424,
88,
2289,
12,
21811,
1908,
3548,
12,
4952,
18,
22861,
2934,
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
12,
2890,
16,
320,
24008,
67,
3618,
16,
876,
67,
803,
16,
810,
67,
4094,
16,
1500,
16,
613,
4672,
2633,
273,
6424,
88,
2289,
12,
21811,
1908,
3548,
12,
4952,
18,
22861,
2934,
2... |
self.write_breadcrumbs(out, doc) | self.write_breadcrumbs(out, doc, self.pysrc_url(doc)) | def write_sourcecode(self, out, doc): filename = doc.filename name = str(doc.canonical_name) # Header self.write_header(out, name) self.write_navbar(out, doc) self.write_breadcrumbs(out, doc) | 038faa3b3abb74159d142669f28698abda4fb0e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/038faa3b3abb74159d142669f28698abda4fb0e8/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
3168,
710,
12,
2890,
16,
596,
16,
997,
4672,
1544,
273,
997,
18,
3459,
508,
273,
609,
12,
2434,
18,
18288,
67,
529,
13,
225,
468,
4304,
365,
18,
2626,
67,
3374,
12,
659,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
3168,
710,
12,
2890,
16,
596,
16,
997,
4672,
1544,
273,
997,
18,
3459,
508,
273,
609,
12,
2434,
18,
18288,
67,
529,
13,
225,
468,
4304,
365,
18,
2626,
67,
3374,
12,
659,
... |
time.sleep(1) data = self.fp.readline(300) if not data: _debug_('%s: No data, stopping (pid %s)!' % (self.name, os.getpid())) self.fp.close() break | _debug_('%s: No data, stopping (pid %s)!' % (self.name, os.getpid())) self.fp.close() break | def _handle_input(self): saved = '' while 1: | 3e53c993840c4efaa2b94c819b7ef80c670bd925 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/3e53c993840c4efaa2b94c819b7ef80c670bd925/childapp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4110,
67,
2630,
12,
2890,
4672,
225,
5198,
273,
875,
1323,
404,
30,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4110,
67,
2630,
12,
2890,
4672,
225,
5198,
273,
875,
1323,
404,
30,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
print '*get*', `line` | print '*get*', self.sanitize(line) | def getline(self): line = self.file.readline() if self.debugging > 1: print '*get*', `line` if not line: raise EOFError if line[-2:] == CRLF: line = line[:-2] elif line[-1:] in CRLF: line = line[:-1] return line | a400852e53478ba4d10fbcf752119754d73c29d3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/a400852e53478ba4d10fbcf752119754d73c29d3/ftplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
1369,
12,
2890,
4672,
980,
273,
365,
18,
768,
18,
896,
1369,
1435,
309,
365,
18,
4148,
1998,
405,
404,
30,
1172,
14609,
588,
14,
2187,
365,
18,
20266,
12,
1369,
13,
309,
486,
98... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1369,
12,
2890,
4672,
980,
273,
365,
18,
768,
18,
896,
1369,
1435,
309,
365,
18,
4148,
1998,
405,
404,
30,
1172,
14609,
588,
14,
2187,
365,
18,
20266,
12,
1369,
13,
309,
486,
98... |
return parse( xml_data ) | return self.parse( xml_data ) | def analyze(self, text, content_type="text/txt"): """ Submits 'text' to OpenCalais for analysis and memorizes the extracted metadata. Set the content-type to 'text/html' if you are submitting HTML data. """ externalID = Calais.content_id(text) paramsXML = PARAMS_XML % (content_type, self.allow_distro, self.allow_search, externalID, self.submitter) param = urllib.urlencode({'licenseID':self.api_key, 'content':text, 'paramsXML':paramsXML}) # do not fetch the data again, if a file exists in the cache get_calias_data = urllib.urlopen(OPENCALAIS_URL, param).read if self.cache is None: xml_data = unpack( get_calias_data() ) else: xml_data = unpack( self.cache.fetch( externalID, get_calias_data ) ) | 81e94b045477ce84d5691e72cef69f651c8d471e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6604/81e94b045477ce84d5691e72cef69f651c8d471e/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12375,
12,
2890,
16,
977,
16,
913,
67,
723,
1546,
955,
19,
5830,
6,
4672,
3536,
2592,
22679,
296,
955,
11,
358,
3502,
3005,
69,
291,
364,
6285,
471,
1663,
280,
3128,
326,
9438,
1982,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12375,
12,
2890,
16,
977,
16,
913,
67,
723,
1546,
955,
19,
5830,
6,
4672,
3536,
2592,
22679,
296,
955,
11,
358,
3502,
3005,
69,
291,
364,
6285,
471,
1663,
280,
3128,
326,
9438,
1982,
... |
m = re.match(r'^.. \[([a-z0-9_.-])\]', line, re.I) | m = re.match(ur'^.. \[([a-z0-9_.-])\]', line, re.I) | def mangle_docstrings(app, what, name, obj, options, lines, reference_offset=[0]): if what == 'module': # Strip top title title_re = re.compile(r'^\s*[#*=]{4,}\n[a-z0-9 -]+\n[#*=]{4,}\s*', re.I|re.S) lines[:] = title_re.sub('', "\n".join(lines)).split("\n") else: doc = get_doc_object(obj, what, "\n".join(lines)) doc.use_plots = app.config.numpydoc_use_plots lines[:] = str(doc).split("\n") if app.config.numpydoc_edit_link and hasattr(obj, '__name__') and \ obj.__name__: if hasattr(obj, '__module__'): v = dict(full_name="%s.%s" % (obj.__module__, obj.__name__)) else: v = dict(full_name=obj.__name__) lines += ['', '.. htmlonly::', ''] lines += [' %s' % x for x in (app.config.numpydoc_edit_link % v).split("\n")] # replace reference numbers so that there are no duplicates references = [] for line in lines: line = line.strip() m = re.match(r'^.. \[([a-z0-9_.-])\]', line, re.I) if m: references.append(m.group(1)) # start renaming from the longest string, to avoid overwriting parts references.sort(key=lambda x: -len(x)) if references: for i, line in enumerate(lines): for r in references: if re.match(r'^\d+$', r): new_r = "R%d" % (reference_offset[0] + int(r)) else: new_r = "%s%d" % (r, reference_offset[0]) lines[i] = lines[i].replace('[%s]_' % r, '[%s]_' % new_r) lines[i] = lines[i].replace('.. [%s]' % r, '.. [%s]' % new_r) reference_offset[0] += len(references) | c3a0fb9711a119ac303d18719cea702efeff408f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14925/c3a0fb9711a119ac303d18719cea702efeff408f/numpydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
312,
4341,
67,
2434,
10219,
12,
2910,
16,
4121,
16,
508,
16,
1081,
16,
702,
16,
2362,
16,
2114,
67,
3348,
22850,
20,
65,
4672,
225,
309,
4121,
422,
296,
2978,
4278,
468,
15589,
1760,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
312,
4341,
67,
2434,
10219,
12,
2910,
16,
4121,
16,
508,
16,
1081,
16,
702,
16,
2362,
16,
2114,
67,
3348,
22850,
20,
65,
4672,
225,
309,
4121,
422,
296,
2978,
4278,
468,
15589,
1760,
... |
if (("lax" == type) and (self._max != self._min) and | if (("lax" == regexp_type) and (self._max != self._min) and | def getString(self, type = "strict"): """The result depends on `type`. If `type` is "strict" the representation will be the exact interval (@TODO ? except if the whole class is covered for \d and \s). If `type` is "lax" the representation of the class will be used for some characters : - digit -> \d - letter or '_' -> \w - space -> \s If the sequence is not contained and more than one character or different from a class is returned brakets will be added unless the sequence is part of a bigger interval.""" use_brackets = False if (("lax" == type) and (self._max != self._min) and (self.getCategory() in CATEGORY_HAVE_CLASS)): if (self.getCategory() == DIGITS.getCategory()): string = "\d" elif (self.getCategory() in CATEGORY_WORDS): string = "\w" elif (self.getCategory() == SPACES.getCategory()): string = "\s" else: raise Exception("Unexpected category: " + self.getCategory()) else: if (self._max == self._min): string = self._max.getString() elif (ord(self._max.getChar()) - ord(self._min.getChar()) > 1): string = self._min.getString() + "-" + self._max.getString() use_brackets = True else: string = self._min.getString() + self._max.getString() use_brackets = True if ((not self._contained) and (use_brackets)): string = "[" + string + "]" return string | 9b3ed74c17dec8d9116a2102e8382fb7fa489058 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6399/9b3ed74c17dec8d9116a2102e8382fb7fa489058/generator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4997,
12,
2890,
16,
618,
273,
315,
13948,
6,
4672,
3536,
1986,
563,
10935,
603,
1375,
723,
8338,
971,
1375,
723,
68,
353,
315,
13948,
6,
326,
4335,
903,
506,
326,
5565,
3673,
261,
36,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4997,
12,
2890,
16,
618,
273,
315,
13948,
6,
4672,
3536,
1986,
563,
10935,
603,
1375,
723,
8338,
971,
1375,
723,
68,
353,
315,
13948,
6,
326,
4335,
903,
506,
326,
5565,
3673,
261,
36,
... |
all_letters = string.replace(all_letters, self.alignment._alphabet.gap_char, '') | all_letters = all_letters.replace(self.alignment._alphabet.gap_char,'') | def _get_base_replacements(self, skip_items = []): """Get a zeroed dictonary of all possible letter combinations. | db0e57e83d4c61f00fb4a96f8686aadf8ab59e3f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7167/db0e57e83d4c61f00fb4a96f8686aadf8ab59e3f/AlignInfo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
1969,
67,
2079,
1346,
12,
2890,
16,
2488,
67,
3319,
273,
5378,
4672,
3536,
967,
279,
3634,
329,
2065,
265,
814,
434,
777,
3323,
9471,
17265,
18,
2,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
1969,
67,
2079,
1346,
12,
2890,
16,
2488,
67,
3319,
273,
5378,
4672,
3536,
967,
279,
3634,
329,
2065,
265,
814,
434,
777,
3323,
9471,
17265,
18,
2,
-100,
-100,
-100,
-100... |
print b.products() | print b.getproducts() | def selftest(): url = 'https://bugzilla.redhat.com/xmlrpc.cgi' cookies = find_firefox_cookiefile() public_bug = 1 private_bug = 250666 query = {'product':'Fedora', 'component':'kernel', 'version':'devel', 'long_desc':'wireless'} print "Woo, welcome to the bugzilla.py self-test." print "Using bugzilla at " + url if not cookies: print "Could not find any cookies for that URL!" print "Log in with firefox or give me a username/password." sys.exit(1) print "Reading cookies from " + cookies b = Bugzilla(url=url,cookies=cookies) print "Reading product list" print b.products() print "Reading public bug (#%i)" % public_bug print b.getbugsimple(public_bug) print "Reading private bug (#%i)" % private_bug try: print b.getbugsimple(private_bug) except xmlrpclib.Fault, e: if 'NotPermitted' in e.faultString: print "Failed: Not authorized." else: print "Failed: Unknown XMLRPC error: %s" % e q_msg = "%s %s %s %s" % (query['product'],query['component'], query['version'],query['long_desc']) print "Querying %s bugs" % q_msg q_result = b.query(query) bugs = q_result['bugs'] print "%s bugs found." % len(bugs) for bug in bugs: if 'short_short_desc' not in bug: print "wtf? bug %s has no desc." % bug['bug_id'] else: print "Bug #%s %-10s - %s - %s" % (bug['bug_id'], '('+bug['bug_status']+')',bug['assigned_to'], bug['short_short_desc']) print "Awesome. We're done." | da6ca0d553e0c3dd3da698e46b215df23369eee2 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5050/da6ca0d553e0c3dd3da698e46b215df23369eee2/selftest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
365,
3813,
13332,
880,
273,
296,
4528,
2207,
925,
15990,
18,
1118,
11304,
18,
832,
19,
2902,
7452,
18,
19062,
11,
7237,
273,
1104,
67,
12179,
13873,
67,
8417,
768,
1435,
1071,
67,
925,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
365,
3813,
13332,
880,
273,
296,
4528,
2207,
925,
15990,
18,
1118,
11304,
18,
832,
19,
2902,
7452,
18,
19062,
11,
7237,
273,
1104,
67,
12179,
13873,
67,
8417,
768,
1435,
1071,
67,
925,
... |
out.write("\tifaceConstantCount = %d\n" % len(constants)) | out.write("\tifaceConstantCount = %d,\n" % len(constants)) out.write("\tifacePropertyCount = %d\n" % len(properties)) | def printIFaceTableCXXFile(f,out): constants = [] functions = [] for name in f.order: features = f.features[name] if features["Category"] != "Deprecated": if features["FeatureType"] == "val": if not (Contains(name, "SCE_") or Contains(name, "SCLEX_")): constants.append( (name, features["Value"]) ) elif features["FeatureType"] in ["fun","get","set"]: functions.append((name, features)) out.write("\nstatic IFaceConstant ifaceConstants[] = {") if constants: constants.sort() first = 1 for name, value in constants: if first: first = 0 else: out.write(",") out.write('\n\t{"%s",%s}' % (name, value)) out.write("\n};\n") else: out.write('{"",0}};\n') # Write an array of function descriptions. This can be # used as a sort of compiled typelib. out.write("\nstatic IFaceFunction ifaceFunctions[] = {") if functions: functions.sort() first = 1 for name, features in functions: if first: first = 0 else: out.write(",") paramTypes = [ features["Param1Type"] or "void", features["Param2Type"] or "void" ] # Fix-up: if a param is an int named length, change to iface_type_length. if features["Param1Type"] == "int" and features["Param1Name"] == "length": paramTypes[0] = "length" if features["Param2Type"] == "int" and features["Param2Name"] == "length": paramTypes[1] = "length" out.write('\n\t{"%s", %s, iface_%s, {iface_%s, iface_%s}}' % ( name, features["Value"], features["ReturnType"] or "void", paramTypes[0], paramTypes[1] )) out.write("\n};\n") else: out.write('{""}};\n') out.write("\nenum {\n") out.write("\tifaceFunctionCount = %d,\n" % len(functions)) out.write("\tifaceConstantCount = %d\n" % len(constants)) out.write("};\n\n") | 114db92c80378b4eaad3f91ec47fb94c1731131a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5233/114db92c80378b4eaad3f91ec47fb94c1731131a/IFaceTableGen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
5501,
623,
1388,
39,
5619,
812,
12,
74,
16,
659,
4672,
6810,
273,
5378,
4186,
273,
5378,
225,
364,
508,
316,
284,
18,
1019,
30,
4467,
273,
284,
18,
7139,
63,
529,
65,
309,
4467... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
5501,
623,
1388,
39,
5619,
812,
12,
74,
16,
659,
4672,
6810,
273,
5378,
4186,
273,
5378,
225,
364,
508,
316,
284,
18,
1019,
30,
4467,
273,
284,
18,
7139,
63,
529,
65,
309,
4467... |
self.assertEquals(x._objects, "abc") | self.assertEquals(x._objects, b"abc") | def test_ccharp(self): x = c_char_p() self.assertEquals(x._objects, None) x.value = "abc" self.assertEquals(x._objects, "abc") x = c_char_p("spam") self.assertEquals(x._objects, "spam") | de988d78f8ffa8ec82bf0428197ea569c91e5a78 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/de988d78f8ffa8ec82bf0428197ea569c91e5a78/test_keeprefs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
71,
3001,
84,
12,
2890,
4672,
619,
273,
276,
67,
3001,
67,
84,
1435,
365,
18,
11231,
8867,
12,
92,
6315,
6911,
16,
599,
13,
619,
18,
1132,
273,
315,
18947,
6,
365,
18,
11... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
71,
3001,
84,
12,
2890,
4672,
619,
273,
276,
67,
3001,
67,
84,
1435,
365,
18,
11231,
8867,
12,
92,
6315,
6911,
16,
599,
13,
619,
18,
1132,
273,
315,
18947,
6,
365,
18,
11... |
buf.append((obj.absolute_url(1), obj.title_or_id(), obj.releasedate, obj.icon, obj.meta_type, obj.description)) | else: buf.append((obj.absolute_url(1), obj.title_or_id(), obj.releasedate, obj.icon, obj.meta_type, obj.description)) | def getPredefinedUploads(self): """ get the predefined list of uploads """ buf = [] for url in self.predefined_latest_uploads: obj = self.unrestrictedTraverse(url, None) if obj is None: self.predefined_latest_uploads.remove(url) buf.append((obj.absolute_url(1), obj.title_or_id(), obj.releasedate, obj.icon, obj.meta_type, obj.description)) return buf | 211b034dab74707538986f4038fefcf6ab0f7d23 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3287/211b034dab74707538986f4038fefcf6ab0f7d23/CHMSite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12822,
2178,
18309,
12,
2890,
4672,
3536,
336,
326,
19555,
666,
434,
18427,
3536,
1681,
273,
5378,
364,
880,
316,
365,
18,
1484,
2178,
67,
13550,
67,
27717,
30,
1081,
273,
365,
18,
318,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12822,
2178,
18309,
12,
2890,
4672,
3536,
336,
326,
19555,
666,
434,
18427,
3536,
1681,
273,
5378,
364,
880,
316,
365,
18,
1484,
2178,
67,
13550,
67,
27717,
30,
1081,
273,
365,
18,
318,
... |
if attempt == ATTEMPT_LOGIN or attempt == ATTEMPT_NONE: | if attempt == ATTEMPT_LOGIN or attempt == ATTEMPT_NONE \ or attempt == ATTEMPT_RESUME: | def __call__(self, container, req): '''The __before_publishing_traverse__ hook.''' resp = self.REQUEST['RESPONSE'] attempt = self.modifyRequest(req, resp) if attempt == ATTEMPT_DISABLED: return if not req.get('disable_cookie_login__', 0): if attempt == ATTEMPT_LOGIN or attempt == ATTEMPT_NONE: # Modify the "unauthorized" response. req._hold(ResponseCleanup(resp)) resp.unauthorized = self.unauthorized resp._unauthorized = self._unauthorized if attempt != ATTEMPT_NONE: phys_path = self.getPhysicalPath() if self.logout_page: # Cookies are in use. page = getattr(container, self.logout_page, None) if page is not None: # Provide a logout page. req._logout_path = phys_path + ('logout',) req._credentials_changed_path = ( phys_path + ('credentialsChanged',)) | cd1dc493841e97be2b039352a180da0b0cc0f3c7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1843/cd1dc493841e97be2b039352a180da0b0cc0f3c7/CookieCrumbler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
1478,
16,
1111,
4672,
9163,
1986,
1001,
5771,
67,
6543,
310,
67,
2033,
2476,
972,
3953,
1093,
6309,
1718,
273,
365,
18,
5519,
3292,
14508,
3546,
4395,
273,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
1478,
16,
1111,
4672,
9163,
1986,
1001,
5771,
67,
6543,
310,
67,
2033,
2476,
972,
3953,
1093,
6309,
1718,
273,
365,
18,
5519,
3292,
14508,
3546,
4395,
273,... |
munkicommon.display_debug1("Looking for package %s, version %s" % | munkicommon.display_debug1("Looking for package %s, version %s" % | def compareReceiptVersion(item): """ Determines if the given package is already installed. packageid is a 'com.apple.pkg.ServerAdminTools' style id Returns 0 if the receipt isn't present -1 if it's older 1 if the version is the same 2 if the version is newer -2 if there's an error in the input """ if 'packageid' in item and 'version' in item: pkgid = item['packageid'] vers = item['version'] else: print "Missing packageid or version info!" return -2 munkicommon.display_debug1("Looking for package %s, version %s" % (pkgid, vers)) installedvers = munkicommon.getInstalledPackageVersion(pkgid) if installedvers: return compareVersions(installedvers, vers) else: munkicommon.display_debug1( "\tThis package is not currently installed.") return 0 | 5350042f4ddfb098468c8d75b15dfa28757b9321 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6241/5350042f4ddfb098468c8d75b15dfa28757b9321/updatecheck.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3400,
15636,
1444,
12,
1726,
4672,
3536,
30778,
309,
326,
864,
2181,
353,
1818,
5876,
18,
2181,
350,
353,
279,
296,
832,
18,
438,
1802,
18,
10657,
18,
2081,
4446,
10348,
11,
2154,
612,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3400,
15636,
1444,
12,
1726,
4672,
3536,
30778,
309,
326,
864,
2181,
353,
1818,
5876,
18,
2181,
350,
353,
279,
296,
832,
18,
438,
1802,
18,
10657,
18,
2081,
4446,
10348,
11,
2154,
612,
... |
self.pool.installed = self.pool.create_repo( "system" ) | system = self.pool.create_repo( '@system' ) self.pool.set_installed(system) solv3 = system.create_solvable( 'two', '1.0-0', 'noarch' ) solv4 = system.create_solvable( 'three', '1.0-0', 'noarch' ) rel = satsolver.Relation( self.pool, 'two', satsolver.REL_EQ, '1.0-0' ) solv4.requires().add(rel) | def test_creation(self): repo = self.pool.create_repo( 'test' ) assert repo solv1 = repo.create_solvable( 'one', '1.0-0' ) assert solv1 assert repo.size() == 1 assert solv1.name() == 'one' assert solv1.evr() == "1.0-0" assert solv1.vendor() == None solv2 = satsolver.Solvable( repo, 'two', '2.0-0', 'noarch' ) assert solv2 assert repo.size() == 2 assert solv2.name() == 'two' assert solv2.evr() == "2.0-0" solv2.set_vendor("Ruby") assert solv2.vendor() == "Ruby" rel = satsolver.Relation( self.pool, "two", satsolver.REL_GE, "2.0-0" ) assert rel solv1.requires().add(rel) assert solv1.requires().size() == 1 transaction = self.pool.create_transaction() transaction.install( solv1 ) | 77ca9c5ca2751a76c3dfe9641d6d9ca00e3d27a5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14459/77ca9c5ca2751a76c3dfe9641d6d9ca00e3d27a5/solvable.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
17169,
12,
2890,
4672,
3538,
273,
365,
18,
6011,
18,
2640,
67,
7422,
12,
296,
3813,
11,
262,
1815,
3538,
3704,
90,
21,
273,
3538,
18,
2640,
67,
18281,
16845,
12,
296,
476,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
17169,
12,
2890,
4672,
3538,
273,
365,
18,
6011,
18,
2640,
67,
7422,
12,
296,
3813,
11,
262,
1815,
3538,
3704,
90,
21,
273,
3538,
18,
2640,
67,
18281,
16845,
12,
296,
476,
... |
msg = "The following jigs write output to the tracefile: Measure Distance jigs, Rotary Motors, Linear Motors, Anchors, Thermostats and Thermometers." | msg = "The following jigs write output to the tracefile: Measurement jigs, Rotary Motors, Linear Motors, Anchors, Thermostats and Thermometers." | def setup(self): """Setup the Plot Tool dialog, including populating the combobox with plotting options. """ # To setup the Plot Tool, we need to do the following: # 1. Make sure there is a valid DPB file. This is temporary since the Plot Tool will # soon allow the user to open and plot any trace file. # 2. From the DPB filename, construct the trace filename and GNUplot filename. # 3. Read the header from the trace file to obtain: # - Date and time # - Trajectory (DPB) filename. This is redundant now, but will be necessary when # Plot Tool allows the user to open and plot any trace file. # - The number of columns of data in the trace file so we can... # 4. Populate the plot combobox with the graph names # Make sure there is a DPB file for the assy. if not self.movie or not self.movie.filename: msg = redmsg("No tracefile exists for this part. To create one, run a simulation.") env.history.message(cmd + msg) return 1 # Construct the trace file name. self.traceFile = self.movie.get_trace_filename() | 2381cd6a37fe2a4aeaaf67daa7a04d6ccfe5ffb0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/2381cd6a37fe2a4aeaaf67daa7a04d6ccfe5ffb0/PlotTool.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
12,
2890,
4672,
3536,
7365,
326,
15211,
13288,
6176,
16,
6508,
3650,
1776,
326,
3894,
27570,
598,
20947,
702,
18,
3536,
468,
2974,
3875,
326,
15211,
13288,
16,
732,
1608,
358,
741,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
12,
2890,
4672,
3536,
7365,
326,
15211,
13288,
6176,
16,
6508,
3650,
1776,
326,
3894,
27570,
598,
20947,
702,
18,
3536,
468,
2974,
3875,
326,
15211,
13288,
16,
732,
1608,
358,
741,
... |
bits = next(31) | bits = self.next(31) | def nextInt(self, n = None): """ Return a random int in [0, `n`). | 87b6542119e8b64f12041b25ec3c779382ab9886 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14153/87b6542119e8b64f12041b25ec3c779382ab9886/javarandom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17617,
12,
2890,
16,
290,
273,
599,
4672,
3536,
2000,
279,
2744,
509,
316,
306,
20,
16,
1375,
82,
68,
2934,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17617,
12,
2890,
16,
290,
273,
599,
4672,
3536,
2000,
279,
2744,
509,
316,
306,
20,
16,
1375,
82,
68,
2934,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
self.__cmdb__loadComponentFromActivityDB( sourceId ) | if not self.__cmdb__loadComponentFromActivityDB( sourceId ): return False | def __cmdb_heartbeatComponent( self, sourceId, componentExtraInfo ): #Component heartbeat if sourceId not in ServiceInterface.__sourceToComponentIdMapping: self.__cmdb__loadComponentFromActivityDB( sourceId ) if ServiceInterface.__sourceToComponentIdMapping[ sourceId ][ 'type' ] not in ( 'service', 'agent' ): return self.__cmdb__merge( sourceId, componentExtraInfo ) self.__cmdb__writeHeartbeat( sourceId ) | e441ea717d4e5cd36fabe4af9bcb75ffb1de605e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/e441ea717d4e5cd36fabe4af9bcb75ffb1de605e/ServiceInterface.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
4172,
70,
67,
25445,
1841,
12,
365,
16,
27572,
16,
1794,
7800,
966,
262,
30,
468,
1841,
12923,
309,
27572,
486,
316,
1956,
1358,
16186,
3168,
774,
1841,
548,
3233,
30,
309,
486,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4172,
70,
67,
25445,
1841,
12,
365,
16,
27572,
16,
1794,
7800,
966,
262,
30,
468,
1841,
12923,
309,
27572,
486,
316,
1956,
1358,
16186,
3168,
774,
1841,
548,
3233,
30,
309,
486,
... |
pfx = 'ticket.custom.%i' % i | pfx = 'ticket.custom.%d' % i | def insert_custom_fields(env, hdf, vals = {}): fields = get_custom_fields(env) i = 0 for f in fields: name = f['name'] val = vals.get('custom_' + name, f['value']) pfx = 'ticket.custom.%i' % i hdf['%s.name' % pfx] = f['name'] hdf['%s.type' % pfx] = f['type'] hdf['%s.label' % pfx] = f['label'] or f['name'] hdf['%s.value' % pfx] = val if f['type'] == 'select' or f['type'] == 'radio': j = 0 for option in f['options']: hdf['%s.option.%d' % (pfx, j)] = option if val and (option == val or str(j) == val): hdf['%s.option.%i.selected' % (pfx, j)] = 1 j += 1 elif f['type'] == 'checkbox': if val in util.TRUE: hdf['%s.selected' % pfx] = 1 elif f['type'] == 'textarea': hdf['%s.width' % pfx] = f['width'] hdf['%s.height' % pfx] = f['height'] i += 1 | 328e1e367f7d64846a50abc99077f2f27875a4e1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/328e1e367f7d64846a50abc99077f2f27875a4e1/Ticket.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2243,
67,
3662,
67,
2821,
12,
3074,
16,
24217,
16,
5773,
273,
2618,
4672,
1466,
273,
336,
67,
3662,
67,
2821,
12,
3074,
13,
277,
273,
374,
364,
284,
316,
1466,
30,
508,
273,
284,
329... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2243,
67,
3662,
67,
2821,
12,
3074,
16,
24217,
16,
5773,
273,
2618,
4672,
1466,
273,
336,
67,
3662,
67,
2821,
12,
3074,
13,
277,
273,
374,
364,
284,
316,
1466,
30,
508,
273,
284,
329... |
print os.path.join(bugreporter_base,tag,str(int(id/1000)),str(id)) | def reportnewbugs(self,irc): # Compile list of bugs print "Reporting new bugs" tracker = self.db['malone'] bugs = {} sc = imaplib.IMAP4_SSL(imap_server) sc.login(imap_user, imap_password) sc.select('INBOX') new_mail = sc.search(None, '(UNSEEN)')[1][0].split()[:20] for m in new_mail: print "Loading %s" % m msg = sc.fetch(m, 'RFC822')[1][0][1] #print msg fp = email.FeedParser.FeedParser() fp.feed(msg) bug = fp.close() #print "Mail parsed" # Determine bug number, component and tag try: id = int(bug['Reply-To'].split()[1]) except: continue tag = bug['Delivered-To'] tag = tag[tag.find('+')+1:tag.find('@')] component = bug['X-Launchpad-Bug'] if 'component' in component: component = component[component.find('component=')+10:] component = component[:component.find(';')].replace('None','') else: component = '' if tag not in bugs: bugs[tag] = {} #print "Data extracted" if id not in bugs[tag]: try: os.makedirs(os.path.join(bugreporter_base,tag,str(int(id/1000)))) except: pass print os.path.join(bugreporter_base,tag,str(int(id/1000)),str(id)) if id > 58184 and not os.path.exists(os.path.join(bugreporter_base,tag,str(int(id/1000)),str(id))): print "New bug: %d" % id fd2 = open(os.path.join(bugreporter_base,tag,str(int(id/1000)),str(id)),'w') fd2.close() try: if component: bugs[tag][id] = self.get_bug(tracker, id, False)[0].replace('"','(%s) "' % component, 1) else: bugs[tag][id] = self.get_bug(tracker, id, False)[0] except: print "Cannot get bug %d" % id for c in irc.state.channels: tag = self.registryValue('bugReporter', channel=c) if not tag: continue if tag not in bugs.keys(): print "No new bugs in %s" % tag continue print "New bugs in %s (%s): %s" % (c, tag, str(bugs[tag].keys())) for b in sorted(bugs[tag].keys()): irc.queueMsg(ircmsgs.privmsg(c,'New bug: #%s' % bugs[tag][b][bugs[tag][b].find('bug ')+4:])) | a1873865d09620ddbd225087a2af830e9d31df4a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3104/a1873865d09620ddbd225087a2af830e9d31df4a/plugin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2605,
2704,
19381,
12,
2890,
16,
481,
71,
4672,
468,
16143,
666,
434,
22398,
1172,
315,
29285,
394,
22398,
6,
9745,
273,
365,
18,
1966,
3292,
81,
12451,
3546,
22398,
273,
2618,
888,
273,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2605,
2704,
19381,
12,
2890,
16,
481,
71,
4672,
468,
16143,
666,
434,
22398,
1172,
315,
29285,
394,
22398,
6,
9745,
273,
365,
18,
1966,
3292,
81,
12451,
3546,
22398,
273,
2618,
888,
273,... | |
if sys.platform in ['aix3', 'aix4']: | if platform in ['aix3', 'aix4']: | def detect_tkinter(self, inc_dirs, lib_dirs): # The _tkinter module. # # The command for _tkinter is long and site specific. Please # uncomment and/or edit those parts as indicated. If you don't have a # specific extension (e.g. Tix or BLT), leave the corresponding line # commented out. (Leave the trailing backslashes in! If you # experience strange errors, you may want to join all uncommented # lines and remove the backslashes -- the backslash interpretation is # done by the shell's "read" command and it may not be implemented on # every system. | 1fc6b0d7db91d541a72639988978bef873a18f5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1fc6b0d7db91d541a72639988978bef873a18f5f/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5966,
67,
16099,
2761,
12,
2890,
16,
7290,
67,
8291,
16,
2561,
67,
8291,
4672,
468,
1021,
389,
16099,
2761,
1605,
18,
468,
468,
1021,
1296,
364,
389,
16099,
2761,
353,
1525,
471,
2834,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5966,
67,
16099,
2761,
12,
2890,
16,
7290,
67,
8291,
16,
2561,
67,
8291,
4672,
468,
1021,
389,
16099,
2761,
1605,
18,
468,
468,
1021,
1296,
364,
389,
16099,
2761,
353,
1525,
471,
2834,
... |
class EscapeFromTheMeaninglessConfinesOfCapital: def own(self, owner): warnings.warn("Foolish capitalist! Your opulent toilet will be your undoing!!", DeprecationWarning, stacklevel=2) def disown(self, owner): warnings.warn("The proletariat is victorious.", DeprecationWarning, stacklevel=2) logOwner = EscapeFromTheMeaninglessConfinesOfCapital() | def logPrefix(self): """ Override this method to insert custom logging behavior. Its return value will be inserted in front of every line. It may be called more times than the number of output lines. """ return '-' | 1b7562e6c25153400d8fc8466bf93de84b049a75 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1b7562e6c25153400d8fc8466bf93de84b049a75/log.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
613,
2244,
12,
2890,
4672,
3536,
1439,
333,
707,
358,
2243,
1679,
2907,
6885,
18,
225,
29517,
327,
460,
903,
506,
9564,
316,
6641,
434,
3614,
980,
18,
225,
2597,
2026,
506,
2566,
1898,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
613,
2244,
12,
2890,
4672,
3536,
1439,
333,
707,
358,
2243,
1679,
2907,
6885,
18,
225,
29517,
327,
460,
903,
506,
9564,
316,
6641,
434,
3614,
980,
18,
225,
2597,
2026,
506,
2566,
1898,
... | |
else: def popen2(cmd, mode='t', bufsize=-1): """Execute the shell command 'cmd' in a sub-process. If 'bufsize' is specified, it sets the buffer size for the I/O pipes. The file objects (child_stdout, child_stdin) are returned.""" if type(mode) is type(0) and bufsize == -1: bufsize = mode mode = 't' assert mode in ('t', 'b') _cleanup() inst = Popen3(cmd, 0, bufsize) return inst.fromchild, inst.tochild | def popen2(cmd, mode='t', bufsize=-1): """Execute the shell command 'cmd' in a sub-process. If 'bufsize' is specified, it sets the buffer size for the I/O pipes. The file objects (child_stdout, child_stdin) are returned.""" w, r = os.popen2(cmd, mode, bufsize) return r, w | d75e63a865b451c24e1a0516744a98d59691b4ff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d75e63a865b451c24e1a0516744a98d59691b4ff/popen2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30925,
22,
12,
4172,
16,
1965,
2218,
88,
2187,
1681,
1467,
29711,
21,
4672,
3536,
5289,
326,
5972,
1296,
296,
4172,
11,
316,
279,
720,
17,
2567,
18,
225,
971,
296,
4385,
1467,
11,
353,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30925,
22,
12,
4172,
16,
1965,
2218,
88,
2187,
1681,
1467,
29711,
21,
4672,
3536,
5289,
326,
5972,
1296,
296,
4172,
11,
316,
279,
720,
17,
2567,
18,
225,
971,
296,
4385,
1467,
11,
353,... | |
sage: E6=WeylCharacterRing("E6",style="coroots") sage: D5=WeylCharacterRing("D5",style="coroots") sage: fw = E6.fundamental_weights() sage: [E6(fw[i]).branch(D5,rule="levi") for i in [1,2,6]] | sage: E6=WeylCharacterRing("E6",style="coroots") sage: D5=WeylCharacterRing("D5",style="coroots") sage: fw = E6.fundamental_weights() sage: [E6(fw[i]).branch(D5,rule="levi") for i in [1,2,6]] | def branch_weyl_character(chi, R, S, rule="default"): r""" A Branching rule describes the restriction of representations from a Lie group or algebra G to a smaller one. See for example, R. C. King, Branching rules for classical Lie groups using tensor and spinor methods. J. Phys. A 8 (1975), 429-449, Howe, Tan and Willenbring, Stable branching rules for classical symmetric pairs, Trans. Amer. Math. Soc. 357 (2005), no. 4, 1601-1626, McKay and Patera, Tables of Dimensions, Indices and Branching Rules for Representations of Simple Lie Algebras (Marcel Dekker, 1981), and Fauser, Jarvis, King and Wybourne, New branching rules induced by plethysm. J. Phys. A 39 (2006), no. 11, 2611--2655. INPUT: - ``chi`` - a character of G - ``R`` - the Weyl Character Ring of G - ``S`` - the Weyl Character Ring of H - ``rule`` - a set of r dominant weights in H where r is the rank of G. You may use a predefined rule by specifying rule = one of"levi", "automorphic", "symmetric", "extended", "triality" or "miscellaneous". The use of these rules will be explained next. After the examples we will explain how to write your own branching rules for cases that we have omitted. To explain the predefined rules we survey the most important branching rules. These may be classified into several cases, and once this is understood, the detailed classification can be read off from the Dynkin diagrams. Dynkin classified the maximal subgroups of Lie groups in Mat. Sbornik N.S. 30(72):349-462 (1952). We will list give predefined rules that cover most cases where the branching rule is to a maximal subgroup. For convenience, we also give some branching rules to subgroups that are not maximal. For example, a Levi subgroup may or may not be maximal. LEVI TYPE. These can be read off from the Dynkin diagram. If removing a node from the Dynkin diagram produces another Dynkin diagram, there is a branching rule. Currently we require that the smaller diagram be connected. For these rules use the option rule="levi":: ['A',r] => ['A',r-1] ['B',r] => ['A',r-1] ['B',r] => ['B',r-1] ['C',r] => ['A',r-1] ['C',r] => ['C',r-1] ['D',r] => ['A',r-1] ['D',r] => ['D',r-1] ['E',r] => ['A',r-1] r = 7,8 ['E',r] => ['D',r-1] r = 6,7,8 ['E',r] => ['E',r-1] F4 => B3 F4 => C3 G2 => A1 (short root) Not all Levi subgroups are maximal subgroups. If the Levi is not maximal there may or may not be a preprogrammed rule="levi" for it. If there is not, the branching rule may still be obtained by going through an intermediate subgroup that is maximal using rule="extended". Thus the other Levi branching rule from G2 => A1 corresponding to the long root is available by first branching G2 => A_2 then A2 => A1. Similarly the branching rules to the Levi subgroup:: ['E',r] => ['A',r-1] r = 6,7,8 may be obtained by first branching E6=>A5xA1, E7=>A7 or E8=>A8. AUTOMORPHIC TYPE. If the Dynkin diagram has a symmetry, then there is an automorphism that is a special case of a branching rule. There is also an exotic "triality" automorphism of D4 having order 3. Use rule="automorphic" or (for D4) rule="triality":: ['A',r] => ['A',r] ['D',r] => ['D',r] E6 => E6 SYMMETRIC TYPE. Related to the automorphic type, when either the Dynkin diagram or the extended diagram has a symmetry there is a branching rule to the subalgebra (or subgroup) of invariants under the automorphism. Use rule="symmetric". The last branching rule, D4=>G2 is not to a maximal subgroup since D4=>B3=>G2, but it is included for convenience. :: ['A',2r+1] => ['B',r] ['A',2r] => ['C',r] ['A',2r] => ['D',r] ['D',r] => ['B',r-1] E6 => F4 D4 => G2 EXTENDED TYPE. If removing a node from the extended Dynkin diagram results in a Dynkin diagram, then there is a branching rule. Use rule="extended" for these. We will also use this classification for some rules that are not of this type, mainly involving type B, such as D6 => B3xB3. Here is the extended Dynkin diagram for D6:: 0 6 O O | | | | O---O---O---O---O 1 2 3 4 6 Removing the node 3 results in an embedding D3xD3 -> D6. This corresponds to the embedding SO(6)xSO(6) -> SO(12), and is of extended type. On the other hand the embedding SO(5)xSO(7)-->SO(12) (e.g. B2xB3 -> D6) cannot be explained this way but for uniformity is implemented under rule="extended". Using rule="extended" you can get any branching rule SO(n) => SO(a) x SO(b) x SO(c) x ... where n = a+b+c+ ... Sp(2n) => Sp(2a) x Sp(2b) x Sp(2c) x ... where n = a+b+c+ ... where O(a) = ['D',r] (a=2r) or ['B',r] (a=2r+1) and Sp(2r)=['C',r]. The following rules are implemented as special cases of rule="extended". :: E6 => A5xA1, A2xA2xA2 E7 => A7, D6xA1, A3xA3xA1 E8 => A8, D8, E7xA1, A4xA4, D5xA3, E6xA2 F4 => B4, C3xA1, A2xA2, A3xA1 G2 => A1xA1 Note that E8 has only a limited number of representations of reasonably low degree. TENSOR: There are branching rules: :: ['A', rs-1] => ['A',r-1] x ['A',s-1] ['B',2rs+r+s] => ['B',r] x ['B',s] ['D',2rs+s] => ['B',r] x ['D',s] ['D',2rs] => ['D',r] x ['D',s] ['D',2rs] => ['C',r] x ['C',s] ['C',2rs+s] => ['B',r] x ['C',s] ['C',2rs] => ['C',r] x ['D',s]. corresponding to the tensor product homomorphism. For type A, the homomorphism is GL(r) x GL(s) -> GL(rs). For the classical types, the relevant fact is that if V,W are orthogonal or symplectic spaces, that is, spaces endowed with symmetric or skew-symmetric bilinear forms, then V tensor W is also an orthogonal space (if V and W are both orthogonal or both symplectic) or symplectic (if one of V and W is orthogonal and the other symplectic). The corresponding branching rules are obtained using rule="tensor". SYMMETRIC POWER: The k-th symmetric and exterior power homomorphisms map GL(n) --> GL(binomial(n+k-1,k)) and GL(binomial(n,k)). The corresponding branching rules are not implemented but a special case is. The k-th symmetric power homomorphism SL(2) --> GL(k+1) has its image inside of SO(2r+1) if k=2r and inside of Sp(2r) if k=2r-1. Hence there are branching rules:: ['B',r] => A1 ['C',r] => A1 and these may be obtained using the rule "symmetric_power". MISCELLANEOUS: Use rule="miscellaneous" for the following rules:: B3 => G2 F4 => G2xA1 (not implemented yet) BRANCHING RULES FROM PLETHYSMS Nearly all branching rules G => H where G is of type A,B,C or D are covered by the preceding rules. The function branching_rules_from_plethysm covers the remaining cases. ISOMORPHIC TYPE: Although not usually referred to as a branching rule, the effects of the accidental isomorphisms may be handled using rule="isomorphic":: B2 => C2 C2 => B2 A3 => D3 D3 => A3 D2 => A1xA1 B1 => A1 C1 => A1 EXAMPLES: (Levi type) :: sage: A1 = WeylCharacterRing("A1") sage: A2 = WeylCharacterRing("A2") sage: A3 = WeylCharacterRing("A3") sage: A4 = WeylCharacterRing("A4") sage: A5 = WeylCharacterRing("A5") sage: B2 = WeylCharacterRing("B2") sage: B3 = WeylCharacterRing("B3") sage: B4 = WeylCharacterRing("B4") sage: C2 = WeylCharacterRing("C2") sage: C3 = WeylCharacterRing("C3") sage: D3 = WeylCharacterRing("D3") sage: D4 = WeylCharacterRing("D4") sage: D5 = WeylCharacterRing("D5") sage: G2 = WeylCharacterRing("G2") sage: F4 = WeylCharacterRing("F4",style="coroots") # long time sage: E6=WeylCharacterRing("E6",style="coroots") sage: D5=WeylCharacterRing("D5",style="coroots") sage: [B3(w).branch(A2,rule="levi") for w in B3.fundamental_weights()] [A2(0,0,-1) + A2(0,0,0) + A2(1,0,0), A2(0,-1,-1) + A2(0,0,-1) + A2(0,0,0) + A2(1,0,-1) + A2(1,0,0) + A2(1,1,0), A2(-1/2,-1/2,-1/2) + A2(1/2,-1/2,-1/2) + A2(1/2,1/2,-1/2) + A2(1/2,1/2,1/2)] The last example must be understood as follows. The representation of B3 being branched is spin, which is not a representation of SO(7) but of its double cover spin(7). The group A2 is really GL(3) and the double cover of SO(7) induces a cover of GL(3) that is trivial over SL(3) but not over the center of GL(3). The weight lattice for this GL(3) consists of triples (a,b,c) of half integers such that a-b and b-c are in `\ZZ`, and this is reflected in the last decomposition. :: sage: [C3(w).branch(A2,rule="levi") for w in C3.fundamental_weights()] [A2(0,0,-1) + A2(1,0,0), A2(0,-1,-1) + A2(1,0,-1) + A2(1,1,0), A2(-1,-1,-1) + A2(1,-1,-1) + A2(1,1,-1) + A2(1,1,1)] sage: [D4(w).branch(A3,rule="levi") for w in D4.fundamental_weights()] [A3(0,0,0,-1) + A3(1,0,0,0), A3(0,0,-1,-1) + A3(0,0,0,0) + A3(1,0,0,-1) + A3(1,1,0,0), A3(1/2,-1/2,-1/2,-1/2) + A3(1/2,1/2,1/2,-1/2), A3(-1/2,-1/2,-1/2,-1/2) + A3(1/2,1/2,-1/2,-1/2) + A3(1/2,1/2,1/2,1/2)] sage: [B3(w).branch(B2,rule="levi") for w in B3.fundamental_weights()] [2*B2(0,0) + B2(1,0), B2(0,0) + 2*B2(1,0) + B2(1,1), 2*B2(1/2,1/2)] sage: C3 = WeylCharacterRing(['C',3]) sage: [C3(w).branch(C2,rule="levi") for w in C3.fundamental_weights()] [2*C2(0,0) + C2(1,0), C2(0,0) + 2*C2(1,0) + C2(1,1), C2(1,0) + 2*C2(1,1)] sage: [D5(w).branch(D4,rule="levi") for w in D5.fundamental_weights()] [2*D4(0,0,0,0) + D4(1,0,0,0), D4(0,0,0,0) + 2*D4(1,0,0,0) + D4(1,1,0,0), D4(1,0,0,0) + 2*D4(1,1,0,0) + D4(1,1,1,0), D4(1/2,1/2,1/2,-1/2) + D4(1/2,1/2,1/2,1/2), D4(1/2,1/2,1/2,-1/2) + D4(1/2,1/2,1/2,1/2)] sage: G2(1,0,-1).branch(A1,rule="levi") A1(0,-1) + A1(1,-1) + A1(1,0) sage: E6=WeylCharacterRing("E6",style="coroots") # long time sage: D5=WeylCharacterRing("D5",style="coroots") # long time sage: fw = E6.fundamental_weights() # long time sage: [E6(fw[i]).branch(D5,rule="levi") for i in [1,2,6]] # long time [D5(0,0,0,0,0) + D5(0,0,0,0,1) + D5(1,0,0,0,0), D5(0,0,0,0,0) + D5(0,0,0,1,0) + D5(0,0,0,0,1) + D5(0,1,0,0,0), D5(0,0,0,0,0) + D5(0,0,0,1,0) + D5(1,0,0,0,0)] sage: E7=WeylCharacterRing("E7",style="coroots") # long time sage: D6=WeylCharacterRing("D6",style="coroots") # long time sage: fw = E7.fundamental_weights() # long time sage: [E7(fw[i]).branch(D6,rule="levi") for i in [1,2,7]] # long time [3*D6(0,0,0,0,0,0) + 2*D6(0,0,0,0,1,0) + D6(0,1,0,0,0,0), 3*D6(0,0,0,0,0,1) + 2*D6(1,0,0,0,0,0) + 2*D6(0,0,1,0,0,0) + D6(1,0,0,0,1,0), D6(0,0,0,0,0,1) + 2*D6(1,0,0,0,0,0)] sage: D7=WeylCharacterRing("D7",style="coroots",cache=True) # long time sage: E8=WeylCharacterRing("E8",style="coroots",cache=True) # long time sage: D7=WeylCharacterRing("D7",style="coroots",cache=True) # long time sage: E8(1,0,0,0,0,0,0,0).branch(D7,rule="levi") # long time 3*D7(0,0,0,0,0,0,0) + 2*D7(0,0,0,0,0,1,0) + 2*D7(0,0,0,0,0,0,1) + 2*D7(1,0,0,0,0,0,0) + D7(0,1,0,0,0,0,0) + 2*D7(0,0,1,0,0,0,0) + D7(0,0,0,1,0,0,0) + D7(1,0,0,0,0,1,0) + D7(1,0,0,0,0,0,1) + D7(2,0,0,0,0,0,0) sage: E8(0,0,0,0,0,0,0,1).branch(D7,rule="levi") # long time D7(0,0,0,0,0,0,0) + D7(0,0,0,0,0,1,0) + D7(0,0,0,0,0,0,1) + 2*D7(1,0,0,0,0,0,0) + D7(0,1,0,0,0,0,0) sage: [F4(fw).branch(B3,rule="levi") for fw in F4.fundamental_weights()] # long time [B3(0,0,0) + 2*B3(1/2,1/2,1/2) + 2*B3(1,0,0) + B3(1,1,0), B3(0,0,0) + 6*B3(1/2,1/2,1/2) + 5*B3(1,0,0) + 7*B3(1,1,0) + 3*B3(1,1,1) + 6*B3(3/2,1/2,1/2) + 2*B3(3/2,3/2,1/2) + B3(2,0,0) + 2*B3(2,1,0) + B3(2,1,1), 3*B3(0,0,0) + 6*B3(1/2,1/2,1/2) + 4*B3(1,0,0) + 3*B3(1,1,0) + B3(1,1,1) + 2*B3(3/2,1/2,1/2), 3*B3(0,0,0) + 2*B3(1/2,1/2,1/2) + B3(1,0,0)] sage: [F4(fw).branch(C3,rule="levi") for fw in F4.fundamental_weights()] # long time [3*C3(0,0,0) + 2*C3(1,1,1) + C3(2,0,0), 3*C3(0,0,0) + 6*C3(1,1,1) + 4*C3(2,0,0) + 2*C3(2,1,0) + 3*C3(2,2,0) + C3(2,2,2) + C3(3,1,0) + 2*C3(3,1,1), 2*C3(1,0,0) + 3*C3(1,1,0) + C3(2,0,0) + 2*C3(2,1,0) + C3(2,1,1), 2*C3(1,0,0) + C3(1,1,0)] sage: A1xA1 = WeylCharacterRing("A1xA1") sage: [A3(hwv).branch(A1xA1,rule="levi") for hwv in A3.fundamental_weights()] [A1xA1(0,0,1,0) + A1xA1(1,0,0,0), A1xA1(0,0,1,1) + A1xA1(1,0,1,0) + A1xA1(1,1,0,0), A1xA1(1,0,1,1) + A1xA1(1,1,1,0)] sage: A1xB1=WeylCharacterRing("A1xB1",style="coroots") sage: [B3(x).branch(A1xB1,rule="levi") for x in B3.fundamental_weights()] [A1xB1(0,2) + 2*A1xB1(1,0), 3*A1xB1(0,0) + A1xB1(0,2) + 2*A1xB1(1,2) + A1xB1(2,0), 2*A1xB1(0,1) + A1xB1(1,1)] EXAMPLES: (Automorphic type, including D4 triality) :: sage: [A3(chi).branch(A3,rule="automorphic") for chi in A3.fundamental_weights()] [A3(0,0,0,-1), A3(0,0,-1,-1), A3(0,-1,-1,-1)] sage: [D4(chi).branch(D4,rule="automorphic") for chi in D4.fundamental_weights()] [D4(1,0,0,0), D4(1,1,0,0), D4(1/2,1/2,1/2,1/2), D4(1/2,1/2,1/2,-1/2)] sage: [D4(chi).branch(D4,rule="triality") for chi in D4.fundamental_weights()] [D4(1/2,1/2,1/2,-1/2), D4(1,1,0,0), D4(1/2,1/2,1/2,1/2), D4(1,0,0,0)] EXAMPLES: (Symmetric type) :: sage: [w.branch(B2,rule="symmetric") for w in [A4(1,0,0,0,0),A4(1,1,0,0,0),A4(1,1,1,0,0),A4(2,0,0,0,0)]] [B2(1,0), B2(1,1), B2(1,1), B2(0,0) + B2(2,0)] sage: [A5(w).branch(C3,rule="symmetric") for w in A5.fundamental_weights()] [C3(1,0,0), C3(0,0,0) + C3(1,1,0), C3(1,0,0) + C3(1,1,1), C3(0,0,0) + C3(1,1,0), C3(1,0,0)] sage: [A5(w).branch(D3,rule="symmetric") for w in A5.fundamental_weights()] [D3(1,0,0), D3(1,1,0), D3(1,1,-1) + D3(1,1,1), D3(1,1,0), D3(1,0,0)] sage: [D4(x).branch(B3,rule="symmetric") for x in D4.fundamental_weights()] [B3(0,0,0) + B3(1,0,0), B3(1,0,0) + B3(1,1,0), B3(1/2,1/2,1/2), B3(1/2,1/2,1/2)] sage: [D4(x).branch(G2,rule="symmetric") for x in D4.fundamental_weights()] [G2(0,0,0) + G2(1,0,-1), 2*G2(1,0,-1) + G2(2,-1,-1), G2(0,0,0) + G2(1,0,-1), G2(0,0,0) + G2(1,0,-1)] sage: [E6(fw).branch(F4,rule="symmetric") for fw in E6.fundamental_weights()] # long time [F4(0,0,0,0) + F4(0,0,0,1), F4(0,0,0,1) + F4(1,0,0,0), F4(0,0,0,1) + F4(1,0,0,0) + F4(0,0,1,0), F4(1,0,0,0) + 2*F4(0,0,1,0) + F4(1,0,0,1) + F4(0,1,0,0), F4(0,0,0,1) + F4(1,0,0,0) + F4(0,0,1,0), F4(0,0,0,0) + F4(0,0,0,1)] EXAMPLES: (Extended type) :: sage: [B3(x).branch(D3,rule="extended") for x in B3.fundamental_weights()] [D3(0,0,0) + D3(1,0,0), D3(1,0,0) + D3(1,1,0), D3(1/2,1/2,-1/2) + D3(1/2,1/2,1/2)] sage: [G2(w).branch(A2, rule="extended") for w in G2.fundamental_weights()] [A2(0,0,0) + A2(1/3,1/3,-2/3) + A2(2/3,-1/3,-1/3), A2(1/3,1/3,-2/3) + A2(2/3,-1/3,-1/3) + A2(1,0,-1)] sage: [F4(fw).branch(B4,rule="extended") for fw in F4.fundamental_weights()] # long time [B4(1/2,1/2,1/2,1/2) + B4(1,1,0,0), B4(1,1,0,0) + B4(1,1,1,0) + B4(3/2,1/2,1/2,1/2) + B4(3/2,3/2,1/2,1/2) + B4(2,1,1,0), B4(1/2,1/2,1/2,1/2) + B4(1,0,0,0) + B4(1,1,0,0) + B4(1,1,1,0) + B4(3/2,1/2,1/2,1/2), B4(0,0,0,0) + B4(1/2,1/2,1/2,1/2) + B4(1,0,0,0)] sage: E6 = WeylCharacterRing("E6", style="coroots") # long time sage: A2xA2xA2=WeylCharacterRing("A2xA2xA2",style="coroots") sage: A5xA1=WeylCharacterRing("A5xA1",style="coroots") sage: G2 = WeylCharacterRing("G2", style="coroots") sage: A1xA1 = WeylCharacterRing("A1xA1", style="coroots") sage: F4 = WeylCharacterRing("F4",style="coroots") sage: A3xA1 = WeylCharacterRing("A3xA1", style="coroots") sage: A2xA2 = WeylCharacterRing("A2xA2", style="coroots") sage: A1xC3 = WeylCharacterRing("A1xC3",style="coroots") sage: E6(1,0,0,0,0,0).branch(A5xA1,rule="extended") # long time A5xA1(0,0,0,1,0,0) + A5xA1(1,0,0,0,0,1) sage: E6(1,0,0,0,0,0).branch(A2xA2xA2, rule="extended") # long time A2xA2xA2(0,0,0,1,1,0) + A2xA2xA2(0,1,1,0,0,0) + A2xA2xA2(1,0,0,0,0,1) sage: E7=WeylCharacterRing("E7",style="coroots") # long time sage: A7=WeylCharacterRing("A7",style="coroots") # long time sage: E7(1,0,0,0,0,0,0).branch(A7,rule="extended") # long time A7(0,0,0,1,0,0,0) + A7(1,0,0,0,0,0,1) sage: E8=WeylCharacterRing("E8",cache=true,style="coroots") # long time sage: D8=WeylCharacterRing("D8",cache=true,style="coroots") # long time sage: E8(0,0,0,0,0,0,0,1).branch(D8,rule="extended") # long time D8(0,0,0,0,0,0,1,0) + D8(0,1,0,0,0,0,0,0) sage: F4(1,0,0,0).branch(A1xC3,rule="extended") # long time A1xC3(0,2,0,0) + A1xC3(1,0,0,1) + A1xC3(2,0,0,0) sage: G2(0,1).branch(A1xA1, rule="extended") A1xA1(0,2) + A1xA1(2,0) + A1xA1(3,1) sage: F4(0,0,0,1).branch(A2xA2, rule="extended") # long time A2xA2(0,0,1,1) + A2xA2(0,1,0,1) + A2xA2(1,0,1,0) sage: F4(0,0,0,1).branch(A3xA1,rule="extended") # long time A3xA1(0,0,0,0) + A3xA1(0,0,0,2) + A3xA1(0,0,1,1) + A3xA1(0,1,0,0) + A3xA1(1,0,0,1) sage: D4=WeylCharacterRing("D4",style="coroots") sage: D2xD2=WeylCharacterRing("D2xD2",style="coroots") # We get D4 => A1xA1xA1xA1 by remembering that A1xA1 = D2. sage: [D4(fw).branch(D2xD2, rule="extended") for fw in D4.fundamental_weights()] [D2xD2(0,0,1,1) + D2xD2(1,1,0,0), D2xD2(0,0,2,0) + D2xD2(0,0,0,2) + D2xD2(2,0,0,0) + D2xD2(1,1,1,1) + D2xD2(0,2,0,0), D2xD2(1,0,0,1) + D2xD2(0,1,1,0), D2xD2(1,0,1,0) + D2xD2(0,1,0,1)] EXAMPLES: (Tensor type) :: sage: A5=WeylCharacterRing("A5", style="coroots") sage: A2xA1=WeylCharacterRing("A2xA1", style="coroots") sage: [A5(hwv).branch(A2xA1, rule="tensor") for hwv in A5.fundamental_weights()] [A2xA1(1,0,1), A2xA1(0,1,2) + A2xA1(2,0,0), A2xA1(0,0,3) + A2xA1(1,1,1), A2xA1(1,0,2) + A2xA1(0,2,0), A2xA1(0,1,1)] sage: B4=WeylCharacterRing("B4",style="coroots") sage: B1xB1=WeylCharacterRing("B1xB1",style="coroots") sage: [B4(f).branch(B1xB1,rule="tensor") for f in B4.fundamental_weights()] [B1xB1(2,2), B1xB1(0,2) + B1xB1(2,0) + B1xB1(2,4) + B1xB1(4,2), B1xB1(0,2) + B1xB1(0,6) + B1xB1(2,0) + B1xB1(2,2) + B1xB1(2,4) + B1xB1(4,2) + B1xB1(4,4) + B1xB1(6,0), B1xB1(1,3) + B1xB1(3,1)] sage: D4=WeylCharacterRing("D4",style="coroots") sage: C2xC1=WeylCharacterRing("C2xC1",style="coroots") sage: [D4(f).branch(C2xC1,rule="tensor") for f in D4.fundamental_weights()] [C2xC1(1,0,1), C2xC1(0,0,2) + C2xC1(0,1,2) + C2xC1(2,0,0), C2xC1(1,0,1), C2xC1(0,0,2) + C2xC1(0,1,0)] sage: C3=WeylCharacterRing("C3",style="coroots") sage: B1xC1=WeylCharacterRing("B1xC1",style="coroots") sage: [C3(f).branch(B1xC1,rule="tensor") for f in C3.fundamental_weights()] [B1xC1(2,1), B1xC1(2,2) + B1xC1(4,0), B1xC1(0,3) + B1xC1(4,1)] EXAMPLES: (Symmetric Power) :: sage: A1=WeylCharacterRing("A1",style="coroots") sage: B3=WeylCharacterRing("B3",style="coroots") sage: C3=WeylCharacterRing("C3",style="coroots") sage: [B3(fw).branch(A1,rule="symmetric_power") for fw in B3.fundamental_weights()] [A1(6), A1(2) + A1(6) + A1(10), A1(0) + A1(6)] sage: [C3(fw).branch(A1,rule="symmetric_power") for fw in C3.fundamental_weights()] [A1(5), A1(4) + A1(8), A1(3) + A1(9)] EXAMPLES: (Miscellaneous type) :: sage: G2 = WeylCharacterRing("G2") sage: [fw1, fw2, fw3] = B3.fundamental_weights() sage: B3(fw1+fw3).branch(G2, rule="miscellaneous") G2(1,0,-1) + G2(2,-1,-1) + G2(2,0,-2) EXAMPLES: (Isomorphic type) :: sage: [B2(x).branch(C2, rule="isomorphic") for x in B2.fundamental_weights()] [C2(1,1), C2(1,0)] sage: [C2(x).branch(B2, rule="isomorphic") for x in C2.fundamental_weights()] [B2(1/2,1/2), B2(1,0)] sage: [A3(x).branch(D3,rule="isomorphic") for x in A3.fundamental_weights()] [D3(1/2,1/2,1/2), D3(1,0,0), D3(1/2,1/2,-1/2)] sage: [D3(x).branch(A3,rule="isomorphic") for x in D3.fundamental_weights()] [A3(1/2,1/2,-1/2,-1/2), A3(1/4,1/4,1/4,-3/4), A3(3/4,-1/4,-1/4,-1/4)] Here A3(x,y,z,w) can be understood as a representation of SL(4). The weights x,y,z,w and x+t,y+t,z+t,w+t represent the same representation of SL(4) - though not of GL(4) - since A3(x+t,y+t,z+t,w+t) is the same as A3(x,y,z,w) tensored with `det^t`. So as a representation of SL(4), A3(1/4,1/4,1/4,-3/4) is the same as A3(1,1,1,0). The exterior square representation SL(4) -> GL(6) admits an invariant symmetric bilinear form, so is a representation SL(4) -> SO(6) that lifts to an isomorphism SL(4) -> Spin(6). Conversely, there are two isomorphisms SO(6) -> SL(4), of which we've selected one. In cases like this you might prefer style="coroots". :: sage: A3 = WeylCharacterRing("A3",style="coroots") sage: D3 = WeylCharacterRing("D3",style="coroots") sage: [D3(fw) for fw in D3.fundamental_weights()] [D3(1,0,0), D3(0,1,0), D3(0,0,1)] sage: [D3(fw).branch(A3,rule="isomorphic") for fw in D3.fundamental_weights()] [A3(0,1,0), A3(0,0,1), A3(1,0,0)] sage: D2 = WeylCharacterRing("D2", style="coroots") sage: A1xA1 = WeylCharacterRing("A1xA1", style="coroots") sage: [D2(fw).branch(A1xA1,rule="isomorphic") for fw in D2.fundamental_weights()] [A1xA1(1,0), A1xA1(0,1)] EXAMPLES: (Branching rules from plethysms) This is a general rule that includes any branching rule from types A,B,C or D as a special case. Thus it could be used in place of the above rules and would give the same results. However it is most useful when branching from G to a maximal subgroup H such that rank(H) < rank(G)-1. We consider a homomorphism H --> G where G is one of SL(r+1), SO(2r+1), Sp(2r) or SO(2r). The function branching_rule_from_plethysm produces the corresponding branching rule. The main ingredient is the character chi of the representation of H that is the homomorphism to GL(r+1), GL(2r+1) or GL(2r). This rule is so powerful that it contains the other rules implemented above as special cases. First let us consider the symmetric fifth power representation of SL(2). :: sage: A1=WeylCharacterRing("A1",style="coroots") sage: chi=A1([5]) sage: chi.degree() 6 sage: chi.frobenius_schur_indicator() -1 This confirms that the character has degree 6 and is symplectic, so it corresponds to a homomorphism SL(2) --> Sp(6), and there is a corresponding branching rule C3 => A1. :: sage: C3 = WeylCharacterRing("C3",style="coroots") sage: sym5rule = branching_rule_from_plethysm(chi,"C3") sage: [C3(hwv).branch(A1,rule=sym5rule) for hwv in C3.fundamental_weights()] [A1(5), A1(4) + A1(8), A1(3) + A1(9)] This is identical to the results we would obtain using rule="symmetric_power". The next example gives a branching not available by other standard rules. :: sage: G2 = WeylCharacterRing("G2",style="coroots") sage: D7 = WeylCharacterRing("D7",style="coroots") sage: ad=G2(0,1); ad.degree(); ad.frobenius_schur_indicator() 14 1 sage: spin = D7(0,0,0,0,0,1,0); spin.degree() 64 sage: spin.branch(G2, rule=branching_rule_from_plethysm(ad, "D7")) G2(1,1) We have confirmed that the adjoint representation of G2 gives a homomorphism into SO(14), and that the pullback of the one of the two 64 dimensional spin representations to SO(14) is an irreducible representation of G2. BRANCHING FROM A REDUCIBLE ROOT SYSTEM If you are branching from a reducible root system, the rule is a list of rules, one for each component type in the root system. The rules in the list are given in pairs [type, rule], where type is the root system to be branched to, and rule is the branching rule. :: sage: D4 = WeylCharacterRing("D4",style="coroots") sage: D2xD2 = WeylCharacterRing("D2xD2",style="coroots") sage: A1xA1xA1xA1 = WeylCharacterRing("A1xA1xA1xA1",style="coroots") sage: rr = [["A1xA1","isomorphic"],["A1xA1","isomorphic"]] sage: [D4(fw) for fw in D4.fundamental_weights()] [D4(1,0,0,0), D4(0,1,0,0), D4(0,0,1,0), D4(0,0,0,1)] sage: [D4(fw).branch(D2xD2,rule="extended").branch(A1xA1xA1xA1,rule=rr) for fw in D4.fundamental_weights()] [A1xA1xA1xA1(0,0,1,1) + A1xA1xA1xA1(1,1,0,0), A1xA1xA1xA1(0,0,0,2) + A1xA1xA1xA1(0,0,2,0) + A1xA1xA1xA1(0,2,0,0) + A1xA1xA1xA1(1,1,1,1) + A1xA1xA1xA1(2,0,0,0), A1xA1xA1xA1(0,1,1,0) + A1xA1xA1xA1(1,0,0,1), A1xA1xA1xA1(0,1,0,1) + A1xA1xA1xA1(1,0,1,0)] WRITING YOUR OWN RULES Suppose you want to branch from a group G to a subgroup H. Arrange the embedding so that a Cartan subalgebra U of H is contained in a Cartan subalgebra T of G. There is thus a mapping from the weight spaces Lie(T)* --> Lie(U)*. Two embeddings will produce identical branching rules if they differ by an element of the Weyl group of H. The RULE is this map Lie(T)* = G.space() to Lie(U)* = H.space(), which you may implement as a function. As an example, let us consider how to implement the branching rule A3 => C2. Here H = C2 = Sp(4) embedded as a subgroup in A3 = GL(4). The Cartan subalgebra U consists of diagonal matrices with eigenvalues u1, u2, -u2, -u1. The C2.space() is the two dimensional vector spaces consisting of the linear functionals u1 and u2 on U. On the other hand Lie(T) is RR^4. A convenient way to see the restriction is to think of it as the adjoint of the map [u1,u2] -> [u1,u2,-u2,-u1], that is, [x0,x1,x2,x3] -> [x0-x3,x1-x2]. Hence we may encode the rule: :: def rule(x): return [x[0]-x[3],x[1]-x[2]] or simply: :: rule = lambda x : [x[0]-x[3],x[1]-x[2]] EXAMPLES:: sage: A3 = WeylCharacterRing(['A',3]) sage: C2 = WeylCharacterRing(['C',2]) sage: rule = lambda x : [x[0]-x[3],x[1]-x[2]] sage: branch_weyl_character(A3([1,1,0,0]),A3,C2,rule) C2(0,0) + C2(1,1) sage: A3(1,1,0,0).branch(C2, rule) == C2(0,0) + C2(1,1) True """ if type(rule) == str: rule = get_branching_rule(R._cartan_type, S._cartan_type, rule) elif R._cartan_type.is_compound(): Rtypes = R._cartan_type.component_types() Stypes = [CartanType(l[0]) for l in rule] rules = [l[1] for l in rule] ntypes = len(Rtypes) rule_list = [get_branching_rule(Rtypes[i], Stypes[i], rules[i]) for i in range(ntypes)] shifts = R._cartan_type._shifts def rule(x): yl = [] for i in range(ntypes): yl.append(rule_list[i](x[shifts[i]:shifts[i+1]])) return flatten(yl) mdict = {} for k in chi._mdict: if S._style == "coroots": if S._cartan_type.is_atomic() and S._cartan_type[0] == 'E': if S._cartan_type[1] == 6: h = S._space(rule(list(k.to_vector()))) h = S.coerce_to_e6(h) elif S._cartan_type[1] == 7: h = S.coerce_to_e7(S._space(rule(list(k.to_vector())))) else: h = S.coerce_to_sl(S._space(rule(list(k.to_vector())))) else: h = S._space(rule(list(k.to_vector()))) if h in mdict: mdict[h] += chi._mdict[k] else: mdict[h] = chi._mdict[k] hdict = S.char_from_weights(mdict) return WeylCharacter(S, hdict, mdict) | 6242c71e9458efbf328be967e795e57a7ca2740b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/6242c71e9458efbf328be967e795e57a7ca2740b/weyl_characters.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3803,
67,
91,
402,
80,
67,
11560,
12,
24010,
16,
534,
16,
348,
16,
1720,
1546,
1886,
6,
4672,
436,
8395,
432,
15449,
310,
1720,
19605,
326,
9318,
434,
27851,
628,
279,
511,
1385,
1041,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3803,
67,
91,
402,
80,
67,
11560,
12,
24010,
16,
534,
16,
348,
16,
1720,
1546,
1886,
6,
4672,
436,
8395,
432,
15449,
310,
1720,
19605,
326,
9318,
434,
27851,
628,
279,
511,
1385,
1041,... |
path = self.request.path | path = os.path.realpath(os.path.join('/', self.request.path)) | def get(self): path = self.request.path # special path to invoke the unit tests # TODO(nickbaum): is there a less ghetto way to invoke the unit test? if path == "/test/": self.unitTest() return # if root, redirect to index.html # TODO(nickbaum): this doesn't handle /chrome/extensions/trunk, etc if (path == "/chrome/extensions") or (path == "chrome/extensions/"): self.redirect("/chrome/extensions/index.html") return # else remove prefix if(path[:18] == "/chrome/extensions"): path = path[18:] # TODO(nickbaum): there's a subtle bug here: if there are two instances of the app, # their default caches will override each other. This is bad! result = memcache.get(path) if result is None: logging.info("Cache miss: " + path) url = self.getSrcUrl(path) if (url[1] is not Channel.TRUNK) and (url[0] != "http://src.chromium.org/favicon.ico"): branch = self.getBranch(url[1]) url = url[0] % branch else: url = url[0] logging.info("Path: " + self.request.path) logging.info("Url: " + url) try: result = urlfetch.fetch(url + self.request.query_string) if result.status_code != 200: logging.error("urlfetch failed: " + url) # TODO(nickbaum): what should we do when the urlfetch fails? except: logging.error("urlfetch failed: " + url) # TODO(nickbaum): what should we do when the urlfetch fails? try: if not memcache.add(path, result, DEFAULT_CACHE_TIME): logging.error("Memcache set failed.") except: logging.error("Memcache set failed.") for key in result.headers: self.response.headers[key] = result.headers[key] self.response.out.write(result.content) | 08284a8e331cb1a9ac04ee5e0da07efb131514bd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/08284a8e331cb1a9ac04ee5e0da07efb131514bd/chromeextensionsdocs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
4672,
589,
273,
1140,
18,
803,
18,
7688,
803,
12,
538,
18,
803,
18,
5701,
2668,
19,
2187,
365,
18,
2293,
18,
803,
3719,
468,
4582,
589,
358,
4356,
326,
2836,
7434,
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,
336,
12,
2890,
4672,
589,
273,
1140,
18,
803,
18,
7688,
803,
12,
538,
18,
803,
18,
5701,
2668,
19,
2187,
365,
18,
2293,
18,
803,
3719,
468,
4582,
589,
358,
4356,
326,
2836,
7434,
468... |
@param verbose: The level of verbosity output when writing the | @param verbose: The level of verbosity for output when writing the | def write(self, directory=None, verbose=1): """ Write the documentation to the given directory. | 1cbf22bf435c5a597ad3c4c61bb27adb7b7cf726 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/1cbf22bf435c5a597ad3c4c61bb27adb7b7cf726/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
1867,
33,
7036,
16,
3988,
33,
21,
4672,
3536,
2598,
326,
7323,
358,
326,
864,
1867,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1045,
12,
2890,
16,
1867,
33,
7036,
16,
3988,
33,
21,
4672,
3536,
2598,
326,
7323,
358,
326,
864,
1867,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
cairo.cairo_set_source_surface(cr, image, 0, 0) | cairo.cairo_set_source_surface(cr, image, self.rx, self.ry) | def render(self, cr): assert None not in (self.rx, self.ry, self.rwidth, self.rheight) | 17ea96a2b7b5f4d06a721801da71661d7eb05773 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10761/17ea96a2b7b5f4d06a721801da71661d7eb05773/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
4422,
4672,
1815,
599,
486,
316,
261,
2890,
18,
20122,
16,
365,
18,
1176,
16,
365,
18,
86,
2819,
16,
365,
18,
86,
4210,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
4422,
4672,
1815,
599,
486,
316,
261,
2890,
18,
20122,
16,
365,
18,
1176,
16,
365,
18,
86,
2819,
16,
365,
18,
86,
4210,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,... |
''' Adds a new instrument to the project, and return the ID for that instrument. ''' | """ Adds a new instrument to the project and returns the ID for that instrument. Parameters: name -- name of the instrument. type -- type of the instrument. pixbuf -- image object corresponding to the instrument. Returns: ID of the added Instrument. """ | def AddInstrument(self, name, type, pixbuf): ''' Adds a new instrument to the project, and return the ID for that instrument. ''' instr = Instrument(self, name, type, pixbuf) if len(self.instruments) == 0: #If this is the first instrument, arm it by default instr.ToggleArmed() audio_dir = os.path.join(os.path.split(self.projectfile)[0], "audio") instr.path = os.path.join(audio_dir) self.temp = instr.id self.instruments.append(instr) return instr.id | e2b4f4a534dc5054c26a7ac44730cd6e0c158de4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10033/e2b4f4a534dc5054c26a7ac44730cd6e0c158de4/Project.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1436,
19228,
12,
2890,
16,
508,
16,
618,
16,
11871,
4385,
4672,
3536,
15605,
279,
394,
10353,
358,
326,
1984,
471,
1135,
326,
1599,
364,
716,
10353,
18,
225,
7012,
30,
508,
1493,
508,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1436,
19228,
12,
2890,
16,
508,
16,
618,
16,
11871,
4385,
4672,
3536,
15605,
279,
394,
10353,
358,
326,
1984,
471,
1135,
326,
1599,
364,
716,
10353,
18,
225,
7012,
30,
508,
1493,
508,
... |
ARCH=ReadFile(GetOutputDir()+"/tmp/architecture.txt").strip() if RUNTIME: | ARCH = ReadFile(GetOutputDir()+"/tmp/architecture.txt").strip() if (RUNTIME): | def MakeInstallerLinux(): import compileall if RUNTIME: # No worries, it won't be used PYTHONV="python" else: PYTHONV=SDK["PYTHONVERSION"] PV=PYTHONV.replace("python", "") if (os.path.isdir("linuxroot")): oscmd("chmod -R 755 linuxroot") oscmd("rm -rf linuxroot data.tar.gz control.tar.gz panda3d.spec") oscmd("mkdir linuxroot") # Invoke installpanda.py to install it into a temporary dir if RUNTIME: InstallRuntime(destdir = "linuxroot", outputdir = GetOutputDir()) else: InstallPanda(destdir = "linuxroot", outputdir = GetOutputDir()) oscmd("chmod -R 755 linuxroot/usr/share/panda3d") if (os.path.exists("/usr/bin/rpmbuild") and not os.path.exists("/usr/bin/dpkg-deb")): oscmd("rm -rf linuxroot/DEBIAN") oscmd("rpm -E '%_target_cpu' > "+GetOutputDir()+"/tmp/architecture.txt") ARCH=ReadFile(GetOutputDir()+"/tmp/architecture.txt").strip() pandasource = os.path.abspath(os.getcwd()) txt = INSTALLER_SPEC_FILE[1:].replace("VERSION",VERSION).replace("PANDASOURCE",pandasource).replace("PYTHONV",PYTHONV).replace("PV",PV) WriteFile("panda3d.spec", txt) oscmd("rpmbuild --define '_rpmdir "+pandasource+"' --root "+pandasource+" --buildroot linuxroot -bb panda3d.spec") oscmd("mv "+ARCH+"/panda3d-"+VERSION+"-1."+ARCH+".rpm .") oscmd("rmdir "+ARCH, True) if (os.path.exists("/usr/bin/dpkg-deb")): oscmd("dpkg --print-architecture > "+GetOutputDir()+"/tmp/architecture.txt") ARCH=ReadFile(GetOutputDir()+"/tmp/architecture.txt").strip() if RUNTIME: txt = RUNTIME_INSTALLER_DEB_FILE[1:] else: txt = INSTALLER_DEB_FILE[1:] txt = txt.replace("VERSION",str(VERSION)).replace("PYTHONV",PYTHONV).replace("ARCH",ARCH).replace("PV",PV) oscmd("mkdir --mode=0755 -p linuxroot/DEBIAN") oscmd("cd linuxroot ; (find usr -type f -exec md5sum {} \;) > DEBIAN/md5sums") if (not RUNTIME): oscmd("cd linuxroot ; (find etc -type f -exec md5sum {} \;) >> DEBIAN/md5sums") WriteFile("linuxroot/DEBIAN/conffiles","/etc/Config.prc\n") WriteFile("linuxroot/DEBIAN/control",txt) WriteFile("linuxroot/DEBIAN/postinst","#!/bin/sh\necho running ldconfig\nldconfig\n") oscmd("cp linuxroot/DEBIAN/postinst linuxroot/DEBIAN/postrm") oscmd("chmod -R 755 linuxroot/DEBIAN") if (RUNTIME): oscmd("dpkg-deb -b linuxroot panda3d-runtime_"+VERSION+"_"+ARCH+".deb") else: oscmd("dpkg-deb -b linuxroot panda3d_"+VERSION+"_"+ARCH+".deb") oscmd("chmod -R 755 linuxroot") if not(os.path.exists("/usr/bin/rpmbuild") or os.path.exists("/usr/bin/dpkg-deb")): exit("To build an installer, either rpmbuild or dpkg-deb must be present on your system!") | 512c359555ea73a6d275ee5f014884d456b34252 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7242/512c359555ea73a6d275ee5f014884d456b34252/makepanda.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4344,
18678,
19475,
13332,
1930,
4074,
454,
309,
534,
25375,
30,
468,
2631,
14591,
566,
281,
16,
518,
8462,
1404,
506,
1399,
12191,
20131,
58,
1546,
8103,
6,
469,
30,
12191,
20131,
58,
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,
4344,
18678,
19475,
13332,
1930,
4074,
454,
309,
534,
25375,
30,
468,
2631,
14591,
566,
281,
16,
518,
8462,
1404,
506,
1399,
12191,
20131,
58,
1546,
8103,
6,
469,
30,
12191,
20131,
58,
3... |
:param: the data key | :param key: the data key | def get_global(key): """Return the dictionary for the given key in the global data. The global data is stored in the ``babel/global.dat`` file and contains information independent of individual locales. >>> get_global('zone_aliases')['UTC'] 'Etc/GMT' >>> get_global('zone_territories')['Europe/Berlin'] 'DE' :param: the data key :return the dictionary found in the global data under the given key :rtype: `dict` :since: version 0.9 """ global _global_data if _global_data is None: dirname = os.path.join(os.path.dirname(__file__)) filename = os.path.join(dirname, 'global.dat') fileobj = open(filename, 'rb') try: _global_data = pickle.load(fileobj) finally: fileobj.close() return _global_data.get(key, {}) | 56df9b036dfcd862b72471e819c982aab32b140c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8909/56df9b036dfcd862b72471e819c982aab32b140c/core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
6347,
12,
856,
4672,
3536,
990,
326,
3880,
364,
326,
864,
498,
316,
326,
2552,
501,
18,
225,
1021,
2552,
501,
353,
4041,
316,
326,
12176,
70,
873,
19,
6347,
18,
3404,
10335,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6347,
12,
856,
4672,
3536,
990,
326,
3880,
364,
326,
864,
498,
316,
326,
2552,
501,
18,
225,
1021,
2552,
501,
353,
4041,
316,
326,
12176,
70,
873,
19,
6347,
18,
3404,
10335,
... |
excuse_unsat_deps = self.excuse_unsat_deps | check_installable = self.check_installable | def iter_packages(self, packages, output): extra = [] nuninst_comp = self.get_nuninst() | 59b36ea1bf248c8b337353565b2ecc0547783fab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2784/59b36ea1bf248c8b337353565b2ecc0547783fab/britney.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1400,
67,
10308,
12,
2890,
16,
5907,
16,
876,
4672,
2870,
273,
5378,
290,
318,
8591,
67,
2919,
273,
365,
18,
588,
67,
82,
318,
8591,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1400,
67,
10308,
12,
2890,
16,
5907,
16,
876,
4672,
2870,
273,
5378,
290,
318,
8591,
67,
2919,
273,
365,
18,
588,
67,
82,
318,
8591,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
print openfst.GetString(shortest) | shortest.Write("temp.fst") assert "AABA"==openfst.GetString(shortest) | def testTranslation(self): input = openfst.StdVectorFst() input.AddString("hello") input.AddString("foo") fst = openfst.StdVectorFst() fst.AddTranslation("hello","world") fst.Write("trans.fst") result = openfst.StdVectorFst() openfst.Compose(input,fst,result) shortest = openfst.StdVectorFst() openfst.ShortestPath(result,shortest,1) print openfst.GetString(shortest) | 925b2d4611c04131e050b3dc88593e61d4f10a2a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5933/925b2d4611c04131e050b3dc88593e61d4f10a2a/test-openfst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
6717,
12,
2890,
4672,
810,
273,
1696,
74,
334,
18,
10436,
5018,
42,
334,
1435,
810,
18,
986,
780,
2932,
23711,
7923,
810,
18,
986,
780,
2932,
11351,
7923,
20223,
273,
1696,
74,
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,
6717,
12,
2890,
4672,
810,
273,
1696,
74,
334,
18,
10436,
5018,
42,
334,
1435,
810,
18,
986,
780,
2932,
23711,
7923,
810,
18,
986,
780,
2932,
11351,
7923,
20223,
273,
1696,
74,
3... |
if self.fire_date < other.fire_date: return -1 elif self.fire_date > other.fire_date: return 1 else: return 0 | return cmp(self.fire_date, other.fire_date) | def __cmp__(self, other): if self.fire_date < other.fire_date: return -1 elif self.fire_date > other.fire_date: return 1 else: return 0 | 6e282a2f67355a89451c24ab12d48f8117605149 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11479/6e282a2f67355a89451c24ab12d48f8117605149/Engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9625,
972,
12,
2890,
16,
1308,
4672,
309,
365,
18,
12179,
67,
712,
411,
1308,
18,
12179,
67,
712,
30,
327,
300,
21,
1327,
365,
18,
12179,
67,
712,
405,
1308,
18,
12179,
67,
712... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9625,
972,
12,
2890,
16,
1308,
4672,
309,
365,
18,
12179,
67,
712,
411,
1308,
18,
12179,
67,
712,
30,
327,
300,
21,
1327,
365,
18,
12179,
67,
712,
405,
1308,
18,
12179,
67,
712... |
""" | """ | def fl_setpup_submenu(m, i, subm): """ fl_setpup_submenu(m, i, subm) """ _fl_setpup_submenu(m, i, subm) | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
542,
84,
416,
67,
1717,
5414,
12,
81,
16,
277,
16,
720,
81,
4672,
3536,
1183,
67,
542,
84,
416,
67,
1717,
5414,
12,
81,
16,
277,
16,
720,
81,
13,
3536,
225,
389,
2242,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1183,
67,
542,
84,
416,
67,
1717,
5414,
12,
81,
16,
277,
16,
720,
81,
4672,
3536,
1183,
67,
542,
84,
416,
67,
1717,
5414,
12,
81,
16,
277,
16,
720,
81,
13,
3536,
225,
389,
2242,
... |
sectorkeys.append(xr[i]*1000 + yr[j]) | sectorkeys.append(i*1000 + j) | def nearbythingsbybbox(thing, bbox, otherowner=None): xmin = int(bbox.xmin/5.0) ymin = int(bbox.ymin/5.0) xmax = int(bbox.xmax/5.0) ymax = int(bbox.ymax/5.0) xr = xrange(xmin,xmax) yr = xrange(ymin,ymax) sectorkeys = [] for i in xr: for j in yr: sectorkeys.append(xr[i]*1000 + yr[j]) print str(sectorkeys) return thing.objects.filter(sector__in=sectorkeys, owner = otherowner) | d021b42e0febe097b99a27a0546b26690f4cbced /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2020/d021b42e0febe097b99a27a0546b26690f4cbced/models.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13378,
1637,
451,
899,
1637,
20737,
12,
4274,
16,
8472,
16,
1308,
8443,
33,
7036,
4672,
13777,
273,
509,
12,
20737,
18,
92,
1154,
19,
25,
18,
20,
13,
15763,
273,
509,
12,
20737,
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,
13378,
1637,
451,
899,
1637,
20737,
12,
4274,
16,
8472,
16,
1308,
8443,
33,
7036,
4672,
13777,
273,
509,
12,
20737,
18,
92,
1154,
19,
25,
18,
20,
13,
15763,
273,
509,
12,
20737,
18,
... |
self.OnOpenRot(None) self.OnOpenThrust(None) | def __init__(self, parent): wx.aui.AuiMDIParentFrame.__init__(self, parent, -1, title="UMD Robotics", size=(640,480), style=wx.DEFAULT_FRAME_STYLE) self.OnOpenRot(None) self.OnOpenThrust(None) mb = self.MakeMenuBar() self.SetMenuBar(mb) self.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOWFRAME)) self.CreateStatusBar() | 6efc1658861d508d7fbe3f3950f7a6854250bd77 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10608/6efc1658861d508d7fbe3f3950f7a6854250bd77/MainView.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
4672,
7075,
18,
69,
4881,
18,
37,
4881,
49,
2565,
3054,
3219,
16186,
2738,
972,
12,
2890,
16,
982,
16,
300,
21,
16,
2077,
1546,
2799,
40,
19686,
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,
1001,
2738,
972,
12,
2890,
16,
982,
4672,
7075,
18,
69,
4881,
18,
37,
4881,
49,
2565,
3054,
3219,
16186,
2738,
972,
12,
2890,
16,
982,
16,
300,
21,
16,
2077,
1546,
2799,
40,
19686,
3... | |
print "Outputs tokens string to stdout if second argument (the target file) is missing." | print "Outputs tokens string to stdout if the second argument (the target file) is missing." | def main(): if len(sys.argv) >= 2: tokenString = convertTokensToString(parseFile(sys.argv[1])) if len(sys.argv) >= 3: tokenFile = file(sys.argv[2], "w") tokenFile.write(tokenString) tokenFile.flush() tokenFile.close() else: print tokenString else: print "tokenizer.py input.js [output.txt]" print "First Argument should be a JavaScript file." print "Outputs tokens string to stdout if second argument (the target file) is missing." | cfa739069de6b3587878887cd115c9102e66f71b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5718/cfa739069de6b3587878887cd115c9102e66f71b/tokenizer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
309,
562,
12,
9499,
18,
19485,
13,
1545,
576,
30,
1147,
780,
273,
1765,
5157,
5808,
12,
2670,
812,
12,
9499,
18,
19485,
63,
21,
22643,
309,
562,
12,
9499,
18,
19485,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
309,
562,
12,
9499,
18,
19485,
13,
1545,
576,
30,
1147,
780,
273,
1765,
5157,
5808,
12,
2670,
812,
12,
9499,
18,
19485,
63,
21,
22643,
309,
562,
12,
9499,
18,
19485,
13,
... |
def testRAND(self): | def test_random(self): | def testRAND(self): v = ssl.RAND_status() if test_support.verbose: sys.stdout.write("\n RAND_status is %d (%s)\n" % (v, (v and "sufficient randomness") or "insufficient randomness")) try: ssl.RAND_egd(1) except TypeError: pass else: print "didn't raise TypeError" ssl.RAND_add("this is a random string", 75.0) | 3945c867d60b1d53299799dd09b6753dcd0a9546 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/3945c867d60b1d53299799dd09b6753dcd0a9546/test_ssl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9188,
12,
2890,
4672,
331,
273,
5832,
18,
54,
4307,
67,
2327,
1435,
309,
1842,
67,
13261,
18,
11369,
30,
2589,
18,
10283,
18,
2626,
31458,
82,
534,
4307,
67,
2327,
353,
738,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9188,
12,
2890,
4672,
331,
273,
5832,
18,
54,
4307,
67,
2327,
1435,
309,
1842,
67,
13261,
18,
11369,
30,
2589,
18,
10283,
18,
2626,
31458,
82,
534,
4307,
67,
2327,
353,
738,
... |
i = 0 for dict in dicts: | for i, dict in enumerate(dicts): | def _array_get_all(a, object_cache): """ Return a 4-tuple containing all the data stored in a given array, in a format that is easy to turn into an actual dictionary. @param a: Array representing a dictionary. @param object_cache: A list of strings referenced by elements in the array. @return: A 4-tuple: (name, shortname, depend, content), in which all members are strings except depend which is a list of strings. """ name = ".".join([object_cache[i] for i in a[a[0]:a[1]]]) shortname = ".".join([object_cache[i] for i in a[a[1]:a[2]]]) content = "".join([object_cache[i] for i in a[a[3]:]]) depend = [] prefix = "" for n, d in zip(a[a[0]:a[1]], a[a[2]:a[3]]): for dep in object_cache[d].split(): depend.append(prefix + dep) prefix += object_cache[n] + "." return name, shortname, depend, content | 28d72e6d0104eee977ffcbc5eb29a27e101f38c7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10349/28d72e6d0104eee977ffcbc5eb29a27e101f38c7/kvm_config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1126,
67,
588,
67,
454,
12,
69,
16,
733,
67,
2493,
4672,
3536,
2000,
279,
1059,
17,
8052,
4191,
777,
326,
501,
4041,
316,
279,
864,
526,
16,
316,
279,
740,
716,
353,
12779,
358,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1126,
67,
588,
67,
454,
12,
69,
16,
733,
67,
2493,
4672,
3536,
2000,
279,
1059,
17,
8052,
4191,
777,
326,
501,
4041,
316,
279,
864,
526,
16,
316,
279,
740,
716,
353,
12779,
358,... |
try: file_outcar = ReadOUTCAR(dir) atomtypes = file_outcar.atom_types() except IOError: file_potcar = ReadPOTCAR(dir) atomtypes = file_potcar.atom_types() | atomtypes = atomtypes_outpot(vaspdir) | def read_vasp(filename='CONTCAR'): """Import POSCAR/CONTCAR type file. Reads unitcell, atom positions and constraints from the POSCAR/CONTCAR file and tries to read atom types from POSCAR/CONTCAR header, if this fails the atom types are read from OUTCAR or POTCAR file. """ import os from ase import Atoms, Atom from ase.constraints import FixAtoms, fix_scaled from ase.data import chemical_symbols import numpy as np if type(filename) == str: f = open(filename) elif type(filename) == file: f = filename else: raise TypeError("filename argument must be a string or a file object.") # First line should contain the atom symbols , eg. "Ag Ge" in # the same order # as later in the file (and POTCAR for the full vasp run) atomtypes = f.readline().split() try: for atype in atomtypes: if not atype in chemical_symbols: raise KeyError except KeyError: try: file_outcar = ReadOUTCAR(dir) atomtypes = file_outcar.atom_types() except IOError: file_potcar = ReadPOTCAR(dir) atomtypes = file_potcar.atom_types() lattice_constant = float(f.readline()) # Now the lattice vectors a = [] for ii in range(3): s = f.readline().split() floatvect = float(s[0]), float(s[1]), float(s[2]) a.append(floatvect) basis_vectors = np.array(a) * lattice_constant # Number of atoms. Again this must be in the same order as # in the first line # or in the POTCAR or OUTCAR file atom_symbols = [] numofatoms = f.readline().split() for i, num in enumerate(numofatoms): numofatoms[i] = int(num) if (len(atomtypes) < i + 1): atomtypes.append("Unknown") [atom_symbols.append(atomtypes[i]) for na in xrange(numofatoms[i])] # Check if Selective dynamics is switched on sdyn = f.readline() selective_dynamics = sdyn[0].lower() == "s" # Check if atom coordinates are cartesian or direct if selective_dynamics: ac_type = f.readline() else: ac_type = sdyn cartesian = ac_type[0].lower() == "c" or ac_type[0].lower() == "k" tot_natoms = sum(numofatoms) atoms_pos = np.empty((tot_natoms, 3)) if selective_dynamics: selective_flags = np.empty((tot_natoms, 3), dtype=bool) for atom in xrange(tot_natoms): ac = f.readline().split() atoms_pos[atom] = (float(ac[0]), float(ac[1]), float(ac[2])) if selective_dynamics: curflag = [] for flag in ac[3:6]: curflag.append(flag == 'F') selective_flags[atom] = curflag # Done with all reading if type(filename) == str: f.close() if cartesian: atoms_pos *= lattice_constant atoms = Atoms(symbols = atom_symbols, cell = basis_vectors, pbc = True) if cartesian: atoms.set_positions(atoms_pos) else: atoms.set_scaled_positions(atoms_pos) if selective_dynamics: constraints = [] indices = [] for ind, sflags in enumerate(selective_flags): if sflags.any() and not sflags.all(): constraints.append(fix_scaled(atoms.get_cell(), ind, sflags)) elif sflags.all(): indices.append(ind) if indices: constraints.append(FixAtoms(indices)) if constraints: atoms.set_constraint(constraints) return atoms | 0ef92d0036640a01731a11fd224ec8bb5389da74 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1380/0ef92d0036640a01731a11fd224ec8bb5389da74/vasp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
4423,
84,
12,
3459,
2218,
6067,
39,
985,
11,
4672,
3536,
5010,
13803,
2312,
985,
19,
6067,
39,
985,
618,
585,
18,
225,
29185,
2836,
3855,
16,
3179,
6865,
471,
6237,
628,
326,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
4423,
84,
12,
3459,
2218,
6067,
39,
985,
11,
4672,
3536,
5010,
13803,
2312,
985,
19,
6067,
39,
985,
618,
585,
18,
225,
29185,
2836,
3855,
16,
3179,
6865,
471,
6237,
628,
326,
... |
t1 + O(t1^4) + (1 + O(t1^4))*t2 + (-4*t1^3 + O(t1^4))*t2^2 + (-4*t1^2 + O(t1^4))*t2^3 + O(t2^4) | t1 + O(t1^4) + (1 + O(t1^4))*t2 + (2*t1^3 + O(t1^4))*t2^2 + (2*t1^2 + O(t1^4))*t2^3 + O(t2^4) Test for trac ticket 9646:: sage: P.<a1, a2, a3, a4, a6> = PolynomialRing(ZZ, 5) sage: E = EllipticCurve(list(P.gens())) sage: F = E.formal().group_law(prec = 4) sage: t2 = F.parent().gen() sage: t1 = F.parent().base_ring().gen() sage: F(t1, 0) t1 sage: F(0, t2) t2 sage: F[2][1] -a2 | def group_law(self, prec=10): r""" The formal group law. INPUT: - ``prec`` - integer (default 10) OUTPUT: a power series with given precision in ZZ[[ ZZ[['t1']],'t2']] DETAILS: Return the formal power series .. math:: F(t_1, t_2) = t_1 + t_2 - a_1 t_1 t_2 - \cdots to precision `O(t^{prec})` of page 115 of [Silverman AEC1]. The result is cached, and a cached version is returned if possible. .. warning:: | 45947b9ae52f8ba82e72b744e68f60d7a5fe66a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/45947b9ae52f8ba82e72b744e68f60d7a5fe66a7/formal_group.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1041,
67,
80,
2219,
12,
2890,
16,
13382,
33,
2163,
4672,
436,
8395,
1021,
25739,
1041,
328,
2219,
18,
225,
12943,
30,
282,
300,
225,
12176,
4036,
10335,
300,
3571,
261,
1886,
1728,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1041,
67,
80,
2219,
12,
2890,
16,
13382,
33,
2163,
4672,
436,
8395,
1021,
25739,
1041,
328,
2219,
18,
225,
12943,
30,
282,
300,
225,
12176,
4036,
10335,
300,
3571,
261,
1886,
1728,
13,
... |
class TixWidget(Widget): | class TixWidget(Tkinter.Widget): | def slaves(self): return map(self._nametowidget, self.tk.splitlist( self.tk.call( 'tixForm', 'slaves', self._w))) | 48af83dadc128720a7642beb50800c6971404eb9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/48af83dadc128720a7642beb50800c6971404eb9/Tix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30403,
12,
2890,
4672,
327,
852,
12,
2890,
6315,
17808,
278,
543,
2208,
16,
365,
18,
16099,
18,
4939,
1098,
12,
365,
18,
16099,
18,
1991,
12,
296,
88,
697,
1204,
2187,
296,
2069,
6606,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30403,
12,
2890,
4672,
327,
852,
12,
2890,
6315,
17808,
278,
543,
2208,
16,
365,
18,
16099,
18,
4939,
1098,
12,
365,
18,
16099,
18,
1991,
12,
296,
88,
697,
1204,
2187,
296,
2069,
6606,... |
connection.putrequest(http_operation, full_uri) | connection.putrequest(http_operation, full_uri, skip_host=self.skip_host) | def _CreateConnection(self, uri, http_operation, extra_headers=None, url_params=None, escape_params=True): full_uri = BuildUri(uri, url_params, escape_params) (connection, full_uri) = self._PrepareConnection(full_uri) connection.putrequest(http_operation, full_uri) | 640308770e97df9ee10f141a928aa80dda59ab00 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6580/640308770e97df9ee10f141a928aa80dda59ab00/service.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1684,
1952,
12,
2890,
16,
2003,
16,
1062,
67,
7624,
16,
2870,
67,
2485,
33,
7036,
16,
880,
67,
2010,
33,
7036,
16,
4114,
67,
2010,
33,
5510,
4672,
225,
1983,
67,
1650,
273,
3998... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1684,
1952,
12,
2890,
16,
2003,
16,
1062,
67,
7624,
16,
2870,
67,
2485,
33,
7036,
16,
880,
67,
2010,
33,
7036,
16,
4114,
67,
2010,
33,
5510,
4672,
225,
1983,
67,
1650,
273,
3998... |
cell_1_left = """<small><strong>Search for:</strong></small> <br><input type="text" name="p" size="%d" value="%s">""" % \ | cell_1_left = """<input type="text" name="p" size="%d" value="%s">""" % \ | def create_search_box(cc, colls, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, d1y, d1m, d1d, d2y, d2m, d2d): "Create search box for 'search again in the results page' functionality." out = "" # print search box prolog: out += """ <form action="%s/search.py" method="get"> <strong class="headline"><span class="h1">%s</span></strong> <input type="hidden" name="cc" value="%s"> <input type="hidden" name="as" value="%s"> """ % (weburl, cc, cc, as) if ot: out += """<input type="hidden" name="ot" value="%s">""" % ot if sp: out += """<input type="hidden" name="sp" value="%s">""" % sp # possibly print external search engines links (Google box): if cfg_google_box: out += """<table align="right"><tr><td>%s</td></tr></table>""" % create_google_box(p, f, p1, p2, p3) out += "<table>" # firstly, print Query box: if as==1: # print Advanced Search form: # define search box elements: cell_1_left = "<small><strong>Search for:</strong></small><br>" + create_matchtype_box('m1', m1) + \ """<input type="text" name="p1" size="%d" value="%s">""" % (cfg_advancedsearch_pattern_box_width, cgi.escape(p1,1)) cell_1_right = "<small><strong>within:</strong></small><br>%s" % create_searchwithin_selection_box('f1', f1) cell_1_moreright = create_andornot_box('op1', op1) cell_1_farright = "" cell_2_left = create_matchtype_box('m2', m2) + """<input type="text" name="p2" size="%d" value="%s">""" % (cfg_advancedsearch_pattern_box_width, cgi.escape(p2,1)) cell_2_right = create_searchwithin_selection_box('f2', f2) cell_2_moreright = create_andornot_box('op2', op2) cell_2_farright = "" cell_3_left = create_matchtype_box('m3', m3) + """<input type="text" name="p3" size="%d" value="%s">""" % (cfg_advancedsearch_pattern_box_width, cgi.escape(p3,1)) cell_3_right = create_searchwithin_selection_box('f3', f3) cell_3_moreright = """<input type="submit" name="search" value="SEARCH"><input type="submit" name="search" value="Browse"> """ cell_3_farright = """<small class="light"><a href="%s/search.py?p=%s&f=%s&cc=%s">Simple Search</a></small> <br><small><a href="%s/help/search/tips.html">Search Tips</a></small>""" % \ (weburl, urllib.quote(p1), urllib.quote(f1), urllib.quote(cc), weburl) # print them: out += """ <tr> <td valign="top" nowrap> <table> <tr valign="bottom"> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> </tr> <tr valign="bottom"> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> </tr> <tr valign="bottom"> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> </tr> </table> </td> </tr>""" % \ (cell_1_left, cell_1_right, cell_1_moreright, cell_1_farright, \ cell_2_left, cell_2_right, cell_2_moreright, cell_2_farright, \ cell_3_left, cell_3_right, cell_3_moreright, cell_3_farright) else: # print Simple Search form: cell_1_left = """<small><strong>Search for:</strong></small> <br><input type="text" name="p" size="%d" value="%s">""" % \ (cfg_simplesearch_pattern_box_width, cgi.escape(p, 1)) cell_1_middle = "<small><strong>within:</strong></small><br>%s" % create_searchwithin_selection_box('f', f) cell_1_right = """<input type="submit" name="search" value="SEARCH"><input type="submit" name="search" value="Browse"> """ cell_1_farright = """<small class="light"><a href="%s/search.py?p1=%s&f1=%s&as=1&cc=%s">Advanced Search</a></small> <br><small><a href="%s/help/search/tips.html">Search Tips</a></small>""" %\ (weburl, urllib.quote(p), urllib.quote(f), urllib.quote(cc), weburl) out += """ <tr> <td valign="top" nowrap> <table> <tr valign="bottom"> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> </tr> </table> </td> </tr> """ % (cell_1_left, cell_1_middle, cell_1_right, cell_1_farright) # secondly, print Collection(s) box: out += """ <tr> <td valign="top"> <small><strong>Search collections:</strong></small><br>""" colls_nicely_ordered = get_nicely_ordered_collection_list() if colls and colls[0] != cdsname: # some collections are defined, so print these first, and only then print 'add another collection' heading: for c in colls: if c: out += """<select name="c"><option value="">*** remove this collection ***""" for (cx, cx_printable) in colls_nicely_ordered: # print collection: if not cx.startswith("Unnamed collection"): out+= """<option value="%s"%s>%s""" % (cx, is_selected(c, re.sub("^[\s\-]*","",cx)), cx_printable) out += """</select>""" out += """<select name="c"><option value="">*** add another collection ***""" else: # we searched in CDSNAME, so print 'any collection' heading out += """<select name="c"><option value="">*** any collection ***""" for (cx, cx_printable) in colls_nicely_ordered: if not cx.startswith("Unnamed collection"): out += """<option value="%s">%s""" % (cx, cx_printable) out += """ </select> </td> </tr>""" # thirdly, print from/until date boxen, if applicable: if d1y=="" and d1m=="" and d1d=="" and d2y=="" and d2m=="" and d2d=="": pass # do not need it else: cell_6_a = create_inputdate_box("Added since", "d1", d1y, d1m, d1d) cell_6_b = create_inputdate_box("until", "d2", d2y, d2m, d2d) out += """<table cellpadding="3" cellspacing="0"> <tr> <td colspan="3" height="3"> </td> </tr> <tr valign="bottom"> <td>%s</td> <td>%s</td> </tr> </table>""" % \ (cell_6_a, cell_6_b) # fourthly, print Display/Sort box: cell_1_left = """<small><strong>Sort by:</strong></small><br> <select name="sf"> <option value="">- latest first -""" query = """SELECT DISTINCT(f.code),f.name FROM field AS f, collection_field_fieldvalue AS cff WHERE cff.type='soo' AND cff.id_field=f.id ORDER BY cff.score DESC, f.name ASC""" res = run_sql(query) for code, name in res: # propose found sort options: cell_1_left += """<option value="%s"%s>%s""" % (code, is_selected(sf,code), name) cell_1_left += """</select>""" cell_1_left += """<select name="so"> <option value="a"%s>asc. <option value="d"%s>desc. </select>""" % (is_selected(so,"a"),is_selected(so,"d")) cell_1_right = """<small><strong>Output format:</strong></small><br> <select name="of">""" query = """SELECT code,name FROM format ORDER BY name ASC""" res = run_sql(query) if res: # propose found formats: for code, name in res: cell_1_right += """<option value="%s"%s>%s""" % (code, is_selected(of,code), name) else: # no formats are found, so propose the default HTML one: cell_1_right += """<option value="hb"%s>HTML brief""" % (is_selected(of,"hb")) # is format made of numbers only? if yes, then propose it too: if of and str(of[0:3]).isdigit(): cell_1_right += """<option value="%s" selected>%s MARC tag""" % (of, of) cell_1_right += """</select>""" ## okay, formats ended cell_1_middle = """<small><strong>Display results:</strong></small><br> <select name="rg"> <option value="10"%s>10 results <option value="25"%s>25 results <option value="50"%s>50 results <option value="100"%s>100 results <option value="250"%s>250 results <option value="500"%s>500 results </select> <select name="sc"> <option value="0"%s>grouped together <option value="1"%s>split by collection </select> """ % (is_selected(rg,"10"), is_selected(rg,"25"), is_selected(rg,"50"), \ is_selected(rg,"100"), is_selected(rg,"250"), is_selected(rg,"500"),\ is_selected(sc,"0"), is_selected(sc,"1")) out += """ <tr> <td valign="top"> <table><tr valign="top"><td>%s</td><td>%s</td><td>%s</td></tr></table> </td> </tr>""" % (cell_1_left, cell_1_middle, cell_1_right) # print end of search box: out += """</table></form> """ return out | 03e310531e299959e23e689e2221361a7aa1e6d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/03e310531e299959e23e689e2221361a7aa1e6d6/search_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
3072,
67,
2147,
12,
952,
16,
645,
3251,
16,
293,
16,
284,
16,
14524,
16,
9033,
16,
1427,
16,
1694,
16,
434,
16,
15835,
16,
487,
16,
293,
21,
16,
284,
21,
16,
312,
21,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
3072,
67,
2147,
12,
952,
16,
645,
3251,
16,
293,
16,
284,
16,
14524,
16,
9033,
16,
1427,
16,
1694,
16,
434,
16,
15835,
16,
487,
16,
293,
21,
16,
284,
21,
16,
312,
21,
16... |
def test_tee(self): a = [] p, q = t = tee([a]*2) a += [a, p, q, t] p.next() del a, p, q, t | def test_starmap(self): a = [] self.makecycle(starmap(lambda *t: t, [(a,a)]*2), a) | ad983e79d6f215235d205245c2599620e33cf719 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ad983e79d6f215235d205245c2599620e33cf719/test_itertools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
10983,
1458,
12,
2890,
4672,
279,
273,
5378,
365,
18,
81,
581,
4578,
12,
10983,
1458,
12,
14661,
380,
88,
30,
268,
16,
306,
12,
69,
16,
69,
13,
5772,
22,
3631,
279,
13,
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,
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,
10983,
1458,
12,
2890,
4672,
279,
273,
5378,
365,
18,
81,
581,
4578,
12,
10983,
1458,
12,
14661,
380,
88,
30,
268,
16,
306,
12,
69,
16,
69,
13,
5772,
22,
3631,
279,
13,
2... | |
return cset | return cset, len(parents) > 0 | def parselogentry(orig_paths, revnum, author, date, message): self.ui.debug("parsing revision %d (%d changes)\n" % (revnum, len(orig_paths))) | c6a1068cdcfcb9641c61c95fff848144537955b7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11312/c6a1068cdcfcb9641c61c95fff848144537955b7/subversion.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
779,
1786,
717,
4099,
12,
4949,
67,
4481,
16,
5588,
2107,
16,
2869,
16,
1509,
16,
883,
4672,
365,
18,
4881,
18,
4148,
2932,
24979,
6350,
738,
72,
6142,
72,
3478,
5153,
82,
6,
738,
26... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
779,
1786,
717,
4099,
12,
4949,
67,
4481,
16,
5588,
2107,
16,
2869,
16,
1509,
16,
883,
4672,
365,
18,
4881,
18,
4148,
2932,
24979,
6350,
738,
72,
6142,
72,
3478,
5153,
82,
6,
738,
26... |
buildscript.execute(['autoreconf', '-i'], cwd=builddir, | buildscript.execute(['autoreconf', '-i'], cwd=srcdir, | def do_configure(self, buildscript): builddir = self.get_builddir(buildscript) if buildscript.config.buildroot and not os.path.exists(builddir): os.makedirs(builddir) buildscript.set_action(_('Configuring'), self) | b02b95d006e6e9ef7d8a114d17ce60a05ab9fb59 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4596/b02b95d006e6e9ef7d8a114d17ce60a05ab9fb59/autotools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
14895,
12,
2890,
16,
1361,
4263,
4672,
25666,
330,
449,
481,
273,
365,
18,
588,
67,
70,
89,
330,
449,
481,
12,
3510,
4263,
13,
309,
1361,
4263,
18,
1425,
18,
3510,
3085,
471... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
14895,
12,
2890,
16,
1361,
4263,
4672,
25666,
330,
449,
481,
273,
365,
18,
588,
67,
70,
89,
330,
449,
481,
12,
3510,
4263,
13,
309,
1361,
4263,
18,
1425,
18,
3510,
3085,
471... |
print "Error running pyrexc." sys.exit(ret) | print "sage: Error running pyrexc." sys.exit(1) | def process_pyrex_file(f, m): # This is a pyrex file, so process accordingly. g = os.path.splitext(f)[0] pyx_inst_file = '%s/%s'%(SITE_PACKAGES, f) if need_to_create(f, pyx_inst_file): print "%s --> %s"%(f, pyx_inst_file) os.system('cp %s %s 2>/dev/null'%(f, pyx_inst_file)) out_file = f[:-4] + ".c" if m.language == 'c++': out_file += 'pp' if need_to_create(f, out_file) or need_to_create(g + '.pxd', out_file): cmd = "pyrexc -I%s %s"%(os.getcwd(),f) print cmd ret = os.system(cmd) if ret != 0: print "Error running pyrexc." sys.exit(ret) # If the language for the extension is C++, # then move the resulting output file to have the correct extension. # (I don't know how to tell Pyrex to do this automatically.) if m.language == 'c++': os.system('mv %s.c %s'%(f[:-4], out_file)) return [out_file] | c9984711e01afe58262b21866d825167c82ee1de /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9417/c9984711e01afe58262b21866d825167c82ee1de/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
2074,
266,
92,
67,
768,
12,
74,
16,
312,
4672,
468,
1220,
353,
279,
2395,
266,
92,
585,
16,
1427,
1207,
15905,
18,
314,
273,
1140,
18,
803,
18,
4939,
408,
12,
74,
25146,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2074,
266,
92,
67,
768,
12,
74,
16,
312,
4672,
468,
1220,
353,
279,
2395,
266,
92,
585,
16,
1427,
1207,
15905,
18,
314,
273,
1140,
18,
803,
18,
4939,
408,
12,
74,
25146,
... |
raise Exception("Index out of bounds: %d" % (t)) | common.error("Index out of bounds: %d" % (t)) | def get_bookmark(tag, bookmarks): """Returns the bookmark(s) fitting 'tag'""" if str.isdigit(tag): t = int(tag) if 0 <= t < len(bookmarks): return [bookmarks[t]] else: raise Exception("Index out of bounds: %d" % (t)) possible = [] for t, dest in bookmarks: if t.startswith(tag): possible.append((t, dest)) return possible | 06fbc82b350f225a91c414fda3f96b5145ffaee2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12638/06fbc82b350f225a91c414fda3f96b5145ffaee2/pybookmark.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3618,
3355,
12,
2692,
16,
13696,
87,
4672,
3536,
1356,
326,
13696,
12,
87,
13,
23591,
296,
2692,
11,
8395,
309,
609,
18,
291,
11052,
12,
2692,
4672,
268,
273,
509,
12,
2692,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3618,
3355,
12,
2692,
16,
13696,
87,
4672,
3536,
1356,
326,
13696,
12,
87,
13,
23591,
296,
2692,
11,
8395,
309,
609,
18,
291,
11052,
12,
2692,
4672,
268,
273,
509,
12,
2692,
... |
before, decl, after = html[:m.start(1)], m.group(1), html[m.end(1):] m = re.search( r'''(?ui)\sversion\s*=\s*'([^']*)'|"([^"]*)"|([^\s<>]*)''', decl) if m: if m.group(1) is not None: g = 1 elif m.group(2) is not None: g = 2 else: g = 3 if re.match(r'1\.[0-9]+\Z', m.group(g)): version = m.group() else: raise ValidationError('Bad version in XML declaration', 0, 1, 1, []) return decl + before + after | enc = sniff_bom_encoding(xml) encode = codecs.lookup(enc).incrementalencoder().encode prefix = encode('') assert encode('''axz<?'"[]:()+*>'''*3)==encode('''axz<?'"[]:()+*>''')*3 L = lambda s: re.escape(encode(s)) group = lambda s: '(%s)' % s optional = lambda s: '(?:%s)?' % s oneof = lambda opts: '(?:%s)' % '|'.join(opts) charset = lambda s: oneof([L(c) for c in s]) all_until = lambda s: '(?:(?!%s).)*' % s caseless = lambda s: oneof([L(c.lower()) for c in s] + [L(c.upper()) for c in s]) upper = charset('ABCDEFGHIJKLMNOPQRSTUVWXYZ') lower = charset('abcdefghijklmnopqrstuvwxyz') digits = charset('0123456789') punc = charset('._-') Name = '(?:%s%s*)' % (oneof([upper, lower]), oneof([upper, lower, digits, punc])) Ss = charset(' \t\r\n')+'*' Sp = charset(' \t\r\n')+'+' VERSION = encode('version') ENCODING = encode('encoding') STANDALONE = encode('standalone') StartDecl = ''.join([prefix, Ss, L('<'), Ss, L('?'), Ss, oneof([L('xml'), L('xmL'), L('xMl'), L('xML'), L('Xml'), L('XmL'), L('XMl'), L('XML')])]) Attr = ''.join([group(Sp), group(Name), Ss, group(L('=')), Ss, oneof([ group(L('"')+all_until(oneof([L('"'), L('<'), L('>')]))+L('"')), group(L("'")+all_until(oneof([L("'"), L('<'), L('>')]))+L("'")), group(all_until(oneof([Sp, L('?'), L('<'), L('>')]))), ]) ]) Attr_re = re.compile(Attr, re.DOTALL) EndDecl = ''.join([group(Ss), oneof([''.join([L('?'), Ss, L('>')]), L('>')])]) EOS = r'\Z' m = re.match(StartDecl, xml) if m: pos = m.end() attrs = {} while 1: m2 = Attr_re.match(xml, pos) if m2: wspace, name, eq, dquoted, squoted, unquoted = m2.groups() if dquoted is not None: quotes = encode('"') n = len(quotes) value = dquoted[n:-n] elif squoted is not None: quotes = encode("'") n = len(quotes) value = squoted[n:-n] else: quotes = encode('"') value = unquoted if name in attrs: pass elif name==VERSION: m3 = re.match(Ss + group(L("1.") + digits) + Ss + EOS, value) if m3: attrs[name] = wspace + name + eq + quotes + m3.group(1) + quotes else: pass elif name==ENCODING: m3 = re.match(Ss + group(Name) + Ss + EOS, value) if m3: attrs[name] = wspace + name + eq + quotes + m3.group(1) + quotes else: pass elif name==STANDALONE: m3 = re.match( Ss + oneof([ group(oneof([ L('yes'), L('yeS'), L('yEs'), L('yES'), L('Yes'), L('YeS'), L('YEs'), L('YES')])), group(oneof([L('no'), L('nO'), L('No'), L('NO')])) ]) + Ss + EOS, value) if m3: yes, no = m3.groups() if yes: attrs[name] = wspace + name + eq + quotes + encode('yes') + quotes else: attrs[name] = wspace + name + eq + quotes + encode('no') + quotes else: pass else: pass pos = m2.end() else: break m4 = re.compile(EndDecl).match(xml, pos) if m4: return (prefix + encode('<?xml') + attrs.get(VERSION, encode(' version="%s"' % default_version)) + (attrs.get(ENCODING) if ENCODING in attrs else '') + (attrs.get(STANDALONE) if STANDALONE in attrs else '') + m4.group(1) + encode('?>') + xml[m4.end():]) else: m5 = re.compile(oneof([L('>'), L('<')])).search(xml, pos) if m5: if m5.group()==encode('>'): endpos = m5.end() else: endpos = m5.start() return xml[:m.start()] + xml[endpos:] else: return '' return xml | def fix_xmldecl(html): """Looks for an XML declaration near the start of html, cleans it up, and returns the adjusted version of html. Doesn't add a declaration if none was found.""" # FIXME: a) Unfinished, b) Won't work. Needs rewriting to start as a more # lenient sniff_encoding(). m = re.match(r'(?si)(?:\s+|<!--.*?-->)*(<\?xml\s[^>]*>\s*)', html) if not m: return html else: before, decl, after = html[:m.start(1)], m.group(1), html[m.end(1):] m = re.search( r'''(?ui)\sversion\s*=\s*'([^']*)'|"([^"]*)"|([^\s<>]*)''', decl) if m: if m.group(1) is not None: g = 1 elif m.group(2) is not None: g = 2 else: g = 3 if re.match(r'1\.[0-9]+\Z', m.group(g)): version = m.group() else: raise ValidationError('Bad version in XML declaration', 0, 1, 1, []) return decl + before + after | f1e2722fde16f8590e966d559bbe355f0df65883 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10679/f1e2722fde16f8590e966d559bbe355f0df65883/xhtmlify.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
67,
2902,
8840,
12,
2620,
4672,
3536,
20475,
364,
392,
3167,
8266,
13378,
326,
787,
434,
1729,
16,
1619,
634,
518,
731,
16,
471,
1135,
326,
13940,
1177,
434,
1729,
18,
9637,
82,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
67,
2902,
8840,
12,
2620,
4672,
3536,
20475,
364,
392,
3167,
8266,
13378,
326,
787,
434,
1729,
16,
1619,
634,
518,
731,
16,
471,
1135,
326,
13940,
1177,
434,
1729,
18,
9637,
82,
... |
if spec is None and policySpec in [None, 'DynamicPolicy', 'DesignatedWrapPolicy', 'DefaultPolicy']: | if spec is None: | def RegisterClasses(*classes, **flags): quiet = flags.has_key('quiet') and flags['quiet'] debugging = flags.has_key('debug') and flags['debug'] for cls in classes: clsid = cls._reg_clsid_ progID = _get(cls, '_reg_progid_') desc = _get(cls, '_reg_desc_', progID) spec = _get(cls, '_reg_class_spec_') verProgID = _get(cls, '_reg_verprogid_') defIcon = _get(cls, '_reg_icon_') threadingModel = _get(cls, '_reg_threading_', 'both') catids = _get(cls, '_reg_catids_', []) options = _get(cls, '_reg_options_', {}) policySpec = _get(cls, '_reg_policy_spec_') clsctx = _get(cls, '_reg_clsctx_') addPyComCat = not _get(cls, '_reg_disable_pycomcat_', 0) addnPath = None if debugging: # If the class has a debugging dispatcher specified, use it, otherwise # use our default dispatcher. dispatcherSpec = _get(cls, '_reg_debug_dispatcher_spec_') if dispatcherSpec is None: dispatcherSpec = "win32com.server.dispatcher.DispatcherWin32trace" # And remember the debugging flag as servers may wish to use it at runtime. debuggingDesc = "(for debugging)" options['Debugging'] = "1" else: dispatcherSpec = _get(cls, '_reg_dispatcher_spec_') debuggingDesc = "" options['Debugging'] = "0" if spec is None and policySpec in [None, 'DynamicPolicy', 'DesignatedWrapPolicy', 'DefaultPolicy']: # No class or policy has been specified (or a policy we know requires it!) # We assume sys.argv[0] holds the script name # so we build the info our-self. scriptDir = os.path.split(sys.argv[0])[0] if not scriptDir: scriptDir = "." # Use the win32api to find the case-sensitive name try: moduleName = os.path.splitext(win32api.FindFiles(sys.argv[0])[0][8])[0] except (IndexError, win32api.error): # Can't find the script file - the user must explicitely set the _reg_... attribute. raise TypeError, "Can't locate the script hosting the COM object - please set _reg_class_spec_ in your object" spec = moduleName + "." + cls.__name__ addnPath = win32api.GetFullPathName(scriptDir) RegisterServer(clsid, spec, desc, progID, verProgID, defIcon, threadingModel, policySpec, catids, options, addPyComCat, dispatcherSpec, clsctx, addnPath) if not quiet: print 'Registered:', progID or spec, debuggingDesc | 7782066b4f671edc87912d3860ee92d1fba06b58 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/992/7782066b4f671edc87912d3860ee92d1fba06b58/register.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5433,
4818,
30857,
4701,
16,
2826,
7133,
4672,
10902,
273,
2943,
18,
5332,
67,
856,
2668,
20380,
6134,
471,
2943,
3292,
20380,
3546,
10450,
273,
2943,
18,
5332,
67,
856,
2668,
4148,
6134,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5433,
4818,
30857,
4701,
16,
2826,
7133,
4672,
10902,
273,
2943,
18,
5332,
67,
856,
2668,
20380,
6134,
471,
2943,
3292,
20380,
3546,
10450,
273,
2943,
18,
5332,
67,
856,
2668,
4148,
6134,
... |
while not line.startswith('msgstr'): if not line: raise Exception('malformed file') source += unquote(line) line = self.lines.pop(0).strip() trad = line[8:-1] line = self.lines.pop(0).strip() while line: trad += unquote(line) line = self.lines.pop(0).strip() | if tmp_tnrs: type, name, res_id = tmp_tnrs.pop(0) for t, n, r in tmp_tnrs: self.tnrs.append((t, n, r, source, trad)) | def unquote(str): return str[1:-1].replace("\\n", "\n") \ .replace('\\"', "\"") | 78fce194caa14faf4eeca470e9c5be5da2cfa2e1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7397/78fce194caa14faf4eeca470e9c5be5da2cfa2e1/translate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25611,
12,
701,
4672,
327,
609,
63,
21,
30,
17,
21,
8009,
2079,
2932,
1695,
82,
3113,
1548,
82,
7923,
282,
521,
263,
2079,
2668,
27576,
2187,
11143,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25611,
12,
701,
4672,
327,
609,
63,
21,
30,
17,
21,
8009,
2079,
2932,
1695,
82,
3113,
1548,
82,
7923,
282,
521,
263,
2079,
2668,
27576,
2187,
11143,
13,
2,
-100,
-100,
-100,
-100,
-100... |
if p2: results_tmp = search_pattern(req, p2, f2, colls_to_search, m2) | if p2n: results_tmp = search_pattern(req, p2n, f2, colls_to_search, m2) | def perform_request_search(req=None, cc=cdsname, c=None, p="", f="", rg="10", sf="", so="d", sp="", of="hb", ot="", as="0", p1="", f1="", m1="", op1="", p2="", f2="", m2="", op2="", p3="", f3="", m3="", sc="0", jrec="0", id="-1", idb="-1", sysnb="", search="SEARCH", d1y="", d1m="", d1d="", d2y="", d2m="", d2d=""): """Perform search, without checking for authentication. Return list of recIDs found, if of=id. Otherwise create web page.""" # wash all passed arguments: cc = wash_url_argument(cc, 'str') p = wash_url_argument(p, 'str') f = wash_url_argument(f, 'str') rg = wash_url_argument(rg, 'int') sf = wash_url_argument(sf, 'str') so = wash_url_argument(so, 'str') sp = wash_url_argument(sp, 'string') of = wash_url_argument(of, 'str') if type(ot) is list: ot = string.join(ot,",") ot = wash_url_argument(ot, 'str') as = wash_url_argument(as, 'int') p1 = wash_url_argument(p1, 'str') f1 = wash_url_argument(f1, 'str') m1 = wash_url_argument(m1, 'str') op1 = wash_url_argument(op1, 'str') p2 = wash_url_argument(p2, 'str') f2 = wash_url_argument(f2, 'str') m2 = wash_url_argument(m2, 'str') op2 = wash_url_argument(op2, 'str') p3 = wash_url_argument(p3, 'str') f3 = wash_url_argument(f3, 'str') m3 = wash_url_argument(m3, 'str') sc = wash_url_argument(sc, 'int') jrec = wash_url_argument(jrec, 'int') id = wash_url_argument(id, 'int') idb = wash_url_argument(idb, 'int') sysnb = wash_url_argument(sysnb, 'int') search = wash_url_argument(search, 'str') d1y = wash_url_argument(d1y, 'str') d1m = wash_url_argument(d1m, 'str') d1d = wash_url_argument(d1d, 'str') d2y = wash_url_argument(d2y, 'str') d2m = wash_url_argument(d2m, 'str') d2d = wash_url_argument(d2d, 'str') day1, day2 = wash_dates(d1y, d1m, d1d, d2y, d2m, d2d) # deduce user id: uid = getUid(req) # start output if of.startswith('x'): # we are doing XML output: req.content_type = "text/xml" req.send_http_header() req.write("""<?xml version="1.0" encoding="UTF-8"?>\n""") if of.startswith("xm"): req.write("""<collection xmlns="http://www.loc.gov/MARC21/slim">\n""") else: req.write("""<collection>\n""") elif of.startswith('t') or str(of[0:3]).isdigit(): # we are doing plain text output: req.content_type = "text/plain" req.send_http_header() elif of == "id": # we are passing list of recIDs pass else: # we are doing HTML output: req.content_type = "text/html" req.send_http_header() # write header: req.write(create_header(cc, as, uid)) if sysnb or id>0: ## 1 - detailed record display if sysnb: # ALEPH sysnb is passed, so deduce MySQL id for the record: id = get_mysql_recid_from_aleph_sysno(sysnb) if of=="hb": of = "hd" if record_exists(id): if idb<=id: # sanity check idb=id+1 print_records(req, range(id,idb), -1, -9999, of, ot) else: # record does not exist if of.startswith("h"): (cc, colls_to_display, colls_to_search) = wash_colls(cc, c, sc) p = wash_pattern(p) f = wash_field(f) out = """<table width="100%%" cellspacing="0" cellpadding="0" border="0"> <tr valign="top"> <td> %s </td> <td class="pagestriperight"> %s </td> </tr> </table>""" % \ (create_search_box(cc, colls_to_display, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, d1y, d1m, d1d, d2y, d2m, d2d, search), create_google_box(p, f, p1, p2, p3)) req.write(out) print_warning(req, "Requested record does not seem to exist.", None, "<p>") elif search == "Browse": ## 2 - browse needed (cc, colls_to_display, colls_to_search) = wash_colls(cc, c, sc) p = wash_pattern(p) f = wash_field(f) # write search box: if of.startswith("h"): out = """<table width="100%%" cellspacing="0" cellpadding="0" border="0"> <tr valign="top"> <td> %s </td> <td class="pagestriperight"> %s </td> </tr> </table>""" % \ (create_search_box(cc, colls_to_display, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, d1y, d1m, d1d, d2y, d2m, d2d, search), create_google_box(p, f, p1, p2, p3)) req.write(out) if as==1 or (p1 or p2 or p3): browse_pattern(req, colls_to_search, p1, f1, rg) browse_pattern(req, colls_to_search, p2, f2, rg) browse_pattern(req, colls_to_search, p3, f3, rg) else: browse_pattern(req, colls_to_search, p, f, rg) else: ## 3 - search needed # wash passed collection arguments: (cc, colls_to_display, colls_to_search) = wash_colls(cc, c, sc) p = wash_pattern(p) f = wash_field(f) # write search box: if of.startswith("h"): out = """<table width="100%%" cellspacing="0" cellpadding="0" border="0"> <tr valign="top"> <td> %s </td> <td class="pagestriperight"> %s </td> </tr> </table>""" % \ (create_search_box(cc, colls_to_display, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, d1y, d1m, d1d, d2y, d2m, d2d, search), create_google_box(p, f, p1, p2, p3)) req.write(out) # run search: t1 = os.times()[4] if as == 1 or (p1 or p2 or p3): # 3A - advanced search results_final = search_pattern(req, "", "", colls_to_search) if p1: results_tmp = search_pattern(req, p1, f1, colls_to_search, m1) for coll in colls_to_search: # join results for first advanced search boxen results_final[coll].intersect(results_tmp[coll]) if p2: results_tmp = search_pattern(req, p2, f2, colls_to_search, m2) for coll in colls_to_search: # join results for first and second advanced search boxen if op1 == "a": # add results_final[coll].intersect(results_tmp[coll]) elif op1 == "o": # or results_final[coll].union(results_tmp[coll]) elif op1 == "n": # not results_final[coll].difference(results_tmp[coll]) else: print_warning(req, "Invalid set operation %s." % op1, "Error") if p3: results_tmp = search_pattern(req, p3, f3, colls_to_search, m3) for coll in colls_to_search: # join results for second and third advanced search boxen if op2 == "a": # add results_final[coll].intersect(results_tmp[coll]) elif op2 == "o": # or results_final[coll].union(results_tmp[coll]) elif op2 == "n": # not results_final[coll].difference(results_tmp[coll]) else: print_warning(req, "Invalid set operation %s." % op1, "Error") for coll in colls_to_search: results_final[coll].calculate_nbhits() else: # 3B - simple search search_cache_key = p+"@"+f+"@"+string.join(colls_to_search,",") if search_cache.has_key(search_cache_key): # is the result in search cache? results_final = search_cache[search_cache_key] else: results_final = search_pattern(req, p, f, colls_to_search) search_cache[search_cache_key] = results_final if len(search_cache) > cfg_search_cache_size: # is the cache full? (sanity cleaning) search_cache.clear() # search done; was there a time restriction? if yes, apply it now: if day1 != "": results_of_time_restriction = search_in_bibrec(day1, day2) for coll in colls_to_search: results_final[coll].intersect(results_of_time_restriction) results_final[coll].calculate_nbhits() t2 = os.times()[4] cpu_time = t2 - t1 # find total number of records found in each collection results_final_nb_total = 0 results_final_nb = {} for coll in colls_to_search: results_final_nb[coll] = results_final[coll]._nbhits results_final_nb_total += results_final_nb[coll] # was there at least one hit? if results_final_nb_total == 0: # nope, so try silently dash-slash-etc-less matches first: if as==1 or (p1 or p2 or p3): if re.search(r'\w[^a-zA-Z0-9]\w',p1) or \ re.search(r'\w[^a-zA-Z0-9]\w',p2) or \ re.search(r'\w[^a-zA-Z0-9]\w',p3): if p1.startswith('"') and p1.endswith('"'): # is it ACC query? p1 = re.sub(r'(\w)[^a-zA-Z0-9](\w)', "\\1_\\2", p1) else: # it is WRD query p1 = re.sub(r'(\w)[^a-zA-Z0-9](\w)', "\\1 \\2", p1) if p1.startswith('"') and p1.endswith('"'): # is it ACC query? p2 = re.sub(r'(\w)[^a-zA-Z0-9](\w)', "\\1_\\2", p2) else: # it is WRD query p2 = re.sub(r'(\w)[^a-zA-Z0-9](\w)', "\\1 \\2", p2) if p3.startswith('"') and p3.endswith('"'): # is it ACC query? p3 = re.sub(r'(\w)[^a-zA-Z0-9](\w)', "\\1_\\2", p3) else: # it is WRD query p3 = re.sub(r'(\w)[^a-zA-Z0-9](\w)', "\\1 \\2", p3) if of.startswith('h'): print_warning(req, "No match found, trying similar queries...", "", "<p>","<p>") results_final = search_pattern(req, "", "", colls_to_search) if p1: results_tmp = search_pattern(req, p1, f1, colls_to_search, m1) for coll in colls_to_search: # join results for first advanced search boxen results_final[coll].intersect(results_tmp[coll]) if p2: results_tmp = search_pattern(req, p2, f2, colls_to_search, m2) for coll in colls_to_search: # join results for first and second advanced search boxen if op1 == "a": # add results_final[coll].intersect(results_tmp[coll]) elif op1 == "o": # or results_final[coll].union(results_tmp[coll]) elif op1 == "n": # not results_final[coll].difference(results_tmp[coll]) else: print_warning(req, "Invalid set operation %s." % op1, "Error") if p3: results_tmp = search_pattern(req, p3, f3, colls_to_search, m3) for coll in colls_to_search: # join results for second and third advanced search boxen if op2 == "a": # add results_final[coll].intersect(results_tmp[coll]) elif op2 == "o": # or results_final[coll].union(results_tmp[coll]) elif op2 == "n": # not results_final[coll].difference(results_tmp[coll]) else: print_warning(req, "Invalid set operation %s." % op1, "Error") for coll in colls_to_search: results_final[coll].calculate_nbhits() results_final_nb[coll] = results_final[coll]._nbhits results_final_nb_total += results_final_nb[coll] else: if re.search(r'\w[^a-zA-Z0-9]\w',p): if p.startswith('"') and p.endswith('"'): # is it ACC query? p = re.sub(r'(\w)[^a-zA-Z0-9](\w)', "\\1_\\2", p) else: # it is WRD query p = re.sub(r'(\w)[^a-zA-Z0-9](\w)', "\\1 \\2", p) if of.startswith('h'): print_warning(req, "No match found, trying %s..." % p, "", "<p>","<p>") results_final = search_pattern(req, p, f, colls_to_search, None) for coll in colls_to_search: results_final_nb[coll] = results_final[coll]._nbhits results_final_nb_total += results_final_nb[coll] # once again, was there at least one hit? if results_final_nb_total == 0: # nope, so try similar queries: if of.startswith('h'): print_warning(req, "No match found, trying similar queries...", "", "<p>","<p>") req.write("<p>") if as==1 or (p1 or p2 or p3): if p1: search_pattern(req, p1, f1, colls_to_search, m1, 1) if p2: search_pattern(req, p2, f2, colls_to_search, m2, 1) if p3: search_pattern(req, p3, f3, colls_to_search, m3, 1) else: search_pattern(req, p, f, colls_to_search, None, 1) else: # yes, some hits found, so print results overview: if of == "id": # we have been asked to return list of recIDs results_final_for_all_colls = HitList() for coll in colls_to_search: results_final_for_all_colls.union(results_final[coll]) return results_final_for_all_colls.items() elif of.startswith("h"): req.write(print_results_overview(colls_to_search, results_final_nb_total, results_final_nb, cpu_time)) # print records: if len(colls_to_search)>1: cpu_time = -1 # we do not want to have search time printed on each collection for coll in colls_to_search: if results_final[coll]._nbhits: if of.startswith("h"): req.write(print_search_info(p, f, sf, so, sp, of, ot, coll, results_final_nb[coll], jrec, rg, as, p1, p2, p3, f1, f2, f3, m1, m2, m3, op1, op2, d1y, d1m, d1d, d2y, d2m, d2d, cpu_time)) results_final_sorted = results_final[coll].items() if sf: results_final_sorted = sort_records(req, results_final_sorted, sf, so, sp) print_records(req, results_final_sorted, jrec, rg, of, ot) if of.startswith("h"): req.write(print_search_info(p, f, sf, so, sp, of, ot, coll, results_final_nb[coll], jrec, rg, as, p1, p2, p3, f1, f2, f3, m1, m2, m3, op1, op2, d1y, d1m, d1d, d2y, d2m, d2d, cpu_time, 1)) # log query: try: log_query(req.get_remote_host(), req.args, uid) except: # do not log query if req is None (used by CLI interface) pass log_query_info("ss", p, f, colls_to_search, results_final_nb_total) # 4 -- write footer: if of.startswith('h'): req.write(create_footer()) elif of.startswith('x'): req.write("""</collection>\n""") # 5 - return value if of == "id": return [] else: return "\n" | 9abc6750025b014a8ac519a428db93e9918f7e41 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/9abc6750025b014a8ac519a428db93e9918f7e41/search_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
2293,
67,
3072,
12,
3658,
33,
7036,
16,
4946,
33,
71,
2377,
529,
16,
276,
33,
7036,
16,
293,
1546,
3113,
284,
1546,
3113,
14524,
1546,
2163,
3113,
9033,
1546,
3113,
1427,
154... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
2293,
67,
3072,
12,
3658,
33,
7036,
16,
4946,
33,
71,
2377,
529,
16,
276,
33,
7036,
16,
293,
1546,
3113,
284,
1546,
3113,
14524,
1546,
2163,
3113,
9033,
1546,
3113,
1427,
154... |
self.canv.setFont("Helvetica", utils.unit_get(8)) | self.canv.setFont("Helvetica", utils.unit_get(str(8))) | def draw(self): self.canv.beginForm("pageCount") self.canv.setFont("Helvetica", utils.unit_get(8)) self.canv.drawString(0, 0, str(self.canv.getPageNumber())) self.canv.endForm() | 54a8a7600cd0d455897ab0bfff6b52a37ad93f5d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12853/54a8a7600cd0d455897ab0bfff6b52a37ad93f5d/trml2pdf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
12,
2890,
4672,
365,
18,
4169,
90,
18,
10086,
1204,
2932,
2433,
1380,
7923,
365,
18,
4169,
90,
18,
542,
5711,
2932,
44,
292,
90,
7943,
69,
3113,
2990,
18,
4873,
67,
588,
12,
70... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
12,
2890,
4672,
365,
18,
4169,
90,
18,
10086,
1204,
2932,
2433,
1380,
7923,
365,
18,
4169,
90,
18,
542,
5711,
2932,
44,
292,
90,
7943,
69,
3113,
2990,
18,
4873,
67,
588,
12,
70... |
if _have_threads: test_support.threading_cleanup(*thread_info) | def test_main(verbose=False): if skip_expected: raise test_support.TestSkipped("No SSL support") global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir, "keycert.pem") SVN_PYTHON_ORG_ROOT_CERT = os.path.join( os.path.dirname(__file__) or os.curdir, "https_svn_python_org_root.pem") if (not os.path.exists(CERTFILE) or not os.path.exists(SVN_PYTHON_ORG_ROOT_CERT)): raise test_support.TestFailed("Can't read certificate files!") TESTPORT = test_support.find_unused_port() if not TESTPORT: raise test_support.TestFailed("Can't find open port to test servers on!") tests = [BasicTests] #if test_support.is_resource_enabled('network'): tests.append(NetworkedTests) #if _have_threads: # thread_info = test_support.threading_setup() # if thread_info and test_support.is_resource_enabled('network'): tests.append(ThreadedTests) test_support.run_unittest(*tests) if _have_threads: test_support.threading_cleanup(*thread_info) | 204bcd24c3280e35a44d1f0aa60729558b712e40 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10423/204bcd24c3280e35a44d1f0aa60729558b712e40/test_ssl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5254,
12,
11369,
33,
8381,
4672,
309,
2488,
67,
3825,
30,
1002,
1842,
67,
13261,
18,
4709,
16425,
2932,
2279,
7419,
2865,
7923,
225,
2552,
25423,
3776,
16,
29537,
50,
67,
16235... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5254,
12,
11369,
33,
8381,
4672,
309,
2488,
67,
3825,
30,
1002,
1842,
67,
13261,
18,
4709,
16425,
2932,
2279,
7419,
2865,
7923,
225,
2552,
25423,
3776,
16,
29537,
50,
67,
16235... | |
('Green', (u'Green'), 120), | ('Green', _(u'Green'), 120), | def setValues(self, **kwds): | 0ac41855e105c8a7a719da383d58cbdf2913d2d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/0ac41855e105c8a7a719da383d58cbdf2913d2d7/usercollections.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
27466,
12,
2890,
16,
2826,
25577,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
27466,
12,
2890,
16,
2826,
25577,
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,
-... |
self.notify_client('progress', pos, len(changed), item.url) | self.notify_client('progress', pos+1, len(changed), item.url) | def _initial_scan(self, first_call): """ Start scanning the current list of items if they need to be updated. With a full structure covered by inotify, there should be not changes. """ self._checking = True changed = [] | a6e38e90792674ad624f8179f4427952f5e1e2a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11703/a6e38e90792674ad624f8179f4427952f5e1e2a8/monitor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6769,
67,
9871,
12,
2890,
16,
1122,
67,
1991,
4672,
3536,
3603,
21138,
326,
783,
666,
434,
1516,
309,
2898,
1608,
358,
506,
3526,
18,
3423,
279,
1983,
3695,
18147,
635,
316,
352,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
389,
6769,
67,
9871,
12,
2890,
16,
1122,
67,
1991,
4672,
3536,
3603,
21138,
326,
783,
666,
434,
1516,
309,
2898,
1608,
358,
506,
3526,
18,
3423,
279,
1983,
3695,
18147,
635,
316,
352,
... |
my_wh='' if profile != '': | if profile != '' : | def waybill_search(request): profile = '' try: profile=request.user.get_profile() except: pass search_string = request.GET['wbnumber'] found_wb='' found_wb = Waybill.objects.filter(waybillNumber__icontains=search_string) my_valid_wb=[] my_wh='' if profile != '': for waybill in found_wb: if profile.isCompasUser: my_valid_wb.append(waybill.id) if profile.warehouses and waybill.loadingdetail_set.select_related()[0].siNo.ORIGIN_WH_CODE == profile.warehouses.ORIGIN_WH_CODE: my_valid_wb.append(waybill.id) if profile.receptionPoints and waybill.loadingdetail_set.select_related()[0].siNo.CONSEGNEE_CODE == profile.receptionPoints.CONSEGNEE_CODE and waybill.loadingdetail_set.select_related()[0].siNo.DESTINATION_LOC_NAME == profile.receptionPoints.LOC_NAME : my_valid_wb.append(waybill.id) return render_to_response('list_waybills.html', {'waybill_list':found_wb,'profile':profile, 'my_wb':my_valid_wb}, context_instance=RequestContext(request)) | fbb98ab79c16ccad0c9df4e533d087a0f148c01f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12559/fbb98ab79c16ccad0c9df4e533d087a0f148c01f/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4031,
17240,
67,
3072,
12,
2293,
4672,
3042,
273,
875,
775,
30,
3042,
33,
2293,
18,
1355,
18,
588,
67,
5040,
1435,
1335,
30,
1342,
1623,
67,
1080,
273,
225,
590,
18,
3264,
3292,
9464,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4031,
17240,
67,
3072,
12,
2293,
4672,
3042,
273,
875,
775,
30,
3042,
33,
2293,
18,
1355,
18,
588,
67,
5040,
1435,
1335,
30,
1342,
1623,
67,
1080,
273,
225,
590,
18,
3264,
3292,
9464,
... |
if xsource.find('Recommended').text is not None: | if xsource.find('Recommended').text == 'true': | def source_from_xml(xsource): ret = dict([('rawurl', False), ('url', False)]) for key, tag in [('groups', 'Group'), ('components', 'Component'), ('arches', 'Arch'), ('blacklist', 'Blacklist')]: ret[key] = [item.text for item in xsource.findall(tag)] # version and component need to both contain data for sources to work try: ret['version'] = xsource.find('Version').text except: ret['version'] = 'placeholder' if ret['components'] == []: ret['components'] = ['placeholder'] try: if xsource.find('Recommended').text is not None: ret['recommended'] = True except: ret['recommended'] = False if xsource.find('RawURL') is not None: ret['rawurl'] = xsource.find('RawURL').text if not ret['rawurl'].endswith('/'): ret['rawurl'] += '/' else: ret['url'] = xsource.find('URL').text if not ret['url'].endswith('/'): ret['url'] += '/' return ret | 665456d89a54c6b5ec3f534a3ce1105df9a3b6e4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/665456d89a54c6b5ec3f534a3ce1105df9a3b6e4/Packages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1084,
67,
2080,
67,
2902,
12,
92,
3168,
4672,
325,
273,
2065,
3816,
2668,
1899,
718,
2187,
1083,
3631,
7707,
718,
2187,
1083,
13,
5717,
364,
498,
16,
1047,
316,
306,
2668,
4650,
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,
1084,
67,
2080,
67,
2902,
12,
92,
3168,
4672,
325,
273,
2065,
3816,
2668,
1899,
718,
2187,
1083,
3631,
7707,
718,
2187,
1083,
13,
5717,
364,
498,
16,
1047,
316,
306,
2668,
4650,
2187,
... |
self.is_sync_target = self.peer_sync_source = self.cstatus == "SyncTarget" self.peer_sync_target = self.is_sync_source = self.cstatus == "SyncSource" self.is_resync = self.is_sync_target or self.is_sync_source | def __init__(self, procline): u = self.UNCONF_RE.match(procline) if u: self.cstatus = "Unconfigured" self.lrole = self.rrole = self.ldisk = self.rdisk = None else: m = self.LINE_RE.match(procline) if not m: raise errors.BlockDeviceError("Can't parse input data '%s'" % procline) self.cstatus = m.group(1) self.lrole = m.group(2) self.rrole = m.group(3) self.ldisk = m.group(4) self.rdisk = m.group(5) | 3c003d9d4dd677407fb0361a7eefa3307ee75f3b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7542/3c003d9d4dd677407fb0361a7eefa3307ee75f3b/bdev.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
450,
830,
558,
4672,
582,
273,
365,
18,
2124,
14497,
67,
862,
18,
1916,
12,
685,
830,
558,
13,
309,
582,
30,
365,
18,
71,
2327,
273,
315,
984,
16449,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
450,
830,
558,
4672,
582,
273,
365,
18,
2124,
14497,
67,
862,
18,
1916,
12,
685,
830,
558,
13,
309,
582,
30,
365,
18,
71,
2327,
273,
315,
984,
16449,
... | |
:param (inputs,outputs): inputs and outputs Theano variables that describe the function that is applied recursively :param n_seqs: number of sequences over which scan will have to iterate | :param (inputs,outputs, givens): inputs and outputs Theano variables that describe the function that is applied recursively; givens list is used to replace shared variables with not shared ones :param n_seqs: number of sequences over which scan will have to iterate | def __init__(self,(inputs, outputs, givens),n_seqs, n_outs, inplace_map={}, seqs_taps={}, outs_taps={}, truncate_gradient = -1, go_backwards = False, stored_steps_output = {}, mode = 'FAST_RUN', inplace=False): ''' :param (inputs,outputs): inputs and outputs Theano variables that describe the function that is applied recursively | a5641dce66ebdee57597525bd6e0453c1896ea93 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/a5641dce66ebdee57597525bd6e0453c1896ea93/scan.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
12,
10029,
16,
6729,
16,
314,
427,
773,
3631,
82,
67,
22437,
16,
225,
290,
67,
20125,
16,
11783,
67,
1458,
28793,
19472,
67,
88,
6679,
28793,
28266,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
12,
10029,
16,
6729,
16,
314,
427,
773,
3631,
82,
67,
22437,
16,
225,
290,
67,
20125,
16,
11783,
67,
1458,
28793,
19472,
67,
88,
6679,
28793,
28266,
67,
... |
raise ValueError, "I/O operation on closed file" | raise ValueError("I/O operation on closed file") | def __iter__(self): """Get an iterator over the file object. """ if self.closed: raise ValueError, "I/O operation on closed file" return self | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2165,
972,
12,
2890,
4672,
3536,
967,
392,
2775,
1879,
326,
585,
733,
18,
3536,
309,
365,
18,
12204,
30,
1002,
2068,
2932,
45,
19,
51,
1674,
603,
4375,
585,
7923,
327,
365,
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,
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,
2165,
972,
12,
2890,
4672,
3536,
967,
392,
2775,
1879,
326,
585,
733,
18,
3536,
309,
365,
18,
12204,
30,
1002,
2068,
2932,
45,
19,
51,
1674,
603,
4375,
585,
7923,
327,
365,
2,
... |
self._treeview.setSelectionMode(qt.QListView.Multi) | self._treeview.setSelectionMode(qt.QListView.Extended) | def __init__(self, parent=None): qt.QWidget.__init__(self, parent) | b7dad206b13fefdffe44c68239062d45107c700c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8317/b7dad206b13fefdffe44c68239062d45107c700c/packageview.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
33,
7036,
4672,
25672,
18,
53,
4609,
16186,
2738,
972,
12,
2890,
16,
982,
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,
0,
0,
0,
0,
0,
0,
0,
0,
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,
33,
7036,
4672,
25672,
18,
53,
4609,
16186,
2738,
972,
12,
2890,
16,
982,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
c.execute("""select sum(if(field_name = '%s', 1, 0)) as present, | c.execute(""" select sum(if(field_name = '%s', 1, 0)) as present, | def addDefaultPerms(field, user, group): c.execute("""select sum(if(field_name = '%s', 1, 0)) as present, | 61b80bc872aa4d15c4f67dfd48cbcb289757f094 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/750/61b80bc872aa4d15c4f67dfd48cbcb289757f094/schoolyearifyperms.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
28297,
27256,
12,
1518,
16,
729,
16,
1041,
4672,
276,
18,
8837,
2932,
3660,
4025,
2142,
12,
430,
12,
1518,
67,
529,
273,
1995,
87,
2187,
404,
16,
374,
3719,
487,
3430,
16,
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,
28297,
27256,
12,
1518,
16,
729,
16,
1041,
4672,
276,
18,
8837,
2932,
3660,
4025,
2142,
12,
430,
12,
1518,
67,
529,
273,
1995,
87,
2187,
404,
16,
374,
3719,
487,
3430,
16,
2,
-100,
-... |
self.__passcode = crypt.crypt(passcode, self.__salt) | self.__passcode = crypt.crypt(passcode, self.salt()) | def __init__(self, name, notebook, id, system=None, passcode = ''): name = ' '.join(name.split()) self.__id = id self.__system = system self.__next_id = (_notebook.MAX_WORKSHEETS) * id self.__name = name self.__notebook = notebook self.__passcode = crypt.crypt(passcode, self.__salt) self.__passcrypt= True dir = list(name) for i in range(len(dir)): if not dir[i].isalnum() and dir[i] != '_': dir[i]='_' dir = ''.join(dir) self.__filename = dir self.__dir = '%s/%s'%(notebook.worksheet_directory(), dir) while os.path.exists(self.__dir): self.__dir += "_" self.__filename += '_' self.__comp_is_running = False if not os.path.exists(self.__dir): os.makedirs(self.__dir) self.__queue = [] self.__cells = [ ] for i in range(INITIAL_NUM_CELLS): self.append_new_cell() | 4102657e010332c47a5c3624c8af675eba64b8b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9417/4102657e010332c47a5c3624c8af675eba64b8b3/worksheet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
508,
16,
14718,
16,
612,
16,
2619,
33,
7036,
16,
1342,
710,
273,
875,
4672,
508,
273,
296,
2418,
5701,
12,
529,
18,
4939,
10756,
365,
16186,
350,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
508,
16,
14718,
16,
612,
16,
2619,
33,
7036,
16,
1342,
710,
273,
875,
4672,
508,
273,
296,
2418,
5701,
12,
529,
18,
4939,
10756,
365,
16186,
350,
273,
... |
fixUpSMIGlobs(portal, out) | fixUpSMIGlobs(portal, out, reinit=False) | def installMimetypesRegistry(portal): out = StringIO() fixUpSMIGlobs(portal, out) | 2ec5bc2902f1f2013bb80c11ad9ce8723fbdcfc8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12163/2ec5bc2902f1f2013bb80c11ad9ce8723fbdcfc8/setuphandlers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3799,
49,
381,
15180,
4243,
12,
24386,
4672,
596,
273,
15777,
1435,
225,
2917,
1211,
7303,
3047,
1295,
87,
12,
24386,
16,
596,
16,
283,
2738,
33,
8381,
13,
282,
2,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3799,
49,
381,
15180,
4243,
12,
24386,
4672,
596,
273,
15777,
1435,
225,
2917,
1211,
7303,
3047,
1295,
87,
12,
24386,
16,
596,
16,
283,
2738,
33,
8381,
13,
282,
2,
-100,
-100,
-100,
-1... |
return SymbolicConstant( operator.mul(self._obj, right._obj) ) | constants = isinstance(self._obj, sage.functions.constants.Constant) or isinstance(right._obj, sage.functions.constants.Constant) if not constants: return SymbolicConstant( operator.mul(self._obj, right._obj) ) | def _mul_(self, right): """ EXAMPLES: sage: SR = SymbolicExpressionRing() sage: a = SR(2) sage: b = a*2; b 4 sage: type(b) <class 'sage.calculus.calculus.SymbolicConstant'> sage: prod([a for i in range(1000)]) 10715086071862673209484250490600018105614048117055336074437503883703510511249361224931983788156958581275946729175531468251871452856923140435984577574698574803934567774824230985421074605062371141877954182153046474983581941267398767559165543946077062914571196477686542167660429831652624386837205668069376 sage: type(_) <class 'sage.calculus.calculus.SymbolicConstant'> """ if isinstance(right, SymbolicConstant): try: self_parent = self._obj.parent() right_parent = right._obj.parent() if self_parent != SR and right_parent != SR and ( self_parent.has_coerce_map_from(right_parent) or right_parent.has_coerce_map_from(self_parent) ): return SymbolicConstant( operator.mul(self._obj, right._obj) ) except AttributeError: #Either self._obj or right._obj doesn't have a #parent method (like 'int' or 'float') return SymbolicConstant( operator.mul(self._obj, right._obj) ) | 6592ce23b20d7ce956e19700b128a23ad5941665 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/6592ce23b20d7ce956e19700b128a23ad5941665/calculus.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
16411,
67,
12,
2890,
16,
2145,
4672,
3536,
5675,
8900,
11386,
30,
272,
410,
30,
19145,
273,
16455,
12164,
2300,
10369,
1435,
272,
410,
30,
279,
273,
19145,
12,
22,
13,
272,
410,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
16411,
67,
12,
2890,
16,
2145,
4672,
3536,
5675,
8900,
11386,
30,
272,
410,
30,
19145,
273,
16455,
12164,
2300,
10369,
1435,
272,
410,
30,
279,
273,
19145,
12,
22,
13,
272,
410,
3... |
print ('Removed tag %s from object %s\n' | print('Removed tag %s from object %s\n' | def execute_untag_command (objs, db, tags, options): actions = { 'id': db.untag_object_by_id, 'about': db.untag_object_by_about, } for obj in objs: description = describe_by_mode(obj.specifier, obj.mode) for tag in tags: o = actions[obj.mode](obj.specifier, tag) if o == 0: if options.verbose: print ('Removed tag %s from object %s\n' % (tag, description)) else: warning ('Failed to remove tag %s from object %s' % (tag, description)) warning ('Error code %d' % o) | e75848841ac96982524448e932e12fd6ff9cbe0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12637/e75848841ac96982524448e932e12fd6ff9cbe0c/fdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
67,
318,
2692,
67,
3076,
261,
18093,
16,
1319,
16,
2342,
16,
702,
4672,
4209,
273,
288,
296,
350,
4278,
1319,
18,
318,
2692,
67,
1612,
67,
1637,
67,
350,
16,
296,
21071,
4278,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
67,
318,
2692,
67,
3076,
261,
18093,
16,
1319,
16,
2342,
16,
702,
4672,
4209,
273,
288,
296,
350,
4278,
1319,
18,
318,
2692,
67,
1612,
67,
1637,
67,
350,
16,
296,
21071,
4278,
... |
cert.set_pubkey(EVP.PKey(pkey)) cert.set_pubkey(EVP.PKey(cert.get_pubkey())) | cert.set_pubkey(pkey) | def makeCert(req, caPkey): pkey = req.get_pubkey() #woop = makePKey(generateRSAKey()) #if not req.verify(woop.pkey): if not req.verify(pkey): # XXX What error object should I use? raise ValueError, 'Error verifying request' sub = req.get_subject() # If this were a real certificate request, you would display # all the relevant data from the request and ask a human operator # if you were sure. Now we just create the certificate blindly based # on the request. cert = X509.X509() # We know we are making CA cert now... # Serial defaults to 0. cert.set_serial_number(1) cert.set_version(2) cert.set_subject(sub) issuer = X509.X509_Name() issuer.CN = 'The Issuer Monkey' issuer.O = 'The Organization Otherwise Known as My CA, Inc.' cert.set_issuer(issuer) cert.set_pubkey(EVP.PKey(pkey)) cert.set_pubkey(EVP.PKey(cert.get_pubkey()))# Just a test of the API notBefore = m2.x509_get_not_before(cert.x509) notAfter = m2.x509_get_not_after(cert.x509) m2.x509_gmtime_adj(notBefore, 0) days = 30 m2.x509_gmtime_adj(notAfter, 60*60*24*days) cert.add_ext( X509.new_extension('subjectAltName', 'DNS:foobar.example.com')) ext = X509.new_extension('nsComment', 'M2Crypto generated certificate') ext.set_critical(0)# Defaults to non-critical, but we can also set it cert.add_ext(ext) cert.sign(caPkey, 'sha1') assert(cert.get_ext('subjectAltName').get_name() == 'subjectAltName') assert(cert.get_ext_at(0).get_name() == 'subjectAltName') assert(cert.get_ext_at(0).get_value() == 'DNS:foobar.example.com') return cert | b7b6a08b9b07c9e34da8572d7617ba460e12d92b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8055/b7b6a08b9b07c9e34da8572d7617ba460e12d92b/ca.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
5461,
12,
3658,
16,
3474,
52,
856,
4672,
19291,
273,
1111,
18,
588,
67,
23428,
1435,
468,
6933,
556,
273,
1221,
52,
653,
12,
7163,
15248,
653,
10756,
468,
430,
486,
1111,
18,
870... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
5461,
12,
3658,
16,
3474,
52,
856,
4672,
19291,
273,
1111,
18,
588,
67,
23428,
1435,
468,
6933,
556,
273,
1221,
52,
653,
12,
7163,
15248,
653,
10756,
468,
430,
486,
1111,
18,
870... |
def readConfigFile(filename, includePath, cachedir): | def readConfigFile(filename, includePath, cachedir, traceable): | def readConfigFile(filename, includePath, cachedir): # Read the config file. conf = Configuration(filename, includePath) # Now read IDL files to connect the information in the config file to # actual XPCOM interfaces, methods, and attributes. interfaces = [] interfacesByName = {} parser = xpidl.IDLParser(cachedir) def getInterface(interfaceName, errorLoc): iface = interfacesByName.get(interfaceName) if iface is None: idlFile = findIDL(conf.includePath, conf.irregularFilenames, interfaceName) idl = loadIDL(parser, conf.includePath, idlFile) if not idl.hasName(interfaceName): raise UserError("The interface %s was not found " "in the idl file %r." % (interfaceName, idlFile)) iface = idl.getName(interfaceName, errorLoc) iface.stubMembers = [] interfaces.append(iface) interfacesByName[interfaceName] = iface return iface for memberId in conf.members: interfaceName, memberName = parseMemberId(memberId) iface = getInterface(interfaceName, errorLoc='looking for %r' % memberId) if not iface.attributes.scriptable: raise UserError("Interface %s is not scriptable. " "IDL file: %r." % (interfaceName, idlFile)) if memberName == '*': # Stub all scriptable members of this interface. for member in iface.members: if member.kind in ('method', 'attribute') and not member.noscript: addStubMember(iface.name + '.' + member.name, member) else: # Look up a member by name. if memberName not in iface.namemap: idlFile = iface.idl.parser.lexer.filename raise UserError("Interface %s has no member %r. " "(See IDL file %r.)" % (interfaceName, memberName, idlFile)) member = iface.namemap.get(memberName, None) if member in iface.stubMembers: raise UserError("Member %s is specified more than once." % memberId) addStubMember(memberId, member) return conf, interfaces | c14e4ffd79d3b97514ad112cb46c7dbd495ad99b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11102/c14e4ffd79d3b97514ad112cb46c7dbd495ad99b/qsgen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
13705,
12,
3459,
16,
2341,
743,
16,
3472,
481,
16,
2606,
429,
4672,
468,
2720,
326,
642,
585,
18,
2195,
273,
4659,
12,
3459,
16,
2341,
743,
13,
225,
468,
4494,
855,
1599,
48,
13... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
13705,
12,
3459,
16,
2341,
743,
16,
3472,
481,
16,
2606,
429,
4672,
468,
2720,
326,
642,
585,
18,
2195,
273,
4659,
12,
3459,
16,
2341,
743,
13,
225,
468,
4494,
855,
1599,
48,
13... |
if co_filename in ('rpc.py', '<string>'): | if co_filename in (r'.\rpc.py', 'rpc.py','<string>'): | def user_line(self, frame): # get the currently executing function ##print>>sys.__stderr__, "*function: ", frame.f_code.co_name ##print>>sys.__stderr__, "*file: ", frame.f_code.co_filename ##print>>sys.__stderr__, "*line number: ", frame.f_code.co_firstlineno co_filename = frame.f_code.co_filename co_name = frame.f_code.co_name try: func = frame.f_locals[co_name] if getattr(func, "DebuggerStepThrough", 0): print "XXXX DEBUGGER STEPPING THROUGH" self.set_step() return except: pass if co_filename in ('rpc.py', '<string>'): self.set_step() return if co_filename.endswith('threading.py'): self.set_step() return message = self.__frame2message(frame) self.gui.interaction(message, frame) | 067d734f9e54fa7685ab9bd44e2221c04a52f292 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/067d734f9e54fa7685ab9bd44e2221c04a52f292/Debugger.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
729,
67,
1369,
12,
2890,
16,
2623,
4672,
468,
336,
326,
4551,
11274,
445,
7541,
1188,
9778,
9499,
16186,
11241,
972,
16,
15902,
915,
30,
3104,
2623,
18,
74,
67,
710,
18,
2894,
67,
529,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
729,
67,
1369,
12,
2890,
16,
2623,
4672,
468,
336,
326,
4551,
11274,
445,
7541,
1188,
9778,
9499,
16186,
11241,
972,
16,
15902,
915,
30,
3104,
2623,
18,
74,
67,
710,
18,
2894,
67,
529,... |
"can't translate character '\\uffff' in position 1: ouch" | "can't translate character u'\\uffff' in position 1: ouch" | def test_unicodetranslateerror(self): self.check_exceptionobjectargs( UnicodeTranslateError, [u"g\xfcrk", 1, 2, "ouch"], "can't translate character '\\xfc' in position 1: ouch" ) self.check_exceptionobjectargs( UnicodeTranslateError, [u"g\u0100rk", 1, 2, "ouch"], "can't translate character '\\u0100' in position 1: ouch" ) self.check_exceptionobjectargs( UnicodeTranslateError, [u"g\uffffrk", 1, 2, "ouch"], "can't translate character '\\uffff' in position 1: ouch" ) if sys.maxunicode > 0xffff: self.check_exceptionobjectargs( UnicodeTranslateError, [u"g\U00010000rk", 1, 2, "ouch"], "can't translate character '\\U00010000' in position 1: ouch" ) self.check_exceptionobjectargs( UnicodeTranslateError, [u"g\xfcrk", 1, 3, "ouch"], "can't translate characters in position 1-2: ouch" ) | c174bbc23ec4b576d8279cce618b3d4931989635 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c174bbc23ec4b576d8279cce618b3d4931989635/test_codeccallbacks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
318,
335,
369,
16354,
634,
20293,
1636,
12,
2890,
4672,
365,
18,
1893,
67,
4064,
1612,
1968,
12,
9633,
12818,
668,
16,
306,
89,
6,
75,
64,
5841,
3353,
79,
3113,
404,
16,
57... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
318,
335,
369,
16354,
634,
20293,
1636,
12,
2890,
4672,
365,
18,
1893,
67,
4064,
1612,
1968,
12,
9633,
12818,
668,
16,
306,
89,
6,
75,
64,
5841,
3353,
79,
3113,
404,
16,
57... |
raise BadValue("accepts only values in %s" % self.list, | raise BadValue("accepts only values in %s" % repr(self.list), | def __call__(self, obj, col, value): if value not in self.list: raise BadValue("accepts only values in %s" % self.list, obj, col, value) | 0d5297f26fdf8486b1c23d77ee36ff14277134b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6718/0d5297f26fdf8486b1c23d77ee36ff14277134b6/constraints.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
1081,
16,
645,
16,
460,
4672,
309,
460,
486,
316,
365,
18,
1098,
30,
1002,
6107,
620,
2932,
9436,
87,
1338,
924,
316,
738,
87,
6,
738,
8480,
12,
2890,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1991,
972,
12,
2890,
16,
1081,
16,
645,
16,
460,
4672,
309,
460,
486,
316,
365,
18,
1098,
30,
1002,
6107,
620,
2932,
9436,
87,
1338,
924,
316,
738,
87,
6,
738,
8480,
12,
2890,
... |
return UserBit.find_by_anchor_perms(Class, self.user, v, self.program.anchor.tree_decode('Classes')) | return UserBit.find_by_anchor_perms(Class, self.user, v, self.program.anchor.tree_decode(['Classes'])) | def preregistered_classes(self): v = GetNode( 'V/Preregister' ) return UserBit.find_by_anchor_perms(Class, self.user, v, self.program.anchor.tree_decode('Classes')) | 6d5cc8478c48096ffb1a9fb45a2b8b4667409890 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12041/6d5cc8478c48096ffb1a9fb45a2b8b4667409890/models.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
846,
13630,
329,
67,
4701,
12,
2890,
4672,
331,
273,
968,
907,
12,
296,
58,
19,
2050,
13630,
11,
262,
327,
2177,
5775,
18,
4720,
67,
1637,
67,
16215,
67,
15969,
12,
797,
16,
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,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
846,
13630,
329,
67,
4701,
12,
2890,
4672,
331,
273,
968,
907,
12,
296,
58,
19,
2050,
13630,
11,
262,
327,
2177,
5775,
18,
4720,
67,
1637,
67,
16215,
67,
15969,
12,
797,
16,
365,
18,... |
gLogger.error(errMessage,pathSURL) | gLogger.error( errMessage, pathSURL ) | def isFile(self,path): """Check if the given path exists and it is a file """ res = self.checkArgumentFormat(path) if not res['OK']: return res urls = res['Value'] | 70e66af095cb6701e39b1e701e4a2ce4d012b4f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/70e66af095cb6701e39b1e701e4a2ce4d012b4f7/SRM2Storage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11655,
12,
2890,
16,
803,
4672,
3536,
1564,
309,
326,
864,
589,
1704,
471,
518,
353,
279,
585,
3536,
400,
273,
365,
18,
1893,
1379,
1630,
12,
803,
13,
309,
486,
400,
3292,
3141,
3546,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
11655,
12,
2890,
16,
803,
4672,
3536,
1564,
309,
326,
864,
589,
1704,
471,
518,
353,
279,
585,
3536,
400,
273,
365,
18,
1893,
1379,
1630,
12,
803,
13,
309,
486,
400,
3292,
3141,
3546,
... |
self.frame.SetTitle(default + '- BitTorrent') | self.frame.SetTitle(default + '- BitTorrent ' + version) | def onChooseFile(self, default, bucket, f, size, dir): if dir: dl = wxDirDialog(self.frame, 'Choose a directory to save to, pick a partial download to resume', join(getcwd(), default), style = wxDD_DEFAULT_STYLE | wxDD_NEW_DIR_BUTTON) else: dl = wxFileDialog(self.frame, 'Choose file to save as, pick a partial download to resume', '', default, '*.*', wxSAVE) if dl.ShowModal() != wxID_OK: self.done(None) else: bucket[0] = dl.GetPath() self.fileNameText.SetLabel('%s (%.1f MB)' % (default, float(size) / (1 << 20))) self.timeEstText.SetLabel('Starting up...') self.fileDestText.SetLabel(dl.GetPath()) self.filename = default self.frame.SetTitle(default + '- BitTorrent') self.shown = true self.frame.Show(true) f.set() | 1837d5770325d3550eb3de5c39a6b107db1bd1ac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/1837d5770325d3550eb3de5c39a6b107db1bd1ac/btdownloadgui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
24529,
812,
12,
2890,
16,
805,
16,
2783,
16,
284,
16,
963,
16,
1577,
4672,
309,
1577,
30,
8910,
273,
7075,
1621,
6353,
12,
2890,
18,
3789,
16,
296,
24529,
279,
1867,
358,
1923,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
24529,
812,
12,
2890,
16,
805,
16,
2783,
16,
284,
16,
963,
16,
1577,
4672,
309,
1577,
30,
8910,
273,
7075,
1621,
6353,
12,
2890,
18,
3789,
16,
296,
24529,
279,
1867,
358,
1923,
... |
for (token, value) in PythonLexer().get_tokens(source): | for (token, value) in all_tokens: | def reprint_line(lineno, s, to_replace=[]): if lineno < 0: return t = list(PythonLexer().get_tokens(s)) for (i, token) in to_replace: t[i] = token o = format(t, BPythonFormatter(OPTS.color_scheme)) self.scr.move(lineno, 4) map(self.echo, o.split('\x04')) | fbe00460abf42f866390e0d1138ec5447e78446b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6932/fbe00460abf42f866390e0d1138ec5447e78446b/cli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
283,
1188,
67,
1369,
12,
17782,
16,
272,
16,
358,
67,
2079,
33,
8526,
4672,
309,
7586,
411,
374,
30,
327,
268,
273,
666,
12,
15774,
13356,
7675,
588,
67,
7860,
12,
87,
3719,
364,
261... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
283,
1188,
67,
1369,
12,
17782,
16,
272,
16,
358,
67,
2079,
33,
8526,
4672,
309,
7586,
411,
374,
30,
327,
268,
273,
666,
12,
15774,
13356,
7675,
588,
67,
7860,
12,
87,
3719,
364,
261... |
logging.debug('filepicker.cleanup_temp_files: %r' % temp_file) os.remove(temp_file) | if os.path.exists(temp_file): os.remove(temp_file) _temp_files_to_clean.remove(temp_file) else: logging.debug('filepicker.cleanup_temp_files: no file %r' % temp_file) | def cleanup_temp_files(): for temp_file in _temp_files_to_clean: logging.debug('filepicker.cleanup_temp_files: %r' % temp_file) os.remove(temp_file) | 550ea94aeebe21bcf3e991de8f9eeb4103939734 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6905/550ea94aeebe21bcf3e991de8f9eeb4103939734/filepicker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6686,
67,
5814,
67,
2354,
13332,
364,
1906,
67,
768,
316,
389,
5814,
67,
2354,
67,
869,
67,
6200,
30,
309,
1140,
18,
803,
18,
1808,
12,
5814,
67,
768,
4672,
1140,
18,
4479,
12,
5814,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6686,
67,
5814,
67,
2354,
13332,
364,
1906,
67,
768,
316,
389,
5814,
67,
2354,
67,
869,
67,
6200,
30,
309,
1140,
18,
803,
18,
1808,
12,
5814,
67,
768,
4672,
1140,
18,
4479,
12,
5814,... |
contactgroups_to_define.update(host_contactgroups_of(all_active_hosts())) contactgroups_to_define.update(host_contactgroups_of(all_active_clusters())) cgs = list(contactgroups_to_define) cgs.sort() outfile.write("\n for name in cgs: if type(define_contactgroups) == dict: alias = define_contactgroups.get(name, name) else: alias = name outfile.write("\ndefine contactgroup {\n" " contactgroup_name %s\n" " alias %s\n" "}\n" % (name, alias)) | cgs = list(contactgroups_to_define) cgs.sort() outfile.write("\n for name in cgs: if type(define_contactgroups) == dict: alias = define_contactgroups.get(name, name) else: alias = name outfile.write("\ndefine contactgroup {\n" " contactgroup_name %s\n" " alias %s\n" "}\n" % (name, alias)) | def create_nagios_config_contactgroups(outfile): if define_contactgroups: contactgroups_to_define.update(host_contactgroups_of(all_active_hosts())) contactgroups_to_define.update(host_contactgroups_of(all_active_clusters())) cgs = list(contactgroups_to_define) cgs.sort() outfile.write("\n# Contact groups, (controlled by define_contactgroups)\n") for name in cgs: if type(define_contactgroups) == dict: alias = define_contactgroups.get(name, name) else: alias = name outfile.write("\ndefine contactgroup {\n" " contactgroup_name %s\n" " alias %s\n" "}\n" % (name, alias)) | 12fce2b252e6648c9765f59a1d7b36db6851e28f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5589/12fce2b252e6648c9765f59a1d7b36db6851e28f/check_mk.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
27132,
7441,
67,
1425,
67,
8994,
4650,
12,
26050,
4672,
309,
4426,
67,
8994,
4650,
30,
5388,
4650,
67,
869,
67,
11255,
18,
2725,
12,
2564,
67,
8994,
4650,
67,
792,
12,
454,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
27132,
7441,
67,
1425,
67,
8994,
4650,
12,
26050,
4672,
309,
4426,
67,
8994,
4650,
30,
5388,
4650,
67,
869,
67,
11255,
18,
2725,
12,
2564,
67,
8994,
4650,
67,
792,
12,
454,
... |
(150, gtk.CellRendererText()) | (150, renderer) | def on_expose(self, window, event): a = event.area f = a[1]/self.h k = a[3]/self.h print a, f, k y = f*self.h for i in xrange(f, f+k+1): x = 0 for j, (w, renderer) in enumerate(self.columns): r = gtk.gdk.Rectangle(x, y, w, self.h) background_area = r cell_area = r expose_area = cell_area renderer.set_property("text", self.data.get_item(i, j)) renderer.render(self.window, self, background_area, cell_area, expose_area, gtk.CELL_RENDERER_PRELIT) x += w | 67aa47f766fc6d66a3ca063c05e35f0e0efbdb7c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8273/67aa47f766fc6d66a3ca063c05e35f0e0efbdb7c/query_view.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
338,
4150,
12,
2890,
16,
2742,
16,
871,
4672,
279,
273,
871,
18,
5036,
284,
273,
279,
63,
21,
18537,
2890,
18,
76,
417,
273,
279,
63,
23,
18537,
2890,
18,
76,
1172,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
338,
4150,
12,
2890,
16,
2742,
16,
871,
4672,
279,
273,
871,
18,
5036,
284,
273,
279,
63,
21,
18537,
2890,
18,
76,
417,
273,
279,
63,
23,
18537,
2890,
18,
76,
1172,
279,
1... |
INPUT:: | INPUT: | def NKStarGraph(self,n,k): r''' Returns the (n,k)-star graph. | 964210a5192f4b56729c7c92c3aa648c59e61bea /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/964210a5192f4b56729c7c92c3aa648c59e61bea/graph_generators.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
423,
47,
18379,
4137,
12,
2890,
16,
82,
16,
79,
4672,
436,
26418,
2860,
326,
261,
82,
16,
79,
24950,
10983,
2667,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
423,
47,
18379,
4137,
12,
2890,
16,
82,
16,
79,
4672,
436,
26418,
2860,
326,
261,
82,
16,
79,
24950,
10983,
2667,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
DateTimeBehavior.transformFromNative(obj, False) | return DateTimeBehavior.transformFromNative(obj, False) | def transformFromNative(obj): DateTimeBehavior.transformFromNative(obj, False) | 294eb46b4f7dfea86975e1ce3c2fde15608c2e47 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9169/294eb46b4f7dfea86975e1ce3c2fde15608c2e47/icalendar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2510,
1265,
9220,
12,
2603,
4672,
3716,
9212,
18,
6547,
1265,
9220,
12,
2603,
16,
1083,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2510,
1265,
9220,
12,
2603,
4672,
3716,
9212,
18,
6547,
1265,
9220,
12,
2603,
16,
1083,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
'Esential', 'Filename', 'Size', 'Installed-Size', 'MD5sum', 'Description', ''] | 'Esential', 'Filename', 'Size', 'Installed-Size', 'MD5sum', 'Description', 'Uploaders', 'Bugs', 'Origin', 'Task', ''] | def newFiles(self, out, binary): if binary: file = 'Packages' else: file = 'Sources' new_fd = open (out + os.sep + file, "w", os.O_CREAT) if binary: control_fields = ['Package', 'Source', 'Version', 'Section','Priority', 'Architecture', 'Maintainer','Pre-Depends', 'Depends', 'Suggests', 'Recommends', 'Enhances', 'enhances', 'Conflicts', 'Provides','Replaces', 'Esential', 'Filename', 'Size', 'Installed-Size', 'MD5sum', 'Description', ''] else: control_fields = ['Package', 'Binary', 'Version', 'Priority', 'Section', 'Maintainer', 'Build-Depends', 'Build-Depends-Indep', 'Build-Conflicts', 'Build-Conflicts-Indep', 'Architecture', 'Standards-Version', 'Format', 'Directory', 'Files', 'Uploaders'] for package in self.pkg_list: for k in control_fields: if package.hasKey(k): new_fd.write("%s: %s\n"%(k, package.get(k))) new_fd.write('\n') new_fd.close() self.gen_compressed(out + os.sep + file, binary) | 0077c14961f1de36609aa9aa13657d6ba2650fd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1007/0077c14961f1de36609aa9aa13657d6ba2650fd3/packagesList.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
2697,
12,
2890,
16,
596,
16,
3112,
4672,
309,
3112,
30,
585,
273,
296,
11425,
11,
469,
30,
585,
273,
296,
8628,
11,
394,
67,
8313,
273,
1696,
261,
659,
397,
1140,
18,
10814,
397... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
2697,
12,
2890,
16,
596,
16,
3112,
4672,
309,
3112,
30,
585,
273,
296,
11425,
11,
469,
30,
585,
273,
296,
8628,
11,
394,
67,
8313,
273,
1696,
261,
659,
397,
1140,
18,
10814,
397... |
print >>sys.stderr, cgitb.text(sys.exc_info()) | traceback.print_exc(file = sys.stderr) | def output(message, toStdout = True): message = time.strftime('[%Y-%m-%d %H:%M:%S] ') + message wikipedia.output(message, toStdout = toStdout) if toStdout: sys.stdout.flush() else: sys.stderr.flush() | 64b9b174965ac4b41dd4775b5cb6fed796652b43 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/64b9b174965ac4b41dd4775b5cb6fed796652b43/delinker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
876,
12,
2150,
16,
358,
27334,
273,
1053,
4672,
883,
273,
813,
18,
701,
9982,
2668,
14451,
61,
6456,
81,
6456,
72,
738,
44,
5319,
49,
5319,
55,
65,
8624,
397,
883,
21137,
18,
2844,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
876,
12,
2150,
16,
358,
27334,
273,
1053,
4672,
883,
273,
813,
18,
701,
9982,
2668,
14451,
61,
6456,
81,
6456,
72,
738,
44,
5319,
49,
5319,
55,
65,
8624,
397,
883,
21137,
18,
2844,
1... |
frame = 1 nc.close() log.info("Current frame number is: %i" % (frame-1)) | if hasattr(self,'atoms'): frame = 1 else: frame = 0 log.info("Current frame number is: %i" % (frame-1)) | def _set_frame_number(self, frame=None): 'set framenumber in the netcdf file' if frame is None: nc = netCDF(self.nc, 'r') if 'TotalEnergy' in nc.variables: frame = nc.variables['TotalEnergy'].shape[0] # make sure the last energy is reasonable. Sometime # the field is empty if the calculation ran out of # walltime for example. Empty values get returned as # 9.6E36. Dacapos energies should always be negative, # so if the energy is > 1E36, there is definitely # something wrong and a restart is required. if nc.variables.get('TotalEnergy', None)[-1] > 1E36: log.warn("Total energy > 1E36. NC file is incomplete. \ calc.restart required") self.restart() else: frame = 1 nc.close() log.info("Current frame number is: %i" % (frame-1)) self._frame = frame-1 #netCDF starts counting with 1 | aabaca6c3ff2bc9a7f87d3884bfc98e39475d6b2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5735/aabaca6c3ff2bc9a7f87d3884bfc98e39475d6b2/jacapo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
542,
67,
3789,
67,
2696,
12,
2890,
16,
2623,
33,
7036,
4672,
296,
542,
21799,
21998,
316,
326,
2901,
24799,
585,
11,
225,
309,
2623,
353,
599,
30,
8194,
273,
2901,
39,
4577,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
542,
67,
3789,
67,
2696,
12,
2890,
16,
2623,
33,
7036,
4672,
296,
542,
21799,
21998,
316,
326,
2901,
24799,
585,
11,
225,
309,
2623,
353,
599,
30,
8194,
273,
2901,
39,
4577,
12,
... |
test_targets.append(xcode_target) | run_test_targets.append(run_target) xcode_target.test_runner = run_target | def Finalize1(self, xcode_targets): # Collect a list of all of the build configuration names used by the # various targets in the file. It is very heavily advised to keep each # target in an entire project (even across multiple project files) using # the same set of configuration names. configurations = [] for xct in self.project.GetProperty('targets'): xccl = xct.GetProperty('buildConfigurationList') xcbcs = xccl.GetProperty('buildConfigurations') for xcbc in xcbcs: name = xcbc.GetProperty('name') if name not in configurations: configurations.append(name) | 4a7d6bada7b90676be8e62a590f697b46a0d21b9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6220/4a7d6bada7b90676be8e62a590f697b46a0d21b9/xcode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30740,
21,
12,
2890,
16,
619,
710,
67,
11358,
4672,
468,
9302,
279,
666,
434,
777,
434,
326,
1361,
1664,
1257,
1399,
635,
326,
468,
11191,
5774,
316,
326,
585,
18,
225,
2597,
353,
8572... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30740,
21,
12,
2890,
16,
619,
710,
67,
11358,
4672,
468,
9302,
279,
666,
434,
777,
434,
326,
1361,
1664,
1257,
1399,
635,
326,
468,
11191,
5774,
316,
326,
585,
18,
225,
2597,
353,
8572... |
self.hotspot_tracker.redraw_cell(self._widget) | self.hotspot_tracker.redraw_cell() | def on_row_deleted(self, model, path): if self.hotspot_tracker: self.hotspot_tracker.redraw_cell(self._widget) self.hotspot_tracker = None | 8e46a38d27a7643e52cead8fead58a30b431a2a8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12354/8e46a38d27a7643e52cead8fead58a30b431a2a8/tableview.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
492,
67,
8600,
12,
2890,
16,
938,
16,
589,
4672,
309,
365,
18,
15224,
19032,
67,
16543,
30,
365,
18,
15224,
19032,
67,
16543,
18,
1118,
1899,
67,
3855,
1435,
365,
18,
15224,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
492,
67,
8600,
12,
2890,
16,
938,
16,
589,
4672,
309,
365,
18,
15224,
19032,
67,
16543,
30,
365,
18,
15224,
19032,
67,
16543,
18,
1118,
1899,
67,
3855,
1435,
365,
18,
15224,
... |
raise NotImplementedError('%s should implement get_pagemenu.' % self.__class__) | return None | def get_pagemenu(self, request, *args, **kwargs): raise NotImplementedError('%s should implement get_pagemenu.' % self.__class__) | 34a2e9c7044829a5a6cdb3f63c9be5a103290f99 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12648/34a2e9c7044829a5a6cdb3f63c9be5a103290f99/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
9095,
351,
2104,
12,
2890,
16,
590,
16,
380,
1968,
16,
2826,
4333,
4672,
327,
599,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
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,
336,
67,
9095,
351,
2104,
12,
2890,
16,
590,
16,
380,
1968,
16,
2826,
4333,
4672,
327,
599,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
parents = [particle])] new_particles.extend(P(weight = new_weight, pcoord = copy(particle.pcoord), p_parent = particle, parents = [particle]) for i in xrange(1, m)) self.particles_split.add(particle) bin.discard(particle) particles.discard(particle) self.particles_created.update(new_particles) bin.update(new_particles) particles.update(new_particles) | parents = [particle]) for i in xrange(1, new_num)) self.particles_split.add(particle) bin.discard(particle) particles.discard(particle) self.particles_created.update(new_particles) bin.update(new_particles) particles.update(new_particles) | def split_particles(self, particles, binarray): """Split particles according to weight. New particles must have their lineage information set correctly and be put into the `particles_created` collection. The source particle must be added to the `particles_split` collection. """ for bin in binarray: bnorm = bin.norm ideal_weight = bnorm / bin.ideal_num for particle in list(bin): if particle.weight > bin.split_threshold*ideal_weight: P = particle.__class__ m = int(math.ceil(particle.weight / ideal_weight)) assert(m >= 2) new_weight = particle.weight / m new_particles = [P(weight = new_weight, pcoord = copy(particle.pcoord), p_parent = particle, parents = [particle])] new_particles.extend(P(weight = new_weight, pcoord = copy(particle.pcoord), p_parent = particle, parents = [particle]) for i in xrange(1, m)) self.particles_split.add(particle) bin.discard(particle) particles.discard(particle) self.particles_created.update(new_particles) bin.update(new_particles) particles.update(new_particles) | 2c08a37a173a1a3fc757755048b549ee9a7927ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6168/2c08a37a173a1a3fc757755048b549ee9a7927ab/we_driver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1416,
67,
2680,
8383,
12,
2890,
16,
28312,
16,
4158,
1126,
4672,
3536,
5521,
28312,
4888,
358,
3119,
18,
225,
1166,
28312,
1297,
1240,
3675,
31766,
1779,
444,
8783,
471,
506,
1378,
1368,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1416,
67,
2680,
8383,
12,
2890,
16,
28312,
16,
4158,
1126,
4672,
3536,
5521,
28312,
4888,
358,
3119,
18,
225,
1166,
28312,
1297,
1240,
3675,
31766,
1779,
444,
8783,
471,
506,
1378,
1368,
... |
EXAMLPLE:: | EXAMPLE:: | def characters(self, ch): elem = self.stack[-1] elem.characters(ch) | e1098a4e657e9ede06183d4d07f8b01cea1ffd95 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7631/e1098a4e657e9ede06183d4d07f8b01cea1ffd95/api1.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3949,
12,
2890,
16,
462,
4672,
3659,
273,
365,
18,
3772,
18919,
21,
65,
3659,
18,
20558,
12,
343,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3949,
12,
2890,
16,
462,
4672,
3659,
273,
365,
18,
3772,
18919,
21,
65,
3659,
18,
20558,
12,
343,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
code[tail] = len(code) - tail | code[tail] = _len(code) - tail | def fixup(literal, flags=flags): return _sre.getlower(literal, flags) | 2177055b902a7e649c7988bb4499ab5115b4ea1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2177055b902a7e649c7988bb4499ab5115b4ea1d/sre_compile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
416,
12,
13107,
16,
2943,
33,
7133,
4672,
327,
389,
87,
266,
18,
588,
8167,
12,
13107,
16,
2943,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
416,
12,
13107,
16,
2943,
33,
7133,
4672,
327,
389,
87,
266,
18,
588,
8167,
12,
13107,
16,
2943,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.