rem stringlengths 1 226k | add stringlengths 0 227k | context stringlengths 6 326k | meta stringlengths 143 403 | input_ids listlengths 256 256 | attention_mask listlengths 256 256 | labels listlengths 128 128 |
|---|---|---|---|---|---|---|
segments = d['title_text'].split('/') | segments = d['page_name'].split('/') | def title(self, d): """ Assemble the title (now using breadcrumbs) @param d: parameter dictionary @rtype: string @return: title html """ _ = self.request.getText content = [] if d['title_link']: curpage = '' segments = d['title_text'].split('/') for s in segments[:-1]: curpage += s content.append("<li>%s</li>" % Page(self.request, curpage).link_to(self.request, s)) curpage += '/' content.append(('<li><a class="backlink" title="%(title)s" href="%(href)s">%(text)s</a></li>') % { 'title': _('Click to do a full-text search for this title'), 'href': d['title_link'], 'text': wikiutil.escape(segments[-1]), }) else: content.append('<li>%s</li>' % wikiutil.escape(d['title_text'])) | 024de7714043ca98759b1e96c303c3c3e1b07f6d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/888/024de7714043ca98759b1e96c303c3c3e1b07f6d/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2077,
12,
2890,
16,
302,
4672,
3536,
2970,
10045,
326,
2077,
261,
3338,
1450,
18414,
13,
225,
632,
891,
302,
30,
1569,
3880,
632,
86,
723,
30,
533,
632,
2463,
30,
2077,
1729,
3536,
389... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2077,
12,
2890,
16,
302,
4672,
3536,
2970,
10045,
326,
2077,
261,
3338,
1450,
18414,
13,
225,
632,
891,
302,
30,
1569,
3880,
632,
86,
723,
30,
533,
632,
2463,
30,
2077,
1729,
3536,
389... |
Reteurn default element if key is not in the dict, of if the self[key] evaluates to False. | Return default element if key is not in the dict, or if self[key] evaluates to False. | def get_true (self, key, default): """ Reteurn default element if key is not in the dict, of if the self[key] evaluates to False. """ if key not in self or not self[key]: return default return self[key] | d2ced755673169360a9d6533c7ed2b9724816363 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/d2ced755673169360a9d6533c7ed2b9724816363/containers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3767,
261,
2890,
16,
498,
16,
805,
4672,
3536,
2000,
805,
930,
309,
498,
353,
486,
316,
326,
2065,
16,
578,
309,
365,
63,
856,
65,
20996,
358,
1083,
18,
3536,
309,
498,
486,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3767,
261,
2890,
16,
498,
16,
805,
4672,
3536,
2000,
805,
930,
309,
498,
353,
486,
316,
326,
2065,
16,
578,
309,
365,
63,
856,
65,
20996,
358,
1083,
18,
3536,
309,
498,
486,... |
utils.system('PATH=%s/bin:%s/bin:$PATH make check' % | utils.system('PATH=%s/bin:%s/bin:$PATH make installcheck' % | def run_once(self): testsuite = os.path.join(self.srcdir, 'testsuite') os.chdir(testsuite) | b55e940ad19d7b65d112e2c518989095e1cb4408 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12268/b55e940ad19d7b65d112e2c518989095e1cb4408/systemtap.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
8243,
12,
2890,
4672,
7434,
9519,
273,
1140,
18,
803,
18,
5701,
12,
2890,
18,
4816,
1214,
16,
296,
16341,
9519,
6134,
1140,
18,
343,
1214,
12,
16341,
9519,
13,
2,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
8243,
12,
2890,
4672,
7434,
9519,
273,
1140,
18,
803,
18,
5701,
12,
2890,
18,
4816,
1214,
16,
296,
16341,
9519,
6134,
1140,
18,
343,
1214,
12,
16341,
9519,
13,
2,
-100,
-100,... |
return redirect(url_for('admin_venueform', key=key), code=303) | return redirect(url_for('admin_venue', edition=edition), code=303) | def admin_venue(edition): if request.method == 'GET': if 'email' in request.args: return admin_venue(key, 'venueregemail', request.args['email']) else: return render_template('venuereg.html', key=key) elif request.method =='POST': formid = request.form.get('form.id', formid) if formid == 'venueregemail': email = request.form.get('email', email) if email: p = Participant.query.filter_by(email=email).first() if p is not None: if p.attended: # Already signed in flash("You have already signed in. Next person please.") return redirect(url_for('admin_venue', key=key), code=303) else: return render_template('venueregdetails.html', key=key, p=p) # Unknown email address. Ask for new registration regform = RegisterForm() regform.email.data = email return render_template('venueregnew.html', key=key, regform=regform) elif formid == 'venueregconfirm': id = request.form['id'] subscribe = request.form.get('subscribe') p = Participant.query.get(id) if subscribe: p.subscribe = True else: p.subscribe = False p.attended = True p.attenddate = datetime.utcnow() db.session.commit() flash("You have been signed in. Next person please.", 'info') return redirect(url_for('admin_venueform', key=key), code=303) elif formid == 'venueregform': # Validate form and register regform = RegisterForm() if regform.validate_on_submit(): participant = Participant() regform.populate_obj(participant) participant.ipaddr = request.environ['REMOTE_ADDR'] # TODO: Make user and add to mailchimp db.session.add(participant) db.session.commit() return render_template('venueregsuccess.html', key=key, p=participant) else: return render_template('venueregform.html', key=key, regform=regform, ajax_re_register=True) else: flash("Unknown form submission", 'error') return redirect(url_for('admin_venue', key=key), code=303) | c39abb5ad830344c728adba73719fbcab48a649a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12083/c39abb5ad830344c728adba73719fbcab48a649a/website.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3981,
67,
24612,
12,
329,
608,
4672,
309,
590,
18,
2039,
422,
296,
3264,
4278,
309,
296,
3652,
11,
316,
590,
18,
1968,
30,
327,
3981,
67,
24612,
12,
856,
16,
296,
90,
2104,
11877,
36... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3981,
67,
24612,
12,
329,
608,
4672,
309,
590,
18,
2039,
422,
296,
3264,
4278,
309,
296,
3652,
11,
316,
590,
18,
1968,
30,
327,
3981,
67,
24612,
12,
856,
16,
296,
90,
2104,
11877,
36... |
<article><front><journal-meta><journal-title>J. High Energy Phys.</journal-title><abbrev-journal-title>J. High Energy Phys.</abbrev-journal-title><issn>1126-6708</issn></journal-meta><article-meta><title-group><article-title>AdS/CFT For Non-Boundary Manifolds</article-title></title-group><contrib-group><contrib contrib-type="author"><name><surname>McInnes</surname><given-names>B</given-names></name></contrib></contrib-group><pub-date pub-type="pub"><year>2000</year></pub-date><volume>05</volume><fpage></fpage><lpage></lpage><self-uri xlink:href="http://pcdh23.cern.ch/record/70" xmlns:xlink="http://www.w3.org/1999/xlink/"/><self-uri xlink:href="http://documents.cern.ch/cgi-bin/setlink?base=preprint&categ=hep-th&id=0003291" xmlns:xlink="http://www.w3.org/1999/xlink/" /></article-meta><abstract>In its Euclidean formulation, the AdS/CFT correspondence begins as a study of Yang-Mills conformal field theories on the sphere, S^4. It has been successfully extended, however, to S^1 X S^3 and to the torus T^4. It is natural tohope that it can be made to work for any manifold on which it is possible to define a stable Yang-Mills conformal field theory. We consider a possible classification of such manifolds, and show how to deal with the most obviousobjection : the existence of manifolds which cannot be represented as boundaries. We confirm Witten's suggestion that this can be done with the help of a brane in the bulk.</abstract></front><article-type>research-article</article-type><ref></ref></article> </articles>''' | <article><front><journal-meta><journal-title>J. High Energy Phys.</journal-title><abbrev-journal-title>J. High Energy Phys.</abbrev-journal-title><issn>1126-6708</issn></journal-meta><article-meta><title-group><article-title>AdS/CFT For Non-Boundary Manifolds</article-title></title-group><contrib-group><contrib contrib-type="author"><name><surname>McInnes</surname><given-names>B</given-names></name></contrib></contrib-group><pub-date pub-type="pub"><year>2000</year></pub-date><volume>05</volume><fpage></fpage><lpage></lpage><self-uri xlink:href="%s/record/70" xmlns:xlink="http://www.w3.org/1999/xlink/"/><self-uri xlink:href="http://documents.cern.ch/cgi-bin/setlink?base=preprint&categ=hep-th&id=0003291" xmlns:xlink="http://www.w3.org/1999/xlink/" /></article-meta><abstract>In its Euclidean formulation, the AdS/CFT correspondence begins as a study of Yang-Mills conformal field theories on the sphere, S^4. It has been successfully extended, however, to S^1 X S^3 and to the torus T^4. It is natural tohope that it can be made to work for any manifold on which it is possible to define a stable Yang-Mills conformal field theory. We consider a possible classification of such manifolds, and show how to deal with the most obviousobjection : the existence of manifolds which cannot be represented as boundaries. We confirm Witten's suggestion that this can be done with the help of a brane in the bulk.</abstract></front><article-type>research-article</article-type><ref></ref></article> </articles>''' % weburl | def setUp(self): """Prepare some ideal outputs""" self.record_70_xn = '''<?xml version="1.0" encoding="UTF-8"?> | ae32bb9a7da93f0d2fbe65b2536139b29c85d54b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12027/ae32bb9a7da93f0d2fbe65b2536139b29c85d54b/bibformat_regression_tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
12,
2890,
4672,
3536,
7543,
2690,
23349,
6729,
8395,
365,
18,
3366,
67,
7301,
67,
22695,
273,
9163,
12880,
2902,
1177,
1546,
21,
18,
20,
6,
2688,
1546,
5159,
17,
28,
6,
35,
34,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
24292,
12,
2890,
4672,
3536,
7543,
2690,
23349,
6729,
8395,
365,
18,
3366,
67,
7301,
67,
22695,
273,
9163,
12880,
2902,
1177,
1546,
21,
18,
20,
6,
2688,
1546,
5159,
17,
28,
6,
35,
34,
... |
'state' : lambda *a: 'plain', | 'type' : lambda *a: 'plain', | def _get_child_ids( self, cr, uid, ids, name, args, context ): res = {} for object in self.browse(cr, uid, ids): child_ids = self.pool.get('account.analytic.account').search(cr, uid, [('parent_id', '=', object.analytic_account_id.id)]) res[object.id] = self.search(cr, uid, [('analytic_account_id', 'in', child_ids)]) return res | 288403f6cd184a90c1836577014d814ed770358d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7339/288403f6cd184a90c1836577014d814ed770358d/training.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
3624,
67,
2232,
12,
365,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
833,
16,
819,
262,
30,
400,
273,
2618,
364,
733,
316,
365,
18,
25731,
12,
3353,
16,
4555,
16,
3258... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
3624,
67,
2232,
12,
365,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
833,
16,
819,
262,
30,
400,
273,
2618,
364,
733,
316,
365,
18,
25731,
12,
3353,
16,
4555,
16,
3258... |
SkuInfo.SkuId = Item | SkuInfo.SkuId = pb.SkuIds[Item] | def __init__(self, ActivePlatform = None): self.Workspace = EdkIIWorkspace() self.PrintRunTime = True self.PlatformBuild = True self.TargetTxt = TargetTxtClassObject() self.ToolDef = ToolDefClassObject() | fc77633ac7352c7ba54264b9a26231e88c5fecc5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/914/fc77633ac7352c7ba54264b9a26231e88c5fecc5/EdkIIWorkspaceBuild.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
8857,
8201,
273,
599,
4672,
365,
18,
8241,
9079,
273,
512,
2883,
6954,
8241,
1435,
365,
18,
5108,
1997,
950,
5411,
273,
1053,
365,
18,
8201,
3116,
6647,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8857,
8201,
273,
599,
4672,
365,
18,
8241,
9079,
273,
512,
2883,
6954,
8241,
1435,
365,
18,
5108,
1997,
950,
5411,
273,
1053,
365,
18,
8201,
3116,
6647,
... |
if n < 2: return integer_ring.ZZ(2) if n == 2: return integer_ring.ZZ(3) if not proof: return integer_ring.ZZ((eval(str(pari(n+1).nextprime())))) if n % 2 == 0: n += 1 else: n += 2 while not is_prime(n): n += 2 return integer_ring.ZZ(n) | return n.next_prime(proof=proof) | def next_prime(n, proof=True): """ The next prime greater than the integer n. If n is prime, then this function does not return n, but the next prime after n. If the optional argument proof is False (the default), this function only returns a pseudo-prime, as defined by the PARI nextprime function. INPUT: n -- integer proof -- bool (default: True) EXAMPLES: sage: next_prime(-100) 2 sage: next_prime(1) 2 sage: next_prime(2) 3 sage: next_prime(3) 5 sage: next_prime(4) 5 Notice that the next_prime(5) is not 5 but 7. sage: next_prime(5) 7 sage: next_prime(2004) 2011 """ n = integer_ring.ZZ(n) if n < 2: # negatives are not prime. return integer_ring.ZZ(2) if n == 2: return integer_ring.ZZ(3) if not proof: # pari nextprime is probabilistic (according to their docs) return integer_ring.ZZ((eval(str(pari(n+1).nextprime())))) if n % 2 == 0: n += 1 else: n += 2 while not is_prime(n): # pari isprime is provably correct n += 2 return integer_ring.ZZ(n) | 8573e698101217dcc364ea9d47dd6cdb9a810c8b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/8573e698101217dcc364ea9d47dd6cdb9a810c8b/arith.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1024,
67,
16382,
12,
82,
16,
14601,
33,
5510,
4672,
3536,
1021,
1024,
17014,
6802,
2353,
326,
3571,
290,
18,
225,
971,
290,
353,
17014,
16,
1508,
333,
445,
1552,
486,
327,
290,
16,
149... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1024,
67,
16382,
12,
82,
16,
14601,
33,
5510,
4672,
3536,
1021,
1024,
17014,
6802,
2353,
326,
3571,
290,
18,
225,
971,
290,
353,
17014,
16,
1508,
333,
445,
1552,
486,
327,
290,
16,
149... |
print 'Adding BZERO = 32768 card' hdr.update('BZERO', 32768, 'Unsigned -> signed') | def fix_sdss_idr(hdu): hdr = hdu.header.copy() if hdr.get('SIMPLE', True): print 'SIMPLE = T: not an SDSS idR file.' return hdu print 'Setting SIMPLE = True' hdr.update('SIMPLE', True, 'FITS compliant (via fix-sdss-idr.py)') if hdr.get('SDSS', None) == pyfits.UNDEFINED: print 'Setting SDSS = True' hdr['SDSS'] = True else: print 'No SDSS header card: not an SDSS idR file.' return hdu if (hdr.get('UNSIGNED', None) == pyfits.UNDEFINED and (not 'BSCALE' in hdr) and (not 'BZERO' in hdr)): print 'Setting UNSIGNED = True' hdr['UNSIGNED'] = True print 'Adding BZERO = 32768 card' hdr.update('BZERO', 32768, 'Unsigned -> signed') else: print 'No UNSIGNED header card, or unexpected BSCALE or BZERO card: not an SDSS idR file.' return hdu hdr._updateHDUtype() newhdu = hdr._hdutype(data=pyfits.DELAYED, header=hdr) #print 'newhdu:', newhdu ## HACK - encapsulation violation newhdu._file = hdu._file newhdu._ffile = hdu._ffile newhdu._datLoc = hdu._datLoc newhdu.__getattr__('data') #print 'data:', type(newhdu.data) #print 'data:', newhdu.data.dtype print 'data range:', newhdu.data.min(), 'to', newhdu.data.max() return newhdu #newhdu2 = pyfits.PrimaryHDU(data=pyfits.DELAYED, header=hdr) #newhdu2 = newhdu2.setupHDU() #print 'newhdu2:', newhdu2 #print 'data:', type(newhdu2.data) #print 'data:', newhdu2.data.dtype #print 'data range:', newhdu2.data.min(), 'to', newhdu2.data.max() | 612d70799769e0dec5e6e73b41b9c4f89de46476 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7059/612d70799769e0dec5e6e73b41b9c4f89de46476/fix-sdss-idr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
67,
6427,
1049,
67,
350,
86,
12,
76,
2544,
4672,
7723,
273,
22320,
18,
3374,
18,
3530,
1435,
225,
309,
7723,
18,
588,
2668,
31669,
900,
2187,
1053,
4672,
1172,
296,
31669,
900,
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,
2917,
67,
6427,
1049,
67,
350,
86,
12,
76,
2544,
4672,
7723,
273,
22320,
18,
3374,
18,
3530,
1435,
225,
309,
7723,
18,
588,
2668,
31669,
900,
2187,
1053,
4672,
1172,
296,
31669,
900,
2... | |
"""SMTP 'DATA' command. Sends message data to server. | """SMTP 'DATA' command -- sends message data to server. | def data(self,msg): """SMTP 'DATA' command. Sends message data to server. Automatically quotes lines beginning with a period per rfc821. """ self.putcmd("data") (code,repl)=self.getreply() if self.debuglevel >0 : print "data:", (code,repl) if code <> 354: return -1 else: self.send(quotedata(msg)) self.send("%s.%s" % (CRLF, CRLF)) (code,msg)=self.getreply() if self.debuglevel >0 : print "data:", (code,msg) return code | de1c0a3c6cefc0960617175f1a9491221d9defa6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/de1c0a3c6cefc0960617175f1a9491221d9defa6/smtplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
501,
12,
2890,
16,
3576,
4672,
3536,
55,
14636,
296,
4883,
11,
1296,
1493,
9573,
883,
501,
358,
1438,
18,
11809,
20271,
10681,
2362,
8435,
598,
279,
3879,
1534,
16590,
28,
5340,
18,
3536... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
501,
12,
2890,
16,
3576,
4672,
3536,
55,
14636,
296,
4883,
11,
1296,
1493,
9573,
883,
501,
358,
1438,
18,
11809,
20271,
10681,
2362,
8435,
598,
279,
3879,
1534,
16590,
28,
5340,
18,
3536... |
raise RunTimeError('SVM Library not found. Cannot use this classifier.') | raise RuntimeError('SVM Library not found. Cannot use this classifier.') | def __init__(self): classifier.__init__(self) if _svm is None: raise RunTimeError('SVM Library not found. Cannot use this classifier.') self.param = _svm.svm_parameter(kernel_type = svm.RBF) | be85a656ab13c4bbe0c0fc7fd36a154513944e06 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12199/be85a656ab13c4bbe0c0fc7fd36a154513944e06/libsvmclassifier.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
14622,
16186,
2738,
972,
12,
2890,
13,
309,
389,
87,
3489,
353,
599,
30,
1002,
7265,
2668,
55,
7397,
18694,
486,
1392,
18,
14143,
999,
333,
14622,
1093,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4672,
14622,
16186,
2738,
972,
12,
2890,
13,
309,
389,
87,
3489,
353,
599,
30,
1002,
7265,
2668,
55,
7397,
18694,
486,
1392,
18,
14143,
999,
333,
14622,
1093,
... |
r = (24 - currentHour) * 60 * 60 r = r + (59 - currentMinute) * 60 r = r + (59 - currentSecond) | if (currentMinute == 0) and (currentSecond == 0): r = (24 - currentHour) * 60 * 60 else: r = (23 - currentHour) * 60 * 60 r = r + (59 - currentMinute) * 60 r = r + (60 - currentSecond) | def __init__(self, filename, when='h', interval=1, backupCount=0, encoding=None): BaseRotatingHandler.__init__(self, filename, 'a', encoding) self.when = string.upper(when) self.backupCount = backupCount # Calculate the real rollover interval, which is just the number of # seconds between rollovers. Also set the filename suffix used when # a rollover occurs. Current 'when' events supported: # S - Seconds # M - Minutes # H - Hours # D - Days # midnight - roll over at midnight # W{0-6} - roll over on a certain day; 0 - Monday # # Case of the 'when' specifier is not important; lower or upper case # will work. currentTime = int(time.time()) if self.when == 'S': self.interval = 1 # one second self.suffix = "%Y-%m-%d_%H-%M-%S" elif self.when == 'M': self.interval = 60 # one minute self.suffix = "%Y-%m-%d_%H-%M" elif self.when == 'H': self.interval = 60 * 60 # one hour self.suffix = "%Y-%m-%d_%H" elif self.when == 'D' or self.when == 'MIDNIGHT': self.interval = 60 * 60 * 24 # one day self.suffix = "%Y-%m-%d" elif self.when.startswith('W'): self.interval = 60 * 60 * 24 * 7 # one week if len(self.when) != 2: raise ValueError("You must specify a day for weekly rollover from 0 to 6 (0 is Monday): %s" % self.when) if self.when[1] < '0' or self.when[1] > '6': raise ValueError("Invalid day specified for weekly rollover: %s" % self.when) self.dayOfWeek = int(self.when[1]) self.suffix = "%Y-%m-%d" else: raise ValueError("Invalid rollover interval specified: %s" % self.when) | c86d20db46f07653e16d0dcd36daff71e00a6760 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/c86d20db46f07653e16d0dcd36daff71e00a6760/handlers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1544,
16,
1347,
2218,
76,
2187,
3673,
33,
21,
16,
5114,
1380,
33,
20,
16,
2688,
33,
7036,
4672,
3360,
8570,
1776,
1503,
16186,
2738,
972,
12,
2890,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1544,
16,
1347,
2218,
76,
2187,
3673,
33,
21,
16,
5114,
1380,
33,
20,
16,
2688,
33,
7036,
4672,
3360,
8570,
1776,
1503,
16186,
2738,
972,
12,
2890,
16,
... |
'How big the point is.' | 'How big the point is (i.e., area in points^2=(1/72 inch)^2).' | def _allowed_options(self): """ Return the allowed options for the Point class. | 8f9c28d814253042e193c64fe9c63ee15b32aacb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8f9c28d814253042e193c64fe9c63ee15b32aacb/point.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8151,
67,
2116,
12,
2890,
4672,
3536,
2000,
326,
2935,
702,
364,
326,
4686,
667,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8151,
67,
2116,
12,
2890,
4672,
3536,
2000,
326,
2935,
702,
364,
326,
4686,
667,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
el1 = SubElement(self.current_element, 'text:p', attrib={'text:style-name': 'rststyle-textbody'}) | if self.in_paragraph: el1 = self.current_element else: el1 = SubElement(self.current_element, 'text:p', attrib={'text:style-name': 'rststyle-textbody'}) | def visit_image(self, node): #ipshell('At visit_image') #self.trace_visit_node(node) # Capture the image file. if 'uri' in node.attributes: source = node.attributes['uri'] if not self.check_file_exists(source): print 'Error: Cannot find image file %s.' % (source, ) return else: return filename = os.path.split(source)[1] destination = 'Pictures/1%08x%s' % (self.image_count, filename, ) spec = (source, destination,) self.embedded_file_list.append(spec) # Is this a figure (containing an image) or just a plain image? if isinstance(node.parent, docutils.nodes.figure): self.generate_figure(node, source, destination) else: el1 = SubElement(self.current_element, 'text:p', attrib={'text:style-name': 'rststyle-textbody'}) self.generate_image(node, source, destination, el1) | 4ac345a59065bf2bb58eb94e0d529c1f65d3a8aa /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1278/4ac345a59065bf2bb58eb94e0d529c1f65d3a8aa/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
2730,
12,
2890,
16,
756,
4672,
468,
625,
10304,
2668,
861,
3757,
67,
2730,
6134,
468,
2890,
18,
5129,
67,
11658,
67,
2159,
12,
2159,
13,
468,
18477,
326,
1316,
585,
18,
309,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
2730,
12,
2890,
16,
756,
4672,
468,
625,
10304,
2668,
861,
3757,
67,
2730,
6134,
468,
2890,
18,
5129,
67,
11658,
67,
2159,
12,
2159,
13,
468,
18477,
326,
1316,
585,
18,
309,
... |
self.mirrorlists.extend('thisrepo.mirrorlist') | self.mirrorlists.append(thisrepo.mirrorlist) | def __init__(self, config, ksparser): pypungi.PungiBase.__init__(self, config) | 3b955cc823559d501bc1b9c7140539a22fc3d03b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8489/3b955cc823559d501bc1b9c7140539a22fc3d03b/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
642,
16,
11654,
4288,
4672,
18951,
318,
10052,
18,
52,
318,
10052,
2171,
16186,
2738,
972,
12,
2890,
16,
642,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
642,
16,
11654,
4288,
4672,
18951,
318,
10052,
18,
52,
318,
10052,
2171,
16186,
2738,
972,
12,
2890,
16,
642,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
testmod(m) | failures, _ = testmod(m) | def _test(): testfiles = [arg for arg in sys.argv[1:] if arg and arg[0] != '-'] if testfiles: for filename in testfiles: if filename.endswith(".py"): # It is a module -- insert its dir into sys.path and try to # import it. If it is part of a package, that possibly won't work # because of package imports. dirname, filename = os.path.split(filename) sys.path.insert(0, dirname) m = __import__(filename[:-3]) del sys.path[0] testmod(m) else: testfile(filename, module_relative=False) else: r = unittest.TextTestRunner() r.run(DocTestSuite()) | 5154a5b79d33bdd03d196a74be86a5a4d60ea66f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/5154a5b79d33bdd03d196a74be86a5a4d60ea66f/doctest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3813,
13332,
1842,
2354,
273,
306,
3175,
364,
1501,
316,
2589,
18,
19485,
63,
21,
26894,
309,
1501,
471,
1501,
63,
20,
65,
480,
2400,
3546,
309,
1842,
2354,
30,
364,
1544,
316,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3813,
13332,
1842,
2354,
273,
306,
3175,
364,
1501,
316,
2589,
18,
19485,
63,
21,
26894,
309,
1501,
471,
1501,
63,
20,
65,
480,
2400,
3546,
309,
1842,
2354,
30,
364,
1544,
316,
18... |
self.record('END FAIL', None, 'reboot', traceback.format_exc()) | err_msg = str(e) + '\n' + traceback.format_exc() self.record('END FAIL', None, 'reboot', err_msg) | def run_reboot(self, reboot_func, get_kernel_func): """\ A specialization of run_group meant specifically for handling a reboot. Includes support for capturing the kernel version after the reboot. | a4f84a3cf51abfc6e256821e36f00a25221c4241 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12268/a4f84a3cf51abfc6e256821e36f00a25221c4241/server_job.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
266,
7137,
12,
2890,
16,
22852,
67,
644,
16,
336,
67,
8111,
67,
644,
4672,
3536,
64,
432,
4582,
1588,
434,
1086,
67,
1655,
20348,
21195,
364,
5057,
279,
22852,
18,
657,
8993,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1086,
67,
266,
7137,
12,
2890,
16,
22852,
67,
644,
16,
336,
67,
8111,
67,
644,
4672,
3536,
64,
432,
4582,
1588,
434,
1086,
67,
1655,
20348,
21195,
364,
5057,
279,
22852,
18,
657,
8993,... |
result = _wrap(DebugProperty(self.code, self.hresult, self.result), axdebug.IID_IDebugProperty) | result = _wrap(DebugProperty(self.code, self.result, None, self.hresult), axdebug.IID_IDebugProperty) | def GetResultAsDebugProperty(self): result = _wrap(DebugProperty(self.code, self.hresult, self.result), axdebug.IID_IDebugProperty) return self.hresult, result | 11987ba923ad498972ab210ac08a30ffbfe1cb28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/992/11987ba923ad498972ab210ac08a30ffbfe1cb28/expressions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
1253,
1463,
2829,
1396,
12,
2890,
4672,
563,
273,
389,
4113,
12,
2829,
1396,
12,
2890,
18,
710,
16,
365,
18,
2088,
16,
599,
16,
365,
18,
76,
2088,
3631,
1740,
4148,
18,
45,
734,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
1253,
1463,
2829,
1396,
12,
2890,
4672,
563,
273,
389,
4113,
12,
2829,
1396,
12,
2890,
18,
710,
16,
365,
18,
2088,
16,
599,
16,
365,
18,
76,
2088,
3631,
1740,
4148,
18,
45,
734,... |
return FiniteField_ext_pariElement(self.__parent, self.__value + right.__value) | return FiniteField_ext_pariElement(self.__parent, self.__value + right.__value, check=False) | def _add_(self, right): return FiniteField_ext_pariElement(self.__parent, self.__value + right.__value) | 99f8f4d261745ac6dc3bdcdaa49d15b9651e62e7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/99f8f4d261745ac6dc3bdcdaa49d15b9651e62e7/finite_field_element.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1289,
67,
12,
2890,
16,
2145,
4672,
327,
9458,
1137,
974,
67,
408,
67,
1065,
77,
1046,
12,
2890,
16186,
2938,
16,
365,
16186,
1132,
397,
2145,
16186,
1132,
16,
866,
33,
8381,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1289,
67,
12,
2890,
16,
2145,
4672,
327,
9458,
1137,
974,
67,
408,
67,
1065,
77,
1046,
12,
2890,
16186,
2938,
16,
365,
16186,
1132,
397,
2145,
16186,
1132,
16,
866,
33,
8381,
13,
... |
outJson, ret = self.ExecuteCommand(self.proxyString + command) | outJson, ret = self.ExecuteCommand(self.proxyString + self.hackEnv + command) | def query(self, obj, service='', objType='node') : """ query status and eventually other scheduler related information """ # jobId for remapping jobIds = {} | 7685e14f94579c474c8c6806a5f8657e23834f1e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8886/7685e14f94579c474c8c6806a5f8657e23834f1e/SchedulerGLite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
843,
12,
2890,
16,
1081,
16,
1156,
2218,
2187,
30078,
2218,
2159,
6134,
294,
3536,
843,
1267,
471,
18011,
1308,
8129,
3746,
1779,
3536,
225,
468,
13845,
364,
21674,
1382,
1719,
2673,
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,
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,
843,
12,
2890,
16,
1081,
16,
1156,
2218,
2187,
30078,
2218,
2159,
6134,
294,
3536,
843,
1267,
471,
18011,
1308,
8129,
3746,
1779,
3536,
225,
468,
13845,
364,
21674,
1382,
1719,
2673,
273,
... |
apkgs = self._at_groupdowngrade(kwargs['pattern']) doing_group_pkgs = True else: apkgs = self.pkgSack.returnPackages(patterns=[kwargs['pattern']], | apkgs = self._at_groupdowngrade(kwargs['pattern']) doing_group_pkgs = True else: apkgs = self.pkgSack.returnPackages(patterns=[kwargs['pattern']], | def downgrade(self, po=None, **kwargs): """ Try to downgrade a package. Works like: % yum shell <<EOL remove abcd install abcd-<old-version> run EOL """ | 73608510136c99d64d53a82d34851986935d56d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5445/73608510136c99d64d53a82d34851986935d56d3/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2588,
3994,
12,
2890,
16,
8275,
33,
7036,
16,
2826,
4333,
4672,
3536,
6161,
358,
2588,
3994,
279,
2181,
18,
4147,
87,
3007,
30,
738,
677,
379,
5972,
2296,
5842,
1206,
225,
1223,
4315,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2588,
3994,
12,
2890,
16,
8275,
33,
7036,
16,
2826,
4333,
4672,
3536,
6161,
358,
2588,
3994,
279,
2181,
18,
4147,
87,
3007,
30,
738,
677,
379,
5972,
2296,
5842,
1206,
225,
1223,
4315,
... |
cmd = '/etc/init.d/%s status | grep started' | cmd = '/sbin/rc-update show default | grep %s' | def VerifyService(self, entry, _): ''' Verify Service status for entry. Assumes we run in the "default" runlevel. ''' # check if init script exists try: os.stat('/etc/init.d/%s' % entry.get('name')) except OSError: self.logger.debug("Init script for service %s does not exist" % entry.get('name')) return False # check is service is enabled cmd = '/etc/init.d/%s status | grep started' rc = self.cmd.run(cmd % entry.get('name'))[0] is_enabled = (rc == 0) | 9eebc33df4cd5034d99f611b333949a2a1b7f04d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/9eebc33df4cd5034d99f611b333949a2a1b7f04d/RcUpdate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8553,
1179,
12,
2890,
16,
1241,
16,
389,
4672,
9163,
8553,
1956,
1267,
364,
1241,
18,
25374,
732,
1086,
316,
326,
315,
1886,
6,
1086,
2815,
18,
9163,
468,
866,
309,
1208,
2728,
1704,
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,
8553,
1179,
12,
2890,
16,
1241,
16,
389,
4672,
9163,
8553,
1956,
1267,
364,
1241,
18,
25374,
732,
1086,
316,
326,
315,
1886,
6,
1086,
2815,
18,
9163,
468,
866,
309,
1208,
2728,
1704,
7... |
>>> t.rundict(d, "rundict_test", m1) | >>> t.rundict(m1.__dict__, "rundict_test", m1) | ... def bar(self): | d0755d8636fa6d67c1e9e5d8fe9d7ff7d40b4bd6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/d0755d8636fa6d67c1e9e5d8fe9d7ff7d40b4bd6/doctest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1372,
565,
1652,
4653,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1372,
565,
1652,
4653,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
self.update_section_numbers(child, number_str, depth+1) cur_index += 1 | self.update_section_numbers(child, numbers, depth) sectnum += 1 | def update_section_numbers(self, node, prefix, depth): cur_index = 1 for child in node: if isinstance(child, nodes.section): number_str = "%s%d." % (prefix, cur_index) title = child[0] child['autonum_origtitle'] = copy_and_filter(self.document, title) child['autonum_prefix'] = prefix if isinstance(title[0], nodes.Text): title[0].data = number_str + " " + title[0].data else: title.insert(0, nodes.Text(number_str + " ")) if depth < self.maxdepth: self.update_section_numbers(child, number_str, depth+1) cur_index += 1 | 285ad520aeee309515b9dc262bcfb313179cfef6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1532/285ad520aeee309515b9dc262bcfb313179cfef6/parts.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
3464,
67,
13851,
12,
2890,
16,
756,
16,
1633,
16,
3598,
4672,
662,
67,
1615,
273,
404,
364,
1151,
316,
756,
30,
309,
1549,
12,
3624,
16,
2199,
18,
3464,
4672,
1300,
67,
701... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
3464,
67,
13851,
12,
2890,
16,
756,
16,
1633,
16,
3598,
4672,
662,
67,
1615,
273,
404,
364,
1151,
316,
756,
30,
309,
1549,
12,
3624,
16,
2199,
18,
3464,
4672,
1300,
67,
701... |
self.session = ISession(self.avatar) | if not self.session: self.session = ISession(self.avatar) | def request_pty_req(self, data): self.session = ISession(self.avatar) term, windowSize, modes = parseRequest_pty_req(data) log.msg('pty request: %s %s' % (term, windowSize)) try: self.session.getPty(term, windowSize, modes) except: log.err() return 0 else: return 1 | 8f9bb85827890ec5867b87b0529099cc6b761207 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8f9bb85827890ec5867b87b0529099cc6b761207/session.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
590,
67,
825,
67,
3658,
12,
2890,
16,
501,
4672,
309,
486,
365,
18,
3184,
30,
365,
18,
3184,
273,
467,
2157,
12,
2890,
18,
19660,
13,
2481,
16,
27064,
16,
12382,
273,
1109,
691,
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,
590,
67,
825,
67,
3658,
12,
2890,
16,
501,
4672,
309,
486,
365,
18,
3184,
30,
365,
18,
3184,
273,
467,
2157,
12,
2890,
18,
19660,
13,
2481,
16,
27064,
16,
12382,
273,
1109,
691,
67,
... |
if self.settings.has_key("portage_overlay"): if type(self.settings["portage_overlay"])==types.StringType: self.settings["portage_overlay"]=[self.settings["portage_overlay"]] | if self.settings.has_key("portage_overlay"): if type(self.settings["portage_overlay"])==types.StringType: self.settings["portage_overlay"]=self.settings["portage_overlay"].split() print "portage_overlay directories are set to: \"" + string.join(self.settings["portage_overlay"])+"\"" | def set_portage_overlay(self): if self.settings.has_key("portage_overlay"): if type(self.settings["portage_overlay"])==types.StringType: self.settings["portage_overlay"]=[self.settings["portage_overlay"]] | 989aa926fc75a6f5cdede4f7e73ceea771898ef3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7327/989aa926fc75a6f5cdede4f7e73ceea771898ef3/generic_stage_target.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
655,
410,
67,
17312,
12,
2890,
4672,
309,
365,
18,
4272,
18,
5332,
67,
856,
2932,
655,
410,
67,
17312,
6,
4672,
309,
618,
12,
2890,
18,
4272,
9614,
655,
410,
67,
17312,
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,
444,
67,
655,
410,
67,
17312,
12,
2890,
4672,
309,
365,
18,
4272,
18,
5332,
67,
856,
2932,
655,
410,
67,
17312,
6,
4672,
309,
618,
12,
2890,
18,
4272,
9614,
655,
410,
67,
17312,
6,
... |
self.write(cr, uid,[result], { 'tax_code_id': tax['base_code_id'], 'tax_amount': tax['base_sign'] * total }) | if tmp_cnt == 0: if tax[base_code]: tmp_cnt += 1 self.write(cr, uid,[result], { 'tax_code_id': tax[base_code], 'tax_amount': tax[base_sign] * abs(total) }) else: data = { 'move_id': vals['move_id'], 'journal_id': vals['journal_id'], 'period_id': vals['period_id'], 'name': vals['name']+' '+tax['name'], 'date': vals['date'], 'partner_id': vals.get('partner_id',False), 'ref': vals.get('ref',False), 'account_tax_id': False, 'tax_code_id': tax[base_code], 'tax_amount': tax[base_sign] * abs(total), 'account_id': vals['account_id'], 'credit': 0.0, 'debit': 0.0, } if data['tax_code_id']: self.create(cr, uid, data, context) | def create(self, cr, uid, vals, context=None, check=True): if not context: context={} account_obj = self.pool.get('account.account') tax_obj=self.pool.get('account.tax') | e35628a21e6d0ebd530e15b8c3e40e19acdcaa85 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7397/e35628a21e6d0ebd530e15b8c3e40e19acdcaa85/account_move_line.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2890,
16,
4422,
16,
4555,
16,
5773,
16,
819,
33,
7036,
16,
866,
33,
5510,
4672,
309,
486,
819,
30,
819,
12938,
2236,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
4631,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2890,
16,
4422,
16,
4555,
16,
5773,
16,
819,
33,
7036,
16,
866,
33,
5510,
4672,
309,
486,
819,
30,
819,
12938,
2236,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
4631,
18,
... |
_exposed_ = ('isSet', 'set', 'clear', 'wait') | _exposed_ = ('is_set', 'set', 'clear', 'wait') | def notify_all(self): return self._callmethod('notify_all') | 21c74cfdfae66549e4251a9939ce1c149687fcf2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/21c74cfdfae66549e4251a9939ce1c149687fcf2/managers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5066,
67,
454,
12,
2890,
4672,
327,
365,
6315,
1991,
2039,
2668,
12336,
67,
454,
6134,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
5066,
67,
454,
12,
2890,
4672,
327,
365,
6315,
1991,
2039,
2668,
12336,
67,
454,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
for chan in chanNums: chanNameSnr = chanStringBase + "_SNRSQ_" + str(chan) try: squareSnr_tuple = Fr.frgetvect(frameFile,chanNameSnr,-1,segLenSec,0) except: break if position == 1: chan -= 1 if position == 0: chan -= 2 chanNameSnr = chanStringBase + "_SNRSQ_" + str(chan) chanNameChisq = chanStringBase + "_CHISQ_" + str(chan) | chanNameSnr = chanStringBase + "_SNRSQ_" + chanNumber chanNameChisq = chanStringBase + "_CHISQ_" + chanNumber | def plotsnrchisq(gpsTime,frameFile,outputPath,inspProcParams,tableFileName,imgFile,page): rsqThreshold = 0; for row in inspProcParams: if row.param == "--channel-name": chanStringBase = row.value ifoName = str(row.value).split(":",1) if row.param == "--segment-length": segLen = eval(row.value) if row.param == "--sample-rate": sampleRate = eval(row.value) if row.param == "--segment-overlap": segOverlap = eval(row.value) if (row.param == "--chisq-delta"): chisqDelta = eval(row.value) if row.param =="--chisq-bins": chisqBins = eval(row.value) if row.param == "--snr-threshold": snrThreshold = eval(row.value) if row.param == "--chisq-threshold": chisqThreshold = eval(row.value) if row.param == "--rsq-veto-threshold": rsqThreshold = eval(row.value) if row.param == "--trig-start-time": trigStart = eval(row.value) if row.param == "--gps-start-time": gpsStart = eval(row.value) if row.param == "--low-frequency-cutoff": flow = eval(row.value) if row.param == "--dynamic-range-exponent": dynRange = eval(row.value) segLenSec = segLen / sampleRate segOverlapSec = segOverlap / sampleRate if (trigStart): trigPosition = int((trigStart - gpsStart - segOverlapSec ) / (segLenSec -segOverlapSec)) else: trigPosition = 0 gpsPosition = int((eval(gpsTime) - gpsStart - segOverlapSec/2. ) / (segLenSec -segOverlapSec)) if (trigPosition < 0): trigPosition = 0 position = gpsPosition - trigPosition chanNumber = str(position) chanNamePSD = chanStringBase + "_PSD" # now, read the data !! # The window width should be an input argument maybe ? duration = 2.0 chanNums = range(16) print chanNums # figure out what the hell is in this file for chan in chanNums: chanNameSnr = chanStringBase + "_SNRSQ_" + str(chan) try: squareSnr_tuple = Fr.frgetvect(frameFile,chanNameSnr,-1,segLenSec,0) except: break if position == 1: chan -= 1 if position == 0: chan -= 2 chanNameSnr = chanStringBase + "_SNRSQ_" + str(chan) chanNameChisq = chanStringBase + "_CHISQ_" + str(chan) squareSnr_tuple = Fr.frgetvect(frameFile,chanNameSnr,-1,segLenSec,0) squareChisq_tuple = Fr.frgetvect(frameFile,chanNameChisq,-1,segLenSec,0) PSD_tuple = Fr.frgetvect(frameFile,chanNamePSD,-1,segLenSec*8,0) #print PSD_tuple snr_position = eval(gpsTime) - (gpsStart + gpsPosition* (segLenSec - segOverlapSec) ) chisq_position = snr_position # compute the snr vector snr_vector = sqrt(squareSnr_tuple[0]) # print squareSnr_tuple snr_time = array(range(0, segLen)) * squareSnr_tuple[3][0] - snr_position | 86d5e9a91584989d75281800f3eff14e2619b6b8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5758/86d5e9a91584989d75281800f3eff14e2619b6b8/plotsnrchisq_pipe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
8134,
86,
343,
291,
85,
12,
75,
1121,
950,
16,
3789,
812,
16,
2844,
743,
16,
267,
1752,
15417,
1370,
16,
2121,
4771,
16,
6081,
812,
16,
2433,
4672,
225,
3597,
85,
7614,
273,
37... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
8134,
86,
343,
291,
85,
12,
75,
1121,
950,
16,
3789,
812,
16,
2844,
743,
16,
267,
1752,
15417,
1370,
16,
2121,
4771,
16,
6081,
812,
16,
2433,
4672,
225,
3597,
85,
7614,
273,
37... |
nodeName_ == 'requred': | nodeName_ == 'required': | def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and \ nodeName_ == 'ip_address': ip_address_ = '' for text__content_ in child_.childNodes: ip_address_ += text__content_.nodeValue self.ip_address = ip_address_ self.validate_ip_address(self.ip_address) # validate type ip_address elif child_.nodeType == Node.ELEMENT_NODE and \ nodeName_ == 'ipv6_address': ipv6_address_ = '' for text__content_ in child_.childNodes: ipv6_address_ += text__content_.nodeValue self.ipv6_address = ipv6_address_ self.validate_ipv6_address(self.ipv6_address) # validate type ipv6_address elif child_.nodeType == Node.ELEMENT_NODE and \ nodeName_ == 'dns_name': dns_name_ = '' for text__content_ in child_.childNodes: dns_name_ += text__content_.nodeValue self.dns_name = dns_name_ self.validate_dns_name(self.dns_name) # validate type dns_name elif child_.nodeType == Node.ELEMENT_NODE and \ nodeName_ == 'device_name': device_name_ = '' for text__content_ in child_.childNodes: device_name_ += text__content_.nodeValue self.device_name = device_name_ self.validate_device_name(self.device_name) # validate type device_name elif child_.nodeType == Node.ELEMENT_NODE and \ nodeName_ == 'netmask': netmask_ = '' for text__content_ in child_.childNodes: netmask_ += text__content_.nodeValue self.netmask = netmask_ self.validate_netmask(self.netmask) # validate type netmask elif child_.nodeType == Node.ELEMENT_NODE and \ nodeName_ == 'port_type': port_type_ = '' for text__content_ in child_.childNodes: port_type_ += text__content_.nodeValue self.port_type = port_type_ self.validate_port_type(self.port_type) # validate type port_type elif child_.nodeType == Node.ELEMENT_NODE and \ nodeName_ == 'active': if child_.firstChild: sval_ = child_.firstChild.nodeValue if sval_ in ('true', '1'): ival_ = True elif sval_ in ('false', '0'): ival_ = False else: raise ValueError('requires boolean -- %s' % child_.toxml()) self.active = ival_ elif child_.nodeType == Node.ELEMENT_NODE and \ nodeName_ == 'requred': if child_.firstChild: sval_ = child_.firstChild.nodeValue if sval_ in ('true', '1'): ival_ = True elif sval_ in ('false', '0'): ival_ = False else: raise ValueError('requires boolean -- %s' % child_.toxml()) self.requred = ival_ | 91b7fa5f4789cd99e181dad4d2401509c907da8c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7635/91b7fa5f4789cd99e181dad4d2401509c907da8c/generateds_system_1_0.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
4212,
12,
2890,
16,
1151,
67,
16,
7553,
67,
4672,
309,
1151,
27799,
2159,
559,
422,
2029,
18,
10976,
67,
8744,
471,
521,
7553,
67,
422,
296,
625,
67,
2867,
4278,
2359,
67,
2867,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4212,
12,
2890,
16,
1151,
67,
16,
7553,
67,
4672,
309,
1151,
27799,
2159,
559,
422,
2029,
18,
10976,
67,
8744,
471,
521,
7553,
67,
422,
296,
625,
67,
2867,
4278,
2359,
67,
2867,
... |
if len(inFields) != len(inValues): | if len( inFields ) != len( inValues ): | def __checkFields( self, inFields, inValues ): | 0e53f5944800e7e4e2a93a0c3f1aefa6be7f7b08 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/0e53f5944800e7e4e2a93a0c3f1aefa6be7f7b08/MySQL.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1893,
2314,
12,
365,
16,
316,
2314,
16,
316,
1972,
262,
30,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1893,
2314,
12,
365,
16,
316,
2314,
16,
316,
1972,
262,
30,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
Abelian group on 5 generators (a, b, c, d, e) with invariants [5, 5, 7, 8, 9] | AbelianGroup( 5, [5, 5, 7, 8, 9]) | def is_AbelianGroup(x): """ Return True if $x$ is an abelian group. EXAMPLES: sage: F = AbelianGroup(5,[5,5,7,8,9],names = list("abcde")); F AbelianGroup( 5, [5, 5, 7, 8, 9]) sage: is_AbelianGroup(F) True sage: is_AbelianGroup(AbelianGroup(7, [3]*7)) True """ return isinstance(x, AbelianGroup_class) | 82feb7d5287b66fa860c45cb0b160fbe7aa67b0a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9417/82feb7d5287b66fa860c45cb0b160fbe7aa67b0a/abelian_group.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
5895,
292,
2779,
1114,
12,
92,
4672,
3536,
2000,
1053,
309,
271,
92,
8,
353,
392,
1223,
292,
2779,
1041,
18,
225,
5675,
8900,
11386,
30,
272,
410,
30,
478,
273,
9771,
292,
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,
353,
67,
5895,
292,
2779,
1114,
12,
92,
4672,
3536,
2000,
1053,
309,
271,
92,
8,
353,
392,
1223,
292,
2779,
1041,
18,
225,
5675,
8900,
11386,
30,
272,
410,
30,
478,
273,
9771,
292,
2... |
def improvedMetricHistogram(self, candidate): | def getTriggersWithinEpsilon(self, candidate, epsilon): | def improvedMetricHistogram(self, candidate): """ Return distance squared between candidate and coincident triggers using the following metric | de2e9d5312290205808cffee242913dd495127b5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3592/de2e9d5312290205808cffee242913dd495127b5/CoincInspiralUtils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
1652,
336,
15114,
18949,
29889,
10327,
12,
2890,
16,
5500,
16,
12263,
4672,
3536,
2000,
3888,
21778,
3086,
5500,
471,
13170,
71,
6392,
11752,
1450,
326,
3751,
3999,
2,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
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,
225,
1652,
336,
15114,
18949,
29889,
10327,
12,
2890,
16,
5500,
16,
12263,
4672,
3536,
2000,
3888,
21778,
3086,
5500,
471,
13170,
71,
6392,
11752,
1450,
326,
3751,
3999,
2,
-100,
-100,
-100,
-10... |
sage: hypergeometric_U(1,1,1) 0.59634736232319407 sage: hypergeometric_U(1,1,1,70) 0.59634736232319407434152 """ | sage: hypergeometric_U(1,1,1,"scipy") 0.596347362323... sage: hypergeometric_U(1,1,1) 0.59634736232319... sage: hypergeometric_U(1,1,1,"pari",70) 0.59634736232319407434... """ if alg=="scipy": import scipy.special ans = str(scipy.special.hyperu(float(alpha),float(beta),float(x))) ans = ans.replace("(","") ans = ans.replace(")","") ans = ans.replace("j","*I") return sage_eval(ans) | def hypergeometric_U(alpha,beta,x,prec=53): r""" Wraps Pari's hyperu(alpha,beta,x) function. The confluent hypergeometric function $y = U(a,b,x)$ is defined to be the solution to Kummer's differential equation \[ xy'' + (b-x)y' - ay = 0. \] This satisfies $U(a,b,x) \sim x^{-a}$, as $x\rightarrow \infty$, and is sometimes denoted \verb|x^{-a}2_F_0(a,1+a-b,-1/x)|. This is not the same as Kummer's $M$-hypergeometric function, denoted sometimes as \verb|_1F_1(alpha,beta,x)|, though it satisfies the same DE that $U$ does. WARNING: In the literature, both are called "Kummer confluent hypergeometric" functions. EXAMPLES: sage: hypergeometric_U(1,1,1) ## random output 0.59634736232319407 sage: hypergeometric_U(1,1,1,70) ## random output 0.59634736232319407434152 """ ## For commented out code below, ## f = lambda x: hypergeometric_U(1,1,x) ## P = plot(f,0.1,1) ## seems to hang. I don't know why. from sage.libs.pari.all import pari from sage.interfaces.gp import Gp,gp R,a = _setup(prec) #b = R(pari(alpha).hyperu(beta,x)) #pari.set_real_precision(a) #return b #above has weird bug ans = gp.eval("hyperu(%s,%s,%s)"%(alpha,beta,x)) return R(ans) | 035e73f8a11cfe8d51a32f49900d3f8b55b2aa84 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/035e73f8a11cfe8d51a32f49900d3f8b55b2aa84/special.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9512,
10049,
1591,
67,
57,
12,
5429,
16,
5758,
16,
92,
16,
4036,
33,
8643,
4672,
436,
8395,
678,
7506,
2280,
77,
1807,
9512,
89,
12,
5429,
16,
5758,
16,
92,
13,
445,
18,
225,
1021,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9512,
10049,
1591,
67,
57,
12,
5429,
16,
5758,
16,
92,
16,
4036,
33,
8643,
4672,
436,
8395,
678,
7506,
2280,
77,
1807,
9512,
89,
12,
5429,
16,
5758,
16,
92,
13,
445,
18,
225,
1021,
... |
'file_type': fields.char('Content Type', size=32), | 'file_type': fields.char('Content Type', size=64), | def _data_set(self, cr, uid, id, name, value, arg, context): if not value: return True fbro = self.browse(cr, uid, id, context=context) nctx = nodes.get_node_context(cr, uid, context) fnode = nodes.node_file(None, None, nctx, fbro) res = fnode.set_data(cr, base64.decodestring(value), fbro) return res | 43f356ec67f042ef97ac70e332913fd82a472276 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/43f356ec67f042ef97ac70e332913fd82a472276/document.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
892,
67,
542,
12,
2890,
16,
4422,
16,
4555,
16,
612,
16,
508,
16,
460,
16,
1501,
16,
819,
4672,
309,
486,
460,
30,
327,
1053,
284,
4637,
273,
365,
18,
25731,
12,
3353,
16,
455... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
892,
67,
542,
12,
2890,
16,
4422,
16,
4555,
16,
612,
16,
508,
16,
460,
16,
1501,
16,
819,
4672,
309,
486,
460,
30,
327,
1053,
284,
4637,
273,
365,
18,
25731,
12,
3353,
16,
455... |
BOUNDARY = '----------$_BOUNDARY_' + str(random.random) + '_$' | BOUNDARY = '----------$_BOUNDARY_' + str(random.getrandbits(128)) + '_$' | def encode_multipart_formdata(body): BOUNDARY = '----------$_BOUNDARY_' + str(random.random) + '_$' CRLF = '\r\n' L = [] for key in body: L.append('--' + BOUNDARY) L.append('Content-Disposition: form-data; name="%s"' % key) L.append('') L.append(body[key]) L.append('--' + BOUNDARY + '--') L.append('') body = CRLF.join(L) content_type = 'multipart/form-data; boundary=%s' % BOUNDARY return content_type, body | 0932ab4f30412222b711dd99a417dfe9f17f1930 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12761/0932ab4f30412222b711dd99a417dfe9f17f1930/facebook_.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2017,
67,
16404,
67,
687,
892,
12,
3432,
4672,
9784,
5240,
6043,
273,
296,
15392,
8,
67,
19318,
6043,
4623,
397,
609,
12,
9188,
18,
588,
7884,
6789,
12,
10392,
3719,
397,
2070,
9227,
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,
2017,
67,
16404,
67,
687,
892,
12,
3432,
4672,
9784,
5240,
6043,
273,
296,
15392,
8,
67,
19318,
6043,
4623,
397,
609,
12,
9188,
18,
588,
7884,
6789,
12,
10392,
3719,
397,
2070,
9227,
2... |
graphics_file_dict[key].remove(filename) | if self._checkValidGraphicFile(filename, graphicstype=key, vidintid=intid) == True: graphics_file_dict[key].remove(filename) | def _graphicsCleanup(self): '''Match the graphics in the mythtv graphics directories with the ones specified by the mythvideometa records. Remove any graphics that are not referenced at least once. Print a report. ''' num_total = 0 num_deleted = 1 num_new_total = 2 stats = {'coverfile': [0,0,0], 'banner': [0,0,0], 'fanart': [0,0,0]} | 881a9111c0613ff73ff321ac94e0e0ed204b9de1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13713/881a9111c0613ff73ff321ac94e0e0ed204b9de1/jamu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
31586,
15007,
12,
2890,
4672,
9163,
2060,
326,
17313,
316,
326,
3399,
451,
24161,
17313,
6402,
598,
326,
5945,
1269,
635,
326,
3399,
451,
6768,
362,
1066,
3853,
18,
3581,
1281,
17313,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
31586,
15007,
12,
2890,
4672,
9163,
2060,
326,
17313,
316,
326,
3399,
451,
24161,
17313,
6402,
598,
326,
5945,
1269,
635,
326,
3399,
451,
6768,
362,
1066,
3853,
18,
3581,
1281,
17313,... |
Subwidgets Class ---------- ----- <panes> g/p widgets added dynamically""" def __init__(self, master, cnf={}, **kw): TixWidget.__init__(self, master, 'tixPanedWindow', ['orientation', 'options'], cnf, kw) | Subwidgets Class ---------- ----- <panes> g/p widgets added dynamically""" def __init__(self, master, cnf={}, **kw): TixWidget.__init__(self, master, 'tixPanedWindow', ['orientation', 'options'], cnf, kw) | def enable(self, name): | 86af7ef7e3f4448abc89aa941517a84075d99a38 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/86af7ef7e3f4448abc89aa941517a84075d99a38/Tix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4237,
12,
2890,
16,
508,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4237,
12,
2890,
16,
508,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
if reap_process(process.pid): | if callable(getattr(os, "kill", None)) and reap_process(process.pid): | def process_is_dead(process): """Check if process is not running anymore. First it finds out if the process is running by sending signal 0. Then if the process is a child process, and is running it finds out if it's a zombie process and reaps it. If the process is running and is not a zombie it tries to send a ping through the process pipe. :param process: A :class:`multiprocessing.Process` instance. :returns: ``True`` if the process is not running, ``False`` otherwise. """ # Try to see if the process is actually running, # and reap zombie proceses while we're at it. if reap_process(process.pid): return True # Then try to ping the process using its pipe. try: proc_is_alive = process.is_alive() except OSError: return True else: return not proc_is_alive | 65da4070bee80b09abbd1fff3d47d948a542eae0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2024/65da4070bee80b09abbd1fff3d47d948a542eae0/pool.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
291,
67,
22097,
12,
2567,
4672,
3536,
1564,
309,
1207,
353,
486,
3549,
16828,
18,
225,
5783,
518,
13094,
596,
309,
326,
1207,
353,
3549,
635,
5431,
4277,
374,
18,
9697,
309,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
291,
67,
22097,
12,
2567,
4672,
3536,
1564,
309,
1207,
353,
486,
3549,
16828,
18,
225,
5783,
518,
13094,
596,
309,
326,
1207,
353,
3549,
635,
5431,
4277,
374,
18,
9697,
309,
... |
def remap_element_names(root, name_map): queue = [] for child in root.childNodes: if child.nodeType == ELEMENT: queue.append(child) while queue: node = queue.pop() tagName = node.tagName if name_map.has_key(tagName): name, attrs = name_map[tagName] node._node.name = name for attr, value in attrs.items(): node.setAttribute(attr, value) for child in node.childNodes: if child.nodeType == ELEMENT: queue.append(child) | def remap_element_names(root, name_map): queue = [] for child in root.childNodes: if child.nodeType == ELEMENT: queue.append(child) while queue: node = queue.pop() tagName = node.tagName if name_map.has_key(tagName): name, attrs = name_map[tagName] node._node.name = name for attr, value in attrs.items(): node.setAttribute(attr, value) for child in node.childNodes: if child.nodeType == ELEMENT: queue.append(child) | 6c4872a20bb98bc582729d92f55edc88066ab46b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/6c4872a20bb98bc582729d92f55edc88066ab46b/docfixer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21674,
67,
2956,
67,
1973,
12,
3085,
16,
508,
67,
1458,
4672,
2389,
273,
5378,
364,
1151,
316,
1365,
18,
3624,
3205,
30,
309,
1151,
18,
2159,
559,
422,
13424,
30,
2389,
18,
6923,
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,
21674,
67,
2956,
67,
1973,
12,
3085,
16,
508,
67,
1458,
4672,
2389,
273,
5378,
364,
1151,
316,
1365,
18,
3624,
3205,
30,
309,
1151,
18,
2159,
559,
422,
13424,
30,
2389,
18,
6923,
12,
... | |
self.deletecommand(tmp[0]) | self.deletecommand(name) | def callit(func=func, args=args, self=self, tmp=tmp): try: func(*args) finally: try: self.deletecommand(tmp[0]) except TclError: pass | 4696ffbf0935519eb457ea6a786f22631a63ffda /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4696ffbf0935519eb457ea6a786f22631a63ffda/Tkinter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
745,
305,
12,
644,
33,
644,
16,
833,
33,
1968,
16,
365,
33,
2890,
16,
1853,
33,
5645,
4672,
775,
30,
1326,
30857,
1968,
13,
3095,
30,
775,
30,
365,
18,
19003,
30433,
889,
12,
529,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
745,
305,
12,
644,
33,
644,
16,
833,
33,
1968,
16,
365,
33,
2890,
16,
1853,
33,
5645,
4672,
775,
30,
1326,
30857,
1968,
13,
3095,
30,
775,
30,
365,
18,
19003,
30433,
889,
12,
529,
... |
if order_field in self._columns: | if order_field == 'id': order_by_clause = '"%s"."%s"' % (self._table, order_field) elif order_field in self._columns: | def _generate_order_by(self, order_spec, query): """ Attempt to consruct an appropriate ORDER BY clause based on order_spec, which must be a comma-separated list of valid field names, optionally followed by an ASC or DESC direction. | 1e1830cd00a62908128a9d09005d86c0cffd54ec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1e1830cd00a62908128a9d09005d86c0cffd54ec/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7163,
67,
1019,
67,
1637,
12,
2890,
16,
1353,
67,
2793,
16,
843,
4672,
3536,
12864,
358,
1959,
86,
853,
392,
5505,
10205,
6953,
6591,
2511,
603,
1353,
67,
2793,
16,
1492,
1297,
50... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7163,
67,
1019,
67,
1637,
12,
2890,
16,
1353,
67,
2793,
16,
843,
4672,
3536,
12864,
358,
1959,
86,
853,
392,
5505,
10205,
6953,
6591,
2511,
603,
1353,
67,
2793,
16,
1492,
1297,
50... |
query_line = obj_acc_move_line._query_get(cr, uid, obj='l', context=used_context) | query_line = obj_acc_move_line._query_get(cr, uid, obj='l', context=used_context) | def check_report(self, cr, uid, ids, context=None): obj_acc_move_line = self.pool.get('account.move.line') data = {} data['ids'] = context.get('active_ids',[]) data['model'] = context.get('active_model', 'ir.ui.menu') data['form'] = self.read(cr, uid, ids, ['date_from', 'date_to', 'fiscalyear_id', 'journal_ids', 'period_from', 'period_to', 'filter', 'chart_account_id'])[0] used_context = self._build_context(cr, uid, ids, data, context) query_line = obj_acc_move_line._query_get(cr, uid, obj='l', context=used_context) return self._print_report(cr, uid, ids, data, query_line, context) | 41255ffacfd1eb78d16a18981694ad4842de21df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/41255ffacfd1eb78d16a18981694ad4842de21df/account_common_report.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
6006,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
1081,
67,
8981,
67,
8501,
67,
1369,
273,
365,
18,
6011,
18,
588,
2668,
4631,
18,
8501,
18,
1369,
6134,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
6006,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
1081,
67,
8981,
67,
8501,
67,
1369,
273,
365,
18,
6011,
18,
588,
2668,
4631,
18,
8501,
18,
1369,
6134,... |
self.assertEquals(sms_next_read_sizes[current_frame], pd.frame_size) | assert sms_next_read_sizes[current_frame] == pd.frame_size | def test_size_next_read(self): """test_size_next_read Make sure pysms PeakDetection is calculating the correct value for the size of the next frame.""" audio, sampling_rate = self.get_audio() | f0576d53f10832adb8a491f85ec86d2219a621bf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10871/f0576d53f10832adb8a491f85ec86d2219a621bf/sms.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1467,
67,
4285,
67,
896,
12,
2890,
4672,
3536,
3813,
67,
1467,
67,
4285,
67,
896,
4344,
3071,
21027,
959,
19622,
581,
10214,
353,
21046,
326,
3434,
460,
364,
326,
963,
434,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1467,
67,
4285,
67,
896,
12,
2890,
4672,
3536,
3813,
67,
1467,
67,
4285,
67,
896,
4344,
3071,
21027,
959,
19622,
581,
10214,
353,
21046,
326,
3434,
460,
364,
326,
963,
434,
3... |
if log.isEnabledFor(log.DEBUG): log.debug("%s %s %s %s"%(obj.name or "",controlTypes.speechRoleLabels[obj.role],obj.value or "",obj.description or "")) | def setMouseObject(obj): """Tells NVDA to remember the given object as the object that is directly under the mouse""" if log.isEnabledFor(log.DEBUG): log.debug("%s %s %s %s"%(obj.name or "",controlTypes.speechRoleLabels[obj.role],obj.value or "",obj.description or "")) globalVars.mouseObject=obj | 9e5d89df6fd89a167be0fe42a0be0667fd981dc0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9340/9e5d89df6fd89a167be0fe42a0be0667fd981dc0/api.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
9186,
921,
12,
2603,
4672,
3536,
21009,
87,
423,
58,
9793,
358,
11586,
326,
864,
733,
487,
326,
733,
716,
353,
5122,
3613,
326,
7644,
8395,
2552,
5555,
18,
11697,
921,
33,
2603,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
9186,
921,
12,
2603,
4672,
3536,
21009,
87,
423,
58,
9793,
358,
11586,
326,
864,
733,
487,
326,
733,
716,
353,
5122,
3613,
326,
7644,
8395,
2552,
5555,
18,
11697,
921,
33,
2603,
2... | |
self.close() | def addCurrentServiceToBouquet(self, dest): mutableList = self.getMutableList(dest) if not mutableList is None: if not mutableList.addService(self.servicelist.getCurrent()): self.bouquetNumOffsetCache = { } mutableList.flushChanges() self.close() | 454fc2dd8591aa9f45545f9c0c667a49a221b285 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/454fc2dd8591aa9f45545f9c0c667a49a221b285/ChannelSelection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
3935,
1179,
774,
38,
1395,
28357,
12,
2890,
16,
1570,
4672,
16074,
682,
273,
365,
18,
588,
19536,
682,
12,
10488,
13,
309,
486,
16074,
682,
353,
599,
30,
309,
486,
16074,
682,
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,
527,
3935,
1179,
774,
38,
1395,
28357,
12,
2890,
16,
1570,
4672,
16074,
682,
273,
365,
18,
588,
19536,
682,
12,
10488,
13,
309,
486,
16074,
682,
353,
599,
30,
309,
486,
16074,
682,
18,... | |
h.endheaders() | try: h.endheaders() except socket.error, err: raise URLError(err) | def do_open(self, http_class, req): host = req.get_host() if not host: raise URLError('no host given') | ac6817c3c65ca5ef8a6c7c75fe2b53cf5f35344a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ac6817c3c65ca5ef8a6c7c75fe2b53cf5f35344a/urllib2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
3190,
12,
2890,
16,
1062,
67,
1106,
16,
1111,
4672,
1479,
273,
1111,
18,
588,
67,
2564,
1435,
309,
486,
1479,
30,
1002,
1976,
668,
2668,
2135,
1479,
864,
6134,
2,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
3190,
12,
2890,
16,
1062,
67,
1106,
16,
1111,
4672,
1479,
273,
1111,
18,
588,
67,
2564,
1435,
309,
486,
1479,
30,
1002,
1976,
668,
2668,
2135,
1479,
864,
6134,
2,
-100,
-100,
... |
test_support.unlink(second_temp) | def hooktester(count, block_size, total_size, count_holder=[0]): self.assert_(isinstance(count, int)) self.assert_(isinstance(block_size, int)) self.assert_(isinstance(total_size, int)) self.assertEqual(count, count_holder[0]) count_holder[0] = count_holder[0] + 1 | 9aba6d6905bcf3f3009f71cfa70525eb8b0ad3dc /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/9aba6d6905bcf3f3009f71cfa70525eb8b0ad3dc/test_urllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3953,
1078,
387,
12,
1883,
16,
1203,
67,
1467,
16,
2078,
67,
1467,
16,
1056,
67,
4505,
22850,
20,
65,
4672,
365,
18,
11231,
67,
12,
291,
1336,
12,
1883,
16,
509,
3719,
365,
18,
11231... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3953,
1078,
387,
12,
1883,
16,
1203,
67,
1467,
16,
2078,
67,
1467,
16,
1056,
67,
4505,
22850,
20,
65,
4672,
365,
18,
11231,
67,
12,
291,
1336,
12,
1883,
16,
509,
3719,
365,
18,
11231... | |
(-2.1598449493429825, -0.83146961230254546), (-1.9634954084936207, | (-2.1598449493429825, -0.831469612302545...), (-1.9634954084936207, | 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.83146961230254546), (-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.83146961230254546), (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 | fcff82c919cb4ddf038cc5c9ed2026a986eb7cba /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/fcff82c919cb4ddf038cc5c9ed2026a986eb7cba/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... |
paintText( draw, bgimage, getScaledAttribute(node, "x"), getScaledAttribute(node, "y"), getScaledAttribute(node, "w"), getScaledAttribute(node, "h"), text, themeFonts[node.attributes["font"].value], color, node.attributes["align"].value ) boundarybox=checkBoundaryBox(boundarybox, node) | paintText(draw, bgimage, text, node) boundarybox = checkBoundaryBox(boundarybox, node) | def drawThemeItem(page, itemsonthispage, itemnum, menuitem, bgimage, draw, bgimagemask, drawmask, highlightcolor, spumuxdom, spunode, numberofitems, chapternumber, chapterlist): """Draws text and graphics onto a dvd menu, called by createMenu and createChapterMenu""" #Get the XML containing information about this item infoDOM = xml.dom.minidom.parse( os.path.join(getItemTempPath(itemnum),"info.xml") ) #Error out if its the wrong XML if infoDOM.documentElement.tagName != "fileinfo": fatalError("The info.xml file (%s) doesn't look right" % os.path.join(getItemTempPath(itemnum),"info.xml")) #boundarybox holds the max and min dimensions for this item so we can auto build a menu highlight box boundarybox=9999,9999,0,0 wantHighlightBox = True #Loop through all the nodes inside this menu item for node in menuitem.childNodes: #Process each type of item to add it onto the background image if node.nodeName=="graphic": #Overlay graphic image onto background #if this graphic item is a movie thumbnail then we dont process it here if node.attributes["filename"].value == "%movie": #this is a movie item but we must still update the boundary box boundarybox=checkBoundaryBox(boundarybox, node) else: imagefilename = expandItemText(infoDOM,node.attributes["filename"].value, itemnum, page, itemsonthispage, chapternumber, chapterlist) if doesFileExist(imagefilename) == False: if imagefilename == node.attributes["filename"].value: imagefilename = getThemeFile(themeName, node.attributes["filename"].value) if doesFileExist(imagefilename): picture = Image.open(imagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture = picture.convert("RGBA") #see if an image mask exists imagemaskfilename = None if node.hasAttribute("mask"): if node.attribute["mask"].value <> "": imagemaskfilename = getThemeFile(themeName, node.attributes["mask"].value) if imagemaskfilename <> None and doesFileExist(imagemaskfilename): maskpicture = Image.open(imagemaskfilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) maskpicture = maskpicture.convert("RGBA") bgimage.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), maskpicture) del maskpicture else: bgimage.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), picture) del picture write( "Added image %s" % imagefilename) boundarybox=checkBoundaryBox(boundarybox, node) else: write( "Image file does not exist '%s'" % imagefilename) elif node.nodeName=="text": #Apply some text to the background, including wordwrap if required. text=expandItemText(infoDOM,node.attributes["value"].value, itemnum, page, itemsonthispage,chapternumber,chapterlist) if node.hasAttribute("colour"): color = node.attributes["colour"].value elif node.hasAttribute("color"): color = node.attributes["color"].value else: color = None if text>"": paintText( draw, bgimage, getScaledAttribute(node, "x"), getScaledAttribute(node, "y"), getScaledAttribute(node, "w"), getScaledAttribute(node, "h"), text, themeFonts[node.attributes["font"].value], color, node.attributes["align"].value ) boundarybox=checkBoundaryBox(boundarybox, node) del text elif node.nodeName=="previous": if page>1: #Overlay previous graphic button onto background imagefilename = getThemeFile(themeName, node.attributes["filename"].value) if not doesFileExist(imagefilename): fatalError("Cannot find image for previous button (%s)." % imagefilename) maskimagefilename = getThemeFile(themeName, node.attributes["mask"].value) if not doesFileExist(maskimagefilename): fatalError("Cannot find mask image for previous button (%s)." % maskimagefilename) picture=Image.open(imagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture=picture.convert("RGBA") bgimage.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), picture) del picture write( "Added previous button image %s" % imagefilename) picture=Image.open(maskimagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture=picture.convert("RGBA") bgimagemask.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), picture) del picture write( "Added previous button mask image %s" % imagefilename) button = spumuxdom.createElement("button") button.setAttribute("name","previous") button.setAttribute("x0","%s" % getScaledAttribute(node, "x")) button.setAttribute("y0","%s" % getScaledAttribute(node, "y")) button.setAttribute("x1","%s" % (getScaledAttribute(node, "x") + getScaledAttribute(node, "w"))) button.setAttribute("y1","%s" % (getScaledAttribute(node, "y") + getScaledAttribute(node, "h"))) spunode.appendChild(button) elif node.nodeName=="next": if itemnum < numberofitems: #Overlay next graphic button onto background imagefilename = getThemeFile(themeName, node.attributes["filename"].value) if not doesFileExist(imagefilename): fatalError("Cannot find image for next button (%s)." % imagefilename) maskimagefilename = getThemeFile(themeName, node.attributes["mask"].value) if not doesFileExist(maskimagefilename): fatalError("Cannot find mask image for next button (%s)." % maskimagefilename) picture = Image.open(imagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture = picture.convert("RGBA") bgimage.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), picture) del picture write( "Added next button image %s " % imagefilename) picture=Image.open(maskimagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture=picture.convert("RGBA") bgimagemask.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), picture) del picture write( "Added next button mask image %s" % imagefilename) button = spumuxdom.createElement("button") button.setAttribute("name","next") button.setAttribute("x0","%s" % getScaledAttribute(node, "x")) button.setAttribute("y0","%s" % getScaledAttribute(node, "y")) button.setAttribute("x1","%s" % (getScaledAttribute(node, "x") + getScaledAttribute(node, "w"))) button.setAttribute("y1","%s" % (getScaledAttribute(node, "y") + getScaledAttribute(node, "h"))) spunode.appendChild(button) elif node.nodeName=="playall": #Overlay playall graphic button onto background imagefilename = getThemeFile(themeName, node.attributes["filename"].value) if not doesFileExist(imagefilename): fatalError("Cannot find image for playall button (%s)." % imagefilename) maskimagefilename = getThemeFile(themeName, node.attributes["mask"].value) if not doesFileExist(maskimagefilename): fatalError("Cannot find mask image for playall button (%s)." % maskimagefilename) picture = Image.open(imagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture = picture.convert("RGBA") bgimage.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), picture) del picture write( "Added playall button image %s " % imagefilename) picture=Image.open(maskimagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture=picture.convert("RGBA") bgimagemask.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), picture) del picture write( "Added playall button mask image %s" % imagefilename) button = spumuxdom.createElement("button") button.setAttribute("name","playall") button.setAttribute("x0","%s" % getScaledAttribute(node, "x")) button.setAttribute("y0","%s" % getScaledAttribute(node, "y")) button.setAttribute("x1","%s" % (getScaledAttribute(node, "x") + getScaledAttribute(node, "w"))) button.setAttribute("y1","%s" % (getScaledAttribute(node, "y") + getScaledAttribute(node, "h"))) spunode.appendChild(button) elif node.nodeName=="titlemenu": if itemnum < numberofitems: #Overlay next graphic button onto background imagefilename = getThemeFile(themeName, node.attributes["filename"].value) if not doesFileExist(imagefilename): fatalError("Cannot find image for titlemenu button (%s)." % imagefilename) maskimagefilename = getThemeFile(themeName, node.attributes["mask"].value) if not doesFileExist(maskimagefilename): fatalError("Cannot find mask image for titlemenu button (%s)." % maskimagefilename) picture = Image.open(imagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture = picture.convert("RGBA") bgimage.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), picture) del picture write( "Added titlemenu button image %s " % imagefilename) picture=Image.open(maskimagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture=picture.convert("RGBA") bgimagemask.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), picture) del picture write( "Added titlemenu button mask image %s" % imagefilename) button = spumuxdom.createElement("button") button.setAttribute("name","titlemenu") button.setAttribute("x0","%s" % getScaledAttribute(node, "x")) button.setAttribute("y0","%s" % getScaledAttribute(node, "y")) button.setAttribute("x1","%s" % (getScaledAttribute(node, "x") + getScaledAttribute(node, "w"))) button.setAttribute("y1","%s" % (getScaledAttribute(node, "y") + getScaledAttribute(node, "h"))) spunode.appendChild(button) elif node.nodeName=="button": wantHighlightBox = False #Overlay item graphic/text button onto background imagefilename = getThemeFile(themeName, node.attributes["filename"].value) if not doesFileExist(imagefilename): fatalError("Cannot find image for menu button (%s)." % imagefilename) maskimagefilename = getThemeFile(themeName, node.attributes["mask"].value) if not doesFileExist(maskimagefilename): fatalError("Cannot find mask image for menu button (%s)." % maskimagefilename) picture=Image.open(imagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture=picture.convert("RGBA") bgimage.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), picture) del picture # if we have some text paint that over the image textnode = node.getElementsByTagName("textnormal") if textnode.length > 0: textnode = textnode[0] text=expandItemText(infoDOM,textnode.attributes["value"].value, itemnum, page, itemsonthispage,chapternumber,chapterlist) if node.hasAttribute("colour"): color = node.attributes["colour"].value elif node.hasAttribute("color"): color = node.attributes["color"].value else: color = None if text > "": paintText( draw, bgimage, getScaledAttribute(textnode, "x"), getScaledAttribute(textnode, "y"), getScaledAttribute(textnode, "w"), getScaledAttribute(textnode, "h"), text, themeFonts[textnode.attributes["font"].value], color, textnode.attributes["align"].value ) boundarybox=checkBoundaryBox(boundarybox, node) del text write( "Added button image %s" % imagefilename) picture=Image.open(maskimagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture=picture.convert("RGBA") bgimagemask.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")),picture) #del picture # if we have some text paint that over the image textnode = node.getElementsByTagName("textselected") if textnode.length > 0: textnode = textnode[0] text = expandItemText(infoDOM,textnode.attributes["value"].value, itemnum, page, itemsonthispage,chapternumber,chapterlist) textImage = Image.new("RGBA",picture.size) textDraw = ImageDraw.Draw(textImage) if text > "": paintText(textDraw, textImage, getScaledAttribute(node, "x") - getScaledAttribute(textnode, "x"), getScaledAttribute(node, "y") - getScaledAttribute(textnode, "y"), getScaledAttribute(textnode, "w"), getScaledAttribute(textnode, "h"), text, themeFonts[textnode.attributes["font"].value], "white", textnode.attributes["align"].value ) #convert the RGB image to a 1 bit image (width, height) = textImage.size for y in range(height): for x in range(width): if textImage.getpixel((x,y)) < (100, 100, 100, 255): textImage.putpixel((x,y), (0, 0, 0, 0)) else: textImage.putpixel((x,y), (255, 255, 255, 255)) if textnode.hasAttribute("colour"): color = textnode.attributes["colour"].value elif textnode.hasAttribute("color"): color = textnode.attributes["color"].value else: color = "white" bgimagemask.paste(color, (getScaledAttribute(textnode, "x"), getScaledAttribute(textnode, "y")), textImage) boundarybox=checkBoundaryBox(boundarybox, node) del text, textImage, textDraw del picture elif node.nodeName=="#text" or node.nodeName=="#comment": #Do nothing assert True else: write( "Dont know how to process %s" % node.nodeName) if drawmask == None: return #Draw the mask for this item if wantHighlightBox == True: # Make the boundary box bigger than the content to avoid over writing it boundarybox=boundarybox[0]-1,boundarybox[1]-1,boundarybox[2]+1,boundarybox[3]+1 drawmask.rectangle(boundarybox,outline=highlightcolor) # Draw another line to make the box thicker - PIL does not support linewidth boundarybox=boundarybox[0]-1,boundarybox[1]-1,boundarybox[2]+1,boundarybox[3]+1 drawmask.rectangle(boundarybox,outline=highlightcolor) node = spumuxdom.createElement("button") #Fiddle this for chapter marks.... if chapternumber>0: node.setAttribute("name","%s" % chapternumber) else: node.setAttribute("name","%s" % itemnum) node.setAttribute("x0","%d" % int(boundarybox[0])) node.setAttribute("y0","%d" % int(boundarybox[1])) node.setAttribute("x1","%d" % int(boundarybox[2] + 1)) node.setAttribute("y1","%d" % int(boundarybox[3] + 1)) spunode.appendChild(node) | 3b621623397009015c837134fe56f0ca3f353bed /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13713/3b621623397009015c837134fe56f0ca3f353bed/mythburn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
8335,
1180,
12,
2433,
16,
761,
816,
2211,
2433,
16,
761,
2107,
16,
3824,
1726,
16,
7611,
2730,
16,
3724,
16,
7611,
15374,
351,
835,
16,
3724,
4455,
16,
8839,
3266,
16,
1694,
379,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
8335,
1180,
12,
2433,
16,
761,
816,
2211,
2433,
16,
761,
2107,
16,
3824,
1726,
16,
7611,
2730,
16,
3724,
16,
7611,
15374,
351,
835,
16,
3724,
4455,
16,
8839,
3266,
16,
1694,
379,... |
def endElement(self, name, qname): self._cont_handler.endElement(name, qname) | def endElement(self, name): self._cont_handler.endElement(name) def startElementNS(self, name, qname, attrs): self._cont_handler.startElement(name, attrs) def endElementNS(self, name, qname): self._cont_handler.endElementNS(name, qname) | def endElement(self, name, qname): self._cont_handler.endElement(name, qname) | 1ae857dd21d675f660ac4264cbe9baea51cad6c7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/1ae857dd21d675f660ac4264cbe9baea51cad6c7/saxutils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14840,
12,
2890,
16,
508,
16,
12621,
4672,
365,
6315,
1213,
67,
4176,
18,
409,
1046,
12,
529,
16,
12621,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14840,
12,
2890,
16,
508,
16,
12621,
4672,
365,
6315,
1213,
67,
4176,
18,
409,
1046,
12,
529,
16,
12621,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
w = self.width() if w == 0: w = 1 h = self.height() if h == 0: h = 1 | w,h = self.width(), self.height() if w == 0 or h == 0: return | def paintGL(self): w = self.width() if w == 0: w = 1 h = self.height() if h == 0: h = 1 cursorselection = -1 if self.mousepos != None: cursorselection = self.selectedColor(self.mousepos.x(),self.mousepos.y()) glViewport(0,0,w,h); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0,w,h,0,-3000,1000); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT) glShadeModel(GL_SMOOTH) nbcitem, nbritem = self.getNbColRow(w,h) colorlist = self.turtle.getColorList() nbcolors = len(colorlist) colindex = 0 d = Discretizer() glr = GLRenderer(d) defmat = Material('default') selectionbegin = self.selectionbegin selectionend = self.selectionend if selectionend is None and not selectionbegin is None: selectionbegin,selectionend = min(cursorselection,selectionbegin),max(cursorselection,selectionbegin) for i in xrange(0,nbcitem): for j in xrange(0,nbritem): glPushMatrix() glTranslate(self.unitsize+2*self.unitsize*i,self.unitsize+2*self.unitsize*j,0) glCallList(self.checklist) glEnable(GL_LIGHTING) if colindex < nbcolors: colorlist[colindex].apply(glr) else: defmat.apply(glr) if colindex == cursorselection: glScalef(1.3,1.3,1.3) elif ( not self.selectionbegin is None and ( selectionbegin <= colindex <= selectionend ) ): glScalef(1.2,1.2,1.2) glCallList(self.spherelist) glPopMatrix() colindex += 1 | 48a8c793828ba902031d2f3fd6340c5621cae525 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/796/48a8c793828ba902031d2f3fd6340c5621cae525/materialeditor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12574,
11261,
12,
2890,
4672,
341,
16,
76,
273,
365,
18,
2819,
9334,
365,
18,
4210,
1435,
309,
341,
422,
374,
578,
366,
422,
374,
30,
327,
25326,
1383,
292,
794,
273,
300,
21,
309,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12574,
11261,
12,
2890,
4672,
341,
16,
76,
273,
365,
18,
2819,
9334,
365,
18,
4210,
1435,
309,
341,
422,
374,
578,
366,
422,
374,
30,
327,
25326,
1383,
292,
794,
273,
300,
21,
309,
3... |
print ("Attempting to detect screensaver and powersaving type... (" + str(self.dbusDetectionFailures) + " dbus failures so far)") | print ("Attempting to detect screensaver/powersaving type... (" + str(self.dbusDetectionFailures) + " dbus failures so far)") | def _detectScreensaverAndPowersavingType(self): """This method always runs when the first attempt to inhibit the screensaver and powersaving is made. It detects what screensaver/powersaving software is running. After detection is complete, it will finish the inhibiting process.""" print ("Attempting to detect screensaver and powersaving type... (" + str(self.dbusDetectionFailures) + " dbus failures so far)") bus = dbus.SessionBus() if 'org.gnome.ScreenSaver' in bus.list_names(): self.screensaverAndPowersavingType = "Gnome" elif 'org.freedesktop.ScreenSaver' in bus.list_names() and \ 'org.freedesktop.PowerManagement.Inhibit' in bus.list_names(): self.screensaverAndPowersavingType = "KDE" else: self.dbusDetectionFailures += 1 if self.dbusDetectionFailures <= 8: self.dbusDetectionTimer = threading.Timer(15, self._detectScreensaverAndPowersavingType) self.dbusDetectionTimer.start() return else: # At this point, all attempts to connect to the relevant dbus interfaces have failed. # This user must be using something other than the Gnome or KDE screensaver programs. if "xscreensaver" in utils.getProcesses().keys(): self.screensaverAndPowersavingType = "XSS+DPMS" else: self.screensaverAndPowersavingType = "DPMS" | c7e9f7c76d9e7e14b3081a3c4615b999242059b9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7152/c7e9f7c76d9e7e14b3081a3c4615b999242059b9/core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
16518,
1541,
266,
773,
21851,
1876,
28289,
414,
5339,
559,
12,
2890,
4672,
3536,
2503,
707,
3712,
7597,
1347,
326,
1122,
4395,
358,
316,
31597,
326,
888,
266,
773,
21851,
471,
7602,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16518,
1541,
266,
773,
21851,
1876,
28289,
414,
5339,
559,
12,
2890,
4672,
3536,
2503,
707,
3712,
7597,
1347,
326,
1122,
4395,
358,
316,
31597,
326,
888,
266,
773,
21851,
471,
7602,
... |
nameClass = networkfile.partition(".clamnetwork")[0] nameClass = "SetupNetwork_"+nameClass.rpartition("/")[2] | if len(sys.argv)>2 : nameClass = "NetworkDefinition_"+sys.argv[2] else : nameClass = "NetworkDefinition_"+os.path.splitext(os.path.basename(networkfile))[0] | def setupCode(self) : return self._result | 606c69200c63b4cff536a8bd0d10957b9ff23f74 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1456/606c69200c63b4cff536a8bd0d10957b9ff23f74/clamnetwork2code.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
1085,
12,
2890,
13,
294,
327,
365,
6315,
2088,
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,
... | [
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,
3875,
1085,
12,
2890,
13,
294,
327,
365,
6315,
2088,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
sage: g.coeffs() | sage: g.coefficients() | def polynomial(self, base_ring): r""" Return \code{self} as an algebraic polynomial over the given base ring, if possible. | 88ff2d07f85457f450fa2570c5fb9a41657d2974 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/88ff2d07f85457f450fa2570c5fb9a41657d2974/calculus.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16991,
12,
2890,
16,
1026,
67,
8022,
4672,
436,
8395,
2000,
521,
710,
95,
2890,
97,
487,
392,
524,
29087,
335,
16991,
1879,
326,
864,
1026,
9221,
16,
309,
3323,
18,
2,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16991,
12,
2890,
16,
1026,
67,
8022,
4672,
436,
8395,
2000,
521,
710,
95,
2890,
97,
487,
392,
524,
29087,
335,
16991,
1879,
326,
864,
1026,
9221,
16,
309,
3323,
18,
2,
-100,
-100,
-100... |
def read(self,cr, uid, ids, fields=None, context={}, load='_classic_read'): | def read(self, cr, uid, ids, fields=None, context={}, load='_classic_read'): | def read(self,cr, uid, ids, fields=None, context={}, load='_classic_read'): | 56835ae5b2cc9cc4c329b80c11b10d09a2d619e9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12853/56835ae5b2cc9cc4c329b80c11b10d09a2d619e9/ir_ui_view.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
12,
2890,
16,
3353,
16,
4555,
16,
3258,
16,
1466,
33,
7036,
16,
819,
28793,
1262,
2218,
67,
1106,
335,
67,
896,
11,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
12,
2890,
16,
3353,
16,
4555,
16,
3258,
16,
1466,
33,
7036,
16,
819,
28793,
1262,
2218,
67,
1106,
335,
67,
896,
11,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
commandline = " cd ./BALL/source/BENCHMARKS && " commandline += "LD_LIBRARY_PATH="+ldpath+" make bench >bench.log" | commandline = " cd ./BALL/source/BENCHMARKS " commandline += " && export LD_LIBRARY_PATH="+ldpath+" && " commandline += " make bench >bench.log" | def put(file, user, host, path): # prepare the scp - command if (config.has_key("scp")): commandline = config["scp"] else: commandline = "scp " commandline += " "+file+" "+user.strip()+"@"+host.strip() commandline += ":"+os.path.expanduser(path) retval = os.system(commandline) | 769c8fb3ee5ca995d325d83594869802716bffd1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5247/769c8fb3ee5ca995d325d83594869802716bffd1/testBuild.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1378,
12,
768,
16,
729,
16,
1479,
16,
589,
4672,
225,
468,
2911,
326,
30361,
300,
1296,
309,
261,
1425,
18,
5332,
67,
856,
2932,
18461,
6,
3719,
30,
28305,
273,
642,
9614,
18461,
11929... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1378,
12,
768,
16,
729,
16,
1479,
16,
589,
4672,
225,
468,
2911,
326,
30361,
300,
1296,
309,
261,
1425,
18,
5332,
67,
856,
2932,
18461,
6,
3719,
30,
28305,
273,
642,
9614,
18461,
11929... |
src = src[:-1] try: time_t = time.strptime(' '.join(src), fmt) except ValueError: time_t = time.strptime(' '.join(src), fmt.replace('%Y', '%y')) return calendar.timegm(time_t)-delta | src = src.replace(zone.group(), '') if cls.pubdate_fmt is None: src = src.strip().split() try: src[0] = str(cls.DAY_MAP[src[0][:-1]])+',' except KeyError: src[0] = str(cls.FULL_DAY_MAP[src[0][:-1]])+',' try: src[2] = str(cls.MONTH_MAP[src[2]]) except KeyError: src[2] = str(cls.FULL_MONTH_MAP[src[2]]) fmt = '%w, %d %m %Y %H:%M:%S' src = src[:5] try: time_t = time.strptime(' '.join(src), fmt) except ValueError: time_t = time.strptime(' '.join(src), fmt.replace('%Y', '%y')) return calendar.timegm(time_t)-delta else: return calendar.timegm(time.strptime(src, cls.pubdate_fmt)) | def strptime(cls, src): src = src.strip().split() try: src[0] = str(cls.DAY_MAP[src[0][:-1]])+',' except KeyError: src[0] = str(cls.FULL_DAY_MAP[src[0][:-1]])+',' try: src[2] = str(cls.MONTH_MAP[src[2]]) except KeyError: src[2] = str(cls.FULL_MONTH_MAP[src[2]]) fmt = '%w, %d %m %Y %H:%M:%S' delta = 0 if src[-1].startswith('+') or src[-1].startswith('-'): delta = src[-1] hrs, mins = int(delta[1:3]), int(delta[3:5]) delta = 60*(hrs*60 + mins) * (-1 if delta.startswith('-') else 1) src = src[:-1] # Discard timezone information try: time_t = time.strptime(' '.join(src), fmt) except ValueError: time_t = time.strptime(' '.join(src), fmt.replace('%Y', '%y')) return calendar.timegm(time_t)-delta | f69e43e9861306596c1c6143e19195b9e5c0ce70 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9125/f69e43e9861306596c1c6143e19195b9e5c0ce70/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17572,
12,
6429,
16,
1705,
4672,
1705,
273,
1705,
18,
6406,
7675,
4939,
1435,
775,
30,
1705,
63,
20,
65,
273,
609,
12,
6429,
18,
10339,
67,
8352,
63,
4816,
63,
20,
6362,
30,
17,
21,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17572,
12,
6429,
16,
1705,
4672,
1705,
273,
1705,
18,
6406,
7675,
4939,
1435,
775,
30,
1705,
63,
20,
65,
273,
609,
12,
6429,
18,
10339,
67,
8352,
63,
4816,
63,
20,
6362,
30,
17,
21,
... |
return self.changed(item, attribute) | return self.changed(item, attribute, op) | def monitored(self, op, item, attribute, *args, **kwds): return self.changed(item, attribute) | 7f0f49bf5bb90dd2c5010558c09e5c8a697694a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/7f0f49bf5bb90dd2c5010558c09e5c8a697694a5/Query.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
28651,
12,
2890,
16,
1061,
16,
761,
16,
1566,
16,
380,
1968,
16,
2826,
25577,
4672,
327,
365,
18,
6703,
12,
1726,
16,
1566,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
28651,
12,
2890,
16,
1061,
16,
761,
16,
1566,
16,
380,
1968,
16,
2826,
25577,
4672,
327,
365,
18,
6703,
12,
1726,
16,
1566,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
logger.error('Failed to source %s (Error was "%s"). Check your file for syntax errors.', fileName, str(e)) | self.logger.error('Failed to source %s (Error was "%s"). Check your file for syntax errors.', fileName, str(e)) | def override_credits(): credits._Printer__data += '\n\nGanga: The Ganga Developers (http://cern.ch/ganga)\n' copyright._Printer__data += '\n\nCopyright (c) 2000-2008 The Ganga Developers (http://cern.ch/ganga)\n' | cdba4264cfe64fd57a0bc63cf059d34b1ba3dee4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1488/cdba4264cfe64fd57a0bc63cf059d34b1ba3dee4/bootstrap.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3849,
67,
20610,
1282,
13332,
6197,
1282,
6315,
12149,
972,
892,
1011,
2337,
82,
64,
82,
43,
539,
69,
30,
1021,
611,
539,
69,
1505,
8250,
414,
261,
2505,
2207,
14770,
18,
343,
19,
75,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3849,
67,
20610,
1282,
13332,
6197,
1282,
6315,
12149,
972,
892,
1011,
2337,
82,
64,
82,
43,
539,
69,
30,
1021,
611,
539,
69,
1505,
8250,
414,
261,
2505,
2207,
14770,
18,
343,
19,
75,
... |
for docid in db: | def dump_db(dburl, username=None, password=None, boundary=None, output=sys.stdout): db = Database(dburl) if username is not None and password is not None: db.resource.http.add_credentials(username, password) envelope = write_multipart(output, boundary=boundary) for docid in db: doc = db.get(docid, attachments=True) print>>sys.stderr, 'Dumping document %r' % doc.id attachments = doc.pop('_attachments', {}) jsondoc = json.encode(doc) if attachments: parts = envelope.open({ 'Content-ID': doc.id, 'ETag': '"%s"' % doc.rev }) parts.add('application/json', jsondoc) for name, info in attachments.items(): content_type = info.get('content_type') if content_type is None: # CouchDB < 0.8 content_type = info.get('content-type') parts.add(content_type, b64decode(info['data']), { 'Content-ID': name }) parts.close() else: envelope.add('application/json', jsondoc, { 'Content-ID': doc.id, 'ETag': '"%s"' % doc.rev }, ) envelope.close() | ae1b66cb5e34b9cb8bd1f95605c2cf8b31beaec3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9373/ae1b66cb5e34b9cb8bd1f95605c2cf8b31beaec3/dump.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4657,
67,
1966,
12,
1966,
718,
16,
2718,
33,
7036,
16,
2201,
33,
7036,
16,
7679,
33,
7036,
16,
876,
33,
9499,
18,
10283,
4672,
1319,
273,
5130,
12,
1966,
718,
13,
309,
2718,
353,
486... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4657,
67,
1966,
12,
1966,
718,
16,
2718,
33,
7036,
16,
2201,
33,
7036,
16,
7679,
33,
7036,
16,
876,
33,
9499,
18,
10283,
4672,
1319,
273,
5130,
12,
1966,
718,
13,
309,
2718,
353,
486... | |
return 'LIST>|'+(indent-6)*' '+childstr[indent:] | return 'LIST>|'+(indent-6)*' '+childstr[indent+2:] | def to_debug(tree, indent=4, seclevel=0): """ Given the DOM tree for an epytext string (as returned by C{parse()}), return a string encoding it in plaintext. This function is similar to C{to_epytext()}; however, it prints escaped characters in unescaped form, removes colorizing, etc... """ if isinstance(tree, Text): return tree.data if tree.tagName == 'section': seclevel += 1 children = [to_debug(c, indent+2, seclevel) for c in tree.childNodes] childstr = ''.join(children) if tree.tagName == 'para': lines = [' |'+l for l in wordwrap(childstr, indent-6).split('\n')] return '\n'.join(lines)+'\n' elif tree.tagName == 'li': bulletAttr = tree.getAttributeNode('bullet') if bulletAttr: bullet = bulletAttr.value else: bullet = '-' return ' LI>|'+(indent-6)*' '+ bullet + ' ' + childstr[6:].lstrip() elif tree.tagName == 'heading': uline = len(childstr)*_HEADING_CHARS[seclevel-1] return ('SEC'+`seclevel`+'>|'+(indent-6)*' ' + childstr + '\n' + ' |'+(indent-6)*' ' + uline + '\n') elif tree.tagName == 'doctestblock': lines = ['DTST>|'+(indent-6)*' '+line for line in childstr.split('\n')] return '\n'.join(lines) + '\n' elif tree.tagName == 'literalblock': lines = [' LIT>|'+(indent-6)*' '+line for line in childstr.split('\n')] return '\n'.join(lines) + '\n' elif tree.tagName in ('olist', 'ulist'): return 'LIST>|'+(indent-6)*' '+childstr[indent:] elif tree.tagName == 'field': if (len(tree.childNodes) > 1 and tree.childNodes[1].tagName == 'arg'): return (' FLD>|'+(indent-6)*' '+children[0]+'('+ children[1]+'):\n'+''.join(children[2:])) else: return (' FLD>|'+(indent-6)*' '+children[0]+':\n'+ ''.join(children[1:])) elif tree.tagName in ('fieldlist', 'tag', 'arg', 'epytext', 'section'): return childstr else: # Assume that anything else is colorizing. return '<'+tree.tagName+'>'+childstr+'</'+tree.tagName+'>' | 0cc72bd3422be83752480f57dbecac32d991815f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/0cc72bd3422be83752480f57dbecac32d991815f/epytext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
67,
4148,
12,
3413,
16,
3504,
33,
24,
16,
1428,
2815,
33,
20,
4672,
3536,
16803,
326,
4703,
2151,
364,
392,
425,
2074,
955,
533,
261,
345,
2106,
635,
385,
95,
2670,
17767,
3631,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
67,
4148,
12,
3413,
16,
3504,
33,
24,
16,
1428,
2815,
33,
20,
4672,
3536,
16803,
326,
4703,
2151,
364,
392,
425,
2074,
955,
533,
261,
345,
2106,
635,
385,
95,
2670,
17767,
3631,
... |
def get_coll_sons(coll): "Returns a list of sons (first-level descendants) for collection 'coll'." | def get_coll_sons(coll, type='r'): "Returns a list of sons (first-level descendants) of type 'type' for collection 'coll'." | def get_coll_sons(coll): "Returns a list of sons (first-level descendants) for collection 'coll'." coll_sons = [] query = "SELECT c.name FROM collection AS c "\ "LEFT JOIN collection_collection AS cc ON c.id=cc.id_son "\ "LEFT JOIN collection AS ccc ON ccc.id=cc.id_dad "\ "WHERE ccc.name='%s' ORDER BY cc.score DESC" \ % escape_string(coll) res = run_sql(query) for name in res: coll_sons.append(name[0]) return coll_sons | 0f644a3e9a21fa49065fbfbec95493378ff259fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2139/0f644a3e9a21fa49065fbfbec95493378ff259fb/search_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
12910,
67,
816,
87,
12,
12910,
16,
618,
2218,
86,
11,
4672,
315,
1356,
279,
666,
434,
272,
7008,
261,
3645,
17,
2815,
18039,
13,
434,
618,
296,
723,
11,
364,
1849,
296,
1291... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12910,
67,
816,
87,
12,
12910,
16,
618,
2218,
86,
11,
4672,
315,
1356,
279,
666,
434,
272,
7008,
261,
3645,
17,
2815,
18039,
13,
434,
618,
296,
723,
11,
364,
1849,
296,
1291... |
set_options = 1 if (os.environ.has_key("RAWSOCKFD")): | set_options = True if os.environ.has_key("RAWSOCKFD"): | def setup_raw(argv): """Setup the raw socket. Only one raw socket is needed to send any number of packets, so it can be created at startup and root can be dropped; alternatively, a setuid program can set envar RAWSOCKFD and pass it here. The third option is to set raw_proxy in sumiserv.cfg to the address of a server running rawproxd, in which case all raw socket writes will be sent to and sent by that server.""" global raw_socket, raw_proxy set_options = 1 if (os.environ.has_key("RAWSOCKFD")): # Launched from 'launch' # fromfd unavailable on Win32. FastCGI for Perl has an ugly hack # to use fromfd on Windows, but for now 'launch' is Unix-only. raw_socket = socket.fromfd(int(os.environ["RAWSOCKFD"]), socket.AF_INET, socket.IPPROTO_UDP) elif cfg.has_key("raw_proxy"): # Remote raw proxy server raw_proxy_addr_pw = cfg["raw_proxy"].split(" ") if len(raw_proxy_addr_pw) == 1: raw_proxy_ipport = raw_proxy_addr_pw[0] pw = "" elif len(raw_proxy_addr_pw) == 2: (raw_proxy_ipport, pw) = raw_proxy_addr_pw else: fatal(11, "Invalid raw proxy format: " + cfg["raw_proxy"]) raw_proxy_list = raw_proxy_ipport.split(":") if len(raw_proxy_list) == 1: raw_proxy_ip = raw_proxy_list[0] raw_proxy_port = 7010 elif len(raw_proxy_list) == 2: (raw_proxy_ip, raw_proxy_port) = raw_proxy_list raw_proxy_port = int(raw_proxy_port) else: fatal(12, "Invalid raw proxy format2: " + cfg["raw_proxy"]) print "Using raw proxy server at",raw_proxy_ip,"on port",raw_proxy_port try: raw_proxy = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP) raw_proxy.connect((raw_proxy_ip, raw_proxy_port)) except socket.error, e: fatal(13, "Raw proxy connection error: %s %s" % (e[0], e[1])) # Authenticate challenge = raw_proxy.recv(32) if len(challenge) != 32: print "Couldn't read challenge from raw proxy server: ", len(challenge) ss.exit(-6) ctx = md5.md5() ctx.update(challenge) ctx.update(pw) print "Logging into raw proxy..."; raw_proxy.send(ctx.digest()) if len(raw_proxy.recv(1)) != 1: fatal(14, """Raw proxy refused our password! | 70d16121d30ba988d5b58d360835248a53501bdd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2496/70d16121d30ba988d5b58d360835248a53501bdd/sumiserv.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
67,
1899,
12,
19485,
4672,
3536,
7365,
326,
1831,
2987,
18,
5098,
1245,
1831,
2987,
353,
3577,
358,
1366,
1281,
1300,
434,
12640,
16,
1427,
518,
848,
506,
2522,
622,
11850,
471,
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,
3875,
67,
1899,
12,
19485,
4672,
3536,
7365,
326,
1831,
2987,
18,
5098,
1245,
1831,
2987,
353,
3577,
358,
1366,
1281,
1300,
434,
12640,
16,
1427,
518,
848,
506,
2522,
622,
11850,
471,
13... |
self.redirect('/exercises?exid=' + exid + now_proficient_string) | self.redirect('/exercises?exid=' + exid) | def post(self): user = users.get_current_user() if user: key = self.request.get('key') exid = self.request.get('exid') correct = int(self.request.get('correct')) start_time = float(self.request.get('start_time')) | 3e220f2624267eec127e53da6b6c1685923ee167 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12010/3e220f2624267eec127e53da6b6c1685923ee167/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1603,
12,
2890,
4672,
729,
273,
3677,
18,
588,
67,
2972,
67,
1355,
1435,
309,
729,
30,
498,
273,
365,
18,
2293,
18,
588,
2668,
856,
6134,
431,
350,
273,
365,
18,
2293,
18,
588,
2668,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1603,
12,
2890,
4672,
729,
273,
3677,
18,
588,
67,
2972,
67,
1355,
1435,
309,
729,
30,
498,
273,
365,
18,
2293,
18,
588,
2668,
856,
6134,
431,
350,
273,
365,
18,
2293,
18,
588,
2668,... |
'required': "company", | 'required': "type != 'none' and company", | def create_tax(self, cursor, user, template, company_id, template2tax_code, template2account, context=None, template2tax=None, parent_id=False): ''' Create recursively taxes based on template. | 4726d2a2ad09a9dfe73f64fb50235c5a8a38043a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9290/4726d2a2ad09a9dfe73f64fb50235c5a8a38043a/tax.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
8066,
12,
2890,
16,
3347,
16,
729,
16,
1542,
16,
9395,
67,
350,
16,
1542,
22,
8066,
67,
710,
16,
1542,
22,
4631,
16,
819,
33,
7036,
16,
1542,
22,
8066,
33,
7036,
16,
982,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
752,
67,
8066,
12,
2890,
16,
3347,
16,
729,
16,
1542,
16,
9395,
67,
350,
16,
1542,
22,
8066,
67,
710,
16,
1542,
22,
4631,
16,
819,
33,
7036,
16,
1542,
22,
8066,
33,
7036,
16,
982,
... |
return exFatal(e) | return self.exFatal(e) | def unlock(): try: self.closeRpmDB() self.doUnlock() except Errors.LockError, e: return 200 return 0 | 91382336f96fc77a9b60f7508c6b056e98b70555 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/91382336f96fc77a9b60f7508c6b056e98b70555/utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7186,
13332,
775,
30,
365,
18,
4412,
54,
7755,
2290,
1435,
365,
18,
2896,
7087,
1435,
1335,
9372,
18,
2531,
668,
16,
425,
30,
327,
4044,
327,
374,
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,
0,
0,
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,
7186,
13332,
775,
30,
365,
18,
4412,
54,
7755,
2290,
1435,
365,
18,
2896,
7087,
1435,
1335,
9372,
18,
2531,
668,
16,
425,
30,
327,
4044,
327,
374,
2,
-100,
-100,
-100,
-100,
-100,
-100... |
if (self.get(x+1, y) == '-' and self.get(x, y+1) == '|'): return [Line( Point(x*NOMINAL_SIZE+CENTER, y*NOMINAL_SIZE+BOTTOM), Point(x*NOMINAL_SIZE+RIGHT, y*NOMINAL_SIZE+CENTER) )] if (self.get(x-1, y) == '-' and self.get(x, y-1) == '|'): return [Line( Point(x*NOMINAL_SIZE+CENTER, y*NOMINAL_SIZE+TOP), Point(x*NOMINAL_SIZE+LEFT, y*NOMINAL_SIZE+CENTER) )] if (self.get(x-1, y) == '-' and self.get(x, y+1) == '|'): return [Line( Point(x*NOMINAL_SIZE+CENTER, y*NOMINAL_SIZE+BOTTOM), Point(x*NOMINAL_SIZE+LEFT, y*NOMINAL_SIZE+CENTER) )] if (self.get(x+1, y) == '-' and self.get(x, y-1) == '|'): return [Line( Point(x*NOMINAL_SIZE+CENTER, y*NOMINAL_SIZE+TOP), Point(x*NOMINAL_SIZE+RIGHT, y*NOMINAL_SIZE+CENTER) )] return [] | result = [] if self.get(x, y) == '/': if (self.get(x+1, y) == '-' and self.get(x, y+1) == '|'): result.append(Line( Point(x*NOMINAL_SIZE+CENTER, y*NOMINAL_SIZE+BOTTOM), Point(x*NOMINAL_SIZE+RIGHT, y*NOMINAL_SIZE+CENTER) )) if (self.get(x-1, y) == '-' and self.get(x, y-1) == '|'): result.append(Line( Point(x*NOMINAL_SIZE+CENTER, y*NOMINAL_SIZE+TOP), Point(x*NOMINAL_SIZE+LEFT, y*NOMINAL_SIZE+CENTER) )) p1 = p2 = None if self.get(x+1, y-1) == '|': p1 = Point((x+1)*NOMINAL_SIZE+CENTER, y*NOMINAL_SIZE+TOP) elif self.get(x+1, y-1) == '+': p1 = Point((x+1)*NOMINAL_SIZE+CENTER, (y-1)*NOMINAL_SIZE+CENTER) elif self.get(x+1, y-1) == '-': p1 = Point(x*NOMINAL_SIZE+RIGHT, (y-1)*NOMINAL_SIZE+CENTER) elif self.get(x+1, y-1) == '/': p1 = Point(x*NOMINAL_SIZE+RIGHT, y*NOMINAL_SIZE+TOP) elif self.get(x+1, y) == '|': p1 = Point(x*NOMINAL_SIZE+RIGHT+CENTER, y*NOMINAL_SIZE+TOP) elif self.get(x, y-1) == '-': p1 = Point(x*NOMINAL_SIZE+RIGHT, y*NOMINAL_SIZE+TOP-CENTER) if self.get(x-1, y+1) == '|': p2 = Point(x*NOMINAL_SIZE+LEFT-CENTER, (y+1)*NOMINAL_SIZE+TOP) elif self.get(x-1, y+1) == '+': p2 = Point(x*NOMINAL_SIZE+LEFT-CENTER, (y+1)*NOMINAL_SIZE+CENTER) elif self.get(x-1, y+1) == '-': p2 = Point(x*NOMINAL_SIZE, (y+1)*NOMINAL_SIZE+CENTER) elif self.get(x-1, y+1) == '/': p2 = Point(x*NOMINAL_SIZE+LEFT, y*NOMINAL_SIZE+BOTTOM) elif self.get(x-1, y) == '|': p2 = Point(x*NOMINAL_SIZE-CENTER, y*NOMINAL_SIZE+BOTTOM) elif self.get(x, y+1) == '-': p2 = Point(x*NOMINAL_SIZE+LEFT, y*NOMINAL_SIZE+BOTTOM+CENTER) if p1 and p2: result.append(Line(p1, p2)) else: if (self.get(x-1, y) == '-' and self.get(x, y+1) == '|'): result.append(Line( Point(x*NOMINAL_SIZE+CENTER, y*NOMINAL_SIZE+BOTTOM), Point(x*NOMINAL_SIZE+LEFT, y*NOMINAL_SIZE+CENTER) )) if (self.get(x+1, y) == '-' and self.get(x, y-1) == '|'): result.append(Line( Point(x*NOMINAL_SIZE+CENTER, y*NOMINAL_SIZE+TOP), Point(x*NOMINAL_SIZE+RIGHT, y*NOMINAL_SIZE+CENTER) )) p1 = p2 = None if self.get(x-1, y-1) == '|': p1 = Point((x-1)*NOMINAL_SIZE+CENTER, y*NOMINAL_SIZE+TOP) elif self.get(x-1, y-1) == '+': p1 = Point((x-1)*NOMINAL_SIZE+CENTER, y*NOMINAL_SIZE-CENTER) elif self.get(x-1, y-1) == '-': p1 = Point(x*NOMINAL_SIZE+LEFT, (y-1)*NOMINAL_SIZE+CENTER) elif self.get(x-1, y-1) == '\\': p1 = Point(x*NOMINAL_SIZE+LEFT, y*NOMINAL_SIZE+TOP) elif self.get(x-1, y) == '|': p1 = Point(x*NOMINAL_SIZE-CENTER, y*NOMINAL_SIZE+TOP) elif self.get(x, y-1) == '-': p1 = Point(x*NOMINAL_SIZE+LEFT, y*NOMINAL_SIZE+TOP-CENTER) if self.get(x+1, y+1) == '|': p2 = Point(x*NOMINAL_SIZE+RIGHT+CENTER, (y+1)*NOMINAL_SIZE+TOP) elif self.get(x+1, y+1) == '+': p2 = Point(x*NOMINAL_SIZE+RIGHT+CENTER, (y+1)*NOMINAL_SIZE+CENTER) elif self.get(x+1, y+1) == '-': p2 = Point(x*NOMINAL_SIZE+RIGHT, (y+1)*NOMINAL_SIZE+CENTER) elif self.get(x+1, y+1) == '\\': p2 = Point(x*NOMINAL_SIZE+RIGHT, y*NOMINAL_SIZE+BOTTOM) elif self.get(x+1, y) == '|': p2 = Point(x*NOMINAL_SIZE+RIGHT+CENTER, y*NOMINAL_SIZE+BOTTOM) elif self.get(x, y+1) == '-': p2 = Point(x*NOMINAL_SIZE+RIGHT, y*NOMINAL_SIZE+BOTTOM+CENTER) if p1 and p2: result.append(Line(p1, p2)) if result: self.tag([(x,y)], CLASS_JOIN) return result | def _follow_rounded_edge(self, x, y): """check for rounded edges: /- | -\- | | -/ | \- """ #XXX return Arc shapes, not lines if (self.get(x+1, y) == '-' and self.get(x, y+1) == '|'): return [Line( Point(x*NOMINAL_SIZE+CENTER, y*NOMINAL_SIZE+BOTTOM), Point(x*NOMINAL_SIZE+RIGHT, y*NOMINAL_SIZE+CENTER) )] if (self.get(x-1, y) == '-' and self.get(x, y-1) == '|'): return [Line( Point(x*NOMINAL_SIZE+CENTER, y*NOMINAL_SIZE+TOP), Point(x*NOMINAL_SIZE+LEFT, y*NOMINAL_SIZE+CENTER) )] if (self.get(x-1, y) == '-' and self.get(x, y+1) == '|'): return [Line( Point(x*NOMINAL_SIZE+CENTER, y*NOMINAL_SIZE+BOTTOM), Point(x*NOMINAL_SIZE+LEFT, y*NOMINAL_SIZE+CENTER) )] if (self.get(x+1, y) == '-' and self.get(x, y-1) == '|'): return [Line( Point(x*NOMINAL_SIZE+CENTER, y*NOMINAL_SIZE+TOP), Point(x*NOMINAL_SIZE+RIGHT, y*NOMINAL_SIZE+CENTER) )] return [] | 148f0ecef28839da3f1a261509f7b089a2c0d9e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1203/148f0ecef28839da3f1a261509f7b089a2c0d9e5/aafigure.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
14641,
67,
27561,
67,
7126,
12,
2890,
16,
619,
16,
677,
4672,
3536,
1893,
364,
16729,
5231,
30,
342,
17,
565,
571,
377,
300,
12907,
565,
571,
571,
565,
300,
19,
1377,
571,
377,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
14641,
67,
27561,
67,
7126,
12,
2890,
16,
619,
16,
677,
4672,
3536,
1893,
364,
16729,
5231,
30,
342,
17,
565,
571,
377,
300,
12907,
565,
571,
571,
565,
300,
19,
1377,
571,
377,
... |
caller=inspect.stack()[1] | caller=inspect.stack()[2] | def dprint(str=''): if TRACING: _traceoff() caller=inspect.stack()[1] try: namespace=caller[0].f_locals if 'self' in namespace: cls=namespace['self'].__class__.__name__+'.' else: cls='' if isinstance(str, unicode): str = str.encode("utf-8") dlogfh.write("%s:%d %s%s: %s%s" % (os.path.basename(caller[1]),caller[2],cls,caller[3],str,os.linesep)) finally: del caller if TRACING: _traceon() return True | 8f5b7f0ca129204ff5878e55f9ec1fee212ec24d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11522/8f5b7f0ca129204ff5878e55f9ec1fee212ec24d/debug.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
302,
1188,
12,
701,
2218,
11,
4672,
309,
4235,
2226,
1360,
30,
389,
5129,
3674,
1435,
377,
4894,
33,
12009,
18,
3772,
1435,
63,
22,
65,
775,
30,
1981,
33,
16140,
63,
20,
8009,
74,
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,
302,
1188,
12,
701,
2218,
11,
4672,
309,
4235,
2226,
1360,
30,
389,
5129,
3674,
1435,
377,
4894,
33,
12009,
18,
3772,
1435,
63,
22,
65,
775,
30,
1981,
33,
16140,
63,
20,
8009,
74,
67... |
self.announce("f2py-opts: %s" % string.join(f2py_opts2,' ')) | self.announce("f2py-opts: %s" % \ string.join(f2py_opts2,' ')) | def f2py_sources (self, sources, ext): | cf5035a497ee83adb91090bf4f4d3c6faf969b9f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/cf5035a497ee83adb91090bf4f4d3c6faf969b9f/run_f2py.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
22,
2074,
67,
10141,
261,
2890,
16,
5550,
16,
1110,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
22,
2074,
67,
10141,
261,
2890,
16,
5550,
16,
1110,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
asyncore.dispatcher.close(self) | def close(self): if self.idler is not None and not self.idler.cancelled: self.idler.cancel() asyncore.dispatcher.close(self) | 0e25bc513f061243045ddb058759c4eeb2bc448c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3782/0e25bc513f061243045ddb058759c4eeb2bc448c/ftpserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
12,
2890,
4672,
309,
365,
18,
22515,
353,
486,
599,
471,
486,
365,
18,
22515,
18,
10996,
1259,
30,
365,
18,
22515,
18,
10996,
1435,
4326,
479,
18,
18495,
18,
4412,
12,
2890,
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,
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,
1746,
12,
2890,
4672,
309,
365,
18,
22515,
353,
486,
599,
471,
486,
365,
18,
22515,
18,
10996,
1259,
30,
365,
18,
22515,
18,
10996,
1435,
4326,
479,
18,
18495,
18,
4412,
12,
2890,
13,
... | |
dev_list = re.findall(PCI_DEV_REG_EXPRESS_STR, '%s' % dev_list) | dev_list = extract_the_exact_pci_names('%s' % dev_list) | def find_coassigned_pci_devices(self, ignore_bridge = True): ''' Here'self' is a PCI device, we need find the uppermost PCI/PCI-X bridge, and all devices behind it must be co-assigned to the same guest. Parameter: [ignore_bridge]: if set, the returned result doesn't include any bridge behind the uppermost PCI/PCI-X bridge. Note: The first element of the return value is the uppermost PCI/PCI-X bridge. If the caller doesn't need the first element, the caller itself can remove it explicitly. ''' dev = self.find_the_uppermost_pci_bridge() | 0d974155677fda82bdaf678e29b0f30411f06134 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6195/0d974155677fda82bdaf678e29b0f30411f06134/pci.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
2894,
15938,
67,
2436,
77,
67,
12506,
12,
2890,
16,
2305,
67,
18337,
273,
1053,
4672,
9163,
13743,
1807,
19079,
11,
353,
279,
453,
7266,
2346,
16,
732,
1608,
1104,
326,
3854,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
2894,
15938,
67,
2436,
77,
67,
12506,
12,
2890,
16,
2305,
67,
18337,
273,
1053,
4672,
9163,
13743,
1807,
19079,
11,
353,
279,
453,
7266,
2346,
16,
732,
1608,
1104,
326,
3854,
... |
result = S_ERROR('JobDB.setJobOptParameter: operation failed.') result = self._insert('OptimizerParameters',['JobID','Name','Value'],[jobID, name, value]) if not result['OK']: return S_ERROR('JobDB.setJobOptParameter: operation failed.') | result = S_ERROR( 'JobDB.setJobOptParameter: operation failed.' ) result = self._insert( 'OptimizerParameters', ['JobID', 'Name', 'Value'], [jobID, name, value] ) if not result['OK']: return S_ERROR( 'JobDB.setJobOptParameter: operation failed.' ) | def setJobOptParameter(self,jobID,name,value): """ Set an optimzer parameter specified by name,value pair for the job JobID """ ret = self._escapeString(jobID) if not ret['OK']: return ret e_jobID = ret['Value'] | 99c1bc850ba087890925b3180df206f65bb1d4b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/99c1bc850ba087890925b3180df206f65bb1d4b3/JobDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
2278,
6179,
1662,
12,
2890,
16,
4688,
734,
16,
529,
16,
1132,
4672,
3536,
1000,
392,
5213,
24355,
1569,
1269,
635,
508,
16,
1132,
3082,
364,
326,
1719,
22137,
3536,
325,
273,
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,
444,
2278,
6179,
1662,
12,
2890,
16,
4688,
734,
16,
529,
16,
1132,
4672,
3536,
1000,
392,
5213,
24355,
1569,
1269,
635,
508,
16,
1132,
3082,
364,
326,
1719,
22137,
3536,
325,
273,
365,
... |
if not os.path.exists(filename[0:-1]): raise CoverageException, ("No source for compiled code '%s'." % filename) filename = filename[0:-1] elif ext != '.py': raise CoverageException, "File '%s' not Python source." % filename source = open(filename, 'r') lines, excluded_lines, line_map = self.find_executable_statements( source.read(), exclude=self.exclude_re ) source.close() | if not os.path.exists(filename[:-1]): source = self.get_zip_data(filename[:-1]) if not source: raise CoverageException( "No source for compiled code '%s'." % filename ) filename = filename[:-1] if not source: sourcef = open(filename, 'rU') source = sourcef.read() try: lines, excluded_lines, line_map = self.find_executable_statements( source, exclude=self.exclude_re ) except SyntaxError, synerr: raise CoverageException( "Couldn't parse '%s' as Python source: '%s' at line %d" % (filename, synerr.msg, synerr.lineno) ) if sourcef: sourcef.close() | def analyze_morf(self, morf): if morf in self.analysis_cache: return self.analysis_cache[morf] filename = self.morf_filename(morf) ext = os.path.splitext(filename)[1] if ext == '.pyc': if not os.path.exists(filename[0:-1]): raise CoverageException, ("No source for compiled code '%s'." % filename) filename = filename[0:-1] elif ext != '.py': raise CoverageException, "File '%s' not Python source." % filename source = open(filename, 'r') lines, excluded_lines, line_map = self.find_executable_statements( source.read(), exclude=self.exclude_re ) source.close() result = filename, lines, excluded_lines, line_map self.analysis_cache[morf] = result return result | 6554c74cd9574cf89b8acd0a0333651afacbfa8e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11312/6554c74cd9574cf89b8acd0a0333651afacbfa8e/coverage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12375,
67,
81,
280,
74,
12,
2890,
16,
31213,
74,
4672,
309,
31213,
74,
316,
365,
18,
12746,
67,
2493,
30,
327,
365,
18,
12746,
67,
2493,
63,
81,
280,
74,
65,
1544,
273,
365,
18,
81... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12375,
67,
81,
280,
74,
12,
2890,
16,
31213,
74,
4672,
309,
31213,
74,
316,
365,
18,
12746,
67,
2493,
30,
327,
365,
18,
12746,
67,
2493,
63,
81,
280,
74,
65,
1544,
273,
365,
18,
81... |
list.append((descr,port)) | if port != "DVI-PC": list.append((descr,port)) | def listInputChannels(self): hw_type = HardwareInfo().get_device_name() list = [] | 20c942082eedd5307bd331e4097b9892adaed120 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6652/20c942082eedd5307bd331e4097b9892adaed120/VideoWizard.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
1210,
10585,
12,
2890,
4672,
16139,
67,
723,
273,
27438,
966,
7675,
588,
67,
5964,
67,
529,
1435,
666,
273,
5378,
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,
666,
1210,
10585,
12,
2890,
4672,
16139,
67,
723,
273,
27438,
966,
7675,
588,
67,
5964,
67,
529,
1435,
666,
273,
5378,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
def __init__(self, display=1, logdir=None, context=5, file=None): | def __init__(self, display=1, logdir=None, context=5, file=None, format="html"): | def __init__(self, display=1, logdir=None, context=5, file=None): self.display = display # send tracebacks to browser if true self.logdir = logdir # log tracebacks to files if not None self.context = context # number of source code lines per frame self.file = file or sys.stdout # place to send the output | 364ca40c2a053718f67c2032769de1f1fd76bb22 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/364ca40c2a053718f67c2032769de1f1fd76bb22/cgitb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2562,
33,
21,
16,
613,
1214,
33,
7036,
16,
819,
33,
25,
16,
585,
33,
7036,
16,
740,
1546,
2620,
6,
4672,
365,
18,
5417,
273,
2562,
1850,
468,
1366,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2562,
33,
21,
16,
613,
1214,
33,
7036,
16,
819,
33,
25,
16,
585,
33,
7036,
16,
740,
1546,
2620,
6,
4672,
365,
18,
5417,
273,
2562,
1850,
468,
1366,
1... |
def __init__(self): if _debug: print "\t%s: Called LinePlot.__init__()" % rendererName pass | def __init__(self, scene): """ Initialisation of the ContourPlot class @param scene: the scene with which to associate the line plot @type scene: Scene object """ Plot.__init__() debugMsg("Called LinePlot.__init__()") | def __init__(self): if _debug: print "\t%s: Called LinePlot.__init__()" % rendererName pass | 2c6f5854681d121be831d4c08049300ffd9a9194 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8476/2c6f5854681d121be831d4c08049300ffd9a9194/plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
309,
389,
4148,
30,
1172,
1548,
88,
9,
87,
30,
11782,
5377,
11532,
16186,
2738,
972,
10031,
738,
5690,
461,
1342,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
309,
389,
4148,
30,
1172,
1548,
88,
9,
87,
30,
11782,
5377,
11532,
16186,
2738,
972,
10031,
738,
5690,
461,
1342,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
title_label = Label(self.title, wrap=True) | def build_text(self): vbox = VBox(spacing=6) title_label = Label(self.title, wrap=True) description_label = Label(self.description, wrap=True) title_label.set_bold(True) description_label.set_bold(True) title_label.set_size_request(360, -1) description_label.set_size_request(360, -1) vbox.pack_start(title_label) vbox.pack_start(description_label) return vbox | f8629cd0337442b0f9962dc18979ef5ce89e50ea /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12354/f8629cd0337442b0f9962dc18979ef5ce89e50ea/window.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
955,
12,
2890,
4672,
331,
2147,
273,
776,
3514,
12,
14080,
33,
26,
13,
2477,
67,
1925,
273,
5287,
12,
2890,
18,
3384,
16,
2193,
33,
5510,
13,
2077,
67,
1925,
18,
542,
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,
1361,
67,
955,
12,
2890,
4672,
331,
2147,
273,
776,
3514,
12,
14080,
33,
26,
13,
2477,
67,
1925,
273,
5287,
12,
2890,
18,
3384,
16,
2193,
33,
5510,
13,
2077,
67,
1925,
18,
542,
67,
... | |
self.SetViewWhiteSpace (stc.STC_WS_VISIBLEALWAYS) self.SetViewEOL (True) | self.setDebugWhitespace () | def updateDisplayByItems (self): self.SetReadOnly (False) self.numFullColumns = len (self.items) / self.viewWindow.height | 0d03e682bd4e82b7034aecb5365658f3d6516468 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9028/0d03e682bd4e82b7034aecb5365658f3d6516468/candy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
4236,
858,
3126,
261,
2890,
4672,
365,
18,
694,
12066,
261,
8381,
13,
365,
18,
2107,
5080,
3380,
273,
562,
261,
2890,
18,
3319,
13,
342,
365,
18,
1945,
3829,
18,
4210,
2,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
4236,
858,
3126,
261,
2890,
4672,
365,
18,
694,
12066,
261,
8381,
13,
365,
18,
2107,
5080,
3380,
273,
562,
261,
2890,
18,
3319,
13,
342,
365,
18,
1945,
3829,
18,
4210,
2,
-100,
... |
if (PkgSelected(opts,"FMOD")): cmd = cmd + ' -Lthirdparty/linux-libs-a/fmod/lib -lfmod-3.74' | def CompileLinkLINUXA(wdll, obj, wobj, opts, dll, ldef): if (dll[-4:]==".exe"): cmd = 'g++ -o ' + wdll + ' -Lbuilt/lib -L/usr/X11R6/lib' else: cmd = 'g++ -shared -o ' + wdll + ' -Lbuilt/lib -L/usr/X11R6/lib' for x in obj: suffix = x[-4:] if (suffix==".obj"): cmd = cmd + ' built/tmp/' + x[:-4] + '.o' elif (suffix==".dll"): cmd = cmd + ' -l' + x[3:-4] elif (suffix==".lib"): cmd = cmd + ' built/lib/' + x[:-4] + '.a' elif (suffix==".ilb"): cmd = cmd + ' built/tmp/' + x[:-4] + '.a' if (PkgSelected(opts,"FMOD")): cmd = cmd + ' -Lthirdparty/linux-libs-a/fmod/lib -lfmod-3.74' if (PkgSelected(opts,"FMODEX")): cmd = cmd + ' -Lthirdparty/linux-libs-a/fmodex/lib -lfmod-3.74' if (PkgSelected(opts,"NVIDIACG")): cmd = cmd + ' -Lthirdparty/nvidiacg/lib ' if (opts.count("CGGL")): cmd = cmd + " -lCgGL" cmd = cmd + " -lCg" if (PkgSelected(opts,"NSPR")): cmd = cmd + ' -Lthirdparty/linux-libs-a/nspr/lib -lpandanspr4' if (PkgSelected(opts,"ZLIB")): cmd = cmd + " -lz" if (PkgSelected(opts,"PNG")): cmd = cmd + " -lpng" if (PkgSelected(opts,"JPEG")): cmd = cmd + " -ljpeg" if (PkgSelected(opts,"TIFF")): cmd = cmd + " -ltiff" if (PkgSelected(opts,"OPENSSL")): cmd = cmd + " -lssl" if (PkgSelected(opts,"FREETYPE")): cmd = cmd + " -lfreetype" if (PkgSelected(opts,"VRPN")): cmd = cmd + ' -Lthirdparty/linux-libs-a/vrpn/lib -lvrpn -lquat' if (PkgSelected(opts,"FFTW")): cmd = cmd + ' -Lthirdparty/linux-libs-a/fftw/lib -lrfftw -lfftw' if (opts.count("GLUT")): cmd = cmd + " -lGL -lGLU" oscmd(cmd) | a996ac16ff952120272d0fdfc857572952160b6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8543/a996ac16ff952120272d0fdfc857572952160b6f/makepanda.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16143,
2098,
20663,
57,
17269,
12,
3623,
2906,
16,
1081,
16,
341,
2603,
16,
1500,
16,
302,
2906,
16,
328,
536,
4672,
309,
261,
27670,
18919,
24,
26894,
631,
9654,
14880,
6,
4672,
1797,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16143,
2098,
20663,
57,
17269,
12,
3623,
2906,
16,
1081,
16,
341,
2603,
16,
1500,
16,
302,
2906,
16,
328,
536,
4672,
309,
261,
27670,
18919,
24,
26894,
631,
9654,
14880,
6,
4672,
1797,
... | |
cStyleComment = Regex(r"\/\*[\s\S]*?\*\/") | cStyleComment = Regex(r"\/\*[\s\S]*?\*\/").setName("C style comment") | def makeXMLTags(tagStr): """Helper to construct opening and closing tag expressions for XML, given a tag name""" return _makeTags( tagStr, True ) | 4dd667da6e48068600070158aa6be25adb8d1a4e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3693/4dd667da6e48068600070158aa6be25adb8d1a4e/pyparsing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
4201,
3453,
12,
2692,
1585,
4672,
3536,
2276,
358,
4872,
10890,
471,
7647,
1047,
8041,
364,
3167,
16,
864,
279,
1047,
508,
8395,
327,
389,
6540,
3453,
12,
1047,
1585,
16,
1053,
262... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
4201,
3453,
12,
2692,
1585,
4672,
3536,
2276,
358,
4872,
10890,
471,
7647,
1047,
8041,
364,
3167,
16,
864,
279,
1047,
508,
8395,
327,
389,
6540,
3453,
12,
1047,
1585,
16,
1053,
262... |
wantx = norm(cross(Y,wantz)) wanty = cross(wantz,wantx) | wantx = norm(cross(Y, wantz)) wanty = cross(wantz, wantx) | def set_cov(self):#060218... doesn't yet work very well. need to check if 6*self.glpane.scale is correct... # not that i know what would fail if not. return ###### try: space = self.command # since this method is in the GraphicsMode glpane = self.glpane cov = - glpane.pov # center of view, ie what camera is looking at guy_offset = space.guy.pos - cov # camera wants to rotate, but can't do this super-quickly, and it might have inertia, not sure... # kluge, test: set cov to some fraction of the distance newcov = + cov newcov += guy_offset * 0.2 # now figure out new pos of camera (maintains distance), then new angle... what is old pos of camera? eyeball = (glpane.quat).unrot(V(0,0,6*glpane.scale)) - glpane.pov # code copied from selectMode; the 6 might be wrong # took out - from -glpane.quat since it looks wrong... this drastically improved it, still not perfect. # but it turned out that was wrong! There was some other bug (what was it? I forget). # And th - was needed. I prefer to put in unrot instead. _debug_oldeye = + eyeball desireddist = 6*glpane.scale nowdist = vlen(eyeball - newcov) #k not used? should it be? # now move it partway towards guy... what about elevation? should we track its shadow instead? # ignore for now and see what happens? or just use fixed ratio? desired_elev = 2 * glpane.scale ## guess desired_h_dist = math.sqrt( desireddist * desireddist - desired_elev * desired_elev) | 55ac4fdc2a170bd52fcbe417587721669a976b6f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/55ac4fdc2a170bd52fcbe417587721669a976b6f/test_animation_mode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
14014,
12,
2890,
4672,
7,
7677,
3103,
2643,
2777,
3302,
1404,
4671,
1440,
8572,
5492,
18,
1608,
358,
866,
309,
1666,
14,
2890,
18,
7043,
29009,
18,
5864,
353,
3434,
2777,
468,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
14014,
12,
2890,
4672,
7,
7677,
3103,
2643,
2777,
3302,
1404,
4671,
1440,
8572,
5492,
18,
1608,
358,
866,
309,
1666,
14,
2890,
18,
7043,
29009,
18,
5864,
353,
3434,
2777,
468,
... |
def process_wiki_target(self, target): self.process_wiki_text(target) self.add_wiki_markup() | return True | def process_inline(self, node, uri_string): """ Process the "inline:" link scheme. This can either come from visit_reference or from visit_image. The uri_string changes depending on the caller. The uri is passed to MoinMoin to handle the inline link. If it is an image, the src line is extracted and passed to the html4css1 writer to allow the reST image attributes. Otherwise, the html from MoinMoin is inserted into the reST document and SkipNode is raised. """ self.process_wiki_text(node[uri_string]) # Only pass the src and alt parts to the writer. The reST writer # inserts its own tags so we don't need the MoinMoin html markup. src = re.search('src="([^"]+)"', self.wiki_text) if src: node['uri'] = src.groups()[0] if not 'alt' in node.attributes: alt = re.search('alt="([^"]*)"', self.wiki_text) if alt: node['alt'] = alt.groups()[0] else: # Image doesn't exist yet for the page so just use what's # returned from MoinMoin. self.wiki_text = self.fixup_wiki_formatting(self.wiki_text) self.add_wiki_markup() | 9f752108b6fd42db83c75b9b1560912b9f2e5da6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/888/9f752108b6fd42db83c75b9b1560912b9f2e5da6/rst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
10047,
12,
2890,
16,
756,
16,
2003,
67,
1080,
4672,
3536,
4389,
326,
315,
10047,
2773,
1692,
4355,
18,
1220,
848,
3344,
12404,
628,
3757,
67,
6180,
578,
628,
3757,
67,
2730,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
10047,
12,
2890,
16,
756,
16,
2003,
67,
1080,
4672,
3536,
4389,
326,
315,
10047,
2773,
1692,
4355,
18,
1220,
848,
3344,
12404,
628,
3757,
67,
6180,
578,
628,
3757,
67,
2730,
... |
r = (40, 40, 400, 300) | r = windowbounds(400, 400) | def open(self, path, name, data): self.path = path self.name = name r = (40, 40, 400, 300) w = Win.NewWindow(r, name, 1, 0, -1, 1, 0x55555555) self.wid = w r2 = (0, 0, 345, 245) Qd.SetPort(w) Qd.TextFont(4) Qd.TextSize(9) self.ted = TE.TENew(r2, r2) self.ted.TEAutoView(1) self.ted.TESetText(data) w.DrawGrowIcon() self.scrollbars() self.changed = 0 self.do_postopen() self.do_activate(1, None) | 4e0726f4da81ce97d19f5ddb53c6fb214d6c77fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/4e0726f4da81ce97d19f5ddb53c6fb214d6c77fd/ped.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
2890,
16,
589,
16,
508,
16,
501,
4672,
365,
18,
803,
273,
589,
365,
18,
529,
273,
508,
436,
273,
2742,
10576,
12,
16010,
16,
7409,
13,
341,
273,
21628,
18,
1908,
3829,
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,
1696,
12,
2890,
16,
589,
16,
508,
16,
501,
4672,
365,
18,
803,
273,
589,
365,
18,
529,
273,
508,
436,
273,
2742,
10576,
12,
16010,
16,
7409,
13,
341,
273,
21628,
18,
1908,
3829,
12,
... |
extreme_wilson{ | extreme_wilson{ | def select_crystal_symmetry( from_command_line, from_parameter_file, from_coordinate_files, from_reflection_files): result = crystal.symmetry( unit_cell=None, space_group_info=None) if (from_command_line is not None): result = result.join_symmetry( other_symmetry=from_command_line, force=False) if (from_parameter_file is not None): result = result.join_symmetry( other_symmetry=from_parameter_file, force=False) if (result.unit_cell() is None): for crystal_symmetry in from_reflection_files: unit_cell = crystal_symmetry.unit_cell() if (unit_cell is not None): result = crystal.symmetry( unit_cell=unit_cell, space_group_info=result.space_group_info(), assert_is_compatible_unit_cell=False) break for crystal_symmetry in from_coordinate_files: result = result.join_symmetry(other_symmetry=crystal_symmetry, force=False) if (result.space_group_info() is None): for crystal_symmetry in from_reflection_files: space_group_info = crystal_symmetry.space_group_info() if (space_group_info is not None): result = crystal.symmetry( unit_cell=result.unit_cell(), space_group_info=space_group_info, assert_is_compatible_unit_cell=False) break return result | 95ea40706150efdd497c59bd7453515caa13e6e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/696/95ea40706150efdd497c59bd7453515caa13e6e4/remove_outliers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2027,
67,
3353,
31365,
67,
8117,
18042,
12,
628,
67,
3076,
67,
1369,
16,
628,
67,
6775,
67,
768,
16,
628,
67,
29191,
67,
2354,
16,
628,
67,
26606,
67,
2354,
4672,
563,
273,
4422,
313... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2027,
67,
3353,
31365,
67,
8117,
18042,
12,
628,
67,
3076,
67,
1369,
16,
628,
67,
6775,
67,
768,
16,
628,
67,
29191,
67,
2354,
16,
628,
67,
26606,
67,
2354,
4672,
563,
273,
4422,
313... |
self.assert_(msg.content.body == body) | self.assert_(msg.body == body) | def test_simple_delivery_queued(self): """ Test basic message delivery where publish is issued before consume (i.e. requires queueing of the message) """ session = self.session session.queue_declare(queue="test-queue", exclusive=True, auto_delete=True) session.exchange_bind(queue="test-queue", exchange="amq.fanout") body = "Queued Delivery" session.message_transfer("amq.fanout", None, None, Message(body)) | 58f3151dc5d3f52eed6fb9599e9b00ff745a30f5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/197/58f3151dc5d3f52eed6fb9599e9b00ff745a30f5/broker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9647,
67,
15703,
67,
19499,
12,
2890,
4672,
3536,
7766,
5337,
883,
7912,
1625,
3808,
353,
16865,
1865,
7865,
261,
77,
18,
73,
18,
4991,
2389,
310,
434,
326,
883,
13,
3536,
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,
1842,
67,
9647,
67,
15703,
67,
19499,
12,
2890,
4672,
3536,
7766,
5337,
883,
7912,
1625,
3808,
353,
16865,
1865,
7865,
261,
77,
18,
73,
18,
4991,
2389,
310,
434,
326,
883,
13,
3536,
13... |
syncWidget(widget) | if widget.blockItem.contentsCollection is not None: syncWidget(widget) | def syncWidget(w): w.wxSynchronizeWidget() | 85a4c26247bf451a765dad70e5ac5132afd876a0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/85a4c26247bf451a765dad70e5ac5132afd876a0/CalendarCanvas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3792,
4609,
12,
91,
4672,
341,
18,
27226,
19298,
554,
4609,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3792,
4609,
12,
91,
4672,
341,
18,
27226,
19298,
554,
4609,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
wx.GetApp().CallItemMethodAsync("MainView", 'setStatusMessage', _(u"Search found nothing")) | app.CallItemMethodAsync("MainView", 'setStatusMessage', _(u"Search found nothing")) | def processQuickEntry(self, command): """ Parses the text in the quick item entry widget in the toolbar. Creates the items depending on the command and adds it to the appropriate collection. Also parses the date/time info and sets the start/end time or the reminder time. """ msgFlag = False eventFlag = False taskFlag = False # Default kind defaultKind = sidebar.filterClass # Search the text for "/" which indicates it is a quick item entry cmd_re = re.compile(r'/(?P<kind>([A-z]+))') cmd = cmd_re.match(command) if cmd is None: if defaultKind is not None: if defaultKind == pim.tasks.TaskStamp: taskFlag = True elif defaultKind == pim.mail.MailStamp: msgFlag = True elif defaultKind == pim.calendar.Calendar.EventStamp: eventFlag = True displayName = command while cmd is not None: kind = (cmd.group('kind')).lower() displayName = command[(cmd.end()):].strip() command = displayName # Set flags depending on its kind if kind == 'search': return False elif kind == 'task': taskFlag = True elif kind in ('msg', 'message'): msgFlag = True elif kind == 'event': eventFlag = True elif kind == 'invite': eventFlag = True msgFlag = True elif kind == 'request': taskFlag = True msgFlag = True elif kind != 'note': # if command is not 'note' then it is not a valid command. for eg: '/foo' return False cmd = cmd_re.match(displayName) | 689873a6bcbe7ebfe206015bd4c69513dc6951e1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/689873a6bcbe7ebfe206015bd4c69513dc6951e1/Main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
13663,
1622,
12,
2890,
16,
1296,
4672,
3536,
2280,
2420,
326,
977,
316,
326,
9549,
761,
1241,
3604,
316,
326,
12748,
18,
10210,
326,
1516,
8353,
603,
326,
1296,
471,
4831,
518,
358... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
13663,
1622,
12,
2890,
16,
1296,
4672,
3536,
2280,
2420,
326,
977,
316,
326,
9549,
761,
1241,
3604,
316,
326,
12748,
18,
10210,
326,
1516,
8353,
603,
326,
1296,
471,
4831,
518,
358... |
author= element.getTaggedValue('author', self.author) or 'unknown' | author= element.getOption('author', element, self.author) or 'unknown' | def generateModuleInfoHeader(self, outfile, modulename, element): if not self.module_info_header: return | 08a5371ff27a21ecfcb6580102f3117ebcea6d32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11941/08a5371ff27a21ecfcb6580102f3117ebcea6d32/ArchetypesGenerator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
3120,
966,
1864,
12,
2890,
16,
8756,
16,
31961,
16,
930,
4672,
309,
486,
365,
18,
2978,
67,
1376,
67,
3374,
30,
327,
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,
2103,
3120,
966,
1864,
12,
2890,
16,
8756,
16,
31961,
16,
930,
4672,
309,
486,
365,
18,
2978,
67,
1376,
67,
3374,
30,
327,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
imagedata = DupePage.getLatestUploader()[1] | if DupePage == self.image and self.timestamp != None: imagedata = self.timestamp else: imagedata = DupePage.getLatestUploader()[1] | def checkImageDuplicated(self, duplicates_rollback): """ Function to check the duplicated images. """ # {{Dupe|Image:Blanche_Montel.jpg}} # Skip the stub images #if 'stub' in self.imageName.lower() and self.project == 'wikipedia' and self.site.lang == 'it': # return True # Skip the stub, ok dupText = wikipedia.translate(self.site, duplicatesText) dupRegex = wikipedia.translate(self.site, duplicatesRegex) dupTalkHead = wikipedia.translate(self.site, duplicate_user_talk_head) dupTalkText = wikipedia.translate(self.site, duplicates_user_talk_text) dupComment_talk = wikipedia.translate(self.site, duplicates_comment_talk) dupComment_image = wikipedia.translate(self.site, duplicates_comment_image) duplicateRegex = r'\n\*(?:\[\[:Image:%s\]\] has the following duplicates(?: \(\'\'\'forced mode\'\'\'\)|):|\*\[\[:Image:%s\]\])$' % (self.convert_to_url(self.imageName), self.convert_to_url(self.imageName)) imagePage = wikipedia.ImagePage(self.site, u'Image:%s' % self.imageName) hash_found = imagePage.getHash() duplicates = self.site.getImagesFromAnHash(hash_found) if duplicates == None: return False # Error, image deleted, no hash found. Skip the image. if len(duplicates) > 1: if len(duplicates) == 2: wikipedia.output(u'%s has a duplicate! Reporting it...' % self.imageName) else: wikipedia.output(u'%s has %s duplicates! Reporting them...' % (self.imageName, len(duplicates) - 1)) if not dupText == None and not dupRegex == None: time_image_list = list() time_list = list() for duplicate in duplicates: DupePage = wikipedia.ImagePage(self.site, u'Image:%s' % duplicate) imagedata = DupePage.getLatestUploader()[1] # '2008-06-18T08:04:29Z' data = time.strptime(imagedata, u"%Y-%m-%dT%H:%M:%SZ") data_seconds = time.mktime(data) time_image_list.append([data_seconds, duplicate]) time_list.append(data_seconds) older_image = self.returnOlderTime(time_image_list, time_list) # And if the images are more than two? Page_oder_image = wikipedia.ImagePage(self.site, u'Image:%s' % older_image) string = '' images_to_tag_list = [] for duplicate in duplicates: if wikipedia.ImagePage(self.site, u'%s:%s' % (self.image_namespace, duplicate)) == \ wikipedia.ImagePage(self.site, u'%s:%s' % (self.image_namespace, older_image)): continue # the older image, not report also this as duplicate DupePage = wikipedia.ImagePage(self.site, u'Image:%s' % duplicate) try: DupPageText = DupePage.get() older_page_text = Page_oder_image.get() except wikipedia.NoPage: continue # The page doesn't exists if re.findall(dupRegex, DupPageText) == [] and re.findall(dupRegex, older_page_text) == []: wikipedia.output(u'%s is a duplicate and has to be tagged...' % duplicate) images_to_tag_list.append(duplicate) #if duplicate != duplicates[-1]: string += u"*[[:%s%s]]\n" % (self.image_namespace, duplicate) #else: # string += "*[[:%s%s]]" % (self.image_namespace, duplicate) else: wikipedia.output(u"Already put the dupe-template in the image's page or in the dupe's page. Skip.") return True # Ok - No problem. Let's continue the checking phase older_image_ns = u'%s%s' % (self.image_namespace, older_image) # adding the namespace only_report = False # true if the image are not to be tagged as dupes | 13ae2b2efc0f23258500db58afe50ac2fd09d224 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/13ae2b2efc0f23258500db58afe50ac2fd09d224/checkimages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
2040,
19682,
690,
12,
2890,
16,
11211,
67,
20050,
4672,
3536,
4284,
358,
866,
326,
16975,
4602,
18,
3536,
468,
10179,
40,
89,
347,
96,
2040,
30,
4802,
304,
18706,
67,
49,
1580,
29... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
2040,
19682,
690,
12,
2890,
16,
11211,
67,
20050,
4672,
3536,
4284,
358,
866,
326,
16975,
4602,
18,
3536,
468,
10179,
40,
89,
347,
96,
2040,
30,
4802,
304,
18706,
67,
49,
1580,
29... |
self.waterpumpitem.connect("button_press_event", gcompris.utils.item_event_focus) | gcompris.utils.item_focus_init(self.waterpumpitem, None) | def start(self): self.gcomprisBoard.level=1 self.gcomprisBoard.maxlevel=1 self.gcomprisBoard.sublevel=1 self.gcomprisBoard.number_of_sublevel=1 | 43391a08b217b2de454c37878789a4913b8c75ad /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11306/43391a08b217b2de454c37878789a4913b8c75ad/watercycle.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
4672,
365,
18,
75,
832,
683,
291,
22233,
18,
2815,
33,
21,
365,
18,
75,
832,
683,
291,
22233,
18,
1896,
2815,
33,
21,
365,
18,
75,
832,
683,
291,
22233,
18,
87,
1255... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
4672,
365,
18,
75,
832,
683,
291,
22233,
18,
2815,
33,
21,
365,
18,
75,
832,
683,
291,
22233,
18,
1896,
2815,
33,
21,
365,
18,
75,
832,
683,
291,
22233,
18,
87,
1255... |
for key, value in form.clean_data.items(): | formdata = getattr(form, "cleaned_data", getattr(form, "clean_data", None)) for key, value in formdata.items(): | def do_change_profile(request): form = ChangeProfileForm(request.POST) form.full_clean() if not form.errors: for key, value in form.clean_data.items(): setattr(request.user, key, value) request.user.save() request.user.message_set.create(message="Your profile was updated successfully.") return form | 160d9a889f3baf1823bb149b9bec616f31d36e8d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6757/160d9a889f3baf1823bb149b9bec616f31d36e8d/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
3427,
67,
5040,
12,
2293,
4672,
646,
273,
7576,
4029,
1204,
12,
2293,
18,
3798,
13,
646,
18,
2854,
67,
6200,
1435,
309,
486,
646,
18,
4324,
30,
225,
30642,
273,
3869,
12,
68... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
3427,
67,
5040,
12,
2293,
4672,
646,
273,
7576,
4029,
1204,
12,
2293,
18,
3798,
13,
646,
18,
2854,
67,
6200,
1435,
309,
486,
646,
18,
4324,
30,
225,
30642,
273,
3869,
12,
68... |
if ul > tl or dl > tl or el > tl or tl < (23+ul+dl+el): | if tl < (23+ul+dl+el): | def next(self, index=0): file=self._file seek=file.seek read=file.read pos=self._pos | 6ae3c752ee37a9a22f3f6a46cc54c722d7b143f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/6ae3c752ee37a9a22f3f6a46cc54c722d7b143f2/FileStorage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1024,
12,
2890,
16,
770,
33,
20,
4672,
585,
33,
2890,
6315,
768,
6520,
33,
768,
18,
16508,
855,
33,
768,
18,
896,
949,
33,
2890,
6315,
917,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1024,
12,
2890,
16,
770,
33,
20,
4672,
585,
33,
2890,
6315,
768,
6520,
33,
768,
18,
16508,
855,
33,
768,
18,
896,
949,
33,
2890,
6315,
917,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
help='simulation update time step Δt (in days)' ) | help='simulation update time step Δt (in days). Avg editing time (conflicts are resolved in FIFO order)' ) | def make_parser(): parser = ArgumentParser(description=desc, usage=usage, fromfile_prefix_chars='@') #----------------------# # positional arguments # #----------------------# parser.add_argument( 'time', type=float, help='simulated time, in number of days') parser.add_argument( 'seed', type=int, nargs='?', help='seed of the pseudo-random numbers generator', metavar='seed') #--------------------------------------# # optional arguments (model parameter) # #--------------------------------------# parser.add_argument( '-t', '--time-step', type=np.double, default=1.0, metavar='value', help='simulation update time step Δt (in days)' ) parser.add_argument( '-e', '--daily-edits', type=float, help='average daily number of edits per user ', default=1) parser.add_argument( '-b', '--base-life', type=float, help='baseline average user lifetime', default=100.0) parser.add_argument( '-u', '--num-users', type=int, default=0, help='initial number of users', metavar='value') parser.add_argument( '-p', '--num-pages', type=int, default=0, help='initial number of pages', metavar='value') parser.add_argument( '-U', '--daily-users', metavar='rate', default=1.0, type=np.double, help='daily rate of new users') parser.add_argument( '-P', '--daily-pages', metavar='rate', type=np.double, default=1.0, help='daily rate of new pages') parser.add_argument( '-c', '--confidence', metavar='value', type=np.double, default=.2, help='confidence parameter') parser.add_argument( '-s', '--speed', metavar='value', type=np.double, default=0.5, help='opinion averaging speed') parser.add_argument( '--transient', dest='num_transient_steps', type=int, metavar='value', help='number of transient steps', default=0) parser.add_argument( '--const-succ', metavar='value', type=int, default=1, help='user baseline success constant term') parser.add_argument( '--const-pop', metavar='value', type=int, default=1, help='page baseline popularity constant term') parser.add_argument( '--rollback-prob', metavar='prob', type=np.double, default=0.5, help='roll-back probability') #-------------------------------------------# # optional arguments (simulator parameters) # #-------------------------------------------# parser.add_argument( '-i', '--info-file', type=FileType('w+'), help='write simulation info to file', metavar='file') parser.add_argument( '--info-binary', action='store_true', default=False, help='write binary data to info file (NumPy format)') parser.add_argument( 'info_dty_descr', default='f8, i4, i4,', help=SUPPRESS, nargs='?') parser.add_argument( '-d', '--dry-run', action='store_true', default=False, help='do not simulate, just print parameters defaults') parser.add_argument( '-D', '--debug', action='store_true', default=False, help='raise Python exceptions to the console') parser.add_argument( '--profile', action='store_true', default=False, help='run profiling') parser.add_argument( '--profile-file', metavar='file', default=None, help="store profiling information in file") return parser | 9f6aa915579081ac29c154ba6d802acb3cd8098a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11300/9f6aa915579081ac29c154ba6d802acb3cd8098a/peers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
4288,
13332,
2082,
273,
16624,
12,
3384,
33,
5569,
16,
4084,
33,
9167,
16,
628,
768,
67,
3239,
67,
7549,
2218,
36,
6134,
468,
1271,
13093,
7,
468,
16780,
1775,
468,
468,
1271... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
4288,
13332,
2082,
273,
16624,
12,
3384,
33,
5569,
16,
4084,
33,
9167,
16,
628,
768,
67,
3239,
67,
7549,
2218,
36,
6134,
468,
1271,
13093,
7,
468,
16780,
1775,
468,
468,
1271... |
if not var_is_group and space_vars: | if not var_is_group and space_vars and n_nongroup > 1: | def _cfg_string(self, prefix, print_desc=True): """ Convert object into a string to write into a config file. """ ret = [] desc = unicode_to_str(self._desc.strip('\n')).replace('\n', '\n# | ') is_anonymous = self._name.endswith(']') | 8fd111901c1241bd23d9fe40fcb8efdff85802ef /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11722/8fd111901c1241bd23d9fe40fcb8efdff85802ef/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7066,
67,
1080,
12,
2890,
16,
1633,
16,
1172,
67,
5569,
33,
5510,
4672,
3536,
4037,
733,
1368,
279,
533,
358,
1045,
1368,
279,
642,
585,
18,
3536,
325,
225,
273,
5378,
3044,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7066,
67,
1080,
12,
2890,
16,
1633,
16,
1172,
67,
5569,
33,
5510,
4672,
3536,
4037,
733,
1368,
279,
533,
358,
1045,
1368,
279,
642,
585,
18,
3536,
325,
225,
273,
5378,
3044,
273,
... |
if self.getprops().has_key('type'): | props = self.getprops() if props.has_key('type'): | def import_files(self, dirname, nodeid): ''' Import the "content" property as a file ''' source = self.exportFilename(dirname, nodeid) | afc7f43b776f280240ac48bfe71ebc04033c1e87 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1906/afc7f43b776f280240ac48bfe71ebc04033c1e87/hyperdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
67,
2354,
12,
2890,
16,
4283,
16,
756,
350,
4672,
9163,
6164,
326,
315,
1745,
6,
1272,
487,
279,
585,
9163,
1084,
273,
365,
18,
6530,
5359,
12,
12287,
16,
756,
350,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
67,
2354,
12,
2890,
16,
4283,
16,
756,
350,
4672,
9163,
6164,
326,
315,
1745,
6,
1272,
487,
279,
585,
9163,
1084,
273,
365,
18,
6530,
5359,
12,
12287,
16,
756,
350,
13,
2,
-100... |
def testConnect(self): | def test_connect(self): | def testConnect(self): s = ssl.wrap_socket(socket.socket(socket.AF_INET), cert_reqs=ssl.CERT_NONE) s.connect(("svn.python.org", 443)) c = s.getpeercert() if c: self.fail("Peer cert %s shouldn't be here!") s.close() | 0dd64f6a0e5850fce167a308c0d887027fbc21ee /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/0dd64f6a0e5850fce167a308c0d887027fbc21ee/test_ssl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
3612,
12,
2890,
4672,
272,
273,
5832,
18,
4113,
67,
7814,
12,
7814,
18,
7814,
12,
7814,
18,
6799,
67,
18819,
3631,
3320,
67,
25782,
33,
8157,
18,
22367,
67,
9826,
13,
272,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3612,
12,
2890,
4672,
272,
273,
5832,
18,
4113,
67,
7814,
12,
7814,
18,
7814,
12,
7814,
18,
6799,
67,
18819,
3631,
3320,
67,
25782,
33,
8157,
18,
22367,
67,
9826,
13,
272,
... |
def __repr__(self): | def _repr_(self): | def __repr__(self): """ TESTS:: | 37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
12715,
67,
12,
2890,
4672,
3536,
22130,
55,
2866,
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,... | [
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,
389,
12715,
67,
12,
2890,
4672,
3536,
22130,
55,
2866,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
evalString += "%s])" % xdata[-1] | evalString += "%s])" % xData[-1] | def setData(self, *dataList): """ Set data to the plot | 7c21316bd2b0282da374aba97a863460405e2cdb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8476/7c21316bd2b0282da374aba97a863460405e2cdb/plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7929,
12,
2890,
16,
380,
892,
682,
4672,
3536,
1000,
501,
358,
326,
3207,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7929,
12,
2890,
16,
380,
892,
682,
4672,
3536,
1000,
501,
358,
326,
3207,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
cond = self.currentScope.transformIntoCond() | cond = self.currentScope.closeScope() | def preMapResult(self, expr): # Create a separate scope for the expression. self.currentScope = Scope() | 6e025f7b21e49c8c49798a30af00a60a9939001e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5223/6e025f7b21e49c8c49798a30af00a60a9939001e/decouple.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
675,
863,
1253,
12,
2890,
16,
3065,
4672,
468,
1788,
279,
9004,
2146,
364,
326,
2652,
18,
365,
18,
2972,
3876,
273,
5468,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
675,
863,
1253,
12,
2890,
16,
3065,
4672,
468,
1788,
279,
9004,
2146,
364,
326,
2652,
18,
365,
18,
2972,
3876,
273,
5468,
1435,
2,
-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.