rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
result[name]=value | if not already_have(name): result[name]=value | def parse_cookie(text, result=None, qparmre=regex.compile( '\([\0- ]*' '\([^\0- ;,=\"]+\)="\([^"]*\)\"' '\([\0- ]*[;,]\)?[\0- ]*\)' ), parmre=regex.compile( '\([\0- ]*' '\([^\0- ;,=\"]+\)=\([^\0;-=\"]*\)' '\([\0- ]*[;,]\)?[\0- ]*\)' ), ): if result is None: result={} if qparmre.match(text) >= 0: # Match quoted correct cookies name=qparmre.group(2) value=qparmre.group(3) l=len(qparmre.group(1)) elif parmre.match(text) >= 0: # Match evil MSIE cookies ;) name=parmre.group(2) value=parmre.group(3) l=len(parmre.group(1)) else: if not text or not strip(text): return result raise "InvalidParameter", text result[name]=value return apply(parse_cookie,(text[l:],result)) | bd5142940bf866ae23c9af7b36e6caf93eb3f7b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/bd5142940bf866ae23c9af7b36e6caf93eb3f7b1/Publish.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
8417,
12,
955,
16,
563,
33,
7036,
16,
1043,
1065,
81,
266,
33,
7584,
18,
11100,
12,
2337,
14026,
20,
17,
308,
4035,
2337,
19042,
20,
17,
274,
16,
5189,
26446,
13,
1546,
64,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
8417,
12,
955,
16,
563,
33,
7036,
16,
1043,
1065,
81,
266,
33,
7584,
18,
11100,
12,
2337,
14026,
20,
17,
308,
4035,
2337,
19042,
20,
17,
274,
16,
5189,
26446,
13,
1546,
64,... |
bc = {name: {'path': os.path.join('path', 'to', 'mod'), 'bc': b'NNN'}} | bc = {name: {'path': os.path.join('path', 'to', 'mod'), 'bc': b'1234'}} | def test_bad_bytecode(self): # Malformed code object bytecode should lead to a ValueError. name = 'mod' bc = {name: {'path': os.path.join('path', 'to', 'mod'), 'bc': b'NNN'}} mock = PyPycLoaderMock({name: None}, bc) with util.uncache(name), self.assertRaises(ValueError): mock.load_module(name) | 2215c14f0347cebd074840f7b6c994be7500a9aa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/2215c14f0347cebd074840f7b6c994be7500a9aa/test_abc_loader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
8759,
67,
1637,
16651,
12,
2890,
4672,
468,
13311,
981,
733,
22801,
1410,
5871,
358,
279,
2068,
18,
508,
273,
296,
1711,
11,
6533,
273,
288,
529,
30,
13666,
803,
4278,
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,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
8759,
67,
1637,
16651,
12,
2890,
4672,
468,
13311,
981,
733,
22801,
1410,
5871,
358,
279,
2068,
18,
508,
273,
296,
1711,
11,
6533,
273,
288,
529,
30,
13666,
803,
4278,
1140,
... |
"""DrawSpline(self, int PCOUNT, Point points)""" | """DrawSpline(self, int points, Point points_array)""" | def DrawSpline(*args, **kwargs): """DrawSpline(self, int PCOUNT, Point points)""" return _ogl.PseudoMetaFile_DrawSpline(*args, **kwargs) | baaa1d1a58224f2d1509965e5e9d9e8fd5799cf0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12725/baaa1d1a58224f2d1509965e5e9d9e8fd5799cf0/ogl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10184,
16881,
558,
30857,
1968,
16,
2826,
4333,
4672,
3536,
6493,
16881,
558,
12,
2890,
16,
509,
3143,
16,
4686,
3143,
67,
1126,
15574,
327,
389,
717,
80,
18,
26716,
2781,
812,
67,
6493,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10184,
16881,
558,
30857,
1968,
16,
2826,
4333,
4672,
3536,
6493,
16881,
558,
12,
2890,
16,
509,
3143,
16,
4686,
3143,
67,
1126,
15574,
327,
389,
717,
80,
18,
26716,
2781,
812,
67,
6493,... |
else: | except Exception, e: | def onActivateStream(self, iq): fromJID = jid.internJID(iq["from"]).full() activateJID = jid.internJID(str(iq.query.activate)).full() sid = hashSID(iq.query["sid"], fromJID, activateJID) log.msg("Activation requested for: ", sid) | ac6a0727c2479ce891eca6cb48835f7c9a2a7465 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5317/ac6a0727c2479ce891eca6cb48835f7c9a2a7465/proxy65.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
21370,
1228,
12,
2890,
16,
24288,
4672,
628,
46,
734,
273,
14201,
18,
267,
798,
46,
734,
12,
18638,
9614,
2080,
11929,
2934,
2854,
1435,
10235,
46,
734,
273,
14201,
18,
267,
798,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
21370,
1228,
12,
2890,
16,
24288,
4672,
628,
46,
734,
273,
14201,
18,
267,
798,
46,
734,
12,
18638,
9614,
2080,
11929,
2934,
2854,
1435,
10235,
46,
734,
273,
14201,
18,
267,
798,
... |
"""Translate a 'virtual' FTP path into equivalent filesystem path. @param path: absolute or relative virtual path. @return: full absolute filesystem path. note: directory separators are system dependent. | """Translate a 'virtual' FTP path into equivalent filesystem path. Take an absolute or relative path as input and return a full absolute file path. Note: directory separators are system dependent. | def translate(self, path): """Translate a 'virtual' FTP path into equivalent filesystem path. @param path: absolute or relative virtual path. @return: full absolute filesystem path. note: directory separators are system dependent. """ # as far as i know, it should always be path traversal safe... return os.path.normpath(self.root + self.normalize(path)) | e1763c9db15d5d6d781646fb0678f3c70d95867a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7236/e1763c9db15d5d6d781646fb0678f3c70d95867a/FTPServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4204,
12,
2890,
16,
589,
4672,
3536,
12818,
279,
296,
12384,
11,
19324,
589,
1368,
7680,
6496,
589,
18,
17129,
392,
4967,
578,
3632,
589,
487,
810,
471,
327,
279,
1983,
4967,
585,
589,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4204,
12,
2890,
16,
589,
4672,
3536,
12818,
279,
296,
12384,
11,
19324,
589,
1368,
7680,
6496,
589,
18,
17129,
392,
4967,
578,
3632,
589,
487,
810,
471,
327,
279,
1983,
4967,
585,
589,
... |
subprocess.call(cmd, shell=shell) | return subprocess.call(cmd, shell=shell) else: return 0 | def _RunCommand(cmd, dry_run, shell=False, echo_cmd=True): """Runs the command if dry_run is false, otherwise just prints the command.""" if echo_cmd: print cmd # TODO(wtc): Check the return value of subprocess.call, which is the return # value of the command. if not dry_run: subprocess.call(cmd, shell=shell) | 7eb226a6351d7143f78d283e76a172431e34f93c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/7eb226a6351d7143f78d283e76a172431e34f93c/coverity.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1997,
2189,
12,
4172,
16,
10299,
67,
2681,
16,
5972,
33,
8381,
16,
3376,
67,
4172,
33,
5510,
4672,
3536,
9361,
326,
1296,
309,
10299,
67,
2681,
353,
629,
16,
3541,
2537,
14971,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1997,
2189,
12,
4172,
16,
10299,
67,
2681,
16,
5972,
33,
8381,
16,
3376,
67,
4172,
33,
5510,
4672,
3536,
9361,
326,
1296,
309,
10299,
67,
2681,
353,
629,
16,
3541,
2537,
14971,
32... |
from inspect import stack self.__caller = tuple(stack()[2][1:3]) | if tools.config['log_level'] in (netsvc.LOG_DEBUG, netsvc.LOG_DEBUG_RPC): from inspect import stack self.__caller = tuple(stack()[2][1:3]) | def __init__(self, pool): self._pool = pool self._cnx = pool.getconn() self._obj = self._cnx.cursor(cursor_factory=psycopg1cursor) self.autocommit(False) self.dbname = pool.dbname from inspect import stack self.__caller = tuple(stack()[2][1:3]) | a875a71408e1de8588f82ebd6d6b39bb92f040ed /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/a875a71408e1de8588f82ebd6d6b39bb92f040ed/sql_db.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2845,
4672,
365,
6315,
6011,
273,
2845,
365,
6315,
10305,
92,
273,
2845,
18,
588,
4646,
1435,
365,
6315,
2603,
273,
365,
6315,
10305,
92,
18,
9216,
12,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2845,
4672,
365,
6315,
6011,
273,
2845,
365,
6315,
10305,
92,
273,
2845,
18,
588,
4646,
1435,
365,
6315,
2603,
273,
365,
6315,
10305,
92,
18,
9216,
12,
9... |
if node.get('groups'): groups = node.get('groups').split(',') readonly = False access_pool = self.pool.get('ir.model.access') for group in groups: readonly = readonly or access_pool.check_groups(cr, user, group) if not readonly: node.set('invisible', '1') del(node.attrib['groups']) | check_group(node) | def encode(s): if isinstance(s, unicode): return s.encode('utf8') return s | 43885464599c129aa3047d213235920204bb59b1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/43885464599c129aa3047d213235920204bb59b1/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2017,
12,
87,
4672,
309,
1549,
12,
87,
16,
5252,
4672,
327,
272,
18,
3015,
2668,
3158,
28,
6134,
327,
272,
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,
2017,
12,
87,
4672,
309,
1549,
12,
87,
16,
5252,
4672,
327,
272,
18,
3015,
2668,
3158,
28,
6134,
327,
272,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
'allowed_type_column' : 'portal_type', | def get(self, instance, **kwargs): template = '%%d.%%0%dd' % self.precision value = ObjectField.get(self, instance, **kwargs) __traceback_info__ = (template, value) if value is None: return self.default if type(value) in [StringType]: value = self._to_tuple(value) return template % value | 589c8a00edeed82af11646c142742440f2908f59 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/589c8a00edeed82af11646c142742440f2908f59/Field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
16,
791,
16,
2826,
4333,
4672,
1542,
273,
1995,
9,
72,
7866,
9,
20,
9,
449,
11,
738,
365,
18,
14548,
460,
273,
1033,
974,
18,
588,
12,
2890,
16,
791,
16,
2826,
4333,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16,
791,
16,
2826,
4333,
4672,
1542,
273,
1995,
9,
72,
7866,
9,
20,
9,
449,
11,
738,
365,
18,
14548,
460,
273,
1033,
974,
18,
588,
12,
2890,
16,
791,
16,
2826,
4333,... | |
sage: show(plot(sin,-4,4), axes=False) | sage.: show(plot(sin,-4,4), axes=False) | def show(self, xmin=None, xmax=None, ymin=None, ymax=None, figsize=DEFAULT_FIGSIZE, filename=None, dpi=DEFAULT_DPI, axes=True, axes_label=None,frame=False, **args): """ Show this graphics image with the default image viewer. | c0e21f844db5dcf442dd512ff861c952b0661fb2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9417/c0e21f844db5dcf442dd512ff861c952b0661fb2/plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
12,
2890,
16,
13777,
33,
7036,
16,
14016,
33,
7036,
16,
15763,
33,
7036,
16,
15275,
33,
7036,
16,
14697,
33,
5280,
67,
5236,
4574,
16,
1544,
33,
7036,
16,
16361,
33,
5280,
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,
2405,
12,
2890,
16,
13777,
33,
7036,
16,
14016,
33,
7036,
16,
15763,
33,
7036,
16,
15275,
33,
7036,
16,
14697,
33,
5280,
67,
5236,
4574,
16,
1544,
33,
7036,
16,
16361,
33,
5280,
67,
... |
self.timeout = max( 600, self.timeout ) | self.timeout = max( 120, self.timeout ) else: self.timeout = 600 | def __discoverTimeout( self ): if self.KW_TIMEOUT in self.kwargs: self.timeout = self.kwargs[ self.KW_TIMEOUT ] else: self.timeout = False if self.timeout: self.timeout = max( 600, self.timeout ) self.kwargs[ self.KW_TIMEOUT ] = self.timeout return S_OK() | 2ef58447dd488ddc336509070b2ebdd36314bdb6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12864/2ef58447dd488ddc336509070b2ebdd36314bdb6/BaseClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2251,
3165,
2694,
12,
365,
262,
30,
309,
365,
18,
30134,
67,
9503,
316,
365,
18,
4333,
30,
365,
18,
4538,
273,
365,
18,
4333,
63,
365,
18,
30134,
67,
9503,
308,
469,
30,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2251,
3165,
2694,
12,
365,
262,
30,
309,
365,
18,
30134,
67,
9503,
316,
365,
18,
4333,
30,
365,
18,
4538,
273,
365,
18,
4333,
63,
365,
18,
30134,
67,
9503,
308,
469,
30,
365,
... |
is_oob_signature = true | is_oob_signature = True | def put_processed_json(self,ooid,processed_json): """ Create a crash report from the cooked json output of the processor """ row_id = ooid_to_row_id(ooid) | ccf77afa0d0c6762e415d84419e9152954c6e702 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12383/ccf77afa0d0c6762e415d84419e9152954c6e702/hbaseClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1378,
67,
11005,
67,
1977,
12,
2890,
16,
83,
839,
16,
11005,
67,
1977,
4672,
3536,
1788,
279,
17053,
2605,
628,
326,
15860,
329,
1163,
876,
434,
326,
6659,
3536,
1027,
67,
350,
273,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1378,
67,
11005,
67,
1977,
12,
2890,
16,
83,
839,
16,
11005,
67,
1977,
4672,
3536,
1788,
279,
17053,
2605,
628,
326,
15860,
329,
1163,
876,
434,
326,
6659,
3536,
1027,
67,
350,
273,
32... |
unichr(NSDeleteCharacter), | unichr(0x007F), | def _keyDown(self, event): # this method is called by the NSTableView subclass after a key down # has occurred. the subclass expects that a boolean will be returned # that indicates if this method has done something (delete an item or # select an item). if False is returned, the delegate calls the super # method to insure standard key down behavior. # # get the characters characters = event.characters() # get the field editor fieldEditor = self._tableView.window().fieldEditor_forObject_(True, self._tableView) # deleteCharacters = [ NSBackspaceCharacter, NSDeleteFunctionKey, NSDeleteCharacter, unichr(NSDeleteCharacter), ] nonCharacters = [ NSUpArrowFunctionKey, NSDownArrowFunctionKey, NSLeftArrowFunctionKey, NSRightArrowFunctionKey, NSPageUpFunctionKey, NSPageDownFunctionKey, unichr(NSEnterCharacter), unichr(NSCarriageReturnCharacter), unichr(NSTabCharacter), ] if characters in deleteCharacters: if self._enableDelete: self._removeSelection() return True # arrow key. reset the typing entry if necessary. elif characters in nonCharacters: if self._typingSensitive: self._lastInputTime = None fieldEditor.setString_(u"") return False elif self._typingSensitive: # get the current time rightNow = time.time() # no time defined. define it. if self._lastInputTime is None: self._lastInputTime = rightNow # if the last input was too long ago, # clear away the old input if rightNow - self._lastInputTime > 0.75: fieldEditor.setString_(u"") # reset the clock self._lastInputTime = rightNow # add the characters to the fied editor fieldEditor.interpretKeyEvents_([event]) # get the input string inputString = fieldEditor.string() # if the list has multiple columns, we'll use the items in the first column tableColumns = self._tableView.tableColumns() columnID = tableColumns[self._typingSensitiveColumn].identifier() # match = None matchIndex = None lastResort = None lastResortIndex = None inputLength = len(inputString) for index in xrange(len(self)): item = self._arrayController.content()[index] # the item could be a dictionary or # a NSObject. safely handle each. if isinstance(item, NSDictionary): item = item[columnID] else: item = getattr(item, columnID)() # only test strings if not isinstance(item, basestring): continue # if the item starts with the input string, it is considered a match if item.startswith(inputString): if match is None: match = item matchIndex = index continue # only if the item is less than the previous match is it a more relevant match # example: # given this order: sys, signal # and this input string: s # sys will be the first match, but signal is the more accurate match if item < match: match = item matchIndex = index continue # if the item is greater than the input string,it can be used as a last resort # example: # given this order: vanilla, zipimport # and this input string: x # zipimport will be used as the last resort if item > inputString: if lastResort is None: lastResort = item lastResortIndex = index continue # if existing the last resort is greater than the item # the item is a closer match to the input string if lastResort > item: lastResort = item lastResortIndex = index continue if matchIndex is not None: self.setSelection([matchIndex]) return True elif lastResortIndex is not None: self.setSelection([lastResortIndex]) return True return False | 5157df77a18d2485d15982443d06d4f3a92b3784 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8843/5157df77a18d2485d15982443d06d4f3a92b3784/vanillaList.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
856,
4164,
12,
2890,
16,
871,
4672,
468,
333,
707,
353,
2566,
635,
326,
423,
882,
429,
1767,
10177,
1839,
279,
498,
2588,
468,
711,
7841,
18,
326,
10177,
10999,
716,
279,
1250,
90... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
856,
4164,
12,
2890,
16,
871,
4672,
468,
333,
707,
353,
2566,
635,
326,
423,
882,
429,
1767,
10177,
1839,
279,
498,
2588,
468,
711,
7841,
18,
326,
10177,
10999,
716,
279,
1250,
90... |
print "NETWORKS", networks | def populate_networks(self, networks): """ Populate the network database with ``networks`` | e38eb114d95889cd5d495c6ca6c46ee1b2e3fe18 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12036/e38eb114d95889cd5d495c6ca6c46ee1b2e3fe18/provider.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6490,
67,
19982,
12,
2890,
16,
13884,
4672,
3536,
22254,
326,
2483,
2063,
598,
12176,
19982,
10335,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
6490,
67,
19982,
12,
2890,
16,
13884,
4672,
3536,
22254,
326,
2483,
2063,
598,
12176,
19982,
10335,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... | |
return max([image.get_potential_energy() for image in self.images[1:-1]]) | return npy.nan """ if not self.parallel: return max([image.get_potential_energy() for image in self.images[1:-1]]) else: i = rank // (self.nimages - 2) + 1 forces[i - 1] = images[i].get_forces() for i in range(1, self.nimages - 1): world.broadcast(forces[i], (i - 1) * size // (self.nimages - 2)) """ | def get_potential_energy(self): return max([image.get_potential_energy() for image in self.images[1:-1]]) | 09a9f071d7ad2b4d75bb34a1018e69ff45f9fcec /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5735/09a9f071d7ad2b4d75bb34a1018e69ff45f9fcec/neb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
26451,
67,
15358,
12,
2890,
4672,
327,
943,
3816,
2730,
18,
588,
67,
26451,
67,
15358,
1435,
364,
1316,
316,
365,
18,
7369,
63,
21,
30,
17,
21,
65,
5717,
2,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
26451,
67,
15358,
12,
2890,
4672,
327,
943,
3816,
2730,
18,
588,
67,
26451,
67,
15358,
1435,
364,
1316,
316,
365,
18,
7369,
63,
21,
30,
17,
21,
65,
5717,
2,
-100,
-100,
-100... |
def main(): | def main2(): | def main(): app = PyrApp(0) app.MainLoop() | c962045642fbb422f5cbce9dc79aed22a7c912a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3700/c962045642fbb422f5cbce9dc79aed22a7c912a3/pyranim.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
22,
13332,
595,
273,
4707,
86,
3371,
12,
20,
13,
595,
18,
6376,
6452,
1435,
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,
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,
2774,
22,
13332,
595,
273,
4707,
86,
3371,
12,
20,
13,
595,
18,
6376,
6452,
1435,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
trans = self.pool.get('ir.translation')._get_source(cr, user, context['base_model_name'], 'view', context['lang'], node.get('string').encode('utf8')) | trans = self.pool.get('ir.translation')._get_source(cr, user, context['base_model_name'], 'view', context['lang'], node.get('string')) | def check_group(node): if node.get('groups'): groups = node.get('groups').split(',') access_pool = self.pool.get('ir.model.access') can_see = any(access_pool.check_groups(cr, user, group) for group in groups) if not can_see: node.set('invisible', '1') if 'attrs' in node.attrib: del(node.attrib['attrs']) #avoid making field visible later del(node.attrib['groups']) return can_see else: return True | 80c4054ceb50018be0f374df918b01fc5378cf04 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/80c4054ceb50018be0f374df918b01fc5378cf04/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
1655,
12,
2159,
4672,
309,
756,
18,
588,
2668,
4650,
11,
4672,
3252,
273,
756,
18,
588,
2668,
4650,
16063,
4939,
12,
2187,
6134,
2006,
67,
6011,
273,
365,
18,
6011,
18,
588,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
1655,
12,
2159,
4672,
309,
756,
18,
588,
2668,
4650,
11,
4672,
3252,
273,
756,
18,
588,
2668,
4650,
16063,
4939,
12,
2187,
6134,
2006,
67,
6011,
273,
365,
18,
6011,
18,
588,
... |
def find_src_files(L,d,N): if string.upper(os.path.basename(d))=='CVS': return for n in N: fn = os.path.normcase(os.path.normpath(os.path.join(d,n))) if os.path.isfile(fn): L.append(fn) | def find_src_files(L,d,N): if string.upper(os.path.basename(d))=='CVS': return #ignore all CVS for n in N: fn = os.path.normcase(os.path.normpath(os.path.join(d,n))) if os.path.isfile(fn): L.append(fn) | 9428867e35d04f48f018e2559da3c19fbeb25b24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9428867e35d04f48f018e2559da3c19fbeb25b24/daily.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
4816,
67,
2354,
12,
48,
16,
72,
16,
50,
4672,
309,
533,
18,
5797,
12,
538,
18,
803,
18,
13909,
12,
72,
3719,
18920,
39,
14640,
4278,
327,
202,
7,
6185,
777,
385,
14640,
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,
1104,
67,
4816,
67,
2354,
12,
48,
16,
72,
16,
50,
4672,
309,
533,
18,
5797,
12,
538,
18,
803,
18,
13909,
12,
72,
3719,
18920,
39,
14640,
4278,
327,
202,
7,
6185,
777,
385,
14640,
3... | |
- ``unit`` | - ``unit`` | def base_units(unit): """ Converts unit to base SI units. INPUT: - ``unit`` OUTPUT: - `symbolic expression` EXAMPLES:: sage: sage.symbolic.units.base_units(units.length.foot) 381/1250*meter If unit is already a base unit, it just returns that unit:: sage: sage.symbolic.units.base_units(units.length.meter) meter Derived units get broken down into their base parts:: sage: sage.symbolic.units.base_units(units.force.newton) kilogram*meter/second^2 sage: sage.symbolic.units.base_units(units.volume.liter) 1/1000*meter^3 Returns variable if 'unit' is not a unit:: sage: sage.symbolic.units.base_units(var('x')) x """ from sage.misc.all import sage_eval if not unit_to_type.has_key(str(unit)): return unit elif unit_to_type[str(unit)] == 'si_prefixes' or unit_to_type[str(unit)] == 'unit_multipliers': return sage_eval(unitdict[unit_to_type[str(unit)]][str(unit)]) else: v = SR.var(unit_to_type[str(unit)]) if unit_derivations.has_key(str(v)): base = unit_derivations_expr(v) for i in base.variables(): base = base.subs({i:SR.var(value_to_unit[str(i)]['1'])}) return base*sage_eval(unitdict[str(v)][str(unit)]) else: base = SR.var(value_to_unit[str(v)]['1'])*sage_eval(unitdict[str(v)][str(unit)]) return base | d9145e61c2e167a847618a21778e0e532a04af5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/d9145e61c2e167a847618a21778e0e532a04af5d/units.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1026,
67,
7705,
12,
4873,
4672,
3536,
20377,
2836,
358,
1026,
5705,
4971,
18,
225,
12943,
30,
225,
300,
12176,
4873,
10335,
225,
11550,
30,
225,
300,
1375,
9009,
12164,
2652,
68,
225,
56... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1026,
67,
7705,
12,
4873,
4672,
3536,
20377,
2836,
358,
1026,
5705,
4971,
18,
225,
12943,
30,
225,
300,
12176,
4873,
10335,
225,
11550,
30,
225,
300,
1375,
9009,
12164,
2652,
68,
225,
56... |
parser.add_option("","--minimal-match", | parser.add_option("--minimal-match", | def main(): check_executable() time.sleep(1) print '--- Parsing user arguments' parser = OptionParser() parser.add_option("", "--noise-model", dest='noise_model',default='LIGOI',metavar='NOISEMODEL', help=" <VIRGO, GEO, LIGOI, LIGOA, EGO>") parser.add_option("", "--search", dest='search',default='BNS', help=" <BNS, BBH, PBH , BHNS>") parser.add_option("","--signal-mass-range", default='1 3', dest='signal_mass_range', help="min and max individual mass in solar mass." ) parser.add_option("","--bank-mass-range", default='1 3', dest='bank_mass_range', help="min and max individual mass in solar mass." ) parser.add_option("","--signal", default='EOB', dest='signal',type='string', help="approximant of the injection (EOB, TaylorT1, ...)." ) parser.add_option("","--template", default='EOB', dest='template',type='string', help="approximant of the injection (EOB, TaylorT1, ...)." ) parser.add_option("","--template-order", default=4, dest='template_order',type='int', help="PN order of the template." ) parser.add_option("","--signal-order", default=4,dest='signal_order', type='int', help="PN order of the signal." ) parser.add_option("","--minimal-match", default=0.95, dest='minimal_match', help="minimal match." ) parser.add_option("","--sampling", dest='sampling', default=4096, type='float', help="sampling frequency" ) parser.add_option("","--bank-ffinal", dest='bank_ffinal', default=2047, type='float', help="upper frequency to be used" ) parser.add_option("-n","--ntrial", dest='ntrial', default=10000, type='int', help="number of trial." ) parser.add_option("","--bank-grid-spacing", dest='bank_grid_spacing', default='Hexagonal', help="type of template bank placement : Hexagonal, SquareNotOriented, HexagonalNotOriented" ) parser.add_option("","--fl", dest='fl', type='int',default=-1, help="lower cut off frequency" ) parser.add_option("","--max-total-mass", dest='max_total_mass', default=-1, type='float', help="max total mass (injection)" ) parser.add_option("","--fast-simulation", action="store_true", default="false", dest='fast_simulation', help="fast simulation" ) parser.add_option("","--bhns-injection", action="store_true", default="false", dest='bhns_simulation', help="bhns injection only" ) | 208ca15bb9366e5a32c6733f92be08e161c460f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5758/208ca15bb9366e5a32c6733f92be08e161c460f1/bep.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
866,
67,
17751,
1435,
813,
18,
19607,
12,
21,
13,
1172,
3534,
17,
19761,
729,
1775,
11,
2082,
273,
18862,
1435,
225,
2082,
18,
1289,
67,
3482,
2932,
3113,
5238,
17814,
17,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
866,
67,
17751,
1435,
813,
18,
19607,
12,
21,
13,
1172,
3534,
17,
19761,
729,
1775,
11,
2082,
273,
18862,
1435,
225,
2082,
18,
1289,
67,
3482,
2932,
3113,
5238,
17814,
17,
... |
"WHERE id = "+str(id) | "WHERE id = "+str(int(id)) | def vfolder_set(id, name, query, parent): cursor = sqmail.db.cursor() q = "UPDATE vfolders SET "\ " name = '"+sqmail.db.escape(name)+"', "\ " query = '"+sqmail.db.escape(query)+"', "\ " parent = "+str(parent)+" "\ "WHERE id = "+str(id) print q cursor.execute(q) | a8d4603e5ac3e4a7dff8615777c91b1b45d2f710 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3083/a8d4603e5ac3e4a7dff8615777c91b1b45d2f710/vfolder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
331,
5609,
67,
542,
12,
350,
16,
508,
16,
843,
16,
982,
4672,
3347,
273,
4744,
4408,
18,
1966,
18,
9216,
1435,
1043,
273,
315,
8217,
331,
16064,
7855,
1548,
315,
508,
273,
2119,
15,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
331,
5609,
67,
542,
12,
350,
16,
508,
16,
843,
16,
982,
4672,
3347,
273,
4744,
4408,
18,
1966,
18,
9216,
1435,
1043,
273,
315,
8217,
331,
16064,
7855,
1548,
315,
508,
273,
2119,
15,
... |
return select.select([self], [], [], 0) == ([self], [], []) | return select([self], [], [], 0) == ([self], [], []) | def sock_avail(self): """Test whether data is available on the socket.""" return select.select([self], [], [], 0) == ([self], [], []) | 63be25c16968b1c9d0252f27173e9cf04188007e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6753/63be25c16968b1c9d0252f27173e9cf04188007e/telnetlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7313,
67,
842,
671,
12,
2890,
4672,
3536,
4709,
2856,
501,
353,
2319,
603,
326,
2987,
12123,
327,
2027,
18,
4025,
3816,
2890,
6487,
5378,
16,
5378,
16,
374,
13,
422,
23265,
2890,
6487,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7313,
67,
842,
671,
12,
2890,
4672,
3536,
4709,
2856,
501,
353,
2319,
603,
326,
2987,
12123,
327,
2027,
18,
4025,
3816,
2890,
6487,
5378,
16,
5378,
16,
374,
13,
422,
23265,
2890,
6487,
... |
msrpdata.add_header(protocol.ByteRangeHeader((fro, fro+len(msrpdata.data), total))) self._msrpdata.add_header(protocol.ByteRangeHeader((fro+msrpdata.size, None, total))) | msrpdata.add_header(protocol.ByteRangeHeader((fro, None, total))) if last_chunk: self._msrpdata = msrpdata return self.read_chunk(size) else: self._msrpdata.add_header(protocol.ByteRangeHeader((fro+msrpdata.size, None, total))) | def read_chunk(self, size=None): """Wait for a new chunk and return it. If there was an error, close the connection and raise ChunkParseError. | 3096231406532c10513f42eafd3a1ccf36bc4153 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3444/3096231406532c10513f42eafd3a1ccf36bc4153/transport.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
6551,
12,
2890,
16,
963,
33,
7036,
4672,
3536,
5480,
364,
279,
394,
2441,
471,
327,
518,
18,
971,
1915,
1703,
392,
555,
16,
1746,
326,
1459,
471,
1002,
13021,
21004,
18,
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,
855,
67,
6551,
12,
2890,
16,
963,
33,
7036,
4672,
3536,
5480,
364,
279,
394,
2441,
471,
327,
518,
18,
971,
1915,
1703,
392,
555,
16,
1746,
326,
1459,
471,
1002,
13021,
21004,
18,
2,
... |
if path == '': return '' elif path.startswith('/'): if path == '/': return self.root else: return self.root + os.path.normpath(path) else: if self.cwd == '/': return self.root + os.path.normpath(self.cwd) + os.path.normpath(path) else: return self.root + os.path.normpath(self.cwd) + os.path.normpath('/' + path) def normalize(self, path): if not path: return self.cwd elif path.startswith('/'): if path.endswith('/') and len(path) > 1: return path[:-1] else: return path else: if self.cwd == '/': return self.cwd + path else: return self.cwd + '/' + path | """Translate a 'virtual' FTP path into equivalent filesystem path. @param path: absolute or relative virtual path. @return: full absolute filesystem path. note: directory separators are system dependent. """ return os.path.normpath(self.root + self.normalize(path)) | def translate(self, path): if path == '': return '' # absolute pathname elif path.startswith('/'): if path == '/': return self.root else: return self.root + os.path.normpath(path) # relative pathname else: if self.cwd == '/': return self.root + os.path.normpath(self.cwd) + os.path.normpath(path) else: return self.root + os.path.normpath(self.cwd) + os.path.normpath('/' + path) | 862047750282396db4054a2b8efce56bdffefea4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3782/862047750282396db4054a2b8efce56bdffefea4/FTPServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4204,
12,
2890,
16,
589,
4672,
309,
589,
422,
875,
30,
327,
875,
468,
4967,
9806,
1327,
589,
18,
17514,
1918,
2668,
2473,
4672,
309,
589,
422,
2023,
30,
327,
365,
18,
3085,
469,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4204,
12,
2890,
16,
589,
4672,
309,
589,
422,
875,
30,
327,
875,
468,
4967,
9806,
1327,
589,
18,
17514,
1918,
2668,
2473,
4672,
309,
589,
422,
2023,
30,
327,
365,
18,
3085,
469,
30,
... |
env.config_ini_filename = 'de.ckan.net.ini' | def de_ckan_net(): env.user = 'okfn' env.ckan_instance_name = 'de.ckan.net' env.hosts = ['us1.okfn.org'] env.base_dir = '/home/okfn/var/srvc' env.config_ini_filename = 'de.ckan.net.ini' | 892cfe9ef70acfccf3de736e3cf23a5288b785a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/265/892cfe9ef70acfccf3de736e3cf23a5288b785a7/fabfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
443,
67,
363,
304,
67,
2758,
13332,
1550,
18,
1355,
273,
296,
601,
4293,
11,
1550,
18,
363,
304,
67,
1336,
67,
529,
273,
296,
323,
18,
363,
304,
18,
2758,
11,
1550,
18,
11588,
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,
443,
67,
363,
304,
67,
2758,
13332,
1550,
18,
1355,
273,
296,
601,
4293,
11,
1550,
18,
363,
304,
67,
1336,
67,
529,
273,
296,
323,
18,
363,
304,
18,
2758,
11,
1550,
18,
11588,
273,
... | |
hide_broken_links=self.hide_broken_links, | def get_target_block(fragment, targets): '''Return the correct block for the <a name> element''' bs = targets[fragment] if not isinstance(bs, BlockSpace): return bs ans, found, page = None, False, bs.parent for item in page.contents: if found: if isinstance(item, (TextBlock, RuledLine, ImageBlock)): ans = item break if item == bs: found = True continue if not ans: for i in range(len(page.contents)-1, -1, -1): if isinstance(page.contents[i], (TextBlock, RuledLine, ImageBlock)): ans = page.contents[i] break if not ans: ntb = self.book.create_text_block() ntb.Paragraph(' ') page.append(ntb) ans = ntb if found: targets[fragment] = ans page.contents.remove(bs) return ans | 7329106b9971a236c22ef7a40e8a849bddcad759 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9125/7329106b9971a236c22ef7a40e8a849bddcad759/convert_from.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3299,
67,
2629,
12,
11956,
16,
5774,
4672,
9163,
990,
326,
3434,
1203,
364,
326,
411,
69,
508,
34,
930,
26418,
7081,
273,
5774,
63,
11956,
65,
309,
486,
1549,
12,
2038,
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,
336,
67,
3299,
67,
2629,
12,
11956,
16,
5774,
4672,
9163,
990,
326,
3434,
1203,
364,
326,
411,
69,
508,
34,
930,
26418,
7081,
273,
5774,
63,
11956,
65,
309,
486,
1549,
12,
2038,
16,
... | |
def set( self, v, checkEnv=1, minLen=3, **vars ): """ Assign a new file name | def set( self, v, checkEnv=1, minLen=3, maxSub=1, absolute=1, resolveLinks=0, **vars ): """ Assign a new file name. checkEnv, minLen, resolve*, maxSub are only considered for path name input. | def set( self, v, checkEnv=1, minLen=3, **vars ): """ Assign a new file name @param v: fragment tuples or path or custom-formatted string @type v: [ (str,str) ] OR str @param checkEnv: look for possible substitutions in environment [1] (ignored if v is already formatted like '{/x/y|$xy}/z.txt' ) @type checkEnv: 0|1 @param minLen: mininal length of environment variables to consider [3] (ignored if v is already formatted like '{/x/y|$xy}/z.txt' ) @type minLen: int """ if type( v ) == list: return self.set_fragments( v ) | 3c3e49363a7a3c916b648c6154d8aef255c31d3e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/482/3c3e49363a7a3c916b648c6154d8aef255c31d3e/LocalPath.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
12,
365,
16,
331,
16,
866,
3491,
33,
21,
16,
1131,
2891,
33,
23,
16,
943,
1676,
33,
21,
16,
4967,
33,
21,
16,
2245,
7100,
33,
20,
16,
2826,
4699,
262,
30,
3536,
12093,
279,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
12,
365,
16,
331,
16,
866,
3491,
33,
21,
16,
1131,
2891,
33,
23,
16,
943,
1676,
33,
21,
16,
4967,
33,
21,
16,
2245,
7100,
33,
20,
16,
2826,
4699,
262,
30,
3536,
12093,
279,
... |
item.connect("enter_notify_event", on_transition_source_enter) item.connect("leave_notify_event", on_transition_source_leave) | item.connect("enter_notify_event", on_transition_enter) item.connect("leave_notify_event", on_transition_leave) | def __init__(self, transition, canvas): self.canvas = canvas self.root = canvas.get_root_item_model() self.transition = transition group = goocanvas.GroupModel (parent = self.root) ellipse_source = goocanvas.EllipseModel (parent = group, center_x = 0, center_y = 0, radius_x = 5, radius_y = 5, visibility = goocanvas.ITEM_INVISIBLE, pointer_events = goocanvas.EVENTS_ALL) x_source_p = get_locationNail_x_coordinate(self.transition.source, self.transition.target.xpos, self.transition.target.ypos, 25) y_source_p = get_locationNail_y_coordinate(self.transition.source, self.transition.target.xpos, self.transition.target.ypos, 25) x_target_p = get_locationNail_x_coordinate(self.transition.target, self.transition.source.xpos, self.transition.source.ypos, 25) y_target_p = get_locationNail_y_coordinate(self.transition.target, self.transition.source.xpos, self.transition.source.ypos, 25) path = goocanvas.PathModel(parent = group, data="M " + str(x_source_p)+" "+str(y_source_p)+ " L "+str(x_target_p)+" "+str(y_target_p)) ellipse_target = goocanvas.EllipseModel (parent = group, center_x = 0, center_y = 0, radius_x = 5, radius_y = 5, visibility = goocanvas.ITEM_INVISIBLE) | 5967098489aa700214639a59f9ad770023887a6f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2599/5967098489aa700214639a59f9ad770023887a6f/pyuppaal_gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
6007,
16,
5953,
4672,
365,
18,
15424,
273,
5953,
365,
18,
3085,
273,
5953,
18,
588,
67,
3085,
67,
1726,
67,
2284,
1435,
365,
18,
14936,
273,
6007,
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,
1001,
2738,
972,
12,
2890,
16,
6007,
16,
5953,
4672,
365,
18,
15424,
273,
5953,
365,
18,
3085,
273,
5953,
18,
588,
67,
3085,
67,
1726,
67,
2284,
1435,
365,
18,
14936,
273,
6007,
1041,
... |
proxy.setAbsoluteURL('%s/%s' % (self.absolute_url(), join(rel_dir,id))) | proxy.setAbsoluteURL('%s/%s' % (self.absolute_url(), join(rel_dir,id).replace('\\','/'))) | def _createProxy(self, id, **kw): """ handle the details, nassty """ from os.path import join, dirname, exists destination = kw['destination'] proxy_type = kw.get('type', 'content') properties = kw.get('properties', None) rel_dir = kw['rel_dir'] | 427351963657f6df9e3d74fe70f3dab38f6423b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1807/427351963657f6df9e3d74fe70f3dab38f6423b4/PloneLocalFolderNG.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2640,
3886,
12,
2890,
16,
612,
16,
2826,
9987,
4672,
3536,
1640,
326,
3189,
16,
290,
345,
334,
93,
3536,
628,
1140,
18,
803,
1930,
1233,
16,
4283,
16,
1704,
2929,
273,
5323,
3292,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2640,
3886,
12,
2890,
16,
612,
16,
2826,
9987,
4672,
3536,
1640,
326,
3189,
16,
290,
345,
334,
93,
3536,
628,
1140,
18,
803,
1930,
1233,
16,
4283,
16,
1704,
2929,
273,
5323,
3292,... |
if kwargs['x'] == 'auto': | if isinstance(kwargs['x'], str) and kwargs['x'] == 'auto': | def setp(self, **kwargs): """ Set line properties. Legal keyword arguments: x, y, format. The x and y arguments hold the x and y points of a curve. The format string is just passed on to setformat, which parses the contents and sets the format information. """ PlotProperties.setp(self, **kwargs) # Here x,y values can be any SequenceType # The proper casting should be in the backends plotroutine | 5d9b0e40a631c0ab47fc35a5a63e905312b80d9c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4727/5d9b0e40a631c0ab47fc35a5a63e905312b80d9c/common.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
84,
12,
2890,
16,
2826,
4333,
4672,
3536,
1000,
980,
1790,
18,
17167,
287,
4932,
1775,
30,
619,
16,
677,
16,
740,
18,
1021,
619,
471,
677,
1775,
6887,
326,
619,
471,
677,
3143,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
84,
12,
2890,
16,
2826,
4333,
4672,
3536,
1000,
980,
1790,
18,
17167,
287,
4932,
1775,
30,
619,
16,
677,
16,
740,
18,
1021,
619,
471,
677,
1775,
6887,
326,
619,
471,
677,
3143,
... |
} else if (key_indent(e)) { | } else if (key_indent(e) && cell_input.selectionStart != cell_input.selectionEnd) { | def notebook_lib(): s= r""" | 7812d70ec18c3610dc87b53d5800fd7bc054e30a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/7812d70ec18c3610dc87b53d5800fd7bc054e30a/js.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14718,
67,
2941,
13332,
272,
33,
436,
8395,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14718,
67,
2941,
13332,
272,
33,
436,
8395,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
if file.startswith("src-"): fileParts = file.split("-") | if file.startswith("src!"): fileParts = file.split("!") | def find_files(path): for root, dirs, files in os.walk(path): for file in files: if file.startswith("src-"): fileParts = file.split("-") unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1] assert unused == "src" relPath = os.sep.join(relPathParts) yield relPath, file, newName | 02a126316c2b761233aed2d194e61074fc69620b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13096/02a126316c2b761233aed2d194e61074fc69620b/builddeb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
2354,
12,
803,
4672,
364,
1365,
16,
7717,
16,
1390,
316,
1140,
18,
11348,
12,
803,
4672,
364,
585,
316,
1390,
30,
309,
585,
18,
17514,
1918,
2932,
4816,
4442,
4672,
585,
4305... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
2354,
12,
803,
4672,
364,
1365,
16,
7717,
16,
1390,
316,
1140,
18,
11348,
12,
803,
4672,
364,
585,
316,
1390,
30,
309,
585,
18,
17514,
1918,
2932,
4816,
4442,
4672,
585,
4305... |
roledetails = run_sql("""SELECT * FROM accROLE WHERE name = '%s' """ % (name_role, )) | roledetails = run_sql("""SELECT * FROM accROLE WHERE name = %s """, (name_role, )) | def acc_find_delegated_roles(id_role_admin=0): """find all the roles the admin role has delegation rights over. return tuple of all the roles. id_role_admin - id of the admin role """ id_action_delegate = acc_getActionId(name_action=DELEGATEADDUSERROLE) rolenames = run_sql("""SELECT DISTINCT(ar.value) FROM accROLE_accACTION_accARGUMENT raa LEFT JOIN accARGUMENT ar ON raa.id_accARGUMENT = ar.id WHERE raa.id_accROLE = '%s' AND raa.id_accACTION = '%s' """ % (id_role_admin, id_action_delegate)) result = [] for (name_role, ) in rolenames: roledetails = run_sql("""SELECT * FROM accROLE WHERE name = '%s' """ % (name_role, )) if roledetails: result.append(roledetails) return result | 31e1b0bc8460287f2ab023e74c2aeb22a4d39413 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/31e1b0bc8460287f2ab023e74c2aeb22a4d39413/access_control_admin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4078,
67,
4720,
67,
3771,
1332,
690,
67,
7774,
12,
350,
67,
4615,
67,
3666,
33,
20,
4672,
3536,
4720,
777,
326,
4900,
326,
3981,
2478,
711,
23595,
14989,
1879,
18,
327,
3193,
434,
777,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4078,
67,
4720,
67,
3771,
1332,
690,
67,
7774,
12,
350,
67,
4615,
67,
3666,
33,
20,
4672,
3536,
4720,
777,
326,
4900,
326,
3981,
2478,
711,
23595,
14989,
1879,
18,
327,
3193,
434,
777,... |
from util.fxdimdb import FxdImdb, makeVideo | from util.fxdimdb import FxdImdb, makeVideo, str2XML | def create_fxd(self,rec_prog): from util.fxdimdb import FxdImdb, makeVideo fxd = FxdImdb() fxd.setFxdFile(config.TV_RECORD_DIR + '/' + rec_prog.filename) video = makeVideo('file', 'f1', os.path.basename(rec_prog.filename) + '.mpeg') fxd.setVideo(video) fxd.info['tagline'] = rec_prog.sub_title fxd.info['plot'] = rec_prog.desc fxd.info['runtime'] = None fxd.info['year'] = time.strftime('%m-%d %I:%M', time.localtime(rec_prog.start)) fxd.title = rec_prog.title fxd.writeFxd() # Maybe we should call util.videothumb.snapshot to make a snapshot too, but # we'd have to do it after a few minutes of recording | 3da7409bf188414e38c69594a407bd850540656f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/3da7409bf188414e38c69594a407bd850540656f/recordserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
74,
7669,
12,
2890,
16,
3927,
67,
14654,
4672,
628,
1709,
18,
19595,
3509,
1966,
1930,
478,
7669,
1170,
1966,
16,
1221,
10083,
16,
609,
22,
4201,
284,
7669,
273,
478,
7669,
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,
752,
67,
74,
7669,
12,
2890,
16,
3927,
67,
14654,
4672,
628,
1709,
18,
19595,
3509,
1966,
1930,
478,
7669,
1170,
1966,
16,
1221,
10083,
16,
609,
22,
4201,
284,
7669,
273,
478,
7669,
11... |
def _dirAttr(self, attr): | def _dirGetAttr(self, attr): | def _dirAttr(self, attr): """ Make the directory attributes call .dirSetup() if needed. """ attr = '_dir_setup_' + attr if not hasattr(self, attr): self.dirSetup() return getattr(self, attr) | acc85de7d75ed00616ac79909551b5a19d243d37 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5445/acc85de7d75ed00616ac79909551b5a19d243d37/yumRepo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1214,
967,
3843,
12,
2890,
16,
1604,
4672,
3536,
4344,
326,
1867,
1677,
745,
263,
1214,
7365,
1435,
309,
3577,
18,
3536,
1604,
273,
2070,
1214,
67,
8401,
4623,
397,
1604,
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,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1214,
967,
3843,
12,
2890,
16,
1604,
4672,
3536,
4344,
326,
1867,
1677,
745,
263,
1214,
7365,
1435,
309,
3577,
18,
3536,
1604,
273,
2070,
1214,
67,
8401,
4623,
397,
1604,
309,
486,
... |
last_comics=Comics.objects.filter(visible=True).order_by('-pub_date')[0] | last_comics=Comics.objects.filter(visible=True).order_by('-updated')[0] | def last(request): last_comics=Comics.objects.filter(visible=True).order_by('-pub_date')[0] return HttpResponseRedirect(last_comics.get_absolute_url()) | 5a2e126fa89a1f8d36b3344b4d086e88d57938ba /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7156/5a2e126fa89a1f8d36b3344b4d086e88d57938ba/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1142,
12,
2293,
4672,
1142,
67,
832,
2102,
33,
799,
2102,
18,
6911,
18,
2188,
12,
8613,
33,
5510,
2934,
1019,
67,
1637,
2668,
17,
7007,
6134,
63,
20,
65,
327,
31780,
12,
2722,
67,
83... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1142,
12,
2293,
4672,
1142,
67,
832,
2102,
33,
799,
2102,
18,
6911,
18,
2188,
12,
8613,
33,
5510,
2934,
1019,
67,
1637,
2668,
17,
7007,
6134,
63,
20,
65,
327,
31780,
12,
2722,
67,
83... |
if flicense != pflicense: flicense = flicense + ' (' + pflicense + ')' | if not policyset and flicense != 'TBD': llicense = flag_policy_issue(llicense, 'U') | def check_policy(flicense, llicense, library, static, issue): # is the lib dynamic or static? ltype = 'Dynamic' if static: ltype = 'Static' # it's possible that the license assigned to the target or library is one of # the aliases, in which case we need the 'official' name for the policy check pllicense = llicense # we want to display both names in the report, if present pflicense = flicense llicenseset = Aliases.objects.filter(alias = llicense) if llicenseset: # can only be one match pllicense = llicenseset[0].license flicenseset = Aliases.objects.filter(alias = flicense) if flicenseset: # can only be one match pflicense = flicenseset[0].license policyset = Policy.objects.filter(tlicense = pflicense, dlicense = pllicense) policyset = policyset.filter(Q(relationship = ltype) | Q(relationship = 'Both')) # if we got multiple matches, just return - bad policies if policyset and policyset.count() < 2: status = policyset[0].status # only set the issue flag for the target coloring for the disallowed case if status == 'D': issue = issue or True if llicense != pllicense: # plug in the alias (real name) llicense = llicense + ' (' + pllicense + ')' llicense = flag_policy_issue(llicense, status) if flicense != pflicense: flicense = flicense + ' (' + pflicense + ')' # modify the target when there's been a problem somewhere in the whole license set if issue: flicense = flag_policy_issue(flicense, 'D') return issue, llicense, flicense | 451c4e3c805fe84725cdce5f847784b27c2b1560 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/451c4e3c805fe84725cdce5f847784b27c2b1560/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
5086,
12,
2242,
5142,
16,
6579,
5142,
16,
5313,
16,
760,
16,
5672,
4672,
468,
353,
326,
2561,
5976,
578,
760,
35,
328,
723,
273,
296,
9791,
11,
309,
760,
30,
328,
723,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
5086,
12,
2242,
5142,
16,
6579,
5142,
16,
5313,
16,
760,
16,
5672,
4672,
468,
353,
326,
2561,
5976,
578,
760,
35,
328,
723,
273,
296,
9791,
11,
309,
760,
30,
328,
723,
273,
... |
@keyword extraArgs: As a last resort, arbitrary arguments may be passed | @keyword extraArgs: As a last resort, arbitrary arguments may be passed | def __init__(self, recipe, *args, **keywords): | bbf56a2c6ce326846b9cfaed245edce8bd904567 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8747/bbf56a2c6ce326846b9cfaed245edce8bd904567/source.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
16100,
16,
380,
1968,
16,
2826,
11771,
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,
... | [
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,
1001,
2738,
972,
12,
2890,
16,
16100,
16,
380,
1968,
16,
2826,
11771,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
path = urllib.unquote(path) | def __call__(self, request_string, handle_errors=True, form=None): # Commit work done by previous python code. commit() | 73d71b7ab2440ab5c178371b3ded84bd300222a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9519/73d71b7ab2440ab5c178371b3ded84bd300222a6/functional.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
590,
67,
1080,
16,
1640,
67,
4324,
33,
5510,
16,
646,
33,
7036,
4672,
468,
10269,
1440,
2731,
635,
2416,
5790,
981,
18,
3294,
1435,
2,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
590,
67,
1080,
16,
1640,
67,
4324,
33,
5510,
16,
646,
33,
7036,
4672,
468,
10269,
1440,
2731,
635,
2416,
5790,
981,
18,
3294,
1435,
2,
-100,
-100,
-100,
... | |
if len(most_likely): | if len(most_likely): | def _displaySeries(self, allSeries_array): """Helper function, lists series with corresponding ID """ if video_type == u'IMDB': URL = u'http://www.imdb.com/title/tt' URL2 = u'http://www.imdb.com/find?s=all&q='+urllib.quote_plus(UI_title.encode("utf-8"))+'&x=0&y=0' reftype = u'IMDB' elif video_type == u'TMDB': URL = u'http://themoviedb.org/movie/' URL2 = u'http://themoviedb.org/' reftype = u'TMDB' else: # TVDB URL = u'http://thetvdb.com/index.php?tab=series&id=%s&lid=%s' URL2 = u'http://thetvdb.com/?tab=advancedsearch' reftype = u'thetvdb' tmp_title = u'' | 6089d4d60f2dab84c6af9981c242684b162de38e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13713/6089d4d60f2dab84c6af9981c242684b162de38e/jamu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5417,
6485,
12,
2890,
16,
777,
6485,
67,
1126,
4672,
3536,
2276,
445,
16,
6035,
4166,
598,
4656,
1599,
3536,
309,
6191,
67,
723,
422,
582,
11,
3445,
2290,
4278,
1976,
273,
582,
11... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5417,
6485,
12,
2890,
16,
777,
6485,
67,
1126,
4672,
3536,
2276,
445,
16,
6035,
4166,
598,
4656,
1599,
3536,
309,
6191,
67,
723,
422,
582,
11,
3445,
2290,
4278,
1976,
273,
582,
11... |
yield p[:-1] + [p[-1] + 1] yield p + [1] | yield Partition_class(list(p[:-1]) + [p[-1] + 1]) yield Partition_class(p + [1]) | def iterator(self): """ An iterator a list of the partitions of n. | 11af6766ba02a77f5cdbb878238210bc101dacef /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/11af6766ba02a77f5cdbb878238210bc101dacef/partition.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2775,
12,
2890,
4672,
3536,
1922,
2775,
279,
666,
434,
326,
10060,
434,
290,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2775,
12,
2890,
4672,
3536,
1922,
2775,
279,
666,
434,
326,
10060,
434,
290,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.assertFalse(Decimal(1) < None) self.assertTrue(Decimal(1) > None) | with check_py3k_warnings(): self.assertFalse(Decimal(1) < None) self.assertTrue(Decimal(1) > None) | def test_comparison_operators(self): | 6d3ff2bc452eeec5ff97424d92c4a6cbc97e9a2f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/6d3ff2bc452eeec5ff97424d92c4a6cbc97e9a2f/test_decimal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
23050,
67,
30659,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
23050,
67,
30659,
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,
-10... |
If ``m``, ``n`` are not None, returns a solution `x` to the | If ``m``, ``n`` are not ``None``, returns a solution `x` to the | def crt(a,b,m=None,n=None): r""" Returns a solution to a Chinese Remainder Theorem problem. INPUT: - ``a``, ``b`` - two residues (elements of some ring for which extended gcd is available), or two lists, one of residues and one of moduli. - ``m``, ``n`` - two moduli, or None. OUTPUT: If ``m``, ``n`` are not None, returns a solution `x` to the simultaneous congruences `x\equiv a \bmod m` and `x\equiv b \bmod n`, if one exists; which is if and only if `a\equiv b\pmod{\gcd(m,n)}` by the Chinese Remainder Theorem. The solution `x` is only well-defined modulo lcm`(m,n)`. If ``a`` and ``b`` are lists, returns a simultaneous solution to the congruences `x\equiv a_i\pmod{b_i}`, if one exists. EXAMPLES:: sage: crt(2, 1, 3, 5) 11 sage: crt(13,20,100,301) 28013 You can also use upper case:: sage: c = CRT(2,3, 3, 5); c 8 sage: c % 3 == 2 True sage: c % 5 == 3 True Note that this also works for polynomial rings:: sage: K.<a> = NumberField(x^3 - 7) sage: R.<y> = K[] sage: f = y^2 + 3 sage: g = y^3 - 5 sage: CRT(1,3,f,g) -3/26*y^4 + 5/26*y^3 + 15/26*y + 53/26 sage: CRT(1,a,f,g) (-3/52*a + 3/52)*y^4 + (5/52*a - 5/52)*y^3 + (15/52*a - 15/52)*y + 27/52*a + 25/52 You can also do this for any number of moduli:: sage: K.<a> = NumberField(x^3 - 7) sage: R.<x> = K[] sage: CRT([], []) 0 sage: CRT([a], [x]) a sage: f = x^2 + 3 sage: g = x^3 - 5 sage: h = x^5 + x^2 - 9 sage: k = CRT([1, a, 3], [f, g, h]); k (127/26988*a - 5807/386828)*x^9 + (45/8996*a - 33677/1160484)*x^8 + (2/173*a - 6/173)*x^7 + (133/6747*a - 5373/96707)*x^6 + (-6/2249*a + 18584/290121)*x^5 + (-277/8996*a + 38847/386828)*x^4 + (-135/4498*a + 42673/193414)*x^3 + (-1005/8996*a + 470245/1160484)*x^2 + (-1215/8996*a + 141165/386828)*x + 621/8996*a + 836445/386828 sage: k.mod(f) 1 sage: k.mod(g) a sage: k.mod(h) 3 If the moduli are not coprime, a solution may not exist:: sage: crt(4,8,8,12) 20 sage: crt(4,6,8,12) Traceback (most recent call last): ... ValueError: No solution to crt problem since gcd(8,12) does not divide 4-6 sage: x = polygen(QQ) sage: crt(2,3,x-1,x+1) -1/2*x + 5/2 sage: crt(2,x,x^2-1,x^2+1) -1/2*x^3 + x^2 + 1/2*x + 1 sage: crt(2,x,x^2-1,x^3-1) Traceback (most recent call last): ... ValueError: No solution to crt problem since gcd(x^2 - 1,x^3 - 1) does not divide 2-x """ if isinstance(a,list): return CRT_list(a,b) g, alpha, beta = XGCD(m,n) q,r = (b-a).quo_rem(g) if r!=0: raise ValueError, "No solution to crt problem since gcd(%s,%s) does not divide %s-%s"%(m,n,a,b) return (a+q*alpha*m) % lcm(m,n) | 7ea827af7c3137ff225a616d3aa3bc906313a7e7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/7ea827af7c3137ff225a616d3aa3bc906313a7e7/arith.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30677,
12,
69,
16,
70,
16,
81,
33,
7036,
16,
82,
33,
7036,
4672,
436,
8395,
2860,
279,
6959,
358,
279,
1680,
25331,
2663,
25407,
1021,
479,
81,
6199,
18,
225,
12943,
30,
225,
300,
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,
30677,
12,
69,
16,
70,
16,
81,
33,
7036,
16,
82,
33,
7036,
4672,
436,
8395,
2860,
279,
6959,
358,
279,
1680,
25331,
2663,
25407,
1021,
479,
81,
6199,
18,
225,
12943,
30,
225,
300,
12... |
sums = ["COALESCE(AVG(load_1),0)", "COALESCE(AVG(load_5),0)", "COALESCE(AVG(load_15),0)"] | sums = ["ROUND((COALESCE(AVG(load_1),0))::numeric, 2)", "ROUND((COALESCE(AVG(load_5),0))::numeric, 2)", "ROUND((COALESCE(AVG(load_15),0))::numeric, 2)"] | def get_graph(self, end_date, report_days, host=None, user=None, email=None): if email or host or user: return None | 76334c6b3cd698e75ba1c275cbedf6be7e3e6aea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/87/76334c6b3cd698e75ba1c275cbedf6be7e3e6aea/untangle_server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4660,
12,
2890,
16,
679,
67,
712,
16,
2605,
67,
9810,
16,
1479,
33,
7036,
16,
729,
33,
7036,
16,
2699,
33,
7036,
4672,
309,
2699,
578,
1479,
578,
729,
30,
327,
599,
2,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4660,
12,
2890,
16,
679,
67,
712,
16,
2605,
67,
9810,
16,
1479,
33,
7036,
16,
729,
33,
7036,
16,
2699,
33,
7036,
4672,
309,
2699,
578,
1479,
578,
729,
30,
327,
599,
2,
-10... |
elif type(filename) == file: | else: | 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, FixScaled 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.") vaspdir = os.path.dirname(f.name) # 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: atomtypes = atomtypes_outpot(vaspdir) 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() if len(atomtypes) < len(numofatoms): # First line in POSCAR/CONTCAR didn't contain enough symbols. atomtypes = atomtypes_outpot(vaspdir) for i, num in enumerate(numofatoms): numofatoms[i] = int(num) [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(FixScaled(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 | 44efe7d3c2ff1e3b93464592763dabf693007241 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1380/44efe7d3c2ff1e3b93464592763dabf693007241/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,
... |
return [self.addEdge(polygon, container = container, **attr)] | return [self.addEdge(polygon, **attr)] | def addClippedPoly(self, polygon, container = True, **attr): """fe.addClippedPoly(polygon, ...) | 311763453fb1b797fe60147ddccc21bd3aca3c63 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10394/311763453fb1b797fe60147ddccc21bd3aca3c63/figexport.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
15339,
1845,
12487,
12,
2890,
16,
7154,
16,
1478,
273,
1053,
16,
2826,
1747,
4672,
3536,
3030,
18,
1289,
15339,
1845,
12487,
12,
20917,
16,
1372,
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,
0,
0,
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,
527,
15339,
1845,
12487,
12,
2890,
16,
7154,
16,
1478,
273,
1053,
16,
2826,
1747,
4672,
3536,
3030,
18,
1289,
15339,
1845,
12487,
12,
20917,
16,
1372,
13,
2,
-100,
-100,
-100,
-100,
-100... |
orig_request=request, | orig_request=rq.request, | def HandleResponse(self, payload, ip, port): """Asynchronous handler for a confd reply | 71e114da4ce07bcbe76516069b621ac459da3d69 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7542/71e114da4ce07bcbe76516069b621ac459da3d69/client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5004,
1064,
12,
2890,
16,
2385,
16,
2359,
16,
1756,
4672,
3536,
1463,
7121,
1838,
364,
279,
2195,
72,
4332,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5004,
1064,
12,
2890,
16,
2385,
16,
2359,
16,
1756,
4672,
3536,
1463,
7121,
1838,
364,
279,
2195,
72,
4332,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
def modules(self, mod, version, *args, **kw): | def modules(self, mod, version='latest', *args, **kw): if version=="latest": ncmodules = Ncmodule.select(AND(Ncmodule.q.modname==mod, Ncmodule.q.islatest=="1"), orderBy=Ncmodule.q.modname) for ncmodule in ncmodules: version = ncmodule.version | def modules(self, mod, version, *args, **kw): return dict(modmenu=moduleJumpMenu, mod=mod, version=version, copyright=0) | 9acdc9250215acbd7c076c011826f96166610743 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3309/9acdc9250215acbd7c076c011826f96166610743/controllers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4381,
12,
2890,
16,
681,
16,
1177,
2218,
13550,
2187,
380,
1968,
16,
2826,
9987,
4672,
309,
1177,
31713,
13550,
6877,
8194,
6400,
273,
423,
71,
2978,
18,
4025,
12,
4307,
12,
50,
71,
29... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4381,
12,
2890,
16,
681,
16,
1177,
2218,
13550,
2187,
380,
1968,
16,
2826,
9987,
4672,
309,
1177,
31713,
13550,
6877,
8194,
6400,
273,
423,
71,
2978,
18,
4025,
12,
4307,
12,
50,
71,
29... |
self.optimize_loop(ops, 'Not, Not, Not', ops) | self.optimize_loop(ops, 'Not, Not, Not', expected, preamble) | def test_p123_array(self): ops = """ [i1, p2, p3] i3 = getarrayitem_gc(p3, 0, descr=arraydescr) escape(i3) p1 = new_array(1, descr=arraydescr) setarrayitem_gc(p1, 0, i1, descr=arraydescr) jump(i1, p1, p2) """ # We cannot track virtuals that survive for more than two iterations. self.optimize_loop(ops, 'Not, Not, Not', ops) | 1ca649089b6d3244f4d70d4547c3779712b8c025 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6934/1ca649089b6d3244f4d70d4547c3779712b8c025/test_optimizeopt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
84,
12936,
67,
1126,
12,
2890,
4672,
6727,
273,
3536,
306,
77,
21,
16,
293,
22,
16,
293,
23,
65,
277,
23,
273,
336,
1126,
1726,
67,
13241,
12,
84,
23,
16,
374,
16,
18426,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
84,
12936,
67,
1126,
12,
2890,
4672,
6727,
273,
3536,
306,
77,
21,
16,
293,
22,
16,
293,
23,
65,
277,
23,
273,
336,
1126,
1726,
67,
13241,
12,
84,
23,
16,
374,
16,
18426,... |
self.mode = mode | text.mode = mode | def makefile(self, mode="r", buffering=None, *, encoding=None, newline=None): """Return an I/O stream connected to the socket. | 694e54248e72f4b22db6eef0871bc48c14e819c9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/694e54248e72f4b22db6eef0871bc48c14e819c9/socket.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
768,
12,
2890,
16,
1965,
1546,
86,
3113,
25056,
33,
7036,
16,
380,
16,
2688,
33,
7036,
16,
9472,
33,
7036,
4672,
3536,
990,
392,
467,
19,
51,
1407,
5840,
358,
326,
2987,
18,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
768,
12,
2890,
16,
1965,
1546,
86,
3113,
25056,
33,
7036,
16,
380,
16,
2688,
33,
7036,
16,
9472,
33,
7036,
4672,
3536,
990,
392,
467,
19,
51,
1407,
5840,
358,
326,
2987,
18,
2,... |
return cmp( self.__dict__, other.__dict__ ) | if isinstance( other, Edge ): return cmp( self.__dict__, other.__dict__ ) else: return 1 | def __cmp__( self, other ): return cmp( self.__dict__, other.__dict__ ) | c6bcf26fe82668b7bdd694f068d800327c24240b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2104/c6bcf26fe82668b7bdd694f068d800327c24240b/newick.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9625,
972,
12,
365,
16,
1308,
262,
30,
327,
9411,
12,
365,
16186,
1576,
972,
16,
1308,
16186,
1576,
972,
262,
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,
9625,
972,
12,
365,
16,
1308,
262,
30,
327,
9411,
12,
365,
16186,
1576,
972,
16,
1308,
16186,
1576,
972,
262,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
print ("WARNING: Cannot include %s -- " "file not found" % filename) | logging.warning("Cannot include %s -- file not found", filename) | def parse(self, file, list, restricted=False, prev_indent=-1): """ Read and parse lines from file until a line with an indent level lower than or equal to prev_indent is encountered. | 0ae821998f2c2f979b34b606091ddc8d892b33a9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12268/0ae821998f2c2f979b34b606091ddc8d892b33a9/kvm_config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
585,
16,
666,
16,
15693,
33,
8381,
16,
2807,
67,
9355,
29711,
21,
4672,
3536,
2720,
471,
1109,
2362,
628,
585,
3180,
279,
980,
598,
392,
3504,
1801,
2612,
2353,
578... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1109,
12,
2890,
16,
585,
16,
666,
16,
15693,
33,
8381,
16,
2807,
67,
9355,
29711,
21,
4672,
3536,
2720,
471,
1109,
2362,
628,
585,
3180,
279,
980,
598,
392,
3504,
1801,
2612,
2353,
578... |
self.randomlist = [] folderlist = [] | self.randomlist = [] folderlist = [] | def expand_filelist_and_load_image(self, inputlist): | a4d6024d09d807bd2a142bf54daca1a7d1873c7f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2291/a4d6024d09d807bd2a142bf54daca1a7d1873c7f/mirage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4542,
67,
7540,
5449,
67,
464,
67,
945,
67,
2730,
12,
2890,
16,
810,
1098,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4542,
67,
7540,
5449,
67,
464,
67,
945,
67,
2730,
12,
2890,
16,
810,
1098,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if not self.buffers.has_key(key): return for buff in self.buffers[key]: if buff.peer==arg or buff.peer==arg.bare(): buff.buffer.update() | if not self.conversations.has_key(key): return for conv in self.conversations[key]: if conv.peer==arg or conv.peer==arg.bare(): conv.buffer.update() | def ev_presence_changed(self,event,arg): key=arg.bare().as_unicode() if not self.buffers.has_key(key): return for buff in self.buffers[key]: if buff.peer==arg or buff.peer==arg.bare(): buff.buffer.update() | 2ed38e70a33bd2df44c8386053a4e6083705130d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12768/2ed38e70a33bd2df44c8386053a4e6083705130d/message.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2113,
67,
21731,
67,
6703,
12,
2890,
16,
2575,
16,
3175,
4672,
498,
33,
3175,
18,
70,
834,
7675,
345,
67,
9124,
1435,
309,
486,
365,
18,
28101,
18,
5332,
67,
856,
12,
856,
4672,
327,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2113,
67,
21731,
67,
6703,
12,
2890,
16,
2575,
16,
3175,
4672,
498,
33,
3175,
18,
70,
834,
7675,
345,
67,
9124,
1435,
309,
486,
365,
18,
28101,
18,
5332,
67,
856,
12,
856,
4672,
327,... |
os.chdir("/tmp/__bazaarTests/testplayground") | os.chdir("/tmp/__%s_bazaarTests/testplayground" % str(self.pid)) | def setUp(self): self.pid = os.getpid() c = ["rm -rf /tmp/__bazaarTests", "mkdir /tmp/__bazaarTests", "mkdir /tmp/__bazaarTests/master", "mkdir /tmp/__bazaarTests/testplayground", "cd /tmp/__bazaarTests/master;bzr init .", "touch /tmp/__bazaarTests/master/AFile", "cd /tmp/__bazaarTests/master;bzr add AFile", "cd /tmp/__bazaarTests/master;bzr commit -m 'Inital Version' AFile", ] self.runCommands(c) self.originalPath = os.getcwd() os.chdir("/tmp/__bazaarTests/testplayground") | 9f01e142ab8d5e3f70a2165bd2869f15e046c1c9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8259/9f01e142ab8d5e3f70a2165bd2869f15e046c1c9/BazaarTests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
12,
2890,
4672,
365,
18,
6610,
273,
1140,
18,
588,
6610,
1435,
276,
273,
8247,
8864,
300,
5809,
342,
5645,
19,
972,
70,
1561,
69,
297,
14650,
3113,
315,
26686,
342,
5645,
19,
97... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
12,
2890,
4672,
365,
18,
6610,
273,
1140,
18,
588,
6610,
1435,
276,
273,
8247,
8864,
300,
5809,
342,
5645,
19,
972,
70,
1561,
69,
297,
14650,
3113,
315,
26686,
342,
5645,
19,
97... |
print "%s ERROR: %s %s failed: %d (%s) (%f seconds)" % (prefix, command, args, e.errno, e.strerror, elapsedtime) | print "\n%s ERROR: %s %s failed: %d (%s) (%f seconds)\n" % (prefix, command, args, e.errno, e.strerror, elapsedtime) | def forkexec(command, args): global prefix global elapsedtime #print command #print args try: pid = os.fork() if pid == 0: # Child os.execvp(command, args) flushbuffers() else: # Parent return pid except OSError, e: print "%s ERROR: %s %s failed: %d (%s) (%f seconds)" % (prefix, command, args, e.errno, e.strerror, elapsedtime) flushexit(exitOSError) | e66e48a291dc1a59e55600b2f95f4526a0e16fe2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13067/e66e48a291dc1a59e55600b2f95f4526a0e16fe2/timed_run.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12515,
4177,
12,
3076,
16,
833,
4672,
2552,
1633,
2552,
9613,
957,
468,
1188,
1296,
468,
1188,
833,
775,
30,
4231,
273,
1140,
18,
23335,
1435,
309,
4231,
422,
374,
30,
225,
468,
7451,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12515,
4177,
12,
3076,
16,
833,
4672,
2552,
1633,
2552,
9613,
957,
468,
1188,
1296,
468,
1188,
833,
775,
30,
4231,
273,
1140,
18,
23335,
1435,
309,
4231,
422,
374,
30,
225,
468,
7451,
... |
self.escape_trailing_spaces) | self.escape_trailing_spaces), | def get_title_line(): """Add the first line, mostly for decoration""" read_string = self.read_only and "read only" or "read/write" if self.name: return ('Detected abilities for %s (%s) file system:' % (self.name, read_string)) else: return ('Detected abilities for %s file system' % (read_string,)) | f60608f98fd8ab8c759a2551cbdf0e1be9520518 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/783/f60608f98fd8ab8c759a2551cbdf0e1be9520518/fs_abilities.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2649,
67,
1369,
13332,
3536,
986,
326,
1122,
980,
16,
23958,
364,
29217,
8395,
855,
67,
1080,
273,
365,
18,
896,
67,
3700,
471,
315,
896,
1338,
6,
578,
315,
896,
19,
2626,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2649,
67,
1369,
13332,
3536,
986,
326,
1122,
980,
16,
23958,
364,
29217,
8395,
855,
67,
1080,
273,
365,
18,
896,
67,
3700,
471,
315,
896,
1338,
6,
578,
315,
896,
19,
2626,
6... |
yield UInt32(self, "offset", "Some kind of offset (?)") elif self["flags"].value == 0xA0000007: yield CString(self, "file_path", "Path to icon") | yield UInt32(self, "offset", "Offset to Item ID entry") elif self["signature"].value in (0xA0000001, 0xA0000006, 0xA0000007): if self["signature"].value == 0xA0000001: object_name="target" elif self["signature"].value == 0xA0000006: object_name="darwinID" else: object_name="icon_path" yield CString(self, object_name, "Data (ASCII format)", charset="ASCII") remaining = self["length"].value - self.current_size/8 - 260*2 if remaining: yield RawBytes(self, "slack_space[]", remaining, "Data beyond end of string") yield CString(self, object_name+'_unicode', "Data (Unicode format)", charset="UTF-16-LE", truncate="\0") remaining = self["length"].value - self.current_size/8 if remaining: yield RawBytes(self, "slack_space[]", remaining, "Data beyond end of string") elif self["signature"].value == 0xA0000002: yield ColorTableIndex(self, "color_text", 4, "Screen text color index") yield ColorTableIndex(self, "color_bg", 4, "Screen background color index") yield NullBytes(self, "reserved[]", 1) yield ColorTableIndex(self, "color_popup_text", 4, "Pop-up text color index") yield ColorTableIndex(self, "color_popup_bg", 4, "Pop-up background color index") yield NullBytes(self, "reserved[]", 1) yield UInt16(self, "buffer_width", "Screen buffer width (character cells)") yield UInt16(self, "buffer_height", "Screen buffer height (character cells)") yield UInt16(self, "window_width", "Window width (character cells)") yield UInt16(self, "window_height", "Window height (character cells)") yield UInt16(self, "position_left", "Window distance from left edge (screen coords)") yield UInt16(self, "position_top", "Window distance from top edge (screen coords)") yield UInt32(self, "font_number") yield UInt32(self, "input_buffer_size") yield UInt16(self, "font_width", "Font width in pixels; 0 for a non-raster font") yield UInt16(self, "font_height", "Font height in pixels; equal to the font size for non-raster fonts") yield UInt32(self, "font_family") yield UInt32(self, "font_weight") yield String(self, "font_name_unicode", 64, "Font Name (Unicode format)", charset="UTF-16-LE", truncate="\0") yield UInt32(self, "cursor_size", "Relative size of cursor (% of character size)") yield Enum(UInt32(self, "full_screen", "Run console in full screen?"), self.BOOL_ENUM) yield Enum(UInt32(self, "quick_edit", "Console uses quick-edit feature (using mouse to cut & paste)?"), self.BOOL_ENUM) yield Enum(UInt32(self, "insert_mode", "Console uses insertion mode?"), self.BOOL_ENUM) yield Enum(UInt32(self, "auto_position", "System automatically positions window?"), self.BOOL_ENUM) yield UInt32(self, "history_size", "Size of the history buffer (in lines)") yield UInt32(self, "history_count", "Number of history buffers (each process gets one up to this limit)") yield Enum(UInt32(self, "history_no_dup", "Automatically eliminate duplicate lines in the history buffer?"), self.BOOL_ENUM) for index in xrange(16): yield ColorRef(self, "color[]") elif self["signature"].value == 0xA0000004: yield UInt32(self, "codepage", "Console's code page") else: | def createFields(self): yield UInt32(self, "length", "Length of this structure") if not self["length"].value: return | 2078f158e6614c23c8bcfb26762a3370d667c630 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9327/2078f158e6614c23c8bcfb26762a3370d667c630/lnk.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
2314,
12,
2890,
4672,
2824,
29810,
1578,
12,
2890,
16,
315,
2469,
3113,
315,
1782,
434,
333,
3695,
7923,
309,
486,
365,
9614,
2469,
6,
8009,
1132,
30,
327,
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,
752,
2314,
12,
2890,
4672,
2824,
29810,
1578,
12,
2890,
16,
315,
2469,
3113,
315,
1782,
434,
333,
3695,
7923,
309,
486,
365,
9614,
2469,
6,
8009,
1132,
30,
327,
2,
-100,
-100,
-100,
-1... |
settings = oUser.settings self.params = { 'USER': oUser.displayName.value, | self.params = { 'USER' : oUser.displayName.value, | def setParams(self): self.isPage = True self.response.setHeader('cache-control', 'no-cache') oUser = self.session.user settings = oUser.settings self.params = { 'USER': oUser.displayName.value, 'AUTO_RUN' : '', 'RUN_MAXIMIZED' : 0, 'SETTINGS_DISABLED' : '', 'LOGOFF_DISABLED' : '' } if hasattr(oUser, 'authenticate'): self.params['AUTO_RUN'] = \ settings.value.setdefault('AUTO_RUN', '') self.params['RUN_MAXIMIZED'] = \ int(settings.value.setdefault('RUN_MAXIMIZED', False)) taskbar_position = \ settings.value.setdefault('TASK_BAR_POS', 'bottom') else: taskbar_position = 'bottom' self.params['SETTINGS_DISABLED'] = 'true' self.params['LOGOFF_DISABLED'] = 'true' self.params['REPOSITORY_DISABLED'] = 'true' self.params['PERSONAL_FOLDER'] = '' if hasattr(oUser, 'personalFolder'): self.params['REPOSITORY_DISABLED'] = 'false' self.params['PERSONAL_FOLDER'] = oUser.personalFolder.value # has the user access to recycle bin? rb_icon = '' rb = self.server.store.getItem('rb') if rb: rb_icon = ''' <a:icon top="80" left="10" width="80" height="80" imgalign="top" ondblclick="generic.openContainer" img="desktop/images/trashcan_full.gif" color="white" caption="%s"> <a:prop name="folderID" value="rb"></a:prop> </a:icon> ''' % rb.displayName.value desktop_pane = DESKSTOP_PANE % (self.item.displayName.value, rb_icon) if taskbar_position == 'bottom': self.params['TOP'] = desktop_pane self.params['BOTTOM'] = '' else: self.params['TOP'] = '' self.params['BOTTOM'] = desktop_pane # get applications oCmd = OqlCommand() sOql = "select launchUrl,displayName,icon from 'apps' " + \ "order by displayName asc" apps = oCmd.execute(sOql) sApps = '' if len(apps) > 0: for app in apps: sApps += '''<a:menuoption img="%s" caption="%s" onclick="generic.runApp"> <a:prop name="url" value="%s"></a:prop> </a:menuoption>''' % \ (app['icon'], app['displayName'], app['launchUrl']) self.params['APPS'] = sApps else: self.params['APPS'] = '<a:menuoption caption="@@EMPTY@@"' + \ ' disabled="true"></a:menuoption>' | 488b771208f9b662e97052dfdad15ee0e0aeda9b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2504/488b771208f9b662e97052dfdad15ee0e0aeda9b/ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31705,
12,
2890,
4672,
365,
18,
291,
1964,
273,
1053,
365,
18,
2740,
18,
542,
1864,
2668,
2493,
17,
7098,
2187,
296,
2135,
17,
2493,
6134,
225,
15380,
273,
365,
18,
3184,
18,
1355,
225... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31705,
12,
2890,
4672,
365,
18,
291,
1964,
273,
1053,
365,
18,
2740,
18,
542,
1864,
2668,
2493,
17,
7098,
2187,
296,
2135,
17,
2493,
6134,
225,
15380,
273,
365,
18,
3184,
18,
1355,
225... |
* *host* is a hostname, an IPv4 dotted quad, or an IPv6 address wrapped in square brackets. e.g. freevo.org, 192.168.0.1, [3000::1] | * *host* is an IPv4 dotted quad or an IPv6 address wrapped in square brackets. e.g. 192.168.0.1, [3000::1] | def listen(self, bind_info, qlen=5): """ Sets the socket to listen. | a3c47eb439eb3a998c22d6bc63fbcd891e4cb35c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11722/a3c47eb439eb3a998c22d6bc63fbcd891e4cb35c/sockets.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6514,
12,
2890,
16,
1993,
67,
1376,
16,
1043,
1897,
33,
25,
4672,
3536,
11511,
326,
2987,
358,
6514,
18,
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,
6514,
12,
2890,
16,
1993,
67,
1376,
16,
1043,
1897,
33,
25,
4672,
3536,
11511,
326,
2987,
358,
6514,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
"""Initialize color and image collections.""" colors['bash.esm'] = (220,220,255) colors['bash.doubleTime.not'] = 'WHITE' colors['bash.doubleTime.exists'] = (255,220,220) colors['bash.doubleTime.load'] = (255,100,100) colors['bash.exOverLoaded'] = (0xFF,0x99,0) colors['bash.masters.remapped'] = (100,255,100) colors['bash.masters.changed'] = (220,255,220) colors['bash.mods.isMergeable'] = (0x00,0x99,0x00) colors['bash.mods.groupHeader'] = (0xD8,0xD8,0xD8) colors['bash.mods.isGhost'] = (0xe8,0xe8,0xe8) colors['bash.installers.skipped'] = (0xe0,0xe0,0xe0) colors['bash.installers.outOfOrder'] = (0xDF,0xDF,0xC5) colors['bash.installers.dirty'] = (0xFF,0xBB,0x33) images['save.on'] = Image(r'images/save_on.png',wx.BITMAP_TYPE_PNG) images['save.off'] = Image(r'images/save_off.png',wx.BITMAP_TYPE_PNG) images['help'] = Image(r'images/help.png',wx.BITMAP_TYPE_PNG) images['doc.on'] = Image(r'images/page_find.png',wx.BITMAP_TYPE_PNG) images['bashmon'] = Image(r'images/group_gear.png',wx.BITMAP_TYPE_PNG) images['modChecker'] = Image(r'images/table_error.png',wx.BITMAP_TYPE_PNG) images['checkbox.red.x'] = Image(r'images/checkbox_red_x.png',wx.BITMAP_TYPE_PNG) images['checkbox.green.on.32'] = (Image(r'images/checkbox_green_on_32.png',wx.BITMAP_TYPE_PNG)) images['checkbox.blue.on.32'] = (Image(r'images/checkbox_blue_on_32.png',wx.BITMAP_TYPE_PNG)) images['bash.16'] = Image(r'images/bash_16.png',wx.BITMAP_TYPE_PNG) images['bash.32'] = Image(r'images/bash_32.png',wx.BITMAP_TYPE_PNG) images['bash.16.blue'] = Image(r'images/bash_16_blue.png',wx.BITMAP_TYPE_PNG) images['bash.32.blue'] = Image(r'images/bash_32_blue.png',wx.BITMAP_TYPE_PNG) global bashRed bashRed = balt.ImageBundle() bashRed.Add(images['bash.16']) bashRed.Add(images['bash.32']) global bashBlue bashBlue = balt.ImageBundle() bashBlue.Add(images['bash.16.blue']) bashBlue.Add(images['bash.32.blue']) | """Initialize color and image collections.""" colors['bash.esm'] = (220,220,255) colors['bash.doubleTime.not'] = 'WHITE' colors['bash.doubleTime.exists'] = (255,220,220) colors['bash.doubleTime.load'] = (255,100,100) colors['bash.exOverLoaded'] = (0xFF,0x99,0) colors['bash.masters.remapped'] = (100,255,100) colors['bash.masters.changed'] = (220,255,220) colors['bash.mods.isMergeable'] = (0x00,0x99,0x00) colors['bash.mods.groupHeader'] = (0xD8,0xD8,0xD8) colors['bash.mods.isGhost'] = (0xe8,0xe8,0xe8) colors['bash.installers.skipped'] = (0xe0,0xe0,0xe0) colors['bash.installers.outOfOrder'] = (0xDF,0xDF,0xC5) colors['bash.installers.dirty'] = (0xFF,0xBB,0x33) images['save.on'] = Image(r'images/save_on.png',wx.BITMAP_TYPE_PNG) images['save.off'] = Image(r'images/save_off.png',wx.BITMAP_TYPE_PNG) images['help'] = Image(r'images/help.png',wx.BITMAP_TYPE_PNG) images['doc.on'] = Image(r'images/page_find.png',wx.BITMAP_TYPE_PNG) images['bashmon'] = Image(r'images/group_gear.png',wx.BITMAP_TYPE_PNG) images['modChecker'] = Image(r'images/table_error.png',wx.BITMAP_TYPE_PNG) images['checkbox.red.x'] = Image(r'images/checkbox_red_x.png',wx.BITMAP_TYPE_PNG) images['checkbox.green.on.32'] = (Image(r'images/checkbox_green_on_32.png',wx.BITMAP_TYPE_PNG)) images['checkbox.blue.on.32'] = (Image(r'images/checkbox_blue_on_32.png',wx.BITMAP_TYPE_PNG)) images['bash.16'] = Image(r'images/bash_16.png',wx.BITMAP_TYPE_PNG) images['bash.32'] = Image(r'images/bash_32.png',wx.BITMAP_TYPE_PNG) images['bash.16.blue'] = Image(r'images/bash_16_blue.png',wx.BITMAP_TYPE_PNG) images['bash.32.blue'] = Image(r'images/bash_32_blue.png',wx.BITMAP_TYPE_PNG) global bashRed bashRed = balt.ImageBundle() bashRed.Add(images['bash.16']) bashRed.Add(images['bash.32']) global bashBlue bashBlue = balt.ImageBundle() bashBlue.Add(images['bash.16.blue']) bashBlue.Add(images['bash.32.blue']) | def InitImages(): """Initialize color and image collections.""" #--Colors colors['bash.esm'] = (220,220,255) colors['bash.doubleTime.not'] = 'WHITE' colors['bash.doubleTime.exists'] = (255,220,220) colors['bash.doubleTime.load'] = (255,100,100) colors['bash.exOverLoaded'] = (0xFF,0x99,0) colors['bash.masters.remapped'] = (100,255,100) colors['bash.masters.changed'] = (220,255,220) colors['bash.mods.isMergeable'] = (0x00,0x99,0x00) colors['bash.mods.groupHeader'] = (0xD8,0xD8,0xD8) colors['bash.mods.isGhost'] = (0xe8,0xe8,0xe8) colors['bash.installers.skipped'] = (0xe0,0xe0,0xe0) colors['bash.installers.outOfOrder'] = (0xDF,0xDF,0xC5) colors['bash.installers.dirty'] = (0xFF,0xBB,0x33) #--Standard images['save.on'] = Image(r'images/save_on.png',wx.BITMAP_TYPE_PNG) images['save.off'] = Image(r'images/save_off.png',wx.BITMAP_TYPE_PNG) #--Misc #images['fallout3'] = Image(r'images/fallout3.png',wx.BITMAP_TYPE_PNG) images['help'] = Image(r'images/help.png',wx.BITMAP_TYPE_PNG) #--Tools images['doc.on'] = Image(r'images/page_find.png',wx.BITMAP_TYPE_PNG) images['bashmon'] = Image(r'images/group_gear.png',wx.BITMAP_TYPE_PNG) images['modChecker'] = Image(r'images/table_error.png',wx.BITMAP_TYPE_PNG) #--ColorChecks images['checkbox.red.x'] = Image(r'images/checkbox_red_x.png',wx.BITMAP_TYPE_PNG) images['checkbox.green.on.32'] = (Image(r'images/checkbox_green_on_32.png',wx.BITMAP_TYPE_PNG)) images['checkbox.blue.on.32'] = (Image(r'images/checkbox_blue_on_32.png',wx.BITMAP_TYPE_PNG)) #--Bash images['bash.16'] = Image(r'images/bash_16.png',wx.BITMAP_TYPE_PNG) images['bash.32'] = Image(r'images/bash_32.png',wx.BITMAP_TYPE_PNG) images['bash.16.blue'] = Image(r'images/bash_16_blue.png',wx.BITMAP_TYPE_PNG) images['bash.32.blue'] = Image(r'images/bash_32_blue.png',wx.BITMAP_TYPE_PNG) #--Applications Icons global bashRed bashRed = balt.ImageBundle() bashRed.Add(images['bash.16']) bashRed.Add(images['bash.32']) #--Application Subwindow Icons global bashBlue bashBlue = balt.ImageBundle() bashBlue.Add(images['bash.16.blue']) bashBlue.Add(images['bash.32.blue']) | 3ac43907fa076fea1e8d682219e2b28fc7419f7b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/3ac43907fa076fea1e8d682219e2b28fc7419f7b/basher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4378,
8946,
13332,
3536,
7520,
2036,
471,
1316,
6980,
12123,
468,
413,
12570,
5740,
3292,
28734,
18,
281,
81,
3546,
273,
261,
27246,
16,
27246,
16,
10395,
13,
5740,
3292,
28734,
18,
9056,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4378,
8946,
13332,
3536,
7520,
2036,
471,
1316,
6980,
12123,
468,
413,
12570,
5740,
3292,
28734,
18,
281,
81,
3546,
273,
261,
27246,
16,
27246,
16,
10395,
13,
5740,
3292,
28734,
18,
9056,
... |
game.quadrant.x = w.x/QUADSIZE game.quadrant.y = w.y/QUADSIZE game.sector.x = w.x - (QUADSIZE*game.quadrant.x) game.sector.y = w.y - (QUADSIZE*game.quadrant.y) | game.quadrant.i = w.i/QUADSIZE game.quadrant.j = w.j/QUADSIZE game.sector.i = w.i - (QUADSIZE*game.quadrant.i) game.sector.j = w.j - (QUADSIZE*game.quadrant.j) | def no_quad_change(): # No quadrant change -- compute new average enemy distances game.quad[game.sector.x][game.sector.y] = game.ship if game.enemies: for enemy in game.enemies: finald = (w-enemy.kloc).distance() enemy.kavgd = 0.5 * (finald + enemy.kdist) enemy.kdist = finald game.enemies.sort(lambda x, y: cmp(x.kdist, y.kdist)) if not game.state.galaxy[game.quadrant.x][game.quadrant.y].supernova: attack(torps_ok=False) for enemy in game.enemies: enemy.kavgd = enemy.kdist newcnd() drawmaps(0) setwnd(message_window) | e67cf36a789c4ab1cd905a9a08e91d219395f538 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3176/e67cf36a789c4ab1cd905a9a08e91d219395f538/sst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1158,
67,
21733,
67,
3427,
13332,
468,
2631,
9474,
6890,
2549,
1493,
3671,
394,
8164,
570,
351,
93,
12491,
7920,
18,
21733,
63,
13957,
18,
5709,
280,
18,
92,
6362,
13957,
18,
5709,
280,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1158,
67,
21733,
67,
3427,
13332,
468,
2631,
9474,
6890,
2549,
1493,
3671,
394,
8164,
570,
351,
93,
12491,
7920,
18,
21733,
63,
13957,
18,
5709,
280,
18,
92,
6362,
13957,
18,
5709,
280,
... |
mod = imp.load_compiled(temp_mod_name, temp_mod_name + '.pyc') self.assertEquals(1, mod.a) | mod = imp.load_compiled(temp_mod_name, temp_mod_name + '.pyc') self.assertEquals(1, mod.a) | def test_issue5604(self): # Test cannot cover imp.load_compiled function. # Martin von Loewis note what shared library cannot have non-ascii # character because init_xxx function cannot be compiled # and issue never happens for dynamic modules. # But sources modified to follow generic way for processing pathes. | 28ec079c105aa61ff111341f47ebf944e16a8271 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/28ec079c105aa61ff111341f47ebf944e16a8271/test_imp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
13882,
4313,
3028,
12,
2890,
4672,
468,
7766,
2780,
5590,
1646,
18,
945,
67,
19397,
445,
18,
468,
490,
485,
267,
331,
265,
3176,
359,
291,
4721,
4121,
5116,
5313,
2780,
1240,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
13882,
4313,
3028,
12,
2890,
4672,
468,
7766,
2780,
5590,
1646,
18,
945,
67,
19397,
445,
18,
468,
490,
485,
267,
331,
265,
3176,
359,
291,
4721,
4121,
5116,
5313,
2780,
1240,
... |
if line.startswith("import"): | if line.startswith("import ") or line.startswith("import\t"): | def addpackage(sitedir, name, known_paths): """Add a new path to known_paths by combining sitedir and 'name' or execute sitedir if it starts with 'import'""" if known_paths is None: _init_pathinfo() reset = 1 else: reset = 0 fullname = os.path.join(sitedir, name) try: f = open(fullname, "rU") except IOError: return try: for line in f: if line.startswith("#"): continue if line.startswith("import"): exec line continue line = line.rstrip() dir, dircase = makepath(sitedir, line) if not dircase in known_paths and os.path.exists(dir): sys.path.append(dir) known_paths.add(dircase) finally: f.close() if reset: known_paths = None return known_paths | 5abd752edffee306144645b11626885cf9023bc6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/5abd752edffee306144645b11626885cf9023bc6/site.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
5610,
12,
87,
16261,
481,
16,
508,
16,
4846,
67,
4481,
4672,
3536,
986,
279,
394,
589,
358,
4846,
67,
4481,
635,
29189,
10982,
23210,
471,
296,
529,
11,
578,
1836,
10982,
23210,
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,
527,
5610,
12,
87,
16261,
481,
16,
508,
16,
4846,
67,
4481,
4672,
3536,
986,
279,
394,
589,
358,
4846,
67,
4481,
635,
29189,
10982,
23210,
471,
296,
529,
11,
578,
1836,
10982,
23210,
3... |
error, desc = commands.getstatusoutput("xsltproc -o /tmp/xepbuilder/xep-" + nr + ".tex.xml xep2texml.xsl xep-" + nr + ".xml") if not checkError(error, desc): return False error, desc = commands.getstatusoutput("texml -e utf8 /tmp/xepbuilder/xep-" + nr + ".tex.xml /tmp/xepbuilder/xep-" + nr + ".tex") | error, desc = executeCommand("xsltproc -o /tmp/xepbuilder/xep-" + nr + ".tex.xml xep2texml.xsl xep-" + nr + ".xml") if not checkError(error, desc): return False error, desc = executeCommand("texml -e utf8 /tmp/xepbuilder/xep-" + nr + ".tex.xml /tmp/xepbuilder/xep-" + nr + ".tex") | def buildPDF( file ): nr = re.match("xep-(\d\d\d\d).xml", file).group(1) error, desc = commands.getstatusoutput("xsltproc -o /tmp/xepbuilder/xep-" + nr + ".tex.xml xep2texml.xsl xep-" + nr + ".xml") if not checkError(error, desc): return False error, desc = commands.getstatusoutput("texml -e utf8 /tmp/xepbuilder/xep-" + nr + ".tex.xml /tmp/xepbuilder/xep-" + nr + ".tex") if not checkError(error, desc): return False #detect http urls and escape them to make them breakable error, desc = commands.getstatusoutput('''sed -i 's|\([\s"]\)\(http://[^ "]*\)|\1\\path{\2}|g' /tmp/xepbuilder/xep-''' + nr + ".tex") if not checkError(error, desc): return False #adjust references error, desc = commands.getstatusoutput('''sed -i 's|\\hyperref\[#\([^}]*\)\]|\\hyperref\[\1\]|g' /tmp/xepbuilder/xep-''' + nr + ".tex") if error != 0: if verbose == 1: print "Error: ", desc return False error, desc = commands.getstatusoutput('''sed -i 's|\\pageref{#\([^}]*\)}|\\pageref{\1}|g' /tmp/xepbuilder/xep-''' + nr + ".tex") if not checkError(error, desc): return False olddir = os.getcwd() os.chdir("/tmp/xepbuilder") error, desc = commands.getstatusoutput("xelatex -interaction=batchmode xep-" + nr + ".tex") #if not checkError(error, desc): # os.chdir(olddir) # return False error, desc = commands.getstatusoutput("xelatex -interaction=batchmode xep-" + nr + ".tex") #if not checkError(error, desc): # os.chdir(olddir) # return False os.chdir(olddir) error, desc = commands.getstatusoutput("cp /tmp/xepbuilder/xep-" + nr + ".pdf " + XEPPATH + "/") if not checkError(error, desc): return False return True | c48521c5c739ae238f0623f2a23e1f09ad509054 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3519/c48521c5c739ae238f0623f2a23e1f09ad509054/gen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
17508,
12,
585,
262,
30,
9884,
273,
283,
18,
1916,
2932,
92,
881,
17,
4713,
72,
64,
72,
64,
72,
64,
72,
2934,
2902,
3113,
585,
2934,
1655,
12,
21,
13,
225,
555,
16,
3044,
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,
1361,
17508,
12,
585,
262,
30,
9884,
273,
283,
18,
1916,
2932,
92,
881,
17,
4713,
72,
64,
72,
64,
72,
64,
72,
2934,
2902,
3113,
585,
2934,
1655,
12,
21,
13,
225,
555,
16,
3044,
273... |
values.purgeValue(txn, uValue) | values.purgeValue(txn, uValue) | def undoItem(self, txn, indexReader, indexSearcher): store = self.repository.store items = store._items values = store._values refs = store._refs lobs = store._lobs indexes = store._indexes | 66d3bfc298d9eda4bc995f194579aa874fff6679 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/66d3bfc298d9eda4bc995f194579aa874fff6679/DBItemIO.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15436,
1180,
12,
2890,
16,
7827,
16,
770,
2514,
16,
770,
2979,
264,
4672,
225,
1707,
273,
365,
18,
9071,
18,
2233,
1516,
273,
1707,
6315,
3319,
924,
273,
1707,
6315,
2372,
9047,
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,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15436,
1180,
12,
2890,
16,
7827,
16,
770,
2514,
16,
770,
2979,
264,
4672,
225,
1707,
273,
365,
18,
9071,
18,
2233,
1516,
273,
1707,
6315,
3319,
924,
273,
1707,
6315,
2372,
9047,
273,
1... |
self.max_login_attempts[1] = 0 | self.attempted_logins = 0 | def ftp_PASS(self, line): # TODO - brute force protection: 'freeze'/'sleep' (without blocking the main loop) # PI for a certain amount of time if authentication fails. if not self.username: self.respond("503 Login with USER first") return if self.username == 'anonymous': line = '' if self.authorizer.has_user(self.username): if self.authorizer.validate_authentication(self.username, line): if not self.msg_login: self.respond("230 User %s logged in." %self.username) else: self.push("230-%s\r\n" %self.msg_login) self.respond("230 Welcome.") self.authenticated = True self.max_login_attempts[1] = 0 self.fs.root = self.authorizer.get_home_dir(self.username) self.log("User %s logged in." %self.username) else: self.max_login_attempts[1] += 1 if self.max_login_attempts[0] == self.max_login_attempts[1]: self.log("Maximum login attempts. Disconnecting.") self.respond("530 Maximum login attempts. Disconnecting.") self.close() else: self.respond("530 Authentication failed.") self.username = "" else: if self.username.lower() == 'anonymous': self.respond("530 Anonymous access not allowed.") self.log('Authentication failed: anonymous access not allowed.') else: self.respond("530 Authentication failed.") self.log('Authentication failed: unknown username "%s".' %self.username) self.username = "" | cb01c49a66d7848781b76239960b060d1d7dcf4e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7236/cb01c49a66d7848781b76239960b060d1d7dcf4e/FTPServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13487,
67,
10884,
12,
2890,
16,
980,
4672,
468,
2660,
300,
5186,
624,
2944,
17862,
30,
296,
29631,
11,
2473,
19607,
11,
261,
13299,
9445,
326,
2774,
2798,
13,
468,
282,
7024,
364,
279,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13487,
67,
10884,
12,
2890,
16,
980,
4672,
468,
2660,
300,
5186,
624,
2944,
17862,
30,
296,
29631,
11,
2473,
19607,
11,
261,
13299,
9445,
326,
2774,
2798,
13,
468,
282,
7024,
364,
279,
... |
return subprocess.call([self.exe, 'version']) == 0 | return 0 == subprocess.call( [self.exe, 'version'], stdout=self._get_devnull(), ) | def is_valid(self): return subprocess.call([self.exe, 'version']) == 0 | d8c7ce5a9420e2bafd7373ccbe4c47e12804af14 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/833/d8c7ce5a9420e2bafd7373ccbe4c47e12804af14/setuptools_hg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
877,
12,
2890,
4672,
327,
6652,
18,
1991,
3816,
2890,
18,
14880,
16,
296,
1589,
19486,
422,
374,
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,
353,
67,
877,
12,
2890,
4672,
327,
6652,
18,
1991,
3816,
2890,
18,
14880,
16,
296,
1589,
19486,
422,
374,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
self.assertEqual( rtime, wtime, "Stored and retrieved values do not match.") | self.assert_( allequal(rtime, wtime), "Stored and retrieved values do not match.") | def test00_Compare32VLArray(self): "Comparing written 32-bit time data with read data in a VLArray." | 2953f06c72e2521b548ca4dd99aecff040aeab6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12687/2953f06c72e2521b548ca4dd99aecff040aeab6e/test_timetype.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
713,
67,
8583,
1578,
58,
48,
1076,
12,
2890,
4672,
315,
799,
12583,
5941,
3847,
17,
3682,
813,
501,
598,
855,
501,
316,
279,
776,
48,
1076,
1199,
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,
1842,
713,
67,
8583,
1578,
58,
48,
1076,
12,
2890,
4672,
315,
799,
12583,
5941,
3847,
17,
3682,
813,
501,
598,
855,
501,
316,
279,
776,
48,
1076,
1199,
2,
-100,
-100,
-100,
-100,
-100,... |
"TestTableSelection.py", | def run_tests(tests): for filename in tests: try: execfile(os.path.join(functional_dir, filename)) except: import traceback print "%s failed due to exception" % fileName type, value, stack = sys.exc_info() traceback.print_exception(type, value, stack, None, sys.stderr) | da5d5a03d1067bb729ff0c91b1a5753187a5f578 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/da5d5a03d1067bb729ff0c91b1a5753187a5f578/FunctionalTestSuite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
16341,
12,
16341,
4672,
364,
1544,
316,
7434,
30,
775,
30,
1196,
768,
12,
538,
18,
803,
18,
5701,
12,
915,
287,
67,
1214,
16,
1544,
3719,
1335,
30,
1930,
10820,
1172,
2213,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
16341,
12,
16341,
4672,
364,
1544,
316,
7434,
30,
775,
30,
1196,
768,
12,
538,
18,
803,
18,
5701,
12,
915,
287,
67,
1214,
16,
1544,
3719,
1335,
30,
1930,
10820,
1172,
2213,
... | |
print 'session: %s' % search | def search(request): if request.method == 'POST': # If the form has been submitted form = SearchForm(request.POST) # A form bound to the POST data if form.is_valid(): # All validation rules pass #process search form into search object search = processSearchForm(form) #store search in session request.session['search'] = search print 'session: %s' % search return HttpResponseRedirect('%ssearch/results/' % settings.SITE_ROOT) # Redirect after POST else: form = SearchForm() # An unbound form #construct a list of values for i iValues = [ # Generates a series of tuples (<value>,<signed string of value>); zero is 'i' (i,'%+i'%i if i else 'i') for i in RESIDUE_INDEXES ] #order the residue properties in way that django template can handle it better residueFields = [] for i in RESIDUE_INDEXES: dict = {} for prefix in ("ss", "aa", "phi", "psi", "ome", "chi", "bm", "bs", "bg", "h_bond_energy", "zeta", 'a1','a2','a3','a4','a5','a6','a7','L1','L2','L3','L4','L5'): dict[prefix] = form['%s_%i' % (prefix, i)] dict['%s_i' % prefix] = form['%s_i_%i' % (prefix, i)] dict['index'] = i residueFields.append(dict) return render_to_response('search.html', { 'form': form, 'maxLength' : searchSettings.segmentSize, 'iValues':iValues, 'residueFields':residueFields }, context_instance=RequestContext(request)) | bf65ce60b2586ffda642c3d3d840692cb3c90b09 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6163/bf65ce60b2586ffda642c3d3d840692cb3c90b09/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
12,
2293,
4672,
309,
590,
18,
2039,
422,
296,
3798,
4278,
468,
971,
326,
646,
711,
2118,
9638,
646,
273,
5167,
1204,
12,
2293,
18,
3798,
13,
468,
432,
646,
2489,
358,
326,
5485,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
12,
2293,
4672,
309,
590,
18,
2039,
422,
296,
3798,
4278,
468,
971,
326,
646,
711,
2118,
9638,
646,
273,
5167,
1204,
12,
2293,
18,
3798,
13,
468,
432,
646,
2489,
358,
326,
5485,
... | |
text=str(arg), anchor="sw", | text=str(text), anchor="sw", | def write(self, arg, move=0): x, y = start = self._position x = x-1 # correction -- calibrated for Windows item = self._canvas.create_text(x, y, text=str(arg), anchor="sw", fill=self._color) self._items.append(item) if move: x0, y0, x1, y1 = self._canvas.bbox(item) self._goto(x1, y1) self._draw_turtle() | e3a25838db0ac392aa9e68379e167635f8e67a43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e3a25838db0ac392aa9e68379e167635f8e67a43/turtle.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
1501,
16,
3635,
33,
20,
4672,
619,
16,
677,
273,
787,
273,
365,
6315,
3276,
619,
273,
619,
17,
21,
468,
15104,
1493,
26139,
86,
690,
364,
8202,
761,
273,
365,
631... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
1501,
16,
3635,
33,
20,
4672,
619,
16,
677,
273,
787,
273,
365,
6315,
3276,
619,
273,
619,
17,
21,
468,
15104,
1493,
26139,
86,
690,
364,
8202,
761,
273,
365,
631... |
print "%s watcher %s wants to subscribe to your presence information. Press (a) to allow, (d) to deny, (p) to polite block:" % (pending[0].status, pending[0]) | print "%s watcher %s wants to subscribe to your presence information. Press (a) for allow, (d) for deny or (p) for polite blocking:" % (pending[0].status.capitalize(), pending[0]) | def read_queue(e, username, domain, password, display_name, route, xcap_root, expires, do_siptrace, pjsip_logging): global user_quit, lock, queue, sip_uri, winfo, xcap_client lock.acquire() try: sip_uri = SIPURI(user=username, host=domain, display=display_name) sub = Subscription(Credentials(sip_uri, password), sip_uri, 'presence.winfo', route=route, expires=expires) winfo = WatcherInfo() if xcap_root is not None: xcap_client = XCAPClient(xcap_root, '%s@%s' % (sip_uri.user, sip_uri.host), password=password, auth=None) print 'Retrieving current presence rules from %s' % xcap_root get_prules() print 'Allowed list:' if allow_rule_identities is not None: for identity in allow_rule_identities: print '\t%s' % identity print 'Blocked list:' if block_rule_identities is not None: for identity in block_rule_identities: print '\t%s' % identity print 'Polite-blocked list:' if polite_block_rule_identities is not None: for identity in polite_block_rule_identities: print '\t%s' % identity print 'Subscribing to "%s@%s" for the presence.winfo event, at %s:%d' % (sip_uri.user, sip_uri.host, route.host, route.port) sub.subscribe() while True: command, data = queue.get() if command == "print": print data if len(pending) > 0: print "%s watcher %s wants to subscribe to your presence information. Press (a) to allow, (d) to deny, (p) to polite block:" % (pending[0].status, pending[0]) if command == "pypjua_event": event_name, args = data if command == "user_input": key = data if len(pending) > 0: if key == 'a': watcher = pending.popleft() allow_watcher(watcher) elif key == 'd': watcher = pending.popleft() block_watcher(watcher) elif key == 'p': watcher = pending.popleft() polite_block_watcher(watcher) else: print "Please select a valid choice. Press (a) to allow, (d) to deny, (p) to polite block" if len(pending) > 0: print "%s watcher %s wants to subscribe to your presence information. Press (a) to allow, (d) to deny, (p) to polite block:" % (pending[0].status, pending[0]) if command == "eof": command = "end" want_quit = True if command == "end": try: sub.unsubscribe() except: pass if command == "quit": user_quit = False break except: user_quit = False traceback.print_exc() finally: e.stop() if not user_quit: os.kill(os.getpid(), signal.SIGINT) lock.release() | 41c797a1a21804f03a8def523b8e202c6e55e39e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3449/41c797a1a21804f03a8def523b8e202c6e55e39e/sip_subscribe_winfo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
4000,
12,
73,
16,
2718,
16,
2461,
16,
2201,
16,
2562,
67,
529,
16,
1946,
16,
619,
5909,
67,
3085,
16,
7368,
16,
741,
67,
28477,
5129,
16,
293,
2924,
625,
67,
11167,
4672,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4000,
12,
73,
16,
2718,
16,
2461,
16,
2201,
16,
2562,
67,
529,
16,
1946,
16,
619,
5909,
67,
3085,
16,
7368,
16,
741,
67,
28477,
5129,
16,
293,
2924,
625,
67,
11167,
4672,
... |
except DistutilsExecError, msg: | except DistutilsExecError as msg: | def link(self, target_desc, objects, output_filename, output_dir=None, libraries=None, library_dirs=None, runtime_library_dirs=None, export_symbols=None, debug=0, extra_preargs=None, extra_postargs=None, build_temp=None, target_lang=None): | be7b797774c4af82fd3ef39795d0f2d99e7326bb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/be7b797774c4af82fd3ef39795d0f2d99e7326bb/msvc9compiler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1692,
12,
2890,
16,
1018,
67,
5569,
16,
2184,
16,
876,
67,
3459,
16,
876,
67,
1214,
33,
7036,
16,
14732,
33,
7036,
16,
5313,
67,
8291,
33,
7036,
16,
3099,
67,
12083,
67,
8291,
33,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1692,
12,
2890,
16,
1018,
67,
5569,
16,
2184,
16,
876,
67,
3459,
16,
876,
67,
1214,
33,
7036,
16,
14732,
33,
7036,
16,
5313,
67,
8291,
33,
7036,
16,
3099,
67,
12083,
67,
8291,
33,
... |
for path in glob.glob(pathexp): if os.path.exists(path): for file in dircache.listdir(path): | for path in glob.glob( pathexp ): if os.path.exists( path ): for file in dircache.listdir( path ): | def findFile( searchpath ): path = "" file = "" for entry in searchpath: pathexp, fileexp = os.path.split( entry ) for path in glob.glob(pathexp): if os.path.exists(path): for file in dircache.listdir(path): if fnmatch.fnmatch( file, fileexp ): return (file, path) return (None, None) | d941256082445e4067ba7bbfd19725f6d2fd0a35 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/d941256082445e4067ba7bbfd19725f6d2fd0a35/configure.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
812,
12,
1623,
803,
262,
30,
589,
273,
1408,
585,
273,
1408,
364,
1241,
316,
1623,
803,
30,
589,
2749,
16,
585,
2749,
273,
1140,
18,
803,
18,
4939,
12,
1241,
262,
364,
589,
316... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
812,
12,
1623,
803,
262,
30,
589,
273,
1408,
585,
273,
1408,
364,
1241,
316,
1623,
803,
30,
589,
2749,
16,
585,
2749,
273,
1140,
18,
803,
18,
4939,
12,
1241,
262,
364,
589,
316... |
return "%s, %u samples" % (self["name"].display, self["samples"].value) | return "Instrument '%s': %i samples, header %i bytes" % \ (self["name"].display, self["samples"].value, self["size"].value) | def createDescription(self): return "%s, %u samples" % (self["name"].display, self["samples"].value) | 2f037e9e7d40fcafd2c66d8ff31cf720c36c92bd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9327/2f037e9e7d40fcafd2c66d8ff31cf720c36c92bd/xm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
3291,
12,
2890,
4672,
327,
2213,
87,
16,
738,
89,
5216,
6,
738,
261,
2890,
9614,
529,
6,
8009,
5417,
16,
365,
9614,
7319,
6,
8009,
1132,
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,
752,
3291,
12,
2890,
4672,
327,
2213,
87,
16,
738,
89,
5216,
6,
738,
261,
2890,
9614,
529,
6,
8009,
5417,
16,
365,
9614,
7319,
6,
8009,
1132,
13,
2,
-100,
-100,
-100,
-100,
-100,
-10... |
ws = Workspace.objects.get(pk = workspace_id) | ws = DAMWorkspace.objects.get(pk = workspace_id) | def test_add_items(self): workspace_id = 1 ws = Workspace.objects.get(pk = workspace_id) coll= Node.objects.get(label = 'test1', workspace = ws, type = 'collection') item = Item.objects.all()[0] params = self.get_final_parameters({ 'items':[item.pk, item.pk]}) response = self.client.post('/api/collection/%s/add_items/'%coll.pk, params) self.assertTrue(response.content == '') items = coll.items.all() self.assertTrue(items.count() == 1) | 774c03fcc85d5555c72b71c04da9a7d1a510e957 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4589/774c03fcc85d5555c72b71c04da9a7d1a510e957/tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1289,
67,
3319,
12,
2890,
4672,
6003,
67,
350,
273,
404,
4945,
273,
463,
2192,
8241,
18,
6911,
18,
588,
12,
5465,
273,
6003,
67,
350,
13,
4508,
33,
2029,
18,
6911,
18,
588,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1289,
67,
3319,
12,
2890,
4672,
6003,
67,
350,
273,
404,
4945,
273,
463,
2192,
8241,
18,
6911,
18,
588,
12,
5465,
273,
6003,
67,
350,
13,
4508,
33,
2029,
18,
6911,
18,
588,... |
self.timeoutOffToOn(None) | self.timeoutOffToOn() | def changeOffToOn(self) : # the source went from off to on if (self.onTimeout != 0) : self.delayTimer.setDelay(self.onTimeout) self.delayTimer.setInitialDelay(self.onTimeout) self.delayTimer.start() else : self.timeoutOffToOn(None) return | e5050c1a58c75160a37a36abc95f424d0dfa582a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1660/e5050c1a58c75160a37a36abc95f424d0dfa582a/DebounceSensor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2549,
7210,
774,
1398,
12,
2890,
13,
294,
468,
326,
1084,
16343,
628,
3397,
358,
603,
309,
261,
2890,
18,
265,
2694,
480,
374,
13,
294,
365,
18,
10790,
6777,
18,
542,
6763,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2549,
7210,
774,
1398,
12,
2890,
13,
294,
468,
326,
1084,
16343,
628,
3397,
358,
603,
309,
261,
2890,
18,
265,
2694,
480,
374,
13,
294,
365,
18,
10790,
6777,
18,
542,
6763,
12,
2890,
... |
else: necessary = True | else: necessary = True | def doSackFilelistPopulate(self): """convenience function to populate the repos with the filelist metadata it also is simply to only emit a log if anything actually gets populated""" necessary = False | 9b2cafacba5310955b61999d357d314556bc061e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5445/9b2cafacba5310955b61999d357d314556bc061e/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
55,
484,
25579,
5449,
19097,
12,
2890,
4672,
3536,
591,
9080,
445,
358,
6490,
326,
13686,
598,
326,
26204,
1982,
518,
2546,
353,
8616,
358,
1338,
3626,
279,
613,
309,
6967,
6013,
55... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
741,
55,
484,
25579,
5449,
19097,
12,
2890,
4672,
3536,
591,
9080,
445,
358,
6490,
326,
13686,
598,
326,
26204,
1982,
518,
2546,
353,
8616,
358,
1338,
3626,
279,
613,
309,
6967,
6013,
55... |
- ``solution_dict = True`` - return a list of dictionaries containing the solutions. | - ``solution_dict`` - bool (default: False); if True, return a list of dictionaries containing the solutions. | def solve(f, *args, **kwds): r""" Algebraically solve an equation of system of equations for given variables. INPUT: - ``f`` - equation or system of equations (given by a list or tuple) - ``*args`` - variables to solve for. - ``solution_dict = True`` - return a list of dictionaries containing the solutions. EXAMPLES:: sage: x, y = var('x, y') sage: solve([x+y==6, x-y==4], x, y) [[x == 5, y == 1]] sage: solve([x^2+y^2 == 1, y^2 == x^3 + x + 1], x, y) [[x == -1/2*I*sqrt(3) - 1/2, y == -1/2*sqrt(-I*sqrt(3) + 3)*sqrt(2)], [x == -1/2*I*sqrt(3) - 1/2, y == 1/2*sqrt(-I*sqrt(3) + 3)*sqrt(2)], [x == 1/2*I*sqrt(3) - 1/2, y == -1/2*sqrt(I*sqrt(3) + 3)*sqrt(2)], [x == 1/2*I*sqrt(3) - 1/2, y == 1/2*sqrt(I*sqrt(3) + 3)*sqrt(2)], [x == 0, y == -1], [x == 0, y == 1]] sage: solutions=solve([x^2+y^2 == 1, y^2 == x^3 + x + 1], x, y, solution_dict=True) sage: for solution in solutions: print solution[x].n(digits=3), ",", solution[y].n(digits=3) -0.500 - 0.866*I , -1.27 + 0.341*I -0.500 - 0.866*I , 1.27 - 0.341*I -0.500 + 0.866*I , -1.27 - 0.341*I -0.500 + 0.866*I , 1.27 + 0.341*I 0.000 , -1.00 0.000 , 1.00 sage: z = 5 sage: solve([8*z + y == 3, -z +7*y == 0],y,z) Traceback (most recent call last): ... TypeError: 5 is not a valid variable. If ``True`` appears in the list of equations it is ignored, and if ``False`` appears in the list then no solutions are returned. E.g., note that the first ``3==3`` evaluates to ``True``, not to a symbolic equation. :: sage: solve([3==3, 1.00000000000000*x^3 == 0], x) [x == 0] sage: solve([1.00000000000000*x^3 == 0], x) [x == 0] Here, the first equation evaluates to ``False``, so there are no solutions:: sage: solve([1==3, 1.00000000000000*x^3 == 0], x) [] :: sage: var('s,j,b,m,g') (s, j, b, m, g) sage: sys = [ m*(1-s) - b*s*j, b*s*j-g*j ]; sage: solve(sys,s,j) [[s == 1, j == 0], [s == g/b, j == (b - g)*m/(b*g)]] sage: solve(sys,(s,j)) [[s == 1, j == 0], [s == g/b, j == (b - g)*m/(b*g)]] sage: solve(sys,[s,j]) [[s == 1, j == 0], [s == g/b, j == (b - g)*m/(b*g)]] """ try: return f.solve(*args,**kwds) except AttributeError: from sage.symbolic.ring import is_SymbolicVariable if is_SymbolicVariable(args[0]): variables = args else: variables = tuple(args[0]) for v in variables: if not is_SymbolicVariable(v): raise TypeError, "%s is not a valid variable."%v try: f = [s for s in f if s is not True] except TypeError: raise ValueError, "Unable to solve %s for %s"%(f, args) if any(s is False for s in f): return [] m = maxima(f) try: s = m.solve(variables) except: raise ValueError, "Unable to solve %s for %s"%(f, args) sol_list = string_to_list_of_solutions(repr(s)) if 'solution_dict' in kwds and kwds['solution_dict']==True: sol_dict=[dict([[eq.left(),eq.right()] for eq in solution]) for solution in sol_list] return sol_dict else: return sol_list | 3961abf578b8680a70f88012b4051205b3878942 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/3961abf578b8680a70f88012b4051205b3878942/relation.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12439,
12,
74,
16,
380,
1968,
16,
2826,
25577,
4672,
436,
8395,
2262,
29087,
6478,
12439,
392,
15778,
434,
2619,
434,
30369,
364,
864,
3152,
18,
225,
12943,
30,
225,
300,
225,
12176,
74,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12439,
12,
74,
16,
380,
1968,
16,
2826,
25577,
4672,
436,
8395,
2262,
29087,
6478,
12439,
392,
15778,
434,
2619,
434,
30369,
364,
864,
3152,
18,
225,
12943,
30,
225,
300,
225,
12176,
74,... |
deltaHeight = 1 | deltaY = 0 | def MakeRectForRange(self, startTime, endTime): """ Turn a datetime range into a single rectangle that can be drawn on the screen """ startX, startY, width = self.getPositionFromDateTime(startTime) deltaHeight = 1 if IS_MAC: startY -= 1 deltaHeight = 0 height = int(self.hourHeight * (endTime.hour + endTime.minute/60.0) - startY) height = max(height, self.hourHeight / 2 + self.hourHeight % 2) return wx.Rect(startX, startY, width+1, height+deltaHeight) | ccac59343e820e8a9133ac1ae6188c94196b0a6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/ccac59343e820e8a9133ac1ae6188c94196b0a6e/TimedCanvas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4344,
6120,
1290,
2655,
12,
2890,
16,
8657,
16,
13859,
4672,
3536,
22425,
279,
3314,
1048,
1368,
279,
2202,
11845,
716,
848,
506,
19377,
603,
326,
5518,
3536,
787,
60,
16,
787,
61,
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,
4344,
6120,
1290,
2655,
12,
2890,
16,
8657,
16,
13859,
4672,
3536,
22425,
279,
3314,
1048,
1368,
279,
2202,
11845,
716,
848,
506,
19377,
603,
326,
5518,
3536,
787,
60,
16,
787,
61,
16,
... |
messages.add_message(request, messages.SUCCESS, 'You have joined the group "%s".' % (g.name)) | for groupMember in GroupMember.objects.filter(group = group, student = member): groupMember.confirmed = True groupMember.save() messages.add_message(request, messages.SUCCESS, 'You have joined the group "%s".' % (group.name)) | def join(request, course_slug, group_slug): c = get_object_or_404(CourseOffering, slug=course_slug) g = get_object_or_404(Group, courseoffering = c, slug = group_slug) p = get_object_or_404(Person, userid = request.user.username) m = get_object_or_404(Member, person = p, offering=c) gm = get_object_or_404(GroupMember, group=g, student=m) gm.confirmed = True gm.save(); messages.add_message(request, messages.SUCCESS, 'You have joined the group "%s".' % (g.name)) return HttpResponseRedirect(reverse('groups.views.groupmanage', kwargs={'course_slug': course_slug})) | 0002727b84a94f81892985dd53205499bfdab08c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6634/0002727b84a94f81892985dd53205499bfdab08c/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1233,
12,
2293,
16,
4362,
67,
6436,
16,
1041,
67,
6436,
4672,
276,
273,
336,
67,
1612,
67,
280,
67,
11746,
12,
39,
3117,
17800,
16,
4959,
33,
5566,
67,
6436,
13,
314,
273,
336,
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,
1233,
12,
2293,
16,
4362,
67,
6436,
16,
1041,
67,
6436,
4672,
276,
273,
336,
67,
1612,
67,
280,
67,
11746,
12,
39,
3117,
17800,
16,
4959,
33,
5566,
67,
6436,
13,
314,
273,
336,
67,
... |
new_parentless.discard(rv) | new_parentless.discard(source) | def depends_on(self, source, focus=False): """ Used to indicate that this render depends on another render. Useful, for example, if we use pygame_surface to make a surface, and then blit that surface into another render. """ | 8be5069490796079ec81f6bc032f7da720eeaaec /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10962/8be5069490796079ec81f6bc032f7da720eeaaec/render.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10935,
67,
265,
12,
2890,
16,
1084,
16,
7155,
33,
8381,
4672,
3536,
10286,
358,
10768,
716,
333,
1743,
10935,
603,
4042,
1743,
18,
19256,
16,
364,
3454,
16,
309,
732,
999,
2395,
13957,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10935,
67,
265,
12,
2890,
16,
1084,
16,
7155,
33,
8381,
4672,
3536,
10286,
358,
10768,
716,
333,
1743,
10935,
603,
4042,
1743,
18,
19256,
16,
364,
3454,
16,
309,
732,
999,
2395,
13957,
... |
params = {'rev': rev, 'mode': mode, 'limit': limit} | link_rev = rev if rev == str(repos.youngest_rev): link_rev = None params = {'rev': link_rev, 'mode': mode, 'limit': limit} | def make_log_href(path, **args): params = {'rev': rev, 'mode': mode, 'limit': limit} params.update(args) if verbose: params['verbose'] = verbose return self.env.href.log(path, **params) | 616da62f50ea82f0a23e87479e26d0aef6f233ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/616da62f50ea82f0a23e87479e26d0aef6f233ca/Browser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
1330,
67,
7547,
12,
803,
16,
2826,
1968,
4672,
1692,
67,
9083,
273,
5588,
309,
5588,
422,
609,
12,
15564,
18,
93,
465,
17592,
67,
9083,
4672,
1692,
67,
9083,
273,
599,
859,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
1330,
67,
7547,
12,
803,
16,
2826,
1968,
4672,
1692,
67,
9083,
273,
5588,
309,
5588,
422,
609,
12,
15564,
18,
93,
465,
17592,
67,
9083,
4672,
1692,
67,
9083,
273,
599,
859,
... |
seconds=(remainingPages * put_throttle.getDelay(wait=True))) | seconds=(remainingPages * put_throttle.getDelay(True))) | def remaining(): import datetime remainingPages = page_put_queue.qsize() - 1 # -1 because we added a None element to stop the queue remainingSeconds = datetime.timedelta( seconds=(remainingPages * put_throttle.getDelay(wait=True))) return (remainingPages, remainingSeconds) | b157df224bfa352964e6933a258d7bf5513bb207 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4404/b157df224bfa352964e6933a258d7bf5513bb207/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4463,
13332,
1930,
3314,
4463,
5716,
273,
1363,
67,
458,
67,
4000,
18,
85,
1467,
1435,
300,
404,
468,
300,
21,
2724,
732,
3096,
279,
599,
930,
358,
2132,
326,
2389,
4463,
6762,
273,
33... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4463,
13332,
1930,
3314,
4463,
5716,
273,
1363,
67,
458,
67,
4000,
18,
85,
1467,
1435,
300,
404,
468,
300,
21,
2724,
732,
3096,
279,
599,
930,
358,
2132,
326,
2389,
4463,
6762,
273,
33... |
ValueError | ValueError: you should pass exactly one of of_degree and max_degree | def monics( self, of_degree = None, max_degree = None ): """ Return an iterator over the monic polynomials of specified degree. | 3eb6f5d2076fa6fa0385bdfc619bbdb2c4ad2e3d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/3eb6f5d2076fa6fa0385bdfc619bbdb2c4ad2e3d/polynomial_ring.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6921,
2102,
12,
365,
16,
434,
67,
21361,
273,
599,
16,
943,
67,
21361,
273,
599,
262,
30,
3536,
2000,
392,
2775,
1879,
326,
6921,
335,
16991,
87,
434,
1269,
10782,
18,
2,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6921,
2102,
12,
365,
16,
434,
67,
21361,
273,
599,
16,
943,
67,
21361,
273,
599,
262,
30,
3536,
2000,
392,
2775,
1879,
326,
6921,
335,
16991,
87,
434,
1269,
10782,
18,
2,
-100,
-100,
... |
float a = (%(_a)s->descr->type_num == PyArray_FLOAT) | float a = (%(_a)s->descr->type_num == PyArray_FLOAT) | def __str__(self): return "_dot22scalar" | ce2912309e41b74d53d3229d40d141175d5cda46 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/ce2912309e41b74d53d3229d40d141175d5cda46/blas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
327,
4192,
9811,
3787,
8748,
6,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
327,
4192,
9811,
3787,
8748,
6,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.tk.call(self._w, 'scan', 'dragto', x, y) | self.tk.call(self._w, 'scan', 'dragto', x, y, gain) | def scan_dragto(self, x, y): """Adjust the view of the canvas to 10 times the difference between X and Y and the coordinates given in scan_mark.""" self.tk.call(self._w, 'scan', 'dragto', x, y) | bd3ab92f9e1c36211da94407ecf27054146fbc07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/bd3ab92f9e1c36211da94407ecf27054146fbc07/Tkinter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4135,
67,
15997,
869,
12,
2890,
16,
619,
16,
677,
4672,
3536,
10952,
326,
1476,
434,
326,
5953,
358,
1728,
4124,
326,
7114,
3086,
1139,
471,
1624,
471,
326,
5513,
864,
316,
4135,
67,
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,
4135,
67,
15997,
869,
12,
2890,
16,
619,
16,
677,
4672,
3536,
10952,
326,
1476,
434,
326,
5953,
358,
1728,
4124,
326,
7114,
3086,
1139,
471,
1624,
471,
326,
5513,
864,
316,
4135,
67,
3... |
if not self._byhour or hour in self._byhour: | if not byhour or hour in byhour: | def _iter(self): year, month, day, hour, minute, second, weekday, yearday, _ = \ self._dtstart.timetuple() | d375f07e08a8fd61f1640e67f981e1abdac8d8d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8441/d375f07e08a8fd61f1640e67f981e1abdac8d8d1/rrule.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2165,
12,
2890,
4672,
3286,
16,
3138,
16,
2548,
16,
6126,
16,
8044,
16,
2205,
16,
7560,
16,
677,
73,
1060,
528,
16,
389,
273,
521,
365,
6315,
7510,
1937,
18,
8584,
278,
2268,
14... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
389,
2165,
12,
2890,
4672,
3286,
16,
3138,
16,
2548,
16,
6126,
16,
8044,
16,
2205,
16,
7560,
16,
677,
73,
1060,
528,
16,
389,
273,
521,
365,
6315,
7510,
1937,
18,
8584,
278,
2268,
14... |
new_keysyms.append('') | unicode_char = '' if unicode_char == u'\x00': unicode_char = '' new_keysyms.append(unicode_char) | def get_keymap_table(): keymap = {} keymap_table = cmd_keymap_table() re_line = re.compile(r'0x\w+') for line in keymap_table.split('\n')[1:]: if len(line) > 0: keycode = re.search(r'\s+(\d+).*', line) if keycode: new_keysyms = [] keycode = int(keycode.group(1)) keysyms = re_line.findall(line) # When you press only one key try: new_keysyms.append(unichr(int(keysyms[0], 16))) except: new_keysyms.append('') # When you press a key plus Shift key try: new_keysyms.append(unichr(int(keysyms[1], 16))) except: new_keysyms.append('') # When you press a key plus meta (dead keys) try: new_keysyms.append(unichr(int(keysyms[4], 16))) except: new_keysyms.append('') # When you press a key plus meta plus Shift key (dead keys) try: new_keysyms.append(unichr(int(keysyms[5], 16))) except: new_keysyms.append('') keymap[keycode-8] = new_keysyms return keymap | e8245fe51ea61f1764c2053166427459a0c9f3ad /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4183/e8245fe51ea61f1764c2053166427459a0c9f3ad/modmap.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
856,
1458,
67,
2121,
13332,
498,
1458,
273,
2618,
225,
498,
1458,
67,
2121,
273,
1797,
67,
856,
1458,
67,
2121,
1435,
225,
283,
67,
1369,
273,
283,
18,
11100,
12,
86,
11,
20... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
856,
1458,
67,
2121,
13332,
498,
1458,
273,
2618,
225,
498,
1458,
67,
2121,
273,
1797,
67,
856,
1458,
67,
2121,
1435,
225,
283,
67,
1369,
273,
283,
18,
11100,
12,
86,
11,
20... |
__main__.__dict__.keys()]: | self.namespace.keys()]: | def global_matches(self, text): """Compute matches when text is a simple name. | 3bef21992735e5adc7d41b329f305af37e2944a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/3bef21992735e5adc7d41b329f305af37e2944a2/rlcompleter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2552,
67,
8436,
12,
2890,
16,
977,
4672,
3536,
7018,
1885,
1347,
977,
353,
279,
4143,
508,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2552,
67,
8436,
12,
2890,
16,
977,
4672,
3536,
7018,
1885,
1347,
977,
353,
279,
4143,
508,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
r""" The composite numbers: numbers $n$ of the form $xy$ for $x > 1$ and $y > 1$. INPUT: n -- positive integer OUTPUT: integer -- function value EXAMPLES: sage: a = sloane.A002808;a The composite numbers: numbers n of the form x*y for x > 1 and y > 1. sage: a(0) Traceback (most recent call last): ... ValueError: input n (=0) must be a positive integer sage: a(2) 6 sage: a(11) 20 sage: a.list(12) [4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21] AUTHOR: -- Jaap Spies (2007-01-26) """ def __init__(self): | def __init__(self): r""" The composite numbers: numbers $n$ of the form $xy$ for $x > 1$ and $y > 1$. INPUT: n -- positive integer OUTPUT: integer -- function value EXAMPLES: sage: a = sloane.A002808;a The composite numbers: numbers n of the form x*y for x > 1 and y > 1. sage: a(0) Traceback (most recent call last): ... ValueError: input n (=0) must be a positive integer sage: a(2) 6 sage: a(11) 20 sage: a.list(12) [4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21] AUTHOR: -- Jaap Spies (2007-01-26) """ | # def list(self, n): | 69a199217d612e1c590af73e16003812c85b93ec /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/69a199217d612e1c590af73e16003812c85b93ec/sloane_functions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
565,
1652,
666,
12,
2890,
16,
290,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
565,
1652,
666,
12,
2890,
16,
290,
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._cond.acquire() | with self._cond: self.writers += 1 while self.writing or self._out: self._cond.wait() if self.closed: raise ValueError('closed') self.writing = True | def write_lock(self): self._cond.acquire() try: self.writing = True while self._out: self._cond.wait() finally: self._cond.release() | 233cea39af70d717fd8ab3c278d20ff46d363c7f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10048/233cea39af70d717fd8ab3c278d20ff46d363c7f/FileStorage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
739,
12,
2890,
4672,
598,
365,
6315,
10013,
30,
365,
18,
5363,
414,
1011,
404,
1323,
365,
18,
14345,
578,
365,
6315,
659,
30,
365,
6315,
10013,
18,
7048,
1435,
309,
365,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
739,
12,
2890,
4672,
598,
365,
6315,
10013,
30,
365,
18,
5363,
414,
1011,
404,
1323,
365,
18,
14345,
578,
365,
6315,
659,
30,
365,
6315,
10013,
18,
7048,
1435,
309,
365,
18,
... |
res[line.id]['price_subtotal_incl'] = res_init[line.id] | res[line.id]['price_subtotal_incl'] = cur_obj.round(cr, uid, cur, res_init[line.id]) | def _amount_line2(self, cr, uid, ids, name, args, context=None): """ Return the subtotal excluding taxes with respect to price_type. """ res = {} tax_obj = self.pool.get('account.tax') for line in self.browse(cr, uid, ids): res_init = super(account_invoice_line, self)._amount_line(cr, uid, [line.id], name, args, context) res[line.id] = { 'price_subtotal': 0.0, 'price_subtotal_incl': 0.0, 'data': [] } if not line.quantity: continue if line.invoice_id: product_taxes = [] if line.product_id: if line.invoice_id.type in ('out_invoice', 'out_refund'): product_taxes = filter(lambda x: x.price_include, line.product_id.taxes_id) else: product_taxes = filter(lambda x: x.price_include, line.product_id.supplier_taxes_id) | e046ad914f4bf2f5bbb61c6ff4254b42cecd6847 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/e046ad914f4bf2f5bbb61c6ff4254b42cecd6847/invoice_tax_incl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8949,
67,
1369,
22,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
833,
16,
819,
33,
7036,
4672,
3536,
2000,
326,
720,
4963,
19560,
5320,
281,
598,
8762,
358,
6205,
67,
72... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8949,
67,
1369,
22,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
833,
16,
819,
33,
7036,
4672,
3536,
2000,
326,
720,
4963,
19560,
5320,
281,
598,
8762,
358,
6205,
67,
72... |
if os.path.isdir(fullpath) and not name in excludes: | if os.path.isdir(fullpath) and not fnmatch.fnmatch(name, excludes): | def copyTree(srcdir, destdir, patterns, excludes): for pattern in patterns: matches = glob.glob(os.path.join(srcdir, pattern)) for match in matches: if os.path.isfile(match) and not match in excludes: if not os.path.exists(destdir): _mkdirs(destdir) shutil.copy(match, destdir) for name in os.listdir(srcdir): fullpath = os.path.join(srcdir, name) if os.path.isdir(fullpath) and not name in excludes: copyTree(fullpath, os.path.join(destdir, name), patterns, excludes) | 17db6e71d943f55801ea8a48bbbf48f20198c154 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/17db6e71d943f55801ea8a48bbbf48f20198c154/hardhatlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
2471,
12,
4816,
1214,
16,
1570,
1214,
16,
6884,
16,
13644,
4672,
364,
1936,
316,
6884,
30,
1885,
273,
4715,
18,
10581,
12,
538,
18,
803,
18,
5701,
12,
4816,
1214,
16,
1936,
3719,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
2471,
12,
4816,
1214,
16,
1570,
1214,
16,
6884,
16,
13644,
4672,
364,
1936,
316,
6884,
30,
1885,
273,
4715,
18,
10581,
12,
538,
18,
803,
18,
5701,
12,
4816,
1214,
16,
1936,
3719,... |
dst = os.path.join(self.lib_dir, os.path.basename(item.__file__)) self.copy_file(src, dst) self.lib_files.append(dst) | if not self.single_file: dst = os.path.join(self.lib_dir, os.path.basename(item.__file__)) self.copy_file(src, dst) self.lib_files.append(dst) else: dst = os.path.join(self.collect_dir, os.path.basename(src)) self.copy_file(src, dst) compiled_files.append(os.path.basename(dst)) | def create_binaries(self, py_files, extensions, dlls): dist = self.distribution # byte compile the python modules into the target directory print "*** byte compile python files ***" compiled_files = byte_compile(py_files, target_dir=self.collect_dir, optimize=self.optimize, force=0, verbose=self.verbose, dry_run=self.dry_run) | d81e43cc424db2fdd1eb0a09e10eebf9dc8625a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1361/d81e43cc424db2fdd1eb0a09e10eebf9dc8625a1/build_exe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
4757,
5646,
12,
2890,
16,
2395,
67,
2354,
16,
4418,
16,
302,
2906,
87,
4672,
2411,
273,
365,
18,
16279,
225,
468,
1160,
4074,
326,
5790,
4381,
1368,
326,
1018,
1867,
1172,
315... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
4757,
5646,
12,
2890,
16,
2395,
67,
2354,
16,
4418,
16,
302,
2906,
87,
4672,
2411,
273,
365,
18,
16279,
225,
468,
1160,
4074,
326,
5790,
4381,
1368,
326,
1018,
1867,
1172,
315... |
def _get_schema_handler(self): | def _get_schema_handler_names(self): | def _get_schema_handler(self): handlers = [] for key, data in self.schema.iteritems(): if isinstance(data, tuple): name, kk = data handlers.append(name) return handlers | 99fe1adcb10b389a6cccfdbcb8b674cf970d8aea /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12681/99fe1adcb10b389a6cccfdbcb8b674cf970d8aea/future.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
4821,
67,
4176,
67,
1973,
12,
2890,
4672,
4919,
273,
5378,
364,
498,
16,
501,
316,
365,
18,
4821,
18,
2165,
3319,
13332,
309,
1549,
12,
892,
16,
3193,
4672,
508,
16,
17... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
4821,
67,
4176,
67,
1973,
12,
2890,
4672,
4919,
273,
5378,
364,
498,
16,
501,
316,
365,
18,
4821,
18,
2165,
3319,
13332,
309,
1549,
12,
892,
16,
3193,
4672,
508,
16,
17... |
self.parser.phase.insertionModes["inHead"](self.parser).processStartTag(name, attributes) | self.parser.phase.insertionModes["inHead"](self.parser).\ processStartTag(name, attributes) | def startTagFromHead(self, name, attributes): self.parser.parseError() self.parser.phase.insertionModes["inHead"](self.parser).processStartTag(name, attributes) | 14d32ff13a1e485034b3d2170cde39db587bf593 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10463/14d32ff13a1e485034b3d2170cde39db587bf593/parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
1805,
1265,
1414,
12,
2890,
16,
508,
16,
1677,
4672,
365,
18,
4288,
18,
2670,
668,
1435,
365,
18,
4288,
18,
13961,
18,
6387,
285,
18868,
9614,
267,
1414,
11929,
12,
2890,
18,
4288... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
787,
1805,
1265,
1414,
12,
2890,
16,
508,
16,
1677,
4672,
365,
18,
4288,
18,
2670,
668,
1435,
365,
18,
4288,
18,
13961,
18,
6387,
285,
18868,
9614,
267,
1414,
11929,
12,
2890,
18,
4288... |
if string.upper(text) in ("Y", "YES", "TRUE", "1"): | if text.upper() in ("Y", "YES", "TRUE", "1"): | def readBool(text): if string.upper(text) in ("Y", "YES", "TRUE", "1"): return 1 elif string.upper(text) in ("N", "NO", "FALSE", "0"): return 0 else: raise RMLError, "true/false attribute has illegal value '%s'" % text | 041e2d265f4d145658b08edc02ff501d425029d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/041e2d265f4d145658b08edc02ff501d425029d6/para.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
7464,
12,
955,
4672,
309,
977,
18,
5797,
1435,
316,
7566,
61,
3113,
315,
29081,
3113,
315,
18724,
3113,
315,
21,
6,
4672,
327,
404,
1327,
533,
18,
5797,
12,
955,
13,
316,
7566,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7464,
12,
955,
4672,
309,
977,
18,
5797,
1435,
316,
7566,
61,
3113,
315,
29081,
3113,
315,
18724,
3113,
315,
21,
6,
4672,
327,
404,
1327,
533,
18,
5797,
12,
955,
13,
316,
7566,
... |
anchor=linkimagesplit[0].replace('[[','') | anchor=linkimagesplit[0].lstrip('[') anchor=anchor.rstrip(']') | def sectionheader(text,level,beginmarkup): #output of headinglevels to console if checklevels: print text.rstrip('\n') levelstr='='*level remuster='%s.*?%s' %(levelstr,levelstr) such=re.compile(remuster,re.DOTALL) for treffer in such.findall(text): sectiontitle=treffer.replace(levelstr,'') sectiontitle=sectiontitle.strip(' ') sectionid=sectiontitle.replace("'",'') sectionid=sectionid.replace("?",'') sectionid=sectionid.replace(",",'') sectionid=sectionid.replace("/",'-') sectionid=sectionid.replace(' ','-') sectionid=sectionid.replace('<quote>','').replace('</quote>','') sectionid=sectionid.replace('"','') sectionid=sectionid.replace('nbsp;','') sectionid=sectionid.replace('&','') sectionid=sectionid.replace('(','').replace(')','') sectionid=sectionid.lower() text=text.replace(treffer, '%s id="%s"><title>%s</title>' %(beginmarkup,sectionid,sectiontitle)) return text | caa8bf8158cb2a3ab25a09d0ff4a91b0baf37239 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1692/caa8bf8158cb2a3ab25a09d0ff4a91b0baf37239/wiki2docbook.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2442,
3374,
12,
955,
16,
2815,
16,
10086,
15056,
4672,
468,
2844,
434,
910,
1714,
941,
87,
358,
2983,
309,
866,
12095,
30,
1172,
977,
18,
86,
6406,
2668,
64,
82,
6134,
1801,
701,
2218,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2442,
3374,
12,
955,
16,
2815,
16,
10086,
15056,
4672,
468,
2844,
434,
910,
1714,
941,
87,
358,
2983,
309,
866,
12095,
30,
1172,
977,
18,
86,
6406,
2668,
64,
82,
6134,
1801,
701,
2218,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.