rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
box = gtk.VBox() | box = gtk.VBox(spacing=4) | def append_page(self, contentview): tab_label = gtk.EventBox() tab_label.show() l = gtk.Label(contentview.short_title) pos = self.notebook.get_tab_pos() if pos in [gtk.POS_LEFT, gtk.POS_RIGHT]: box = gtk.VBox() if pos == gtk.POS_LEFT: l.set_angle(90) else: l.set_angle(270) else: box = gtk.HBox() box.pack_start(contentview.icon, expand=False) box.pack_start(l, expand=False) tab_label.add(box) tab_label.show_all() # Set the tooltip text tooltiptext = contentview.LONG_TITLE if not tooltiptext: tooltiptext = contentview.SHORT_TITLE if not tooltiptext: tooltiptext = 'No tooltip set for %s' % contentview icons.tips.set_tip(tab_label, tooltiptext) # Add the content view contentview.show() self.__notebook.append_page(contentview, tab_label=tab_label) self.__views[contentview.unique_id] = contentview contentview.holder = self contentview.connect('short-title-changed', self.cb_view_short_title_changed) if self.__list_widget is not None: self.__list_widget.append_page(contentview) | d0434ad7fbb810788ee92702622b45bcd59a0025 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2233/d0434ad7fbb810788ee92702622b45bcd59a0025/contentbook.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
714,
67,
2433,
12,
2890,
16,
913,
1945,
4672,
3246,
67,
1925,
273,
22718,
18,
1133,
3514,
1435,
3246,
67,
1925,
18,
4500,
1435,
328,
273,
22718,
18,
2224,
12,
1745,
1945,
18,
6620,
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,
714,
67,
2433,
12,
2890,
16,
913,
1945,
4672,
3246,
67,
1925,
273,
22718,
18,
1133,
3514,
1435,
3246,
67,
1925,
18,
4500,
1435,
328,
273,
22718,
18,
2224,
12,
1745,
1945,
18,
6620,
67,... |
neighs = Phi2_quad(X, ss_points[j_prev], ss_points[pos]).roots() | neighbors = Phi2_quad(X, ss_points[j_prev], ss_points[pos]).roots() | def supersingular_points(self): r""" This function computes the supersingular j-invariants over the finite field associated to self. | c732f65751748e79d80e2e4cd21b7817d7f75379 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/c732f65751748e79d80e2e4cd21b7817d7f75379/ssmod.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1169,
414,
17830,
67,
4139,
12,
2890,
4672,
436,
8395,
1220,
445,
15881,
326,
1169,
414,
17830,
525,
17,
267,
15886,
1879,
326,
25922,
652,
3627,
358,
365,
18,
2,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
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,
1169,
414,
17830,
67,
4139,
12,
2890,
4672,
436,
8395,
1220,
445,
15881,
326,
1169,
414,
17830,
525,
17,
267,
15886,
1879,
326,
25922,
652,
3627,
358,
365,
18,
2,
-100,
-100,
-100,
-100,... |
sage: bessel_J(2,1.1) 0.136564153956658000 sage: bessel_J(0,1.1) 0.719622018527510801 sage: bessel_J(0,1) 0.765197686557966605 | sage: bessel_J(2,1.1) 0.13656415395665... sage: bessel_J(0,1.1) 0.71962201852751... sage: bessel_J(0,1) 0.76519768655796... | def bessel_J(nu,z,alg="pari",prec=53): r""" Return value of the "J-Bessel function", or "Bessel function, 1st kind", with index (or "order") nu and argument z. \begin{verbatim} Defn: Maxima: inf ==== - nu - 2 k nu + 2 k \ (-1)^k 2 z > ------------------------- / k! Gamma(nu + k + 1) ==== k = 0 Pari: inf ==== - 2k 2k \ (-1)^k 2 z Gamma(nu + 1) > ---------------------------- / k! Gamma(nu + k + 1) ==== k = 0 \end{verbatim} Sometimes bessel_J(nu,z) is denoted J_nu(z) in the literature. WARNING: Inaccurate for small values of z. EXAMPLES: sage: bessel_J(2,1.1) # last few digits are random 0.136564153956658000 sage: bessel_J(0,1.1) # last few digits are random 0.719622018527510801 sage: bessel_J(0,1) # last few digits are random 0.765197686557966605 We check consistency of PARI and Maxima: sage: n(bessel_J(3,10,"maxima")) # last few digits are random 0.0583793793051869 sage: n(bessel_J(3,10,"pari")) # last few digits are random 0.0583793793051868 """ if alg=="pari": from sage.libs.pari.all import pari nu = pari(nu) z = pari(z) if nu.imag() or z.imag(): K,a = _setup_CC(prec) else: K,a = _setup(prec) b = K(nu.besselj(z)) pari.set_real_precision(a) return b else: return meval("bessel_j(%s,%s)"%(nu, z)) | 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,
324,
403,
292,
67,
46,
12,
13053,
16,
94,
16,
18413,
1546,
1065,
77,
3113,
4036,
33,
8643,
4672,
436,
8395,
2000,
460,
434,
326,
315,
46,
17,
38,
403,
292,
445,
3113,
578,
315,
38,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
324,
403,
292,
67,
46,
12,
13053,
16,
94,
16,
18413,
1546,
1065,
77,
3113,
4036,
33,
8643,
4672,
436,
8395,
2000,
460,
434,
326,
315,
46,
17,
38,
403,
292,
445,
3113,
578,
315,
38,
... |
v = B.solve_right(-c, check_rank=False) | v = B.solve_right(-c, check_rank=True) | def doubleDet (A, b, c): """ Compute the determinants of the stacked matrices A.stack(b) and A.stack(c). INPUT: A -- an (n-1) x n matrix b -- an 1 x n matrix c -- an 1 x n matrix OUTPUT: a pair of two integers. """ # We use the "two for the price of one" algorithm. # This is a clever trick! First we transpose everything. Then # we use that if [A|b]*v = c then [A|c]*w = b with w easy to write down! # In fact w is got from v by dividing all entries by -v[n], where n is the # number of rows of v, and *also* dividing the last entry of w by v[n] again. # See this as an algebra exercise where you have to think of matrix vector # multiply as "linear combination of columns". A = A.transpose() b = b.transpose() c = c.transpose() t = verbose('starting double det') B = A.augment(b) v = B.solve_right(-c, check_rank=False) # infinite loop if not full rank! db = v.denominator() p = 46337 Bmod = B._reduce(p) z = Bmod.determinant() / db z = z.lift() if z > p//2: z = z - p db *= z n = v.nrows() vn = v[n-1,0] w = (-1/vn)*v w[n-1] = w[n-1]/vn dc = w.denominator() Cmod = A.augment(c)._reduce(p) z = Cmod.determinant() / dc z = z.lift() if z > p//2: z = z - p dc *= z verbose('finished double det', t) return (db, dc) | e4efad0907e34db2c61f5c1935160aed400d9935 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/e4efad0907e34db2c61f5c1935160aed400d9935/matrix_integer_dense_hnf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1645,
4986,
261,
37,
16,
324,
16,
276,
4672,
3536,
8155,
326,
6328,
4388,
434,
326,
25776,
16415,
432,
18,
3772,
12,
70,
13,
471,
432,
18,
3772,
12,
71,
2934,
225,
12943,
30,
432,
14... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1645,
4986,
261,
37,
16,
324,
16,
276,
4672,
3536,
8155,
326,
6328,
4388,
434,
326,
25776,
16415,
432,
18,
3772,
12,
70,
13,
471,
432,
18,
3772,
12,
71,
2934,
225,
12943,
30,
432,
14... |
show ip -- Display the ip addresses of the nodes | show ip [to file] -- Display the ip addresses of the nodes | def command_loop(): # we will set this if they call set timeout global globalseashtimeout # things that may be set herein and used in later commands host = None port = None expnum = None filename = None cmdargs = None defaulttarget = None defaultkeyname = None # exit via a return while True: try: prompt = '' if defaultkeyname: prompt = fit_string(defaultkeyname,20)+"@" # display the thing they are acting on in their prompt (if applicable) if defaulttarget: prompt = prompt + fit_string(defaulttarget,20) prompt = prompt + " !> " # the prompt should look like: justin@good !> # get the user input userinput = raw_input(prompt) userinput = userinput.strip() userinputlist = userinput.split() if len(userinputlist)==0: continue # by default, use the target specified in the prompt currenttarget = defaulttarget # set the target, then handle other operations if len(userinputlist) >= 2: if userinputlist[0] == 'on': if userinputlist[1] not in targets: raise UserError("Error: Unknown target '"+userinputlist[1]+"'") # set the target and strip the rest... currenttarget = userinputlist[1] userinputlist = userinputlist[2:] # they are setting the default if len(userinputlist) == 0: defaulttarget = currenttarget continue # by default, use the identity specified in the prompt currentkeyname = defaultkeyname # set the keys, then handle other operations if len(userinputlist) >= 2: if userinputlist[0] == 'as': if userinputlist[1] not in keys: raise UserError("Error: Unknown identity '"+userinputlist[1]+"'") # set the target and strip the rest... currentkeyname = userinputlist[1] userinputlist = userinputlist[2:] # they are setting the default if len(userinputlist) == 0: defaultkeyname = currentkeyname continue | 448c4325d7e4a3188225bc2613435876407aecd0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7263/448c4325d7e4a3188225bc2613435876407aecd0/seash.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1296,
67,
6498,
13332,
468,
732,
903,
444,
333,
309,
2898,
745,
444,
2021,
2552,
4715,
544,
345,
647,
494,
659,
282,
468,
9198,
716,
2026,
506,
444,
2674,
267,
471,
1399,
316,
5137,
43... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1296,
67,
6498,
13332,
468,
732,
903,
444,
333,
309,
2898,
745,
444,
2021,
2552,
4715,
544,
345,
647,
494,
659,
282,
468,
9198,
716,
2026,
506,
444,
2674,
267,
471,
1399,
316,
5137,
43... |
self.cameralist = [] | def close( self ): if self.h is not None: self._dll.dc1394_free( self.h ) self.h = None self.cameralist = [] | ee74dad00ea14cde6198c80c18522e6e32fd4a62 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6169/ee74dad00ea14cde6198c80c18522e6e32fd4a62/camera.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
12,
365,
262,
30,
309,
365,
18,
76,
353,
486,
599,
30,
365,
6315,
27670,
18,
7201,
3437,
11290,
67,
9156,
12,
365,
18,
76,
262,
365,
18,
76,
273,
599,
365,
18,
20133,
11612,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
12,
365,
262,
30,
309,
365,
18,
76,
353,
486,
599,
30,
365,
6315,
27670,
18,
7201,
3437,
11290,
67,
9156,
12,
365,
18,
76,
262,
365,
18,
76,
273,
599,
365,
18,
20133,
11612,
... | |
timeout = time() + 2 | timeout = time.time() + 2 | def tearDown(self): self.run_loop = 0 self.thread.join() td.shutdown() self.server.close() # Make sure all sockets get closed by asyncore normally. timeout = time() + 2 while 1: if len(asyncore.socket_map) == self.orig_map_size: # Clean! break if time() >= timeout: self.fail('Leaked a socket: %s' % `asyncore.socket_map`) break asyncore.poll(0.1) | 90d04321f031c84ce099735d79abab9afd55bb34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/90d04321f031c84ce099735d79abab9afd55bb34/test_ftpserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
2091,
4164,
12,
2890,
4672,
365,
18,
2681,
67,
6498,
273,
374,
365,
18,
5930,
18,
5701,
1435,
6655,
18,
15132,
1435,
365,
18,
3567,
18,
4412,
1435,
468,
4344,
3071,
777,
16762,
33... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
2091,
4164,
12,
2890,
4672,
365,
18,
2681,
67,
6498,
273,
374,
365,
18,
5930,
18,
5701,
1435,
6655,
18,
15132,
1435,
365,
18,
3567,
18,
4412,
1435,
468,
4344,
3071,
777,
16762,
33... |
def check_key(self, key, key_extra_len=0): """Checks sanity of key. Fails if: Key length is > SERVER_MAX_KEY_LENGTH (Raises MemcachedKeyLength). Contains control characters (Raises MemcachedKeyCharacterError). Is not a string (Raises MemcachedStringEncodingError) Is an unicode string (Raises MemcachedStringEncodingError) Is not a string (Raises MemcachedKeyError) Is None (Raises MemcachedKeyError) """ if isinstance(key, tuple): key = key[1] if not key: raise Client.MemcachedKeyNoneError("Key is None") if isinstance(key, unicode): raise Client.MemcachedStringEncodingError("Keys must be str()'s, not " "unicode. Convert your unicode strings using " "mystring.encode(charset)!") if not isinstance(key, str): raise Client.MemcachedKeyTypeError("Key must be str()'s") if isinstance(key, basestring): if self.server_max_key_lenght != 0 and \ len(key) + key_extra_len > self.server_max_key_lenght: raise Client.MemcachedKeyLengthError("Key length is > %s" % self.server_max_key_lenght) for char in key: if ord(char) < 32 or ord(char) == 127: raise Client.MemcachedKeyCharacterError( "Control characters not allowed") | def _recv_value(self, server, flags, rlen): rlen += 2 # include \r\n buf = server.recv(rlen) if len(buf) != rlen: raise _Error("received %d bytes when expecting %d" % (len(buf), rlen)) | 14105f5c7b7349c63655b5a3c3785fe12d84aa68 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11935/14105f5c7b7349c63655b5a3c3785fe12d84aa68/memcache.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
18334,
67,
1132,
12,
2890,
16,
1438,
16,
2943,
16,
436,
1897,
4672,
436,
1897,
1011,
576,
468,
2341,
521,
86,
64,
82,
1681,
273,
1438,
18,
18334,
12,
1321,
275,
13,
309,
562,
12... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
18334,
67,
1132,
12,
2890,
16,
1438,
16,
2943,
16,
436,
1897,
4672,
436,
1897,
1011,
576,
468,
2341,
521,
86,
64,
82,
1681,
273,
1438,
18,
18334,
12,
1321,
275,
13,
309,
562,
12... | |
olapi.login('joe', 'secret') | olapi.login('apiuser', 'secret') | def test_write_with_embeddable_types2(): q = { 'key': '/b/OL1M', 'table_of_contents': {'connect': 'update_list', 'value': [ {'title': 'chapter 1'}, {'title': 'chapter 2'} ]}, } olapi.login('joe', 'secret') olapi.write(q, comment="update toc") d = olapi.get('/b/OL1M') print d['table_of_contents'] assert d['table_of_contents'] == [ {"type": {"key": "/type/toc_item"}, "title": "chapter 1"}, {"type": {"key": "/type/toc_item"}, "title": "chapter 2"}, ] | 8cd19e44dcaff792dbab2e7de2630c2d64b67e1f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3913/8cd19e44dcaff792dbab2e7de2630c2d64b67e1f/test_api.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2626,
67,
1918,
67,
8483,
17394,
67,
2352,
22,
13332,
1043,
273,
288,
296,
856,
4278,
1173,
70,
19,
1741,
21,
49,
2187,
296,
2121,
67,
792,
67,
3980,
4278,
13666,
3612,
4278,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2626,
67,
1918,
67,
8483,
17394,
67,
2352,
22,
13332,
1043,
273,
288,
296,
856,
4278,
1173,
70,
19,
1741,
21,
49,
2187,
296,
2121,
67,
792,
67,
3980,
4278,
13666,
3612,
4278,... |
f = ManualGenerator("SetPopupData", setpopupdata_body, condition=" | f = ManualGenerator("SetPopupData", setpopupdata_body, condition=" | def outputCleanupStructMembers(self): Output("Py_XDECREF(self->ob_callbackdict);") Output("if (self->ob_itself)SetControlReference(self->ob_itself, (long)0); /* Make it forget about us */") | 47eba1f171b926379f9b85a189ca91138fe05632 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/47eba1f171b926379f9b85a189ca91138fe05632/ctlsupport.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
876,
15007,
3823,
6918,
12,
2890,
4672,
3633,
2932,
9413,
67,
60,
1639,
5458,
42,
12,
2890,
2122,
947,
67,
3394,
1576,
1769,
7923,
3633,
2932,
430,
261,
2890,
2122,
947,
67,
1282,
19079,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
876,
15007,
3823,
6918,
12,
2890,
4672,
3633,
2932,
9413,
67,
60,
1639,
5458,
42,
12,
2890,
2122,
947,
67,
3394,
1576,
1769,
7923,
3633,
2932,
430,
261,
2890,
2122,
947,
67,
1282,
19079,... |
length -= len(response[-1]) self.position += len(response[-1]) | last_read = len(response[-1]) if last_read == 0: break length -= last_read self.position += last_read | def _chunked_read(self, rfile, length=None): if self.wfile is not None: ## 100 Continue self.wfile.write(self.wfile_line) self.wfile = None self.wfile_line = None | a7039cee84a6944dd8a7e46ad47c5e368bf550df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10078/a7039cee84a6944dd8a7e46ad47c5e368bf550df/wsgi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6551,
329,
67,
896,
12,
2890,
16,
436,
768,
16,
769,
33,
7036,
4672,
309,
365,
18,
91,
768,
353,
486,
599,
30,
7541,
2130,
16773,
365,
18,
91,
768,
18,
2626,
12,
2890,
18,
91,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6551,
329,
67,
896,
12,
2890,
16,
436,
768,
16,
769,
33,
7036,
4672,
309,
365,
18,
91,
768,
353,
486,
599,
30,
7541,
2130,
16773,
365,
18,
91,
768,
18,
2626,
12,
2890,
18,
91,... |
if failed_uploads: raise UploadFailed('Error uploading:\n%s' % '\n'.join(failed_uploads)) | if len(failed_uploads) > 1 or (None not in failed_uploads): error_msg = ['%s -> %s\n' % args for args in failed_uploads] raise UploadFailed('Error uploading:\n%s' % error_msg) | def UploadPrebuilt(build_path, bucket, board=None, git_file=None): """Upload Host prebuilt files to Google Storage space. Args: build_path: The path to the root of the chroot. bucket: The Google Storage bucket to upload to. board: The board to upload to Google Storage, if this is None upload host packages. git_file: If set, update this file with a host/version combo, commit and push it. """ version = GetVersion() if not board: # We are uploading host packages # TODO(scottz): eventually add support for different host_targets package_path = os.path.join(build_path, _HOST_PACKAGES_PATH) gs_path = os.path.join(bucket, _GS_HOST_PATH, version) strip_pattern = package_path package_string = _HOST_TARGET else: board_path = os.path.join(build_path, _BOARD_PATH % {'board': board}) package_path = os.path.join(board_path, 'packages') package_string = board strip_pattern = board_path gs_path = os.path.join(bucket, _GS_BOARD_PATH % {'board': board, 'version': version}) upload_files = GenerateUploadDict(package_path, gs_path, strip_pattern) print 'Uploading %s' % package_string failed_uploads = RemoteUpload(upload_files) if failed_uploads: raise UploadFailed('Error uploading:\n%s' % '\n'.join(failed_uploads)) if git_file: RevGitFile(git_file, package_string, version) | 96619e72e1d577e7b3682818fdce277c4090cc30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/96619e72e1d577e7b3682818fdce277c4090cc30/prebuilt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9414,
1386,
12406,
12,
3510,
67,
803,
16,
2783,
16,
11094,
33,
7036,
16,
5071,
67,
768,
33,
7036,
4672,
3536,
4777,
4893,
675,
12406,
1390,
358,
6124,
5235,
3476,
18,
225,
6634,
30,
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,
9414,
1386,
12406,
12,
3510,
67,
803,
16,
2783,
16,
11094,
33,
7036,
16,
5071,
67,
768,
33,
7036,
4672,
3536,
4777,
4893,
675,
12406,
1390,
358,
6124,
5235,
3476,
18,
225,
6634,
30,
13... |
return self._Aggregate, self._Index | return self.aggregate, self.index | def __getinitargs__(self): return self._Aggregate, self._Index | 4003a772783c0ae3cc1cc6a5a9c795b0b258bf30 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12571/4003a772783c0ae3cc1cc6a5a9c795b0b258bf30/primitives.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
2738,
1968,
972,
12,
2890,
4672,
327,
365,
6315,
11490,
16,
365,
6315,
1016,
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,
1001,
588,
2738,
1968,
972,
12,
2890,
4672,
327,
365,
6315,
11490,
16,
365,
6315,
1016,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
defaults = default_setup | defaults = None | def apply_auto_progress(args): if args and '--auto-progress' in args: if sys.stdout.isatty(): progress = '--progress' else: progress = '--no-progress' | d7279b410b19b1663e2cdd24c2dbea97a7cc284e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10007/d7279b410b19b1663e2cdd24c2dbea97a7cc284e/options.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
67,
6079,
67,
8298,
12,
1968,
4672,
309,
833,
471,
3534,
6079,
17,
8298,
11,
316,
833,
30,
309,
2589,
18,
10283,
18,
291,
270,
4098,
13332,
4007,
273,
3534,
8298,
11,
469,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
67,
6079,
67,
8298,
12,
1968,
4672,
309,
833,
471,
3534,
6079,
17,
8298,
11,
316,
833,
30,
309,
2589,
18,
10283,
18,
291,
270,
4098,
13332,
4007,
273,
3534,
8298,
11,
469,
30,
... |
widget_list[1] = gridflow | widget_list.append(gridflow) self.tooltip.grid = gridflow | def _populate_completion(self): widget_list = self.tooltip.body widget_list[1] = urwid.Text('') # This is just me flailing around wildly. TODO: actually write. if self.complete(): if self.argspec: # This is mostly just stolen from the cli module. func_name, args, is_bound, in_arg = self.argspec args, varargs, varkw, defaults = args[:4] if py3: kwonly, kwonly_defaults = args[4:] else: kwonly, kwonly_defaults = [], {} markup = [('bold name', func_name), ('name', ': (')] | c34e7b3a0658b6694c5b8025e99f4cfa7cc5eafe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6932/c34e7b3a0658b6694c5b8025e99f4cfa7cc5eafe/urwid.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
19936,
67,
11469,
12,
2890,
4672,
3604,
67,
1098,
273,
365,
18,
19798,
18,
3432,
3604,
67,
1098,
63,
21,
65,
273,
8896,
30902,
18,
1528,
2668,
6134,
468,
1220,
353,
2537,
1791,
11... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
19936,
67,
11469,
12,
2890,
4672,
3604,
67,
1098,
273,
365,
18,
19798,
18,
3432,
3604,
67,
1098,
63,
21,
65,
273,
8896,
30902,
18,
1528,
2668,
6134,
468,
1220,
353,
2537,
1791,
11... |
self.array = _SurfArrayAccess(sprite=self, | self.array = _SurfArrayAccess(self.im, | def __init__(self, width=100, height=100, x=0, y=0, depth=0, \ fb=None, on=1, image=None, dx=0, dy=0, fname=None, \ name=None, icolor='black', centerorigin=0): """Sprite instantiation function **width, height** -- width and height of sprite in pixels **x, y** -- initial sprite position (pixels in world coordinates) **depth** -- depth of sprite (for DisplayList below). The DisplayList class draws sprites in depth order, with large depths being draw first (ie, 0 is the top-most layer of sprites) | 225862206915a937b75b16306d39fcee962cb426 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5701/225862206915a937b75b16306d39fcee962cb426/sprite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1835,
33,
6625,
16,
2072,
33,
6625,
16,
619,
33,
20,
16,
677,
33,
20,
16,
3598,
33,
20,
16,
521,
12754,
33,
7036,
16,
603,
33,
21,
16,
1316,
33,
70... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1835,
33,
6625,
16,
2072,
33,
6625,
16,
619,
33,
20,
16,
677,
33,
20,
16,
3598,
33,
20,
16,
521,
12754,
33,
7036,
16,
603,
33,
21,
16,
1316,
33,
70... |
ui.status('Writing ', m['Subject'], ' ...\n') | ui.status(_('Writing '), m['Subject'], ' ...\n') | def getaddrs(opt, prpt, default = None): addrs = opts.get(opt) or (ui.config('email', opt) or ui.config('patchbomb', opt) or prompt(prpt, default = default)).split(',') return [a.strip() for a in addrs if a.strip()] | feceedab4b4640d6f5c5bd8e509d1224aca166b5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11312/feceedab4b4640d6f5c5bd8e509d1224aca166b5/patchbomb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
23305,
12,
3838,
16,
846,
337,
16,
805,
273,
599,
4672,
11755,
273,
1500,
18,
588,
12,
3838,
13,
578,
261,
4881,
18,
1425,
2668,
3652,
2187,
2153,
13,
578,
5915,
18,
1425,
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,
336,
23305,
12,
3838,
16,
846,
337,
16,
805,
273,
599,
4672,
11755,
273,
1500,
18,
588,
12,
3838,
13,
578,
261,
4881,
18,
1425,
2668,
3652,
2187,
2153,
13,
578,
5915,
18,
1425,
2668,
... |
compr = cab["compr_method"].display if cab["compr_method"].value != 0: compr += " (level %u)" % cab["compr_level"].value | compr = folder["compr_method"].display if folder["compr_method"].value != 0: compr += " (level %u)" % folder["compr_level"].value | def useFolder(self, folder): compr = cab["compr_method"].display if cab["compr_method"].value != 0: compr += " (level %u)" % cab["compr_level"].value self.compression = compr | a67681689c5c4a9751617480519dfb543d84f02b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9327/a67681689c5c4a9751617480519dfb543d84f02b/archive.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
999,
3899,
12,
2890,
16,
3009,
4672,
532,
683,
273,
3009,
9614,
832,
683,
67,
2039,
6,
8009,
5417,
309,
3009,
9614,
832,
683,
67,
2039,
6,
8009,
1132,
480,
374,
30,
532,
683,
1011,
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,
999,
3899,
12,
2890,
16,
3009,
4672,
532,
683,
273,
3009,
9614,
832,
683,
67,
2039,
6,
8009,
5417,
309,
3009,
9614,
832,
683,
67,
2039,
6,
8009,
1132,
480,
374,
30,
532,
683,
1011,
3... |
for tkt_id in [ticket['id'] for ticket in milestone['tickets'] | tickets = get_tickets_for_milestone(self.env, db, milestone.name, field='owner') tickets = apply_ticket_permissions(self.env, req, milestone, tickets) for tkt_id in [ticket['id'] for ticket in tickets | def write_utctime(name, value, params={}): write_prop(name, strftime('%Y%m%dT%H%M%SZ', value), params) | 517187fd8e15835f4c27204d1d2cef2e8fb9a563 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2831/517187fd8e15835f4c27204d1d2cef2e8fb9a563/roadmap.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
322,
21261,
12,
529,
16,
460,
16,
859,
12938,
4672,
1045,
67,
5986,
12,
529,
16,
10405,
29909,
61,
9,
81,
9,
23148,
9,
44,
9,
49,
9,
28830,
2187,
460,
3631,
859,
13,
2,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
322,
21261,
12,
529,
16,
460,
16,
859,
12938,
4672,
1045,
67,
5986,
12,
529,
16,
10405,
29909,
61,
9,
81,
9,
23148,
9,
44,
9,
49,
9,
28830,
2187,
460,
3631,
859,
13,
2,
... |
color=color, size=nodesize,edgecolor=node_edgecolor) if not (uselabels=='none'): if uselabels == 'all': axes.annotate(str(node),(xy[node][0]+nodeLabel_xOffset,xy[node][1]), | color=color, size=nodesize, edgecolor=nodeEdgeColor) if node in labels or uselabels == 'all': if node in labels: if isinstance(labels[node],float): showthislabel="%2.2f" % labels[node] else: showthislabel=labels[node] else: showthislabel = str(node) axes.annotate(showthislabel,(xy[node][0]+nodeLabel_xOffset,xy[node][1]), | def VisualizeNet(net, xy, figsize=(6,6), coloredNodes=True, equalsize=False, labels=None, fontsize=7, showAllNodes=True, nodeColor=None, nodeSize=1.0, minnode=2.0, maxnode=6.0, nodeColors=None, nodeSizes=None, bgcolor='white', maxwidth=2.0, minwidth=0.2, uselabels='none', edgeColorMap='winter', weightLimits=None, setNodeColorsByProperty=None, nodeColorMap='winter', nodePropertyLimits=None, nodeLabel_xOffset=None, coloredvertices=None, vcolor=None, vsize=None, frame=False, showTicks=False, axisLimits=None, baseFig=None): """Visualizes a network. The coloring of the nodes is decided as follows: a) If dictionary `nodeColors` is given, it is used. If it does not contain a color for every node, the rest are colored 1) according to property `setNodeColorsByProperty`, if it is given, or else 2) by `nodeColor` if it is given, or 3) white if neither of the above is given. b) If dictionary `nodeColors` is not given, but `nodeColor` is given, all nodes are colored with `nodeColor`. c) If none of `setNodeColorsByProperty`,`nodeColors` and `nodeColor` is given, nodes are colored by strength using the colormap `nodeColorMap` (by default 'winter'). Parameters ---------- net : pynet.SymmNet The network to visualize xy : dictionary of tuples {node_ID: (x,y,z)} Coordinates of all nodes. These usually originate from visuals.Himmeli, e.g. h = visuals.Himmeli(net, ...) xy = h.getCoordinates() figsize : (x,y) Size of the output figure in inches. dpi is set to 100. coloredNodes : bool If True, nodes are colored. Otherwise all nodes are white. nodeColors : dict Dictionary of node colors by node index. nodeSizes : dict Dictionary of node sizes by node index. minnode : minimum node size, if autoscaling used maxnode : maximum node size, if autoscaling used nodeColor : RGB color tuple Default color of a node. Three values between 0 and 1, for example (1.0, 0, 0) is red and (0.5, 0.5, 0.5) is middle gray. setNodeColorByProperty : sequence of node indices If `setNodeColorsByProperty` is specified, any node not appearing in the dictionary `nodeColors` will be colored according to the given property (using `nodeColorMap` and `nodePropertyLimits`). Option `nodeColors` overrides the 'setNodeColorsByProperty' option. nodeColorMap : str A colormap used to color the nodes listed in `setNodeColorsByProperty`. nodePropertyLimits : [min_val max_val] If nodes are coloured according to a nodeProperty, these are the min and max values of said property. equalsize : bool If True, all nodes are of size `nodeSize`. If False, node size is based on node strength. showAllNodes : bool If True, displays disconnected components and nodes which have no edges left after e.g. thresholding. (quick hack?) bgcolor : sequence (r, g, b) Background color as RGB tuple. Default is black. minwidth : float Minimum width of plotted edges. maxwidth : float Maximum width of plotted edges. labels : dict {nodename:labelstring} Dictionary of node labels. uselabels : str, either 'none' or 'all' If 'all', the node index is shown as label for those nodes that are not listed in `labels`. fontsize : int Sets font size for labels. edgeColorMap : str or cmap Allows the user to set color scheme for edges. Edges are always colored according to edge weights, which are first normalized to the range (0,1) and then transformed to colors using edgeColorMap. There are 150 colormaps available in pylab; for a full listing, please see help(pylab.cm) (and look for DATA). Or try, for example, edgeColorMap='orange' or edgeColorMap='primary', two colormaps of our own that are not available in pylab. To make all edges have the same color, create a constant color map with getConstantColorMap(rgb). weightLimits : tuple (minWeight, maxWeight) Provides the minimum and maximum value for weights. If not are given, (nearly) the true min and max weights in the network will be used. The weightLimits are used for setting edge colors and width. They enable the user to plot several networks (which may have different min and max weights) so that a certain color and width always correspond to a certain edge weight. Thus, the color and width in the visualization can be used to infer edge weight. If the network turns out to contain weights above the given maxWeight (below minWeight) these will be rounded downwards (upwards) to the given limit. nodeLabel_xOffset : float (default nodeSize/40) Amount for moving node labels the right so that the text does not fall on the nodes. frame : bool If True, draws a box around the figure. showTicks : bool If True, adds ticks in the frame. Setting `showTicks` to True will always set `frame` to True also. axisLimits : tuple ((minX, maxX),(minY, maxY)) Sets tick limits if `showTicks` is True. baseFig : FigureCanvasBase If None, the network is drawn on an empty figure, otherwise baseFig is used as a starting point. Return ------ fig : pylab.Figure The plotted network figure. Examples -------- >>> from netpython import pynet, visuals >>> net = pynet.SymmNet() >>> net[0][1] = 1.0 >>> net[1][2] = 3.5 >>> net[0][2] = 5.0 >>> # Here are the coordinates, a dictionary that contains 2-tuples >>> xy = {0:(0,0), 1:(4,0), 2:(2,3)} >>> # With larger network use Himmeli to calculate coordinates. >>> h = visuals.Himmeli(net) >>> xy = h.getCoordinates() >>> f = FigureCanvasBase(visuals.VisualizeNet(net,xy)) >>> f.print_eps("myPlot_1.eps", dpi=80.0) >>> f2 = FigureCanvasBase(visuals.VisualizeNet(other_net,xy,baseFig=f)) >>> f=FigureCanvasBase(visuals.VisualizeNet(net,xy,edgeColorMap='orange')) >>> f.print_eps("myPlot_2.eps", dpi=80.0) >>> f=FigureCanvasBase(visuals.VisualizeNet(net,xy,edgeColorMap='orange', equalsize=True, nodeSize=16)) >>> f.print_eps("myPlot_3.eps", dpi=80.0) (General questions: Is there a neater way to output the figures than using FigureCanvasBase? How can I have a look at the figures from within python, without saving them to .eps files?) """ # Warn about obsolete input arguments if coloredvertices!=None or vcolor!=None or vsize!=None: warnings.warn("\n\n The options \n" "\t coloredvertices, vcolor, and vsize \n" "are now obsolete. Please use instead \n" "\t coloredNodes, nodeColor, and nodeSize.\n") if coloredvertices != None: coloredNodes = coloredvertices if vcolor != None and nodeColor == None: nodeColor = vcolor if vsize != None: nodeSize = vsize if nodeColors is None: nodeColors = {} if nodeSizes is None: nodeSizes = {} if labels is None: labels = {} # The following is for the EDEN software, where "nets" or nets # derived from matrices can have edge distances instead of weights. if hasattr(net,'matrixtype'): if net.matrixtype==0: net=transforms.dist_to_weights(net) if baseFig==None: thisfigure=Figure(figsize=figsize,dpi=100,facecolor=bgcolor) axes=thisfigure.add_subplot(111) else: thisfigure=baseFig.figure thisfigure.set_facecolor(bgcolor) axes=thisfigure.gca() axes.set_axis_bgcolor(bgcolor) if frame == False and showTicks == False: axes.set_axis_off() # Set the color for node labels fontcolor='w' node_edgecolor='w' if bgcolor=='white': fontcolor='k' node_edgecolor='k' # First draw all edges, if there are any edges=list(net.edges) if len(edges)>0: wlist=[] for edge in edges: wlist.append(edge[2]) wmin=min(wlist) wmax=max(wlist) # If weightLimits were not given, use (almost) the true min # and max weights in the network. Note: using a value slightly # below wmin, because otherwise when normalizing the weights, # the minimum weights would be transformed to zero and the # edges not visible at all. - Riitta if weightLimits==None: if wmin==0: weightLimits=(wmin,wmax) else: weightLimits=(wmin-0.00001,wmax) myEdgeColorMap=setColorMap(edgeColorMap) # Plot edges according to weight, beginning with small weight sortedEdges=list(net.edges) sortedEdges.sort(key=lambda x: x[2]) for edge in sortedEdges: width=setEdgeWidth(edge[2],weightLimits,minwidth,maxwidth) colour=setColor(edge[2],weightLimits,myEdgeColorMap) xcoords=[xy[edge[0]][0],xy[edge[1]][0]] ycoords=[xy[edge[0]][1],xy[edge[1]][1]] plot_edge(axes, xcoords, ycoords, width=width, colour=colour, symmetric=net.isSymmetric()) # Then draw nodes, depending on given options showAllNodes # displays also nodes who do not have any edges left after # e.g. thresholding nodelist=[] if showAllNodes: nodelist = [node for node in xy.keys()] else: nodelist = [node for node in net] strengths = netext.strengths(net) maxs = max(strengths.values()) mins = min(strengths.values()) if not(equalsize): A = (0 if maxs == mins else (maxnode-minnode)/(maxs-mins)) B = maxnode-A*maxs myNodeColorMap=setColorMap(nodeColorMap) # If nodes will be colored by setNodeColorsByProperty but # nodePropertyLimits were not given, use the true min and max # property values in the network. if setNodeColorsByProperty != None: if nodePropertyLimits == None: np=[net.nodeProperty[setNodeColorsByProperty][node] for node in net] nodePropertyLimits=(min(np),max(np)) for node in nodelist: # First define size if equalsize: nodesize=nodeSize if (nodesize<1.0): # hack: Himmeli wants size <1.0 nodesize=nodesize*maxnode # if Himmeli-type size used, scale up elif len(nodeSizes)>0: # if nodeSizes are given, use it if node in nodeSizes.keys(): # if this node is in nodeSizes, use the value nodesize=nodeSizes[node] else: nodesize=minnode # otherwise use min value (e.g. if nodeSizes has only k>0 nodes, # and k=0 nodes from thresholding are shown too. else: if node in net: nodesize=A*strengths[node]+B else: nodesize=minnode if node in net: nodestrength=strengths[node] else: # This is for nodes which appear in MST coords (i.e. have # zero links) and are thus not included in net, but should # yet be displayed when visualizing a thresholded network nodestrength=mins # Then determine color if coloredNodes: if setNodeColorsByProperty != None: # If setNodeColorsByProperty is given, use it initially value = net.nodeProperty[setNodeColorsByProperty][node] color = setColor(value,nodePropertyLimits,myNodeColorMap) if len(nodeColors)>0: # If dict nodeColors is given, it overrides # setNodeColorsByProperty if not nodeColors.get(node): # If node is not contained in dict nodeColors if setNodeColorsByProperty == None: # Use setNodeColorsByProperty if it was given, # otherwise use nodeColor and if it is not # given use white. color = (nodeColor or (1,1,1)) else: # If node IS contained in dict nodeColors, use # nodeColors[node] ctemp = nodeColors[node] if len(ctemp)==6: # Recognize as Himmeli-type string ('999999') rc=float(ctemp[0:2])/99.0 gc=float(ctemp[2:4])/99.0 bc=float(ctemp[4:6])/99.0 # this is a stupid hack; sometimes rounding # errors result in rc=1.0 + epsilon and # matplotlib complains... rc = max(0.0, min(rc, 1.0)) bc = max(0.0, min(bc, 1.0)) gc = max(0.0, min(gc, 1.0)) color = (rc,gc,bc) else: # Otherwise assume it is an RGB tuple color = nodeColors[node] elif setNodeColorsByProperty is None and nodeColor is not None: # If neither setNodeColorsByProperty or dict # nodeColors is given, but nodeColor is, use nodeColor. if len(nodeColor)==6: rc=float(nodeColor[0:2])/99.0 gc=float(nodeColor[2:4])/99.0 bc=float(nodeColor[4:6])/99.0 rc = max(0.0, min(rc, 1.0)) bc = max(0.0, min(bc, 1.0)) gc = max(0.0, min(gc, 1.0)) color=(rc,gc,bc) else: color=nodeColor elif setNodeColorsByProperty == None: # Set color by node strength color = setColor(nodestrength,(mins,maxs),myNodeColorMap) else: # If coloredNodes is False, use white. color=(1.0,1.0,1.0) # Move node labels slightly to the right so that they # don't coincide on the nodes nodeLabel_xOffset = (nodeLabel_xOffset or float(nodesize)/40) plot_node(axes, x=xy[node][0], y=xy[node][1], color=color, size=nodesize,edgecolor=node_edgecolor) if not (uselabels=='none'): if uselabels == 'all': axes.annotate(str(node),(xy[node][0]+nodeLabel_xOffset,xy[node][1]), color=fontcolor,size=fontsize) elif node in labels: if isinstance(labels[node],float): showthislabel="%2.2f" % labels[node] else: showthislabel=labels[node] axes.annotate(showthislabel,(xy[node][0]+nodeLabel_xOffset,xy[node][1]),color=fontcolor,size=fontsize) xylist = xy.values() xlist=[] ylist=[] for elem in xylist: xlist.append(elem[0]) ylist.append(elem[1]) minx=min(xlist) maxx=max(xlist) miny=min(ylist) maxy=max(ylist) xdelta=0.05*(maxx-minx) ydelta=0.05*(maxy-miny) if frame==True and showTicks==False: setp(axes,'xticks',[],'xticklabels',[],'yticks',[],'yticklabels',[]) if not axisLimits==None: # If limits are given, use them, whatever the values of # showTicks or frame ... setp(axes, 'xlim', (axisLimits[0][0],axisLimits[0][1]), 'ylim', (axisLimits[1][0],axisLimits[1][1])) else: setp(axes, 'xlim', (minx-xdelta,maxx+xdelta), 'ylim', (miny-ydelta,maxy+ydelta)) return thisfigure | 5b590591c50efd58822f1cb0f934b092db648f88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/768/5b590591c50efd58822f1cb0f934b092db648f88/visuals.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26832,
554,
7308,
12,
2758,
16,
7668,
16,
14697,
28657,
26,
16,
26,
3631,
19757,
3205,
33,
5510,
16,
1606,
554,
33,
8381,
16,
3249,
33,
7036,
16,
14869,
33,
27,
16,
2405,
1595,
3205,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26832,
554,
7308,
12,
2758,
16,
7668,
16,
14697,
28657,
26,
16,
26,
3631,
19757,
3205,
33,
5510,
16,
1606,
554,
33,
8381,
16,
3249,
33,
7036,
16,
14869,
33,
27,
16,
2405,
1595,
3205,
... |
def docclass(self, object): | def docclass(self, object, name=None): | def docclass(self, object): """Produce text documentation for a given class object.""" name = object.__name__ bases = object.__bases__ | 54a838fe1421d6e6829cabc42e7f398722140804 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/54a838fe1421d6e6829cabc42e7f398722140804/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
1106,
12,
2890,
16,
733,
16,
508,
33,
7036,
4672,
3536,
25884,
977,
7323,
364,
279,
864,
667,
733,
12123,
508,
273,
733,
16186,
529,
972,
8337,
273,
733,
16186,
18602,
972,
2,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
1106,
12,
2890,
16,
733,
16,
508,
33,
7036,
4672,
3536,
25884,
977,
7323,
364,
279,
864,
667,
733,
12123,
508,
273,
733,
16186,
529,
972,
8337,
273,
733,
16186,
18602,
972,
2,
-10... |
result.extend(subpackageDottedNames(path, ns_dottedname)) | subpackages = subpackageDottedNames(path, ns_dottedname) for subpackage in subpackages: if subpackage not in ns_dottednames: result.append(subpackage) | def dottedNames(self): """Return dotted names of all relevant packages in a distribution. | ecf51268132a9e4bc1a7e97ced2734a086c9a1f6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9605/ecf51268132a9e4bc1a7e97ced2734a086c9a1f6/utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20965,
1557,
12,
2890,
4672,
3536,
990,
20965,
1257,
434,
777,
9368,
5907,
316,
279,
7006,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
20965,
1557,
12,
2890,
4672,
3536,
990,
20965,
1257,
434,
777,
9368,
5907,
316,
279,
7006,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
class DiskCached(DiskCache): | def _get_fname( self, obj_id ): """ computes the filename of the file with the given object identifier and creates the required directory structure (if necessary). """ assert( len(obj_id) >= self.cache_nesting_level ) obj_dir = join( *( [self.cache_dir] + list( obj_id[:self.cache_nesting_level] )) ) if not exists(obj_dir): makedirs(obj_dir) return join(obj_dir, obj_id+self.cache_file_suffix) class DiskCached(): | def getCacheStatistics(self): """ returns statistics regarding the cache's hit/miss ratio """ return {'cache_hits': self._cache_hit, 'cache_misses': self._cache_miss} | 2355828a58c7929e11ae58a88a6ffb902ba065ba /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6604/2355828a58c7929e11ae58a88a6ffb902ba065ba/cache.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8577,
8569,
12,
2890,
4672,
3536,
1135,
7691,
29012,
326,
1247,
1807,
6800,
19,
3105,
7169,
3536,
327,
13666,
2493,
67,
15173,
4278,
365,
6315,
2493,
67,
15989,
16,
296,
2493,
67,
3105,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8577,
8569,
12,
2890,
4672,
3536,
1135,
7691,
29012,
326,
1247,
1807,
6800,
19,
3105,
7169,
3536,
327,
13666,
2493,
67,
15173,
4278,
365,
6315,
2493,
67,
15989,
16,
296,
2493,
67,
3105,
... |
sys.exit(False) | sys.exit(1) | def main(): """Support mirobridge from the command line returns True """ global localhostname, simulation, verbose, storagegroups, ffmpeg, channel_id, channel_num global flat, download_sleeptime, channel_watch_only, channel_mythvideo_only, channel_new_watch_copy global vid_graphics_dirs, imagemagick, statistics, requirements_are_met global graphic_suffix, graphic_path_suffix, graphic_name_suffix global mythcommflag_recordings, mythcommflag_videos global local_only parser = OptionParser(usage=u"%prog usage: mirobridge -huevstdociVHSCWM [parameters]\n") parser.add_option( "-e", "--examples", action="store_true", default=False, dest="examples", help=u"Display examples for executing the jamu script") parser.add_option( "-v", "--version", action="store_true", default=False, dest="version", help=u"Display version and author information") parser.add_option( "-s", "--simulation", action="store_true", default=False, dest="simulation", help=u"Simulation (dry run), no files are copied, symlinks created or MythTV data bases altered. If option (-n) is NOT specified Miro auto downloads WILL take place. See option (-n) help for details.") parser.add_option( "-t", "--testenv", action="store_true", default=False, dest="testenv", help=u"Test that the local environment can run all mirobridge functionality") parser.add_option( "-n", "--no_autodownload", action="store_true", default=False, dest="no_autodownload", help=u"Do not perform Miro Channel updates, video expiry and auto-downloadings. Default is to perform all perform all Channel maintenance features.") parser.add_option( "-o", "--nosubdirs", action="store_true", default=False, dest="nosubdirs", help=u"Organise MythVideo's Miro directory WITHOUT Miro channel subdirectories. The default is to have Channel subdirectories.") parser.add_option( "-c", "--channel", metavar="CHANNEL_ID:CHANNEL_NUM", default="", dest="channel", help=u'Specifies the channel id that is used for Miros unplayed recordings. Enter as "xxxx:yyy". Default is 9999:999. Be warned that once you change the default channel_id "9999" you must always use this option!') #parser.add_option( "-i", "--import", metavar="CONFIGFILE", default="", dest="import", # help=u'Import Miro exported configuration file and or channel changes.') parser.add_option( "-V", "--verbose", action="store_true", default=False, dest="verbose", help=u"Display verbose messages when processing") parser.add_option( "-H", "--hostname", metavar="HOSTNAME", default="", dest="hostname", help=u"MythTV Backend hostname mirobridge is to up date") parser.add_option( "-S", "--sleeptime", metavar="SLEEP_DELAY_SECONDS", default="", dest="sleeptime", help=u"The amount of seconds to wait for an auto download to start.\nThe default is 60 seconds, but this may need to be adjusted for slower Internet connections.") parser.add_option( "-C", "--addchannel", metavar="ICONFILE_PATH", default="OFF", dest="addchannel", help=u'Add a Miro Channel record to MythTV. This gets rid of the "#9999 #9999" on the Watch Recordings screen and replaces it with the usual\nthe channel number and channel name.\nThe default if not overridden by the (-c) option is channel number 999.\nIf a filename and path is supplied it will be set as the channels icon. Make sure your override channel number is NOT one of your current MythTV channel numbers.\nThis option is typically only used once as there can only be one Miro channel record at a time.') parser.add_option( "-N", "--new_watch_copy", action="store_true", default=False, dest="new_watch_copy", help=u'For ALL Miro Channels: Use the "Watch Recording" screen to watch new Miro downloads then once watched copy the videos, icons, screen shot and metadata to MythVideo. Once coping is complete delete the video from Miro.\nThis option overrides any "mirobridge.conf" settings.') parser.add_option( "-W", "--watch_only", action="store_true", default=False, dest="watch_only", help=u'For ALL Miro Channels: Only use "Watch Recording" never move any Miro videos to MythVideo.\nThis option overrides any "mirobridge.conf" settings.') parser.add_option( "-M", "--mythvideo_only", action="store_true", default=False, dest="mythvideo_only", help=u'For ALL Miro Channel videos: Copy newly downloaded Miro videos to MythVideo and removed from Miro. These Miro videos never appear in the MythTV "Watch Recording" screen.\nThis option overrides any "mirobridge.conf" settings.') opts, args = parser.parse_args() if opts.examples: # Display example information sys.stdout.write(examples_txt+'\n') sys.exit(True) if opts.version: # Display program information sys.stdout.write(u"\nTitle: (%s); Version: description(%s); Author: (%s)\n%s\n" % ( __title__, __version__, __author__, __purpose__ )) sys.exit(True) if opts.testenv: test_environment = True else: test_environment = False # Verify that Miro is not currently running if isMiroRunning(): sys.exit(False) # Verify that only None or one of the mutually exclusive (-W), (-M) and (-N) options is being used x = 0 if opts.new_watch_copy: x+=1 if opts.watch_only: x+=1 if opts.mythvideo_only: x+=1 if x > 1: logger.critical(u"The (-W), (-M) and (-N) options are mutually exclusive, so only one can be specified at a time.") sys.exit(False) # Set option related global variables simulation = opts.simulation verbose = opts.verbose if opts.hostname: # Override localhostname if the user specified an hostname localhostname = opts.hostname # Validate settings # Make sure mirobridge is to update a real MythTV backend if not mythdb.getSetting(u'BackendServerIP', hostname = localhostname): logger.critical(u"The MythTV backend (%s) is not a MythTV backend." % localhostname) if test_environment: requirements_are_met = False else: sys.exit(False) ## Video base directory and current version and revision numbers base_video_dir = config.get(prefs.MOVIES_DIRECTORY) miro_version_rev = u"%s r%s" % (config.get(prefs.APP_VERSION), config.get(prefs.APP_REVISION_NUM)) displayMessage(u"Miro Version (%s)" % (miro_version_rev)) displayMessage(u"Base Miro Video Directory (%s)" % (base_video_dir,)) logger.info(u'') # Verify Miro version sufficent and Video file configuration correct. if not os.path.isdir(base_video_dir): logger.critical(u"The Miro Videos directory (%s) does not exist." % str(base_video_dir)) if test_environment: requirements_are_met = False else: sys.exit(False) if config.get(prefs.APP_VERSION) < u"2.0.3": logger.critical(u"The installed version of Miro (%s) is too old. It must be at least v2.0.3 or higher." % config.get(prefs.APP_VERSION)) if test_environment: requirements_are_met = False else: sys.exit(False) # Get storage groups if getStorageGroups() == False: logger.critical(u"Retrieving storage groups from the MythTV data base failed") if test_environment: requirements_are_met = False else: sys.exit(False) elif not u'default' in storagegroups.keys(): logger.critical(u"There must be a 'Default' storage group") if test_environment: requirements_are_met = False else: sys.exit(False) if opts.channel: channel = opts.channel.split(u':') if len(channel) != 2: logger.critical(u"The Channel (%s) must be in the format xxx:yyy with x an y all numeric." % str(opts.channel)) if test_environment: requirements_are_met = False else: sys.exit(False) elif not _can_int(channel[0]) or not _can_int(channel[1]): logger.critical(u"The Channel_id (%s) and Channel_num (%s) must be numeric." % (channel[0], channel[1])) if test_environment: requirements_are_met = False else: sys.exit(False) else: channel_id = int(channel[0]) channel_num = int(channel[1]) if opts.sleeptime: if not _can_int(opts.sleeptime): logger.critical(u"Auto-dewnload sleep time (%s) must be numeric." % str(opts.sleeptime)) if test_environment: requirements_are_met = False else: sys.exit(False) else: download_sleeptime = float(opts.sleeptime) getMythtvDirectories() # Initialize all the Video and graphics directory dictionary if opts.nosubdirs: # Did the user want a flat MythVideo "Miro" directory structure? flat = True # Get the values in the mirobridge.conf configuration file setUseroptions() if opts.watch_only: # ALL Miro videos will only be viewed in the MythTV "Watch Recordings" screen channel_watch_only = [u'all'] if opts.mythvideo_only: # ALL Miro videos will be copied to MythVideo and removed from Miro channel_mythvideo_only = {u'all': vid_graphics_dirs[u'mythvideo']+u'Miro/'} # Once watched ALL Miro videos will be copied to MythVideo and removed from Miro if opts.new_watch_copy: channel_new_watch_copy = {u'all': vid_graphics_dirs[u'mythvideo']+u'Miro/'} # Verify that "Mythvideo Only" and "New-Watch-Copy" channels do not clash if len(channel_mythvideo_only) and len(channel_new_watch_copy): for key in channel_mythvideo_only.keys(): if key in channel_new_watch_copy.keys(): logger.critical(u'The Miro Channel (%s) cannot be used as both a "Mythvideo Only" and "New-Watch-Copy" channel.' % key) if test_environment: requirements_are_met = False else: sys.exit(False) # Verify that ImageMagick is installed ret = useImageMagick(u"convert -version") if ret < 0 or ret > 1: logger.critical(u"ImageMagick must be installed, graphics cannot be resized or converted to the required graphics format (e.g. jpg and or png)") if test_environment: requirements_are_met = False else: sys.exit(False) # Verify that mythcommflag is installed mythcommflagpath = getlocationMythcommflag() if mythcommflagpath: mythcommflag_recordings = mythcommflag_recordings % mythcommflagpath mythcommflag_videos = mythcommflag_videos % mythcommflagpath else: logger.critical(u"mythcommflag must be installed so that Miro video seek tables can be built.") if test_environment: requirements_are_met = False else: sys.exit(False) if opts.testenv: # All tests passed getVideoDetails(u"") # Test that ffmpeg is available if ffmpeg and requirements_are_met: logger.info(u"The environment test passed !\n\n") sys.exit(True) else: logger.critical(u"The environment test FAILED. See previously displayed error messages!") sys.exit(False) if opts.addchannel != u'OFF': # Add a Miro Channel record - Should only be done once createChannelRecord(opts.addchannel, channel_id, channel_num) logger.info(u"The Miro Channel record has been successfully created !\n\n") sys.exit(True) ########################################### # Mainlogic for all Miro and MythTV bridge ########################################### # # Start the Miro Front and Backend - This allows mirobridge to execute actions on the Miro backend # displayMessage(u"Starting Miro Frontend and Backend") startup.initialize(config.get(prefs.THEME_NAME)) app.cli_events = EventHandler() app.cli_events.connect_to_signals() startup.startup() app.cli_events.startup_event.wait() if app.cli_events.startup_failure: logger.critical(u"Starting Miro Frontend and Backend failed: (%s)" % app.cli_events.startup_failure[0]) print_text(app.cli_events.startup_failure[1]) app.controller.shutdown() time.sleep(5) # Let the shutdown processing complete sys.exit(False) app.cli_interpreter = MiroInterpreter() if opts.verbose: app.cli_interpreter.verbose = True else: app.cli_interpreter.verbose = False app.cli_interpreter.simulation = opts.simulation app.cli_interpreter.videofiles = [] app.cli_interpreter.downloading = False app.cli_interpreter.icon_cache_dir = config.get(prefs.ICON_CACHE_DIRECTORY) app.cli_interpreter.imagemagick = imagemagick app.cli_interpreter.statistics = statistics if config.get(prefs.APP_VERSION) < u"2.5.0": app.renderer = app.cli_interpreter else: app.movie_data_program_info = app.cli_interpreter.movie_data_program_info # # Optionally Update Miro feeds and # download any "autodownloadable" videos which are pending # if not opts.no_autodownload: if opts.verbose: app.cli_interpreter.verbose = False app.cli_interpreter.do_mythtv_getunwatched(u'') before_download = len(app.cli_interpreter.videofiles) if opts.verbose: app.cli_interpreter.verbose = True app.cli_interpreter.do_mythtv_update_autodownload(u'') time.sleep(download_sleeptime) firsttime = True while True: app.cli_interpreter.do_mythtv_check_downloading(u'') if app.cli_interpreter.downloading: time.sleep(30) firsttime = False continue elif firsttime: time.sleep(download_sleeptime) firsttime = False continue else: break if opts.verbose: app.cli_interpreter.verbose = False app.cli_interpreter.do_mythtv_getunwatched(u'') after_download = len(app.cli_interpreter.videofiles) statistics[u'Miros_videos_downloaded'] = after_download - before_download if opts.verbose: app.cli_interpreter.verbose = True # Deal with orphaned oldrecorded records. # These records indicate that the MythTV user deleted the video from the Watched Recordings screen # or from MythVideo # These video items must also be deleted from Miro videostodelete = getOldrecordedOrphans() if len(videostodelete): displayMessage(u"Starting Miro delete of videos deleted in the MythTV Watched Recordings screen.") for video in videostodelete: # Completely remove the video and item information from Miro app.cli_interpreter.do_mythtv_item_remove([video[u'title'], video[u'subtitle']]) # # Collect the set of played Miro video files # app.cli_interpreter.videofiles = getPlayedMiroVideos() # # Updated the played status of items # if app.cli_interpreter.videofiles: displayMessage(u"Starting Miro update of watched MythTV videos") app.cli_interpreter.do_mythtv_updatewatched(u'') # # Get the unwatched videos details from Miro # app.cli_interpreter.do_mythtv_getunwatched(u'') unwatched = app.cli_interpreter.videofiles # # Get the watched videos details from Miro # app.cli_interpreter.do_mythtv_getwatched(u'') watched = app.cli_interpreter.videofiles # # Remove any duplicate Miro videoes from the unwatched or watched list of Miro videos # This means that Miro has duplicates due to a Miro/Channel website issue # These videos should not be added to the MythTV Watch Recordings screen # unwatched_copy = [] for item in unwatched: unwatched_copy.append(item) for item in unwatched_copy: # Check for a duplicate against already watched Miro videos for x in watched: if item[u'channelTitle'] == x[u'channelTitle'] and item[u'title'] == x[u'title']: try: unwatched.remove(item) # Completely remove this duplicate video and item information from Miro app.cli_interpreter.do_mythtv_item_remove(item[u'videoFilename']) displayMessage(u"Skipped adding a duplicate Miro video to the MythTV Watch Recordings screen (%s - %s) which is already in MythVideo.\nSometimes a Miro channel has the same video downloaded multiple times.\nThis is a Miro/Channel web site issue and often rectifies itself overtime." % (item[u'channelTitle'], item[u'title'])) except ValueError: pass duplicates = [] for item in unwatched_copy: dup_flag = 0 for x in unwatched: # Check for a duplicate against un-watched Miro videos if item[u'channelTitle'] == x[u'channelTitle'] and item[u'title'] == x[u'title']: dup_flag+=1 if dup_flag > 1: for x in duplicates: if item[u'channelTitle'] == x[u'channelTitle'] and item[u'title'] == x[u'title']: break else: duplicates.append(item) for duplicate in duplicates: try: unwatched.remove(duplicate) # Completely remove this duplicate video and item information from Miro app.cli_interpreter.do_mythtv_item_remove(duplicate[u'videoFilename']) displayMessage(u"Skipped adding a Miro video to the MythTV Watch Recordings screen (%s - %s) as there are duplicate 'new' video items.\nSometimes a Miro channel has the same video downloaded multiple times.\nThis is a Miro/Channel web site issue and often rectifies itself overtime." % (duplicate[u'channelTitle'], duplicate[u'title'])) except ValueError: pass # # Deal with any Channel videos that are to be copied and removed from Miro # copy_items = [] # Copy unwatched and watched Miro videos (all or only selected Channels) if u'all' in channel_mythvideo_only: for array in [watched, unwatched]: for item in array: copy_items.append(item) elif len(channel_mythvideo_only): for array in [watched, unwatched]: for video in array: if filter(is_not_punct_char, video[u'channelTitle'].lower()) in channel_mythvideo_only.keys(): copy_items.append(video) # Copy ONLY watched Miro videos (all or only selected Channels) if u'all' in channel_new_watch_copy: for video in watched: copy_items.append(video) elif len(channel_new_watch_copy): for video in watched: if filter(is_not_punct_char, video[u'channelTitle'].lower()) in channel_new_watch_copy.keys(): copy_items.append(video) channels_to_copy = {} for key in channel_mythvideo_only.keys(): channels_to_copy[key] = channel_mythvideo_only[key] for key in channel_new_watch_copy.keys(): channels_to_copy[key] = channel_new_watch_copy[key] for video in copy_items: dir_key = filter(is_not_punct_char, video[u'channelTitle'].lower()) # Create the subdirectories to copy the video into directory_coverart = False if not os.path.isdir(channels_to_copy[dir_key]): if simulation: logger.info(u"Simulation: Creating the MythVideo directory (%s)." % (channels_to_copy[dir_key])) else: os.makedirs(channels_to_copy[dir_key]) directory_coverart = True # If the directory was just created it needs coverart else: if video[u'channel_icon']: ext = getExtention(video[u'channel_icon']) if not os.path.isfile(u"%s%s.%s" % (channels_to_copy[dir_key], video[u'channelTitle'].lower(), ext)): directory_coverart = True # If the directory was just created it needs coverart elif video[u'item_icon']: ext = getExtention(video[u'item_icon']) if not os.path.isfile(u"%s%s - %s.%s" % (channels_to_copy[dir_key], video[u'channelTitle'].lower(), video[u'title'].lower(), ext)): directory_coverart = True # If the directory was just created it needs coverart # Copy the Channel icon located in the posters/coverart directory if directory_coverart and video[u'channel_icon']: ext = getExtention(video[u'channel_icon']) tmp_path = channels_to_copy[dir_key][:-1] foldername = tmp_path[tmp_path.rindex(u'/')+1:] dirpath = u"%s%s" % (channels_to_copy[dir_key], u'folder.jpg') dirpath2 = u"%s%s" % (channels_to_copy[dir_key], u'folder.png') if os.path.isfile(dirpath) or os.path.isfile(dirpath2): # See if a folder cover already exists pass else: if simulation: logger.info(u"Simulation: Copy a Channel Icon (%s) for directory (%s)." % (video[u'channel_icon'], dirpath)) else: try: # Miro Channel icon copy for the new subdirectory useImageMagick(u'convert "%s" "%s"' % (video[u'channel_icon'], dirpath)) except: logger.critical(u"Copy a Channel Icon (%s) for directory (%s) failed." % (video[u'channel_icon'], dirpath)) # Gracefully close the Miro database and shutdown the Miro Front and Back ends app.controller.shutdown() time.sleep(5) # Let the shutdown processing complete sys.exit(False) # Copy the Miro video file save_video_filename = video[u'videoFilename'] # This filename is needed later for deleting in Miro ext = getExtention(video[u'videoFilename']) if ext.lower() == u'm4v': ext = u'mpg' filepath = u"%s%s - %s.%s" % (channels_to_copy[dir_key], video[u'channelTitle'], video[u'title'], ext) if simulation: logger.info(u"Simulation: Copying the Miro video (%s) to the MythVideo directory (%s)." % (video[u'videoFilename'], filepath)) else: try: # Miro video copied into a MythVideo directory shutil.copy2(video[u'videoFilename'], filepath) statistics[u'Miros_MythVideos_copied']+=1 if u'mythvideo' in storagegroups.keys() and not local_only: video[u'videoFilename'] = filepath.replace(storagegroups[u'mythvideo'], u'') else: video[u'videoFilename'] = filepath except: logger.critical(u"Copying the Miro video (%s) to the MythVideo directory (%s).\n This maybe a permissions error (mirobridge.py does not have permission to write to the directory)." % (video[u'videoFilename'], filepath)) # Gracefully close the Miro database and shutdown the Miro Front and Back ends app.controller.shutdown() time.sleep(5) # Let the shutdown processing complete sys.exit(False) # Copy the Channel or item's icon if video[u'channel_icon'] and not video[u'channelTitle'].lower() in channel_icon_override: pass else: if video[u'item_icon']: video[u'channel_icon'] = video[u'item_icon'] if video[u'channel_icon']: ext = getExtention(video[u'channel_icon']) if video[u'channelTitle'].lower() in channel_icon_override: filepath = u"%s%s - %s%s.%s" % (vid_graphics_dirs[u'posterdir'], video[u'channelTitle'], video[u'title'], graphic_suffix[u'posterdir'], ext) else: filepath = u"%s%s%s.%s" % (vid_graphics_dirs[u'posterdir'], video[u'channelTitle'], graphic_suffix[u'posterdir'], ext) # There may already be a Channel icon available or it is a symlink which needs to be replaced if not os.path.isfile(filepath) or os.path.islink(filepath): if simulation: logger.info(u"Simulation: Copying the Channel Icon (%s) to the poster directory (%s)." % (video[u'channel_icon'], filepath)) else: try: # Miro Channel icon copied into a MythVideo directory try: # Remove any old symlink file os.remove(filepath) except OSError: pass shutil.copy2(video[u'channel_icon'], filepath) if u'posterdir' in storagegroups.keys() and not local_only: video[u'channel_icon'] = filepath.replace(storagegroups[u'posterdir'], u'') else: video[u'channel_icon'] = filepath except: logger.critical(u"Copying the Channel Icon (%s) to the poster directory (%s).\n This maybe a permissions error (mirobridge.py does not have permission to write to the directory)." % (video[u'channel_icon'], filepath)) # Gracefully close the Miro database and shutdown the Miro Front and Back ends app.controller.shutdown() time.sleep(5) # Let the shutdown processing complete sys.exit(False) else: if u'posterdir' in storagegroups.keys() and not local_only: video[u'channel_icon'] = filepath.replace(storagegroups[u'posterdir'], u'') else: video[u'channel_icon'] = filepath # There may already be a Screenshot available or it is a symlink which needs to be replaced if video[u'screenshot']: ext = getExtention(video[u'screenshot']) filepath = u"%s%s - %s%s.%s" % (vid_graphics_dirs[u'episodeimagedir'], video[u'channelTitle'], video[u'title'], graphic_suffix[u'episodeimagedir'], ext) else: filepath = u'' if not os.path.isfile(filepath) or os.path.islink(filepath): if video[u'screenshot']: if simulation: logger.info(u"Simulation: Copying the Screenshot (%s) to the Screenshot directory (%s)." % (video[u'screenshot'], filepath)) else: try: # Miro Channel icon copied into a MythVideo directory try: # Remove any old symlink file os.remove(filepath) except OSError: pass shutil.copy2(video[u'screenshot'], filepath) displayMessage(u"Copied Miro screenshot file (%s) to MythVideo (%s)" % (video[u'screenshot'], filepath)) if u'episodeimagedir' in storagegroups.keys() and not local_only: video[u'screenshot'] = filepath.replace(storagegroups[u'episodeimagedir'], u'') else: video[u'screenshot'] = filepath except: logger.critical(u"Copying the Screenshot (%s) to the Screenshot directory (%s).\n This maybe a permissions error (mirobridge.py does not have permission to write to the directory)." % (video[u'screenshot'], filepath)) # Gracefully close the Miro database and shutdown the Miro Front and Back ends app.controller.shutdown() time.sleep(5) # Let the shutdown processing complete sys.exit(False) elif video[u'screenshot']: if u'episodeimagedir' in storagegroups.keys() and not local_only: video[u'screenshot'] = filepath.replace(storagegroups[u'episodeimagedir'], u'') else: video[u'screenshot'] = filepath video[u'copied'] = True # Mark this video item as being copied # Completely remove the video and item information from Miro app.cli_interpreter.do_mythtv_item_remove(save_video_filename) # Gracefully close the Miro database and shutdown the Miro Front and Back ends app.controller.shutdown() time.sleep(5) # Let the shutdown processing complete # # Add and delete MythTV (Watch Recordings) Miro recorded records # Add and remove symlinks for Miro video files # # Check if the user does not want any channels Added to the "Watch Recordings" screen if channel_mythvideo_only.has_key(u'all'): for video in unwatched: watched.append(video) unwatched = [] else: if len(channel_mythvideo_only): unwatched_copy = [] for video in unwatched: if not filter(is_not_punct_char, video[u'channelTitle'].lower()) in channel_mythvideo_only.keys(): unwatched_copy.append(video) else: watched.append(video) unwatched = unwatched_copy statistics[u'Total_unwatched'] = len(unwatched) if not len(unwatched): displayMessage(u"There are no Miro unwatched video items to add as MythTV Recorded videos.") if not updateMythRecorded(unwatched): logger.critical(u"Updating MythTV Recording with Miro video files failed." % str(base_video_dir)) sys.exit(False) # # Add and delete MythVideo records for played Miro Videos # Add and delete symbolic links to Miro Videos and subdirectories # Add and delete symbolic links to coverart/Miro icons and Miro screenshots/fanart # if len(channel_watch_only): # If the user does not want any channels moved to MythVideo exit if channel_watch_only[0].lower() == u'all': printStatistics() return True if not len(watched): displayMessage(u"There are no Miro watched items to add to MythVideo") if not updateMythVideo(watched): logger.critical(u"Updating MythVideo with Miro video files failed.") sys.exit(False) printStatistics() return True | 0f178cb606ce1cfb96840e30bd489d420b041e6d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13713/0f178cb606ce1cfb96840e30bd489d420b041e6d/mirobridge.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
3536,
6289,
312,
11373,
18337,
628,
326,
1296,
980,
1135,
1053,
3536,
2552,
1191,
10358,
16,
14754,
16,
3988,
16,
2502,
4650,
16,
6875,
19951,
16,
1904,
67,
350,
16,
1904,
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,
2774,
13332,
3536,
6289,
312,
11373,
18337,
628,
326,
1296,
980,
1135,
1053,
3536,
2552,
1191,
10358,
16,
14754,
16,
3988,
16,
2502,
4650,
16,
6875,
19951,
16,
1904,
67,
350,
16,
1904,
6... |
age.mfs.update() print "Writing %s" %(agename + ".xml") age.mfs.writexml(basepath + "/" + agename + ".xml") | def export_age(agename,basepath,selection=0,merge=0,pagename=None): print "Exporting age %s" %agename # load the alcscript AlcScript.LoadFromBlender() rmgr=alcResManager(basepath,alcconfig.ver0,alcconfig.ver2) if merge: rmgr.preload() rmgr.export_book(agename,selection) age=rmgr.findAge(agename) age.write() #first load if merge: for page in age.pages: page.load() if not merge and pagename!=None: for page in age.pages: if page.name=="Textures": page.load() #now export for page in age.pages: if page.name=="Textures": page.export_all(selection) for page in age.pages: if (pagename==None or page.name==pagename) and page.name!="Textures": page.export_all(selection) #save print "" # for formatting of output for page in age.pages: if pagename==None or page.name=="Textures" or page.name==pagename: page.save() #unload for page in age.pages: page.unload() #generate the funny file print "Writing %s" %(agename + ".fni") initxt=alcFindBlenderText("init") fnitxt="" for line in initxt.asLines(): fnitxt=fnitxt + line + "\n" if fnitxt!="": age.setInit(fnitxt) age.mfs.addFile(basepath + "/" + agename + ".fni") #generate mfs and sum files #print "Computing Checksums..." age.mfs.update() print "Writing %s" %(agename + ".xml") age.mfs.writexml(basepath + "/" + agename + ".xml") old_style=0 if alcconfig.ver2==11: old_style=1 print "Writing %s" %(agename + ".sum") age.mfs.writesum(basepath + "/" + agename + ".sum",old_style) | c25e3a96eb2b4bb1fe5d5742f701296b21caa292 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12286/c25e3a96eb2b4bb1fe5d5742f701296b21caa292/uruprp_export.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3359,
67,
410,
12,
346,
1069,
16,
1969,
803,
16,
10705,
33,
20,
16,
2702,
33,
20,
16,
9095,
1069,
33,
7036,
4672,
1172,
315,
6144,
310,
9388,
738,
87,
6,
738,
346,
1069,
468,
1262,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3359,
67,
410,
12,
346,
1069,
16,
1969,
803,
16,
10705,
33,
20,
16,
2702,
33,
20,
16,
9095,
1069,
33,
7036,
4672,
1172,
315,
6144,
310,
9388,
738,
87,
6,
738,
346,
1069,
468,
1262,
... | |
failedDeps = self._checkDependencies(cfg, repos, labelPath) | failedDeps = self._checkDependencies(repos) | def findTroves(self, troveMap, cfg, repos, labelPath, flavor): self._findTroves(troveMap) self._removeTroves(repos) | f69122887a79464c05d1e19fe7809f82a90a9e3e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/f69122887a79464c05d1e19fe7809f82a90a9e3e/recipe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
56,
303,
3324,
12,
2890,
16,
23432,
537,
863,
16,
2776,
16,
13686,
16,
1433,
743,
16,
19496,
4672,
365,
6315,
4720,
56,
303,
3324,
12,
88,
303,
537,
863,
13,
365,
6315,
4479,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
56,
303,
3324,
12,
2890,
16,
23432,
537,
863,
16,
2776,
16,
13686,
16,
1433,
743,
16,
19496,
4672,
365,
6315,
4720,
56,
303,
3324,
12,
88,
303,
537,
863,
13,
365,
6315,
4479,
5... |
from reportlab.pdfbase.pdfmetrics import _py_unicode2T1, _py_getFont | from reportlab.pdfbase.pdfmetrics import _py_unicode2T1, getFont, _fonts | def test_unicode2T1(self): from reportlab.pdfbase.pdfmetrics import _py_unicode2T1, _py_getFont from _rl_accel import unicode2T1 t1fn = 'Times-Roman' t1f = _py_getFont(t1fn) enc = 'cp1252' senc = 'utf8' testCp1252 = ('copyright %s trademark %s registered %s ReportLab! Ol%s!' % (chr(169), chr(153),chr(174), chr(0xe9))).decode(enc) utext = 'This is the end of the \xce\x91\xce\xb2 world. This is the end of the \xce\x91\xce\xb2 world jap=\xe3\x83\x9b\xe3\x83\x86. This is the end of the \xce\x91\xce\xb2 world. This is the end of the \xce\x91\xce\xb2 world jap=\xe3\x83\x9b\xe3\x83\x86'.decode('utf8') def tfunc(f,ts): w1 = unicode2T1(ts,[f]+f.substitutionFonts) w2 = _py_unicode2T1(ts,[f]+f.substitutionFonts) assert w1==w2,"%r != %r" % (w1,w2) tfunc(t1f,testCp1252) tfunc(t1f,utext) | 12e8e9cc55671e5cc6f4a8cba83406f53d6c3513 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/12e8e9cc55671e5cc6f4a8cba83406f53d6c3513/test_rl_accel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9124,
22,
56,
21,
12,
2890,
4672,
628,
2605,
7411,
18,
7699,
1969,
18,
7699,
9597,
1930,
389,
2074,
67,
9124,
22,
56,
21,
16,
18776,
16,
389,
22052,
628,
389,
1321,
67,
307... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9124,
22,
56,
21,
12,
2890,
4672,
628,
2605,
7411,
18,
7699,
1969,
18,
7699,
9597,
1930,
389,
2074,
67,
9124,
22,
56,
21,
16,
18776,
16,
389,
22052,
628,
389,
1321,
67,
307... |
res = self.__getDirectoryContents(path) | res = self.__getDirectoryContents( path ) | def getDirectoryReplicas(self, lfn, allStatus=False): """ This method gets all of the pfns in the directory """ res = self.__checkArgumentFormat(lfn) if not res['OK']: return res lfns = res['Value'] created = self.__openSession() failed = {} successful = {} for path in lfns.keys(): res = self.__getDirectoryContents(path) if not res['OK']: failed[path] = res['Message'] else: pathReplicas = {} files = res['Value']['Files'] for lfn,fileDict in files.items(): pathReplicas[lfn] = {} for se,seDict in fileDict['Replicas'].items(): pfn = seDict['PFN'] status = seDict['Status'] if (status != 'P') or allStatus: pathReplicas[lfn][se] = pfn successful[path] = pathReplicas if created: self.__closeSession() resDict = {'Failed':failed,'Successful':successful} return S_OK(resDict) | 6280f3782654b93320f684f56a83a6624459bcec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/6280f3782654b93320f684f56a83a6624459bcec/LcgFileCatalogClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19831,
17248,
12,
2890,
16,
328,
4293,
16,
777,
1482,
33,
8381,
4672,
3536,
1220,
707,
5571,
777,
434,
326,
10811,
2387,
316,
326,
1867,
3536,
400,
273,
365,
16186,
1893,
1379,
1630,
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,
19831,
17248,
12,
2890,
16,
328,
4293,
16,
777,
1482,
33,
8381,
4672,
3536,
1220,
707,
5571,
777,
434,
326,
10811,
2387,
316,
326,
1867,
3536,
400,
273,
365,
16186,
1893,
1379,
1630,
12,... |
print " <3> Data to Scatter Plot:", combined_scatter_data | print "Data to Scatter Plot:", combined_scatter_data | def scatter_plot(group_info,scatter_info,data_set): #data_set is a dictionary keyed by quantity, containing lists of groups and Independent Data and Dep data points. for quantity_number in scatter_info: #print "Dataset for quantity number "+str(quantity_number)+": ", data_set[quantity_number] if data_set[quantity_number] == []: if diagnostic_level >= 2: print "No Scatter Plot Data in Quantity "+str(quantity_number)+" Dataset.\n" else: if diagnostic_level >= 2: print "Scatter Plot Data for Quantity "+str(quantity_number)+" Dataset." # Set variables for Plot extracted from the first group of lines in config file starting with 'q'. # Variables for plot. plot_title = scatter_info[int(quantity_number)]['Scatter_Plot_Title'] if diagnostic_level >= 2: print "Plot Title:", plot_title ind_title = scatter_info[int(quantity_number)]['Ind_Title'] dep_title = scatter_info[int(quantity_number)]['Dep_Title'] min_ind = float(scatter_info[int(quantity_number)]['Plot_Min']) max_ind = float(scatter_info[int(quantity_number)]['Plot_Max']) min_dep = float(scatter_info[int(quantity_number)]['Plot_Min']) max_dep = float(scatter_info[int(quantity_number)]['Plot_Max']) percent_error = float(scatter_info[int(quantity_number)]['%error']) title_position = scatter_info[int(quantity_number)]['Title_Position'] plot_width = float(scatter_info[int(quantity_number)]['Plot_Width(cm)']) # Specify the position and line spacing of the plot key. key_pos = scatter_info[int(quantity_number)]['Key_Position'] key_dist = 0.1*unit.v_cm v_dist = 0.7*unit.v_cm h_dist = 0.4*unit.v_cm #Create filename from fields in input file record. plot_file_name = scatter_info[int(quantity_number)]['Plot_Filename'] if diagnostic_level >= 3: print " <3> Plot File Name:", plot_file_name # Determine the location for the key, alignment based on Key_Position setting. if key_pos == "tl" or "tc" or "tr" or "ml" or "mc" or "mr" or "bl" or "bc" or "br": pass if diagnostic_level >= 3: print " <3> Key Position =", key_pos else: if diagnostic_level >= 2: print "The key position was not specified.\nUsing the default bottom right position." key_pos = "br" # Determine the location for the title, alignment based on Title_Position setting. if title_position == "tl" or "tc" or "tr" or "ml" or "mc" or "mr" or "bl" or "bc" or "br": () if diagnostic_level >= 3: print " <3> Title Position =", title_position else: if diagnostic_level >= 2: print "The Title position was not specified.\nUsing the default top left position." key_pos = "tl" #Begin Plotting # Initialize graph object g = graph.graphxy(width=plot_width, ratio=1/1, key=graph.key.key(pos=key_pos, dist=key_dist, vdist=v_dist, hdist=h_dist, textattrs=[text.size.footnotesize]), x=graph.axis.linear(title=ind_title, min=min_ind, max=max_ind), y=graph.axis.linear(title=dep_title, min=min_dep, max=max_dep)) #Plot Midline and Error bounds lines. errorLineCenterPoints = [[min_ind,min_dep],[max_ind,max_dep]] if diagnostic_level >= 3: print " <3> Error Line Center Points:", errorLineCenterPoints if min_ind < 0: lower_bound = ((min_dep)+((min_dep)*(percent_error / 100))) errorLineLowerPoints = [[min_ind,lower_bound],[max_ind,max_dep]] upper_bound = ((min_dep)-((min_dep)*(percent_error/100))) errorLineUpperPoints = [[min_ind,upper_bound],[max_ind,max_dep]] if diagnostic_level >= 3: print " <3> Error Line Center Points:", errorLineCenterPoints print " <3> Lower Bound:", lower_bound print " <3> Lower Error Line Points:", errorLineLowerPoints print " <3> Upper Bound:", upper_bound print " <3> Upper Error Line Points:", errorLineUpperPoints else: lower_bound = max_dep - max_dep * percent_error / 100 errorLineLowerPoints = [[min_ind,min_dep],[max_ind,lower_bound]] upper_bound = max_dep + max_dep * percent_error / 100.0 errorLineUpperPoints = [[min_ind,min_dep],[max_ind,upper_bound]] if diagnostic_level >= 3: print " <3> Error Line Center Points:", errorLineCenterPoints print " <3> Lower Bound:", lower_bound print " <3> Lower Error Line Points:", errorLineLowerPoints print " <3> Upper Bound:", upper_bound print " <3> Upper Error Line Points:", errorLineUpperPoints g.plot(graph.data.points(errorLineCenterPoints, title=None, x=1, y=2), [graph.style.line([style.linewidth.Thin, style.linestyle.solid])]) if percent_error == 0: if diagnostic_level >= 1: print "No Error Bars Drawn" else: g.plot(graph.data.points(errorLineLowerPoints, title=None, x=1, y=2), [graph.style.line([style.linewidth.Thin, style.linestyle.dashed])]) g.plot(graph.data.points(errorLineUpperPoints, title=None, x=1, y=2), [graph.style.line([style.linewidth.Thin, style.linestyle.dashed])]) #One point at a time added to plot from each data set. # Iterate over items in scatter data dictionary key for items that are not []. # Append data sets to scatter_plot_data_list # colors for symbols are from http://pyx.sourceforge.net/manual/colorname.html scatter_plot_data_list = [] grouped_data = {} grouped_data_list = range(len(group_quantity_data_dicts[0])+1) if diagnostic_level >= 3: print " <3> Grouped Data List:", grouped_data_list if diagnostic_level >= 3: print " <3> DataSet for Quantity "+str(quantity_number)+":", data_set[quantity_number] if len(data_set[quantity_number]) > 1: if diagnostic_level >= 3: print " <3> Grouped Scatter Data:", data_set[quantity_number] for arr_temp in grouped_data_list: grouped_data_list[arr_temp] = [] for data_set_item in data_set[quantity_number]: if diagnostic_level >= 3: print " <3> Data Set Item:", data_set_item print " <3> Data for Group:"+data_set_item[0]+":", data_set_item[1] grouped_data_list[int(data_set_item[0])].append(data_set_item[1]) if diagnostic_level >= 3: print " <3> Grouped Data List:", grouped_data_list group_counter = 0 for j in grouped_data_list: if diagnostic_level >= 3: print " <3> J =", j if j != []: if diagnostic_level >= 3: print " <3> Group Counter:", group_counter # Pull group symbol specifications from config file. config_group_symbol = group_info[group_counter]["Symbol"] if diagnostic_level >= 3: print " <3> Group Symbol:", config_group_symbol group_symbol = "graph.style.symbol."+config_group_symbol config_group_symbol_color = group_info[group_counter]["Color"] if diagnostic_level >= 3: print " <3> Group Symbol Color:", config_group_symbol_color config_group_symbol_filled = group_info[group_counter]["Filled"] if diagnostic_level >= 3: print " <3> Group Symbol Filled:", config_group_symbol_filled if config_group_symbol_filled == 'yes': fillstyle = "deco.filled([color.cmyk."+config_group_symbol_color+"])" else: fillstyle = "deco.stroked([color.cmyk."+config_group_symbol_color+"])" #Create temporary symbol style. tempstyle = "graph.style.symbol("+group_symbol+", size=0.1*unit.v_cm, symbolattrs=["+fillstyle+"])" scatterpointstyle = eval(tempstyle) if diagnostic_level >= 3: print " <3> Group Title:", group_info[group_counter]["Group_Title"] g.plot(graph.data.points(j, x=1, y=2, title=group_info[group_counter]["Group_Title"]), [scatterpointstyle]) else: pass group_counter = group_counter + 1 if diagnostic_level >= 3: print " <3> Group Counter:", group_counter else: if diagnostic_level >= 1: print "Non-Grouped Scatter Data:" scatter_plot_data = [] scatter_plot_data.append(data_set[quantity_number][0][1]) if diagnostic_level >= 3: print " <3> Grouped Data List:", grouped_data_list # Now plot the Title text, alignment based on Title_Position setting. # "tl" or "tc" or "tr" or "ml" or "mc" or "mr" or "bl" or "bc" or "br" if title_position == 'tl': g.text(0.2, g.height - 0.2, plot_title, [text.halign.left, text.valign.top, text.size.normalsize]) elif title_position == 'tc': g.text(g.width/2, g.height - 0.2, plot_title, [text.halign.center, text.valign.top, text.size.normalsize]) elif title_position == 'tr': g.text(g.width-0.2, g.height - 0.2, plot_title, [text.halign.right, text.valign.top, text.size.normalsize]) elif title_position == 'ml': g.text(0.2, g.height/2, plot_title, [text.halign.left, text.valign.middle, text.size.normalsize]) elif title_position == 'mc': g.text(g.width/2, g.height/2, plot_title, [text.halign.center, text.valign.middle, text.size.normalsize]) elif title_position == 'mr': g.text(g.width-0.2, g.height/2, plot_title, [text.halign.right, text.valign.middle, text.size.normalsize]) elif title_position == 'bl': g.text(0.2, 0.2, plot_title, [text.halign.left, text.valign.bottom, text.size.normalsize]) elif title_position == 'bc': g.text(g.width/2, 0.2, plot_title, [text.halign.center, text.valign.bottom, text.size.normalsize]) elif title_position == 'br': g.text(g.width-0.2, 0.2, plot_title, [text.halign.right, text.valign.bottom, text.size.normalsize]) else: print "A title location was not specified.\nUsing the default top left position." g.text(0.2, g.height - 0.2, plot_title, [text.halign.left, text.valign.top, text.size.normalsize]) #Make %error text on plot by error bars. # pos_percent_error = str(percent_error)+"%" # neg_percent_error = "-"+str(percent_error)+"%" # g.text(g.width - 0.4, g.height - 0.3, pos_percent_error, [text.halign.center, text.valign.middle, text.size.tiny]) # g.text(g.width - 0.2, g.height - 0.4, neg_percent_error, [text.halign.center, text.valign.middle, text.size.tiny]) # Write the output plot_file_path = output_directory+plot_file_name if diagnostic_level >= 3: print " <3> Plot File Path:", plot_file_path g.writePDFfile(plot_file_path) if diagnostic_level >= 2: print "Scatter Plot to: \n", plot_file_path+".PDF\n" | f66ca75013a32a9d59d8e58dec0baa78eda49b79 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12/f66ca75013a32a9d59d8e58dec0baa78eda49b79/Validation_Data_Processor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14644,
67,
4032,
12,
1655,
67,
1376,
16,
31320,
67,
1376,
16,
892,
67,
542,
4672,
468,
892,
67,
542,
353,
279,
3880,
17408,
635,
10457,
16,
4191,
6035,
434,
3252,
471,
657,
10891,
1910... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14644,
67,
4032,
12,
1655,
67,
1376,
16,
31320,
67,
1376,
16,
892,
67,
542,
4672,
468,
892,
67,
542,
353,
279,
3880,
17408,
635,
10457,
16,
4191,
6035,
434,
3252,
471,
657,
10891,
1910... |
frames.append('''<p> | frames.append(''' | def reader(lnum=[lnum]): highlight[lnum[0]] = 1 try: return linecache.getline(file, lnum[0]) finally: lnum[0] += 1 | d73dbf6662d0071e92013361f41cd3db0b0ca4b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d73dbf6662d0071e92013361f41cd3db0b0ca4b2/cgitb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2949,
12,
80,
2107,
22850,
80,
2107,
65,
4672,
8839,
63,
80,
2107,
63,
20,
13563,
273,
404,
775,
30,
327,
4739,
557,
807,
18,
588,
1369,
12,
768,
16,
328,
2107,
63,
20,
5717,
3095,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2949,
12,
80,
2107,
22850,
80,
2107,
65,
4672,
8839,
63,
80,
2107,
63,
20,
13563,
273,
404,
775,
30,
327,
4739,
557,
807,
18,
588,
1369,
12,
768,
16,
328,
2107,
63,
20,
5717,
3095,
... |
nids.add( nid ) | def applyMethod(self ): """index the graph. """ componentor = Components.SComponents() | 5d957d19611af0acd27a7dbdd3123b0e3a1e82dd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8010/5d957d19611af0acd27a7dbdd3123b0e3a1e82dd/AddaCluster.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
1305,
12,
2890,
262,
30,
3536,
1615,
326,
2667,
18,
3536,
1794,
280,
273,
25286,
18,
55,
7171,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
1305,
12,
2890,
262,
30,
3536,
1615,
326,
2667,
18,
3536,
1794,
280,
273,
25286,
18,
55,
7171,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
def _handle_MSRPChatDidDeliverMessage(self, msrp_chat, data): | def _handle_MSRPChatDidNotDeliverMessage(self, msrp_chat, data): | def _handle_MSRPChatDidDeliverMessage(self, msrp_chat, data): session = self.msrp_chat_mapping.get(msrp_chat, None) if session is not None: self.notification_center.post_notification("SCSessionDidNotDeliverMessage", session, data) | 01388ec4746e0692ca1e2ea41b21b8130074d47f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5703/01388ec4746e0692ca1e2ea41b21b8130074d47f/session.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4110,
67,
3537,
54,
52,
14163,
18250,
1248,
20813,
1079,
12,
2890,
16,
4086,
13832,
67,
10880,
16,
501,
4672,
1339,
273,
365,
18,
959,
13832,
67,
10880,
67,
6770,
18,
588,
12,
959... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4110,
67,
3537,
54,
52,
14163,
18250,
1248,
20813,
1079,
12,
2890,
16,
4086,
13832,
67,
10880,
16,
501,
4672,
1339,
273,
365,
18,
959,
13832,
67,
10880,
67,
6770,
18,
588,
12,
959... |
Ctrl-E Go to right edge (nospaces off) or end of line (nospaces on). | Ctrl-E Go to right edge (stripspaces off) or end of line (stripspaces on). | def rectangle(win, uly, ulx, lry, lrx): "Draw a rectangle." win.vline(uly+1, ulx, curses.ACS_VLINE, lry - uly - 1) win.hline(uly, ulx+1, curses.ACS_HLINE, lrx - ulx - 1) win.hline(lry, ulx+1, curses.ACS_HLINE, lrx - ulx - 1) win.vline(uly+1, lrx, curses.ACS_VLINE, lry - uly - 1) win.addch(uly, ulx, curses.ACS_ULCORNER) win.addch(uly, lrx, curses.ACS_URCORNER) win.addch(lry, lrx, curses.ACS_LRCORNER) win.addch(lry, ulx, curses.ACS_LLCORNER) | 5af256ded6190e899530de8df61fa77fe37686fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5af256ded6190e899530de8df61fa77fe37686fc/textpad.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11845,
12,
8082,
16,
7493,
93,
16,
7493,
92,
16,
328,
1176,
16,
12226,
92,
4672,
315,
6493,
279,
11845,
1199,
5657,
18,
90,
1369,
12,
332,
93,
15,
21,
16,
7493,
92,
16,
30436,
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,
11845,
12,
8082,
16,
7493,
93,
16,
7493,
92,
16,
328,
1176,
16,
12226,
92,
4672,
315,
6493,
279,
11845,
1199,
5657,
18,
90,
1369,
12,
332,
93,
15,
21,
16,
7493,
92,
16,
30436,
18,
... |
EXAMPLES: | EXAMPLES:: | def __getstate__(self): r""" A __getstate__ method for testing pickling. | a4aad1557cdf06ed8562711534ca467dff85c855 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/a4aad1557cdf06ed8562711534ca467dff85c855/explain_pickle.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
2019,
972,
12,
2890,
4672,
436,
8395,
432,
1001,
588,
2019,
972,
707,
364,
7769,
6002,
2456,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
588,
2019,
972,
12,
2890,
4672,
436,
8395,
432,
1001,
588,
2019,
972,
707,
364,
7769,
6002,
2456,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
elif os.path.isdir(fname): self.toDir[fname] = adding for f in glob.glob(os.path.join(fname, '*')): self.doTo(f, adding) | def doTo(self, fname, adding): if os.path.islink(fname): pass elif os.path.isfile(fname): self.to[fname] = adding elif os.path.isdir(fname): self.toDir[fname] = adding for f in glob.glob(os.path.join(fname, '*')): self.doTo(f, adding) | c026487631f1f879bca7f784debf81b64e8bb73a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/675/c026487631f1f879bca7f784debf81b64e8bb73a/check_docrefs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
774,
12,
2890,
16,
5299,
16,
6534,
4672,
309,
1140,
18,
803,
18,
291,
1232,
12,
12749,
4672,
1342,
1327,
1140,
18,
803,
18,
291,
768,
12,
12749,
4672,
365,
18,
869,
63,
12749,
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,
741,
774,
12,
2890,
16,
5299,
16,
6534,
4672,
309,
1140,
18,
803,
18,
291,
1232,
12,
12749,
4672,
1342,
1327,
1140,
18,
803,
18,
291,
768,
12,
12749,
4672,
365,
18,
869,
63,
12749,
6... | |
if not repo.has_permissions(user.username, "w"): | if not repo_subssh.has_permissions(user.username, "w"): | def permissions_hook(ui, repo_hg, **kwargs): | 0494ad1a0ba9dc36f3f8f585b203e892f4d61ecf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13178/0494ad1a0ba9dc36f3f8f585b203e892f4d61ecf/hg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4371,
67,
4476,
12,
4881,
16,
3538,
67,
26981,
16,
2826,
4333,
4672,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
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,
4371,
67,
4476,
12,
4881,
16,
3538,
67,
26981,
16,
2826,
4333,
4672,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
elif quadratureOrder == "Selective": | elif lm3dscan.quadratureOrder == "Selective": | def initialize(self, scanner): | 0ed2a56edefae6f13f6dc361db180ce8710a3bf9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8640/0ed2a56edefae6f13f6dc361db180ce8710a3bf9/Lithomop3d_setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
12,
2890,
16,
7683,
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,
4046,
12,
2890,
16,
7683,
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,
-10... |
zValueFiles=fnmatch.filter(wikiFileFinder.get_RDS_R_L1_SEIS(),\ "*/%s_RDS_*/%s/*summary.txt"%(sngl.ifo,sngl.time)) | def prepareChecklist(wikiFilename=None,wikiCoinc=None,wikiTree=None,file2URL=None): """ Method to prepare a checklist where data products are isolated in directory. """ endOfS5=int(875232014) wikiFileFinder=findFileType(wikiTree,wikiCoinc) # Check to see if wiki file with name already exists maxCount=0 while os.path.exists(wikiFilename) and maxCount < 15: sys.stdout.write("File %s already exists.\n"%\ os.path.split(wikiFilename)[1]) wikiFilename=wikiFilename+".wiki" maxCount=maxCount+1 # #Create the wikipage object etc # wikiPage=wiki(wikiFilename) # # Create top two trigger params tables # cTable=wikiPage.wikiTable(2,9) cTable.data=[ ["Trigger Type", "Rank", "FAR", "SNR", "IFOS(Coinc)", "Instruments(Active)", "Coincidence Time (s)", "Total Mass (mSol)", "Chirp Mass (mSol)" ], ["%s"%(wikiCoinc.type), "%s"%(wikiCoinc.rank), "%s"%(wikiCoinc.far), "%s"%(wikiCoinc.snr), "%s"%(wikiCoinc.ifos), "%s"%(wikiCoinc.instruments), "%s"%(wikiCoinc.time), "%s"%(wikiCoinc.mass), "%s"%(wikiCoinc.mchirp) ] ] pTable=wikiPage.wikiTable(len(wikiCoinc.sngls_in_coinc())+1,7) pTable.data[0]=[ "IFO", "GPS Time(s)", "SNR", "CHISQR", "Mass 1", "Mass 2", "Chirp Mass" ] for row,cSngl in enumerate(wikiCoinc.sngls_in_coinc()): pTable.data[row+1]=[ "%s"%(cSngl.ifo), "%s"%(cSngl.time), "%s"%(cSngl.snr), "%s"%(cSngl.chisqr), "%s"%(cSngl.mass1), "%s"%(cSngl.mass2), "%s"%(cSngl.mchirp) ] #Write the tables into the Wiki object wikiPage.putText("Coincident Trigger Event Information: %s\n"\ %(stfu_pipe.gpsTimeToReadableDate(wikiCoinc.time))) wikiPage.insertTable(cTable) wikiPage.putText("Corresponding Coincident Single IFO Trigger Information\n") wikiPage.insertTable(pTable) #Generate a table of contents to appear after candidate params table wikiPage.tableOfContents(3) #Begin including each checklist item as section with subsections wikiPage.section("Follow-up Checklist") #Put each checklist item wikiPage.subsection("Checklist Summary") wikiPage.subsubsection("Does this candidate pass this checklist?") wikiPage.subsubsection("Answer") wikiPage.subsubsection("Relevant Information and Comments") wikiPage.insertHR() # #First real checklist item wikiPage.subsection("#0 False Alarm Probability") wikiPage.subsubsection("Question") wikiPage.putText("What is the false alarm rate associated with this candidate?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") farTable=wikiPage.wikiTable(2,1) farTable.setTableStyle("background-color: yellow; text-align center;") farTable.data[0][0]="False Alarm Rate" farTable.data[1][0]="%s"%(wikiCoinc.far) wikiPage.insertTable(farTable) wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # #Additional Checklist Item #First real checklist item wikiPage.subsection("#1 Data Quality Flags") wikiPage.subsubsection("Question") wikiPage.putText("Can the data quality flags coincident with this candidate be safely disregarded?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPath=os.path.split(wikiFilename)[0] dqFileList=wikiFileFinder.get_findFlags() if len(dqFileList) != 1: sys.stdout.write("Warning: DQ flags data product import problem.\n") print "Found %i files."%len(dqFileList) for mf in dqFileList: print mf for myFile in dqFileList: wikiPage.putText("%s\n"%(file(myFile).read())) wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # #Additional Checklist Item #First real checklist item wikiPage.subsection("#2 Veto Investigations") wikiPage.subsubsection("Question") wikiPage.putText("Does the candidate survive the veto investigations performed at its time?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") vetoFileList=wikiFileFinder.get_findVetos() if len(vetoFileList) != 1: sys.stdout.write("Warning: Veto flags data product import problem.\n") for myFile in vetoFileList:print myFile for myFile in vetoFileList: wikiPage.putText("%s\n"%(file(myFile).read())) wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # #Additional Checklist Item #First real checklist item wikiPage.subsection("#3 IFO Status") wikiPage.subsubsection("Question") wikiPage.putText("Are the interferometers operating normally with a reasonable level of sensitivity around the time of the candidate?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") #Add link to Daily Stats if wikiCoinc.time <= endOfS5: statsLink=wikiPage.makeExternalLink("http://blue.ligo-wa.caltech.edu/scirun/S5/DailyStatistics/",\ "S5 Daily Stats Page") else: statsLink="This should be a link to S6 Daily Stats!\n" wikiPage.putText(statsLink) #Link figures of merit #Get link for all members of wikiCoinc wikiPage.putText("Figures of Merit\n") if wikiCoinc.time > endOfS5: fomLinks=dict() elems=0 for wikiSngl in wikiCoinc.sngls: if not(wikiSngl.ifo.upper().rstrip().lstrip() == 'V1'): fomLinks[wikiSngl.ifo]=stfu_pipe.getFOMLinks(wikiCoinc.time,wikiSngl.ifo) elems=elems+len(fomLinks[wikiSngl.ifo]) else: for myLabel,myLink,myThumb in stfu_pipe.getFOMLinks(wikiCoinc.time,wikiSngl.ifo): wikiPage.putText("%s\n"%(wikiPage.makeExternalLink(myLink,myLabel))) cols=4 rows=(elems/3)+1 fTable=wikiPage.wikiTable(rows,cols) fTable.data[0]=["IFO,Shift","FOM1","FOM2","FOM3"] currentIndex=0 for myIFOKey in fomLinks.keys(): for label,link,thumb in fomLinks[myIFOKey]: myRow=currentIndex/int(3)+1 myCol=currentIndex%int(3)+1 fTable.data[myRow][0]=label thumbURL=thumb fTable.data[myRow][myCol]="%s"%(wikiPage.linkedRemoteImage(thumb,link)) currentIndex=currentIndex+1 wikiPage.insertTable(fTable) else: wikiPage.putText("Can not automatically fetch S5 FOM links.") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # #Additional Checklist Item #First real checklist item wikiPage.subsection("#4 Candidate Appearance") wikiPage.subsubsection("Question") wikiPage.putText("Do the Qscan figures show what we would expect for a gravitational-wave event?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") imageDict=dict() indexDict=dict() thumbDict=dict() for sngl in wikiCoinc.sngls: frametype,channelName=stfu_pipe.figure_out_type(sngl.time,sngl.ifo,'hoft') indexDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_hoft_frame(),\ "*/%s/*/%s/*index.html"%(frametype,sngl.time)) imageDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_hoft_frame(),\ "*%s*_%s_16.00_spectrogram_whitened.png"\ %(sngl.time,channelName)) thumbDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_hoft_frame(),\ "*%s*_%s_16.00_spectrogram_whitened?thumb.png"\ %(sngl.time,channelName)) # #Convert disk locals to URLs imageDict[sngl.ifo]=[file2URL.convert(x) for x in imageDict[sngl.ifo]] indexDict[sngl.ifo]=[file2URL.convert(x) for x in indexDict[sngl.ifo]] thumbDict[sngl.ifo]=[file2URL.convert(x) for x in thumbDict[sngl.ifo]] if len(indexDict[sngl.ifo]) < 1: wikiPage.putText("GW data channel scans for %s not available.\n"%sngl.ifo) enoughImage=[len(imageDict[key])>0 for key in imageDict.keys()].count(True) >= 1 enoughIndex=[len(indexDict[key])>0 for key in indexDict.keys()].count(True) >= 1 if enoughImage and enoughIndex: wikiPage.insertQscanTable(imageDict,\ thumbDict,\ indexDict) else: sys.stdout.write("Warning: Candidate appearance plot import problem.\n") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#5 Seismic Plots") wikiPage.subsubsection("Question") wikiPage.putText("Is the seismic activity insignificant around the time of the candidate?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") imageDict=dict() indexDict=dict() thumbDict=dict() zValueDict=dict() imageDictAQ=dict() indexDictAQ=dict() thumbDictAQ=dict() zValueDictAQ=dict() # for sngl in wikiCoinc.sngls_in_coinc(): indexDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_RDS_R_L1_SEIS(),\ "*/%s_RDS_*/%s/*index.html"%(sngl.ifo,sngl.time)) imageDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_RDS_R_L1_SEIS(),\ "*/%s_RDS_*/%s/*SEI*_512.00_spectrogram_whitened.png"%\ (sngl.ifo,sngl.time)) thumbDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_RDS_R_L1_SEIS(),\ "*/%s_RDS_*/%s/*SEI*_512.00_spectrogram_whitened?thumb.png"%\ (sngl.ifo,sngl.time)) #Search for corresponding Omega summary.txt file zValueFiles=fnmatch.filter(wikiFileFinder.get_RDS_R_L1_SEIS(),\ "*/%s_RDS_*/%s/*summary.txt"%(sngl.ifo,sngl.time)) zValueDict[sngl.ifo]=list() if (len(zValueFiles) > 0): for zFile in zValueFiles: zValueDict[sngl.ifo].extend(wikiFileFinder.__readSummary__(zFile)) #Reparse only keeping SEI channels tmpList=list() for chan in zValueDict[sngl.ifo]: if "SEI" in chan[0]: tmpList.append(chan) zValueDict[sngl.ifo]=tmpList else: sys.stdout.write("Omega scan summary file not for for %s. ...skipping...\n"%sngl.ifo) #Search for analyzeQscan files #/L1-analyseQscan_L1_932797512_687_seis_rds_L1_SEI-ETMX_X_z_scat-unspecified-gpstime.png timeString=str(float(sngl.time)).replace(".","_") zValueFiles=fnmatch.filter(wikiFileFinder.get_analyzeQscan_SEIS(),\ "*_%s_%s_*.txt"%(sngl.ifo,timeString)) indexDictAQ[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_analyzeQscan_SEIS(),\ "*_%s_%s_*.html"%(sngl.ifo,timeString)) thumbDictAQ[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_analyzeQscan_SEIS(),\ "*%s-*_%s_*_SEI*_z_scat-unspecified-gpstime_thumb.png"\ %(sngl.ifo,timeString)) imageDictAQ[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_analyzeQscan_SEIS(),\ "*%s-*_%s_*_SEI*_z_scat-unspecified-gpstime.png"\ %(sngl.ifo,timeString)) #Process zValue ranking file if found for IFO zValueDictAQ[sngl.ifo]=list() if len(zValueFiles)>0: for zFile in zValueFiles: zValueDictAQ[sngl.ifo].extend(wikiFileFinder.__readZranks__(zFile)) #Reparse keeping SEI channels tmpList=list() for chan in zValueDictAQ[sngl.ifo]: if "SEI" in chan[0]: tmpList.append(chan) zValueDictAQ[sngl.ifo]=tmpList else: sys.stdout.write("Analyze Qscan Z ranking file not found for %s. ...skipping...\n"%sngl.ifo) #Convert disk locals to URLs imageDict[sngl.ifo]=[file2URL.convert(x) for x in imageDict[sngl.ifo]] indexDict[sngl.ifo]=[file2URL.convert(x) for x in indexDict[sngl.ifo]] thumbDict[sngl.ifo]=[file2URL.convert(x) for x in thumbDict[sngl.ifo]] imageDictAQ[sngl.ifo]=[file2URL.convert(x) for x in imageDictAQ[sngl.ifo]] indexDictAQ[sngl.ifo]=[file2URL.convert(x) for x in indexDictAQ[sngl.ifo]] thumbDictAQ[sngl.ifo]=[file2URL.convert(x) for x in thumbDictAQ[sngl.ifo]] if len(indexDict[sngl.ifo]) < 1: wikiPage.putText("Seismic scans for %s not available.\n"%sngl.ifo) enoughImage=[len(imageDict[key])>0 for key in imageDict.keys()].count(True) >=1 enoughIndex=[len(indexDict[key])>0 for key in indexDict.keys()].count(True) >=1 if enoughImage and enoughIndex: wikiPage.insertAnalyzeQscanTable(imageDict, thumbDict, indexDict, zValueDict, imageDictAQ, thumbDictAQ, indexDictAQ, zValueDictAQ) else: sys.stdout.write("Warning: Seismic plots product import problem.\n") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#6 Other environmental causes") wikiPage.subsubsection("Question") wikiPage.putText("Were the environmental disturbances (other than seismic) insignificant at the time of the candidate?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") imageDict=dict() indexDict=dict() thumbDict=dict() zValueDict=dict() imageDictAQ=dict() indexDictAQ=dict() thumbDictAQ=dict() zValueDictAQ=dict() #Select only PEM channels for sngl in wikiCoinc.sngls_in_coinc(): imageDict[sngl.ifo]=list() indexDict[sngl.ifo]=list() thumbDict[sngl.ifo]=list() for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*html"%(sngl.ifo,sngl.time)): indexDict[sngl.ifo].append(myFile) for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*_16.00_spectrogram_whitened.png"%\ (sngl.ifo,sngl.time)): if "PEM" in myFile.upper() and not "SEI" in myFile.upper(): imageDict[sngl.ifo].append(myFile) for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*_16.00_spectrogram_whitened?thumb.png"%\ (sngl.ifo,sngl.time)): if "PEM" in myFile.upper() and not "SEI" in myFile.upper(): thumbDict[sngl.ifo].append(myFile) #Search for corresponding Omega summary.txt file zValueFiles=fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*summary.txt"%(sngl.ifo,sngl.time)) zValueDict[sngl.ifo]=list() if len(zValueFiles)>0: for zFile in zValueFiles: zValueDict[sngl.ifo].extend(wikiFileFinder.__readSummary__(zFile)) #Reparse only keeping PEM and not SEI channels tmpList=list() for chan in zValueDict[sngl.ifo]: if "PEM" in chan[0] and not "SEI" in chan[0]: tmpList.append(chan) zValueDict[sngl.ifo]=tmpList else: sys.stdout.write("Omega scan summary file not for for %s. ...skipping...\n"%sngl.ifo) #Select associated analyzeQscans imageDictAQ[sngl.ifo]=list() indexDictAQ[sngl.ifo]=list() thumbDictAQ[sngl.ifo]=list() timeString=str(float(sngl.time)).replace(".","_") for myFile in fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*html"%(sngl.ifo,timeString)): indexDictAQ[sngl.ifo].append(myFile) zValueFiles=fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*txt"%(sngl.ifo,timeString)) zValueDictAQ[sngl.ifo]=list() if len(zValueFiles)>0: for zFile in zValueFiles: zValueDictAQ[sngl.ifo].extend(wikiFileFinder.__readZranks__(zFile)) for chan in zValueDictAQ[sngl.ifo]: if "PEM" in chan[0] and not "SEI" in chan[0]: tmpList.append(chan) zValueDictAQ[sngl.ifo]=tmpList else: sys.stdout.write("Analyze Qscan Z ranking file not found for %s. ...skipping...\n"%sngl.ifo) #H1-analyseQscan_H1_931176926_116_rds_H0_PEM-MY_SEISX_z_scat-unspecified-gpstime_thumb.png #H1-analyseQscan_H1_931176926_116_rds_H0_PEM-MY_SEISX_z_scat-unspecified-gpstime.png for myFile in fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*_z_scat-unspecified-gpstime.png"%\ (sngl.ifo,timeString)): if "PEM" in myFile.upper() and not "SEI" in myFile.upper(): imageDictAQ[sngl.ifo].append(myFile) for myFile in fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*_z_scat-unspecified-gpstime?thumb.png"%\ (sngl.ifo,timeString)): if "PEM" in myFile.upper() and not "SEI" in myFile.upper(): thumbDictAQ[sngl.ifo].append(myFile) #Convert disk locals to URLs imageDict[sngl.ifo]=[file2URL.convert(x) for x in imageDict[sngl.ifo]] indexDict[sngl.ifo]=[file2URL.convert(x) for x in indexDict[sngl.ifo]] thumbDict[sngl.ifo]=[file2URL.convert(x) for x in thumbDict[sngl.ifo]] imageDictAQ[sngl.ifo]=[file2URL.convert(x) for x in imageDictAQ[sngl.ifo]] indexDictAQ[sngl.ifo]=[file2URL.convert(x) for x in indexDictAQ[sngl.ifo]] thumbDictAQ[sngl.ifo]=[file2URL.convert(x) for x in thumbDictAQ[sngl.ifo]] if len(imageDict[sngl.ifo]) < 1: wikiPage.putText("PEM scans for %s not available.\n"%sngl.ifo) enoughImage=[len(imageDict[key])>0 for key in imageDict.keys()].count(True) >=1 enoughIndex=[len(indexDict[key])>0 for key in indexDict.keys()].count(True) >=1 if enoughImage and enoughIndex: wikiPage.insertAnalyzeQscanTable(imageDict, thumbDict, indexDict, zValueDict, imageDictAQ, thumbDictAQ, indexDictAQ, zValueDictAQ) else: sys.stdout.write("Warning: PEM plots import trouble.\n") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#7 Auxiliary degree of freedom") wikiPage.subsubsection("Question") wikiPage.putText("Were the auxiliary channel transients coincident with the candidate insignificant?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") imageDict=dict() indexDict=dict() thumbDict=dict() zValueDict=dict() imageDictAQ=dict() indexDictAQ=dict() thumbDictAQ=dict() zValueDictAQ=dict() #Select only AUX channels for sngl in wikiCoinc.sngls: imageDict[sngl.ifo]=list() indexDict[sngl.ifo]=list() thumbDict[sngl.ifo]=list() for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*html"%(sngl.ifo,sngl.time)): indexDict[sngl.ifo].append(myFile) for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*_16.00_spectrogram_whitened.png"%\ (sngl.ifo,sngl.time)): if not "PEM" in myFile.upper() or not "SEI" in myFile.upper(): imageDict[sngl.ifo].append(myFile) for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*_16.00_spectrogram_whitened?thumb.png"%\ (sngl.ifo,sngl.time)): if not "PEM" in myFile.upper() or not "SEI" in myFile.upper(): thumbDict[sngl.ifo].append(myFile) zValueFiles=fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*summary.txt"%(sngl.ifo,sngl.time)) zValueDict[sngl.ifo]=list() if len(zValueFiles)>0: for zFile in zValueFiles: zValueDict[sngl.ifo].extend(wikiFileFinder.__readSummary__(zFile)) #Reparse NOT keeping PEM or SEI channels tmpList=list() for chan in zValueDict[sngl.ifo]: if not "PEM" in chan[0] or not "SEI" in chan[0]: tmpList.append(chan) zValueDict[sngl.ifo]=tmpList else: sys.stdout.write("Omega scan summary file not for for %s. ...skipping...\n"%sngl.ifo) #Select associated analyzeQscans imageDictAQ[sngl.ifo]=list() indexDictAQ[sngl.ifo]=list() thumbDictAQ[sngl.ifo]=list() timeString=str(float(sngl.time)).replace(".","_") #H1-analyseQscan_H1_931176926_116_rds-unspecified-gpstime.html for myFile in fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*html"%(sngl.ifo,timeString)): indexDictAQ[sngl.ifo].append(myFile) zValueFiles=fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*txt"%(sngl.ifo,timeString)) #Process zValue ranking file if found for IFO zValueDictAQ[sngl.ifo]=list() if len(zValueFiles)>0: for zFile in zValueFiles: zValueDictAQ[sngl.ifo].extend(wikiFileFinder.__readZranks__(zFile)) #Reparse NOT keeping PEM or SEI channels tmpList=list() for chan in zValueDictAQ[sngl.ifo]: if not "PEM" in chan[0] or not "SEI" in chan[0]: tmpList.append(chan) zValueDictAQ[sngl.ifo]=tmpList else: sys.stdout.write("Z ranking file not found for %s. ...skipping...\n"%sngl.ifo) #H1-analyseQscan_H1_931176926_116_rds_H0_PEM-MY_SEISX_z_scat-unspecified-gpstime_thumb.png #H1-analyseQscan_H1_931176926_116_rds_H0_PEM-MY_SEISX_z_scat-unspecified-gpstime.png for myFile in fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*_z_scat-unspecified-gpstime.png"%\ (sngl.ifo,timeString)): if not "PEM" in myFile.upper() or not "SEI" in myFile.upper(): imageDictAQ[sngl.ifo].append(myFile) for myFile in fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*_z_scat-unspecified-gpstime?thumb.png"%\ (sngl.ifo,timeString)): if not "PEM" in myFile.upper() or not "SEI" in myFile.upper(): thumbDictAQ[sngl.ifo].append(myFile) #Convert disk locals to URLs imageDict[sngl.ifo]=[file2URL.convert(x) for x in imageDict[sngl.ifo]] indexDict[sngl.ifo]=[file2URL.convert(x) for x in indexDict[sngl.ifo]] thumbDict[sngl.ifo]=[file2URL.convert(x) for x in thumbDict[sngl.ifo]] imageDictAQ[sngl.ifo]=[file2URL.convert(x) for x in imageDictAQ[sngl.ifo]] indexDictAQ[sngl.ifo]=[file2URL.convert(x) for x in indexDictAQ[sngl.ifo]] thumbDictAQ[sngl.ifo]=[file2URL.convert(x) for x in thumbDictAQ[sngl.ifo]] if len(indexDict[sngl.ifo]) < 1: wikiPage.putText("Other scans for %s not available.\n"%sngl.ifo) enoughImage=[len(imageDict[key])>0 for key in imageDict.keys()].count(True) >=1 enoughIndex=[len(indexDict[key])>0 for key in indexDict.keys()].count(True) >=1 if enoughImage and enoughIndex: wikiPage.insertAnalyzeQscanTable(imageDict, thumbDict, indexDict, zValueDict, imageDictAQ, thumbDictAQ, indexDictAQ, zValueDictAQ) else: sys.stdout.write("Warning: AUX plots import trouble.\n") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#8 Electronic Log Book") wikiPage.subsubsection("Question") wikiPage.putText("Were the instruments behaving normally according to the comments posted by the sci-mons or the operators in the e-log?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") wikiLinkLHOlog=wikiPage.makeExternalLink(stfu_pipe.getiLogURL(myCoinc.time,"H1"), "Hanford eLog") wikiLinkLLOlog=wikiPage.makeExternalLink(stfu_pipe.getiLogURL(myCoinc.time,"L1"), "Livingston eLog") wikiPage.putText("%s\n\n%s\n\n"%(wikiLinkLHOlog,wikiLinkLLOlog)) wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#9 Glitch Report") wikiPage.subsubsection("Question") wikiPage.putText("Were the instruments behaving normally according to the weekly glitch report?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") if int(wikiCoinc.time) >= endOfS5: wikiLinkGlitch=wikiPage.makeExternalLink( "https://www.lsc-group.phys.uwm.edu/twiki/bin/view/DetChar/GlitchStudies", "Glitch Reports for S6" ) else: wikiLinkGlitch=wikiPage.makeExternalLink( "http://www.lsc-group.phys.uwm.edu/glitch/investigations/s5index.html#shift", "Glitch Reports for S5" ) wikiPage.putText("%s\n"%(wikiLinkGlitch)) wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#10 Snr versus time") wikiPage.subsubsection("Question") wikiPage.putText("Is this trigger significant in a SNR versus time plot of all triggers in its analysis chunk?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#11 Parameters of the candidate") wikiPage.subsubsection("Question") wikiPage.putText("Does the candidate have a high likelihood of being a gravitational-wave according to its parameters?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Effective Distance Ratio Test\n") effDList=wikiFileFinder.get_effDRatio() if len(effDList) != 1: sys.stdout.write("Warning: Effective Distance Test import problem.\n") for myFile in effDList: wikiPage.putText("%s\n"%(file(myFile).read())) wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#12 Snr and Chisq") wikiPage.subsubsection("Question") wikiPage.putText("Are the SNR and CHISQ time series consistent with our expectations for a gravitational wave?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") # #Put plots SNR and Chi sqr # indexList=fnmatch.filter(wikiFileFinder.get_plotsnrchisq(),"*.html") thumbList=fnmatch.filter(wikiFileFinder.get_plotsnrchisq(),"*_snr-*thumb.png") thumbList.extend(fnmatch.filter(wikiFileFinder.get_plotsnrchisq(),"*_chisq-*thumb.png")) thumbList.sort() indexList=[file2URL.convert(x) for x in indexList] thumbList=[file2URL.convert(x) for x in thumbList] #Two thumb types possible "_thumb.png" or ".thumb.png" imageList=[x.replace("_thumb.png",".png").replace(".thumb.png",".png") for x in thumbList] ifoCount=len(wikiCoinc.sngls) rowLabel={"SNR":1,"CHISQ":2} rowCount=len(rowLabel) colCount=ifoCount if len(indexList) >= 1: snrTable=wikiPage.wikiTable(rowCount+1,colCount+1) for i,sngl in enumerate(wikiCoinc.sngls): myIndex="" for indexFile in indexList: if indexFile.__contains__("_pipe_%s_FOLLOWUP_"%sngl.ifo): myIndex=indexFile if myIndex=="": snrTable.data[0][i+1]=" %s "%sngl.ifo else: snrTable.data[0][i+1]=wikiPage.makeExternalLink(myIndex,sngl.ifo) for col,sngl in enumerate(wikiCoinc.sngls): for row,label in enumerate(rowLabel.keys()): snrTable.data[row+1][0]=label for k,image in enumerate(imageList): if (image.__contains__("_%s-"%label.lower()) \ and image.__contains__("pipe_%s_FOLLOWUP"%sngl.ifo)): snrTable.data[row+1][col+1]=" %s "%(wikiPage.linkedRemoteImage(thumbList[k],thumbList[k])) wikiPage.insertTable(snrTable) else: sys.stdout.write("Warning: SNR and CHISQ plots not found.\n") wikiPage.putText("SNR and CHISQ plots not found.\n") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#13 Template bank veto") wikiPage.subsubsection("Question") wikiPage.putText("Is the bank veto value consistent with our expectations for a gravitational wave?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#14 Coherent studies") wikiPage.subsubsection("Question") wikiPage.putText("Are the triggers found in multiple interferometers coherent with each other?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") indexList=fnmatch.filter(wikiFileFinder.get_plotchiatimeseries(),"*.html") if len(indexList) >= 1: myIndex=file2URL.convert(indexList[0]) wikiPage.putText(wikiPage.makeExternalLink(myIndex,\ "%s Coherence Study Results"%(wikiCoinc.ifos))) thumbList=fnmatch.filter(wikiFileFinder.get_plotchiatimeseries(),\ "PLOT_CHIA_%s_snr-squared*thumb.png"%(wikiCoinc.time)) imageList=[x.replace("_thumb.png",".png").replace(".thumb.png",".png") for x in thumbList] rowCount=len(imageList) colCount=1 cohSnrTimeTable=wikiPage.wikiTable(rowCount+1,colCount) cohSnrTimeTable.data[0][0]="%s Coherent SNR Squared Times Series"%(wikiCoinc.ifos) for i,image in enumerate(imageList): cohSnrTimeTable.data[i+1][0]=wikiPage.linkedRemoteImage(image,thumbList[i]) wikiPage.insertTable(cohSnrTimeTable) else: sys.stdout.write("Warning: Coherent plotting jobs not found.\n") wikiPage.putText("Coherent Studies plots not found.\n") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#15 Segmentation Stability") wikiPage.subsubsection("Question") wikiPage.putText("Is the candidate stable against changes in segmentation?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#16 Calibration Stability") wikiPage.subsubsection("Question") wikiPage.putText("Is the candidate stable against changes in calibration that are consistent with systematic uncertainties?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # | 481b556f895e5b0b4caf0acaf35400d2993db8e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/481b556f895e5b0b4caf0acaf35400d2993db8e5/makeCheckListWiki.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
1564,
1098,
12,
13044,
5359,
33,
7036,
16,
13044,
27055,
71,
33,
7036,
16,
13044,
2471,
33,
7036,
16,
768,
22,
1785,
33,
7036,
4672,
3536,
2985,
358,
2911,
279,
866,
1098,
1625,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
1564,
1098,
12,
13044,
5359,
33,
7036,
16,
13044,
27055,
71,
33,
7036,
16,
13044,
2471,
33,
7036,
16,
768,
22,
1785,
33,
7036,
4672,
3536,
2985,
358,
2911,
279,
866,
1098,
1625,
... | |
class ListStore(Gtk.ListStore, TreeModel): | class TreeSortable(Gtk.TreeSortable, ): def get_sort_column_id(self): success, sort_column_id, order = super(TreeSortable, self).get_sort_column_id() if success: return (sort_column_id, order,) else: return (None, None,) TreeSortable = override(TreeSortable) __all__.append('TreeSortable') class ListStore(Gtk.ListStore, TreeModel, TreeSortable): | def iter_parent(self, aiter): success, parent_iter = super(TreeModel, self).iter_parent(aiter) if success: return parent_iter | cdacaa9572893796e0f3aa3730d0191911cb29ee /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8659/cdacaa9572893796e0f3aa3730d0191911cb29ee/Gtk.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1400,
67,
2938,
12,
2890,
16,
279,
2165,
4672,
2216,
16,
982,
67,
2165,
273,
2240,
12,
2471,
1488,
16,
365,
2934,
2165,
67,
2938,
12,
1540,
264,
13,
309,
2216,
30,
327,
982,
67,
2165... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1400,
67,
2938,
12,
2890,
16,
279,
2165,
4672,
2216,
16,
982,
67,
2165,
273,
2240,
12,
2471,
1488,
16,
365,
2934,
2165,
67,
2938,
12,
1540,
264,
13,
309,
2216,
30,
327,
982,
67,
2165... |
shift, bin1, bin2 = best return bin1, bin2, shift | t1, t2, shift = best if trace: print >>sys.stderr, "Best:", dump(t1, t2, shift, bytes) if __debug__: mask = ~((~0) << shift) for i in xrange(len(t)): assert t[i] == t2[(t1[i >> shift] << shift) + (i & mask)] return best | def splitbins(bins): # split a sparse integer table into two tables, such as: # value = t2[(t1[char>>shift]<<shift)+(char&mask)] # and value == 0 means no data bytes = sys.maxint for shift in range(16): bin1 = [] bin2 = [] size = 2**shift bincache = {} for i in range(0, len(bins), size): bin = bins[i:i+size] index = bincache.get(tuple(bin)) if index is None: index = len(bin2) bincache[tuple(bin)] = index for v in bin: if v is None: bin2.append(0) else: bin2.append(v) bin1.append(index>>shift) # determine memory size b = len(bin1)*getsize(bin1) + len(bin2)*getsize(bin2) if b < bytes: best = shift, bin1, bin2 bytes = b shift, bin1, bin2 = best | 2101348830ff0d65cebd4caf886011f45bcc7618 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2101348830ff0d65cebd4caf886011f45bcc7618/makeunicodedata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1416,
11862,
12,
11862,
4672,
468,
1416,
279,
9387,
3571,
1014,
1368,
2795,
4606,
16,
4123,
487,
30,
468,
282,
460,
273,
268,
22,
63,
12,
88,
21,
63,
3001,
9778,
4012,
65,
17685,
4012,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1416,
11862,
12,
11862,
4672,
468,
1416,
279,
9387,
3571,
1014,
1368,
2795,
4606,
16,
4123,
487,
30,
468,
282,
460,
273,
268,
22,
63,
12,
88,
21,
63,
3001,
9778,
4012,
65,
17685,
4012,... |
f('\x0a\xef\x0b\x01\x05\x06\x10\x01\xff\xff\x99\x97\x00\x55\x01\x70') | f(b'\x0a\xef\x0b\x01\x05\x06\x10\x01\xff\xff\x99\x97\x00\x55\x01\x70') | def testStringToIPv6(self): if not hasattr(socket, 'inet_ntop'): return # No inet_ntop() on this platform try: from socket import inet_ntop, AF_INET6, has_ipv6 if not has_ipv6: return except ImportError: return f = lambda a: inet_ntop(AF_INET6, a) | b234e991478d0c1cbe3796a3057c374e1be92a29 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/b234e991478d0c1cbe3796a3057c374e1be92a29/test_socket.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
23282,
12775,
26,
12,
2890,
4672,
309,
486,
3859,
12,
7814,
16,
296,
23864,
67,
496,
556,
11,
4672,
327,
468,
2631,
17661,
67,
496,
556,
1435,
603,
333,
4072,
775,
30,
628,
2987,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
23282,
12775,
26,
12,
2890,
4672,
309,
486,
3859,
12,
7814,
16,
296,
23864,
67,
496,
556,
11,
4672,
327,
468,
2631,
17661,
67,
496,
556,
1435,
603,
333,
4072,
775,
30,
628,
2987,... |
return _apply(s.rfind, args) | return s.rfind(*args) | def rfind(s, *args): """rfind(s, sub [,start [,end]]) -> int Return the highest index in s where substring sub is found, such that sub is contained within s[start,end]. Optional arguments start and end are interpreted as in slice notation. Return -1 on failure. """ return _apply(s.rfind, args) | 7ee17801d7df9c8d8c0ab843127b0523fde6e516 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/7ee17801d7df9c8d8c0ab843127b0523fde6e516/string.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31257,
12,
87,
16,
380,
1968,
4672,
3536,
86,
4720,
12,
87,
16,
720,
306,
16,
1937,
306,
16,
409,
65,
5717,
317,
509,
225,
2000,
326,
9742,
770,
316,
272,
1625,
3019,
720,
353,
1392,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31257,
12,
87,
16,
380,
1968,
4672,
3536,
86,
4720,
12,
87,
16,
720,
306,
16,
1937,
306,
16,
409,
65,
5717,
317,
509,
225,
2000,
326,
9742,
770,
316,
272,
1625,
3019,
720,
353,
1392,... |
print "ds="+str(ds) print "dh="+str(dh) | def overcount(st,p): """Returns how many p are on st, works even for overlapping""" ocu=0 x=0 while 1: try: i=st.index(p,x) except ValueError: break ocu=ocu+1 x=i+1 return ocu | d52039c8e5c65c8bdf22f39be55279d0b9becbe1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7167/d52039c8e5c65c8bdf22f39be55279d0b9becbe1/MeltingTemp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1879,
1883,
12,
334,
16,
84,
4672,
3536,
1356,
3661,
4906,
293,
854,
603,
384,
16,
6330,
5456,
364,
18620,
8395,
320,
6319,
33,
20,
619,
33,
20,
1323,
404,
30,
775,
30,
277,
33,
334,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1879,
1883,
12,
334,
16,
84,
4672,
3536,
1356,
3661,
4906,
293,
854,
603,
384,
16,
6330,
5456,
364,
18620,
8395,
320,
6319,
33,
20,
619,
33,
20,
1323,
404,
30,
775,
30,
277,
33,
334,... | |
for partner in self.browse(cr, uid, ids): | for partner in self.browse(cr, uid, ids, context=context): | def _membership_date(self, cr, uid, ids, name, args, context=None): | 2a4c1e50cb967d4599507ed63424b4f85c7753ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2a4c1e50cb967d4599507ed63424b4f85c7753ea/membership.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
19679,
67,
712,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
833,
16,
819,
33,
7036,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
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,
389,
19679,
67,
712,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
833,
16,
819,
33,
7036,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
'Specified method is invalid for this server.'), | 'Specified method is invalid for this resource.'), | def address_string(self): """Return the client address formatted for logging. | ee5546c31676f181ed7c1674b7ea2b23672959b2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/ee5546c31676f181ed7c1674b7ea2b23672959b2/BaseHTTPServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1758,
67,
1080,
12,
2890,
4672,
3536,
990,
326,
1004,
1758,
4955,
364,
2907,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1758,
67,
1080,
12,
2890,
4672,
3536,
990,
326,
1004,
1758,
4955,
364,
2907,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
leg.extend(["I_mu", "F_mu", "I_mod", "F_mod"]) | leg.extend(["FinalMu", "FinalMod"]) P.legend(leg) | def HRF(stims, TR, num): TR = float(TR) inputl = 0; inputt = 0 dt = TR/HRFDIVIDER stimarr = [i for i in range(0, int(num*HRFDIVIDER + 2*hrfparam[6]/dt))] for i in range(0, len(stimarr)): if inputt < len(stims) and i*dt > stims[inputt][0] + hrfparam[5]\ + hrfparam[6]: inputl = stims[inputt][1] inputt = inputt+1 stimarr[i] = inputl points = [i for i in range(0,hrfparam[6]/dt)] hrf = [gamma.pdf(u, hrfparam[0]/hrfparam[2], scale=hrfparam[2]/dt) - \ gamma.pdf(u, hrfparam[1]/hrfparam[3], scale=hrfparam[3]/dt) \ / hrfparam[4] for u in points] scale = sum([hrf[i] for i in range(len(hrf)) if i%HRFDIVIDER == 0]) hrf = [point/scale for point in hrf] hdsignal = convolve(stimarr, hrf, mode="full") signal = [hdsignal[i] for i in range(0, len(stimarr)) \ if i%HRFDIVIDER == 0 and i*dt > hrfparam[6] and \ i*dt < len(stimarr)*dt-hrfparam[6]] delta = [(hdsignal[i+1] - hdsignal[i])/dt for i in range(0, len(stimarr)) \ if i%HRFDIVIDER == 0 and i*dt > hrfparam[6] and \ i*dt < len(stimarr)*dt-hrfparam[6]] return (signal, delta) | 960e87c2fc3c0197bb6c3d62ee1d879193a3a9b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5491/960e87c2fc3c0197bb6c3d62ee1d879193a3a9b4/makehist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
670,
12918,
12,
334,
12097,
16,
4235,
16,
818,
4672,
4235,
273,
1431,
12,
4349,
13,
810,
80,
273,
374,
31,
810,
88,
273,
374,
3681,
273,
4235,
19,
44,
12918,
2565,
20059,
25542,
5399,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
670,
12918,
12,
334,
12097,
16,
4235,
16,
818,
4672,
4235,
273,
1431,
12,
4349,
13,
810,
80,
273,
374,
31,
810,
88,
273,
374,
3681,
273,
4235,
19,
44,
12918,
2565,
20059,
25542,
5399,
... |
if processFocusWinEvent(*(focusWinEvent[1:])): | procFunc=processForegroundWinEvent if focusWinEvent[0]==winUser.EVENT_SYSTEM_FOREGROUND else processFocusWinEvent if procFunc(*(focusWinEvent[1:])): | def pumpAll(): #Receive all the winEvents from the limiter for this cycle winEvents=winEventLimiter.flushEvents() focusWinEvents=[] validFocus=False foregroundEvent=None fakeFocusEvent=None for winEvent in winEvents[0-MAX_WINEVENTS:]: #We want to only pass on one focus event to NVDA, but we always want to use the most recent possible one if winEvent[0]==winUser.EVENT_OBJECT_FOCUS: focusWinEvents.append(winEvent) continue else: for focusWinEvent in reversed(focusWinEvents): if processFocusWinEvent(*(focusWinEvent[1:])): validFocus=True break focusWinEvents=[] if winEvent[0]==winUser.EVENT_SYSTEM_FOREGROUND: # We will only use this if there is no valid focus event. foregroundEvent=winEvent[1:] elif winEvent[0]==winUser.EVENT_SYSTEM_DESKTOPSWITCH: processDesktopSwitchWinEvent(*winEvent[1:]) elif winEvent[0]==winUser.EVENT_OBJECT_DESTROY: processDestroyWinEvent(*winEvent[1:]) elif winEvent[0] in MENU_EVENTIDS+(winUser.EVENT_SYSTEM_SWITCHEND,): # If there is no valid focus event, we may need to use this to fake the focus later. fakeFocusEvent=winEvent else: processGenericWinEvent(*winEvent) for focusWinEvent in reversed(focusWinEvents): if processFocusWinEvent(*(focusWinEvent[1:])): validFocus=True break if foregroundEvent and not validFocus: processForegroundWinEvent(*foregroundEvent) if fakeFocusEvent: # Try this as a last resort. if fakeFocusEvent[0] in (winUser.EVENT_SYSTEM_MENUSTART, winUser.EVENT_SYSTEM_MENUPOPUPSTART): # menuStart needs to be handled specially and might act even if there was a valid focus event. processMenuStartWinEvent(*fakeFocusEvent, validFocus=validFocus) elif not validFocus: # Other fake focus events only need to be handled if there was no valid focus event. processFakeFocusWinEvent(*fakeFocusEvent) | 8b8ac88e11348fd02a4d63f329e6de6409be55c4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9340/8b8ac88e11348fd02a4d63f329e6de6409be55c4/IAccessibleHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
293,
2801,
1595,
13332,
468,
11323,
777,
326,
5657,
3783,
628,
326,
25057,
364,
333,
8589,
5657,
3783,
33,
8082,
1133,
22329,
18,
11330,
3783,
1435,
7155,
18049,
3783,
33,
8526,
923,
9233,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
293,
2801,
1595,
13332,
468,
11323,
777,
326,
5657,
3783,
628,
326,
25057,
364,
333,
8589,
5657,
3783,
33,
8082,
1133,
22329,
18,
11330,
3783,
1435,
7155,
18049,
3783,
33,
8526,
923,
9233,... |
column = row = 0 | column = row = comments_row = 0 | def widget_factory(type, col): if bulk: w = bulk_widgets[type](db, col, parent) else: w = widgets[type](db, col, parent) w.initialize(book_id) return w | 6ab5113196eceff570960a0341d3f0f27c8c10ec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/6ab5113196eceff570960a0341d3f0f27c8c10ec/custom_column_widgets.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3604,
67,
6848,
12,
723,
16,
645,
4672,
309,
8280,
30,
341,
273,
8280,
67,
18148,
63,
723,
29955,
1966,
16,
645,
16,
982,
13,
469,
30,
341,
273,
10965,
63,
723,
29955,
1966,
16,
645,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3604,
67,
6848,
12,
723,
16,
645,
4672,
309,
8280,
30,
341,
273,
8280,
67,
18148,
63,
723,
29955,
1966,
16,
645,
16,
982,
13,
469,
30,
341,
273,
10965,
63,
723,
29955,
1966,
16,
645,... |
startAnim, deleteAnim, lambda: self.assert_(avg.getNumRunningAnims() == 0), | startAnim | def deleteAnim(): self.anim = None | 25433654ead5e7cb0e330d27e2eb89812447ed8d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7300/25433654ead5e7cb0e330d27e2eb89812447ed8d/AnimTest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
20892,
13332,
365,
18,
304,
381,
273,
599,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
20892,
13332,
365,
18,
304,
381,
273,
599,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
self.hasPager = None | self.hasPager = None | def __init__(self, userHandle="", screenName="", listType=None, group=None, status=None): self.userHandle = userHandle self.screenName = screenName self.list = listType # list ('fl','rl','bl','al') self.group = group # group id (if applicable) self.status = status # current status | 9b2b7163e441396d9e5e7f46775cd7809b4655be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/9b2b7163e441396d9e5e7f46775cd7809b4655be/msn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
729,
3259,
1546,
3113,
5518,
461,
1546,
3113,
666,
559,
33,
7036,
16,
1041,
33,
7036,
16,
1267,
33,
7036,
4672,
365,
18,
1355,
3259,
273,
729,
3259,
365,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
729,
3259,
1546,
3113,
5518,
461,
1546,
3113,
666,
559,
33,
7036,
16,
1041,
33,
7036,
16,
1267,
33,
7036,
4672,
365,
18,
1355,
3259,
273,
729,
3259,
365,... |
self.tree.add_node(node, parent_id = '0') | self.assertSignal(self.view, \ 'node-modified-inview', \ self.tree.add_node, 2)(node, parent_id = '0') self.assert_(('temp',) in self.recorded_signals['node-modified-inview']) self.assert_(('0',) in self.recorded_signals['node-modified-inview']) | def test_add_parent(self): view = self.tree.get_viewtree(refresh = True) node = DummyNode('temp') node.add_color('blue') | c073ff4667160cf47c0c01dcc56265e0e4f9e5cd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/c073ff4667160cf47c0c01dcc56265e0e4f9e5cd/test_liblarch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1289,
67,
2938,
12,
2890,
4672,
1476,
273,
365,
18,
3413,
18,
588,
67,
1945,
3413,
12,
9144,
273,
1053,
13,
756,
273,
28622,
907,
2668,
5814,
6134,
756,
18,
1289,
67,
3266,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1289,
67,
2938,
12,
2890,
4672,
1476,
273,
365,
18,
3413,
18,
588,
67,
1945,
3413,
12,
9144,
273,
1053,
13,
756,
273,
28622,
907,
2668,
5814,
6134,
756,
18,
1289,
67,
3266,
... |
cookies = [ ('Set-Cookie', '%s=%s; Path=/' % ( self.cookie_name, ticket.cookie_value())), ('Set-Cookie', '%s=%s; Path=/; Domain=%s' % ( self.cookie_name, ticket.cookie_value(), cur_domain)), ('Set-Cookie', '%s=%s; Path=/; Domain=%s' % ( self.cookie_name, ticket.cookie_value(), wild_domain)) ] | cookie_options = "" if self.secure: cookie_options += "; secure" if self.httponly: cookie_options += "; HttpOnly" cookies = [] if self.no_domain_cookie: cookies.append(('Set-Cookie', '%s=%s; Path=/%s' % ( self.cookie_name, ticket.cookie_value(), cookie_options))) if self.current_domain_cookie: cookies.append(('Set-Cookie', '%s=%s; Path=/; Domain=%s%s' % ( self.cookie_name, ticket.cookie_value(), cur_domain, cookie_options))) if self.wildcard_cookie: cookies.append(('Set-Cookie', '%s=%s; Path=/; Domain=%s%s' % ( self.cookie_name, ticket.cookie_value(), wild_domain, cookie_options))) | def set_user_cookie(self, environ, userid, tokens, user_data): if not isinstance(tokens, basestring): tokens = ','.join(tokens) if self.include_ip: remote_addr = environ['REMOTE_ADDR'] else: remote_addr = '0.0.0.0' ticket = AuthTicket( self.secret, userid, remote_addr, tokens=tokens, user_data=user_data, cookie_name=self.cookie_name, secure=self.secure) # @@: Should we set REMOTE_USER etc in the current # environment right now as well? cur_domain = environ.get('HTTP_HOST', environ.get('SERVER_NAME')) wild_domain = '.' + cur_domain cookies = [ ('Set-Cookie', '%s=%s; Path=/' % ( self.cookie_name, ticket.cookie_value())), ('Set-Cookie', '%s=%s; Path=/; Domain=%s' % ( self.cookie_name, ticket.cookie_value(), cur_domain)), ('Set-Cookie', '%s=%s; Path=/; Domain=%s' % ( self.cookie_name, ticket.cookie_value(), wild_domain)) ] return cookies | 6c6088e2216956d0c77ac890894bd0922b998c7e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11400/6c6088e2216956d0c77ac890894bd0922b998c7e/auth_tkt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
1355,
67,
8417,
12,
2890,
16,
5473,
16,
6709,
16,
2430,
16,
729,
67,
892,
4672,
309,
486,
1549,
12,
7860,
16,
10699,
4672,
2430,
273,
3316,
18,
5701,
12,
7860,
13,
309,
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,
67,
1355,
67,
8417,
12,
2890,
16,
5473,
16,
6709,
16,
2430,
16,
729,
67,
892,
4672,
309,
486,
1549,
12,
7860,
16,
10699,
4672,
2430,
273,
3316,
18,
5701,
12,
7860,
13,
309,
365,... |
def __init__(self, id, d): | def __init__(self, id, d, user, passwd): | def __init__(self, id, d): self.error = 0 self.id = id self.d = d self.ip = d['ip'] self.port = d['port'] self.pan0 = d['pan0'] self.name = d['name'] self.settings = {} self.cid = None self.haveControl = False | 76ebebcbdf36af98d587f43432fa8c2a0bbe6466 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11185/76ebebcbdf36af98d587f43432fa8c2a0bbe6466/vbcam.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
612,
16,
302,
16,
729,
16,
19093,
4672,
365,
18,
1636,
273,
374,
365,
18,
350,
273,
612,
365,
18,
72,
273,
302,
365,
18,
625,
273,
302,
3292,
625,
35... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
612,
16,
302,
16,
729,
16,
19093,
4672,
365,
18,
1636,
273,
374,
365,
18,
350,
273,
612,
365,
18,
72,
273,
302,
365,
18,
625,
273,
302,
3292,
625,
35... |
if 'uid' not in props: props['uid'] = uid | props['uid'] = uid | def update(self, uid, props, filelike=None, can_move=False): if 'uid' not in props: props['uid'] = uid if filelike: if isinstance(filelike, basestring): # lets treat it as a filename filelike = open(filelike, "r") filelike.seek(0) path = self._writeContent(uid, filelike, can_move=can_move) self.indexmanager.index(props, path) else: self.indexmanager.index(props) | 0a7e80f01ac0f96b15d1eeeda3386be40b8a9b7c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9394/0a7e80f01ac0f96b15d1eeeda3386be40b8a9b7c/backingstore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
16,
4555,
16,
3458,
16,
661,
292,
2547,
33,
7036,
16,
848,
67,
8501,
33,
8381,
4672,
3458,
3292,
1911,
3546,
273,
4555,
309,
661,
292,
2547,
30,
309,
1549,
12,
7540,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
16,
4555,
16,
3458,
16,
661,
292,
2547,
33,
7036,
16,
848,
67,
8501,
33,
8381,
4672,
3458,
3292,
1911,
3546,
273,
4555,
309,
661,
292,
2547,
30,
309,
1549,
12,
7540,
... |
for b in baudrate_constants.keys(): if b > 230400: del baudrate_constants[b] | def set_special_baudrate(port, baudrate): raise ValueError("sorry don't know how to handle non standard baud rate on this platform") | 99220a05686825c332014472328610306cf55b88 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2937/99220a05686825c332014472328610306cf55b88/serialposix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
9371,
67,
12124,
1100,
5141,
12,
655,
16,
9846,
1100,
5141,
4672,
1002,
2068,
2932,
2467,
1176,
2727,
1404,
5055,
3661,
358,
1640,
1661,
4529,
9846,
1100,
4993,
603,
333,
4072,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
444,
67,
9371,
67,
12124,
1100,
5141,
12,
655,
16,
9846,
1100,
5141,
4672,
1002,
2068,
2932,
2467,
1176,
2727,
1404,
5055,
3661,
358,
1640,
1661,
4529,
9846,
1100,
4993,
603,
333,
4072,
... | |
mask: A list of booleans as long as the number of atoms | mask: list of bool | def log(self, parameter=None): """Log the parameters of the eigenmode search.""" if self.logfile is not None: if parameter is not None: l = 'DIM:CONTROL: Updated Parameter: %s = %s\n' % (parameter, str(self.get_parameter(parameter))) else: l = 'MINMODE:METHOD: Dimer\n' l += 'DIM:CONTROL: Search Parameters:\n' l += 'DIM:CONTROL: ------------------\n' for key in self.parameters: l += 'DIM:CONTROL: %s = %s\n' % (key, str(self.get_parameter(key))) l += 'DIM:CONTROL: ------------------\n' l += 'DIM:ROT: OPT-STEP ROT-STEP CURVATURE ROT-ANGLE ' + \ 'ROT-FORCE\n' self.logfile.write(l) self.logfile.flush() | 4018acf8c674e0693794b02621baa8897f571068 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1380/4018acf8c674e0693794b02621baa8897f571068/dimer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
613,
12,
2890,
16,
1569,
33,
7036,
4672,
3536,
1343,
326,
1472,
434,
326,
16719,
3188,
1623,
12123,
309,
365,
18,
28806,
353,
486,
599,
30,
309,
1569,
353,
486,
599,
30,
328,
273,
296,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
613,
12,
2890,
16,
1569,
33,
7036,
4672,
3536,
1343,
326,
1472,
434,
326,
16719,
3188,
1623,
12123,
309,
365,
18,
28806,
353,
486,
599,
30,
309,
1569,
353,
486,
599,
30,
328,
273,
296,... |
"""Open Data/masterlist.txt.""" def AppendToMenu(self,menu,window,data): Link.AppendToMenu(self,menu,window,data) menuItem = wx.MenuItem(menu,self.id,_('masterlist.txt...')) menu.AppendItem(menuItem) self.path = bosh.dirs['mods'].join('masterlist.txt') menuItem.Enable(self.path.exists()) def Execute(self,event): """Handle selection.""" self.path.start() | """Open Data/masterlist.txt.""" def AppendToMenu(self,menu,window,data): Link.AppendToMenu(self,menu,window,data) menuItem = wx.MenuItem(menu,self.id,_('masterlist.txt...')) menu.AppendItem(menuItem) self.path = bosh.dirs['mods'].join('masterlist.txt') menuItem.Enable(self.path.exists()) def Execute(self,event): """Handle selection.""" self.path.start() | def Execute(self,event): """Handle selection.""" self.path.start() | 3ac43907fa076fea1e8d682219e2b28fc7419f7b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/3ac43907fa076fea1e8d682219e2b28fc7419f7b/basher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7903,
12,
2890,
16,
2575,
4672,
3536,
3259,
4421,
12123,
365,
18,
803,
18,
1937,
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,
... | [
1,
1,
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,
7903,
12,
2890,
16,
2575,
4672,
3536,
3259,
4421,
12123,
365,
18,
803,
18,
1937,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if dt.tzinfo: dt = dt.astimezone(tz) | if getattr(dt, 'tzinfo', None): dt = dt.astimezone(tz) | def convertToMX(dt, tz=None): """Convert the given datetime into an mxDateTime. Convert dt to local time if it has a timezone. >>> import datetime, mx.DateTime >>> dt = datetime.datetime(2004, 12, 20, 18, tzinfo=utc) >>> mxdt = convertToMX(dt, pacific) >>> print mxdt 2004-12-20 10:00:00.00 >>> type(mxdt) <type 'DateTime'> """ if not tz: tz = localtime if dt.tzinfo: dt = dt.astimezone(tz) return DateTime.mktime(dt.timetuple()) | 404f8894f93966d39b5586909b8f35bfa2aa573c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/404f8894f93966d39b5586909b8f35bfa2aa573c/icalendar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8137,
13874,
12,
7510,
16,
6016,
33,
7036,
4672,
3536,
2723,
326,
864,
3314,
1368,
392,
7938,
5096,
18,
225,
4037,
3681,
358,
1191,
813,
309,
518,
711,
279,
6371,
18,
225,
4080,
1930,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8137,
13874,
12,
7510,
16,
6016,
33,
7036,
4672,
3536,
2723,
326,
864,
3314,
1368,
392,
7938,
5096,
18,
225,
4037,
3681,
358,
1191,
813,
309,
518,
711,
279,
6371,
18,
225,
4080,
1930,
... |
"""Moves to a point dx, dy away from the start of the current line - NOT from the current point! So if you call it in mid-sentence, watch out.""" | """Starts a new line at an offset dx,dy from the start of the current line. This does not move the cursor relative to the current position, and it changes the current offset of every future line drawn (i.e. if you next do a textLine() call, it will move the cursor to a position one line lower than the position specificied in this call. """ | def moveCursor(self, dx, dy): """Moves to a point dx, dy away from the start of the current line - NOT from the current point! So if you call it in mid-sentence, watch out.""" if self._code and self._code[-1][-3:]==' Td': L = string.split(self._code[-1]) if len(L)==3: del self._code[-1] else: self._code[-1] = string.join(L[:-4]) dx = dx + float(L[-3]) dy = dy - float(L[-2]) self._code.append('%s Td' % fp_str(dx, -dy)) | c8807bcce56d0da528e6e56ed9baa7e7f4382f44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/c8807bcce56d0da528e6e56ed9baa7e7f4382f44/textobject.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3635,
6688,
12,
2890,
16,
6633,
16,
7732,
4672,
225,
3536,
11203,
279,
394,
980,
622,
392,
1384,
6633,
16,
15680,
628,
326,
787,
434,
326,
783,
980,
18,
1220,
1552,
486,
3635,
326,
334... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3635,
6688,
12,
2890,
16,
6633,
16,
7732,
4672,
225,
3536,
11203,
279,
394,
980,
622,
392,
1384,
6633,
16,
15680,
628,
326,
787,
434,
326,
783,
980,
18,
1220,
1552,
486,
3635,
326,
334... |
game.quad[ix][iy]=('-','o','O')[m-1] | game.quad[game.sector.i][game.sector.j]=('-','o','O')[m-1] | def mayday(): "Yell for help from nearest starbase." # There's more than one way to move in this game! scanner.chew() # Test for conditions which prevent calling for help if game.condition == "docked": prout(_("Lt. Uhura- \"But Captain, we're already docked.\"")) return if damaged(DRADIO): prout(_("Subspace radio damaged.")) return if not game.state.baseq: prout(_("Lt. Uhura- \"Captain, I'm not getting any response from Starbase.\"")) return if game.landed: prout(_("You must be aboard the %s.") % crmshp()) return # OK -- call for help from nearest starbase game.nhelp += 1 if game.base.i!=0: # There's one in this quadrant ddist = (game.base - game.sector).distance() else: ddist = FOREVER for ibq in game.state.baseq: xdist = QUADSIZE * (ibq - game.quadrant).distance() if xdist < ddist: ddist = xdist # Since starbase not in quadrant, set up new quadrant game.quadrant = ibq newqad() # dematerialize starship game.quad[game.sector.i][game.sector.j]='.' proutn(_("Starbase in Quadrant %s responds--%s dematerializes") \ % (game.quadrant, crmshp())) game.sector.invalidate() for m in range(1, 5+1): w = game.base.scatter() if w.valid_sector() and game.quad[w.i][w.j]=='.': # found one -- finish up game.sector = w break if not game.sector.is_valid(): prout(_("You have been lost in space...")) finish(FMATERIALIZE) return # Give starbase three chances to rematerialize starship probf = math.pow((1.0 - math.pow(0.98,ddist)), 0.33333333) for m in range(1, 3+1): if m == 1: proutn(_("1st")) elif m == 2: proutn(_("2nd")) elif m == 3: proutn(_("3rd")) proutn(_(" attempt to re-materialize ") + crmshp()) game.quad[ix][iy]=('-','o','O')[m-1] textcolor(RED) warble() if randreal() > probf: break prout(_("fails.")) textcolor(DEFAULT) curses.delay_output(500) if m > 3: game.quad[ix][iy]='?' game.alive = False drawmaps(1) setwnd(message_window) finish(FMATERIALIZE) return game.quad[ix][iy]=game.ship textcolor(GREEN); prout(_("succeeds.")) textcolor(DEFAULT); dock(False) skip(1) prout(_("Lt. Uhura- \"Captain, we made it!\"")) | 65ebc303124b932f39a34d20faaa702d07854b82 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3176/65ebc303124b932f39a34d20faaa702d07854b82/sst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2026,
2881,
13332,
315,
61,
1165,
364,
2809,
628,
11431,
10443,
1969,
1199,
468,
6149,
1807,
1898,
2353,
1245,
4031,
358,
3635,
316,
333,
7920,
5,
7683,
18,
343,
359,
1435,
468,
7766,
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,
2026,
2881,
13332,
315,
61,
1165,
364,
2809,
628,
11431,
10443,
1969,
1199,
468,
6149,
1807,
1898,
2353,
1245,
4031,
358,
3635,
316,
333,
7920,
5,
7683,
18,
343,
359,
1435,
468,
7766,
36... |
0.90455689430238140 - 1.0612750619050357*I | 0.904556894302381 - 1.06127506190503*I | def acos(self): """ EXAMPLES: sage: (1+I).acos() 0.90455689430238140 - 1.0612750619050357*I """ return self.parent()(self._pari_().acos()) | 0f85c81e959512e75d1c3f66db056b379125ea81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/0f85c81e959512e75d1c3f66db056b379125ea81/complex_number.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1721,
538,
12,
2890,
4672,
3536,
5675,
8900,
11386,
30,
272,
410,
30,
261,
21,
15,
45,
2934,
1077,
538,
1435,
374,
18,
29,
3028,
2539,
26,
6675,
8942,
3103,
7414,
21,
300,
404,
18,
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,
1721,
538,
12,
2890,
4672,
3536,
5675,
8900,
11386,
30,
272,
410,
30,
261,
21,
15,
45,
2934,
1077,
538,
1435,
374,
18,
29,
3028,
2539,
26,
6675,
8942,
3103,
7414,
21,
300,
404,
18,
7... |
register("mosaic", None, GenericBrowser("mosaic %s >/dev/null &")) | register("mosaic", None, GenericBrowser( "mosaic '%s' >/dev/null &")) | def open_new(self, url): self.open(url) | 925f14427416c1c5a8c6e71d17daac20e248c7b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/925f14427416c1c5a8c6e71d17daac20e248c7b0/webbrowser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
2704,
12,
2890,
16,
880,
4672,
365,
18,
3190,
12,
718,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
2704,
12,
2890,
16,
880,
4672,
365,
18,
3190,
12,
718,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if (os.path.exists(subl[4])): retval += [subl[4]] else: print 'ldd returns non existing library '+subl[2] | if (mode == 3): if (os.path.exists(subl[4])): retval += [subl[4]] else: print 'ldd returns non existing library '+subl[4] elif (mode == 4): if (os.path.exists(subl[6])): retval += [subl[6]] else: print 'ldd returns non existing library '+subl[6] else: print 'unknown mode, please report this bug in jk_lib.py' | def lddlist_libraries_openbsd(executable): """returns a list of libraries that the executable depends on """ retval = [] pd = os.popen3('ldd '+executable) line = pd[1].readline() while (len(line)>0): subl = string.split(line) if (len(subl)>0): if (subl[0] == executable+':'): pass elif (subl[0] == 'Start'): pass elif (len(subl)>=5): if (os.path.exists(subl[4])): retval += [subl[4]] else: print 'ldd returns non existing library '+subl[2] else: print 'WARNING: failed to parse ldd output '+line[:-1] else: print 'WARNING: failed to parse ldd output '+line[:-1] line = pd[1].readline() return retval | bbe59c48e9965929a6c62e147ee0cc5035a847ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6201/bbe59c48e9965929a6c62e147ee0cc5035a847ca/jk_lib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
328,
449,
1098,
67,
31417,
67,
3190,
2038,
72,
12,
17751,
4672,
3536,
6154,
279,
666,
434,
14732,
716,
326,
9070,
10935,
603,
3536,
5221,
273,
5378,
4863,
273,
1140,
18,
84,
3190,
23,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
328,
449,
1098,
67,
31417,
67,
3190,
2038,
72,
12,
17751,
4672,
3536,
6154,
279,
666,
434,
14732,
716,
326,
9070,
10935,
603,
3536,
5221,
273,
5378,
4863,
273,
1140,
18,
84,
3190,
23,
... |
value = u"%(x)s, %()s" % {'x':u"abc", u''.encode('utf-8'):"def"} | if sys.platform[:4] != 'java': value = u"%(x)s, %()s" % {'x':u"abc", u''.encode('utf-8'):"def"} else: value = u"%(x)s, %()s" % {'x':u"abc", u'':"def"} | def test_fixup(s): s2 = u'\ud800\udc01' test_lecmp(s, s2) s2 = u'\ud900\udc01' test_lecmp(s, s2) s2 = u'\uda00\udc01' test_lecmp(s, s2) s2 = u'\udb00\udc01' test_lecmp(s, s2) s2 = u'\ud800\udd01' test_lecmp(s, s2) s2 = u'\ud900\udd01' test_lecmp(s, s2) s2 = u'\uda00\udd01' test_lecmp(s, s2) s2 = u'\udb00\udd01' test_lecmp(s, s2) s2 = u'\ud800\ude01' test_lecmp(s, s2) s2 = u'\ud900\ude01' test_lecmp(s, s2) s2 = u'\uda00\ude01' test_lecmp(s, s2) s2 = u'\udb00\ude01' test_lecmp(s, s2) s2 = u'\ud800\udfff' test_lecmp(s, s2) s2 = u'\ud900\udfff' test_lecmp(s, s2) s2 = u'\uda00\udfff' test_lecmp(s, s2) s2 = u'\udb00\udfff' test_lecmp(s, s2) | ef0a032883cadeb0dba7a6ff84025f7133b75b31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ef0a032883cadeb0dba7a6ff84025f7133b75b31/test_unicode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
904,
416,
12,
87,
4672,
272,
22,
273,
582,
8314,
1100,
17374,
64,
1100,
71,
1611,
11,
1842,
67,
298,
9625,
12,
87,
16,
272,
22,
13,
272,
22,
273,
582,
8314,
1100,
29,
713... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
904,
416,
12,
87,
4672,
272,
22,
273,
582,
8314,
1100,
17374,
64,
1100,
71,
1611,
11,
1842,
67,
298,
9625,
12,
87,
16,
272,
22,
13,
272,
22,
273,
582,
8314,
1100,
29,
713... |
test_shape() | if __name__ == '__main__': test_sphere() | def test_imagetex(): imagetex = ImageTexture(r"C:\Documents and Settings\admin\Mes documents\Develop\Practice\bark.png") imagetex.apply(printer) eval_code(imagetex) | 5af742fb7bba9aa7cc5692e378c2cd775320b880 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/799/5af742fb7bba9aa7cc5692e378c2cd775320b880/test_pyprinter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
15374,
278,
338,
13332,
8902,
278,
338,
273,
3421,
10967,
12,
86,
6,
39,
5581,
12922,
471,
8709,
64,
3666,
64,
49,
281,
7429,
64,
758,
8250,
64,
52,
14266,
1812,
64,
70,
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,
15374,
278,
338,
13332,
8902,
278,
338,
273,
3421,
10967,
12,
86,
6,
39,
5581,
12922,
471,
8709,
64,
3666,
64,
49,
281,
7429,
64,
758,
8250,
64,
52,
14266,
1812,
64,
70,
13... |
u'\u1794\u17d2\u178a\u17bc\u179a\u1785\u17c6\u178e\u1784\u1787\u17be\u1784'], | u'\u1794\u17d2\u178a\u17bc\u179a\u1785\u17c6\u178e\u1784\u1787\u17be\u1784', u'ប្តូរទីតាំងទៅ'], | def category_namespaces(self, code): return self.namespace(code, 14, all = True) | 961406df3620c68da51815dde157ded92152bcdc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/961406df3620c68da51815dde157ded92152bcdc/family.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3150,
67,
16078,
12,
2890,
16,
981,
4672,
327,
365,
18,
4937,
12,
710,
16,
5045,
16,
777,
273,
1053,
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,
3150,
67,
16078,
12,
2890,
16,
981,
4672,
327,
365,
18,
4937,
12,
710,
16,
5045,
16,
777,
273,
1053,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
azim = dict['PAzim'] | azim = dict['PAzim'] | def drawFocMec(self): if self.dictFocalMechanism == {}: err = "Error: No focal mechanism data!" self.textviewStdErrImproved.write(err) return # make up the figure: fig = self.fig self.axsFocMec = [] axs = self.axsFocMec fig.subplots_adjust(left=0, bottom=0, right=1, top=1) # plot the selected solution dF = self.dictFocalMechanism axs.append(Beachball([dF['Strike'], dF['Dip'], dF['Rake']], fig=fig)) # plot the alternative solutions if self.focMechList != []: for dict in self.focMechList: axs.append(Beachball([dict['Strike'], dict['Dip'], dict['Rake']], nofill=True, fig=fig, edgecolor='k', linewidth=1., alpha=0.3)) text = "Focal Mechanism (%i of %i)" % \ (self.focMechCurrent + 1, self.focMechCount) text += "\nDip: %6.2f Strike: %6.2f Rake: %6.2f" % \ (dF['Dip'], dF['Strike'], dF['Rake']) if 'Errors' in dF: text += "\nErrors: %i/%i" % (dF['Errors'], dF['Station Polarity Count']) else: text += "\nUsed Polarities: %i" % dF['Station Polarity Count'] #fig.canvas.set_window_title("Focal Mechanism (%i of %i)" % \ # (self.focMechCurrent + 1, self.focMechCount)) fig.subplots_adjust(top=0.88) # make room for suptitle # values 0.02 and 0.96 fit best over the outer edges of beachball #ax = fig.add_axes([0.00, 0.02, 1.00, 0.96], polar=True) self.axFocMecStations = fig.add_axes([0.00,0.02,1.00,0.84], polar=True) ax = self.axFocMecStations ax.set_title(text) ax.set_axis_off() for dict in self.dicts: if 'PAzim' in dict and 'PInci' in dict and 'PPol' in dict: if dict['PPol'] == "up": color = "black" elif dict['PPol'] == "poorup": color = "darkgrey" elif dict['PPol'] == "poordown": color = "lightgrey" elif dict['PPol'] == "down": color = "white" else: continue # southern hemisphere projection if dict['PInci'] > 90: inci = 180. - dict['PInci'] azim = -180. + dict['PAzim'] else: inci = dict['PInci'] azim = dict['PAzim'] #we have to hack the azimuth because of the polar plot #axes orientation plotazim = (np.pi / 2.) - ((azim / 180.) * np.pi) ax.scatter([plotazim], [inci], facecolor=color) ax.text(plotazim, inci, " " + dict['Station'], va="top") #this fits the 90 degree incident value to the beachball edge best ax.set_ylim([0., 91]) self.canv.draw() | 3f74a1e386d3c23bf0221947eebfe61d223353bd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10470/3f74a1e386d3c23bf0221947eebfe61d223353bd/obspyck.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
42,
504,
49,
557,
12,
2890,
4672,
309,
365,
18,
1576,
42,
23735,
31546,
422,
16648,
393,
273,
315,
668,
30,
2631,
284,
23735,
12860,
501,
4442,
365,
18,
955,
1945,
10436,
2524,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
42,
504,
49,
557,
12,
2890,
4672,
309,
365,
18,
1576,
42,
23735,
31546,
422,
16648,
393,
273,
315,
668,
30,
2631,
284,
23735,
12860,
501,
4442,
365,
18,
955,
1945,
10436,
2524,
1... |
source_list = [] source = open(source_name) | source_list = [] with open(source_name) as source: | def test_checkcache(self): getline = linecache.getline try: # Create a source file and cache its contents source_name = support.TESTFN + '.py' with open(source_name, 'w') as source: source.write(SOURCE_1) source.close() getline(source_name, 1) | c2037ed2b9ceebb973d58f88cf4fec8c6435df25 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/c2037ed2b9ceebb973d58f88cf4fec8c6435df25/test_linecache.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1893,
2493,
12,
2890,
4672,
336,
1369,
273,
4739,
557,
807,
18,
588,
1369,
775,
30,
468,
1788,
279,
1084,
585,
471,
1247,
2097,
2939,
1084,
67,
529,
273,
2865,
18,
16961,
197... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1893,
2493,
12,
2890,
4672,
336,
1369,
273,
4739,
557,
807,
18,
588,
1369,
775,
30,
468,
1788,
279,
1084,
585,
471,
1247,
2097,
2939,
1084,
67,
529,
273,
2865,
18,
16961,
197... |
typ, rid, dt = record[:3] min = dt[:-3] dt = parsedt(dt) | typ, rid, dt, min = record[:4] dt = parsedt(' '.join([dt,min])) | def main(args=None): if args is None: args = sys.argv[1:] options, args = parser.parse_args(args) if options.event_log: restarts = find_restarts(options.event_log) else: restarts = [] restarts.append(datetime.datetime.utcnow()+datetime.timedelta(1000)) if options.html: print_app_requests = print_app_requests_html output_minute = output_minute_html output_stats = output_stats_html minutes_header = minutes_header_html minutes_footer = minutes_footer_html print '<html title="trace log statistics"><body>' else: print_app_requests = print_app_requests_text output_minute = output_minute_text output_stats = output_stats_text minutes_header = minutes_header_text minutes_footer = minutes_footer_text if options.summary_only: print_app_requests = output_minute = lambda *a, **kw: None minutes_footer = minutes_header = lambda *a, **kw: None urls = {} [file] = args lmin = ldt = None requests = {} input = apps = output = n = wait = 0 spr = spa = 0.0 restart = restarts.pop(0) minutes_header() remove_prefix = options.remove_prefix if file == '-': file = sys.stdin else: file = open(file) for record in file: record = record.split() typ, rid, dt = record[:3] min = dt[:-3] dt = parsedt(dt) if dt == restart: continue while dt > restart: print_app_requests(requests, ldt, options.old_requests, options.app_requests, urls, "\nLeft over:") record_hung(urls, requests) requests = {} input = apps = output = n = wait = 0 spr = spa = 0.0 restart = restarts.pop(0) ldt = dt if min != lmin: if lmin is not None: output_minute(lmin, requests, input, wait, apps, output, n, spr, spa) if apps > options.apps: print_app_requests(requests, dt, options.old_requests, options.app_requests, urls, ) lmin = min spr = 0.0 spa = 0.0 n = 0 if typ == 'B': if rid in requests: request = requests[rid] if request.state == 'output': output -= 1 elif request.state == 'app': apps -= 1 else: input -= 1 input += 1 request = Request(dt, *record[3:5]) if remove_prefix and request.url.startswith(remove_prefix): request.url = request.url[len(remove_prefix):] requests[rid] = request elif typ == 'I': if rid in requests: input -= 1 wait += 1 requests[rid].I(dt, record[3]) elif typ == 'C': if rid in requests: wait -= 1 apps += 1 requests[rid].C(dt) elif typ == 'A': if rid in requests: apps -= 1 output += 1 requests[rid].A(dt, *record[3:5]) elif typ == 'E': if rid in requests: output -= 1 request = requests.pop(rid) request.E(dt) spr += request.total_seconds spa += request.app_seconds n += 1 url = "%s -> %s" % (request.url, request.response) times = urls.get(url) if times is None: times = urls[url] = Times() times.finished(request) elif typ in 'SX': print_app_requests(requests, ldt, options.old_requests, options.app_requests, urls, "\nLeft over:") record_hung(urls, requests) requests = {} input = apps = output = n = wait = 0 spr = spa = 0.0 else: print 'WTF', record print_app_requests(requests, dt, options.old_requests, options.app_requests, urls, "Left over:") minutes_footer() output_stats(urls, lines=options.summary_lines) if options.html: print '</body></html>' | 4cd9e6511af6ff0ea1e7f5f00c8b96d1715cb05f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7695/4cd9e6511af6ff0ea1e7f5f00c8b96d1715cb05f/tracereport.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
1968,
33,
7036,
4672,
309,
833,
353,
599,
30,
833,
273,
2589,
18,
19485,
63,
21,
26894,
225,
702,
16,
833,
273,
2082,
18,
2670,
67,
1968,
12,
1968,
13,
309,
702,
18,
2575,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
1968,
33,
7036,
4672,
309,
833,
353,
599,
30,
833,
273,
2589,
18,
19485,
63,
21,
26894,
225,
702,
16,
833,
273,
2082,
18,
2670,
67,
1968,
12,
1968,
13,
309,
702,
18,
2575,
... |
def delete_db(settings): | def delete_db(settings): | def delete_db(settings): """Delete the old database.""" engine = settings.DATABASE_ENGINE if engine == 'sqlite3': try: os.unlink(settings.DATABASE_NAME) except OSError: pass elif engine == 'mysql': import _mysql s = _mysql.connect(host=settings.DATABASE_HOST, user=settings.DATABASE_USER, passwd=settings.DATABASE_PASSWORD) for cmd in ['drop database if exists %s', 'create database %s CHARACTER SET utf8 COLLATE utf8_general_ci']: s.query(cmd % settings.DATABASE_NAME) elif engine in ('postgresql', 'postgresql_psycopg2'): if settings.DATABASE_NAME == '': raise AssertionError, "You must specified a value for DATABASE_NAME in local_settings.py." if settings.DATABASE_USER == '': raise AssertionError, "You must specified a value for DATABASE_USER in local_settings.py." params=" --username=%s --password" % settings.DATABASE_USER if settings.DATABASE_HOST: params += " --host=%s" % settings.DATABASE_HOST if settings.DATABASE_PORT: params += " --port=%s" % settings.DATABASE_PORT params += " %s" % settings.DATABASE_NAME print """You will be prompted for the password for the user '%s' twice. Once to drop an existing database and then a second time for create the database """ % settings.DATABASE_USER for cmd in ['dropdb %s', 'createdb %s']: os.system(cmd % params) else: raise AssertionError, "Unknown database engine %s" % engine | 0b5b5bdddb5618fc3777a5e213b03abd527f7ab5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13656/0b5b5bdddb5618fc3777a5e213b03abd527f7ab5/load_data.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
67,
1966,
12,
4272,
4672,
3536,
2613,
326,
1592,
2063,
12123,
4073,
273,
1947,
18,
22366,
67,
28980,
309,
4073,
422,
296,
19460,
23,
4278,
775,
30,
1140,
18,
318,
1232,
12,
4272,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
67,
1966,
12,
4272,
4672,
3536,
2613,
326,
1592,
2063,
12123,
4073,
273,
1947,
18,
22366,
67,
28980,
309,
4073,
422,
296,
19460,
23,
4278,
775,
30,
1140,
18,
318,
1232,
12,
4272,
... |
class MarginsPropertySet : def __init__( self, top=None, left=None, bottom=None, right=None ) : self.SetTop ( top ) self.SetLeft ( left ) self.SetBottom( bottom ) self.SetRight ( right ) def SetTop( self, value ) : | class MarginsPropertySet: def __init__(self, top=None, left=None, bottom=None, right=None): self.SetTop(top) self.SetLeft(left) self.SetBottom(bottom) self.SetRight(right) def SetTop(self, value): | def __init__( self ) : super( Papers, self ).__init__( Paper ) | 13865299ef9bc077be9a5eaa4326b7a30307d828 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3330/13865299ef9bc077be9a5eaa4326b7a30307d828/PropertySets.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
262,
294,
2240,
12,
453,
438,
414,
16,
365,
262,
16186,
2738,
972,
12,
20971,
262,
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,
1001,
2738,
972,
12,
365,
262,
294,
2240,
12,
453,
438,
414,
16,
365,
262,
16186,
2738,
972,
12,
20971,
262,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.bank = bank self.label = label | self.brokerBank = broker.getBrokerBank() self.agentBank = agentBank self.label = label | def __init__(self, broker, bank, label): self.broker = broker self.bank = bank self.label = label | 0d08ba902f6f1345e2b0a283cf6e677e5be4b47d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/197/0d08ba902f6f1345e2b0a283cf6e677e5be4b47d/console.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
8625,
16,
11218,
16,
1433,
4672,
365,
18,
21722,
273,
8625,
365,
18,
10546,
282,
273,
11218,
365,
18,
1925,
225,
273,
1433,
2,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
8625,
16,
11218,
16,
1433,
4672,
365,
18,
21722,
273,
8625,
365,
18,
10546,
282,
273,
11218,
365,
18,
1925,
225,
273,
1433,
2,
-100,
-100,
-100,
-100,
-1... |
if (miller_array.is_xray_intensity_array()): | if (miller_array.is_complex_array() and miller_array.sigmas() is None): assert not miller_array.is_xray_intensity_array() if (miller_array.anomalous_flag()): result = "GP" else: result = "FP" elif (miller_array.is_xray_intensity_array()): | def default_column_types(miller_array): result = None if (miller_array.is_xray_intensity_array()): if (miller_array.anomalous_flags()): result = "K" if (miller_array.sigmas() is not None): result += "M" else: result = "J" if (miller_array.sigmas() is not None): result += "Q" elif (miller_array.is_xray_amplitude_array() or (miller_array.is_real_array() and miller_array.sigmas() is not None)): if (miller_array.anomalous_flag()): result = "G" if (miller_array.sigmas() is not None): result += "L" else: result = "F" if (miller_array.sigmas() is not None): result += "Q" elif (( miller_array.is_bool_array() or miller_array.is_integer_array()) and miller_array.sigmas() is None): result = "I" elif (miller_array.is_real_array()): if (miller_array.anomalous_flag()): result = "G" else: result = "F" elif (miller_array.is_complex_array() and miller_array.sigmas() is None): if (miller_array.anomalous_flag()): result = "GP" else: result = "FP" elif (miller_array.is_hendrickson_lattman_array()): result = "AAAA" return result | 2a0ffab624390cfa303ac88ffcf4a41498a3a1f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/696/2a0ffab624390cfa303ac88ffcf4a41498a3a1f5/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
805,
67,
2827,
67,
2352,
12,
81,
24462,
67,
1126,
4672,
563,
273,
599,
309,
261,
81,
24462,
67,
1126,
18,
291,
67,
14259,
67,
1126,
1435,
471,
312,
24462,
67,
1126,
18,
7340,
15260,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
805,
67,
2827,
67,
2352,
12,
81,
24462,
67,
1126,
4672,
563,
273,
599,
309,
261,
81,
24462,
67,
1126,
18,
291,
67,
14259,
67,
1126,
1435,
471,
312,
24462,
67,
1126,
18,
7340,
15260,
... |
def floordiv(w_bigint1, w_bigint2): div, mod = w_bigint1.divmod(w_bigint2) | def floordiv(self, other): div, mod = self.divmod(other) | def floordiv(w_bigint1, w_bigint2): div, mod = w_bigint1.divmod(w_bigint2) return div | 87da397eba037ce53e8c5847c7c4b29acfda97b2 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6934/87da397eba037ce53e8c5847c7c4b29acfda97b2/rbigint.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20802,
517,
427,
12,
2890,
16,
1308,
4672,
3739,
16,
681,
273,
365,
18,
2892,
1711,
12,
3011,
13,
327,
3739,
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,
20802,
517,
427,
12,
2890,
16,
1308,
4672,
3739,
16,
681,
273,
365,
18,
2892,
1711,
12,
3011,
13,
327,
3739,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return | skip("XXX the following does not work because there are no fallbacks in the reflective object space") | def f(x, y, z): return x + y * z | 5531d8c0b3dd286dacc356c34d47e2aa49095741 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6934/5531d8c0b3dd286dacc356c34d47e2aa49095741/test_reflective.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
12,
92,
16,
677,
16,
998,
4672,
327,
619,
397,
677,
380,
998,
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,
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,
284,
12,
92,
16,
677,
16,
998,
4672,
327,
619,
397,
677,
380,
998,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
result = self.main.dbus_action.do_message(users , | result = self.main.dbus_action.do_message(newusernames , | def menu_event_one(self, action): start1=time() (model, iter) = self.main.tabla.get_selection().get_selected() if iter == None: print_debug( "menu_event_one() not selected thin client !!!" ) return self.main.selected_host=model.get_value(iter,COL_HOST) self.main.selected_ip=model.get_value(iter, COL_IP) if not self.doaction_onthisclient(action, self.main.selected_ip): # show a msg shared.info_msg ( _("Can't exec this action because you are connected at this host!") ) return if action == 0: # refresh terminal # call to read remote info self.main.xmlrpc.newhost(self.main.selected_ip) self.main.xmlrpc.ip=self.main.selected_ip self.main.worker=shared.Workers( self.main,\ target=self.populate_datatxt, args=([self.main.selected_ip]) ).start() if action == 1: # clean datatxtbuffer self.main.datatxt.clean() if action == 2: # Ask for reboot reboot ip=self.main.selected_ip msg=_( _("Do you want to reboot %s?" ) %(self.main.selected_ip) ) if shared.ask_msg ( msg ): self.main.xmlrpc.Exe("reboot") if action == 3: # Ask for poweroff reboot msg=_( _("Do you want to poweroff %s?" ) %(self.main.selected_ip) ) if shared.ask_msg ( msg ): self.main.xmlrpc.Exe("poweroff") if action == 4: # lock screen if not self.main.xmlrpc.lockscreen(): shared.error_msg( _("Can't connect to tcosxmlrpc.\nPlease verify user and password in prefences!") ) return self.change_lockscreen(self.main.selected_ip) if action == 5: # unlock screen if not self.main.xmlrpc.unlockscreen(): shared.error_msg( _("Can't connect to tcosxmlrpc.\nPlease verify user and password in prefences!") ) return self.change_lockscreen(self.main.selected_ip) if action == 6: # start ivs self.main.worker=shared.Workers(self.main, target=self.start_ivs, args=([self.main.selected_ip]) ) self.main.worker.start() if action == 7: # start vnc self.main.worker=shared.Workers(self.main, target=self.start_vnc, args=([self.main.selected_ip]) ) self.main.worker.start() if action == 8: # screenshot !!! self.main.worker=shared.Workers(self.main, target=self.get_screenshot, args=[self.main.selected_ip]) self.main.worker.start() if action == 9: # give a remote xterm throught SSH pass_msg=_("Enter password of remote thin client (if asked for it)") cmd="xterm -e \"echo '%s'; ssh root@%s\"" %(pass_msg, self.main.selected_ip) print_debug ( "menu_event_one(%d) cmd=%s" %(action, cmd) ) th=self.main.exe_cmd( cmd ) if action == 10: # launch personalize settings if client is TCOS (PXES and LTSP not supported) client_type = self.main.xmlrpc.ReadInfo("get_client") if client_type == "tcos": cmd="gksu \"tcospersonalize --host=%s\"" %(self.main.selected_ip) print_debug ( "menu_event_one(%d) cmd=%s" %(action, cmd) ) th=self.main.exe_cmd( cmd ) else: shared.info_msg( _("%s is not supported to personalize!") %(client_type) ) if action == 11: # reset xorg # Ask for it if not self.main.localdata.IsLogged(self.main.selected_ip): shared.error_msg ( _("Can't logout, user is not logged") ) return user=self.main.localdata.GetUsernameAndHost(self.main.selected_ip) print_debug("menu_event_one() user=%s" %user) msg=_( _("Do you want to logout user \"%s\"?" ) %(user) ) if shared.ask_msg ( msg ): newusernames=[] remote_cmd="/usr/lib/tcos/session-cmd-send LOGOUT" if user.find(":") != -1: # we have a standalone user... usern, ip = user.split(":") self.main.xmlrpc.newhost(ip) self.main.xmlrpc.DBus("exec", remote_cmd ) else: newusernames.append(user) result = self.main.dbus_action.do_exec(newusernames ,remote_cmd ) if not result: shared.error_msg ( _("Error while exec remote app:\nReason:%s") %( self.main.dbus_action.get_error_msg() ) ) if action == 12: # restart xorg with new settings # thin client must download again XXX.XXX.XXX.XXX.conf and rebuild xorg.conf client_type = self.main.xmlrpc.ReadInfo("get_client") if client_type == "tcos": msg=_( "Restart X session of %s with new config?" ) %(self.main.selected_ip) if shared.ask_msg ( msg ): # see xmlrpc/xorg.h, rebuild will download and sed xorg.conf.tpl self.main.xmlrpc.tc.tcos.xorg("rebuild", "--restartxorg", \ self.main.xmlrpc.username, \ self.main.xmlrpc.password ) self.refresh_client_info(self.main.selected_ip) else: shared.info_msg( _("%s is not supported to restart Xorg!") %(client_type) ) if action == 13: # exec app self.askfor(mode="exec", users=[self.main.localdata.GetUsernameAndHost(self.main.selected_ip)]) if action == 14: # send message self.askfor(mode="mess", users=[self.main.localdata.GetUsernameAndHost(self.main.selected_ip)] ) if action == 15: print_debug ("menu_event_one() show running apps" ) self.get_user_processes(self.main.selected_ip) if action == 16: # action sent by vidal_joshur at gva dot es # start video broadcast mode # search for connected users users=[self.main.localdata.GetUsernameAndHost(self.main.selected_ip)] client=[self.main.selected_ip] dialog = gtk.FileChooserDialog(_("Select audio/video file.."), None, gtk.FILE_CHOOSER_ACTION_OPEN, (_("Play DVD"), 1, _("Play SVCD/VCD"), 2, _("Play AudioCD"), 3, gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OPEN, gtk.RESPONSE_OK)) dialog.set_default_response(gtk.RESPONSE_OK) self.folder = self._folder = os.environ['HOME'] dialog.set_current_folder(self.folder) filter = gtk.FileFilter() filter.set_name("Media Files ( *.avi, *.mpg, *.mpeg, *.mp3, *.wav, etc.. )") file_types=["*.avi", "*.mpg", "*.mpeg", "*.ogg", "*.ogm", "*.asf", "*.divx", "*.wmv", "*.vob", "*.m2v", "*.m4v", "*.mp2", "*.mp4", "*.ac3", "*.ogg", "*.mp1", "*.mp2", "*.mp3", "*.wav", "*.wma"] for elem in file_types: filter.add_pattern( elem ) dialog.add_filter(filter) filter = gtk.FileFilter() filter.set_name("All Files") filter.add_pattern("*.*") dialog.add_filter(filter) | 53a3eea66bbc168c70ea325ef8439de22d83ed8b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13520/53a3eea66bbc168c70ea325ef8439de22d83ed8b/TcosActions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3824,
67,
2575,
67,
476,
12,
2890,
16,
1301,
4672,
787,
21,
33,
957,
1435,
261,
2284,
16,
1400,
13,
273,
365,
18,
5254,
18,
7032,
11821,
18,
588,
67,
10705,
7675,
588,
67,
8109,
1435... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3824,
67,
2575,
67,
476,
12,
2890,
16,
1301,
4672,
787,
21,
33,
957,
1435,
261,
2284,
16,
1400,
13,
273,
365,
18,
5254,
18,
7032,
11821,
18,
588,
67,
10705,
7675,
588,
67,
8109,
1435... |
marker = '@' | marker = '@@' | def replaceLanguageLinks(oldtext, new, site = None): """Replace the interwiki language links given in the wikitext given in oldtext by the new links given in new. 'new' should be a dictionary with the language names as keys, and Page objects as values. """ # Find a marker that is not already in the text. We assume nobody puts '@' # immediately before AND immediately after an interwiki link marker = '@' while marker in oldtext: marker += '@' if site == None: site = getSite() s = interwikiFormat(new, insite = site) s2 = removeLanguageLinks(oldtext, site = site, marker = marker) if s: if site.language() in site.family.interwiki_attop: newtext = s + site.family.interwiki_text_separator + s2.replace(marker,'') else: # calculate what was after the language links on the page firstafter = s2.find(marker) + len(marker) # Is there any text in the 'after' part that means we should keep it after? if "</noinclude>" in s2[firstafter:]: newtext = s2[:firstafter] + s + s2[firstafter:] elif site.language() in site.family.categories_last: cats = getCategoryLinks(s2, site = site) s2 = removeCategoryLinks(s2, site) + site.family.interwiki_text_separator + s newtext = replaceCategoryLinks(s2, cats, site=site) else: newtext = s2 + site.family.interwiki_text_separator + s newtext = newtext.replace(marker,'') else: newtext = s2.replace(marker,'') return newtext | f9c80ef99f35a24fb3c47761699987c6879700b2 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/f9c80ef99f35a24fb3c47761699987c6879700b2/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1453,
3779,
7100,
12,
1673,
955,
16,
394,
16,
2834,
273,
599,
4672,
3536,
5729,
326,
1554,
13044,
2653,
4716,
864,
316,
326,
341,
1766,
305,
408,
864,
316,
1592,
955,
635,
326,
394,
47... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1453,
3779,
7100,
12,
1673,
955,
16,
394,
16,
2834,
273,
599,
4672,
3536,
5729,
326,
1554,
13044,
2653,
4716,
864,
316,
326,
341,
1766,
305,
408,
864,
316,
1592,
955,
635,
326,
394,
47... |
def _email_send(message, openobject_id=None, debug=False): | def _email_send(smtp_from, smtp_to_list, message, openobject_id=None, ssl=False, debug=False): | def _email_send(message, openobject_id=None, debug=False): """Low-level method to send directly a Message through the configured smtp server. :param message: an email.message.Message to send :param debug: True if messages should be output to stderr before being sent, and smtplib.SMTP put into debug mode. :return: True if the mail was delivered successfully to the smtp, else False (+ exception logged) """ if openobject_id: message['Message-Id'] = "<%s-openobject-%s@%s>" % (time.time(), openobject_id, socket.gethostname()) try: oldstderr = smtplib.stderr s = smtplib.SMTP() try: # in case of debug, the messages are printed to stderr. if debug: smtplib.stderr = WriteToLogger() s.set_debuglevel(int(bool(debug))) # 0 or 1 s.connect(smtp_server, config['smtp_port']) if ssl: s.ehlo() s.starttls() s.ehlo() if config['smtp_user'] or config['smtp_password']: s.login(config['smtp_user'], config['smtp_password']) s.sendmail(email_from, flatten([email_to, email_cc, email_bcc]), message.as_string()) finally: s.quit() if debug: smtplib.stderr = oldstderr except Exception, e: _logger.error('could not deliver email', exc_info=True) return False return True | 3d8d4a173b87927fdf5ffb9de8e423ad1b1599b5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/3d8d4a173b87927fdf5ffb9de8e423ad1b1599b5/misc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3652,
67,
4661,
12,
20278,
67,
2080,
16,
17660,
67,
869,
67,
1098,
16,
883,
16,
1696,
1612,
67,
350,
33,
7036,
16,
5832,
33,
8381,
16,
1198,
33,
8381,
4672,
3536,
10520,
17,
281... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3652,
67,
4661,
12,
20278,
67,
2080,
16,
17660,
67,
869,
67,
1098,
16,
883,
16,
1696,
1612,
67,
350,
33,
7036,
16,
5832,
33,
8381,
16,
1198,
33,
8381,
4672,
3536,
10520,
17,
281... |
syslog(LOG_INFO, "File %s changed" % event.filename) | syslog(LOG_INFO, "Cfg: File %s changed" % event.filename) | def HandleEvent(self, event): '''Handle FAM updates''' action = event.code2str() if event.filename[-5:] == ':info': return self.read_info(event.filename) for entry in self.basefiles + self.deltas: if entry.name.split('/')[-1] == event.filename: if action == 'changed': syslog(LOG_INFO, "File %s changed" % event.filename) entry.HandleEvent(event) elif action == 'deleted': [flist.remove(entry) for flist in [self.basefiles, self.deltas] if entry in flist] else: syslog(LOG_ERR, "Cfg: Unhandled Action %s for file %s" % (action, event.filename)) | d95d4eea0cb84903bf9b68fe0f5821bfe5d4a183 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11867/d95d4eea0cb84903bf9b68fe0f5821bfe5d4a183/Cfg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5004,
1133,
12,
2890,
16,
871,
4672,
9163,
3259,
478,
2192,
4533,
26418,
1301,
273,
871,
18,
710,
22,
701,
1435,
309,
871,
18,
3459,
18919,
25,
26894,
422,
4290,
1376,
4278,
327,
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,
5004,
1133,
12,
2890,
16,
871,
4672,
9163,
3259,
478,
2192,
4533,
26418,
1301,
273,
871,
18,
710,
22,
701,
1435,
309,
871,
18,
3459,
18919,
25,
26894,
422,
4290,
1376,
4278,
327,
365,
... |
MOCK run_and_throw_if_fail: ['WebKitTools/Scripts/run-webkit-tests', '--no-launch-safari', '--exit-after-n-failures=1', '--ignore-tests', 'compositing/iframes', '--quiet'] | MOCK run_and_throw_if_fail: ['WebKitTools/Scripts/run-webkit-tests', '--no-launch-safari', '--exit-after-n-failures=1', '--ignore-tests', 'compositing', '--quiet'] | def test_runtests_leopard_commit_queue_hack(self): mock_options = Mock() mock_options.non_interactive = True step = RunTests(MockTool(log_executive=True), mock_options) # FIXME: We shouldn't use a real port-object here, but there is too much to mock at the moment. mock_port = WebKitPort() mock_port.name = lambda: "Mac" mock_port.is_leopard = lambda: True step.port = lambda: mock_port expected_stderr = """Running Python unit tests | 4c272bd23a643f41ccc5bf730d661f8eb073eb51 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/4c272bd23a643f41ccc5bf730d661f8eb073eb51/steps_unittest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2681,
16341,
67,
298,
556,
1060,
67,
7371,
67,
4000,
67,
76,
484,
12,
2890,
4672,
5416,
67,
2116,
273,
7867,
1435,
5416,
67,
2116,
18,
5836,
67,
24761,
273,
1053,
2235,
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,
1842,
67,
2681,
16341,
67,
298,
556,
1060,
67,
7371,
67,
4000,
67,
76,
484,
12,
2890,
4672,
5416,
67,
2116,
273,
7867,
1435,
5416,
67,
2116,
18,
5836,
67,
24761,
273,
1053,
2235,
273,
... |
{"key": "subject:love", "url": "/subjects/love", "name": "Love", "count": 4}, {"key": "place:san_francisco", "url": "/subjects/place:san_francisco", "name": "San Francisco", "count": 3} | {"key": "subject:love", "url": "/subjects/love", "name": "Love", "title": "Love", "count": 4}, {"key": "place:san_francisco", "url": "/subjects/place:san_francisco", "name": "San Francisco", "title": "San Francisco", "count": 3} | def test_simple(self): doc1 = { "_id": "/works/OL1W", "editions": 10, "works": 1, "ebooks": 2, "subjects": [ {"key": "subject:love", "name": "Love", "count": 2} ] } | ebb0b86f96814ef918bb51e9ea72ac2b92055f5c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3913/ebb0b86f96814ef918bb51e9ea72ac2b92055f5c/test_model.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9647,
12,
2890,
4672,
997,
21,
273,
288,
4192,
350,
6877,
2206,
18597,
19,
1741,
21,
59,
3113,
315,
329,
5029,
6877,
1728,
16,
315,
18597,
6877,
404,
16,
315,
73,
12567,
6877... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
2890,
4672,
997,
21,
273,
288,
4192,
350,
6877,
2206,
18597,
19,
1741,
21,
59,
3113,
315,
329,
5029,
6877,
1728,
16,
315,
18597,
6877,
404,
16,
315,
73,
12567,
6877... |
vf = npy.vdot(self.v, f) | vf = npy.vdot(f,self.v) | def step(self,f): | 20cf7fcea498d3b3d2b04a93b381f1e6d6ef8dac /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5735/20cf7fcea498d3b3d2b04a93b381f1e6d6ef8dac/fire.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2235,
12,
2890,
16,
74,
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,
2235,
12,
2890,
16,
74,
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 numpy.allclose(L3, 0.0) or type(L3)==complex: | if numpy.allclose(L3, 0.0) or type(L3)==numpy.complex_: | def calc_itls_center_of_reaction(iT, iL, iS, origin): """iT is a single float; iL[3,3]; iS[3] """ ## construct TLS tensors from isotropic TLS description T0 = numpy.array([[iT, 0.0, 0.0], [0.0, iT, 0.0], [0.0, 0.0, iT]], float) L0 = iL.copy() S0 = numpy.array([ [ 0.0, 0.0, iS[1]], [iS[0], 0.0, 0.0], [ 0.0, iS[2], 0.0] ], float) ## LSMALL is the smallest magnitude of L before it is considered 0.0 LSMALL = 0.5 * Constants.DEG2RAD2 rdict = {} rdict["T'"] = T0.copy() rdict["L'"] = L0.copy() rdict["S'"] = S0.copy() rdict["rT'"] = T0.copy() rdict["L1_eigen_val"] = 0.0 rdict["L2_eigen_val"] = 0.0 rdict["L3_eigen_val"] = 0.0 rdict["L1_rmsd"] = 0.0 rdict["L2_rmsd"] = 0.0 rdict["L3_rmsd"] = 0.0 rdict["L1_eigen_vec"] = numpy.zeros(3, float) rdict["L2_eigen_vec"] = numpy.zeros(3, float) rdict["L3_eigen_vec"] = numpy.zeros(3, float) rdict["RHO"] = numpy.zeros(3, float) rdict["COR"] = origin rdict["L1_rho"] = numpy.zeros(3, float) rdict["L2_rho"] = numpy.zeros(3, float) rdict["L3_rho"] = numpy.zeros(3, float) rdict["L1_pitch"] = 0.0 rdict["L2_pitch"] = 0.0 rdict["L3_pitch"] = 0.0 rdict["Tr1_eigen_val"] = 0.0 rdict["Tr2_eigen_val"] = 0.0 rdict["Tr3_eigen_val"] = 0.0 rdict["Tr1_rmsd"] = 0.0 rdict["Tr2_rmsd"] = 0.0 rdict["Tr3_rmsd"] = 0.0 ## set the L tensor eigenvalues and eigenvectors (L_evals, RL) = numpy.linalg.eigenvectors(L0) L1, L2, L3 = L_evals good_L_eigens = [] if numpy.allclose(L1, 0.0) or type(L1)==complex: L1 = 0.0 else: good_L_eigens.append(0) if numpy.allclose(L2, 0.0) or type(L2)==complex: L2 = 0.0 else: good_L_eigens.append(1) if numpy.allclose(L3, 0.0) or type(L3)==complex: L3 = 0.0 else: good_L_eigens.append(2) ## no good L eigen values if len(good_L_eigens)==0: Tr1, Tr2, Tr3 = numpy.linalg.eigenvalues(T0) if numpy.allclose(Tr1, 0.0) or type(Tr1)==complex: Tr1 = 0.0 if numpy.allclose(Tr2, 0.0) or type(Tr2)==complex: Tr2 = 0.0 if numpy.allclose(Tr3, 0.0) or type(Tr3)==complex: Tr3 = 0.0 rdict["Tr1_eigen_val"] = Tr1 rdict["Tr2_eigen_val"] = Tr2 rdict["Tr3_eigen_val"] = Tr3 rdict["Tr1_rmsd"] = calc_rmsd(Tr1) rdict["Tr2_rmsd"] = calc_rmsd(Tr2) rdict["Tr3_rmsd"] = calc_rmsd(Tr3) return rdict ## one good eigen value -- reconstruct RL about it elif len(good_L_eigens)==1: i = good_L_eigens[0] evec = RL[i] RZt = numpy.transpose(AtomMath.rmatrixz(evec)) xevec = numpy.matrixmultiply(RZt, numpy.array([1.0, 0.0, 0.0], float)) yevec = numpy.matrixmultiply(RZt, numpy.array([0.0, 1.0, 0.0], float)) if i==0: RL[1] = xevec RL[2] = yevec elif i==1: RL[0] = xevec RL[2] = yevec elif i==2: RL[0] = xevec RL[1] = yevec ## two good eigen values -- reconstruct RL about them elif len(good_L_eigens)==2: i = good_L_eigens[0] j = good_L_eigens[1] xevec = AtomMath.normalize(numpy.cross(RL[i], RL[j])) for k in range(3): if k==i: continue if k==j: continue RL[k] = xevec break rdict["L1_eigen_val"] = L1 rdict["L2_eigen_val"] = L2 rdict["L3_eigen_val"] = L3 rdict["L1_rmsd"] = calc_rmsd(L1) rdict["L2_rmsd"] = calc_rmsd(L2) rdict["L3_rmsd"] = calc_rmsd(L3) rdict["L1_eigen_vec"] = RL[0].copy() rdict["L2_eigen_vec"] = RL[1].copy() rdict["L3_eigen_vec"] = RL[2].copy() ## begin tensor transformations which depend upon ## the eigenvectors of L0 being well-determined ## make sure RLt is right-handed if numpy.allclose(numpy.linalg.determinant(RL), -1.0): I = numpy.identity(3, float) I[0,0] = -1.0 RL = numpy.matrixmultiply(I, RL) if not numpy.allclose(numpy.linalg.determinant(RL), 1.0): return rdict RLt = numpy.transpose(RL) ## carrot-L tensor (tensor WRT principal axes of L) cL = numpy.matrixmultiply(numpy.matrixmultiply(RL, L0), RLt) ## carrot-T tensor (T tensor WRT principal axes of L) cT = numpy.matrixmultiply(numpy.matrixmultiply(RL, T0), RLt) ## carrot-S tensor (S tensor WRT principal axes of L) cS = numpy.matrixmultiply(numpy.matrixmultiply(RL, S0), RLt) ## ^rho: the origin-shift vector in the coordinate system of L L23 = L2 + L3 L13 = L1 + L3 L12 = L1 + L2 ## shift for L1 if not numpy.allclose(L1, 0.0) and abs(L23)>LSMALL: crho1 = (cS[1,2] - cS[2,1]) / L23 else: crho1 = 0.0 if not numpy.allclose(L2, 0.0) and abs(L13)>LSMALL: crho2 = (cS[2,0] - cS[0,2]) / L13 else: crho2 = 0.0 if not numpy.allclose(L3, 0.0) and abs(L12)>LSMALL: crho3 = (cS[0,1] - cS[1,0]) / L12 else: crho3 = 0.0 crho = numpy.array([crho1, crho2, crho3], float) ## rho: the origin-shift vector in orthogonal coordinates rho = numpy.matrixmultiply(RLt, crho) rdict["RHO"] = rho rdict["COR"] = origin + rho ## set up the origin shift matrix PRHO WRT orthogonal axes PRHO = numpy.array([ [ 0.0, rho[2], -rho[1]], [-rho[2], 0.0, rho[0]], [ rho[1], -rho[0], 0.0] ], float) ## set up the origin shift matrix cPRHO WRT libration axes cPRHO = numpy.array([ [ 0.0, crho[2], -crho[1]], [-crho[2], 0.0, crho[0]], [ crho[1], -crho[0], 0.0] ], float) ## calculate tranpose of cPRHO, ans cS cSt = numpy.transpose(cS) cPRHOt = numpy.transpose(cPRHO) ## calculate S'^ = S^ + L^*pRHOt cSp = cS + numpy.matrixmultiply(cL, cPRHOt) ## calculate T'^ = cT + cPRHO*S^ + cSt*cPRHOt + cPRHO*cL*cPRHOt * cTp = cT + numpy.matrixmultiply(cPRHO, cS) + numpy.matrixmultiply(cSt, cPRHOt) + \ numpy.matrixmultiply(numpy.matrixmultiply(cPRHO, cL), cPRHOt) ## transpose of PRHO and S PRHOt = numpy.transpose(PRHO) St = numpy.transpose(S0) ## calculate S' = S + L*PRHOt Sp = S0 + numpy.matrixmultiply(L0, PRHOt) rdict["S'"] = Sp ## calculate T' = T + PRHO*S + St*PRHOT + PRHO*L*PRHOt Tp = T0 + numpy.matrixmultiply(PRHO, S0) + numpy.matrixmultiply(St, PRHOt) + \ numpy.matrixmultiply(numpy.matrixmultiply(PRHO, L0), PRHOt) rdict["T'"] = Tp ## now calculate the TLS motion description using 3 non ## intersecting screw axes, with one ## libration axis 1 shift in the L coordinate system ## you cannot determine axis shifts from the isotropic TLS parameters cL1rho = numpy.zeros(3, float) cL2rho = numpy.zeros(3, float) cL3rho = numpy.zeros(3, float) ## libration axes shifts in the origional orthogonal ## coordinate system rdict["L1_rho"] = numpy.matrixmultiply(RLt, cL1rho) rdict["L2_rho"] = numpy.matrixmultiply(RLt, cL2rho) rdict["L3_rho"] = numpy.matrixmultiply(RLt, cL3rho) ## calculate screw pitches (A*R / R*R) = (A/R) ## no screw pitches either rdict["L1_pitch"] = 0.0 rdict["L2_pitch"] = 0.0 rdict["L3_pitch"] = 0.0 ## rotate the newly calculated reduced-T tensor from the carrot ## coordinate system (coordinate system of L) back to the structure ## coordinate system Tiso = numpy.trace(Tp) / 3.0 rdict["rT'"] = Tiso * numpy.identity(3, float) rdict["Tr1_eigen_val"] = Tiso rdict["Tr2_eigen_val"] = Tiso rdict["Tr3_eigen_val"] = Tiso rdict["Tr1_rmsd"] = calc_rmsd(Tiso) rdict["Tr2_rmsd"] = calc_rmsd(Tiso) rdict["Tr3_rmsd"] = calc_rmsd(Tiso) return rdict | 56f30da138626c8c6f397e7d28b00e0126c279a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10674/56f30da138626c8c6f397e7d28b00e0126c279a7/TLS.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7029,
67,
305,
3251,
67,
5693,
67,
792,
67,
266,
1128,
12,
77,
56,
16,
277,
48,
16,
277,
55,
16,
4026,
4672,
3536,
77,
56,
353,
279,
2202,
1431,
31,
277,
48,
63,
23,
16,
23,
1553... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7029,
67,
305,
3251,
67,
5693,
67,
792,
67,
266,
1128,
12,
77,
56,
16,
277,
48,
16,
277,
55,
16,
4026,
4672,
3536,
77,
56,
353,
279,
2202,
1431,
31,
277,
48,
63,
23,
16,
23,
1553... |
'from 'where m._Marker_key = r._Marker_key ' + \ 'and r._Refs_key = b._Refs_key') cmds.append('create nonclustered index index_refs_key on | 'from 'where r._Refs_key = b._Refs_key') cmds.append('create index index_refs_key on | def writeRecordD(fp, r): fp.write(r['jnumID'] + TAB) if pubMedIDs.has_key(r['_Refs_key']): purl = regsub.gsub('@@@@', pubMedIDs[r['_Refs_key']], url) fp.write('<A HREF="%s">%s</A>' % (purl, pubMedIDs[r['_Refs_key']])) fp.write(TAB) if r['_Refs_key'] in gxd: fp.write('Y' + TAB) else: fp.write('N' + TAB) fp.write(r['mgiID'] + TAB + \ r['symbol'] + TAB + \ r['name'] + CRT) | 14d44534de3f5b85347a2d8c4a92c92ddfccf0b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/340/14d44534de3f5b85347a2d8c4a92c92ddfccf0b7/MRK_GOIEA.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
2115,
40,
12,
7944,
16,
436,
4672,
225,
4253,
18,
2626,
12,
86,
3292,
78,
2107,
734,
3546,
397,
26158,
13,
225,
309,
5634,
13265,
5103,
18,
5332,
67,
856,
12,
86,
3292,
67,
983... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
2115,
40,
12,
7944,
16,
436,
4672,
225,
4253,
18,
2626,
12,
86,
3292,
78,
2107,
734,
3546,
397,
26158,
13,
225,
309,
5634,
13265,
5103,
18,
5332,
67,
856,
12,
86,
3292,
67,
983... |
if os.path.exists(program): | if os.path.exists(program) or os.path.exists(program + '.exe'): | def minimize(self): #bruce 041215 fixed some bugs and changed some error messages # in the case when the simulator executable is not found. # Bugs included uncaught exception (rather than error message) # which could also fail to restore the current working directory. from debug import print_compact_traceback ## bruce 041101 removed this since it's immediately overwritten below: ## self.win.statusBar.message( "Minimizing...") QApplication.setOverrideCursor( QCursor(Qt.WaitCursor) ) # hourglass s = ""; args = ['bugifseen']; r = program = 'bugifseen' try: self.win.statusBar.message("Calculating...") import os, sys filePath = os.path.dirname(os.path.abspath(sys.argv[0])) tmpFilePath = self.win.tmpFilePath writemmp(self.assy, os.path.join(tmpFilePath, "minimize.mmp")) #Huaicai 12/07/04, if path name for "minimize.mmp" has space, # spawnv() has problems on Windows, so changing working directory to it oldWorkingDir = os.getcwd() program = os.path.normpath(filePath + '/../bin/simulator') args = [program, '-m ', "minimize.mmp"] if os.path.exists(program): try: os.chdir(tmpFilePath) r = os.spawnv(os.P_WAIT, program, args) finally: os.chdir(oldWorkingDir) else: r = 'program not found' s = "simulator not found at %r; installation error?" % program except: print_compact_traceback("exception in minimize; continuing: ") print "note: spawnv args were %r" % (args,) s = "internal error (traceback printed elsewhere)" r = -1 # simulate failure QApplication.restoreOverrideCursor() # Restore the cursor if not r: self.win.statusBar.message("Minimizing...") self.startmovie(os.path.join(tmpFilePath, "minimize.dpb")) else: if not s: s = "exit code %r" % r print "Minimization Failed:", s print "note: spawnv args were %r" % (args,) print " in the temporary working directory %r" % (tmpFilePath,) self.win.statusBar.message("Minimization Failed!") ##e include s? QMessageBox.warning(self, "Minimization Failed:", s) return | 06ea390a1b2d26c20ef47e3a844061a6b709d67e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/06ea390a1b2d26c20ef47e3a844061a6b709d67e/GLPane.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18935,
12,
2890,
4672,
468,
2848,
3965,
16486,
2138,
3600,
5499,
2690,
22398,
471,
3550,
2690,
555,
2743,
468,
316,
326,
648,
1347,
326,
3142,
11775,
9070,
353,
486,
1392,
18,
468,
605,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18935,
12,
2890,
4672,
468,
2848,
3965,
16486,
2138,
3600,
5499,
2690,
22398,
471,
3550,
2690,
555,
2743,
468,
316,
326,
648,
1347,
326,
3142,
11775,
9070,
353,
486,
1392,
18,
468,
605,
... |
handler.parent = self | handler.parent = container | def set_handler(self, path, handler, **kw): if not isinstance(path, uri.Path): path = uri.Path(path) | 9d70f5fd556e50c9911c8c0b10abdc795233e5d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/9d70f5fd556e50c9911c8c0b10abdc795233e5d1/Folder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
4176,
12,
2890,
16,
589,
16,
1838,
16,
2826,
9987,
4672,
309,
486,
1549,
12,
803,
16,
2003,
18,
743,
4672,
589,
273,
2003,
18,
743,
12,
803,
13,
2,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
444,
67,
4176,
12,
2890,
16,
589,
16,
1838,
16,
2826,
9987,
4672,
309,
486,
1549,
12,
803,
16,
2003,
18,
743,
4672,
589,
273,
2003,
18,
743,
12,
803,
13,
2,
-100,
-100,
-100,
-100,
... |
" '%s': %s" % (dir_name, err)) | " '%s': %s" % (dir_name, err)) | def EnsureDirs(dirs): """Make required directories, if they don't exist. @param dirs: list of tuples (dir_name, dir_mode) @type dirs: list of (string, integer) """ for dir_name, dir_mode in dirs: try: os.mkdir(dir_name, mode) except EnvironmentError, err: if err.errno != errno.EEXIST: raise errors.GenericError("Cannot create needed directory" " '%s': %s" % (dir_name, err)) if not os.path.isdir(dir_name): raise errors.GenericError("%s is not a directory" % dir_name) | 1b2c8f853bb444e0bdff3e33f685362860204bec /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7542/1b2c8f853bb444e0bdff3e33f685362860204bec/utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7693,
9872,
12,
8291,
4672,
3536,
6464,
1931,
6402,
16,
309,
2898,
2727,
1404,
1005,
18,
225,
632,
891,
7717,
30,
666,
434,
10384,
261,
1214,
67,
529,
16,
1577,
67,
3188,
13,
632,
723,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7693,
9872,
12,
8291,
4672,
3536,
6464,
1931,
6402,
16,
309,
2898,
2727,
1404,
1005,
18,
225,
632,
891,
7717,
30,
666,
434,
10384,
261,
1214,
67,
529,
16,
1577,
67,
3188,
13,
632,
723,... |
button = UpdatedButton(top, text ="Create new style", command = self.CreateStyleFromSelection, | button = UpdatedButton(top, text =_("Create new style"), command = self.CreateStyleFromSelection, | def build_dlg(self): root = self.top | 82de312c345da93ba609089ae29cdfe484d465ca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3123/82de312c345da93ba609089ae29cdfe484d465ca/styledlg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
5761,
75,
12,
2890,
4672,
1365,
273,
365,
18,
3669,
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... | [
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,
1361,
67,
5761,
75,
12,
2890,
4672,
1365,
273,
365,
18,
3669,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
if il<=p["var1"]<=sl and p["var2"]==True] | if il<=p["var1"]<=sl] | def test13f(self): """Checking repeated queries, with different limits.""" | 69d2d64c29e4a988f74981326eae5c0cd99c6293 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12687/69d2d64c29e4a988f74981326eae5c0cd99c6293/test_indexvalues.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
3437,
74,
12,
2890,
4672,
3536,
14294,
12533,
6218,
16,
598,
3775,
8181,
12123,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
3437,
74,
12,
2890,
4672,
3536,
14294,
12533,
6218,
16,
598,
3775,
8181,
12123,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
result.Append(CXXFLAGS='/EHsc /W3 /MDd /wd4099 /wd4244 /wd4800 /wd4996 /wd4251 /wd4661') | if result['OPENSCENEGRAPH_DEBUG']: result.Append(CXXFLAGS='/EHsc /W3 /MDd /wd4099 /wd4244 /wd4800 /wd4996 /wd4251 /wd4661') else: result.Append(CXXFLAGS='/EHsc /W3 /MD /wd4099 /wd4244 /wd4800 /wd4996 /wd4251 /wd4661') | def _build_environment(): result = scons.Environment(options = options) result.Tool('subst', toolpath = [os.path.dirname(__file__)+'/tools']) | 3a08761ffa1c029f184589495c3459f938fa92de /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8421/3a08761ffa1c029f184589495c3459f938fa92de/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3510,
67,
10274,
13332,
563,
273,
272,
8559,
18,
5494,
12,
2116,
273,
702,
13,
563,
18,
6364,
2668,
1717,
334,
2187,
5226,
803,
273,
306,
538,
18,
803,
18,
12287,
12,
972,
768,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3510,
67,
10274,
13332,
563,
273,
272,
8559,
18,
5494,
12,
2116,
273,
702,
13,
563,
18,
6364,
2668,
1717,
334,
2187,
5226,
803,
273,
306,
538,
18,
803,
18,
12287,
12,
972,
768,
... |
print ' $ mv %s %s' % (f,join(backup_folder,name)) | call('mv %s %s' % (f,join(backup_folder,name)),fake=debug) | def backup_affected_assets(cfg_folder, backup_folder): "Backup files that would be overwritten by config tracking into backup folder" files = local_assets(os.listdir(cfg_folder),lambda x: True) for f in files: if os.path.exists(f): name = os.path.split(f)[1] print ' $ mv %s %s' % (f,join(backup_folder,name)) | 3bee57ba2e7f0bcf4a04894f8e896e4bc837bc07 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14333/3bee57ba2e7f0bcf4a04894f8e896e4bc837bc07/install.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5114,
67,
20119,
67,
9971,
12,
7066,
67,
5609,
16,
5114,
67,
5609,
4672,
315,
6248,
1390,
716,
4102,
506,
15345,
635,
642,
11093,
1368,
5114,
3009,
6,
1390,
273,
1191,
67,
9971,
12,
53... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5114,
67,
20119,
67,
9971,
12,
7066,
67,
5609,
16,
5114,
67,
5609,
4672,
315,
6248,
1390,
716,
4102,
506,
15345,
635,
642,
11093,
1368,
5114,
3009,
6,
1390,
273,
1191,
67,
9971,
12,
53... |
self.date = date | self.timestamp = timestamp | def __init__(self, date, open, high, low, close, volume): """ Summary stats for a day that a stock traded. | 5ba1a4a9510fd2da6a56209f764593aa64c92d20 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/5ba1a4a9510fd2da6a56209f764593aa64c92d20/stock.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1509,
16,
1696,
16,
3551,
16,
4587,
16,
1746,
16,
3940,
4672,
3536,
17967,
3177,
364,
279,
2548,
716,
279,
12480,
1284,
785,
18,
2,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1509,
16,
1696,
16,
3551,
16,
4587,
16,
1746,
16,
3940,
4672,
3536,
17967,
3177,
364,
279,
2548,
716,
279,
12480,
1284,
785,
18,
2,
-100,
-100,
-100,
-10... |
w.icon = self.request.get('icon') | w.icon = str(self.request.get('icon')) | def post(self): w = Word() w.icon = self.request.get('icon') w.description = self.request.get('description') w.definition = self.request.get('definition') w.author = self.request.remote_addr w.total_users = 0 w.outbound_users = 1 w.put() self.redirect('/read/%s' % str(w.key())) | d17d4bb3d5c2635e0f5dba260c931e3eb16a9e5c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3507/d17d4bb3d5c2635e0f5dba260c931e3eb16a9e5c/iconforth.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1603,
12,
2890,
4672,
341,
273,
9926,
1435,
341,
18,
3950,
273,
609,
12,
2890,
18,
2293,
18,
588,
2668,
3950,
26112,
341,
18,
3384,
273,
365,
18,
2293,
18,
588,
2668,
3384,
6134,
341,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
341,
273,
9926,
1435,
341,
18,
3950,
273,
609,
12,
2890,
18,
2293,
18,
588,
2668,
3950,
26112,
341,
18,
3384,
273,
365,
18,
2293,
18,
588,
2668,
3384,
6134,
341,
... |
(triggerIntegratedPower-meanPixelPower)/ | (brightPixel[4]-meanPixelPower)/ | def createGlitchDatabase(self,verbose=bool(False)): """ Commands to build either a structure which can be graphed selectively or to create a database for use with auto-glitch classification pipeline. There is a companion summary for this method. If one wants to hand cut the summary you can excise the triggers from the output summary from original entire database for graphing the triggers. Symmetry weights -- Z scores replace this field! """ weight=1 glitchDatabase=[] spinner=progressSpinner(verbose,2) spinner.setTag('GlitchDB ') for trigger in self.curves: spinner.updateSpinner() triggerStartString=trigger.startGPS().__diskPrint__() triggerStartFloat=trigger.startGPS().getAsFloat() triggerStopFloat=trigger.stopGPS().getAsFloat() triggerBandwidth,triggerLowF,triggerHighF=trigger.getCandidateBandwidth(bool(True)) triggerID,triggerLength,triggerIntegratedPower=trigger.getKurveHeader() brightPixel=trigger.getBrightPixel() cmPixel=trigger.getBrightPixel() meanPixelPower,varPixelPower=trigger.__getKurveMeanVar__() triggerCentralFreq=triggerLowF+(triggerHighF-triggerLowF)/2 triggerDuration=triggerStopFloat-triggerStartFloat triggerCentralTime=(triggerStopFloat+triggerStartFloat)/2 # relativeTimeBP=brightPixel[2].getAsFloat()-triggerCentralTime relativeFreqBP=brightPixel[3]-triggerCentralFreq ###symmetryBP=trigger.getSymmetryFactor(brightPixel,weight) zScoreBP=( (triggerIntegratedPower-meanPixelPower)/ math.sqrt(varPixelPower) ) relativeTimeCM=cmPixel[2].getAsFloat()-triggerCentralTime relativeFreqCM=cmPixel[3]-triggerCentralFreq ###symmetryCM=trigger.getSymmetryFactor(brightPixel,weight) zScoreCM=( (triggerIntegratedPower-meanPixelPower)/ math.sqrt(varPixelPower) ) #(+) if T_bp > T_cm if (triggerDuration > 0): spanTnorm=( (brightPixel[2].getAsFloat()-cmPixel[2].getAsFloat())/ triggerDuration ) else: spanTnorm=0 #(+) if F_bp>F_cm if (triggerBandwidth > 0): spanFnorm=(brightPixel[3]-cmPixel[3])/triggerBandwidth else: spanFnorm=0 #Create glitch database entry glitchDatabaseEntry=[triggerStartString,triggerStartFloat, triggerLowF,triggerDuration, triggerBandwidth,int(triggerLength), triggerIntegratedPower,meanPixelPower, varPixelPower,relativeTimeBP, relativeFreqBP,0, zScoreBP,relativeTimeCM, relativeTimeCM,0, zScoreCM,spanTnorm,spanFnorm] glitchDatabase.append(glitchDatabaseEntry) spinner.closeSpinner() return glitchDatabase #End createGraphingSummary | f8356864ebd3e4f4c62944a76ace8501c23ac979 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5758/f8356864ebd3e4f4c62944a76ace8501c23ac979/tracksearchutils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
21308,
1437,
4254,
12,
2890,
16,
11369,
33,
6430,
12,
8381,
3719,
30,
3536,
18034,
358,
1361,
3344,
279,
3695,
1492,
848,
506,
2667,
329,
2027,
4492,
578,
358,
752,
279,
2063,
364,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
21308,
1437,
4254,
12,
2890,
16,
11369,
33,
6430,
12,
8381,
3719,
30,
3536,
18034,
358,
1361,
3344,
279,
3695,
1492,
848,
506,
2667,
329,
2027,
4492,
578,
358,
752,
279,
2063,
364,
... |
("safe_headers", "Safe headers", ("abuse-reports-to", "date errors-to", | ("safe_headers", "Safe headers", ("abuse-reports-to", "date", "errors-to", | def bool(val): return not not val | c3a6c629eb134f582812030484f7f471287faa4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6126/c3a6c629eb134f582812030484f7f471287faa4f/Options.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1426,
12,
1125,
4672,
327,
486,
486,
1244,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1426,
12,
1125,
4672,
327,
486,
486,
1244,
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... |
re.sub(r'\r?\n', CRLF, data)) | re.sub(r'(?:\r\n|\n|\r(?!\n))', CRLF, data)) | def quotedata(data): """Quote data for email. Double leading '.', and change Unix newline '\n' into Internet CRLF end-of-line.""" return re.sub(r'(?m)^\.', '..', re.sub(r'\r?\n', CRLF, data)) | fcfb6323fb0030467d67b071654b342b7725727f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fcfb6323fb0030467d67b071654b342b7725727f/smtplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9298,
396,
12,
892,
4672,
3536,
10257,
501,
364,
2699,
18,
225,
3698,
7676,
2611,
16,
471,
2549,
9480,
9472,
2337,
82,
11,
1368,
21352,
21791,
679,
17,
792,
17,
1369,
12123,
327,
283,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9298,
396,
12,
892,
4672,
3536,
10257,
501,
364,
2699,
18,
225,
3698,
7676,
2611,
16,
471,
2549,
9480,
9472,
2337,
82,
11,
1368,
21352,
21791,
679,
17,
792,
17,
1369,
12123,
327,
283,
... |
if self.image_loaded == True and self.last_image_action_was_fit == True: | if self.image_loaded == True: | def window_resized(self, widget, allocation): # Update the image size on window resize if the current image was last fit: if self.image_loaded == True and self.last_image_action_was_fit == True: if allocation.width != self.prevwinwidth or allocation.height != self.prevwinheight: if self.zoomratio != 1: print "window resized" self.zoom_to_fit_window(None) self.prevwinwidth = allocation.width self.prevwinheight = allocation.height return | 256b0d450ece2fc62a329cf543aee8046cf71dba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2291/256b0d450ece2fc62a329cf543aee8046cf71dba/mirage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2742,
67,
455,
1235,
12,
2890,
16,
3604,
16,
13481,
4672,
468,
2315,
326,
1316,
963,
603,
2742,
7041,
309,
326,
783,
1316,
1703,
1142,
4845,
30,
309,
365,
18,
2730,
67,
4230,
422,
1053... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2742,
67,
455,
1235,
12,
2890,
16,
3604,
16,
13481,
4672,
468,
2315,
326,
1316,
963,
603,
2742,
7041,
309,
326,
783,
1316,
1703,
1142,
4845,
30,
309,
365,
18,
2730,
67,
4230,
422,
1053... |
def __init__(self, root, path, oeb, map=HTML_MAP): | def __init__(self, root, item, oeb, map=HTML_MAP): | def __init__(self, root, path, oeb, map=HTML_MAP): self.item = item self.logger = oeb.logger self.manifest = oeb.manifest self.tags, self.tattrs = map self.buf = StringIO() self.anchors = [] self.page_breaks = [] self.is_html = is_html = map is HTML_MAP self.stylizer = Stylizer(root, item.href, oeb) if is_html else None self.tree_to_binary(root) self.content = self.buf.getvalue() self.ahc = self.build_ahc() if is_html else None self.aht = self.build_aht() if is_html else None | 3eef5f35bf71bec485dc304665235dbb2e1d5b8b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9125/3eef5f35bf71bec485dc304665235dbb2e1d5b8b/writer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1365,
16,
761,
16,
320,
24008,
16,
852,
33,
4870,
67,
8352,
4672,
365,
18,
1726,
273,
761,
365,
18,
4901,
273,
320,
24008,
18,
4901,
365,
18,
14357,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1365,
16,
761,
16,
320,
24008,
16,
852,
33,
4870,
67,
8352,
4672,
365,
18,
1726,
273,
761,
365,
18,
4901,
273,
320,
24008,
18,
4901,
365,
18,
14357,
27... |
sizehint, if given, is passed as size argument to the stream's .read() method. """ if sizehint is None: data = self.stream.read() else: data = self.stream.read(sizehint) | sizehint, if given, is ignored since there is no efficient way to finding the true end-of-line. """ data = self.stream.read() | def readlines(self, sizehint=None): | 70596312880e288cdc4bf7e7b2416353c2c6025f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/70596312880e288cdc4bf7e7b2416353c2c6025f/codecs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17546,
12,
2890,
16,
963,
11317,
33,
7036,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17546,
12,
2890,
16,
963,
11317,
33,
7036,
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... |
for atm in atomsScheduledForDeletion: | val = Atom_prekill_prep() for a in atomsScheduledForDeletionDict.values(): a._will_kill = val for atm in atomsScheduledForDeletionDict.values(): | def _remove_bases_from_duplex(self, group, resizeEndAxisAtom, numberOfBasePairsToRemove): """ AVAILABLE AS A DEBUG PREFERENCE ONLY AS OF 2008-03-27. Will be cleaned up further. Remove the spcified number of base pairs from the duplex. @param group: The DnaGroup which contains this duplex @type group: DnaGroup @param resizeEndAxisAtom: The end axis base atom at a DnaLadder end of the duplex. This end base atom is used as a starting base atom while determining which base atoms to remove. @type resizeEndAxisAtom: Atom @param numberOfBasePairsToRemove: The total number of base paris to remove from the duplex. @type numberOfBasePairsToRemove: int """ ladder = resizeEndAxisAtom.molecule.ladder atomsScheduledForDeletion = [] atm = resizeEndAxisAtom strand_neighbors_to_delete = self._strand_neighbors_to_delete(atm) atomsScheduledForDeletion.extend(strand_neighbors_to_delete) #Fix for bug 2712 -- #Determine the ladder end. Based on the ladder end, we will decide which #direction to proceed in ,to find the next base atom. (e.g. it its #ladderend 0, we will proceed towards ladder end 1. and vice versa) #This direction is used by WholeChain.yield_rail_index_direction_counter #which is a pythongenerator object. (we pass 'pos' tuple argument which #includes this direction. It is important to properly determine this #direction. Otherwise the generator will not yeild all the base atoms we #desire. Wrong direction will result in bugs like 2712. #[ -- Ninad 2008-03-27 comment.] | 4090824539fc516abf6a30244c3d3d05582e6bbc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/4090824539fc516abf6a30244c3d3d05582e6bbc/DnaDuplex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4479,
67,
18602,
67,
2080,
67,
72,
2268,
92,
12,
2890,
16,
1041,
16,
7041,
1638,
6558,
3641,
16,
7922,
2171,
10409,
12765,
4672,
3536,
15068,
20027,
5355,
432,
6369,
7071,
10830,
20... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4479,
67,
18602,
67,
2080,
67,
72,
2268,
92,
12,
2890,
16,
1041,
16,
7041,
1638,
6558,
3641,
16,
7922,
2171,
10409,
12765,
4672,
3536,
15068,
20027,
5355,
432,
6369,
7071,
10830,
20... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.