rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
A = self.ambient_hecke_module() V = A.free_module() | rank_target = V.rank() - self.rank() misc.verbose("computing complement") misc.verbose("rank of V is %s" % V.rank()) misc.verbose("want to reduce rank to %s" % rank_target) found = False | def complement(self, bound=None): """ Return the largest Hecke-stable complement of this space. | c47cdc1c671fef9480c8f0aca24dfcf57b4b2aab /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/c47cdc1c671fef9480c8f0aca24dfcf57b4b2aab/submodule.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17161,
12,
2890,
16,
2489,
33,
7036,
4672,
3536,
2000,
326,
12756,
670,
762,
73,
17,
15021,
17161,
434,
333,
3476,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17161,
12,
2890,
16,
2489,
33,
7036,
4672,
3536,
2000,
326,
12756,
670,
762,
73,
17,
15021,
17161,
434,
333,
3476,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
icon = self.icon(obj.getIcon(1)) | icon = self.icon(portal_type) | def info_object(self, obj, allowLink=True): '''Get information from a content object''' | 188d71cf0739c305eb952f114afbd218d5b8b31c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10193/188d71cf0739c305eb952f114afbd218d5b8b31c/plonedrawers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1123,
67,
1612,
12,
2890,
16,
1081,
16,
1699,
2098,
33,
5510,
4672,
9163,
967,
1779,
628,
279,
913,
733,
26418,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1123,
67,
1612,
12,
2890,
16,
1081,
16,
1699,
2098,
33,
5510,
4672,
9163,
967,
1779,
628,
279,
913,
733,
26418,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
cr.execute('SELECT id, number_next, prefix, suffix, padding FROM ir_sequence WHERE '+test+' AND active=%s FOR UPDATE', (sequence_id, True)) | assert test in ('code','id') cr.execute('SELECT id, number_next, prefix, suffix, padding FROM ir_sequence WHERE '+test+'=%s AND active=%s FOR UPDATE', (sequence_id, True)) | def get_id(self, cr, uid, sequence_id, test='id=%s', context=None): try: cr.execute('SELECT id, number_next, prefix, suffix, padding FROM ir_sequence WHERE '+test+' AND active=%s FOR UPDATE', (sequence_id, True)) res = cr.dictfetchone() if res: cr.execute('UPDATE ir_sequence SET number_next=number_next+number_increment WHERE id=%s AND active=%s', (res['id'], True)) if res['number_next']: return self._process(res['prefix']) + '%%0%sd' % res['padding'] % res['number_next'] + self._process(res['suffix']) else: return self._process(res['prefix']) + self._process(res['suffix']) finally: cr.commit() return False | f386ec0932aade690049bc3cbd65f12fce0637a9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/f386ec0932aade690049bc3cbd65f12fce0637a9/ir_sequence.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
350,
12,
2890,
16,
4422,
16,
4555,
16,
3102,
67,
350,
16,
1842,
2218,
350,
5095,
87,
2187,
819,
33,
7036,
4672,
775,
30,
1815,
1842,
316,
7707,
710,
17023,
350,
6134,
4422,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
350,
12,
2890,
16,
4422,
16,
4555,
16,
3102,
67,
350,
16,
1842,
2218,
350,
5095,
87,
2187,
819,
33,
7036,
4672,
775,
30,
1815,
1842,
316,
7707,
710,
17023,
350,
6134,
4422,
... |
r.concatTransform( M44f.createTranslated( V3f( 0, 0, -5 ) ) ) | r.concatTransform( M44f.createTranslated( V3f( 0, 0, 5 ) ) ) | def testStacks( self ) : r = Renderer() r.setOption( "gl:mode", StringData( "deferred" ) ) r.setOption( "gl:searchPath:shader", StringData( os.path.dirname( __file__ ) + "/shaders" ) ) r.worldBegin() # we have to make this here so that the shaders that get made are made in the # correct GL context. My understanding is that all shaders should work in all # GL contexts in the address space, but that doesn't seem to be the case. #w = SceneViewer( "scene", r.scene() ) r.concatTransform( M44f.createTranslated( V3f( 0, 0, -5 ) ) ) r.shader( "surface", "color", { "colorValue" : Color3fData( Color3f( 1, 0, 0 ) ) } ) r.geometry( "sphere", {}, {} ) r.concatTransform( M44f.createTranslated( V3f( -1, 0, 0 ) ) ) r.shader( "surface", "color", { "colorValue" : Color3fData( Color3f( 0, 1, 0 ) ) } ) r.geometry( "sphere", {}, {} ) r.concatTransform( M44f.createTranslated( V3f( 2, 0, 0 ) ) ) r.shader( "surface", "color", { "colorValue" : Color3fData( Color3f( 0, 0, 1 ) ) } ) r.geometry( "sphere", {}, {} ) r.worldEnd() #w.start() | 686f08c6e1e459dbc1884fe646a6bd99017df827 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9042/686f08c6e1e459dbc1884fe646a6bd99017df827/Renderer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
28090,
12,
365,
262,
294,
225,
436,
273,
17589,
1435,
436,
18,
542,
1895,
12,
315,
7043,
30,
3188,
3113,
514,
751,
12,
315,
26622,
6,
262,
262,
436,
18,
542,
1895,
12,
315,
704... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
28090,
12,
365,
262,
294,
225,
436,
273,
17589,
1435,
436,
18,
542,
1895,
12,
315,
7043,
30,
3188,
3113,
514,
751,
12,
315,
26622,
6,
262,
262,
436,
18,
542,
1895,
12,
315,
704... |
def __call__(self, table, weight, verbose=0): | def __call__(self, table, weight=None, folds=5, verbose=0): | def __call__(self, table, weight, verbose=0): import types, whrandom import orange, orngTest, orngStat if (type(self.parameter)==types.ListType) or (type(self.parameter)==types.TupleType): to_set=[self.findobj(ld) for ld in self.parameter] else: to_set=[self.findobj(self.parameter)] | 51a593a49e59e2bf47ecfffe8b4de220485b6c43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6366/51a593a49e59e2bf47ecfffe8b4de220485b6c43/orngWrap.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
1014,
16,
3119,
33,
7036,
16,
11590,
87,
33,
25,
16,
3988,
33,
20,
4672,
1930,
1953,
16,
600,
9188,
1930,
578,
726,
16,
578,
3368,
4709,
16,
578,
3368,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
1014,
16,
3119,
33,
7036,
16,
11590,
87,
33,
25,
16,
3988,
33,
20,
4672,
1930,
1953,
16,
600,
9188,
1930,
578,
726,
16,
578,
3368,
4709,
16,
578,
3368,... |
cmd = '/usr/bin/scanner ' cmd += '-b %s ' % self.options.brain_instance | cmd = opts.scanner or '/usr/bin/scanner' cmd += ' ' if self.options.brain_instance: cmd += '-b %s ' % self.options.brain_instance | def do_scan(self, subcmd, opts, *args): """${cmd_name}: scan mirrors | 04f843cf6542842a0090d55fc9be9756d9d1bc7b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10990/04f843cf6542842a0090d55fc9be9756d9d1bc7b/mirrordoctor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
9871,
12,
2890,
16,
720,
4172,
16,
1500,
16,
380,
1968,
4672,
3536,
18498,
4172,
67,
529,
6713,
4135,
312,
27026,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
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,
741,
67,
9871,
12,
2890,
16,
720,
4172,
16,
1500,
16,
380,
1968,
4672,
3536,
18498,
4172,
67,
529,
6713,
4135,
312,
27026,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if not os.isatty(slave_fd) and sys.platform not in fickle_isatty: | if not os.isatty(slave_fd): | def test_basic_pty(): try: debug("Calling master_open()") master_fd, slave_name = pty.master_open() debug("Got master_fd '%d', slave_name '%s'"%(master_fd, slave_name)) debug("Calling slave_open(%r)"%(slave_name,)) slave_fd = pty.slave_open(slave_name) debug("Got slave_fd '%d'"%slave_fd) except OSError: # " An optional feature could not be imported " ... ? raise TestSkipped, "Pseudo-terminals (seemingly) not functional." if not os.isatty(slave_fd) and sys.platform not in fickle_isatty: raise TestFailed, "slave_fd is not a tty" debug("Writing to slave_fd") os.write(slave_fd, TEST_STRING_1) s1 = os.read(master_fd, 1024) sys.stdout.write(normalize_output(s1)) debug("Writing chunked output") os.write(slave_fd, TEST_STRING_2[:5]) os.write(slave_fd, TEST_STRING_2[5:]) s2 = os.read(master_fd, 1024) sys.stdout.write(normalize_output(s2)) os.close(slave_fd) os.close(master_fd) | 7fbecc6e4f25c49e8e53a0d7007a71cb1ee15ad5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7fbecc6e4f25c49e8e53a0d7007a71cb1ee15ad5/test_pty.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
13240,
67,
825,
13332,
775,
30,
1198,
2932,
19677,
4171,
67,
3190,
1435,
7923,
4171,
67,
8313,
16,
11735,
67,
529,
273,
293,
4098,
18,
7525,
67,
3190,
1435,
1198,
2932,
15617,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
13240,
67,
825,
13332,
775,
30,
1198,
2932,
19677,
4171,
67,
3190,
1435,
7923,
4171,
67,
8313,
16,
11735,
67,
529,
273,
293,
4098,
18,
7525,
67,
3190,
1435,
1198,
2932,
15617,
... |
res = super(wiz_auc_lots_numerotate_per_lot, self).default_get(cr, uid, fields, context=context) | res = super(auction_lots_numerotate_per_lot, self).default_get(cr, uid, fields, context=context) | def default_get(self, cr, uid, fields, context): """ To get default values for the object. @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param fields: List of fields for which we want default values @param context: A standard dictionary @return: A dictionary which of fields with values. """ res = super(wiz_auc_lots_numerotate_per_lot, self).default_get(cr, uid, fields, context=context) active_id = context.get('active_id',False) active_model = context.get('active_model') if active_id and (active_model and active_model!='auction.lots'): return res lots_obj = self.pool.get('auction.lots') lots = lots_obj.browse(cr, uid, active_id) if 'bord_vnd_id' in fields and context.get('bord_vnd_id',False): res['bord_vnd_id'] = context.get('bord_vnd_id') if 'lot_num' in fields and context.get('lot_num',False): res['lot_num'] = context.get('lot_num') if 'lot_est1' in fields: res['lot_est1'] = lots.lot_est1 if 'lot_est2' in fields: res['lot_est2'] = lots.lot_est2 if 'name' in fields: res['name'] = lots.name if 'obj_desc' in fields: res['obj_desc'] = lots.obj_desc if 'obj_num' in fields: res['obj_num'] = lots.obj_num return res | 61ce0995704862e3efbaaa16153c8d416ee15094 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/61ce0995704862e3efbaaa16153c8d416ee15094/auction_lots_numerotate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
805,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
1466,
16,
819,
4672,
3536,
2974,
336,
805,
924,
364,
326,
733,
18,
632,
891,
365,
30,
1021,
733,
4407,
18,
632,
891,
4422,
30,
432,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
805,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
1466,
16,
819,
4672,
3536,
2974,
336,
805,
924,
364,
326,
733,
18,
632,
891,
365,
30,
1021,
733,
4407,
18,
632,
891,
4422,
30,
432,
... |
Equivalent of `itertool.imap()` -- can be MUCH slower than `Pool.map()` | Equivalent of `itertools.imap()` -- can be MUCH slower than `Pool.map()` | def imap(self, func, iterable, chunksize=1): ''' Equivalent of `itertool.imap()` -- can be MUCH slower than `Pool.map()` ''' assert self._state == RUN if chunksize == 1: result = IMapIterator(self._cache) self._taskqueue.put((((result._job, i, func, (x,), {}) for i, x in enumerate(iterable)), result._set_length)) return result else: assert chunksize > 1 task_batches = Pool._get_tasks(func, iterable, chunksize) result = IMapIterator(self._cache) self._taskqueue.put((((result._job, i, mapstar, (x,), {}) for i, x in enumerate(task_batches)), result._set_length)) return (item for chunk in result for item in chunk) | fc7d8a5e6accf7853e2f418e578ba043963cc43e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/fc7d8a5e6accf7853e2f418e578ba043963cc43e/pool.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20226,
12,
2890,
16,
1326,
16,
6087,
16,
23256,
33,
21,
4672,
9163,
31208,
434,
1375,
2165,
6642,
18,
12161,
20338,
1493,
848,
506,
490,
57,
1792,
27926,
2353,
1375,
2864,
18,
1458,
2033... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20226,
12,
2890,
16,
1326,
16,
6087,
16,
23256,
33,
21,
4672,
9163,
31208,
434,
1375,
2165,
6642,
18,
12161,
20338,
1493,
848,
506,
490,
57,
1792,
27926,
2353,
1375,
2864,
18,
1458,
2033... |
return webjournal_error_box(self.ln, | return webjournal_templates.tmpl_webjournal_error_box(self.ln, | def user_box(self): """ user-friendly message with formatting. """ _ = gettext_set_language(self.ln) return webjournal_error_box(self.ln, _('No current issue'), _('We could not find any informtion on the current issue'), _('The configuration for the current issue seems to be empty. ' 'Try providing an issue number or check with support.')) | 71e3916e1f77352af2632a272e01d8bf90b6c8b9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/71e3916e1f77352af2632a272e01d8bf90b6c8b9/webjournal_config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
729,
67,
2147,
12,
2890,
4672,
3536,
729,
17,
29111,
883,
598,
10407,
18,
3536,
389,
273,
24972,
67,
542,
67,
4923,
12,
2890,
18,
2370,
13,
327,
732,
441,
7116,
67,
8502,
18,
24717,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
729,
67,
2147,
12,
2890,
4672,
3536,
729,
17,
29111,
883,
598,
10407,
18,
3536,
389,
273,
24972,
67,
542,
67,
4923,
12,
2890,
18,
2370,
13,
327,
732,
441,
7116,
67,
8502,
18,
24717,
... |
return 'fail' | gdaltest.post_reason( 'wrong geometry type for layer table36_inherited2' ) return 'fail' lyr = ds.GetLayerByName( 'AutoTest-schema.table36_inherited2' ) if lyr is None: return 'fail' if gdaltest.pg_has_postgis and lyr.GetLayerDefn().GetGeomType() != ogr.wkbLineString: gdaltest.post_reason( 'wrong geometry type for layer AutoTest-schema.table36_inherited2' ) return 'fail' | def ogr_pg_36(): if gdaltest.pg_ds is None: return 'skip' if gdaltest.pg_has_postgis: gdaltest.pg_lyr = gdaltest.pg_ds.CreateLayer( 'table36_base', geom_type = ogr.wkbPoint ) else: gdaltest.pg_lyr = gdaltest.pg_ds.CreateLayer( 'table36_base' ) gdaltest.pg_ds.ExecuteSQL('CREATE TABLE table36_inherited ( col1 CHAR(1) ) INHERITS ( table36_base )') gdaltest.pg_ds.ExecuteSQL('CREATE TABLE table36_inherited2 ( col2 CHAR(1) ) INHERITS ( table36_inherited )') ds = ogr.Open( 'PG:' + gdaltest.pg_connection_string, update = 1 ) found = ogr_pg_check_layer_in_list(ds, 'table36_inherited') if found is False: gdaltest.post_reason( 'layer table36_inherited not listed' ) return 'fail' found = ogr_pg_check_layer_in_list(ds, 'table36_inherited2') if found is False: gdaltest.post_reason( 'layer table36_inherited2 not listed' ) return 'fail' lyr = ds.GetLayerByName( 'table36_inherited2' ) if lyr is None: return 'fail' if gdaltest.pg_has_postgis and lyr.GetLayerDefn().GetGeomType() != ogr.wkbPoint: return 'fail' ds.Destroy() return 'success' | 8157a300f635947e1897b92df3dc46d883c62794 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10289/8157a300f635947e1897b92df3dc46d883c62794/ogr_pg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
320,
3197,
67,
8365,
67,
5718,
13332,
225,
309,
15551,
2390,
395,
18,
8365,
67,
2377,
353,
599,
30,
327,
296,
7457,
11,
225,
309,
15551,
2390,
395,
18,
8365,
67,
5332,
67,
2767,
15761,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
320,
3197,
67,
8365,
67,
5718,
13332,
225,
309,
15551,
2390,
395,
18,
8365,
67,
2377,
353,
599,
30,
327,
296,
7457,
11,
225,
309,
15551,
2390,
395,
18,
8365,
67,
5332,
67,
2767,
15761,... |
slices[slicenodat] = Slice(slicenodat, live[slicenodat]['name'], live[slicenodat]['_rspec']) | if live.has_key(slicenodat): slices[slicenodat] = Slice(slicenodat, live[slicenodat]['name'], live[slicenodat]['_rspec']) else: bwlimit.off(slicenodat) | def sync(nmdbcopy): """ Syncs tc, db, and bwmon.dat. Then, starts new slices, kills old ones, and updates byte accounts for each running slice. Sends emails and caps those that went over their limit. """ # Defaults global datafile, \ period, \ default_MaxRate, \ default_Maxi2Rate, \ default_MinRate, \ default_MaxKByte,\ default_ThreshKByte,\ default_Maxi2KByte,\ default_Threshi2KByte,\ default_Share,\ verbose # All slices names = [] # Incase the limits have changed. default_MaxRate = int(bwlimit.get_bwcap() / 1000) default_Maxi2Rate = int(bwlimit.bwmax / 1000) # Incase default isn't set yet. if default_MaxRate == -1: default_MaxRate = 1000000 try: f = open(datafile, "r+") logger.log("bwmon: Loading %s" % datafile) (version, slices, deaddb) = pickle.load(f) f.close() # Check version of data file if version != "$Id$": logger.log("bwmon: Not using old version '%s' data file %s" % (version, datafile)) raise Exception except Exception: version = "$Id$" slices = {} deaddb = {} # Get/set special slice IDs root_xid = bwlimit.get_xid("root") default_xid = bwlimit.get_xid("default") # Since root is required for sanity, its not in the API/plc database, so pass {} # to use defaults. if root_xid not in slices.keys(): slices[root_xid] = Slice(root_xid, "root", {}) slices[root_xid].reset(0, 0, 0, 0, {}) # Used by bwlimit. pass {} since there is no rspec (like above). if default_xid not in slices.keys(): slices[default_xid] = Slice(default_xid, "default", {}) slices[default_xid].reset(0, 0, 0, 0, {}) live = {} # Get running slivers that should be on this node (from plc). {xid: name} # db keys on name, bwmon keys on xid. db doesnt have xid either. for plcSliver in nmdbcopy.keys(): live[bwlimit.get_xid(plcSliver)] = nmdbcopy[plcSliver] logger.log("bwmon: Found %s instantiated slices" % live.keys().__len__()) logger.log("bwmon: Found %s slices in dat file" % slices.values().__len__()) # Get actual running values from tc. # Update slice totals and bandwidth. {xid: {values}} kernelhtbs = gethtbs(root_xid, default_xid) logger.log("bwmon: Found %s running HTBs" % kernelhtbs.keys().__len__()) # The dat file has HTBs for slices, but the HTBs aren't running nohtbslices = Set(slices.keys()) - Set(kernelhtbs.keys()) logger.log( "bwmon: Found %s slices in dat but not running." % nohtbslices.__len__() ) # Reset tc counts. for nohtbslice in nohtbslices: if live.has_key(nohtbslice): slices[nohtbslice].reset( 0, 0, 0, 0, live[nohtbslice]['_rspec'] ) # The dat file doesnt have HTB for the slice, but slice is running and # HTB exists slicesnodat = Set(kernelhtbs.keys()) - Set(slices.keys()) logger.log( "bwmon: Found %s slices with HTBs but not in dat" % slicesnodat.__len__() ) for slicenodat in slicesnodat: slices[slicenodat] = Slice(slicenodat, live[slicenodat]['name'], live[slicenodat]['_rspec']) # Get new slices. # Slices in GetSlivers but not running HTBs newslicesxids = Set(live.keys()) - Set(kernelhtbs.keys()) logger.log("bwmon: Found %s new slices" % newslicesxids.__len__()) # Setup new slices for newslice in newslicesxids: # Delegated slices dont have xids (which are uids) since they haven't been # instantiated yet. if newslice != None and live[newslice].has_key('_rspec') == True: # Check to see if we recently deleted this slice. if live[newslice]['name'] not in deaddb.keys(): logger.log( "bwmon: New Slice %s" % live[newslice]['name'] ) # _rspec is the computed rspec: NM retrieved data from PLC, computed loans # and made a dict of computed values. slices[newslice] = Slice(newslice, live[newslice]['name'], live[newslice]['_rspec']) slices[newslice].reset( 0, 0, 0, 0, live[newslice]['_rspec'] ) # Double check time for dead slice in deaddb is within 24hr recording period. elif (time.time() <= (deaddb[live[newslice]['name']]['slice'].time + period)): deadslice = deaddb[live[newslice]['name']] logger.log("bwmon: Reinstantiating deleted slice %s" % live[newslice]['name']) slices[newslice] = deadslice['slice'] slices[newslice].xid = newslice # Start the HTB slices[newslice].reset(deadslice['slice'].MaxRate, deadslice['slice'].Maxi2Rate, deadslice['htb']['usedbytes'], deadslice['htb']['usedi2bytes'], live[newslice]['_rspec']) # Bring up to date slices[newslice].update(deadslice['slice'].MaxRate, deadslice['slice'].Maxi2Rate, deadslice['htb']['usedbytes'], deadslice['htb']['usedi2bytes'], live[newslice]['_rspec']) # Since the slice has been reinitialed, remove from dead database. del deaddb[deadslice] else: logger.log("bwmon Slice %s doesn't have xid. Must be delegated."\ "Skipping." % live[newslice]['name']) # Move dead slices that exist in the pickle file, but # aren't instantiated by PLC into the dead dict until # recording period is over. This is to avoid the case where a slice is dynamically created # and destroyed then recreated to get around byte limits. deadxids = Set(slices.keys()) - Set(live.keys()) logger.log("bwmon: Found %s dead slices" % (dead.__len__() - 2)) for deadxid in deadxids: if deadxid == root_xid or deadxid == default_xid: continue logger.log("bwmon: removing dead slice %s " % deadxid) if slices.has_key(deadxid): # add slice (by name) to deaddb deaddb[slices[deadxid].name] = {'slice': slices[deadxid], 'htb': kernelhtbs[deadxid]} del slices[deadxid] if kernelhtbs.has_key(deadxid): bwlimit.off(xid) # Clean up deaddb for (deadslice, deadhtb) in deaddb.iteritems(): if (time.time() >= (deadslice.time() + period)): logger.log("bwmon: Removing dead slice %s from dat." % deadslice.name) del deaddb[deadslice.name] # Get actual running values from tc since we've added and removed buckets. # Update slice totals and bandwidth. {xid: {values}} kernelhtbs = gethtbs(root_xid, default_xid) logger.log("bwmon: now %s running HTBs" % kernelhtbs.keys().__len__()) for (xid, slice) in slices.iteritems(): # Monitor only the specified slices if xid == root_xid or xid == default_xid: continue if names and name not in names: continue if (time.time() >= (slice.time + period)) or \ (kernelhtbs[xid]['usedbytes'] < slice.bytes) or \ (kernelhtbs[xid]['usedi2bytes'] < slice.i2bytes): # Reset to defaults every 24 hours or if it appears # that the byte counters have overflowed (or, more # likely, the node was restarted or the HTB buckets # were re-initialized). slice.reset(kernelhtbs[xid]['maxrate'], \ kernelhtbs[xid]['maxexemptrate'], \ kernelhtbs[xid]['usedbytes'], \ kernelhtbs[xid]['usedi2bytes'], \ live[xid]['_rspec']) else: if debug: logger.log("bwmon: Updating slice %s" % slice.name) # Update byte counts slice.update(kernelhtbs[xid]['maxrate'], \ kernelhtbs[xid]['maxexemptrate'], \ kernelhtbs[xid]['usedbytes'], \ kernelhtbs[xid]['usedi2bytes'], \ live[xid]['_rspec']) logger.log("bwmon: Saving %s slices in %s" % (slices.keys().__len__(),datafile)) f = open(datafile, "w") pickle.dump((version, slices, deaddb), f) f.close() | 329419f2c6de2b011a55dbd9f1f91337ef3b840a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6995/329419f2c6de2b011a55dbd9f1f91337ef3b840a/bwmon.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3792,
12,
82,
27574,
3530,
4672,
3536,
9721,
87,
1715,
16,
1319,
16,
471,
12986,
2586,
18,
3404,
18,
225,
9697,
16,
2542,
394,
12390,
16,
8673,
87,
1592,
5945,
16,
471,
4533,
1160,
948... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3792,
12,
82,
27574,
3530,
4672,
3536,
9721,
87,
1715,
16,
1319,
16,
471,
12986,
2586,
18,
3404,
18,
225,
9697,
16,
2542,
394,
12390,
16,
8673,
87,
1592,
5945,
16,
471,
4533,
1160,
948... |
f = llhelper(self._STACK_CHECK_SLOWPATH, rstack.stack_check_slowpath) addr = rffi.cast(lltype.Signed, f) mc.CALL(imm(addr)) | mc.CALL(imm(slowpathaddr)) | def _build_stack_check_slowpath(self): from pypy.rlib import rstack mc = codebuf.MachineCodeBlockWrapper() mc.PUSH_r(ebp.value) mc.MOV_rr(ebp.value, esp.value) # if IS_X86_64: # on the x86_64, we have to save all the registers that may # have been used to pass arguments for reg in [edi, esi, edx, ecx, r8, r9]: mc.PUSH_r(reg.value) mc.SUB_ri(esp.value, 8*8) for i in range(8): mc.MOVSD_sx(8*i, i) # xmm0 to xmm7 # if IS_X86_32: mc.LEA_rb(eax.value, +8) mc.PUSH_r(eax.value) elif IS_X86_64: mc.LEA_rb(edi.value, +16) mc.AND_ri(esp.value, -16) # f = llhelper(self._STACK_CHECK_SLOWPATH, rstack.stack_check_slowpath) addr = rffi.cast(lltype.Signed, f) mc.CALL(imm(addr)) # mc.MOV(eax, heap(self.cpu.pos_exception())) mc.TEST_rr(eax.value, eax.value) mc.J_il8(rx86.Conditions['NZ'], 0) jnz_location = mc.get_relative_pos() # if IS_X86_64: # restore the registers for i in range(7, -1, -1): mc.MOVSD_xs(i, 8*i) for i, reg in [(6, r9), (5, r8), (4, ecx), (3, edx), (2, esi), (1, edi)]: mc.MOV_rb(reg.value, -8*i) # mc.MOV_rr(esp.value, ebp.value) mc.POP_r(ebp.value) mc.RET() # # patch the JNZ above offset = mc.get_relative_pos() - jnz_location assert 0 < offset <= 127 mc.overwrite(jnz_location-1, chr(offset)) # clear the exception from the global position mc.MOV(eax, heap(self.cpu.pos_exc_value())) mc.MOV(heap(self.cpu.pos_exception()), imm0) mc.MOV(heap(self.cpu.pos_exc_value()), imm0) # save the current exception instance into fail_boxes_ptr[0] adr = self.fail_boxes_ptr.get_addr_for_num(0) mc.MOV(heap(adr), eax) # call the helper function to set the GC flag on the fail_boxes_ptr # array (note that there is no exception any more here) addr = self.cpu.get_on_leave_jitted_int(save_exception=False) mc.CALL(imm(addr)) # assert self.cpu.exit_frame_with_exception_v >= 0 mc.MOV_ri(eax.value, self.cpu.exit_frame_with_exception_v) # # footer -- note the ADD, which skips the return address of this # function, and will instead return to the caller's caller. Note # also that we completely ignore the saved arguments, because we # are interrupting the function. mc.MOV_rr(esp.value, ebp.value) mc.POP_r(ebp.value) mc.ADD_ri(esp.value, WORD) mc.RET() # rawstart = mc.materialize(self.cpu.asmmemmgr, []) self.stack_check_slowpath_imm = imm(rawstart) | 6bc9ade812f014c6aebce1452a76e194d9852757 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6934/6bc9ade812f014c6aebce1452a76e194d9852757/assembler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3510,
67,
3772,
67,
1893,
67,
87,
821,
803,
12,
2890,
4672,
628,
18951,
93,
18,
1321,
495,
1930,
436,
3772,
6108,
273,
981,
4385,
18,
6981,
1085,
1768,
3611,
1435,
6108,
18,
30348... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3510,
67,
3772,
67,
1893,
67,
87,
821,
803,
12,
2890,
4672,
628,
18951,
93,
18,
1321,
495,
1930,
436,
3772,
6108,
273,
981,
4385,
18,
6981,
1085,
1768,
3611,
1435,
6108,
18,
30348... |
"""Invoke parent class' journal_show_object if it exists.""" s = super(ViewSourceActivity, self) if hasattr(s, 'journal_show_object'): s.journal_show_object(object_id) | """Invoke journal_show_object from sugar.activity.activity if it exists.""" try: from sugar.activity.activity import show_object_in_journal show_object_in_journal(object_id) except ImportError: pass | def journal_show_object(self, object_id): """Invoke parent class' journal_show_object if it exists.""" s = super(ViewSourceActivity, self) if hasattr(s, 'journal_show_object'): s.journal_show_object(object_id) | 17c462757fca10bbf5c065c8ae3cc18bf40851ac /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7190/17c462757fca10bbf5c065c8ae3cc18bf40851ac/activity.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13001,
67,
4500,
67,
1612,
12,
2890,
16,
733,
67,
350,
4672,
3536,
10969,
982,
667,
11,
13001,
67,
4500,
67,
1612,
309,
518,
1704,
12123,
272,
273,
2240,
12,
1767,
1830,
6193,
16,
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,
13001,
67,
4500,
67,
1612,
12,
2890,
16,
733,
67,
350,
4672,
3536,
10969,
982,
667,
11,
13001,
67,
4500,
67,
1612,
309,
518,
1704,
12123,
272,
273,
2240,
12,
1767,
1830,
6193,
16,
365,... |
c = self.out.read( 1 ) | c = stream2str( self.out.read( 1 ) ) | def run( self ): global terminate | fd081abd0af582428041d7b17f7ef9f605828342 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10890/fd081abd0af582428041d7b17f7ef9f605828342/slimv.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
365,
262,
30,
2552,
10850,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
365,
262,
30,
2552,
10850,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
return value.strftime('%Y-%m-%d %H:%M') | return value.strftime('%Y-%m-%d') | def encode(cls, value): if value is None: return '' return value.strftime('%Y-%m-%d %H:%M') | 8bbb2a3fb14f7652affdf75eb3a99e780e8e2232 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/8bbb2a3fb14f7652affdf75eb3a99e780e8e2232/IO.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2017,
12,
6429,
16,
460,
4672,
309,
460,
353,
599,
30,
327,
875,
327,
460,
18,
701,
9982,
29909,
61,
6456,
81,
6456,
72,
738,
44,
5319,
49,
6134,
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,
2017,
12,
6429,
16,
460,
4672,
309,
460,
353,
599,
30,
327,
875,
327,
460,
18,
701,
9982,
29909,
61,
6456,
81,
6456,
72,
738,
44,
5319,
49,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-10... |
gameTypeName = variants[variant].name ratingType = self.variants[variant] self.widgets["yourRatingNameLabel"].set_label(gameTypeName) | gametype = variants[variant].name ratingtype = self.variants[variant] return gametype, ratingtype def __updateYourRatingHBox (self): if self.finger == None: return gametype, ratingtype = self.__getGameTypes() self.widgets["yourRatingNameLabel"].set_label(gametype) | def __updateYourRatingHBox (self): if self.finger == None: return if self.widgets["untimedCheck"].get_active(): gameTypeName = self.__getNameOfTimeControl(0, 0) ratingType = self.__getTypeOfTimeControl(0, 0) elif self.widgets["noVariantRadio"].get_active(): min = int(self.widgets["minutesSpin"].get_value()) gain = int(self.widgets["gainSpin"].get_value()) gameTypeName = self.__getNameOfTimeControl(min, gain) ratingType = self.__getTypeOfTimeControl(min, gain) else: variant_combo_getter = self.seekEditorWidgetGettersSetters["variantCombo"][0] variant = variant_combo_getter(self.widgets["variantCombo"]) gameTypeName = variants[variant].name ratingType = self.variants[variant] | 722dcd889fab912f15e7688b07f1ddcedb21e013 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5339/722dcd889fab912f15e7688b07f1ddcedb21e013/ICLounge.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2725,
15446,
20388,
44,
3514,
261,
2890,
4672,
309,
365,
18,
74,
6658,
422,
599,
30,
327,
225,
309,
365,
18,
18148,
9614,
318,
20905,
1564,
6,
8009,
588,
67,
3535,
13332,
7920,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2725,
15446,
20388,
44,
3514,
261,
2890,
4672,
309,
365,
18,
74,
6658,
422,
599,
30,
327,
225,
309,
365,
18,
18148,
9614,
318,
20905,
1564,
6,
8009,
588,
67,
3535,
13332,
7920,
7... |
if __name__ == '__main__': | if __name__ == '__main__': | def main(args=sys.argv): parser = option_parser() options, args = parser.parse_args(args) if len(args) != 2: parser.print_help() return 1 fetcher = create_fetcher(options) fetcher.start_fetch(args[1]) | 596b52afac5365d3f7c48b017160fc09530e9c95 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9125/596b52afac5365d3f7c48b017160fc09530e9c95/simple.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
1968,
33,
9499,
18,
19485,
4672,
2082,
273,
1456,
67,
4288,
1435,
702,
16,
833,
273,
2082,
18,
2670,
67,
1968,
12,
1968,
13,
309,
562,
12,
1968,
13,
480,
576,
30,
2082,
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,
2774,
12,
1968,
33,
9499,
18,
19485,
4672,
2082,
273,
1456,
67,
4288,
1435,
702,
16,
833,
273,
2082,
18,
2670,
67,
1968,
12,
1968,
13,
309,
562,
12,
1968,
13,
480,
576,
30,
2082,
18,... |
initialStrainB = [6.1e-4, 6.2e-4, 6.3e-4, 6.4e-4, 6.5e-4, 6.6e-4] | initialStrainB = [6.1e-5, 6.2e-5, 6.3e-5, 6.6e-5, 6.5e-5, 6.4e-5] | def __init__(self, name="druckerprager3delastic"): """ Constructor. """ ElasticMaterialApp.__init__(self, name) | 7457070fc151c31ad4b7704dd791acb50ee6640a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8645/7457070fc151c31ad4b7704dd791acb50ee6640a/DruckerPrager3DTimeDep.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
508,
1546,
3069,
9031,
264,
683,
6817,
23,
3771,
8160,
6,
4672,
3536,
11417,
18,
3536,
9775,
11790,
3371,
16186,
2738,
972,
12,
2890,
16,
508,
13,
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,
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,
508,
1546,
3069,
9031,
264,
683,
6817,
23,
3771,
8160,
6,
4672,
3536,
11417,
18,
3536,
9775,
11790,
3371,
16186,
2738,
972,
12,
2890,
16,
508,
13,
2,
-10... |
def _set_message(self, msgid, msgstr=[''], comments=[], references={}): | def _set_message(self, msgid, msgstr=[u''], comments=[], references={}): | def _set_message(self, msgid, msgstr=[''], comments=[], references={}): if isinstance(msgid, (str, unicode)): msgid = [msgid] if isinstance(msgstr, (str, unicode)): msgstr = [msgstr] | 92fbac2762ad6f7abb01e267b4ed5b254274700f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/92fbac2762ad6f7abb01e267b4ed5b254274700f/PO.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
542,
67,
2150,
12,
2890,
16,
24389,
16,
8733,
313,
22850,
89,
11,
17337,
5678,
22850,
6487,
5351,
12938,
4672,
309,
1549,
12,
3576,
350,
16,
261,
701,
16,
5252,
3719,
30,
24389,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
542,
67,
2150,
12,
2890,
16,
24389,
16,
8733,
313,
22850,
89,
11,
17337,
5678,
22850,
6487,
5351,
12938,
4672,
309,
1549,
12,
3576,
350,
16,
261,
701,
16,
5252,
3719,
30,
24389,
2... |
print 'No changes were necessary in %s' % pl.linkname() | try: print 'No changes were necessary in %s' % pl.linkname() except UnicodeEncodeError: print 'Error decoding pl.linkname()' continue | def generator(source, replacements, exceptions, regex, textfilename = None, sqlfilename = None, pagenames = None): ''' Generator which will yield PageLinks for pages that might contain text to replace. These pages might be retrieved from a local SQL dump file or a text file, or as a list of pages entered by the user. Arguments: * source - where the bot should retrieve the page list from. can be 'sqldump', 'textfile' or 'userinput'. * replacements - a dictionary where keys are original texts and values are replacement texts. * exceptions - a list of strings; pages which contain one of these won't be changed. * regex - if the entries of replacements and exceptions should be interpreted as regular expressions * textfilename - the textfile's path, either absolute or relative, which will be used when source is 'textfile'. * sqlfilename - the dump's path, either absolute or relative, which will be used when source is 'sqldump'. * pagenames - a list of pages which will be used when source is 'userinput'. ''' if source == 'sqldump': for pl in read_pages_from_sql_dump(sqlfilename, replacements, exceptions, regex): yield pl elif source == 'textfile': for pl in read_pages_from_text_file(textfilename): yield pl elif source == 'userinput': for pagename in pagenames: yield wikipedia.PageLink(wikipedia.mylang, pagename) | d4b4944c8e5c69f758d1be95405dc813ac10b3da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/d4b4944c8e5c69f758d1be95405dc813ac10b3da/replace.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4456,
12,
3168,
16,
11413,
16,
4798,
16,
3936,
16,
977,
3459,
273,
599,
16,
1847,
3459,
273,
599,
16,
4262,
6809,
273,
599,
4672,
9163,
10159,
1492,
903,
2824,
3460,
7100,
364,
4689,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4456,
12,
3168,
16,
11413,
16,
4798,
16,
3936,
16,
977,
3459,
273,
599,
16,
1847,
3459,
273,
599,
16,
4262,
6809,
273,
599,
4672,
9163,
10159,
1492,
903,
2824,
3460,
7100,
364,
4689,
7... |
mov reg, reg, regm, flags=(nCPF,) | mov reg, reg, t1, flags=(nCPF,) | def macroop CMOVNP_R_M | 011c1865ad559220f2ff07db572afd93244a9b6c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6787/011c1865ad559220f2ff07db572afd93244a9b6c/conditional_move.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11522,
556,
385,
5980,
58,
23430,
67,
54,
67,
49,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11522,
556,
385,
5980,
58,
23430,
67,
54,
67,
49,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
sage: R.<x> = QQ['x'] sage: H = HyperellipticCurve(x^5-23*x^3+18*x^2+40*x) sage: P = H(1,6) sage: x,y = H.local_coordinates_at_nonweierstrass(P,prec=5) sage: x 1 + t + O(t^5) sage: y 6 + t - 7/2*t^2 - 1/2*t^3 - 25/48*t^4 + O(t^5) sage: Q = H(-2,12) sage: x,y = H.local_coordinates_at_nonweierstrass(Q,prec=5) sage: x -2 + t + O(t^5) sage: y 12 - 19/2*t - 19/32*t^2 + 61/256*t^3 - 5965/24576*t^4 + O(t^5) | sage: R.<x> = QQ['x'] sage: H = HyperellipticCurve(x^5-23*x^3+18*x^2+40*x) sage: P = H(1,6) sage: x,y = H.local_coordinates_at_nonweierstrass(P,prec=5) sage: x 1 + t + O(t^5) sage: y 6 + t - 7/2*t^2 - 1/2*t^3 - 25/48*t^4 + O(t^5) sage: Q = H(-2,12) sage: x,y = H.local_coordinates_at_nonweierstrass(Q,prec=5) sage: x -2 + t + O(t^5) sage: y 12 - 19/2*t - 19/32*t^2 + 61/256*t^3 - 5965/24576*t^4 + O(t^5) | def local_coordinates_at_nonweierstrass(self, P, prec = 20, name = 't'): """ For a non-Weierstrass point P = (a,b) on the hyperelliptic curve y^2 = f(x), returns (x(t), y(t)) such that (y(t))^2 = f(x(t)), where t = x - a is the local parameter. | b4e1545eaa37e1811f989723319008a1806539dc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/b4e1545eaa37e1811f989723319008a1806539dc/hyperelliptic_generic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1191,
67,
16941,
67,
270,
67,
5836,
1814,
20778,
313,
428,
12,
2890,
16,
453,
16,
13382,
273,
4200,
16,
508,
273,
296,
88,
11,
4672,
3536,
2457,
279,
1661,
17,
3218,
20778,
313,
428,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1191,
67,
16941,
67,
270,
67,
5836,
1814,
20778,
313,
428,
12,
2890,
16,
453,
16,
13382,
273,
4200,
16,
508,
273,
296,
88,
11,
4672,
3536,
2457,
279,
1661,
17,
3218,
20778,
313,
428,
... |
queue_options["qpid.max_count"] = "100" queue_options["qpid.max_size"] = "500" | queue_options["qpid.max_count"] = 100 queue_options["qpid.max_size"] = 500 | def test_queue_deny_mode(self): """ Test cases for queue acl in deny mode """ aclf = ACLFile() aclf.write('acl allow bob@QPID create queue name=q1 durable=true passive=true\n') aclf.write('acl allow bob@QPID create queue name=q2 exclusive=true policytype=ring\n') aclf.write('acl allow bob@QPID access queue name=q3\n') aclf.write('acl allow bob@QPID purge queue name=q3\n') aclf.write('acl allow bob@QPID create queue name=q3\n') aclf.write('acl allow bob@QPID create queue name=q4\n') aclf.write('acl allow bob@QPID delete queue name=q4\n') aclf.write('acl allow bob@QPID create queue name=q5 maxqueuesize=1000 maxqueuecount=100\n') aclf.write('acl allow guest@QPID all all\n') aclf.write('acl deny all all') aclf.close() result = self.reload_acl() if (result.text.find("format error",0,len(result.text)) != -1): self.fail(result) session = self.get_session('bob','bob') try: session.queue_declare(queue="q1", durable=True, passive=True) except qpid.session.SessionException, e: if (530 == e.args[0].error_code): self.fail("ACL should allow queue create request with name=q1 durable=true passive=true"); try: session.queue_declare(queue="q1", durable=False, passive=False) self.fail("ACL should deny queue create request with name=q1 durable=true passive=false"); except qpid.session.SessionException, e: self.assertEqual(530,e.args[0].error_code) session = self.get_session('bob','bob') | 2ffd5ef16d8535853832a6ddacb650cc6f2e8362 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/198/2ffd5ef16d8535853832a6ddacb650cc6f2e8362/acl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
4000,
67,
13002,
93,
67,
3188,
12,
2890,
4672,
3536,
7766,
6088,
364,
2389,
7895,
316,
17096,
1965,
3536,
7895,
74,
273,
10098,
812,
1435,
7895,
74,
18,
2626,
2668,
10150,
1699... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4000,
67,
13002,
93,
67,
3188,
12,
2890,
4672,
3536,
7766,
6088,
364,
2389,
7895,
316,
17096,
1965,
3536,
7895,
74,
273,
10098,
812,
1435,
7895,
74,
18,
2626,
2668,
10150,
1699... |
return replacement.generate().render('xhtml', encoding=None) | return replacement.generate().render('xhtml', encoding=None, strip_whitespace=False) | def replace(self, fullmatch): """Replace one match with its corresponding expansion""" replacement = self.handle_match(fullmatch) if replacement: if isinstance(replacement, Element): return replacement.generate().render('xhtml', encoding=None) return to_unicode(replacement) | f449dbffbe604a657a72c6a7cfb399d853d07308 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2831/f449dbffbe604a657a72c6a7cfb399d853d07308/formatter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1453,
12,
2890,
16,
1983,
1916,
4672,
3536,
5729,
1245,
845,
598,
2097,
4656,
17965,
8395,
6060,
273,
365,
18,
4110,
67,
1916,
12,
2854,
1916,
13,
309,
6060,
30,
309,
1549,
12,
24394,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1453,
12,
2890,
16,
1983,
1916,
4672,
3536,
5729,
1245,
845,
598,
2097,
4656,
17965,
8395,
6060,
273,
365,
18,
4110,
67,
1916,
12,
2854,
1916,
13,
309,
6060,
30,
309,
1549,
12,
24394,
... |
def fl_add_xyplot_overlay_file(obj, id, f, c): """ fl_add_xyplot_overlay_file(obj, id, f, c) -> num. """ retval = _fl_add_xyplot_overlay_file(obj, id, f, c) | def fl_add_xyplot_overlay_file(pObject, id, f, c): """ fl_add_xyplot_overlay_file(pObject, id, f, c) -> num. """ retval = _fl_add_xyplot_overlay_file(pObject, id, f, c) | def fl_add_xyplot_overlay_file(obj, id, f, c): """ fl_add_xyplot_overlay_file(obj, id, f, c) -> num. """ retval = _fl_add_xyplot_overlay_file(obj, id, f, c) return retval | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
1289,
67,
1698,
4032,
67,
17312,
67,
768,
12,
84,
921,
16,
612,
16,
284,
16,
276,
4672,
3536,
1183,
67,
1289,
67,
1698,
4032,
67,
17312,
67,
768,
12,
84,
921,
16,
612,
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,
1183,
67,
1289,
67,
1698,
4032,
67,
17312,
67,
768,
12,
84,
921,
16,
612,
16,
284,
16,
276,
4672,
3536,
1183,
67,
1289,
67,
1698,
4032,
67,
17312,
67,
768,
12,
84,
921,
16,
612,
16... |
print "123" + task_deps['depends'][task] + "456" | def add_tasks(self, fn, dataCache): """ Add tasks for a given fn to the database """ | d40615961e843851f59f5b3dda141745989d80bb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2672/d40615961e843851f59f5b3dda141745989d80bb/taskdata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
9416,
12,
2890,
16,
2295,
16,
501,
1649,
4672,
3536,
1436,
4592,
364,
279,
864,
2295,
358,
326,
2063,
3536,
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,
527,
67,
9416,
12,
2890,
16,
2295,
16,
501,
1649,
4672,
3536,
1436,
4592,
364,
279,
864,
2295,
358,
326,
2063,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
where ai.Archive_ID=%d and me.Type='DCMIType' and cd.Code is null | where ai.Archive_ID=%d and me.Type='DCMIType' and (me.Content is null of me.Content not in ('Collection','Dataset','Event','Image','InteractiveResource', 'Service','Software','Sound','Text','PhysicalObject')) | def check_invalid_code(con, archive_id=None): cur = con.cursor() if archive_id is None: sqls = [ "delete from INTEGRITY_CHECK where Problem_Code='BLT'", """ insert into INTEGRITY_CHECK (Object_ID, Value, Problem_Code) select distinct Element_ID, me.Code, 'BLT' from METADATA_ELEM me left join CODE_DEFN cd on cd.Extension_ID=me.Extension_ID and cd.Code=me.Code where me.Type='linguistic-type' and cd.Code is null """, "delete from INTEGRITY_CHECK where Problem_Code='BDT'", """ insert into INTEGRITY_CHECK (Object_ID, Value, Problem_Code) select distinct Element_ID, me.Code, 'BDT' from METADATA_ELEM me left join CODE_DEFN cd on cd.Extension_ID=me.Extension_ID and cd.Code=me.Code where me.Type='DCMIType' and cd.Code is null """, "delete from INTEGRITY_CHECK where Problem_Code='BLC'", #"insert into INTEGRITY_CHECK (Object_ID, Value, Problem_Code) select distinct Element_ID, me.Code, 'BLC' from METADATA_ELEM me left join CODE_DEFN cd on me.Code=cd.Code where me.Type='language' and cd.Code is null", """\ insert into INTEGRITY_CHECK (Object_ID, Value, Problem_Code) select distinct Element_ID, me.Code, 'BLC' from METADATA_ELEM me left join ISO_639_3 lc on me.Code=lc.Id left join ISO_639_3 lc2 on me.Code=lc2.Part2B left join ISO_639_3 lc4 on me.Code=lc4.Part1 where me.Type='language' and lc.Id is null and lc2.Id is null and lc4.Id is null """, ] else: sqls = [ "delete ic.* from INTEGRITY_CHECK ic, METADATA_ELEM me, ARCHIVED_ITEM ai where ic.Object_ID=me.Element_ID and me.Item_ID=ai.Item_ID and ai.Archive_ID=%d and Problem_Code='BLT'" % archive_id, """ insert into INTEGRITY_CHECK (Object_ID, Value, Problem_Code) select distinct Element_ID, me.Code, 'BLT' from METADATA_ELEM me left join CODE_DEFN cd on cd.Extension_ID=me.Extension_ID and cd.Code=me.Code left join ARCHIVED_ITEM ai on me.Item_ID=ai.Item_ID where ai.Archive_ID=%d and me.Type='linguistic-type' and cd.Code is null """ % archive_id, "delete ic.* from INTEGRITY_CHECK ic, METADATA_ELEM me, ARCHIVED_ITEM ai where ic.Object_ID=me.Element_ID and me.Item_ID=ai.Item_ID and ai.Archive_ID=%d and Problem_Code='BDT'" % archive_id, """ insert into INTEGRITY_CHECK (Object_ID, Value, Problem_Code) select distinct Element_ID, me.Code, 'BDT' from METADATA_ELEM me left join CODE_DEFN cd on cd.Extension_ID=me.Extension_ID and cd.Code=me.Code left join ARCHIVED_ITEM ai on me.Item_ID=ai.Item_ID where ai.Archive_ID=%d and me.Type='DCMIType' and cd.Code is null """ % archive_id, "delete ic.* from INTEGRITY_CHECK ic, METADATA_ELEM me, ARCHIVED_ITEM ai where ic.Object_ID=me.Element_ID and me.Item_ID=ai.Item_ID and ai.Archive_ID=%d and Problem_Code='BLC'" % archive_id, #"insert into INTEGRITY_CHECK (Object_ID, Value, Problem_Code) select distinct Element_ID, me.Code, 'BLC' from METADATA_ELEM me left join CODE_DEFN cd on me.Code=cd.Code left join ARCHIVED_ITEM ai on me.Item_ID=ai.Item_ID where ai.Archive_ID=%d and me.Type='language' and cd.Code is null" % archive_id, """\ insert into INTEGRITY_CHECK (Object_ID, Value, Problem_Code) select distinct Element_ID, me.Code, 'BLC' from METADATA_ELEM me left join ARCHIVED_ITEM ai on me.Item_ID=ai.Item_ID left join ISO_639_3 lc on me.Code=lc.Id left join ISO_639_3 lc2 on me.Code=lc2.Part2B left join ISO_639_3 lc4 on me.Code=lc4.Part1 where ai.Archive_ID=%d and me.Type='language' and lc.Id is null and lc2.Id is null and lc4.Id is null """ % archive_id, ] for sql in sqls: cur.execute(sql) con.commit() cur.close() | 39c6542b109b16a5d5ed2d857fbad9101e47bbe1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8937/39c6542b109b16a5d5ed2d857fbad9101e47bbe1/integrity.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
5387,
67,
710,
12,
591,
16,
5052,
67,
350,
33,
7036,
4672,
662,
273,
356,
18,
9216,
1435,
225,
309,
5052,
67,
350,
353,
599,
30,
1847,
87,
273,
306,
315,
3733,
628,
2120,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5387,
67,
710,
12,
591,
16,
5052,
67,
350,
33,
7036,
4672,
662,
273,
356,
18,
9216,
1435,
225,
309,
5052,
67,
350,
353,
599,
30,
1847,
87,
273,
306,
315,
3733,
628,
2120,
... |
('linux' in sys.platform or 'bsd' in sys.platform or 'darwin' in sys.platform): | ('bsd' in sys.platform or 'darwin' in sys.platform): | def read_file(filename): """Reads the contents of a given file and returns it.""" return open(path_join(dirname(__file__), filename)).read() | 0f84d34956fa7aaa2d4e735eb0e7606fbc29d5dc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14346/0f84d34956fa7aaa2d4e735eb0e7606fbc29d5dc/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
768,
12,
3459,
4672,
3536,
7483,
326,
2939,
434,
279,
864,
585,
471,
1135,
518,
12123,
327,
1696,
12,
803,
67,
5701,
12,
12287,
12,
972,
768,
972,
3631,
1544,
13,
2934,
896,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
768,
12,
3459,
4672,
3536,
7483,
326,
2939,
434,
279,
864,
585,
471,
1135,
518,
12123,
327,
1696,
12,
803,
67,
5701,
12,
12287,
12,
972,
768,
972,
3631,
1544,
13,
2934,
896,
... |
class AppTestWeavingAtExecution(object): | class AppTestWeavingAtExecution(BaseAppTest): | def test_and_compound_pointcut_match(self): from aop import PointCut from parser import ASTClass, ASTPass, ASTFunction, ASTCallFunc, ASTName pc1 = PointCut(klass="Mumble") pc2 = PointCut(func="frobble") pc = (pc1 & pc2).execution() f = ASTFunction(None, 'frobble', [], [], 0, '', ASTPass()) f.parent = ASTClass('MumblesALot', [], None, ASTPass()) assert pc.match(f) f.parent.name = 'Babble' assert not pc.match(f) c = ASTClass('frobbles_a_bit', [], None, ASTPass()) c.parent = ASTClass('MumblesALot', [], None, ASTPass()) assert not pc.match(c) | aba107d06da66a7adcfb550eb962d00c7c5200e0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6934/aba107d06da66a7adcfb550eb962d00c7c5200e0/test_aop.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
464,
67,
22585,
67,
1153,
5150,
67,
1916,
12,
2890,
4672,
628,
279,
556,
1930,
4686,
15812,
628,
2082,
1930,
9183,
797,
16,
9183,
6433,
16,
9183,
2083,
16,
9183,
1477,
2622,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
464,
67,
22585,
67,
1153,
5150,
67,
1916,
12,
2890,
4672,
628,
279,
556,
1930,
4686,
15812,
628,
2082,
1930,
9183,
797,
16,
9183,
6433,
16,
9183,
2083,
16,
9183,
1477,
2622,
... |
return Utils.maketext( | return quick_maketext( | def html_TOC(self): mlist = self.maillist listname = mlist.internal_name() mbox = os.path.join(mlist.archive_dir()+'.mbox', listname+'.mbox') d = {"listname": mlist.real_name, "listinfo": mlist.GetScriptURL('listinfo', absolute=1), "fullarch": '../%s.mbox/%s.mbox' % (listname, listname), "size": sizeof(mbox, mlist.preferred_language), } # Avoid i18n side-effects otrans = i18n.get_translation() i18n.set_language(mlist.preferred_language) try: if not self.archives: d["noarchive_msg"] = _( '<P>Currently, there are no archives. </P>') d["archive_listing_start"] = "" d["archive_listing_end"] = "" d["archive_listing"] = "" else: d["noarchive_msg"] = "" d["archive_listing_start"] = Utils.maketext( 'archliststart.html', raw=1, lang=mlist.preferred_language, mlist=mlist) d["archive_listing_end"] = Utils.maketext( 'archlistend.html', raw=1, lang=mlist.preferred_language, mlist=mlist) | 1a6a7a39d00618a07ee9f3bcaf350032ab0fbc59 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/1a6a7a39d00618a07ee9f3bcaf350032ab0fbc59/HyperArch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1729,
67,
4296,
39,
12,
2890,
4672,
312,
1098,
273,
365,
18,
4408,
1098,
666,
529,
273,
312,
1098,
18,
7236,
67,
529,
1435,
312,
2147,
273,
1140,
18,
803,
18,
5701,
12,
781,
376,
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,
1729,
67,
4296,
39,
12,
2890,
4672,
312,
1098,
273,
365,
18,
4408,
1098,
666,
529,
273,
312,
1098,
18,
7236,
67,
529,
1435,
312,
2147,
273,
1140,
18,
803,
18,
5701,
12,
781,
376,
18,... |
b1 = bytearray([1, 2, 3]) b2 = bytearray([1, 2, 3]) b3 = bytearray([1, 3]) | b1 = self.type2test([1, 2, 3]) b2 = self.type2test([1, 2, 3]) b3 = self.type2test([1, 3]) | def test_compare(self): b1 = bytearray([1, 2, 3]) b2 = bytearray([1, 2, 3]) b3 = bytearray([1, 3]) | 8e1c00cf398f63360436a121ac5e130e511a0386 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/8e1c00cf398f63360436a121ac5e130e511a0386/test_bytes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9877,
12,
2890,
4672,
324,
21,
273,
14552,
3816,
21,
16,
576,
16,
890,
5717,
324,
22,
273,
14552,
3816,
21,
16,
576,
16,
890,
5717,
324,
23,
273,
14552,
3816,
21,
16,
890,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9877,
12,
2890,
4672,
324,
21,
273,
14552,
3816,
21,
16,
576,
16,
890,
5717,
324,
22,
273,
14552,
3816,
21,
16,
576,
16,
890,
5717,
324,
23,
273,
14552,
3816,
21,
16,
890,
... |
str += c | else: str += '\\' + c | def lex_arg_quoted(self, delim): str = '' while self.pos != self.end: c = self.eat() if c == delim: return str elif c == '\\' and delim == '"': # Shell escaping is just '\"' to avoid termination, no actual # escaping. if self.pos == self.end: Util.warning("escape at end of quoted argument in: %r" % self.data) return str c = self.eat() if c != delim: str += '\\' str += c else: str += c Util.warning("missing quote character in %r" % self.data) return str | e1bd1ed9fd9d897cb9f35489a2255f45451bf4ed /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11986/e1bd1ed9fd9d897cb9f35489a2255f45451bf4ed/ShUtil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5275,
67,
3175,
67,
15179,
12,
2890,
16,
10508,
4672,
609,
273,
875,
1323,
365,
18,
917,
480,
365,
18,
409,
30,
276,
273,
365,
18,
73,
270,
1435,
309,
276,
422,
10508,
30,
327,
609,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5275,
67,
3175,
67,
15179,
12,
2890,
16,
10508,
4672,
609,
273,
875,
1323,
365,
18,
917,
480,
365,
18,
409,
30,
276,
273,
365,
18,
73,
270,
1435,
309,
276,
422,
10508,
30,
327,
609,
... |
self.revision = revision | self.revisions = revisions | def __init__(self, caller, event, paths, revision): """ @param caller: The calling object @type caller: object @param base_dir: The curent working directory @type base_dir: string @param paths: The selected paths @type paths: list | 254cf90c673c32fc3faafcde068598e8de07eeee /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5119/254cf90c673c32fc3faafcde068598e8de07eeee/log.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4894,
16,
871,
16,
2953,
16,
6350,
4672,
3536,
632,
891,
225,
4894,
30,
1021,
4440,
733,
632,
723,
282,
4894,
30,
733,
225,
632,
891,
225,
1026,
67,
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,
1001,
2738,
972,
12,
2890,
16,
4894,
16,
871,
16,
2953,
16,
6350,
4672,
3536,
632,
891,
225,
4894,
30,
1021,
4440,
733,
632,
723,
282,
4894,
30,
733,
225,
632,
891,
225,
1026,
67,
12... |
except Exception, exception: err_dialog = ErrorDialog(exception, self) err_dialog.exec_() | except Exception, exception: err_dialog = ErrorDialog(exception, self) err_dialog.exec_() def event(self, p_event): if p_event.WindowStateChange: if not self.isMinimized() and not self.isHidden(): self._settings.show_user_details \ = self._user_details.isVisible() return QtGui.QMainWindow.event(self, p_event) | def _getFileByUrl(self, p_url): try: if p_url[0] == "/": p_url = self._img_url_prefix + p_url try: self._img_cache.append(urllib.URLopener()) file = self._img_cache[-1].retrieve(p_url)[0] return file except: return None except Exception, exception: # Fehlerdialog anzeigen err_dialog = ErrorDialog(exception, self) err_dialog.exec_() | 264364269a301ec6020404f8aff8dc3b8f01916d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4919/264364269a301ec6020404f8aff8dc3b8f01916d/MainWindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
29925,
858,
1489,
12,
2890,
16,
293,
67,
718,
4672,
775,
30,
309,
293,
67,
718,
63,
20,
65,
422,
4016,
30,
293,
67,
718,
273,
365,
6315,
6081,
67,
718,
67,
3239,
397,
293,
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,
389,
29925,
858,
1489,
12,
2890,
16,
293,
67,
718,
4672,
775,
30,
309,
293,
67,
718,
63,
20,
65,
422,
4016,
30,
293,
67,
718,
273,
365,
6315,
6081,
67,
718,
67,
3239,
397,
293,
67,... |
logger.notifyChannel('init', netsvc.LOG_DEBUG, 'creating new column %s of table %s'% (k, self._table)) | logger.notifyChannel('orm', netsvc.LOG_DEBUG, 'creating new column %s of table %s'% (k, self._table)) | def _auto_init(self, cr, context={}): store_compute = False logger = netsvc.Logger() create = False todo_end = [] self._field_create(cr, context=context) if not hasattr(self, "_auto") or self._auto: cr.execute("SELECT relname FROM pg_class WHERE relkind in ('r','v') AND relname='%s'" % self._table) if not cr.rowcount: cr.execute("CREATE TABLE \"%s\" (id SERIAL NOT NULL, PRIMARY KEY(id)) WITH OIDS" % self._table) create = True cr.commit() if self._parent_store: cr.execute("""SELECT c.relname FROM pg_class c, pg_attribute a WHERE c.relname=%s AND a.attname=%s AND c.oid=a.attrelid """, (self._table, 'parent_left')) if not cr.rowcount: if 'parent_left' not in self._columns: logger.notifyChannel('init', netsvc.LOG_ERROR, 'create a column parent_left on object %s: fields.integer(\'Left Parent\', select=1)' % (self._table, )) if 'parent_right' not in self._columns: logger.notifyChannel('init', netsvc.LOG_ERROR, 'create a column parent_right on object %s: fields.integer(\'Right Parent\', select=1)' % (self._table, )) if self._columns[self._parent_name].ondelete<>'cascade': logger.notifyChannel('init', netsvc.LOG_ERROR, "the columns %s on object must be set as ondelete='cascasde'" % (self._name, self._parent_name)) cr.execute('ALTER TABLE "%s" ADD COLUMN "parent_left" INTEGER' % (self._table,)) cr.execute('ALTER TABLE "%s" ADD COLUMN "parent_right" INTEGER' % (self._table,)) cr.commit() store_compute = True | 9af9e363d0be0a398773712ed8b721eb1cdb0fe2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12853/9af9e363d0be0a398773712ed8b721eb1cdb0fe2/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6079,
67,
2738,
12,
2890,
16,
4422,
16,
819,
12938,
4672,
1707,
67,
9200,
273,
225,
1083,
1194,
273,
21954,
4227,
18,
3328,
1435,
752,
273,
1083,
10621,
67,
409,
273,
5378,
365,
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,
389,
6079,
67,
2738,
12,
2890,
16,
4422,
16,
819,
12938,
4672,
1707,
67,
9200,
273,
225,
1083,
1194,
273,
21954,
4227,
18,
3328,
1435,
752,
273,
1083,
10621,
67,
409,
273,
5378,
365,
6... |
def main(args = sys.argv[1:], out = sys.stdout): | def main(args = sys.argv[1:], out=sys.stdout): | def main(args = sys.argv[1:], out = sys.stdout): global fnfilter, rmode, bufsize try: opts, args = getopt.getopt(args, 'blts:') except getopt.error, msg: sys.stderr.write('%s: %s\n%s' % (sys.argv[0], msg, usage)) return 2 for o, a in opts: if o == '-l': fnfilter = os.path.basename if o == '-b': rmode = 'rb' if o == '-t': rmode = 'r' if o == '-s': bufsize = int(a) if not args: args = ['-'] return sum(args, out) | 9ad4750ffc693e7cfc62729ef7d746881f333eaa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/9ad4750ffc693e7cfc62729ef7d746881f333eaa/md5sum.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
1968,
273,
2589,
18,
19485,
63,
21,
30,
6487,
596,
33,
9499,
18,
10283,
4672,
2552,
2295,
2188,
16,
436,
3188,
16,
1681,
1467,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
1968,
273,
2589,
18,
19485,
63,
21,
30,
6487,
596,
33,
9499,
18,
10283,
4672,
2552,
2295,
2188,
16,
436,
3188,
16,
1681,
1467,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
5... |
for i in xrange(5, 20): tree.append(None, StaticTextTreeItem('Test %d' % i)) finally: tree.thaw() | class CBProgress(ProgressBar): def update(self, value, total): super(CBProgress, self).update(value, total) | def main(): tree = TreeCtrl() tree.freeze() try: item = tree.append(None, StaticTextTreeItem('Test 1')) tree.append(item, StaticTextTreeItem('Test 2')) tree.append(item, StaticTextTreeItem('Test 3')) tree.append(None, StaticTextTreeItem('Test 4')) item.collapsed = False for i in xrange(5, 20): tree.append(None, StaticTextTreeItem('Test %d' % i)) finally: tree.thaw() while True: ctrl = Controller() if ctrl.circle: break elif ctrl.right: tree.selected.collapsed = False tree.redraw() elif ctrl.left: tree.selected.collapsed = True tree.redraw() elif ctrl.up: tree.selectPrev() tree.redraw() elif ctrl.down: tree.selectNext() tree.redraw() | e331d79c32a1c48a63843972e627a7a7f53d919c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5063/e331d79c32a1c48a63843972e627a7a7f53d919c/comics.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
2151,
273,
4902,
12418,
1435,
2151,
18,
29631,
1435,
775,
30,
761,
273,
2151,
18,
6923,
12,
7036,
16,
10901,
1528,
2471,
1180,
2668,
4709,
404,
26112,
2151,
18,
6923,
12,
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,
2151,
273,
4902,
12418,
1435,
2151,
18,
29631,
1435,
775,
30,
761,
273,
2151,
18,
6923,
12,
7036,
16,
10901,
1528,
2471,
1180,
2668,
4709,
404,
26112,
2151,
18,
6923,
12,
17... |
self.addReference(issue, reference.comment) | self.addReference(issue, IssueRelationship(issue.absolute_url(1), reference.comment)) | def add_reference(self, reference, RESPONSE=None): """ add a new reference (record object) """ | 222b6f83fd5a7e45beea8fbad654e241b66e90d3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1807/222b6f83fd5a7e45beea8fbad654e241b66e90d3/Issue.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
6180,
12,
2890,
16,
2114,
16,
20645,
33,
7036,
4672,
3536,
527,
279,
394,
2114,
261,
3366,
733,
13,
3536,
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,
527,
67,
6180,
12,
2890,
16,
2114,
16,
20645,
33,
7036,
4672,
3536,
527,
279,
394,
2114,
261,
3366,
733,
13,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
OPTS.append("USEMALLOC") | def CreatePandaVersionFiles(): version1=int(VERSION.split(".")[0]) version2=int(VERSION.split(".")[1]) version3=int(VERSION.split(".")[2]) nversion=version1*1000000+version2*1000+version3 pandaversion_h = PANDAVERSION_H.replace("VERSION1",str(version1)) pandaversion_h = pandaversion_h.replace("VERSION2",str(version2)) pandaversion_h = pandaversion_h.replace("VERSION3",str(version3)) pandaversion_h = pandaversion_h.replace("NVERSION",str(nversion)) checkpandaversion_cxx = CHECKPANDAVERSION_CXX.replace("VERSION1",str(version1)) checkpandaversion_cxx = checkpandaversion_cxx.replace("VERSION2",str(version2)) checkpandaversion_cxx = checkpandaversion_cxx.replace("VERSION3",str(version3)) checkpandaversion_cxx = checkpandaversion_cxx.replace("NVERSION",str(nversion)) checkpandaversion_h = CHECKPANDAVERSION_H.replace("VERSION1",str(version1)) checkpandaversion_h = checkpandaversion_h.replace("VERSION2",str(version2)) checkpandaversion_h = checkpandaversion_h.replace("VERSION3",str(version3)) checkpandaversion_h = checkpandaversion_h.replace("NVERSION",str(nversion)) ConditionalWriteFile('built/include/pandaVersion.h', pandaversion_h) ConditionalWriteFile('built/include/checkPandaVersion.cxx', checkpandaversion_cxx) ConditionalWriteFile('built/include/checkPandaVersion.h', checkpandaversion_h) if (OMIT.count("PYTHON")==0): ConditionalWriteFile("built/tmp/pythonversion", os.path.basename(PYTHONSDK)) ConditionalWriteFile("built/tmp/null.cxx","") | 79d574ab93071a7df9b2a6939e3f91bece0d56e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/79d574ab93071a7df9b2a6939e3f91bece0d56e4/makepanda.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1788,
52,
464,
69,
1444,
2697,
13332,
1177,
21,
33,
474,
12,
5757,
18,
4939,
2932,
1199,
25146,
20,
5717,
1177,
22,
33,
474,
12,
5757,
18,
4939,
2932,
1199,
25146,
21,
5717,
1177,
23,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1788,
52,
464,
69,
1444,
2697,
13332,
1177,
21,
33,
474,
12,
5757,
18,
4939,
2932,
1199,
25146,
20,
5717,
1177,
22,
33,
474,
12,
5757,
18,
4939,
2932,
1199,
25146,
21,
5717,
1177,
23,
... | |
p = os.system("ps --no-heading --pid " + pid) p_name = os.popen("ps -f --pid " + pid).read() | p = os.system("/bin/ps %s >/dev/null" % pid) p_name = os.popen("/bin/ps -f %s" % pid).read() | def check_instance(directory): """Check if gtg is already running.""" pidfile = directory + "gtg.pid" if not os.path.exists(pidfile): f = open(pidfile, "w") f.close() os.chmod(pidfile, 0600) #see if gtg is already running f = open(pidfile, "r") pid = f.readline() f.close() if pid: p = os.system("ps --no-heading --pid " + pid) p_name = os.popen("ps -f --pid " + pid).read() if p == 0 and "gtg" in p_name: print _("gtg is already running!") d=dbus.SessionBus().get_object(CoreConfig.BUSNAME,\ CoreConfig.BUSINTERFACE) d.show_task_browser() sys.exit(0) #write the pid file f = open(pidfile, "w") f.write(str(os.getpid())) f.close() | e9a78819321cdd105dfdffda86c2fd701d737b8c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8234/e9a78819321cdd105dfdffda86c2fd701d737b8c/gtg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
1336,
12,
5149,
4672,
3536,
1564,
309,
9879,
75,
353,
1818,
3549,
12123,
27656,
273,
1867,
397,
315,
4521,
75,
18,
6610,
6,
309,
486,
1140,
18,
803,
18,
1808,
12,
6610,
768,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1336,
12,
5149,
4672,
3536,
1564,
309,
9879,
75,
353,
1818,
3549,
12123,
27656,
273,
1867,
397,
315,
4521,
75,
18,
6610,
6,
309,
486,
1140,
18,
803,
18,
1808,
12,
6610,
768,
... |
" --segment_url https://segdb.ligo.caltech.edu"+\ | " --segment-url https://segdb.ligo.caltech.edu"+\ | def grab_segments(start,end,flag): """ Returns a segmentlist containing the segments during which the given flag was active in the given period. """ #== construct segment query segment_cmd = "ligolw_segment_query --query-segments"+\ " --segment_url https://segdb.ligo.caltech.edu"+\ " --include-segments "+flag+\ " --gps-start-time "+str(start)+\ " --gps-end-time "+str(end)+\ ''' | ligolw_print -t segment -c start_time -c end_time --delimiter " "''' #== run segment query segs = GetCommandOutput(segment_cmd) #== construct segments as structure seglist=[] segs=segs.split('\n') for seg in segs: if seg=='': continue try: [seg_start,seg_end]=seg.split(' ') seglist.append(segment(int(seg_start),int(seg_end))) except: continue seglist = segmentlist([seglist]) return seglist | 60b65a7e57d28ab398b5333cb2466dd1465e30c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/60b65a7e57d28ab398b5333cb2466dd1465e30c8/dqSegmentUtils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11086,
67,
12838,
12,
1937,
16,
409,
16,
6420,
4672,
3536,
2860,
279,
3267,
1098,
4191,
326,
5155,
4982,
1492,
326,
864,
2982,
1703,
2695,
316,
326,
864,
3879,
18,
3536,
225,
468,
631,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11086,
67,
12838,
12,
1937,
16,
409,
16,
6420,
4672,
3536,
2860,
279,
3267,
1098,
4191,
326,
5155,
4982,
1492,
326,
864,
2982,
1703,
2695,
316,
326,
864,
3879,
18,
3536,
225,
468,
631,
... |
0.83146961230254524), (1.1780972450961724, 0.92387953251128674), | 0.831469612302545...), (1.1780972450961724, 0.92387953251128674), | def generate_plot_points(f, xrange, plot_points=5, adaptive_tolerance=0.01, adaptive_recursion=5, randomize = True): r""" Calculate plot points for a function f in the interval xrange. The adaptive refinement algorithm for plotting a function f. See the docstring for plot for a description of the algorithm. INPUT: f -- a function of one variable p1, p2 -- two points to refine between plot_points -- (default: 5) the minimal number of plot points. adaptive_recursion -- (default: 5) how many levels of recursion to go before giving up when doing adaptive refinement. Setting this to 0 disables adaptive refinement. adaptive_tolerance -- (default: 0.01) how large a difference should be before the adaptive refinement code considers it significant. See the documentation for plot() for more information. OUTPUT: list -- a list of points (x, f(x)) in the interval xrange, which aproximate the function f. TESTS: sage: from sage.plot.plot import generate_plot_points sage: generate_plot_points(sin, (0, pi), plot_points=2, adaptive_recursion=0) [(0.0, 0.0), (3.1415926535897931, 1.2246...e-16)] sage: generate_plot_points(sin(x), (-pi, pi), randomize=False) [(-3.1415926535897931, -1.2246...e-16), (-2.748893571891069, -0.38268343236508989), (-2.3561944901923448, -0.707106781186547...), (-2.1598449493429825, -0.831469612302545...), (-1.9634954084936207, -0.92387953251128674), (-1.7671458676442586, -0.98078528040323043), (-1.5707963267948966, -1.0), (-1.3744467859455345, -0.98078528040323043), (-1.1780972450961724, -0.92387953251128674), (-0.98174770424681035, -0.83146961230254524), (-0.78539816339744828, -0.707106781186547...), (-0.39269908169872414, -0.38268343236508978), (0.0, 0.0), (0.39269908169872414, 0.38268343236508978), (0.78539816339744828, 0.707106781186547...), (0.98174770424681035, 0.83146961230254524), (1.1780972450961724, 0.92387953251128674), (1.3744467859455345, 0.98078528040323043), (1.5707963267948966, 1.0), (1.7671458676442586, 0.98078528040323043), (1.9634954084936207, 0.92387953251128674), (2.1598449493429825, 0.831469612302545...), (2.3561944901923448, 0.707106781186547...), (2.748893571891069, 0.38268343236508989), (3.1415926535897931, 1.2246...e-16)] This shows that lowering adaptive_tolerance and raising adaptive_recursion both increase the number of subdivision points: sage: x = var('x') sage: f = sin(1/x) sage: [len(generate_plot_points(f, (-pi, pi), adaptive_tolerance=i)) for i in [0.01, 0.001, 0.0001]] [42, 67, 104] sage: [len(generate_plot_points(f, (-pi, pi), adaptive_recursion=i)) for i in [5, 10, 15]] [34, 144, 897] """ x, data = var_and_list_of_values(xrange, plot_points) xmin = data[0] xmax = data[-1] delta = float(xmax-xmin) / plot_points random = current_randstate().python_random().random exceptions = 0; msg='' exception_indices = [] for i in range(len(data)): xi = data[i] # Slightly randomize the interior sample points if # randomize is true if randomize and i > 0 and i < plot_points-1: xi += delta*(random() - 0.5) try: data[i] = (float(xi), float(f(xi))) if str(data[i][1]) in ['nan', 'NaN', 'inf', '-inf']: sage.misc.misc.verbose("%s\nUnable to compute f(%s)"%(msg, x),1) exceptions += 1 exception_indices.append(i) except (ZeroDivisionError, TypeError, ValueError, OverflowError), msg: sage.misc.misc.verbose("%s\nUnable to compute f(%s)"%(msg, x),1) if i == 0: for j in range(1, 99): xj = xi + delta*j/100.0 try: data[i] = (float(xj), float(f(xj))) # nan != nan if data[i][1] != data[i][1]: continue break except (ZeroDivisionError, TypeError, ValueError, OverflowError), msg: pass else: exceptions += 1 exception_indices.append(i) elif i == plot_points-1: for j in range(1, 99): xj = xi - delta*j/100.0 try: data[i] = (float(xj), float(f(xj))) # nan != nan if data[i][1] != data[i][1]: continue break except (ZeroDivisionError, TypeError, ValueError, OverflowError), msg: pass else: exceptions += 1 exception_indices.append(i) else: exceptions += 1 exception_indices.append(i) exceptions += 1 exception_indices.append(i) data = [data[i] for i in range(len(data)) if i not in exception_indices] # adaptive refinement i, j = 0, 0 adaptive_tolerance = delta * float(adaptive_tolerance) adaptive_recursion = int(adaptive_recursion) while i < len(data) - 1: for p in adaptive_refinement(f, data[i], data[i+1], adaptive_tolerance=adaptive_tolerance, adaptive_recursion=adaptive_recursion): data.insert(i+1, p) i += 1 i += 1 if (len(data) == 0 and exceptions > 0) or exceptions > 10: sage.misc.misc.verbose("WARNING: When plotting, failed to evaluate function at %s points."%exceptions, level=0) sage.misc.misc.verbose("Last error message: '%s'"%msg, level=0) return data | 9ae89749591f12a06c4798e19eccdbaf35f29d93 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/9ae89749591f12a06c4798e19eccdbaf35f29d93/plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
4032,
67,
4139,
12,
74,
16,
12314,
16,
3207,
67,
4139,
33,
25,
16,
5855,
688,
67,
25456,
33,
20,
18,
1611,
16,
5855,
688,
67,
31347,
33,
25,
16,
2744,
554,
273,
1053,
467... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
4032,
67,
4139,
12,
74,
16,
12314,
16,
3207,
67,
4139,
33,
25,
16,
5855,
688,
67,
25456,
33,
20,
18,
1611,
16,
5855,
688,
67,
31347,
33,
25,
16,
2744,
554,
273,
1053,
467... |
if hasattr(ncvar,'_FillValue'): mask = addmask(mask,dat==float(ncvar._FillValue)) if hasattr(ncvar,'missing_value'): mask = addmask(mask,dat==float(ncvar.missing_value)) | if hasattr(ncvar,'_FillValue'): mask = addmask(mask,dat==numpy.asarray(ncvar._FillValue,dtype=dat.dtype)) if hasattr(ncvar,'missing_value'): mask = addmask(mask,dat==numpy.asarray(ncvar.missing_value,dtype=dat.dtype)) | def addmask(mask,newmask): if mask==None: mask = numpy.empty(dat.shape,dtype=numpy.bool) mask.fill(False) return numpy.logical_or(mask,newmask) | bab4180ea4449a83d23cffc8b67e6291b05d96dd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/381/bab4180ea4449a83d23cffc8b67e6291b05d96dd/data.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
4455,
12,
4455,
16,
2704,
4455,
4672,
309,
3066,
631,
7036,
30,
3066,
273,
3972,
18,
5531,
12,
3404,
18,
4867,
16,
8972,
33,
15974,
18,
6430,
13,
3066,
18,
5935,
12,
8381,
13,
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,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
4455,
12,
4455,
16,
2704,
4455,
4672,
309,
3066,
631,
7036,
30,
3066,
273,
3972,
18,
5531,
12,
3404,
18,
4867,
16,
8972,
33,
15974,
18,
6430,
13,
3066,
18,
5935,
12,
8381,
13,
3... |
headers, 'file:'+pathname2url(file)) | headers, 'file:'+file) | def open_local_file(self, url): import mimetypes, mimetools, StringIO mtype = mimetypes.guess_type(url)[0] headers = mimetools.Message(StringIO.StringIO( 'Content-Type: %s\n' % (mtype or 'text/plain'))) host, file = splithost(url) if not host: return addinfourl(open(url2pathname(file), 'rb'), headers, 'file:'+pathname2url(file)) host, port = splitport(host) if not port \ and socket.gethostbyname(host) in (localhost(), thishost()): return addinfourl(open(url2pathname(file), 'rb'), headers, 'file:'+pathname2url(file)) raise IOError, ('local file error', 'not on local host') | 681ea582d3a32b7164c1533b9774b7385525268f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/681ea582d3a32b7164c1533b9774b7385525268f/urllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
3729,
67,
768,
12,
2890,
16,
880,
4672,
1930,
20369,
15180,
16,
20369,
278,
8192,
16,
15777,
22189,
273,
20369,
15180,
18,
20885,
67,
723,
12,
718,
25146,
20,
65,
1607,
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,
1696,
67,
3729,
67,
768,
12,
2890,
16,
880,
4672,
1930,
20369,
15180,
16,
20369,
278,
8192,
16,
15777,
22189,
273,
20369,
15180,
18,
20885,
67,
723,
12,
718,
25146,
20,
65,
1607,
273,
... |
layout.emit("send") | counter = unicode(entry.entry_get()).encode("utf-8").replace("<br>","").strip() if len(counter) == 0: self.send_empty(layout).start() elif len(counter) > 159: self.dialog.dialog("layout", "Error", "Text too long, only single messages possible at the moment, please shorten your text").start() else: layout.emit("send") | def send_request(self, layout, entry, **kargs): | 09f34ee0fec480f5f1cdb3f85e0b9de65261564f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4712/09f34ee0fec480f5f1cdb3f85e0b9de65261564f/msgs2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
2293,
12,
2890,
16,
3511,
16,
1241,
16,
2826,
79,
1968,
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,... | [
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,
1366,
67,
2293,
12,
2890,
16,
3511,
16,
1241,
16,
2826,
79,
1968,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
pass | def show(self): player = client.getPlayer() text = [] # imperator or leader if player.imperator == 1: text.append(_("You are LEADER of the galaxy.")) text.append("") elif player.imperator == 2: text.append(_("You are IMPERATOR of the galaxy.")) text.append("") elif player.imperator >= 3: text.append(_("You are IMPERATOR of the galaxy.")) text.append(_("You have the right to end this galaxy.")) text.append("") | df758e1aaba3ab2e55ff762348c96defd2120cf8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/503/df758e1aaba3ab2e55ff762348c96defd2120cf8/EmpireOverviewDlg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
12,
2890,
4672,
7291,
273,
1004,
18,
588,
12148,
1435,
977,
273,
5378,
468,
709,
457,
639,
578,
10302,
309,
7291,
18,
381,
457,
639,
422,
404,
30,
977,
18,
6923,
24899,
2932,
622... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4672,
7291,
273,
1004,
18,
588,
12148,
1435,
977,
273,
5378,
468,
709,
457,
639,
578,
10302,
309,
7291,
18,
381,
457,
639,
422,
404,
30,
977,
18,
6923,
24899,
2932,
622... | |
photoItem = FlickrPhoto(photo=flickrPhoto, itsView=repView, itsParent=userdata) | photoItem = FlickrPhoto(photo=flickrPhoto, itsView=repView, itsParent=repView['userdata']) | def fillCollectionFromFlickr(self, repView): """ Fills the collection with photos from the flickr website. """ coll = pim.ListCollection(itsView = repView).setup() if self.userName: flickrUserName = flickr.people_findByUsername(self.userName.encode('utf8')) flickrPhotos = flickr.people_getPublicPhotos(flickrUserName.id,10) elif self.tag: flickrPhotos = flickr.photos_search(tags=self.tag,per_page=10,sort="date-posted-desc") else: assert (False) #we should have either a userName or tag | 9117b16c67be28a0a170fe4d46c0bc4a0f04851f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/9117b16c67be28a0a170fe4d46c0bc4a0f04851f/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3636,
2532,
1265,
2340,
16254,
12,
2890,
16,
2071,
1767,
4672,
3536,
14192,
87,
326,
1849,
598,
18185,
628,
326,
1183,
16254,
12504,
18,
3536,
4508,
273,
293,
381,
18,
682,
2532,
12,
128... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3636,
2532,
1265,
2340,
16254,
12,
2890,
16,
2071,
1767,
4672,
3536,
14192,
87,
326,
1849,
598,
18185,
628,
326,
1183,
16254,
12504,
18,
3536,
4508,
273,
293,
381,
18,
682,
2532,
12,
128... |
po = self.read_in_package(pkg, pkgpath=pkgpath, reldir=reldir) | po = self.read_in_package(pkg, pkgpath=pkgpath, reldir=reldir) | def writeMetadataDocs(self, pkglist=[], pkgpath=None): | 473cb91d36b5c88e3a55fa60404eb172a1c6e32b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9557/473cb91d36b5c88e3a55fa60404eb172a1c6e32b/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
2277,
12656,
12,
2890,
16,
3475,
1098,
22850,
6487,
3475,
803,
33,
7036,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
2277,
12656,
12,
2890,
16,
3475,
1098,
22850,
6487,
3475,
803,
33,
7036,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
'single': ('-t', '--test', 's', '', 'Run single test'), | 'single': ('-t', '--test', 's', '', 'Run test(s) (comma separated list)'), | def parseOptions(): _configItems = { 'mode': ('-m', '--mode', 's', None, 'debug or release; by default attempts both'), 'noStop': ('-C', '--continue', 'b', False, 'Continue even after test failures'), 'unit': ('-u', '--unit', 'b', False, 'unit tests each in own process'), 'verbose': ('-v', '--verbose', 'b', False, 'Verbose output'), 'funcSuite': ('-f', '--funcSuite', 'b', False, 'Functional test suite'), 'perf': ('-p', '--perf', 'b', False, 'Performance tests'), 'single': ('-t', '--test', 's', '', 'Run single test'), 'noEnv': ('-i', '--ignoreEnv', 'b', False, 'Ignore environment variables'), 'help': ('-H', '', 'b', False, 'Extended help'), 'dryrun': ('-d', '--dryrun', 'b', False, 'Do all of the prep work but do not run any tests'), 'selftest': ('', '--selftest', 'b', False, 'Run self test'), #'restored': ('-R', '--restoredRepository', 'b', False, 'unit tests with restored repository instead of creating new for each test'), #'profile': ('-P', '--profile', 'b', False, 'Profile performance tests'), #'tbox': ('-T', '--tbox', 'b', False, 'Tinderbox output mode'), #'config': ('-L', '', 's', None, 'Custom Chandler logging configuration file'), } # %prog expands to os.path.basename(sys.argv[0]) usage = "usage: %prog [options]\n" + \ " %prog [options] -U module" parser = OptionParser(usage=usage, version="%prog") for key in _configItems: (shortCmd, longCmd, optionType, defaultValue, helpText) = _configItems[key] if optionType == 'b': parser.add_option(shortCmd, longCmd, dest=key, action='store_true', default=defaultValue, help=helpText) else: parser.add_option(shortCmd, longCmd, dest=key, default=defaultValue, help=helpText) (options, args) = parser.parse_args() options.args = args return options | 3328cd9ca2c398ada6b7bc675bf147dd36d77a3e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/3328cd9ca2c398ada6b7bc675bf147dd36d77a3e/rt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
1320,
13332,
389,
1425,
3126,
273,
288,
296,
3188,
4278,
1377,
7707,
17,
81,
2187,
3534,
3188,
2187,
9079,
296,
87,
2187,
599,
16,
225,
296,
4148,
578,
3992,
31,
635,
805,
7531,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1320,
13332,
389,
1425,
3126,
273,
288,
296,
3188,
4278,
1377,
7707,
17,
81,
2187,
3534,
3188,
2187,
9079,
296,
87,
2187,
599,
16,
225,
296,
4148,
578,
3992,
31,
635,
805,
7531,
... |
self.peersock.transport.loseConnection() | self.peersock.transport.unregisterProducer() | def connectionLost(self, reason): if self.state == socks5.STATE_CONNECT_PENDING: self.service.removePendingConnection(self.addr, self) else: if self.peersock != None: self.peersock.peersock = None self.peersock.transport.loseConnection() self.peersock = None self.service.removeActiveConnection(self.addr, self) | 26dc22b4b597351de5bae35a9b6ca4059e4c0a95 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5317/26dc22b4b597351de5bae35a9b6ca4059e4c0a95/proxy65.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1459,
19024,
12,
2890,
16,
3971,
4672,
309,
365,
18,
2019,
422,
7313,
87,
25,
18,
7998,
67,
11032,
67,
25691,
30,
365,
18,
3278,
18,
4479,
8579,
1952,
12,
2890,
18,
4793,
16,
365,
13... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1459,
19024,
12,
2890,
16,
3971,
4672,
309,
365,
18,
2019,
422,
7313,
87,
25,
18,
7998,
67,
11032,
67,
25691,
30,
365,
18,
3278,
18,
4479,
8579,
1952,
12,
2890,
18,
4793,
16,
365,
13... |
fp.write("\t\taetools.enumsubst(_arguments, %s, _Enum_%s)\n" % | if ename <> '****': fp.write("\t\taetools.enumsubst(_arguments, %s, _Enum_%s)\n" % | fp.write("\tdef %s(self, "%funcname) | ddf78cf5c144bba2e86762a483c1d85f8d3106ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/ddf78cf5c144bba2e86762a483c1d85f8d3106ea/gensuitemodule.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4253,
18,
2626,
31458,
88,
536,
738,
87,
12,
2890,
16,
2213,
644,
529,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
4253,
18,
2626,
31458,
88,
536,
738,
87,
12,
2890,
16,
2213,
644,
529,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
This involves locating the correct ISessionDataContainer for the | This involves locating the correct ISessionDataContainer for the | def __getitem__(product_id): """Return the relevant ISessionPkgData This involves locating the correct ISessionDataContainer for the given product id, determining the client id, and returning the relevant ISessionPkgData. """ | d6b2d90cdc1b26c797484ccc05461dc899f81d6c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9756/d6b2d90cdc1b26c797484ccc05461dc899f81d6c/interfaces.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
5896,
67,
350,
4672,
3536,
990,
326,
9368,
467,
2157,
11264,
751,
225,
1220,
29876,
3324,
1515,
1776,
326,
3434,
467,
2157,
751,
2170,
364,
326,
864,
3017,
612,
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,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
5896,
67,
350,
4672,
3536,
990,
326,
9368,
467,
2157,
11264,
751,
225,
1220,
29876,
3324,
1515,
1776,
326,
3434,
467,
2157,
751,
2170,
364,
326,
864,
3017,
612,
16,... |
src = tools.config.options['smtp_user'] | src = tools.config.options['email_from'] | def _sendmail(self ,cr, uid, data, context): if data['form']['email_conf']: mail_notsent = '' msg_sent = '' msg_unsent = '' count = 0 pool = pooler.get_pool(cr.dbname) data_user = pool.get('res.users').browse(cr,uid,uid) line_obj = pool.get('account_followup.stat') move_lines = line_obj.browse(cr,uid,data['form']['partner_ids'][0][2]) partners = [] dict_lines = {} for line in move_lines: partners.append(line.name) dict_lines[line.name.id] =line for partner in partners: ids_lines = pool.get('account.move.line').search(cr,uid,[('partner_id','=',partner.id),('reconcile_id','=',False),('account_id.type','in',['receivable'])]) data_lines = pool.get('account.move.line').browse(cr,uid,ids_lines) followup_data = dict_lines[partner.id] dest = False if partner.address: for adr in partner.address: if adr.type=='contact': if adr.email: dest = [adr.email] if (not dest) and adr.type=='default': if adr.email: dest = [adr.email] src = tools.config.options['smtp_user'] if not data['form']['partner_lang']: body = data['form']['email_body'] else: cxt = context.copy() cxt['lang'] = partner.lang body = pool.get('res.users').browse(cr, uid, uid, context=cxt).company_id.follow_up_msg total_amt = followup_data.debit - followup_data.credit move_line = '' subtotal_due = 0.0 subtotal_paid = 0.0 subtotal_maturity = 0.0 balance = 0.0 l = '--------------------------------------------------------------------------------------------------------------------------' head = l+ '\n' + 'Date'.rjust(10) + '\t' + 'Description'.rjust(10) + '\t' + 'Ref'.rjust(10) + '\t' + 'Maturity date'.rjust(10) + '\t' + 'Due'.rjust(10) + '\t' + 'Paid'.rjust(10) + '\t' + 'Maturity'.rjust(10) + '\t' + 'Litigation'.rjust(10) + '\n' + l for i in data_lines: maturity = 0.00 if i.date_maturity < time.strftime('%Y-%m-%d') and (i.debit - i.credit): maturity = i.debit - i.credit subtotal_due = subtotal_due + i.debit subtotal_paid = subtotal_paid + i.credit subtotal_maturity = subtotal_maturity + int(maturity) balance = balance + (i.debit - i.credit) move_line = move_line + (i.date).rjust(10) + '\t'+ (i.name).rjust(10) + '\t'+ (i.ref or '').rjust(10) + '\t' + (i.date_maturity or '').rjust(10) + '\t' + str(i.debit).rjust(10) + '\t' + str(i.credit).rjust(10) + '\t' + str(maturity).rjust(10) + '\t' + str(i.blocked).rjust(10) + '\n' move_line = move_line + l + '\n'+ '\t\t\t' + 'Sub total'.rjust(35) + '\t' + (str(subtotal_due) or '').rjust(10) + '\t' + (str(subtotal_paid) or '').rjust(10) + '\t' + (str(subtotal_maturity) or '').rjust(10)+ '\n' move_line = move_line + '\t\t\t' + 'Balance'.rjust(33) + '\t' + str(balance).rjust(10) + '\n' + l val = { 'partner_name':partner.name, 'followup_amount':total_amt, 'user_signature':data_user.name, 'company_name':data_user.company_id.name, 'company_currency':data_user.company_id.currency_id.name, 'line':move_line, 'heading': head, 'date':time.strftime('%Y-%m-%d'), } body = body%val sub = tools.ustr(data['form']['email_subject']) msg = '' if dest: tools.email_send(src,dest,sub,body) msg_sent += partner.name + '\n' else: msg += partner.name + '\n' msg_unsent += msg if not msg_unsent: summary = _("All E-mails have been successfully sent to Partners:.\n\n") + msg_sent else: msg_unsent = _("E-Mail not sent to following Partners, Email not available !\n\n") + msg_unsent msg_sent = msg_sent and _("\n\nE-Mail sent to following Partners successfully. !\n\n") + msg_sent line = '==========================================================================' summary = msg_unsent + line + msg_sent return {'summary' : summary} else: return {'summary' : '\n\n\nE-Mail has not been sent to any partner. If you want to send it, please tick send email confirmation on wizard.'} | 811dea54b48b2830c2d001b0385b03dee4793f92 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/811dea54b48b2830c2d001b0385b03dee4793f92/wizard_followup_print.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4661,
4408,
12,
2890,
269,
3353,
16,
4555,
16,
501,
16,
819,
4672,
309,
501,
3292,
687,
21712,
3652,
67,
3923,
3546,
30,
4791,
67,
902,
7569,
273,
875,
1234,
67,
7569,
273,
875,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4661,
4408,
12,
2890,
269,
3353,
16,
4555,
16,
501,
16,
819,
4672,
309,
501,
3292,
687,
21712,
3652,
67,
3923,
3546,
30,
4791,
67,
902,
7569,
273,
875,
1234,
67,
7569,
273,
875,
... |
return ('brc.views.art_installation', (), { | return ('brc.views.art_installation_id', (), { | def get_absolute_url(self): return ('brc.views.art_installation', (), { 'art_installation_id':self.id, 'year_year':self.year.year, }) | 9bdefa0167808a869a8f90dc63345071d0171a8e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5677/9bdefa0167808a869a8f90dc63345071d0171a8e/models.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
12547,
67,
718,
12,
2890,
4672,
327,
7707,
70,
1310,
18,
7061,
18,
485,
67,
5425,
367,
67,
350,
2187,
1832,
16,
288,
296,
485,
67,
5425,
367,
67,
350,
4278,
2890,
18,
350,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
12547,
67,
718,
12,
2890,
4672,
327,
7707,
70,
1310,
18,
7061,
18,
485,
67,
5425,
367,
67,
350,
2187,
1832,
16,
288,
296,
485,
67,
5425,
367,
67,
350,
4278,
2890,
18,
350,
... |
print "Deefuzz v"+version | print "DeeFuzz v"+version | def main(): if len(sys.argv) == 2: print "Deefuzz v"+version d = DeeFuzz(sys.argv[1]) d.play() else: text = prog_info() sys.exit(text) | 1bfb93b85eed7476b5c9fe62882ddbb9f6af6c1b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12047/1bfb93b85eed7476b5c9fe62882ddbb9f6af6c1b/deefuzz.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
309,
562,
12,
9499,
18,
19485,
13,
422,
576,
30,
1172,
315,
758,
73,
42,
9510,
331,
6,
15,
1589,
302,
273,
463,
1340,
42,
9510,
12,
9499,
18,
19485,
63,
21,
5717,
302,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
309,
562,
12,
9499,
18,
19485,
13,
422,
576,
30,
1172,
315,
758,
73,
42,
9510,
331,
6,
15,
1589,
302,
273,
463,
1340,
42,
9510,
12,
9499,
18,
19485,
63,
21,
5717,
302,
... |
""" | """ | def flimage_get_format_info(p1): """ flimage_get_format_info(p1) -> format_info class instance """ retval = _flimage_get_format_info(p1) return retval | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
2730,
67,
588,
67,
2139,
67,
1376,
12,
84,
21,
4672,
3536,
1183,
2730,
67,
588,
67,
2139,
67,
1376,
12,
84,
21,
13,
317,
740,
67,
1376,
667,
791,
3536,
225,
5221,
273,
389,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
2730,
67,
588,
67,
2139,
67,
1376,
12,
84,
21,
4672,
3536,
1183,
2730,
67,
588,
67,
2139,
67,
1376,
12,
84,
21,
13,
317,
740,
67,
1376,
667,
791,
3536,
225,
5221,
273,
389,
2... |
def Dir_test(lpath, path_, up_path_, sep=sep): return _do_Dir_test(lpath, path_, up_path_, sep) | def Dir_test(lpath, path_, up_path_, sep=sep, func=_do_Dir_test): return func(lpath, path_, up_path_, sep) | def Dir_test(lpath, path_, up_path_, sep=sep): return _do_Dir_test(lpath, path_, up_path_, sep) | fbf318d0ccd47c34ef40439a607d9c4184a254db /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12817/fbf318d0ccd47c34ef40439a607d9c4184a254db/FSTests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8446,
67,
3813,
12,
80,
803,
16,
589,
67,
16,
731,
67,
803,
67,
16,
5478,
33,
10814,
4672,
327,
389,
2896,
67,
1621,
67,
3813,
12,
80,
803,
16,
589,
67,
16,
731,
67,
803,
67,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8446,
67,
3813,
12,
80,
803,
16,
589,
67,
16,
731,
67,
803,
67,
16,
5478,
33,
10814,
4672,
327,
389,
2896,
67,
1621,
67,
3813,
12,
80,
803,
16,
589,
67,
16,
731,
67,
803,
67,
16,... |
title = '[no title]' for line in msg.split('\n'): if line: title = line | title = (filter(None, msg.splitlines()) or ['[no title]'])[-1] issue_id = None | def send_bugtracker(msg, parent): from tryton import rpc win = gtk.Dialog(_('Tryton - Bug Tracker'), parent, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OK, gtk.RESPONSE_OK)) win.set_icon(TRYTON_ICON) win.set_default_response(gtk.RESPONSE_OK) hbox = gtk.HBox() image = gtk.Image() image.set_from_stock(gtk.STOCK_DIALOG_QUESTION, gtk.ICON_SIZE_DIALOG) hbox.pack_start(image, False, False) table = gtk.Table(2, 2) table.set_col_spacings(3) table.set_row_spacings(3) table.set_border_width(1) label_user = gtk.Label(_('User:')) label_user.set_alignment(1.0, 0.5) table.attach(label_user, 0, 1, 0, 1, yoptions=False, xoptions=gtk.FILL) entry_user = gtk.Entry() entry_user.set_activates_default(True) table.attach(entry_user, 1, 2, 0, 1, yoptions=False, xoptions=gtk.FILL) label_password = gtk.Label(_('Password:')) label_password.set_alignment(1.0, 0.5) table.attach(label_password, 0, 1, 1, 2, yoptions=False, xoptions=gtk.FILL) entry_password = gtk.Entry() entry_password.set_activates_default(True) entry_password.set_visibility(False) table.attach(entry_password, 1, 2, 1, 2, yoptions=False, xoptions=gtk.FILL) hbox.pack_start(table) win.vbox.pack_start(hbox) win.show_all() entry_password.grab_focus() entry_user.set_text(rpc._USERNAME) response = win.run() parent.present() user = entry_user.get_text() password = entry_password.get_text() win.destroy() if response == gtk.RESPONSE_OK: try: msg = msg.encode('ascii', 'replace') server = xmlrpclib.Server(('http://%s:%s@' + CONFIG['roundup.xmlrpc']) % (user, password), allow_none=True) msg_md5 = md5.new(msg).hexdigest() title = '[no title]' for line in msg.split('\n'): if line: title = line msg_ids = server.filter('msg', None, {'summary': str(msg_md5)}) issue_id = None if msg_ids: issue_ids = server.filter('issue', None, {'messages': msg_ids}) if issue_ids: issue_id = issue_ids[0] server.set('issue' + str(issue_id), *['nosy=+' + str(user)]) if not issue_id: msg_id = server.create('msg', *['content=' + str(msg), 'author=' + str(user), 'summary=' + str(msg_md5)]) issue_id = server.create('issue', *['messages=' + str(msg_id), 'nosy=' + str(user), 'title=' + str(title), 'priority=bug']) except Exception, exception: tb_s = reduce(lambda x, y: x + y, traceback.format_exception(sys.exc_type, sys.exc_value, sys.exc_traceback)) message(_('Exception:') + '\n' + tb_s, parent, msg_type=gtk.MESSAGE_ERROR) | 140b9549a7cf73fb5b18edd3f80c6a43d9cf75ec /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9151/140b9549a7cf73fb5b18edd3f80c6a43d9cf75ec/common.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
925,
16543,
12,
3576,
16,
982,
4672,
628,
775,
1917,
1930,
6724,
5657,
273,
22718,
18,
6353,
24899,
2668,
7833,
1917,
300,
16907,
11065,
264,
19899,
982,
16,
22718,
18,
2565,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
925,
16543,
12,
3576,
16,
982,
4672,
628,
775,
1917,
1930,
6724,
5657,
273,
22718,
18,
6353,
24899,
2668,
7833,
1917,
300,
16907,
11065,
264,
19899,
982,
16,
22718,
18,
2565,
1... |
ErrorDialog(_("The image file %s does NOT have write access/ permissions. " "If you have access and rights to change the permissions, " "then please do it now." % basename)) | LOG.warn(_("The image file %s does NOT have write access/ permissions. " "If you have access and rights to change the permissions, " "then please do it now." % basename)) | def write_image_metadata(self, obj): """ saves the data fields to the image """ | 85120981c36cb94696cf716feba20c7de0ae85c7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1491/85120981c36cb94696cf716feba20c7de0ae85c7/ImageMetadataGramplet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
2730,
67,
4165,
12,
2890,
16,
1081,
4672,
3536,
14649,
326,
501,
1466,
358,
326,
1316,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
2730,
67,
4165,
12,
2890,
16,
1081,
4672,
3536,
14649,
326,
501,
1466,
358,
326,
1316,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
elif media == 'MP3': mp3.cwd(config.ROM_DRIVES[0][0], menuwidget) | elif media == 'AUDIO': music.parse_entry([config.ROM_DRIVES[0][0], config.ROM_DRIVES[0][0]], menuwidget) | def autostart(): if config.ROM_DRIVES != None: media,label,image,play_options = util.identifymedia(config.ROM_DRIVES[0][0]) if play_options: movie.play(None, play_options) elif media == 'DIVX': movie.cwd(config.ROM_DRIVES[0][0], menuwidget) elif media == 'MP3': mp3.cwd(config.ROM_DRIVES[0][0], menuwidget) elif media == 'IMAGE': imenu.cwd(config.ROM_DRIVES[0][0], menuwidget) | cd3e5b07a5c256a022edda579b31f02c9caf50bf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/cd3e5b07a5c256a022edda579b31f02c9caf50bf/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2059,
669,
485,
13332,
309,
642,
18,
3942,
67,
40,
2259,
3412,
55,
480,
599,
30,
3539,
16,
1925,
16,
2730,
16,
1601,
67,
2116,
273,
1709,
18,
31079,
5829,
12,
1425,
18,
3942,
67,
40,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2059,
669,
485,
13332,
309,
642,
18,
3942,
67,
40,
2259,
3412,
55,
480,
599,
30,
3539,
16,
1925,
16,
2730,
16,
1601,
67,
2116,
273,
1709,
18,
31079,
5829,
12,
1425,
18,
3942,
67,
40,... |
'BuildRoot: %{_tmppath}/%{name}-buildroot', | 'BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot', | def _make_spec_file(self): """Generate the text of an RPM spec file and return it as a list of strings (one per line). """ # definitions and headers spec_file = [ '%define name ' + self.distribution.get_name(), '%define version ' + self.distribution.get_version(), '%define release ' + self.release, '', 'Summary: ' + self.distribution.get_description(), ] | c4686569a3bc1ce3a9ffaecca80c17651540065a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/c4686569a3bc1ce3a9ffaecca80c17651540065a/bdist_rpm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6540,
67,
2793,
67,
768,
12,
2890,
4672,
3536,
4625,
326,
977,
434,
392,
534,
12728,
857,
585,
471,
327,
518,
487,
279,
666,
434,
2064,
261,
476,
1534,
980,
2934,
3536,
468,
6377,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6540,
67,
2793,
67,
768,
12,
2890,
4672,
3536,
4625,
326,
977,
434,
392,
534,
12728,
857,
585,
471,
327,
518,
487,
279,
666,
434,
2064,
261,
476,
1534,
980,
2934,
3536,
468,
6377,... |
for e,v in es.items(): | for k,v in es.items(): | def _checkManagerAndEmployeesDict(self, m, es): """Make sure a list of employees has the same manager""" for e,v in es.items(): self.assertEquals(v.manager, m) self.assert_(m.hasValue('employees', v)) | 77a04dbd7204e544362efe8cd5e70b4c8c33bcda /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/77a04dbd7204e544362efe8cd5e70b4c8c33bcda/TestPersistentCollections.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
1318,
1876,
41,
23377,
25521,
5014,
12,
2890,
16,
312,
16,
5001,
4672,
3536,
6464,
3071,
279,
666,
434,
24539,
25521,
711,
326,
1967,
3301,
8395,
364,
417,
16,
90,
316,
5001,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1893,
1318,
1876,
41,
23377,
25521,
5014,
12,
2890,
16,
312,
16,
5001,
4672,
3536,
6464,
3071,
279,
666,
434,
24539,
25521,
711,
326,
1967,
3301,
8395,
364,
417,
16,
90,
316,
5001,
... |
sage: set( Word().factor_set() ) set([word: ]) """ return Set(set(self.factor_iterator())) | :: sage: Set(Word().factor_set()) {word: } """ return Set(set(self.factor_iterator(n))) def rauzy_graph(self, n): r""" Returns the Rauzy graph of the factors of length n of self. The vertices are the factors of length `n` and there is an edge from `u` to `v` if `ua = bv` is a factor of length `n+1` for some letters `a` and `b`. INPUT: - ``n`` - integer EXAMPLES:: sage: w = Word(range(10)); w word: 0123456789 sage: g = w.rauzy_graph(3); g Looped digraph on 8 vertices sage: WordOptions(identifier='') sage: g.vertices() [012, 123, 234, 345, 456, 567, 678, 789] sage: g.edges() [(012, 123, None), (123, 234, None), (234, 345, None), (345, 456, None), (456, 567, None), (567, 678, None), (678, 789, None)] sage: WordOptions(identifier='word: ') :: sage: f = words.FibonacciWord()[:100] sage: f.rauzy_graph(8) Looped digraph on 9 vertices :: sage: w = Word('1111111') sage: g = w.rauzy_graph(3) sage: g.edges() [(word: 111, word: 111, None)] :: sage: w = Word('111') sage: for i in range(5) : w.rauzy_graph(i) Looped digraph on 1 vertex Looped digraph on 1 vertex Looped digraph on 1 vertex Looped digraph on 1 vertex Looped multi-digraph on 0 vertices """ d = {} if n == self.length(): d[self] = [] else: for w in self.factor_iterator(n+1): u = w[:-1] v = w[1:] if d.has_key(u): d[u].append(v) else: d[u] = [v] from sage.graphs.graph import DiGraph return DiGraph(d, loops=True) | def factor_set(self): r""" Returns the set of factors of self. | f0f8fa71b4bca942b7c4ac98178e7004e50418e3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/f0f8fa71b4bca942b7c4ac98178e7004e50418e3/word.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5578,
67,
542,
12,
2890,
4672,
436,
8395,
2860,
326,
444,
434,
14490,
434,
365,
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... | [
1,
1,
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,
5578,
67,
542,
12,
2890,
4672,
436,
8395,
2860,
326,
444,
434,
14490,
434,
365,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
i, j = m.span() | def search_backward(self, text, prog, line, col, wrap, ok=0): chars = text.get("%d.0" % line, "%d.0" % (line+1)) while 1: m = search_reverse(prog, chars[:-1], col) if m: i, j = m.span() if ok or m.start() < col: return line, m line = line - 1 ok = 1 if line <= 0: if not wrap: break wrap = 0 pos = text.index("end-1c") line, col = map(int, string.split(pos, ".")) chars = text.get("%d.0" % line, "%d.0" % (line+1)) col = len(chars) - 1 return None | 6b67c52bf2e6fd0f19933aee35504ae297cb40fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6b67c52bf2e6fd0f19933aee35504ae297cb40fc/SearchEngine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
67,
29275,
12,
2890,
16,
977,
16,
11243,
16,
980,
16,
645,
16,
2193,
16,
1529,
33,
20,
4672,
5230,
273,
977,
18,
588,
27188,
72,
18,
20,
6,
738,
980,
16,
2213,
72,
18,
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,
1623,
67,
29275,
12,
2890,
16,
977,
16,
11243,
16,
980,
16,
645,
16,
2193,
16,
1529,
33,
20,
4672,
5230,
273,
977,
18,
588,
27188,
72,
18,
20,
6,
738,
980,
16,
2213,
72,
18,
20,
... | |
if t.options["auto_managed"] and (not self.config["ignore_seeding"] or t.state != "Seeding"): if active: t.resume() else: t.pause() | if t.options["auto_managed"]: if not self.config["ignore_seeding"] or not ( t.state == "Seeding" or (t.state == "Queued" and t.get_status(["progress"]).get("progress", 0) >= 100)): if active: t.resume() else: t.pause() | def _set_managed_torrents_state(self, active): """ Sets all auto-managed torrents to the state specfied in active, i.e. either running, or paused. """ | 858d5708dadf9ce33fbe62ac6c674ee32c051a5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14226/858d5708dadf9ce33fbe62ac6c674ee32c051a5d/core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
542,
67,
19360,
67,
13039,
547,
87,
67,
2019,
12,
2890,
16,
2695,
4672,
3536,
11511,
777,
3656,
17,
19360,
17351,
87,
358,
326,
919,
857,
74,
2092,
316,
2695,
16,
277,
18,
73,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
389,
542,
67,
19360,
67,
13039,
547,
87,
67,
2019,
12,
2890,
16,
2695,
4672,
3536,
11511,
777,
3656,
17,
19360,
17351,
87,
358,
326,
919,
857,
74,
2092,
316,
2695,
16,
277,
18,
73,
1... |
return str(root) | return str(root) + '\n' | def dvdauthor_xml(disc): """Return the dvdauthor XML string for the given Disc. """ assert isinstance(disc, Disc) # Root dvdauthor element root = xml.Element('dvdauthor', dest=disc.name.replace(' ', '_')) vmgm = root.add('vmgm') # Add topmenu if present if disc.topmenu: menus = vmgm.add('menus') menus.add('video') pgc = menus.add('pgc', entry='title') vob = pgc.add('vob', file=disc.topmenu.filename) for index, titleset in enumerate(disc.titlesets): vob.add('button', 'jump titleset %d;' % (index + 1)) # Add each titleset for titleset in disc.titlesets: menu = titleset.menu ts = root.add('titleset') # Add menu if present if menu: menus = ts.add('menus') menus.add('video') menus.add('pgc', entry='root') vob = menus.add('vob', file=menu.filename) for index, video in enumerate(menu.videos): vob.add('button', 'jump title %d;' % (index + 1)) vob.add('button', 'jump vmgm menu;') # Add a pgc for each video for video in titleset.videos: pgc = ts.add('pgc') pgc.add('vob', file=video.filename, chapters=','.join(video.chapters)) pgc.add('post', 'call menu;') # Return XML string return str(root) | 2337717119f11b713e56550fca0ca14eabf780e3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4675/2337717119f11b713e56550fca0ca14eabf780e3/author.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12494,
72,
4161,
67,
2902,
12,
2251,
71,
4672,
3536,
990,
326,
12494,
72,
4161,
3167,
533,
364,
326,
864,
3035,
71,
18,
3536,
1815,
1549,
12,
2251,
71,
16,
3035,
71,
13,
468,
7450,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12494,
72,
4161,
67,
2902,
12,
2251,
71,
4672,
3536,
990,
326,
12494,
72,
4161,
3167,
533,
364,
326,
864,
3035,
71,
18,
3536,
1815,
1549,
12,
2251,
71,
16,
3035,
71,
13,
468,
7450,
1... |
self.vision.downward.orangeDetectOn() | self.vision.downward.orangeDetectOn() | def intializePipeLight(self): self.orangex = -1.0 self.orangey = -1.0 self.scanCount = 0 self.scanDegrees = 5 self.binCount = 0 self.orangeCount = 0 self.countDown = 15 self.lostPipeCountDown = 40 self.countOfTimesPipeLost = 0 self.lightFoundCount = 0 self.lightLostCount = 0 self.chaseCount = 0 self.vision.downward.orangeDetectOn() self.vision.forward.redLightDetectOn() self.controller.setSpeed(4) self.controller.yawVehicle(-60) self.stateMachine.change_state("waitThenPipeLight") | b10a92e535b20c0b6cda01a39be7e0c41877eb1b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10608/b10a92e535b20c0b6cda01a39be7e0c41877eb1b/cleanAI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
509,
1710,
11546,
12128,
12,
2890,
4672,
365,
18,
280,
539,
338,
273,
300,
21,
18,
20,
365,
18,
280,
539,
402,
273,
300,
21,
18,
20,
365,
18,
9871,
1380,
273,
374,
365,
18,
9871,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
509,
1710,
11546,
12128,
12,
2890,
4672,
365,
18,
280,
539,
338,
273,
300,
21,
18,
20,
365,
18,
280,
539,
402,
273,
300,
21,
18,
20,
365,
18,
9871,
1380,
273,
374,
365,
18,
9871,
2... |
global logger, max_bytes, xmlparser, dbobj, xmlparser, lwtparser, rls | global logger, max_bytes, xmlparser, lwtparser, dbobj, rls global dmt_proc_dict, dmt_seg_def_dict | def shutdown(): global logger, max_bytes, xmlparser, dbobj, xmlparser, lwtparser, rls logger.info("Shutting down server module %s" % __name__ ) if rls: del rls del lwtparser del xmlparser del dbobj del dmt_proc_dict del dmt_seg_def_dict | 54638185112b29dc629837d9da4bf4d911d2ec83 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3589/54638185112b29dc629837d9da4bf4d911d2ec83/LDBDServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5731,
13332,
2552,
1194,
16,
943,
67,
3890,
16,
2025,
4288,
16,
328,
6046,
4288,
16,
302,
1075,
441,
16,
436,
3251,
2552,
302,
1010,
67,
9381,
67,
1576,
16,
302,
1010,
67,
5680,
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,
5731,
13332,
2552,
1194,
16,
943,
67,
3890,
16,
2025,
4288,
16,
328,
6046,
4288,
16,
302,
1075,
441,
16,
436,
3251,
2552,
302,
1010,
67,
9381,
67,
1576,
16,
302,
1010,
67,
5680,
67,
... |
"contact_email", "licence") | "contact_email", "licence", "classifiers") | def is_pure (self): return (self.has_pure_modules() and not self.has_ext_modules() and not self.has_c_libraries()) | 939561d2398194c36dbf08ce3cfcb44b057a3124 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/939561d2398194c36dbf08ce3cfcb44b057a3124/dist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
84,
594,
261,
2890,
4672,
327,
261,
2890,
18,
5332,
67,
84,
594,
67,
6400,
1435,
471,
486,
365,
18,
5332,
67,
408,
67,
6400,
1435,
471,
486,
365,
18,
5332,
67,
71,
67,
314... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
353,
67,
84,
594,
261,
2890,
4672,
327,
261,
2890,
18,
5332,
67,
84,
594,
67,
6400,
1435,
471,
486,
365,
18,
5332,
67,
408,
67,
6400,
1435,
471,
486,
365,
18,
5332,
67,
71,
67,
314... |
os.removedirs(path) | shutil.rmtree(path) | def read_data(path): f = open(path) data = f.read() f.close() return data | 94140157445c602566af2220f85f7483813ff9dc /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/94140157445c602566af2220f85f7483813ff9dc/test_shutil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
892,
12,
803,
4672,
284,
273,
1696,
12,
803,
13,
501,
273,
284,
18,
896,
1435,
284,
18,
4412,
1435,
327,
501,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
892,
12,
803,
4672,
284,
273,
1696,
12,
803,
13,
501,
273,
284,
18,
896,
1435,
284,
18,
4412,
1435,
327,
501,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
else | else: | def __init__(data = None) if data == None: quickfix.StringField.__init__(self, 934) else quickfix.StringField.__init__(self, 934, data) | 484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
780,
974,
16186,
2738,
972,
12,
2890,
16,
2468,
5026,
13,
469,
30,
9549,
904,
18,
780,
974,
16186,
2738... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
780,
974,
16186,
2738,
972,
12,
2890,
16,
2468,
5026,
13,
469,
30,
9549,
904,
18,
780,
974,
16186,
2738... |
class _ReferenceableProducerWrapper(pb.Referenceable): def __init__(self, producer): self.producer = producer def remote_resumeProducing(self): self.producer.resumeProducing() def remote_pauseProducing(self): self.producer.pauseProducing() def remote_stopProducing(self): self.producer.stopProducing() class OldRequestCopier(pb.RemoteCopy, OldRequestAdapter): def setCopyableState(self, state): for k in 'host', 'client': tup = state[k] addrdesc = {'INET': 'TCP', 'UNIX': 'UNIX'}[tup[0]] addr = {'TCP': lambda: address.IPv4Address(addrdesc, tup[1], tup[2], _bwHack='INET'), 'UNIX': lambda: address.UNIXAddress(tup[1])}[addrdesc]() state[k] = addr pb.RemoteCopy.setCopyableState(self, state) remote_methods = ['write', 'finish', 'setHeader', 'addCookie', 'setETag', 'setResponseCode', 'setLastModified'] for rm in remote_methods: setattr(self, rm, self.remote.remoteMethod(rm)) self.content = StringIO(self.content_data) def registerProducer(self, producer, streaming): self.remote.callRemote("registerProducer", _ReferenceableProducerWrapper(producer), streaming).addErrback(self.fail) def unregisterProducer(self): self.remote.callRemote("unregisterProducer").addErrback(self.fail) def fail(self, failure): log.err(failure) pb.setCopierForClass(OldRequestAdapter, OldRequestCopier) | def getSession(self, sessionInterface = None): # Session management if not self.session: # FIXME: make sitepath be something cookiename = string.join(['TWISTED_SESSION'] + self.sitepath, "_") sessionCookie = self.getCookie(cookiename) if sessionCookie: try: self.session = self.site.getSession(sessionCookie) except KeyError: pass # if it still hasn't been set, fix it up. if not self.session: self.session = self.site.makeSession() self.addCookie(cookiename, self.session.uid, path='/') self.session.touch() if sessionInterface: return self.session.getComponent(sessionInterface) return self.session | 9d3471d69825564ffa264d54a5c1ad49b3703d22 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/9d3471d69825564ffa264d54a5c1ad49b3703d22/compat.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7183,
12,
2890,
16,
1339,
1358,
273,
599,
4672,
468,
3877,
11803,
309,
486,
365,
18,
3184,
30,
468,
9852,
30,
1221,
2834,
803,
506,
5943,
15860,
77,
1069,
273,
533,
18,
5701,
12,
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,
7183,
12,
2890,
16,
1339,
1358,
273,
599,
4672,
468,
3877,
11803,
309,
486,
365,
18,
3184,
30,
468,
9852,
30,
1221,
2834,
803,
506,
5943,
15860,
77,
1069,
273,
533,
18,
5701,
12,
3292,... | |
outfile=makeFile(outfilepath) | outfile=self.makeFile(outfilepath) | def generatePackage(self,package,recursive=1): package.generatedModules=[] package.generatedClasses=[] if package.getName() == 'java': #to suppress these unneccesary implicit created java packages (ArcgoUML and Poseidon) return makeDir(package.getFilePath()) for element in package.getClasses()+package.getInterfaces(): #skip stub and internal classes if element.isInternal() or element.hasStereoType(self.stub_stereotypes): continue | 8e4d9d9e796f5091a3eae12f371779fbf8c28ad2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11941/8e4d9d9e796f5091a3eae12f371779fbf8c28ad2/ArchGenXML.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
2261,
12,
2890,
16,
5610,
16,
10543,
33,
21,
4672,
2181,
18,
11168,
7782,
33,
8526,
2181,
18,
11168,
4818,
33,
8526,
309,
2181,
18,
17994,
1435,
422,
296,
6290,
4278,
468,
869,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
2261,
12,
2890,
16,
5610,
16,
10543,
33,
21,
4672,
2181,
18,
11168,
7782,
33,
8526,
2181,
18,
11168,
4818,
33,
8526,
309,
2181,
18,
17994,
1435,
422,
296,
6290,
4278,
468,
869,
1... |
if revision is None and self.cachable(key): response = self.cache.get(key) or self.memcache.get(web.safestr(key)) if not response: response = super.get(sitename, data) self.cache[key] = response | def _get(): return self.memcache.get(web.safestr(key)) or super.get(sitename, data) if revision is None: if self.cachable(key): response = self.cache.get(key) if not response: response = _get() self.cache[key] = response else: response = _get() | def get(self, super, sitename, data): key = data.get('key') revision = data.get('revision') | 7b41c12e176e2c77e839ca008f8a659911239b67 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3913/7b41c12e176e2c77e839ca008f8a659911239b67/connection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
16,
2240,
16,
10982,
1069,
16,
501,
4672,
498,
273,
501,
18,
588,
2668,
856,
6134,
6350,
273,
501,
18,
588,
2668,
13057,
6134,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
16,
2240,
16,
10982,
1069,
16,
501,
4672,
498,
273,
501,
18,
588,
2668,
856,
6134,
6350,
273,
501,
18,
588,
2668,
13057,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
clock_pic = self.getClockPixmap(service, begTime, duration, eventId) | def buildMultiEntry(self, changecount, service, eventId, begTime, duration, EventName, nowTime, service_name): rec=begTime and (self.timer.isInTimer(eventId, begTime, duration, service)) r1=self.service_rect r2=self.progress_rect r3=self.descr_rect r4=self.start_end_rect res = [ None ] # no private data needed if rec: clock_pic = self.getClockPixmap(service, begTime, duration, eventId) res.extend(( (eListboxPythonMultiContent.TYPE_TEXT, r1.left(), r1.top(), r1.width()-21, r1.height(), 0, RT_HALIGN_LEFT, service_name), (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, r1.left()+r1.width()-16, r1.top(), 21, 21, clock_pic) )) else: res.append((eListboxPythonMultiContent.TYPE_TEXT, r1.left(), r1.top(), r1.width(), r1.height(), 0, RT_HALIGN_LEFT, service_name)) if begTime is not None: if nowTime < begTime: begin = localtime(begTime) end = localtime(begTime+duration) | 1cd8250a9e8f1d9236ec0101480872cf0802cfb3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6652/1cd8250a9e8f1d9236ec0101480872cf0802cfb3/EpgList.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
5002,
1622,
12,
2890,
16,
9435,
557,
592,
16,
1156,
16,
26004,
16,
16847,
950,
16,
3734,
16,
2587,
461,
16,
2037,
950,
16,
1156,
67,
529,
4672,
1950,
33,
70,
1332,
950,
471,
26... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
5002,
1622,
12,
2890,
16,
9435,
557,
592,
16,
1156,
16,
26004,
16,
16847,
950,
16,
3734,
16,
2587,
461,
16,
2037,
950,
16,
1156,
67,
529,
4672,
1950,
33,
70,
1332,
950,
471,
26... | |
yield eval(self._content[identifier]) return | identifier = identifier.encode('utf8') if identifier in ids: ids = [identifier] else: ids = [] | def oai_query(self, offset=0, batch_size=20, sets=[], not_sets=[], filter_sets=[], from_date=None, until_date=None, identifier=None): | fb14eded0d71d71eb3373dff8683da652cf215ce /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14691/fb14eded0d71d71eb3373dff8683da652cf215ce/btree.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
320,
10658,
67,
2271,
12,
2890,
16,
1384,
33,
20,
16,
2581,
67,
1467,
33,
3462,
16,
1678,
22850,
6487,
486,
67,
4424,
22850,
6487,
1034,
67,
4424,
22850,
6487,
628,
67,
712,
33,
7036,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
320,
10658,
67,
2271,
12,
2890,
16,
1384,
33,
20,
16,
2581,
67,
1467,
33,
3462,
16,
1678,
22850,
6487,
486,
67,
4424,
22850,
6487,
1034,
67,
4424,
22850,
6487,
628,
67,
712,
33,
7036,
... |
for cat in cats: | for cat in cats[:]: | def change_category(article, oldCat, newCatTitle): """ Given an article which is in category oldCat, moves it to category called newCatTitle. Moves subcategories of oldCat as well. oldCat should be a Category object, newCatTitle should be the new name as a string, without namespace. If newCatTitle is None, the category will be removed. """ cats = article.categories(withSortKeys = True) site = article.site() sort_key = '' removed = False for cat in cats: # get the category title without the namespace, but possibly with a # "|" sign followed by a sortkey if cat == oldCat: # because a list element is removed, the iteration will skip the # next element. this might lead to forgotten categories, but # usually each category should only appear once per article. cats.remove(cat) removed = True elif cat.title().startswith(oldCat.title() + '|'): sort_key = cat.titleWithoutNamespace().split('|', 1)[1] cats.remove(cat) removed = True if not removed: wikipedia.output(u'ERROR: %s is not in category %s!' % (article.aslink(), oldCat.title())) return if newCatTitle is not None: if sort_key == '': newCat = Category(site, newCatTitle) else: newCat = Category(site, newCatTitle + '|' + sort_key) cats.append(newCat) text = article.get() text = wikipedia.replaceCategoryLinks(text, cats) article.put(text) | e701d1c84933467dbf5b8866e35f03bb8f8c04e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/e701d1c84933467dbf5b8866e35f03bb8f8c04e4/catlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2549,
67,
4743,
12,
11480,
16,
1592,
11554,
16,
394,
11554,
4247,
4672,
3536,
16803,
392,
7559,
1492,
353,
316,
3150,
1592,
11554,
16,
13934,
518,
358,
3150,
2566,
394,
11554,
4247,
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,
2549,
67,
4743,
12,
11480,
16,
1592,
11554,
16,
394,
11554,
4247,
4672,
3536,
16803,
392,
7559,
1492,
353,
316,
3150,
1592,
11554,
16,
13934,
518,
358,
3150,
2566,
394,
11554,
4247,
18,
... |
elif k in [pickle.STRING]: pass | def refuse_to_unpickle(self): raise pickle.UnpicklingError, 'Refused' | 0f7afa6d2bd9ffe9bcbff548137dce145b5e8136 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/0f7afa6d2bd9ffe9bcbff548137dce145b5e8136/TreeTag.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1278,
1202,
67,
869,
67,
318,
20847,
12,
2890,
4672,
1002,
13379,
18,
984,
11503,
2456,
668,
16,
296,
1957,
3668,
11,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1278,
1202,
67,
869,
67,
318,
20847,
12,
2890,
4672,
1002,
13379,
18,
984,
11503,
2456,
668,
16,
296,
1957,
3668,
11,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... | |
return output.split(None, 1)[0] | return output.split(None, 2)[1] | def git_get_hash(self, name, version="HEAD"): cmd_list = [["echo", str(version + ':' + name)], self.git_command() + ["cat-file", "--batch-check"]] debug_print('executing commands', cmd_list) result, output, errs = execute_piped_cmdlines(cmd_list) debug_print('stdout:', type(output), output) debug_print('stderr:', type(errs), errs) if result != 0: # check output for error messages raise ModuleError(self, "Error retrieving file '%s'\n" % name + errs) return output.split(None, 1)[0] | 1b190225cce9e4fbbd1fe9e0fd1d77297b6572cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/1b190225cce9e4fbbd1fe9e0fd1d77297b6572cb/init.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5071,
67,
588,
67,
2816,
12,
2890,
16,
508,
16,
1177,
1546,
12458,
6,
4672,
1797,
67,
1098,
273,
306,
9614,
12946,
3113,
609,
12,
1589,
397,
3921,
397,
508,
13,
6487,
365,
18,
6845,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5071,
67,
588,
67,
2816,
12,
2890,
16,
508,
16,
1177,
1546,
12458,
6,
4672,
1797,
67,
1098,
273,
306,
9614,
12946,
3113,
609,
12,
1589,
397,
3921,
397,
508,
13,
6487,
365,
18,
6845,
... |
print "fyi: this SimpleColumn has %d args" % len(args) print "fyi: the args i mentioned are: %r" % (args,) | len(args) if debug070321: print "fyi: this SimpleColumn has %d args" % len(args) print "fyi: the args i mentioned are: %r" % (args,) | def _init_instance(self):##### debug only super(SimpleColumn, self)._init_instance() try: args = 'bug' # for use in error message, in case of exception args = self.args print "fyi: this SimpleColumn has %d args" % len(args) print "fyi: the args i mentioned are: %r" % (args,) ##### except: print "following exception concerns self = %r, args = %r" % (self, args) raise return | e390f09522e65a3a626dcf5f754a40d67926a9e5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/e390f09522e65a3a626dcf5f754a40d67926a9e5/Column.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
67,
1336,
12,
2890,
4672,
1970,
7,
1198,
1338,
2240,
12,
5784,
1494,
16,
365,
2934,
67,
2738,
67,
1336,
1435,
775,
30,
833,
273,
296,
925,
11,
468,
364,
999,
316,
555,
883... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2738,
67,
1336,
12,
2890,
4672,
1970,
7,
1198,
1338,
2240,
12,
5784,
1494,
16,
365,
2934,
67,
2738,
67,
1336,
1435,
775,
30,
833,
273,
296,
925,
11,
468,
364,
999,
316,
555,
883... |
ns['STATUS'] = properties('STATUS').value | status = properties('STATUS') if status: ns['STATUS'] = properties('STATUS').value else: ns['STATUS'] = '' | def get_ns_event(self, day, event, resource_name=None, conflicts_list=[], starts_on=True, ends_on=True, out_on=True): """ Specify the namespace given on views to represent an event. | c72afbe2f3dd66d7d003964775b3ff62f8fc4e8c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12681/c72afbe2f3dd66d7d003964775b3ff62f8fc4e8c/ical.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2387,
67,
2575,
12,
2890,
16,
2548,
16,
871,
16,
1058,
67,
529,
33,
7036,
16,
14450,
67,
1098,
22850,
6487,
2542,
67,
265,
33,
5510,
16,
3930,
67,
265,
33,
5510,
16,
596,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2387,
67,
2575,
12,
2890,
16,
2548,
16,
871,
16,
1058,
67,
529,
33,
7036,
16,
14450,
67,
1098,
22850,
6487,
2542,
67,
265,
33,
5510,
16,
3930,
67,
265,
33,
5510,
16,
596,
... |
query = 'SELECT name, model, res_id, module' \ ' FROM ir_model_data' query_models = """SELECT m.id, m.model, imd.module | query = 'SELECT name, model, res_id, module' \ ' FROM ir_model_data WHERE %s ORDER BY module, model, name' query_models = """SELECT * FROM ( SELECT DISTINCT ON(m.model) m.id, m.model, imd.module | def trans_generate(lang, modules, dbname=None): logger = logging.getLogger('i18n') if not dbname: dbname=tools.config['db_name'] if not modules: modules = ['all'] pool = pooler.get_pool(dbname) trans_obj = pool.get('ir.translation') model_data_obj = pool.get('ir.model.data') cr = pooler.get_db(dbname).cursor() uid = 1 l = pool.obj_pool.items() l.sort() query = 'SELECT name, model, res_id, module' \ ' FROM ir_model_data' query_models = """SELECT m.id, m.model, imd.module FROM ir_model AS m, ir_model_data AS imd WHERE m.id = imd.res_id AND imd.model = 'ir.model' """ if 'all_installed' in modules: query += ' WHERE module IN ( SELECT name FROM ir_module_module WHERE state = \'installed\') ' query_models += " AND imd.module in ( SELECT name FROM ir_module_module WHERE state = 'installed') " query_param = None if 'all' not in modules: query += ' WHERE module IN %s' query_models += ' AND imd.module in %s' query_param = (tuple(modules),) query += ' ORDER BY module, model, name' query_models += ' ORDER BY module, model' cr.execute(query, query_param) _to_translate = [] def push_translation(module, type, name, id, source): tuple = (module, source, name, id, type) if source and tuple not in _to_translate: _to_translate.append(tuple) def encode(s): if isinstance(s, unicode): return s.encode('utf8') return s for (xml_name,model,res_id,module) in cr.fetchall(): module = encode(module) model = encode(model) xml_name = "%s.%s" % (module, encode(xml_name)) if not pool.get(model): logger.error("Unable to find object %r", model) continue exists = pool.get(model).exists(cr, uid, res_id) if not exists: logger.warning("Unable to find object %r with id %d", model, res_id) continue obj = pool.get(model).browse(cr, uid, res_id) if model=='ir.ui.view': d = etree.XML(encode(obj.arch)) for t in trans_parse_view(d): push_translation(module, 'view', encode(obj.model), 0, t) elif model=='ir.actions.wizard': service_name = 'wizard.'+encode(obj.wiz_name) if netsvc.Service._services.get(service_name): obj2 = netsvc.Service._services[service_name] for state_name, state_def in obj2.states.iteritems(): if 'result' in state_def: result = state_def['result'] if result['type'] != 'form': continue name = "%s,%s" % (encode(obj.wiz_name), state_name) def_params = { 'string': ('wizard_field', lambda s: [encode(s)]), 'selection': ('selection', lambda s: [encode(e[1]) for e in ((not callable(s)) and s or [])]), 'help': ('help', lambda s: [encode(s)]), } # export fields if not result.has_key('fields'): logger.warning("res has no fields: %r", result) continue for field_name, field_def in result['fields'].iteritems(): res_name = name + ',' + field_name for fn in def_params: if fn in field_def: transtype, modifier = def_params[fn] for val in modifier(field_def[fn]): push_translation(module, transtype, res_name, 0, val) # export arch arch = result['arch'] if arch and not isinstance(arch, UpdateableStr): d = etree.XML(arch) for t in trans_parse_view(d): push_translation(module, 'wizard_view', name, 0, t) # export button labels for but_args in result['state']: button_name = but_args[0] button_label = but_args[1] res_name = name + ',' + button_name push_translation(module, 'wizard_button', res_name, 0, button_label) elif model=='ir.model.fields': try: field_name = encode(obj.name) except AttributeError, exc: logger.error("name error in %s: %s", xml_name, str(exc)) continue objmodel = pool.get(obj.model) if not objmodel or not field_name in objmodel._columns: continue field_def = objmodel._columns[field_name] name = "%s,%s" % (encode(obj.model), field_name) push_translation(module, 'field', name, 0, encode(field_def.string)) if field_def.help: push_translation(module, 'help', name, 0, encode(field_def.help)) if field_def.translate: ids = objmodel.search(cr, uid, []) obj_values = objmodel.read(cr, uid, ids, [field_name]) for obj_value in obj_values: res_id = obj_value['id'] if obj.name in ('ir.model', 'ir.ui.menu'): res_id = 0 model_data_ids = model_data_obj.search(cr, uid, [ ('model', '=', model), ('res_id', '=', res_id), ]) if not model_data_ids: push_translation(module, 'model', name, 0, encode(obj_value[field_name])) if hasattr(field_def, 'selection') and isinstance(field_def.selection, (list, tuple)): for dummy, val in field_def.selection: push_translation(module, 'selection', name, 0, encode(val)) elif model=='ir.actions.report.xml': name = encode(obj.report_name) fname = "" if obj.report_rml: fname = obj.report_rml parse_func = trans_parse_rml report_type = "report" elif obj.report_xsl: fname = obj.report_xsl parse_func = trans_parse_xsl report_type = "xsl" if fname and obj.report_type in ('pdf', 'xsl'): try: d = etree.parse(tools.file_open(fname)) for t in parse_func(d.iter()): push_translation(module, report_type, name, 0, t) except (IOError, etree.XMLSyntaxError): logger.exception("couldn't export translation for report %s %s %s", name, report_type, fname) for field_name,field_def in obj._table._columns.items(): if field_def.translate: name = model + "," + field_name try: trad = getattr(obj, field_name) or '' except: trad = '' push_translation(module, 'model', name, xml_name, encode(trad)) # End of data for ir.model.data query results cr.execute(query_models, query_param) def push_constraint_msg(module, term_type, model, msg): # Check presence of __call__ directly instead of using # callable() because it will be deprecated as of Python 3.0 if not hasattr(msg, '__call__'): push_translation(module, term_type, model, 0, encode(msg)) for (model_id, model, module) in cr.fetchall(): module = encode(module) model = encode(model) model_obj = pool.get(model) if not model_obj: logger.error("Unable to find object %r", model) continue if model_obj._debug: logger.debug("Scanning model %s for translations", model) for constraint in getattr(model_obj, '_constraints', []): push_constraint_msg(module, 'constraint', model, constraint[1]) for constraint in getattr(model_obj, '_sql_constraints', []): push_constraint_msg(module, 'sql_constraint', model, constraint[2]) # parse source code for _() calls def get_module_from_path(path, mod_paths=None): if not mod_paths: # First, construct a list of possible paths def_path = os.path.abspath(os.path.join(tools.config['root_path'], 'addons')) # default addons path (base) ad_paths= map(lambda m: os.path.abspath(m.strip()),tools.config['addons_path'].split(',')) mod_paths=[def_path] for adp in ad_paths: mod_paths.append(adp) if not os.path.isabs(adp): mod_paths.append(adp) elif adp.startswith(def_path): mod_paths.append(adp[len(def_path)+1:]) for mp in mod_paths: if path.startswith(mp) and (os.path.dirname(path) != mp): path = path[len(mp)+1:] return path.split(os.path.sep)[0] return 'base' # files that are not in a module are considered as being in 'base' module modobj = pool.get('ir.module.module') installed_modids = modobj.search(cr, uid, [('state', '=', 'installed')]) installed_modules = map(lambda m: m['name'], modobj.read(cr, uid, installed_modids, ['name'])) root_path = os.path.join(tools.config['root_path'], 'addons') apaths = map(os.path.abspath, map(str.strip, tools.config['addons_path'].split(','))) if root_path in apaths: path_list = apaths else : path_list = [root_path,] + apaths logger.debug("Scanning modules at paths: %s",' '.join(path_list)) mod_paths = [] join_dquotes = re.compile(r'([^\\])"[\s\\]*"', re.DOTALL) join_quotes = re.compile(r'([^\\])\'[\s\\]*\'', re.DOTALL) re_dquotes = re.compile(r'[^a-zA-Z0-9_]_\([\s]*"(.+?)"[\s]*?\)', re.DOTALL) re_quotes = re.compile(r'[^a-zA-Z0-9_]_\([\s]*\'(.+?)\'[\s]*?\)', re.DOTALL) def export_code_terms_from_file(fname, path, root, terms_type): fabsolutepath = join(root, fname) frelativepath = fabsolutepath[len(path):] module = get_module_from_path(fabsolutepath, mod_paths=mod_paths) is_mod_installed = module in installed_modules if (('all' in modules) or (module in modules)) and is_mod_installed: logger.debug("Scanning code of %s at module: %s", frelativepath, module) code_string = tools.file_open(fabsolutepath, subdir='').read() if module in installed_modules: frelativepath = str("addons" + frelativepath) ite = re_dquotes.finditer(code_string) for i in ite: src = i.group(1) if src.startswith('""'): assert src.endswith('""'), "Incorrect usage of _(..) function (should contain only literal strings!) in file %s near: %s" % (frelativepath, src[:30]) src = src[2:-2] else: src = join_dquotes.sub(r'\1', src) # now, since we did a binary read of a python source file, we # have to expand pythonic escapes like the interpreter does. src = src.decode('string_escape') push_translation(module, terms_type, frelativepath, 0, encode(src)) ite = re_quotes.finditer(code_string) for i in ite: src = i.group(1) if src.startswith("''"): assert src.endswith("''"), "Incorrect usage of _(..) function (should contain only literal strings!) in file %s near: %s" % (frelativepath, src[:30]) src = src[2:-2] else: src = join_quotes.sub(r'\1', src) src = src.decode('string_escape') push_translation(module, terms_type, frelativepath, 0, encode(src)) for path in path_list: logger.debug("Scanning files of modules at %s", path) for root, dummy, files in tools.osutil.walksymlinks(path): for fname in itertools.chain(fnmatch.filter(files, '*.py')): export_code_terms_from_file(fname, path, root, 'code') for fname in itertools.chain(fnmatch.filter(files, '*.mako')): export_code_terms_from_file(fname, path, root, 'report') out = [["module","type","name","res_id","src","value"]] # header _to_translate.sort() # translate strings marked as to be translated for module, source, name, id, type in _to_translate: trans = trans_obj._get_source(cr, uid, name, type, lang, source) out.append([module, type, name, id, source, encode(trans) or '']) cr.close() return out | 596e694080c12324ca62467c5926f5a1bbc0a27b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/596e694080c12324ca62467c5926f5a1bbc0a27b/translate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
906,
67,
7163,
12,
4936,
16,
4381,
16,
18448,
33,
7036,
4672,
1194,
273,
2907,
18,
588,
3328,
2668,
77,
2643,
82,
6134,
309,
486,
18448,
30,
18448,
33,
6642,
18,
1425,
3292,
1966,
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,
906,
67,
7163,
12,
4936,
16,
4381,
16,
18448,
33,
7036,
4672,
1194,
273,
2907,
18,
588,
3328,
2668,
77,
2643,
82,
6134,
309,
486,
18448,
30,
18448,
33,
6642,
18,
1425,
3292,
1966,
67,
... |
self.inputs[index] = val self.unvalidate_input(index) | self.set_input(index, val) | def set_input_by_key(self, key, val): """ Set the input value for the specified port name (key)""" index = self.map_index_in[key] self.inputs[index] = val self.unvalidate_input(index) | 5cc208910e2581a2922581c6ffb491e11f926b0d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11338/5cc208910e2581a2922581c6ffb491e11f926b0d/core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
2630,
67,
1637,
67,
856,
12,
2890,
16,
498,
16,
1244,
4672,
3536,
1000,
326,
810,
460,
364,
326,
1269,
1756,
508,
261,
856,
15574,
770,
273,
365,
18,
1458,
67,
1615,
67,
267... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
2630,
67,
1637,
67,
856,
12,
2890,
16,
498,
16,
1244,
4672,
3536,
1000,
326,
810,
460,
364,
326,
1269,
1756,
508,
261,
856,
15574,
770,
273,
365,
18,
1458,
67,
1615,
67,
267... |
self.session_cache[address] = (time.time(), user) | self.session_cache[address] = (time.time(), client) | def AuthenticateConnection(self, cert, user, password, address): '''This function checks auth creds''' if cert: id_method = 'cert' certinfo = dict([x[0] for x in cert['subject']]) # look at cert.cN client = certinfo['commonName'] self.debug_log("Got cN %s; using as client name" % client) auth_type = self.auth.get(client, 'cert+password') elif user == 'root': id_method = 'address' try: client = self.resolve_client(address) except MetadataConsistencyError: self.logger.error("Client %s failed to resolve; metadata problem" % (address[0])) return False else: id_method = 'uuid' # user maps to client if user not in self.uuid: client = user self.uuid[user] = user else: client = self.uuid[user] | 80f8da0cb96466e108963c88645b99bd32ce5f0f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/80f8da0cb96466e108963c88645b99bd32ce5f0f/Metadata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26644,
1952,
12,
2890,
16,
3320,
16,
729,
16,
2201,
16,
1758,
4672,
9163,
2503,
445,
4271,
1357,
12534,
26418,
309,
3320,
30,
612,
67,
2039,
273,
296,
7593,
11,
3320,
1376,
273,
2065,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26644,
1952,
12,
2890,
16,
3320,
16,
729,
16,
2201,
16,
1758,
4672,
9163,
2503,
445,
4271,
1357,
12534,
26418,
309,
3320,
30,
612,
67,
2039,
273,
296,
7593,
11,
3320,
1376,
273,
2065,
... |
if not topic.forum.category.has_access(request.user): | if not forum.category.has_access(request.user): | def add_post(request, forum_id, topic_id): forum = None topic = None posts = None if forum_id: forum = get_object_or_404(Forum, pk=forum_id) elif topic_id: topic = get_object_or_404(Topic, pk=topic_id) posts = topic.posts.all().select_related() if topic and topic.closed: return HttpResponseRedirect(topic.get_absolute_url()) if not topic.forum.category.has_access(request.user): return HttpResponseForbidden() ip = request.META.get('REMOTE_ADDR', '') form = build_form(AddPostForm, request, topic=topic, forum=forum, user=request.user, ip=ip, initial={'markup': request.user.forum_profile.markup}) if 'post_id' in request.GET: post_id = request.GET['post_id'] post = get_object_or_404(Post, pk=post_id) form.fields['body'].initial = "[quote=%s]%s[/quote]" % (post.user, post.body) if form.is_valid(): post = form.save(); return HttpResponseRedirect(post.get_absolute_url()) return {'form': form, 'posts': posts, 'topic': topic, 'forum': forum, } | bd2a25ca2dfe7136f46d43ab2eb749298328fbab /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13701/bd2a25ca2dfe7136f46d43ab2eb749298328fbab/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
2767,
12,
2293,
16,
11283,
67,
350,
16,
3958,
67,
350,
4672,
11283,
273,
599,
3958,
273,
599,
10775,
273,
599,
225,
309,
11283,
67,
350,
30,
11283,
273,
336,
67,
1612,
67,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
2767,
12,
2293,
16,
11283,
67,
350,
16,
3958,
67,
350,
4672,
11283,
273,
599,
3958,
273,
599,
10775,
273,
599,
225,
309,
11283,
67,
350,
30,
11283,
273,
336,
67,
1612,
67,
2... |
tasks += "Description: %s\nPriority: %s, Actionable: %s, Open: %s, Due: %s\nPath: %s, Tags: %s\n\n" % (desc, prio, actionable, opn, due, path_name, ", ".join(tags)) | tasks += "Description: %s\nPriority: %s, Actionable: %s, Open: %s, Due: %s\nPath: %s, Tags: %s\n\n" % (desc, prio, actionable, opn, due, path_name, ", ".join(tags)) | def copy_to_clipboard(self): '''Exports currently visable elements from the tasks list''' logger.debug('Exporting to clipboard current view of task list.') model = self.get_model() tasks = "" for row in model: # only open items if row[self.OPEN_COL]: tags = set() vis, prio, desc, due, path_name, actionable, opn = row if due == "9999": due = "-" for match in tag_re.findall(desc.decode("UTF-8")): tags.add(match) tasks += "Description: %s\nPriority: %s, Actionable: %s, Open: %s, Due: %s\nPath: %s, Tags: %s\n\n" % (desc, prio, actionable, opn, due, path_name, ", ".join(tags)) tasks += "Number of tasks: %s. Exported: %s UTC." \ % (len(model), str(datetime.datetime.utcnow())[:-7]) #~ print tasks gtk.Clipboard().set_text(tasks.decode("UTF-8")) | b4594f91af2c45f75e72f3c799a764d4d113bce0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4103/b4594f91af2c45f75e72f3c799a764d4d113bce0/tasklist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
67,
869,
67,
14161,
3752,
12,
2890,
4672,
9163,
15352,
4551,
2281,
429,
2186,
628,
326,
4592,
666,
26418,
1194,
18,
4148,
2668,
6144,
310,
358,
20304,
783,
1476,
434,
1562,
666,
10... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
67,
869,
67,
14161,
3752,
12,
2890,
4672,
9163,
15352,
4551,
2281,
429,
2186,
628,
326,
4592,
666,
26418,
1194,
18,
4148,
2668,
6144,
310,
358,
20304,
783,
1476,
434,
1562,
666,
10... |
path = os.path.join(self.library_path, self.path(id, index_is_id=True), 'cover.jpg') | try: path = os.path.join(self.abspath(id, index_is_id=True), 'cover.jpg') except: return False | def has_cover(self, index, index_is_id=False): id = index if index_is_id else self.id(index) path = os.path.join(self.library_path, self.path(id, index_is_id=True), 'cover.jpg') return os.access(path, os.R_OK) | c006e2e14bebef07898a934bdb6225ea14b6280f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/c006e2e14bebef07898a934bdb6225ea14b6280f/database2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
711,
67,
3165,
12,
2890,
16,
770,
16,
770,
67,
291,
67,
350,
33,
8381,
4672,
612,
273,
770,
309,
770,
67,
291,
67,
350,
469,
365,
18,
350,
12,
1615,
13,
775,
30,
589,
273,
1140,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
711,
67,
3165,
12,
2890,
16,
770,
16,
770,
67,
291,
67,
350,
33,
8381,
4672,
612,
273,
770,
309,
770,
67,
291,
67,
350,
469,
365,
18,
350,
12,
1615,
13,
775,
30,
589,
273,
1140,
... |
elif self.type == self.REMOVE: self.container.execute("ipkg list_installed enigma2-plugin-*") | def runFinished(self, retval): if self.run == 0: self.run = 1 if self.type == self.DOWNLOAD: self.container.execute("ipkg list enigma2-plugin-*") elif self.type == self.REMOVE: self.container.execute("ipkg list_installed enigma2-plugin-*") else: if len(self.pluginlist) > 0: self.updateList() self["list"].instance.show() else: self["text"].setText("No plugins found") | f76e89cb7e3e742bf9da52f259d4494a67733487 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/f76e89cb7e3e742bf9da52f259d4494a67733487/PluginBrowser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
10577,
12,
2890,
16,
5221,
4672,
309,
365,
18,
2681,
422,
374,
30,
365,
18,
2681,
273,
404,
309,
365,
18,
723,
422,
365,
18,
12711,
7783,
30,
365,
18,
3782,
18,
8837,
2932,
625... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10577,
12,
2890,
16,
5221,
4672,
309,
365,
18,
2681,
422,
374,
30,
365,
18,
2681,
273,
404,
309,
365,
18,
723,
422,
365,
18,
12711,
7783,
30,
365,
18,
3782,
18,
8837,
2932,
625... | |
def isContainedIn(self, itemId): | def isContainedIn(self, itemId, trans=None): | def isContainedIn(self, itemId): """ Checks if the item is contained in the specified container. @param itemId: The id of the container @type itemId: str @rtype: bool """ oItem = self while oItem._id is not '': if oItem._id==itemId: return True oItem = db.getItem(oItem.parentid) return False | 05f44890d37196c044d663689f53fb7b05a0c0e4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2504/05f44890d37196c044d663689f53fb7b05a0c0e4/systemObjects.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
660,
8707,
382,
12,
2890,
16,
18424,
16,
906,
33,
7036,
4672,
3536,
13074,
309,
326,
761,
353,
7542,
316,
326,
1269,
1478,
18,
225,
632,
891,
18424,
30,
1021,
612,
434,
326,
1478,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
660,
8707,
382,
12,
2890,
16,
18424,
16,
906,
33,
7036,
4672,
3536,
13074,
309,
326,
761,
353,
7542,
316,
326,
1269,
1478,
18,
225,
632,
891,
18424,
30,
1021,
612,
434,
326,
1478,... |
if self.options.pause and not bKnown: | if self.options.pause: | def __action(self, crash): | 83fa4706732ac3c486059710e8ef2a07eb6e4466 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7261/83fa4706732ac3c486059710e8ef2a07eb6e4466/crash_logger.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1128,
12,
2890,
16,
17053,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1128,
12,
2890,
16,
17053,
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,
-1... |
_completion_function = function | global _completer_function _completer_function = function | def set_completer(function=None): """set_completer([function]) -> None Set or remove the completer function. The function is called as function(text, state), for state in 0, 1, 2, ..., until it returns a non-string. It should return the next possible completion starting with 'text'.""" _completion_function = function def complete_handler(buffer, cursor, candidates): for state in xrange(100): # TODO arbitrary, what's the number used by gnu readline? completion = None try: completion = function(buffer[:cursor], state) except: pass if completion: candidates.add(completion) else: break return 0 reader.addCompletor(complete_handler) | 24d3df536f1a55ecda3dd9e7f94f30c1a507dddb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6753/24d3df536f1a55ecda3dd9e7f94f30c1a507dddb/readline.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
832,
17754,
12,
915,
33,
7036,
4672,
3536,
542,
67,
832,
17754,
3816,
915,
5717,
317,
599,
1000,
578,
1206,
326,
31848,
445,
18,
1021,
445,
353,
2566,
487,
445,
12,
955,
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,
444,
67,
832,
17754,
12,
915,
33,
7036,
4672,
3536,
542,
67,
832,
17754,
3816,
915,
5717,
317,
599,
1000,
578,
1206,
326,
31848,
445,
18,
1021,
445,
353,
2566,
487,
445,
12,
955,
16,
... |
print "path: " + lpath | def add_books_to_metadata(self, locations, metadata, booklists): metadata = iter(metadata) for i, location in enumerate(locations): self.report_progress((i+1) / float(len(locations)), _('Adding books to device metadata listing...')) info = metadata.next() blist = 2 if location[1] == 'cardb' else 1 if location[1] == 'carda' else 0 | 7044e5811681064b7453106ce09747af1c5aa0e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/7044e5811681064b7453106ce09747af1c5aa0e8/driver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
12567,
67,
869,
67,
4165,
12,
2890,
16,
7838,
16,
1982,
16,
6978,
9772,
4672,
1982,
273,
1400,
12,
4165,
13,
364,
277,
16,
2117,
316,
4241,
12,
12352,
4672,
365,
18,
6006,
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,
527,
67,
12567,
67,
869,
67,
4165,
12,
2890,
16,
7838,
16,
1982,
16,
6978,
9772,
4672,
1982,
273,
1400,
12,
4165,
13,
364,
277,
16,
2117,
316,
4241,
12,
12352,
4672,
365,
18,
6006,
6... | |
newPage=False, token=None, newToken=False, sysop=False): | newPage=False, token=None, newToken=False, sysop=False, deleted=True): | def _putPage(self, text, comment=None, watchArticle=False, minorEdit=True, newPage=False, token=None, newToken=False, sysop=False): """Upload 'text' as new content of Page by filling out the edit form. | e209aca4a97685700a9613125cf0216fca9e1b79 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/e209aca4a97685700a9613125cf0216fca9e1b79/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
458,
1964,
12,
2890,
16,
977,
16,
2879,
33,
7036,
16,
4267,
7880,
33,
8381,
16,
8439,
4666,
33,
5510,
16,
394,
1964,
33,
8381,
16,
1147,
33,
7036,
16,
394,
1345,
33,
8381,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
458,
1964,
12,
2890,
16,
977,
16,
2879,
33,
7036,
16,
4267,
7880,
33,
8381,
16,
8439,
4666,
33,
5510,
16,
394,
1964,
33,
8381,
16,
1147,
33,
7036,
16,
394,
1345,
33,
8381,
16,
... |
pass | network = XendAPIStore.get(self.network, "network") bridge_name = network.get_name_label() from xen.util import Brctl Brctl.vif_bridge_rem({ "bridge": bridge_name, "vif": self.get_interface_name() }) def destroy(self): if self.get_interface_name() == \ self.get_device(): raise PIFIsPhysical(self.get_uuid()) self.unplug() if _destroy_VLAN(self.get_device(), self.get_VLAN()): XendBase.destroy(self) import XendNode XendNode.instance().save_PIFs() else: raise NetworkError("Unable to delete VLAN", self.get_uuid()) | def unplug(self): """Unplug the PIF from the network""" pass | eb0fc8bcf6319cfbe13303e0b77cc5d4e12e5232 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6195/eb0fc8bcf6319cfbe13303e0b77cc5d4e12e5232/XendPIF.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
640,
22045,
12,
2890,
4672,
3536,
984,
22045,
326,
453,
5501,
628,
326,
2483,
8395,
1342,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
640,
22045,
12,
2890,
4672,
3536,
984,
22045,
326,
453,
5501,
628,
326,
2483,
8395,
1342,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
if _o is None: | if _o is None or _o == 'NULL': | def GetOverview(self, ov_index ): _o = _gdal.GDALGetOverview( self._o, ov_index ) if _o is None: return None else: return Band( _obj = _o ) | 13acf88a0abb83d2ea2d7f24356ae1f003ca5bde /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10289/13acf88a0abb83d2ea2d7f24356ae1f003ca5bde/gdal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
26648,
12,
2890,
16,
23094,
67,
1615,
262,
30,
389,
83,
273,
389,
19016,
287,
18,
27338,
1013,
967,
26648,
12,
365,
6315,
83,
16,
23094,
67,
1615,
262,
309,
389,
83,
353,
599,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
26648,
12,
2890,
16,
23094,
67,
1615,
262,
30,
389,
83,
273,
389,
19016,
287,
18,
27338,
1013,
967,
26648,
12,
365,
6315,
83,
16,
23094,
67,
1615,
262,
309,
389,
83,
353,
599,
5... |
norm_factor = 100 / (sum(times) - sum(_last_cpu_times)) | idle_percent = (cpu_times_delta / total_time_delta) * 100.0 percent = (100 * NUM_CPUS) - idle_percent | def cpu_percent(): """Return CPU utilization times (user, kernel, idle) as a percentage calculated from the last call to the function. """ global _last_cpu_times times = cpu_times() times_len=len(times) try : # normalization factor = 100/(amount of time between calls) norm_factor = 100 / (sum(times) - sum(_last_cpu_times)) except ZeroDivisionError: percentages = [ 0 for i in range(times_len)] else : deltas = [m - n for m, n in zip(times, _last_cpu_times)] percentages = tuple([x * norm_factor for x in deltas]) _last_cpu_times = times return percentages | 834bf57288ea1ea7e68cf554bfff97b112179cc4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7296/834bf57288ea1ea7e68cf554bfff97b112179cc4/_psutil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8326,
67,
8849,
13332,
3536,
990,
12154,
1709,
1588,
4124,
261,
1355,
16,
5536,
16,
12088,
13,
487,
279,
11622,
8894,
628,
326,
1142,
745,
358,
326,
445,
18,
3536,
2552,
389,
2722,
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,
8326,
67,
8849,
13332,
3536,
990,
12154,
1709,
1588,
4124,
261,
1355,
16,
5536,
16,
12088,
13,
487,
279,
11622,
8894,
628,
326,
1142,
745,
358,
326,
445,
18,
3536,
2552,
389,
2722,
67,
... |
a = t.annotate([]) a.simplify() | t.annotate([]) | def demo(): # Teach network XOR function pat = [ [[0,0], [0]], [[0,1], [1]], [[1,0], [1]], [[1,1], [0]] ] # create a network with two input, two hidden, and two output nodes n = NN(2, 3, 1) # train it with some patterns n.train(pat, 2000) # test it n.test(pat) | ed02c36023b464c29743382b96a179109e1976ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/ed02c36023b464c29743382b96a179109e1976ba/bpnn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21477,
13332,
468,
399,
13798,
2483,
28086,
445,
9670,
273,
306,
12167,
20,
16,
20,
6487,
306,
20,
65,
6487,
12167,
20,
16,
21,
6487,
306,
21,
65,
6487,
12167,
21,
16,
20,
6487,
306,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21477,
13332,
468,
399,
13798,
2483,
28086,
445,
9670,
273,
306,
12167,
20,
16,
20,
6487,
306,
20,
65,
6487,
12167,
20,
16,
21,
6487,
306,
21,
65,
6487,
12167,
21,
16,
20,
6487,
306,
... |
return cache.get(CACHE_REVISION_KEY) | return cache.get(cls.CACHE_REVISION_KEY) | def get_cache_revision(cls): a = cache.get(cls.CACHE_REVISION_KEY) if a: return a else: cls.reset_cache_revision() return cache.get(CACHE_REVISION_KEY) | 779cc9f5a4539b69ff3c5c6e815088c43eb3cf1e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12041/779cc9f5a4539b69ff3c5c6e815088c43eb3cf1e/models.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2493,
67,
13057,
12,
6429,
4672,
279,
273,
1247,
18,
588,
12,
6429,
18,
8495,
67,
862,
25216,
67,
3297,
13,
309,
279,
30,
327,
279,
469,
30,
2028,
18,
6208,
67,
2493,
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,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2493,
67,
13057,
12,
6429,
4672,
279,
273,
1247,
18,
588,
12,
6429,
18,
8495,
67,
862,
25216,
67,
3297,
13,
309,
279,
30,
327,
279,
469,
30,
2028,
18,
6208,
67,
2493,
67,
... |
self.ImportSettings('Mozilla Firefox', False, ['ALL']) | self.ImportSettings('Mozilla Firefox', False, self._to_import) | def testImportFirefoxDataTwice(self): """Verify importing Firefox data twice. | 98d75b89680c12c09bb081ebf1cdbbeed7c61eb6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/98d75b89680c12c09bb081ebf1cdbbeed7c61eb6/imports.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
5010,
9723,
13873,
751,
23539,
1812,
12,
2890,
4672,
3536,
8097,
25077,
22950,
501,
13605,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
5010,
9723,
13873,
751,
23539,
1812,
12,
2890,
4672,
3536,
8097,
25077,
22950,
501,
13605,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.