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 |
|---|---|---|---|---|---|---|
if db_backend.startswith('postgresql'): | if db_backend.find('postgresql') != -1: | def ensure_success(errcode): if errcode != 0: print "ERROR: Command failed to execute, aborting!" exit(1) | fa522864c2c4f5ce19485f933ba5e4775e537f48 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11345/fa522864c2c4f5ce19485f933ba5e4775e537f48/prepare-database.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3387,
67,
4768,
12,
25093,
4672,
309,
393,
710,
480,
374,
30,
1172,
315,
3589,
30,
3498,
2535,
358,
1836,
16,
6263,
310,
4442,
2427,
12,
21,
13,
225,
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,
3387,
67,
4768,
12,
25093,
4672,
309,
393,
710,
480,
374,
30,
1172,
315,
3589,
30,
3498,
2535,
358,
1836,
16,
6263,
310,
4442,
2427,
12,
21,
13,
225,
2,
-100,
-100,
-100,
-100,
-100,
... |
self.assertEquals(3, int(env1.locals.prop)) class TestWrapper(unittest.TestCase): | self.assertEquals(3, int(env1.locals.prop)) class TestWrapper(unittest.TestCase): | def _testCrossDomainDelete(self): with JSContext() as env1: env2 = JSContext() # Set to the same domain. env1.securityToken = "foo" env2.securityToken = "foo" env1.locals.prop = 3 env2.locals.env1 = env1.locals # Change env2 to a different domain and delete env1.prop. #env2.securityToken = "bar" self.assertEquals(3, int(env1.eval("prop"))) print env1.eval("env1") with env2: self.assertEquals(3, int(env2.eval("this.env1.prop"))) self.assertEquals("false", str(e.eval("delete env1.prop"))) # Check that env1.prop still exists. self.assertEquals(3, int(env1.locals.prop)) | d76ea3f452d147f051e65b20fdab9b87a8b84413 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2065/d76ea3f452d147f051e65b20fdab9b87a8b84413/PyV8.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3813,
13941,
3748,
2613,
12,
2890,
4672,
598,
6756,
1042,
1435,
487,
1550,
21,
30,
1550,
22,
273,
6756,
1042,
1435,
225,
468,
1000,
358,
326,
1967,
2461,
18,
1550,
21,
18,
7462,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3813,
13941,
3748,
2613,
12,
2890,
4672,
598,
6756,
1042,
1435,
487,
1550,
21,
30,
1550,
22,
273,
6756,
1042,
1435,
225,
468,
1000,
358,
326,
1967,
2461,
18,
1550,
21,
18,
7462,
1... |
if e.args[0] == 32: | if e.args[0] == 32 or e.args[0] == 104: print "thread", self.id ,"connection broken, retrying." self.socket = socket.socket() | def run(self): while self.running: while self.running: try: self.socket.connect((self.flooder.host, self.flooder.port)) print "thread", self.id, "connected" break except Exception as e: if e.args[0] == 106: break print "Couldn't connect:", e.args, self.flooder.host, self.flooder.port time.sleep(1) continue break | 379a2875db3a75847e7d15c659794788e24d7630 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13624/379a2875db3a75847e7d15c659794788e24d7630/Flooder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
1323,
365,
18,
8704,
30,
1323,
365,
18,
8704,
30,
775,
30,
365,
18,
7814,
18,
3612,
12443,
2890,
18,
74,
383,
5350,
18,
2564,
16,
365,
18,
74,
383,
5350,
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,
1086,
12,
2890,
4672,
1323,
365,
18,
8704,
30,
1323,
365,
18,
8704,
30,
775,
30,
365,
18,
7814,
18,
3612,
12443,
2890,
18,
74,
383,
5350,
18,
2564,
16,
365,
18,
74,
383,
5350,
18,
... |
self._update(*args, refresh=False) | kwargs = {'refresh':False} self._update(*args, **kwargs) | def _update_norefresh(self, *args): self._update(*args, refresh=False) | 5369786e9c2cacdc5c293015007ee60fe46bbafc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13232/5369786e9c2cacdc5c293015007ee60fe46bbafc/grid.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2725,
67,
82,
479,
74,
1955,
12,
2890,
16,
380,
1968,
4672,
365,
6315,
2725,
30857,
1968,
16,
4460,
33,
8381,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2725,
67,
82,
479,
74,
1955,
12,
2890,
16,
380,
1968,
4672,
365,
6315,
2725,
30857,
1968,
16,
4460,
33,
8381,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
f = file(logfile, 'a') | f = file(logfile, 'ab') | def ttylog_open(logfile, stamp): f = file(logfile, 'a') sec, usec = int(stamp), int(1000000 * (stamp - int(stamp))) f.write(struct.pack('iLiiLL', 1, 0, 0, 0, sec, usec)) f.close() | ff1579f6feca94f0382dac036d172da2878f76b9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7245/ff1579f6feca94f0382dac036d172da2878f76b9/ttylog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21520,
1330,
67,
3190,
12,
28806,
16,
14429,
4672,
284,
273,
585,
12,
28806,
16,
296,
378,
6134,
1428,
16,
999,
71,
273,
509,
12,
14317,
3631,
509,
12,
21,
9449,
380,
261,
14317,
300,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21520,
1330,
67,
3190,
12,
28806,
16,
14429,
4672,
284,
273,
585,
12,
28806,
16,
296,
378,
6134,
1428,
16,
999,
71,
273,
509,
12,
14317,
3631,
509,
12,
21,
9449,
380,
261,
14317,
300,
... |
for line in fixupcode(code).split("\n"): | for line in fixupcode(code): | def fixupasyncvfs(self, fname, code): n=os.path.join(os.path.dirname(__file__), fname) # see http://www.sqlite.org/src/info/084941461f afs=re.compile(r"^(int asyncFileSize\()") proto=re.compile(r"^(\w+\s+sqlite3async_(initialize|shutdown|control|run)\()") o=open(n, "wt") try: for line in fixupcode(code).split("\n"): line=afs.sub(r"static \1", line) line=proto.sub(r"SQLITE3ASYNC_API \1", line) o.write(line+"\n") o.close() except: o.close() os.remove(n) raise | d57009b084ea453f10e1a2f64eb6481c19d585f8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/993/d57009b084ea453f10e1a2f64eb6481c19d585f8/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
416,
3810,
90,
2556,
12,
2890,
16,
5299,
16,
981,
4672,
290,
33,
538,
18,
803,
18,
5701,
12,
538,
18,
803,
18,
12287,
12,
972,
768,
972,
3631,
5299,
13,
468,
2621,
1062,
2207,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
416,
3810,
90,
2556,
12,
2890,
16,
5299,
16,
981,
4672,
290,
33,
538,
18,
803,
18,
5701,
12,
538,
18,
803,
18,
12287,
12,
972,
768,
972,
3631,
5299,
13,
468,
2621,
1062,
2207,
... |
elif job.is_pyexample: kind = "PythonExample" | def run_tests(): # # Run waf to make sure that everything is built, configured and ready to go # unless we are explicitly told not to. We want to be careful about causing # our users pain while waiting for extraneous stuff to compile and link, so # we allow users that know what they''re doing to not invoke waf at all. # if not options.nowaf: # # If the user is running the "kinds" or "list" options, there is an # implied dependency on the test-runner since we call that program # if those options are selected. We will exit after processing those # options, so if we see them, we can safely only build the test-runner. # # If the user has constrained us to running only a particular type of # file, we can only ask waf to build what we know will be necessary. # For example, if the user only wants to run BVT tests, we only have # to build the test-runner and can ignore all of the examples. # # If the user only wants to run a single example, then we can just build # that example. # # If there is no constraint, then we have to build everything since the # user wants to run everything. # if options.kinds or options.list or (len(options.constrain) and options.constrain in core_kinds): if sys.platform == "win32": waf_cmd = "waf --target=test-runner" else: waf_cmd = "./waf --target=test-runner" elif len(options.example): if sys.platform == "win32": waf_cmd = "waf --target=%s" % os.path.basename(options.example) else: waf_cmd = "./waf --target=%s" % os.path.basename(options.example) else: if sys.platform == "win32": waf_cmd = "waf" else: waf_cmd = "./waf" if options.verbose: print "Building: %s" % waf_cmd proc = subprocess.Popen(waf_cmd, shell = True) proc.communicate() # # Pull some interesting configuration information out of waf, primarily # so we can know where executables can be found, but also to tell us what # pieces of the system have been built. This will tell us what examples # are runnable. # read_waf_active_variant() read_waf_config() make_library_path() # # If lots of logging is enabled, we can crash Python when it tries to # save all of the text. We just don't allow logging to be turned on when # test.py runs. If you want to see logging output from your tests, you # have to run them using the test-runner directly. # os.environ["NS_LOG"] = "" # # There are a couple of options that imply we can to exit before starting # up a bunch of threads and running tests. Let's detect these cases and # handle them without doing all of the hard work. # if options.kinds: path_cmd = os.path.join("utils", "test-runner --kinds") (rc, standard_out, standard_err, et) = run_job_synchronously(path_cmd, os.getcwd(), False, False) print standard_out if options.list: path_cmd = os.path.join("utils", "test-runner --list") (rc, standard_out, standard_err, et) = run_job_synchronously(path_cmd, os.getcwd(), False, False) print standard_out if options.kinds or options.list: return # # We communicate results in two ways. First, a simple message relating # PASS, FAIL, CRASH or SKIP is always written to the standard output. It # is expected that this will be one of the main use cases. A developer can # just run test.py with no options and see that all of the tests still # pass. # # The second main use case is when detailed status is requested (with the # --text or --html options). Typicall this will be text if a developer # finds a problem, or HTML for nightly builds. In these cases, an # XML file is written containing the status messages from the test suites. # This file is then read and translated into text or HTML. It is expected # that nobody will really be interested in the XML, so we write it somewhere # with a unique name (time) to avoid collisions. In case an error happens, we # provide a runtime option to retain the temporary files. # # When we run examples as smoke tests, they are going to want to create # lots and lots of trace files. We aren't really interested in the contents # of the trace files, so we also just stash them off in the temporary dir. # The retain option also causes these unchecked trace files to be kept. # date_and_time = time.strftime("%Y-%m-%d-%H-%M-%S-CUT", time.gmtime()) if not os.path.exists(TMP_OUTPUT_DIR): os.makedirs(TMP_OUTPUT_DIR) testpy_output_dir = os.path.join(TMP_OUTPUT_DIR, date_and_time); if not os.path.exists(testpy_output_dir): os.makedirs(testpy_output_dir) # # Create the main output file and start filling it with XML. We need to # do this since the tests will just append individual results to this file. # xml_results_file = os.path.join(testpy_output_dir, "results.xml") f = open(xml_results_file, 'w') f.write('<?xml version="1.0"?>\n') f.write('<TestResults>\n') f.close() # # We need to figure out what test suites to execute. We are either given one # suite or example explicitly via the --suite or --example/--pyexample option, # or we need to call into the test runner and ask it to list all of the available # test suites. Further, we need to provide the constraint information if it # has been given to us. # # This translates into allowing the following options with respect to the # suites # # ./test,py: run all of the suites and examples # ./test.py --constrain=core: run all of the suites of all kinds # ./test.py --constrain=unit: run all unit suites # ./test,py --suite=some-test-suite: run a single suite # ./test,py --example=udp/udp-echo: run no test suites # ./test,py --pyexample=wireless/mixed-wireless.py: run no test suites # ./test,py --suite=some-suite --example=some-example: run the single suite # # We can also use the --constrain option to provide an ordering of test # execution quite easily. # if len(options.suite): suites = options.suite + "\n" elif len(options.example) == 0 and len(options.pyexample) == 0: if len(options.constrain): path_cmd = os.path.join("utils", "test-runner --list --constrain=%s" % options.constrain) (rc, suites, standard_err, et) = run_job_synchronously(path_cmd, os.getcwd(), False, False) else: path_cmd = os.path.join("utils", "test-runner --list") (rc, suites, standard_err, et) = run_job_synchronously(path_cmd, os.getcwd(), False, False) else: suites = "" # # suite_list will either a single test suite name that the user has # indicated she wants to run or a list of test suites provided by # the test-runner possibly according to user provided constraints. # We go through the trouble of setting up the parallel execution # even in the case of a single suite to avoid having two process the # results in two different places. # suite_list = suites.split('\n') # # We now have a possibly large number of test suites to run, so we want to # run them in parallel. We're going to spin up a number of worker threads # that will run our test jobs for us. # input_queue = Queue.Queue(0) output_queue = Queue.Queue(0) jobs = 0 threads=[] # # In Python 2.6 you can just use multiprocessing module, but we don't want # to introduce that dependency yet; so we jump through a few hoops. # processors = 1 if sys.platform != "win32": if 'SC_NPROCESSORS_ONLN'in os.sysconf_names: processors = os.sysconf('SC_NPROCESSORS_ONLN') else: proc = subprocess.Popen("sysctl -n hw.ncpu", shell = True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout_results, stderr_results = proc.communicate() if len(stderr_results) == 0: processors = int(stdout_results) # # Now, spin up one thread per processor which will eventually mean one test # per processor running concurrently. # for i in range(processors): thread = worker_thread(input_queue, output_queue) threads.append(thread) thread.start() # # Keep track of some summary statistics # total_tests = 0 skipped_tests = 0 # # We now have worker threads spun up, and a list of work to do. So, run # through the list of test suites and dispatch a job to run each one. # # Dispatching will run with unlimited speed and the worker threads will # execute as fast as possible from the queue. # # Note that we actually dispatch tests to be skipped, so all of the # PASS, FAIL, CRASH and SKIP processing is done in the same place. # for test in suite_list: test = test.strip() if len(test): job = Job() job.set_is_example(False) job.set_is_pyexample(False) job.set_display_name(test) job.set_tmp_file_name(os.path.join(testpy_output_dir, "%s.xml" % test)) job.set_cwd(os.getcwd()) job.set_basedir(os.getcwd()) job.set_tempdir(testpy_output_dir) if (options.multiple): multiple = " --multiple" else: multiple = "" path_cmd = os.path.join("utils", "test-runner --suite=%s%s" % (test, multiple)) job.set_shell_command(path_cmd) if options.valgrind and test in core_valgrind_skip_tests: job.set_is_skip(True) if options.verbose: print "Queue %s" % test input_queue.put(job) jobs = jobs + 1 total_tests = total_tests + 1 # # We've taken care of the discovered or specified test suites. Now we # have to deal with examples run as smoke tests. We have a list of all of # the example programs it makes sense to try and run. Each example will # have a condition associated with it that must evaluate to true for us # to try and execute it. This is used to determine if the example has # a dependency that is not satisfied. For example, if an example depends # on NSC being configured by waf, that example should have a condition # that evaluates to true if NSC is enabled. For example, # # ("tcp-nsc-zoo", "ENABLE_NSC == True"), # # In this case, the example "tcp-nsc-zoo" will only be run if we find the # waf configuration variable "ENABLE_NSC" to be True. # # We don't care at all how the trace files come out, so we just write them # to a single temporary directory. # # XXX As it stands, all of the trace files have unique names, and so file # collisions can only happen if two instances of an example are running in # two versions of the test.py process concurrently. We may want to create # uniquely named temporary traces directories to avoid this problem. # # We need to figure out what examples to execute. We are either given one # suite or example explicitly via the --suite or --example option, or we # need to walk the list of examples looking for available example # conditions. # # This translates into allowing the following options with respect to the # suites # # ./test,py: run all of the examples # ./test.py --constrain=unit run no examples # ./test.py --constrain=example run all of the examples # ./test.py --suite=some-test-suite: run no examples # ./test.py --example=some-example: run the single example # ./test.py --suite=some-suite --example=some-example: run the single example # # XXX could use constrain to separate out examples used for performance # testing # if len(options.suite) == 0 and len(options.example) == 0 and len(options.pyexample) == 0: if len(options.constrain) == 0 or options.constrain == "example": if ENABLE_EXAMPLES: for test, do_run, do_valgrind_run in example_tests: if eval(do_run): job = Job() job.set_is_example(True) job.set_is_pyexample(False) job.set_display_name(test) job.set_tmp_file_name("") job.set_cwd(testpy_output_dir) job.set_basedir(os.getcwd()) job.set_tempdir(testpy_output_dir) job.set_shell_command("examples/%s" % test) if options.valgrind and not eval(do_valgrind_run): job.set_is_skip (True) if options.verbose: print "Queue %s" % test input_queue.put(job) jobs = jobs + 1 total_tests = total_tests + 1 elif len(options.example): # # If you tell me to run an example, I will try and run the example # irrespective of any condition. # job = Job() job.set_is_example(True) job.set_is_pyexample(False) job.set_display_name(options.example) job.set_tmp_file_name("") job.set_cwd(testpy_output_dir) job.set_basedir(os.getcwd()) job.set_tempdir(testpy_output_dir) job.set_shell_command("examples/%s" % options.example) if options.verbose: print "Queue %s" % options.example input_queue.put(job) jobs = jobs + 1 total_tests = total_tests + 1 # # Run some Python examples as smoke tests. We have a list of all of # the example programs it makes sense to try and run. Each example will # have a condition associated with it that must evaluate to true for us # to try and execute it. This is used to determine if the example has # a dependency that is not satisfied. # # We don't care at all how the trace files come out, so we just write them # to a single temporary directory. # # We need to figure out what python examples to execute. We are either # given one pyexample explicitly via the --pyexample option, or we # need to walk the list of python examples # # This translates into allowing the following options with respect to the # suites # # ./test.py --constrain=pyexample run all of the python examples # ./test.py --pyexample=some-example.py: run the single python example # if len(options.suite) == 0 and len(options.example) == 0 and len(options.pyexample) == 0: if len(options.constrain) == 0 or options.constrain == "pyexample": if ENABLE_EXAMPLES: for test, do_run in python_tests: if eval(do_run): job = Job() job.set_is_example(False) job.set_is_pyexample(True) job.set_display_name(test) job.set_tmp_file_name("") job.set_cwd(testpy_output_dir) job.set_basedir(os.getcwd()) job.set_tempdir(testpy_output_dir) job.set_shell_command("examples/%s" % test) if options.valgrind and not eval(do_valgrind_run): job.set_is_skip (True) if options.verbose: print "Queue %s" % test input_queue.put(job) jobs = jobs + 1 total_tests = total_tests + 1 elif len(options.pyexample): # # If you tell me to run a python example, I will try and run the example # irrespective of any condition. # job = Job() job.set_is_pyexample(True) job.set_display_name(options.pyexample) job.set_tmp_file_name("") job.set_cwd(testpy_output_dir) job.set_basedir(os.getcwd()) job.set_tempdir(testpy_output_dir) job.set_shell_command("examples/%s" % options.pyexample) if options.verbose: print "Queue %s" % options.pyexample input_queue.put(job) jobs = jobs + 1 total_tests = total_tests + 1 # # Tell the worker threads to pack up and go home for the day. Each one # will exit when they see their is_break task. # for i in range(processors): job = Job() job.set_is_break(True) input_queue.put(job) # # Now all of the tests have been dispatched, so all we have to do here # in the main thread is to wait for them to complete. Keyboard interrupt # handling is broken as mentioned above. We use a signal handler to catch # sigint and set a global variable. When the worker threads sense this # they stop doing real work and will just start throwing jobs back at us # with is_break set to True. In this case, there are no real results so we # ignore them. If there are real results, we always print PASS or FAIL to # standard out as a quick indication of what happened. # passed_tests = 0 failed_tests = 0 crashed_tests = 0 valgrind_errors = 0 for i in range(jobs): job = output_queue.get() if job.is_break: continue if job.is_example: kind = "Example" elif job.is_pyexample: kind = "PythonExample" else: kind = "TestSuite" if job.is_skip: status = "SKIP" skipped_tests = skipped_tests + 1 else: if job.returncode == 0: status = "PASS" passed_tests = passed_tests + 1 elif job.returncode == 1: failed_tests = failed_tests + 1 status = "FAIL" elif job.returncode == 2: valgrind_errors = valgrind_errors + 1 status = "VALGR" else: crashed_tests = crashed_tests + 1 status = "CRASH" print "%s: %s %s" % (status, kind, job.display_name) if job.is_example or job.is_pyexample: # # Examples are the odd man out here. They are written without any # knowledge that they are going to be run as a test, so we need to # cook up some kind of output for them. We're writing an xml file, # so we do some simple XML that says we ran the example. # # XXX We could add some timing information to the examples, i.e. run # them through time and print the results here. # f = open(xml_results_file, 'a') f.write('<Example>\n') example_name = " <Name>%s</Name>\n" % job.display_name f.write(example_name) if status == "PASS": f.write(' <Result>PASS</Result>\n') elif status == "FAIL": f.write(' <Result>FAIL</Result>\n') elif status == "VALGR": f.write(' <Result>VALGR</Result>\n') elif status == "SKIP": f.write(' <Result>SKIP</Result>\n') else: f.write(' <Result>CRASH</Result>\n') f.write(' <ElapsedTime>%.3f</ElapsedTime>\n' % job.elapsed_time) f.write('</Example>\n') f.close() else: # # If we're not running an example, we're running a test suite. # These puppies are running concurrently and generating output # that was written to a temporary file to avoid collisions. # # Now that we are executing sequentially in the main thread, we can # concatenate the contents of the associated temp file to the main # results file and remove that temp file. # # One thing to consider is that a test suite can crash just as # well as any other program, so we need to deal with that # possibility as well. If it ran correctly it will return 0 # if it passed, or 1 if it failed. In this case, we can count # on the results file it saved being complete. If it crashed, it # will return some other code, and the file should be considered # corrupt and useless. If the suite didn't create any XML, then # we're going to have to do it ourselves. # # Another issue is how to deal with a valgrind error. If we run # a test suite under valgrind and it passes, we will get a return # code of 0 and there will be a valid xml results file since the code # ran to completion. If we get a return code of 1 under valgrind, # the test case failed, but valgrind did not find any problems so the # test case return code was passed through. We will have a valid xml # results file here as well since the test suite ran. If we see a # return code of 2, this means that valgrind found an error (we asked # it to return 2 if it found a problem in run_job_synchronously) but # the suite ran to completion so there is a valid xml results file. # If the suite crashes under valgrind we will see some other error # return code (like 139). If valgrind finds an illegal instruction or # some other strange problem, it will die with its own strange return # code (like 132). However, if the test crashes by itself, not under # valgrind we will also see some other return code. # # If the return code is 0, 1, or 2, we have a valid xml file. If we # get another return code, we have no xml and we can't really say what # happened -- maybe the TestSuite crashed, maybe valgrind crashed due # to an illegal instruction. If we get something beside 0-2, we assume # a crash and fake up an xml entry. After this is all done, we still # need to indicate a valgrind error somehow, so we fake up an xml entry # with a VALGR result. Thus, in the case of a working TestSuite that # fails valgrind, we'll see the PASS entry for the working TestSuite # followed by a VALGR failing test suite of the same name. # if job.is_skip: f = open(xml_results_file, 'a') f.write("<TestSuite>\n") f.write(" <SuiteName>%s</SuiteName>\n" % job.display_name) f.write(' <SuiteResult>SKIP</SuiteResult>\n') f.write(' <SuiteTime>Execution times not available</SuiteTime>\n') f.write("</TestSuite>\n") f.close() else: if job.returncode == 0 or job.returncode == 1 or job.returncode == 2: f_to = open(xml_results_file, 'a') f_from = open(job.tmp_file_name) f_to.write(f_from.read()) f_to.close() f_from.close() else: f = open(xml_results_file, 'a') f.write("<TestSuite>\n") f.write(" <SuiteName>%s</SuiteName>\n" % job.display_name) f.write(' <SuiteResult>CRASH</SuiteResult>\n') f.write(' <SuiteTime>Execution times not available</SuiteTime>\n') f.write("</TestSuite>\n") f.close() if job.returncode == 2: f = open(xml_results_file, 'a') f.write("<TestSuite>\n") f.write(" <SuiteName>%s</SuiteName>\n" % job.display_name) f.write(' <SuiteResult>VALGR</SuiteResult>\n') f.write(' <SuiteTime>Execution times not available</SuiteTime>\n') f.write("</TestSuite>\n") f.close() # # We have all of the tests run and the results written out. One final # bit of housekeeping is to wait for all of the threads to close down # so we can exit gracefully. # for thread in threads: thread.join() # # Back at the beginning of time, we started the body of an XML document # since the test suites and examples were going to just write their # individual pieces. So, we need to finish off and close out the XML # document # f = open(xml_results_file, 'a') f.write('</TestResults>\n') f.close() # # Print a quick summary of events # print "%d of %d tests passed (%d passed, %d skipped, %d failed, %d crashed, %d valgrind errors)" % (passed_tests, total_tests, passed_tests, skipped_tests, failed_tests, crashed_tests, valgrind_errors) # # The last things to do are to translate the XML results file to "human # readable form" if the user asked for it (or make an XML file somewhere) # if len(options.html): translate_to_html(xml_results_file, options.html) if len(options.text): translate_to_text(xml_results_file, options.text) if len(options.xml): shutil.copyfile(xml_results_file, options.xml) # # If we have been asked to retain all of the little temporary files, we # don't delete tm. If we do delete the temporary files, delete only the # directory we just created. We don't want to happily delete any retained # directories, which will probably surprise the user. # if not options.retain: shutil.rmtree(testpy_output_dir) if passed_tests + skipped_tests == total_tests: return 0 # success else: return 1 # catchall for general errors | 36d879aed9338f58c9b0dbcf5d40deebf5c2009c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12851/36d879aed9338f58c9b0dbcf5d40deebf5c2009c/test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
16341,
13332,
468,
468,
1939,
24103,
358,
1221,
3071,
716,
7756,
353,
6650,
16,
4351,
471,
5695,
358,
1960,
468,
3308,
732,
854,
8122,
268,
1673,
486,
358,
18,
225,
1660,
2545,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
16341,
13332,
468,
468,
1939,
24103,
358,
1221,
3071,
716,
7756,
353,
6650,
16,
4351,
471,
5695,
358,
1960,
468,
3308,
732,
854,
8122,
268,
1673,
486,
358,
18,
225,
1660,
2545,... | |
user='vtserver', passwd='', | user=db_read_user, passwd=db_read_pass, | def get_vt_tagged_versions(self, host, port, db_name, vt_id): self.server_logger.info("Request: get_vt_tagged_versions(%s,%s,%s,%s)"%(host, port, db_name, vt_id)) try: locator = DBLocator(host=host, port=int(port), database=db_name, user='vtserver', passwd='', obj_id=int(vt_id), obj_type=None, connection_id=None) | 3ebd431b3e88347283e0d6f951c8fac25465a30e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/3ebd431b3e88347283e0d6f951c8fac25465a30e/application_server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
11734,
67,
23023,
67,
10169,
12,
2890,
16,
1479,
16,
1756,
16,
1319,
67,
529,
16,
7966,
67,
350,
4672,
365,
18,
3567,
67,
4901,
18,
1376,
2932,
691,
30,
336,
67,
11734,
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,
11734,
67,
23023,
67,
10169,
12,
2890,
16,
1479,
16,
1756,
16,
1319,
67,
529,
16,
7966,
67,
350,
4672,
365,
18,
3567,
67,
4901,
18,
1376,
2932,
691,
30,
336,
67,
11734,
67,
... |
S = self.system() if S != 'sage': if s.startswith('%sage'): | if self.system() != 'sage': if len(s) == 0 or s[0] != "%": return True, self._eval_cmd(self.system(), s, os.path.abspath(C.directory())) elif s.startswith("%sage"): | def check_for_system_switching(self, s, C): r""" Check for input cells that start with \code{\%foo}, where \var{foo} is an object with an eval method. """ z = s s = s.lstrip() S = self.system() if S != 'sage': if s.startswith('%sage'): s = after_first_word(s).lstrip() z = s else: return True, self._eval_cmd(S, s, os.path.abspath(C.directory())) if len(s) == 0 or s[0] != '%': return False, z if s.startswith('%hide'): t = after_first_word(s).lstrip() if len(t) == 0 or t[0] != '%': return False, t s = t if s.startswith('%save_server'): self.notebook().save() t = after_first_word(s).lstrip() if len(t) == 0 or t[0] != '%': return False, t s = t if s.startswith("%cython") or s.startswith("%pyrex") or s.startswith("%sagex"): # a block of Cython code. return True, self.cython_import(after_first_word(s).lstrip(), C) | 3ddc8ee2dbf2eeecd939448fa1a97d25590c8172 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/3ddc8ee2dbf2eeecd939448fa1a97d25590c8172/worksheet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
1884,
67,
4299,
67,
9610,
310,
12,
2890,
16,
272,
16,
385,
4672,
436,
8395,
2073,
364,
810,
5983,
716,
787,
598,
521,
710,
23241,
9,
11351,
5779,
1625,
521,
1401,
95,
11351,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1884,
67,
4299,
67,
9610,
310,
12,
2890,
16,
272,
16,
385,
4672,
436,
8395,
2073,
364,
810,
5983,
716,
787,
598,
521,
710,
23241,
9,
11351,
5779,
1625,
521,
1401,
95,
11351,
... |
if str(state) == str([(2,1), (0,1)]) and \ str(newLhs) == str([(2,1), (3,1)]): set_trace() | def getSimilarState(lhs, states): """lhs and all states items must be a reduced state""" foundState = None if lhs == []: foundState = ([], 0) i = 0 while i < len(states) and foundState is None: state = copy(states[i]) if state != []: state.sort() newLhs = copy(lhs) newLhs.sort() difference = newLhs[0].i - state[0].i if difference != 0: newLhs = map(lambda s: fsc.StandardPosition(s.i - difference, s.e), lhs) if str(state) == str([(2,1), (0,1)]) and \ str(newLhs) == str([(2,1), (3,1)]): set_trace() if isStateEqual(newLhs, state): foundState = (state, difference) i += 1 if foundState is None: set_trace() return foundState | aca87753c237888d667ffda5a14498674ab22868 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5196/aca87753c237888d667ffda5a14498674ab22868/possibleStates.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1322,
381,
5611,
1119,
12,
80,
4487,
16,
5493,
4672,
3536,
80,
4487,
471,
777,
5493,
1516,
1297,
506,
279,
13162,
919,
8395,
1392,
1119,
273,
599,
309,
8499,
422,
5378,
30,
1392,
1119,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1322,
381,
5611,
1119,
12,
80,
4487,
16,
5493,
4672,
3536,
80,
4487,
471,
777,
5493,
1516,
1297,
506,
279,
13162,
919,
8395,
1392,
1119,
273,
599,
309,
8499,
422,
5378,
30,
1392,
1119,
... | |
r""" The cubes: $a(n) = n^3$. INPUT: n -- non negative integer OUTPUT: integer -- function value EXAMPLES: sage: a = sloane.A000578;a The cubes: n^3 sage: a(-1) Traceback (most recent call last): ... ValueError: input n (=-1) must be an integer >= 0 sage: a(0) 0 sage: a(3) 27 sage: a(11) 1331 sage: a.list(12) [0, 1, 8, 27, 64, 125, 216, 343, 512, 729, 1000, 1331] AUTHOR: -- Jaap Spies (2007-01-26) """ def __init__(self): | def __init__(self): r""" The cubes: $a(n) = n^3$. INPUT: n -- non negative integer OUTPUT: integer -- function value EXAMPLES: sage: a = sloane.A000578;a The cubes: n^3 sage: a(-1) Traceback (most recent call last): ... ValueError: input n (=-1) must be an integer >= 0 sage: a(0) 0 sage: a(3) 27 sage: a(11) 1331 sage: a.list(12) [0, 1, 8, 27, 64, 125, 216, 343, 512, 729, 1000, 1331] AUTHOR: -- Jaap Spies (2007-01-26) """ | def _eval(self, n): return Integer(2**n) | 7b02e5455d5d52d6dcc7f2314cdd56803031a1c6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/7b02e5455d5d52d6dcc7f2314cdd56803031a1c6/sloane_functions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8622,
12,
2890,
16,
290,
4672,
327,
2144,
12,
22,
636,
82,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
389,
8622,
12,
2890,
16,
290,
4672,
327,
2144,
12,
22,
636,
82,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
fields = (doc.seealsos() + doc.authors() + doc.requires() + doc.warnings() + doc.notes()) if doc.version(): fields.append(doc.version()) if doc.descr(): fields.append(doc.descr()) return fields | field_values = [] for field in doc.fields(): field_values += doc.field_value(field) return field_values | def _standard_field_values(self, doc): """ @return: A list of epytext field values that includes all fields that are common to all L{ObjDoc}s. C{_standard_field_value} is used by L{_extract_term_index}. @rtype: C{list} of L{xml.dom.minidom.Document} """ fields = (doc.seealsos() + doc.authors() + doc.requires() + doc.warnings() + doc.notes()) if doc.version(): fields.append(doc.version()) if doc.descr(): fields.append(doc.descr()) return fields | 36d55ba570a7b20eabb1f20282f2d10ee3127367 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/36d55ba570a7b20eabb1f20282f2d10ee3127367/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
10005,
67,
1518,
67,
2372,
12,
2890,
16,
997,
4672,
3536,
632,
2463,
30,
432,
666,
434,
425,
2074,
955,
652,
924,
716,
6104,
777,
1466,
716,
854,
2975,
358,
777,
511,
95,
2675,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10005,
67,
1518,
67,
2372,
12,
2890,
16,
997,
4672,
3536,
632,
2463,
30,
432,
666,
434,
425,
2074,
955,
652,
924,
716,
6104,
777,
1466,
716,
854,
2975,
358,
777,
511,
95,
2675,
... |
if site.lang != 'commons': | if (site.lang != 'commons' and self.CommonsDelinker.config['global']): | def get_summary(self, site, image, admin, reason, replacement): """ Get the summary template and substitute the correct values.""" # FIXME: Hardcode is EVIL if site.lang != 'commons': reason = reason.replace('[[', '[[commons:') if replacement: tlp = self.CommonsDelinker.SummaryCache.get(site, 'replace-I18n') else: tlp = self.CommonsDelinker.SummaryCache.get(site, 'summary-I18n') tlp = tlp.replace('$1', image) if replacement: tlp = tlp.replace('$2', replacement) tlp = tlp.replace('$3', unicode(admin)) tlp = tlp.replace('$4', unicode(reason)) else: tlp = tlp.replace('$2', unicode(admin)) tlp = tlp.replace('$3', unicode(reason)) return tlp | 17a85ac63e47810cc72be098bd594698ace87f68 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/17a85ac63e47810cc72be098bd594698ace87f68/delinker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
7687,
12,
2890,
16,
2834,
16,
1316,
16,
3981,
16,
3971,
16,
6060,
4672,
3536,
968,
326,
4916,
1542,
471,
14811,
326,
3434,
924,
12123,
468,
9852,
30,
670,
1060,
710,
353,
1483... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7687,
12,
2890,
16,
2834,
16,
1316,
16,
3981,
16,
3971,
16,
6060,
4672,
3536,
968,
326,
4916,
1542,
471,
14811,
326,
3434,
924,
12123,
468,
9852,
30,
670,
1060,
710,
353,
1483... |
query = [ OrQuery(EqQuery('title', word), EqQuery('text', word)) for word, kk in TextField.split(text) ] query = AndQuery(*query) results = root.search(query=query) documents = results.get_documents(start=start, size=size) | if text.split(): query = [ OrQuery(EqQuery('title', word), EqQuery('text', word)) for word, kk in TextField.split(text) ] query = AndQuery(*query) results = root.search(query=query) total = results.get_n_documents() documents = results.get_documents(start=start, size=size) else: documents = [] total = 0 | def site_search(self, context): root = context.root | 0ff784ba7bc3929b42ff604f657bdb48cf9079fe /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12681/0ff784ba7bc3929b42ff604f657bdb48cf9079fe/website.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2834,
67,
3072,
12,
2890,
16,
819,
4672,
1365,
273,
819,
18,
3085,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2834,
67,
3072,
12,
2890,
16,
819,
4672,
1365,
273,
819,
18,
3085,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
elif isinstance(context, ClassDoc) and isinstance(value, classmethod): | elif isinstance(value, classmethod): | def inspector_method(self, value, context): """ @return: A routine that should be used to inspect the given value. This routine should accept two parameters, a value and a L{ValueDoc}; and should udpate the C{ValueDoc} with API documentation information about the value. Typically, the routine will modify the C{ValueDoc}'s class using the L{specialize_to()<APIDoc.specialize_to>} method. @param context: The API documentation for the class of module that contains C{value} (if available). Currently, this is just used to decide whether a function object should be treated as an instance method or not. @rtype: C{routine} """ if inspect.ismodule(value): return self.inspect_module elif inspect.isclass(value): return self.inspect_class elif isinstance(context, ClassDoc) and isinstance(value, classmethod): return self.inspect_classmethod elif isinstance(context, ClassDoc) and isinstance(value, staticmethod): return self.inspect_staticmethod elif isinstance(context, ClassDoc) and inspect.isroutine(value): return self.inspect_instancemethod elif inspect.isfunction(value): return self.inspect_function elif inspect.isroutine(value): return self.inspect_builtin elif isinstance(value, property): return self.inspect_property else: return self.inspect_value | 960670d3795d5b5fc8874a89f10226823a601309 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/960670d3795d5b5fc8874a89f10226823a601309/docinspector.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
22700,
67,
2039,
12,
2890,
16,
460,
16,
819,
4672,
3536,
632,
2463,
30,
432,
12245,
716,
1410,
506,
1399,
358,
5334,
326,
864,
460,
18,
225,
1220,
12245,
1410,
2791,
2795,
1472,
16,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
22700,
67,
2039,
12,
2890,
16,
460,
16,
819,
4672,
3536,
632,
2463,
30,
432,
12245,
716,
1410,
506,
1399,
358,
5334,
326,
864,
460,
18,
225,
1220,
12245,
1410,
2791,
2795,
1472,
16,
27... |
execfile("drover.properties") | f = open("drover.properties") exec(f) f.close() | def drover(options, args): revision = options.revert or options.merge # Initialize some variables used below. They can be overwritten by # the drover.properties file. BASE_URL = "svn://svn.chromium.org/chrome" TRUNK_URL = BASE_URL + "/trunk/src" BRANCH_URL = BASE_URL + "/branches/$branch/src" SKIP_CHECK_WORKING = True PROMPT_FOR_AUTHOR = False DEFAULT_WORKING = "drover_" + str(revision) if options.branch: DEFAULT_WORKING += ("_" + options.branch) if not isMinimumSVNVersion(1, 5): print "You need to use at least SVN version 1.5.x" return 1 # Override the default properties if there is a drover.properties file. global file_pattern_ if os.path.exists("drover.properties"): FILE_PATTERN = file_pattern_ execfile("drover.properties") if FILE_PATTERN: file_pattern_ = FILE_PATTERN if options.revert and options.branch: url = BRANCH_URL.replace("$branch", options.branch) elif options.merge and options.sbranch: url = BRANCH_URL.replace("$branch", options.sbranch) else: url = TRUNK_URL working = options.workdir or DEFAULT_WORKING if options.local: working = os.getcwd() if not inCheckoutRoot(working): print "'%s' appears not to be the root of a working copy" % working return 1 if (isSVNDirty() and not prompt("Working copy contains uncommitted files. Continue?")): return 1 command = 'svn log ' + url + " -r "+str(revision) + " -v" os.system(command) if not (options.revertbot or prompt("Is this the correct revision?")): return 0 if (os.path.exists(working)) and not options.local: if not (options.revertbot or SKIP_CHECK_WORKING or prompt("Working directory: '%s' already exists, clobber?" % working)): return 0 gclient_utils.RemoveDirectory(working) if not options.local: os.makedirs(working) os.chdir(working) if options.merge: action = "Merge" if not options.local: branch_url = BRANCH_URL.replace("$branch", options.branch) # Checkout everything but stuff that got added into a new dir checkoutRevision(url, revision, branch_url) # Merge everything that changed mergeRevision(url, revision) # "Export" files that were added from the source and add them to branch exportRevision(url, revision) # Delete directories that were deleted (file deletes are handled in the # merge). deleteRevision(url, revision) elif options.revert: action = "Revert" if options.branch: url = BRANCH_URL.replace("$branch", options.branch) checkoutRevision(url, revision, url, True) revertRevision(url, revision) revertExportRevision(url, revision) # Check the base url so we actually find the author who made the change if options.auditor: author = options.auditor else: author = getAuthor(url, revision) if not author: author = getAuthor(TRUNK_URL, revision) filename = str(revision)+".txt" out = open(filename,"w") out.write(action +" " + str(revision) + " - ") out.write(getRevisionLog(url, revision)) if (author): out.write("\nTBR=" + author) out.close() change_cmd = 'change ' + str(revision) + " " + filename if options.revertbot: change_cmd += ' --silent' runGcl(change_cmd) os.unlink(filename) if options.local: return 0 print author print revision print ("gcl upload " + str(revision) + " --send_mail --no_presubmit --reviewers=" + author) if options.revertbot or prompt("Would you like to upload?"): if PROMPT_FOR_AUTHOR: author = text_prompt("Enter new author or press enter to accept default", author) if options.revertbot and options.revertbot_reviewers: author += "," author += options.revertbot_reviewers gclUpload(revision, author) else: print "Deleting the changelist." print "gcl delete " + str(revision) runGcl("delete " + str(revision)) return 0 # We commit if the reverbot is set to commit automatically, or if this is # not the revertbot and the user agrees. if options.revertbot_commit or (not options.revertbot and prompt("Would you like to commit?")): print "gcl commit " + str(revision) + " --no_presubmit --force" return runGcl("commit " + str(revision) + " --no_presubmit --force") else: return 0 | 8f29513e4f03bba1ec58db1d28591081c3d0d93f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6076/8f29513e4f03bba1ec58db1d28591081c3d0d93f/drover.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31473,
502,
12,
2116,
16,
833,
4672,
6350,
273,
702,
18,
266,
1097,
578,
702,
18,
2702,
225,
468,
9190,
2690,
3152,
1399,
5712,
18,
16448,
848,
506,
15345,
635,
468,
326,
31473,
502,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31473,
502,
12,
2116,
16,
833,
4672,
6350,
273,
702,
18,
266,
1097,
578,
702,
18,
2702,
225,
468,
9190,
2690,
3152,
1399,
5712,
18,
16448,
848,
506,
15345,
635,
468,
326,
31473,
502,
1... |
self.doclist.Delete(entry.GetEditLink().href) | self.editClient.Delete(entry.GetEditLink().href) | def testUploadAndDeletePresentation(self): ms = gdata.MediaSource(file_path='test.ppt', content_type='application/vnd.ms-powerpoint') entry = self.doclist.UploadPresentation(ms, 'test preso') self.assertEqual(entry.title.text, 'test preso') self.assertEqual(entry.category[0].label, 'presentation') self.assert_(isinstance(entry, gdata.docs.DocumentListEntry)) self.doclist.Delete(entry.GetEditLink().href) | 6a1d41e0ebd05471e1aa915fdf0a98f4af4bce69 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5609/6a1d41e0ebd05471e1aa915fdf0a98f4af4bce69/service_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
4777,
1876,
2613,
6351,
367,
12,
2890,
4672,
4086,
273,
314,
892,
18,
5419,
1830,
12,
768,
67,
803,
2218,
3813,
18,
84,
337,
2187,
913,
67,
723,
2218,
3685,
19,
11169,
18,
959,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
4777,
1876,
2613,
6351,
367,
12,
2890,
4672,
4086,
273,
314,
892,
18,
5419,
1830,
12,
768,
67,
803,
2218,
3813,
18,
84,
337,
2187,
913,
67,
723,
2218,
3685,
19,
11169,
18,
959,
... |
raise socket.error, "Tunnel connection failed: %d %s" % (code, message.strip()) | raise socket.error("Tunnel connection failed: %d %s" % (code, message.strip())) | def _tunnel(self): self._set_hostport(self._tunnel_host, self._tunnel_port) self.send("CONNECT %s:%d HTTP/1.0\r\n\r\n" % (self.host, self.port)) response = self.response_class(self.sock, strict = self.strict, method = self._method) (version, code, message) = response._read_status() | 92331d5e1be51aa990836dd8f0c43b33e8802a7d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8546/92331d5e1be51aa990836dd8f0c43b33e8802a7d/httplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
19878,
12,
2890,
4672,
365,
6315,
542,
67,
2564,
655,
12,
2890,
6315,
19878,
67,
2564,
16,
365,
6315,
19878,
67,
655,
13,
365,
18,
4661,
2932,
11032,
738,
87,
5319,
72,
2239,
19,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
19878,
12,
2890,
4672,
365,
6315,
542,
67,
2564,
655,
12,
2890,
6315,
19878,
67,
2564,
16,
365,
6315,
19878,
67,
655,
13,
365,
18,
4661,
2932,
11032,
738,
87,
5319,
72,
2239,
19,
... |
msg = "You are about to delete " if track_count > 0: msg += " %i tracks" % track_count if file_count > 0: msg += " %i files" % file_count if folder_count > 0: msg += " %i folders" % folder_count if playlist_count > 0: msg += " %i playlists" % playlist_count if folder_count > 0 : msg += "\nAll the files contained within the folders will be destroyed as well" confirm_dlg = gtk.MessageDialog(self.window, gtk.DIALOG_MODAL, gtk.MESSAGE_QUESTION, gtk.BUTTONS_OK_CANCEL, msg) confirm_dlg.set_title("Confirm delete") response=confirm_dlg.run() confirm_dlg.destroy() if response <> gtk.RESPONSE_OK: return for metadata in to_del: if DEBUG: debug_trace("deleting file with ID %s (%s)" % (metadata.id, metadata.filename), sender=self) self.transfer_manager.del_file(metadata) | if metadata.type == Metadata.TYPE_PLAYLIST_ITEM: to_remove_from_playlist.append(metadata) to_del.remove(metadata) if len(to_del)>0: msg = "You are about to delete " if track_count > 0: msg += " %i tracks" % track_count if file_count > 0: msg += " %i files" % file_count if folder_count > 0: msg += " %i folders" % folder_count if playlist_count > 0: msg += " %i playlists" % playlist_count if folder_count > 0 : msg += "\nAll the files contained within the folders will be destroyed as well" confirm_dlg = gtk.MessageDialog(self.window, gtk.DIALOG_MODAL, gtk.MESSAGE_QUESTION, gtk.BUTTONS_OK_CANCEL, msg) confirm_dlg.set_title("Confirm delete") response=confirm_dlg.run() confirm_dlg.destroy() if response <> gtk.RESPONSE_OK: return for metadata in to_del: if DEBUG: debug_trace("deleting file with ID %s (%s)" % (metadata.id, metadata.filename), sender=self) self.transfer_manager.del_file(metadata) for metadata in to_remove_from_playlist: self.transfer_manager.remove_track_from_playlist(metadata) | def delete_objects(self, to_del): if len(to_del)==0: return (folder_count, playlist_count, file_count, track_count) = (0, 0, 0, 0) | c53ab5980eab6bc66121ddbad3807ad1581e7164 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2271/c53ab5980eab6bc66121ddbad3807ad1581e7164/MTPnavigatorGui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
67,
6911,
12,
2890,
16,
358,
67,
3771,
4672,
309,
562,
12,
869,
67,
3771,
13,
631,
20,
30,
327,
261,
5609,
67,
1883,
16,
16428,
67,
1883,
16,
585,
67,
1883,
16,
3298,
67,
188... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1430,
67,
6911,
12,
2890,
16,
358,
67,
3771,
4672,
309,
562,
12,
869,
67,
3771,
13,
631,
20,
30,
327,
261,
5609,
67,
1883,
16,
16428,
67,
1883,
16,
585,
67,
1883,
16,
3298,
67,
188... |
pass | logging.exception ("error killing process") | def killProcess(self, pid=None): if pid is not None: try: os.kill(pid, signal.SIGTERM) time.sleep(1) os.kill(pid, signal.SIGKILL) except: pass | f0bf8dbddcd648a5fac7417081eff16a65f3ea2c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12354/f0bf8dbddcd648a5fac7417081eff16a65f3ea2c/platformutils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8673,
2227,
12,
2890,
16,
4231,
33,
7036,
4672,
309,
4231,
353,
486,
599,
30,
775,
30,
1140,
18,
16418,
12,
6610,
16,
4277,
18,
18513,
15176,
13,
813,
18,
19607,
12,
21,
13,
1140,
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,
8673,
2227,
12,
2890,
16,
4231,
33,
7036,
4672,
309,
4231,
353,
486,
599,
30,
775,
30,
1140,
18,
16418,
12,
6610,
16,
4277,
18,
18513,
15176,
13,
813,
18,
19607,
12,
21,
13,
1140,
18... |
for s in self._edit_grp.signals: | sigs = [p for p in editable.programs if not p.startswith("@")] for s in sigs: | def _get_api_signals(self): ret = {} | 3f644b5b69cc4224d8cdda4bb754bf492f566745 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12343/3f644b5b69cc4224d8cdda4bb754bf492f566745/rpc_handlers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
2425,
67,
29659,
12,
2890,
4672,
325,
273,
2618,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
2425,
67,
29659,
12,
2890,
4672,
325,
273,
2618,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
gnucap += self.to_gnucap_res(self.gnucap_name + "_top", 0, 1, self.value_top) | gnucap_resp = self.to_gnucap_res(self.gnucap_name + "_top", 0, 1, self.value_top) gnucap[0] += gnucap_resp[0] gnucap[1] += gnucap_resp[1] | def to_gnucap(self, model): | 13ee6c41f57e9506834260f5eae4b05b66b6faeb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11306/13ee6c41f57e9506834260f5eae4b05b66b6faeb/electric.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
67,
1600,
5286,
438,
12,
2890,
16,
938,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
358,
67,
1600,
5286,
438,
12,
2890,
16,
938,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
the (n,k)-star graph. Frist, two vertices are adjacent if one can be | the (n,k)-star graph. First, two vertices are adjacent if one can be | def NKStarGraph(self,n,k): r''' Returns the (n,k)-star graph. The vertices of the (n,k)-star graph are the set of all arangements of n symbols into labels of length k. There are two adjacency rules for the (n,k)-star graph. Frist, two vertices are adjacent if one can be obtained from the other by swapping the first symbol with another symbol. Second, two vertices are adjacent if one can be obtained from the other by swapping the first symbol with an external symbol (a symbol not used in the original label). INPUT:: - ``n`` - ``k`` EXAMPLES:: sage: g = graphs.NKStarGraph(4,2) sage: g.plot() # long time REFERENCES: - Wei-Kuo, Chiang, and Chen Rong-Jaye. "The (n, k)-star graph: A generalized star graph." Information Processing Letters 56, no. 5 (December 8, 1995): 259-264. AUTHORS: - Michael Yurko (2009-09-01) | aa71796c41743b21cf5dd66d16cf6af9c8e363ee /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/aa71796c41743b21cf5dd66d16cf6af9c8e363ee/graph_generators.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
423,
47,
18379,
4137,
12,
2890,
16,
82,
16,
79,
4672,
436,
26418,
2860,
326,
261,
82,
16,
79,
24950,
10983,
2667,
18,
225,
1021,
6928,
434,
326,
261,
82,
16,
79,
24950,
10983,
2667,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
423,
47,
18379,
4137,
12,
2890,
16,
82,
16,
79,
4672,
436,
26418,
2860,
326,
261,
82,
16,
79,
24950,
10983,
2667,
18,
225,
1021,
6928,
434,
326,
261,
82,
16,
79,
24950,
10983,
2667,
... |
rsa = RSA.gen_key(256, 65537, self.gen2_callback) assert len(rsa) == 256 | rsa = RSA.gen_key(512, 65537, self.gen2_callback) assert len(rsa) == 512 | def test_keygen_bad_cb(self): rsa = RSA.gen_key(256, 65537, self.gen2_callback) assert len(rsa) == 256 assert rsa.e == '\000\000\000\003\001\000\001' # aka 65537 aka 0xf4 assert rsa.check_key() == 1 | b10c53309bf5a763f622542ce68cfbee01186a91 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10522/b10c53309bf5a763f622542ce68cfbee01186a91/test_rsa.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
856,
4507,
67,
8759,
67,
7358,
12,
2890,
4672,
14771,
273,
13470,
18,
4507,
67,
856,
12,
13757,
16,
8982,
6418,
16,
365,
18,
4507,
22,
67,
3394,
13,
1815,
562,
12,
24654,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
856,
4507,
67,
8759,
67,
7358,
12,
2890,
4672,
14771,
273,
13470,
18,
4507,
67,
856,
12,
13757,
16,
8982,
6418,
16,
365,
18,
4507,
22,
67,
3394,
13,
1815,
562,
12,
24654,
1... |
os.system("/home/ldm/bin/pqinsert /tmp/wxc_snet8.txt") | os.system("/home/ldm/bin/pqinsert -p wxc_snet8.txt /tmp/wxc_snet8.txt") | def main(): kcci = iemAccessNetwork.iemAccessNetwork("KCCI") kelo = iemAccessNetwork.iemAccessNetwork("KELO") kimt = iemAccessNetwork.iemAccessNetwork("KIMT") kcci.getObs(iemdb) kelo.getObs(iemdb) kimt.getObs(iemdb) kcci.getTrend15(iemdb) kelo.getTrend15(iemdb) kimt.getTrend15(iemdb) kcci.getPrecipTotals(iemdb) kelo.getPrecipTotals(iemdb) kimt.getPrecipTotals(iemdb) kcci.data = computeOthers(kcci.data) kelo.data = computeOthers(kelo.data) kimt.data = computeOthers(kimt.data) # Ugly, but necessary of = open('kcci.dat', 'w') of.write("sid,ts,tmpf,dwpf,relh,feel,alti,altiTend,drctTxt,sped,sknt,drct,20gu,gmph,gtim,pday,pmonth,tmpf_min,tmpf_max,max_sknt,drct_max,max_sped,max_drctTxt,max_srad,\n") for sid in kcci.data.keys(): try: of.write("%(station)s,%(ticks)s,%(tmpf).0f,%(dwpf).0f,%(relh).0f,%(feel).0f,%(pres).2f,%(altiTend)s,%(drctTxt)s,%(sped).0f,%(sknt).0f,%(drct).0f,%(20gu).0f,%(gmph).0f,%(gtim)s,%(pday).2f,%(pmonth).2f,%(min_tmpf).0f,%(max_tmpf).0f,%(max_gust).0f,%(max_drct).0f,%(max_sped).0f,%(max_drctTxt)s,%(max_srad).0f,\n" % kcci.data[sid] ) except: print kcci.data[sid] print sys.excepthook(sys.exc_info()[0],sys.exc_info()[1],sys.exc_info()[2] ) sys.exc_traceback = None of.close() os.system("/home/ldm/bin/pqinsert -p 'data c %s csv/kcci.dat bogus dat' kcci.dat"%(tstr,) ) os.remove("kcci.dat") of = open('kcci2.dat', 'w') of.write("sid,ts,tmpf,dwpf,relh,feel,alti,altiTend,drctTxt,sped,sknt,drct,20gu,gmph,gtim,pday,pmonth,tmpf_min,tmpf_max,max_sknt,drct_max,max_sped,max_drctTxt,srad,max_srad,online,\n") for sid in kcci.data.keys(): kcci.data[sid]['online'] = 1 if ((now - kcci.data[sid]['ts']) > 3600): kcci.data[sid]['online'] = 0 try: of.write("%(station)s,%(ticks).0f,%(tmpf).0f,%(dwpf).0f,%(relh).0f,%(feel).0f,%(pres).2f,%(altiTend)s,%(drctTxt)s,%(sped).0f,%(sknt).0f,%(drct).0f,%(20gu).0f,%(gmph).0f,%(gtim)s,%(pday).2f,%(pmonth).2f,%(min_tmpf).0f,%(max_tmpf).0f,%(max_sknt).0f,%(max_drct).0f,%(max_sped).0f,%(max_drctTxt)s,%(srad).0f,%(max_srad).0f,%(online)s,\n" % kcci.data[sid] ) except: print kcci.data[sid] print sys.excepthook(sys.exc_info()[0],sys.exc_info()[1],sys.exc_info()[2] ) sys.exc_traceback = None of.close() os.system("/home/ldm/bin/pqinsert -p 'data c %s csv/kcci2.dat bogus dat' kcci2.dat"%(tstr,)) os.remove("kcci2.dat") #of = open('kelo.dat', 'w') #of.write("sid,ts,tmpf,dwpf,relh,feel,alti,altiTend,drctTxt,sped,sknt,drct,20gu,gmph,gtim,pday,pmonth,tmpf_min,tmpf_max,max_sknt,drct_max,max_sped,max_drctTxt,srad,max_srad,\n") #for sid in kelo.data.keys(): # try: # of.write("%(station)s,%(ticks).0f,%(tmpf).0f,%(dwpf).0f,%(relh).0f,%(feel).0f,%(pres).2f,%(altiTend)s,%(drctTxt)s,%(sped).0f,%(sknt).0f,%(drct).0f,%(20gu).0f,%(gmph).0f,%(gtim)s,%(pday).2f,%(pmonth).2f,%(min_tmpf).0f,%(max_tmpf).0f,%(max_sknt).0f,%(max_drct).0f,%(max_sped).0f,%(max_drctTxt)s,%(srad).0f,%(max_srad).0f,\n" % kelo.data[sid] ) # except: # print kelo.data[sid] # print sys.excepthook(sys.exc_info()[0],sys.exc_info()[1],sys.exc_info()[2] ) # sys.exc_traceback = None #of.close() #os.system("/home/ldm/bin/pqinsert -p 'data c %s csv/kelo.dat bogus dat' kelo.dat"%(tstr,) ) #os.remove("kelo.dat") of = open('kimt.dat', 'w') of.write("sid,ts,tmpf,dwpf,relh,feel,alti,altiTend,drctTxt,sped,sknt,drct,20gu,gmph,gtim,pday,pmonth,tmpf_min,tmpf_max,max_sknt,drct_max,max_sped,max_drctTxt,srad,max_srad,\n") for sid in kimt.data.keys(): try: of.write("%(station)s,%(ticks).0f,%(tmpf).0f,%(dwpf).0f,%(relh).0f,%(feel).0f,%(pres).2f,%(altiTend)s,%(drctTxt)s,%(sped).0f,%(sknt).0f,%(drct).0f,%(20gu).0f,%(gmph).0f,%(gtim)s,%(pday).2f,%(pmonth).2f,%(min_tmpf).0f,%(max_tmpf).0f,%(max_sknt).0f,%(max_drct).0f,%(max_sped).0f,%(max_drctTxt)s,%(srad).0f,%(max_srad).0f,\n" % kimt.data[sid] ) except: #print kimt.data[sid] #print sys.excepthook(sys.exc_info()[0],sys.exc_info()[1],sys.exc_info()[2] ) sys.exc_traceback = None of.close() os.system("/home/ldm/bin/pqinsert -p 'data c %s csv/kimt.dat bogus dat' kimt.dat"%(tstr,) ) os.remove("kimt.dat") # Do KCCI stuff in WXC format of = open('/tmp/wxc_snet8.txt', 'w') of.write("""Weather Central 001d0300 Surface Data 25 5 Station 52 CityName 20 CityShort 2 State 7 Lat 8 Lon 2 Day 4 Hour 4 AirTemp 4 AirDewp 4 Feels Like 4 Wind Direction Degrees 4 Wind Direction Text 4 Wind Speed 4 Today Max Temp 4 Today Min Temp 4 Today Max Wind Gust MPH 3 Today Max Wind Direction Text 6 Today Precip 6 Month Precip 8 Time of Today Gust 6 Last 2 Day Precip 6 Last 3 Day Precip 6 Last 7 Day Precip 6 Last 14 Day Precip | 7ff7a6e59f07043995b2672993e2d504e1bf6818 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11189/7ff7a6e59f07043995b2672993e2d504e1bf6818/snet_collect.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
417,
952,
77,
273,
277,
351,
1862,
3906,
18,
77,
351,
1862,
3906,
2932,
47,
6743,
45,
7923,
417,
24214,
273,
277,
351,
1862,
3906,
18,
77,
351,
1862,
3906,
2932,
6859,
150... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
417,
952,
77,
273,
277,
351,
1862,
3906,
18,
77,
351,
1862,
3906,
2932,
47,
6743,
45,
7923,
417,
24214,
273,
277,
351,
1862,
3906,
18,
77,
351,
1862,
3906,
2932,
6859,
150... |
def check_mkcacert(self): | def mkcacert(self): | def check_mkcacert(self): req, pk = self.mkreq(512, ca=1) pkey = req.get_pubkey() sub = req.get_subject() cert = X509.X509() cert.set_serial_number(1) cert.set_version(2) cert.set_subject(sub) t = long(time.time()) + time.timezone now = ASN1.ASN1_UTCTIME() now.set_time(t) nowPlusYear = ASN1.ASN1_UTCTIME() nowPlusYear.set_time(t + 60 * 60 * 24 * 365) cert.set_not_before(now) cert.set_not_after(nowPlusYear) issuer = X509.X509_Name() issuer.C = "UK" issuer.CN = "OpenSSL Group" cert.set_issuer(issuer) cert.set_pubkey(pkey) cert.set_pubkey(cert.get_pubkey()) ext = X509.new_extension('basicConstraints', 'CA:TRUE') cert.add_ext(ext) cert.sign(pk, 'sha1') | 66490ba9b17750ebae72c297924555f513ff8602 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8055/66490ba9b17750ebae72c297924555f513ff8602/test_x509.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5028,
71,
1077,
1051,
12,
2890,
4672,
1111,
16,
2365,
273,
365,
18,
24816,
3658,
12,
13757,
16,
3474,
33,
21,
13,
19291,
273,
1111,
18,
588,
67,
23428,
1435,
720,
273,
1111,
18,
588,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5028,
71,
1077,
1051,
12,
2890,
4672,
1111,
16,
2365,
273,
365,
18,
24816,
3658,
12,
13757,
16,
3474,
33,
21,
13,
19291,
273,
1111,
18,
588,
67,
23428,
1435,
720,
273,
1111,
18,
588,
... |
return DatagridNode(bits[1],bits[2],nodelist) | app, model = None, None if len(bits) == 3: app = bits[1] model = bits[2] return DatagridNode(app, model,nodelist) | def datagrid(parser, token): """ Generates a dojo datagrid for a given app's model. renders the contents until {% enddatagrid %} and takes options in the form of option=value per line. """ bits = token.split_contents() nodelist = parser.parse(('enddatagrid',)) parser.delete_first_token() return DatagridNode(bits[1],bits[2],nodelist) | 533e04aa56f3e50a6e48a348bdfe99314e6120b3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12008/533e04aa56f3e50a6e48a348bdfe99314e6120b3/dojango_grid.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1150,
22239,
12,
4288,
16,
1147,
4672,
3536,
31902,
279,
741,
30952,
1150,
22239,
364,
279,
864,
595,
1807,
938,
18,
19567,
326,
2939,
3180,
288,
9,
679,
3404,
22239,
738,
97,
471,
5530,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1150,
22239,
12,
4288,
16,
1147,
4672,
3536,
31902,
279,
741,
30952,
1150,
22239,
364,
279,
864,
595,
1807,
938,
18,
19567,
326,
2939,
3180,
288,
9,
679,
3404,
22239,
738,
97,
471,
5530,... |
if '__desc__' in module._db_annotations: | if '__desc__' in module.db_annotations_key_index: | def setupModule(self, module): """ setupModule(module: Module) -> None Set up the item to reflect the info in 'module' """ # Update module info and visual self.id = module.id self.setZValue(float(self.id)) self.module = module self.center = copy.copy(module.center) if '__desc__' in module._db_annotations: self.label = module.get_annotation_by_key('__desc__').value.strip() self.description = module.label else: self.label = module.label self.description = '' self.setToolTip(self.description) self.computeBoundingRect() self.resetMatrix() self.translate(module.center.x, -module.center.y) c = registry.get_module_color(module.package, module.name, module.namespace) if c: ic = [int(cl*255) for cl in c] b = QtGui.QBrush(QtGui.QColor(ic[0], ic[1], ic[2])) self.moduleBrush = b | ce7377228be1b4a46d009a7bae4d567c1dee144d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6341/ce7377228be1b4a46d009a7bae4d567c1dee144d/pipeline_view.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
3120,
12,
2890,
16,
1605,
4672,
3536,
3875,
3120,
12,
2978,
30,
5924,
13,
317,
599,
1000,
731,
326,
761,
358,
3037,
326,
1123,
316,
296,
2978,
11,
225,
3536,
468,
2315,
1605,
112... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
3120,
12,
2890,
16,
1605,
4672,
3536,
3875,
3120,
12,
2978,
30,
5924,
13,
317,
599,
1000,
731,
326,
761,
358,
3037,
326,
1123,
316,
296,
2978,
11,
225,
3536,
468,
2315,
1605,
112... |
sage: R == loads(dumps(R)) True | sage: TestSuite(R).run() | def __init__(self, ct, base_ring, prefix, cache, style): """ EXAMPLES:: sage: R = WeylCharacterRing(['A',3]) sage: R == loads(dumps(R)) True """ sage.structure.parent_base.ParentWithBase.__init__(self, base_ring) | 18e17f56d0c583cdb129ede5947113fbc43df9f1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/18e17f56d0c583cdb129ede5947113fbc43df9f1/weyl_characters.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
5691,
16,
1026,
67,
8022,
16,
1633,
16,
1247,
16,
2154,
4672,
3536,
5675,
8900,
11386,
2866,
225,
272,
410,
30,
534,
273,
678,
402,
80,
7069,
10369,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
5691,
16,
1026,
67,
8022,
16,
1633,
16,
1247,
16,
2154,
4672,
3536,
5675,
8900,
11386,
2866,
225,
272,
410,
30,
534,
273,
678,
402,
80,
7069,
10369,
12,
... |
def build_re_list(self, expressions_list): | def build_re_list(expressions_list): | def build_re_list(self, expressions_list): re_list = [] for expression in expressions_list: re_list.append(re.compile(expression)) return re_list | 712021c6e5e001b1a637ac5d8f566b3f45b629d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1870/712021c6e5e001b1a637ac5d8f566b3f45b629d4/sloccompare.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
266,
67,
1098,
12,
21480,
67,
1098,
4672,
283,
67,
1098,
273,
5378,
364,
2652,
316,
8041,
67,
1098,
30,
283,
67,
1098,
18,
6923,
12,
266,
18,
11100,
12,
8692,
3719,
327,
28... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1361,
67,
266,
67,
1098,
12,
21480,
67,
1098,
4672,
283,
67,
1098,
273,
5378,
364,
2652,
316,
8041,
67,
1098,
30,
283,
67,
1098,
18,
6923,
12,
266,
18,
11100,
12,
8692,
3719,
327,
28... |
* compilerContext; // compilerContext's forward pointer should be invalidated! | * compilerContext; | * def f() { | 58afad4d3cade0a037f53f0a04cb23589df417b1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12949/58afad4d3cade0a037f53f0a04cb23589df417b1/Parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
380,
1652,
284,
1435,
288,
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,
380,
1652,
284,
1435,
288,
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,
-1... |
return object.__new__(cls, *args, **kw) | return object.__new__(cls) | def __new__(cls, *args, **kw): assert cls.format is not None, "Class attribute 'format' is not set" if cls._class is not cls.__name__: cls._class = cls.__name__ cls.static_size = cls._computeStaticSize() return object.__new__(cls, *args, **kw) | ce59be12343f1a52738ccf1b0c75aecddb6cb2f1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9327/ce59be12343f1a52738ccf1b0c75aecddb6cb2f1/static_field_set.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2704,
972,
12,
6429,
16,
380,
1968,
16,
2826,
9987,
4672,
1815,
2028,
18,
2139,
353,
486,
599,
16,
315,
797,
1566,
296,
2139,
11,
353,
486,
444,
6,
309,
2028,
6315,
1106,
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,
1001,
2704,
972,
12,
6429,
16,
380,
1968,
16,
2826,
9987,
4672,
1815,
2028,
18,
2139,
353,
486,
599,
16,
315,
797,
1566,
296,
2139,
11,
353,
486,
444,
6,
309,
2028,
6315,
1106,
353,
... |
print_warning(req, "Requested record does not seem to exist.", None, "<p>") elif search == "Browse": | print_warning(req, "Requested record does not seem to exist.") elif action == "Browse": | def perform_request_search(req=None, cc=cdsname, c=None, p="", f="", rg="10", sf="", so="d", sp="", of="hb", ot="", as="0", p1="", f1="", m1="", op1="", p2="", f2="", m2="", op2="", p3="", f3="", m3="", sc="0", jrec="0", id="-1", idb="-1", sysnb="", search="SEARCH", d1y="", d1m="", d1d="", d2y="", d2m="", d2d=""): """Perform search, without checking for authentication. Return list of recIDs found, if of=id. Otherwise create web page.""" # wash all passed arguments: cc = wash_url_argument(cc, 'str') p = wash_url_argument(p, 'str') f = wash_url_argument(f, 'str') rg = wash_url_argument(rg, 'int') sf = wash_url_argument(sf, 'str') so = wash_url_argument(so, 'str') sp = wash_url_argument(sp, 'string') of = wash_url_argument(of, 'str') if type(ot) is list: ot = string.join(ot,",") ot = wash_url_argument(ot, 'str') as = wash_url_argument(as, 'int') p1 = wash_url_argument(p1, 'str') f1 = wash_url_argument(f1, 'str') m1 = wash_url_argument(m1, 'str') op1 = wash_url_argument(op1, 'str') p2 = wash_url_argument(p2, 'str') f2 = wash_url_argument(f2, 'str') m2 = wash_url_argument(m2, 'str') op2 = wash_url_argument(op2, 'str') p3 = wash_url_argument(p3, 'str') f3 = wash_url_argument(f3, 'str') m3 = wash_url_argument(m3, 'str') sc = wash_url_argument(sc, 'int') jrec = wash_url_argument(jrec, 'int') id = wash_url_argument(id, 'int') idb = wash_url_argument(idb, 'int') sysnb = wash_url_argument(sysnb, 'str') search = wash_url_argument(search, 'str') d1y = wash_url_argument(d1y, 'str') d1m = wash_url_argument(d1m, 'str') d1d = wash_url_argument(d1d, 'str') d2y = wash_url_argument(d2y, 'str') d2m = wash_url_argument(d2m, 'str') d2d = wash_url_argument(d2d, 'str') day1, day2 = wash_dates(d1y, d1m, d1d, d2y, d2m, d2d) # deduce user id: try: uid = getUid(req) except: uid = 0 # start output if of.startswith('x'): # we are doing XML output: req.content_type = "text/xml" req.send_http_header() req.write("""<?xml version="1.0" encoding="UTF-8"?>\n""") if of.startswith("xm"): req.write("""<collection xmlns="http://www.loc.gov/MARC21/slim">\n""") else: req.write("""<collection>\n""") elif of.startswith('t') or str(of[0:3]).isdigit(): # we are doing plain text output: req.content_type = "text/plain" req.send_http_header() elif of == "id": # we are passing list of recIDs pass else: # we are doing HTML output: req.content_type = "text/html" req.send_http_header() # write header: req.write(create_header(cc, as, uid)) req.write("""<div class="pagebody">""") if sysnb or id>0: ## 1 - detailed record display if sysnb: # ALEPH sysnb is passed, so deduce MySQL id for the record: id = get_mysql_recid_from_aleph_sysno(sysnb) if of=="hb": of = "hd" if record_exists(id): if idb<=id: # sanity check idb=id+1 print_records(req, range(id,idb), -1, -9999, of, ot) else: # record does not exist if of.startswith("h"): (cc, colls_to_display, colls_to_search) = wash_colls(cc, c, sc) p = wash_pattern(p) f = wash_field(f) out = """<table width="100%%" cellspacing="0" cellpadding="0" border="0"> <tr valign="top"> <td> %s </td> <td class="pagestriperight"> %s </td> </tr> </table>""" % \ (create_search_box(cc, colls_to_display, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, d1y, d1m, d1d, d2y, d2m, d2d, search), create_google_box(p, f, p1, p2, p3)) req.write(out) print_warning(req, "Requested record does not seem to exist.", None, "<p>") elif search == "Browse": ## 2 - browse needed (cc, colls_to_display, colls_to_search) = wash_colls(cc, c, sc) p = wash_pattern(p) f = wash_field(f) # write search box: if of.startswith("h"): out = """<table width="100%%" cellspacing="0" cellpadding="0" border="0"> <tr valign="top"> <td> %s </td> <td class="pagestriperight"> %s </td> </tr> </table>""" % \ (create_search_box(cc, colls_to_display, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, d1y, d1m, d1d, d2y, d2m, d2d, search), create_google_box(p, f, p1, p2, p3)) req.write(out) if as==1 or (p1 or p2 or p3): browse_pattern(req, colls_to_search, p1, f1, rg) browse_pattern(req, colls_to_search, p2, f2, rg) browse_pattern(req, colls_to_search, p3, f3, rg) else: browse_pattern(req, colls_to_search, p, f, rg) else: ## 3 - search needed # wash passed collection arguments: (cc, colls_to_display, colls_to_search) = wash_colls(cc, c, sc) p = wash_pattern(p) f = wash_field(f) # write search box: if of.startswith("h"): out = """<table width="100%%" cellspacing="0" cellpadding="0" border="0"> <tr valign="top"> <td> %s </td> <td class="pagestriperight"> %s </td> </tr> </table>""" % \ (create_search_box(cc, colls_to_display, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, d1y, d1m, d1d, d2y, d2m, d2d, search), create_google_box(p, f, p1, p2, p3)) req.write(out) # run search: t1 = os.times()[4] if as == 1 or (p1 or p2 or p3): # 3A - advanced search results_final = search_pattern(req, "", "", colls_to_search) if p1: results_tmp = search_pattern(req, p1, f1, colls_to_search, m1) for coll in colls_to_search: # join results for first advanced search boxen results_final[coll].intersect(results_tmp[coll]) if p2: results_tmp = search_pattern(req, p2, f2, colls_to_search, m2) for coll in colls_to_search: # join results for first and second advanced search boxen if op1 == "a": # add results_final[coll].intersect(results_tmp[coll]) elif op1 == "o": # or results_final[coll].union(results_tmp[coll]) elif op1 == "n": # not results_final[coll].difference(results_tmp[coll]) else: print_warning(req, "Invalid set operation %s." % op1, "Error") if p3: results_tmp = search_pattern(req, p3, f3, colls_to_search, m3) for coll in colls_to_search: # join results for second and third advanced search boxen if op2 == "a": # add results_final[coll].intersect(results_tmp[coll]) elif op2 == "o": # or results_final[coll].union(results_tmp[coll]) elif op2 == "n": # not results_final[coll].difference(results_tmp[coll]) else: print_warning(req, "Invalid set operation %s." % op2, "Error") for coll in colls_to_search: results_final[coll].calculate_nbhits() else: # 3B - simple search search_cache_key = p+"@"+f+"@"+string.join(colls_to_search,",") if search_cache.has_key(search_cache_key): # is the result in search cache? results_final = search_cache[search_cache_key] else: results_final = search_pattern(req, p, f, colls_to_search) search_cache[search_cache_key] = results_final if len(search_cache) > cfg_search_cache_size: # is the cache full? (sanity cleaning) search_cache.clear() # search done; was there a time restriction? if yes, apply it now: if day1 != "": results_of_time_restriction = search_in_bibrec(day1, day2) for coll in colls_to_search: results_final[coll].intersect(results_of_time_restriction) results_final[coll].calculate_nbhits() t2 = os.times()[4] cpu_time = t2 - t1 # find total number of records found in each collection results_final_nb_total = 0 results_final_nb = {} for coll in colls_to_search: results_final_nb[coll] = results_final[coll]._nbhits results_final_nb_total += results_final_nb[coll] # was there at least one hit? if results_final_nb_total == 0: # nope, so try silently dash-slash-etc-less matches first: if as==1 or (p1 or p2 or p3): if re.search(r'\w[^a-zA-Z0-9\s\:]\w',p1) or \ re.search(r'\w[^a-zA-Z0-9\s\:]\w',p2) or \ re.search(r'\w[^a-zA-Z0-9\s\:]\w',p3): p1n, p2n, p3n = p1, p2, p3 if p1.startswith('"') and p1.endswith('"'): # is it ACC query? p1n = re.sub(r'(\w)[^a-zA-Z0-9\s\:](\w)', "\\1_\\2", p1) else: # it is WRD query p1n = re.sub(r'(\w)[^a-zA-Z0-9\s\:](\w)', "\\1 \\2", p1) if p1.startswith('"') and p1.endswith('"'): # is it ACC query? p2n = re.sub(r'(\w)[^a-zA-Z0-9\s\:](\w)', "\\1_\\2", p2) else: # it is WRD query p2n = re.sub(r'(\w)[^a-zA-Z0-9\s\:](\w)', "\\1 \\2", p2) if p3.startswith('"') and p3.endswith('"'): # is it ACC query? p3n = re.sub(r'(\w)[^a-zA-Z0-9\s\:](\w)', "\\1_\\2", p3) else: # it is WRD query p3n = re.sub(r'(\w)[^a-zA-Z0-9\s\:](\w)', "\\1 \\2", p3) if of.startswith('h'): print_warning(req, "No exact match found, trying similar queries...", "", "<p>","<p>") results_final = search_pattern(req, "", "", colls_to_search) if p1n: results_tmp = search_pattern(req, p1n, f1, colls_to_search, m1) for coll in colls_to_search: # join results for first advanced search boxen results_final[coll].intersect(results_tmp[coll]) if p2n: results_tmp = search_pattern(req, p2n, f2, colls_to_search, m2) for coll in colls_to_search: # join results for first and second advanced search boxen if op1 == "a": # add results_final[coll].intersect(results_tmp[coll]) elif op1 == "o": # or results_final[coll].union(results_tmp[coll]) elif op1 == "n": # not results_final[coll].difference(results_tmp[coll]) else: print_warning(req, "Invalid set operation %s." % op1, "Error") if p3n: results_tmp = search_pattern(req, p3n, f3, colls_to_search, m3) for coll in colls_to_search: # join results for second and third advanced search boxen if op2 == "a": # add results_final[coll].intersect(results_tmp[coll]) elif op2 == "o": # or results_final[coll].union(results_tmp[coll]) elif op2 == "n": # not results_final[coll].difference(results_tmp[coll]) else: print_warning(req, "Invalid set operation %s." % op2, "Error") for coll in colls_to_search: results_final[coll].calculate_nbhits() results_final_nb[coll] = results_final[coll]._nbhits results_final_nb_total += results_final_nb[coll] else: if re.search(r'\w[^a-zA-Z0-9\s\:]\w',p): pn = p if p.startswith('"') and p.endswith('"'): # is it ACC query? pn = re.sub(r'(\w)[^a-zA-Z0-9\s\:](\w)', "\\1_\\2", p) else: # it is WRD query pn = re.sub(r'(\w)[^a-zA-Z0-9\s:](\w)', "\\1 \\2", p) if of.startswith('h'): print_warning(req, "No exact match found, trying <em>%s</em>..." % pn, "", "<p>","<p>") results_final = search_pattern(req, pn, f, colls_to_search, None) for coll in colls_to_search: results_final_nb[coll] = results_final[coll]._nbhits results_final_nb_total += results_final_nb[coll] # once again, was there at least one hit? if results_final_nb_total == 0: # nope, so try similar queries: if of.startswith('h'): print_warning(req, "No exact match found, trying similar queries...", "", "<p>","<p>") req.write("<p>") if as==1 or (p1 or p2 or p3): if p1: search_pattern(req, p1, f1, colls_to_search, m1, 1) if p2: search_pattern(req, p2, f2, colls_to_search, m2, 1) if p3: search_pattern(req, p3, f3, colls_to_search, m3, 1) else: search_pattern(req, p, f, colls_to_search, None, 1) else: # yes, some hits found, so print results overview: if of == "id": # we have been asked to return list of recIDs results_final_for_all_colls = HitList() for coll in colls_to_search: results_final_for_all_colls.union(results_final[coll]) return results_final_for_all_colls.items() elif of.startswith("h"): req.write(print_results_overview(colls_to_search, results_final_nb_total, results_final_nb, cpu_time)) # print records: if len(colls_to_search)>1: cpu_time = -1 # we do not want to have search time printed on each collection for coll in colls_to_search: if results_final[coll]._nbhits: if of.startswith("h"): req.write(print_search_info(p, f, sf, so, sp, of, ot, coll, results_final_nb[coll], jrec, rg, as, p1, p2, p3, f1, f2, f3, m1, m2, m3, op1, op2, d1y, d1m, d1d, d2y, d2m, d2d, cpu_time)) results_final_sorted = results_final[coll].items() if sf: results_final_sorted = sort_records(req, results_final_sorted, sf, so, sp) print_records(req, results_final_sorted, jrec, rg, of, ot) if of.startswith("h"): req.write(print_search_info(p, f, sf, so, sp, of, ot, coll, results_final_nb[coll], jrec, rg, as, p1, p2, p3, f1, f2, f3, m1, m2, m3, op1, op2, d1y, d1m, d1d, d2y, d2m, d2d, cpu_time, 1)) # log query: try: log_query(req.get_remote_host(), req.args, uid) except: # do not log query if req is None (used by CLI interface) pass log_query_info("ss", p, f, colls_to_search, results_final_nb_total) # 4 -- write footer: if of.startswith('h'): req.write("""</div>""") # pagebody end req.write(create_footer()) elif of.startswith('x'): req.write("""</collection>\n""") # 5 - return value if of == "id": return [] else: return "\n" | 535ed6a8d836745c0ddd7f1016fbe145d7c7bebd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2139/535ed6a8d836745c0ddd7f1016fbe145d7c7bebd/search_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
2293,
67,
3072,
12,
3658,
33,
7036,
16,
4946,
33,
71,
2377,
529,
16,
276,
33,
7036,
16,
293,
1546,
3113,
284,
1546,
3113,
14524,
1546,
2163,
3113,
9033,
1546,
3113,
1427,
154... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
2293,
67,
3072,
12,
3658,
33,
7036,
16,
4946,
33,
71,
2377,
529,
16,
276,
33,
7036,
16,
293,
1546,
3113,
284,
1546,
3113,
14524,
1546,
2163,
3113,
9033,
1546,
3113,
1427,
154... |
c, noise = noise[0], noise[1:] res = res + c return res + noise + line res = "" for line in map(addnoise, lines): b = binascii.a2b_base64(line) res = res + b verify(res == testdata) | self.fail("binascii.a2b_qp(**{1:1}) didn't raise TypeError") self.assertEqual(binascii.a2b_qp("= "), "") self.assertEqual(binascii.a2b_qp("=="), "=") self.assertEqual(binascii.a2b_qp("=AX"), "=AX") self.assertRaises(TypeError, binascii.b2a_qp, foo="bar") self.assertEqual(binascii.a2b_qp("=00\r\n=00"), "\x00\r\n\x00") self.assertEqual( binascii.b2a_qp("\xff\r\n\xff\n\xff"), "=FF\r\n=FF\r\n=FF" ) self.assertEqual( binascii.b2a_qp("0"*75+"\xff\r\n\xff\r\n\xff"), "0"*75+"=\r\n=FF\r\n=FF\r\n=FF" ) | def addnoise(line): noise = fillers ratio = len(line) // len(noise) res = "" while line and noise: if len(line) // len(noise) > ratio: c, line = line[0], line[1:] else: c, noise = noise[0], noise[1:] res = res + c return res + noise + line | 46cb568c7f48672eda08b3d15f7013b06a02b01f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/46cb568c7f48672eda08b3d15f7013b06a02b01f/test_binascii.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
17814,
12,
1369,
4672,
10825,
273,
661,
3135,
7169,
273,
562,
12,
1369,
13,
368,
562,
12,
17814,
13,
400,
273,
1408,
1323,
980,
471,
10825,
30,
309,
562,
12,
1369,
13,
368,
562,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
17814,
12,
1369,
4672,
10825,
273,
661,
3135,
7169,
273,
562,
12,
1369,
13,
368,
562,
12,
17814,
13,
400,
273,
1408,
1323,
980,
471,
10825,
30,
309,
562,
12,
1369,
13,
368,
562,
... |
if re.match(e[1], result): continue | if re.match(escapestr(e[1], ampm), result): continue | def strftest(now): if verbose: print "strftime test for", time.ctime(now) nowsecs = str(long(now))[:-1] gmt = time.gmtime(now) now = time.localtime(now) if now[3] < 12: ampm='(AM|am)' else: ampm='(PM|pm)' jan1 = time.localtime(time.mktime((now[0], 1, 1, 0, 0, 0, 0, 1, 0))) try: if now[8]: tz = time.tzname[1] else: tz = time.tzname[0] except AttributeError: tz = '' if now[3] > 12: clock12 = now[3] - 12 elif now[3] > 0: clock12 = now[3] else: clock12 = 12 expectations = ( ('%a', calendar.day_abbr[now[6]], 'abbreviated weekday name'), ('%A', calendar.day_name[now[6]], 'full weekday name'), ('%b', calendar.month_abbr[now[1]], 'abbreviated month name'), ('%B', calendar.month_name[now[1]], 'full month name'), # %c see below ('%d', '%02d' % now[2], 'day of month as number (00-31)'), ('%H', '%02d' % now[3], 'hour (00-23)'), ('%I', '%02d' % clock12, 'hour (01-12)'), ('%j', '%03d' % now[7], 'julian day (001-366)'), ('%m', '%02d' % now[1], 'month as number (01-12)'), ('%M', '%02d' % now[4], 'minute, (00-59)'), ('%p', ampm, 'AM or PM as appropriate'), ('%S', '%02d' % now[5], 'seconds of current time (00-60)'), ('%U', '%02d' % ((now[7] + jan1[6])//7), 'week number of the year (Sun 1st)'), ('%w', '0?%d' % ((1+now[6]) % 7), 'weekday as a number (Sun 1st)'), ('%W', '%02d' % ((now[7] + (jan1[6] - 1)%7)//7), 'week number of the year (Mon 1st)'), # %x see below ('%X', '%02d:%02d:%02d' % (now[3], now[4], now[5]), '%H:%M:%S'), ('%y', '%02d' % (now[0]%100), 'year without century'), ('%Y', '%d' % now[0], 'year with century'), # %Z see below ('%%', '%', 'single percent sign'), ) nonstandard_expectations = ( # These are standard but don't have predictable output ('%c', fixasctime(time.asctime(now)), 'near-asctime() format'), ('%x', '%02d/%02d/%02d' % (now[1], now[2], (now[0]%100)), '%m/%d/%y %H:%M:%S'), ('%Z', '%s' % tz, 'time zone name'), # These are some platform specific extensions ('%D', '%02d/%02d/%02d' % (now[1], now[2], (now[0]%100)), 'mm/dd/yy'), ('%e', '%2d' % now[2], 'day of month as number, blank padded ( 0-31)'), ('%h', calendar.month_abbr[now[1]], 'abbreviated month name'), ('%k', '%2d' % now[3], 'hour, blank padded ( 0-23)'), ('%n', '\n', 'newline character'), ('%r', '%02d:%02d:%02d %s' % (clock12, now[4], now[5], ampm), '%I:%M:%S %p'), ('%R', '%02d:%02d' % (now[3], now[4]), '%H:%M'), ('%s', nowsecs, 'seconds since the Epoch in UCT'), ('%t', '\t', 'tab character'), ('%T', '%02d:%02d:%02d' % (now[3], now[4], now[5]), '%H:%M:%S'), ('%3y', '%03d' % (now[0]%100), 'year without century rendered using fieldwidth'), ) if verbose: print "Strftime test, platform: %s, Python version: %s" % \ (sys.platform, sys.version.split()[0]) for e in expectations: try: result = time.strftime(e[0], now) except ValueError, error: print "Standard '%s' format gave error:" % e[0], error continue if re.match(e[1], result): continue if not result or result[0] == '%': print "Does not support standard '%s' format (%s)" % (e[0], e[2]) else: print "Conflict for %s (%s):" % (e[0], e[2]) print " Expected %s, but got %s" % (e[1], result) for e in nonstandard_expectations: try: result = time.strftime(e[0], now) except ValueError, result: if verbose: print "Error for nonstandard '%s' format (%s): %s" % \ (e[0], e[2], str(result)) continue if re.match(e[1], result): if verbose: print "Supports nonstandard '%s' format (%s)" % (e[0], e[2]) elif not result or result[0] == '%': if verbose: print "Does not appear to support '%s' format (%s)" % (e[0], e[2]) else: if verbose: print "Conflict for nonstandard '%s' format (%s):" % (e[0], e[2]) print " Expected %s, but got %s" % (e[1], result) | 14862d75c75ae24480c1ab96017a87014f7c45c4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/14862d75c75ae24480c1ab96017a87014f7c45c4/test_strftime.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
609,
1222,
395,
12,
3338,
4672,
309,
3988,
30,
1172,
315,
701,
9982,
1842,
364,
3113,
813,
18,
21261,
12,
3338,
13,
2037,
21317,
273,
609,
12,
5748,
12,
3338,
3719,
10531,
17,
21,
65,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
609,
1222,
395,
12,
3338,
4672,
309,
3988,
30,
1172,
315,
701,
9982,
1842,
364,
3113,
813,
18,
21261,
12,
3338,
13,
2037,
21317,
273,
609,
12,
5748,
12,
3338,
3719,
10531,
17,
21,
65,
... |
if return_only: self.stdout = old_stdout return stringio.getvalue() | def do_help(self, arg=None, return_only=False): if return_only: stringio = StringIO() old_stdout = self.stdout self.stdout = stringio if arg: cmd_names = set(name[3:] for name in self.get_names() if name.startswith('do_')) if arg in cmd_names: command_help = self.get_command_help(arg) if command_help is None: logging.warning(u'Command "%s" is undocumented' % arg) else: self.stdout.write('%s\n' % command_help) else: logging.error(u'Unknown command: "%s"' % arg) else: names = set(name for name in self.get_names() if name.startswith('do_')) application_cmds_doc = [] weboob_cmds_doc = [] cmds_undoc = [] for name in sorted(names): cmd = name[3:] if cmd in self.hidden_commands.union(['help']): continue elif getattr(self, name).__doc__: short_help = ' %s' % self.get_command_help(cmd, short=True) if cmd in self.weboob_commands: weboob_cmds_doc.append(short_help) else: application_cmds_doc.append(short_help) else: cmds_undoc.append(cmd) application_cmds_header = '%s commands' % self.APPNAME.capitalize() self.stdout.write('%s\n%s\n' % (application_cmds_header, '-' * len(application_cmds_header))) self.stdout.write('\n'.join(application_cmds_doc) + '\n\n') weboob_cmds_header = 'Generic Weboob commands' self.stdout.write('%s\n%s\n' % (weboob_cmds_header, '-' * len(weboob_cmds_header))) self.stdout.write('\n'.join(weboob_cmds_doc) + '\n\n') self.print_topics(self.undoc_header, cmds_undoc, 15,80) self.stdout.write('Type "help <command>" for more info about a command.\n') if return_only: self.stdout = old_stdout return stringio.getvalue() | 6bbc6f599ec3217986a558239488dbf3b67c40c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7471/6bbc6f599ec3217986a558239488dbf3b67c40c3/repl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
5201,
12,
2890,
16,
1501,
33,
7036,
16,
327,
67,
3700,
33,
8381,
4672,
309,
327,
67,
3700,
30,
533,
1594,
273,
15777,
1435,
1592,
67,
10283,
273,
365,
18,
10283,
365,
18,
10... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
5201,
12,
2890,
16,
1501,
33,
7036,
16,
327,
67,
3700,
33,
8381,
4672,
309,
327,
67,
3700,
30,
533,
1594,
273,
15777,
1435,
1592,
67,
10283,
273,
365,
18,
10283,
365,
18,
10... | |
self.curScale = scale | self.curScale *= scale if self.curScale == 1.: print "The simulation is not accelerated." else: print "The simulation will be accelerated by %.1f times." % self.curScale | def scaleParam(self, scale): if scale != 1: print "The simulation will be accelerated by %.1f times " % scale self.mutaRate *= scale self.recIntensity *= scale self.backMigrRate *= scale self.step = int(self.step / scale) self.figureStep = int(self.figureStep / scale) self.initGen = int(self.initGen / scale) self.expandGen = int(self.expandGen / scale) self.curScale = scale | 98502d12d19bdb42845789ba2700e0f30bf0e0b0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/401/98502d12d19bdb42845789ba2700e0f30bf0e0b0/simuAdmixture.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3159,
786,
12,
2890,
16,
3159,
4672,
309,
3159,
480,
404,
30,
1172,
315,
1986,
14754,
903,
506,
15153,
19007,
635,
12639,
21,
74,
4124,
315,
738,
3159,
365,
18,
10735,
69,
4727,
6413,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3159,
786,
12,
2890,
16,
3159,
4672,
309,
3159,
480,
404,
30,
1172,
315,
1986,
14754,
903,
506,
15153,
19007,
635,
12639,
21,
74,
4124,
315,
738,
3159,
365,
18,
10735,
69,
4727,
6413,
... |
class Text(Feature): pass class Command(Feature): def act(self): pass class Table(Feature): items = trellis.make(trellis.List) @trellis.maintain(initially=None) def selected_item(self): if self.selected_item is None or not self.selected_item in self.items: return self.items[0] or None return self.selected_item def display_name(self, item): """Hook for customizing item display""" return unicode(item) | def __str__(self): return self.msg % {'cell_description' : self.cell_description, 'cell_value' : self.cell_value} | 2d846dfc0a2a292c98fc3af53d4fc966746ef936 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12987/2d846dfc0a2a292c98fc3af53d4fc966746ef936/core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
327,
365,
18,
3576,
738,
13666,
3855,
67,
3384,
11,
294,
365,
18,
3855,
67,
3384,
16,
296,
3855,
67,
1132,
11,
4202,
294,
365,
18,
3855,
67,
1132,
97,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
327,
365,
18,
3576,
738,
13666,
3855,
67,
3384,
11,
294,
365,
18,
3855,
67,
3384,
16,
296,
3855,
67,
1132,
11,
4202,
294,
365,
18,
3855,
67,
1132,
97,... | |
return [(channel, u"%s: hace un rato lo escuche decir «%s» o una gansada por el estilo" % (user, what))] | return [(channel, u"%s: [%s] %s" % (user, when.strftime ("%x %X"), what))] | def seen (self, user, channel, command, nick): if nick not in (self.nickname, user): try: what, when= self.seenlog[nick] except KeyError: return [(channel, u"%s: me lo deje en la otra pollera :|" % user)] else: # now= time.time () if what=='joined': return [(channel, u"%s: le vi entrar hace un rato..." % user)] elif what=='parted': return [(channel, u"%s: creo que se fua a hacer una paja y no volvio..." % user)] else: return [(channel, u"%s: hace un rato lo escuche decir «%s» o una gansada por el estilo" % (user, what))] elif nick==self.nickname: return [(channel, u"%s: acástoi, papafrita!" % user)] elif nick==user: return [(channel, u"%s: andá mirate en el espejo del baño" % user)] | fee305d6220a8799799461a9b5a4f8fce98695fb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5759/fee305d6220a8799799461a9b5a4f8fce98695fb/seen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5881,
261,
2890,
16,
729,
16,
1904,
16,
1296,
16,
10909,
4672,
309,
10909,
486,
316,
261,
2890,
18,
17091,
529,
16,
729,
4672,
775,
30,
4121,
16,
1347,
33,
365,
18,
15156,
1330,
63,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5881,
261,
2890,
16,
729,
16,
1904,
16,
1296,
16,
10909,
4672,
309,
10909,
486,
316,
261,
2890,
18,
17091,
529,
16,
729,
4672,
775,
30,
4121,
16,
1347,
33,
365,
18,
15156,
1330,
63,
... |
self.currdef['element'] = self.text() | self.currdef['elements'].append(self.text()) | def endElementNS(self, tag, qname): if tag in ((RELAXNS, 'attribute'), (RELAXNS, 'start')): self.ignore = 0 return if self.ignore == 1: return #print "END ",tag if tag == (RELAXNS, 'define'): if self.currdef.has_key('element'): self.definitions[self.currdef['name']] = self.currdef elif tag == (RELAXNS, 'name'): self.currdef['element'] = self.text() elif tag == (RELAXNS, 'anyName'): self.currdef['element'] = "__ANYNAME__" self.data = [] | 020dbeee98763576db32091bbe9b337f32f889f1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7337/020dbeee98763576db32091bbe9b337f32f889f1/gen_allowed_children.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14840,
3156,
12,
2890,
16,
1047,
16,
12621,
4672,
309,
1047,
316,
14015,
15868,
2501,
3156,
16,
296,
4589,
19899,
261,
15868,
2501,
3156,
16,
296,
1937,
26112,
30,
365,
18,
6185,
273,
37... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14840,
3156,
12,
2890,
16,
1047,
16,
12621,
4672,
309,
1047,
316,
14015,
15868,
2501,
3156,
16,
296,
4589,
19899,
261,
15868,
2501,
3156,
16,
296,
1937,
26112,
30,
365,
18,
6185,
273,
37... |
p = self._prime | def __init__(self, E, P, proof=None, algorithm="pari"): """ Initializes the reduction data for the elliptic curve E at the prime P. | d268d826e9ff15e8e9c26c0ba3dd27591f648207 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/d268d826e9ff15e8e9c26c0ba3dd27591f648207/ell_local_data.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
512,
16,
453,
16,
14601,
33,
7036,
16,
4886,
1546,
1065,
77,
6,
4672,
3536,
10188,
3128,
326,
20176,
501,
364,
326,
415,
549,
21507,
8882,
512,
622,
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,
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,
512,
16,
453,
16,
14601,
33,
7036,
16,
4886,
1546,
1065,
77,
6,
4672,
3536,
10188,
3128,
326,
20176,
501,
364,
326,
415,
549,
21507,
8882,
512,
622,
326,... | |
def equify(f, variables = None): | def equify(f): | def equify(f, variables = None): """ Returns the equation rewritten as a symbolic function to give negative values when True, positive when False. EXAMPLES:: sage: from sage.plot.contour_plot import equify sage: var('x, y') (x, y) sage: equify(x^2 < 2) x |--> x^2 - 2 sage: equify(x^2 > 2) x |--> -x^2 + 2 sage: equify(x*y > 1) (x, y) |--> -x*y + 1 sage: equify(y > 0, (x,y)) (x, y) |--> -y """ import operator from sage.calculus.all import symbolic_expression op = f.operator() if variables == None: variables = f.variables() if op is operator.gt or op is operator.ge: s = symbolic_expression(f.rhs() - f.lhs()).function(*variables) return s else: s = symbolic_expression(f.lhs() - f.rhs()).function(*variables) return s | 2ab3140f4272b6e39d490424279d912b3be528ce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/2ab3140f4272b6e39d490424279d912b3be528ce/contour_plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1298,
1164,
12,
74,
4672,
3536,
2860,
326,
15778,
26768,
487,
279,
16754,
445,
358,
8492,
6092,
924,
1347,
1053,
16,
6895,
1347,
1083,
18,
225,
5675,
8900,
11386,
2866,
225,
272,
410,
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,
1298,
1164,
12,
74,
4672,
3536,
2860,
326,
15778,
26768,
487,
279,
16754,
445,
358,
8492,
6092,
924,
1347,
1053,
16,
6895,
1347,
1083,
18,
225,
5675,
8900,
11386,
2866,
225,
272,
410,
30... |
print "Good gods! A VTK ExposeEvent!" | pass | def _vtk_expose_event(self, vtk_obj, eventname): print "Good gods! A VTK ExposeEvent!" | 61ea9b28d42e42e54bb012c2e6199e48d9341416 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13166/61ea9b28d42e42e54bb012c2e6199e48d9341416/vtk_window.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
11734,
79,
67,
338,
4150,
67,
2575,
12,
2890,
16,
13659,
67,
2603,
16,
871,
529,
4672,
1172,
315,
18195,
314,
369,
87,
5,
225,
432,
22944,
47,
1312,
4150,
1133,
4442,
2,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
11734,
79,
67,
338,
4150,
67,
2575,
12,
2890,
16,
13659,
67,
2603,
16,
871,
529,
4672,
1172,
315,
18195,
314,
369,
87,
5,
225,
432,
22944,
47,
1312,
4150,
1133,
4442,
2,
-100,
-... |
try_6to4 = convert_6to4_v4(ip) if try_6to4 is not None: ip = try_6to4 else: try_teredo = convert_teredo_v4(ip) if try_teredo is not None: ip = try_teredo | for scheme in (convert_6to4_v4, convert_teredo_v4): result = scheme(ip) if result is not None: ip = result break | def return_error(kwargs, message='', returncode=200): d = dict(returncode=returncode, message=message, resulttype='mirrorlist', results=[]) if 'metalink' in kwargs and kwargs['metalink']: d['resulttype'] = 'metalink' d['message'] = metalink_failuredoc(message) return d | 4e105475542a680ec478ca7f4c996bf570127f46 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13031/4e105475542a680ec478ca7f4c996bf570127f46/mirrorlist_server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
327,
67,
1636,
12,
4333,
16,
883,
2218,
2187,
18125,
33,
6976,
4672,
302,
273,
2065,
12,
2463,
710,
33,
2463,
710,
16,
883,
33,
2150,
16,
563,
723,
2218,
27197,
1098,
2187,
1686,
22850... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
327,
67,
1636,
12,
4333,
16,
883,
2218,
2187,
18125,
33,
6976,
4672,
302,
273,
2065,
12,
2463,
710,
33,
2463,
710,
16,
883,
33,
2150,
16,
563,
723,
2218,
27197,
1098,
2187,
1686,
22850... |
k_final = calc_k_final(config, wavelength_final) E_final = calc_E_final(config, wavelength_final) | data_dst.release_resource() k_final = calc_k_final(config) E_final = calc_E_final(config) | def run(config): # Michael works here if config.data==None: raise RuntimeError, "Need to pass a data filename to the driver \ script." if config.output==None: print "No output file name specified. Using temp.srf" config.output="temp.srf" import dst_base data_dst = dst_base.getInstance("application/x-NeXus", config.data) som_id = ("/entry/data", 1) so_axis = "time_of_flight" d_som1 = data_dst.getSOM(som_id, so_axis) if not config.use_dead_time: d_som2 = dead_time_correction(config, d_som1) else: d_som2 = d_som1 if not config.norm==None: norm_dst = dst_base.getInstance("application/x-NeXus", config.norm) n_som1 = norm_dst.getSOM(som_id, so_axis) norm_dst.release_resource() else: n_som1 = None if not config.norm_bkg==None norm_bkg_dst = dst_base.getInstance("application/x-NeXus",\ config.norm_bkg) n_bkg_som1 = norm_bkg_dst.getSOM(som_id, so_axis) else: n_bkg_som1 = None n_som2 = subtract_norm_bkg_from_norm(config, n_som1, n_bkg_som1) if not config.dark_current==None: dc_dst = dst_base.getInstance("application/x-NeXus",\ config.dark_current) dc_som1 = dst_base.getSOM(som_id, so_axis) dc_dst.release_resource() else: dc_som1 = None d_som3 = subtract_dark_current_from_data(config, d_som2, dc_som1) if not config.no_tib: B = determine_time_indep_bkg(config, d_som3) else: B = None d_som4 = subtract_time_indep_bkg(config, d_som3, B) if not config.bkg==None: bkg_dst = dst_base.getInstance("application/x-NeXus",\ config.dark_current) bkg_som1 = dst_base.getSOM(som_id, so_axis) bkg_dst.release_resource() else: bkg_som1 = None d_som4 = subtract_bkg_from_data(config, d_som3, bkg_som1) if not config.no_norm: d_som5 = norm_data_by_van(config, d_som4, n_som1) else: d_som5 = d_som4 if config.no_mon_norm: m_som1 = None else: som_id = ("/entry/monitor2", 1) m_som1 = data_dst.getSOM(som_id, so_axis) d_som6, m_som2 = convert_data_and_mon_to_wavelength(config, d_som5, m_som1) if config.mon_eff==None: m_eff1 = None else: # SNS-FIXME # read in montior efficiency m_eff2 = rebin_mon_eff(config, m_som2, m_eff1) m_som3 = eff_correct_mon(config, m_som2, m_eff2) if config.det_eff==None: det_eff2 = None else: # SNS-FIXME # read in detector efficiency det_eff2 = rebin_det_eff(config, d_som6, det_eff1) d_som7 = eff_correct_data(config, d_som6, det_eff2) d_som8 = norm_data_by_mon(config, d_som7, m_som3) d_som9 = calc_k_initial(config, d_som8) d_som10 = calc_E_initial(config, d_som9) # SNS-FIXME # Where to we get wavelength_final from? k_final = calc_k_final(config, wavelength_final) E_final = calc_E_final(config, wavelength_final) d_som11 = energy_transfer(config, d_som10, E_final) d_som12 = calc_scalar_Q(config, d_som11, k_final) if config.Q_bins==None or config.E_bins==None: config.banks_separate=True d_som13 = d_som12 else: d_som13 = rebin_final(config, d_som12) if not config.banks_separate: d_som14 = sum_all_spectra(config, d_som13) else: d_som14 = d_som13 # SNS-FIXME # Write output file | 29efc361c4183443dc2b83ffa4d0ef8288a4d580 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/763/29efc361c4183443dc2b83ffa4d0ef8288a4d580/amorphous_reduction.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
1425,
4672,
468,
490,
1354,
69,
292,
6330,
2674,
225,
309,
642,
18,
892,
631,
7036,
30,
1002,
7265,
16,
315,
14112,
358,
1342,
279,
501,
1544,
358,
326,
3419,
521,
2728,
1199... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1425,
4672,
468,
490,
1354,
69,
292,
6330,
2674,
225,
309,
642,
18,
892,
631,
7036,
30,
1002,
7265,
16,
315,
14112,
358,
1342,
279,
501,
1544,
358,
326,
3419,
521,
2728,
1199... |
t = index.data().toPyObject() editor.setText(t[0]) | schema = self.asSchema(index.data().toPyObject()) editor.setText(schema.name) | def setEditorData(self, editor, index): t = index.data().toPyObject() editor.setText(t[0]) | 040b4fbf2aa44ad50b9f46c3dfe85ba5dcbacbec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6366/040b4fbf2aa44ad50b9f46c3dfe85ba5dcbacbec/OWPreprocess.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
6946,
751,
12,
2890,
16,
4858,
16,
770,
4672,
1963,
273,
365,
18,
345,
3078,
12,
1615,
18,
892,
7675,
869,
9413,
921,
10756,
4858,
18,
542,
1528,
12,
4821,
18,
529,
13,
225,
2,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
6946,
751,
12,
2890,
16,
4858,
16,
770,
4672,
1963,
273,
365,
18,
345,
3078,
12,
1615,
18,
892,
7675,
869,
9413,
921,
10756,
4858,
18,
542,
1528,
12,
4821,
18,
529,
13,
225,
2,
... |
msg = self.ExecuteCommand( "export X509_USER_PROXY=" + self.cert \ + "; glite-wms-job-delegate-proxy -d " + self.delegationId \ + " --endpoint " + wms ) | command = "glite-wms-job-delegate-proxy -d " + self.delegationId \ + " --endpoint " + wms if self.cert != '' : command = "export X509_USER_PROXY=" + self.cert + ' ; ' + command msg = self.ExecuteCommand( command ) | def delegateProxy( self, wms ): """ delegate proxy to a wms """ msg = self.ExecuteCommand( "export X509_USER_PROXY=" + self.cert \ + "; glite-wms-job-delegate-proxy -d " + self.delegationId \ + " --endpoint " + wms ) | 55a5ed1914a85dd769f4f5581fc70550a93a78e4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8886/55a5ed1914a85dd769f4f5581fc70550a93a78e4/SchedulerGLiteAPI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7152,
3886,
12,
365,
16,
341,
959,
262,
30,
3536,
7152,
2889,
358,
279,
341,
959,
3536,
225,
1234,
273,
365,
18,
5289,
2189,
12,
315,
6530,
1139,
5995,
67,
4714,
67,
16085,
1546,
397,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7152,
3886,
12,
365,
16,
341,
959,
262,
30,
3536,
7152,
2889,
358,
279,
341,
959,
3536,
225,
1234,
273,
365,
18,
5289,
2189,
12,
315,
6530,
1139,
5995,
67,
4714,
67,
16085,
1546,
397,
... |
utils.CreateBackup(constants.RAPI_CERT_FILE) logging.debug("Generating new RAPI certificate at %s", constants.RAPI_CERT_FILE) GenerateSelfSignedSslCert(constants.RAPI_CERT_FILE) | utils.CreateBackup(rapicert_file) logging.debug("Generating new RAPI certificate at %s", rapicert_file) GenerateSelfSignedSslCert(rapicert_file) | def GenerateClusterCrypto(new_cluster_cert, new_rapi_cert, new_confd_hmac_key, rapi_cert_pem=None): """Updates the cluster certificates, keys and secrets. @type new_cluster_cert: bool @param new_cluster_cert: Whether to generate a new cluster certificate @type new_rapi_cert: bool @param new_rapi_cert: Whether to generate a new RAPI certificate @type new_confd_hmac_key: bool @param new_confd_hmac_key: Whether to generate a new HMAC key @type rapi_cert_pem: string @param rapi_cert_pem: New RAPI certificate in PEM format """ # noded SSL certificate cluster_cert_exists = os.path.exists(constants.NODED_CERT_FILE) if new_cluster_cert or not cluster_cert_exists: if cluster_cert_exists: utils.CreateBackup(constants.NODED_CERT_FILE) logging.debug("Generating new cluster certificate at %s", constants.NODED_CERT_FILE) GenerateSelfSignedSslCert(constants.NODED_CERT_FILE) # confd HMAC key if new_confd_hmac_key or not os.path.exists(constants.CONFD_HMAC_KEY): logging.debug("Writing new confd HMAC key to %s", constants.CONFD_HMAC_KEY) GenerateHmacKey(constants.CONFD_HMAC_KEY) # RAPI rapi_cert_exists = os.path.exists(constants.RAPI_CERT_FILE) if rapi_cert_pem: # Assume rapi_pem contains a valid PEM-formatted certificate and key logging.debug("Writing RAPI certificate at %s", constants.RAPI_CERT_FILE) utils.WriteFile(constants.RAPI_CERT_FILE, data=rapi_cert_pem, backup=True) elif new_rapi_cert or not rapi_cert_exists: if rapi_cert_exists: utils.CreateBackup(constants.RAPI_CERT_FILE) logging.debug("Generating new RAPI certificate at %s", constants.RAPI_CERT_FILE) GenerateSelfSignedSslCert(constants.RAPI_CERT_FILE) | aeefe835be955a154e5d02b354d5e229201fdf5c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7542/aeefe835be955a154e5d02b354d5e229201fdf5c/bootstrap.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6654,
3629,
18048,
12,
2704,
67,
7967,
67,
7593,
16,
394,
67,
1266,
77,
67,
7593,
16,
394,
67,
3923,
72,
67,
19820,
67,
856,
16,
767,
7259,
67,
7593,
67,
20313,
33,
7036,
4672,
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,
6654,
3629,
18048,
12,
2704,
67,
7967,
67,
7593,
16,
394,
67,
1266,
77,
67,
7593,
16,
394,
67,
3923,
72,
67,
19820,
67,
856,
16,
767,
7259,
67,
7593,
67,
20313,
33,
7036,
4672,
3536,... |
self.cloud.sem_and_run(name, freq, handler, | self.cloud.sem_and_run("config-" + name, freq, handler, | def handle(self, name, args, freq=None): try: mod = __import__("cc_" + name.replace("-","_"),globals()) def_freq = getattr(mod, "frequency",per_instance) handler = getattr(mod, "handle") | da22979dabb6a5d791eaca17aae8c15fd39cdafe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10142/da22979dabb6a5d791eaca17aae8c15fd39cdafe/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
12,
2890,
16,
508,
16,
833,
16,
7684,
33,
7036,
4672,
775,
30,
681,
273,
1001,
5666,
972,
2932,
952,
9548,
397,
508,
18,
2079,
2932,
17,
15937,
9548,
3631,
16227,
10756,
1652,
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,
1640,
12,
2890,
16,
508,
16,
833,
16,
7684,
33,
7036,
4672,
775,
30,
681,
273,
1001,
5666,
972,
2932,
952,
9548,
397,
508,
18,
2079,
2932,
17,
15937,
9548,
3631,
16227,
10756,
1652,
67... |
def cb_out_skip(self, arg): | def cb_out_skip(self, *args): | def cb_out_skip(self, arg): if not self.ocheck(): return if not self.vout.forward(): self.err('Output buffer exhausted') self.oshow() | 89a8f9532953b87e4128e8ce87609893e92d59eb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/89a8f9532953b87e4128e8ce87609893e92d59eb/Vedit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2875,
67,
659,
67,
7457,
12,
2890,
16,
380,
1968,
4672,
309,
486,
365,
18,
83,
1893,
13332,
327,
309,
486,
365,
18,
90,
659,
18,
11565,
13332,
365,
18,
370,
2668,
1447,
1613,
24948,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2875,
67,
659,
67,
7457,
12,
2890,
16,
380,
1968,
4672,
309,
486,
365,
18,
83,
1893,
13332,
327,
309,
486,
365,
18,
90,
659,
18,
11565,
13332,
365,
18,
370,
2668,
1447,
1613,
24948,
... |
self.valid = True else: context.error("invalid syntax") | context.error("invalid syntax") if operands[1] != '+' and operands[1] != '-': context.error("invalid syntax") if len(operands) == 3: op2 = self._parseOperand(context, operands[2]) if op1 and op2: if operands[1] == '+': self.value = op1 + op2 else: self.value = op1 - op2 self.valid = True self.complete = True | def __init__(self, context, operands): self.valid = False self.complete = False self.operands = operands self.value = None if operands: if len(operands) == 1 or len(operands) == 3: op1 = self._parseOperand(context, operands[0]) if op1: self.value = op1 if len(operands) > 1: if operands[1] == '+' or operands[1] == '-': op2 = self._parseOperand(context, operands[2]) if op2: if operands[1] == '+': self.value += op2 else: self.value -= op2 self.valid = True self.complete = True else: context.error("invalid syntax") else: self.valid = True else: context.error("invalid syntax") else: context.error("invalid syntax") | c8a1491e7e4e5af0338da85d0aec2057b8989dbe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8152/c8a1491e7e4e5af0338da85d0aec2057b8989dbe/expression.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
819,
16,
14883,
4672,
365,
18,
877,
273,
1083,
365,
18,
6226,
273,
1083,
365,
18,
4063,
5708,
273,
14883,
365,
18,
1132,
273,
599,
225,
309,
14883,
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,
1001,
2738,
972,
12,
2890,
16,
819,
16,
14883,
4672,
365,
18,
877,
273,
1083,
365,
18,
6226,
273,
1083,
365,
18,
4063,
5708,
273,
14883,
365,
18,
1132,
273,
599,
225,
309,
14883,
30,
... |
print >> sys.stderr, "Usage: %s [-s] [-faststart] [CABWIZ_PATH] SOURCE_DIR PROGRAM_NAME CAB_FINAL_NAME" % args[0] | print >> sys.stderr, "Usage: %s [-setupdll] [-s] [-faststart] [CABWIZ_PATH] SOURCE_DIR PROGRAM_NAME CAB_FINAL_NAME" % args[0] | def main(): args = sys.argv if len(args) < 4 or len(args) > 7: print >> sys.stderr, "Usage: %s [-s] [-faststart] [CABWIZ_PATH] SOURCE_DIR PROGRAM_NAME CAB_FINAL_NAME" % args[0] print >> sys.stderr, "Example: %s /c/Program\ Files/Microsoft\ Visual\ Studio\ 9.0/ fennec Fennec fennec-0.11.en-US.wince-arm.cab" % args[0] sys.exit(1) args = args[1:] if args[0] == "-s": global CompressFlag CompressFlag = "" args = args[1:] if args[0] == "-faststart": global FaststartFlag FaststartFlag = 1 args = args[1:] cabwiz_path = None if len(args) == 4: cabwiz_path = args[0] args = args[1:] else: if "VSINSTALLDIR" in os.environ: cabwiz_path = os.path.join(os.environ["VSINSTALLDIR"], "SmartDevices", "SDK", "SDKTools", "cabwiz.exe") source_dir = args[0] program_name = args[1] app_name = "%s.exe" % source_dir cab_final_name = args[2] if cabwiz_path is None or not os.path.isfile(cabwiz_path): print """*************************************************************************** | a018dc4263bde0f15dceea808d04ab5b9f7f8c28 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11102/a018dc4263bde0f15dceea808d04ab5b9f7f8c28/make_wince_cab.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
833,
273,
2589,
18,
19485,
309,
562,
12,
1968,
13,
411,
1059,
578,
562,
12,
1968,
13,
405,
2371,
30,
1172,
1671,
2589,
18,
11241,
16,
315,
5357,
30,
738,
87,
23059,
542,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
833,
273,
2589,
18,
19485,
309,
562,
12,
1968,
13,
411,
1059,
578,
562,
12,
1968,
13,
405,
2371,
30,
1172,
1671,
2589,
18,
11241,
16,
315,
5357,
30,
738,
87,
23059,
542,
... |
[ring] = [segs[segs.find(trigger1_end_time)] for segs in rings.values() if trigger1_end_time in segs] | try: [ring] = [segs[segs.find(trigger1_end_time)] for segs in rings.values() if trigger1_end_time in segs] except ValueError: print >>sys.stderr, "trigger1 found not on a ring, trying trigger2" [ring] = [segs[segs.find(trigger2_end_time)] for segs in rings.values() if trigger2_end_time in segs] | def calc_delta_t(trigger1_ifo, trigger1_end_time, trigger1_end_time_ns, trigger2_ifo, trigger2_end_time, trigger2_end_time_ns, time_slide_id, rings = rings, offset_vectors = offset_vectors): trigger1_true_end_time = dbtables.lsctables.LIGOTimeGPS(trigger1_end_time, trigger1_end_time_ns) trigger2_true_end_time = dbtables.lsctables.LIGOTimeGPS(trigger2_end_time, trigger2_end_time_ns) # find the instruments that were on at trigger 1's end time and # find the ring that contains this trigger [ring] = [segs[segs.find(trigger1_end_time)] for segs in rings.values() if trigger1_end_time in segs] # now we can unslide the triggers on the ring trigger1_true_end_time = SnglInspiralUtils.slideTimeOnRing(trigger1_true_end_time, offset_vectors[time_slide_id][trigger1_ifo], ring) trigger2_true_end_time = SnglInspiralUtils.slideTimeOnRing(trigger2_true_end_time, offset_vectors[time_slide_id][trigger2_ifo], ring) out = abs(trigger1_true_end_time - trigger2_true_end_time) return float(out) | 9bb61b008ffbb20184122495f1e4df0afeca56c2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/9bb61b008ffbb20184122495f1e4df0afeca56c2/mvsc_get_doubles.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7029,
67,
9878,
67,
88,
12,
10668,
21,
67,
20299,
16,
3080,
21,
67,
409,
67,
957,
16,
3080,
21,
67,
409,
67,
957,
67,
2387,
16,
3080,
22,
67,
20299,
16,
3080,
22,
67,
409,
67,
95... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7029,
67,
9878,
67,
88,
12,
10668,
21,
67,
20299,
16,
3080,
21,
67,
409,
67,
957,
16,
3080,
21,
67,
409,
67,
957,
67,
2387,
16,
3080,
22,
67,
20299,
16,
3080,
22,
67,
409,
67,
95... |
context.arc(x, y, dotSmall/2., 0, 2 * math.pi) | context.arc(alloc.x+x, alloc.y+y, dotSmall/2., 0, 2 * math.pi) | def draw (self, context, r): alloc = self.get_allocation() width = alloc.width height = alloc.height context.move_to(line, line) context.rel_line_to(0, height-line*2-curve) context.rel_curve_to(0, curve, 0, curve, curve, curve) context.rel_line_to(width-line*2-curve, 0) context.set_line_width(line) context.set_line_cap(cairo.LINE_CAP_ROUND) context.set_source_color(self.get_style().dark[self.state]) context.stroke() for y, title in self.ymarks: context.set_source_color(self.get_style().fg[self.state]) #context.set_source_rgba(0, 0, 0, 0.7) context.set_font_size(12) x, y = self.transCords (0, y) context.move_to (x+line/2., y+line/2.) context.show_text(title) context.set_source_color(self.get_style().bg[self.state]) context.move_to (x, y-line/2.) context.rel_curve_to (0, 6, -line, 6, -line, 6) context.rel_curve_to (line, 0, line, 6, line, 6) context.close_path() context.fill() for x, title in self.xmarks: context.set_source_color(self.get_style().fg[self.state]) #context.set_source_rgba(0, 0, 0, 0.7) context.set_font_size(12) x, y = self.transCords (x, 1) context.move_to (x+line/2., y) context.rotate(-math.pi/2) context.show_text(title) context.rotate(math.pi/2) context.set_source_color(self.get_style().bg[self.state]) context.move_to (x-line/2., y+line/2.) context.rel_curve_to (6, 0, 6, line, 6, line) context.rel_curve_to (0, -line, 6, -line, 6, -line) context.close_path() context.fill() context.set_line_width(dotSmall/10.) for x, y, type, name, text in self.spots.values(): context.set_source_rgb(*self.typeColors[type][0]) if self.hovered and name == self.hovered[3]: continue x, y = self.transCords (x, y) context.arc(x, y, dotSmall/2., 0, 2 * math.pi) context.fill_preserve() context.set_source_rgb(*self.typeColors[type][1]) context.stroke() context.set_line_width(dotLarge/10.) if self.hovered: x, y, type, name, text = self.hovered x, y = self.transCords (x, y) if not self.pressed: context.set_source_rgb(*self.typeColors[type][0]) else: context.set_source_rgb(*self.typeColors[type][1]) context.arc(x, y, dotLarge/2., 0, 2 * math.pi) context.fill_preserve() context.set_source_rgb(*self.typeColors[type][1]) context.stroke() x, y, width, height = self.getTextBounds(self.hovered) context.rectangle(x-hpadding, y-vpadding, width+hpadding*2, height+vpadding*2) context.set_source_color(bg) context.fill() context.move_to(x, y) context.set_source_rgb(0,0,0) context.show_layout(self.create_pango_layout(text)) | ed6e7f8fe6139ffb2a75aa4de13757198f8bc724 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5339/ed6e7f8fe6139ffb2a75aa4de13757198f8bc724/SpotGraph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
261,
2890,
16,
819,
16,
436,
4672,
4767,
273,
365,
18,
588,
67,
29299,
1435,
1835,
273,
4767,
18,
2819,
2072,
273,
4767,
18,
4210,
225,
819,
18,
8501,
67,
869,
12,
1369,
16,
98... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
261,
2890,
16,
819,
16,
436,
4672,
4767,
273,
365,
18,
588,
67,
29299,
1435,
1835,
273,
4767,
18,
2819,
2072,
273,
4767,
18,
4210,
225,
819,
18,
8501,
67,
869,
12,
1369,
16,
98... |
total: Total volume of shares daily: Average daily volume | volume: (dict) daily: Volume of shares traded average: Average daily volume (3 months) | def __init__(self, symbol): """ Download stock's attributes and attribute them to this object. * Basic attributes: | 7c9184818b453528534eca1880bdd385c68cec25 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2318/7c9184818b453528534eca1880bdd385c68cec25/YahooFinance.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3273,
4672,
3536,
13059,
12480,
1807,
1677,
471,
1566,
2182,
358,
333,
733,
18,
225,
380,
7651,
1677,
30,
2,
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,
1001,
2738,
972,
12,
2890,
16,
3273,
4672,
3536,
13059,
12480,
1807,
1677,
471,
1566,
2182,
358,
333,
733,
18,
225,
380,
7651,
1677,
30,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
raise ESPError(), 'Could not find user "%s %s"' % (first, last) | raise ESPError(False), '"%s %s": Unknown User' % (first, last) | def getUserFromNum(first, last, num): if num == '': num = 0 try: num = int(num) except: raise ESPError(), 'Could not find user "%s %s"' % (first, last) users = User.objects.filter(last_name__iexact = last, first_name__iexact = first).order_by('id') if len(users) <= num: raise ESPError(), 'Could not find user "%s %s"' % (first, last) return ESPUser(users[num]) | 0ddd425706adbd3354b23dd22c80c38b6b72b545 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12041/0ddd425706adbd3354b23dd22c80c38b6b72b545/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4735,
1265,
2578,
12,
3645,
16,
1142,
16,
818,
4672,
309,
818,
422,
875,
30,
818,
273,
374,
775,
30,
818,
273,
509,
12,
2107,
13,
1335,
30,
1002,
512,
3118,
668,
12,
8381,
3631,
2256... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4735,
1265,
2578,
12,
3645,
16,
1142,
16,
818,
4672,
309,
818,
422,
875,
30,
818,
273,
374,
775,
30,
818,
273,
509,
12,
2107,
13,
1335,
30,
1002,
512,
3118,
668,
12,
8381,
3631,
2256... |
try: result = self.templates[name]['content'] | try: result = nget(self.templates,name)['content'] | def getTemplate(self, name, followRedirects=True): ns, name, full = namespace.splitname(name, namespace.NS_TEMPLATE) if ns!=namespace.NS_TEMPLATE: return self.getRawArticle(full) try: result = self.templates[name]['content'] if isinstance(result, str): # fix bug in some simplejson version w/ Python 2.4 return unicode(result, 'utf-8') return result except KeyError: pass return None | 534819a3727f235571481b0675a66077bf8109ac /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12391/534819a3727f235571481b0675a66077bf8109ac/zipwiki.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10646,
12,
2890,
16,
508,
16,
2805,
21978,
33,
5510,
4672,
3153,
16,
508,
16,
1983,
273,
1981,
18,
4939,
529,
12,
529,
16,
1981,
18,
3156,
67,
12205,
13,
309,
3153,
5,
33,
4937,
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,
10646,
12,
2890,
16,
508,
16,
2805,
21978,
33,
5510,
4672,
3153,
16,
508,
16,
1983,
273,
1981,
18,
4939,
529,
12,
529,
16,
1981,
18,
3156,
67,
12205,
13,
309,
3153,
5,
33,
4937,
18,
... |
self.offset = self.length + offset offset = self.offset - len(self.start) | offset = self.length + offset if offset > self.length: offset = self.length self.offset = offset offset = offset - len(self.start) | def seek(self, offset, whence=0): | 10743adceeb3334af8f3c8576010a1ba3e23d667 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10962/10743adceeb3334af8f3c8576010a1ba3e23d667/loader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6520,
12,
2890,
16,
1384,
16,
23692,
33,
20,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6520,
12,
2890,
16,
1384,
16,
23692,
33,
20,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
while 1: line = sys.stdin.readline() if not line: break items = line.split() items = map(makekey, items) items.sort() | for line in sys.stdin: items = sorted(makekey(item) for item in line.split()) | def makekey(item, prog=prog): match = prog.match(item) if match: var, num = match.group(1, 2) return string.atoi(num), var else: # Bad input -- pretend it's a var with value 0 return 0, item | f1ca811abb26b9ade70cb80ddc2dc8ed89b330b3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8546/f1ca811abb26b9ade70cb80ddc2dc8ed89b330b3/sortingtest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
856,
12,
1726,
16,
11243,
33,
14654,
4672,
845,
273,
11243,
18,
1916,
12,
1726,
13,
309,
845,
30,
569,
16,
818,
273,
845,
18,
1655,
12,
21,
16,
576,
13,
327,
533,
18,
270,
11... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
856,
12,
1726,
16,
11243,
33,
14654,
4672,
845,
273,
11243,
18,
1916,
12,
1726,
13,
309,
845,
30,
569,
16,
818,
273,
845,
18,
1655,
12,
21,
16,
576,
13,
327,
533,
18,
270,
11... |
+ StringEnd()) .setParseAction(self._actionModule)\ .setName('module') | + StringEnd()) .setParseAction(self._actionModule) | compound_stmt = (classdef | funcDef | ifStatement) | 8d423a3a49fcffb9fd2045c1638eeede3472d2e1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2720/8d423a3a49fcffb9fd2045c1638eeede3472d2e1/simlparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
11360,
67,
10589,
273,
261,
1106,
536,
571,
1326,
3262,
571,
309,
3406,
13,
282,
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,
11360,
67,
10589,
273,
261,
1106,
536,
571,
1326,
3262,
571,
309,
3406,
13,
282,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def rotate_dword(x, count): rotate_left(x, count, 32, 0) def rotate_word(x, count): rotate_left(x, count, 16, 0) def rotate_byte(x, count): rotate_left(x, count, 8, 0) | def rotate_dword(x, count): return rotate_left(x, count, 32, 0) def rotate_word(x, count): return rotate_left(x, count, 16, 0) def rotate_byte(x, count): return rotate_left(x, count, 8, 0) | def rotate_dword(x, count): rotate_left(x, count, 32, 0) | 0ffa672fe74d2b51e1742b974493692270938976 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3410/0ffa672fe74d2b51e1742b974493692270938976/idc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8534,
67,
72,
1095,
12,
92,
16,
1056,
4672,
8534,
67,
4482,
12,
92,
16,
1056,
16,
3847,
16,
374,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8534,
67,
72,
1095,
12,
92,
16,
1056,
4672,
8534,
67,
4482,
12,
92,
16,
1056,
16,
3847,
16,
374,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def postreferences(self): return set() def postupdates(self): return set() | def postreferences(self): return cellset() def postupdates(self): return cellset() | def postreferences(self): return set() | 71e0598bb7dc6d9b90f66161eeb283e8ddccc073 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2040/71e0598bb7dc6d9b90f66161eeb283e8ddccc073/esotope-bfc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1603,
14353,
12,
2890,
4672,
327,
444,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1603,
14353,
12,
2890,
4672,
327,
444,
1435,
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 self.imagePage.titleWithoutNamespace() != self.newname.decode('utf-8'): | if self.imagePage.titleWithoutNamespace() != self.newname: | def run(self): tosend={'language':self.imagePage.site().language().encode('utf-8'), 'image':self.imagePage.titleWithoutNamespace().encode('utf-8'), 'newname':self.newname.encode('utf-8'), 'project':self.imagePage.site().family.name.encode('utf-8'), 'username':'', 'commonsense':'1', 'remove_categories':'1', 'ignorewarnings':'1', 'doit':'Uitvoeren' } tosend=urllib.urlencode(tosend) print tosend CH=pageTextPost('http://www.toolserver.org/~magnus/commonshelper.php', tosend) print 'Got CH desc.' tablock=CH.split('<textarea ')[1].split('>')[0] CH=CH.split('<textarea '+tablock+'>')[1].split('</textarea>')[0] CH=CH.replace(u'×', u'×') wikipedia.output(CH); #CH=CH.decode('utf-8') ## if not '[[category:' in CH.lower(): # I want every picture to be tagged with the bottemplate so i can check my contributions later. CH=u'\n\n{{BotMoveToCommons|'+ self.imagePage.site().language() + '.' + self.imagePage.site().family.name +'}}'+CH #urlEncoding='utf-8' bot = UploadRobot(url=self.imagePage.fileUrl(), description=CH, useFilename=self.newname, keepFilename=True, verifyDescription=False, ignoreWarning = True, targetSite = wikipedia.getSite('commons', 'commons')) bot.run() | 823950fc8f6b5197216f8b11fe571904477602a7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/823950fc8f6b5197216f8b11fe571904477602a7/imagecopy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
358,
4661,
5899,
11,
4923,
4278,
2890,
18,
2730,
1964,
18,
4256,
7675,
4923,
7675,
3015,
2668,
3158,
17,
28,
19899,
296,
2730,
4278,
2890,
18,
2730,
1964,
18,
2649,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
358,
4661,
5899,
11,
4923,
4278,
2890,
18,
2730,
1964,
18,
4256,
7675,
4923,
7675,
3015,
2668,
3158,
17,
28,
19899,
296,
2730,
4278,
2890,
18,
2730,
1964,
18,
2649,... |
pprint({ 'rules': asGrammar(f), | it = { 'rules': asGrammar(f), | def main(argv): from pprint import pprint data = argv[1] f = myStore.load(data) pprint({ 'rules': asGrammar(f), 'first': sets(f, EBNF.first), 'follow': sets(f, EBNF.follow)}) | b179aae00351ee83e5a440dd7d8eda8e43f77808 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3308/b179aae00351ee83e5a440dd7d8eda8e43f77808/gramLL1.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
4672,
628,
18771,
1930,
18771,
501,
273,
5261,
63,
21,
65,
284,
273,
3399,
2257,
18,
945,
12,
892,
13,
518,
273,
288,
296,
7482,
4278,
487,
18576,
12,
74,
3631,
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,
2774,
12,
19485,
4672,
628,
18771,
1930,
18771,
501,
273,
5261,
63,
21,
65,
284,
273,
3399,
2257,
18,
945,
12,
892,
13,
518,
273,
288,
296,
7482,
4278,
487,
18576,
12,
74,
3631,
296,
... |
wasempty = repo.changelog.count() == 0 | def pull(ui, repo, source="default", **opts): """pull changes from the specified source Pull changes from a remote repository to a local one. This finds all changes from the repository at the specified path or URL and adds them to the local repository. By default, this does not update the copy of the project in the working directory. Valid URLs are of the form: local/filesystem/path (or file://local/filesystem/path) http://[user@]host[:port]/[path] https://[user@]host[:port]/[path] ssh://[user@]host[:port]/[path] static-http://host[:port]/[path] Paths in the local filesystem can either point to Mercurial repositories or to bundle files (as created by 'hg bundle' or 'hg incoming --bundle'). The static-http:// protocol, albeit slow, allows access to a Mercurial repository where you simply use a web server to publish the .hg directory as static content. An optional identifier after # indicates a particular branch, tag, or changeset to pull. Some notes about using SSH with Mercurial: - SSH requires an accessible shell account on the destination machine and a copy of hg in the remote path or specified with as remotecmd. - path is relative to the remote user's home directory by default. Use an extra slash at the start of a path to specify an absolute path: ssh://example.com//tmp/repository - Mercurial doesn't use its own compression via SSH; the right thing to do is to configure it in your ~/.ssh/config, e.g.: Host *.mylocalnetwork.example.com Compression no Host * Compression yes Alternatively specify "ssh -C" as your ssh command in your hgrc or with the --ssh command line option. """ source, revs = cmdutil.parseurl(ui.expandpath(source), opts['rev']) cmdutil.setremoteconfig(ui, opts) other = hg.repository(ui, source) ui.status(_('pulling from %s\n') % (source)) if revs: if 'lookup' in other.capabilities: revs = [other.lookup(rev) for rev in revs] else: error = _("Other repository doesn't support revision lookup, so a rev cannot be specified.") raise util.Abort(error) wasempty = repo.changelog.count() == 0 modheads = repo.pull(other, heads=revs, force=opts['force']) return postincoming(ui, repo, modheads, opts['update'], wasempty) | 30c5744a87e768b1e275ea6e6bbaf632d52cff60 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11312/30c5744a87e768b1e275ea6e6bbaf632d52cff60/commands.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6892,
12,
4881,
16,
3538,
16,
1084,
1546,
1886,
3113,
2826,
4952,
4672,
3536,
13469,
3478,
628,
326,
1269,
1084,
225,
14899,
3478,
628,
279,
2632,
3352,
358,
279,
1191,
1245,
18,
225,
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,
6892,
12,
4881,
16,
3538,
16,
1084,
1546,
1886,
3113,
2826,
4952,
4672,
3536,
13469,
3478,
628,
326,
1269,
1084,
225,
14899,
3478,
628,
279,
2632,
3352,
358,
279,
1191,
1245,
18,
225,
12... | |
print "OnNotify code=0x%x (0x%x, 0x%x)" % (code, wparam, lparam) | def OnNotify(self, hwnd, msg, wparam, lparam): hwndFrom, idFrom, code = win32gui_struct.UnpackWMNOTIFY(lparam) print "OnNotify code=0x%x (0x%x, 0x%x)" % (code, wparam, lparam) if code == commctrl.NM_SETFOCUS: # Control got focus - Explorer may not know - tell it if self.browser is not None: self.browser.OnViewWindowActive(None) # And do our menu thang self._OnActivate(shellcon.SVUIA_ACTIVATE_FOCUS) elif code == commctrl.NM_KILLFOCUS: self._OnDeactivate() elif code == commctrl.NM_DBLCLK: # This DblClick implementation leaves a little to be desired :) # It demonstrates some useful concepts, such as asking the # folder for its context-menu and invoking a command from it. # However, as our folder delegates IContextMenu to the shell # itself, the end result is that the folder is opened in # its "normal" place in Windows explorer rather than inside # our shell-extension. # Determine the selected items. sel = [] n = -1 while 1: n = win32gui.SendMessage(self.hwnd_child, commctrl.LVM_GETNEXTITEM, n, commctrl.LVNI_SELECTED) if n==-1: break sel.append(self.children[n][-1:]) print "Selection is", sel # Get the IContextMenu for the items. inout, cm = self.folder.GetUIObjectOf(self.hwnd_parent, sel, shell.IID_IContextMenu, 0) hmenu = win32gui.CreateMenu() try: # As per 'Q179911', we need to determine if the default operation # should be 'open' or 'explore' flags = shellcon.CMF_DEFAULTONLY try: self.browser.GetControlWindow(shellcon.FCW_TREE) flags |= shellcon.CMF_EXPLORE except pythoncom.com_error: pass id_cmd_first = 1 # TrackPopupMenu makes it hard to use 0 cm.QueryContextMenu(hmenu, 0, id_cmd_first, -1, flags) # Find the default item in the returned menu. cmd = win32gui.GetMenuDefaultItem(hmenu, False, 0) if cmd == -1: print "Oops: _doDefaultActionFor found no default menu" else: ci = 0, self.hwnd_parent, cmd-id_cmd_first, None, None, 0, 0, 0 cm.InvokeCommand(ci) finally: win32gui.DestroyMenu(hmenu) | 29f1237703d41142c157323e2290f3e0f010a413 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/677/29f1237703d41142c157323e2290f3e0f010a413/shell_view.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
9168,
12,
2890,
16,
16139,
4880,
16,
1234,
16,
341,
891,
16,
328,
891,
4672,
16139,
4880,
1265,
16,
612,
1265,
16,
981,
273,
5657,
1578,
20292,
67,
1697,
18,
23649,
25173,
4400,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
9168,
12,
2890,
16,
16139,
4880,
16,
1234,
16,
341,
891,
16,
328,
891,
4672,
16139,
4880,
1265,
16,
612,
1265,
16,
981,
273,
5657,
1578,
20292,
67,
1697,
18,
23649,
25173,
4400,
... | |
if len(self.mediaNodes < 1): | if len(self.mediaNodes) < 1: | def canRun(self): # See if we were built with no XLF # If we were, attempt to set ourselves up # Otherwise return False if self.builtWithNoXLF: self.__setup() if self.builtWithNoXLF: return False self.mediaCheck = True if len(self.mediaNodes < 1): log.log(3,"warn",_("Layout ") + self.layoutID + _(" cannot run because layout has no media nodes.")) self.mediaCheck = False | 65268b67f960f379c6b8fe0ad78794c76d1559d6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5464/65268b67f960f379c6b8fe0ad78794c76d1559d6/XiboClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
848,
1997,
12,
2890,
4672,
468,
2164,
309,
732,
4591,
6650,
598,
1158,
1139,
9105,
468,
971,
732,
4591,
16,
4395,
358,
444,
19801,
731,
468,
5272,
327,
1083,
309,
365,
18,
12406,
1190,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
848,
1997,
12,
2890,
4672,
468,
2164,
309,
732,
4591,
6650,
598,
1158,
1139,
9105,
468,
971,
732,
4591,
16,
4395,
358,
444,
19801,
731,
468,
5272,
327,
1083,
309,
365,
18,
12406,
1190,
... |
def get_member(self, email_address, fqdn_listname): """Return a member object. :param email_adresses: the email address used :type email_address: string :param fqdn_listname: the mailing list :type fqdn_listname: string :return: a member object :rtype: _Member """ return _Member(self.host, email_address, fqdn_listname) def get_user(self, email_address): """Find and return a user object. :param email_address: one of the user's email addresses :type email: string: :returns: a user object :rtype: _User """ return _User(self.host, email_address) | def get_member(self, email_address, fqdn_listname): """Return a member object. :param email_adresses: the email address used :type email_address: string :param fqdn_listname: the mailing list :type fqdn_listname: string :return: a member object :rtype: _Member """ return _Member(self.host, email_address, fqdn_listname) | a73b2f832d063623dfaf85e3b60c20180665247c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2119/a73b2f832d063623dfaf85e3b60c20180665247c/mailman_rest_client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5990,
12,
2890,
16,
2699,
67,
2867,
16,
19897,
67,
1098,
529,
4672,
3536,
990,
279,
3140,
733,
18,
225,
294,
891,
2699,
67,
361,
15807,
30,
326,
2699,
1758,
1399,
294,
723,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5990,
12,
2890,
16,
2699,
67,
2867,
16,
19897,
67,
1098,
529,
4672,
3536,
990,
279,
3140,
733,
18,
225,
294,
891,
2699,
67,
361,
15807,
30,
326,
2699,
1758,
1399,
294,
723,
... | |
register("windows-default", WindowsDefault) | def open(self, url, new=0, autoraise=1): os.startfile(url) return True # Oh, my... | 65651bea05f337dff247bbe21dd81e05627974a4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/65651bea05f337dff247bbe21dd81e05627974a4/webbrowser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
2890,
16,
880,
16,
394,
33,
20,
16,
2059,
10610,
784,
33,
21,
4672,
1140,
18,
1937,
768,
12,
718,
13,
327,
1053,
468,
531,
76,
16,
3399,
2777,
2,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
2890,
16,
880,
16,
394,
33,
20,
16,
2059,
10610,
784,
33,
21,
4672,
1140,
18,
1937,
768,
12,
718,
13,
327,
1053,
468,
531,
76,
16,
3399,
2777,
2,
-100,
-100,
-100,
-100,
... | |
ID_MENU_UPDATE = 108 ID_MENU_REPORTBUG = 109 | def DamnLoadCurrentLocale(): if DV.languages.has_key(DV.lang): DV.locale = DV.languages[DV.lang] else: DV.locale = None | 7a486514c4f2b2eb8c7e2a316b3d60c539f2c4cb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11142/7a486514c4f2b2eb8c7e2a316b3d60c539f2c4cb/DamnVid.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
463,
301,
82,
2563,
3935,
3916,
13332,
309,
463,
58,
18,
14045,
18,
5332,
67,
856,
12,
30199,
18,
4936,
4672,
463,
58,
18,
6339,
273,
463,
58,
18,
14045,
63,
30199,
18,
4936,
65,
469... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
463,
301,
82,
2563,
3935,
3916,
13332,
309,
463,
58,
18,
14045,
18,
5332,
67,
856,
12,
30199,
18,
4936,
4672,
463,
58,
18,
6339,
273,
463,
58,
18,
14045,
63,
30199,
18,
4936,
65,
469... | |
links[i] = self.fix_fragment(m) | links[i] = self.fix_fragment(m.group(1), m.group(2)) | def fix_genindex(self, tree): """Fix href attributes for genindex pages. """ # XXX: modifies tree inline # Logic modeled from themes/basic/genindex.html for key, columns in tree: for entryname, (links, subitems) in columns: for (i, link) in enumerate(links): m = _refuri_re.match(link) if m: links[i] = self.fix_fragment(m) for subentryname, subentrylinks in subitems: for (i, link) in enumerate(subentrylinks): m = _refuri_re.match(link) if m: subentrylinks[i] = self.fix_fragment(m) | e76daad195e3ac6a45ae9fd27a6d086118c396b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7032/e76daad195e3ac6a45ae9fd27a6d086118c396b3/epub.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
67,
4507,
1615,
12,
2890,
16,
2151,
4672,
3536,
8585,
3897,
1677,
364,
3157,
1615,
4689,
18,
3536,
468,
11329,
30,
23934,
2151,
6370,
468,
10287,
938,
329,
628,
15455,
19,
13240,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
67,
4507,
1615,
12,
2890,
16,
2151,
4672,
3536,
8585,
3897,
1677,
364,
3157,
1615,
4689,
18,
3536,
468,
11329,
30,
23934,
2151,
6370,
468,
10287,
938,
329,
628,
15455,
19,
13240,
1... |
self._columns[field].set(cr, self, id, field, vals[field], user, context=context) | self._columns[field].set(cr, self, id, field, vals[field], user, context=rel_context) | def write(self, cr, user, ids, vals, context=None): readonly = None for field in vals.copy(): fobj = None if field in self._columns: fobj = self._columns[field] else: fobj = self._inherit_fields[field][2] if not fobj: continue groups = fobj.write | a94ca8c20d26330914c8041af4210bd0aa0fa432 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12853/a94ca8c20d26330914c8041af4210bd0aa0fa432/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
4422,
16,
729,
16,
3258,
16,
5773,
16,
819,
33,
7036,
4672,
17102,
273,
599,
364,
652,
316,
5773,
18,
3530,
13332,
24705,
273,
599,
309,
652,
316,
365,
6315,
5112,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
729,
16,
3258,
16,
5773,
16,
819,
33,
7036,
4672,
17102,
273,
599,
364,
652,
316,
5773,
18,
3530,
13332,
24705,
273,
599,
309,
652,
316,
365,
6315,
5112,
... |
common.warning(_('You can not log into the system !\n' \ 'Ask the administrator to verify\n' \ 'you have an action defined for your user.'), | common.warning(_('You can not log into the system!\n' \ 'Verify if you have an menu defined on your user.'), | def sig_win_new(self, widget=None, menu_type='menu', quiet=True, except_id=False, prefs=None): if not prefs: try: prefs = rpc.execute('object', 'execute', 'res.user', 'get_preferences', False, rpc.CONTEXT) except: return False sb_id = self.sb_username.get_context_id('message') self.sb_username.push(sb_id, prefs['status_bar'] or '') sb_id = self.sb_servername.get_context_id('message') self.sb_servername.push(sb_id, '%s@%s:%d/%s' % (rpc._USERNAME, rpc._SOCK.hostname, rpc._SOCK.port, rpc._DATABASE)) if not prefs[menu_type]: if quiet: return False common.warning(_('You can not log into the system !\n' \ 'Ask the administrator to verify\n' \ 'you have an action defined for your user.'), 'Access Denied!', self.window) rpc.logout() self.refresh_ssl() return False act_id = prefs[menu_type] if except_id and act_id == except_id: return act_id Action.execute(act_id, {'window': self.window}) return act_id | bb9050c5d847f9b9616dfd128a3b11b6307b5109 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9151/bb9050c5d847f9b9616dfd128a3b11b6307b5109/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3553,
67,
8082,
67,
2704,
12,
2890,
16,
3604,
33,
7036,
16,
3824,
67,
723,
2218,
5414,
2187,
10902,
33,
5510,
16,
1335,
67,
350,
33,
8381,
16,
15503,
33,
7036,
4672,
309,
486,
15503,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3553,
67,
8082,
67,
2704,
12,
2890,
16,
3604,
33,
7036,
16,
3824,
67,
723,
2218,
5414,
2187,
10902,
33,
5510,
16,
1335,
67,
350,
33,
8381,
16,
15503,
33,
7036,
4672,
309,
486,
15503,
... |
scale_division = scale_division.round() or 1 | scale_division = round(scale_division) or 1 | def data_range(self, axis): side = {'x': 'right', 'y': 'top'}[axis] | 47b2da086d8082fcb232535d81ad4bf0e7399ca9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12209/47b2da086d8082fcb232535d81ad4bf0e7399ca9/Plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
501,
67,
3676,
12,
2890,
16,
2654,
4672,
4889,
273,
13666,
92,
4278,
296,
4083,
2187,
296,
93,
4278,
296,
3669,
11,
20294,
4890,
65,
2,
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,
501,
67,
3676,
12,
2890,
16,
2654,
4672,
4889,
273,
13666,
92,
4278,
296,
4083,
2187,
296,
93,
4278,
296,
3669,
11,
20294,
4890,
65,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if name and Options.spacename and name != Options.spacename: raise TestSkip return option.objspace(name,_spacecache={}) | return objspace(name=name, new_flag=True) | def new_objspace(name=''): if name and Options.spacename and name != Options.spacename: raise TestSkip return option.objspace(name,_spacecache={}) | 2a7a12b9fb1a2815f910adcde930c17f8055a71c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/2a7a12b9fb1a2815f910adcde930c17f8055a71c/testit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
67,
2603,
2981,
12,
529,
2218,
11,
4672,
327,
1081,
2981,
12,
529,
33,
529,
16,
394,
67,
6420,
33,
5510,
13,
225,
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,
394,
67,
2603,
2981,
12,
529,
2218,
11,
4672,
327,
1081,
2981,
12,
529,
33,
529,
16,
394,
67,
6420,
33,
5510,
13,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
userbit__verb = verb2).distinct(), | userbit__verb = verb2, userbit__startdate__lte=now, userbit__enddate__gte=now).distinct(), | def students(self, QObject = False): verb = GetNode('V/Flags/Public') verb2 = GetNode('V/Flags/Registration/Attended') STUDREP_VERB = GetNode('V/Flags/UserRole/StudentRep') STUDREP_QSC = GetNode('Q') qsc = GetNode("/".join(self.program_anchor_cached().tree_encode()) + "/Confirmation") qsc_waitlist = GetNode("/".join(self.program_anchor_cached().tree_encode()) + "/Waitlist") | bb36f2c2d7c00614878bb9fb6d9060b8cd518768 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12041/bb36f2c2d7c00614878bb9fb6d9060b8cd518768/studentregcore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10068,
4877,
12,
2890,
16,
2238,
921,
273,
1083,
4672,
6405,
273,
968,
907,
2668,
58,
19,
5094,
19,
4782,
6134,
6405,
22,
273,
968,
907,
2668,
58,
19,
5094,
19,
7843,
19,
3075,
3934,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10068,
4877,
12,
2890,
16,
2238,
921,
273,
1083,
4672,
6405,
273,
968,
907,
2668,
58,
19,
5094,
19,
4782,
6134,
6405,
22,
273,
968,
907,
2668,
58,
19,
5094,
19,
7843,
19,
3075,
3934,
... |
class Dot11Addr2MACField(MACField): | class Dot11Addr2MACField(Dot11AddrMACField): | def getfield(self, pkt, s): if self.is_applicable(pkt): return MACField.getfield(self, pkt, s) else: return s,None | fdc42c04e59757fb088ee127057846d803626638 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7311/fdc42c04e59757fb088ee127057846d803626638/scapy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
1518,
12,
2890,
16,
11536,
16,
272,
4672,
309,
365,
18,
291,
67,
438,
10120,
12,
5465,
88,
4672,
327,
14246,
974,
18,
588,
1518,
12,
2890,
16,
11536,
16,
272,
13,
469,
30,
327,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1518,
12,
2890,
16,
11536,
16,
272,
4672,
309,
365,
18,
291,
67,
438,
10120,
12,
5465,
88,
4672,
327,
14246,
974,
18,
588,
1518,
12,
2890,
16,
11536,
16,
272,
13,
469,
30,
327,
... |
raise ValueError, "local port must be an integer number" | raise ValueError, "Local port must be an integer number" | def usage(): print >>sys.stderr, """USAGE: %s [options] Simple Terminal Programm for the serial port. options: -p, --port=PORT: serial port, a number, defualt = 0 or a device name -b, --baud=BAUD: baudrate, default 9600 -r, --rtscts: enable RTS/CTS flow control (default off) -x, --xonxoff: enable software flow control (default off) -P, --localport: TCP/IP port on which to run the server (default 7777) """ % sys.argv[0] | d1bc025a5ffd45b7cb45bdc2b2b0210119acfd93 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10955/d1bc025a5ffd45b7cb45bdc2b2b0210119acfd93/tcp_serial_redirect.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
1671,
9499,
18,
11241,
16,
3536,
29550,
30,
738,
87,
306,
2116,
65,
4477,
18778,
13586,
81,
364,
326,
2734,
1756,
18,
225,
702,
30,
300,
84,
16,
1493,
655,
33,
6354,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
1671,
9499,
18,
11241,
16,
3536,
29550,
30,
738,
87,
306,
2116,
65,
4477,
18778,
13586,
81,
364,
326,
2734,
1756,
18,
225,
702,
30,
300,
84,
16,
1493,
655,
33,
6354,... |
raise ValueError(_("%s time can't be before year 10") % which) | raise ValueError(neg_error) | def _ensure_within_range(self, time, delta, which): """ Return new time (time + delta) or raise ValueError if it is not within the range [MIN_TIME, MAX_TIME]. """ new_time, overflow = self._calculate_overflow(time, delta) if overflow > 0: raise ValueError(_("%s time can't be after year 9989") % which) elif overflow < 0: raise ValueError(_("%s time can't be before year 10") % which) else: return new_time | 81c24b66938f30cf26ff60e266925ad043d45f3c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5252/81c24b66938f30cf26ff60e266925ad043d45f3c/data.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
15735,
67,
25850,
67,
3676,
12,
2890,
16,
813,
16,
3622,
16,
1492,
4672,
3536,
2000,
394,
813,
261,
957,
397,
3622,
13,
578,
1002,
2068,
309,
518,
353,
486,
3470,
326,
1048,
306,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
15735,
67,
25850,
67,
3676,
12,
2890,
16,
813,
16,
3622,
16,
1492,
4672,
3536,
2000,
394,
813,
261,
957,
397,
3622,
13,
578,
1002,
2068,
309,
518,
353,
486,
3470,
326,
1048,
306,
... |
try: mil.due = due and datefmt.parse_date(due) or 0 except ValueError, e: raise TracError(e, 'Invalid Date Format') if 'completed' in req.args: completed = req.args.get('completeddate', '') | if due: | def render_admin_panel(self, req, cat, page, milestone): req.perm.require('TICKET_ADMIN') | 92b4beedefba22f9d279a03853a2001d63693582 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2831/92b4beedefba22f9d279a03853a2001d63693582/admin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
3666,
67,
13916,
12,
2890,
16,
1111,
16,
6573,
16,
1363,
16,
28664,
4672,
1111,
18,
12160,
18,
6528,
2668,
56,
16656,
1584,
67,
15468,
6134,
2,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
3666,
67,
13916,
12,
2890,
16,
1111,
16,
6573,
16,
1363,
16,
28664,
4672,
1111,
18,
12160,
18,
6528,
2668,
56,
16656,
1584,
67,
15468,
6134,
2,
-100,
-100,
-100,
-100,
-100,
... |
def config(what): if sys.platform == "win32": try: from win32pipe import popen except ImportError: print "win32pipe is required for building on Windows." print "Get it here: http://www.python.org/windows/win32/" raise else: | if sys.platform == "win32": mysqlroot = os.getenv('mysqlroot', None) if mysqlroot is None: print "You need to set the environment variable mysqlroot!" print "This should be the path to your MySQL installation." print "Probably C:\Program Files\MySQL 4.1\ or something like that." sys.exit(1) include_dirs = [os.path.join(mysqlroot, "include")] library_dirs = [os.path.join(mysqlroot, "libs")] libraries.extend(['zlib', 'msvcrt', 'libcmt', 'wsock32', 'advapi32']) else: def config(what): | def config(what): if sys.platform == "win32": try: from win32pipe import popen except ImportError: print "win32pipe is required for building on Windows." print "Get it here: http://www.python.org/windows/win32/" raise else: from os import popen return popen("mysql_config --%s" % what).read().strip().split() | aac97876056f36d4b4dc261c45dac95d3accf54a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10477/aac97876056f36d4b4dc261c45dac95d3accf54a/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
309,
2589,
18,
9898,
422,
315,
8082,
1578,
6877,
7219,
3085,
273,
1140,
18,
588,
3074,
2668,
12527,
3085,
2187,
599,
13,
309,
7219,
3085,
353,
599,
30,
1172,
315,
6225,
1608,
358,
444,
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,
309,
2589,
18,
9898,
422,
315,
8082,
1578,
6877,
7219,
3085,
273,
1140,
18,
588,
3074,
2668,
12527,
3085,
2187,
599,
13,
309,
7219,
3085,
353,
599,
30,
1172,
315,
6225,
1608,
358,
444,
326,
... |
try: fp = open(SSTDOC, "r") except IOError: | for directory in docpath: | def helpme(): "Browse on-line help." key = scanner.next() while True: if key == "IHEOL": setwnd(prompt_window) proutn(_("Help on what command? ")) key = scanner.next() setwnd(message_window) if key == "IHEOL": return if scanner.token in commands or scanner.token == "ABBREV": break skip(1) listCommands() key = "IHEOL" scanner.chew() skip(1) cmd = scanner.token.upper() try: fp = open(SSTDOC, "r") except IOError: try: fp = open(DOC_NAME, "r") except IOError: prout(_("Spock- \"Captain, that information is missing from the")) proutn(_(" computer. You need to find ")) proutn(DOC_NAME) prout(_(" and put it in the")) proutn(_(" current directory or to ")) proutn(SSTDOC) prout(".\"") # This used to continue: "You need to find SST.DOC and put # it in the current directory." return while True: linebuf = fp.readline() if linebuf == '': prout(_("Spock- \"Captain, there is no information on that command.\"")) fp.close() return if linebuf[0] == '%' and linebuf[1] == '%' and linebuf[2] == ' ': linebuf = linebuf[3:].strip() if cmd == linebuf: break skip(1) prout(_("Spock- \"Captain, I've found the following information:\"")) skip(1) while linebuf in fp: if "******" in linebuf: break proutn(linebuf) fp.close() | e56967f9f71423371cfe28a2ffa246a89042d531 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3176/e56967f9f71423371cfe28a2ffa246a89042d531/sst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2809,
3501,
13332,
315,
27304,
603,
17,
1369,
2809,
1199,
498,
273,
7683,
18,
4285,
1435,
1323,
1053,
30,
309,
498,
422,
315,
45,
3900,
1741,
6877,
444,
91,
4880,
12,
13325,
67,
5668,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2809,
3501,
13332,
315,
27304,
603,
17,
1369,
2809,
1199,
498,
273,
7683,
18,
4285,
1435,
1323,
1053,
30,
309,
498,
422,
315,
45,
3900,
1741,
6877,
444,
91,
4880,
12,
13325,
67,
5668,
... |
if oldFile: contentRequest.append((oldFileId, oldFileVersion)) | elif oldFile.contents.sha1() == newFile.contents.sha1(): continue elif (oldFile and oldFile.flags.isConfig()) or newFile.flags.isConfig(): contentsNeeded.append((pathId, oldFile, True, newFile, newFileId)) contentRequest.append((oldFileId, oldFileVersion)) | def rdiffChangeSet(repos, job): # creates a changeset, but only puts in file contents for config files, and # always puts those contents in as diffs (unless the file is new of course) oldTroveInfo = (job[0], job[1][0], job[1][1]) newTroveInfo = (job[0], job[2][0], job[2][1]) if oldTroveInfo[1] is None: oldTroveInfo = None newTrove = repos.getTrove(*newTroveInfo) else: oldTrove, newTrove = repos.getTroves( [ oldTroveInfo, newTroveInfo ] ) trvCs, fileChangeList = newTrove.diff(oldTrove)[0:2] cs = changeset.ChangeSet() cs.newTrove(trvCs) filesNeeded = [] for (pathId, oldFileId, oldFileVersion, newFileId, newFileVersion) in \ fileChangeList: if oldFileId: filesNeeded.append((pathId, oldFileId, oldFileVersion)) filesNeeded.append((pathId, newFileId, newFileVersion)) fileObjects = repos.getFileVersions(filesNeeded) contentsNeeded = [] contentRequest = [] for (pathId, oldFileId, oldFileVersion, newFileId, newFileVersion) in \ fileChangeList: if oldFileId: oldFile = fileObjects.pop(0) else: oldFile = None newFile = fileObjects.pop(0) fileDiff = newFile.diff(oldFile) cs.addFile(oldFileId, newFileId, fileDiff) if (oldFile and oldFile.flags.isConfig()) or newFile.flags.isConfig(): contentsNeeded.append((pathId, oldFile, oldFileId, newFile, newFileId)) if oldFile: contentRequest.append((oldFileId, oldFileVersion)) contentRequest.append((newFileId, newFileVersion)) contents = repos.getFileContents(contentRequest) for (pathId, oldFile, oldFileId, newFile, newFileId) in contentsNeeded: if oldFileId: oldContents = contents.pop(0) else: oldContents = None newContents = contents.pop(0) (contType, cont) = changeset.fileContentsDiff(oldFile, oldContents, newFile, newContents) cs.addFileContents(pathId, newFileId, contType, cont, True) return cs | ba3de6c5f951f40840162b54dc71b9d2b93bec26 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8747/ba3de6c5f951f40840162b54dc71b9d2b93bec26/checkin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
436,
5413,
21565,
12,
15564,
16,
1719,
4672,
468,
3414,
279,
22463,
16,
1496,
1338,
8200,
316,
585,
2939,
364,
642,
1390,
16,
471,
468,
3712,
8200,
5348,
2939,
316,
487,
15250,
261,
2850... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
436,
5413,
21565,
12,
15564,
16,
1719,
4672,
468,
3414,
279,
22463,
16,
1496,
1338,
8200,
316,
585,
2939,
364,
642,
1390,
16,
471,
468,
3712,
8200,
5348,
2939,
316,
487,
15250,
261,
2850... |
sortedby=request.GET['sortedby']; | request.session['sortedby'] = request.GET['sortedby']; sortedby = request.session.get('sortedby', "-date"); | def user_tag_page(request, username, tags): logging.debug("bookmarks.views.user_tag_page() username=%s tags=%s" % (username, tags)); logging.debug("bookmarks.views.user_tag_page() request.user.username=%s" % (request.user.username)); tag_array = tags.split('/'); sortedby = "-date"; if request.GET.has_key('sortedby'): sortedby=request.GET['sortedby']; user = get_object_or_404(User, username=username) http_host = request.META['HTTP_HOST'] if(user.username == request.user.username): bookmarks = Bookmark.objects.filter(user=user); for tag in tag_array: if len(tag) > 0: bookmarks = bookmarks.filter(Q(**{'tags__name__iexact':tag})); bookmarks = bookmarks.order_by(sortedby); is_owner = True; show_edit = True show_delete = True else: bookmarks = Bookmark.objects.filter(user=user).filter(share=True); for tag in tag_array: if len(tag) > 0: bookmarks = bookmarks.filter(Q(**{'tags__name__iexact':tag})); bookmarks = bookmarks.order_by(sortedby); is_owner = False; show_edit = False show_delete = False #tags = Bookmark.objects.tag_clouds(username, is_owner); ids = []; for bookmark in bookmarks: ids.append(bookmark.id); tags = Bookmark.objects.associated_tags(username=username, is_owner=is_owner, tags=tag_array, ids=ids); tag_browse = True; paginator = Paginator(bookmarks, ITEMS_PER_PAGE); page = 1; if request.GET.has_key('page'): page = int(request.GET['page']); try: p = paginator.page(page); except: raise Http404; tag_nav = []; url = "/bookmarks/user/" + username + "/"; for tag in tag_array: url += tag + "/"; tag_dict = {'name': tag, 'url': url}; tag_nav.append(tag_dict); variables = RequestContext(request, { 'sortedby':sortedby, 'page_type':'user', 'is_owner': is_owner, 'user': request.user, 'username':username, #'bookmarks':bookmarks, 'bookmarks':p.object_list, 'total':len(bookmarks), 'tags':tags, 'tag_nav':tag_nav, 'show_edit':show_edit, 'show_delete':show_delete, 'http_host':http_host, 'tag_browse':tag_browse, 'has_other_pages': p.has_other_pages(), 'has_next': p.has_next(), 'has_previous': p.has_previous(), 'page': p.number, 'pages': range(1, p.paginator.num_pages + 1), 'next_page_number': p.next_page_number(), 'previous_page_number': p.previous_page_number() }) return render_to_response('bookmarks/bookmarks_page.html', variables) | 21dc630bb00c51c3e84c9f958c48915afee4d71a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10474/21dc630bb00c51c3e84c9f958c48915afee4d71a/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
729,
67,
2692,
67,
2433,
12,
2293,
16,
2718,
16,
2342,
4672,
2907,
18,
4148,
2932,
3618,
17439,
18,
7061,
18,
1355,
67,
2692,
67,
2433,
1435,
2718,
5095,
87,
2342,
5095,
87,
6,
738,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
729,
67,
2692,
67,
2433,
12,
2293,
16,
2718,
16,
2342,
4672,
2907,
18,
4148,
2932,
3618,
17439,
18,
7061,
18,
1355,
67,
2692,
67,
2433,
1435,
2718,
5095,
87,
2342,
5095,
87,
6,
738,
... |
F = C.base_ring() q = F.order() | def assmus_mattson_designs(self,t,mode=None): r""" Assmus and Mattson Theorem (section 8.4, page 303 of [HP]): Let $A_0, A_1, ..., A_n$ be the weights of the codewords in a binary linear $[n , k, d]$ code $C$, and let $A_0^*, A_1^*, ..., A_n^*$ be the weights of the codewords in its dual $[n, n-k, d^*]$ code $C^*$. Fix a $t$, $0<t<d$, and let $$ s = |{ i | A_i^* \not= 0, 0<i\leq n-t}|. $$ Assume $s\leq d-t$. (1) If $Ai\not= 0$ and $d\leq i\leq n then Ci = { c in C | wt(c) = i}$ holds a simple t-design. | 3a7625918ca06799454663aea3e731edc0d084bf /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/3a7625918ca06799454663aea3e731edc0d084bf/linear_code.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1551,
81,
407,
67,
81,
4558,
816,
67,
16934,
87,
12,
2890,
16,
88,
16,
3188,
33,
7036,
4672,
436,
8395,
4725,
81,
407,
471,
490,
4558,
816,
1021,
479,
81,
261,
3464,
1725,
18,
24,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1551,
81,
407,
67,
81,
4558,
816,
67,
16934,
87,
12,
2890,
16,
88,
16,
3188,
33,
7036,
4672,
436,
8395,
4725,
81,
407,
471,
490,
4558,
816,
1021,
479,
81,
261,
3464,
1725,
18,
24,
... | |
sys.stdout.write(data) | if not null: sys.stdout.write(data) | def main(argv): null = False server = "localhost" port = options["html_ui", "port"] prob = 1.0 try: opts, args = getopt.getopt(argv, "hns:p:r:o:", ["help", "null", "server=", "port=", "prob=", "option="]) except getopt.error: usage(globals(), locals()) sys.exit(1) for opt, arg in opts: if opt in ("-h", "--help"): usage(globals(), locals()) sys.exit(0) elif opt in ("-n", "--null"): null = True elif opt in ("-s", "--server"): server = arg elif opt in ("-p", "--port"): port = int(arg) elif opt in ("-r", "--prob"): n = float(arg) if n < 0.0 or n > 1.0: usage(globals(), locals()) sys.exit(1) prob = n elif opt in ('-o', '--option'): options.set_from_cmdline(arg, sys.stderr) if args: usage(globals(), locals()) sys.exit(1) data = sys.stdin.read() sys.stdout.write(data) if random.random() < prob: try: post_multipart("%s:%d"%(server,port), "/upload", [], [('file', 'message.dat', data)]) except: # not an error if the server isn't responding pass | d5ecce13a9795b8289900d4f1f562ea176cd365e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9857/d5ecce13a9795b8289900d4f1f562ea176cd365e/sb_upload.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
4672,
446,
273,
1083,
1438,
273,
315,
13014,
6,
1756,
273,
702,
9614,
2620,
67,
4881,
3113,
315,
655,
11929,
3137,
273,
404,
18,
20,
225,
775,
30,
1500,
16,
833,
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,
2774,
12,
19485,
4672,
446,
273,
1083,
1438,
273,
315,
13014,
6,
1756,
273,
702,
9614,
2620,
67,
4881,
3113,
315,
655,
11929,
3137,
273,
404,
18,
20,
225,
775,
30,
1500,
16,
833,
273,
... |
content = obj.GET() contenttype = self.REQUEST.RESPONSE.headers.get('content-type', '') contenttype = getCharsetFromContentType(contenttype, default_charset) content = unicode(content, contenttype) | content = getattr(obj, obj.__browser_default__(self.REQUEST[1][0])() if not isintance(obj, unicode): contenttype = self.REQUEST.RESPONSE.headers.get('content-type', '') contenttype = getCharsetFromContentType(contenttype, default_charset) content = unicode(content, contenttype) | def getResourceContent(self, item, context, original=False): """Fetch resource content for delivery.""" ids = self.concatenatedresources.get(item, None) resources = self.getResourcesDict() if ids is not None: ids = ids[:] output = u"" if len(ids) > 1: output = output + self.merged_output_prefix | fc821e0e40bb89c4dfd55af7c70ff45259f67978 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12274/fc821e0e40bb89c4dfd55af7c70ff45259f67978/BaseRegistry.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5070,
1350,
12,
2890,
16,
761,
16,
819,
16,
2282,
33,
8381,
4672,
3536,
5005,
1058,
913,
364,
7912,
12123,
3258,
273,
365,
18,
16426,
275,
690,
4683,
18,
588,
12,
1726,
16,
599,
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,
5070,
1350,
12,
2890,
16,
761,
16,
819,
16,
2282,
33,
8381,
4672,
3536,
5005,
1058,
913,
364,
7912,
12123,
3258,
273,
365,
18,
16426,
275,
690,
4683,
18,
588,
12,
1726,
16,
599,
13,
... |
@param axisAndStrandAtomPairsToBond: A list containing pairs of the | @param axis_and_strand_atomPairs_to_bond: A list containing pairs of the | def _bond_bare_strandAtoms_with_orig_axisAtoms(self, axisAndStrandAtomPairsToBond): """ Create bonds between the bare strand atoms of the new dna with the corresponding axis atoms of the original dna. This method should be called ONLY from self._replace_overlapping_axisAtoms_of_new_dna() where we remove the axis atoms of new dna that overlap the ones in old dna. We need to re-bond the bare strand atoms as a result of this replacment, with the axis atoms of the old dna. @param axisAndStrandAtomPairsToBond: A list containing pairs of the axis and strand atoms that will be bonded together. It is of the format [(atm1, atm2) , ....] Where, atm1 is always axisAtom of original dna atm2 is always bare strandAtom of new dna @type axisAndStrandAtomPairsToBond: list @see: self._replace_overlapping_axisAtoms_of_new_dna() which calls this. """ | 0f66720dc7592e697b0246deb3b5551a198d4c93 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/0f66720dc7592e697b0246deb3b5551a198d4c93/B_Dna_PAM3_SingleStrand.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
26425,
67,
70,
834,
67,
701,
464,
14280,
67,
1918,
67,
4949,
67,
4890,
14280,
12,
2890,
16,
2654,
1876,
1585,
464,
3641,
10409,
774,
9807,
4672,
3536,
1788,
15692,
3086,
326,
18208,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
26425,
67,
70,
834,
67,
701,
464,
14280,
67,
1918,
67,
4949,
67,
4890,
14280,
12,
2890,
16,
2654,
1876,
1585,
464,
3641,
10409,
774,
9807,
4672,
3536,
1788,
15692,
3086,
326,
18208,... |
[root, ext] = os.path.splitext(tail) contents = getFileContents(root, ext) | contents = getFileContents(fname) | def main(fname, label_prefix): [head, tail] = os.path.split(fname) if head: os.chdir(head) [root, ext] = os.path.splitext(tail) contents = getFileContents(root, ext) nonempty = stripComments(contents) lineinfo = addFileNameAndNumber(nonempty) return getSectionLabels(lineinfo, label_prefix=label_prefix) | fa630a3acb768d9c20019f1d326b9f75b9105d8a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6145/fa630a3acb768d9c20019f1d326b9f75b9105d8a/outline.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
12749,
16,
1433,
67,
3239,
4672,
306,
1978,
16,
5798,
65,
273,
1140,
18,
803,
18,
4939,
12,
12749,
13,
309,
910,
30,
1140,
18,
343,
1214,
12,
1978,
13,
225,
2939,
273,
6034... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12749,
16,
1433,
67,
3239,
4672,
306,
1978,
16,
5798,
65,
273,
1140,
18,
803,
18,
4939,
12,
12749,
13,
309,
910,
30,
1140,
18,
343,
1214,
12,
1978,
13,
225,
2939,
273,
6034... |
"""Bind balloon widget to another. One balloon widget may be bound to several widgets at the same time""" apply(self.tk.call, (self._w, 'bind', widget._w) + self._options(cnf, kw)) | """Bind balloon widget to another. One balloon widget may be bound to several widgets at the same time""" apply(self.tk.call, (self._w, 'bind', widget._w) + self._options(cnf, kw)) | def bind_widget(self, widget, cnf={}, **kw): | 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,
1993,
67,
6587,
12,
2890,
16,
3604,
16,
23118,
28793,
2826,
9987,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1993,
67,
6587,
12,
2890,
16,
3604,
16,
23118,
28793,
2826,
9987,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
v, maxlinelen=self.__maxheaderlen, | v, maxlinelen=self._maxheaderlen, | def _write_headers(self, msg): for h, v in msg.items(): print >> self._fp, '%s:' % h, if self.__maxheaderlen == 0: # Explicit no-wrapping print >> self._fp, v elif isinstance(v, Header): # Header instances know what to do print >> self._fp, v.encode() elif _is8bitstring(v): # If we have raw 8bit data in a byte string, we have no idea # what the encoding is. There is no safe way to split this # string. If it's ascii-subset, then we could do a normal # ascii split, but if it's multibyte then we could break the # string. There's no way to know so the least harm seems to # be to not split the string and risk it being too long. print >> self._fp, v else: # Header's got lots of smarts, so use it. print >> self._fp, Header( v, maxlinelen=self.__maxheaderlen, header_name=h, continuation_ws='\t').encode() # A blank line always separates headers from body print >> self._fp | bebf357b442a43365c8883f99b9f699444d75bc7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/bebf357b442a43365c8883f99b9f699444d75bc7/Generator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2626,
67,
2485,
12,
2890,
16,
1234,
4672,
364,
366,
16,
331,
316,
1234,
18,
3319,
13332,
1172,
1671,
365,
6315,
7944,
16,
1995,
87,
2497,
738,
366,
16,
309,
365,
16186,
1896,
3374... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2626,
67,
2485,
12,
2890,
16,
1234,
4672,
364,
366,
16,
331,
316,
1234,
18,
3319,
13332,
1172,
1671,
365,
6315,
7944,
16,
1995,
87,
2497,
738,
366,
16,
309,
365,
16186,
1896,
3374... |
self._stop = False | self._stop_server = False | def __init__(self, request_handler): threading.Thread.__init__(self) self._stop = False self.ready = threading.Event() request_handler.protocol_version = "HTTP/1.0" self.httpd = LoopbackHttpServer(('127.0.0.1', 0), request_handler) #print "Serving HTTP on %s port %s" % (self.httpd.server_name, # self.httpd.server_port) self.port = self.httpd.server_port | e1ed1f062cf525e582b87660d3b830ba4df0c704 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/e1ed1f062cf525e582b87660d3b830ba4df0c704/test_urllib2_localnet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
590,
67,
4176,
4672,
17254,
18,
3830,
16186,
2738,
972,
12,
2890,
13,
365,
6315,
5681,
67,
3567,
273,
1083,
365,
18,
1672,
273,
17254,
18,
1133,
1435,
59... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
590,
67,
4176,
4672,
17254,
18,
3830,
16186,
2738,
972,
12,
2890,
13,
365,
6315,
5681,
67,
3567,
273,
1083,
365,
18,
1672,
273,
17254,
18,
1133,
1435,
59... |
if not v.lower() in states: | if v.lower() not in self._boolean_states: | def getboolean(self, section, option): states = {'1': 1, 'yes': 1, 'true': 1, 'on': 1, '0': 0, 'no': 0, 'false': 0, 'off': 0} v = self.get(section, option) if not v.lower() in states: raise ValueError, 'Not a boolean: %s' % v return states[v.lower()] | 92ed640936b92665295d98ba8eae84e2874ec357 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/92ed640936b92665295d98ba8eae84e2874ec357/ConfigParser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
6494,
12,
2890,
16,
2442,
16,
1456,
4672,
5493,
273,
13666,
21,
4278,
404,
16,
296,
9707,
4278,
404,
16,
296,
3767,
4278,
404,
16,
296,
265,
4278,
404,
16,
296,
20,
4278,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
6494,
12,
2890,
16,
2442,
16,
1456,
4672,
5493,
273,
13666,
21,
4278,
404,
16,
296,
9707,
4278,
404,
16,
296,
3767,
4278,
404,
16,
296,
265,
4278,
404,
16,
296,
20,
4278,
374,
1... |
if int(val) > 0: | if val == "Yes" or val == "yes" or val == "1": | def prep_faildom_panel(self, faildom): self.current_faildom = faildom if self.current_faildom != None: self.faildom_name_label.set_markup("<span><b>" + cgi.escape(faildom.getName()) + "</b></span>") | 390bbc4989bb649bc8c792fc37abeace25a5835a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3879/390bbc4989bb649bc8c792fc37abeace25a5835a/FaildomController.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13237,
67,
507,
545,
362,
67,
13916,
12,
2890,
16,
11087,
545,
362,
4672,
365,
18,
2972,
67,
507,
545,
362,
273,
11087,
545,
362,
309,
365,
18,
2972,
67,
507,
545,
362,
480,
599,
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,
13237,
67,
507,
545,
362,
67,
13916,
12,
2890,
16,
11087,
545,
362,
4672,
365,
18,
2972,
67,
507,
545,
362,
273,
11087,
545,
362,
309,
365,
18,
2972,
67,
507,
545,
362,
480,
599,
30,... |
headingText = findHeading(text) newHeadingText = convertHeading(headingText) text = heading.sub(newHeadingText, text) | def processFile(fileName): print fileName f = open(fileName) text = f.read() f.close() headingText = findHeading(text) newHeadingText = convertHeading(headingText) text = heading.sub(newHeadingText, text) text = convertBody(text) if fileName == str(sys.argv[1]) + '/aindex.html': text = convertAIndex(text) if fileName == str(sys.argv[1]) + '/index.html': text = convertIndex(text, str(sys.argv[2])) f = open(fileName, 'w+') f.write(text) f.close() | d5a8b3ed8a73c01dabe549211dd2f52c0d2cde00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12582/d5a8b3ed8a73c01dabe549211dd2f52c0d2cde00/postprocessing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
812,
12,
17812,
4672,
1172,
3968,
284,
273,
1696,
12,
17812,
13,
977,
273,
284,
18,
896,
1435,
284,
18,
4412,
1435,
225,
977,
273,
1765,
2250,
12,
955,
13,
309,
3968,
422,
609,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
812,
12,
17812,
4672,
1172,
3968,
284,
273,
1696,
12,
17812,
13,
977,
273,
284,
18,
896,
1435,
284,
18,
4412,
1435,
225,
977,
273,
1765,
2250,
12,
955,
13,
309,
3968,
422,
609,
... | |
if __name__=="__main__": | if __name__ == "__main__": | def _test(): XMLReader() IncrementalParser() Locator() AttributesImpl() | 8038369b720358a74f44b3ceb5290fab530e6a7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/8038369b720358a74f44b3ceb5290fab530e6a7b/xmlreader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3813,
13332,
3167,
2514,
1435,
17883,
287,
2678,
1435,
2851,
639,
1435,
9055,
2828,
1435,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3813,
13332,
3167,
2514,
1435,
17883,
287,
2678,
1435,
2851,
639,
1435,
9055,
2828,
1435,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
message = message[:107] + ' M3U: ' + self.m3u_tinyurl | message = message[:107] + ' M3U : ' + self.m3u_tinyurl | def run(self): while True: self.q.get(1) self.next_media = 0 self.media = self.get_next_media() self.counter += 1 | a79f801564005a521166c0aa9af56c21c88a4050 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12047/a79f801564005a521166c0aa9af56c21c88a4050/station.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
1323,
1053,
30,
365,
18,
85,
18,
588,
12,
21,
13,
365,
18,
4285,
67,
5829,
273,
374,
365,
18,
5829,
273,
365,
18,
588,
67,
4285,
67,
5829,
1435,
365,
18,
7476... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1086,
12,
2890,
4672,
1323,
1053,
30,
365,
18,
85,
18,
588,
12,
21,
13,
365,
18,
4285,
67,
5829,
273,
374,
365,
18,
5829,
273,
365,
18,
588,
67,
4285,
67,
5829,
1435,
365,
18,
7476... |
syslog('mischief', 'Unsubscribe attempt of non-member w/ private rosters: %s', user) add_error_message( doc, _('The confirmation email has been sent.'), tag='') | if mlist.private_roster == 0: doc.addError(_('No such member: %(safeuser)s.')) else: syslog('mischief', 'Unsub attempt of non-member w/ private rosters: %s', user) doc.addError(_('The confirmation email has been sent.'), tag='') | def main(): doc = Document() doc.set_language(mm_cfg.DEFAULT_SERVER_LANGUAGE) parts = Utils.GetPathPieces() lenparts = parts and len(parts) if not parts or lenparts < 1: title = _('CGI script error') doc.SetTitle(title) doc.AddItem(Header(2, title)) add_error_message(doc, _('Invalid options to CGI script.')) doc.AddItem('<hr>') doc.AddItem(MailmanLogo()) print doc.Format() return # get the list and user's name listname = parts[0].lower() # open list try: mlist = MailList.MailList(listname, lock=0) except Errors.MMListError, e: # Avoid cross-site scripting attacks safelistname = cgi.escape(listname) title = _('CGI script error') doc.SetTitle(title) doc.AddItem(Header(2, title)) add_error_message(doc, _('No such list <em>%(safelistname)s</em>')) doc.AddItem('<hr>') doc.AddItem(MailmanLogo()) print doc.Format() syslog('error', 'No such list "%s": %s\n', listname, e) return # The total contents of the user's response cgidata = cgi.FieldStorage(keep_blank_values=1) # Set the language for the page. If we're coming from the listinfo cgi, # we might have a 'language' key in the cgi data. That was an explicit # preference to view the page in, so we should honor that here. If that's # not available, use the list's default language. language = cgidata.getvalue('language', mlist.preferred_language) i18n.set_language(language) doc.set_language(language) if lenparts < 2: user = cgidata.getvalue('email') if not user: loginpage(mlist, doc, None, cgidata) print doc.Format() return else: user = Utils.LCDomain(Utils.UnobscureEmail(SLASH.join(parts[1:]))) # Sanity check the user, but be careful about leaking membership # information when we're using private rosters. if not mlist.isMember(user) and mlist.private_roster == 0: # Avoid cross-site scripting attacks safeuser = cgi.escape(user) add_error_message(doc, _('No such member: %(safeuser)s.')) loginpage(mlist, doc, None, cgidata) print doc.Format() return # Find the case preserved email address (the one the user subscribed with) lcuser = user.lower() try: cpuser = mlist.getMemberCPAddress(lcuser) except Errors.NotAMemberError: # This happens if the user isn't a member but we've got private rosters cpuser = None if lcuser == cpuser: cpuser = None # And now we know the user making the request, so set things up to for the # user's stored preferred language, overridden by any form settings for # their new language preference. userlang = cgidata.getvalue('language', mlist.getMemberLanguage(user)) doc.set_language(userlang) i18n.set_language(userlang) # See if this is VARHELP on topics. varhelp = None if cgidata.has_key('VARHELP'): varhelp = cgidata['VARHELP'].value elif os.environ.get('QUERY_STRING'): # POST methods, even if their actions have a query string, don't get # put into FieldStorage's keys :-( qs = cgi.parse_qs(os.environ['QUERY_STRING']).get('VARHELP') if qs and type(qs) == types.ListType: varhelp = qs[0] if varhelp: topic_details(mlist, doc, user, cpuser, userlang, varhelp) return # Are we processing an unsubscription request from the login screen? if cgidata.has_key('login-unsub'): # Because they can't supply a password for unsubscribing, we'll need # to do the confirmation dance. if mlist.isMember(user): mlist.ConfirmUnsubscription(user, userlang) else: syslog('mischief', 'Unsubscribe attempt of non-member w/ private rosters: %s', user) add_error_message( doc, _('The confirmation email has been sent.'), tag='') loginpage(mlist, doc, user, cgidata) print doc.Format() return # Are we processing a password reminder from the login screen? if cgidata.has_key('login-remind'): if mlist.isMember(user): mlist.MailUserPassword(user) else: syslog('mischief', 'Reminder attempt of non-member w/ private rosters: %s', user) add_error_message( doc, _('A reminder of your password has been emailed to you.'), tag='') loginpage(mlist, doc, user, cgidata) print doc.Format() return # Authenticate, possibly using the password supplied in the login page password = cgidata.getvalue('password', '').strip() if not mlist.WebAuthenticate((mm_cfg.AuthUser, mm_cfg.AuthListAdmin, mm_cfg.AuthSiteAdmin), password, user): # Not authenticated, so throw up the login page again. If they tried # to authenticate via cgi (instead of cookie), then print an error # message. if cgidata.has_key('password'): add_error_message(doc, _('Authentication failed.')) # So as not to allow membership leakage, prompt for the email # address and the password here. if mlist.private_roster <> 0: syslog('mischief', 'Login failure with private rosters: %s', user) user = None loginpage(mlist, doc, user, cgidata) print doc.Format() return # From here on out, the user is okay to view and modify their membership # options. The first set of checks does not require the list to be # locked. if cgidata.has_key('logout'): print mlist.ZapCookie(mm_cfg.AuthUser, user) loginpage(mlist, doc, user, cgidata) print doc.Format() return if cgidata.has_key('emailpw'): mlist.MailUserPassword(user) options_page( mlist, doc, user, cpuser, userlang, _('A reminder of your password has been emailed to you.')) print doc.Format() return if cgidata.has_key('othersubs'): hostname = mlist.host_name title = _('List subscriptions for %(user)s on %(hostname)s') doc.SetTitle(title) doc.AddItem(Header(2, title)) doc.AddItem(_('''Click on a link to visit your options page for the requested mailing list.''')) # Troll through all the mailing lists that match host_name and see if # the user is a member. If so, add it to the list. onlists = [] for gmlist in lists_of_member(mlist, user) + [mlist]: url = gmlist.GetOptionsURL(user) link = Link(url, gmlist.real_name) onlists.append((gmlist.real_name, link)) onlists.sort() items = OrderedList(*[link for name, link in onlists]) doc.AddItem(items) print doc.Format() return if cgidata.has_key('change-of-address'): # We could be changing the user's full name, email address, or both membername = cgidata.getvalue('fullname') newaddr = cgidata.getvalue('new-address') confirmaddr = cgidata.getvalue('confirm-address') oldname = mlist.getMemberName(user) set_address = set_membername = 0 # We will change the member's name under the following conditions: # - membername has a value # - membername has no value, but they /used/ to have a membername if membername and membername <> oldname: # Setting it to a new value set_membername = 1 if not membername and oldname: # Unsetting it set_membername = 1 # We will change the user's address if both newaddr and confirmaddr # are non-blank, have the same value, and aren't the currently # subscribed email address (when compared case-sensitively). If both # are blank, but membername is set, we ignore it, otherwise we print # an error. if newaddr and confirmaddr: if newaddr <> confirmaddr: options_page(mlist, doc, user, cpuser, userlang, _('Addresses did not match!')) print doc.Format() return if newaddr == user: options_page(mlist, doc, user, cpuser, userlang, _('You are already using that email address')) print doc.Format() return set_address = 1 elif (newaddr or confirmaddr) and not set_membername: options_page(mlist, doc, user, cpuser, userlang, _('Addresses may not be blank')) print doc.Format() return # See if the user wants to change their email address globally globally = cgidata.getvalue('changeaddr-globally') # Standard sigterm handler. def sigterm_handler(signum, frame, mlist=mlist): mlist.Unlock() sys.exit(0) signal.signal(signal.SIGTERM, sigterm_handler) msg = '' if set_address: # Register the pending change after the list is locked msg = _('A confirmation message has been sent to %(newaddr)s') mlist.Lock() try: try: mlist.ChangeMemberAddress(user, newaddr, globally) mlist.Save() finally: mlist.Unlock() except Errors.MMBadEmailError: msg = _('Bad email address provided') except Errors.MMHostileAddress: msg = _('Illegal email address provided') except Errors.MMAlreadyAMember: msg = _('%(newaddr)s is already a member of the list.') if set_membername: mlist.Lock() try: mlist.ChangeMemberName(user, membername, globally) mlist.Save() finally: mlist.Unlock() msg += _('Member name successfully changed.') options_page(mlist, doc, user, cpuser, userlang, msg) print doc.Format() return if cgidata.has_key('changepw'): newpw = cgidata.getvalue('newpw') confirmpw = cgidata.getvalue('confpw') if not newpw or not confirmpw: options_page(mlist, doc, user, cpuser, userlang, _('Passwords may not be blank')) print doc.Format() return if newpw <> confirmpw: options_page(mlist, doc, user, cpuser, userlang, _('Passwords did not match!')) print doc.Format() return # See if the user wants to change their passwords globally mlists = [mlist] if cgidata.getvalue('pw-globally'): mlists.extend(lists_of_member(mlist, user)) for gmlist in mlists: change_password(gmlist, user, newpw, confirmpw) # Regenerate the cookie so a re-authorization isn't necessary print mlist.MakeCookie(mm_cfg.AuthUser, user) options_page(mlist, doc, user, cpuser, userlang, _('Password successfully changed.')) print doc.Format() return if cgidata.has_key('unsub'): # Was the confirming check box turned on? if not cgidata.getvalue('unsubconfirm'): options_page( mlist, doc, user, cpuser, userlang, _('''You must confirm your unsubscription request by turning on the checkbox below the <em>Unsubscribe</em> button. You have not been unsubscribed!''')) print doc.Format() return # Standard signal handler def sigterm_handler(signum, frame, mlist=mlist): mlist.Unlock() sys.exit(0) # Okay, zap them. Leave them sitting at the list's listinfo page. We # must own the list lock, and we want to make sure the user (BAW: and # list admin?) is informed of the removal. signal.signal(signal.SIGTERM, sigterm_handler) mlist.Lock() needapproval = 0 try: try: mlist.DeleteMember( user, _('via the member options page'), userack=1) except Errors.MMNeedApproval: needapproval = 1 mlist.Save() finally: mlist.Unlock() # Now throw up some results page, with appropriate links. We can't # drop them back into their options page, because that's gone now! fqdn_listname = mlist.GetListEmail() owneraddr = mlist.GetOwnerEmail() url = mlist.GetScriptURL('listinfo', absolute=1) title = _('Unsubscription results') doc.SetTitle(title) doc.AddItem(Header(2, title)) if needapproval: doc.AddItem(_("""Your unsubscription request has been received and forwarded on to the list moderators for approval. You will receive notification once the list moderators have made their decision.""")) else: doc.AddItem(_("""You have been successfully unsubscribed from the mailing list %(fqdn_listname)s. If you were receiving digest deliveries you may get one more digest. If you have any questions about your unsubscription, please contact the list owners at %(owneraddr)s.""")) doc.AddItem(mlist.GetMailmanFooter()) print doc.Format() return if cgidata.has_key('options-submit'): # Digest action flags digestwarn = 0 cantdigest = 0 mustdigest = 0 newvals = [] # First figure out which options have changed. The item names come # from FormatOptionButton() in HTMLFormatter.py for item, flag in (('digest', mm_cfg.Digests), ('mime', mm_cfg.DisableMime), ('dontreceive', mm_cfg.DontReceiveOwnPosts), ('ackposts', mm_cfg.AcknowledgePosts), ('disablemail', mm_cfg.DisableDelivery), ('conceal', mm_cfg.ConcealSubscription), ('remind', mm_cfg.SuppressPasswordReminder), ('rcvtopic', mm_cfg.ReceiveNonmatchingTopics), ): try: newval = int(cgidata.getvalue(item)) except (TypeError, ValueError): newval = None # Skip this option if there was a problem or it wasn't changed. # Note that delivery status is handled separate from the options # flags. if newval is None: continue elif flag == mm_cfg.DisableDelivery: status = mlist.getDeliveryStatus(user) # Here, newval == 0 means enable, newval == 1 means disable if not newval and status <> MemberAdaptor.ENABLED: newval = MemberAdaptor.ENABLED elif newval and status == MemberAdaptor.ENABLED: newval = MemberAdaptor.BYUSER else: continue elif newval == mlist.getMemberOption(user, flag): continue newvals.append((flag, newval)) # The user language is handled a little differently if userlang not in mlist.GetAvailableLanguages(): newvals.append((SETLANGUAGE, mlist.preferred_language)) else: newvals.append((SETLANGUAGE, userlang)) # Process user selected topics, but don't make the changes to the # MailList object; we must do that down below when the list is # locked. topicnames = cgidata.getvalue('usertopic') if topicnames: # Some topics were selected. topicnames can actually be a string # or a list of strings depending on whether more than one topic # was selected or not. if not isinstance(topicnames, ListType): # Assume it was a bare string, so listify it topicnames = [topicnames] # unquote the topic names topicnames = [urllib.unquote_plus(n) for n in topicnames] # The standard sigterm handler (see above) def sigterm_handler(signum, frame, mlist=mlist): mlist.Unlock() sys.exit(0) # Now, lock the list and perform the changes mlist.Lock() try: signal.signal(signal.SIGTERM, sigterm_handler) # `values' is a tuple of flags and the web values for flag, newval in newvals: # Handle language settings differently if flag == SETLANGUAGE: mlist.setMemberLanguage(user, newval) # Handle delivery status separately elif flag == mm_cfg.DisableDelivery: mlist.setDeliveryStatus(user, newval) else: mlist.setMemberOption(user, flag, newval) # Set the topics information. mlist.setMemberTopics(user, topicnames) mlist.Save() finally: mlist.Unlock() # The enable/disable option and the password remind option may have # their global flags sets. global_enable = None if cgidata.getvalue('deliver-globally'): # Yes, this is inefficient, but the list is so small it shouldn't # make much of a difference. for flag, newval in newvals: if flag == mm_cfg.DisableDelivery: global_enable = newval break global_remind = None if cgidata.getvalue('remind-globally'): for flag, newval in newvals: if flag == mm_cfg.SuppressPasswordReminder: global_remind = newval break if global_enable is not None or global_remind is not None: for gmlist in lists_of_member(mlist, user): global_options(gmlist, user, global_enable, global_remind) # Now print the results if cantdigest: msg = _('''The list administrator has disabled digest delivery for this list, so your delivery option has not been set. However your other options have been set successfully.''') elif mustdigest: msg = _('''The list administrator has disabled non-digest delivery for this list, so your delivery option has not been set. However your other options have been set successfully.''') else: msg = _('You have successfully set your options.') if digestwarn: msg += _('You may get one last digest.') options_page(mlist, doc, user, cpuser, userlang, msg) print doc.Format() return options_page(mlist, doc, user, cpuser, userlang) print doc.Format() | 1b0a7186ef948b504ed35356bdee74957c65566d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/1b0a7186ef948b504ed35356bdee74957c65566d/options.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
997,
273,
4319,
1435,
997,
18,
542,
67,
4923,
12,
7020,
67,
7066,
18,
5280,
67,
4370,
67,
15547,
13,
225,
2140,
273,
6091,
18,
967,
743,
16539,
8610,
1435,
562,
6019,
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,
2774,
13332,
997,
273,
4319,
1435,
997,
18,
542,
67,
4923,
12,
7020,
67,
7066,
18,
5280,
67,
4370,
67,
15547,
13,
225,
2140,
273,
6091,
18,
967,
743,
16539,
8610,
1435,
562,
6019,
273,... |
if csDisabledFlag: Script.disableCS() | def usage(): Script.showHelp() DIRAC.exit( 2 ) | c3496dcd0891746d04bc4c72309b10c3fd9f2de0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/c3496dcd0891746d04bc4c72309b10c3fd9f2de0/dirac-configure.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
7739,
18,
4500,
6696,
1435,
18544,
2226,
18,
8593,
12,
576,
262,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
7739,
18,
4500,
6696,
1435,
18544,
2226,
18,
8593,
12,
576,
262,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
chandlerDir = os.path.join(workingDir, "chandler") | chandlerDir = os.path.join(workingDir, 'chandler') logDir = os.path.join(chandlerDir, 'test_profile') chandlerLog = os.path.join(logDir, 'chandler.log') FuncTestLog = os.path.join(logDir, 'FunctionalTestSuite.log') | def doFunctionalTests(releaseMode, workingDir, log): chandlerDir = os.path.join(workingDir, "chandler") if buildenv['os'] == 'win': runChandler = 'RunChandler.bat' else: runChandler = 'RunChandler' if releaseMode == 'debug': runChandler = os.path.join(chandlerDir, 'debug', runChandler) elif releaseMode == 'release': runChandler = os.path.join(chandlerDir, 'release', runChandler) os.chdir(chandlerDir) try: print "Running %s Functional Tests" % releaseMode log.write(separator) log.write("Running %s Functional Tests ...\n" % releaseMode) try: os.remove('chandler.log') except OSError: pass args = [runChandler, '--create', '--nocatch', '--profileDir=.', '--parcelPath=tools/QATestScripts/DataFiles', '--scriptTimeout=600', '--scriptFile=tools/cats/Functional/FunctionalTestSuite.py', '--chandlerTestLogfile=FunctionalTestSuite.log'] #new framework defaults to no log without this outputList = hardhatutil.executeCommandReturnOutput(args) # Hack: find if any line contains '#TINDERBOX# Status = FAILED' and # if so raise the exception to signal test failure for line in outputList: if line.find('#TINDERBOX# Status = FAIL') >= 0 or \ line.find('#TINDERBOX# Status = UNCHECKED') >= 0: raise hardhatutil.ExternalCommandErrorWithOutputList([0, outputList]) hardhatutil.dumpOutputList(outputList, log) except hardhatutil.ExternalCommandErrorWithOutputList, e: print "functional tests failed", e log.write("***Error during functional tests***\n") log.write("Test log:\n") hardhatutil.dumpOutputList(e.outputList, log) log.write("exit code=%s\n" % e.args) log.write("NOTE: If the tests themselves passed but the exit code\n") log.write(" reports failure, it means a shutdown problem.\n") log.write("chandler.log:\n") try: CopyLog('chandler.log', log) except: pass log.write(separator) log.write("FunctionalTestSuite.log:\n") try: CopyLog('FunctionalTestSuite.log', log) except: pass log.write(separator) forceBuildNextCycle(log, workingDir) return "test_failed" except Exception, e: print "functional tests failed", e log.write("***Error during functional tests***\n") log.write("Exception:\n") log.write(str(e) + "\n") forceBuildNextCycle(log, workingDir) return "test_failed" else: log.write("Functional tests exit code=0\n") return "success" | 78f649aa26e0440cc322968217defb741c25dc9f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/78f649aa26e0440cc322968217defb741c25dc9f/newchandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
2083,
287,
14650,
12,
9340,
2309,
16,
5960,
1621,
16,
613,
4672,
462,
464,
749,
1621,
273,
1140,
18,
803,
18,
5701,
12,
20478,
1621,
16,
225,
296,
343,
464,
749,
6134,
31101,
1377... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2083,
287,
14650,
12,
9340,
2309,
16,
5960,
1621,
16,
613,
4672,
462,
464,
749,
1621,
273,
1140,
18,
803,
18,
5701,
12,
20478,
1621,
16,
225,
296,
343,
464,
749,
6134,
31101,
1377... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.