rem stringlengths 1 226k | add stringlengths 0 227k | context stringlengths 6 326k | meta stringlengths 143 403 | input_ids listlengths 256 256 | attention_mask listlengths 256 256 | labels listlengths 128 128 |
|---|---|---|---|---|---|---|
for karg in build_sh_spec['kargs'][0]: build_sh_options += ' -k "%s"'%karg | if len(build_sh_spec['kargs']) > 0: for karg in build_sh_spec['kargs'][0]: build_sh_options += ' -k "%s"'%karg | def build_command(self, node_type, build_sh_spec, node_image, type, floppy_file, log_file): | 465b8a21950bdfc9cb670656cbab951f353d85a9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7598/465b8a21950bdfc9cb670656cbab951f353d85a9/GetBootMedium.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
3076,
12,
2890,
16,
756,
67,
723,
16,
1361,
67,
674,
67,
2793,
16,
756,
67,
2730,
16,
618,
16,
284,
16884,
2074,
67,
768,
16,
613,
67,
768,
4672,
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,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
3076,
12,
2890,
16,
756,
67,
723,
16,
1361,
67,
674,
67,
2793,
16,
756,
67,
2730,
16,
618,
16,
284,
16884,
2074,
67,
768,
16,
613,
67,
768,
4672,
2,
-100,
-100,
-100,
-10... |
def runDashlet(self, script): if not isinstance(self._job.get("dashlet", False), types.DictType): return return | def runDashlet(self, script): | 37ff735a15d950e877ac68861405f1893d4ff769 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5718/37ff735a15d950e877ac68861405f1893d4ff769/Generator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
21893,
1810,
12,
2890,
16,
2728,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
21893,
1810,
12,
2890,
16,
2728,
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,
-1... | |
if v.has_key(key): | if key in v: | def measure(self, v, rf, off=False): """Create/convert a measure using the frame state set on the measures server instance. `v` The measure to convert | d38898ee7af73aa5b71e4eeaaf5344b8a4c61bb2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7472/d38898ee7af73aa5b71e4eeaaf5344b8a4c61bb2/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6649,
12,
2890,
16,
331,
16,
9075,
16,
3397,
33,
8381,
4672,
3536,
1684,
19,
6283,
279,
6649,
1450,
326,
2623,
919,
444,
603,
326,
22692,
1438,
791,
18,
225,
1375,
90,
68,
1021,
6649,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6649,
12,
2890,
16,
331,
16,
9075,
16,
3397,
33,
8381,
4672,
3536,
1684,
19,
6283,
279,
6649,
1450,
326,
2623,
919,
444,
603,
326,
22692,
1438,
791,
18,
225,
1375,
90,
68,
1021,
6649,
... |
print >> sys.stderr, 'size mismatch %d != %d' % (total_size, expected_size) | print >> sys.stderr, 'size mismatch %d != %d' % (total_size, expected_size) | def main(): try: opts, args = getopt.getopt(sys.argv[1:], 'hfgstGSd:p:o:a:A:k:') except getopt.error, msg: usage(2, msg) # build the default socket filename from environment variables filename = os.path.expanduser('~/.sbbnsock-'+socket.gethostname()) action_options = [] server_options = [] for opt, arg in opts: if opt == '-h': usage(0) elif opt in ('-f', '-g', '-s', '-t', '-G', '-S'): action_options.append(opt) elif opt in ('-d', '-p', '-o', '-a', '-A'): server_options.append(opt) server_options.append(arg) elif opt == '-k': filename = arg if len(args) != 0: usage(2) server_options.append(filename) s = make_socket(server_options, filename) # We have a connection to the existing shared server w_file = s.makefile('w') r_file = s.makefile('r') # pass our command line on the first line into the socket w_file.write(' '.join(action_options)+'\n') # copy entire contents of stdin into the socket while 1: b = sys.stdin.read(1024*64) if not b: break w_file.write(b) w_file.flush() w_file.close() s.shutdown(1) # expect to get back a line containing the size of the rest of the response error = int(r_file.readline()) expected_size = int(r_file.readline()) if error: output = sys.stderr else: output = sys.stdout total_size = 0 # copy entire contents of socket into stdout or stderr while 1: b = r_file.read(1024*64) if not b: break output.write(b) total_size += len(b) output.flush() # If we didnt receive the right amount then something has gone wrong. # exit now, and procmail will ignore everything we have sent to stdout. # Note that this policy is different to the xmlrpc client, which # tries to handle errors internally by constructing a stdout that is # the same as stdin was. if total_size != expected_size: print >> sys.stderr, 'size mismatch %d != %d' % (total_size, expected_size) sys.exit(3) if error: sys.exit(error) | 84fbeb4e80b2c67753ed4a88cdc07298da5ae23f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9857/84fbeb4e80b2c67753ed4a88cdc07298da5ae23f/sb_bnfilter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
18,
19485,
63,
21,
30,
6487,
296,
76,
2137,
334,
16113,
72,
30,
84,
30,
83,
30,
69,
30,
37,
30,
79,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
18,
19485,
63,
21,
30,
6487,
296,
76,
2137,
334,
16113,
72,
30,
84,
30,
83,
30,
69,
30,
37,
30,
79,
... |
return {'policy': None, 'javaClass': 'com.untangle.uvm.security.Tid', 'id': tid, 'nodeName': None, 'name': "%d" % ( tid ) } | return {'javaClass': 'com.untangle.uvm.security.Tid', 'id': tid, 'name': "%d" % ( tid ) } | def buildTid(self,tid): tid = int( tid ) return {'policy': None, 'javaClass': 'com.untangle.uvm.security.Tid', 'id': tid, 'nodeName': None, 'name': "%d" % ( tid ) } | 5ba0ca8e893c9efe082c8fe71b9e22c1698db581 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/87/5ba0ca8e893c9efe082c8fe71b9e22c1698db581/manager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
56,
350,
12,
2890,
16,
18081,
4672,
11594,
273,
509,
12,
11594,
262,
327,
13666,
5086,
4278,
599,
16,
296,
6290,
797,
4278,
296,
832,
18,
10032,
4341,
18,
89,
3489,
18,
7462,
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,
1361,
56,
350,
12,
2890,
16,
18081,
4672,
11594,
273,
509,
12,
11594,
262,
327,
13666,
5086,
4278,
599,
16,
296,
6290,
797,
4278,
296,
832,
18,
10032,
4341,
18,
89,
3489,
18,
7462,
18,... |
if len(dbuf) > 0: output += self.dice(dbuf) | if len(dbuf) > 0: roll=self.dice(dbuf) if roll: color.append(ansi(COLOR['gray'])) output += color[-1] + '[' + roll[0] + ': ' color.append(ansi(COLOR['green'])) output += color[-1] + roll[1] color.pop() output += color[-1] + ']' color.pop() output += color[-1] else: output += dbuf | def wrap(self,data): ''' Miten ois v2 mika lukee koko paskan kirjain kirjaimelta -> varien sailytys onnistuis ''' # First talking quote = False offtopic = False dice = False cmode = False output = '' dbuf = '' cbuf = '' color = [ansi(COLOR['white'])] print data ''' for tok in data.split(' '): if len(tok) == 0: print "funny",data.split(' ');continue if tok[0] == '!': if len(tok) > 2: # Probably a dice, hit it, machine! roll = self.dice(tok) if roll: color.append(ansi(COLOR['red'])) output += color[-1] + roll color.pop() output += color[-1] + ' ' continue ''' for char in data: | 0c2660358aa59fdccd838709058972b485f435cd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13227/0c2660358aa59fdccd838709058972b485f435cd/ropeserve.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2193,
12,
2890,
16,
892,
4672,
9163,
490,
305,
275,
320,
291,
331,
22,
312,
21256,
328,
19445,
1340,
417,
601,
83,
293,
835,
304,
417,
481,
78,
530,
417,
481,
78,
4581,
8967,
317,
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,
2193,
12,
2890,
16,
892,
4672,
9163,
490,
305,
275,
320,
291,
331,
22,
312,
21256,
328,
19445,
1340,
417,
601,
83,
293,
835,
304,
417,
481,
78,
530,
417,
481,
78,
4581,
8967,
317,
13... |
We compute with the L-series of $E_{16}$: | We compute with the L-series of $E_{16}$ and then $E_{20}$: | def eisenstein_series_Lseries(weight, prec=53, max_imaginary_part=0, max_asymp_coeffs=40): r""" Return the L-series of the weight $2k$ Eisenstein series on $\SL_2(\Z)$. This actually returns an interface to Tim Dokchitser's program for computing with the L-series of the Eisenstein series INPUT: weight -- even integer prec -- integer (bits precision) max_imaginary_part -- real number max_asymp_coeffs -- integer OUTPUT: The L-series of the Eisenstein series. EXAMPLES: We compute with the L-series of $E_{16}$: sage: L = eisenstein_series_Lseries(16) sage: L(1) -0.291657724743873 We compute with the L-series of $E_{20}$: sage: L = eisenstein_series_Lseries(20) sage: L(2) -5.02355351645987 """ f = eisenstein_series_qexp(weight,prec) from sage.lfunctions.all import Dokchitser key = (prec, max_imaginary_part, max_asymp_coeffs) j = weight L = Dokchitser(conductor = 1, gammaV = [0,1], weight = j, eps = (-1)**Integer((j/2)), poles = [j], residues = [(-1)**Integer((j/2))*(float(pi))**(0.5)*bernoulli(j)/j], prec = prec) s = 'coeff = %s;'%f.list() L.init_coeffs('coeff[k+1]',pari_precode = s, max_imaginary_part=max_imaginary_part, max_asymp_coeffs=max_asymp_coeffs) L.check_functional_equation() L.rename('L-series associated to the weight %s Eisenstein series %s on SL_2(Z)'%(j,f)) return L | 0047302c06dcb788aebf2d93e9df325067845409 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/0047302c06dcb788aebf2d93e9df325067845409/eis_series.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
425,
291,
275,
334,
13685,
67,
10222,
67,
48,
10222,
12,
4865,
16,
13382,
33,
8643,
16,
943,
67,
15374,
2101,
67,
2680,
33,
20,
16,
943,
67,
15762,
1291,
67,
30463,
33,
7132,
4672,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
425,
291,
275,
334,
13685,
67,
10222,
67,
48,
10222,
12,
4865,
16,
13382,
33,
8643,
16,
943,
67,
15374,
2101,
67,
2680,
33,
20,
16,
943,
67,
15762,
1291,
67,
30463,
33,
7132,
4672,
4... |
time.sleep(240) | time.sleep(300) | def main(argv=None): if argv is None: argv = sys.argv usage = "-w" parser = OptionParser(usage) parser.add_option("-v", "--variation_test", dest="vary_mc_smt", default=False, action="store_true", help="Vary sched_mc & sched_smt. \ -c and -t inputs are initial value of sched_mc & sched_smt") parser.add_option("-c", "--mc_value", dest="mc_value", default=0, help="Sched mc power saving value 0/1/2") parser.add_option("-t", "--smt_value", dest="smt_value", default=0, help="Sched smt power saving value 0/1/2") parser.add_option("-w", "--workload", dest="work_ld", default="ebizzy", help="Workload can be ebizzy/kernbench") parser.add_option("-s", "--stress", dest="stress", default="partial", help="Load on system is full/partial [i.e 50%]/thread") (options, args) = parser.parse_args() try: count_num_cpu() count_num_sockets() # User would set option -v / -vc / -vt to test cpu consolidation # gets disabled when sched_mc &(/) sched_smt is disabled when # workload is already running in the system if options.vary_mc_smt: # Since same code is used for testing package consolidation and core # consolidation is_multi_socket & is_hyper_threaded check is done if is_multi_socket(): if options.mc_value: set_sched_mc_power(options.mc_value) mc_value=int(options.mc_value) else: set_sched_mc_power(1) mc_value=int(options.mc_value) if is_hyper_threaded(): if options.smt_value: set_sched_smt_power(options.smt_value) smt_value=int(options.smt_value) else: set_sched_smt_power(1) smt_value=1 #Generate arguments for trigger workload, run workload in background map_cpuid_pkgid() background="yes" duration=360 pinned="no" if int(options.mc_value) < 2: trigger_ebizzy (smt_value, "partial", duration, background, pinned) work_ld="ebizzy" #Wait for 120 seconds and then validate cpu consolidation works #When sched_mc & sched_smt is set import time time.sleep(120) else: #Wait for 120 seconds and then validate cpu consolidation works #When sched_mc & sched_smt is set trigger_kernbench (smt_value, "partial", background, pinned) work_ld="kernbench" import time time.sleep(240) generate_report() status = validate_cpu_consolidation(work_ld, mc_value, smt_value) if status == 0: print "INFO: Consolidation worked sched_smt &(/) sched_mc is set" #Disable sched_smt & sched_mc interface values if (options.vary_mc_smt and options.mc_value) and is_multi_socket(): set_sched_mc_power(0) #Reset sched_smt bcoz when sched_smt is set process still #continue to consolidate if is_hyper_threaded(): set_sched_smt_power(0) if (options.vary_mc_smt and options.smt_value) and is_hyper_threaded(): set_sched_smt_power(0) time.sleep(120) generate_report() status = validate_cpu_consolidation(options.work_ld,options.mc_value, options.smt_value) #CPU consolidation should fail as sched_mc &(/) sched_smt is disabled if status == 1: return(0) else: return(1) else: print "INFO: CPU consolidation failed when sched_mc &(/) \ | 4abd883d0e112ea2f9001ec4dae55fcf8dbbea8c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11457/4abd883d0e112ea2f9001ec4dae55fcf8dbbea8c/cpu_consolidation.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
33,
7036,
4672,
309,
5261,
353,
599,
30,
5261,
273,
2589,
18,
19485,
225,
4084,
273,
3701,
91,
6,
2082,
273,
18862,
12,
9167,
13,
2082,
18,
1289,
67,
3482,
2932,
17,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
33,
7036,
4672,
309,
5261,
353,
599,
30,
5261,
273,
2589,
18,
19485,
225,
4084,
273,
3701,
91,
6,
2082,
273,
18862,
12,
9167,
13,
2082,
18,
1289,
67,
3482,
2932,
17,
... |
ReplaceLineInFile( "./nautilussvn/DEBIAN/postinst", 'ln -s /usr/lib/nautilus', 'ln -s /usr/lib/nautilus/extensions-1.0/python/%s/NautilusSvn.py /usr/lib/nautilus/extensions-1.0/python/NautilusSvn.py\n'%VERSION ) | patterns = { 'include': [ '.*py$', '.*xrc$', 'svn.ico' ], 'exclude': [ 'setup.py' ] } | def ReplaceLineInFile(filename, target, subst): """ Replaces lines in *filename* containing *target* with *subst* """ st = open(filename, "r").readlines() out = [] for line in st: if target in line: line = subst out.append(line) f = open(filename, "w") for s in out: f.write(s) | 9d1ebf45598c95f5da9ed897f331bdc0639b07db /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5119/9d1ebf45598c95f5da9ed897f331bdc0639b07db/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6910,
1670,
382,
812,
12,
3459,
16,
1018,
16,
27750,
4672,
3536,
868,
11350,
2362,
316,
380,
3459,
14,
4191,
380,
3299,
14,
598,
380,
1717,
334,
14,
3536,
384,
273,
1696,
12,
3459,
16,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6910,
1670,
382,
812,
12,
3459,
16,
1018,
16,
27750,
4672,
3536,
868,
11350,
2362,
316,
380,
3459,
14,
4191,
380,
3299,
14,
598,
380,
1717,
334,
14,
3536,
384,
273,
1696,
12,
3459,
16,... |
cont = filecontents.FromFile(gzip.GzipFile(None, "r", fileobj = f)) | cont = filecontents.FromFile(gzip.GzipFile(None, 'r', fileobj = f)) | def __init__(self, fileName, skipValidate = 1): if type(fileName) is str: f = open(fileName, "r") csf = filecontainer.FileContainer(f) else: csf = filecontainer.FileContainer(fileName) | 5e116c568dc7a66c94d65f172a930733bbb3f886 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/5e116c568dc7a66c94d65f172a930733bbb3f886/changeset.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3968,
16,
2488,
4270,
273,
404,
4672,
309,
618,
12,
17812,
13,
353,
609,
30,
284,
273,
1696,
12,
17812,
16,
315,
86,
7923,
2873,
74,
273,
585,
3782,
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,
1001,
2738,
972,
12,
2890,
16,
3968,
16,
2488,
4270,
273,
404,
4672,
309,
618,
12,
17812,
13,
353,
609,
30,
284,
273,
1696,
12,
17812,
16,
315,
86,
7923,
2873,
74,
273,
585,
3782,
18... |
def visibleChildren(self, level): ls = [] | def intersects(self, r): if self.y2 < r.y1: return False if self.y1 > r.y2: return False if self.x2 < r.x1: return False if self.x1 > r.x2: return False return True | def visibleChildren(self, level): ls = [] | e331d79c32a1c48a63843972e627a7a7f53d919c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5063/e331d79c32a1c48a63843972e627a7a7f53d919c/comics.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6021,
4212,
12,
2890,
16,
1801,
4672,
7180,
273,
5378,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6021,
4212,
12,
2890,
16,
1801,
4672,
7180,
273,
5378,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
self.event.clicked_object = None | def _helper_glyph_button_up(self, event_name): ex, ey = self.event.disp_pos ret = self._pick_glyph(ex,ey) if ret: pc, psp = ret self.event.name = event_name pc.notify(event_name) else: self.event.clicked_object = None self.event.name = event_name self.notify(event_name) | 45c54a8cf3bb4d9c412053bee57429cdc5d3b11a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4494/45c54a8cf3bb4d9c412053bee57429cdc5d3b11a/devide_canvas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4759,
67,
19426,
67,
5391,
67,
416,
12,
2890,
16,
871,
67,
529,
4672,
431,
16,
12739,
273,
365,
18,
2575,
18,
25453,
67,
917,
325,
273,
365,
6315,
11503,
67,
19426,
12,
338,
16,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4759,
67,
19426,
67,
5391,
67,
416,
12,
2890,
16,
871,
67,
529,
4672,
431,
16,
12739,
273,
365,
18,
2575,
18,
25453,
67,
917,
325,
273,
365,
6315,
11503,
67,
19426,
12,
338,
16,... | |
print "reading cache" print cache | def getMetadata(self, troveList, label, cacheFile = None, cacheOnly = False, saveOnly = False): metadata = {} if cacheFile and not saveOnly: try: print "opening cache" cacheFp = open(cacheFile, "r") cache = pickle.load(cacheFp) cacheFp.close() except IOError, EOFError: print "got an error, returning" if cacheOnly: return {} else: print "reading cache" print cache lStr = label.asString() | 08f4b50b7b59c04afbfa7e1bc89323cb1d41ea4a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/08f4b50b7b59c04afbfa7e1bc89323cb1d41ea4a/conaryclient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11159,
12,
2890,
16,
23432,
537,
682,
16,
1433,
16,
18748,
273,
599,
16,
1247,
3386,
273,
1083,
16,
1923,
3386,
273,
1083,
4672,
1982,
273,
2618,
309,
18748,
471,
486,
1923,
3386,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11159,
12,
2890,
16,
23432,
537,
682,
16,
1433,
16,
18748,
273,
599,
16,
1247,
3386,
273,
1083,
16,
1923,
3386,
273,
1083,
4672,
1982,
273,
2618,
309,
18748,
471,
486,
1923,
3386,
30,
... | |
matches = (['class', name], ['class', name + ':']) | pat = re.compile(r'^\s*class\s*' + name + r'\b') | def findsource(object): """Return the entire source file and starting line number for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a list of all the lines in the file and the line number indexes a line in that list. An IOError is raised if the source code cannot be retrieved.""" try: file = open(getsourcefile(object)) except (TypeError, IOError): raise IOError, 'could not get source code' lines = file.readlines() file.close() if ismodule(object): return lines, 0 if isclass(object): name = object.__name__ matches = (['class', name], ['class', name + ':']) for i in range(len(lines)): if string.split(lines[i])[:2] in matches: return lines, i else: raise IOError, 'could not find class definition' if ismethod(object): object = object.im_func if isfunction(object): object = object.func_code if istraceback(object): object = object.tb_frame if isframe(object): object = object.f_code if iscode(object): if not hasattr(object, 'co_firstlineno'): raise IOError, 'could not find function definition' lnum = object.co_firstlineno - 1 while lnum > 0: if string.split(lines[lnum])[:1] == ['def']: break lnum = lnum - 1 return lines, lnum | 704c314f4179203a24c494f2a40dd915600f9c28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/704c314f4179203a24c494f2a40dd915600f9c28/inspect.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
3168,
12,
1612,
4672,
3536,
990,
326,
7278,
1084,
585,
471,
5023,
980,
1300,
364,
392,
733,
18,
225,
1021,
1237,
2026,
506,
279,
1605,
16,
667,
16,
707,
16,
445,
16,
10820,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
3168,
12,
1612,
4672,
3536,
990,
326,
7278,
1084,
585,
471,
5023,
980,
1300,
364,
392,
733,
18,
225,
1021,
1237,
2026,
506,
279,
1605,
16,
667,
16,
707,
16,
445,
16,
10820,
16,
... |
print searchResults[0] | def findAdditionalProblems(self): # In every tupla there's a setting configuration for tupla in self.settingsData: name = tupla[1] find_tipe = tupla[2] find = tupla[3] find_list = self.load(find) imagechanges = tupla[4] if imagechanges.lower() == 'false': imagestatus = False elif imagechanges.lower() == 'true': imagestatus = True else: wikipedia.output(u"Error! Imagechanges set wrongly!") self.settingsData = None break summary = tupla[5] head_2 = tupla[6] text = tupla[7] text = text % self.imageName mexCatched = tupla[8] for k in find_list: if find_tipe.lower() == 'findonly': searchResults = re.findall(r'%s' % k.lower(), self.imageCheckText.lower()) if searchResults != []: if searchResults[0] == self.imageCheckText.lower(): print searchResults[0] self.some_problem = True self.text_used = text self.head_used = head_2 self.imagestatus_used = imagestatus self.name_used = name self.summary_used = summary self.mex_used = mexCatched break elif find_tipe.lower() == 'find': if re.findall(r'%s' % k.lower(), self.imageCheckText.lower()) != []: print re.findall(r'%s' % k.lower(), self.imageCheckText.lower()) self.some_problem = True self.text_used = text self.head_used = head_2 self.imagestatus_used = imagestatus self.name_used = name self.summary_used = summary self.mex_used = mexCatched continue | 2fcfc5fa0be0174064492f34e277ecfb916c8e02 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/2fcfc5fa0be0174064492f34e277ecfb916c8e02/checkimages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
10552,
626,
19122,
12,
2890,
4672,
468,
657,
3614,
28325,
412,
69,
1915,
1807,
279,
3637,
1664,
364,
28325,
412,
69,
316,
365,
18,
4272,
751,
30,
508,
273,
28325,
412,
69,
63,
21... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
10552,
626,
19122,
12,
2890,
4672,
468,
657,
3614,
28325,
412,
69,
1915,
1807,
279,
3637,
1664,
364,
28325,
412,
69,
316,
365,
18,
4272,
751,
30,
508,
273,
28325,
412,
69,
63,
21... | |
return None if self.__current_realm is None: self.__current_realm = realm else: self.__current_realm = realm | def get_authorization(self, req, chal): try: realm = chal['realm'] nonce = chal['nonce'] algorithm = chal.get('algorithm', 'MD5') # mod_digest doesn't send an opaque, even though it isn't # supposed to be optional opaque = chal.get('opaque', None) except KeyError: return None | 4a061261db60e3d9ba7e8ee962b4db15349be0f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/4a061261db60e3d9ba7e8ee962b4db15349be0f3/urllib2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
12218,
12,
2890,
16,
1111,
16,
462,
287,
4672,
775,
30,
11319,
273,
462,
287,
3292,
24056,
3546,
7448,
273,
462,
287,
3292,
12824,
3546,
4886,
273,
462,
287,
18,
588,
2668,
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,
336,
67,
12218,
12,
2890,
16,
1111,
16,
462,
287,
4672,
775,
30,
11319,
273,
462,
287,
3292,
24056,
3546,
7448,
273,
462,
287,
3292,
12824,
3546,
4886,
273,
462,
287,
18,
588,
2668,
12... | |
cmd += ['--restore=%s' % os.path.join(options.profileDir, | cmd += ['--restore=%s' % os.path.join(options.profileDir, | def runScriptPerfTests(options, testlist, largeData=False, repeat=1, logger=log): """ Run script performance tests. >>> options = parseOptions() >>> checkOptions(options) >>> options.dryrun = True >>> options.verbose = True >>> runScriptPerfTests(options, ['foobar']) /.../release/RunChandler --catch=tests --profileDir=test_profile --parcelPath=tools/cats/DataFiles --catsPerfLog=test_profile/time.log --scriptFile=foobar --create foobar 0.00 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | 0.00 ... 0.00 False >>> runScriptPerfTests(options, ['foobar'], largeData=True) /.../release/RunChandler --catch=tests --profileDir=test_profile --parcelPath=tools/cats/DataFiles --catsPerfLog=test_profile/time.log --scriptFile=foobar --restore=test_profile/__repository__.001 foobar 0.00 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | 0.00 ... 0.00 False >>> options.profile = True >>> runScriptPerfTests(options, ['foobar.py']) /.../release/RunChandler --catch=tests --profileDir=test_profile --parcelPath=tools/cats/DataFiles --catsPerfLog=test_profile/time.log --scriptFile=foobar.py --catsProfile=test_profile/foobar.hotshot --create foobar.py 0.00 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | 0.00 ... 0.00 False """ failed = False l = len(options.chandlerHome) + 1 timeLog = os.path.join(options.profileDir, 'time.log') if repeat == 1: just = 20 elif repeat == 2: just = 13 else: just = 6 for item in testlist: #$CHANDLERBIN/release/$RUN_CHANDLER --create --catch=tests # --profileDir="$PC_DIR" # --catsPerfLog="$TIME_LOG" # --scriptFile="$TESTNAME" &> $TESTLOG if item.startswith(options.chandlerHome): item = item[l:] name = item[item.rfind('/') + 1:] cmd = [ options.runchandler['release'], '--catch=tests', '--profileDir=%s' % options.profileDir, '--parcelPath=%s' % options.parcelPath, '--catsPerfLog=%s' % timeLog, '--scriptFile=%s' % item ] if options.profile: cmd += ['--catsProfile=%s.hotshot' % os.path.join(options.profileDir, name[:-3])] if not largeData: cmd += ['--create'] else: cmd += ['--restore=%s' % os.path.join(options.profileDir, '__repository__.001')] if options.params: cmd += [ options.params ] if options.verbose: log(' '.join(cmd)) values = [] log(name.ljust(33), newline=' ') for _x in range(repeat): if not options.dryrun: if os.path.isfile(timeLog): os.remove(timeLog) if options.dryrun: result = 0 else: tempLogger = DelayedLogger() result = build_lib.runCommand(cmd, timeout=1800, logger=tempLogger) if result != 0: if options.tbox: if result == -9: log("***Error: A timeout error has happened for %s" % name) log("***Error: The process output will be dumped below but it may be incomplete") log("***Error: due to the process either crashing or being killed.") # Strip OSAF_QA lines because we don't want to include # results from failed runs for args, kw in tempLogger.delayed: if not args[0].startswith('OSAF_QA: '): log(*args, **kw) else: tempLogger.logAll() log('***Error exit code=%d, %s' % (result, name)) failed = True failedTests.append(item) if not options.noStop: break else: if options.dryrun: value = 0.00 else: if os.path.isfile(timeLog): value = float(open(timeLog).readline()[:-1]) else: log('\ntimeLog [%s] not found' % timeLog) failed = True failedTests.append(item) if not options.noStop: break log(('%02.2f' % value).rjust(just), newline=' ') if not options.dryrun: values.append((value, tempLogger)) else: values.append((value, None)) if options.dryrun: log('- + ' * 15) else: tempLogger('- + ' * 15) else: try: originalValues = values[:] values.sort() value = values[repeat/2] log(' | ', newline='') log(('%02.2f' % value[0]).rjust(6) , newline='') log(u' \u00B1 '.encode('utf8'), newline='') # Unicode PLUS-MINUS SIGN log(('%02.2f' % stddev([x for x, _y in values])).rjust(6)) if not options.dryrun: if options.tbox: for args, kw in value[1].delayed: logger(*args, **kw) else: for _n, tempLogger in originalValues: for args, kw in tempLogger.delayed: logger(*args, **kw) except IndexError: if not options.noStop: raise if failed and not options.noStop: break return failed | 64e3ec7e167097dc0b4afb4eadc40bc6adec660f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/64e3ec7e167097dc0b4afb4eadc40bc6adec660f/rt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
3651,
22016,
14650,
12,
2116,
16,
1842,
1098,
16,
7876,
751,
33,
8381,
16,
7666,
33,
21,
16,
1194,
33,
1330,
4672,
3536,
1939,
2728,
9239,
7434,
18,
225,
4080,
702,
273,
1109,
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,
1086,
3651,
22016,
14650,
12,
2116,
16,
1842,
1098,
16,
7876,
751,
33,
8381,
16,
7666,
33,
21,
16,
1194,
33,
1330,
4672,
3536,
1939,
2728,
9239,
7434,
18,
225,
4080,
702,
273,
1109,
13... |
try: if not os.path.isdir(p): | if not os.path.isdir(p): try: | def create_build_dir(): for p in [BuildPkg.blddir, BuildPkg.logdir, BuildPkg.libdir, BuildPkg.bindir, ]: try: if not os.path.isdir(p): os.makedirs(p) except: fatal("error creating directory " + p) | 89b15e98275333525e3bccdd4be6b1cae64e3221 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5963/89b15e98275333525e3bccdd4be6b1cae64e3221/build_packages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
3510,
67,
1214,
13332,
364,
293,
316,
306,
3116,
11264,
18,
3083,
449,
481,
16,
3998,
11264,
18,
1330,
1214,
16,
3998,
11264,
18,
2941,
1214,
16,
3998,
11264,
18,
4376,
481,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
3510,
67,
1214,
13332,
364,
293,
316,
306,
3116,
11264,
18,
3083,
449,
481,
16,
3998,
11264,
18,
1330,
1214,
16,
3998,
11264,
18,
2941,
1214,
16,
3998,
11264,
18,
4376,
481,
1... |
if not self.env.config.has_key('auth'): | if not self.env.config.has_key('boto_web'): | def get_auth_config(self, path): """ Get the auth config for this path """ log.info("Get Auth Config: %s" % (path)) match = None if not self.env.config.has_key('auth'): return None for rule in self.env.config['auth']: if rule.has_key("url"): if not re.match(rule['url'], path): continue if rule.has_key("method"): if rule['method'] != method: continue match = rule break return match | 168dd0abe620c6594fb332c7cc5f44eff6f12253 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10599/168dd0abe620c6594fb332c7cc5f44eff6f12253/auth_layer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1944,
67,
1425,
12,
2890,
16,
589,
4672,
3536,
968,
326,
1357,
642,
364,
333,
589,
3536,
613,
18,
1376,
2932,
967,
3123,
1903,
30,
738,
87,
6,
738,
261,
803,
3719,
845,
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,
336,
67,
1944,
67,
1425,
12,
2890,
16,
589,
4672,
3536,
968,
326,
1357,
642,
364,
333,
589,
3536,
613,
18,
1376,
2932,
967,
3123,
1903,
30,
738,
87,
6,
738,
261,
803,
3719,
845,
273,... |
self.widget=menu.AppendCheckItem(self.id, self.name, self.tooltip) | self.widget=menu.AppendCheckItem(self.id, self.name, self.getTooltip()) | def insertIntoMenu(self,menu): self.id=wx.NewId() self.widget=menu.AppendCheckItem(self.id, self.name, self.tooltip) self.frame.Connect(self.id,-1,wx.wxEVT_COMMAND_MENU_SELECTED, self.OnMenuSelected) self.frame.Connect(self.id,-1,wx.wxEVT_UPDATE_UI, self.OnUpdateUI) self.Check() | d797d4f7b5a36cb545c715bb09c1aac93fa5c250 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11522/d797d4f7b5a36cb545c715bb09c1aac93fa5c250/menu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2243,
5952,
4599,
12,
2890,
16,
5414,
4672,
365,
18,
350,
33,
27226,
18,
1908,
548,
1435,
365,
18,
6587,
33,
5414,
18,
5736,
1564,
1180,
12,
2890,
18,
350,
16,
365,
18,
529,
16,
365,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2243,
5952,
4599,
12,
2890,
16,
5414,
4672,
365,
18,
350,
33,
27226,
18,
1908,
548,
1435,
365,
18,
6587,
33,
5414,
18,
5736,
1564,
1180,
12,
2890,
18,
350,
16,
365,
18,
529,
16,
365,... |
self.assertRaises(TypeError, list, ifilter(isEven, N(s))) | self.assertRaises(TypeError, ifilter, isEven, N(s)) | def test_ifilter(self): for s in (range(10), range(0), range(1000), (7,11), xrange(2000,2200,5)): for g in (G, I, Ig, S, L, R): self.assertEqual(list(ifilter(isEven, g(s))), filter(isEven, g(s))) self.assertRaises(TypeError, ifilter, isEven, X(s)) self.assertRaises(TypeError, list, ifilter(isEven, N(s))) self.assertRaises(ZeroDivisionError, list, ifilter(isEven, E(s))) | 5cb6bfcb86589e7d483f1ae2db98f69a231d8a0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/5cb6bfcb86589e7d483f1ae2db98f69a231d8a0b/test_itertools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
430,
1088,
12,
2890,
4672,
364,
272,
316,
261,
3676,
12,
2163,
3631,
1048,
12,
20,
3631,
1048,
12,
18088,
3631,
261,
27,
16,
2499,
3631,
12314,
12,
17172,
16,
3787,
713,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
430,
1088,
12,
2890,
4672,
364,
272,
316,
261,
3676,
12,
2163,
3631,
1048,
12,
20,
3631,
1048,
12,
18088,
3631,
261,
27,
16,
2499,
3631,
12314,
12,
17172,
16,
3787,
713,
16,
... |
src=open(DV.tmp_path+i,'rb') dst=open(self.outdir+self.filename,'wb') | src=DamnOpenFile(DV.tmp_path+i,'rb') dst=DamnOpenFile(self.outdir+self.filename,'wb') | def run(self): self.uris=self.getURI(self.sourceuri) self.abort=False if not self.abort: if True: Damnlog('Conversion routine starting, URI is',self.uris[0]) self.uri=self.uris[0] self.update(0) self.parent.thisvideo.append(self.parent.videos[self.parent.converting]) self.filename=unicodedata.normalize('NFKD',DamnUnicode(REGEX_FILE_CLEANUP_FILENAME.sub('',self.parent.meta[self.parent.videos[self.parent.converting]]['name']))).encode('utf8','ignore').replace('/','').replace('\\','').strip() self.profile=int(self.parent.meta[self.parent.videos[self.parent.converting]]['profile']) if os.path.exists(self.uri): Damnlog('We\'re dealing with a file stream here.') self.stream=self.uri # It's a file stream, ffmpeg will take care of it if self.outdir is None: self.outdir=DV.prefs.get('defaultoutdir') else: Damnlog('We\'re dealing with a network stream here.') self.stream='-' # It's another stream, spawn a downloader thread to take care of it and pipe the content to ffmpeg via stdin if self.outdir is None: self.outdir=DV.prefs.get('defaultweboutdir') if self.outdir[-1:]==DV.sep: self.outdir=self.outdir[0:-1] if not os.path.exists(self.outdir): os.makedirs(self.outdir) elif not os.path.isdir(self.outdir): os.remove(self.outdir) os.makedirs(self.outdir) self.outdir=self.outdir+DV.sep Damnlog('Profile is',self.profile,'; Output directory is',self.outdir) if self.profile==-1: # Do not encode, just copy Damnlog('We\'re in raw copy mode') if True: failed=False if self.stream=='-': # Spawn a downloader src=DamnURLPicker(self.uris) total=int(src.info()['Content-Length']) Damnlog('Total bytes:',total) ext='avi' try: if src.info()['Content-Type'].lower().find('audio')!=-1: ext='mp3' except: ext='avi' try: tmpuri=src.info()['Content-Disposition'][src.info()['Content-Disposition'].find('filename=')+9:] except: tmpuri='Video.'+ext # And pray for the best! Damnlog('Temp URI is',tmpuri) else: # Just copy the file, lol total=int(os.lstat(self.stream).st_size) src=open(self.stream,'rb') tmpuri=self.stream Damnlog('Total is',total,'; Temp URI is',tmpuri) if REGEX_URI_EXTENSION_EXTRACT.search(tmpuri): ext='.'+REGEX_URI_EXTENSION_EXTRACT.sub('\\1',tmpuri) else: ext='.avi' # And pray for the best again! self.filename=self.getfinalfilename(self.outdir,self.filename,ext) Damnlog('Filename is',self.filename,'; opening local stream.') dst=open(self.outdir+self.filename+ext,'wb') Damnlog(self.outdir+self.filename+ext,'opened.') keepgoing=True copied=0.0 lasttime=0.0 self.update(statustext=DV.l('Copying ')+DamnUnicode(self.parent.meta[self.parent.videos[self.parent.converting]]['name'])+DV.l(' to ')+DamnUnicode(self.filename+ext)+DV.l('...')) Damnlog('Starting raw download of stream',src) while keepgoing and not self.abort: i=src.read(4096) if len(i): dst.write(i) copied+=4096.0 else: copied=float(total) keepgoing=False progress=min((100.0,copied/total*100.0)) nowtime=float(time.time()) if lasttime+.5<nowtime or not keepgoing: # Do not send a progress update more than 2 times per second, otherwise the event queue can get overloaded. On some platforms, time() is an int, but that doesn't matter; the progress will be updated once a second instead of 2 times, which is still acceptable. self.update(progress,status=self.parent.meta[self.parent.videos[self.parent.converting]]['status']+' ['+str(int(progress))+'%]') lasttime=nowtime Damnlog('Done downloading!') else: Damnlog('Raw download failed. Aborted?',self.abort) failed=True self.grabberrun=False if self.abort or failed: self.parent.meta[self.parent.videos[self.parent.converting]]['status']='Failure.' self.update(status='Failure.') else: self.parent.meta[self.parent.videos[self.parent.converting]]['status']='Success!' self.update(status='Success!') self.parent.resultlist.append((self.parent.meta[self.parent.videos[self.parent.converting]]['name'],self.outdir)) self.update(go=self.abort) return Damnlog('We\'re in on-the-fly conversion mode.') os_exe_ext='' if DV.os=='nt': os_exe_ext='.exe' elif DV.os=='mac': os_exe_ext='osx' if DV.bit64==True: os_exe_ext='64'+os_exe_ext self.passes=1 cmd=[DV.bin_path+'ffmpeg'+os_exe_ext,'-i','?DAMNVID_VIDEO_STREAM?','-y','-deinterlace','-passlogfile',DV.tmp_path+'pass'] for i in DV.preferences.keys(): if i[0:25]=='damnvid-profile:encoding_': i=i[16:] pref=DV.prefs.getp(self.profile,i) if pref: if type(DV.preferences['damnvid-profile:'+i]['kind']) in (type(''),type(u'')): if DV.preferences['damnvid-profile:'+i]['kind'][0]=='%': pref=str(round(float(pref),0)) # Round if i=='encoding_pass': pref='?DAMNVID_VIDEO_PASS?' if i[9:]=='b' and pref=='sameq': cmd.append('-sameq') else: cmd.extend(['-'+i[9:],pref]) self.encodevideo=DV.prefs.getp(self.profile,'video') self.encodeaudio=DV.prefs.getp(self.profile,'audio') if not self.encodevideo: cmd.append('-vn') if not self.encodeaudio: cmd.append('-an') vidformat=DV.prefs.getp(self.profile,'Encoding_f') self.vcodec=DV.prefs.getp(self.profile,'Encoding_vcodec') self.acodec=DV.prefs.getp(self.profile,'Encoding_acodec') self.totalpasses=DV.prefs.getp(self.profile,'Encoding_pass') if not self.totalpasses: self.totalpasses=1 else: self.totalpasses=int(self.totalpasses) if vidformat and DV.file_ext.has_key(vidformat): ext='.'+DV.file_ext[vidformat] else: if self.vcodec and self.encodevideo and DV.file_ext_by_codec.has_key(self.vcodec): ext='.'+DV.file_ext_by_codec[self.vcodec] elif self.encodeaudio and not self.encodevideo: if DV.file_ext_by_codec.has_key(self.acodec): ext='.'+DV.file_ext_by_codec[self.acodec] else: ext='.mp3' else: ext='.avi' flags=[] if self.vcodec and DV.codec_advanced_cl.has_key(self.vcodec): for o in DV.codec_advanced_cl[self.vcodec]: if type(o) in (type(''),type(u'')): if o not in flags: # If the flag is already there, don't add it again flags.append(o) else: if '-'+o[0] not in cmd: # If the option is already there, don't overwrite it cmd.extend(['-'+o[0],o[1]]) if len(flags): cmd.extend(['-flags',''.join(flags)]) self.filename=self.getfinalfilename(self.outdir,self.filename,ext) self.filenamenoext=self.filename self.tmpfilename=self.gettmpfilename(DV.tmp_path,self.filenamenoext.decode('utf8','ignore').encode('charmap','ignore'),ext) cmd.append('?DAMNVID_OUTPUT_FILE?') if len(self.moduleextraargs): cmd.extend(self.moduleextraargs) Damnlog('ffmpeg call has been generated:',cmd) self.filename=self.filenamenoext+ext self.duration=None self.update(statustext=DV.l('Converting ')+DamnUnicode(self.parent.meta[self.parent.videos[self.parent.converting]]['name'])+DV.l(' to ')+DamnUnicode(self.filename.decode('utf8'))+DV.l('...')) while int(self.passes)<=int(self.totalpasses) and not self.abort: Damnlog('Starting pass',self.passes,'out of',self.totalpasses) if self.totalpasses!=1: self.parent.meta[self.parent.videos[self.parent.converting]]['status']=DV.l('Pass ')+str(self.passes)+'/'+str(self.totalpasses)+DV.l('...') self.update(status=DV.l('Pass ')+str(self.passes)+'/'+str(self.totalpasses)+DV.l('...')) if self.stream=='-': if self.passes==1: self.tmppassfile=DV.tmp_path+self.gettmpfilename(DV.tmp_path,self.filenamenoext,ext) else: self.stream=self.tmppassfile if self.passes!=1: self.tmpfilename=self.gettmpfilename(DV.tmp_path,self.filenamenoext,ext) self.process=DamnSpawner(self.cmd2str(cmd),stderr=subprocess.PIPE,stdin=subprocess.PIPE,cwd=os.path.dirname(DV.tmp_path)) if self.stream=='-': if self.totalpasses!=1: self.feeder=DamnDownloader(self.uris,self.process.stdin,self.tmppassfile) else: self.feeder=DamnDownloader(self.uris,self.process.stdin) self.feeder.start() curline='' while self.process.poll()==None and not self.abort: c=self.process.stderr.read(1) curline+=c if c=='\r' or c=='\n': self.parseLine(curline) curline='' self.passes+=1 Damnlog('And we\'re done converting!') self.update(100) result=self.process.poll() # The process is complete, but .poll() still returns the process's return code time.sleep(.25) # Wait a bit self.grabberrun=False # That'll make the DamnConverterGrabber wake up just in case if result and os.path.exists(DV.tmp_path+self.tmpfilename): os.remove(DV.tmp_path+self.tmpfilename) # Delete the output file if ffmpeg has exitted with a bad return code Damnlog('All the routine completed successfully.') else: result=1 Damnlog('Error in main conversion routine.') Damnlog('Cleaning up after conversion.') for i in os.listdir(os.path.dirname(DV.tmp_path)): if i[0:8]=='damnvid-': i=i[8:] if i==self.tmpfilename and not result and not self.abort: try: os.rename(DV.tmp_path+i,self.outdir+self.filename) except: # Maybe the file still isn't unlocked, it happens... Wait moar and retry try: time.sleep(2) os.rename(DV.tmp_path+i,self.outdir+self.filename) except: # Now this is really bad, alert the user try: # Manual copy, might be needed if we're working on two different filesystems on a non-Windows platform src=open(DV.tmp_path+i,'rb') dst=open(self.outdir+self.filename,'wb') for fileline in src.readlines(): dst.write(fileline) try: # Another try block in order to avoid raising the huge except block with the dialog src.close() dst.close() os.remove(DV.tmp_path+i) except: pass except: self.update(dialog=(DV.l('Cannot move file!'),DV.l('locale:successfully-converted-file-but-ioerror')+'\n'+DV.tmp_path+i,wx.OK|wx.ICON_EXCLAMATION)) else: try: os.remove(DV.tmp_path+i) except: pass Damnlog('End cleanup, returning. Result?',result,'; Abort?',self.abort) if not result and not self.abort: self.parent.meta[self.parent.videos[self.parent.converting]]['status']=DV.l('Success!') self.parent.resultlist.append((self.parent.meta[self.parent.videos[self.parent.converting]]['name'],self.outdir)) self.update(status=DV.l('Success!'),go=self.abort) return self.parent.meta[self.parent.videos[self.parent.converting]]['status']=DV.l('Failure.') self.update(status=DV.l('Failure.'),go=self.abort) | eb32c3f0350ac5e4cc4ce63c81f04bfa758a966a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11142/eb32c3f0350ac5e4cc4ce63c81f04bfa758a966a/DamnVid.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
365,
18,
23510,
33,
2890,
18,
588,
3098,
12,
2890,
18,
3168,
1650,
13,
365,
18,
18623,
33,
8381,
309,
486,
365,
18,
18623,
30,
309,
1053,
30,
463,
301,
82,
1330... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
365,
18,
23510,
33,
2890,
18,
588,
3098,
12,
2890,
18,
3168,
1650,
13,
365,
18,
18623,
33,
8381,
309,
486,
365,
18,
18623,
30,
309,
1053,
30,
463,
301,
82,
1330... |
ignorePrimaryPins = False)[0] | ignorePrimaryPins = False) | # def _resolveDependencies() begins here | ee4de86bc27832efbeef6e6900e90a53ec4212b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/ee4de86bc27832efbeef6e6900e90a53ec4212b4/update.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
1652,
389,
10828,
8053,
1435,
17874,
2674,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
1652,
389,
10828,
8053,
1435,
17874,
2674,
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,
... |
if __debug__: class Foo: version = 1 class Foo: version = 2 class Foo: version = 3 def execfunc(x): exec x in y | def get_namespace(self): """Returns the single namespace bound to this name. | 6e33e13d7addf2321a96d34004ac062d482b5cbc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6e33e13d7addf2321a96d34004ac062d482b5cbc/symtable.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4937,
12,
2890,
4672,
3536,
1356,
326,
2202,
1981,
2489,
358,
333,
508,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
336,
67,
4937,
12,
2890,
4672,
3536,
1356,
326,
2202,
1981,
2489,
358,
333,
508,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
name = encodinglib.get_descriptive_name(config.file.encoding) self._encodings.insert(0, (config.file.encoding, name)) | try: encoding = config.file.encoding name = encodinglib.get_descriptive_name(encoding) self._encodings.insert(0, (encoding, name)) except ValueError: pass | def _init_encodings(self): """Initialize encodings.""" | bcde01d42b6f1ada4a089d0435d8eeea8d068f3e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12852/bcde01d42b6f1ada4a089d0435d8eeea8d068f3e/filechooser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
67,
1331,
369,
899,
12,
2890,
4672,
3536,
7520,
24118,
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,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
67,
1331,
369,
899,
12,
2890,
4672,
3536,
7520,
24118,
12123,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
self._process = external_program_thread(command=self.command, program_id=self.program_id, log=self.log) | self._process = external_program_thread( command=self.command, program_id=self.program_id, log=self.log, intercept_output=self.intercept_output) | def initialize_server (self) : if self._process is None and self._server is None : valid_ports = [] for (start, end) in self.port_ranges : valid_ports.extend([ n for n in range(start, end) ]) i = int(random.random() * (len(valid_ports) - 1)) self._port = valid_ports[i] prog_port_env = "CCTBX_%s_PORT" % string.upper(self.program_id) os.environ[prog_port_env] = str(self._port) if self.timeout is not None : os.environ["CCTBX_XMLRPC_TIMEOUT"] = str(self.timeout) if self.local_port is not None : os.environ["CCTBX_XMLRPC_PORT"] = str(self.local_port) self._process = external_program_thread(command=self.command, program_id=self.program_id, log=self.log) self._process.start() if self.cache_requests : proxy_class = ServerProxy else : proxy_class = xmlrpclib.ServerProxy self._server = proxy_class(uri="http://127.0.0.1:%d/RPC2" % self._port) | 7fa4f9c53b20fc1fc9f0a2b2509c49a9f9056261 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/696/7fa4f9c53b20fc1fc9f0a2b2509c49a9f9056261/xmlrpc_utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
67,
3567,
261,
2890,
13,
294,
309,
365,
6315,
2567,
353,
599,
471,
365,
6315,
3567,
353,
599,
294,
923,
67,
4363,
273,
5378,
364,
261,
1937,
16,
679,
13,
316,
365,
18,
655,
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,
4046,
67,
3567,
261,
2890,
13,
294,
309,
365,
6315,
2567,
353,
599,
471,
365,
6315,
3567,
353,
599,
294,
923,
67,
4363,
273,
5378,
364,
261,
1937,
16,
679,
13,
316,
365,
18,
655,
67,... |
checkout = True if checkout: | branch = True if branch: | def obtain(self, dest): url, rev = self.get_url_rev() if rev: rev_options = ['-r', rev] rev_display = ' (to revision %s)' % rev else: rev_options = [] rev_display = '' checkout = True if os.path.exists(os.path.join(dest, '.bzr')): existing_url = self.get_url(dest) checkout = False if existing_url == url: logger.info('Checkout in %s exists, and has correct URL (%s)' % (display_path(dest), url)) logger.notify('Updating checkout %s%s' % (display_path(dest), rev_display)) checkout = True else: logger.warn('Bazaar checkout in %s exists with URL %s' % (display_path(dest), existing_url)) logger.warn('The plan is to install the Bazaar repository %s' % url) response = ask('What to do? (s)witch, (i)gnore, (w)ipe, (b)ackup ', ('s', 'i', 'w', 'b')) if response == 's': logger.notify('Switching checkout %s to %s%s' % (display_path(dest), url, rev_display)) call_subprocess(['bzr', 'switch', url], cwd=dest) elif response == 'i': # do nothing pass elif response == 'w': logger.warn('Deleting %s' % display_path(dest)) shutil.rmtree(dest) checkout = True elif response == 'b': dest_dir = backup_dir(dest) logger.warn('Backing up %s to %s' % (display_path(dest), dest_dir)) shutil.move(dest, dest_dir) checkout = True if checkout: logger.notify('Checking out %s%s to %s' % (url, rev_display, display_path(dest))) call_subprocess( ['bzr', 'checkout', '-q'] + rev_options + [url, dest]) | 22a9aa0c1ba89d1fe5c4749dbb26f02277d162f1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12982/22a9aa0c1ba89d1fe5c4749dbb26f02277d162f1/pip.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7161,
12,
2890,
16,
1570,
4672,
880,
16,
5588,
273,
365,
18,
588,
67,
718,
67,
9083,
1435,
309,
5588,
30,
5588,
67,
2116,
273,
10228,
17,
86,
2187,
5588,
65,
5588,
67,
5417,
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,
7161,
12,
2890,
16,
1570,
4672,
880,
16,
5588,
273,
365,
18,
588,
67,
718,
67,
9083,
1435,
309,
5588,
30,
5588,
67,
2116,
273,
10228,
17,
86,
2187,
5588,
65,
5588,
67,
5417,
273,
296... |
m1 = SparseMatrixConstructor((ind2-ind1, ind1)) m2 = Eye(ind2-ind1) m3 = SparseMatrixConstructor((ind2-ind1, x.size - ind2)) r = Hstack((m1, m2, m3)) | r = Eye(ind2-ind1) if ind1 != 0: m1 = SparseMatrixConstructor((ind2-ind1, ind1)) r = Hstack((SparseMatrixConstructor((ind2-ind1, ind1)), r)) if ind2 != x.size: r = Hstack((r, SparseMatrixConstructor((ind2-ind1, x.size - ind2)))) | def d(x): condBigMatrix = Len(x) > 100 #and (ind2-ind1) > 0.25*x.size if condBigMatrix and not scipyInstalled: self.pWarn(scipyAbsentMsg) if condBigMatrix and scipyInstalled: m1 = SparseMatrixConstructor((ind2-ind1, ind1)) m2 = Eye(ind2-ind1) m3 = SparseMatrixConstructor((ind2-ind1, x.size - ind2)) r = Hstack((m1, m2, m3)) else: m1 = zeros((ind2-ind1, ind1)) m2 = eye(ind2-ind1) m3 = zeros((ind2-ind1, x.size - ind2)) r = hstack((m1, m2, m3)) return r | 46ddd3fab39c4ba0664d368497c7633e8b7283d4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6196/46ddd3fab39c4ba0664d368497c7633e8b7283d4/ooFun.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
302,
12,
92,
4672,
6941,
9901,
4635,
273,
6698,
12,
92,
13,
405,
2130,
468,
464,
261,
728,
22,
17,
728,
21,
13,
405,
374,
18,
2947,
14,
92,
18,
1467,
309,
6941,
9901,
4635,
471,
48... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
302,
12,
92,
4672,
6941,
9901,
4635,
273,
6698,
12,
92,
13,
405,
2130,
468,
464,
261,
728,
22,
17,
728,
21,
13,
405,
374,
18,
2947,
14,
92,
18,
1467,
309,
6941,
9901,
4635,
471,
48... |
doc.AddItem(Bold(_('No such list <em>%s</em>') % listname)) | doc.AddItem(Bold(_('No such list <em>%(listname)s</em>'))) | def main(): doc = Document() parts = Utils.GetPathPieces() if not parts or len(parts) < 2: doc.AddItem(Header(2, _("Error"))) doc.AddItem(Bold(_("Invalid options to CGI script."))) print doc.Format(bgcolor="#ffffff") return listname = string.lower(parts[0]) user = parts[1] try: mlist = MailList.MailList(listname) except Errors.MMListError, e: doc.AddItem(Header(2, _("Error"))) doc.AddItem(Bold(_('No such list <em>%s</em>') % listname)) print doc.Format(bgcolor="#ffffff") syslog('error', 'No such list "%s": %s\n' % (listname, e)) return try: process_form(mlist, user, doc) finally: mlist.Save() mlist.Unlock() | 271131e22a67ced7cee6dcb6fb6840ce57b4190b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/271131e22a67ced7cee6dcb6fb6840ce57b4190b/handle_opts.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
997,
273,
4319,
1435,
2140,
273,
6091,
18,
967,
743,
16539,
8610,
1435,
309,
486,
2140,
578,
562,
12,
6019,
13,
411,
576,
30,
997,
18,
986,
1180,
12,
1864,
12,
22,
16,
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,
2774,
13332,
997,
273,
4319,
1435,
2140,
273,
6091,
18,
967,
743,
16539,
8610,
1435,
309,
486,
2140,
578,
562,
12,
6019,
13,
411,
576,
30,
997,
18,
986,
1180,
12,
1864,
12,
22,
16,
3... |
else: if verbose: output(u"BUGWARNING: %s already done!" % pl.aslink()) | elif verbose: output(u"BUGWARNING: %s already done!" % pl.aslink()) | def __init__(self, site, pages, throttle, force): """First argument is Site object. Second argument is list (should have .append and be iterable)""" self.site = site self.pages = [] self.throttle = throttle for pl in pages: if ((not hasattr(pl,'_contents') and not hasattr(pl,'_getexception')) or force): self.pages.append(pl) else: if verbose: output(u"BUGWARNING: %s already done!" % pl.aslink()) | 1772b9bbdda7283edd40efeb6d36e9202357e6ac /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/1772b9bbdda7283edd40efeb6d36e9202357e6ac/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2834,
16,
4689,
16,
18304,
16,
2944,
4672,
3536,
3759,
1237,
353,
9063,
733,
18,
7631,
1237,
353,
666,
261,
13139,
1240,
263,
6923,
471,
506,
6087,
15574,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2834,
16,
4689,
16,
18304,
16,
2944,
4672,
3536,
3759,
1237,
353,
9063,
733,
18,
7631,
1237,
353,
666,
261,
13139,
1240,
263,
6923,
471,
506,
6087,
15574,
... |
research_children = [ | research_children = [ | def createFolderStructure(portal): """Define which objects we want to create in the site. """ importance_children = [ { 'id': 'statistics', 'title': 'Statistics', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'nutritional-facts', 'title': 'Nutritional facts', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, ] sweetpotatoIntroduction_children = [ { 'id': 'importance', 'title': 'Importance', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', 'children': importance_children, }, { 'id': 'how-to-grow-it', 'title': 'How to grow it', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'history', 'title': 'History', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'biology', 'title': 'Biology', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'photos', 'title': 'Photos', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, ] cipGenebank_children = [ { 'id': 'germplasm-collection', 'title': 'Germplasm Collection', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'germplasm-ordering', 'title': 'Germplasm Ordering', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, ] pqsCollection_children = [ { 'id': 'available-germplasm', 'title': 'Available Germplasm', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, ] germplasmCollection_children = [ { 'id': 'cip-genebank', 'title': 'CIP Genebank', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', 'children': cipGenebank_children, }, { 'id': 'pqs-collection', 'title': 'PQS Collection', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', 'children': pqsCollection_children, }, ] germplasmExchange_children = [ { 'id': 'virus-cleaning-testing', 'title': 'Virus Cleaning and Testing', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'germplasm-exchange', 'title': 'Germplasm Exchange Protocols', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'policy-legal-issues', 'title': 'Policy and Legal Issues', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, ] preBreeding_children = [ { 'id': 'available-material', 'title': 'Available Material', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'results-from-trials', 'title': 'Results from Trials', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, ] availableMaterial_children = [ { 'id': 'released-varieties', 'title': 'Released Varieties', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, ] breedingObjectives_children = [ { 'id': 'drought-resistence', 'title': 'Drought Resistence', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'virus-resistence', 'title': 'Virus Resistence', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'unsweet', 'title': 'Unsweet', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'animal-feed', 'title': 'Animal Feed', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', } ] breeding_children = [ { 'id': 'available-material', 'title': 'Available Material', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', 'children': availableMaterial_children, }, { 'id': 'results-from-trials', 'title': 'Results From Trials', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'breeding-objectives', 'title': 'Breeding Objectives', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', 'children': breedingObjectives_children, } ] farmersVarieties_children = [ { 'id': 'variety-preferences', 'title': 'Variety Preferences', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'selection-practices', 'title': 'Selection Practices', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, ] biotechnology_children = [ { 'id': 'marker-assisted-selection', 'title': 'Marker assisted selection', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'wevil-resistance', 'title': 'Wevil resistance', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, ] gp_children = [ { 'id': 'test-ntoicia', 'title': 'Test noticia', 'description': 'gp-noticias-ejemplo gp-noticias-ejemplo gp-noticias-ejemplo gp-noticias-ejemplo', 'type': 'News Item', 'layout': 'folder_listing', }, { 'id': 'test-ntoicia2', 'title': 'Test noticia 2', 'description': 'gp-noticias-ejemplo gp-noticias-ejemplo gp-noticias-ejemplo gp-noticias-ejemplo', 'type': 'News Item', 'layout': 'folder_listing', }, ] germplasm_children = [ { 'id': 'germplasm-noticias', 'title': 'Germplasm Noticias', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', 'children': gp_children, }, { 'id': 'germplasm-collection', 'title': 'Germplasm Collection', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', 'children': germplasmCollection_children, }, { 'id': 'germplasm-exchange', 'title': 'Germplasm Exchange', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', 'children': germplasmExchange_children, }, { 'id': 'pre-breeding', 'title': 'Pre-breeding', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', 'children': preBreeding_children, }, { 'id': 'breeding', 'title': 'Breeding', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', 'children': breeding_children, }, { 'id': 'farmers-varieties', 'title': 'Farmers Varieties', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', 'children': farmersVarieties_children, }, { 'id': 'biotechnology', 'title': 'Biotechnology', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', 'children': biotechnology_children, }, { 'id': 'research-methods', 'title': 'Research Methods and Tools', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'training-communication', 'title': 'Training and Communication', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, ] foundationSeed_children = [ { 'id': 'in-vitro', 'title': 'In Vitro', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'iroponics', 'title': 'Iroponics', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'screenhouse', 'title': 'Screenhouse', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', } ] fieldMultiplication_children = [ { 'id': 'root-vine', 'title': 'Root & Vine', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'rapid-multiplication-techniques', 'title': 'Rapid multiplication techniques', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, ] onFarm_children = [ { 'id': 'vine-conservation', 'title': 'Vine Conservation', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'root-based', 'title': 'Root based', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, ] seedProgation_children= [ { 'id': 'seed-biology', 'title': 'Seed biology', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'foundation-seed', 'title': 'Foundation seed', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', 'children': foundationSeed_children, }, { 'id': 'field-multiplication', 'title': 'Field multiplication', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', 'children': fieldMultiplication_children, }, { 'id': 'vine-handling', 'title': 'Vine handling', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'on-farm', 'title': 'On Farm', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', 'children': onFarm_children, }, ] onFarm2_children = [ { 'id': 'self-supply', 'title': 'Self-supply', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'informal-supply', 'title': 'Informal supply', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, ] supplyDriven_children = [ { 'id': 'truck-chuck', 'title': 'Truck & Chuck', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': '1-2-3-system', 'title': '1, 2, 3 system', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, ] demandDriven_children = [ { 'id': 'voucher-system', 'title': 'Voucher system', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, ] seedSystemOrganization_children = [ { 'id': 'on-farm', 'title': 'On farm', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', 'children': onFarm2_children, }, { 'id': 'supply-driven', 'title': 'Supply driven', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', 'children': supplyDriven_children, }, { 'id': 'demand-driven', 'title': 'Demand driven', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', 'children': demandDriven_children, }, { 'id': 'commercial-formal', 'title': 'Commercial formal', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'quality-control', 'title': 'Quality control', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'policy-legal-frameworks', 'title': 'Policy & legal frameworks', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'gender-in-seed-systems', 'title': 'Gender in seed systems', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, ] caseStudies_children = [ { 'id': 'farmers-seed-acquisition', 'title': 'Farmers seed acquisition', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, ] seedsystem_children = [ { 'id': 'seed-propagation', 'title': 'Seed Propagation', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', 'children': seedProgation_children, }, { 'id': 'seed-system-organization', 'title': 'Seed system organization', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', 'children': seedSystemOrganization_children, }, { 'id': 'case-studies', 'title': 'Case studies', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', 'children': caseStudies_children, }, { 'id': 'research-methods-tools', 'title': 'Research methods & tools', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'training-communication-material', 'title': 'Training & communication material', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, ] socio_children = [ { 'id': 'Farming-strategies', 'title': 'Farming strategies', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'Cultural-aspects', 'title': 'Cultural aspects', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'Returns-on-investment', 'title': 'Returns on investment', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, ] harvesting_children = [ { 'id': 'time', 'title': 'Time', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'method', 'title': 'Method', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, ] physiology_children = [ { 'id': 'plant-phenology', 'title': 'Plant phenology', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'maturity-indicators', 'title': 'Maturity indicators', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, ] soil_children = [ { 'id': 'nutrient-requirements', 'title': 'Nutrient requirements', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'oraganic-fertilizers', 'title': 'Oraganic fertilizers', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'inorganic-fertilizers', 'title': 'Inorganic fertilizers', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, ] agronomy_children = [ { 'id': 'site-selection', 'title': 'Site selection', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'land-preparation', 'title': 'Land Preparation', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'seed-vines-and-vareity-selection', 'title': 'Seed vines and vareity selection', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'planting', 'title': 'Planting', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'inter-cropping', 'title': 'Inter-cropping', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'crop-rotation', 'title': 'Crop rotation', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'weed-management', 'title': 'Weed management', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, ] deseases_children = [ { 'id': 'viruses', 'title': 'Viruses', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'fungal', 'title': 'Fungal', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'bacterial', 'title': 'Bacterial', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, ] pests_children = [ { 'id': 'inset-pests', 'title': 'Inset pests', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'vertebrate-pests', 'title': 'Vertebrate pests', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'nematodes', 'title': 'Nematodes', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'millipedes', 'title': 'Millipedes', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'other-pests', 'title': 'Other pests', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, ] crop_children = [ { 'id': 'introduction', 'title': 'Introduction', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'pests', 'title': 'Pests', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', 'children': pests_children, }, { 'id': 'deseases', 'title': 'Deseases', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', 'children': deseases_children, }, { 'id': 'agronomy', 'title': 'Agronomy', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', 'children': agronomy_children, }, { 'id': 'soil-fertility-management', 'title': 'Soil fertility management', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', 'children': soil_children, }, { 'id': 'physiology', 'title': 'Physiology', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', 'children': physiology_children, }, { 'id': 'harvesting', 'title': 'Harvesting', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', 'children': harvesting_children, }, { 'id': 'socio-economic-issues', 'title': 'Socio-economic issues', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', 'children': socio_children, }, { 'id': 'case-studies', 'title': 'Case studies', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'research-methods-tools', 'title': 'Research methods & tools', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'training-communication-material', 'title': 'Training & communication material', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, ] africa_children = [ { 'id': 'ssa', 'title': 'SSA', 'description': '', 'type': 'Folder', 'layout': 'folder_listing' }, { 'id': 'ea', 'title': 'EA', 'description': '', 'type': 'Folder', 'layout': 'folder_listing' }, { 'id': 'wa', 'title': 'WA', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'sa', 'title': 'SA', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, ] global_children = [ { 'id': 'test-project', 'title': 'Global Project', 'description': '', 'type': 'Project Folder', 'layout': 'folder_listing', }, { 'id': 'test-project2', 'title': 'Global Project Test', 'description': '', 'type': 'Project Folder', 'layout': 'folder_listing', }, { 'id': 'test-project3', 'title': 'Global Project Another test', 'description': '', 'type': 'Project Folder', 'layout': 'folder_listing', }, ] projects_children = [ { 'id': 'global', 'title': 'Global', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', 'children': global_children, }, { 'id': 'africa', 'title': 'Africa', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', 'children': africa_children, }, { 'id': 'latin-america', 'title': 'Latin America', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'north-america', 'title': 'North America', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, { 'id': 'asia', 'title': 'Asia', 'description': '', 'type': 'Folder', 'layout': 'folder_listing', }, ] | b78dc1b4326a8c5ae2e7bd27bfac3b47d1ae3d8b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6717/b78dc1b4326a8c5ae2e7bd27bfac3b47d1ae3d8b/setuphandlers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
3899,
6999,
12,
24386,
4672,
3536,
11644,
1492,
2184,
732,
2545,
358,
752,
316,
326,
2834,
18,
3536,
1930,
1359,
67,
5906,
273,
306,
288,
282,
296,
350,
4278,
296,
14438,
2187,
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,
752,
3899,
6999,
12,
24386,
4672,
3536,
11644,
1492,
2184,
732,
2545,
358,
752,
316,
326,
2834,
18,
3536,
1930,
1359,
67,
5906,
273,
306,
288,
282,
296,
350,
4278,
296,
14438,
2187,
296,... |
uom_index[move.uom.id] = move.uom | def assign_try(self, cursor, user, id, context=None): location_obj = self.pool.get('stock.location') move_obj = self.pool.get('stock.move') product_obj = self.pool.get('product.product') uom_obj = self.pool.get('product.uom') packing = self.browse(cursor, user, id, context=context) parent_to_locations = {} inventory_moves = [] uom_ids = uom_obj.search(cursor, user, [], context=context) uom_index = dict( (uom.id, uom) for uom in \ uom_obj.browse(cursor, user, uom_ids, context=context)) | 0a6c1eb47be3cd6843851373cc84f2f735d55b53 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9298/0a6c1eb47be3cd6843851373cc84f2f735d55b53/packing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2683,
67,
698,
12,
2890,
16,
3347,
16,
729,
16,
612,
16,
819,
33,
7036,
4672,
2117,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
15381,
18,
3562,
6134,
3635,
67,
2603,
273,
365,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2683,
67,
698,
12,
2890,
16,
3347,
16,
729,
16,
612,
16,
819,
33,
7036,
4672,
2117,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
15381,
18,
3562,
6134,
3635,
67,
2603,
273,
365,
18,
... | |
self.job_post(webbrowser.open_new, (UPDATES_URL, )) | self.job_post(open_new, (UPDATES_URL, )) | def do_updates(self, event): self.job_post(webbrowser.open_new, (UPDATES_URL, )) | 10ca0d8a9841497794134a4525061e8e56c6cafb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1662/10ca0d8a9841497794134a4525061e8e56c6cafb/winpdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
14703,
12,
2890,
16,
871,
4672,
365,
18,
4688,
67,
2767,
12,
4875,
11213,
18,
3190,
67,
2704,
16,
261,
8217,
55,
67,
1785,
16,
8623,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
14703,
12,
2890,
16,
871,
4672,
365,
18,
4688,
67,
2767,
12,
4875,
11213,
18,
3190,
67,
2704,
16,
261,
8217,
55,
67,
1785,
16,
8623,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
else | else: | def __init__(data = None) if data == None: quickfix.DoubleField.__init__(self, 882) else quickfix.DoubleField.__init__(self, 882, data) | 484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
5265,
974,
16186,
2738,
972,
12,
2890,
16,
1725,
11149,
13,
469,
30,
9549,
904,
18,
5265,
974,
16186,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
5265,
974,
16186,
2738,
972,
12,
2890,
16,
1725,
11149,
13,
469,
30,
9549,
904,
18,
5265,
974,
16186,
2... |
if self.parser.openElements[-1].name != "select": | node = self.parser.openElements.pop() while node.name != "select": | def endTagSelect(self, name): if self.parser.elementInScope(name, True): if self.parser.openElements[-1].name != "select": node = self.parser.openElements.pop() while node.name != "select": node = self.parser.openElements.pop() self.parser.resetInsertionMode() else: # innerHTML case self.parser.parseError() | c6087fd9d4eccf5145e72815e0d2a685eaabbc74 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4487/c6087fd9d4eccf5145e72815e0d2a685eaabbc74/parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29765,
3391,
12,
2890,
16,
508,
4672,
309,
365,
18,
4288,
18,
2956,
382,
3876,
12,
529,
16,
1053,
4672,
756,
273,
365,
18,
4288,
18,
3190,
3471,
18,
5120,
1435,
1323,
756,
18,
529,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29765,
3391,
12,
2890,
16,
508,
4672,
309,
365,
18,
4288,
18,
2956,
382,
3876,
12,
529,
16,
1053,
4672,
756,
273,
365,
18,
4288,
18,
3190,
3471,
18,
5120,
1435,
1323,
756,
18,
529,
4... |
return TRACE | logger.info("Trace shape : %s:%s:%s" % (TRACE.shape[0], TRACE.shape[1], TRACE.shape[2])) return TRACE | def CalculateTrace0(lda): eps = finfo(float).eps # Calulate FA #TRACE = return TRACE | 5854844cc8ac07021ebe79ca0011ee121da3289e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12580/5854844cc8ac07021ebe79ca0011ee121da3289e/TensorEval.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9029,
3448,
20,
12,
1236,
69,
4672,
225,
7785,
273,
15190,
12,
5659,
2934,
13058,
225,
468,
3596,
6243,
15064,
468,
23827,
273,
225,
1194,
18,
1376,
2932,
3448,
2179,
294,
738,
87,
5319,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9029,
3448,
20,
12,
1236,
69,
4672,
225,
7785,
273,
15190,
12,
5659,
2934,
13058,
225,
468,
3596,
6243,
15064,
468,
23827,
273,
225,
1194,
18,
1376,
2932,
3448,
2179,
294,
738,
87,
5319,... |
if pathname[-1] == '/': | if pathname and pathname[-1] == '/': | def convert_path (pathname): """Return 'pathname' as a name that will work on the native filesystem, i.e. split it on '/' and put it back together again using the current directory separator. Needed because filenames in the setup script are always supplied in Unix style, and have to be converted to the local convention before we can actually use them in the filesystem. Raises ValueError on non-Unix-ish systems if 'pathname' either starts or ends with a slash. """ if os.sep == '/': return pathname if pathname[0] == '/': raise ValueError, "path '%s' cannot be absolute" % pathname if pathname[-1] == '/': raise ValueError, "path '%s' cannot end with '/'" % pathname paths = string.split(pathname, '/') while '.' in paths: paths.remove('.') if not paths: return os.curdir return apply(os.path.join, paths) | 0b5c11252da09a244cb39de47909ed07f4fa82cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0b5c11252da09a244cb39de47909ed07f4fa82cf/util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
67,
803,
261,
28336,
4672,
3536,
990,
296,
28336,
11,
487,
279,
508,
716,
903,
1440,
603,
326,
6448,
6496,
16,
277,
18,
73,
18,
1416,
518,
603,
2023,
471,
1378,
518,
1473,
9475,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
67,
803,
261,
28336,
4672,
3536,
990,
296,
28336,
11,
487,
279,
508,
716,
903,
1440,
603,
326,
6448,
6496,
16,
277,
18,
73,
18,
1416,
518,
603,
2023,
471,
1378,
518,
1473,
9475,
... |
self.client.voidresp() | self.assertEqual(self.client.voidresp(), "226 transfer complete") | def test_data_connection(self): # clear text sock = self.client.transfercmd('list') self.assertNotIsInstance(sock, ssl.SSLSocket) sock.close() self.client.voidresp() | 73b3632747ecfa87480afc8a00af27a4a7839ce6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/73b3632747ecfa87480afc8a00af27a4a7839ce6/test_ftplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
892,
67,
4071,
12,
2890,
4672,
468,
2424,
977,
7313,
273,
365,
18,
2625,
18,
13866,
4172,
2668,
1098,
6134,
365,
18,
11231,
1248,
2520,
1442,
12,
15031,
16,
5832,
18,
1260,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
892,
67,
4071,
12,
2890,
4672,
468,
2424,
977,
7313,
273,
365,
18,
2625,
18,
13866,
4172,
2668,
1098,
6134,
365,
18,
11231,
1248,
2520,
1442,
12,
15031,
16,
5832,
18,
1260,
2... |
self.assertTrue(rec.id, ids) | self.assertTrue(rec.id in ids) | def check_dict_methods(self, rec_dict, keys, ids): self.assertEqual(set(keys), set(rec_dict.keys())) #This is redundant, I just want to make sure len works: self.assertEqual(len(keys), len(rec_dict)) #Make sure boolean evaluation works self.assertEqual(bool(keys), bool(rec_dict)) for key,id in zip(keys, ids): self.assertTrue(key in rec_dict) self.assertEqual(id, rec_dict[key].id) self.assertEqual(id, rec_dict.get(key).id) #Check non-existant keys, assert chr(0) not in keys, "Bad example in test" try: rec = rec_dict[chr(0)] raise ValueError("Accessing a non-existent key should fail") except KeyError: pass self.assertEqual(rec_dict.get(chr(0)), None) self.assertEqual(rec_dict.get(chr(0), chr(1)), chr(1)) if hasattr(dict, "iteritems"): #Python 2.x for key, rec in rec_dict.iteritems(): self.assertTrue(key in keys) self.assertTrue(isinstance(rec, SeqRecord)) self.assertTrue(rec.id, ids) #Now check non-defined methods... self.assertRaises(NotImplementedError, rec_dict.items) self.assertRaises(NotImplementedError, rec_dict.values) else: #Python 3 assert not hasattr(rec_dict, "iteritems") for key, rec in rec_dict.iteritems(): self.assertTrue(key in id_list) self.assertTrue(isinstance(rec, SeqRecord)) self.assertTrue(rec.id, ids) for rec in rec_dict.itervalues(): self.assertTrue(key in id_list) self.assertTrue(isinstance(rec, SeqRecord)) self.assertTrue(rec.id, ids) #Check the following fail self.assertRaises(NotImplementedError, rec_dict.popitem) self.assertRaises(NotImplementedError, rec_dict.pop, chr(0)) self.assertRaises(NotImplementedError, rec_dict.pop, chr(0), chr(1)) self.assertRaises(NotImplementedError, rec_dict.clear) self.assertRaises(NotImplementedError, rec_dict.__setitem__, "X", None) self.assertRaises(NotImplementedError, rec_dict.copy) self.assertRaises(NotImplementedError, rec_dict.fromkeys, []) | 9f0c3be183e05bbe261e4dc6543b24d162f66bf9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7167/9f0c3be183e05bbe261e4dc6543b24d162f66bf9/test_SeqIO_index.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
1576,
67,
5163,
12,
2890,
16,
1950,
67,
1576,
16,
1311,
16,
3258,
4672,
365,
18,
11231,
5812,
12,
542,
12,
2452,
3631,
444,
12,
3927,
67,
1576,
18,
2452,
1435,
3719,
468,
25... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
1576,
67,
5163,
12,
2890,
16,
1950,
67,
1576,
16,
1311,
16,
3258,
4672,
365,
18,
11231,
5812,
12,
542,
12,
2452,
3631,
444,
12,
3927,
67,
1576,
18,
2452,
1435,
3719,
468,
25... |
format = self._job.get("compile-dist/format", False) | format = compConf.get("code/format", False) | def runCompiled(self, parts, packages, boot, variants): if not self._job.get("compile-dist/file"): return | 2830c647c93dff2c883a2b63993fd15ce9de2f71 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5718/2830c647c93dff2c883a2b63993fd15ce9de2f71/Generator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
20733,
12,
2890,
16,
2140,
16,
5907,
16,
4835,
16,
12935,
4672,
309,
486,
365,
6315,
4688,
18,
588,
2932,
11100,
17,
4413,
19,
768,
6,
4672,
327,
2,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
20733,
12,
2890,
16,
2140,
16,
5907,
16,
4835,
16,
12935,
4672,
309,
486,
365,
6315,
4688,
18,
588,
2932,
11100,
17,
4413,
19,
768,
6,
4672,
327,
2,
-100,
-100,
-100,
-100,
-100,... |
tsolver = pyre.inventory.facility("tsolver", factory=Advection_diffusion.temperature_diffadv) vsolver = pyre.inventory.facility("vsolver", factory=Stokes_solver.incompressibleNewtonian) bc = pyre.inventory.facility("bc", factory=BC) const = pyre.inventory.facility("const", factory=Const) ic = pyre.inventory.facility("ic", factory=IC) param = pyre.inventory.facility("param", factory=Param) phase = pyre.inventory.facility("phase", factory=Phase) tracer = pyre.inventory.facility("tracer", factory=Tracer) visc = pyre.inventory.facility("visc", factory=Visc) datadir = pyre.inventory.str("datadir", default=".") rayleigh = pyre.inventory.float("rayleigh", default=1e+05) Q0 = pyre.inventory.float("Q0", default=0.0) stokes_flow_only = pyre.inventory.bool("stokes_flow_only", default=False) output_format = pyre.inventory.str("output_format", default="ascii", validator=pyre.inventory.choice(["ascii", "hdf5"])) output_optional = pyre.inventory.str("output_optional", default="") verbose = pyre.inventory.bool("verbose", default=False) see_convergence = pyre.inventory.bool("see_convergence", default=True) | tsolver = inv.facility("tsolver", factory=Advection_diffusion.temperature_diffadv) vsolver = inv.facility("vsolver", factory=Stokes_solver.incompressibleNewtonian) bc = inv.facility("bc", factory=BC) const = inv.facility("const", factory=Const) ic = inv.facility("ic", factory=IC) param = inv.facility("param", factory=Param) phase = inv.facility("phase", factory=Phase) tracer = inv.facility("tracer", factory=Tracer) visc = inv.facility("visc", factory=Visc) datadir = inv.str("datadir", default=".") rayleigh = inv.float("rayleigh", default=1e+05) Q0 = inv.float("Q0", default=0.0) stokes_flow_only = inv.bool("stokes_flow_only", default=False) output_format = inv.str("output_format", default="ascii-local", validator=inv.choice(["ascii-local", "ascii", "hdf5"])) output_optional = inv.str("output_optional", default="") verbose = inv.bool("verbose", default=False) see_convergence = inv.bool("see_convergence", default=True) | def finalize(self): from CitcomSLib import output_finalize output_finalize(self.all_variables) return | ef5a5b2712d56359e97337d46a5d542f0ad4d7b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8488/ef5a5b2712d56359e97337d46a5d542f0ad4d7b9/Solver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12409,
12,
2890,
4672,
628,
385,
305,
832,
4559,
495,
1930,
876,
67,
30343,
876,
67,
30343,
12,
2890,
18,
454,
67,
7528,
13,
327,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12409,
12,
2890,
4672,
628,
385,
305,
832,
4559,
495,
1930,
876,
67,
30343,
876,
67,
30343,
12,
2890,
18,
454,
67,
7528,
13,
327,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
options['marker'] = sys.argv[-1] for run in range(1, 101): | options['prefix'] = sys.argv[1] if len(sys.argv) > 2: options['marker'] = sys.argv[2] for run in range(1, 1001): | def delete_entry(key): for name, bucket in settings.S3_BUCKETS.iteritems(): print aws.delete(bucket, key).http_response.status, | 3a8310db3a3a5d31dea967777cb70caae7cdc681 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3111/3a8310db3a3a5d31dea967777cb70caae7cdc681/shotserver04_delete_old_s3.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
67,
4099,
12,
856,
4672,
364,
508,
16,
2783,
316,
1947,
18,
55,
23,
67,
28888,
55,
18,
2165,
3319,
13332,
1172,
2287,
18,
3733,
12,
7242,
16,
498,
2934,
2505,
67,
2740,
18,
232... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1430,
67,
4099,
12,
856,
4672,
364,
508,
16,
2783,
316,
1947,
18,
55,
23,
67,
28888,
55,
18,
2165,
3319,
13332,
1172,
2287,
18,
3733,
12,
7242,
16,
498,
2934,
2505,
67,
2740,
18,
232... |
arguments_info += ("import getopt; opts = getopt.getopt(" "sys.argv[1:], 'S:B:W1')[0];\nstorage = " "opts and opts[0][1] or '1'\nblob_dir = " "opts and opts[1][1] or blob_dir") | arguments_info += ("import getopt; opts = " "getopt.getopt(sys.argv[1:], 'S:B:W1')[0];\n" "opts = dict(opts)\n" "storage = opts.has_key('-S') and " "opts['-S'] or '1'\n" "blob_dir = opts.has_key('-B') and " "opts['-B'] or blob_dir") | def install_scripts(self): options = self.options location = options['location'] | 6e2248a5bf7f92bb4bc4fa0f272ab6698aa0a47c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12226/6e2248a5bf7f92bb4bc4fa0f272ab6698aa0a47c/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3799,
67,
12827,
12,
2890,
4672,
702,
273,
365,
18,
2116,
2117,
273,
702,
3292,
3562,
3546,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3799,
67,
12827,
12,
2890,
4672,
702,
273,
365,
18,
2116,
2117,
273,
702,
3292,
3562,
3546,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
standalone_cmd = "rsync -avx --no-p --no-g --chmod=ugo-wx,u+rw,go+r %s::\"%s\" $HOME/Desktop/%s" %( server, rsync_filenames_client.strip(), _("Teacher") ) | standalone_cmd = "rsync -avx --timeout=30 --ignore-existing --no-p --no-g --chmod=ugo-wx,u+rw,go+r %s::\"%s\" $HOME/Desktop/%s" %( server, rsync_filenames_client.strip(), _("Teacher") ) | def menu_event_all(self, action): start1=time() # don't make actions in clients not selected if self.main.config.GetVar("selectedhosts") == 1: allclients=[] model=self.main.tabla.get_model() rows = [] model.foreach(lambda model, path, iter: rows.append(path)) for host in rows: iter=model.get_iter(host) if model.get_value(iter, COL_SEL_ST): allclients.append(model.get_value(iter, COL_IP)) else: # get all clients connected allclients=self.main.localdata.allclients allclients_txt="" for client in allclients: allclients_txt+="\n %s" %(client) if len(self.main.localdata.allclients) == 0: shared.info_msg ( _("No clients connected, press refresh button.") ) return if action == 0: # Ask for reboot msg=_( _("Do you want to reboot the following hosts:%s?" ) \ %(allclients_txt) ) if shared.ask_msg ( msg ): #gobject.timeout_add( 50, self.action_for_clients, allclients, "reboot" ) self.main.worker=shared.Workers(self.main, None, None) self.main.worker.set_for_all_action(self.action_for_clients,\ allclients, "reboot" ) return if action == 1: # Ask for poweroff msg=_( _("Do you want to poweroff the following hosts:%s?" )\ %(allclients_txt) ) if shared.ask_msg ( msg ): #gobject.timeout_add( 50, self.action_for_clients, allclients, "poweroff" ) self.main.worker=shared.Workers(self.main, None, None) self.main.worker.set_for_all_action(self.action_for_clients,\ allclients, "poweroff" ) return if action == 2: # Ask for lock screens msg=_( _("Do you want to lock the following screens:%s?" )\ %(allclients_txt) ) if shared.ask_msg ( msg ): #gobject.timeout_add( 50, self.action_for_clients, allclients, "lockscreen" ) self.main.worker=shared.Workers(self.main, None, None) self.main.worker.set_for_all_action(self.action_for_clients,\ allclients, "lockscreen" ) return if action == 3: # Ask for unlock screens msg=_( _("Do you want to unlock the following screens:%s?" )\ %(allclients_txt) ) if shared.ask_msg ( msg ): #gobject.timeout_add( 50, self.action_for_clients, allclients, "unlockscreen" ) self.main.worker=shared.Workers(self.main, None, None) self.main.worker.set_for_all_action(self.action_for_clients,\ allclients, "unlockscreen" ) return if action == 4: connected_users=[] for client in allclients: if self.main.localdata.IsLogged(client): connected_users.append(self.main.localdata.GetUsernameAndHost(client)) print_debug("menu_event_all() allclients=%s" %allclients) msg=_( _("Do you want to logout the following users:%s?" )\ %(allclients_txt) ) if shared.ask_msg ( msg ): newusernames=[] remote_cmd="/usr/lib/tcos/session-cmd-send LOGOUT" for user in connected_users: 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 == 5: # Ask for restart X session msg=_( _("Do you want to restart X screens:%s?" )\ %(allclients_txt) ) if shared.ask_msg ( msg ): #gobject.timeout_add( 50, self.action_for_clients, allclients, "restartx" ) self.main.worker=shared.Workers(self.main, None, None) self.main.worker.set_for_all_action(self.action_for_clients,\ allclients, "restartx" ) return if action == 6: connected_users=[] for client in allclients: if self.main.localdata.IsLogged(client): connected_users.append(self.main.localdata.GetUsernameAndHost(client)) print_debug("menu_event_all() client=%s username=%s" %(client, connected_users[-1]) ) self.askfor(mode="exec", users=connected_users) if action == 7: connected_users=[] for client in allclients: if self.main.localdata.IsLogged(client): connected_users.append(self.main.localdata.GetUsernameAndHost(client)) print_debug("menu_event_all() client=%s username=%s" %(client, connected_users[-1]) ) self.askfor(mode="mess", users=connected_users) if action == 8: # demo mode os.system("killall x11vnc 2>/dev/null") #generate password vnc passwd=''.join( Random().sample(string.letters+string.digits, 12) ) self.main.exe_cmd("x11vnc -storepasswd %s %s >/dev/null 2>&1" \ %(passwd, os.path.expanduser('~/.tcosvnc')) ) # start x11vnc in local self.main.exe_cmd( "x11vnc -shared -noshm -viewonly -forever -rfbauth %s" %( os.path.expanduser('~/.tcosvnc') ) ) self.main.write_into_statusbar( _("Waiting for start demo mode...") ) # need to wait for start, PingPort loop from ping import PingPort status = "CLOSED" max_wait=10 wait=0 while status != "OPEN": status=PingPort("127.0.0.1", 5900).get_status() if status == "CLOSED": sleep(1) wait+=1 if wait > max_wait: break total=0 for client in allclients: if self.main.localdata.IsLogged(client): self.main.xmlrpc.vnc("genpass", client, passwd ) # get server ip server_ip=self.main.xmlrpc.GetStandalone("get_server") print_debug("menu_event_all() vnc server ip=%s" %(server_ip)) # start vncviewer self.main.xmlrpc.vnc("startclient", client, server_ip ) total+=1 if total < 1: self.main.write_into_statusbar( _("No users logged.") ) # kill x11vnc self.main.exe_cmd("killall x11vnc 2>/dev/null") else: self.main.write_into_statusbar( _("Running in demo mode with %s clients.") %(total) ) self.main.progresstext.set_text( _("Running in demo mode from host %s...") %server_ip ) # configure action for Stop button self.main.progressstop.show() # use new function to stop self.main.progressstop_target="vnc" self.main.progressstop_args['ip']="" self.main.progresstext.show() if action == 9: # capture screenshot of all and show minis # Ask for unlock screens self.main.worker=shared.Workers(self.main, None, None) self.main.worker.set_for_all_action(self.action_for_clients,\ allclients, "screenshot" ) | 02aa26e9decb17b7531b02e8a9add63d01cedfb3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13520/02aa26e9decb17b7531b02e8a9add63d01cedfb3/TcosActions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3824,
67,
2575,
67,
454,
12,
2890,
16,
1301,
4672,
787,
21,
33,
957,
1435,
225,
468,
2727,
1404,
1221,
4209,
316,
7712,
486,
3170,
309,
365,
18,
5254,
18,
1425,
18,
967,
1537,
2932,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
454,
12,
2890,
16,
1301,
4672,
787,
21,
33,
957,
1435,
225,
468,
2727,
1404,
1221,
4209,
316,
7712,
486,
3170,
309,
365,
18,
5254,
18,
1425,
18,
967,
1537,
2932,
... |
if self.spawn: self.http = http.HTTPServer(self.handle) else: self.http = MainLoopServer(self.handle) s = self.http.start((self.address, 0)) self.port = s.getsockname()[1] | self.server = http.HTTPServer(self.address, self.handle) self.server.start() | def setUp(self): if self.spawn: self.http = http.HTTPServer(self.handle) else: self.http = MainLoopServer(self.handle) s = self.http.start((self.address, 0)) self.port = s.getsockname()[1] | b9d930ec135c6f617f8874d9ec2c540d777d4b53 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10423/b9d930ec135c6f617f8874d9ec2c540d777d4b53/test__http.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
12,
2890,
4672,
309,
365,
18,
1752,
9533,
30,
365,
18,
2505,
273,
1062,
18,
3693,
2081,
12,
2890,
18,
4110,
13,
469,
30,
365,
18,
2505,
273,
12740,
6452,
2081,
12,
2890,
18,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
12,
2890,
4672,
309,
365,
18,
1752,
9533,
30,
365,
18,
2505,
273,
1062,
18,
3693,
2081,
12,
2890,
18,
4110,
13,
469,
30,
365,
18,
2505,
273,
12740,
6452,
2081,
12,
2890,
18,
4... |
import sys, getopt, time, string, regex, regsub | import sys, getopt, time, string, re | def main(): import sys, getopt, time, string, regex, regsub try: opts, args = getopt.getopt(sys.argv[1:], "C:d:Hi:l:Mptr:v:", ["CVS_command", "date", "indent", "length", "Merge", "patches", #### not yet supported "text", "rlog_options", #### not yet supported "version" ]) except getopt.error, msg: sys.stdout = sys.stderr print msg print "Usage: cvs2hist ...options..." print "Options: [-C CVS_command] [-d rcs_date] [-i indent] [-l length]" print " [-M] [-p] [-t] [-r rlog_options] [-v version]" sys.exit(2) # Set up defaults for all of the command line options. cvs_repository = GetCVSRepository() if not cvs_repository: print "cvs2hist must be executed in a working CVS directory" sys.exit(2) cvs_command = "cvs" date_option = "" indent = 0 length = 76 merge = 0 patches = 0 rlog_options = "" text_option = 0; version = "CVS" # override defaults if specified on the command line for o, a in opts: if o == '-C' : cvs_command = a elif o == '-d' : date_option = "'-d>" + a + "'" elif o == '-i' : indent = string.atoi(a) elif o == '-l' : length = string.atoi(a) elif o == '-M' : merge = 1 elif o == '-p' : patches = 1 elif o == '-t' : text_option = 1 elif o == '-r' : rlog_options = a elif o == '-v' : version = a else: print "getopt should have failed already" # return only messages on the default branch, unless told otherwise if rlog_options == "": rlog_options = '-b' # set up the cvs log command arguments. log_date_command = cvs_command + ' -d ' + cvs_repository +' -Q log ' + date_option + ' ' + rlog_options # Acquire the log data. log = BuildLog(log_date_command) # By default, if no date option is specified, produce output for # changes since the most recent tagged version. To avoid a second # pass over the CVS repository, we do the filtering locally. min_date = '0000/00/00 00:00:00' if date_option == "": for date, author, text_lines, file, revision, tags in log: if len(tags) != 0 and date > min_date: min_date = date # Scan the makefiles to find source file names. sources = {} sources = ScanMakefileForSources('src/lib.mak', sources, "Library") for key in sources.keys(): if key[:5] == 'src/s': sources[key] = "Streams" sources = ScanMakefileForSources('src/devs.mak', sources, "Drivers") for key in sources.keys(): if key[:10] == 'src/gdevpd': sources[key] = "PDF writer" sources = ScanMakefileForSources('src/int.mak', sources, "Interpreter") sources = ScanMakefileForSources('src/contrib.mak', sources, "Drivers") # Sort the log by group, then by fix/non-fix, then by date, then by # description (to group logically connected files together). sorter = [] group_pattern = regex.compile("^(\([^)]+\))[ ]+") for date, author, text_lines, file, revision, tags in log: if date <= min_date: continue line = '' while len(text_lines) > 0: line = string.strip(text_lines[0]) if line != '': break text_lines[:1] = [] if merge: group = "(all)" elif group_pattern.match(text_lines[0]) > 0: group = group_pattern.group(1) text_lines[0] = text_lines[0][len(group_pattern.group(0)):] else: group = SourceFileGroup(file, sources) try: group_order = GroupOrder[group] except KeyError: group_order = 99 if line[:4] == "Fix:": text_lines[0] = line[4:] + '\n' section = 0 else: section = regex.match("^Fix", text_lines[0]) < 0 sorter.append(group_order, section, date, group, text_lines, author, file, revision, tags) sorter.sort() log = sorter # Print the HTML header. time_now = time.localtime(time.time()) version_date = time.strftime('%Y-%m-%d', time_now) version_time = time.strftime('%Y-%m-%d %H:%M:%S', time_now) if text_option == 0: print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">" print "<html><head>" print "<title>Ghostscript " + version + " change history as of " + version_time + "</title>" print "<link rel=stylesheet type=\"text/css\" href=\"gs.css\">" print "</head><body>\n" print '<!-- cvs command: ' + log_date_command + ' -->\n' last_group = None groups = [] for omit_group_order, section, date, group, description, author, rcs_file, revision, tags in log: if group != last_group: groups.append(group) last_group = group print VersionTOC(version, version_date, groups) else: print "Ghostscript change history as of " + version_time # Pass through the logs creating new entries based on changing # authors, groups, dates and descriptions. last_group = None last_section = None last_description = None last_author = None last_date = None rev_files = [] for omit_group_order, section, date, group, description, author, rcs_file, revision, tags in log: if group != last_group: if rev_files != []: print ChangeLogEntry(cvs_command, last_author, last_date, rev_files, last_description, prefix, indent, length, patches, text_option)[:-1] rev_files = [] if text_option == 0: print ChangeLogGroupHeader(group, last_group, version) else: print '\n****** ' + group + ' ******' last_group = group last_section = None last_description = None if section != last_section: if rev_files != []: print ChangeLogEntry(cvs_command, last_author, last_date, rev_files, last_description, prefix, indent, length, patches, text_option)[:-1] rev_files = [] (header, prefix) = ChangeLogSectionHeader(section, last_section, version) if header != None: print header last_section = section last_description = None if author != last_author or description != last_description or abs(RCSDateToSeconds(date) - RCSDateToSeconds(last_date)) >= 3: if rev_files != []: print ChangeLogEntry(cvs_command, last_author, last_date, rev_files, last_description, prefix, indent, length, patches, text_option)[:-1] rev_files = [] last_author = author last_date = date last_description = description # Accumulate the revisions and RCS files. rev_files.append(revision, rcs_file) # print the last entry if there is one (i.e. the last two entries # have the same author and date) if rev_files != []: print ChangeLogEntry(cvs_command, last_author, last_date, rev_files, last_description, prefix, indent, length, patches, text_option)[:-1] # Print the HTML trailer. if text_option == 0: print "\n</pre></body></html>" | 92f58f6b8b028bc901c1c5f2bd420c92e105f2c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1296/92f58f6b8b028bc901c1c5f2bd420c92e105f2c9/cvs2hist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
1930,
2589,
16,
336,
3838,
16,
813,
16,
533,
16,
283,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
18,
19485,
63,
21,
30,
6487,
315,
39,
30,
72,
30... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
1930,
2589,
16,
336,
3838,
16,
813,
16,
533,
16,
283,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
18,
19485,
63,
21,
30,
6487,
315,
39,
30,
72,
30... |
self.assertTrue(isinstance(x, int) or isinstance(x, long)) | self.assertTrue(isinstance(x, int) or isinstance(x, int)) | def test_used_phymem(self): x = psutil.used_phymem() self.assertTrue(isinstance(x, int) or isinstance(x, long)) self.assertTrue(x > 0) | 7c397a9e03927d8b5085e42fb287dbdde6e056f2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7296/7c397a9e03927d8b5085e42fb287dbdde6e056f2/test_psutil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
3668,
67,
844,
2942,
351,
12,
2890,
4672,
619,
273,
27024,
18,
3668,
67,
844,
2942,
351,
1435,
365,
18,
11231,
5510,
12,
291,
1336,
12,
92,
16,
509,
13,
578,
1549,
12,
92,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
3668,
67,
844,
2942,
351,
12,
2890,
4672,
619,
273,
27024,
18,
3668,
67,
844,
2942,
351,
1435,
365,
18,
11231,
5510,
12,
291,
1336,
12,
92,
16,
509,
13,
578,
1549,
12,
92,
... |
extra_place = stack_pos(olddepth - 1) | def patch_jump(self, old_pos, new_pos, oldlocs, newlocs, olddepth, newdepth): if len(oldlocs) != len(newlocs): # virtualizable mess return if not we_are_translated(): assert str(oldlocs) == str(newlocs) if newdepth != olddepth: mc2 = self.mcstack.next_mc() pos = mc2.tell() diff = olddepth - newdepth for loc in newlocs: if isinstance(loc, MODRM): has_modrm = True break else: has_modrm = False extra_place = stack_pos(olddepth - 1) # this is unused if diff > 0: if has_modrm: mc2.MOV(extra_place, eax) for i in range(len(newlocs)): loc = newlocs[i] if isinstance(loc, MODRM): mc2.MOV(eax, loc) # diff is negative! mc2.MOV(stack_pos(loc.position + diff), eax) mc2.MOV(eax, extra_place) mc2.ADD(esp, imm32((diff) * WORD)) else: if has_modrm: mc2.MOV(extra_place, eax) for i in range(len(newlocs) -1, -1, -1): loc = newlocs[i] if isinstance(loc, MODRM): mc2.MOV(eax, loc) # diff is negative! mc2.MOV(stack_pos(loc.position + diff), eax) mc2.MOV(eax, extra_place) mc2.SUB(esp, imm32((-diff) * WORD)) mc2.JMP(rel32(new_pos)) self.mcstack.give_mc_back(mc2) else: pos = new_pos mc = codebuf.InMemoryCodeBuilder(old_pos, old_pos + MachineCodeBlockWrapper.MC_SIZE) mc.JMP(rel32(pos)) mc.done() | 0c112a5e27c83146c589bb8b50e4bee486aaf59a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6934/0c112a5e27c83146c589bb8b50e4bee486aaf59a/assembler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4729,
67,
24574,
12,
2890,
16,
1592,
67,
917,
16,
394,
67,
917,
16,
1592,
24323,
16,
394,
24323,
16,
1592,
5979,
16,
394,
5979,
4672,
309,
562,
12,
1673,
24323,
13,
480,
562,
12,
270... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4729,
67,
24574,
12,
2890,
16,
1592,
67,
917,
16,
394,
67,
917,
16,
1592,
24323,
16,
394,
24323,
16,
1592,
5979,
16,
394,
5979,
4672,
309,
562,
12,
1673,
24323,
13,
480,
562,
12,
270... | |
v_indexes=np.argwhere(keep_me_vertices).flatten() | v_indexes=np.argwhere(keep_me_vertices).flatten().astype(int) | def minimum_enclosing_circle(labels, indexes = None, hull_and_point_count = None): """Find the location of the minimum enclosing circle and its radius labels - a labels matrix indexes - an array giving the label indexes to be processed hull_and_point_count - convex_hull output if already done. None = calculate returns an Nx3 array organized as i,j of the center and radius Algorithm from http://www.personal.kent.edu/~rmuhamma/Compgeometry/MyCG/CG-Applets/Center/centercli.htm who calls it the Applet's Algorithm and ascribes it to Pr. Chrystal The original citation is Professor Chrystal, "On the problem to construct the minimum circle enclosing n given points in a plane", Proceedings of the Edinburgh Mathematical Society, vol 3, 1884 """ if indexes == None: if hull_and_point_count is not None: indexes = np.unique(hull_and_point_count[0][:,0]) else: max_label = np.max(labels) indexes = np.array(range(1,max_label+1)) else: indexes = np.array(indexes) if indexes.shape[0] == 0: return np.zeros((0,2)),np.zeros((0,)) if hull_and_point_count is None: hull, point_count = convex_hull(labels, indexes) else: hull, point_count = hull_and_point_count centers = np.zeros((len(indexes),2)) radii = np.zeros((len(indexes),)) # # point_index is the index to the first point in "hull" for a label # point_index = np.zeros((indexes.shape[0],),int) point_index[1:] = np.cumsum(point_count[:-1]) ######################################################################### # # The algorithm is this: # * Choose a line S from S0 to S1 at random from the set of adjacent # S0 and S1 # * For every vertex (V) other than S, compute the angle from S0 # to V to S. If this angle is obtuse, the vertex V lies within the # minimum enclosing circle and can be ignored. # * Find the minimum angle for all V. # If the minimum angle is obtuse, stop and accept S as the diameter of # the circle. # * If the vertex with the minimum angle makes angles S0-S1-V and # S1-S0-V that are acute and right, then take S0, S1 and V as the # triangle within the circumscribed minimum enclosing circle. # * Otherwise, find the largest obtuse angle among S0-S1-V and # S1-S0-V (V is the vertex with the minimum angle, not all of them). # If S0-S1-V is obtuse, make V the new S1, otherwise make V the new S0 # ########################################################################## # # anti_indexes is used to transform a label # into an index in the above array # anti_indexes_per_point gives the label index of any vertex # anti_indexes=np.zeros((np.max(indexes)+1,),int) anti_indexes[indexes] = range(indexes.shape[0]) anti_indexes_per_point = anti_indexes[hull[:,0]] # # Start out by eliminating the degenerate cases: 0, 1 and 2 # centers[point_count==0,:]= np.NaN if np.all(point_count == 0): # Bail if there are no points in any hull to prevent # index failures below. return centers,radii centers[point_count==1,:]=hull[point_index[point_count==1],1:] radii[point_count < 2]=0 centers[point_count==2,:]=(hull[point_index[point_count==2],1:]+ hull[point_index[point_count==2]+1,1:])/2 distance = centers[point_count==2,:] - hull[point_index[point_count==2],1:] radii[point_count==2]=np.sqrt(distance[:,0]**2+distance[:,1]**2) # # Get rid of the degenerate points # keep_me = point_count > 2 # # Pick S0 as the first point in each label # and S1 as the second. # s0_idx = point_index.copy() s1_idx = s0_idx+1 # # number each of the points in a label with an index # which gives # the order in which we'll get their angles. We use this to pick out # points # 2 to N which are the candidate vertices to S # within_label_indexes = (np.array(range(hull.shape[0]),int) - point_index[anti_indexes_per_point]) while(np.any(keep_me)): ############################################################# # Label indexing for active labels ############################################################# # # labels_to_consider contains the labels of the objects which # have not been completed # labels_to_consider = indexes[keep_me] # # anti_indexes_to_consider gives the index into any vector # shaped similarly to labels_to_consider (for instance, min_angle # below) for every label in labels_to_consider. # anti_indexes_to_consider =\ np.zeros((np.max(labels_to_consider)+1,),int) anti_indexes_to_consider[labels_to_consider] = \ np.array(range(labels_to_consider.shape[0])) ############################################################## # Vertex indexing for active vertexes other than S0 and S1 ############################################################## # # The vertices are hull-points with indexes of 2 or more # keep_me_vertices is a mask of the vertices to operate on # during this iteration # keep_me_vertices = np.logical_and(keep_me[anti_indexes_per_point], within_label_indexes >= 2) # # v is the vertex coordinates for each vertex considered # v = hull[keep_me_vertices,1:] # # v_labels is the label from the label matrix for each vertex # v_labels = hull[keep_me_vertices,0] # # v_indexes is the index into "hull" for each vertex (and similarly # shaped vectors such as within_label_indexes # v_indexes=np.argwhere(keep_me_vertices).flatten() # # anti_indexes_per_vertex gives the index into "indexes" and # any similarly shaped array of per-label values # (for instance s0_idx) for each vertex being considered # anti_indexes_per_vertex = anti_indexes_per_point[keep_me_vertices] # # anti_indexes_to_consider_per_vertex gives the index into any # vector shaped similarly to labels_to_consider for each # vertex being analyzed # anti_indexes_to_consider_per_vertex = anti_indexes_to_consider[v_labels] # # Get S0 and S1 per vertex # s0 = hull[s0_idx[keep_me],1:] s1 = hull[s1_idx[keep_me],1:] s0 = s0[anti_indexes_to_consider_per_vertex] s1 = s1[anti_indexes_to_consider_per_vertex] # # Compute the angle S0-S1-V # # the first vector of the angles is between S0 and S1 # s01 = (s0 - s1).astype(float) # # compute V-S1 and V-S0 at each of the vertices to be considered # vs0 = (v - s0).astype(float) vs1 = (v - s1).astype(float) # #` Take the dot product of s01 and vs1 divided by the length of s01 * # the length of vs1. This gives the cosine of the angle between. # dot_vs1s0 = (np.sum(s01*vs1,1) / np.sqrt(np.sum(s01**2,1)*np.sum(vs1**2,1))) angle_vs1s0 = np.abs(np.arccos(dot_vs1s0)) s10 = -s01 dot_vs0s1 = (np.sum(s10*vs0,1) / np.sqrt(np.sum(s01**2,1)*np.sum(vs0**2,1))) angle_vs0s1 = np.abs(np.arccos(dot_vs0s1)) # # S0-V-S1 is pi - the other two # angle_s0vs1 = np.pi - angle_vs1s0 - angle_vs0s1 assert np.all(angle_s0vs1 >= 0) # # Now we find the minimum angle per label # min_angle = scind.minimum(angle_s0vs1,v_labels, labels_to_consider) min_angle = fixup_scipy_ndimage_result(min_angle) min_angle_per_vertex = min_angle[anti_indexes_to_consider_per_vertex] # # Calculate the index into V of the minimum angle per label. # Use "indexes" instead of labels_to_consider so we get something # with the same shape as keep_me # min_position = scind.minimum_position(angle_s0vs1,v_labels, indexes) min_position = fixup_scipy_ndimage_result(min_position).astype(int) min_position = min_position.flatten() # # Case 1: minimum angle is obtuse or right. Accept S as the diameter. # Case 1a: there are no vertices. Accept S as the diameter. # vertex_counts = scind.sum(keep_me_vertices, hull[:,0], labels_to_consider) vertex_counts = fixup_scipy_ndimage_result(vertex_counts) case_1 = np.logical_or(min_angle >= np.pi / 2, vertex_counts == 0) if np.any(case_1): # convert from a boolean over indexes_to_consider to a boolean # over indexes finish_me = np.zeros((indexes.shape[0],),bool) finish_me[anti_indexes[labels_to_consider[case_1]]] = True s0_finish_me = hull[s0_idx[finish_me],1:].astype(float) s1_finish_me = hull[s1_idx[finish_me],1:].astype(float) centers[finish_me] = (s0_finish_me + s1_finish_me)/2 radii[finish_me] = np.sqrt(np.sum((s0_finish_me - s1_finish_me)**2,1))/2 keep_me[finish_me] = False # # Case 2: all angles for the minimum angle vertex are acute # or right. # Pick S0, S1 and the vertex with the # smallest angle as 3 points on the circle. If you look at the # geometry, the diameter is the length of S0-S1 divided by # the cosine of 1/2 of the angle. The center of the circle # is at the circumcenter of the triangle formed by S0, S1 and # V. case_2 = keep_me.copy() case_2[angle_vs1s0[min_position] > np.pi/2] = False case_2[angle_vs0s1[min_position] > np.pi/2] = False case_2[angle_s0vs1[min_position] > np.pi/2] = False if np.any(case_2): # # Wikipedia (http://en.wikipedia.org/wiki/Circumcircle#Cartesian_coordinates) # gives the following: # D = 2(S0y Vx + S1y S0x - S1y Vx - S0y S1x - S0x Vy + S1x Vy) # D = 2(S0x (S1y-Vy) + S1x(Vy-S0y) + Vx(S0y-S1y) # x = ((S0x**2+S0y**2)(S1y-Vy)+(S1x**2+S1y**2)(Vy-S0y)+(Vx**2+Vy**2)(S0y-S1y)) / D # y = ((S0x**2+S0y**2)(Vx-S1x)+(S1x**2+S1y**2)(S0y-Vy)+(Vx**2+Vy**2)(S1y-S0y)) / D # ss0 = hull[s0_idx[case_2],1:].astype(float) ss1 = hull[s1_idx[case_2],1:].astype(float) vv = v[min_position[case_2]].astype(float) Y = 0 X = 1 D = 2*(ss0[:,X] * (ss1[:,Y] - vv[:,Y]) + ss1[:,X] * (vv[:,Y] - ss0[:,Y]) + vv[:,X] * (ss0[:,Y] - ss1[:,Y])) x = (np.sum(ss0**2,1)*(ss1[:,Y] - vv[:,Y]) + np.sum(ss1**2,1)*(vv[:,Y] - ss0[:,Y]) + np.sum(vv**2,1) *(ss0[:,Y] - ss1[:,Y])) / D y = (np.sum(ss0**2,1)*(vv[:,X] - ss1[:,X]) + np.sum(ss1**2,1)*(ss0[:,X] - vv[:,X]) + np.sum(vv**2,1) *(ss1[:,X] - ss0[:,X])) / D centers[case_2,X] = x centers[case_2,Y] = y distances = ss0-centers[case_2] radii[case_2] = np.sqrt(np.sum(distances**2,1)) keep_me[case_2] = False # # Finally, for anybody who's left, for each of S0-S1-V and # S1-S0-V, for V, the vertex with the minimum angle, # find the largest obtuse angle. The vertex of this # angle (S0 or S1) is inside the enclosing circle, so take V # and either S1 or S0 as the new S. # # This involves a relabeling of within_label_indexes. We replace # either S0 or S1 with V and assign V either 0 or 1 # if np.any(keep_me): labels_to_consider = indexes[keep_me] indexes_to_consider = anti_indexes[labels_to_consider] # # Index into within_label_indexes for each V with the # smallest angle # v_obtuse_indexes = v_indexes[min_position[keep_me]] angle_vs0s1_to_consider = angle_vs0s1[min_position[keep_me]] angle_vs1s0_to_consider = angle_vs1s0[min_position[keep_me]] # # Do the cases where S0 is larger # s0_is_obtuse = angle_vs0s1_to_consider > np.pi/2 if np.any(s0_is_obtuse): # # The index of the obtuse S0 # v_obtuse_s0_indexes = v_obtuse_indexes[s0_is_obtuse] obtuse_s0_idx = s0_idx[indexes_to_consider[s0_is_obtuse]] # # S0 gets the within_label_index of the vertex # within_label_indexes[obtuse_s0_idx] = \ within_label_indexes[v_obtuse_s0_indexes] # # Assign V as the new S0 # s0_idx[indexes_to_consider[s0_is_obtuse]] = v_obtuse_s0_indexes within_label_indexes[v_obtuse_s0_indexes] = 0 # # Do the cases where S1 is larger # s1_is_obtuse = np.logical_not(s0_is_obtuse) if np.any(s1_is_obtuse): # # The index of the obtuse S1 # v_obtuse_s1_indexes = v_obtuse_indexes[s1_is_obtuse] obtuse_s1_idx = s1_idx[indexes_to_consider[s1_is_obtuse]] # # S1 gets V's within_label_index and goes onto the list # of considered vertices. # within_label_indexes[obtuse_s1_idx] = \ within_label_indexes[v_obtuse_s1_indexes] # # Assign V as the new S1 # s1_idx[indexes_to_consider[s1_is_obtuse]] = v_obtuse_s1_indexes within_label_indexes[v_obtuse_s1_indexes] = 1 return centers, radii | bfe53262b49df104a793fc4b6f38a07aceca420b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2600/bfe53262b49df104a793fc4b6f38a07aceca420b/cpmorphology.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5224,
67,
1331,
10910,
67,
18970,
12,
5336,
16,
5596,
273,
599,
16,
22474,
67,
464,
67,
1153,
67,
1883,
273,
599,
4672,
3536,
3125,
326,
2117,
434,
326,
5224,
16307,
12470,
471,
2097,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5224,
67,
1331,
10910,
67,
18970,
12,
5336,
16,
5596,
273,
599,
16,
22474,
67,
464,
67,
1153,
67,
1883,
273,
599,
4672,
3536,
3125,
326,
2117,
434,
326,
5224,
16307,
12470,
471,
2097,
... |
iFT = [sum([S[i]*zeta^(-i*j) for i in J]) for j in J] | iFT = [sum([S[i]*zeta**(-i*j) for i in J]) for j in J] if not(J[0] in ZZ) or F.base_ring().fraction_field()!=QQ: raise NotImplementedError, "Sorry this type of idft is not implemented yet." | def idft(self): """ Implements a discrete Fourier transform | 9c13afcbe9dba10ea8450a988631f90a3447d7ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/9c13afcbe9dba10ea8450a988631f90a3447d7ef/dft.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
612,
1222,
12,
2890,
4672,
3536,
29704,
279,
20035,
478,
24775,
2510,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
612,
1222,
12,
2890,
4672,
3536,
29704,
279,
20035,
478,
24775,
2510,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
try: self.__is_trivial except AttributeError: pass self.__is_trivial = True R = self.base_ring() z = self.element() == 0 self.__is_trivial = z return z | return (self.element() == 0) | def is_trivial(self): r""" Returns ``True`` if this is the trivial character, i.e., has order 1. EXAMPLES:: sage: G.<a,b> = DirichletGroup(20) sage: a.is_trivial() False sage: (a^2).is_trivial() True """ try: self.__is_trivial except AttributeError: pass self.__is_trivial = True R = self.base_ring() z = self.element() == 0 self.__is_trivial = z return z | 80bb64cda04307dbe55314d6e4fce85c5aab0086 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/80bb64cda04307dbe55314d6e4fce85c5aab0086/dirichlet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
313,
20109,
12,
2890,
4672,
436,
8395,
2860,
12176,
5510,
10335,
309,
333,
353,
326,
433,
20109,
3351,
16,
277,
18,
73,
12990,
711,
1353,
404,
18,
225,
5675,
8900,
11386,
2866,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
313,
20109,
12,
2890,
4672,
436,
8395,
2860,
12176,
5510,
10335,
309,
333,
353,
326,
433,
20109,
3351,
16,
277,
18,
73,
12990,
711,
1353,
404,
18,
225,
5675,
8900,
11386,
2866,
... |
if len(token_list) > 4: tid = self.input_thread(token_list[4]) pid = debug.system.get_thread(tid).get_pid() else: pid = self.lastEvent.get_pid() tid = self.lastEvent.get_tid() | thread = self.get_thread_from_prefix() tid = thread.get_tid() pid = thread.get_pid() | def do_ba(self, arg): """ ba <a|w|e> <1|2|4|8> <address> [thread] - set hardware breakpoint """ if not self.lastEvent: raise CmdError, "no process is being debugged" debug = self.lastEvent.debug token_list = self.split_tokens(arg, 3, 4) access = token_list[0].lower() size = token_list[1] address = token_list[2] if access == 'a': access = debug.BP_BREAK_ON_ACCESS elif access == 'w': access = debug.BP_BREAK_ON_WRITE elif access == 'e': access = debug.BP_BREAK_ON_EXECUTION else: raise CmdError, "bad access type: %s" % token_list[0] if size == '1': size = debug.BP_WATCH_BYTE elif size == '2': size = debug.BP_WATCH_WORD elif size == '4': size = debug.BP_WATCH_DWORD elif size == '8': size = debug.BP_WATCH_QWORD else: raise CmdError, "bad breakpoint size: %s" % size if len(token_list) > 4: tid = self.input_thread(token_list[4]) pid = debug.system.get_thread(tid).get_pid() else: pid = self.lastEvent.get_pid() tid = self.lastEvent.get_tid() address = self.input_address(address, pid) if debug.has_hardware_breakpoint(tid, address): debug.erase_hardware_breakpoint(tid, address) debug.define_hardware_breakpoint(tid, address, access, size) debug.enable_hardware_breakpoint(tid, address) | 95edb553305e95a1ded0ce46aa595556f55c8dbe /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7261/95edb553305e95a1ded0ce46aa595556f55c8dbe/pdebug.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
12124,
12,
2890,
16,
1501,
4672,
3536,
9846,
411,
69,
96,
91,
96,
73,
34,
411,
21,
96,
22,
96,
24,
96,
28,
34,
411,
2867,
34,
306,
5930,
65,
300,
444,
16251,
18820,
3536,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
12124,
12,
2890,
16,
1501,
4672,
3536,
9846,
411,
69,
96,
91,
96,
73,
34,
411,
21,
96,
22,
96,
24,
96,
28,
34,
411,
2867,
34,
306,
5930,
65,
300,
444,
16251,
18820,
3536,
... |
self.tk.call(self._w, 'update') | self.tk.call(self._w, 'update') | def update(self): | 0049f0036898e656085d5c214ba07642a9c25a6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0049f0036898e656085d5c214ba07642a9c25a6e/Tix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
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,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
return struct.unpack('>q', self.read(8))[0] def _read_string(self): count = struct.unpack('>i', self.read(4))[0] s = self.read(count) if s.endswith('\x00'): s = s[:-1] padding = self.read((4 - (count % 4)) % 4) | return int(fromstring(self.fp.read(8), '>q')[0]) def _pack_string(self, s): count = len(s) self._pack_int(count) self.fp.write(s) self.fp.write('0' * (-count % 4)) def _unpack_string(self): count = self._unpack_int() s = self.fp.read(count).rstrip('\x00') self.fp.read(-count % 4) | def _unpack_int64(self): return struct.unpack('>q', self.read(8))[0] | c5eeb7a30fccf949fe4b4d016a566826aaaf111c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5572/c5eeb7a30fccf949fe4b4d016a566826aaaf111c/pupynere.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
17309,
67,
474,
1105,
12,
2890,
4672,
327,
1958,
18,
17309,
2668,
34,
85,
2187,
365,
18,
896,
12,
28,
3719,
63,
20,
65,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
17309,
67,
474,
1105,
12,
2890,
4672,
327,
1958,
18,
17309,
2668,
34,
85,
2187,
365,
18,
896,
12,
28,
3719,
63,
20,
65,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if linelen + len(c) >= MAXLINESIZE: if prevline is not None: write(prevline) prevline = EMPTYSTRING.join(outline) linelen = 0 outline = [] | def write(s, output=output, lineEnd='\n'): # RFC 1521 requires that the line ending in a space or tab must have # that trailing character encoded. if s and s[-1:] in ' \t': output.write(s[:-1] + quote(s[-1]) + lineEnd) else: output.write(s + lineEnd) | dac67ac8bf994b336748283fa25602639c6a9bf4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dac67ac8bf994b336748283fa25602639c6a9bf4/quopri.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
87,
16,
876,
33,
2844,
16,
980,
1638,
2218,
64,
82,
11,
4672,
468,
8372,
4711,
5340,
4991,
716,
326,
980,
11463,
316,
279,
3476,
578,
3246,
1297,
1240,
468,
716,
7341,
3351,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
87,
16,
876,
33,
2844,
16,
980,
1638,
2218,
64,
82,
11,
4672,
468,
8372,
4711,
5340,
4991,
716,
326,
980,
11463,
316,
279,
3476,
578,
3246,
1297,
1240,
468,
716,
7341,
3351,
... | |
return self.klass.getSchema().signature() | return self.klass('test').Schema().signature() | def signature(self): return self.klass.getSchema().signature() | 9ae385822c63ef8db124c1b1f2a32f095de387c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/9ae385822c63ef8db124c1b1f2a32f095de387c1/Registry.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3372,
12,
2890,
4672,
327,
365,
18,
22626,
18,
588,
3078,
7675,
8195,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
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,
3372,
12,
2890,
4672,
327,
365,
18,
22626,
18,
588,
3078,
7675,
8195,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
elif db in ('sqlite', 'mysql', 'firebird', 'sybase', 'maxdb', 'mssql'): | elif db in ('sqlite', 'firebird', 'sybase', 'maxdb', 'mssql'): | def StringLikeConverter(value, db): if isinstance(value, array_type): try: value = value.tounicode() except ValueError: value = value.tostring() elif isinstance(value, buffer_type): value = str(value) if db == 'postgres': for orig, repl in sqlStringReplace: value = value.replace(orig, repl) elif db in ('sqlite', 'mysql', 'firebird', 'sybase', 'maxdb', 'mssql'): value = value.replace("'", "''") else: assert 0, "Database %s unknown" % db return "'%s'" % value | 067a9d26ee04effbac86d17ae41dd8b99852ef5f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6718/067a9d26ee04effbac86d17ae41dd8b99852ef5f/converters.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
514,
8804,
5072,
12,
1132,
16,
1319,
4672,
309,
1549,
12,
1132,
16,
526,
67,
723,
4672,
775,
30,
460,
273,
460,
18,
88,
465,
3487,
1435,
1335,
2068,
30,
460,
273,
460,
18,
14627,
371... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
514,
8804,
5072,
12,
1132,
16,
1319,
4672,
309,
1549,
12,
1132,
16,
526,
67,
723,
4672,
775,
30,
460,
273,
460,
18,
88,
465,
3487,
1435,
1335,
2068,
30,
460,
273,
460,
18,
14627,
371... |
result = diracAdmin.addSiteInMask(site,comment,printOutput=True) | result = diracAdmin.addSiteInMask( site, comment, printOutput = True ) | def usage(): print 'Usage: %s <DIRAC site name> <COMMENT>' %(Script.scriptName) print 'Note: emails should only be disabled for bulk operations.' DIRAC.exit(2) | 43bc1428e2c48300c638de896bbd95b498bb1274 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/43bc1428e2c48300c638de896bbd95b498bb1274/dirac-admin-allow-site.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
296,
5357,
30,
738,
87,
411,
4537,
2226,
2834,
508,
34,
411,
12200,
1870,
8975,
3651,
18,
4263,
461,
13,
1172,
296,
8067,
30,
14255,
1410,
1338,
506,
5673,
364,
8280,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4084,
13332,
1172,
296,
5357,
30,
738,
87,
411,
4537,
2226,
2834,
508,
34,
411,
12200,
1870,
8975,
3651,
18,
4263,
461,
13,
1172,
296,
8067,
30,
14255,
1410,
1338,
506,
5673,
364,
8280,
... |
allow_public = BoolOption('allow_public', 'Allow random qutoes in public', True) | public_browse = BoolOption('public_browse', 'Allow random quotes in public', True) | def za(self, event, za): try: f = urlopen(self.za_url) except Exception, e: event.addresponse(u'Something went wrong getting to the Lotto site') return s = "".join(f) f.close() balls = self.za_re.findall(s) if len(balls) != 14: event.addresponse(u'I expected to get %(expected)s balls, but found %(found)s. They were: %(balls)s', { 'expected': 14, 'found': len(balls), 'balls': u', '.join(balls), }) return event.addresponse(u'Latest lotto results for South Africa, ' u'Lotto: %(lottoballs)s (Bonus: %(lottobonus)s), Lotto Plus: %(plusballs)s (Bonus: %(plusbonus)s)', { 'lottoballs': u" ".join(balls[:6]), 'lottobonus': balls[6], 'plusballs': u" ".join(balls[7:13]), 'plusbonus': balls[13], }) | c65f3d04c87eb7759428b069709c115dafa11f3e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12048/c65f3d04c87eb7759428b069709c115dafa11f3e/lookup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25001,
12,
2890,
16,
871,
16,
25001,
4672,
775,
30,
284,
273,
19613,
12,
2890,
18,
11939,
67,
718,
13,
1335,
1185,
16,
425,
30,
871,
18,
1289,
2740,
12,
89,
11,
24332,
16343,
7194,
8... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25001,
12,
2890,
16,
871,
16,
25001,
4672,
775,
30,
284,
273,
19613,
12,
2890,
18,
11939,
67,
718,
13,
1335,
1185,
16,
425,
30,
871,
18,
1289,
2740,
12,
89,
11,
24332,
16343,
7194,
8... |
req.write("</b>\n") lines = traceback.format_tb(exc[2]) lines.reverse() for line in lines: if html: req.write(html_encode(line)) req.error(line) | req.write("<p><strong>%s</strong>: %s" % (_tb_encode(etype), _tb_encode(evalue))) req.error("%s: %s\n" % (etype, evalue)) if type(evalue) is types.InstanceType: for name in dir(evalue): if html: req.write("\n<br /><tt> </tt>%s = %s" % (_tb_encode(name), _tb_encode(repr(getattr(evalue, name))))) req.error(" %s = %s\n" % (name, repr(getattr(evalue, name)))) | def traceback(req, html=0): import traceback exc = sys.exc_info() if html: try: req.clear_headers() req.clear_output() req.set_header("Content-Type", "text/html; charset=iso-8859-1") except SequencingError: pass req.write("<html><head><title>jonpy traceback</title></head><body>" "<h1>jonpy traceback</h1><pre><b>") for line in traceback.format_exception_only(exc[0], exc[1]): if html: req.write(html_encode(line)) req.error(line) if html: req.write("</b>\n") lines = traceback.format_tb(exc[2]) lines.reverse() for line in lines: if html: req.write(html_encode(line)) req.error(line) if html: req.write("</pre></body></html>\n") | 87df7558c1b2e0b72fc536db3e1ff72612d20be2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/506/87df7558c1b2e0b72fc536db3e1ff72612d20be2/cgi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10820,
12,
3658,
16,
1729,
33,
20,
4672,
1930,
10820,
3533,
273,
2589,
18,
10075,
67,
1376,
1435,
309,
1729,
30,
775,
30,
1111,
18,
8507,
67,
2485,
1435,
1111,
18,
8507,
67,
2844,
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,
10820,
12,
3658,
16,
1729,
33,
20,
4672,
1930,
10820,
3533,
273,
2589,
18,
10075,
67,
1376,
1435,
309,
1729,
30,
775,
30,
1111,
18,
8507,
67,
2485,
1435,
1111,
18,
8507,
67,
2844,
1435... |
if node._attrs.has_key(name): return 1 for item in node._attrsNS.keys(): if item[1] == name: return 1 return 0 return node._attrsNS.has_key((nsuri, name)) | if node.hasAttribute(name): return True return False return node.hasAttributeNS(nsuri, name) | def hasAttr(self, node, name, nsuri=None): """Return true if element has attribute with the given name and optional nsuri. If nsuri is not specified, returns true if an attribute exists with the given name with any namespace.""" if nsuri is None: if node._attrs.has_key(name): return 1 for item in node._attrsNS.keys(): if item[1] == name: return 1 return 0 return node._attrsNS.has_key((nsuri, name)) | 6b88ff72148b053e6c01eb2b51c3b7e22e41fca3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14538/6b88ff72148b053e6c01eb2b51c3b7e22e41fca3/Utility.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
711,
3843,
12,
2890,
16,
756,
16,
508,
16,
3153,
1650,
33,
7036,
4672,
3536,
990,
638,
309,
930,
711,
1566,
598,
326,
864,
508,
471,
3129,
3153,
1650,
18,
971,
3153,
1650,
353,
486,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
711,
3843,
12,
2890,
16,
756,
16,
508,
16,
3153,
1650,
33,
7036,
4672,
3536,
990,
638,
309,
930,
711,
1566,
598,
326,
864,
508,
471,
3129,
3153,
1650,
18,
971,
3153,
1650,
353,
486,
... |
if sys.platform == "darwin": supports_unicode_filenames = True else: supports_unicode_filenames = False | supports_unicode_filenames = False | def realpath(filename): """Return the canonical path of the specified filename, eliminating any | 2d4e988c35e5da0bf4bd35ca3eb6851e83970764 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2d4e988c35e5da0bf4bd35ca3eb6851e83970764/posixpath.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9098,
12,
3459,
4672,
3536,
990,
326,
7378,
589,
434,
326,
1269,
1544,
16,
19229,
267,
1776,
1281,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
9098,
12,
3459,
4672,
3536,
990,
326,
7378,
589,
434,
326,
1269,
1544,
16,
19229,
267,
1776,
1281,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
metavar="<log file>", help="input git log to convert to standard event xml") | metavar="<log file>", help="input git log to convert to standard event xml") p.add_option("-v", "--vss-log", dest="vss_log", metavar="<log file>", help="input vss report to convert to standard event xml") | def parse_args(argv): """ Parses command line arguments and returns an options object along with any extra arguments. """ p = OptionParser() p.add_option("-s", "--svn-log", dest="svn_log", metavar="<log file>", help="input svn log to convert to standard event xml") p.add_option("-c", "--cvs-log", dest="cvs_log", metavar="<log file>", help="input cvs log to convert to standard event xml") p.add_option("-g", "--git-log", dest="git_log", metavar="<log file>", help="input git log to convert to standard event xml") p.add_option("-w", "--wikimedia-log", dest="wikimedia_log", metavar="<log file>", help="input wikimedia log to convert to standard event xml") p.add_option( "-o", "--output-log", dest="output_log", metavar="<log file>", help="specify standard log output file") (options, args) = p.parse_args(argv) return (options, args) | 8a09873aa569b587f86a7b1b18c47ad032cba913 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5288/8a09873aa569b587f86a7b1b18c47ad032cba913/convert_logs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
1968,
12,
19485,
4672,
3536,
2280,
2420,
1296,
980,
1775,
471,
1135,
392,
702,
733,
7563,
598,
1281,
2870,
1775,
18,
3536,
293,
273,
18862,
1435,
225,
293,
18,
1289,
67,
3482,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
1968,
12,
19485,
4672,
3536,
2280,
2420,
1296,
980,
1775,
471,
1135,
392,
702,
733,
7563,
598,
1281,
2870,
1775,
18,
3536,
293,
273,
18862,
1435,
225,
293,
18,
1289,
67,
3482,
... |
if self.eolmode != 'strict' and eol != '\n': | if self.eolmode != 'strict' and eol and eol != '\n': | def writelines(self, fname, lines): # Ensure supplied data ends in fname, being a regular file or # a symlink. updatedir() will -too magically- take care of # setting it to the proper type afterwards. islink = os.path.islink(fname) if islink: fp = cStringIO.StringIO() else: fp = self.opener(fname, 'w') try: if self.eolmode == 'auto' and self.eol: eol = self.eol elif self.eolmode == 'crlf': eol = '\r\n' else: eol = '\n' | 70e75580f201a5657647fec96b40a9a4279aa27e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11312/70e75580f201a5657647fec96b40a9a4279aa27e/patch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6004,
1465,
12,
2890,
16,
5299,
16,
2362,
4672,
468,
7693,
4580,
501,
3930,
316,
5299,
16,
3832,
279,
6736,
585,
578,
468,
279,
10563,
18,
3526,
481,
1435,
903,
300,
16431,
4447,
6478,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6004,
1465,
12,
2890,
16,
5299,
16,
2362,
4672,
468,
7693,
4580,
501,
3930,
316,
5299,
16,
3832,
279,
6736,
585,
578,
468,
279,
10563,
18,
3526,
481,
1435,
903,
300,
16431,
4447,
6478,
... |
if start == end: raise IndexError ("not in range (empty)") | def line_index_from_super (self, li): | 9f861d2f394f3af1067b299d5e87f62ebb289a8e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12310/9f861d2f394f3af1067b299d5e87f62ebb289a8e/GUI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
980,
67,
1615,
67,
2080,
67,
9565,
261,
2890,
16,
4501,
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... | [
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,
980,
67,
1615,
67,
2080,
67,
9565,
261,
2890,
16,
4501,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... | |
''' Enter DNA Origami mode''' msg1 = greenmsg("DNA Origami: ") msg2 = " Not implemented yet" final_msg = msg1 + msg2 env.history.message(final_msg) | ''' Enter DNA Origami mode''' msg1 = greenmsg("DNA Origami: ") msg2 = " Not implemented yet" final_msg = msg1 + msg2 env.history.message(final_msg) | def buildDnaOrigami(self): | c25263540add024396d4bcf7631292f1fd2d50bb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/c25263540add024396d4bcf7631292f1fd2d50bb/MWsemantics.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
40,
6582,
4741,
26223,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
40,
6582,
4741,
26223,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
ldate.after(200,update) | timer1=ldate.after(200,update) | def update(): global root_geom,isec0,im,pim,ndbm0,nsec0,a,ftx0,nin0,nout0, \ receiving,transmitting,newdat,nscroll,newspec,scale0,offset0, \ modpixmap0,tw,s0,c0,fmid,fmid0,loopall,ntr0,txmsg,iband0, \ bandmap,bm,t0,nreject,gain,phdeg,ierr tsec=time.time() utc=time.gmtime(tsec) nsec=int(tsec) nsec0=nsec ns120=nsec % 120 if hopping.hoppingconfigured.get()==1: bhopping.configure(state=NORMAL) else: bhopping.configure(state=DISABLED) hopped=0 if not idle.get(): if hopping.hopping.get()==1: w.acom1.nfhopping=1 if w.acom1.nfhopok: w.acom1.nfhopok=0 b=-1 if hopping.coord_bands.get()==1: ns=nsec % 86400 ns1=ns % (10*120) b=ns1/120 + 3 if b==12: b=2 if hopping.hoppingflag[b].get()==0: b=-1 if b<0: found=False while not found: b = random.randint(1,len(hopping.bandlabels)-1) if hopping.hoppingflag[b].get()!=0: found=True ipctx.set(hopping.hoppingpctx[b].get()) if b!=iband.get(): hopped=1 iband.set(b) else: w.acom1.nfhopping=0 ns=nsec % 86400 ns1=ns % (10*120) b=ns1/120 + 3 if b==12: b=2 if iband.get()==b and random.randint(1,2)==1 and ipctx.get()>0: w.acom1.ntxnext=1 try: f0.set(float(sf0.get())) ftx.set(float(sftx.get())) except: pass isec=utc[5] twait=120.0 - (tsec % 120.0) if iband.get()!=iband0 or advanced.fset.get(): advanced.fset.set(0) f0.set(freq0[iband.get()]) t="%.6f" % (f0.get(),) sf0.set(t) ftx.set(freqtx[iband.get()]) t="%.6f" % (ftx.get(),) sftx.set(t) if options.cat_enable.get(): if advanced.encal.get(): nHz=int(advanced.Acal.get() + \ f0.get()*(1000000.0 + advanced.Bcal.get()) + 0.5) else: nHz=int(1000000.0*f0.get() + 0.5) if options.rignum.get()==2509 or options.rignum.get()==2511: nHzLO=nHz - iq.fiq.get() cmd="rigctl -m %d -r %s F %d" % \ (options.rignum.get(),options.CatPort.get(),nHzLO) else: cmd="rigctl -m %d -r %s -s %d -C data_bits=%s -C stop_bits=%s -C serial_handshake=%s F %d" % \ (options.rignum.get(),options.CatPort.get(), \ options.serial_rate.get(),options.databits.get(), \ options.stopbits.get(),options.serial_handshake.get(), nHz) ierr=os.system(cmd) if ierr==0: ierr2=0 bandmap=[] bm={} text1.configure(state=NORMAL) text1.delete('1.0',END) text1.configure(state=DISABLED) iband0=iband.get() f=open(appdir+'/fmt.ini',mode='w') f.write(cmd+'\n') f.write(str(g.ndevin.get())+'\n') f.close() cmd2='' if os.path.exists('.\user_hardware.bat') or \ os.path.exists('.\user_hardware.cmd') or \ os.path.exists('.\user_hardware.exe'): cmd2='.\user_hardware ' + str(band[iband0]) elif os.path.exists('./user_hardware'): cmd2='./user_hardware ' + str(band[iband0]) if cmd2!='': try: ierr2=os.system(cmd2) except: print 'Execution of "'+cmd2+'" failed.' else: print 'Error attempting to set rig frequency.\a' print cmd + '\a' iband.set(iband0) f0.set(freq0[iband.get()]) t="%.6f" % (f0.get(),) sf0.set(t) ftx.set(freqtx[iband.get()]) t="%.6f" % (ftx.get(),) sftx.set(t) | f1689aca5e95bcd440044ecc67287fa41f60c29b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2394/f1689aca5e95bcd440044ecc67287fa41f60c29b/wspr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
13332,
2552,
1365,
67,
10049,
16,
291,
557,
20,
16,
381,
16,
84,
381,
16,
82,
1966,
81,
20,
16,
82,
3321,
20,
16,
69,
16,
74,
978,
20,
16,
82,
267,
20,
16,
82,
659,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
13332,
2552,
1365,
67,
10049,
16,
291,
557,
20,
16,
381,
16,
84,
381,
16,
82,
1966,
81,
20,
16,
82,
3321,
20,
16,
69,
16,
74,
978,
20,
16,
82,
267,
20,
16,
82,
659,
20,
1... |
{'stokes':'CGS unit defined to be 1/10000 of meter^2/second.'}, | {'stokes':'CGS unit defined to be 1/10000 of meter^2/second.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5302,
4873,
1576,
13332,
3536,
6910,
777,
326,
533,
924,
434,
326,
2836,
1576,
2190,
635,
3675,
12697,
10138,
16,
471,
10736,
2690,
1308,
4606,
364,
28769,
434,
999,
18,
1220,
445,
353,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5302,
4873,
1576,
13332,
3536,
6910,
777,
326,
533,
924,
434,
326,
2836,
1576,
2190,
635,
3675,
12697,
10138,
16,
471,
10736,
2690,
1308,
4606,
364,
28769,
434,
999,
18,
1220,
445,
353,
... |
Probablity and Statistics Tables and Formulae. Chapman & Hall: New | Probability and Statistics Tables and Formulae. Chapman & Hall: New | def spearmanr(a, b=None, axis=0): """ Calculates a Spearman rank-order correlation coefficient and the p-value to test for non-correlation. The Spearman correlation is a nonparametric measure of the linear relationship between two datasets. Unlike the Pearson correlation, the Spearman correlation does not assume that both datasets are normally distributed. Like other correlation coefficients, this one varies between -1 and +1 with 0 implying no correlation. Correlations of -1 or +1 imply an exact linear relationship. Positive correlations imply that as x increases, so does y. Negative correlations imply that as x increases, y decreases. The p-value roughly indicates the probability of an uncorrelated system producing datasets that have a Spearman correlation at least as extreme as the one computed from these datasets. The p-values are not entirely reliable but are probably reasonable for datasets larger than 500 or so. spearmanr currently does not do any tie correction, and is only correct if there are no ties in the data. Parameters ---------- a, b : 1D or 2D array_like, b is optional One or two 1-D or 2-D arrays containing multiple variables and observations. Each column of m represents a variable, and each row entry a single observation of those variables. Also see axis below. Both arrays need to have the same length in the `axis` dimension. axis : int or None, optional If axis=0 (default), then each column represents a variable, with observations in the rows. If axis=0, the relationship is transposed: each row represents a variable, while the columns contain observations. If axis=None, then both arrays will be raveled Returns ------- rho: float or array (2D square) Spearman correlation matrix or correlation coefficient (if only 2 variables are given as parameters. Correlation matrix is square with length equal to total number of variables (columns or rows) in a and b combined p-value : float The two-sided p-value for a hypothesis test whose null hypothesis is that two sets of data are uncorrelated, has same dimension as rho Notes ----- changes in scipy 0.8: rewrite to add tie-handling, and axis References ---------- [CRCProbStat2000]_ Section 14.7 .. [CRCProbStat2000] Zwillinger, D. and Kokoska, S. (2000). CRC Standard Probablity and Statistics Tables and Formulae. Chapman & Hall: New York. 2000. Examples -------- >>> spearmanr([1,2,3,4,5],[5,6,7,8,7]) (0.82078268166812329, 0.088587005313543798) >>> np.random.seed(1234321) >>> x2n=np.random.randn(100,2) >>> y2n=np.random.randn(100,2) >>> spearmanr(x2n) (0.059969996999699973, 0.55338590803773591) >>> spearmanr(x2n[:,0], x2n[:,1]) (0.059969996999699973, 0.55338590803773591) >>> rho, pval = spearmanr(x2n,y2n) >>> rho array([[ 1. , 0.05997 , 0.18569457, 0.06258626], [ 0.05997 , 1. , 0.110003 , 0.02534653], [ 0.18569457, 0.110003 , 1. , 0.03488749], [ 0.06258626, 0.02534653, 0.03488749, 1. ]]) >>> pval array([[ 0. , 0.55338591, 0.06435364, 0.53617935], [ 0.55338591, 0. , 0.27592895, 0.80234077], [ 0.06435364, 0.27592895, 0. , 0.73039992], [ 0.53617935, 0.80234077, 0.73039992, 0. ]]) >>> rho, pval = spearmanr(x2n.T, y2n.T, axis=1) >>> rho array([[ 1. , 0.05997 , 0.18569457, 0.06258626], [ 0.05997 , 1. , 0.110003 , 0.02534653], [ 0.18569457, 0.110003 , 1. , 0.03488749], [ 0.06258626, 0.02534653, 0.03488749, 1. ]]) >>> spearmanr(x2n, y2n, axis=None) (0.10816770419260482, 0.1273562188027364) >>> spearmanr(x2n.ravel(), y2n.ravel()) (0.10816770419260482, 0.1273562188027364) >>> xint = np.random.randint(10,size=(100,2)) >>> spearmanr(xint) (0.052760927029710199, 0.60213045837062351) """ a, axisout = _chk_asarray(a, axis) ar = np.apply_along_axis(rankdata,axisout,a) br = None if not b is None: b, axisout = _chk_asarray(b, axis) br = np.apply_along_axis(rankdata,axisout,b) n = a.shape[axisout] rs = np.corrcoef(ar,br,rowvar=axisout) t = rs * np.sqrt((n-2) / ((rs+1.0)*(1.0-rs))) prob = distributions.t.sf(np.abs(t),n-2)*2 if rs.shape == (2,2): return rs[1,0], prob[1,0] else: return rs, prob | d03be56073480c044df36c5a42d3e8f24c1327c4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12971/d03be56073480c044df36c5a42d3e8f24c1327c4/stats.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17785,
4610,
304,
86,
12,
69,
16,
324,
33,
7036,
16,
2654,
33,
20,
4672,
3536,
26128,
279,
348,
347,
4610,
304,
6171,
17,
1019,
12603,
16554,
471,
326,
293,
17,
1132,
358,
1842,
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,
17785,
4610,
304,
86,
12,
69,
16,
324,
33,
7036,
16,
2654,
33,
20,
4672,
3536,
26128,
279,
348,
347,
4610,
304,
6171,
17,
1019,
12603,
16554,
471,
326,
293,
17,
1132,
358,
1842,
364,
... |
self._notxn = notxn | def open(self, verbose=False, create=False, notxn=False): | 793acc675ad871332cdc05c1e4b5c2a9ce5c6a4a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/793acc675ad871332cdc05c1e4b5c2a9ce5c6a4a/XMLRepository.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
2890,
16,
3988,
33,
8381,
16,
752,
33,
8381,
16,
486,
22695,
33,
8381,
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... | [
1,
1,
1,
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,
1696,
12,
2890,
16,
3988,
33,
8381,
16,
752,
33,
8381,
16,
486,
22695,
33,
8381,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
value = ' '.join(value) | value = u' '.join(value) | def index_document(self, document): self.set_changed() # Create the document to index doc_number = self.documents.n_documents catalog_document = Document(doc_number) | c4f713fbc2432c906108675261272c0dc3930068 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/c4f713fbc2432c906108675261272c0dc3930068/catalog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
770,
67,
5457,
12,
2890,
16,
1668,
4672,
365,
18,
542,
67,
6703,
1435,
468,
1788,
326,
1668,
358,
770,
997,
67,
2696,
273,
365,
18,
24795,
18,
82,
67,
24795,
6222,
67,
5457,
273,
431... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
770,
67,
5457,
12,
2890,
16,
1668,
4672,
365,
18,
542,
67,
6703,
1435,
468,
1788,
326,
1668,
358,
770,
997,
67,
2696,
273,
365,
18,
24795,
18,
82,
67,
24795,
6222,
67,
5457,
273,
431... |
if path.isdir('pics'): self.iconpath = 'pics' elif path.isdir('../share/casnet/pics'): self.iconpath = '../share/casnet/pics' elif path.isdir('/usr/share/casnet/pics'): self.iconpath = '/usr/share/casnet/pics' else: self.pop_dialog('Error', 'Can not find casnet icons.') | self.iconpath = path.join(file_dir, 'pics') if not path.isdir(self.iconpath): self.pop_dialog('Error', 'Can not find casnet icons.') | def __init__(self): # Find casnet icons path. if sys.platform == 'win32': file_dir = path.dirname(sys.argv[0]); self.iconpath = path.join(file_dir.decode('gbk').encode('utf8'), 'pics') else: if path.isdir('pics'): self.iconpath = 'pics' elif path.isdir('../share/casnet/pics'): self.iconpath = '../share/casnet/pics' elif path.isdir('/usr/share/casnet/pics'): self.iconpath = '/usr/share/casnet/pics' else: self.pop_dialog('Error', 'Can not find casnet icons.') # Get saved account information. s = casnetconf.show() if s != False: self.account = s.split(':') | f69d61397ba29e75c91c85aefaaf2fee6511d5f3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4851/f69d61397ba29e75c91c85aefaaf2fee6511d5f3/casnet-gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
468,
4163,
8697,
2758,
17455,
589,
18,
309,
2589,
18,
9898,
422,
296,
8082,
1578,
4278,
585,
67,
1214,
273,
589,
18,
12287,
12,
9499,
18,
19485,
63,
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,
1001,
2738,
972,
12,
2890,
4672,
468,
4163,
8697,
2758,
17455,
589,
18,
309,
2589,
18,
9898,
422,
296,
8082,
1578,
4278,
585,
67,
1214,
273,
589,
18,
12287,
12,
9499,
18,
19485,
63,
20... |
init_plugins=not opts.noplugins, | init_plugins=not opts.noplugins, plugin_types=(plugins.TYPE_CORE,plugins.TYPE_INTERFACE,), | def repo_optcb(optobj, opt, value, parser): '''Callback for the enablerepo and disablerepo option. Combines the values given for these options while preserving order from command line. ''' dest = eval('parser.values.%s' % optobj.dest) dest.append((opt, value)) | 535ef412c0e911f8f6f129fd723215fb5e3f705d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5445/535ef412c0e911f8f6f129fd723215fb5e3f705d/cli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3538,
67,
3838,
7358,
12,
3838,
2603,
16,
2153,
16,
460,
16,
2082,
4672,
9163,
2428,
364,
326,
570,
27371,
881,
83,
471,
1015,
27371,
881,
83,
1456,
18,
225,
15645,
1465,
326,
924,
864... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3538,
67,
3838,
7358,
12,
3838,
2603,
16,
2153,
16,
460,
16,
2082,
4672,
9163,
2428,
364,
326,
570,
27371,
881,
83,
471,
1015,
27371,
881,
83,
1456,
18,
225,
15645,
1465,
326,
924,
864... |
if verbose: print "compiling string with syntax error" | def test_complex_args(self): | exec 'def f(a, a): pass' | 75f85542b2bfe397d3317ab4cac8ce6b3bf8469a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/75f85542b2bfe397d3317ab4cac8ce6b3bf8469a/test_compile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1196,
296,
536,
284,
12,
69,
16,
279,
4672,
1342,
11,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1196,
296,
536,
284,
12,
69,
16,
279,
4672,
1342,
11,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
filename = self.get_param('name', missing, 'content-disposition') | filename = self.get_param('name', missing, 'content-type') | def get_filename(self, failobj=None): """Return the filename associated with the payload if present. | 5d43434df6214f0f717c3237f48055f5b4a81290 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/5d43434df6214f0f717c3237f48055f5b4a81290/message.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3459,
12,
2890,
16,
2321,
2603,
33,
7036,
4672,
3536,
990,
326,
1544,
3627,
598,
326,
2385,
309,
3430,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3459,
12,
2890,
16,
2321,
2603,
33,
7036,
4672,
3536,
990,
326,
1544,
3627,
598,
326,
2385,
309,
3430,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if not swig_sources: | for source in sources: (base, ext) = os.path.splitext(source) if ext == ".i": new_sources.append(base + target_ext) swig_sources.append(source) swig_targets[source] = new_sources[-1] else: new_sources.append(source) if not swig_sources: return new_sources swig = self.find_swig() swig_cmd = [swig, "-python", "-ISWIG"] if self.swig_cpp: swig_cmd.append("-c++") for source in swig_sources: target = swig_targets[source] self.announce("swigging %s to %s" % (source, target)) self.spawn(swig_cmd + ["-o", target, source]) | def swig_sources (self, sources): """Walk the list of source files in 'sources', looking for SWIG interface (.i) files. Run SWIG on all that are found, and return a modified 'sources' list with SWIG source files replaced by the generated C (or C++) files. """ new_sources = [] swig_sources = [] swig_targets = {} # XXX this drops generated C/C++ files into the source tree, which # is fine for developers who want to distribute the generated # source -- but there should be an option to put SWIG output in # the temp dir. if self.swig_cpp: target_ext = '.cpp' else: target_ext = '.c' for source in sources: (base, ext) = os.path.splitext(source) if ext == ".i": # SWIG interface file new_sources.append(base + target_ext) swig_sources.append(source) swig_targets[source] = new_sources[-1] else: new_sources.append(source) if not swig_sources: return new_sources swig = self.find_swig() swig_cmd = [swig, "-python", "-ISWIG"] if self.swig_cpp: swig_cmd.append("-c++") for source in swig_sources: target = swig_targets[source] self.announce("swigging %s to %s" % (source, target)) self.spawn(swig_cmd + ["-o", target, source]) return new_sources | a3445be2469ebc765311af9285429177182b14f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8055/a3445be2469ebc765311af9285429177182b14f6/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1352,
360,
67,
10141,
261,
2890,
16,
5550,
4672,
225,
3536,
9463,
326,
666,
434,
1084,
1390,
316,
296,
10141,
2187,
7849,
364,
16392,
3047,
1560,
261,
18,
77,
13,
1390,
18,
225,
1939,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1352,
360,
67,
10141,
261,
2890,
16,
5550,
4672,
225,
3536,
9463,
326,
666,
434,
1084,
1390,
316,
296,
10141,
2187,
7849,
364,
16392,
3047,
1560,
261,
18,
77,
13,
1390,
18,
225,
1939,
... |
if (re.match("^[a-z0-9][-+.a-z0-9]*:",val_unescaped) or | if (re.match("^[a-z0-9][-+.a-z0-9]*:",val_unescaped) and | def sanitize_token(self, token): if token["type"] in (tokenTypes["StartTag"], tokenTypes["EndTag"], tokenTypes["EmptyTag"]): if token["name"] in self.allowed_elements: if token.has_key("data"): attrs = dict([(name,val) for name,val in token["data"][::-1] if name in self.allowed_attributes]) for attr in self.attr_val_is_uri: if not attrs.has_key(attr): continue val_unescaped = re.sub("[`\000-\040\177-\240\s]+", '', unescape(attrs[attr])).lower() if (re.match("^[a-z0-9][-+.a-z0-9]*:",val_unescaped) or (val_unescaped.split(':')[0] not in self.allowed_protocols)): del attrs[attr] for attr in self.svg_attr_val_allows_ref: if attr in attrs: attrs[attr] = re.sub(r'url\s*\(\s*[^#\s][^)]+?\)', ' ', unescape(attrs[attr])) if (token["name"] in self.svg_allow_local_href and 'xlink:href' in attrs and re.find('^\s*[^#\s].*', attrs['xlink:href'])): del attrs['xlink:href'] if attrs.has_key('style'): attrs['style'] = self.sanitize_css(attrs['style']) token["data"] = [[name,val] for name,val in attrs.items()] return token else: if token["type"] == tokenTypes["EndTag"]: token["data"] = "</%s>" % token["name"] elif token["data"]: attrs = ''.join([' %s="%s"' % (k,escape(v)) for k,v in token["data"]]) token["data"] = "<%s%s>" % (token["name"],attrs) else: token["data"] = "<%s>" % token["name"] if token["type"] == tokenTypes["EmptyTag"]: token["data"]=token["data"][:-1] + "/>" token["type"] = tokenTypes["Characters"] del token["name"] return token elif token["type"] == tokenTypes["Comment"]: pass else: return token | 71c2701963a95992cb3e3033f4c6fa8c252bbee9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4487/71c2701963a95992cb3e3033f4c6fa8c252bbee9/sanitizer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8881,
67,
2316,
12,
2890,
16,
1147,
4672,
309,
1147,
9614,
723,
11929,
316,
261,
2316,
2016,
9614,
30512,
6,
6487,
1147,
2016,
9614,
25633,
6,
6487,
1147,
2016,
9614,
1921,
1805,
11929,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8881,
67,
2316,
12,
2890,
16,
1147,
4672,
309,
1147,
9614,
723,
11929,
316,
261,
2316,
2016,
9614,
30512,
6,
6487,
1147,
2016,
9614,
25633,
6,
6487,
1147,
2016,
9614,
1921,
1805,
11929,
... |
[(0, 1, None), (0, 10, None), (0, 19, None), (1, 8, None), (1, 2, None), (2, 3, None), (2, 6, None), (3, 19, None), (3, 4, None), (4, 17, None), (4, 5, None), (5, 6, None), (5, 15, None), (6, 7, None), (7, 8, None), (7, 14, None), (8, 9, None), (9, 10, None), (9, 13, None), (10, 11, None), (11, 12, None), (11, 18, None), (12, 16, None), (12, 13, None), (13, 14, None), (14, 15, None), (15, 16, None), (16, 17, None), (17, 18, None), (18, 19, None)] | [(0, 1, None), (0, 10, None), (0, 19, None), (1, 2, None), (1, 8, None), (2, 3, None), (2, 6, None), (3, 4, None), (3, 19, None), (4, 5, None), (4, 17, None), (5, 6, None), (5, 15, None), (6, 7, None), (7, 8, None), (7, 14, None), (8, 9, None), (9, 10, None), (9, 13, None), (10, 11, None), (11, 12, None), (11, 18, None), (12, 13, None), (12, 16, None), (13, 14, None), (14, 15, None), (15, 16, None), (16, 17, None), (17, 18, None), (18, 19, None)] | def edges(self, labels=True, sort=True): """ Return a list of edges. Each edge is a triple (u,v,l) where u and v are vertices and l is a label. INPUT: labels -- (bool; default: True) if False, each edge is a tuple (u,v) of vertices. sort -- (bool; default: True) if True, ensure that the list of edges is sorted. | 38a9e93ecb64b46222d35eb9bfaec1190282da29 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/38a9e93ecb64b46222d35eb9bfaec1190282da29/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5231,
12,
2890,
16,
3249,
33,
5510,
16,
1524,
33,
5510,
4672,
3536,
2000,
279,
666,
434,
5231,
18,
8315,
3591,
353,
279,
14543,
261,
89,
16,
90,
16,
80,
13,
1625,
582,
471,
331,
854,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5231,
12,
2890,
16,
3249,
33,
5510,
16,
1524,
33,
5510,
4672,
3536,
2000,
279,
666,
434,
5231,
18,
8315,
3591,
353,
279,
14543,
261,
89,
16,
90,
16,
80,
13,
1625,
582,
471,
331,
854,... |
def bessel_J(nu,z,alg="pari",prec=53): | def bessel_J(nu,z,algorithm="pari",prec=53): | 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) 0.13656415395665... sage: bessel_J(0,1.1) 0.71962201852751... sage: bessel_J(0,1) 0.76519768655796... We check consistency of PARI and Maxima: sage: n(bessel_J(3,10,"maxima")) 0.0583793793051... sage: n(bessel_J(3,10,"pari")) 0.0583793793051... sage: bessel_J(3,10,"scipy") 0.0583793793052... - 1.65905485529...e-17*I """ 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 elif alg=="scipy": import scipy.special ans = str(scipy.special.jv(float(nu),complex(real(z),imag(z)))) ans = ans.replace("(","") ans = ans.replace(")","") ans = ans.replace("j","*I") return sage_eval(ans) else: return meval("bessel_j(%s,%s)"%(nu, z)) | 6634f9ab85d7944da6788aaab93ffaa3f22ce5ac /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/6634f9ab85d7944da6788aaab93ffaa3f22ce5ac/special.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
324,
403,
292,
67,
46,
12,
13053,
16,
94,
16,
12743,
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,
12743,
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,
... |
""" return a unique transaction ID that is mapped internally to a deferred .. also store arbitrary data if it is needed """ | """ return a unique transaction ID that is mapped internally to a deferred .. also store arbitrary data if it is needed """ | def _createIDMapping(self, data=None): """ return a unique transaction ID that is mapped internally to a deferred .. also store arbitrary data if it is needed """ id = self._nextTransactionID() d = Deferred() self.ids[id] = (d, data) return (id, d) | 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,
389,
2640,
734,
3233,
12,
2890,
16,
501,
33,
7036,
4672,
3536,
327,
279,
3089,
2492,
1599,
716,
353,
5525,
12963,
358,
279,
7045,
6116,
2546,
1707,
11078,
501,
309,
518,
353,
3577,
3536,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2640,
734,
3233,
12,
2890,
16,
501,
33,
7036,
4672,
3536,
327,
279,
3089,
2492,
1599,
716,
353,
5525,
12963,
358,
279,
7045,
6116,
2546,
1707,
11078,
501,
309,
518,
353,
3577,
3536,... |
val = "ShAttrib<1, SH_CONST, T>(s" + str(i) + ")" common.inprint("(*this)[" + str(i) + "] = " + val + ";") | common.inprint("(*this)[" + str(i) + "] = s" + str(i) + ";") | def scalarcons(self, args, size, extraTplArg=[]): common.inprint(self.tpl(size)) if len(extraTplArg) > 0: common.inprint("template<" + ", ".join(extraTplArg) + ">") common.inprint("inline") common.inprint(self.tplcls(size) + "::" + self.name + "(" + ', '.join([' '.join(x) for x in args]) + ")") common.inprint(" : ShGeneric<" + self.sizevar(size) + ", T>" + "(new ShVariableNode(Binding, " + self.sizevar(size) + ", ShStorageTypeInfo<T>::value_type))") common.inprint("{") common.indent() common.inprint("if (Binding == SH_CONST) {") common.indent() for i in range(0, size): if args[0][0] == "host_type": common.inprint("setValue(" + str(i) + ", s" + str(i) + ");") else: common.inprint("SH_DEBUG_ASSERT(s" + str(i) + ".hasValues());") common.inprint("setValue(" + str(i) + ", s" + str(i) + ".getValue(0));") common.deindent() common.inprint("} else {") common.indent() if args[0][0] == "T": for i in range(0, size): val = "ShAttrib<1, SH_CONST, T>(s" + str(i) + ")" common.inprint("(*this)[" + str(i) + "] = " + val + ";") else: data = "" for i in range(0, size): if data != "": data += ", " data += "s" + str(i) common.inprint("(*this) = ShAttrib<" + self.sizevar(size) + ", SH_CONST, T>(" + data + ");") common.deindent() common.inprint("}") common.deindent() common.inprint("}") common.inprint("") | 0e974eb2498c9e12a495b5f48c710de74441fea8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1804/0e974eb2498c9e12a495b5f48c710de74441fea8/ShAttribImpl.hpp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4981,
8559,
12,
2890,
16,
833,
16,
963,
16,
2870,
20588,
4117,
33,
8526,
4672,
2975,
18,
267,
1188,
12,
2890,
18,
10933,
12,
1467,
3719,
309,
562,
12,
7763,
20588,
4117,
13,
405,
374,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4981,
8559,
12,
2890,
16,
833,
16,
963,
16,
2870,
20588,
4117,
33,
8526,
4672,
2975,
18,
267,
1188,
12,
2890,
18,
10933,
12,
1467,
3719,
309,
562,
12,
7763,
20588,
4117,
13,
405,
374,
... |
while ret == E_CALL_MULTI_PERFORM: | while ret == E_CALL_MULTI_PERFORM and timeout > 0: | def perform(self): if not self.cont: return r = -1 while r == -1: r = self.multi.select(100.0) ret = E_CALL_MULTI_PERFORM while ret == E_CALL_MULTI_PERFORM: ret, num_handles = self.multi.perform() self.cont = num_handles | 2f79c69879b4b5f565eb8023d680f91d6b787641 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/373/2f79c69879b4b5f565eb8023d680f91d6b787641/comm_curl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
12,
2890,
4672,
309,
486,
365,
18,
1213,
30,
327,
436,
273,
300,
21,
1323,
436,
422,
300,
21,
30,
436,
273,
365,
18,
7027,
18,
4025,
12,
6625,
18,
20,
13,
325,
273,
512,
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,
3073,
12,
2890,
4672,
309,
486,
365,
18,
1213,
30,
327,
436,
273,
300,
21,
1323,
436,
422,
300,
21,
30,
436,
273,
365,
18,
7027,
18,
4025,
12,
6625,
18,
20,
13,
325,
273,
512,
67,
... |
self.name = codec_info.id | self.name = codec_info.codec_id | def __init__(self, codec_info, codec_param): self.name = codec_info.id self.priority = codec_info.priority self.clock_rate = codec_param.info.clock_rate self.channel_count = codec_param.info.channel_count self.avg_bps = codec_param.info.avg_bps self.frm_ptime = codec_param.info.frm_ptime self.ptime = codec_param.info.frm_ptime * \ codec_param.setting.frm_per_pkt self.ptime = codec_param.info.pt self.vad_enabled = codec_param.setting.vad self.plc_enabled = codec_param.setting.plc | 11903e0fff398b4202a356ea16874a469d0cec21 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8531/11903e0fff398b4202a356ea16874a469d0cec21/pjsua.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
9196,
67,
1376,
16,
9196,
67,
891,
4672,
365,
18,
529,
273,
9196,
67,
1376,
18,
21059,
67,
350,
365,
18,
8457,
273,
9196,
67,
1376,
18,
8457,
365,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
9196,
67,
1376,
16,
9196,
67,
891,
4672,
365,
18,
529,
273,
9196,
67,
1376,
18,
21059,
67,
350,
365,
18,
8457,
273,
9196,
67,
1376,
18,
8457,
365,
18,
... |
print mod.__name__, dir(mod) | def parseargs(): global DEBUGSTREAM try: opts, args = getopt.getopt( sys.argv[1:], 'nVhc:d', ['class=', 'nosetuid', 'version', 'help', 'debug']) except getopt.error, e: usage(1, e) options = Options() for opt, arg in opts: if opt in ('-h', '--help'): usage(0) elif opt in ('-V', '--version'): print >> sys.stderr, __version__ sys.exit(0) elif opt in ('-n', '--nosetuid'): options.setuid = 0 elif opt in ('-c', '--class'): options.classname = arg elif opt in ('-d', '--debug'): DEBUGSTREAM = sys.stderr # parse the rest of the arguments if len(args) < 1: localspec = 'localhost:8025' remotespec = 'localhost:25' elif len(args) < 2: localspec = args[0] remotespec = 'localhost:25' elif len(args) < 3: localspec = args[0] remotespec = args[1] else: usage(1, 'Invalid arguments: %s' % COMMASPACE.join(args)) # split into host/port pairs i = localspec.find(':') if i < 0: usage(1, 'Bad local spec: %s' % localspec) options.localhost = localspec[:i] try: options.localport = int(localspec[i+1:]) except ValueError: usage(1, 'Bad local port: %s' % localspec) i = remotespec.find(':') if i < 0: usage(1, 'Bad remote spec: %s' % remotespec) options.remotehost = remotespec[:i] try: options.remoteport = int(remotespec[i+1:]) except ValueError: usage(1, 'Bad remote port: %s' % remotespec) return options | 611d42adcdb6125ed60c06841f1980c39fa9f212 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/611d42adcdb6125ed60c06841f1980c39fa9f212/smtpd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
1968,
13332,
2552,
6369,
13693,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
2589,
18,
19485,
63,
21,
30,
6487,
296,
82,
58,
28353,
30,
72,
2187,
10228,
1106,
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,
1109,
1968,
13332,
2552,
6369,
13693,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
2589,
18,
19485,
63,
21,
30,
6487,
296,
82,
58,
28353,
30,
72,
2187,
10228,
1106,
33,
... | |
self.response.out.write(simplejson.dumps(respo)); | self.response.out.write(respo); | def get(self): people_query = Connection.all(); respo = []; for connection in people_query: respo.append(connection.person.nickname()); self.response.out.write(simplejson.dumps(respo)); | aa9214f26c95d5e9400316ba56c88944fbf2090f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13529/aa9214f26c95d5e9400316ba56c88944fbf2090f/app.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
4672,
16951,
67,
2271,
273,
4050,
18,
454,
5621,
400,
1631,
273,
5378,
31,
364,
1459,
316,
16951,
67,
2271,
30,
400,
1631,
18,
6923,
12,
4071,
18,
12479,
18,
17091,
529,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
4672,
16951,
67,
2271,
273,
4050,
18,
454,
5621,
400,
1631,
273,
5378,
31,
364,
1459,
316,
16951,
67,
2271,
30,
400,
1631,
18,
6923,
12,
4071,
18,
12479,
18,
17091,
529,... |
self.fileSave() | win.fileSave() | def savePrompt(self, closing=False): """Ask for save if doc modified, return false on cancel""" win = globalref.mainWin if not self.duplicateWindows(): if win.doc.modified and (closing or not globalref.options. boolData('OpenNewWindow')): text = win.fileImported and _('Save changes?') or \ _('Save changes to "%s"?') % win.doc.fileName ans = QtGui.QMessageBox.information(win, 'TreeLine', text, _('&Yes'), _('&No'), _('&Cancel'), 0, 2) if ans == 0: self.fileSave() elif ans == 1: self.delAutoSaveFile() return True else: return False if globalref.options.boolData('PersistTreeState'): self.recentFiles.saveTreeState(win.treeView) return True | cf6958908f872f88d5fc403897f114013b879ca1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3087/cf6958908f872f88d5fc403897f114013b879ca1/treecontrol.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
15967,
12,
2890,
16,
7647,
33,
8381,
4672,
3536,
23663,
364,
1923,
309,
997,
4358,
16,
327,
629,
603,
3755,
8395,
5657,
273,
2552,
1734,
18,
5254,
18049,
309,
486,
365,
18,
17342,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
15967,
12,
2890,
16,
7647,
33,
8381,
4672,
3536,
23663,
364,
1923,
309,
997,
4358,
16,
327,
629,
603,
3755,
8395,
5657,
273,
2552,
1734,
18,
5254,
18049,
309,
486,
365,
18,
17342,
... |
typecodes = "cubBhHiIlLfd" | typecodes = "ubBhHiIlLfd" | def __init__(self, typecode, newarg=None): array.array.__init__(typecode) | 10d1df1f083a5ed0aef519012af1724d0009a6cd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/10d1df1f083a5ed0aef519012af1724d0009a6cd/test_array.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
618,
710,
16,
394,
3175,
33,
7036,
4672,
526,
18,
1126,
16186,
2738,
972,
12,
723,
710,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
618,
710,
16,
394,
3175,
33,
7036,
4672,
526,
18,
1126,
16186,
2738,
972,
12,
723,
710,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
'no_of_helpers') | 'no_of_helpers', 'modified_on') | def getAllFriendshipStatistics(self, permid, last_update_time = None, range = None, sort = None, reverse = False): """ db keys: 'source_permid', 'target_permid', 'isForwarder', 'request_time', 'response_time', 'no_of_attempts', 'no_of_helpers' @in: get_online: boolean: if true, give peers a key 'online' if there is a connection now """ value_name = ('source_permid', 'target_permid', 'isForwarder', 'request_time', 'response_time', 'no_of_attempts', 'no_of_helpers') where = 'request_time > '+str(last_update_time) # source_permid done below if range: offset= range[0] limit = range[1] - range[0] else: limit = offset = None if sort: desc = (not reverse) and 'desc' or '' if sort in ('name'): order_by = ' lower(%s) %s' % (sort, desc) else: order_by = ' %s %s' % (sort, desc) else: order_by = None permidstr = bin2str(permid) res_list = self.getAll(value_name, where=where, offset= offset, limit=limit, order_by=order_by, source_permid=permidstr) | 548d2fadf816992e0aadb0535f4d4a11217f7db0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9686/548d2fadf816992e0aadb0535f4d4a11217f7db0/SqliteFriendshipStatsCacheDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5514,
42,
7522,
3261,
8569,
12,
2890,
16,
4641,
350,
16,
1142,
67,
2725,
67,
957,
273,
599,
16,
1048,
273,
599,
16,
1524,
273,
599,
16,
4219,
273,
1083,
4672,
225,
3536,
1319,
1311,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5514,
42,
7522,
3261,
8569,
12,
2890,
16,
4641,
350,
16,
1142,
67,
2725,
67,
957,
273,
599,
16,
1048,
273,
599,
16,
1524,
273,
599,
16,
4219,
273,
1083,
4672,
225,
3536,
1319,
1311,
... |
if sh.cell_value(rowx=row, colx=0) == 'Holidays': | if self.getCellValue(sh, row, 0, '') == 'Holidays': | def process(self): sh = self.sheet | 6cfa26769ed11a8bcef867983ca669c4705d8007 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7127/6cfa26769ed11a8bcef867983ca669c4705d8007/importer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
12,
2890,
4672,
699,
273,
365,
18,
8118,
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,... | [
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,
1207,
12,
2890,
4672,
699,
273,
365,
18,
8118,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if self.selected_rows and self.task_ts.iter_is_valid(self.selected_rows): tid = self.task_ts.get_value(self.selected_rows, self.TASK_MODEL_OBJ) | if (self.selected_rows and self.task_ts.iter_is_valid(self.selected_rows)): tid = self.task_ts.get_value( self.selected_rows, self.TASK_MODEL_OBJ) | def task_cursor_changed(self, selection=None): #We unselect all in the closed task view #Only if something is selected in the active task list self.donebutton.set_icon_name("gtg-task-done") self.dismissbutton.set_icon_name("gtg-task-dismiss") if selection.count_selected_rows() > 0: self.taskdone_tview.get_selection().unselect_all() self.note_tview.get_selection().unselect_all() self.donebutton.set_label(GnomeConfig.MARK_DONE) self.donebutton.set_tooltip_text(GnomeConfig.MARK_DONE_TOOLTIP) self.dismissbutton.set_label(GnomeConfig.MARK_DISMISS) #We reset the previously selected task if self.selected_rows and self.task_ts.iter_is_valid(self.selected_rows): tid = self.task_ts.get_value(self.selected_rows, self.TASK_MODEL_OBJ) task = self.req.get_task(tid) title = self.__build_task_title(task, extended=False) self.task_ts.set_value(self.selected_rows, self.TASK_MODEL_TITLE, title) #We change the selection title #if selection: #ts, itera = selection.get_selected() #pylint: disable-msg=W0612 #if itera and self.task_ts.iter_is_valid(itera): #tid = self.task_ts.get_value(itera, self.TASK_MODEL_OBJ) #task = self.req.get_task(tid) #self.selected_rows = itera # Extended title is temporarily disabled #title = self.__build_task_title(task, extended=True) #title = self.__build_task_title(task, extended=False) #self.task_ts.set_value(self.selected_rows, self.TASK_MODEL_TITLE, title) | 451ea29e3924785bc6c6b8648aa6459b292a0db4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7036/451ea29e3924785bc6c6b8648aa6459b292a0db4/browser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1562,
67,
9216,
67,
6703,
12,
2890,
16,
4421,
33,
7036,
4672,
468,
3218,
640,
4025,
777,
316,
326,
4375,
1562,
1476,
468,
3386,
309,
5943,
353,
3170,
316,
326,
2695,
1562,
666,
365,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1562,
67,
9216,
67,
6703,
12,
2890,
16,
4421,
33,
7036,
4672,
468,
3218,
640,
4025,
777,
316,
326,
4375,
1562,
1476,
468,
3386,
309,
5943,
353,
3170,
316,
326,
2695,
1562,
666,
365,
18... |
return Verification.CHECK_FAILED, "%s verification MAIL failed: %s" % (param, retmsg) | if code >= 500: return Verification.CHECK_FAILED, "%s verification HELO failed with code %s: %s" % (param, code, retmsg) else: return Verification.CHECK_UNKNOWN, "%s verification HELO failed with code %s: %s" % (param, code, retmsg) | def checkMailhost(self, mailhost, domain, user): """Check if something listening for incomming SMTP connection for mailhost. For details about status that can occur during communication see RFC 2821, section 4.3.2""" | 06e00232225fa0e912e5723f5fbb6a8e6ff5f116 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5428/06e00232225fa0e912e5723f5fbb6a8e6ff5f116/Verification.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
6759,
2564,
12,
2890,
16,
4791,
2564,
16,
2461,
16,
729,
4672,
3536,
1564,
309,
5943,
13895,
364,
316,
5702,
310,
18102,
1459,
364,
4791,
2564,
18,
2457,
3189,
2973,
1267,
716,
848,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
866,
6759,
2564,
12,
2890,
16,
4791,
2564,
16,
2461,
16,
729,
4672,
3536,
1564,
309,
5943,
13895,
364,
316,
5702,
310,
18102,
1459,
364,
4791,
2564,
18,
2457,
3189,
2973,
1267,
716,
848,... |
vals['parent_id'] = self.pool.get('account.analytic.account').search(cr,uid,[('id','=',proposition_id.analytic_account_id.id)])[0] return super(dm_campaign_proposition_segment,self).write(cr, uid, ids, vals, context) def create(self,cr,uid,vals,context={}): | vals['parent_id'] = self.pool.get('account.analytic.account').search(cr, uid, [('id', '=', proposition_id.analytic_account_id.id)])[0] return super(dm_campaign_proposition_segment, self).write(cr, uid, ids, vals, context) def create(self, cr, uid, vals, context={}): | def write(self, cr, uid, ids, vals, context=None): if 'proposition_id' in vals and vals['proposition_id']: proposition_id = self.pool.get('dm.campaign.proposition').browse(cr, uid, vals['proposition_id']) vals['parent_id'] = self.pool.get('account.analytic.account').search(cr,uid,[('id','=',proposition_id.analytic_account_id.id)])[0] return super(dm_campaign_proposition_segment,self).write(cr, uid, ids, vals, context) | 7ee897432c7e7d5a5c8e889fc429c3c1b66627fd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7339/7ee897432c7e7d5a5c8e889fc429c3c1b66627fd/dm_campaign.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
5773,
16,
819,
33,
7036,
4672,
309,
296,
685,
3276,
67,
350,
11,
316,
5773,
471,
5773,
3292,
685,
3276,
67,
350,
3546,
30,
450,
3276... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
5773,
16,
819,
33,
7036,
4672,
309,
296,
685,
3276,
67,
350,
11,
316,
5773,
471,
5773,
3292,
685,
3276,
67,
350,
3546,
30,
450,
3276... |
if (self.drone.getDistance(self.player)>=500): | if (self.drone.getDistance(self.player)>=1100): | def orbitMe (self): #self.player.SetTarget(self.drone) # if the drone is more than 500m away it will set if (self.drone.getDistance(self.player)>=500): # orientate the nose of the drone towards the player ship vec = Vector.Sub(self.player.Position(),self.drone.Position()) self.drone.SetOrientation((1,0,0),vec) # set velocity proportional to distance from player vec = Vector.Scale(Vector.SafeNorm(vec),self.drone.getDistance(self.player)/10) self.drone.SetVelocity(vec) #self.stayputtime = VS.GetGameTime() # if drone has approached player until 500m then stop it if (self.drone.getDistance(self.player)<500): self.drone.SetVelocity((0,0,0)) # this is also needed to stop rotation of the drone self.drone.SetAngularVelocity((0,0,0)) return 0 | 861b2caa755798430035f1444afb9bbbe7242a92 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2883/861b2caa755798430035f1444afb9bbbe7242a92/quest_tutorial.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17656,
4667,
261,
2890,
4672,
468,
2890,
18,
14872,
18,
694,
2326,
12,
2890,
18,
3069,
476,
13,
468,
309,
326,
5081,
476,
353,
1898,
2353,
6604,
81,
10804,
518,
903,
444,
309,
261,
289... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17656,
4667,
261,
2890,
4672,
468,
2890,
18,
14872,
18,
694,
2326,
12,
2890,
18,
3069,
476,
13,
468,
309,
326,
5081,
476,
353,
1898,
2353,
6604,
81,
10804,
518,
903,
444,
309,
261,
289... |
- zero for `m_1+m_2+m_3\neq 0` | - zero for `m_1 + m_2 + m_3 \neq 0` | def wigner_3j(j_1, j_2, j_3, m_1, m_2, m_3, prec=None): r""" Calculate the Wigner 3j symbol `Wigner3j(j_1,j_2,j_3,m_1,m_2,m_3)`. INPUT: - ``j_1``, ``j_2``, ``j_3``, ``m_1``, ``m_2``, ``m_3`` - integer or half integer - ``prec`` - precision, default: None. Providing a precision can drastically speed up the calculation. OUTPUT: rational number times the square root of a rational number (if prec=None), or real number if a precision is given EXAMPLES:: sage: wigner_3j(2, 6, 4, 0, 0, 0) sqrt(5/143) sage: wigner_3j(2, 6, 4, 0, 0, 1) 0 sage: wigner_3j(0.5, 0.5, 1, 0.5, -0.5, 0) sqrt(1/6) sage: wigner_3j(40, 100, 60, -10, 60, -50) 95608/18702538494885*sqrt(21082735836735314343364163310/220491455010479533763) sage: wigner_3j(2500, 2500, 5000, 2488, 2400, -4888, prec=64) 7.60424456883448589e-12 It is an error to have arguments that are not integer or half integer values:: sage: wigner_3j(2.1, 6, 4, 0, 0, 0) Traceback (most recent call last): ... ValueError: j values must be integer or half integer sage: wigner_3j(2, 6, 4, 1, 0, -1.1) Traceback (most recent call last): ... ValueError: m values must be integer or half integer NOTES: The Wigner 3j symbol obeys the following symmetry rules: - invariant under any permutation of the columns (with the exception of a sign change where `J:=j_1+j_2+j_3`): .. math:: Wigner3j(j_1,j_2,j_3,m_1,m_2,m_3) =Wigner3j(j_3,j_1,j_2,m_3,m_1,m_2) =Wigner3j(j_2,j_3,j_1,m_2,m_3,m_1) =(-1)^J Wigner3j(j_3,j_2,j_1,m_3,m_2,m_1) =(-1)^J Wigner3j(j_1,j_3,j_2,m_1,m_3,m_2) =(-1)^J Wigner3j(j_2,j_1,j_3,m_2,m_1,m_3) - invariant under space inflection, i. e. .. math:: Wigner3j(j_1,j_2,j_3,m_1,m_2,m_3) =(-1)^J Wigner3j(j_1,j_2,j_3,-m_1,-m_2,-m_3) - symmetric with respect to the 72 additional symmetries based on the work by [Regge58] - zero for `j_1`, `j_2`, `j_3` not fulfilling triangle relation - zero for `m_1+m_2+m_3\neq 0` - zero for violating any one of the conditions `j_1\ge|m_1|`, `j_2\ge|m_2|`, `j_3\ge|m_3|` ALGORITHM: This function uses the algorithm of [Edmonds74] to calculate the value of the 3j symbol exactly. Note that the formula contains alternating sums over large factorials and is therefore unsuitable for finite precision arithmetic and only useful for a computer algebra system [Rasch03]. REFERENCES: - [Regge58] 'Symmetry Properties of Clebsch-Gordan Coefficients', T. Regge, Nuovo Cimento, Volume 10, pp. 544 (1958) - [Edmonds74] 'Angular Momentum in Quantum Mechanics', A. R. Edmonds, Princeton University Press (1974) - [Rasch03] 'Efficient Storage Scheme for Pre-calculated Wigner 3j, 6j and Gaunt Coefficients', J. Rasch and A. C. H. Yu, SIAM J. Sci. Comput. Volume 25, Issue 4, pp. 1416-1428 (2003) AUTHORS: - Jens Rasch (2009-03-24): initial version """ if int(j_1 * 2) != j_1 * 2 or int(j_2 * 2) != j_2 * 2 or \ int(j_3 * 2) != j_3 * 2: raise ValueError("j values must be integer or half integer") if int(m_1 * 2) != m_1 * 2 or int(m_2 * 2) != m_2 * 2 or \ int(m_3 * 2) != m_3 * 2: raise ValueError("m values must be integer or half integer") if (m_1 + m_2 + m_3 <> 0): return 0 prefid = Integer((-1) ** (int(j_1 - j_2 - m_3))) m_3 = -m_3 a1 = j_1 + j_2 - j_3 if (a1 < 0): return 0 a2 = j_1 - j_2 + j_3 if (a2 < 0): return 0 a3 = -j_1 + j_2 + j_3 if (a3 < 0): return 0 if (abs(m_1) > j_1) or (abs(m_2) > j_2) or (abs(m_3) > j_3): return 0 maxfact = max(j_1 + j_2 + j_3 + 1, j_1 + abs(m_1), j_2 + abs(m_2), \ j_3 + abs(m_3)) _calc_factlist(maxfact) argsqrt = Integer(_Factlist[int(j_1 + j_2 - j_3)] * \ _Factlist[int(j_1 - j_2 + j_3)] * \ _Factlist[int(-j_1 + j_2 + j_3)] * \ _Factlist[int(j_1 - m_1)] * \ _Factlist[int(j_1 + m_1)] * \ _Factlist[int(j_2 - m_2)] * \ _Factlist[int(j_2 + m_2)] * \ _Factlist[int(j_3 - m_3)] * \ _Factlist[int(j_3 + m_3)]) / \ _Factlist[int(j_1 + j_2 + j_3 + 1)] ressqrt = argsqrt.sqrt(prec) if type(ressqrt) is ComplexNumber: ressqrt = ressqrt.real() imin = max(-j_3 + j_1 + m_2, -j_3 + j_2 - m_1, 0) imax = min(j_2 + m_2, j_1 - m_1, j_1 + j_2 - j_3) sumres = 0 for ii in range(imin, imax + 1): den = _Factlist[ii] * \ _Factlist[int(ii + j_3 - j_1 - m_2)] * \ _Factlist[int(j_2 + m_2 - ii)] * \ _Factlist[int(j_1 - ii - m_1)] * \ _Factlist[int(ii + j_3 - j_2 + m_1)] * \ _Factlist[int(j_1 + j_2 - j_3 - ii)] sumres = sumres + Integer((-1) ** ii) / den res = ressqrt * sumres * prefid return res | c6a90d820f57455b2ff6063db98cb5e6f7a11f83 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/c6a90d820f57455b2ff6063db98cb5e6f7a11f83/wigner.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
341,
724,
264,
67,
23,
78,
12,
78,
67,
21,
16,
525,
67,
22,
16,
525,
67,
23,
16,
312,
67,
21,
16,
312,
67,
22,
16,
312,
67,
23,
16,
13382,
33,
7036,
4672,
436,
8395,
9029,
326,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
341,
724,
264,
67,
23,
78,
12,
78,
67,
21,
16,
525,
67,
22,
16,
525,
67,
23,
16,
312,
67,
21,
16,
312,
67,
22,
16,
312,
67,
23,
16,
13382,
33,
7036,
4672,
436,
8395,
9029,
326,... |
f_type = ('float8', 'DOUBLE PRECISION') | f_type = ('float8', 'DOUBLE PRECISION', None) | def get_pg_type(f): ''' returns a tuple (type returned by postgres when the column was created, type expression to create the column) ''' type_dict = { fields.boolean: 'bool', fields.integer: 'int4', fields.integer_big: 'int8', fields.text: 'text', fields.date: 'date', fields.time: 'time', fields.datetime: 'timestamp', fields.binary: 'bytea', fields.many2one: 'int4', } if type(f) in type_dict: f_type = (type_dict[type(f)], type_dict[type(f)]) elif isinstance(f, fields.float): if f.digits: f_type = ('numeric', 'NUMERIC') else: f_type = ('float8', 'DOUBLE PRECISION') elif isinstance(f, (fields.char, fields.reference)): f_type = ('varchar', 'VARCHAR(%d)' % (f.size,)) elif isinstance(f, fields.selection): if isinstance(f.selection, list) and isinstance(f.selection[0][0], (str, unicode)): f_size = reduce(lambda x, y: max(x, len(y[0])), f.selection, f.size or 16) elif isinstance(f.selection, list) and isinstance(f.selection[0][0], int): f_size = -1 else: f_size = getattr(f, 'size', None) or 16 if f_size == -1: f_type = ('int4', 'INTEGER') else: f_type = ('varchar', 'VARCHAR(%d)' % f_size) elif isinstance(f, fields.function) and eval('fields.'+(f._type), globals()) in type_dict: t = eval('fields.'+(f._type), globals()) f_type = (type_dict[t], type_dict[t]) elif isinstance(f, fields.function) and f._type == 'float': if f.digits: f_type = ('numeric', 'NUMERIC') else: f_type = ('float8', 'DOUBLE PRECISION') elif isinstance(f, fields.function) and f._type == 'selection': f_type = ('text', 'text') elif isinstance(f, fields.function) and f._type == 'char': f_type = ('varchar', 'VARCHAR(%d)' % (f.size)) else: _logger.warning('%s type not supported!' % (type(f))) f_type = None return f_type | 1273b880acb46f1ed80608d5835a5c72c0e54036 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/1273b880acb46f1ed80608d5835a5c72c0e54036/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
8365,
67,
723,
12,
74,
4672,
9163,
1135,
279,
3193,
261,
723,
2106,
635,
1603,
14107,
1347,
326,
1057,
1703,
2522,
16,
618,
2652,
358,
752,
326,
1057,
13,
9163,
225,
618,
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,
336,
67,
8365,
67,
723,
12,
74,
4672,
9163,
1135,
279,
3193,
261,
723,
2106,
635,
1603,
14107,
1347,
326,
1057,
1703,
2522,
16,
618,
2652,
358,
752,
326,
1057,
13,
9163,
225,
618,
67,
... |
self._books_toolbar._enable_button(False) | self._books_toolbar.enable_button(False) | def get_book(self): self._books_toolbar._enable_button(False) self.progressbar.show() format = self._books_toolbar.format_combo.props.value gobject.idle_add(self.download_book, self.download_url + format) | 7bb6f394a9bdcd5ba073696113049a86645fb5a2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5566/7bb6f394a9bdcd5ba073696113049a86645fb5a2/GetIABooksActivity.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3618,
12,
2890,
4672,
365,
6315,
12567,
67,
18849,
18,
7589,
67,
5391,
12,
8381,
13,
365,
18,
8298,
3215,
18,
4500,
1435,
740,
273,
365,
6315,
12567,
67,
18849,
18,
2139,
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,
336,
67,
3618,
12,
2890,
4672,
365,
6315,
12567,
67,
18849,
18,
7589,
67,
5391,
12,
8381,
13,
365,
18,
8298,
3215,
18,
4500,
1435,
740,
273,
365,
6315,
12567,
67,
18849,
18,
2139,
67,
... |
def fl_get_object_bw(ob, bw): """ fl_get_object_bw(ob, bw) """ _fl_get_object_bw(ob, bw) | def fl_get_object_bw(pObject, bw): """ fl_get_object_bw(pObject, bw) """ _fl_get_object_bw(pObject, bw) | def fl_get_object_bw(ob, bw): """ fl_get_object_bw(ob, bw) """ _fl_get_object_bw(ob, bw) | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
588,
67,
1612,
67,
70,
91,
12,
84,
921,
16,
12986,
4672,
3536,
1183,
67,
588,
67,
1612,
67,
70,
91,
12,
84,
921,
16,
12986,
13,
3536,
225,
389,
2242,
67,
588,
67,
1612,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
588,
67,
1612,
67,
70,
91,
12,
84,
921,
16,
12986,
4672,
3536,
1183,
67,
588,
67,
1612,
67,
70,
91,
12,
84,
921,
16,
12986,
13,
3536,
225,
389,
2242,
67,
588,
67,
1612,
... |
def __init__(data = None) | def __init__(data = None): | def __init__(data = None) if data == None: quickfix.StringField.__init__(self, 831) else quickfix.StringField.__init__(self, 831, data) | 484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
4672,
309,
501,
422,
599,
30,
9549,
904,
18,
780,
974,
16186,
2738,
972,
12,
2890,
16,
1725,
6938,
13,
469,
9549,
904,
18,
780,
974,
16186,
2738,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
4672,
309,
501,
422,
599,
30,
9549,
904,
18,
780,
974,
16186,
2738,
972,
12,
2890,
16,
1725,
6938,
13,
469,
9549,
904,
18,
780,
974,
16186,
2738,
... |
print 'refile', todo, tofolder | def refile_message(): global lastrefile, tofolder itop = scanbox.nearest(0) sel = scanbox.curselection() if not sel: dialog(root, "No Message To Refile", "Please select a message to refile", "", 0, "OK") return foldersel = folderbox.curselection() if len(foldersel) != 1: if not foldersel: msg = "Please select a folder to refile to" else: msg = "Please select exactly one folder to refile to" dialog(root, "No Folder To Refile", msg, "", 0, "OK") return refileto = folderbox.get(foldersel[0]) todo = [] for i in sel: line = scanbox.get(i) if scanparser.match(line) >= 0: todo.append(string.atoi(scanparser.group(1))) print 'refile', todo, tofolder if lastrefile != refileto or not tofolder: print 'new folder' lastrefile = refileto tofolder = None tofolder = mh.openfolder(lastrefile) mhf.refilemessages(todo, tofolder) rescan() fixfocus(min(todo), itop) | 78b0c82535af09fde940d1b040f9da72c20f7c70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/78b0c82535af09fde940d1b040f9da72c20f7c70/mbox.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
283,
768,
67,
2150,
13332,
2552,
1142,
266,
768,
16,
358,
5609,
518,
556,
273,
4135,
2147,
18,
25785,
12,
20,
13,
357,
273,
4135,
2147,
18,
1397,
10705,
1435,
309,
486,
357,
30,
6176,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
283,
768,
67,
2150,
13332,
2552,
1142,
266,
768,
16,
358,
5609,
518,
556,
273,
4135,
2147,
18,
25785,
12,
20,
13,
357,
273,
4135,
2147,
18,
1397,
10705,
1435,
309,
486,
357,
30,
6176,
... | |
file.Write(" uint32 data_size = n * sizeof(GLuint);\n") | code = """ uint32 data_size; if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { return error::kOutOfBounds; } """ file.Write(code) | def WriteGetDataSizeCode(self, func, file): """Overrriden from TypeHandler.""" file.Write(" uint32 data_size = n * sizeof(GLuint);\n") | a6eb5232d2608cd0773bbe559757bd52c7f53670 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/a6eb5232d2608cd0773bbe559757bd52c7f53670/build_gles2_cmd_buffer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
967,
29414,
1085,
12,
2890,
16,
1326,
16,
585,
4672,
3536,
22042,
1691,
275,
628,
1412,
1503,
12123,
585,
18,
3067,
2932,
225,
2254,
1578,
501,
67,
1467,
273,
290,
380,
13726,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
967,
29414,
1085,
12,
2890,
16,
1326,
16,
585,
4672,
3536,
22042,
1691,
275,
628,
1412,
1503,
12123,
585,
18,
3067,
2932,
225,
2254,
1578,
501,
67,
1467,
273,
290,
380,
13726,
12,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.