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 |
|---|---|---|---|---|---|---|
self.assertEqual(len(w.warnings), 1) self.assertWarning(None, w, "Overriding __cmp__ blocks inheritance of __hash__ in 3.x") | self.assertEqual(len(w.warnings), 0) | def __cmp__(self, other): pass | ec27d91741d93f3307208bb3faff590446eac0b7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/ec27d91741d93f3307208bb3faff590446eac0b7/test_py3kwarn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9625,
972,
12,
2890,
16,
1308,
4672,
1342,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9625,
972,
12,
2890,
16,
1308,
4672,
1342,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
self.assertEquals({'status': 'closed'}, closed['qry_args'], 'qry_args incorrect') | self.assertEquals({'status': 'closed', 'group': 'resolution'}, closed['qry_args'], 'qry_args incorrect') | def test_closed_interval(self): closed = self.stats.intervals[0] self.assertEquals('closed', closed['title'], 'closed title incorrect') self.assertEquals('closed', closed['css_class'], 'closed class incorrect') self.assertEquals(True, closed['countsToProg'], 'closed not count to prog') self.assertEquals({'status': 'closed'}, closed['qry_args'], 'qry_args incorrect') self.assertEquals(1, closed['count'], 'closed count incorrect') self.assertEquals(33, closed['percent'], 'closed percent incorrect') | 9cad2d7cbb5a087d0a00f643390ab5eb3f3bc4ae /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9317/9cad2d7cbb5a087d0a00f643390ab5eb3f3bc4ae/roadmap.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
12204,
67,
6624,
12,
2890,
4672,
4375,
273,
365,
18,
5296,
18,
19812,
63,
20,
65,
365,
18,
11231,
8867,
2668,
12204,
2187,
4375,
3292,
2649,
17337,
296,
12204,
2077,
11332,
613... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12204,
67,
6624,
12,
2890,
4672,
4375,
273,
365,
18,
5296,
18,
19812,
63,
20,
65,
365,
18,
11231,
8867,
2668,
12204,
2187,
4375,
3292,
2649,
17337,
296,
12204,
2077,
11332,
613... |
if next_level > item.level: | if next_level is None: context['css_class'] += ' last' elif next_level > item.level: | def get_next_item(item, remaining, prev_level=-1, extra_context=None): context.push() | 743625eff23ed497bc476be757fc2f630d0a2f14 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10899/743625eff23ed497bc476be757fc2f630d0a2f14/incunafein_tags.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4285,
67,
1726,
12,
1726,
16,
4463,
16,
2807,
67,
2815,
29711,
21,
16,
2870,
67,
2472,
33,
7036,
4672,
819,
18,
6206,
1435,
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,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4285,
67,
1726,
12,
1726,
16,
4463,
16,
2807,
67,
2815,
29711,
21,
16,
2870,
67,
2472,
33,
7036,
4672,
819,
18,
6206,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
u = str(self.__unit) | u = repr(self.__unit) | def _repr_(self): cr = self._cr() if len(self) == 0: return str(self.__unit) try: atomic = ((isinstance(self[0][0], (int, long)) or \ self.base_ring().is_atomic_repr())) except AttributeError: atomic = False s = '' mul = ' * ' if cr: mul += '\n' for i in range(len(self)): t = str(self[i][0]) n = self[i][1] if (n>1 or len(self) > 1 or self.__unit != 1) and not atomic and ('+' in t or '-' in t or ' ' in t): t = '(%s)'%t if n != 1: t += '^%s'%n s += t if i < len(self)-1: s += mul if self.__unit != 1: if atomic: u = str(self.__unit) else: u = '(%s)'%self.__unit s = u + mul + s return s | 69d1b9326bfec0216fc83a96fec3511e3703230c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/69d1b9326bfec0216fc83a96fec3511e3703230c/factorization.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
12715,
67,
12,
2890,
4672,
4422,
273,
365,
6315,
3353,
1435,
309,
562,
12,
2890,
13,
422,
374,
30,
327,
609,
12,
2890,
16186,
4873,
13,
775,
30,
7960,
273,
14015,
291,
1336,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
12715,
67,
12,
2890,
4672,
4422,
273,
365,
6315,
3353,
1435,
309,
562,
12,
2890,
13,
422,
374,
30,
327,
609,
12,
2890,
16186,
4873,
13,
775,
30,
7960,
273,
14015,
291,
1336,
12,
... |
container = result | def run(self): try: ids = self._leakDetector.getContainerIds() for id in ids: yield None try: for result in self._leakDetector.getContainerByIdGen(id): yield None container = result except: # reference is invalid, remove it self._leakDetector.removeContainerById(id) except Exception, e: print 'PruneContainerRefs job caught exception: %s' % e if __dev__: #raise e pass yield Job.Done | d9560fa19bec29d4ea08e0b58cd1b7384659f9ff /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7242/d9560fa19bec29d4ea08e0b58cd1b7384659f9ff/ContainerLeakDetector.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
775,
30,
3258,
273,
365,
6315,
298,
581,
12594,
18,
588,
2170,
2673,
1435,
364,
612,
316,
3258,
30,
2824,
599,
775,
30,
364,
563,
316,
365,
6315,
298,
581,
12594,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
775,
30,
3258,
273,
365,
6315,
298,
581,
12594,
18,
588,
2170,
2673,
1435,
364,
612,
316,
3258,
30,
2824,
599,
775,
30,
364,
563,
316,
365,
6315,
298,
581,
12594,... | |
def self.validate_hook(self, module): | def validate_hook(self, module): | def self.validate_hook(self, module): if self.debug_output >= DEBUG_ALL: print "Validating execution hooks: %s" % True return True | 75dbf626c3b697e568752995866893479a555cae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/635/75dbf626c3b697e568752995866893479a555cae/moduleloader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
67,
4476,
12,
2890,
16,
1605,
4672,
309,
365,
18,
4148,
67,
2844,
1545,
6369,
67,
4685,
30,
1172,
315,
31496,
4588,
9153,
30,
738,
87,
6,
738,
1053,
327,
1053,
2,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
67,
4476,
12,
2890,
16,
1605,
4672,
309,
365,
18,
4148,
67,
2844,
1545,
6369,
67,
4685,
30,
1172,
315,
31496,
4588,
9153,
30,
738,
87,
6,
738,
1053,
327,
1053,
2,
-100,
-100,
-... |
tests.remove("test_file") tests.insert(tests.index("test_optparse"), "test_file") | def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False, exclude=False, single=False, randomize=False, fromfile=None, findleaks=False, use_resources=None, trace=False, coverdir='coverage', runleaks=False, huntrleaks=False, verbose2=False): """Execute a test suite. This also parses command-line options and modifies its behavior accordingly. tests -- a list of strings containing test names (optional) testdir -- the directory in which to look for tests (optional) Users other than the Python test suite will certainly want to specify testdir; if it's omitted, the directory containing the Python test suite is searched for. If the tests argument is omitted, the tests listed on the command-line will be used. If that's empty, too, then all *.py files beginning with test_ will be used. The other default arguments (verbose, quiet, generate, exclude, single, randomize, findleaks, use_resources, trace and coverdir) allow programmers calling main() directly to set the values that would normally be set by flags on the command line. """ test_support.record_original_stdout(sys.stdout) try: opts, args = getopt.getopt(sys.argv[1:], 'hvgqxsrf:lu:t:TD:NLR:wM:', ['help', 'verbose', 'quiet', 'generate', 'exclude', 'single', 'random', 'fromfile', 'findleaks', 'use=', 'threshold=', 'trace', 'coverdir=', 'nocoverdir', 'runleaks', 'huntrleaks=', 'verbose2', 'memlimit=', ]) except getopt.error, msg: usage(2, msg) # Defaults if use_resources is None: use_resources = [] for o, a in opts: if o in ('-h', '--help'): usage(0) elif o in ('-v', '--verbose'): verbose += 1 elif o in ('-w', '--verbose2'): verbose2 = True elif o in ('-q', '--quiet'): quiet = True; verbose = 0 elif o in ('-g', '--generate'): generate = True elif o in ('-x', '--exclude'): exclude = True elif o in ('-s', '--single'): single = True elif o in ('-r', '--randomize'): randomize = True elif o in ('-f', '--fromfile'): fromfile = a elif o in ('-l', '--findleaks'): findleaks = True elif o in ('-L', '--runleaks'): runleaks = True elif o in ('-t', '--threshold'): import gc gc.set_threshold(int(a)) elif o in ('-T', '--coverage'): trace = True elif o in ('-D', '--coverdir'): coverdir = os.path.join(os.getcwd(), a) elif o in ('-N', '--nocoverdir'): coverdir = None elif o in ('-R', '--huntrleaks'): huntrleaks = a.split(':') if len(huntrleaks) != 3: print a, huntrleaks usage(2, '-R takes three colon-separated arguments') if len(huntrleaks[0]) == 0: huntrleaks[0] = 5 else: huntrleaks[0] = int(huntrleaks[0]) if len(huntrleaks[1]) == 0: huntrleaks[1] = 4 else: huntrleaks[1] = int(huntrleaks[1]) if len(huntrleaks[2]) == 0: huntrleaks[2] = "reflog.txt" elif o in ('-M', '--memlimit'): test_support.set_memlimit(a) elif o in ('-u', '--use'): u = [x.lower() for x in a.split(',')] for r in u: if r == 'all': use_resources[:] = RESOURCE_NAMES continue remove = False if r[0] == '-': remove = True r = r[1:] if r not in RESOURCE_NAMES: usage(1, 'Invalid -u/--use option: ' + a) if remove: if r in use_resources: use_resources.remove(r) elif r not in use_resources: use_resources.append(r) if generate and verbose: usage(2, "-g and -v don't go together!") if single and fromfile: usage(2, "-s and -f don't go together!") good = [] bad = [] skipped = [] resource_denieds = [] if findleaks: try: import gc except ImportError: print 'No GC available, disabling findleaks.' findleaks = False else: # Uncomment the line below to report garbage that is not # freeable by reference counting alone. By default only # garbage that is not collectable by the GC is reported. #gc.set_debug(gc.DEBUG_SAVEALL) found_garbage = [] if single: from tempfile import gettempdir filename = os.path.join(gettempdir(), 'pynexttest') try: fp = open(filename, 'r') next = fp.read().strip() tests = [next] fp.close() except IOError: pass if fromfile: tests = [] fp = open(fromfile) for line in fp: guts = line.split() # assuming no test has whitespace in its name if guts and not guts[0].startswith('#'): tests.extend(guts) fp.close() # Strip .py extensions. if args: args = map(removepy, args) if tests: tests = map(removepy, tests) stdtests = STDTESTS[:] nottests = NOTTESTS[:] if exclude: for arg in args: if arg in stdtests: stdtests.remove(arg) nottests[:0] = args args = [] tests = tests or args or findtests(testdir, stdtests, nottests) if single: tests = tests[:1] if randomize: random.shuffle(tests) # XXX Temporary hack to force test_optparse to run immediately # XXX after test_file. This should go away as soon as we fix # XXX whatever it is that's causing that to fail. tests.remove("test_file") tests.insert(tests.index("test_optparse"), "test_file") if trace: import trace tracer = trace.Trace(ignoredirs=[sys.prefix, sys.exec_prefix], trace=False, count=True) test_support.verbose = verbose # Tell tests to be moderately quiet test_support.use_resources = use_resources save_modules = sys.modules.keys() for test in tests: if not quiet: print test sys.stdout.flush() if trace: # If we're tracing code coverage, then we don't exit with status # if on a false return value from main. tracer.runctx('runtest(test, generate, verbose, quiet, testdir)', globals=globals(), locals=vars()) else: try: ok = runtest(test, generate, verbose, quiet, testdir, huntrleaks) except KeyboardInterrupt: # print a newline separate from the ^C print break except: raise if ok > 0: good.append(test) elif ok == 0: bad.append(test) else: skipped.append(test) if ok == -2: resource_denieds.append(test) if findleaks: gc.collect() if gc.garbage: print "Warning: test created", len(gc.garbage), print "uncollectable object(s)." # move the uncollectable objects somewhere so we don't see # them again found_garbage.extend(gc.garbage) del gc.garbage[:] # Unload the newly imported modules (best effort finalization) for module in sys.modules.keys(): if module not in save_modules and module.startswith("test."): test_support.unload(module) # The lists won't be sorted if running with -r good.sort() bad.sort() skipped.sort() if good and not quiet: if not bad and not skipped and len(good) > 1: print "All", print count(len(good), "test"), "OK." if verbose: print "CAUTION: stdout isn't compared in verbose mode:" print "a test that passes in verbose mode may fail without it." if bad: print count(len(bad), "test"), "failed:" printlist(bad) if skipped and not quiet: print count(len(skipped), "test"), "skipped:" printlist(skipped) e = _ExpectedSkips() plat = sys.platform if e.isvalid(): surprise = set(skipped) - e.getexpected() - set(resource_denieds) if surprise: print count(len(surprise), "skip"), \ "unexpected on", plat + ":" printlist(surprise) else: print "Those skips are all expected on", plat + "." else: print "Ask someone to teach regrtest.py about which tests are" print "expected to get skipped on", plat + "." if verbose2 and bad: print "Re-running failed tests in verbose mode" for test in bad: print "Re-running test %r in verbose mode" % test sys.stdout.flush() try: test_support.verbose = 1 ok = runtest(test, generate, 1, quiet, testdir, huntrleaks) except KeyboardInterrupt: # print a newline separate from the ^C print break except: raise if single: alltests = findtests(testdir, stdtests, nottests) for i in range(len(alltests)): if tests[0] == alltests[i]: if i == len(alltests) - 1: os.unlink(filename) else: fp = open(filename, 'w') fp.write(alltests[i+1] + '\n') fp.close() break else: os.unlink(filename) if trace: r = tracer.results() r.write_results(show_missing=True, summary=True, coverdir=coverdir) if runleaks: os.system("leaks %d" % os.getpid()) sys.exit(len(bad) > 0) | b94ebb1c610f0c6347fd988a4740e747b006de56 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b94ebb1c610f0c6347fd988a4740e747b006de56/regrtest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
16341,
33,
7036,
16,
1842,
1214,
33,
7036,
16,
3988,
33,
20,
16,
10902,
33,
8381,
16,
2103,
33,
8381,
16,
4433,
33,
8381,
16,
2202,
33,
8381,
16,
2744,
554,
33,
8381,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
16341,
33,
7036,
16,
1842,
1214,
33,
7036,
16,
3988,
33,
20,
16,
10902,
33,
8381,
16,
2103,
33,
8381,
16,
4433,
33,
8381,
16,
2202,
33,
8381,
16,
2744,
554,
33,
8381,
16,
... | |
if string.find(style, txt) != -1: | if style.find(txt) != -1: | def findInStyles(self, txt, styles): for style in styles: if string.find(style, txt) != -1: return True return False | 1e19321bfb8d6ff348cd85bdad3a1a4c2f517fa0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12725/1e19321bfb8d6ff348cd85bdad3a1a4c2f517fa0/STCStyleEditor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
382,
9725,
12,
2890,
16,
6463,
16,
5687,
4672,
364,
2154,
316,
5687,
30,
309,
2154,
18,
4720,
12,
5830,
13,
480,
300,
21,
30,
327,
1053,
327,
1083,
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,
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,
1104,
382,
9725,
12,
2890,
16,
6463,
16,
5687,
4672,
364,
2154,
316,
5687,
30,
309,
2154,
18,
4720,
12,
5830,
13,
480,
300,
21,
30,
327,
1053,
327,
1083,
2,
-100,
-100,
-100,
-100,
-... |
imageviewer().cache(self) | viewer.cache(self) | def cache(self): """ caches (loads) the next image """ imageviewer().cache(self) | 0710989ab5e31436736f020e1e3d5ba0dfecca41 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/0710989ab5e31436736f020e1e3d5ba0dfecca41/imageitem.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1247,
12,
2890,
4672,
3536,
12535,
261,
17135,
13,
326,
1024,
1316,
3536,
1316,
25256,
7675,
2493,
12,
2890,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1247,
12,
2890,
4672,
3536,
12535,
261,
17135,
13,
326,
1024,
1316,
3536,
1316,
25256,
7675,
2493,
12,
2890,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if "pickle" in result: result.update(attrs_defaults[type_name]) if result["pickle"]: pickle = cPickle.loads(str(result["pickle"])) result.update(pickle) del result["pickle"] | if result["pickle"]: pickle = cPickle.loads(str(result["pickle"])) result.update(pickle) del result["pickle"] | def normalize_query_results(self, (query_info, results)): """ Takes a results tuple as returned from query() and converts to a list of dicts. Each result dict is given a "type" entry which corresponds to the type name of that object. This function also unpickles the pickle contained in the row, and creates a "parent" key that holds (parent type name, parent id). """ if len(results) == 0: return [] | 558097a03f36101ed3955cb593f3c2e895dbb2bf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11722/558097a03f36101ed3955cb593f3c2e895dbb2bf/db.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3883,
67,
2271,
67,
4717,
12,
2890,
16,
261,
2271,
67,
1376,
16,
1686,
3719,
30,
3536,
23004,
279,
1686,
3193,
487,
2106,
628,
843,
1435,
471,
7759,
358,
279,
666,
434,
15838,
18,
225,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3883,
67,
2271,
67,
4717,
12,
2890,
16,
261,
2271,
67,
1376,
16,
1686,
3719,
30,
3536,
23004,
279,
1686,
3193,
487,
2106,
628,
843,
1435,
471,
7759,
358,
279,
666,
434,
15838,
18,
225,... |
self.progress = current_status | self.progress = 1 - current_status | def tick_operation(self, op): """ Op handler for regular tick op """ print "Logging.tick" res=Message() | b4c3fdf21e7d1b3e24f6012c031162cabdd9b546 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12932/b4c3fdf21e7d1b3e24f6012c031162cabdd9b546/Logging.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4024,
67,
7624,
12,
2890,
16,
1061,
4672,
3536,
6066,
1838,
364,
6736,
4024,
1061,
3536,
1172,
315,
7735,
18,
6470,
6,
400,
33,
1079,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
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,
4024,
67,
7624,
12,
2890,
16,
1061,
4672,
3536,
6066,
1838,
364,
6736,
4024,
1061,
3536,
1172,
315,
7735,
18,
6470,
6,
400,
33,
1079,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
class Proxy (Object): | class Proxy (object): | def handle_close (self): self.close () while self.sql_defered: self.async_net_continue ('N.') | e15d558cd54fa2d57a860415973cbaf0f8c5da0f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2577/e15d558cd54fa2d57a860415973cbaf0f8c5da0f/ansqlite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
4412,
261,
2890,
4672,
365,
18,
4412,
1832,
1323,
365,
18,
4669,
67,
18974,
329,
30,
365,
18,
3810,
67,
2758,
67,
17143,
7707,
50,
1093,
13,
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,
1640,
67,
4412,
261,
2890,
4672,
365,
18,
4412,
1832,
1323,
365,
18,
4669,
67,
18974,
329,
30,
365,
18,
3810,
67,
2758,
67,
17143,
7707,
50,
1093,
13,
2,
-100,
-100,
-100,
-100,
-100,
... |
if self.olddb is not None: pd = QProgressDialog('', '', 0, 100, self) pd.setWindowModality(Qt.ApplicationModal) pd.setCancelButton(None) pd.setWindowTitle(_('Migrating database')) pd.show() number_of_books = db.migrate_old(self.olddb, pd) self.olddb.close() if number_of_books == 0: os.remove(self.olddb.dbpath) self.olddb = None prefs['library_path'] = self.library_path | prefs['library_path'] = self.library_path | def default_sync(checked): config.set('send_to_storage_card_by_default', bool(checked)) QObject.disconnect(self.action_sync, SIGNAL("triggered(bool)"), self.sync_to_main_memory) QObject.disconnect(self.action_sync, SIGNAL("triggered(bool)"), self.sync_to_card) QObject.connect(self.action_sync, SIGNAL("triggered(bool)"), self.sync_to_card if checked else self.sync_to_main_memory) | 6b1d2571c1cff06fae9a975bebc5cf7784553814 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9125/6b1d2571c1cff06fae9a975bebc5cf7784553814/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
805,
67,
8389,
12,
4532,
4672,
642,
18,
542,
2668,
4661,
67,
869,
67,
5697,
67,
3327,
67,
1637,
67,
1886,
2187,
1426,
12,
4532,
3719,
2238,
921,
18,
20177,
12,
2890,
18,
1128,
67,
83... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
805,
67,
8389,
12,
4532,
4672,
642,
18,
542,
2668,
4661,
67,
869,
67,
5697,
67,
3327,
67,
1637,
67,
1886,
2187,
1426,
12,
4532,
3719,
2238,
921,
18,
20177,
12,
2890,
18,
1128,
67,
83... |
/.../release/RunChandler --create --catch=tests --profileDir=test_profile --parcelPath=tools/cats/DataFiles --chandlerTests=TestAllDayEvent.py -F -D2 -M0 | /.../chandler --create --catch=tests --profileDir=test_profile --parcelPath=tools/cats/DataFiles --chandlerTests=TestAllDayEvent.py -F -D2 -M0 | def runFuncTest(options, test='FunctionalTestSuite.py'): """ Run functional test >>> options = parseOptions() >>> checkOptions(options) >>> options.dryrun = True >>> options.verbose = True >>> options.modes = ['release', 'debug'] >>> runFuncTest(options) /.../release/RunChandler... --create --catch=tests --profileDir=test_profile --parcelPath=tools/cats/DataFiles --scriptFile=tools/cats/Functional/FunctionalTestSuite.py -D2 -M0 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + /.../debug/RunChandler... --create --catch=tests --profileDir=test_profile --parcelPath=tools/cats/DataFiles --scriptFile=tools/cats/Functional/FunctionalTestSuite.py -D2 -M0 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + False >>> runFuncTest(options, 'TestAllDayEvent.py') /.../release/RunChandler --create --catch=tests --profileDir=test_profile --parcelPath=tools/cats/DataFiles --chandlerTests=TestAllDayEvent.py -D2 -M0 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + /.../debug/RunChandler --create --catch=tests --profileDir=test_profile --parcelPath=tools/cats/DataFiles --chandlerTests=TestAllDayEvent.py -D2 -M0 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + False >>> options.noStop = True >>> runFuncTest(options, 'TestAllDayEvent.py') /.../release/RunChandler --create --catch=tests --profileDir=test_profile --parcelPath=tools/cats/DataFiles --chandlerTests=TestAllDayEvent.py -F -D2 -M0 ... """ # $CHANDLERBIN/$mode/$RUN_CHANDLER --create --catch=tests $FORCE_CONT --profileDir="$PC_DIR" --parcelPath="$PP_DIR" --scriptFile="$TESTNAME" -D1 -M2 2>&1 | tee $TESTLOG failed = False for mode in options.modes: cmd = options.runchandler[mode][:] cmd += ['--create', '--catch=tests', '--profileDir=%s' % options.profileDir, '--parcelPath=%s' % options.parcelPath, ] if test == 'FunctionalTestSuite.py': cmd += ['--scriptFile=%s' % os.path.join('tools', 'cats', 'Functional', test)] timeout = 1200 else: cmd += ['--chandlerTests=%s' % test] timeout = 900 if options.noStop: cmd += ['-F'] if options.verbose or test != 'FunctionalTestSuite.py': cmd += ['-D2', '-M0'] elif not options.verbose: cmd += ['-D1', '-M2'] if options.params: cmd += [options.params] if options.verbose: log(' '.join(cmd)) if options.dryrun: result = 0 else: result = build_lib.runCommand(cmd, timeout=timeout) if result != 0: log('***Error exit code=%d' % result) failed = True failedTests.append(test) if not options.noStop: break log('- + ' * 15) return failed | 2268248f0e4728b63ca1842648cbad866d679472 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/2268248f0e4728b63ca1842648cbad866d679472/rt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
2622,
4709,
12,
2116,
16,
1842,
2218,
2083,
287,
4709,
13587,
18,
2074,
11,
4672,
3536,
1939,
18699,
1842,
225,
4080,
702,
273,
1109,
1320,
1435,
4080,
866,
1320,
12,
2116,
13,
408... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2622,
4709,
12,
2116,
16,
1842,
2218,
2083,
287,
4709,
13587,
18,
2074,
11,
4672,
3536,
1939,
18699,
1842,
225,
4080,
702,
273,
1109,
1320,
1435,
4080,
866,
1320,
12,
2116,
13,
408... |
if i.path and config["transfers"]["shownotification"] or config["transfers"]["afterfolder"]: | if i.path and (config["transfers"]["shownotificationperfolder"] or config["transfers"]["afterfolder"]): | def FileDownload(self, msg): """ A file download is in progress""" needupdate = 1 config = self.eventprocessor.config.sections for i in self.downloads: if i.conn != msg.conn: continue try: if i.transfertimer is not None: i.transfertimer.cancel() curtime = time.time() i.currentbytes = msg.file.tell() if i.lastbytes is None: i.lastbytes = i.currentbytes if i.starttime is None: i.starttime = curtime if i.lasttime is None: i.lasttime = curtime - 1 #i.status = "%s" %(str(i.currentbytes)) i.status = "Transferring" oldelapsed = i.timeelapsed i.timeelapsed = curtime - i.starttime if curtime > i.starttime and i.currentbytes > i.offset: i.speed = (i.currentbytes - i.lastbytes)/(curtime - i.lasttime)/1024 if i.speed <= 0.0: i.timeleft = "∞" else: i.timeleft = self.getTime((i.size - i.currentbytes)/i.speed/1024) i.lastbytes = i.currentbytes i.lasttime = curtime if i.size > i.currentbytes: if oldelapsed == i.timeelapsed: needupdate = 0 #i.status = str(i.currentbytes) i.status = "Transferring" else: msg.file.close() basename = self.CleanPath(self.encode(string.split(i.filename,'\\')[-1], i.user)) downloaddir = config["transfers"]["downloaddir"] if i.path and i.path[0] == '/': folder = self.CleanPath(i.path) else: folder = os.path.join(downloaddir, self.encode(i.path)) if not os.access(folder, os.F_OK): os.makedirs(folder) newname = self.getRenamed(os.path.join(folder, basename)) try: if win32: os.rename(msg.file.name, u"%s" % newname) else: os.rename(msg.file.name, newname) except OSError: try: f1 = open(msg.file.name, "rb") d = f1.read() if win32: f1 = open(u"%s" % newname, "wb") else: f1 = open(newname, "wb") f1.write(d) f1.close() os.remove(msg.file.name) except OSError: self.eventprocessor.logMessage(_("Couldn't move '%(tempfile)s' to '%(file)s'") % {'tempfile':self.decode(msg.file.name), 'file':self.decode(newname)}) i.status = "Finished" self.eventprocessor.logMessage(_("Download finished: %(file)s") % {'file':self.decode(newname)}) self.eventprocessor.logTransfer(_("Download finished: user %(user)s, file %(file)s") % {'user':i.user, 'file':self.decode(i.filename)}) self.queue.put(slskmessages.ConnClose(msg.conn)) #if i.speed is not None: #self.queue.put(slskmessages.SendSpeed(i.user, int(i.speed*1024))) #Removed due to misuse. Replaced by SendUploadSpeed i.conn = None if win32: self.addToShared(u"%s" % newname) else: self.addToShared(newname) self.eventprocessor.sendNumSharedFoldersFiles() self.SaveDownloads() self.downloadspanel.update(i) if config["transfers"]["shownotification"]: self.eventprocessor.frame.NewNotification(_("%(file)s downloaded from %(user)s") % {'user':i.user, "file":newname.rsplit(os.sep, 1)[1]}, title=_("Nicotine+ :: file downloaded")) | b8a66b7d2b7dcb72cec6980c8053118074f05f85 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8738/b8a66b7d2b7dcb72cec6980c8053118074f05f85/transfers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1387,
7109,
12,
2890,
16,
1234,
4672,
3536,
432,
585,
4224,
353,
316,
4007,
8395,
1608,
2725,
273,
404,
642,
273,
365,
18,
2575,
8700,
18,
1425,
18,
11657,
364,
277,
316,
365,
18,
7813... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1387,
7109,
12,
2890,
16,
1234,
4672,
3536,
432,
585,
4224,
353,
316,
4007,
8395,
1608,
2725,
273,
404,
642,
273,
365,
18,
2575,
8700,
18,
1425,
18,
11657,
364,
277,
316,
365,
18,
7813... |
yield String(self, "name", self.NAME_SIZE, strip='\0') | yield String(self, "name", 28, strip='\0') | def createFields(self): yield self.getType() yield String(self, "filename", 12, strip='\0') | 9ef711ca7fb1d8fd1e3824891eb445ebdc0eb9e9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9327/9ef711ca7fb1d8fd1e3824891eb445ebdc0eb9e9/s3m.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
2314,
12,
2890,
4672,
2824,
365,
18,
588,
559,
1435,
2824,
514,
12,
2890,
16,
315,
3459,
3113,
2593,
16,
2569,
2218,
64,
20,
6134,
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,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
2314,
12,
2890,
4672,
2824,
365,
18,
588,
559,
1435,
2824,
514,
12,
2890,
16,
315,
3459,
3113,
2593,
16,
2569,
2218,
64,
20,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
define_macros = [('_CRT_[SECURE_NO_WARNINGS', '1')] | macros = [('_CRT_SECURE_NO_WARNINGS', '1')] | def __init__(self, *args, **kwargs): Extension.__init__(self, *args, **kwargs) self.export_symbols = finallist(self.export_symbols) | f217719b204f6daa90050f47cca7c6295d3bddff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10470/f217719b204f6daa90050f47cca7c6295d3bddff/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
4333,
4672,
10021,
16186,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
4333,
13,
365,
18,
6530,
67,
15536,
273,
574,
454,
376,
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,
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,
380,
1968,
16,
2826,
4333,
4672,
10021,
16186,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
4333,
13,
365,
18,
6530,
67,
15536,
273,
574,
454,
376,
12,
... |
mp = self.__namespace.modulePath() if mp is not None: self._setModulePath(mp) | self._setModulePath(self.__namespace.modulePath()) | def __init__ (self, generator, namespace, ns_scc, components=None, **kw): super(NamespaceModule, self).__init__(generator, **kw) self._initializeUniqueInModule(self._UniqueInModule) self.__namespace = namespace self.defineNamespace(namespace, 'Namespace', require_unique=False) print 'NSM Namespace %s module path %s' % (namespace, namespace.modulePath()) mp = self.__namespace.modulePath() if mp is not None: self._setModulePath(mp) self.__namespaceGroup = ns_scc self._RecordNamespace(self) self.__namespaceGroupHead = self.ForNamespace(ns_scc[0]) self.__components = components # wow! fromkeys actually IS useful! if self.__components is not None: self.__ComponentModuleMap.update(dict.fromkeys(self.__components, self)) self.__namespaceBindingNames = {} self.__componentBindingName = {} | 8bb76cad88838122aa395cb75ff97c58226e68ca /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7171/8bb76cad88838122aa395cb75ff97c58226e68ca/generate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
2890,
16,
4456,
16,
1981,
16,
3153,
67,
87,
952,
16,
4085,
33,
7036,
16,
2826,
9987,
4672,
2240,
12,
3402,
3120,
16,
365,
2934,
972,
2738,
972,
12,
8812,
16,
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,
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,
261,
2890,
16,
4456,
16,
1981,
16,
3153,
67,
87,
952,
16,
4085,
33,
7036,
16,
2826,
9987,
4672,
2240,
12,
3402,
3120,
16,
365,
2934,
972,
2738,
972,
12,
8812,
16,
28... |
if bodyrefs and stride != 0: bodyrefs.add(None) | if stride != 0: bodyrefs.addunsure(None) | def prereferences(self): bodyrefs = self.bodyprereferences() stride = self.stride() if bodyrefs and stride != 0: bodyrefs.add(None) return bodyrefs | 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,
30328,
2980,
12,
2890,
4672,
1417,
9316,
273,
365,
18,
3432,
683,
822,
2980,
1435,
11084,
273,
365,
18,
27937,
1435,
309,
11084,
480,
374,
30,
1417,
9316,
18,
1289,
318,
2055,
12,
7036,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
30328,
2980,
12,
2890,
4672,
1417,
9316,
273,
365,
18,
3432,
683,
822,
2980,
1435,
11084,
273,
365,
18,
27937,
1435,
309,
11084,
480,
374,
30,
1417,
9316,
18,
1289,
318,
2055,
12,
7036,
... |
celist = TiersOfATLAS.listCEsInCloudByDomain('*'+domainname) | try: celist = TiersOfATLAS.listCEsInCloudByDomain('*'+domainname) except: celist = [] | def findsetype(sitesrm): setype= 'NULL' if sitesrm.find('castor')>=0: setype = 'CASTOR' elif sitesrm.find('dpm')>=0: setype = 'DPM' elif sitesrm.find('pnfs')>=0: setype = 'DCACHE' elif sitesrm.find('/nfs/')>=0: setype = 'NFS' return setype | b10964954d6f20e39fbcc62461b1516ca8a022e0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1488/b10964954d6f20e39fbcc62461b1516ca8a022e0/ganga-stage-in-out-dq2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
542,
388,
12,
12180,
8864,
4672,
444,
388,
33,
296,
8560,
11,
225,
309,
9180,
8864,
18,
4720,
2668,
4155,
280,
6134,
34,
33,
20,
30,
444,
388,
273,
296,
21871,
916,
11,
1327,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
542,
388,
12,
12180,
8864,
4672,
444,
388,
33,
296,
8560,
11,
225,
309,
9180,
8864,
18,
4720,
2668,
4155,
280,
6134,
34,
33,
20,
30,
444,
388,
273,
296,
21871,
916,
11,
1327,
9... |
""" Returns the number of n-colorings of the graph G for n from 0 to |V|. EXAMPLES: | r""" Returns the number of `n`-colorings of the graph `G` for `n` from `0` to `|V|`. EXAMPLES:: | def numbers_of_colorings(G): """ Returns the number of n-colorings of the graph G for n from 0 to |V|. EXAMPLES: sage: from sage.graphs.graph_coloring import numbers_of_colorings sage: G = Graph({0:[1,2,3],1:[2]}) sage: numbers_of_colorings(G) [0, 0, 0, 12, 72] """ o = G.order() return [number_of_n_colorings(G,i) for i in range(0,o+1)] | 7056b61dfa30c6705aab69c7fdf3017463c8aae2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/7056b61dfa30c6705aab69c7fdf3017463c8aae2/graph_coloring.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5600,
67,
792,
67,
3266,
899,
12,
43,
4672,
436,
8395,
2860,
326,
1300,
434,
1375,
82,
68,
17,
3266,
899,
434,
326,
2667,
1375,
43,
68,
364,
1375,
82,
68,
628,
1375,
20,
68,
358,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5600,
67,
792,
67,
3266,
899,
12,
43,
4672,
436,
8395,
2860,
326,
1300,
434,
1375,
82,
68,
17,
3266,
899,
434,
326,
2667,
1375,
43,
68,
364,
1375,
82,
68,
628,
1375,
20,
68,
358,
1... |
sender = (opts['from'] or ui.config('email', 'from') or ui.config('patchbomb', 'from') or prompt('From', ui.username())) def getaddrs(opt, prpt, default = None): addrs = opts[opt] or (ui.config('email', opt) or ui.config('patchbomb', opt) or prompt(prpt, default = default)).split(',') return [a.strip() for a in addrs if a.strip()] to = getaddrs('to', 'To') cc = getaddrs('cc', 'Cc', '') bcc = opts['bcc'] or (ui.config('email', 'bcc') or ui.config('patchbomb', 'bcc') or '').split(',') bcc = [a.strip() for a in bcc if a.strip()] | def genmsgid(id): return '<%s.%s@%s>' % (id[:20], int(start_time[0]), socket.getfqdn()) | d8c81408241bab99886793f520fe8073ffce12d2 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11312/d8c81408241bab99886793f520fe8073ffce12d2/patchbomb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3157,
3576,
350,
12,
350,
4672,
327,
2368,
9,
87,
7866,
87,
36,
9,
87,
1870,
738,
261,
350,
10531,
3462,
6487,
509,
12,
1937,
67,
957,
63,
20,
65,
3631,
2987,
18,
588,
19206,
5176,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3157,
3576,
350,
12,
350,
4672,
327,
2368,
9,
87,
7866,
87,
36,
9,
87,
1870,
738,
261,
350,
10531,
3462,
6487,
509,
12,
1937,
67,
957,
63,
20,
65,
3631,
2987,
18,
588,
19206,
5176,
... | |
print "Changing hierarchy for %s..." % repr(data) | def changeHierarchy(self, data, x, y): print "Changing hierarchy for %s..." % repr(data) | ca32727cc5bb3298e217074ff838c7a9f8ab45a0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8543/ca32727cc5bb3298e217074ff838c7a9f8ab45a0/SceneGraphUI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2549,
12074,
12,
2890,
16,
501,
16,
619,
16,
677,
4672,
1172,
315,
782,
18183,
9360,
364,
738,
87,
7070,
738,
8480,
12,
892,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2549,
12074,
12,
2890,
16,
501,
16,
619,
16,
677,
4672,
1172,
315,
782,
18183,
9360,
364,
738,
87,
7070,
738,
8480,
12,
892,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
defaultIcon = getResource('pygame_icon.tiff') | defaultIcon = getResource('pygame_icon.tiff').read() | def setIcon(app): try: defaultIcon = getResource('pygame_icon.tiff') except IOError: return data = NSData.dataWithBytes_length_(defaultIcon, len(defaultIcon)) if data is None: return img = NSImage.alloc().initWithData_(data) if img is None: return app.setApplicationIconImage_(img) | f5065554b547e2a8f1626849951ac42dd750b8a4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1298/f5065554b547e2a8f1626849951ac42dd750b8a4/macosx.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21481,
12,
2910,
4672,
775,
30,
805,
5554,
273,
5070,
2668,
2074,
13957,
67,
3950,
18,
88,
3048,
16063,
896,
1435,
1335,
8340,
30,
327,
501,
273,
11472,
751,
18,
892,
1190,
2160,
67,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21481,
12,
2910,
4672,
775,
30,
805,
5554,
273,
5070,
2668,
2074,
13957,
67,
3950,
18,
88,
3048,
16063,
896,
1435,
1335,
8340,
30,
327,
501,
273,
11472,
751,
18,
892,
1190,
2160,
67,
2... |
return AlgebraicReal(self.norm(self)).sqrt()._descr | return AlgebraicReal(self.norm(n)).sqrt()._descr | def abs(self, n): return AlgebraicReal(self.norm(self)).sqrt()._descr | 9d6efb294179e77392be48f56eb8344fa9b9a003 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/9d6efb294179e77392be48f56eb8344fa9b9a003/qqbar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2417,
12,
2890,
16,
290,
4672,
327,
2262,
29087,
335,
6955,
12,
2890,
18,
7959,
12,
2890,
13,
2934,
24492,
1435,
6315,
28313,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
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,
2417,
12,
2890,
16,
290,
4672,
327,
2262,
29087,
335,
6955,
12,
2890,
18,
7959,
12,
2890,
13,
2934,
24492,
1435,
6315,
28313,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
return items | return sorted(items, key=lambda v:v[0].lower()) | def build_term_index(self): items = [] for doc in self.indexed_docs: url = self.url(doc) items += self._terms_from_docstring(url, doc, doc.descr) for (field, arg, descr) in doc.metadata: items += self._terms_from_docstring(url, doc, descr) if hasattr(doc, 'type_descr'): items += self._terms_from_docstring(url, doc, doc.type_descr) if hasattr(doc, 'return_descr'): items += self._terms_from_docstring(url, doc, doc.return_descr) if hasattr(doc, 'return_type'): items += self._terms_from_docstring(url, doc, doc.return_type) return items | 5c410b5b6e25df3bdbc6da266f7773518165cb02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/5c410b5b6e25df3bdbc6da266f7773518165cb02/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
6408,
67,
1615,
12,
2890,
4672,
1516,
273,
5378,
364,
997,
316,
365,
18,
19626,
67,
8532,
30,
880,
273,
365,
18,
718,
12,
2434,
13,
1516,
1011,
365,
6315,
10112,
67,
2080,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
6408,
67,
1615,
12,
2890,
4672,
1516,
273,
5378,
364,
997,
316,
365,
18,
19626,
67,
8532,
30,
880,
273,
365,
18,
718,
12,
2434,
13,
1516,
1011,
365,
6315,
10112,
67,
2080,
... |
outputpath = self.fspath.dirpath('output', self.name) | outputpath = self.fspath.dirpath('output', self.fspath.purebasename) | def run(self): outputpath = self.fspath.dirpath('output', self.name) if not outputpath.check(): py.test.fail("expected outputfile at %s" %(outputpath,)) | 8d4abe111f248e7c6e79c861bc62a17bc6d8f3e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/8d4abe111f248e7c6e79c861bc62a17bc6d8f3e6/conftest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
876,
803,
273,
365,
18,
2556,
803,
18,
1214,
803,
2668,
2844,
2187,
365,
18,
2556,
803,
18,
84,
594,
13909,
13,
309,
486,
876,
803,
18,
1893,
13332,
2395,
18,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
876,
803,
273,
365,
18,
2556,
803,
18,
1214,
803,
2668,
2844,
2187,
365,
18,
2556,
803,
18,
84,
594,
13909,
13,
309,
486,
876,
803,
18,
1893,
13332,
2395,
18,
3... |
does not need to be seekable. The file is gzip decompressed while reading if gz is set to True. If the optional xmldoc argument is provided and not None, the parsed XML tree will be appended to that document, otherwise a new document will be created. The return value is a tuple, the first element of the tuple is the XML document and the second is a string containing the MD5 digest in hex digits of the bytestream that was parsed. | does not need to be seekable. If the gz parameter is None (the default) then gzip compressed data will be automatically detected and decompressed, otherwise decompression can be forced on or off by setting gz to True or False respectively. If the optional xmldoc argument is provided and not None, the parsed XML tree will be appended to that document, otherwise a new document will be created. The return value is a tuple, the first element of the tuple is the XML document and the second is a string containing the MD5 digest in hex digits of the bytestream that was parsed. | def load_fileobj(fileobj, gz = False, xmldoc = None, contenthandler = None): """ Parse the contents of the file object fileobj, and return the contents as a LIGO Light Weight document tree. The file object does not need to be seekable. The file is gzip decompressed while reading if gz is set to True. If the optional xmldoc argument is provided and not None, the parsed XML tree will be appended to that document, otherwise a new document will be created. The return value is a tuple, the first element of the tuple is the XML document and the second is a string containing the MD5 digest in hex digits of the bytestream that was parsed. Example: >>> import sys >>> xmldoc, digest = utils.load_fileobj(sys.stdin, verbose = True, gz = True) """ fileobj = MD5File(fileobj) md5obj = fileobj.md5obj if gz: fileobj = gzip.GzipFile(mode = "rb", fileobj = RewindableInputFile(fileobj)) if xmldoc is None: xmldoc = ligolw.Document() if contenthandler is None: if ContentHandler is not __orig_ContentHandler: warnings.warn("modification of glue.ligolw.utils.ContentHandler global variable for input customization is deprecated. Use contenthandler parameter of glue.ligolw.utils.load_*() functions instead", DeprecationWarning) contenthandler = ContentHandler ligolw.make_parser((contenthandler or ContentHandler)(xmldoc)).parse(fileobj) return xmldoc, md5obj.hexdigest() | a6609b0e22abdcb993241fb93f7d83d0e32abf28 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/a6609b0e22abdcb993241fb93f7d83d0e32abf28/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
768,
2603,
12,
768,
2603,
16,
14136,
273,
1083,
16,
2025,
2434,
273,
599,
16,
913,
4176,
273,
599,
4672,
3536,
2884,
326,
2939,
434,
326,
585,
733,
17041,
16,
471,
327,
326,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
768,
2603,
12,
768,
2603,
16,
14136,
273,
1083,
16,
2025,
2434,
273,
599,
16,
913,
4176,
273,
599,
4672,
3536,
2884,
326,
2939,
434,
326,
585,
733,
17041,
16,
471,
327,
326,
... |
... SyntaxError: 'return' with argument inside generator (<string>, line 3) | .. SyntaxError: 'return' with argument inside generator (..., line 3) | >>> def f(): | ff60a559da3fcbad664672d8df57092e63bbc05c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/ff60a559da3fcbad664672d8df57092e63bbc05c/test_generators.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4080,
1652,
284,
13332,
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,
0,
... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4080,
1652,
284,
13332,
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,
-100,
... |
sys.last_type and sys.last_value. The return value is a list of | sys.exc_info()[0] and sys.exc_info()[1]. The return value is a list of | def format_exception_only(etype, value): """Format the exception part of a traceback. The arguments are the exception type and value such as given by sys.last_type and sys.last_value. The return value is a list of strings, each ending in a newline. Normally, the list contains a single string; however, for SyntaxError exceptions, it contains several lines that (when printed) display detailed information about where the syntax error occurred. The message indicating which exception occurred is always the last string in the list. """ # An instance should not have a meaningful value parameter, but # sometimes does, particularly for string exceptions, such as # >>> raise string1, string2 # deprecated # # Clear these out first because issubtype(string1, SyntaxError) # would throw another exception and mask the original problem. if (isinstance(etype, BaseException) or isinstance(etype, types.InstanceType) or etype is None or type(etype) is str): return [_format_final_exc_line(etype, value)] stype = etype.__name__ if not issubclass(etype, SyntaxError): return [_format_final_exc_line(stype, value)] # It was a syntax error; show exactly where the problem was found. lines = [] try: msg, (filename, lineno, offset, badline) = value.args except Exception: pass else: filename = filename or "<string>" lines.append(' File "%s", line %d\n' % (filename, lineno)) if badline is not None: lines.append(' %s\n' % badline.strip()) if offset is not None: caretspace = badline[:offset].lstrip() # non-space whitespace (likes tabs) must be kept for alignment caretspace = ((c.isspace() and c or ' ') for c in caretspace) # only three spaces to account for offset1 == pos 0 lines.append(' %s^\n' % ''.join(caretspace)) value = msg lines.append(_format_final_exc_line(stype, value)) return lines | 0fd195c81d2eb354e2bdb2e86dfd2c2c47844135 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/0fd195c81d2eb354e2bdb2e86dfd2c2c47844135/traceback.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
67,
4064,
67,
3700,
12,
5872,
16,
460,
4672,
3536,
1630,
326,
1520,
1087,
434,
279,
10820,
18,
225,
1021,
1775,
854,
326,
1520,
618,
471,
460,
4123,
487,
864,
635,
2589,
18,
10075... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
67,
4064,
67,
3700,
12,
5872,
16,
460,
4672,
3536,
1630,
326,
1520,
1087,
434,
279,
10820,
18,
225,
1021,
1775,
854,
326,
1520,
618,
471,
460,
4123,
487,
864,
635,
2589,
18,
10075... |
def bind(self, sequence=None, command=None): return self.canvas.tag_bind(self.id, sequence, command) def unbind(self, sequence): self.canvas.tag_bind(self.id, sequence, '') | def bind(self, sequence=None, command=None, add=None): return self.canvas.tag_bind(self.id, sequence, command, add) def unbind(self, sequence, funcid=None): self.canvas.tag_unbind(self.id, sequence, funcid) | def bind(self, sequence=None, command=None): return self.canvas.tag_bind(self.id, sequence, command) | 00236f38dabd16ffe5da4d75664f051c37833aa5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/00236f38dabd16ffe5da4d75664f051c37833aa5/Canvas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1993,
12,
2890,
16,
3102,
33,
7036,
16,
1296,
33,
7036,
4672,
327,
365,
18,
15424,
18,
2692,
67,
4376,
12,
2890,
18,
350,
16,
3102,
16,
1296,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1993,
12,
2890,
16,
3102,
33,
7036,
16,
1296,
33,
7036,
4672,
327,
365,
18,
15424,
18,
2692,
67,
4376,
12,
2890,
18,
350,
16,
3102,
16,
1296,
13,
2,
-100,
-100,
-100,
-100,
-100,
-10... |
frozendllmain_c, extensions_c] + files | frozendllmain_c, os.path.basename(extensions_c)] + files | def main(): # overridable context prefix = None # settable with -p option exec_prefix = None # settable with -P option extensions = [] exclude = [] # settable with -x option addn_link = [] # settable with -l, but only honored under Windows. path = sys.path[:] modargs = 0 debug = 1 odir = '' win = sys.platform[:3] == 'win' # default the exclude list for each platform if win: exclude = exclude + [ 'dos', 'dospath', 'mac', 'macpath', 'macfs', 'MACFS', 'posix', 'os2'] # modules that are imported by the Python runtime implicits = ["site", "exceptions"] # output files frozen_c = 'frozen.c' config_c = 'config.c' target = 'a.out' # normally derived from script name makefile = 'Makefile' subsystem = 'console' # parse command line by first replacing any "-i" options with the file contents. pos = 1 while pos < len(sys.argv)-1: # last option can not be "-i", so this ensures "pos+1" is in range! if sys.argv[pos] == '-i': try: options = string.split(open(sys.argv[pos+1]).read()) except IOError, why: usage("File name '%s' specified with the -i option can not be read - %s" % (sys.argv[pos+1], why) ) # Replace the '-i' and the filename with the read params. sys.argv[pos:pos+2] = options pos = pos + len(options) - 1 # Skip the name and the included args. pos = pos + 1 # Now parse the command line with the extras inserted. try: opts, args = getopt.getopt(sys.argv[1:], 'a:de:hmo:p:P:qs:wx:l:') except getopt.error, msg: usage('getopt error: ' + str(msg)) # proces option arguments for o, a in opts: if o == '-h': print __doc__ return if o == '-d': debug = debug + 1 if o == '-e': extensions.append(a) if o == '-m': modargs = 1 if o == '-o': odir = a if o == '-p': prefix = a if o == '-P': exec_prefix = a if o == '-q': debug = 0 if o == '-w': win = not win if o == '-s': if not win: usage("-s subsystem option only on Windows") subsystem = a if o == '-x': exclude.append(a) if o == '-l': addn_link.append(a) if o == '-a': apply(modulefinder.AddPackagePath, tuple(string.split(a,"=", 2))) # default prefix and exec_prefix if not exec_prefix: if prefix: exec_prefix = prefix else: exec_prefix = sys.exec_prefix if not prefix: prefix = sys.prefix # determine whether -p points to the Python source tree ishome = os.path.exists(os.path.join(prefix, 'Python', 'ceval.c')) # locations derived from options version = sys.version[:3] if win: extensions_c = 'frozen_extensions.c' if ishome: print "(Using Python source directory)" binlib = exec_prefix incldir = os.path.join(prefix, 'Include') config_h_dir = exec_prefix config_c_in = os.path.join(prefix, 'Modules', 'config.c.in') frozenmain_c = os.path.join(prefix, 'Python', 'frozenmain.c') makefile_in = os.path.join(exec_prefix, 'Modules', 'Makefile') if win: frozendllmain_c = os.path.join(exec_prefix, 'Pc\\frozen_dllmain.c') else: binlib = os.path.join(exec_prefix, 'lib', 'python%s' % version, 'config') incldir = os.path.join(prefix, 'include', 'python%s' % version) config_h_dir = os.path.join(exec_prefix, 'include', 'python%s' % version) config_c_in = os.path.join(binlib, 'config.c.in') frozenmain_c = os.path.join(binlib, 'frozenmain.c') makefile_in = os.path.join(binlib, 'Makefile') frozendllmain_c = os.path.join(binlib, 'frozen_dllmain.c') supp_sources = [] defines = [] includes = ['-I' + incldir, '-I' + config_h_dir] # sanity check of directories and files check_dirs = [prefix, exec_prefix, binlib, incldir] if not win: check_dirs = check_dirs + extensions # These are not directories on Windows. for dir in check_dirs: if not os.path.exists(dir): usage('needed directory %s not found' % dir) if not os.path.isdir(dir): usage('%s: not a directory' % dir) if win: files = supp_sources + extensions # extensions are files on Windows. else: files = [config_c_in, makefile_in] + supp_sources for file in supp_sources: if not os.path.exists(file): usage('needed file %s not found' % file) if not os.path.isfile(file): usage('%s: not a plain file' % file) if not win: for dir in extensions: setup = os.path.join(dir, 'Setup') if not os.path.exists(setup): usage('needed file %s not found' % setup) if not os.path.isfile(setup): usage('%s: not a plain file' % setup) # check that enough arguments are passed if not args: usage('at least one filename argument required') # check that file arguments exist for arg in args: if arg == '-m': break # if user specified -m on the command line before _any_ # file names, then nothing should be checked (as the # very first file should be a module name) if modargs: break if not os.path.exists(arg): usage('argument %s not found' % arg) if not os.path.isfile(arg): usage('%s: not a plain file' % arg) # process non-option arguments scriptfile = args[0] modules = args[1:] # derive target name from script name base = os.path.basename(scriptfile) base, ext = os.path.splitext(base) if base: if base != scriptfile: target = base else: target = base + '.bin' # handle -o option base_frozen_c = frozen_c base_config_c = config_c base_target = target if odir and not os.path.isdir(odir): try: os.mkdir(odir) print "Created output directory", odir except os.error, msg: usage('%s: mkdir failed (%s)' % (odir, str(msg))) base = '' if odir: base = os.path.join(odir, '') frozen_c = os.path.join(odir, frozen_c) config_c = os.path.join(odir, config_c) target = os.path.join(odir, target) makefile = os.path.join(odir, makefile) if win: extensions_c = os.path.join(odir, extensions_c) # Handle special entry point requirements # (on Windows, some frozen programs do not use __main__, but # import the module directly. Eg, DLLs, Services, etc custom_entry_point = None # Currently only used on Windows python_entry_is_main = 1 # Is the entry point called __main__? # handle -s option on Windows if win: import winmakemakefile try: custom_entry_point, python_entry_is_main = \ winmakemakefile.get_custom_entry_point(subsystem) except ValueError, why: usage(why) # Actual work starts here... # collect all modules of the program dir = os.path.dirname(scriptfile) path[0] = dir mf = modulefinder.ModuleFinder(path, debug, exclude) if win and subsystem=='service': # If a Windows service, then add the "built-in" module. mod = mf.add_module("servicemanager") mod.__file__="dummy.pyd" # really built-in to the resulting EXE for mod in implicits: mf.import_hook(mod) for mod in modules: if mod == '-m': modargs = 1 continue if modargs: if mod[-2:] == '.*': mf.import_hook(mod[:-2], None, ["*"]) else: mf.import_hook(mod) else: mf.load_file(mod) # Add the main script as either __main__, or the actual module name. if python_entry_is_main: mf.run_script(scriptfile) else: if modargs: mf.import_hook(scriptfile) else: mf.load_file(scriptfile) if debug > 0: mf.report() print dict = mf.modules # generate output for frozen modules files = makefreeze.makefreeze(base, dict, debug, custom_entry_point) # look for unfrozen modules (builtin and of unknown origin) builtins = [] unknown = [] mods = dict.keys() mods.sort() for mod in mods: if dict[mod].__code__: continue if not dict[mod].__file__: builtins.append(mod) else: unknown.append(mod) # search for unknown modules in extensions directories (not on Windows) addfiles = [] frozen_extensions = [] # Windows list of modules. if unknown or (not win and builtins): if not win: addfiles, addmods = \ checkextensions.checkextensions(unknown+builtins, extensions) for mod in addmods: if mod in unknown: unknown.remove(mod) builtins.append(mod) else: # Do the windows thang... import checkextensions_win32 # Get a list of CExtension instances, each describing a module # (including its source files) frozen_extensions = checkextensions_win32.checkextensions( unknown, extensions) for mod in frozen_extensions: unknown.remove(mod.name) # report unknown modules if unknown: sys.stderr.write('Warning: unknown modules remain: %s\n' % string.join(unknown)) # windows gets different treatment if win: # Taking a shortcut here... import winmakemakefile, checkextensions_win32 checkextensions_win32.write_extension_table(extensions_c, frozen_extensions) # Create a module definition for the bootstrap C code. xtras = [frozenmain_c, os.path.basename(frozen_c), frozendllmain_c, extensions_c] + files maindefn = checkextensions_win32.CExtension( '__main__', xtras ) frozen_extensions.append( maindefn ) outfp = open(makefile, 'w') try: winmakemakefile.makemakefile(outfp, locals(), frozen_extensions, os.path.basename(target)) finally: outfp.close() return # generate config.c and Makefile builtins.sort() infp = open(config_c_in) outfp = bkfile.open(config_c, 'w') try: makeconfig.makeconfig(infp, outfp, builtins) finally: outfp.close() infp.close() cflags = defines + includes + ['$(OPT)'] libs = [os.path.join(binlib, 'libpython$(VERSION).a')] somevars = {} if os.path.exists(makefile_in): makevars = parsesetup.getmakevars(makefile_in) for key in makevars.keys(): somevars[key] = makevars[key] somevars['CFLAGS'] = string.join(cflags) # override files = ['$(OPT)', '$(LDFLAGS)', base_config_c, base_frozen_c] + \ files + supp_sources + addfiles + libs + \ ['$(MODLIBS)', '$(LIBS)', '$(SYSLIBS)'] outfp = bkfile.open(makefile, 'w') try: makemakefile.makemakefile(outfp, somevars, files, base_target) finally: outfp.close() # Done! if odir: print 'Now run "make" in', odir, print 'to build the target:', base_target else: print 'Now run "make" to build the target:', base_target | 94f9614360fc8ebe4364718f3af599c648d629f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/94f9614360fc8ebe4364718f3af599c648d629f7/freeze.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
468,
5713,
27621,
819,
1633,
273,
599,
15604,
468,
444,
2121,
598,
300,
84,
1456,
1196,
67,
3239,
273,
599,
5375,
468,
444,
2121,
598,
300,
52,
1456,
4418,
273,
5378,
4433,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
468,
5713,
27621,
819,
1633,
273,
599,
15604,
468,
444,
2121,
598,
300,
84,
1456,
1196,
67,
3239,
273,
599,
5375,
468,
444,
2121,
598,
300,
52,
1456,
4418,
273,
5378,
4433,
... |
elif long(prefSite) in ceMap.keys(): | elif str(prefSite).isdigit() and long(prefSite) in ceMap.keys(): | def preferredSite(self): """ Generate command line option for ngsub for submitting to a preferred site, if such exist. | 195403efd43037c80686893fe9692788fe7d033a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8887/195403efd43037c80686893fe9692788fe7d033a/ARCSubmitter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9119,
4956,
12,
2890,
4672,
3536,
6654,
1296,
980,
1456,
364,
290,
564,
373,
364,
4879,
1787,
358,
279,
9119,
2834,
16,
309,
4123,
1005,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
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,
9119,
4956,
12,
2890,
4672,
3536,
6654,
1296,
980,
1456,
364,
290,
564,
373,
364,
4879,
1787,
358,
279,
9119,
2834,
16,
309,
4123,
1005,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.setViewPerspecAction.setText(QtGui.QApplication.translate("MainWindow", "Perspective", None, QtGui.QApplication.UnicodeUTF8)) self.setViewPerspecAction.setCheckable(True) | self.setViewPerspecAction.setText(QtGui.QApplication.translate("MainWindow", "Perspective", None, QtGui.QApplication.UnicodeUTF8)) self.setViewPerspecAction.setCheckable(True) | def __init__(self, parent = None, name = None): | c25263540add024396d4bcf7631292f1fd2d50bb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/c25263540add024396d4bcf7631292f1fd2d50bb/MWsemantics.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
273,
599,
16,
508,
273,
599,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
273,
599,
16,
508,
273,
599,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
- ``sort`` - bool (default: True), if True return the point list sorted. If False, returns the points in the order computed by Singular. | - ``D`` - a divisor OUTPUT: A list of function field elements that form a basis of the Riemann-Roch space | def riemann_roch_basis(self, D): r""" Return a basis for the Riemann-Roch space corresponding to `D`. | 45f8022bf1ce8a03a200902d10a41e0e02d6cbbd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/45f8022bf1ce8a03a200902d10a41e0e02d6cbbd/projective_curve.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12347,
351,
1072,
67,
303,
343,
67,
23774,
12,
2890,
16,
463,
4672,
436,
8395,
2000,
279,
10853,
364,
326,
21688,
351,
1072,
17,
54,
9842,
3476,
4656,
358,
1375,
40,
8338,
2,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12347,
351,
1072,
67,
303,
343,
67,
23774,
12,
2890,
16,
463,
4672,
436,
8395,
2000,
279,
10853,
364,
326,
21688,
351,
1072,
17,
54,
9842,
3476,
4656,
358,
1375,
40,
8338,
2,
-100,
-10... |
if os.path.exists(iconPath): self.setIcon(geticon(iconPath)) self.setIconSize(QSize(22, 22)) | self.setIcon(geticon(iconPath)) self.setIconSize(QSize(22, 22)) | def __init__(self, parentWidget, label = '', labelColumn = 0, text = '', iconPath = '', setAsDefault = True, spanWidth = False ): """ Appends a QToolButton (Qt) widget to the bottom of I{parentWidget}, a Property Manager group box. @param parentWidget: The parent group box containing this widget. @type parentWidget: PM_GroupBox @param label: The label that appears to the left or right of the checkbox. If spanWidth is True, the label will be displayed on its own row directly above the list widget. To suppress the label, set I{label} to an empty string. @type label: str @param labelColumn: The column number of the label in the group box grid layout. The only valid values are 0 (left column) and 1 (right column). The default is 0 (left column). @type labelColumn: int @param text: The button's text. @type text: str @param iconPath: The relative path to the button's icon. @type iconPath: str @param setAsDefault: If True, will restore <text> as the button's text when the "Restore Defaults" button is clicked. @type setAsDefault: bool @param spanWidth: If True, the widget and its label will span the width of the group box. Its label will appear directly above the widget (unless the label is empty) and is left justified. @type spanWidth: bool @see: U{B{QToolButton}<http://doc.trolltech.com/4/qtoolbutton.html>} """ if 0: # Debugging code print "PM_ToolButton.__init__():" print " label = ", label print " labelColumn = ", labelColumn print " text = ", text print " iconPath = ", iconPath print " setAsDefault = ", setAsDefault print " spanWidth = ", spanWidth QToolButton.__init__(self) self.parentWidget = parentWidget self.label = label self.labelColumn = labelColumn self.setAsDefault = setAsDefault self.spanWidth = spanWidth if label: # Create this widget's QLabel. self.labelWidget = QLabel() self.labelWidget.setText(label) # Set text self.setText(text) # Set icon if os.path.exists(iconPath): self.setIcon(geticon(iconPath)) self.setIconSize(QSize(22, 22)) # Set default text self.defaultText = text self.setAsDefault = setAsDefault parentWidget.addPmWidget(self) | de95e12f4fd67df46c5e09820c6e5e9e0302d55c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/de95e12f4fd67df46c5e09820c6e5e9e0302d55c/PM_ToolButton.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
4609,
16,
1433,
3639,
273,
10226,
1433,
1494,
225,
273,
374,
16,
977,
540,
273,
10226,
4126,
743,
377,
273,
10226,
444,
1463,
1868,
273,
1053,
16,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
4609,
16,
1433,
3639,
273,
10226,
1433,
1494,
225,
273,
374,
16,
977,
540,
273,
10226,
4126,
743,
377,
273,
10226,
444,
1463,
1868,
273,
1053,
16,
4... |
if not self[opt]: | if not self.has_key(opt): | def parse(self, filename): self["filename"] = filename try: _fd = open(filename, "r") except: raise IOError, "Unable to open '%s'" % filename | 8ca46dfa1d8eed62ea49a09ee900ea152ab7b9a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/8ca46dfa1d8eed62ea49a09ee900ea152ab7b9a3/kickstart.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
1544,
4672,
365,
9614,
3459,
11929,
273,
1544,
775,
30,
389,
8313,
273,
1696,
12,
3459,
16,
315,
86,
7923,
1335,
30,
1002,
8340,
16,
315,
3370,
358,
1696,
1995,
87,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1109,
12,
2890,
16,
1544,
4672,
365,
9614,
3459,
11929,
273,
1544,
775,
30,
389,
8313,
273,
1696,
12,
3459,
16,
315,
86,
7923,
1335,
30,
1002,
8340,
16,
315,
3370,
358,
1696,
1995,
87,... |
self.warnings = warnings | def __init__(self, connection, warnings=1): self.connection = connection self.description = None self.rowcount = -1 self.result = None self.arraysize = 100 self.warnings = warnings | 4dcca6779b980ae173a387375f0f35be5e3fead3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10477/4dcca6779b980ae173a387375f0f35be5e3fead3/MySQLdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1459,
16,
5599,
33,
21,
4672,
365,
18,
4071,
273,
1459,
365,
18,
3384,
273,
599,
365,
18,
492,
1883,
273,
300,
21,
365,
18,
2088,
273,
599,
365,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1459,
16,
5599,
33,
21,
4672,
365,
18,
4071,
273,
1459,
365,
18,
3384,
273,
599,
365,
18,
492,
1883,
273,
300,
21,
365,
18,
2088,
273,
599,
365,
18,
... | |
options.tools_path) | options.tools_path, options.archive) | def main(): # Command line parsing parser = optparse.OptionParser() # Path where the .coverage to .lcov converter tools are stored. parser.add_option('-t', '--tools_path', dest='tools_path', default=None, help='Location of the coverage tools (windows only)') parser.add_option('-u', '--upload', dest='upload_path', default=None, help='Location where the results should be uploaded') # We need the revision number so that we can generate the output file of the # format chrome_<platform>_<revision>.lcov parser.add_option('-r', '--revision', dest='revision', default=None, help='Revision number of the Chromium source repo') # Root of the source tree. Needed for converting the generated .coverage file # on Windows to the open source lcov format. parser.add_option('-s', '--src_root', dest='src_root', default=None, help='Root of the source repository') (options, args) = parser.parse_args() if options.revision == None: parser.error('Revision number not specified') if options.src_root == None: parser.error('Source root not specified') if options.upload_path == None: parser.error('Upload path not specified') if IsWindows(): # Initialize coverage cov = Coverage(options.revision, options.src_root, options.tools_path) list_coverage = [] # Instrument the binaries if cov.SetUp(windows_binaries): # Run all the tests for test in windows_tests: test = os.path.join(options.src_root, 'chrome', 'Release', test) coverage = cov.RunTest(test) if coverage == None: # Indicate failure to the buildbots. return 1 # Collect the intermediate file list_coverage.append(coverage) else: logging.error('Error during instrumentation.') sys.exit(1) cov.Upload(list_coverage, options.upload_path, os.path.join(options.src_root, 'chrome', 'Release'), options.src_root) cov.TearDown() | 1581ad170e9c9d3a92c66b377c35a5abc747dc4c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9392/1581ad170e9c9d3a92c66b377c35a5abc747dc4c/coverage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
468,
3498,
980,
5811,
2082,
273,
2153,
2670,
18,
1895,
2678,
1435,
468,
2666,
1625,
326,
263,
16356,
358,
263,
80,
14014,
6027,
8513,
854,
4041,
18,
2082,
18,
1289,
67,
3482... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
468,
3498,
980,
5811,
2082,
273,
2153,
2670,
18,
1895,
2678,
1435,
468,
2666,
1625,
326,
263,
16356,
358,
263,
80,
14014,
6027,
8513,
854,
4041,
18,
2082,
18,
1289,
67,
3482... |
types.TypeType, types.CodeType, types.FunctionType): | types.TypeType, types.CodeType, types.FunctionType, types.StringType, types.UnicodeType): return True if id(obj) in self._id2ref: | def _isDeadEnd(self, obj): if type(obj) in (types.BooleanType, types.BuiltinFunctionType, types.BuiltinMethodType, types.ComplexType, types.FloatType, types.IntType, types.LongType, types.NoneType, types.NotImplementedType, types.TypeType, types.CodeType, types.FunctionType): return True # if it's an internal object, ignore it if id(obj) in ContainerLeakDetector.PrivateIds: return True if id(obj) in self._id2ref: return True return False | 88950518abcce43f6828c7e417218c4bdb6988d8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8543/88950518abcce43f6828c7e417218c4bdb6988d8/ContainerLeakDetector.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
291,
11852,
1638,
12,
2890,
16,
1081,
4672,
309,
618,
12,
2603,
13,
316,
261,
2352,
18,
5507,
559,
16,
1953,
18,
28032,
2083,
559,
16,
1953,
18,
28032,
21988,
16,
1953,
18,
12795,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
291,
11852,
1638,
12,
2890,
16,
1081,
4672,
309,
618,
12,
2603,
13,
316,
261,
2352,
18,
5507,
559,
16,
1953,
18,
28032,
2083,
559,
16,
1953,
18,
28032,
21988,
16,
1953,
18,
12795,... |
newdir.linkChild(newname, oldfile) | newdir.linkChild(posixpath.basename(new), oldfile) | def rename(old, new): old = _makeAbsPath(old) new = _makeAbsPath(new) oldfile = _findFileFromPath(old) newdir = None newname = None # foo bar (explicit newname == bar) # foo bar/ (implicit newname == foo) try: newdir = _findFileFromPath(new) newname = posixpath.basename(new) except OSError, e: if e.errno == errno.ENOENT: newdir = _findFileFromPath(posixpath.dirname(new)) newname = posixpath.basename(old) if not isinstance(newdir, FakeDir): raise OSError(errno.ENOTDIR, '') if newdir.getChildren(newname): raise OSError(errno.EEXIST, '') oldfile.parent.unlinkChild(oldfile.name) newdir.linkChild(newname, oldfile) | aa20dce7c6d5bb9f33d932aab3323692451f4886 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10739/aa20dce7c6d5bb9f33d932aab3323692451f4886/os_mock.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6472,
12,
1673,
16,
394,
4672,
1592,
273,
389,
6540,
9382,
743,
12,
1673,
13,
394,
273,
389,
6540,
9382,
743,
12,
2704,
13,
225,
1592,
768,
273,
389,
4720,
812,
23064,
12,
1673,
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,
6472,
12,
1673,
16,
394,
4672,
1592,
273,
389,
6540,
9382,
743,
12,
1673,
13,
394,
273,
389,
6540,
9382,
743,
12,
2704,
13,
225,
1592,
768,
273,
389,
4720,
812,
23064,
12,
1673,
13,
... |
return query.group_by(self.commands.c.id).order_by(asc(params['order_by'])) | return query.group_by(self.commands.c.id).order_by(desc(params['order_by'])) | def __displayLogsQuery(self, ctx, params, session): query = session.query(Commands).select_from(self.commands.join(self.commands_on_host).join(self.target)) if params['gid'] != None: query = query.filter(self.target.c.id_group == params['gid']) if params['uuid'] != None: query = query.filter(self.target.c.target_uuid == params['uuid']) if params['filt'] != None: query = query.filter(self.commands.c.title.like('%'+params['filt']+'%')) if params['finished']: query = query.filter(self.commands_on_host.c.current_state == 'done') else: query = query.filter(self.commands_on_host.c.current_state != 'done') return query.group_by(self.commands.c.id).order_by(asc(params['order_by'])) | f0786077fc96513fb6c0976321f26a8b859f6371 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5988/f0786077fc96513fb6c0976321f26a8b859f6371/database.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
5417,
7777,
1138,
12,
2890,
16,
1103,
16,
859,
16,
1339,
4672,
843,
273,
1339,
18,
2271,
12,
9127,
2934,
4025,
67,
2080,
12,
2890,
18,
7847,
18,
5701,
12,
2890,
18,
7847,
67,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
5417,
7777,
1138,
12,
2890,
16,
1103,
16,
859,
16,
1339,
4672,
843,
273,
1339,
18,
2271,
12,
9127,
2934,
4025,
67,
2080,
12,
2890,
18,
7847,
18,
5701,
12,
2890,
18,
7847,
67,
2... |
startdate = utils.parsedate(self.input['start-date']).replace(day=1) | startdate = utils.parsedate( self.input['start-date']).replace(day=1) | def format_minimester_sortkey(self, value): """The minimester sortkey is based on the ordinal value of the start date of a course in the minimester. The start date is normalized by replacing its day of the month with a 1 (e.g. 08/03/2006 -> 08/01/2006). | 20eab91c91a9f72ec790d8c5d1fb9261b7b89028 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4025/20eab91c91a9f72ec790d8c5d1fb9261b7b89028/formatters.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
67,
1154,
4485,
387,
67,
3804,
856,
12,
2890,
16,
460,
4672,
3536,
1986,
1131,
4485,
387,
1524,
856,
353,
2511,
603,
326,
12675,
460,
434,
326,
787,
1509,
434,
279,
4362,
316,
326... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
67,
1154,
4485,
387,
67,
3804,
856,
12,
2890,
16,
460,
4672,
3536,
1986,
1131,
4485,
387,
1524,
856,
353,
2511,
603,
326,
12675,
460,
434,
326,
787,
1509,
434,
279,
4362,
316,
326... |
for ii in range(imin, imax + 1): | for ii in range(imin, imax + 1): | def wigner_3j(j_1, j_2, j_3, m_1, m_2, m_3, prec=None): r""" Calculate the Wigner 3j symbol `Wigner3j(j_1,j_2,j_3,m_1,m_2,m_3)`. INPUT: - ``j_1``, ``j_2``, ``j_3``, ``m_1``, ``m_2``, ``m_3`` - integer or half integer - ``prec`` - precision, default: None. Providing a precision can drastically speed up the calculation. OUTPUT: rational number times the square root of a rational number (if prec=None), or real number if a precision is given EXAMPLES:: sage: wigner_3j(2, 6, 4, 0, 0, 0) sqrt(5/143) sage: wigner_3j(2, 6, 4, 0, 0, 1) 0 sage: wigner_3j(0.5, 0.5, 1, 0.5, -0.5, 0) sqrt(1/6) sage: wigner_3j(40, 100, 60, -10, 60, -50) 95608/18702538494885*sqrt(21082735836735314343364163310/220491455010479533763) sage: wigner_3j(2500, 2500, 5000, 2488, 2400, -4888, prec=64) 7.60424456883448589e-12 It is an error to have arguments that are not integer or half integer values:: sage: wigner_3j(2.1, 6, 4, 0, 0, 0) Traceback (most recent call last): ... ValueError: j values must be integer or half integer sage: wigner_3j(2, 6, 4, 1, 0, -1.1) Traceback (most recent call last): ... ValueError: m values must be integer or half integer NOTES: The Wigner 3j symbol obeys the following symmetry rules: - invariant under any permutation of the columns (with the exception of a sign change where `J:=j_1+j_2+j_3`): .. math:: Wigner3j(j_1,j_2,j_3,m_1,m_2,m_3) =Wigner3j(j_3,j_1,j_2,m_3,m_1,m_2) =Wigner3j(j_2,j_3,j_1,m_2,m_3,m_1) =(-1)^J Wigner3j(j_3,j_2,j_1,m_3,m_2,m_1) =(-1)^J Wigner3j(j_1,j_3,j_2,m_1,m_3,m_2) =(-1)^J Wigner3j(j_2,j_1,j_3,m_2,m_1,m_3) - invariant under space inflection, i. e. .. math:: Wigner3j(j_1,j_2,j_3,m_1,m_2,m_3) =(-1)^J Wigner3j(j_1,j_2,j_3,-m_1,-m_2,-m_3) - symmetric with respect to the 72 additional symmetries based on the work by [Regge58] - zero for `j_1`, `j_2`, `j_3` not fulfilling triangle relation - zero for `m_1+m_2+m_3\neq 0` - zero for violating any one of the conditions `j_1\ge|m_1|`, `j_2\ge|m_2|`, `j_3\ge|m_3|` ALGORITHM: This function uses the algorithm of [Edmonds74] to calculate the value of the 3j symbol exactly. Note that the formula contains alternating sums over large factorials and is therefore unsuitable for finite precision arithmetic and only useful for a computer algebra system [Rasch03]. REFERENCES: - [Regge58] 'Symmetry Properties of Clebsch-Gordan Coefficients', T. Regge, Nuovo Cimento, Volume 10, pp. 544 (1958) - [Edmonds74] 'Angular Momentum in Quantum Mechanics', A. R. Edmonds, Princeton University Press (1974) - [Rasch03] 'Efficient Storage Scheme for Pre-calculated Wigner 3j, 6j and Gaunt Coefficients', J. Rasch and A. C. H. Yu, SIAM J. Sci. Comput. Volume 25, Issue 4, pp. 1416-1428 (2003) AUTHORS: - Jens Rasch (2009-03-24): initial version """ if int(j_1 * 2) != j_1 * 2 or int(j_2 * 2) != j_2 * 2 or \ int(j_3 * 2) != j_3 * 2: raise ValueError("j values must be integer or half integer") if int(m_1 * 2) != m_1 * 2 or int(m_2 * 2) != m_2 * 2 or \ int(m_3 * 2) != m_3 * 2: raise ValueError("m values must be integer or half integer") if (m_1 + m_2 + m_3 <> 0): return 0 prefid = Integer((-1) ** (int(j_1 - j_2 - m_3))) m_3 = -m_3 a1 = j_1 + j_2 - j_3 if (a1 < 0): return 0 a2 = j_1 - j_2 + j_3 if (a2 < 0): return 0 a3 = -j_1 + j_2 + j_3 if (a3 < 0): return 0 if (abs(m_1) > j_1) or (abs(m_2) > j_2) or (abs(m_3) > j_3): return 0 maxfact = max(j_1 + j_2 + j_3 + 1, j_1 + abs(m_1), j_2 + abs(m_2), \ j_3 + abs(m_3)) _calc_factlist(maxfact) argsqrt = Integer(_Factlist[int(j_1 + j_2 - j_3)] * \ _Factlist[int(j_1 - j_2 + j_3)] * \ _Factlist[int(-j_1 + j_2 + j_3)] * \ _Factlist[int(j_1 - m_1)] * \ _Factlist[int(j_1 + m_1)] * \ _Factlist[int(j_2 - m_2)] * \ _Factlist[int(j_2 + m_2)] * \ _Factlist[int(j_3 - m_3)] * \ _Factlist[int(j_3 + m_3)]) / \ _Factlist[int(j_1 + j_2 + j_3 + 1)] ressqrt = argsqrt.sqrt(prec) if type(ressqrt) is ComplexNumber: ressqrt = ressqrt.real() imin = max(-j_3 + j_1 + m_2, -j_3 + j_2 - m_1, 0) imax = min(j_2 + m_2, j_1 - m_1, j_1 + j_2 - j_3) sumres = 0 for ii in range(imin, imax + 1): den = _Factlist[ii] * \ _Factlist[int(ii + j_3 - j_1 - m_2)] * \ _Factlist[int(j_2 + m_2 - ii)] * \ _Factlist[int(j_1 - ii - m_1)] * \ _Factlist[int(ii + j_3 - j_2 + m_1)] * \ _Factlist[int(j_1 + j_2 - j_3 - ii)] sumres = sumres + Integer((-1) ** ii) / den res = ressqrt * sumres * prefid return res | c6a90d820f57455b2ff6063db98cb5e6f7a11f83 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/c6a90d820f57455b2ff6063db98cb5e6f7a11f83/wigner.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
341,
724,
264,
67,
23,
78,
12,
78,
67,
21,
16,
525,
67,
22,
16,
525,
67,
23,
16,
312,
67,
21,
16,
312,
67,
22,
16,
312,
67,
23,
16,
13382,
33,
7036,
4672,
436,
8395,
9029,
326,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
341,
724,
264,
67,
23,
78,
12,
78,
67,
21,
16,
525,
67,
22,
16,
525,
67,
23,
16,
312,
67,
21,
16,
312,
67,
22,
16,
312,
67,
23,
16,
13382,
33,
7036,
4672,
436,
8395,
9029,
326,... |
self.assertTrue(site.getuserbase().startswith('xoxo')) | self.assertTrue(site.getuserbase().startswith('xoxo'), site.getuserbase()) | def test_getuserbase(self): site.USER_BASE = None user_base = site.getuserbase() | c866588d2bb7dde3fc14ec64c6fe3ce476a08353 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/c866588d2bb7dde3fc14ec64c6fe3ce476a08353/test_site.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
588,
1355,
1969,
12,
2890,
4672,
2834,
18,
4714,
67,
8369,
273,
599,
729,
67,
1969,
273,
2834,
18,
588,
1355,
1969,
1435,
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,
1842,
67,
588,
1355,
1969,
12,
2890,
4672,
2834,
18,
4714,
67,
8369,
273,
599,
729,
67,
1969,
273,
2834,
18,
588,
1355,
1969,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
self._note("%s.wait(%s): timed out", self, timeout) try: self.__waiters.remove(waiter) except ValueError: pass | self._note("%s.wait(): got it", self) | def wait(self, timeout=None): me = currentThread() assert self._is_owned(), "wait() of un-acquire()d lock" waiter = _allocate_lock() waiter.acquire() self.__waiters.append(waiter) saved_state = self._release_save() if timeout is None: waiter.acquire() if __debug__: self._note("%s.wait(): got it", self) else: endtime = _time() + timeout delay = 0.000001 # 1 usec while 1: gotit = waiter.acquire(0) if gotit or _time() >= endtime: break _sleep(delay) if delay < 1.0: delay = delay * 2.0 if not gotit: if __debug__: self._note("%s.wait(%s): timed out", self, timeout) try: self.__waiters.remove(waiter) except ValueError: pass else: if __debug__: self._note("%s.wait(%s): got it", self, timeout) self._acquire_restore(saved_state) | 8e1ff6cb6ed43197ef43022e05c15595c6db4f9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/8e1ff6cb6ed43197ef43022e05c15595c6db4f9b/threading.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2529,
12,
2890,
16,
2021,
33,
7036,
4672,
1791,
273,
11800,
1435,
1815,
365,
6315,
291,
67,
995,
329,
9334,
315,
7048,
1435,
434,
640,
17,
1077,
1039,
1435,
72,
2176,
6,
17522,
273,
38... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2529,
12,
2890,
16,
2021,
33,
7036,
4672,
1791,
273,
11800,
1435,
1815,
365,
6315,
291,
67,
995,
329,
9334,
315,
7048,
1435,
434,
640,
17,
1077,
1039,
1435,
72,
2176,
6,
17522,
273,
38... |
color("green") left(130) | left(120) | def demo2(): # exercises some new and improved features speed('fast') width(3) # draw a segmented half-circle setheading(towards(0,0)) x,y = position() r = (x**2+y**2)**.5/2.0 right(90) pendown = True for i in range(18): if pendown: up() pendown = False else: down() pendown = True circle(r,10) sleep(2) reset() left(90) # draw a series of triangles l = 10 color("green") width(3) left(180) sp = 5 for i in range(-2,16): if i > 0: color(1.0-0.05*i,0,0.05*i) fill(1) color("green") for j in range(3): forward(l) left(120) l += 10 left(15) if sp > 0: sp = sp-1 speed(speeds[sp]) color(0.25,0,0.75) fill(0) color("green") left(130) up() forward(90) color("red") speed('fastest') down(); # create a second turtle and make the original pursue and catch it turtle=Turtle() turtle.reset() turtle.left(90) turtle.speed('normal') turtle.up() turtle.goto(280,40) turtle.left(24) turtle.down() turtle.speed('fast') turtle.color("blue") turtle.width(2) speed('fastest') # turn default turtle towards new turtle object setheading(towards(turtle)) while ( abs(position()[0]-turtle.position()[0])>4 or abs(position()[1]-turtle.position()[1])>4): turtle.forward(3.5) turtle.left(0.6) # turn default turtle towards new turtle object setheading(towards(turtle)) forward(4) write("CAUGHT! ", move=True) | 940f668a51bf98e56ee02b2398c53324deae8c87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/940f668a51bf98e56ee02b2398c53324deae8c87/turtle.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21477,
22,
13332,
468,
431,
12610,
6141,
2690,
394,
471,
13069,
2155,
4467,
8632,
2668,
8076,
6134,
1835,
12,
23,
13,
225,
468,
3724,
279,
3267,
329,
8816,
17,
18970,
444,
19948,
12,
310... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21477,
22,
13332,
468,
431,
12610,
6141,
2690,
394,
471,
13069,
2155,
4467,
8632,
2668,
8076,
6134,
1835,
12,
23,
13,
225,
468,
3724,
279,
3267,
329,
8816,
17,
18970,
444,
19948,
12,
310... |
(out, unused_err) = proc.communicate() | (out, err) = proc.communicate() if proc.returncode: display_error("installer -query failed: %s" % ( out.decode('UTF-8') + err.decode('UTF-8'))) return None | def getInstallerPkgInfo(filename): """Uses Apple's installer tool to get basic info about an installer item.""" installerinfo = {} proc = subprocess.Popen(['/usr/sbin/installer', '-pkginfo', '-verbose', '-plist', '-pkg', filename], bufsize=1, stdout=subprocess.PIPE, stderr=subprocess.PIPE) (out, unused_err) = proc.communicate() if out: # discard any lines at the beginning that aren't part of the plist lines = str(out).splitlines() plist = '' for index in range(len(lines)): try: plist = FoundationPlist.readPlistFromString( '\n'.join(lines[index:]) ) except FoundationPlist.NSPropertyListSerializationException: pass if plist: break if plist: if 'Size' in plist: installerinfo['installed_size'] = int(plist['Size']) installerinfo['description'] = plist.get('Description', '') if plist.get('Will Restart') == 'YES': installerinfo['RestartAction'] = 'RequireRestart' if 'Title' in plist: installerinfo['display_name'] = plist['Title'] proc = subprocess.Popen(['/usr/sbin/installer', '-query', 'RestartAction', '-pkg', filename], bufsize=1, stdout=subprocess.PIPE, stderr=subprocess.PIPE) (out, unused_err) = proc.communicate() if out: restartAction = str(out).rstrip('\n') if restartAction != 'None': installerinfo['RestartAction'] = restartAction return installerinfo | 33ffe3bffb1d0cbbbe667d1fdcfe912ad8117dfe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6241/33ffe3bffb1d0cbbbe667d1fdcfe912ad8117dfe/munkicommon.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
18678,
11264,
966,
12,
3459,
4672,
3536,
15128,
1716,
1802,
1807,
16050,
5226,
358,
336,
5337,
1123,
2973,
392,
16050,
761,
12123,
16050,
1376,
273,
2618,
5418,
273,
6652,
18,
52,
319... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
18678,
11264,
966,
12,
3459,
4672,
3536,
15128,
1716,
1802,
1807,
16050,
5226,
358,
336,
5337,
1123,
2973,
392,
16050,
761,
12123,
16050,
1376,
273,
2618,
5418,
273,
6652,
18,
52,
319... |
:raise: a `RuleError` if the expression is malformed | :raise RuleError: if the expression is malformed | def to_python(rule): """Convert a list/dict of rules or a `PluralRule` object into a regular Python function. This is useful in situations where you need a real function and don't are about the actual rule object: >>> func = to_python({'one': 'n is 1', 'few': 'n in 2..4'}) >>> func(1) 'one' >>> func(3) 'few' :param rules: the rules as list or dict, or a `PluralRule` object :return: a corresponding Python function :raise: a `RuleError` if the expression is malformed """ namespace = { 'IN': in_range, 'WITHIN': within_range, 'MOD': cldr_modulo } to_python = _PythonCompiler().compile result = ['def evaluate(n):'] for tag, ast in rule.abstract: result.append(' if (%s): return %r' % (to_python(ast), tag)) result.append(' return %r' % _fallback_tag) exec '\n'.join(result) in namespace return namespace['evaluate'] | fb93d5e6a281a832dcc919a243c028872a58df92 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8909/fb93d5e6a281a832dcc919a243c028872a58df92/plural.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
67,
8103,
12,
5345,
4672,
3536,
2723,
279,
666,
19,
1576,
434,
2931,
578,
279,
1375,
29497,
68,
733,
1368,
279,
6736,
6600,
445,
18,
225,
1220,
353,
5301,
316,
28474,
1625,
1846,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
67,
8103,
12,
5345,
4672,
3536,
2723,
279,
666,
19,
1576,
434,
2931,
578,
279,
1375,
29497,
68,
733,
1368,
279,
6736,
6600,
445,
18,
225,
1220,
353,
5301,
316,
28474,
1625,
1846,
... |
editR = re.compile('<li>.*?<a href=".*?" title=".*?">([^<]*)</a> <span class=\'user\'><a href=".*?" title=".*?">([^<]*?)</a></span>.*?(?:<span class=\'comment\'>(.*?)</span>)?</li>') | if self.site().version() < "1.4": editR = re.compile('<li>.*?<a href=".*?" title=".*?">([^<]*)</a> <span class=\'user\'><a href=".*?" title=".*?">([^<]*?)</a></span>.*?(?:<span class=\'comment\'>(.*?)</span>)?</li>') else: editR = re.compile('<li>.*?<a href=".*?" title=".*?">([^<]*)</a> <span class=\'history-user\'><a href=".*?" title=".*?">([^<]*?)</a></span>.*?(?:<span class=\'comment\'>(.*?)</span>)?</li>') | def getVersionHistory(self, forceReload = False): """ Loads the version history page and returns a list of tuples, where each tuple represents one edit and is built of edit date/time, user name, and edit summary. """ site = self.site() path = site.family.version_history_address(self.site().language(), self.urlname()) | 9cbd57b9fdad927d1182cfa986212a93ea08464f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/9cbd57b9fdad927d1182cfa986212a93ea08464f/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8343,
5623,
12,
2890,
16,
2944,
13013,
273,
1083,
4672,
3536,
4444,
87,
326,
1177,
4927,
1363,
471,
1135,
279,
666,
434,
10384,
16,
1625,
1517,
3193,
8686,
1245,
3874,
471,
353,
6650,
43... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8343,
5623,
12,
2890,
16,
2944,
13013,
273,
1083,
4672,
3536,
4444,
87,
326,
1177,
4927,
1363,
471,
1135,
279,
666,
434,
10384,
16,
1625,
1517,
3193,
8686,
1245,
3874,
471,
353,
6650,
43... |
if name.startswith('DEFAULTSORT:') or name.startswith(' continue | defaultKeys = self.site().siteinfo('magicwords')['defaultsort'] found = False for key in defaultKeys: if name.startswith(key): found = True break if found: continue | def templatesWithParams(self, thistxt=None, get_redirect=False): """Return a list of templates used on this Page. | 2c08e67912446a2945f3174757a5e48185a1c0e7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4404/2c08e67912446a2945f3174757a5e48185a1c0e7/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5539,
19591,
12,
2890,
16,
333,
5830,
33,
7036,
16,
336,
67,
7590,
33,
8381,
4672,
3536,
990,
279,
666,
434,
5539,
1399,
603,
333,
3460,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5539,
19591,
12,
2890,
16,
333,
5830,
33,
7036,
16,
336,
67,
7590,
33,
8381,
4672,
3536,
990,
279,
666,
434,
5539,
1399,
603,
333,
3460,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
return self.get() | pid = self.get() | def wrapper(self): """abstract the process of choosing an existing record or adding a new one""" try: return self.get() except NoneFound: return self.add() except TooManyFound: return self.choose() | 4e7c2028c973be5602a17c99abebb9efdd625c29 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/750/4e7c2028c973be5602a17c99abebb9efdd625c29/importrasta.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4053,
12,
2890,
4672,
3536,
17801,
326,
1207,
434,
24784,
310,
392,
2062,
1409,
578,
6534,
279,
394,
1245,
8395,
775,
30,
4231,
273,
365,
18,
588,
1435,
1335,
599,
2043,
30,
327,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4053,
12,
2890,
4672,
3536,
17801,
326,
1207,
434,
24784,
310,
392,
2062,
1409,
578,
6534,
279,
394,
1245,
8395,
775,
30,
4231,
273,
365,
18,
588,
1435,
1335,
599,
2043,
30,
327,
365,
... |
query = model.meta.Session.query(model.Proposal) query = query.filter(model.Proposal.instance==self.instance) query = query.filter(model.Proposal.delete_time==None) return query.count() | if self.__proposals_count is None: query = model.meta.Session.query(model.Proposal) query = query.filter(model.Proposal.instance==self.instance) query = query.filter(model.Proposal.delete_time==None) self.__proposals_count = query.count() return self.__proposals_count | def _num_proposals(self): query = model.meta.Session.query(model.Proposal) query = query.filter(model.Proposal.instance==self.instance) query = query.filter(model.Proposal.delete_time==None) return query.count() | 17cefb046f682a215e1568dbfc71559a73c3939a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10360/17cefb046f682a215e1568dbfc71559a73c3939a/instance_tiles.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2107,
67,
685,
22536,
12,
2890,
4672,
309,
365,
16186,
685,
22536,
67,
1883,
353,
599,
30,
843,
273,
938,
18,
3901,
18,
2157,
18,
2271,
12,
2284,
18,
14592,
13,
843,
273,
843,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2107,
67,
685,
22536,
12,
2890,
4672,
309,
365,
16186,
685,
22536,
67,
1883,
353,
599,
30,
843,
273,
938,
18,
3901,
18,
2157,
18,
2271,
12,
2284,
18,
14592,
13,
843,
273,
843,
1... |
raise Exception("Implemented in subclasses") | if platform.architecture()[0] == '64bit' and path.isdir('/usr/lib64/virtualbox'): conf.BIN = '/usr/lib64/virtualbox' elif platform.architecture()[0] == '32bit' and path.isdir('/usr/lib/virtualbox'): conf.BIN = '/usr/lib/virtualbox' else: conf.BIN = path.dirname(self.call(["which", "VirtualBox"], output=True)[1].strip()) OSBackend.update_env(self) OSBackend.look_for_virtualbox(self) | def look_for_virtualbox(self): raise Exception("Implemented in subclasses") | 0b8f257b05178bfc46cf1ab8a677c74ccd1ca05e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1208/0b8f257b05178bfc46cf1ab8a677c74ccd1ca05e/linuxbackend.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2324,
67,
1884,
67,
12384,
2147,
12,
2890,
4672,
1002,
1185,
2932,
8644,
316,
15320,
7923,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2324,
67,
1884,
67,
12384,
2147,
12,
2890,
4672,
1002,
1185,
2932,
8644,
316,
15320,
7923,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
self.check_sizeof(s, basicsize,\ size2=basicsize + sys.getsizeof(str(s))) | check(s, basicsize, size2=basicsize + sys.getsizeof(str(s))) | def test_specialtypes(self): h = self.header size = self.calcsize # dict self.check_sizeof({}, size(h + '3P2P') + 8*size('P2P')) longdict = {1:1, 2:2, 3:3, 4:4, 5:5, 6:6, 7:7, 8:8} self.check_sizeof(longdict, size(h + '3P2P') + (8+16)*size('P2P')) # unicode usize = len(u'\0'.encode('unicode-internal')) samples = [u'', u'1'*100] # we need to test for both sizes, because we don't know if the string # has been cached for s in samples: basicsize = size(h + 'PPlP') + usize * (len(s) + 1) self.check_sizeof(s, basicsize,\ size2=basicsize + sys.getsizeof(str(s))) # XXX trigger caching encoded version as Python string s = samples[1] try: getattr(sys, s) except AttributeError: pass finally: self.check_sizeof(s, basicsize + sys.getsizeof(str(s))) | 2a9c012d274c588c51bc5660baff9bd0676bd399 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/2a9c012d274c588c51bc5660baff9bd0676bd399/test_sys.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9371,
2352,
12,
2890,
4672,
366,
273,
365,
18,
3374,
963,
273,
365,
18,
12448,
1467,
468,
2065,
365,
18,
1893,
67,
1467,
792,
23506,
16,
963,
12,
76,
397,
296,
23,
52,
22,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9371,
2352,
12,
2890,
4672,
366,
273,
365,
18,
3374,
963,
273,
365,
18,
12448,
1467,
468,
2065,
365,
18,
1893,
67,
1467,
792,
23506,
16,
963,
12,
76,
397,
296,
23,
52,
22,
... |
if len(r)<8: return None | if len(r)<8: return None | def socks5ParseResponse(r): if len(r)<8: return None version, reply, rsv, atype = struct.unpack("!BBBB",r[:4]) assert version==5 assert rsv==0 if reply != 0x00: return "ERROR" assert atype in (0x01,0x04) expected_len = 4 + ({1:4,4:16}[atype]) + 2 if len(r) < expected_len: return None elif len(r) > expected_len: raise ValueError("Overlong socks5 reply!") addr = r[4:-2] if atype == 0x01: return "%d.%d.%d.%d"%tuple(map(ord,addr)) else: # not really the right way to format IPv6 return "IPv6: %s"%(":".join([hex(ord(c)) for c in addr])) | ba578f0ed63128d4d245b1d40c0ac01d90f8a0da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7483/ba578f0ed63128d4d245b1d40c0ac01d90f8a0da/tor-resolve.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7313,
87,
25,
3201,
1064,
12,
86,
4672,
309,
562,
12,
86,
13,
32,
28,
30,
327,
599,
1177,
16,
4332,
16,
3597,
90,
16,
30965,
273,
1958,
18,
17309,
2932,
5,
9676,
9676,
3113,
86,
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,
7313,
87,
25,
3201,
1064,
12,
86,
4672,
309,
562,
12,
86,
13,
32,
28,
30,
327,
599,
1177,
16,
4332,
16,
3597,
90,
16,
30965,
273,
1958,
18,
17309,
2932,
5,
9676,
9676,
3113,
86,
10... |
self.assertTrue(u.fp.fp._sock.gettimeout() is None) | self.assertTrue(u.fp.fp.raw._sock.gettimeout() is None) | def test_ftp_basic(self): u = urllib2.urlopen("ftp://ftp.mirror.nl/pub/mirror/gnu/") self.assertTrue(u.fp.fp._sock.gettimeout() is None) | cf2f41919c226d1ac04ea74a0138eae3af030554 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/cf2f41919c226d1ac04ea74a0138eae3af030554/test_urllib2net.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
11727,
67,
13240,
12,
2890,
4672,
582,
273,
11527,
22,
18,
295,
18589,
2932,
11727,
2207,
11727,
18,
27197,
18,
14039,
19,
10174,
19,
27197,
19,
1600,
89,
4898,
13,
365,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
11727,
67,
13240,
12,
2890,
4672,
582,
273,
11527,
22,
18,
295,
18589,
2932,
11727,
2207,
11727,
18,
27197,
18,
14039,
19,
10174,
19,
27197,
19,
1600,
89,
4898,
13,
365,
18,
... |
self.calc.xStr == ' 0' and self.calc.flag == Mode.entryMode \ and letter in ('X', 'O', 'B', 'D'): | (self.calc.xStr == ' 0' or \ (self.calc.stack[0] == 0.0 and self.calc.base != 10)) and \ self.calc.flag == Mode.entryMode and \ letter in ('X', 'O', 'B', 'D'): | def keyPressEvent(self, keyEvent): """Event handler for keys - checks for numbers and typed commands""" button = self.mainDict.get(keyEvent.key()) if not self.entryStr and button: button.clickEvent() button.setDown(True) return letter = str(keyEvent.text()).upper() if not self.entryStr and self.calc.base == 16 and \ 'A' <= letter <= 'F': self.issueCmd(keyEvent.text()) elif keyEvent.modifiers() == QtCore.Qt.AltModifier and \ self.altBaseView and self.altBaseView.isVisible() and \ letter in ('X', 'O', 'B', 'D'): self.altBaseView.setCodedBase(letter, False) elif self.altBaseView and self.altBaseView.isVisible() and \ self.calc.xStr == ' 0' and self.calc.flag == Mode.entryMode \ and letter in ('X', 'O', 'B', 'D'): self.altBaseView.setCodedBase(letter, True) elif not self.entryStr and keyEvent.key() == QtCore.Qt.Key_Backspace: button = self.cmdDict['<-'] button.clickEvent() button.tmpDown(300) elif not self.entryStr and keyEvent.key() == QtCore.Qt.Key_Escape: self.popupMenu.popup(self.mapToGlobal(QtCore.QPoint(0, 0))) elif not self.textEntry(str(keyEvent.text())): QtGui.QWidget.keyPressEvent(self, keyEvent) | 2a379d5ed877d4bdad1ac9e468bf5879c2f17ae6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3071/2a379d5ed877d4bdad1ac9e468bf5879c2f17ae6/calcdlg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
498,
11840,
1133,
12,
2890,
16,
498,
1133,
4672,
3536,
1133,
1838,
364,
1311,
300,
4271,
364,
5600,
471,
9092,
4364,
8395,
3568,
273,
365,
18,
5254,
5014,
18,
588,
12,
856,
1133,
18,
8... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
498,
11840,
1133,
12,
2890,
16,
498,
1133,
4672,
3536,
1133,
1838,
364,
1311,
300,
4271,
364,
5600,
471,
9092,
4364,
8395,
3568,
273,
365,
18,
5254,
5014,
18,
588,
12,
856,
1133,
18,
8... |
raise ParseError("Could not find %s" % name) | return _proxy_base(parse_repr=str(name)) | def find_base(name, parent_docs): assert isinstance(name, DottedName) # Find the variable containing the base. base_var = lookup_variable(name, parent_docs) if base_var is None: # If it looks like it's in an external module, then try # "importing" it. if (lookup_name(name[0], parent_docs).imported_from not in (None, UNKNOWN)): _import_var(name, parent_docs) base_var = lookup_variable(name, parent_docs) # If we still don't have a var containing the base, give up. if base_var is None: raise ParseError("Could not find %s" % name) # If the variable has a value, return that value. if base_var.value != UNKNOWN: return base_var.value # Otherwise, if BASE_HANDLING is 'parse', try parsing the docs for # the base class; if that fails, or if BASE_HANDLING is 'link', # just make a proxy object. if base_var.imported_from not in (None, UNKNOWN): if BASE_HANDLING == 'parse': try: return parse_docs(name=base_var.imported_from) except ParseError: pass # Either BASE_HANDLING='link' or parsing the base class failed; # return a proxy value for the base class. return ClassDoc(variables={}, sort_spec=[], bases=[], subclasses=[], proxy_for=base_var.imported_from, docs_extracted_by='parser') else: raise ParseError() # no value available for var. | 492a96145d3bf6e5fb5c6e9919cd061994c164e1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/492a96145d3bf6e5fb5c6e9919cd061994c164e1/docparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
1969,
12,
529,
16,
982,
67,
8532,
4672,
1815,
1549,
12,
529,
16,
17502,
2344,
461,
13,
225,
468,
4163,
326,
2190,
4191,
326,
1026,
18,
1026,
67,
1401,
273,
3689,
67,
6105,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
1969,
12,
529,
16,
982,
67,
8532,
4672,
1815,
1549,
12,
529,
16,
17502,
2344,
461,
13,
225,
468,
4163,
326,
2190,
4191,
326,
1026,
18,
1026,
67,
1401,
273,
3689,
67,
6105,
... |
if authors: authors_text = ', '.join([a for a in authors if a != 'ANONIPEDITS:0']) authors_text = re.sub(u'ANONIPEDITS:(?P<num>\d+)', u'\g<num> %s' % _(u'anonymous edits'), authors_text) authors_text = self.font_switcher.fontifyText(xmlescape(authors_text)) else: authors_text = '-' | authors_text = self._filterAnonIpEdits(authors) | def writeImageMetainfo(self): if not self.img_meta_info: return [] elements = [] elements.append(Paragraph(_('Image Sources, Licenses and Contributors'), heading_style(mode='article'))) for _id, title, url, license, authors in sorted(self.img_meta_info.values()): if authors: authors_text = ', '.join([a for a in authors if a != 'ANONIPEDITS:0']) authors_text = re.sub(u'ANONIPEDITS:(?P<num>\d+)', u'\g<num> %s' % _(u'anonymous edits'), authors_text) authors_text = self.font_switcher.fontifyText(xmlescape(authors_text)) else: authors_text = '-' if license: license_txt = '<i>%(license_label)s</i>: %(license)s ' % {'license_label': _('License'), 'license': self.font_switcher.fontifyText(license), } else: license_txt = _('unknown') txt = '<b>%(title)s</b> <i>%(source_label)s</i>: %(source)s %(license_txt)s<i>%(contribs_label)s</i>: %(contribs)s ' % { 'title': title, 'source_label': _('Source'), 'source': self.font_switcher.fontifyText(xmlescape(url)), 'license_txt': license_txt, 'contribs_label': _('Contributors'), 'contribs': authors_text, } elements.append(Paragraph(txt, text_style('img_attribution'))) return elements | 8353d3a775298949e60828db5b05c98244cdf570 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12390/8353d3a775298949e60828db5b05c98244cdf570/rlwriter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
2040,
12244,
28935,
12,
2890,
4672,
309,
486,
365,
18,
6081,
67,
3901,
67,
1376,
30,
327,
5378,
2186,
273,
5378,
2186,
18,
6923,
12,
17719,
24899,
2668,
2040,
30825,
16,
511,
16548... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2040,
12244,
28935,
12,
2890,
4672,
309,
486,
365,
18,
6081,
67,
3901,
67,
1376,
30,
327,
5378,
2186,
273,
5378,
2186,
18,
6923,
12,
17719,
24899,
2668,
2040,
30825,
16,
511,
16548... |
self._obj.tectValue = rbool(not not val) | self._obj.textValue = rbool(not not val) | def setValue (self, val): self._obj.tectValue = rbool(not not val) | c622165a677f4cb965b5553b8e94e56053d0e0ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12409/c622165a677f4cb965b5553b8e94e56053d0e0ab/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5524,
261,
2890,
16,
1244,
4672,
365,
6315,
2603,
18,
955,
620,
273,
436,
6430,
12,
902,
486,
1244,
13,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5524,
261,
2890,
16,
1244,
4672,
365,
6315,
2603,
18,
955,
620,
273,
436,
6430,
12,
902,
486,
1244,
13,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
ret = hook.hook(lui, repo, "pre-%s" % cmd, False, args=" ".join(fullargs)) if ret: return ret ret = _runcommand(ui, options, cmd, d) hook.hook(lui, repo, "post-%s" % cmd, False, args=" ".join(fullargs), result = ret) return ret | return runcommand(lui, repo, cmd, fullargs, ui, options, d) | def print_time(): t = get_times() ui.warn(_("Time: real %.3f secs (user %.3f+%.3f sys %.3f+%.3f)\n") % (t[4]-s[4], t[0]-s[0], t[2]-s[2], t[1]-s[1], t[3]-s[3])) | 090150447cc41e6c0091d7fab15bc6a6b5db17b7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11312/090150447cc41e6c0091d7fab15bc6a6b5db17b7/dispatch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
67,
957,
13332,
268,
273,
336,
67,
8293,
1435,
5915,
18,
8935,
24899,
2932,
950,
30,
2863,
12639,
23,
74,
18043,
261,
1355,
12639,
23,
74,
15,
9,
18,
23,
74,
2589,
12639,
23,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
67,
957,
13332,
268,
273,
336,
67,
8293,
1435,
5915,
18,
8935,
24899,
2932,
950,
30,
2863,
12639,
23,
74,
18043,
261,
1355,
12639,
23,
74,
15,
9,
18,
23,
74,
2589,
12639,
23,
7... |
staticdir = cdict.get("static_dir", "") if not staticdir: raise Exception("You must set static_dir in your config file.") | def render_url(cdict, pathinfo, querystring=""): """ Takes a url and a querystring and renders the page that corresponds with that by creating a Request and a PyBlosxom object and passing it through. It then returns the resulting Response. This returns a PyBlosxom ``Response`` object. :param cdict: the config.py dict :param pathinfo: the ``PATH_INFO`` string; example: ``/dev/pyblosxom/firstpost.html`` :param querystring: the querystring (if any); example: debug=yes """ staticdir = cdict.get("static_dir", "") # if there is no staticdir, then they're not set up for static # rendering. if not staticdir: raise Exception("You must set static_dir in your config file.") from pyblosxom import PyBlosxom env = { "HTTP_HOST": "localhost", "HTTP_REFERER": "", "HTTP_USER_AGENT": "static renderer", "PATH_INFO": pathinfo, "QUERY_STRING": querystring, "REMOTE_ADDR": "", "REQUEST_METHOD": "GET", "REQUEST_URI": pathinfo + "?" + querystring, "SCRIPT_NAME": "", "wsgi.errors": sys.stderr, "wsgi.input": None } data = {"STATIC": 1} p = PyBlosxom(cdict, env, data) p.run(static=True) return p.getResponse() | 0a6e05f7d56eda3aa55ec98939b2dc9164bbb1e6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11836/0a6e05f7d56eda3aa55ec98939b2dc9164bbb1e6/tools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
718,
12,
71,
1576,
16,
11629,
16,
20741,
1546,
6,
4672,
3536,
23004,
279,
880,
471,
279,
20741,
471,
19567,
326,
1363,
716,
13955,
598,
716,
635,
4979,
279,
1567,
471,
279,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
718,
12,
71,
1576,
16,
11629,
16,
20741,
1546,
6,
4672,
3536,
23004,
279,
880,
471,
279,
20741,
471,
19567,
326,
1363,
716,
13955,
598,
716,
635,
4979,
279,
1567,
471,
279,
4... | |
res[event.id]['register_current'] = number and number[0] or 0.0 | res[event.id]['register_current'] = number and number[0] | def _get_register(self, cr, uid, ids, fields, args, context=None): """Get Confirm or uncofirm register value. @param ids: List of Event registration type's id @param fields: List of function fields(register_current and register_prospect). @param context: A standard dictionary for contextual values @return: Dictionary of function fields value. """ register_pool = self.pool.get('event.registration') res = {} for event in self.browse(cr, uid, ids, context): res[event.id] = {} for field in fields: res[event.id][field] = False state = [] if 'register_current' in fields: state += ['open', 'done'] if 'register_prospect' in fields: state.append('draft') | 39655a3578b18c3aac36322c556e4b06d5203a00 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/39655a3578b18c3aac36322c556e4b06d5203a00/event.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
4861,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
1466,
16,
833,
16,
819,
33,
7036,
4672,
3536,
967,
17580,
578,
6301,
792,
3985,
1744,
460,
18,
632,
891,
3258,
30,
987... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
4861,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
1466,
16,
833,
16,
819,
33,
7036,
4672,
3536,
967,
17580,
578,
6301,
792,
3985,
1744,
460,
18,
632,
891,
3258,
30,
987... |
edje_obj.signal_callback_add("mouse,clicked,1", p + "_area", icon_clicked_cb) | edje_obj.signal_callback_add("mouse,clicked,1", p + "_area", icon_clicked_cb, p) | def icon_clicked_cb(edje_obj, emission, source): icon = source.replace("_area", "") if edje_obj.part_state_get(icon) == ("default", 0.0): global stop_pulsing_id if stop_pulsing_id is not None: stop_pulsing_id.stop() stop_pulsing_id = ecore.timer_add(STOP_PULSING_TIMEOUT, stop_pulsing, edje_obj, icon) edje_obj.signal_emit("select_" + icon, "") for p in parts: if p != icon: edje_obj.signal_emit("unselect_" + p, "") | 2dfffb71f0dd80311fb5ff861e7f1f5e4ee58cae /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12343/2dfffb71f0dd80311fb5ff861e7f1f5e4ee58cae/01-app_launcher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4126,
67,
7475,
329,
67,
7358,
12,
329,
78,
73,
67,
2603,
16,
801,
19710,
16,
1084,
4672,
4126,
273,
1084,
18,
2079,
2932,
67,
5036,
3113,
1408,
13,
309,
1675,
78,
73,
67,
2603,
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,
4126,
67,
7475,
329,
67,
7358,
12,
329,
78,
73,
67,
2603,
16,
801,
19710,
16,
1084,
4672,
4126,
273,
1084,
18,
2079,
2932,
67,
5036,
3113,
1408,
13,
309,
1675,
78,
73,
67,
2603,
18,
... |
if newname is None: return None, None return newname, objects[newname] | if newname is not None: matches.append((newname, objects[newname])) return matches | def find_obj(self, env, modname, classname, name, type, searchorder=0): """ Find a Python object for "name", perhaps using the given module and/or classname. """ # skip parens if name[-2:] == '()': name = name[:-2] | 09e6001e7a99990880a17325c1be36dcdae82d78 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5532/09e6001e7a99990880a17325c1be36dcdae82d78/python.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
2603,
12,
2890,
16,
1550,
16,
16037,
16,
7479,
16,
508,
16,
618,
16,
1623,
1019,
33,
20,
4672,
3536,
4163,
279,
6600,
733,
364,
315,
529,
3113,
26282,
1450,
326,
864,
1605,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
2603,
12,
2890,
16,
1550,
16,
16037,
16,
7479,
16,
508,
16,
618,
16,
1623,
1019,
33,
20,
4672,
3536,
4163,
279,
6600,
733,
364,
315,
529,
3113,
26282,
1450,
326,
864,
1605,
... |
if data.get('negate', 'false') == 'true': | if data.get('negate', 'false') == 'true' data.get('negate', 'false') == 'True': | def __init__(self, data, idict, parent=None): self.data = data self.contents = {} if parent == None: self.predicate = lambda x:True else: predicate = parent.predicate if data.get('negate', 'false') == 'true': psrc = self.nraw else: psrc = self.raw if data.tag in psrc.keys(): self.predicate = eval(psrc[data.tag] % (data.get('name')), {'predicate':predicate}) else: raise Exception mytype = self.__class__ self.children = [] for item in data.getchildren(): if item.tag in self.ignore: continue elif item.tag in self.containers: self.children.append(mytype(item, idict, self)) else: try: self.contents[item.tag][item.get('name')] = item.attrib except KeyError: self.contents[item.tag] = {item.get('name'):item.attrib} if item.text: self.contents[item.tag]['__text__'] = item.text try: idict[item.tag].append(item.get('name')) except KeyError: idict[item.tag] = [item.get('name')] | 2b822c36ae87802b744a908e57e1ef7bdc485d16 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11867/2b822c36ae87802b744a908e57e1ef7bdc485d16/Plugin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
501,
16,
612,
933,
16,
982,
33,
7036,
4672,
365,
18,
892,
273,
501,
365,
18,
3980,
273,
2618,
309,
982,
422,
599,
30,
365,
18,
18344,
273,
3195,
619,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
501,
16,
612,
933,
16,
982,
33,
7036,
4672,
365,
18,
892,
273,
501,
365,
18,
3980,
273,
2618,
309,
982,
422,
599,
30,
365,
18,
18344,
273,
3195,
619,
... |
tar.add("image/"+slide.image.rpartition('/')[2]) | tar.add(slide.image, os.path.join("image", os.path.split(slide.image)[1])) | def export_lib(self, *args): 'Export the full library to file.' dlg = gtk.FileChooserDialog(_("Export Library"), exposong.application.main, gtk.FILE_CHOOSER_ACTION_SAVE, (gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT, gtk.STOCK_OK, gtk.RESPONSE_ACCEPT)) dlg.add_filter(_FILTER) dlg.set_do_overwrite_confirmation(True) dlg.set_current_name(_("exposong_library.expo")) if dlg.run() == gtk.RESPONSE_ACCEPT: #Make sure schedules are up to date. exposong.application.main._save_schedules() oldpath = os.getcwd() os.chdir(DATA_PATH) fname = dlg.get_filename() if not fname.endswith(".expo"): fname += ".expo" tar = tarfile.open(fname, "w:gz") library = exposong.application.main.library itr = library.get_iter_first() while itr: tar.add("pres/"+library.get_value(itr, 0).filename) if library.get_value(itr, 0).get_type() == 'image': for slide in library.get_value(itr, 0).slides: tar.add("image/"+slide.image.rpartition('/')[2]) itr = library.iter_next(itr) model = schedlist.schedlist.get_model() itr = model.iter_children(schedlist.schedlist.custom_schedules) while itr: tar.add("sched/"+model.get_value(itr, 0).filename) itr = model.iter_next(itr) os.chdir(oldpath) tar.close() dlg.hide() | b0a70f3c24377ecc55b17a2ae8333a6adf01843f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5029/b0a70f3c24377ecc55b17a2ae8333a6adf01843f/export_import.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3359,
67,
2941,
12,
2890,
16,
380,
1968,
4672,
296,
6144,
326,
1983,
5313,
358,
585,
1093,
25840,
273,
22718,
18,
812,
17324,
6353,
24899,
2932,
6144,
18694,
6,
3631,
431,
917,
932,
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,
3359,
67,
2941,
12,
2890,
16,
380,
1968,
4672,
296,
6144,
326,
1983,
5313,
358,
585,
1093,
25840,
273,
22718,
18,
812,
17324,
6353,
24899,
2932,
6144,
18694,
6,
3631,
431,
917,
932,
18,
... |
def writeTraceableResultConv(f, type, paramNum, result): | def writeTraceableResultConv(f, type, paramNum): | def writeTraceableResultConv(f, type, paramNum, result): typeName = getBuiltinOrNativeTypeName(type) if typeName is not None: template = traceableResultConvTemplates.get(typeName) if template is not None: values = { 'result': result, 'errorStr': getFailureString( getTraceInfoDefaultReturn(type), 2) } f.write(substitute(template, values)) return # else fall through; this type isn't supported yet elif isInterfaceType(type): if isVariantType(type): f.write(" JSBool ok = xpc_qsVariantToJsval(ccx, %s, %d, " "tvr.addr());\n" % (result, paramNum)) else: f.write(" AutoMarkingNativeInterfacePtr resultiface(ccx, " "%s_Interface(ccx));\n" % type.name) f.write(" JSBool ok = xpc_qsXPCOMObjectToJsval(ccx, %s, " "xpc_qsGetWrapperCache(%s), resultiface, tvr.addr());\n" % (result, result)) f.write(" if (!ok) {\n"); writeFailure(f, getTraceInfoDefaultReturn(type), 2) f.write(" return *tvr.addr();\n") return warn("Unable to convert result of type %s" % typeName) f.write(" !; // TODO - Convert `result` to jsval, store in rval.\n") f.write(" return xpc_qsThrow(cx, NS_ERROR_UNEXPECTED); // FIXME\n") | d4894752c17d8324526f58a8ae8c82f1bcfbecae /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11102/d4894752c17d8324526f58a8ae8c82f1bcfbecae/qsgen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
3448,
429,
1253,
17467,
12,
74,
16,
618,
16,
579,
2578,
4672,
8173,
273,
2882,
4853,
267,
1162,
9220,
7947,
12,
723,
13,
309,
8173,
353,
486,
599,
30,
1542,
273,
2606,
429,
1253,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3448,
429,
1253,
17467,
12,
74,
16,
618,
16,
579,
2578,
4672,
8173,
273,
2882,
4853,
267,
1162,
9220,
7947,
12,
723,
13,
309,
8173,
353,
486,
599,
30,
1542,
273,
2606,
429,
1253,... |
if not isSelected and self.lbVals.count() > 0: self.lbVals.setSelected(0, True) | if not isSelected: if self.lbVals.count() > 0: self.lbVals.setSelected(0, True) else: self.currentVals = [] | def updateValuesStack(self): """Raises appropriate widget for values from stack, fills listBox for discrete attributes, shows statistics for continuous attributes. """ if self.currentVar: varType = self.currentVar.varType else: varType = 0 currentOper = self.currentOperatorDict.get(varType,None) if currentOper: # raise widget self.valuesStack.raiseWidget(currentOper.varType) if currentOper.varType==orange.VarTypes.Discrete: # store selected discrete values, refill values list box, set single/multi selection mode, restore selected item(s) selectedItemNames = [] for i in range(self.lbVals.count()): if self.lbVals.isSelected(i): selectedItemNames.append(str(self.lbVals.item(i).text())) self.lbVals.clear() curVarValues = [] for value in self.currentVar: curVarValues.append(str(value)) curVarValues.sort() for value in curVarValues: self.lbVals.insertItem(str(value)) if currentOper.isInterval: self.lbVals.setSelectionMode(QListBox.Multi) else: self.lbVals.setSelectionMode(QListBox.Single) isSelected = False for name in selectedItemNames: item = self.lbVals.findItem(name) if item: self.lbVals.setSelected(item, True) isSelected = True if not currentOper.isInterval: break if not isSelected and self.lbVals.count() > 0: self.lbVals.setSelected(0, True) elif currentOper.varType==orange.VarTypes.Continuous: # show / hide "and" label and 2nd line edit box if currentOper.isInterval: self.lblAndCon.show() self.leNum2.show() else: self.lblAndCon.hide() self.leNum2.hide() # display attribute statistics if self.currentVar in self.data.domain.variables: basstat = self.bas[self.currentVar] else: basstat = orange.BasicAttrStat(self.currentVar, self.data) | 16c678170b87bb285a80f189d13fb437d1c27ecb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6366/16c678170b87bb285a80f189d13fb437d1c27ecb/OWSelectData.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
1972,
2624,
12,
2890,
4672,
3536,
12649,
6141,
5505,
3604,
364,
924,
628,
2110,
16,
21652,
666,
3514,
364,
20035,
1677,
16,
17975,
7691,
364,
17235,
1677,
18,
3536,
309,
365,
18,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
1972,
2624,
12,
2890,
4672,
3536,
12649,
6141,
5505,
3604,
364,
924,
628,
2110,
16,
21652,
666,
3514,
364,
20035,
1677,
16,
17975,
7691,
364,
17235,
1677,
18,
3536,
309,
365,
18,
2... |
return self.get_cell(cell.x, cell.y - 1) | return self.get_cell(cell.i, cell.j - 1) | def get_neighbor(self, cell, direction): '''Get the neighbor HexCell in the given direction which is one of self.UP, self.DOWN, self.UP_LEFT, self.UP_RIGHT, self.DOWN_LEFT or self.DOWN_RIGHT. | ae46287e32a1e7a487f4f47ee34d687ee3d6604c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7473/ae46287e32a1e7a487f4f47ee34d687ee3d6604c/tiles.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
18168,
12,
2890,
16,
2484,
16,
4068,
4672,
9163,
967,
326,
10553,
15734,
4020,
316,
326,
864,
4068,
1492,
353,
1245,
434,
365,
18,
3079,
16,
365,
18,
12711,
16,
365,
18,
3079,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
18168,
12,
2890,
16,
2484,
16,
4068,
4672,
9163,
967,
326,
10553,
15734,
4020,
316,
326,
864,
4068,
1492,
353,
1245,
434,
365,
18,
3079,
16,
365,
18,
12711,
16,
365,
18,
3079,... |
titleTag.insert(0,self.title + self.title) | titleTag.insert(0,self.title) | def generateOPF(self): | 073710f405f291eedc7992694a78db2be7983d10 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/073710f405f291eedc7992694a78db2be7983d10/catalog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
3665,
42,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
3665,
42,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
return str +'</UL>\n' | return str +'</ul>\n' | def _class_tree(self): str = '<UL>\n' docs = self._docmap.items() docs.sort() for (uid, doc) in docs: if not isinstance(doc, ClassDoc): continue hasbase = 0 for base in doc.bases(): if self._docmap.has_key(base.target()): hasbase = 1 if not hasbase: str += self._class_tree_item(uid) return str +'</UL>\n' | 1b52b16120989cc834166571a9a1e9b8676d968f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/1b52b16120989cc834166571a9a1e9b8676d968f/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1106,
67,
3413,
12,
2890,
4672,
609,
273,
2368,
1506,
5333,
82,
11,
3270,
273,
365,
6315,
2434,
1458,
18,
3319,
1435,
3270,
18,
3804,
1435,
364,
261,
1911,
16,
997,
13,
316,
3270,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1106,
67,
3413,
12,
2890,
4672,
609,
273,
2368,
1506,
5333,
82,
11,
3270,
273,
365,
6315,
2434,
1458,
18,
3319,
1435,
3270,
18,
3804,
1435,
364,
261,
1911,
16,
997,
13,
316,
3270,... |
this = apply(_quickfix.new_OrdRejReason, args) | this = _quickfix.new_OrdRejReason(*args) | def __init__(self, *args): this = apply(_quickfix.new_OrdRejReason, args) try: self.this.append(this) except: self.this = this | 7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
15383,
426,
78,
8385,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
15383,
426,
78,
8385,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
... |
p = 10**(event.xdata) pdot = 10**(event.ydata) | p = event.xdata pdot = event.ydata | def mousepress(event): """Event handler for MouseEvent ('button_press_event'). """ if event.inaxes and event.button == 2: p = 10**(event.xdata) pdot = 10**(event.ydata) bfield, age, edot = params_from_ppdot(p, pdot) print "Coordinates:" print "\tPeriod (s): %g, P-dot (s/s): %g" % (p, pdot) print "\tB-field (G): %g" % bfield print "\tAge (yr): %g" % age print "\tE-dot (erg/s): %g" % edot | eea39b5ffa200e203a272a577114678d00cc2707 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3485/eea39b5ffa200e203a272a577114678d00cc2707/pyppdot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7644,
1028,
12,
2575,
4672,
3536,
1133,
1838,
364,
17013,
1133,
7707,
5391,
67,
1028,
67,
2575,
16063,
3536,
309,
871,
18,
267,
10855,
471,
871,
18,
5391,
422,
576,
30,
293,
273,
871,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7644,
1028,
12,
2575,
4672,
3536,
1133,
1838,
364,
17013,
1133,
7707,
5391,
67,
1028,
67,
2575,
16063,
3536,
309,
871,
18,
267,
10855,
471,
871,
18,
5391,
422,
576,
30,
293,
273,
871,
... |
def writexml(self, writer): | def writexml(self, writer, indent="", addindent="", newl=""): | def writexml(self, writer): writer.write('<?xml version="1.0" ?>\n') for node in self.childNodes: node.writexml(writer) | 46fa39ab1d1e2f14c1b44c5e81c34c5f6cfb9a58 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/46fa39ab1d1e2f14c1b44c5e81c34c5f6cfb9a58/minidom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2518,
338,
781,
12,
2890,
16,
2633,
16,
3504,
1546,
3113,
527,
9355,
1546,
3113,
394,
80,
1546,
6,
4672,
2633,
18,
2626,
2668,
12880,
2902,
1177,
1546,
21,
18,
20,
6,
692,
5333,
82,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2518,
338,
781,
12,
2890,
16,
2633,
16,
3504,
1546,
3113,
527,
9355,
1546,
3113,
394,
80,
1546,
6,
4672,
2633,
18,
2626,
2668,
12880,
2902,
1177,
1546,
21,
18,
20,
6,
692,
5333,
82,
... |
else | else: | def __init__(data = None) if data == None: quickfix.IntField.__init__(self, 897) else quickfix.IntField.__init__(self, 897, data) | 484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
1702,
974,
16186,
2738,
972,
12,
2890,
16,
1725,
10580,
13,
469,
30,
9549,
904,
18,
1702,
974,
16186,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
1702,
974,
16186,
2738,
972,
12,
2890,
16,
1725,
10580,
13,
469,
30,
9549,
904,
18,
1702,
974,
16186,
2... |
server = buf[1].strip() | url = buf[1].strip() | def build(self, server, pkg): # maybe later support protocolls (the first item) other than git? scm = pkg.split('/')[0][:-1] tree = pkg.split('/')[2] pkgarr = pkg.split('/')[3].split('-') pkgname = "-".join(pkgarr[:-3]) pkgver = "-".join(pkgarr[-3:-1]) arch = pkgarr[-1] self.log(pkg, "starting build") sock = os.popen(". ~/.repoman.conf; echo $fst_root; echo $%s_servers" % tree) buf = sock.readlines() sock.close() fst_root = buf[0].strip() server = buf[1].strip() try: os.stat(fst_root) except OSError: os.makedirs(fst_root) os.chdir(fst_root) if scm not in ["git", "darcs"]: self.log(pkg, "unkown scm, aborting") return try: os.stat(tree) os.chdir(tree) if scm == "git": self.system("git pull") self.system("git checkout -f") elif scm == "darcs": self.system("darcs pull -a") self.system("darcs revert -a") except OSError: if scm == "git": self.system("git clone %s %s" % (server, tree)) elif scm == "darcs": self.system("darcs get --partial" % (server, tree)) try: os.chdir(tree) except OSError: self.log(pkg, "failed to get the repo") return self.go(pkgname) if scm == "git": self.system("git clean -x -d") elif scm == "darcs": junk = [] junk.append(glob.glob("*.fpm")) junk.append(glob.glob("*.log")) junk.append(glob.glob("*.log.bz2")) for i in junk: os.unlink(junk) self.system("sudo makepkg -t %s -C" % tree) if self.system("sudo makepkg -t %s -cu" % tree): self.log(pkg, "makepkg failed") server.report_result(pkg, 1) return self.system("repoman -t %s -k sync" % tree) self.log(pkg, "build finished") server.report_result(pkg, 0) | 6e1a504052dad00646ff82cb8e1afeadccf8dcf5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11991/6e1a504052dad00646ff82cb8e1afeadccf8dcf5/syncpkgcd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
12,
2890,
16,
1438,
16,
3475,
4672,
468,
6944,
5137,
2865,
1771,
3251,
261,
5787,
1122,
761,
13,
1308,
2353,
5071,
35,
29207,
273,
3475,
18,
4939,
2668,
2473,
25146,
20,
6362,
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,
1361,
12,
2890,
16,
1438,
16,
3475,
4672,
468,
6944,
5137,
2865,
1771,
3251,
261,
5787,
1122,
761,
13,
1308,
2353,
5071,
35,
29207,
273,
3475,
18,
4939,
2668,
2473,
25146,
20,
6362,
30,
... |
analysis_url = "http://veritas.yiqiang.net/~yi/pdb/%s/ANALYSIS" % (pdbid) | analysis_url = "http://skuld.bmsc.washington.edu/~tlsmd/pdb/%s/ANALYSIS" % (pdbid) | def redirect_page(self, pdbid): # check to see if this job is still running try: os.chdir(conf.WEBTLSMDD_PDB_DIR + '/' + pdbid) except OSError: title = "This structure is currently being analyzed, please check back later." page = [self.html_head(title), html_title(title), self.html_foot()] return "".join(page) | baa591abc91d0ad43d45719554da1e6ed072356b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10674/baa591abc91d0ad43d45719554da1e6ed072356b/webtlsmd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3136,
67,
2433,
12,
2890,
16,
10892,
350,
4672,
468,
866,
358,
2621,
309,
333,
1719,
353,
4859,
3549,
775,
30,
1140,
18,
343,
1214,
12,
3923,
18,
14778,
9905,
49,
5698,
67,
52,
2290,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3136,
67,
2433,
12,
2890,
16,
10892,
350,
4672,
468,
866,
358,
2621,
309,
333,
1719,
353,
4859,
3549,
775,
30,
1140,
18,
343,
1214,
12,
3923,
18,
14778,
9905,
49,
5698,
67,
52,
2290,
... |
return print "\nEXAMPLE 1:" example_1() print "\nEXAMPLE 2:" example_2() print "\nEXAMPLE 3:" example_3() | else: print "\nEXAMPLE 1:" example_1() print "\nEXAMPLE 2:" example_2() print "\nEXAMPLE 3:" example_3() | def example_3(): # show selected characteristics, apply default selection # d_min comes from the structure that we are comparing against database pr, unused_definitions = polygon.master_params.fetch(sources = [params2], track_unused_definitions = True) polygon.polygon(params = pr.extract(), d_min = 2.0) | 4e5bc589aab44514a242b40a85d60bfa79152e24 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/696/4e5bc589aab44514a242b40a85d60bfa79152e24/tst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3454,
67,
23,
13332,
468,
2405,
3170,
29385,
16,
2230,
805,
4421,
468,
302,
67,
1154,
14535,
628,
326,
3695,
716,
732,
854,
17553,
5314,
2063,
846,
16,
10197,
67,
13314,
273,
7154,
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,
3454,
67,
23,
13332,
468,
2405,
3170,
29385,
16,
2230,
805,
4421,
468,
302,
67,
1154,
14535,
628,
326,
3695,
716,
732,
854,
17553,
5314,
2063,
846,
16,
10197,
67,
13314,
273,
7154,
18,
... |
sage: len(L) | sage: len(L) | def __call__(self, vertices, property=lambda x: True, augment='edges'): """ Accesses the generator of isomorphism class representatives. Iterates over distinct, exhaustive representatives. | d81b5e7b91084ae954dbaee810a0da704510ae21 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/d81b5e7b91084ae954dbaee810a0da704510ae21/graph_generators.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
6928,
16,
1272,
33,
14661,
619,
30,
1053,
16,
18260,
2218,
8746,
11,
4672,
3536,
5016,
281,
326,
4456,
434,
353,
362,
7657,
6228,
667,
2406,
8785,
18,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
6928,
16,
1272,
33,
14661,
619,
30,
1053,
16,
18260,
2218,
8746,
11,
4672,
3536,
5016,
281,
326,
4456,
434,
353,
362,
7657,
6228,
667,
2406,
8785,
18,
30... |
self.rAssertAlmostEqual(cmath.e, e_expected, 9, | self.assertAlmostEqual(cmath.e, e_expected, 9, | def test_constants(self): e_expected = 2.71828182845904523536 pi_expected = 3.14159265358979323846 self.rAssertAlmostEqual(cmath.pi, pi_expected, 9, "cmath.pi is %s; should be %s" % (cmath.pi, pi_expected)) self.rAssertAlmostEqual(cmath.e, e_expected, 9, "cmath.e is %s; should be %s" % (cmath.e, e_expected)) | 6e0ef926343218d4437b277412f2a913d6964f3f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3187/6e0ef926343218d4437b277412f2a913d6964f3f/test_cmath.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
13358,
12,
2890,
4672,
425,
67,
3825,
273,
576,
18,
27,
2643,
6030,
28246,
5193,
6162,
3028,
25,
30803,
5718,
4790,
67,
3825,
273,
890,
18,
3461,
24872,
30281,
4763,
6675,
7235... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
13358,
12,
2890,
4672,
425,
67,
3825,
273,
576,
18,
27,
2643,
6030,
28246,
5193,
6162,
3028,
25,
30803,
5718,
4790,
67,
3825,
273,
890,
18,
3461,
24872,
30281,
4763,
6675,
7235... |
arguments in each of any two columns, i. e. | arguments in each of any two columns, i.e. | def wigner_6j(j_1, j_2, j_3, j_4, j_5, j_6, prec=None): r""" Calculate the Wigner 6j symbol `Wigner6j(j_1,j_2,j_3,j_4,j_5,j_6)`. INPUT: - ``j_1``, ..., ``j_6`` - integer or half integer - ``prec`` - precision, default: None. Providing a precision can drastically speed up the calculation. OUTPUT: rational number times the square root of a rational number (if prec=None), or real number if a precision is given EXAMPLES:: sage: wigner_6j(3,3,3,3,3,3) -1/14 sage: wigner_6j(5,5,5,5,5,5) 1/52 sage: wigner_6j(6,6,6,6,6,6) 309/10868 sage: wigner_6j(8,8,8,8,8,8) -12219/965770 sage: wigner_6j(30,30,30,30,30,30) 36082186869033479581/87954851694828981714124 sage: wigner_6j(0.5,0.5,1,0.5,0.5,1) 1/6 sage: wigner_6j(200,200,200,200,200,200, prec=1000)*1.0 0.000155903212413242 It is an error to have arguments that are not integer or half integer values or do not fulfil the triangle relation:: sage: wigner_6j(2.5,2.5,2.5,2.5,2.5,2.5) Traceback (most recent call last): ... ValueError: j values must be integer or half integer and fulfil the triangle relation sage: wigner_6j(0.5,0.5,1.1,0.5,0.5,1.1) Traceback (most recent call last): ... ValueError: j values must be integer or half integer and fulfil the triangle relation NOTES: The Wigner 6j symbol is related to the Racah symbol but exhibits more symmetries as detailed below. .. math:: Wigner6j(j_1,j_2,j_3,j_4,j_5,j_6) =(-1)^{j_1+j_2+j_4+j_5} W(j_1,j_2,j_5,j_4,j_3,j_6) The Wigner 6j symbol obeys the following symmetry rules: - Wigner $6j$ symbols are left invariant under any permutation of the columns: .. math:: Wigner6j(j_1,j_2,j_3,j_4,j_5,j_6) =Wigner6j(j_3,j_1,j_2,j_6,j_4,j_5) =Wigner6j(j_2,j_3,j_1,j_5,j_6,j_4) =Wigner6j(j_3,j_2,j_1,j_6,j_5,j_4) =Wigner6j(j_1,j_3,j_2,j_4,j_6,j_5) =Wigner6j(j_2,j_1,j_3,j_5,j_4,j_6) - They are invariant under the exchange of the upper and lower arguments in each of any two columns, i. e. .. math:: Wigner6j(j_1,j_2,j_3,j_4,j_5,j_6) =Wigner6j(j_1,j_5,j_6,j_4,j_2,j_3) =Wigner6j(j_4,j_2,j_6,j_1,j_5,j_3) =Wigner6j(j_4,j_5,j_3,j_1,j_2,j_6) - additional 6 symmetries [Regge59] giving rise to 144 symmetries in total - only non-zero if any triple of `j`'s fulfil a triangle relation ALGORITHM: This function uses the algorithm of [Edmonds74] to calculate the value of the 6j symbol exactly. Note that the formula contains alternating sums over large factorials and is therefore unsuitable for finite precision arithmetic and only useful for a computer algebra system [Rasch03]. REFERENCES: - [Regge59] 'Symmetry Properties of Racah Coefficients', T. Regge, Nuovo Cimento, Volume 11, pp. 116 (1959) - [Edmonds74] 'Angular Momentum in Quantum Mechanics', A. R. Edmonds, Princeton University Press (1974) - [Rasch03] 'Efficient Storage Scheme for Pre-calculated Wigner 3j, 6j and Gaunt Coefficients', J. Rasch and A. C. H. Yu, SIAM J. Sci. Comput. Volume 25, Issue 4, pp. 1416-1428 (2003) """ res = (-1) ** (int(j_1 + j_2 + j_4 + j_5)) * \ racah(j_1, j_2, j_5, j_4, j_3, j_6, prec) return res | 2aae1a34350173041dcaa920c230128b23fb8288 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/2aae1a34350173041dcaa920c230128b23fb8288/wigner.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
341,
724,
264,
67,
26,
78,
12,
78,
67,
21,
16,
525,
67,
22,
16,
525,
67,
23,
16,
525,
67,
24,
16,
525,
67,
25,
16,
525,
67,
26,
16,
13382,
33,
7036,
4672,
436,
8395,
9029,
326,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
341,
724,
264,
67,
26,
78,
12,
78,
67,
21,
16,
525,
67,
22,
16,
525,
67,
23,
16,
525,
67,
24,
16,
525,
67,
25,
16,
525,
67,
26,
16,
13382,
33,
7036,
4672,
436,
8395,
9029,
326,... |
return (2,) + self.build_gemm_version() | return (3,) + self.build_gemm_version() | def c_code_cache_version(self): return (2,) + self.build_gemm_version() | a5256ba2c40614a069040dbec774df5c09684923 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/a5256ba2c40614a069040dbec774df5c09684923/blas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
276,
67,
710,
67,
2493,
67,
1589,
12,
2890,
4672,
327,
261,
22,
16,
13,
397,
365,
18,
3510,
67,
23465,
81,
67,
1589,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
276,
67,
710,
67,
2493,
67,
1589,
12,
2890,
4672,
327,
261,
22,
16,
13,
397,
365,
18,
3510,
67,
23465,
81,
67,
1589,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
doc = PDFDocument() font = TTFont("Vera", "Vera.ttf") font.splitString('a', doc) internalName = font.getSubsetInternalName(0, doc)[1:] font.addObjects(doc) pdfFont = doc.idToObject[internalName] self.assertEquals(doc.idToObject['BasicFonts'].dict[internalName], pdfFont) self.assertEquals(pdfFont.Name, internalName) self.assertEquals(pdfFont.BaseFont, "AAAAAA+BitstreamVeraSans-Roman") self.assertEquals(pdfFont.FirstChar, 0) self.assertEquals(pdfFont.LastChar, 127) self.assertEquals(len(pdfFont.Widths.sequence), 128) toUnicode = doc.idToObject[pdfFont.ToUnicode.name] self.assert_(toUnicode.content != "") fontDescriptor = doc.idToObject[pdfFont.FontDescriptor.name] self.assertEquals(fontDescriptor.dict['Type'], '/FontDescriptor') | ttfAsciiReadable = rl_config.ttfAsciiReadable try: rl_config.ttfAsciiReadable = 1 doc = PDFDocument() font = TTFont("Vera", "Vera.ttf") font.splitString('a', doc) internalName = font.getSubsetInternalName(0, doc)[1:] font.addObjects(doc) pdfFont = doc.idToObject[internalName] self.assertEquals(doc.idToObject['BasicFonts'].dict[internalName], pdfFont) self.assertEquals(pdfFont.Name, internalName) self.assertEquals(pdfFont.BaseFont, "AAAAAA+BitstreamVeraSans-Roman") self.assertEquals(pdfFont.FirstChar, 0) self.assertEquals(pdfFont.LastChar, 127) self.assertEquals(len(pdfFont.Widths.sequence), 128) toUnicode = doc.idToObject[pdfFont.ToUnicode.name] self.assert_(toUnicode.content != "") fontDescriptor = doc.idToObject[pdfFont.FontDescriptor.name] self.assertEquals(fontDescriptor.dict['Type'], '/FontDescriptor') finally: rl_config.ttfAsciiReadable = ttfAsciiReadable | def testAddObjects(self): "Test TTFont.addObjects" # Actually generate some subsets doc = PDFDocument() font = TTFont("Vera", "Vera.ttf") font.splitString('a', doc) # create some subset internalName = font.getSubsetInternalName(0, doc)[1:] font.addObjects(doc) pdfFont = doc.idToObject[internalName] self.assertEquals(doc.idToObject['BasicFonts'].dict[internalName], pdfFont) self.assertEquals(pdfFont.Name, internalName) self.assertEquals(pdfFont.BaseFont, "AAAAAA+BitstreamVeraSans-Roman") self.assertEquals(pdfFont.FirstChar, 0) self.assertEquals(pdfFont.LastChar, 127) self.assertEquals(len(pdfFont.Widths.sequence), 128) toUnicode = doc.idToObject[pdfFont.ToUnicode.name] self.assert_(toUnicode.content != "") fontDescriptor = doc.idToObject[pdfFont.FontDescriptor.name] self.assertEquals(fontDescriptor.dict['Type'], '/FontDescriptor') | 9b00011f0c2f6693e4cfbfc1b4cff7b7c0a7bdb8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3878/9b00011f0c2f6693e4cfbfc1b4cff7b7c0a7bdb8/test_pdfbase_ttfonts.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
986,
4710,
12,
2890,
4672,
315,
4709,
19912,
5711,
18,
1289,
4710,
6,
468,
4603,
3452,
2103,
2690,
30760,
997,
273,
12667,
2519,
1435,
3512,
273,
19912,
5711,
2932,
3945,
69,
3113,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
986,
4710,
12,
2890,
4672,
315,
4709,
19912,
5711,
18,
1289,
4710,
6,
468,
4603,
3452,
2103,
2690,
30760,
997,
273,
12667,
2519,
1435,
3512,
273,
19912,
5711,
2932,
3945,
69,
3113,
... |
func = name[3:] func = string.lower(func[0:1]) + func[1:] | func = name[3:] func = string.lower(func[0:1]) + func[1:] | def nameFixup(name, classe, type, file): # avoid a desastrous clash listname = classe + "List" ll = len(listname) l = len(classe) if name[0:l] == listname: func = name[l:] func = string.lower(func[0:1]) + func[1:] elif name[0:16] == "virNetworkLookup": func = name[3:] func = string.lower(func[0:1]) + func[1:] elif name[0:12] == "virDomainGet": func = name[12:] func = string.lower(func[0:1]) + func[1:] elif name[0:9] == "virDomain": func = name[9:] func = string.lower(func[0:1]) + func[1:] elif name[0:13] == "virNetworkGet": func = name[13:] func = string.lower(func[0:1]) + func[1:] elif name[0:10] == "virNetwork": func = name[10:] func = string.lower(func[0:1]) + func[1:] elif name[0:7] == "virNode": func = name[7:] func = string.lower(func[0:1]) + func[1:] elif name[0:10] == "virConnect": func = name[10:] func = string.lower(func[0:1]) + func[1:] elif name[0:3] == "xml": func = name[3:] func = string.lower(func[0:1]) + func[1:] else: func = name if func == "iD": func = "ID" if func == "uUID": func = "UUID" if func == "uUIDString": func = "UUIDString" if func == "oSType": func = "OSType" if func == "xMLDesc": func = "XMLDesc" return func | ccee35cbb028125de2f3085a04bdd56f95ea052c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11279/ccee35cbb028125de2f3085a04bdd56f95ea052c/generator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
508,
8585,
416,
12,
529,
16,
23268,
307,
16,
618,
16,
585,
4672,
468,
4543,
279,
2832,
689,
303,
407,
927,
961,
666,
529,
273,
23268,
307,
397,
315,
682,
6,
6579,
273,
562,
12,
1098,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
508,
8585,
416,
12,
529,
16,
23268,
307,
16,
618,
16,
585,
4672,
468,
4543,
279,
2832,
689,
303,
407,
927,
961,
666,
529,
273,
23268,
307,
397,
315,
682,
6,
6579,
273,
562,
12,
1098,... |
or (isinstance(exc, comtypes.COMError) and exc.hresult in (E_ACCESSDENIED, RPC_E_CALL_REJECTED, RPC_E_CALL_CANCELED)) | or (isinstance(exc, comtypes.COMError) and exc.hresult in (E_ACCESSDENIED, EVENT_E_ALL_SUBSCRIBERS_FAILED, RPC_E_CALL_REJECTED, RPC_E_CALL_CANCELED)) | def exception(self, msg="", exc_info=True): """Log an exception at an appropriate levle. Normally, it will be logged at level "ERROR". However, certain exceptions which aren't considered errors (or aren't errors that we can fix) are expected and will therefore be logged at a lower level. """ import comtypes if exc_info is True: exc_info = sys.exc_info() | caf383ccae51d4e550f23f592cac30694f53f2f1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9340/caf383ccae51d4e550f23f592cac30694f53f2f1/logHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1520,
12,
2890,
16,
1234,
1546,
3113,
3533,
67,
1376,
33,
5510,
4672,
3536,
1343,
392,
1520,
622,
392,
5505,
18565,
298,
18,
24773,
1230,
16,
518,
903,
506,
7545,
622,
1801,
315,
3589,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1520,
12,
2890,
16,
1234,
1546,
3113,
3533,
67,
1376,
33,
5510,
4672,
3536,
1343,
392,
1520,
622,
392,
5505,
18565,
298,
18,
24773,
1230,
16,
518,
903,
506,
7545,
622,
1801,
315,
3589,
... |
self.processStartTag(self, name, attributes) | self.processStartTag(name, attributes) | def startTagNoframes(self, name, attributes): self.parser.switchInsertionMode("inBody") self.processStartTag(self, name, attributes) | 2a3965276b7b0b922773b962df7914ef25499f97 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4487/2a3965276b7b0b922773b962df7914ef25499f97/parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
1805,
50,
792,
86,
753,
12,
2890,
16,
508,
16,
1677,
4672,
365,
18,
4288,
18,
9610,
29739,
2309,
2932,
267,
2250,
7923,
365,
18,
2567,
30512,
12,
2890,
16,
508,
16,
1677,
13,
2,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
787,
1805,
50,
792,
86,
753,
12,
2890,
16,
508,
16,
1677,
4672,
365,
18,
4288,
18,
9610,
29739,
2309,
2932,
267,
2250,
7923,
365,
18,
2567,
30512,
12,
2890,
16,
508,
16,
1677,
13,
2,... |
self.timeout = timeout | def communicate(self, input=None, timeout=None): """Interact with process: Send data to stdin. Read data from stdout and stderr, until end-of-file is reached. Wait for process to terminate. The optional input argument should be a string to be sent to the child process, or None, if no data should be sent to the child. | 190e1d7e5f93bc5e6ae85b81866ff360671bfa24 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/888/190e1d7e5f93bc5e6ae85b81866ff360671bfa24/SubProcess.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15541,
12,
2890,
16,
810,
33,
7036,
16,
2021,
33,
7036,
4672,
3536,
2465,
621,
598,
1207,
30,
2479,
501,
358,
8801,
18,
225,
2720,
501,
628,
3909,
471,
4514,
16,
3180,
679,
17,
792,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15541,
12,
2890,
16,
810,
33,
7036,
16,
2021,
33,
7036,
4672,
3536,
2465,
621,
598,
1207,
30,
2479,
501,
358,
8801,
18,
225,
2720,
501,
628,
3909,
471,
4514,
16,
3180,
679,
17,
792,
... | |
for (t,id,author),field_changes,comment,summary in updates: | for (t,id,author,summary),field_changes,comment in updates: | def get_timeline_events(self, req, start, stop, filters): if 'ticket_details' in filters: db = self.env.get_db_cnx() cursor = db.cursor() cursor.execute("SELECT tc.time,tc.ticket,tc.field, " " tc.oldvalue,tc.newvalue,tc.author,t.summary " "FROM ticket_change tc" " LEFT JOIN ticket t ON t.id = tc.ticket " "AND tc.time>=%s AND tc.time<=%s ORDER BY tc.time" % (start, stop)) previous_update = None updates = [] for time,id,field,oldvalue,newvalue,author,summary in cursor: this_summary = summary if (time,id,author) != previous_update: if previous_update: updates.append((previous_update,field_changes,comment, this_summary)) field_changes = [] comment = '' previous_update = (time,id,author) if field == 'comment': comment = newvalue else: field_changes.append(field) if previous_update: updates.append((previous_update,field_changes,comment, this_summary)) | 864c57e24bc80b542bc9f91a63c08830962b5d0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/864c57e24bc80b542bc9f91a63c08830962b5d0c/Ticket.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
26237,
67,
5989,
12,
2890,
16,
1111,
16,
787,
16,
2132,
16,
3415,
4672,
309,
296,
16282,
67,
6395,
11,
316,
3415,
30,
1319,
273,
365,
18,
3074,
18,
588,
67,
1966,
67,
10305,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
26237,
67,
5989,
12,
2890,
16,
1111,
16,
787,
16,
2132,
16,
3415,
4672,
309,
296,
16282,
67,
6395,
11,
316,
3415,
30,
1319,
273,
365,
18,
3074,
18,
588,
67,
1966,
67,
10305,... |
if sys.argv[1] == "build": podir = os.path.join (os.path.realpath ("."), "po") if os.path.isdir (podir): buildcmd = "msgfmt -o build/locale/%s/ccsm.mo po/%s.po" mopath = "build/locale/%s/ccsm.mo" destpath = "share/locale/%s/LC_MESSAGES" for name in os.listdir (podir): if name[-2:] == "po": name = name[:-3] | podir = os.path.join (os.path.realpath ("."), "po") if os.path.isdir (podir): buildcmd = "msgfmt -o build/locale/%s/ccsm.mo po/%s.po" mopath = "build/locale/%s/ccsm.mo" destpath = "share/locale/%s/LC_MESSAGES" for name in os.listdir (podir): if name[-2:] == "po": name = name[:-3] if sys.argv[1] == "build": | def filter_images (image): return image.startswith ("plugin-") or image.startswith ("category-") | 9af6fbb5cb775736c7539a236c8822d35cd7d4bd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1272/9af6fbb5cb775736c7539a236c8822d35cd7d4bd/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1034,
67,
7369,
261,
2730,
4672,
327,
1316,
18,
17514,
1918,
7566,
4094,
17,
7923,
578,
1316,
18,
17514,
1918,
7566,
4743,
17,
7923,
225,
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,
1034,
67,
7369,
261,
2730,
4672,
327,
1316,
18,
17514,
1918,
7566,
4094,
17,
7923,
578,
1316,
18,
17514,
1918,
7566,
4743,
17,
7923,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
ID_TO_UPPER, ID_UNDO, ID_REDO, ID_CUT, ID_COPY, ID_PASTE, ID_SELECTALL]) | ID_TO_UPPER, ID_SELECTALL, ID_UNDO, ID_REDO, ID_CUT, ID_COPY, ID_PASTE]) | def DispatchToControl(self, evt): """Catches events that need to be passed to the current text control for processing. @param evt: Event fired that called this handler @type evt: wxMenuEvent | 01f3f92c6e71b13dcb13ff41b9708dce08a037ae /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3530/01f3f92c6e71b13dcb13ff41b9708dce08a037ae/ed_main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11552,
774,
3367,
12,
2890,
16,
6324,
4672,
3536,
14842,
281,
2641,
716,
1608,
358,
506,
2275,
358,
326,
783,
977,
3325,
364,
4929,
18,
632,
891,
6324,
30,
2587,
15950,
716,
2566,
333,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
11552,
774,
3367,
12,
2890,
16,
6324,
4672,
3536,
14842,
281,
2641,
716,
1608,
358,
506,
2275,
358,
326,
783,
977,
3325,
364,
4929,
18,
632,
891,
6324,
30,
2587,
15950,
716,
2566,
333,
... |
z = np.zeros(self.m) ; z[i] = 1 | z = np.zeros(self.m) ; z[i] = -1 | def hiprod(self, i, v, **kwargs): """ Evaluate matrix-vector product Hi(x) * v. Returns a Numpy array. """ z = np.zeros(self.m) ; z[i] = 1 self.Hprod += 1 return _amplpy.H_prod(z, v, 0.) | 5dc66d894de4e8eef1065a807a6da43f36f0a827 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13857/5dc66d894de4e8eef1065a807a6da43f36f0a827/amplpy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
366,
625,
303,
72,
12,
2890,
16,
277,
16,
331,
16,
2826,
4333,
4672,
3536,
18176,
3148,
17,
7737,
3017,
670,
77,
12,
92,
13,
380,
331,
18,
2860,
279,
6805,
2074,
526,
18,
3536,
998,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
366,
625,
303,
72,
12,
2890,
16,
277,
16,
331,
16,
2826,
4333,
4672,
3536,
18176,
3148,
17,
7737,
3017,
670,
77,
12,
92,
13,
380,
331,
18,
2860,
279,
6805,
2074,
526,
18,
3536,
998,
... |
yield 23 def __len__(self): | def __iter__(self): yield 23 | 4e2f714031654eb4174393454c008961b636f539 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/4e2f714031654eb4174393454c008961b636f539/list_tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2165,
972,
12,
2890,
4672,
2824,
10213,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
2165,
972,
12,
2890,
4672,
2824,
10213,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... | |
dateFiled = trTags[i].td.contents.strip() splitDate = dateFiled[0].split("-") | dateFiled = trTags[i].td.contents[0].strip() splitDate = dateFiled.split("-") | def scrapeCourt(courtID, result, verbosity, daemonmode): if verbosity >= 1: result += "NOW SCRAPING COURT: " + str(courtID) + "\n" if verbosity >= 2: print "NOW SCRAPING COURT: " + str(courtID) if (courtID == 1): """ PDFs are available from the first circuit if you go to their RSS feed. So go to their RSS feed we shall. """ urls = ("http://www.ca1.uscourts.gov/opinions/opinionrss.php",) ct = Court.objects.get(courtUUID='ca1') for url in urls: try: html = urllib2.urlopen(url).read() except: result += "****ERROR CONNECTING TO COURT: " + str(courtID) + "****\n" continue if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result # this code gets rid of errant ampersands - they throw big errors # when parsing. We replace them later. if '&' in html: punctuationRegex = re.compile(" & ") html = re.sub(punctuationRegex, " & ", html) tree = etree.fromstring(html) else: tree = etree.fromstring(html) caseLinks = tree.xpath("//item/link") descriptions = tree.xpath("//item/description") docTypes = tree.xpath("//item/category") caseNamesAndNumbers = tree.xpath("//item/title") caseDateRegex = re.compile("(\d{2}/\d{2}/\d{4})", re.VERBOSE | re.DOTALL) caseNumberRegex = re.compile("(\d{2}-.*?\W)(.*)$") # incredibly, this RSS feed is in cron order, so new stuff is at the # end. Mind blowing. i = len(caseLinks)-1 if verbosity >= 2: print str(i) dupCount = 0 while i > 0: # First: docType, since we don't support them all... docType = docTypes[i].text.strip() if verbosity >= 2: print docType if "unpublished" in docType.lower(): documentType = "Unpublished" elif "published" in docType.lower(): documentType = "Published" elif "errata" in docType.lower(): documentType = "Errata" else: # something weird we don't know about, punt i -= 1 continue # next, we begin with the caseLink field caseLink = caseLinks[i].text caseLink = urljoin(url, caseLink) # then we download the PDF, make the hash and document myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i -= 1 continue if not created: # it's an oldie, punt! if verbosity >= 2: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 8: # eighth dup in a a row. BREAK! # this is 8 here b/c this court has tech problems. break i -= 1 continue else: dupCount = 0 # otherwise, we continue doc.documentType = documentType # next: caseDate caseDate = caseDateRegex.search(descriptions[i].text).group(1) splitDate = caseDate.split('/') caseDate = datetime.date(int(splitDate[2]), int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate # next: caseNumber caseNumber = caseNumberRegex.search(caseNamesAndNumbers[i].text)\ .group(1) # next: caseNameShort caseNameShort = caseNumberRegex.search(caseNamesAndNumbers[i].text)\ .group(2) # check for dups, make the object if necessary, otherwise, get it cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) logger.debug(time.strftime("%a, %d %b %Y %H:%M", time.localtime()) + ": Added " + ct.courtShortName + ": " + cite.caseNameShort) doc.save() i -= 1 return result elif (courtID == 2): """ URL hacking FTW. """ urls = ( "http://www.ca2.uscourts.gov/decisions?IW_DATABASE=OPN&IW_FIELD_TEXT=OPN&IW_SORT=-Date&IW_BATCHSIZE=100", "http://www.ca2.uscourts.gov/decisions?IW_DATABASE=SUM&IW_FIELD_TEXT=SUM&IW_SORT=-Date&IW_BATCHSIZE=100", ) ct = Court.objects.get(courtUUID='ca2') for url in urls: try: html = urllib2.urlopen(url).read() except: result += "****ERROR CONNECTING TO COURT: " + str(courtID) + "****\n" continue soup = BeautifulSoup(html) aTagsRegex = re.compile('(.*?.pdf).*?', re.IGNORECASE) caseNumRegex = re.compile('.*/(\d{1,2}-\d{3,4})(.*).pdf') aTags = soup.findAll(attrs={'href' : aTagsRegex}) if daemonmode: # this mess is necessary because the court puts random # (literally) numbers throughout their links. No idea why, # but the solution is to figure out the caselinks here, and to hand # those to the sha1 generator. aTagsEncoded = [] for i in aTags: caseLink = i.get('href') caseLink = aTagsRegex.search(caseLink).group(1) try: caseNumbers = caseNumRegex.search(caseLink).group(1) except: caseNumbers = "" aTagsEncoded.append(caseNumbers) # if it's daemonmode, see if the court has changed changed = courtChanged(url, str(aTagsEncoded)) if not changed: # if not, bail. If so, continue to the scraping. return result i = 0 dupCount = 0 while i < len(aTags): # we begin with the caseLink field caseLink = aTags[i].get('href') caseLink = aTagsRegex.search(caseLink).group(1) caseLink = urljoin(url, caseLink) if verbosity >= 2: print str(i) + ": " + caseLink myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 2: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 5: # fifth dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 # using caseLink, we can get the caseNumber and documentType caseNum = caseNumRegex.search(caseLink).group(1) if verbosity >= 2: print "caseNum: " + str(caseNum) # and the docType documentType = caseNumRegex.search(caseLink).group(2) if 'opn' in documentType: # it's unpublished doc.documentType = "Published" elif 'so' in documentType: doc.documentType = "Unpublished" # next, the caseNameShort (there's probably a better way to do this. caseNameShort = aTags[i].parent.parent.nextSibling.nextSibling\ .nextSibling.nextSibling.contents[0] # next, we can do the caseDate caseDate = aTags[i].parent.parent.nextSibling.nextSibling\ .nextSibling.nextSibling.nextSibling.nextSibling.contents[0]\ .replace(' ', ' ').strip() # some caseDate cleanup splitDate = caseDate.split('-') caseDate = datetime.date(int(splitDate[2]),int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate # check for duplicates, make the object in their absence cite, created = hasDuplicate(caseNum, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) logger.debug(time.strftime("%a, %d %b %Y %H:%M", time.localtime()) + ": Added " + ct.courtShortName + ": " + cite.caseNameShort) doc.save() i += 1 return result elif (courtID == 3): """ This URL provides the latest 25 cases, so I need to pick out the new ones and only get those. I can do this efficiently by trying to do each, and then giving up once I hit one that I've done before. This will work because they are in reverse chronological order. """ # if these URLs change, the docType identification (below) will need # to be updated. It's lazy, but effective. urls = ("http://www.ca3.uscourts.gov/recentop/week/recprec.htm", "http://www.ca3.uscourts.gov/recentop/week/recnon2day.htm",) ct = Court.objects.get(courtUUID='ca3') for url in urls: try: html = urllib2.urlopen(url).read() except: result += "****ERROR CONNECTING TO COURT: " + str(courtID) + "****\n" continue if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result soup = BeautifulSoup(html) # all links ending in pdf, case insensitive regex = re.compile("pdf$", re.IGNORECASE) aTags = soup.findAll(attrs={"href": regex}) # we will use these vars in our while loop, better not to compile them # each time regexII = re.compile('\d{2}/\d{2}/\d{2}') regexIII = re.compile('\d{2}-\d{4}') i = 0 dupCount = 0 while i < len(aTags): # caseLink and caseNameShort caseLink = aTags[i].get('href') myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 2: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 5: # fifth dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 caseNameShort = aTags[i].contents[0] # caseDate and caseNumber junk = aTags[i].previous.previous.previous try: # this error seems to happen upon dups...not sure why yet caseDate = regexII.search(junk).group(0) caseNumber = regexIII.search(junk).group(0) except: i = i+1 continue # next up is the caseDate splitDate = caseDate.split('/') caseDate = datetime.date(int("20" + splitDate[2]),int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate # Make a decision about the docType. if "recprec.htm" in str(url): doc.documentType = "Published" elif "recnon2day.htm" in str(url): doc.documentType = "Unpublished" cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) logger.debug(time.strftime("%a, %d %b %Y %H:%M", time.localtime()) + ": Added " + ct.courtShortName + ": " + cite.caseNameShort) doc.save() i += 1 return result elif (courtID == 4): """The fourth circuit is THE worst form of HTML I've ever seen. It's going to break a lot, but I've done my best to clean it up, and make it reliable.""" urls = ("http://pacer.ca4.uscourts.gov/opinions_today.htm",) ct = Court.objects.get(courtUUID='ca4') for url in urls: try: html = urllib2.urlopen(url).read() except: result += "****ERROR CONNECTING TO COURT: " + str(courtID) + "****\n" continue if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result # sadly, beautifulsoup chokes on the lines lines of this file because # the HTML is so bad. Stop laughing - the HTML IS awful, but it's not # funny. Anyway, to make this thing work, we must pull out the target # attributes. And so we do. regex = re.compile("target.*>", re.IGNORECASE) html = re.sub(regex, ">", html) soup = BeautifulSoup(html) # all links ending in pdf, case insensitive regex = re.compile("pdf$", re.IGNORECASE) aTags = soup.findAll(attrs={"href": regex}) i = 0 dupCount = 0 regexII = re.compile('\d{2}/\d{2}/\d{4}') regexIII = re.compile('\d{4}(.*)') while i < len(aTags): # caseLink field, and save it caseLink = aTags[i].get('href') caseLink = urljoin(url, caseLink) myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 2: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 5: # fifth dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 # using caselink, we can get the caseNumber and documentType fileName = caseLink.split('/')[-1] caseNumber, documentType = fileName.split('.')[0:2] # the caseNumber needs a hyphen inserted after the second digit caseNumber = caseNumber[0:2] + "-" + caseNumber[2:] if documentType == 'U': doc.documentType = 'Unpublished' elif documentType == 'P': doc.documentType = 'Published' else: doc.documentType = "" # next, we do the caseDate and caseNameShort, so we can quit before # we get too far along. junk = aTags[i].contents[0].replace(' ', ' ').strip() try: # this error seems to happen upon dups...not sure why yet caseDate = cleanString(regexII.search(junk).group(0)) caseNameShort = regexIII.search(junk).group(1) except: i += 1 continue # some caseDate cleanup splitDate = caseDate.split('/') caseDate = datetime.date(int(splitDate[2]),int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate # let's check for duplicates before we proceed cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) logger.debug(time.strftime("%a, %d %b %Y %H:%M", time.localtime()) + ": Added " + ct.courtShortName + ": " + cite.caseNameShort) doc.save() i += 1 return result elif (courtID == 5): """New fifth circuit scraper, which can get back versions all the way to 1992! This is exciting, but be warned, the search is not reliable on recent dates. It has been known not to bring back results that are definitely within the set. Watch closely. """ urls = ("http://www.ca5.uscourts.gov/Opinions.aspx",) ct = Court.objects.get(courtUUID='ca5') for url in urls: # Use just one date, it seems to work better this way. todayObject = datetime.date.today() if verbosity >= 2: print "start date: " + str(todayObject) startDate = time.strftime('%m/%d/%Y', todayObject.timetuple()) if verbosity >= 2: print "Start date is: " + startDate # these are a mess because the court has a security check. postValues = { '__EVENTTARGET' : '', '__EVENTARGUMENT' : '', '__VIEWSTATE' : '/wEPDwULLTEwOTU2NTA2NDMPZBYCAgEPZBYKAgEPDxYIHgtDZWxsUGFkZGluZ2YeC0NlbGxTcGFjaW5nZh4JQmFja0NvbG9yCRcQJ/8eBF8hU0ICiIAYZGQCAw8PFggfAGYfAWYfAgmZzP//HwMCiIAYZGQCGQ9kFgYCAg8PFgQfAgqHAR8DAghkZAIEDw8WBB8CCocBHwMCCGRkAgYPDxYEHwIKhwEfAwIIZGQCGw9kFooBAgIPDxYEHwIKhwEfAwIIZGQCBA8PFgQfAgqHAR8DAghkZAIGDw8WBB8CCocBHwMCCGRkAggPDxYEHwIKhwEfAwIIZGQCCg8PFgQfAgqHAR8DAghkZAIMDw8WBB8CCocBHwMCCGRkAg4PDxYEHwIKhwEfAwIIZGQCEA8PFgQfAgqHAR8DAghkZAISDw8WBB8CCocBHwMCCGRkAhQPDxYEHwIKhwEfAwIIZGQCFg8PFgQfAgqHAR8DAghkZAIYDw8WBB8CCocBHwMCCGRkAhoPDxYEHwIKhwEfAwIIZGQCHA8PFgQfAgqHAR8DAghkZAIeDw8WBB8CCocBHwMCCGRkAiAPDxYEHwIKhwEfAwIIZGQCIg8PFgQfAgqHAR8DAghkZAIkDw8WBB8CCocBHwMCCGRkAiYPDxYEHwIKhwEfAwIIZGQCKA8PFgQfAgqHAR8DAghkZAIqDw8WBB8CCocBHwMCCGRkAiwPDxYEHwIKhwEfAwIIZGQCLg8PFgQfAgqHAR8DAghkZAIwDw8WBB8CCocBHwMCCGRkAjIPDxYEHwIKhwEfAwIIZGQCNA8PFgQfAgqHAR8DAghkZAI2Dw8WBB8CCocBHwMCCGRkAjgPDxYEHwIKhwEfAwIIZGQCOg8PFgQfAgqHAR8DAghkZAI8Dw8WBB8CCocBHwMCCGRkAj4PDxYEHwIKhwEfAwIIZGQCQA8PFgQfAgqHAR8DAghkZAJCDw8WBB8CCocBHwMCCGRkAkQPDxYEHwIKhwEfAwIIZGQCRg8PFgQfAgqHAR8DAghkZAJIDw8WBB8CCocBHwMCCGRkAkoPDxYEHwIKhwEfAwIIZGQCTA8PFgQfAgqHAR8DAghkZAJODw8WBB8CCocBHwMCCGRkAlAPDxYEHwIKhwEfAwIIZGQCUg8PFgQfAgqHAR8DAghkZAJUDw8WBB8CCocBHwMCCGRkAlYPDxYEHwIKhwEfAwIIZGQCWA8PFgQfAgqHAR8DAghkZAJaDw8WBB8CCocBHwMCCGRkAlwPDxYEHwIKhwEfAwIIZGQCXg8PFgQfAgqHAR8DAghkZAJgDw8WBB8CCocBHwMCCGRkAmIPDxYEHwIKhwEfAwIIZGQCZA8PFgQfAgqHAR8DAghkZAJmDw8WBB8CCocBHwMCCGRkAmgPDxYEHwIKhwEfAwIIZGQCag8PFgQfAgqHAR8DAghkZAJsDw8WBB8CCocBHwMCCGRkAm4PDxYEHwIKhwEfAwIIZGQCcA8PFgQfAgqHAR8DAghkZAJyDw8WBB8CCocBHwMCCGRkAnQPDxYEHwIKhwEfAwIIZGQCdg8PFgQfAgqHAR8DAghkZAJ4Dw8WBB8CCocBHwMCCGRkAnoPDxYEHwIKhwEfAwIIZGQCfA8PFgQfAgqHAR8DAghkZAJ+Dw8WBB8CCocBHwMCCGRkAoABDw8WBB8CCocBHwMCCGRkAoIBDw8WBB8CCocBHwMCCGRkAoQBDw8WBB8CCocBHwMCCGRkAoYBDw8WBB8CCocBHwMCCGRkAogBDw8WBB8CCocBHwMCCGRkAooBDw8WBB8CCocBHwMCCGRkAh0PEGRkFgECAmRkcx2JRvTiy039dck7+vdOCUS6J5s=', 'txtBeginDate' : startDate, 'txtEndDate' : '', 'txtDocketNumber' : '', 'txtTitle=' : '', 'btnSearch' : 'Search', '__EVENTVALIDATION' : '/wEWCALd2o3pAgLH8d2nDwKAzfnNDgLChrRGAr2b+P4BAvnknLMEAqWf8+4KAqC3sP0KVcw25xdB1YPfbcUwUCqEYjQqaqM=', } data = urllib.urlencode(postValues) req = urllib2.Request(url, data) try: html = urllib2.urlopen(req).read() except: result += "****ERROR CONNECTING TO COURT: " + str(courtID) + "****\n" continue if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result soup = BeautifulSoup(html) #if verbosity >= 2: print soup #all links ending in pdf, case insensitive aTagRegex = re.compile("pdf$", re.IGNORECASE) aTags = soup.findAll(attrs={"href": aTagRegex}) unpubRegex = re.compile(r"pinions.*unpub") i = 0 dupCount = 0 numP = 0 numQ = 0 while i < len(aTags): # this page has PDFs that aren't cases, we must filter them out if 'pinion' not in str(aTags[i]): # it's not an opinion, increment and punt if verbosity >= 2: print "Punting non-opinion URL: " + str(aTags[i]) i += 1 continue # we begin with the caseLink field caseLink = aTags[i].get('href') caseLink = urljoin(url, caseLink) myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue # next, we do the docStatus field, b/c we need to include it in # the dup check. This is because we need to abort after we have # three non-precedential and three precedential from this court. if unpubRegex.search(str(aTags[i])) == None: # it's published, else it's unpublished documentType = "Published" numP += 1 else: documentType = "Unpublished" numQ += 1 if verbosity >= 2: print "documentType: " + documentType doc.documentType = documentType if not created: # it's an oldie, punt! if verbosity >= 2: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount >= 3 and numP >= 3 and numQ >= 3: # third dup in a a row for both U and P. break i += 1 continue else: dupCount = 0 # using caseLink, we can get the caseNumber and documentType caseNumber = aTags[i].contents[0] # next, we do the caseDate caseDate = aTags[i].next.next.contents[0].contents[0] # some caseDate cleanup splitDate = caseDate.split('/') caseDate = datetime.date(int(splitDate[2]),int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate # next, we do the caseNameShort caseNameShort = aTags[i].next.next.next.next.next.contents[0]\ .contents[0] # now that we have the caseNumber and caseNameShort, we can dup check cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) logger.debug(time.strftime("%a, %d %b %Y %H:%M", time.localtime()) + ": Added " + ct.courtShortName + ": " + cite.caseNameShort) doc.save() i += 1 return result elif (courtID == 6): """Results are available without an HTML POST, but those results lack a date field. Hence, we must do an HTML POST. Missing a day == OK. Just need to monkey with the date POSTed. """ urls = ("http://www.ca6.uscourts.gov/cgi-bin/opinions.pl",) ct = Court.objects.get(courtUUID = 'ca6') for url in urls: today = datetime.date.today() formattedToday = str(today.month) + '/' + str(today.day) + '/' +\ str(today.year) postValues = { 'CASENUM' : '', 'TITLE' : '', 'FROMDATE' : formattedToday, 'TODATE' : formattedToday, 'OPINNUM' : '' } data = urllib.urlencode(postValues) req = urllib2.Request(url, data) try: html = urllib2.urlopen(req).read() except: result += "****ERROR CONNECTING TO COURT: " + str(courtID) + "****\n" continue if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result soup = BeautifulSoup(html) aTagsRegex = re.compile('pdf$', re.IGNORECASE) aTags = soup.findAll(attrs={'href' : aTagsRegex}) i = 0 dupCount = 0 while i < len(aTags): # we begin with the caseLink field caseLink = aTags[i].get('href') caseLink = urljoin(url, caseLink) myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 2: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 5: # fifth dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 # using caseLink, we can get the caseNumber and documentType caseNumber = aTags[i].next.next.next.next.next.contents[0] # using the filename, we can determine the documentType... fileName = aTags[i].contents[0] if 'n' in fileName: # it's unpublished doc.documentType = "Unpublished" elif 'p' in fileName: doc.documentType = "Published" # next, we can do the caseDate caseDate = aTags[i].next.next.next.next.next.next.next.next\ .contents[0] caseDate = cleanString(caseDate) # some caseDate cleanup splitDate = caseDate.split('/') caseDate = datetime.date(int(splitDate[0]),int(splitDate[1]), int(splitDate[2])) doc.dateFiled = caseDate # next, the caseNameShort (there's probably a better way to do this. caseNameShort = aTags[i].next.next.next.next.next.next.next.next\ .next.next.next # now that we have the caseNumber and caseNameShort, we can dup check cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) logger.debug(time.strftime("%a, %d %b %Y %H:%M", time.localtime()) + ": Added " + ct.courtShortName + ": " + cite.caseNameShort) doc.save() i += 1 return result elif (courtID == 7): """another court where we need to do a post. This will be a good starting place for getting the judge field, when we're ready for that. Missing a day == OK. Queries return cases for the past week. """ urls = ("http://www.ca7.uscourts.gov/fdocs/docs.fwx",) ct = Court.objects.get(courtUUID = 'ca7') for url in urls: # if these strings change, check that documentType still gets set correctly. dataStrings = ("yr=&num=&Submit=Past+Week&dtype=Opinion&scrid=Select+a+Case", "yr=&num=&Submit=Past+Week&dtype=Nonprecedential+Disposition&scrid=Select+a+Case",) for dataString in dataStrings: req = urllib2.Request(url, dataString) try: html = urllib2.urlopen(req).read() except: result += "****ERROR CONNECTING TO COURT: " + str(courtID) + "****\n" continue if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url+dataString, html) if not changed: # if not, bail. If so, continue to the scraping. return result soup = BeautifulSoup(html) aTagsRegex = re.compile('pdf$', re.IGNORECASE) aTags = soup.findAll(attrs={'href' : aTagsRegex}) i = 0 dupCount = 0 while i < len(aTags): # we begin with the caseLink field caseLink = aTags[i].get("href") caseLink = urljoin(url, caseLink) myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 2: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 5: # fifth dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 # using caseLink, we can get the caseNumber and documentType caseNumber = aTags[i].previous.previous.previous.previous.previous\ .previous.previous.previous.previous.previous # next up: caseDate caseDate = aTags[i].previous.previous.previous.contents[0] caseDate = cleanString(caseDate) splitDate = caseDate.split('/') caseDate = datetime.date(int(splitDate[2]), int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate # next up: caseNameShort caseNameShort = aTags[i].previous.previous.previous.previous\ .previous.previous.previous # next up: docStatus if "type=Opinion" in dataString: doc.documentType = "Published" elif "type=Nonprecedential+Disposition" in dataString: doc.documentType = "Unpublished" # now that we have the caseNumber and caseNameShort, we can dup check cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) logger.debug(time.strftime("%a, %d %b %Y %H:%M", time.localtime()) + ": Added " + ct.courtShortName + ": " + cite.caseNameShort) doc.save() i += 1 return result elif (courtID == 8): urls = ("http://www.ca8.uscourts.gov/cgi-bin/new/today2.pl",) ct = Court.objects.get(courtUUID = 'ca8') for url in urls: try: html = urllib2.urlopen(url).read() except: result += "****ERROR CONNECTING TO COURT: " + str(courtID) + "****\n" continue if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result soup = BeautifulSoup(html) aTagsRegex = re.compile('pdf$', re.IGNORECASE) aTags = soup.findAll(attrs={'href' : aTagsRegex}) caseNumRegex = re.compile('(\d{2})(\d{4})(u|p)', re.IGNORECASE) caseDateRegex = re.compile('(\d{2}/\d{2}/\d{4})(.*)(</b>)') i = 0 dupCount = 0 while i < len(aTags): # we begin with the caseLink field caseLink = aTags[i].get('href') caseLink = urljoin(url, caseLink) myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 2: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 5: # fifth dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 # using caseLink, we can get the caseNumber and documentType junk = aTags[i].contents[0] caseNumber = caseNumRegex.search(junk).group(1) + "-" +\ caseNumRegex.search(junk).group(2) documentType = caseNumRegex.search(junk).group(3).upper() if documentType == 'U': doc.documentType = 'Unpublished' elif documentType == 'P': doc.documentType = 'Published' # caseDate is next on the block junk = str(aTags[i].next.next.next) caseDate = caseDateRegex.search(junk).group(1) caseDate = cleanString(caseDate) caseNameShort = caseDateRegex.search(junk).group(2) # some caseDate cleanup splitDate = caseDate.split('/') caseDate = datetime.date(int(splitDate[2]),int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate # now that we have the caseNumber and caseNameShort, we can dup check cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) logger.debug(time.strftime("%a, %d %b %Y %H:%M", time.localtime()) + ": Added " + ct.courtShortName + ": " + cite.caseNameShort) doc.save() i += 1 return result elif (courtID == 9): """This court, by virtue of having a javascript laden website, was very hard to parse properly. BeautifulSoup couldn't handle it at all, so lxml has to be used. lxml seems pretty useful, but it was a pain to learn.""" # these URLs redirect now. So much for hacking them. A new approach can probably be done using POST data. urls = ( "http://www.ca9.uscourts.gov/opinions/?o_mode=view&o_sort_field=19&o_sort_type=DESC&o_page_size=100", "http://www.ca9.uscourts.gov/memoranda/?o_mode=view&o_sort_field=21&o_sort_type=DESC&o_page_size=100",) ct = Court.objects.get(courtUUID = 'ca9') for url in urls: if verbosity >= 2: print "Link is now: " + url try: html = urllib2.urlopen(url).read() except: result += "****ERROR CONNECTING TO COURT: " + str(courtID) + "****\n" continue tree = fromstring(html) if url == urls[0]: caseLinks = tree.xpath('//table[3]/tbody/tr/td/a') caseNumbers = tree.xpath('//table[3]/tbody/tr/td[2]/label') caseDates = tree.xpath('//table[3]/tbody/tr/td[6]/label') elif url == urls[1]: caseLinks = tree.xpath('//table[3]/tbody/tr/td/a') caseNumbers = tree.xpath('//table[3]/tbody/tr/td[2]/label') caseDates = tree.xpath('//table[3]/tbody/tr/td[7]/label') if daemonmode: # if it's daemonmode, see if the court has changed # this is necessary because the 9th circuit puts random numbers # in their HTML. This gets rid of those, so SHA1 can be generated. listofLinks = [] for i in caseLinks: listofLinks.append(i.get('href')) changed = courtChanged(url, str(listofLinks)) if not changed: # if not, bail. If so, continue to the scraping. return result i = 0 dupCount = 0 while i < len(caseLinks): # we begin with the caseLink field caseLink = caseLinks[i].get('href') caseLink = urljoin(url, caseLink) if verbosity >= 2: print "CaseLink is: " + caseLink # special case if 'no memos filed' in caseLink.lower(): i += 1 continue myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration if verbosity >= 2: print "Error creating file. Punting..." i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 2: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 5: # fifth dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 # next, we'll do the caseNumber caseNumber = caseNumbers[i].text if verbosity >= 2: print "CaseNumber is: " + caseNumber # next up: document type (static for now) if 'memoranda' in url: doc.documentType = "Unpublished" elif 'opinions' in url: doc.documentType = "Published" if verbosity >= 2: print "Document type is: " + doc.documentType # next up: caseDate splitDate = caseDates[i].text.split('/') caseDate = datetime.date(int(splitDate[2]), int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate if verbosity >= 2: print "CaseDate is: " + str(caseDate) #next up: caseNameShort caseNameShort = titlecase(caseLinks[i].text.lower()) if verbosity >= 2: print "CaseNameShort is: " + caseNameShort + "\n\n" # now that we have the caseNumber and caseNameShort, we can dup check cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) logger.debug(time.strftime("%a, %d %b %Y %H:%M", time.localtime()) + ": Added " + ct.courtShortName + ": " + cite.caseNameShort) doc.save() i += 1 return result elif (courtID == 10): # a daily feed of all the items posted THAT day. Missing a day == bad. urls = ("http://www.ck10.uscourts.gov/opinions/new/daily_decisions.rss",) ct = Court.objects.get(courtUUID = 'ca10') for url in urls: try: html = urllib2.urlopen(url).read() except: result += "****ERROR CONNECTING TO COURT: " + str(courtID) + "****\n" continue if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result # this code gets rid of errant ampersands - they throw big errors # when parsing. We replace them later. if '&' in html: punctuationRegex = re.compile(" & ") html = re.sub(punctuationRegex, " & ", html) tree = etree.fromstring(html) else: tree = etree.fromstring(html) caseLinks = tree.xpath("//item/link") descriptions = tree.xpath("//item/description") docTypes = tree.xpath("//item/category") caseNames = tree.xpath("//item/title") caseDateRegex = re.compile("(\d{2}/\d{2}/\d{4})", re.VERBOSE | re.DOTALL) caseNumberRegex = re.compile("(\d{2}-\d{4})(.*)$") i = 0 dupCount = 0 while i < len(caseLinks): # we begin with the caseLink field caseLink = caseLinks[i].text caseLink = urljoin(url, caseLink) if verbosity >= 2: print "Link: " + caseLink myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration if verbosity >= 1: print "Error creating file, punting." i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 2: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 # this section is commented out because ca10 doesn't publish # their cases in any order resembling sanity. Thus, this bit # of code is moot. Ugh. | bb2449c1a8141bd53a8e2339af75ec01a177eba5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6762/bb2449c1a8141bd53a8e2339af75ec01a177eba5/scrape_and_parse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
888,
25360,
29328,
88,
12,
71,
477,
88,
734,
16,
563,
16,
11561,
16,
8131,
3188,
4672,
309,
11561,
1545,
404,
30,
563,
1011,
315,
27091,
348,
5093,
2203,
1360,
7910,
1099,
56,
30,
315,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
888,
25360,
29328,
88,
12,
71,
477,
88,
734,
16,
563,
16,
11561,
16,
8131,
3188,
4672,
309,
11561,
1545,
404,
30,
563,
1011,
315,
27091,
348,
5093,
2203,
1360,
7910,
1099,
56,
30,
315,... |
print "Checking whether TeX allows spaces in file names... ", | def checkProg(description, progs, rc_entry = [], path = [] ): ''' This function will search a program in $PATH plus given path If found, return directory and program name (not the options). description: description of the program progs: check programs, for each prog, the first word is used for searching but the whole string is used to replace %% for a rc_entry. So, feel free to add '$$i' etc for programs. path: additional path rc_entry: entry to outfile, can be emtpy, one pattern (%% for chosen prog or 'none'), or one for each prog and 'none'. NOTE: if you do not want 'none' entry to be added to the RC file, specify an entry for each prog and use '' for 'none' entry. FIXME: under windows, we should check registry instead of $PATH ''' # one rc entry for each progs plus none entry if len(rc_entry) > 1 and len(rc_entry) != len(progs) + 1: print "rc entry should have one item or item for each prog and none." sys.exit(2) print 'checking for ' + description + '...' ## print '(' + ','.join(progs) + ')', for idx in range(len(progs)): # ac_prog may have options, ac_word is the command name ac_prog = progs[idx] ac_word = ac_prog.split(' ')[0] print '+checking for "' + ac_word + '"... ', path = os.environ["PATH"].split(os.pathsep) + path for ac_dir in path: # check both ac_word and ac_word.exe (for windows system) if os.path.isfile( os.path.join(ac_dir, ac_word) ) or \ os.path.isfile( os.path.join(ac_dir, ac_word + ".exe") ): print ' yes' # write rc entries for this command if len(rc_entry) == 1: addToRC(rc_entry[0].replace('%%', ac_prog)) elif len(rc_entry) > 1: addToRC(rc_entry[idx].replace('%%', ac_prog)) return [ac_dir, ac_word] # if not successful print ' no' # write rc entries for 'not found' if len(rc_entry) > 0: # the last one. addToRC(rc_entry[-1].replace('%%', 'none')) return ['', 'none'] | 41dd4f0be3188829e0dccd1c1ec13e281f4fc00d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7514/41dd4f0be3188829e0dccd1c1ec13e281f4fc00d/configure.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
626,
75,
12,
3384,
16,
450,
564,
16,
4519,
67,
4099,
273,
5378,
16,
589,
273,
5378,
262,
30,
9163,
1220,
445,
903,
1623,
279,
5402,
316,
271,
4211,
8737,
864,
589,
971,
1392,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
626,
75,
12,
3384,
16,
450,
564,
16,
4519,
67,
4099,
273,
5378,
16,
589,
273,
5378,
262,
30,
9163,
1220,
445,
903,
1623,
279,
5402,
316,
271,
4211,
8737,
864,
589,
971,
1392,
16... | |
self.prj.projects_db['launcher'].full_name) + ext_exec, | self.prj.projects_db['launcher'].full_name) + ext_exec, | def install (self, opts = ['rc', 'deps'] ): result = self.result(deps_results = 'deps' in opts) | 292e122d832953f0a5eca4a962c0b1089ab52802 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8002/292e122d832953f0a5eca4a962c0b1089ab52802/ide_project.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3799,
261,
2890,
16,
1500,
273,
10228,
1310,
2187,
296,
14877,
3546,
262,
30,
563,
273,
365,
18,
2088,
12,
14877,
67,
4717,
273,
296,
14877,
11,
316,
1500,
13,
2,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3799,
261,
2890,
16,
1500,
273,
10228,
1310,
2187,
296,
14877,
3546,
262,
30,
563,
273,
365,
18,
2088,
12,
14877,
67,
4717,
273,
296,
14877,
11,
316,
1500,
13,
2,
-100,
-100,
-100,
-10... |
return self.get_handler('/ui/aruni/template.xhtml') | except LookupError: return self.get_handler('/ui/aruni/template.xhtml') | def get_template(self): if self.has_handler('template.xhtml'): return self.get_handler('template.xhtml') # Default, aruni return self.get_handler('/ui/aruni/template.xhtml') | 561b04b86500f7f67e69de0f03a500447abb6080 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12681/561b04b86500f7f67e69de0f03a500447abb6080/skins.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3202,
12,
2890,
4672,
309,
365,
18,
5332,
67,
4176,
2668,
3202,
18,
26341,
11,
4672,
327,
365,
18,
588,
67,
4176,
2668,
3202,
18,
26341,
6134,
468,
2989,
16,
419,
318,
77,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3202,
12,
2890,
4672,
309,
365,
18,
5332,
67,
4176,
2668,
3202,
18,
26341,
11,
4672,
327,
365,
18,
588,
67,
4176,
2668,
3202,
18,
26341,
6134,
468,
2989,
16,
419,
318,
77,
3... |
t_start = startOfInterval(t, t_length) print timestamp_to_string(t), t_length, timestamp_to_string(t_start) assert(time.localtime(t_start)[0:6] == (2009, 3, 4, 1, 55, 00)) t = time.mktime((2009, 3, 4, 1, 0, 0, 0, 0, 0)) | t_test = time.mktime((2009, 3, 4, 1, 57, 17, 0, 0, 0)) t_ans = time.mktime((2009, 3, 4, 1, 55, 0, 0, 0, 0)) t_start = startOfInterval(t_test, t_length) print timestamp_to_string(t_test), t_length, timestamp_to_string(t_start) assert(t_start == t_ans) | def _get_object(module_class, *args, **kwargs): """Given a path to a class, instantiates an instance of the class with the given args and returns it.""" # Split the path into its parts parts = module_class.split('.') # Strip off the classname: module = '.'.join(parts[:-1]) # Import the top level module mod = __import__(module) # Then recursively work down from the top level module to the class name: for part in parts[1:]: mod = getattr(mod, part) # Instance 'mod' will now be a class. Instantiate an instance and return it: obj = mod(*args, **kwargs) return obj | 19b04500cd89d5b1697673f832aae81e1515f674 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1013/19b04500cd89d5b1697673f832aae81e1515f674/weeutil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
1612,
12,
2978,
67,
1106,
16,
380,
1968,
16,
2826,
4333,
4672,
3536,
6083,
279,
589,
358,
279,
667,
16,
5934,
16020,
392,
791,
434,
326,
667,
598,
326,
864,
833,
471,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
1612,
12,
2978,
67,
1106,
16,
380,
1968,
16,
2826,
4333,
4672,
3536,
6083,
279,
589,
358,
279,
667,
16,
5934,
16020,
392,
791,
434,
326,
667,
598,
326,
864,
833,
471,
1... |
Default is 1000./80 where 80 is the fps I want to switch to full screen mode. | Defaults to 1000.0 / 80.0. This means that the screen will be painted using the flip method rather than the update method if the update method is taking so long to update the screen that the frame rate falls below 80 frames per second. | def set_timing_treshold(self, time_ms): """sets the treshold in milliseconds set_timing_treshold(time_ms): return None | d9760f3e4782abb02dd98080337626eefdad67ee /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1298/d9760f3e4782abb02dd98080337626eefdad67ee/sprite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
8584,
310,
67,
88,
3444,
12,
2890,
16,
813,
67,
959,
4672,
3536,
4424,
326,
268,
3444,
316,
10993,
444,
67,
8584,
310,
67,
88,
3444,
12,
957,
67,
959,
4672,
327,
599,
2,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
8584,
310,
67,
88,
3444,
12,
2890,
16,
813,
67,
959,
4672,
3536,
4424,
326,
268,
3444,
316,
10993,
444,
67,
8584,
310,
67,
88,
3444,
12,
957,
67,
959,
4672,
327,
599,
2,
-... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.