rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
if condition: | if condition: | def selectPilots(self,condDict, older=None, newer=None, timeStamp='CreationDate', orderAttribute=None, limit=None): """ Select pilot references according to the provided criteria. "newer" and "older" specify the time interval in minutes """ | 4281b6ebd17e9e6456de007d4a03f9fe1ab6a236 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/4281b6ebd17e9e6456de007d4a03f9fe1ab6a236/PilotAgentsDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2027,
52,
330,
6968,
12,
2890,
16,
10013,
5014,
16,
12156,
33,
7036,
16,
16069,
33,
7036,
16,
18198,
2218,
9906,
1626,
2187,
1353,
1499,
33,
7036,
16,
1800,
33,
7036,
4672,
3536,
6766,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2027,
52,
330,
6968,
12,
2890,
16,
10013,
5014,
16,
12156,
33,
7036,
16,
16069,
33,
7036,
16,
18198,
2218,
9906,
1626,
2187,
1353,
1499,
33,
7036,
16,
1800,
33,
7036,
4672,
3536,
6766,
... |
def name(self, new=''): | def name(self, new=None): | def name(self, new=''): """ Returns the name of the (di)graph. INPUT: new -- if not None, then this becomes the new name of the (di)graph. set_to_none -- if True, removes any name EXAMPLE: sage: d = {0: [1,4,5], 1: [2,6], 2: [3,7], 3: [4,8], 4: [9], 5: [7, 8], 6: [8,9], 7: [9]} sage: G = Graph(d); G Graph on 10 vertices sage: G.name("Petersen Graph"); G 'Petersen Graph' Petersen Graph: Graph on 10 vertices sage: G.name(""); G Graph on 10 vertices | 3f700878d8373eecd5c46e21e9080f2b46363947 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/3f700878d8373eecd5c46e21e9080f2b46363947/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
508,
12,
2890,
16,
394,
33,
7036,
4672,
3536,
2860,
326,
508,
434,
326,
261,
3211,
13,
4660,
18,
225,
12943,
30,
394,
1493,
309,
486,
599,
16,
1508,
333,
12724,
326,
394,
508,
434,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
508,
12,
2890,
16,
394,
33,
7036,
4672,
3536,
2860,
326,
508,
434,
326,
261,
3211,
13,
4660,
18,
225,
12943,
30,
394,
1493,
309,
486,
599,
16,
1508,
333,
12724,
326,
394,
508,
434,
3... |
if not page.has_key('saved'): | if checkAccess and not can_be_read(name): | def can_be_read(name): return request.user.may.read(name) | 54c491e676ba258f38c8d4b9a23f42b50e62d4e5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/888/54c491e676ba258f38c8d4b9a23f42b50e62d4e5/editing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
848,
67,
2196,
67,
896,
12,
529,
4672,
327,
590,
18,
1355,
18,
24877,
18,
896,
12,
529,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
848,
67,
2196,
67,
896,
12,
529,
4672,
327,
590,
18,
1355,
18,
24877,
18,
896,
12,
529,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
log("Warning: Value of property \"length\" must be greater than 0 (setting to 1)") | log(_("Warning: Value of property \"length\" must be greater than 0 (setting to 1)")) | def __setattr__(self, name, value): | f7391a9446de756cb42910377e3e520b76672941 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5768/f7391a9446de756cb42910377e3e520b76672941/ControlWrapper.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
1747,
972,
12,
2890,
16,
508,
16,
460,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
1747,
972,
12,
2890,
16,
508,
16,
460,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
''' | """ | def HyperStarGraph(self,n,k): r''' Returns the hyper-star graph HS(n,k). The vertices of the hyper-star graph are the set of binary strings of length n which contain k 1s. Two vertices, u and v, are adjacent only if u can be obtained from v by swapping the first bit with a different symbol in another position. INPUT:: - ``n`` - ``k`` EXAMPLES:: sage: g = graphs.HyperStarGraph(6,3) sage: g.plot() # long time REFERENCES: - Lee, Hyeong-Ok, Jong-Seok Kim, Eunseuk Oh, and Hyeong-Seok Lim. "Hyper-Star Graph: A New Interconnection Network Improving the Network Cost of the Hypercube." In Proceedings of the First EurAsian Conference on Information and Communication Technology, 858-865. Springer-Verlag, 2002. AUTHORS: - Michael Yurko (2009-09-01) | e57a7b736852231f13d906c838b0d978d747387f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/e57a7b736852231f13d906c838b0d978d747387f/graph_generators.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18274,
18379,
4137,
12,
2890,
16,
82,
16,
79,
4672,
436,
26418,
2860,
326,
9512,
17,
10983,
2667,
670,
55,
12,
82,
16,
79,
2934,
225,
1021,
6928,
434,
326,
9512,
17,
10983,
2667,
854,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18274,
18379,
4137,
12,
2890,
16,
82,
16,
79,
4672,
436,
26418,
2860,
326,
9512,
17,
10983,
2667,
670,
55,
12,
82,
16,
79,
2934,
225,
1021,
6928,
434,
326,
9512,
17,
10983,
2667,
854,
... |
(lineIsFull, line, cursor, currentLength, usedIndent, maxLength, justStrings) = self.fitLine(remainder, maxwidth) | (lineIsFull, line, cursor, currentLength, \ usedIndent, maxLength, justStrings) = self.fitLine(remainder, maxwidth) | def format(self, maxwidth, maxheight, program, leading=0): "return program with line operations added if at least one line fits" # note: a generated formatted segment should not be formatted again startstate = self.__dict__.copy() #remainder = self.cleanProgram(program) remainder = program[:] #program1 = remainder[:] # debug only lineprogram = [] from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_RIGHT, TA_JUSTIFY #if maxheight<TOOSMALLSPACE: # raise ValueError, "attempt to format inside too small a height! "+repr(maxheight) heightremaining = maxheight-leading room = 1 cursorcount = 0 # debug while remainder and room: #heightremaining>=self.leading and remainder: #print "getting line with statestack", len(self.textStateStack) #heightremaining = heightremaining - self.leading indent = self.indent rightIndent = self.rightIndent linewidth = maxwidth - indent - rightIndent beforelinestate = self.__dict__.copy() if linewidth<TOOSMALLSPACE: raise ValueError, "indents %s %s too wide for space %s" % (self.indent, self.rightIndent, maxwidth) try: (lineIsFull, line, cursor, currentLength, usedIndent, maxLength, justStrings) = self.fitLine(remainder, maxwidth) except: | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
12,
2890,
16,
943,
2819,
16,
943,
4210,
16,
5402,
16,
7676,
33,
20,
4672,
315,
2463,
5402,
598,
980,
5295,
3096,
309,
622,
4520,
1245,
980,
13351,
6,
468,
4721,
30,
279,
4374,
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,
740,
12,
2890,
16,
943,
2819,
16,
943,
4210,
16,
5402,
16,
7676,
33,
20,
4672,
315,
2463,
5402,
598,
980,
5295,
3096,
309,
622,
4520,
1245,
980,
13351,
6,
468,
4721,
30,
279,
4374,
4... |
except AttributeError: | except (AttributeError, io.UnsupportedOperation): | def __init__(self, buffer, encoding=None, newline=None): if newline not in (None, "\n", "\r\n"): raise ValueError("illegal newline value: %r" % (newline,)) if encoding is None: try: encoding = os.device_encoding(buffer.fileno()) except AttributeError: pass if encoding is None: try: import locale except ImportError: # Importing locale may fail if Python is being built encoding = "ascii" else: encoding = locale.getpreferredencoding() | c1420ab170a3fadc1fee550248464b7524722a9e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/c1420ab170a3fadc1fee550248464b7524722a9e/io.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1613,
16,
2688,
33,
7036,
16,
9472,
33,
7036,
4672,
309,
9472,
486,
316,
261,
7036,
16,
1548,
82,
3113,
1548,
86,
64,
82,
6,
4672,
1002,
2068,
2932,
31... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1613,
16,
2688,
33,
7036,
16,
9472,
33,
7036,
4672,
309,
9472,
486,
316,
261,
7036,
16,
1548,
82,
3113,
1548,
86,
64,
82,
6,
4672,
1002,
2068,
2932,
31... |
formatname = self.var_format_name.get() if formatname == USER_SPECIFIC: height, width=self.var_width.get(),self.var_height.get() self.var_width.set(width) self.var_height.set(height) | width =min(self.var_width.get(),self.var_height.get()) height=max(self.var_width.get(),self.var_height.get()) self.update_size(width, height) | def set_portrait(self): self.page_orientation=0 formatname = self.var_format_name.get() if formatname == USER_SPECIFIC: height, width=self.var_width.get(),self.var_height.get() self.var_width.set(width) self.var_height.set(height) self.set_size() | 9968b3b60a6a59c3677dab6bf7afea7e0e6494b1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3123/9968b3b60a6a59c3677dab6bf7afea7e0e6494b1/page_panel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
3831,
22513,
12,
2890,
4672,
365,
18,
2433,
67,
19235,
33,
20,
1835,
273,
1154,
12,
2890,
18,
1401,
67,
2819,
18,
588,
9334,
2890,
18,
1401,
67,
4210,
18,
588,
10756,
2072,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
3831,
22513,
12,
2890,
4672,
365,
18,
2433,
67,
19235,
33,
20,
1835,
273,
1154,
12,
2890,
18,
1401,
67,
2819,
18,
588,
9334,
2890,
18,
1401,
67,
4210,
18,
588,
10756,
2072,
... |
UMASK = 077 WORKDIR = "/" | def Daemonize(logfile): """Daemonize the current process. This detaches the current process from the controlling terminal and runs it in the background as a daemon. @type logfile: str @param logfile: the logfile to which we should redirect stdout/stderr @rtype: int @return: the value zero """ # pylint: disable-msg=W0212 # yes, we really want os._exit UMASK = 077 WORKDIR = "/" # this might fail pid = os.fork() if (pid == 0): # The first child. os.setsid() # this might fail pid = os.fork() # Fork a second child. if (pid == 0): # The second child. os.chdir(WORKDIR) os.umask(UMASK) else: # exit() or _exit()? See below. os._exit(0) # Exit parent (the first child) of the second child. else: os._exit(0) # Exit parent of the first child. for fd in range(3): _CloseFDNoErr(fd) i = os.open("/dev/null", os.O_RDONLY) # stdin assert i == 0, "Can't close/reopen stdin" i = os.open(logfile, os.O_WRONLY|os.O_CREAT|os.O_APPEND, 0600) # stdout assert i == 1, "Can't close/reopen stdout" # Duplicate standard output to standard error. os.dup2(1, 2) return 0 | 0260032ce37a960f7c619a1bbc891434ff84c927 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7542/0260032ce37a960f7c619a1bbc891434ff84c927/utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13054,
554,
12,
28806,
4672,
3536,
12858,
554,
326,
783,
1207,
18,
225,
1220,
10199,
281,
326,
783,
1207,
628,
326,
3325,
2456,
8651,
471,
7597,
518,
316,
326,
5412,
487,
279,
8131,
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,
13054,
554,
12,
28806,
4672,
3536,
12858,
554,
326,
783,
1207,
18,
225,
1220,
10199,
281,
326,
783,
1207,
628,
326,
3325,
2456,
8651,
471,
7597,
518,
316,
326,
5412,
487,
279,
8131,
18,
... | |
line = fp.readline() | line = fp.readline().rstrip() | def extractbin(fp): line = fp.readline() while line and not line.startswith('literal '): line = fp.readline() if not line: return size = int(line[8:].rstrip()) dec = [] line = fp.readline() while line: line = line[1:-1] dec.append(base85.b85decode(line)) line = fp.readline() text = zlib.decompress(''.join(dec)) if len(text) != size: raise util.Abort(_('binary patch is %d bytes, not %d') % (len(text), size)) return text | 503bc67416634bd09e5cca6f05550c7420052aec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/503bc67416634bd09e5cca6f05550c7420052aec/patch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
4757,
12,
7944,
4672,
980,
273,
4253,
18,
896,
1369,
7675,
86,
6406,
1435,
1323,
980,
471,
486,
980,
18,
17514,
1918,
2668,
13107,
296,
4672,
980,
273,
4253,
18,
896,
1369,
7675,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
4757,
12,
7944,
4672,
980,
273,
4253,
18,
896,
1369,
7675,
86,
6406,
1435,
1323,
980,
471,
486,
980,
18,
17514,
1918,
2668,
13107,
296,
4672,
980,
273,
4253,
18,
896,
1369,
7675,
... |
Return the ambient group related to self. EXAMPLES: An example involving the dihedral group on four elements, | Return the ambient group related to ``self``. EXAMPLES: An example involving the dihedral group on four elements, | def ambient_group(self): """ Return the ambient group related to self. EXAMPLES: An example involving the dihedral group on four elements, `D_8`:: sage: G = DihedralGroup(4) sage: H = CyclicPermutationGroup(4) sage: gens = H.gens() sage: S = PermutationGroup_subgroup(G, list(gens)) sage: S.ambient_group() Dihedral group of order 8 as a permutation group sage: S.ambient_group() == G True """ return self.__ambient_group | 6ac30ecf5071d4fb909072e90d2311932d8c2165 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/6ac30ecf5071d4fb909072e90d2311932d8c2165/permgroup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13232,
1979,
67,
1655,
12,
2890,
4672,
3536,
2000,
326,
13232,
1979,
1041,
3746,
358,
12176,
2890,
68,
8338,
225,
5675,
8900,
11386,
30,
225,
1922,
3454,
29876,
6282,
326,
4314,
28351,
104... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13232,
1979,
67,
1655,
12,
2890,
4672,
3536,
2000,
326,
13232,
1979,
1041,
3746,
358,
12176,
2890,
68,
8338,
225,
5675,
8900,
11386,
30,
225,
1922,
3454,
29876,
6282,
326,
4314,
28351,
104... |
checkversion(repo.manifest, "manifest") checksize(repo.manifest, "manifest") | if repo.changelog.count() > 0 and repo.manifest.count() == 0: havemf = 0 err(0, _("empty or missing 00manifest.i")) else: checkversion(repo.manifest, "manifest") checksize(repo.manifest, "manifest") | def checkversion(obj, name): if obj.version != revlog.REVLOGV0: if not revlogv1: warn(_("warning: `%s' uses revlog format 1") % name) elif revlogv1: warn(_("warning: `%s' uses revlog format 0") % name) | 81ab121d11413401b817b66dfac2aab4c2762a61 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11312/81ab121d11413401b817b66dfac2aab4c2762a61/verify.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
1589,
12,
2603,
16,
508,
4672,
309,
1081,
18,
1589,
480,
5588,
1330,
18,
862,
58,
4842,
58,
20,
30,
309,
486,
5588,
1330,
90,
21,
30,
1894,
24899,
2932,
8551,
30,
12430,
87,
11,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
1589,
12,
2603,
16,
508,
4672,
309,
1081,
18,
1589,
480,
5588,
1330,
18,
862,
58,
4842,
58,
20,
30,
309,
486,
5588,
1330,
90,
21,
30,
1894,
24899,
2932,
8551,
30,
12430,
87,
11,... |
print "Group order now ",n1*n2,"=",n1,"*",n2 | print "Subgroup order is now ",n1*n2,"=",n1,"*",n2 | def abelian_group(self, debug=False): r""" Returns the abelian group structure of the group of points on this elliptic curve. | 612ce215a92d5ed7d78f8ea65721e4b7aaf9e3ad /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/612ce215a92d5ed7d78f8ea65721e4b7aaf9e3ad/ell_finite_field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1223,
292,
2779,
67,
1655,
12,
2890,
16,
1198,
33,
8381,
4672,
436,
8395,
2860,
326,
1223,
292,
2779,
1041,
3695,
434,
326,
1041,
434,
3143,
603,
333,
415,
549,
21507,
8882,
18,
2,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1223,
292,
2779,
67,
1655,
12,
2890,
16,
1198,
33,
8381,
4672,
436,
8395,
2860,
326,
1223,
292,
2779,
1041,
3695,
434,
326,
1041,
434,
3143,
603,
333,
415,
549,
21507,
8882,
18,
2,
-10... |
task = self._remove(pkg, changeset, locked, pending, WEIGHT_NONE) | task = self.TaskRemove(roottask, pkg, changeset, locked, pending, WEIGHT_NONE, WEIGHT_NONE) | def run(self): | c2ff0e2fa3473e5898baf091e7a39f94abf28732 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8317/c2ff0e2fa3473e5898baf091e7a39f94abf28732/transaction.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
self.service.connectionLost(self.name) | self.service.connectionLost(self.name, self.transport.pid) | def processEnded(self, reason): if not self.empty: self.output.dataReceived('\n') self.service.connectionLost(self.name) | e63be4be40c2fa73dfc4b4e37611c16cfc14ca76 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/e63be4be40c2fa73dfc4b4e37611c16cfc14ca76/procmon.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
28362,
12,
2890,
16,
3971,
4672,
309,
486,
365,
18,
5531,
30,
365,
18,
2844,
18,
892,
8872,
2668,
64,
82,
6134,
365,
18,
3278,
18,
4071,
19024,
12,
2890,
18,
529,
13,
2,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
28362,
12,
2890,
16,
3971,
4672,
309,
486,
365,
18,
5531,
30,
365,
18,
2844,
18,
892,
8872,
2668,
64,
82,
6134,
365,
18,
3278,
18,
4071,
19024,
12,
2890,
18,
529,
13,
2,
-100,
... |
def hide_window(self, window): | def __hide_window(self, window): | def hide_window(self, window): window.__position = window.get_position() window.hide() | 1518cc810432a6e15b3d9f134759190405b665ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4764/1518cc810432a6e15b3d9f134759190405b665ce/trayicon.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
11248,
67,
5668,
12,
2890,
16,
2742,
4672,
2742,
16186,
3276,
273,
2742,
18,
588,
67,
3276,
1435,
2742,
18,
11248,
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,
0,
0,
0,
0,
0,
0,
0,
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,
11248,
67,
5668,
12,
2890,
16,
2742,
4672,
2742,
16186,
3276,
273,
2742,
18,
588,
67,
3276,
1435,
2742,
18,
11248,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
phi_cur ) | phi_cur ) | def __init__( self , ref_el , degree ): entity_ids = {} nodes = [] | 085ed27cab51351290d3dac63b340f8baecc46a8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/625/085ed27cab51351290d3dac63b340f8baecc46a8/brezzi_douglas_marini.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
269,
1278,
67,
292,
269,
10782,
262,
30,
1522,
67,
2232,
273,
2618,
2199,
273,
5378,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
269,
1278,
67,
292,
269,
10782,
262,
30,
1522,
67,
2232,
273,
2618,
2199,
273,
5378,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
floppy = self.floppy_contents(node,True) | floppy_text = self.floppy_contents(node,True) | def hexa2 (c): return chr((c>>4)+65) + chr ((c&16)+65) | c8a588799344db08a0317644ebb9ebfc6ebf9860 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7598/c8a588799344db08a0317644ebb9ebfc6ebf9860/GetBootMedium.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3827,
69,
22,
261,
71,
4672,
327,
4513,
12443,
71,
9778,
24,
27921,
9222,
13,
397,
4513,
14015,
71,
10,
2313,
27921,
9222,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3827,
69,
22,
261,
71,
4672,
327,
4513,
12443,
71,
9778,
24,
27921,
9222,
13,
397,
4513,
14015,
71,
10,
2313,
27921,
9222,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def longtitude(self): | def longitude(self): | def longtitude(self): "(float) Get the longtitude value of the geo-tag. See also .location()" lat, lon = self.location() return lon | cb4068d44da7ae94cbf2c55a70b62c50ed2d4210 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5609/cb4068d44da7ae94cbf2c55a70b62c50ed2d4210/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9192,
12,
2890,
4672,
7751,
5659,
13,
968,
326,
1525,
88,
3540,
460,
434,
326,
7856,
17,
2692,
18,
2164,
2546,
263,
3562,
10031,
2516,
16,
4281,
273,
365,
18,
3562,
1435,
327,
4281,
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,
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,
9192,
12,
2890,
4672,
7751,
5659,
13,
968,
326,
1525,
88,
3540,
460,
434,
326,
7856,
17,
2692,
18,
2164,
2546,
263,
3562,
10031,
2516,
16,
4281,
273,
365,
18,
3562,
1435,
327,
4281,
2,... |
with open(sys.argv[3], "w") as metadata: | cacheName = sys.argv[3] cacheHash = cacheName.split("/")[1] with open(cacheName + ".metadata", "w") as metadata: | def add_tag(tags, metadata, read_name, write_name): if read_name in tags: tag = tags.tags[read_name] tag = tag[0] if isinstance(tag, tuple): # m4a files seem to return track number as a tuple: (tracknumber, totaltracks) (tag, _ignore) = tag metadata.write("%s\n" % write_name) metadata.write("%s\n" % tag) | fe944cd97c5a194b1f09eb9e582b56eb756bbb7b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13015/fe944cd97c5a194b1f09eb9e582b56eb756bbb7b/get_metadata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
2692,
12,
4156,
16,
1982,
16,
855,
67,
529,
16,
1045,
67,
529,
4672,
309,
855,
67,
529,
316,
2342,
30,
1047,
273,
2342,
18,
4156,
63,
896,
67,
529,
65,
1047,
273,
1047,
63... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
2692,
12,
4156,
16,
1982,
16,
855,
67,
529,
16,
1045,
67,
529,
4672,
309,
855,
67,
529,
316,
2342,
30,
1047,
273,
2342,
18,
4156,
63,
896,
67,
529,
65,
1047,
273,
1047,
63... |
u2 = random() | if not 1e-7 < u1 < .9999999: continue u2 = 1.0 - random() | def gammavariate(self, alpha, beta): """Gamma distribution. Not the gamma function! | 873612d58c61fd253556a4f323b4657233abc867 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/873612d58c61fd253556a4f323b4657233abc867/random.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23411,
20689,
297,
3840,
12,
2890,
16,
4190,
16,
6796,
4672,
3536,
31300,
7006,
18,
225,
2288,
326,
9601,
445,
5,
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,
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,
23411,
20689,
297,
3840,
12,
2890,
16,
4190,
16,
6796,
4672,
3536,
31300,
7006,
18,
225,
2288,
326,
9601,
445,
5,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
super(Function, self).__init__(**kwargs) | super(Report, self).__init__(**kwargs) | def __init__(self, model, name, string, **kwargs): self.model = model self.name = name self.string = string super(Function, self).__init__(**kwargs) | 8aa21c08364419edcb84a55d7c721137b1575353 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/8aa21c08364419edcb84a55d7c721137b1575353/yaml_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
938,
16,
508,
16,
533,
16,
2826,
4333,
4672,
365,
18,
2284,
273,
938,
365,
18,
529,
273,
508,
365,
18,
1080,
273,
533,
2240,
12,
2083,
16,
365,
2934,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
938,
16,
508,
16,
533,
16,
2826,
4333,
4672,
365,
18,
2284,
273,
938,
365,
18,
529,
273,
508,
365,
18,
1080,
273,
533,
2240,
12,
2083,
16,
365,
2934,
... |
def setupResponse(self, pingResult, method): if method == "POST": return {'status_code' : pingResult.status_code, 'headers' : pingResult.headers, 'content' : pingResult.content } else: result = {} result['status_code'] = 200 result['headers'] = { 'Content-Type' : "text/plain" } result['content'] = str(pingResult.status_code) + "\n" for header in pingResult.headers.keys(): result['content'] += header + ": " + pingResult.headers[header] + "\n" result['content'] += "\n" + pingResult.content return result | def setupRequest(self, method): qs = self.request.query_string parsedQs = cgi.parse_qs(qs) params = {} if parsedQs.has_key('hub') and parsedQs.has_key('topic'): params['success'] = True params['url'] = urllib.unquote(parsedQs['hub'][0]) params['method'] = "POST" params['body'] = urllib.urlencode( { "hub.mode" : "publish", "hub.url" : parsedQs['topic']}, True ) params['headers'] = { "Content-Type" : "application/x-www-form-urlencoded" } return params else: params['success'] = False return params | 9d5b73c8c3d2f92800ab621cc1824db9a52e9ca5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13890/9d5b73c8c3d2f92800ab621cc1824db9a52e9ca5/urlreq.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
691,
12,
2890,
16,
707,
4672,
8719,
273,
365,
18,
2293,
18,
2271,
67,
1080,
2707,
53,
87,
273,
276,
10052,
18,
2670,
67,
12926,
12,
12926,
13,
225,
859,
273,
2618,
225,
309,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
691,
12,
2890,
16,
707,
4672,
8719,
273,
365,
18,
2293,
18,
2271,
67,
1080,
2707,
53,
87,
273,
276,
10052,
18,
2670,
67,
12926,
12,
12926,
13,
225,
859,
273,
2618,
225,
309,
27... | |
else : | if job.runningJob.errors is None or job.runningJob.errors == [] : | def getWMSOutput( self, jobList, outdir, service ): """ Manage objects to retrieve the output """ | 4821f3f07603aad958a2ac1c2b4b60bcaa7f40d3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8886/4821f3f07603aad958a2ac1c2b4b60bcaa7f40d3/SchedulerGLiteAPI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13876,
3537,
1447,
12,
365,
16,
1719,
682,
16,
225,
15398,
16,
1156,
262,
30,
3536,
24247,
2184,
358,
4614,
326,
876,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
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,
13876,
3537,
1447,
12,
365,
16,
1719,
682,
16,
225,
15398,
16,
1156,
262,
30,
3536,
24247,
2184,
358,
4614,
326,
876,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
rmChans = list() for channel in user.channels: rmChans.append(channel) for channel in rmChans: | for channel in list(user.channels): | def removeUser(self, user): # perform all the cleanup that needs to be done to get a user out of the system log(self, "Removing %s from server" % user, 3) if(user in self.users): self.users.remove(user) else: log(self, "WARNING: %s wasn't in userlist" % user, 3) log(self, "Removing %s from channels %s" % (user, user.channels), 3) rmChans = list() for channel in user.channels: rmChans.append(channel) for channel in rmChans: channel.removeUser(user) if(user.connection.type == self.IRC_Connection.CLIENT): user.connection.sock.close() user.connection.closed = True self.connections.remove(user.connection) | f7836eee8ed9a994dc76e64b7a339f7cab876ec9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11670/f7836eee8ed9a994dc76e64b7a339f7cab876ec9/IRC_Server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
1299,
12,
2890,
16,
729,
4672,
468,
3073,
777,
326,
6686,
716,
4260,
358,
506,
2731,
358,
336,
279,
729,
596,
434,
326,
2619,
613,
12,
2890,
16,
315,
18939,
738,
87,
628,
1438,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
1299,
12,
2890,
16,
729,
4672,
468,
3073,
777,
326,
6686,
716,
4260,
358,
506,
2731,
358,
336,
279,
729,
596,
434,
326,
2619,
613,
12,
2890,
16,
315,
18939,
738,
87,
628,
1438,
... |
source = source.replace('/', os.sep) destination = destination.replace('/', os.sep) self._copy_dir(source, destination) self._info("Copied directory from '%s' to '%s'" % (source, destination)) def _copy_dir(self, source, destination): | source, destination = self._copy_dir(source, destination) self._info("Copied directory from '%s' to '%s'" % (source, destination)) def move_directory(self, source, destination): """Moves the source directory into a destination. If a destination exists, the source is moved under it. Otherwise the destination directory and the possible missing intermediate directories are created. """ source, destination = self._copy_dir(source, destination) shutil.rmtree(source) self._info("Moved directory from '%s' to '%s'" % (source, destination)) def _copy_dir(self, source, dest): source = self._absnorm(source) dest = self._absnorm(dest) | def copy_directory(self, source, destination): """Copies the source directory into the destination. If the destination exists, the source is copied under it. Otherwise the destination directory and the possible missing intermediate directories are created. """ source = source.replace('/', os.sep) destination = destination.replace('/', os.sep) self._copy_dir(source, destination) self._info("Copied directory from '%s' to '%s'" % (source, destination)) | 4e92df2860c270b97129fb5577b1caec2faab8a2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6988/4e92df2860c270b97129fb5577b1caec2faab8a2/OperatingSystem.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
67,
5149,
12,
2890,
16,
1084,
16,
2929,
4672,
3536,
15670,
326,
1084,
1867,
1368,
326,
2929,
18,
225,
971,
326,
2929,
1704,
16,
326,
1084,
353,
9268,
3613,
518,
18,
5272,
326,
29... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
67,
5149,
12,
2890,
16,
1084,
16,
2929,
4672,
3536,
15670,
326,
1084,
1867,
1368,
326,
2929,
18,
225,
971,
326,
2929,
1704,
16,
326,
1084,
353,
9268,
3613,
518,
18,
5272,
326,
29... |
if sys.platform in ('os2emx', 'riscos') or sys.platform[:4] == 'java': | if sys.platform in ('os2emx', 'riscos') or _is_jython: | def addsitepackages(known_paths, sys_prefix=sys.prefix, exec_prefix=sys.exec_prefix): """Add site-packages (and possibly site-python) to sys.path""" prefixes = [os.path.join(sys_prefix, "local"), sys_prefix] if exec_prefix != sys_prefix: prefixes.append(os.path.join(exec_prefix, "local")) for prefix in prefixes: if prefix: if sys.platform in ('os2emx', 'riscos') or sys.platform[:4] == 'java': sitedirs = [os.path.join(prefix, "Lib", "site-packages")] elif sys.platform == 'darwin' and prefix == sys_prefix: if prefix.startswith("/System/Library/Frameworks/"): # Apple's Python sitedirs = [os.path.join("/Library/Python", sys.version[:3], "site-packages"), os.path.join(prefix, "Extras", "lib", "python")] else: # any other Python distros on OSX work this way sitedirs = [os.path.join(prefix, "lib", "python" + sys.version[:3], "site-packages")] elif os.sep == '/': sitedirs = [os.path.join(prefix, "lib", "python" + sys.version[:3], "site-packages"), os.path.join(prefix, "lib", "site-python"), os.path.join(prefix, "python" + sys.version[:3], "lib-dynload")] lib64_dir = os.path.join(prefix, "lib64", "python" + sys.version[:3], "site-packages") if (os.path.exists(lib64_dir) and os.path.realpath(lib64_dir) not in [os.path.realpath(p) for p in sitedirs]): sitedirs.append(lib64_dir) try: # sys.getobjects only available in --with-pydebug build sys.getobjects sitedirs.insert(0, os.path.join(sitedirs[0], 'debug')) except AttributeError: pass else: sitedirs = [prefix, os.path.join(prefix, "lib", "site-packages")] if sys.platform == 'darwin': # for framework builds *only* we add the standard Apple # locations. Currently only per-user, but /Library and # /Network/Library could be added too if 'Python.framework' in prefix: home = os.environ.get('HOME') if home: sitedirs.append( os.path.join(home, 'Library', 'Python', sys.version[:3], 'site-packages')) for sitedir in sitedirs: if os.path.isdir(sitedir): addsitedir(sitedir, known_paths) return None | b540d6409f5bc0644c60737801c207a532d5d7e6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12981/b540d6409f5bc0644c60737801c207a532d5d7e6/site.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4831,
305,
881,
484,
1023,
12,
2994,
67,
4481,
16,
2589,
67,
3239,
33,
9499,
18,
3239,
16,
1196,
67,
3239,
33,
9499,
18,
4177,
67,
3239,
4672,
3536,
986,
2834,
17,
10308,
261,
464,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4831,
305,
881,
484,
1023,
12,
2994,
67,
4481,
16,
2589,
67,
3239,
33,
9499,
18,
3239,
16,
1196,
67,
3239,
33,
9499,
18,
4177,
67,
3239,
4672,
3536,
986,
2834,
17,
10308,
261,
464,
1... |
pass | self.maxDepth = 20 self.fileRoot = "" self.urlRoot = "" self.urlIndex = [] | def __init__(self): pass | 9d1220abfbcbc31806deb9a0809fb045a329b4e4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5718/9d1220abfbcbc31806deb9a0809fb045a329b4e4/Wget.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
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,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
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,
-100,
-1... |
container = self.get_object(path) | try: container = self.get_object(path) except LookupError: return False | def has_object(self, path): if not isinstance(path, Path): path = Path(path) | 1449102c2f834e3ac8b136a5c7e2f703264a4f82 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12681/1449102c2f834e3ac8b136a5c7e2f703264a4f82/base.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
711,
67,
1612,
12,
2890,
16,
589,
4672,
309,
486,
1549,
12,
803,
16,
2666,
4672,
589,
273,
2666,
12,
803,
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,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
711,
67,
1612,
12,
2890,
16,
589,
4672,
309,
486,
1549,
12,
803,
16,
2666,
4672,
589,
273,
2666,
12,
803,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
fxd.title = fxd.str2XML(rec_prog.title) | fxd.title = rec_prog.title | def create_fxd(self,rec_prog): from util.fxdimdb import FxdImdb, makeVideo fxd = FxdImdb() fxd.setFxdFile(config.TV_RECORD_DIR + '/' + rec_prog.filename, overwrite = True) | 827c9366310a81a7745a4e6dfbada9e07ffbceea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/827c9366310a81a7745a4e6dfbada9e07ffbceea/recordserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
74,
7669,
12,
2890,
16,
3927,
67,
14654,
4672,
628,
1709,
18,
19595,
3509,
1966,
1930,
478,
7669,
1170,
1966,
16,
1221,
10083,
284,
7669,
273,
478,
7669,
1170,
1966,
1435,
284,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
74,
7669,
12,
2890,
16,
3927,
67,
14654,
4672,
628,
1709,
18,
19595,
3509,
1966,
1930,
478,
7669,
1170,
1966,
16,
1221,
10083,
284,
7669,
273,
478,
7669,
1170,
1966,
1435,
284,
... |
"""Get taxon labels.""" self.taxlabels=[] opts=CharBuffer(options) while True: taxon=quotestrip(opts.next_word()) if not taxon: break self.taxlabels.append(taxon) | """Get taxon labels. As the taxon names are already in the matrix, this is superflous except for transpose matrices, which are currently unspupported anyway. Thus, we ignore the taxlabels command to make handling of duplicate taxon names easier.i """ pass | def _taxlabels(self,options): """Get taxon labels.""" self.taxlabels=[] opts=CharBuffer(options) while True: taxon=quotestrip(opts.next_word()) if not taxon: break self.taxlabels.append(taxon) | 09503d19fb7097018edce666588847fe56dc3231 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7167/09503d19fb7097018edce666588847fe56dc3231/Nexus.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8066,
5336,
12,
2890,
16,
2116,
4672,
3536,
967,
25458,
3249,
12123,
365,
18,
8066,
5336,
33,
8526,
1500,
33,
2156,
1892,
12,
2116,
13,
1323,
1053,
30,
25458,
33,
18653,
25125,
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,
8066,
5336,
12,
2890,
16,
2116,
4672,
3536,
967,
25458,
3249,
12123,
365,
18,
8066,
5336,
33,
8526,
1500,
33,
2156,
1892,
12,
2116,
13,
1323,
1053,
30,
25458,
33,
18653,
25125,
12,
... |
subprocess.Popen('hg parents --template {date|date}'.split(), stdout=out).wait() | cmd = '%s parents --template {date|date}' % (hgloc) cmd = cmd.split() print cmd subprocess.Popen(cmd, stdout=out).wait() | def build(file, work): print "Building..." if ( need_to_update(file, work) ): print " Writing tempfile:", work make_directory_for_output(work) temp = open(work, "wb") temp.write(get_hg_id()) temp.flush() temp.close() print " Writing output file:", file make_directory_for_output(file) out = open(file, "wb") out.write("const wchar_t *HGVersion = L\"") out.flush() out.write(get_hg_id()) out.flush() out.write("\";\nconst wchar_t *HGDate = L\"") out.flush() subprocess.Popen('hg parents --template {date|date}'.split(), stdout=out).wait() out.flush() out.write('";\n') out.close() print " Done" else: print " Up to date" | 28fabf177fb94b1161310db40dd45aa975737292 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6977/28fabf177fb94b1161310db40dd45aa975737292/version.cpp.maker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
12,
768,
16,
1440,
4672,
1172,
315,
16713,
7070,
309,
261,
1608,
67,
869,
67,
2725,
12,
768,
16,
1440,
13,
262,
30,
1172,
315,
10423,
310,
13275,
2773,
16,
1440,
1221,
67,
5149,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
768,
16,
1440,
4672,
1172,
315,
16713,
7070,
309,
261,
1608,
67,
869,
67,
2725,
12,
768,
16,
1440,
13,
262,
30,
1172,
315,
10423,
310,
13275,
2773,
16,
1440,
1221,
67,
5149,
... |
def close_data(self): | def close_data(self): | def close_data(self): | f1d302d15f45741d8b0d5e81b4b0e5a61c6fa580 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/f1d302d15f45741d8b0d5e81b4b0e5a61c6fa580/binhex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
67,
892,
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,
1746,
67,
892,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
return 1 | return 1 | def is_acquired(ob, hasattr=hasattr, aq_base=aq_base, absattr=absattr): # Return true if this object is not a direct # subobject of its aq_parent object. if not hasattr(ob, 'aq_parent'): return 0 parent = aq_base(ob.aq_parent) absId = absattr(ob.id) if hasattr(parent,'_objects'): if absId+' ' in parent.objectIds(): return 0 if hasattr(parent, absId): return 0 if hasattr(aq_base(ob), 'isTopLevelPrincipiaApplicationObject') and \ ob.isTopLevelPrincipiaApplicationObject: return 0 return 1 | caffc57c633e1357305c97c70b16eab181721275 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/caffc57c633e1357305c97c70b16eab181721275/Common.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
1077,
1402,
12,
947,
16,
3859,
33,
5332,
1747,
16,
279,
85,
67,
1969,
33,
69,
85,
67,
1969,
16,
2417,
1747,
33,
5113,
1747,
4672,
468,
2000,
638,
309,
333,
733,
353,
486,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
1077,
1402,
12,
947,
16,
3859,
33,
5332,
1747,
16,
279,
85,
67,
1969,
33,
69,
85,
67,
1969,
16,
2417,
1747,
33,
5113,
1747,
4672,
468,
2000,
638,
309,
333,
733,
353,
486,
... |
print '===========PAGES=============' print self.pages print '=======ACTIVE LAYER==========' print self.active_layer print '=============================' | def load_Completed(self): if not self.layers: self.layers = [Layer(_("Layer 1"))] if self.active_layer is None: for layer in self.layers: if layer.CanSelect(): self.active_layer = layer break add_guide_layer = add_grid_layer = 1 for layer in self.layers: layer.SetDocument(self) if isinstance(layer, GuideLayer): self.guide_layer = layer add_guide_layer = 0 if isinstance(layer, GridLayer): self.snap_grid = layer add_grid_layer = 0 if add_guide_layer: self.layers.append(self.guide_layer) if add_grid_layer: self.layers.append(self.snap_grid) self.extract_pages() self.RearrangeLayers() print '===========PAGES=============' print self.pages print '=======ACTIVE LAYER==========' print self.active_layer print '=============================' | f3b38dcaa225be26b84c603a5004f9f430d24dad /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3123/f3b38dcaa225be26b84c603a5004f9f430d24dad/document.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
9556,
12,
2890,
4672,
309,
486,
365,
18,
10396,
30,
365,
18,
10396,
273,
306,
4576,
24899,
2932,
4576,
404,
6,
3719,
65,
309,
365,
18,
3535,
67,
6363,
353,
599,
30,
364,
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,
1262,
67,
9556,
12,
2890,
4672,
309,
486,
365,
18,
10396,
30,
365,
18,
10396,
273,
306,
4576,
24899,
2932,
4576,
404,
6,
3719,
65,
309,
365,
18,
3535,
67,
6363,
353,
599,
30,
364,
30... | |
newdrs = self.presupp_drs.replace(self.presupp_variable, self.antecedent_ref, True) | newdrs = self.presupp_drs.replace(self.presupp_variable, self.antecedent_cond.argument, True) | def __call__(self, drs): """Put all conditions from the presupposition DRS (if presupposition condition is a proper name: except the proper name itself) into the drs, and replace the presupposition condition referent in them with antecedent_ref""" #print "BINDING, drs", drs newdrs = self.presupp_drs.replace(self.presupp_variable, self.antecedent_ref, True) # There will be referents and conditions to move # if there is a relative clause modifying the noun that has triggered the presuppositon drs.refs.extend([ref for ref in newdrs.refs \ if ref != self.antecedent_ref.variable]) conds_to_move = [cond for cond in newdrs.conds \ if not is_unary_predicate(cond) or cond.function.variable.name != self.presupp_funcname] # TODO: in these condiitons, variables must be replaced, too. Or is it already done by InnerReplace? # Put the conditions at the position of the original presupposition DRS if self.condition_index is None: # it is an index, it can be zero drs.conds.extend(conds_to_move) else: drs.conds = drs.conds[:self.condition_index+1]+conds_to_move+drs.conds[self.condition_index+1:] return drs | e0d42a5635f01a40f30bb776fbf09ab5ee84e327 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2768/e0d42a5635f01a40f30bb776fbf09ab5ee84e327/temporaldrt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
5081,
87,
4672,
3536,
6426,
777,
4636,
628,
326,
4075,
416,
3276,
463,
13225,
261,
430,
4075,
416,
3276,
2269,
353,
279,
5338,
508,
30,
1335,
326,
5338,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1991,
972,
12,
2890,
16,
5081,
87,
4672,
3536,
6426,
777,
4636,
628,
326,
4075,
416,
3276,
463,
13225,
261,
430,
4075,
416,
3276,
2269,
353,
279,
5338,
508,
30,
1335,
326,
5338,
... |
return new_price | return new_price | def _compute_price(self, cursor, user, from_uom, price, to_uom=False): """ Convert price for given uom's. from_uom and to_uom should be browse records. """ if not from_uom or not price or not to_uom: return price if from_uom.category.id <> to_uom.category.id: return price if from_uom.factor_data: new_price = float(price) / from_uom.factor_data else: new_price = float(price) * from_uom.factor | 1c3eb8968b62e8d0dd32434c2ed5ad19c170cb2e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9285/1c3eb8968b62e8d0dd32434c2ed5ad19c170cb2e/uom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9200,
67,
8694,
12,
2890,
16,
3347,
16,
729,
16,
628,
67,
89,
362,
16,
6205,
16,
358,
67,
89,
362,
33,
8381,
4672,
3536,
4037,
6205,
364,
864,
582,
362,
1807,
18,
628,
67,
89,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9200,
67,
8694,
12,
2890,
16,
3347,
16,
729,
16,
628,
67,
89,
362,
16,
6205,
16,
358,
67,
89,
362,
33,
8381,
4672,
3536,
4037,
6205,
364,
864,
582,
362,
1807,
18,
628,
67,
89,... |
print "SpamBayes: Watching for new messages in folder", name | print "SpamBayes: Watching (for %s) in '%s'" % (what, name) | def _HookFolderEvents(self, folder_ids, include_sub, HandlerClass): new_hooks = {} for msgstore_folder in self.manager.message_store.GetFolderGenerator( folder_ids, include_sub): existing = self.folder_hooks.get(msgstore_folder.id) if existing is None or existing.__class__ != HandlerClass: name = msgstore_folder.GetFQName() try: folder = msgstore_folder.GetOutlookItem() except self.manager.message_store.MsgStoreException, details: # Exceptions here are most likely when the folder is valid # and available to MAPI, but not via the Outlook. # One good way to provoke this is to configure Outlook's # profile so default delivery is set to "None". Then, # when you start Outlook, it immediately displays an # error and terminates. During this process, the addin # is initialized, attempts to get the folders, and fails. print "FAILED to open the Outlook folder '%s' " \ "to hook events" % name print details continue # Ensure the field is created before we hook the folder # events, else there is a chance our event handler will # see the temporary message we create. try: self.manager.EnsureOutlookFieldsForFolder(msgstore_folder.GetID()) except: # An exception checking that Outlook's folder has a # 'spam' field is not fatal, nor really even worth # telling the user about, nor even worth a traceback # (as it is likely a COM error). print "ERROR: Failed to check folder '%s' for " \ "Spam field" % name etype, value, tb = sys.exc_info() tb = None # dont want it, and nuke circular ref traceback.print_exception(etype, value, tb) # now setup the hook. try: new_hook = DispatchWithEvents(folder.Items, HandlerClass) except ValueError: print "WARNING: Folder '%s' can not hook events" % (name,) new_hook = None if new_hook is not None: new_hook.Init(msgstore_folder, self.application, self.manager) new_hooks[msgstore_folder.id] = new_hook print "SpamBayes: Watching for new messages in folder", name else: new_hooks[msgstore_folder.id] = existing existing.ReInit() return new_hooks | 54e586400b93724e781110ac3a96d9911643ea6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9857/54e586400b93724e781110ac3a96d9911643ea6f/addin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5394,
3899,
3783,
12,
2890,
16,
3009,
67,
2232,
16,
2341,
67,
1717,
16,
4663,
797,
4672,
394,
67,
10468,
273,
2618,
364,
1234,
2233,
67,
5609,
316,
365,
18,
4181,
18,
2150,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5394,
3899,
3783,
12,
2890,
16,
3009,
67,
2232,
16,
2341,
67,
1717,
16,
4663,
797,
4672,
394,
67,
10468,
273,
2618,
364,
1234,
2233,
67,
5609,
316,
365,
18,
4181,
18,
2150,
67,
... |
if context.get('action_id', False): picking = picking_obj.browse(cr, uid, [context['action_id']])[0] | if context.get('active_id', False): picking = picking_obj.browse(cr, uid, [context['active_id']])[0] | def _get_picking_address(self, cr, uid, context=None): picking_obj = self.pool.get('stock.picking') if context is None: context = {} if context.get('action_id', False): picking = picking_obj.browse(cr, uid, [context['action_id']])[0] return picking.address_id and picking.address_id.id or False return False | a22787cadf9fdef396f44178ea5b249acbdced9c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a22787cadf9fdef396f44178ea5b249acbdced9c/stock.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
11503,
310,
67,
2867,
12,
2890,
16,
4422,
16,
4555,
16,
819,
33,
7036,
4672,
6002,
310,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
15381,
18,
11503,
310,
6134,
309,
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,
389,
588,
67,
11503,
310,
67,
2867,
12,
2890,
16,
4422,
16,
4555,
16,
819,
33,
7036,
4672,
6002,
310,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
15381,
18,
11503,
310,
6134,
309,
8... |
self.assertAlmostEqual(cmath.pi, pi_expected, 9, "cmath.pi is %s; should be %s" % (cmath.pi, pi_expected)) self.assertAlmostEqual(cmath.e, e_expected, 9, "cmath.e is %s; should be %s" % (cmath.e, e_expected)) | self.assertAlmostEqual(cmath.pi, pi_expected, places=9, msg="cmath.pi is %s; should be %s" % (cmath.pi, pi_expected)) self.assertAlmostEqual(cmath.e, e_expected, places=9, msg="cmath.e is %s; should be %s" % (cmath.e, e_expected)) | def test_constants(self): e_expected = 2.71828182845904523536 pi_expected = 3.14159265358979323846 self.assertAlmostEqual(cmath.pi, pi_expected, 9, "cmath.pi is %s; should be %s" % (cmath.pi, pi_expected)) self.assertAlmostEqual(cmath.e, e_expected, 9, "cmath.e is %s; should be %s" % (cmath.e, e_expected)) | 29306fe1dcc8ce448637486d570e6a1b2f7c9ac2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3187/29306fe1dcc8ce448637486d570e6a1b2f7c9ac2/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... |
output = p.stdout.readline() if output is not None and output != "" : self.log.write(output) self.log.flush() | if self.intercept_output : output = p.stdout.readline() if output is not None and output != "" : self.log.write(output) self.log.flush() | def run (self) : p = subprocess.Popen(args=[self.command], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) while True : if p.poll() is not None : break output = p.stdout.readline() if output is not None and output != "" : self.log.write(output) self.log.flush() self._alive = False | 7fa4f9c53b20fc1fc9f0a2b2509c49a9f9056261 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/696/7fa4f9c53b20fc1fc9f0a2b2509c49a9f9056261/xmlrpc_utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
261,
2890,
13,
294,
293,
273,
6652,
18,
52,
3190,
12,
1968,
22850,
2890,
18,
3076,
6487,
3909,
33,
1717,
2567,
18,
27602,
16,
4514,
33,
1717,
2567,
18,
27602,
16,
5972,
33,
5510,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
261,
2890,
13,
294,
293,
273,
6652,
18,
52,
3190,
12,
1968,
22850,
2890,
18,
3076,
6487,
3909,
33,
1717,
2567,
18,
27602,
16,
4514,
33,
1717,
2567,
18,
27602,
16,
5972,
33,
5510,... |
def __getitem(self, name): | def __getitem__(self, name): | def __getitem(self, name): raise SyntaxError | 8e87afb329f04d5381e5a8f3c2f7cd48b954e26f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/8e87afb329f04d5381e5a8f3c2f7cd48b954e26f/test_operator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
508,
4672,
1002,
18453,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
508,
4672,
1002,
18453,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
self.slider.Enable(state) | if self.slider.IsEnabled() != state: self.slider.Enable(state) | def showEnable(self): state = self.isEnabled() self.slider.Enable(state) | 7bd16236b92beb431ca02effaa58fbc7fa4cbb00 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11522/7bd16236b92beb431ca02effaa58fbc7fa4cbb00/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
8317,
12,
2890,
4672,
919,
273,
365,
18,
291,
1526,
1435,
309,
365,
18,
28372,
18,
2520,
1526,
1435,
480,
919,
30,
365,
18,
28372,
18,
8317,
12,
2019,
13,
225,
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,
2405,
8317,
12,
2890,
4672,
919,
273,
365,
18,
291,
1526,
1435,
309,
365,
18,
28372,
18,
2520,
1526,
1435,
480,
919,
30,
365,
18,
28372,
18,
8317,
12,
2019,
13,
225,
2,
-100,
-100,
-... |
raise TypeError, "Rebinning axis 2 must be a NessiList!" | raise TypeError("Rebinning axis 2 must be a NessiList!") | def rebin_axis_2D(obj,axis1_out,axis2_out): """ This function rebins two primary axes for a SOM or a SO based on the given NessiList axis1 and axis2. Parameters: ---------- -> obj is the SOM or SO to be rebinned -> axis1_out is a NessiList containing the 1st axis to rebin the SOM or SO to -> axis2_out is a NessiList containing the 2nd axis to rebin the SOM or SO to Returns: ------- <- A SOM or SO that has been rebinned according to the provided axis Exceptions: ---------- <- TypeError is raised if the rebinning axis given is not a NessiList <- TypeError is raised if object being rebinned is not a SOM or a SO """ # import the helper functions import hlr_utils # set up for working through data try: axis1_out.__type__ except AttributeError: raise TypeError, "Rebinning axis 1 must be a NessiList!" try: axis2_out.__type__ except AttributeError: raise TypeError, "Rebinning axis 2 must be a NessiList!" (o_descr,d_descr)=hlr_utils.get_descr(obj) if o_descr == "number" or o_descr == "list": raise TypeError, "Do not know how to handle given type %s" %\ o_descr else: pass (result,res_descr)=hlr_utils.empty_result(obj) result=hlr_utils.copy_som_attr(result,res_descr,obj,o_descr) # iterate through the values import axis_manip for i in range(hlr_utils.get_length(obj)): axis1_in = hlr_utils.get_value(obj,i,o_descr,"x",0) axis2_in = hlr_utils.get_value(obj,i,o_descr,"x",1) val = hlr_utils.get_value(obj,i,o_descr) err2 = hlr_utils.get_err2(obj,i,o_descr) value=axis_manip.rebin_axis_2D(axis1_in, axis2_in, val, err2, axis1_out, axis2_out) xvals=[] xvals.append(axis1_out) xvals.append(axis2_out) map_so = hlr_utils.get_map_so(obj,None,i) hlr_utils.result_insert(result,res_descr,value,map_so,"all",0,xvals) return result | 2b591660dbdfac3a152b52f87f0a3b8c577328f0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/763/2b591660dbdfac3a152b52f87f0a3b8c577328f0/hlr_rebin_axis_2D.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
283,
4757,
67,
4890,
67,
22,
40,
12,
2603,
16,
4890,
21,
67,
659,
16,
4890,
22,
67,
659,
4672,
3536,
1220,
445,
283,
11862,
2795,
3354,
6515,
364,
279,
348,
1872,
578,
279,
7460,
251... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
283,
4757,
67,
4890,
67,
22,
40,
12,
2603,
16,
4890,
21,
67,
659,
16,
4890,
22,
67,
659,
4672,
3536,
1220,
445,
283,
11862,
2795,
3354,
6515,
364,
279,
348,
1872,
578,
279,
7460,
251... |
content.append(Choice()) | content.append(Choice(self)) | def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) content = [] | 0f22280071ba54237b2f9c645f8fa9542d57d244 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14538/0f22280071ba54237b2f9c645f8fa9542d57d244/XMLSchema.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
628,
8832,
12,
2890,
16,
756,
4672,
365,
18,
542,
2498,
12,
2159,
13,
2939,
273,
365,
18,
588,
6323,
12,
2159,
13,
913,
273,
5378,
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,
628,
8832,
12,
2890,
16,
756,
4672,
365,
18,
542,
2498,
12,
2159,
13,
2939,
273,
365,
18,
588,
6323,
12,
2159,
13,
913,
273,
5378,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
look.i = next.i + krawli | look.i = goto.i + krawli | def movebaddy(enemy): "Tactical movement for the bad guys." next = coord(); look = coord() irun = False # This should probably be just (game.quadrant in game.state.kcmdr) + (game.state.kscmdr==game.quadrant) if game.skill >= SKILL_EXPERT: nbaddys = (((game.quadrant in game.state.kcmdr)*2 + (game.state.kscmdr==game.quadrant)*2+game.klhere*1.23+game.irhere*1.5)/2.0) else: nbaddys = (game.quadrant in game.state.kcmdr) + (game.state.kscmdr==game.quadrant) dist1 = enemy.kdist mdist = int(dist1 + 0.5); # Nearest integer distance # If SC, check with spy to see if should hi-tail it if enemy.type=='S' and \ (enemy.power <= 500.0 or (game.condition=="docked" and not damaged(DPHOTON))): irun = True motion = -QUADSIZE else: # decide whether to advance, retreat, or hold position forces = enemy.power+100.0*len(game.enemies)+400*(nbaddys-1) if not game.shldup: forces += 1000; # Good for enemy if shield is down! if not damaged(DPHASER) or not damaged(DPHOTON): if damaged(DPHASER): # phasers damaged forces += 300.0 else: forces -= 0.2*(game.energy - 2500.0) if damaged(DPHOTON): # photon torpedoes damaged forces += 300.0 else: forces -= 50.0*game.torps else: # phasers and photon tubes both out! forces += 1000.0 motion = 0 if forces <= 1000.0 and game.condition != "docked": # Typical situation motion = ((forces + randreal(200))/150.0) - 5.0 else: if forces > 1000.0: # Very strong -- move in for kill motion = (1.0 - randreal())**2 * dist1 + 1.0 if game.condition=="docked" and (game.options & OPTION_BASE): # protected by base -- back off ! motion -= game.skill*(2.0-randreal()**2) if idebug: proutn("=== MOTION = %d, FORCES = %1.2f, " % (motion, forces)) # don't move if no motion if motion==0: return # Limit motion according to skill if abs(motion) > game.skill: if motion < 0: motion = -game.skill else: motion = game.skill # calculate preferred number of steps nsteps = abs(int(motion)) if motion > 0 and nsteps > mdist: nsteps = mdist; # don't overshoot if nsteps > QUADSIZE: nsteps = QUADSIZE; # This shouldn't be necessary if nsteps < 1: nsteps = 1; # This shouldn't be necessary if idebug: proutn("NSTEPS = %d:" % nsteps) # Compute preferred values of delta X and Y m = game.sector - enemy.location if 2.0 * abs(m.i) < abs(m.j): m.i = 0 if 2.0 * abs(m.j) < abs(game.sector.i-enemy.location.i): m.j = 0 m = (motion * m).sgn() next = enemy.location # main move loop for ll in range(nsteps): if idebug: proutn(" %d" % (ll+1)) # Check if preferred position available look = next + m if m.i < 0: krawli = 1 else: krawli = -1 if m.j < 0: krawlj = 1 else: krawlj = -1 success = False attempts = 0; # Settle mysterious hang problem while attempts < 20 and not success: attempts += 1 if look.i < 0 or look.i >= QUADSIZE: if motion < 0 and tryexit(enemy, look, irun): return if krawli == m.i or m.j == 0: break look.i = next.i + krawli krawli = -krawli elif look.j < 0 or look.j >= QUADSIZE: if motion < 0 and tryexit(enemy, look, irun): return if krawlj == m.j or m.i == 0: break look.j = next.j + krawlj krawlj = -krawlj elif (game.options & OPTION_RAMMING) and game.quad[look.i][look.j] != '.': # See if enemy should ram ship if game.quad[look.i][look.j] == game.ship and \ (enemy.type == 'C' or enemy.type == 'S'): collision(rammed=True, enemy=enemy) return if krawli != m.i and m.j != 0: look.i = next.i + krawli krawli = -krawli elif krawlj != m.j and m.i != 0: look.j = next.j + krawlj krawlj = -krawlj else: break; # we have failed else: success = True if success: next = look if idebug: proutn(`next`) else: break; # done early if idebug: skip(1) if enemy.move(next): if not damaged(DSRSENS) or game.condition == "docked": proutn(_("*** %s from Sector %s") % (cramen(enemy.type), enemy.location)) if enemy.kdist < dist1: proutn(_(" advances to ")) else: proutn(_(" retreats to ")) prout("Sector %s." % next) | eafdd35f1af1e4e93d3609a0adbe768b562907e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3176/eafdd35f1af1e4e93d3609a0adbe768b562907e0/sst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3635,
70,
31934,
12,
275,
351,
93,
4672,
315,
56,
621,
1706,
26017,
364,
326,
5570,
3058,
1900,
1199,
1024,
273,
2745,
5621,
2324,
273,
2745,
1435,
277,
2681,
273,
1083,
468,
1220,
1410,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3635,
70,
31934,
12,
275,
351,
93,
4672,
315,
56,
621,
1706,
26017,
364,
326,
5570,
3058,
1900,
1199,
1024,
273,
2745,
5621,
2324,
273,
2745,
1435,
277,
2681,
273,
1083,
468,
1220,
1410,... |
for i in xrange(uni_len, len(token)): if token[i] == " ": continue elif self.__uc_char > 0: self.__uc_char -= 1 else: return uni_char + token[i:] | return uni_char + self.__remove_uc_chars(uni_len, token) | def __unicode_process(self, token): #change scope in if token == '\{': self.__uc_value.append(self.__uc_value[-1]) #basic error handling self.__reini_utf8_counters() return token #change scope out: evaluate dict and rebuild elif token == '\}': #self.__uc_value.pop() self.__reini_utf8_counters() return token #add a uc control elif token[:3] == '\uc': self.__uc_value[-1] = int(token[3:]) self.__reini_utf8_counters() return token #handle uc skippable char elif self.__uc_char: #if token[:1] == "\" and token[:1] == "\" pass #go for real \u token match_obj = self.__utf_exp.match(token) if match_obj is not None: #get value and handle negative case uni_char = int(match_obj.group(1)) uni_len = len(match_obj.group(1)) + 2 if uni_char < 0: uni_char += 65536 uni_char = unichr(uni_char).encode('ascii', 'xmlcharrefreplace') #if not uc0 if self.__uc_value[-1]: self.__uc_char = self.__uc_value[-1] #there is only an unicode char if len(token)<= uni_len: return uni_char #an unicode char and something else #must be after as it is splited on \ elif not self.__uc_value[-1]: print('not only token uc0 token: ' + uni_char + token[uni_len:]) return uni_char + token[uni_len:] #if not uc0 and chars else: for i in xrange(uni_len, len(token)): if token[i] == " ": continue elif self.__uc_char > 0: self.__uc_char -= 1 else: return uni_char + token[i:] #print('uc: ' + str(self.__uc_value) + 'uni: ' + str(uni_char) + 'token: ' + token) #default return token | 7c70914ad30fc358bfcd7c099494b0a43682ba27 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/7c70914ad30fc358bfcd7c099494b0a43682ba27/tokenize.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9124,
67,
2567,
12,
2890,
16,
1147,
4672,
468,
3427,
2146,
316,
309,
1147,
422,
2337,
95,
4278,
365,
16186,
5286,
67,
1132,
18,
6923,
12,
2890,
16186,
5286,
67,
1132,
18919,
21,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9124,
67,
2567,
12,
2890,
16,
1147,
4672,
468,
3427,
2146,
316,
309,
1147,
422,
2337,
95,
4278,
365,
16186,
5286,
67,
1132,
18,
6923,
12,
2890,
16186,
5286,
67,
1132,
18919,
21,
... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_modifyaccountstatus(req, userID, email_user_pattern, limit_to, maxpage, page, callback='yes', confirm=0): """set a disabled account to enabled and opposite""" (auth_code, auth_message) = is_adminuser(req) if auth_code != 0: return mustloginpage(req, auth_message) res = run_sql("SELECT id, email, note, password FROM user WHERE id=%s" % userID) output = "" if res: if res[0][2] in [0, "0", None]: res2 = run_sql("UPDATE user SET note=1 WHERE id=%s" % userID) output += """<b><span class="info">The account '%s' has been activated.</span></b>""" % res[0][1] if CFG_ACCESS_CONTROL_NOTIFY_USER_ABOUT_ACTIVATION == 1: emailsent = sendAccountActivatedMessage(res[0][1], res[0][1], res[0][3]) if emailsent: output += """<br><b><span class="info">An email has been sent to the owner of the account.</span></b>""" else: output += """<br><b><span class="info">Could not send an email to the owner of the account.</span></b>""" elif res[0][2] in [1, "1"]: res2 = run_sql("UPDATE user SET note=0 WHERE id=%s" % userID) output += """<b><span class="info">The account '%s' has been set inactive.</span></b>""" % res[0][1] else: output += '<b><span class="info">The account id given does not exist.</span></b>' try: body = [output, extra] except NameError: body = [output] if callback: return perform_modifyaccounts(req, email_user_pattern, limit_to, maxpage, page, content=output, callback='yes') else: return addadminbox(subtitle, body) | 8e6aa1042563d2e1f44b1ffbe6e50d6cd67dbacc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1931/8e6aa1042563d2e1f44b1ffbe6e50d6cd67dbacc/webaccessadmin_lib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
17042,
4631,
2327,
12,
3658,
16,
16299,
16,
2699,
67,
1355,
67,
4951,
16,
1800,
67,
869,
16,
943,
2433,
16,
1363,
16,
1348,
2218,
9707,
2187,
6932,
33,
20,
4672,
3536,
542,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
17042,
4631,
2327,
12,
3658,
16,
16299,
16,
2699,
67,
1355,
67,
4951,
16,
1800,
67,
869,
16,
943,
2433,
16,
1363,
16,
1348,
2218,
9707,
2187,
6932,
33,
20,
4672,
3536,
542,
... |
self.pick_initial_filename(suffix="", torrent=True) | try: self.pick_initial_filename(suffix="", torrent=True) except (OSError, IOError): raise RuntimeError | def got_metainfo(self): # FIXME: If the client is stopped before a BT download gets # its metadata, we never run this. It's not a huge deal # because it only affects the incomplete filename if not self.restarting: try: metainfo = lt.bdecode(self.metainfo) # if we don't get valid torrent metadata back, then the # metainfo is None. treat that like a runtime error. if not metainfo: raise RuntimeError() name = metainfo['info']['name'] except RuntimeError: self.handle_corrupt_torrent() return self.shortFilename = utf8_to_filename(name) self.pick_initial_filename(suffix="", torrent=True) self.update_client() self._resume_torrent() | fca7189bda6a17bc7b00cada10c6179aeb649663 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12354/fca7189bda6a17bc7b00cada10c6179aeb649663/download.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2363,
67,
10578,
28935,
12,
2890,
4672,
468,
9852,
30,
971,
326,
1004,
353,
9627,
1865,
279,
605,
56,
4224,
5571,
468,
3639,
2097,
1982,
16,
732,
5903,
1086,
333,
18,
2597,
1807,
486,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2363,
67,
10578,
28935,
12,
2890,
4672,
468,
9852,
30,
971,
326,
1004,
353,
9627,
1865,
279,
605,
56,
4224,
5571,
468,
3639,
2097,
1982,
16,
732,
5903,
1086,
333,
18,
2597,
1807,
486,
... |
return False | def _flowable(self, node): if node.localName=='para': style = self.styles.para_style_get(node) return platypus.Paragraph(self._textual(node), style, **(utils.attr_get(node, [], {'bulletText':'str'}))) elif node.localName=='barCode': try: from reportlab.graphics.barcode import code128 from reportlab.graphics.barcode import code39 from reportlab.graphics.barcode import code93 from reportlab.graphics.barcode import common from reportlab.graphics.barcode import fourstate from reportlab.graphics.barcode import usps except Exception, e: print 'Warning: Reportlab barcode extension not installed !' return None args = utils.attr_get(node, [], {'ratio':'float','xdim':'unit','height':'unit','checksum':'bool','quiet':'bool'}) codes = { 'codabar': lambda x: common.Codabar(x, **args), 'code11': lambda x: common.Code11(x, **args), 'code128': lambda x: code128.Code128(x, **args), 'standard39': lambda x: code39.Standard39(x, **args), 'standard93': lambda x: code93.Standard93(x, **args), 'i2of5': lambda x: common.I2of5(x, **args), 'extended39': lambda x: code39.Extended39(x, **args), 'extended93': lambda x: code93.Extended93(x, **args), 'msi': lambda x: common.MSI(x, **args), 'fim': lambda x: usps.FIM(x, **args), 'postnet': lambda x: usps.POSTNET(x, **args), } code = 'code128' if node.hasAttribute('code'): code = node.getAttribute('code').lower() return codes[code](self._textual(node)) elif node.localName=='name': self.styles.names[ node.getAttribute('id')] = node.getAttribute('value') return None elif node.localName=='xpre': style = self.styles.para_style_get(node) return platypus.XPreformatted(self._textual(node), style, **(utils.attr_get(node, [], {'bulletText':'str','dedent':'int','frags':'int'}))) elif node.localName=='pre': style = self.styles.para_style_get(node) return platypus.Preformatted(self._textual(node), style, **(utils.attr_get(node, [], {'bulletText':'str','dedent':'int'}))) elif node.localName=='illustration': return self._illustration(node) elif node.localName=='blockTable': return self._table(node) elif node.localName=='title': styles = reportlab.lib.styles.getSampleStyleSheet() style = styles['Title'] return platypus.Paragraph(self._textual(node), style, **(utils.attr_get(node, [], {'bulletText':'str'}))) elif node.localName=='h1': styles = reportlab.lib.styles.getSampleStyleSheet() style = styles['Heading1'] return platypus.Paragraph(self._textual(node), style, **(utils.attr_get(node, [], {'bulletText':'str'}))) elif node.localName=='h2': styles = reportlab.lib.styles.getSampleStyleSheet() style = styles['Heading2'] return platypus.Paragraph(self._textual(node), style, **(utils.attr_get(node, [], {'bulletText':'str'}))) elif node.localName=='h3': styles = reportlab.lib.styles.getSampleStyleSheet() style = styles['Heading3'] return platypus.Paragraph(self._textual(node), style, **(utils.attr_get(node, [], {'bulletText':'str'}))) elif node.localName=='image': if not node.hasAttribute('file'): if node.hasAttribute('name'): image_data = self.doc.images[node.getAttribute('name')].read() else: import base64 image_data = base64.decodestring(node.firstChild.nodeValue) image = StringIO.StringIO(image_data) return platypus.Image(image, mask=(250,255,250,255,250,255), **(utils.attr_get(node, ['width','height']))) else: return platypus.Image(node.getAttribute('file'), mask=(250,255,250,255,250,255), **(utils.attr_get(node, ['width','height']))) | e809ecd3d58900ecd3010b0a6efd77ec67e70de0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7397/e809ecd3d58900ecd3010b0a6efd77ec67e70de0/trml2pdf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2426,
429,
12,
2890,
16,
756,
4672,
309,
756,
18,
3729,
461,
18920,
25072,
4278,
2154,
273,
365,
18,
10218,
18,
25072,
67,
4060,
67,
588,
12,
2159,
13,
327,
29838,
879,
407,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2426,
429,
12,
2890,
16,
756,
4672,
309,
756,
18,
3729,
461,
18920,
25072,
4278,
2154,
273,
365,
18,
10218,
18,
25072,
67,
4060,
67,
588,
12,
2159,
13,
327,
29838,
879,
407,
18,
... | |
'There is no Python module or object named "%s".' % path) | 'No Python documentation found for %s.' % repr(path)) | def do_GET(self): path = self.path if path[-5:] == '.html': path = path[:-5] if path[:1] == '/': path = path[1:] if path and path != '.': try: p, x = locate(path) except DocImportError, value: self.send_document(path, html.escape( 'problem with %s - %s' % (value.filename, value.args))) return if x: self.send_document(describe(x), html.document(x)) else: self.send_document(path, | c59006cf0425a2636c8284ef2601f7f489fad815 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/c59006cf0425a2636c8284ef2601f7f489fad815/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
3264,
12,
2890,
4672,
589,
273,
365,
18,
803,
309,
589,
18919,
25,
26894,
422,
2418,
2620,
4278,
589,
273,
589,
10531,
17,
25,
65,
309,
589,
10531,
21,
65,
422,
2023,
30,
58... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
3264,
12,
2890,
4672,
589,
273,
365,
18,
803,
309,
589,
18919,
25,
26894,
422,
2418,
2620,
4278,
589,
273,
589,
10531,
17,
25,
65,
309,
589,
10531,
21,
65,
422,
2023,
30,
58... |
""" | ''' | def testFile(self): path = os.path.join(tests_path, 'testfiles', 'test.pt') | 1cfc7ddd1cac0110cca3e909215477e1c59bbca3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9523/1cfc7ddd1cac0110cca3e909215477e1c59bbca3/test_directives.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
812,
12,
2890,
4672,
589,
273,
1140,
18,
803,
18,
5701,
12,
16341,
67,
803,
16,
296,
3813,
2354,
2187,
296,
3813,
18,
337,
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,
1842,
812,
12,
2890,
4672,
589,
273,
1140,
18,
803,
18,
5701,
12,
16341,
67,
803,
16,
296,
3813,
2354,
2187,
296,
3813,
18,
337,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
'anchor': ('AjaxForeignKey', ["orm['datatree.DataTree']"], {}), | 'anchor': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['datatree.DataTree']"}), | def backwards(self, orm): # Deleting model 'StudentClassRegModuleInfo' db.delete_table('modules_studentclassregmoduleinfo') # Deleting model 'RemoteProfile' db.delete_table('modules_remoteprofile') # Deleting model 'ClassRegModuleInfo' db.delete_table('modules_classregmoduleinfo') # Deleting model 'SATPrepTeacherModuleInfo' db.delete_table('modules_satprepteachermoduleinfo') # Deleting model 'ProgramModuleObj' db.delete_table('modules_programmoduleobj') # Deleting model 'CreditCardModuleInfo' db.delete_table('modules_creditcardmoduleinfo') # Deleting model 'SATPrepAdminModuleInfo' db.delete_table('modules_satprepadminmoduleinfo') # Deleting model 'DBReceipt' db.delete_table('modules_dbreceipt') # Dropping ManyToManyField 'RemoteProfile.volunteer_times' db.delete_table('modules_remoteprofile_volunteer_times') # Dropping ManyToManyField 'RemoteProfile.bus_runs' db.delete_table('modules_remoteprofile_bus_runs') | 2ef0cc4f8263d0a1c5513b549ab9d107a9531d54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12041/2ef0cc4f8263d0a1c5513b549ab9d107a9531d54/0001_initial.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12727,
12,
2890,
16,
13969,
4672,
225,
468,
20988,
310,
938,
296,
19943,
319,
797,
1617,
3120,
966,
11,
1319,
18,
3733,
67,
2121,
2668,
6400,
67,
26240,
1106,
1574,
2978,
1376,
6134,
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,
12727,
12,
2890,
16,
13969,
4672,
225,
468,
20988,
310,
938,
296,
19943,
319,
797,
1617,
3120,
966,
11,
1319,
18,
3733,
67,
2121,
2668,
6400,
67,
26240,
1106,
1574,
2978,
1376,
6134,
225... |
result = ll_math_modf(10.1) | result = Implementation.ll_math_modf(10.1) | def test_ll_modf(): result = ll_math_modf(10.1) assert result.item0 == math.modf(10.1)[0] assert result.item1 == math.modf(10.1)[1] | dead949a8590d718166a0efd74e0cb7a9160bcc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/dead949a8590d718166a0efd74e0cb7a9160bcc3/test_ll_math.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2906,
67,
1711,
74,
13332,
563,
273,
25379,
18,
2906,
67,
15949,
67,
1711,
74,
12,
2163,
18,
21,
13,
1815,
563,
18,
1726,
20,
422,
4233,
18,
1711,
74,
12,
2163,
18,
21,
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,
1842,
67,
2906,
67,
1711,
74,
13332,
563,
273,
25379,
18,
2906,
67,
15949,
67,
1711,
74,
12,
2163,
18,
21,
13,
1815,
563,
18,
1726,
20,
422,
4233,
18,
1711,
74,
12,
2163,
18,
21,
2... |
Type to use in computing the standard deviation. For arrays of integer type the default is float32, for arrays of float types it is the same as the array type. | Type to use in computing the standard deviation. For arrays of integer type the default is float32, for arrays of float types it is the same as the array type. | def std(a, axis=None, dtype=None, out=None): """Compute the standard deviation along the specified axis. *Description* Returns the standard deviation of the array elements, a measure of the spread of a distribution. The standard deviation is computed for the flattened array by default, otherwise over the specified axis. *Parameters*: axis : integer Axis along which the standard deviation is computed. The default is to compute the standard deviation of the flattened array. dtype : type Type to use in computing the standard deviation. For arrays of integer type the default is float32, for arrays of float types it is the same as the array type. out : ndarray Alternative output array in which to place the result. It must have the same shape as the expected output but the type will be cast if necessary. *Returns*: standard_deviation : The return type varies, see above. A new array holding the result is returned unless out is specified, in which case a reference to out is returned. *SeeAlso*: var Variance mean Average *Notes* The standard deviation is the square root of the average of the squared deviations from the mean, i.e. var = sqrt(mean((x - x.mean())**2)). The computed standard deviation is biased, i.e., the mean is computed by dividing by the number of elements, N, rather than by N-1. """ try: std = a.std except AttributeError: return _wrapit(a, 'std', axis, dtype, out) return std(axis, dtype, out) | fe2f8b811f8f87475f51396eca9a848d2746ab2b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/14925/fe2f8b811f8f87475f51396eca9a848d2746ab2b/fromnumeric.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2044,
12,
69,
16,
2654,
33,
7036,
16,
3182,
33,
7036,
16,
596,
33,
7036,
4672,
3536,
7018,
326,
4529,
17585,
7563,
326,
1269,
2654,
18,
225,
380,
3291,
14,
225,
2860,
326,
4529,
17585,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2044,
12,
69,
16,
2654,
33,
7036,
16,
3182,
33,
7036,
16,
596,
33,
7036,
4672,
3536,
7018,
326,
4529,
17585,
7563,
326,
1269,
2654,
18,
225,
380,
3291,
14,
225,
2860,
326,
4529,
17585,... |
7/2 1/2 3 4/3 2.82842712475 1 | (7/2) (1/2) 3 (4/3) 2.82842712475 1 | def test(): '''\ Test function for rat module. The expected output is (module some differences in floating precission): -1 -1 0 0L 0.1 (0.1+0j) [Rat(1,2), Rat(-3,10), Rat(1,25), Rat(1,4)] [Rat(-3,10), Rat(1,25), Rat(1,4), Rat(1,2)] 0 11/10 11/10 1.1 OK 2 1.5 3/2 (1.5+1.5j) 15707963/5000000 2 2 2.0 (2+0j) 4 0 4 1 4 0 3.5 0.5 3.0 1.33333333333 2.82842712475 1 7/2 1/2 3 4/3 2.82842712475 1 (3.5+1.5j) (0.5-1.5j) (3+3j) (0.666666666667-0.666666666667j) (1.43248815986+2.43884761145j) 1 1.5 1 1.5 (1.5+0j) 3.5 -0.5 3.0 0.75 2.25 -1 3.0 0.0 2.25 1.0 1.83711730709 0 3.0 0.0 2.25 1.0 1.83711730709 1 (3+1.5j) -1.5j (2.25+2.25j) (0.5-0.5j) (1.50768393746+1.04970907623j) -1 3/2 1 1.5 (1.5+0j) 7/2 -1/2 3 3/4 9/4 -1 3.0 0.0 2.25 1.0 1.83711730709 -1 3 0 9/4 1 1.83711730709 0 (3+1.5j) -1.5j (2.25+2.25j) (0.5-0.5j) (1.50768393746+1.04970907623j) -1 (1.5+1.5j) (1.5+1.5j) (3.5+1.5j) (-0.5+1.5j) (3+3j) (0.75+0.75j) 4.5j -1 (3+1.5j) 1.5j (2.25+2.25j) (1+1j) (1.18235814075+2.85446505899j) 1 (3+1.5j) 1.5j (2.25+2.25j) (1+1j) (1.18235814075+2.85446505899j) 1 (3+3j) 0j 4.5j (1+0j) (-0.638110484918+0.705394566962j) 0 ''' print rat(-1L, 1) print rat(1, -1) a = rat(1, 10) print int(a), long(a), float(a), complex(a) b = rat(2, 5) l = [a+b, a-b, a*b, a/b] print l l.sort() print l print rat(0, 1) print a+1 print a+1L print a+1.0 try: print rat(1, 0) raise SystemError, 'should have been ZeroDivisionError' except ZeroDivisionError: print 'OK' print rat(2), rat(1.5), rat(3, 2), rat(1.5+1.5j), rat(31415926,10000000) list = [2, 1.5, rat(3,2), 1.5+1.5j] for i in list: print i, if type(i) is not ComplexType: print int(i), float(i), print complex(i) print for j in list: print i + j, i - j, i * j, i / j, i ** j, cmp(i, j) | 416d656b413374f6e692437040666218ecb0cce3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/416d656b413374f6e692437040666218ecb0cce3/Rat.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
13332,
875,
8314,
7766,
445,
364,
15183,
1605,
18,
225,
1021,
2665,
876,
353,
261,
2978,
2690,
16440,
316,
13861,
13382,
19710,
4672,
300,
21,
300,
21,
374,
374,
48,
374,
18,
21,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
13332,
875,
8314,
7766,
445,
364,
15183,
1605,
18,
225,
1021,
2665,
876,
353,
261,
2978,
2690,
16440,
316,
13861,
13382,
19710,
4672,
300,
21,
300,
21,
374,
374,
48,
374,
18,
21,
... |
FieldLenField("len", None, length_of="data", fmt="B", adjust=lambda p,x:x+6), | FieldLenField("len", None, length_of="data", fmt="B", adjust=lambda p,x:x+2), | def __new__(cls, name, bases, dct): newcls = super(PPP_IPCP_Specific_Option_metaclass, cls).__new__(cls, name, bases, dct) PPP_IPCP_Option._register(newcls) | affecf331b2e4c074e658f4768b06d56fcab287d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7311/affecf331b2e4c074e658f4768b06d56fcab287d/ppp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2704,
972,
12,
6429,
16,
508,
16,
8337,
16,
18253,
4672,
394,
6429,
273,
2240,
12,
6584,
52,
67,
2579,
4258,
67,
9969,
67,
1895,
67,
3901,
1106,
16,
2028,
2934,
972,
2704,
972,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2704,
972,
12,
6429,
16,
508,
16,
8337,
16,
18253,
4672,
394,
6429,
273,
2240,
12,
6584,
52,
67,
2579,
4258,
67,
9969,
67,
1895,
67,
3901,
1106,
16,
2028,
2934,
972,
2704,
972,
... |
self._prompt_wait = [self._prompt] + [re.compile(x) for x in self._ask] | self._prompt_wait = [self._prompt] + [re.compile(x) for x in self._ask] + \ ['Break [0-9]+'] | def __init__(self, script_subdirectory=None, logfile=None, server=None): """ Create an instance of the Maxima interpreter. """ # TODO: Input and output prompts in maxima can be changed by # setting inchar and outchar.. eval_using_file_cutoff = 256 self.__eval_using_file_cutoff = eval_using_file_cutoff STARTUP = '%s/local/bin/sage-maxima.lisp'%SAGE_ROOT if not os.path.exists(STARTUP): raise RuntimeError, 'You must get the file local/bin/sage-maxima.lisp' Expect.__init__(self, name = 'maxima', prompt = '\(\%i[0-9]+\)', command = 'maxima -p "%s"'%STARTUP, maxread = 10000, script_subdirectory = script_subdirectory, restart_on_ctrlc = False, verbose_start = False, init_code = ['display2d : false', # no ascii art output #'load("mactex-utilities")' # latex instead of plain tex from tex command (broken in maxima-5.11.0!) ], logfile = logfile, eval_using_file_cutoff=eval_using_file_cutoff) self._display_prompt = '<sage-display>' # must match what is in the file local/ibn/sage-maxima.lisp!! self._output_prompt_re = re.compile('\(\%o[0-9]+\)') self._ask = ['zero or nonzero?', 'an integer?', 'positive, negative, or zero?', 'positive or negative?'] self._prompt_wait = [self._prompt] + [re.compile(x) for x in self._ask] self._error_re = re.compile('(debugmode|Incorrect syntax|Maxima encountered a Lisp error)') self._display2d = False | c3fa2ccccfc81d125253bc58f7a5acd36a170369 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/c3fa2ccccfc81d125253bc58f7a5acd36a170369/maxima.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2728,
67,
1717,
5149,
33,
7036,
16,
15204,
33,
7036,
16,
1438,
33,
7036,
4672,
3536,
1788,
392,
791,
434,
326,
4238,
13888,
16048,
18,
3536,
468,
2660,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2728,
67,
1717,
5149,
33,
7036,
16,
15204,
33,
7036,
16,
1438,
33,
7036,
4672,
3536,
1788,
392,
791,
434,
326,
4238,
13888,
16048,
18,
3536,
468,
2660,
3... |
options={ 'otherTable' : self.otherClass.sqlmeta.table, 'otherID' : self.otherClass.sqlmeta.idName, 'interTable' : self.intermediateTable, 'table' : self.soClass.sqlmeta.table, 'ID' : self.soClass.sqlmeta.idName, 'joinCol' : self.joinColumn, 'otherCol' : self.otherColumn, 'idValue' : inst.id, } clause = '''\ %(otherTable)s.%(otherID)s = %(interTable)s.%(otherCol)s and %(interTable)s.%(joinCol)s = %(table)s.%(ID)s and %(table)s.%(ID)s = %(idValue)s''' % options if inst.sqlmeta._perConnection: conn = inst._connection else: conn = None results = self.otherClass.select(sqlbuilder.SQLConstant(clause), clauseTables=( options['table'], options['otherTable'], options['interTable'], | results = self.otherClass.select(sqlbuilder.AND( OtherTableToJoin( self.otherClass.sqlmeta.table, self.otherClass.sqlmeta.idName, self.intermediateTable, self.otherColumn | def performJoin(self, inst): options={ 'otherTable' : self.otherClass.sqlmeta.table, 'otherID' : self.otherClass.sqlmeta.idName, 'interTable' : self.intermediateTable, 'table' : self.soClass.sqlmeta.table, 'ID' : self.soClass.sqlmeta.idName, 'joinCol' : self.joinColumn, 'otherCol' : self.otherColumn, 'idValue' : inst.id, } clause = '''\ | c46bdb4ca9c0ca6688b20cd27a7f2fe80c7f5052 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8798/c46bdb4ca9c0ca6688b20cd27a7f2fe80c7f5052/joins.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
4572,
12,
2890,
16,
1804,
4672,
702,
5899,
296,
3011,
1388,
11,
294,
365,
18,
3011,
797,
18,
4669,
3901,
18,
2121,
16,
296,
3011,
734,
11,
294,
365,
18,
3011,
797,
18,
4669,
39... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
4572,
12,
2890,
16,
1804,
4672,
702,
5899,
296,
3011,
1388,
11,
294,
365,
18,
3011,
797,
18,
4669,
3901,
18,
2121,
16,
296,
3011,
734,
11,
294,
365,
18,
3011,
797,
18,
4669,
39... |
objects[self.objtype, name] = self.env.docname | objects[key] = self.env.docname | def add_target_and_index(self, name, sig, signode): if name not in self.state.document.ids: signode['names'].append(name) signode['ids'].append(name) signode['first'] = (not self.names) self.state.document.note_explicit_target(signode) | 8848faea55e18663fe95d1b3d8e897863f1a11d2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7032/8848faea55e18663fe95d1b3d8e897863f1a11d2/rst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
3299,
67,
464,
67,
1615,
12,
2890,
16,
508,
16,
3553,
16,
1573,
390,
4672,
309,
508,
486,
316,
365,
18,
2019,
18,
5457,
18,
2232,
30,
1573,
390,
3292,
1973,
29489,
6923,
12,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
3299,
67,
464,
67,
1615,
12,
2890,
16,
508,
16,
3553,
16,
1573,
390,
4672,
309,
508,
486,
316,
365,
18,
2019,
18,
5457,
18,
2232,
30,
1573,
390,
3292,
1973,
29489,
6923,
12,... |
def GenerateEventTask(view, days=30): | def GenerateEventTask(view, days=30, tzinfo=None): | def GenerateEventTask(view, days=30): """ Generate one Task/Event stamped item """ event = GenerateCalendarEvent(view, days) event.StampKind('add', pim.TaskMixin.getKind(event.itsView)) return event | 7713aa38e29f26998048109963d046607527df00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/7713aa38e29f26998048109963d046607527df00/GenerateItems.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6654,
1133,
2174,
12,
1945,
16,
4681,
33,
5082,
16,
15732,
33,
7036,
4672,
3536,
6654,
1245,
3837,
19,
1133,
14429,
329,
761,
3536,
871,
273,
6654,
7335,
1133,
12,
1945,
16,
4681,
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,
6654,
1133,
2174,
12,
1945,
16,
4681,
33,
5082,
16,
15732,
33,
7036,
4672,
3536,
6654,
1245,
3837,
19,
1133,
14429,
329,
761,
3536,
871,
273,
6654,
7335,
1133,
12,
1945,
16,
4681,
13,
... |
self.wire_id = Wire.wire_counter Wire.wire_counter += 1 | self.wire_id = -1 self._add_connection(source_node) def _add_connection(self, node): if Wire.connection.has_key(node): wire_id = Wire.connection[node].get_wire_id() print "Node already connected to %d" %wire_id if self.wire_id >= 0: for node in Wire.connection.keys(): if Wire.connection[node].get_wire_id() == wire_id: Wire.connection[node].set_wire_id(self.wire_id) else: self.wire_id = wire_id else: if self.wire_id == -1: self.wire_id = Wire.counter Wire.counter += 1 Wire.connection[node] = self print "WIRE_ID = %d" %self.wire_id def set_wire_id(self, id): self.wire_id = id | def __init__(self, rootitem, source_node, x1, y1, x2, y2): self.rootitem = rootitem self.source_node = source_node self.target_node = None self.x1 = x1 self.y1 = y1 self.x2 = x2 self.y2 = y2 self.wire_item = self.rootitem.add( gnome.canvas.CanvasLine, points=( self.x1, self.y1, self.x2, self.y2), fill_color_rgba = 0xCC1111FFL, width_units=5.0 ) self.wire_item.connect("event", self.delete_wire, self) self.wire_id = Wire.wire_counter Wire.wire_counter += 1 | 50a1c4ff3e153605418587fa08322a3d7ce1b3e1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11306/50a1c4ff3e153605418587fa08322a3d7ce1b3e1/electric.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1365,
1726,
16,
1084,
67,
2159,
16,
619,
21,
16,
677,
21,
16,
619,
22,
16,
677,
22,
4672,
365,
18,
3085,
1726,
273,
1365,
1726,
365,
18,
3168,
67,
21... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1365,
1726,
16,
1084,
67,
2159,
16,
619,
21,
16,
677,
21,
16,
619,
22,
16,
677,
22,
4672,
365,
18,
3085,
1726,
273,
1365,
1726,
365,
18,
3168,
67,
21... |
paths = [ os.path.join(base, p) for p in ['..','libraries'] ] add_paths(paths, to_beginning=True) | add_path(os.path.join(ROBOTDIR, 'libraries'), to_beginning=True) add_path(PARENTDIR, to_beginning=True) if fnmatch.fnmatchcase(os.path.basename(PARENTDIR), 'robotframework-*.egg'): add_path(os.path.dirname(PARENTDIR), to_beginning=True) | def remove_path(path): path = norm_path(path) while path in sys.path: sys.path.remove(path) | a2aaa73355ddc580ac9c1408cfa93d0ac35bc6ee /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7408/a2aaa73355ddc580ac9c1408cfa93d0ac35bc6ee/pythonpathsetter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
67,
803,
12,
803,
4672,
589,
273,
4651,
67,
803,
12,
803,
13,
1323,
589,
316,
2589,
18,
803,
30,
2589,
18,
803,
18,
4479,
12,
803,
13,
282,
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,
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,
1206,
67,
803,
12,
803,
4672,
589,
273,
4651,
67,
803,
12,
803,
13,
1323,
589,
316,
2589,
18,
803,
30,
2589,
18,
803,
18,
4479,
12,
803,
13,
282,
2,
-100,
-100,
-100,
-100,
-100,
-... |
debug(" RFC 2965 cookies are switched off") | _debug(" RFC 2965 cookies are switched off") | def set_ok_version(self, cookie, request): if cookie.version is None: # Version is always set to 0 by parse_ns_headers if it's a Netscape # cookie, so this must be an invalid RFC 2965 cookie. debug(" Set-Cookie2 without version attribute (%s=%s)", cookie.name, cookie.value) return False if cookie.version > 0 and not self.rfc2965: debug(" RFC 2965 cookies are switched off") return False elif cookie.version == 0 and not self.netscape: debug(" Netscape cookies are switched off") return False return True | 15f04d8bbaf4e2b7d0d25228ce9bc84f1e501e81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/15f04d8bbaf4e2b7d0d25228ce9bc84f1e501e81/cookielib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
601,
67,
1589,
12,
2890,
16,
3878,
16,
590,
4672,
309,
3878,
18,
1589,
353,
599,
30,
468,
4049,
353,
3712,
444,
358,
374,
635,
1109,
67,
2387,
67,
2485,
309,
518,
1807,
279,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
601,
67,
1589,
12,
2890,
16,
3878,
16,
590,
4672,
309,
3878,
18,
1589,
353,
599,
30,
468,
4049,
353,
3712,
444,
358,
374,
635,
1109,
67,
2387,
67,
2485,
309,
518,
1807,
279,... |
def callInThread(self, callable, *args, **kwargs): | def callInThread(self, _callable, *args, **kwargs): | def callInThread(self, callable, *args, **kwargs): """See twisted.internet.interfaces.IReactorThreads.callInThread. """ if not self.threadpool: self._initThreadPool() self.threadpool.callInThread(callable, *args, **kwargs) | 2be731a1ed281980caf599001b09591be5493949 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/2be731a1ed281980caf599001b09591be5493949/base.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
745,
382,
3830,
12,
2890,
16,
389,
7293,
16,
380,
1968,
16,
2826,
4333,
4672,
3536,
9704,
2339,
25444,
18,
267,
14726,
18,
15898,
18,
45,
426,
3362,
13233,
18,
1991,
382,
3830,
18,
353... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
745,
382,
3830,
12,
2890,
16,
389,
7293,
16,
380,
1968,
16,
2826,
4333,
4672,
3536,
9704,
2339,
25444,
18,
267,
14726,
18,
15898,
18,
45,
426,
3362,
13233,
18,
1991,
382,
3830,
18,
353... |
file = open(filename) | try: file = open(filename) except IOError: return None | def synopsis(filename, cache={}): """Get the one-line summary out of a module file.""" mtime = os.stat(filename).st_mtime lastupdate, result = cache.get(filename, (0, None)) if lastupdate < mtime: info = inspect.getmoduleinfo(filename) file = open(filename) if info and 'b' in info[2]: # binary modules have to be imported try: module = imp.load_module('__temp__', file, filename, info[1:]) except: return None result = split(module.__doc__ or '', '\n')[0] del sys.modules['__temp__'] else: # text modules can be directly examined line = file.readline() while line[:1] == '#' or not strip(line): line = file.readline() if not line: break line = strip(line) if line[:4] == 'r"""': line = line[1:] if line[:3] == '"""': line = line[3:] if line[-1:] == '\\': line = line[:-1] while not strip(line): line = file.readline() if not line: break result = strip(split(line, '"""')[0]) else: result = None file.close() cache[filename] = (mtime, result) return result | 3cdbbe3e8f2ff5bc293c51458f9eb11ffe046a12 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3cdbbe3e8f2ff5bc293c51458f9eb11ffe046a12/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6194,
29522,
12,
3459,
16,
1247,
12938,
4672,
3536,
967,
326,
1245,
17,
1369,
4916,
596,
434,
279,
1605,
585,
12123,
13158,
273,
1140,
18,
5642,
12,
3459,
2934,
334,
67,
10838,
1142,
272... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6194,
29522,
12,
3459,
16,
1247,
12938,
4672,
3536,
967,
326,
1245,
17,
1369,
4916,
596,
434,
279,
1605,
585,
12123,
13158,
273,
1140,
18,
5642,
12,
3459,
2934,
334,
67,
10838,
1142,
272... |
style = win32con.WS_OVERLAPPED | win32con.WS_SYSMENU self.hwnd = CreateWindow(classAtom, "SpamBayes", style, 0, 0, win32con.CW_USEDEFAULT, win32con.CW_USEDEFAULT, 0, 0, hinst, None) UpdateWindow(self.hwnd) | hinst = GetModuleHandle(None) dialogTemplate = [['SpamBayes', (14, 10, 246, 187), -1865809852 & ~win32con.WS_VISIBLE, None, (8, 'Tahoma')],] self.hwnd = CreateDialogIndirect(hinst, dialogTemplate, 0, message_map) | def __init__(self): # The ordering here is important - it is the order that they will # appear in the menu. As dicts don't have an order, this means # that the order is controlled by the id. Any items were the # function is None will appear as separators. self.control_functions = {1024 : ("Start SpamBayes", self.StartStop), 1025 : ("-", None), 1026 : ("View information ...", self.OpenInterface), 1027 : ("Configure ...", self.OpenConfig), 1028 : ("-", None), 1029 : ("Exit SpamBayes", self.OnExit), } message_map = { win32con.WM_DESTROY: self.OnDestroy, win32con.WM_COMMAND: self.OnCommand, win32con.WM_USER+20 : self.OnTaskbarNotify, } | dee0c4d20c1b073d14b6a18a484058719c5c30ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9857/dee0c4d20c1b073d14b6a18a484058719c5c30ec/pop3proxy_tray.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
468,
1021,
9543,
2674,
353,
10802,
300,
518,
353,
326,
1353,
716,
2898,
903,
468,
9788,
316,
326,
3824,
18,
225,
2970,
15838,
2727,
1404,
1240,
392,
1353... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
468,
1021,
9543,
2674,
353,
10802,
300,
518,
353,
326,
1353,
716,
2898,
903,
468,
9788,
316,
326,
3824,
18,
225,
2970,
15838,
2727,
1404,
1240,
392,
1353... |
self.reportProgress(30) | os.system('svn --set-depth infinity up "%s/trunk/l10n-kde4/%s/docmessages"' % (localsvnroot, langlang)) self.reportProgress(15) os.system('svn --set-depth infinity up "%s/trunk/l10n-kde4/%s"' % (localsvnroot, langlang)) | def validatePage(self): if self.existing.isChecked(): return True if os.system('which svn')!=0: KMessageBox.error(self,i18n("Please install 'subversion' package\nto have Lokalize download KDE translation files."),i18n("Subversion client not found")) return False | 4fff230674ead7cc7c99d83ee717306bc218b272 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1688/4fff230674ead7cc7c99d83ee717306bc218b272/newprojectwizard.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
1964,
12,
2890,
4672,
309,
365,
18,
11711,
18,
291,
11454,
13332,
327,
1053,
309,
1140,
18,
4299,
2668,
12784,
5893,
82,
6134,
5,
33,
20,
30,
1475,
27647,
18,
1636,
12,
2890,
16,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
1964,
12,
2890,
4672,
309,
365,
18,
11711,
18,
291,
11454,
13332,
327,
1053,
309,
1140,
18,
4299,
2668,
12784,
5893,
82,
6134,
5,
33,
20,
30,
1475,
27647,
18,
1636,
12,
2890,
16,... |
def _Clone(self, revision, url, verbose=False): | def _Clone(self, revision, url, options): | def _Clone(self, revision, url, verbose=False): """Clone a git repository from the given URL. | e603c688da503d6a6db9690684aa49a1b2a54706 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6076/e603c688da503d6a6db9690684aa49a1b2a54706/gclient_scm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
10930,
12,
2890,
16,
6350,
16,
880,
16,
702,
4672,
3536,
10930,
279,
5071,
3352,
628,
326,
864,
1976,
18,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
10930,
12,
2890,
16,
6350,
16,
880,
16,
702,
4672,
3536,
10930,
279,
5071,
3352,
628,
326,
864,
1976,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
"cancel": (self.cancel, _("exit network adapter setup menu")), "ok": (self.ok, _("select menu entry")), | "cancel": (self.keyCancel, _("exit network adapter configuration")), "ok": (self.keySave, _("activate network adapter configuration")), | def __init__(self, session, networkinfo, essid=None, aplist=None): Screen.__init__(self, session) HelpableScreen.__init__(self) self.session = session if isinstance(networkinfo, (list, tuple)): self.iface = networkinfo[0] self.essid = networkinfo[1] self.aplist = networkinfo[2] else: self.iface = networkinfo self.essid = essid self.aplist = aplist self.extended = None self.applyConfigRef = None self.finished_cb = None self.oktext = _("Press OK on your remote control to continue.") self.oldInterfaceState = iNetwork.getAdapterAttribute(self.iface, "up") | f741c4cc282f2f99b86e6ec305604f27216087ba /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6652/f741c4cc282f2f99b86e6ec305604f27216087ba/NetworkSetup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1339,
16,
2483,
1376,
16,
18518,
350,
33,
7036,
16,
279,
17842,
33,
7036,
4672,
10146,
16186,
2738,
972,
12,
2890,
16,
1339,
13,
11288,
429,
7956,
16186,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1339,
16,
2483,
1376,
16,
18518,
350,
33,
7036,
16,
279,
17842,
33,
7036,
4672,
10146,
16186,
2738,
972,
12,
2890,
16,
1339,
13,
11288,
429,
7956,
16186,
... |
if ('M' in flags): say_date = False | if ('T' in flags): say_time = False | def say(self, str, args = [], kw = {}): | d3dc2a4b9977fedcd280ebc5d5981fcdc2921ec2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3136/d3dc2a4b9977fedcd280ebc5d5981fcdc2921ec2/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12532,
12,
2890,
16,
609,
16,
833,
273,
5378,
16,
5323,
273,
2618,
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,
12532,
12,
2890,
16,
609,
16,
833,
273,
5378,
16,
5323,
273,
2618,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
print "end tag tr" | def endTagTr(self, name="tr"): if self.parser.elementInScope("tr", True): print "end tag tr" self.clearStackToTableRowContext() self.parser.openElements.pop() self.parser.switchInsertionMode("inTableBody") else: # innerHTML case self.parser.parseError() | 787af9f1621cbb26f490880bec265bcadcc03f25 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10463/787af9f1621cbb26f490880bec265bcadcc03f25/parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29765,
1070,
12,
2890,
16,
508,
1546,
313,
6,
4672,
309,
365,
18,
4288,
18,
2956,
382,
3876,
2932,
313,
3113,
1053,
4672,
365,
18,
8507,
2624,
774,
30650,
1042,
1435,
365,
18,
4288,
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,
29765,
1070,
12,
2890,
16,
508,
1546,
313,
6,
4672,
309,
365,
18,
4288,
18,
2956,
382,
3876,
2932,
313,
3113,
1053,
4672,
365,
18,
8507,
2624,
774,
30650,
1042,
1435,
365,
18,
4288,
18... | |
self.statusBar.SetStatusText (os.getcwd ()) | self.statusBar.SetStatusText (os.getcwdu ()) | def __init__ (self, parent, id, title): wx.Frame.__init__ (self, parent, -1, title) | 5f003fa66305ac8935c5608a773efc5e9baee6db /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9028/5f003fa66305ac8935c5608a773efc5e9baee6db/candy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
2890,
16,
982,
16,
612,
16,
2077,
4672,
7075,
18,
3219,
16186,
2738,
972,
261,
2890,
16,
982,
16,
300,
21,
16,
2077,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
2890,
16,
982,
16,
612,
16,
2077,
4672,
7075,
18,
3219,
16186,
2738,
972,
261,
2890,
16,
982,
16,
300,
21,
16,
2077,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.assert_(stderr.startswith(b"UnicodeEncodeError: " b"'utf-8' codec can't encode character '\\udcff' in " b"position 7: surrogates not allowed"), stderr) | self.assert_(b"UnicodeEncodeError:" in stderr, "%r not in %s" % (b"UniodeEncodeError:", ascii(stderr))) | def test_main_invalid_unicode(self): import locale non_decodable = b"\xff" encoding = locale.getpreferredencoding() try: non_decodable.decode(encoding) except UnicodeDecodeError: pass else: self.skipTest('%r is decodable with encoding %s' % (non_decodable, encoding)) code = b'print("' + non_decodable + b'")' p = subprocess.Popen([sys.executable, "-c", code], stderr=subprocess.PIPE) stdout, stderr = p.communicate() self.assertEqual(p.returncode, 1) self.assert_(stderr.startswith(b"UnicodeEncodeError: " b"'utf-8' codec can't encode character '\\udcff' in " b"position 7: surrogates not allowed"), stderr) | c0983856c6814272a5e6004bd50b429afba3f3b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/c0983856c6814272a5e6004bd50b429afba3f3b4/test_sys.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5254,
67,
5387,
67,
9124,
12,
2890,
4672,
1930,
2573,
1661,
67,
323,
1559,
429,
273,
324,
12691,
5297,
6,
2688,
273,
2573,
18,
588,
23616,
5999,
1435,
775,
30,
1661,
67,
323,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5254,
67,
5387,
67,
9124,
12,
2890,
4672,
1930,
2573,
1661,
67,
323,
1559,
429,
273,
324,
12691,
5297,
6,
2688,
273,
2573,
18,
588,
23616,
5999,
1435,
775,
30,
1661,
67,
323,... |
def on_plugin_about_close(self, widget): | def on_plugin_about_close(self, widget, *args): | def on_plugin_about_close(self, widget): """Close the PluginAboutDialog.""" self.plugin_about_dialog.hide() | 967023748625d5d6d6d0b2aef98301cfc91182bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/967023748625d5d6d6d0b2aef98301cfc91182bb/preferences.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
4094,
67,
21071,
67,
4412,
12,
2890,
16,
3604,
16,
380,
1968,
4672,
3536,
4605,
326,
6258,
24813,
6353,
12123,
365,
18,
4094,
67,
21071,
67,
12730,
18,
11248,
1435,
2,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
603,
67,
4094,
67,
21071,
67,
4412,
12,
2890,
16,
3604,
16,
380,
1968,
4672,
3536,
4605,
326,
6258,
24813,
6353,
12123,
365,
18,
4094,
67,
21071,
67,
12730,
18,
11248,
1435,
2,
-100,
-... |
want to silent this exception. | want to silence this exception. | def copytree(src, dst, symlinks=False, ignore=None, copy_function=copy2, ignore_dangling_symlinks=False): """Recursively copy a directory tree. The destination directory must not already exist. If exception(s) occur, an Error is raised with a list of reasons. If the optional symlinks flag is true, symbolic links in the source tree result in symbolic links in the destination tree; if it is false, the contents of the files pointed to by symbolic links are copied. If the file pointed by the symlink doesn't exist, an exception will be added in the list of errors raised in an Error exception at the end of the copy process. You can set the optional ignore_dangling_symlinks flag to true if you want to silent this exception. The optional ignore argument is a callable. If given, it is called with the `src` parameter, which is the directory being visited by copytree(), and `names` which is the list of `src` contents, as returned by os.listdir(): callable(src, names) -> ignored_names Since copytree() is called recursively, the callable will be called once for each directory that is copied. It returns a list of names relative to the `src` directory that should not be copied. The optional copy_function argument is a callable that will be used to copy each file. It will be called with the source path and the destination path as arguments. By default, copy2() is used, but any function that supports the same signature (like copy()) can be used. """ names = os.listdir(src) if ignore is not None: ignored_names = ignore(src, names) else: ignored_names = set() os.makedirs(dst) errors = [] for name in names: if name in ignored_names: continue srcname = os.path.join(src, name) dstname = os.path.join(dst, name) try: if os.path.islink(srcname): linkto = os.readlink(srcname) if symlinks: os.symlink(linkto, dstname) else: # ignore dangling symlink if the flag is on if not os.path.exists(linkto) and ignore_dangling_symlinks: continue # otherwise let the copy occurs. copy2 will raise an error copy_function(srcname, dstname) elif os.path.isdir(srcname): copytree(srcname, dstname, symlinks, ignore, copy_function) else: # Will raise a SpecialFileError for unsupported file types copy_function(srcname, dstname) # catch the Error from the recursive copytree so that we can # continue with other files except Error as err: errors.extend(err.args[0]) except EnvironmentError as why: errors.append((srcname, dstname, str(why))) try: copystat(src, dst) except OSError as why: if WindowsError is not None and isinstance(why, WindowsError): # Copying file access times may fail on Windows pass else: errors.extend((src, dst, str(why))) if errors: raise Error(errors) | 6cf3e616e4f0cbf78870b6907af8a256f8d2eee7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/6cf3e616e4f0cbf78870b6907af8a256f8d2eee7/shutil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
3413,
12,
4816,
16,
3046,
16,
23146,
33,
8381,
16,
2305,
33,
7036,
16,
1610,
67,
915,
33,
3530,
22,
16,
2305,
67,
72,
539,
2456,
67,
21278,
87,
33,
8381,
4672,
3536,
12474,
161... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
3413,
12,
4816,
16,
3046,
16,
23146,
33,
8381,
16,
2305,
33,
7036,
16,
1610,
67,
915,
33,
3530,
22,
16,
2305,
67,
72,
539,
2456,
67,
21278,
87,
33,
8381,
4672,
3536,
12474,
161... |
self.interaction(frame, exc_tuple) | self.interaction(frame, exc_tuple) | def user_exception(self, frame, exc_tuple): """This function is called if an exception occurs, but only if we are to stop at or just below this level.""" frame.f_locals['__exc_tuple__'] = exc_tuple self.interaction(frame, exc_tuple) | e032f4d4e7d00a05fe0f27b0ce4695345bb987e0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12738/e032f4d4e7d00a05fe0f27b0ce4695345bb987e0/debugger.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
729,
67,
4064,
12,
2890,
16,
2623,
16,
3533,
67,
8052,
4672,
3536,
2503,
445,
353,
2566,
309,
392,
1520,
9938,
16,
1496,
1338,
309,
732,
854,
358,
2132,
622,
578,
2537,
5712,
333,
1801... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
729,
67,
4064,
12,
2890,
16,
2623,
16,
3533,
67,
8052,
4672,
3536,
2503,
445,
353,
2566,
309,
392,
1520,
9938,
16,
1496,
1338,
309,
732,
854,
358,
2132,
622,
578,
2537,
5712,
333,
1801... |
def recall(self, s): if self.history: self.history.recall(s) | def recall(self, s, event): self.text.undo_block_start() try: self.text.tag_remove("sel", "1.0", "end") self.text.mark_set("insert", "end-1c") s = s.strip() lines = s.split('\n') if lines: prefix = self.text.get("insert linestart","insert").rstrip() if prefix and prefix[-1]==':': self.newline_and_indent_event(event) self.text.insert("insert",lines[0].strip()) if len(lines) > 1: self.newline_and_indent_event(event) for line in lines[1:]: self.text.insert("insert", line.strip()) self.newline_and_indent_event(event) else: self.text.insert("insert", s) finally: self.text.see("insert") self.text.undo_block_stop() | def recall(self, s): if self.history: self.history.recall(s) | e88225f2d5060953d48573a5934561756edf7326 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/e88225f2d5060953d48573a5934561756edf7326/PyShell.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20895,
12,
2890,
16,
272,
4672,
309,
365,
18,
8189,
30,
365,
18,
8189,
18,
266,
1991,
12,
87,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
20895,
12,
2890,
16,
272,
4672,
309,
365,
18,
8189,
30,
365,
18,
8189,
18,
266,
1991,
12,
87,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
ssn_data_quality = ET.SubElement(client, "ssn_data_quality") ssn_data_quality.text = "full ssn reported (hud)" def customizeClientPersonalIdentifiersForEntryExit(self,client,recordset): first_name = ET.SubElement(client, "first_name") first_name.text = recordset['First Name'] last_name = ET.SubElement(client, "last_name") last_name.text = recordset['Last Name'] if recordset['MI'] <> "": mi_initial = ET.SubElement(client, "mi_initial") mi_initial.text = self.fixMiddleInitial(recordset['MI']) fixedSSN = self.fixSSN(recordset['SSN']) if fixedSSN <> "": soc_sec_no = ET.SubElement(client, "soc_sec_no") soc_sec_no.text = fixedSSN | def customizeClientPersonalIdentifiers(self,client,recordset): | 47d2884a8b5be4efadf798bbb2e71a3d5e993c3e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9116/47d2884a8b5be4efadf798bbb2e71a3d5e993c3e/svcpointxml_406_writer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20236,
1227,
8346,
287,
12745,
12,
2890,
16,
2625,
16,
3366,
542,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20236,
1227,
8346,
287,
12745,
12,
2890,
16,
2625,
16,
3366,
542,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... | |
return "svn diff %s %s" % (tag_url, url) | return "svn --non-interactive diff %s %s" % (tag_url, url) | def cmd_diff_last_commit_against_tag(self, version): url = self._svn_info() tag_url = self.tag_url(version) return "svn diff %s %s" % (tag_url, url) | aa4c18314fd665eda94c51eae897c2d35fd984e6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12067/aa4c18314fd665eda94c51eae897c2d35fd984e6/svn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1797,
67,
5413,
67,
2722,
67,
7371,
67,
23095,
334,
67,
2692,
12,
2890,
16,
1177,
4672,
880,
273,
365,
6315,
31505,
67,
1376,
1435,
1047,
67,
718,
273,
365,
18,
2692,
67,
718,
12,
15... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1797,
67,
5413,
67,
2722,
67,
7371,
67,
23095,
334,
67,
2692,
12,
2890,
16,
1177,
4672,
880,
273,
365,
6315,
31505,
67,
1376,
1435,
1047,
67,
718,
273,
365,
18,
2692,
67,
718,
12,
15... |
if self.outdir[-1:]==os.sep: | if self.outdir[-1:]==DV.sep: | def run(self): self.uris=self.getURI(self.sourceuri) self.abort=False if not self.abort: if True: Damnlog('Conversion routine starting, URI is',self.uris[0]) self.uri=self.uris[0] self.update(0) self.parent.thisvideo.append(self.parent.videos[self.parent.converting]) self.filename=unicodedata.normalize('NFKD',DamnUnicode(REGEX_FILE_CLEANUP_FILENAME.sub('',self.parent.meta[self.parent.videos[self.parent.converting]]['name']))).encode('utf8','ignore').replace('/','').replace('\\','').strip() self.profile=int(self.parent.meta[self.parent.videos[self.parent.converting]]['profile']) if os.path.exists(self.uri): Damnlog('We\'re dealing with a file stream here.') self.stream=self.uri # It's a file stream, ffmpeg will take care of it if self.outdir is None: self.outdir=DV.prefs.get('defaultoutdir') else: Damnlog('We\'re dealing with a network stream here.') self.stream='-' # It's another stream, spawn a downloader thread to take care of it and pipe the content to ffmpeg via stdin if self.outdir is None: self.outdir=DV.prefs.get('defaultweboutdir') if self.outdir[-1:]==os.sep: self.outdir=self.outdir[0:-1] if not os.path.exists(self.outdir): os.makedirs(self.outdir) elif not os.path.isdir(self.outdir): os.remove(self.outdir) os.makedirs(self.outdir) self.outdir=self.outdir+os.sep Damnlog('Profile is',self.profile,'; Output directory is',self.outdir) if self.profile==-1: # Do not encode, just copy Damnlog('We\'re in raw copy mode') if True: failed=False if self.stream=='-': # Spawn a downloader src=DamnURLPicker(self.uris) total=int(src.info()['Content-Length']) Damnlog('Total bytes:',total) ext='avi' try: if src.info()['Content-Type'].lower().find('audio')!=-1: ext='mp3' except: ext='avi' try: tmpuri=src.info()['Content-Disposition'][src.info()['Content-Disposition'].find('filename=')+9:] except: tmpuri='Video.'+ext # And pray for the best! Damnlog('Temp URI is',tmpuri) else: # Just copy the file, lol total=int(os.lstat(self.stream).st_size) src=open(self.stream,'rb') tmpuri=self.stream Damnlog('Total is',total,'; Temp URI is',tmpuri) if REGEX_URI_EXTENSION_EXTRACT.search(tmpuri): ext='.'+REGEX_URI_EXTENSION_EXTRACT.sub('\\1',tmpuri) else: ext='.avi' # And pray for the best again! self.filename=self.getfinalfilename(self.outdir,self.filename,ext) Damnlog('Filename is',self.filename,'; opening local stream.') dst=open(self.outdir+self.filename+ext,'wb') Damnlog(self.outdir+self.filename+ext,'opened.') keepgoing=True copied=0.0 lasttime=0.0 self.update(statustext=u'Copying '+DamnUnicode(self.parent.meta[self.parent.videos[self.parent.converting]]['name'])+u' to '+DamnUnicode(self.filename+ext)+u'...') Damnlog('Starting raw download of stream',src) while keepgoing and not self.abort: i=src.read(4096) if len(i): dst.write(i) copied+=4096.0 else: copied=float(total) keepgoing=False progress=min((100.0,copied/total*100.0)) nowtime=float(time.time()) if lasttime+.5<nowtime or not keepgoing: # Do not send a progress update more than 2 times per second, otherwise the event queue can get overloaded. On some platforms, time() is an int, but that doesn't matter; the progress will be updated once a second instead of 2 times, which is still acceptable. self.update(progress,status=self.parent.meta[self.parent.videos[self.parent.converting]]['status']+' ['+str(int(progress))+'%]') lasttime=nowtime Damnlog('Done downloading!') else: Damnlog('Raw download failed. Aborted?',self.abort) failed=True self.grabberrun=False if self.abort or failed: self.parent.meta[self.parent.videos[self.parent.converting]]['status']='Failure.' self.update(status='Failure.') else: self.parent.meta[self.parent.videos[self.parent.converting]]['status']='Success!' self.update(status='Success!') self.parent.resultlist.append((self.parent.meta[self.parent.videos[self.parent.converting]]['name'],self.outdir)) self.update(go=self.abort) return Damnlog('We\'re in on-the-fly conversion mode.') os_exe_ext='' if DV.os=='nt': os_exe_ext='.exe' elif DV.os=='mac': os_exe_ext='osx' if DV.bit64==True: os_exe_ext='64'+os_exe_ext self.passes=1 cmd=[DV.bin_path+'ffmpeg'+os_exe_ext,'-i','?DAMNVID_VIDEO_STREAM?','-y','-deinterlace','-passlogfile',DV.tmp_path+'pass'] for i in DV.preferences.keys(): if i[0:25]=='damnvid-profile:encoding_': i=i[16:] pref=DV.prefs.getp(self.profile,i) if pref: if type(DV.preferences['damnvid-profile:'+i]['kind']) in (type(''),type(u'')): if DV.preferences['damnvid-profile:'+i]['kind'][0]=='%': pref=str(round(float(pref),0)) # Round if i=='encoding_pass': pref='?DAMNVID_VIDEO_PASS?' if i[9:]=='b' and pref=='sameq': cmd.append('-sameq') else: cmd.extend(['-'+i[9:],pref]) self.encodevideo=DV.prefs.getp(self.profile,'video') self.encodeaudio=DV.prefs.getp(self.profile,'audio') if not self.encodevideo: cmd.append('-vn') if not self.encodeaudio: cmd.append('-an') vidformat=DV.prefs.getp(self.profile,'Encoding_f') self.vcodec=DV.prefs.getp(self.profile,'Encoding_vcodec') self.acodec=DV.prefs.getp(self.profile,'Encoding_acodec') self.totalpasses=DV.prefs.getp(self.profile,'Encoding_pass') if not self.totalpasses: self.totalpasses=1 else: self.totalpasses=int(self.totalpasses) if vidformat and DV.file_ext.has_key(vidformat): ext='.'+DV.file_ext[vidformat] else: if self.vcodec and self.encodevideo and DV.file_ext_by_codec.has_key(self.vcodec): ext='.'+DV.file_ext_by_codec[self.vcodec] elif self.encodeaudio and not self.encodevideo: if DV.file_ext_by_codec.has_key(self.acodec): ext='.'+DV.file_ext_by_codec[self.acodec] else: ext='.mp3' else: ext='.avi' flags=[] if self.vcodec and DV.codec_advanced_cl.has_key(self.vcodec): for o in DV.codec_advanced_cl[self.vcodec]: if type(o) in (type(''),type(u'')): if o not in flags: # If the flag is already there, don't add it again flags.append(o) else: if '-'+o[0] not in cmd: # If the option is already there, don't overwrite it cmd.extend(['-'+o[0],o[1]]) if len(flags): cmd.extend(['-flags',''.join(flags)]) self.filename=self.getfinalfilename(self.outdir,self.filename,ext) self.filenamenoext=self.filename self.tmpfilename=self.gettmpfilename(DV.tmp_path,self.filenamenoext.decode('utf8','ignore').encode('charmap','ignore'),ext) cmd.append('?DAMNVID_OUTPUT_FILE?') if len(self.moduleextraargs): cmd.extend(self.moduleextraargs) Damnlog('ffmpeg call has been generated:',cmd) self.filename=self.filenamenoext+ext self.duration=None self.update(statustext=u'Converting '+DamnUnicode(self.parent.meta[self.parent.videos[self.parent.converting]]['name'])+u' to '+DamnUnicode(self.filename.decode('utf8'))+u'...') while int(self.passes)<=int(self.totalpasses) and not self.abort: Damnlog('Starting pass',self.passes,'out of',self.totalpasses) if self.totalpasses!=1: self.parent.meta[self.parent.videos[self.parent.converting]]['status']='Pass '+str(self.passes)+'/'+str(self.totalpasses)+'...' self.update(status='Pass '+str(self.passes)+'/'+str(self.totalpasses)+'...') if self.stream=='-': if self.passes==1: self.tmppassfile=DV.tmp_path+self.gettmpfilename(DV.tmp_path,self.filenamenoext,ext) else: self.stream=self.tmppassfile if self.passes!=1: self.tmpfilename=self.gettmpfilename(DV.tmp_path,self.filenamenoext,ext) self.process=DamnSpawner(self.cmd2str(cmd),stderr=subprocess.PIPE,stdin=subprocess.PIPE,cwd=os.path.dirname(DV.tmp_path)) if self.stream=='-': if self.totalpasses!=1: self.feeder=DamnDownloader(self.uris,self.process.stdin,self.tmppassfile) else: self.feeder=DamnDownloader(self.uris,self.process.stdin) self.feeder.start() curline='' while self.process.poll()==None and not self.abort: c=self.process.stderr.read(1) curline+=c if c=='\r' or c=='\n': self.parseLine(curline) curline='' self.passes+=1 Damnlog('And we\'re done converting!') self.update(100) result=self.process.poll() # The process is complete, but .poll() still returns the process's return code time.sleep(.25) # Wait a bit self.grabberrun=False # That'll make the DamnConverterGrabber wake up just in case if result and os.path.exists(DV.tmp_path+self.tmpfilename): os.remove(DV.tmp_path+self.tmpfilename) # Delete the output file if ffmpeg has exitted with a bad return code Damnlog('All the routine completed successfully.') else: result=1 Damnlog('Error in main conversion routine.') Damnlog('Cleaning up after conversion.') for i in os.listdir(os.path.dirname(DV.tmp_path)): if i[0:8]=='damnvid-': i=i[8:] if i==self.tmpfilename and not result and not self.abort: try: os.rename(DV.tmp_path+i,self.outdir+self.filename) except: # Maybe the file still isn't unlocked, it happens... Wait moar and retry try: time.sleep(2) os.rename(DV.tmp_path+i,self.outdir+self.filename) except: # Now this is really bad, alert the user try: # Manual copy, might be needed if we're working on two different filesystems on a non-Windows platform src=open(DV.tmp_path+i,'rb') dst=open(self.outdir+self.filename,'wb') for fileline in src.readlines(): dst.write(fileline) try: # Another try block in order to avoid raising the huge except block with the dialog src.close() dst.close() os.remove(DV.tmp_path+i) except: pass except: self.update(dialog=(DV.l('Cannot move file!'),DV.l('locale:successfully-converted-file-but-ioerror')+'\n'+DV.tmp_path+i,wx.OK|wx.ICON_EXCLAMATION)) else: try: os.remove(DV.tmp_path+i) except: pass Damnlog('End cleanup, returning. Result?',result,'; Abort?',self.abort) if not result and not self.abort: self.parent.meta[self.parent.videos[self.parent.converting]]['status']=DV.l('Success!') self.parent.resultlist.append((self.parent.meta[self.parent.videos[self.parent.converting]]['name'],self.outdir)) self.update(status=DV.l('Success!'),go=self.abort) return self.parent.meta[self.parent.videos[self.parent.converting]]['status']=DV.l('Failure.') self.update(status=DV.l('Failure.'),go=self.abort) | 18d91d3a382ccc85706a20ab0defe4fb663ef94f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11142/18d91d3a382ccc85706a20ab0defe4fb663ef94f/DamnVid.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
365,
18,
23510,
33,
2890,
18,
588,
3098,
12,
2890,
18,
3168,
1650,
13,
365,
18,
18623,
33,
8381,
309,
486,
365,
18,
18623,
30,
309,
1053,
30,
463,
301,
82,
1330... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
365,
18,
23510,
33,
2890,
18,
588,
3098,
12,
2890,
18,
3168,
1650,
13,
365,
18,
18623,
33,
8381,
309,
486,
365,
18,
18623,
30,
309,
1053,
30,
463,
301,
82,
1330... |
(6*sqrt(3)*t^3/7 + 6*sqrt(3)*t^2/7 + 6*t^2/7 + 2*sqrt(3)*t/7 + 6*t/7 + 2/7)/(2*sqrt(3) + 2) | (3*sqrt(3)*t^3/7 + 3*sqrt(3)*t^2/7 + 3*t^2/7 + sqrt(3)*t/7 + 3*t/7 + 1/7)/(sqrt(3) + 1) | def chinen_polynomial(self): """ Returns the Chinen zeta polynomial of the code. | a032d7219f7178e41cd3d1727a56c5a90f0201cf /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/a032d7219f7178e41cd3d1727a56c5a90f0201cf/linear_code.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
462,
267,
275,
67,
3915,
13602,
12,
2890,
4672,
3536,
2860,
326,
1680,
267,
275,
998,
1066,
16991,
434,
326,
981,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
462,
267,
275,
67,
3915,
13602,
12,
2890,
4672,
3536,
2860,
326,
1680,
267,
275,
998,
1066,
16991,
434,
326,
981,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
ExplorerNodes.langStyleInfoReg.append( ('Text', 'text', TextSTCMix, | ExplorerNodes.langStyleInfoReg.append( ('Text', 'text', TextSTCMix, | def __init__(self, parent, model): EditorStyledTextCtrl.__init__(self, parent, wxID_TEXTVIEW, model, (), -1) TextSTCMix.__init__(self, wxID_TEXTVIEW) self.active = true | d9d7849efc5eb8e0d9d32209221846ef27372675 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/d9d7849efc5eb8e0d9d32209221846ef27372675/SourceViews.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
938,
4672,
18451,
24273,
1259,
1528,
12418,
16186,
2738,
972,
12,
2890,
16,
982,
16,
7075,
734,
67,
5151,
12145,
16,
938,
16,
1832,
16,
300,
21,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
938,
4672,
18451,
24273,
1259,
1528,
12418,
16186,
2738,
972,
12,
2890,
16,
982,
16,
7075,
734,
67,
5151,
12145,
16,
938,
16,
1832,
16,
300,
21,... |
`\\theta''+\\sin(\\theta)=0`, `\\theta(0)=\\frac 34`, `\\theta'(0) = | `\theta''+\sin(\theta)=0`, `\theta(0)=\frac 34`, `\theta'(0) = | def eulers_method_2x2_plot(f,g, t0, x0, y0, h, t1): """ This plots the soln in the rectangle ``(xrange[0],xrange[1]) x (yrange[0],yrange[1])`` and plots using Euler's method the numerical solution of the 1st order ODEs `x' = f(t,x,y)`, `x(a)=x_0`, `y' = g(t,x,y)`, `y(a) = y_0`. *For pedagogical purposes only.* EXAMPLES:: The following example plots the solution to `\\theta''+\\sin(\\theta)=0`, `\\theta(0)=\\frac 34`, `\\theta'(0) = 0`. Type ``P[0].show()`` to plot the solution, ``(P[0]+P[1]).show()`` to plot `(t,\\theta(t))` and `(t,\\theta'(t))`:: sage: from sage.calculus.desolvers import eulers_method_2x2_plot sage: f = lambda z : z[2]; g = lambda z : -sin(z[1]) sage: P = eulers_method_2x2_plot(f,g, 0.0, 0.75, 0.0, 0.1, 1.0) """ n=int((1.0)*(t1-t0)/h) t00 = t0; x00 = x0; y00 = y0 soln = [[t00,x00,y00]] for i in range(n+1): x01 = x00 + h*f([t00,x00,y00]) y00 = y00 + h*g([t00,x00,y00]) x00 = x01 t00 = t00 + h soln.append([t00,x00,y00]) Q1 = line([[x[0],x[1]] for x in soln], rgbcolor=(1/4,1/8,3/4)) Q2 = line([[x[0],x[2]] for x in soln], rgbcolor=(1/2,1/8,1/4)) return [Q1,Q2] | 103e2c35756877269166b1784fa15fa439c899e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/103e2c35756877269166b1784fa15fa439c899e5/desolvers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
425,
332,
414,
67,
2039,
67,
22,
92,
22,
67,
4032,
12,
74,
16,
75,
16,
268,
20,
16,
619,
20,
16,
677,
20,
16,
366,
16,
268,
21,
4672,
3536,
1220,
17931,
326,
3704,
82,
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,
425,
332,
414,
67,
2039,
67,
22,
92,
22,
67,
4032,
12,
74,
16,
75,
16,
268,
20,
16,
619,
20,
16,
677,
20,
16,
366,
16,
268,
21,
4672,
3536,
1220,
17931,
326,
3704,
82,
316,
326,
... |
if os.environ.has_key('CVSROOT'): cvsroot = os.environ['CVSROOT'] else: cvsroot = '' cvsroot = self.cvsCmdPrompt(cvsroot, cvsDir, help = 'Change the CVSROOT if necessary:') dlg = wxTextEntryDialog(self.list, 'Enter cvs password for '+cvsroot, 'CVS login', '', style = wxOK | wxCANCEL | wxCENTRE | wxTE_PASSWORD) | if not cvsroot: if os.environ.has_key('CVSROOT'): cvsroot = os.environ['CVSROOT'] else: cvsroot = '' cvsroot = self.cvsCmdPrompt(cvsroot, cvsDir, help='Change the CVSROOT if necessary:') dlg = wxTextEntryDialog(self.list, 'Enter cvs password for '+cvsroot, 'CVS login', '', style=wxOK|wxCANCEL|wxCENTRE|wxTE_PASSWORD) | def OnLoginCVS(self, event): cvsDir = self.list.node.resourcepath | b94d80a8d6380c520f64a27f00e364c24e6099b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/b94d80a8d6380c520f64a27f00e364c24e6099b8/CVSExplorer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
5358,
39,
14640,
12,
2890,
16,
871,
4672,
276,
6904,
1621,
273,
365,
18,
1098,
18,
2159,
18,
3146,
803,
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,
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,
2755,
5358,
39,
14640,
12,
2890,
16,
871,
4672,
276,
6904,
1621,
273,
365,
18,
1098,
18,
2159,
18,
3146,
803,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
py_compile.compile(fullname, None, dfile) | ok = py_compile.compile(fullname, None, dfile) | def compile_dir(dir, maxlevels=10, ddir=None, force=0): """Byte-compile all modules in the given directory tree. Arguments (only dir is required): dir: the directory to byte-compile maxlevels: maximum recursion level (default 10) ddir: if given, purported directory name (this is the directory name that will show up in error messages) force: if 1, force compilation, even if timestamps are up-to-date """ print 'Listing', dir, '...' try: names = os.listdir(dir) except os.error: print "Can't list", dir names = [] names.sort() success = 1 for name in names: fullname = os.path.join(dir, name) if ddir: dfile = os.path.join(ddir, name) else: dfile = None if os.path.isfile(fullname): head, tail = name[:-3], name[-3:] if tail == '.py': cfile = fullname + (__debug__ and 'c' or 'o') ftime = os.stat(fullname)[stat.ST_MTIME] try: ctime = os.stat(cfile)[stat.ST_MTIME] except os.error: ctime = 0 if (ctime > ftime) and not force: continue print 'Compiling', fullname, '...' try: py_compile.compile(fullname, None, dfile) except KeyboardInterrupt: raise KeyboardInterrupt except: if type(sys.exc_type) == type(''): exc_type_name = sys.exc_type else: exc_type_name = sys.exc_type.__name__ print 'Sorry:', exc_type_name + ':', print sys.exc_value success = 0 elif maxlevels > 0 and \ name != os.curdir and name != os.pardir and \ os.path.isdir(fullname) and \ not os.path.islink(fullname): compile_dir(fullname, maxlevels - 1, dfile, force) return success | 5dcb85d62bdfe3cc748b635ee516b916da660f1c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/5dcb85d62bdfe3cc748b635ee516b916da660f1c/compileall.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4074,
67,
1214,
12,
1214,
16,
943,
12095,
33,
2163,
16,
302,
1214,
33,
7036,
16,
2944,
33,
20,
4672,
3536,
3216,
17,
11100,
777,
4381,
316,
326,
864,
1867,
2151,
18,
225,
13599,
261,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4074,
67,
1214,
12,
1214,
16,
943,
12095,
33,
2163,
16,
302,
1214,
33,
7036,
16,
2944,
33,
20,
4672,
3536,
3216,
17,
11100,
777,
4381,
316,
326,
864,
1867,
2151,
18,
225,
13599,
261,
... |
svg_string += self._svg_circle(19, 6, 1.5) svg_string += self._svg_circle(6, 19, 1.5) | svg_string += self._svg_circle(19 + x, 6 + y, 1.5) svg_string += self._svg_circle(6 + x, 19 + y, 1.5) | def _svg_die(self, n, x, y): svg_string = "%s%f%s%f%s" % ("<g\n transform=\"translate(", x, ", ", y, "\">\n") self.set_stroke_width(1.5) self.set_colors([self._stroke, "none"]) svg_string += self._svg_rect(25, 25, 2, 2, 0, 0) self.set_stroke_width(2) self.set_colors([self._stroke, self._stroke]) if n in [2, 3, 4, 5, 6]: svg_string += self._svg_circle(6, 6, 1.5) svg_string += self._svg_circle(19, 19, 1.5) if n in [1, 3, 5]: svg_string += self._svg_circle(12.5, 12.5, 1.5) if n in [4, 5, 6]: svg_string += self._svg_circle(19, 6, 1.5) svg_string += self._svg_circle(6, 19, 1.5) if n in [6]: svg_string += self._svg_circle(6, 12.5, 1.5) svg_string += self._svg_circle(19, 12.5, 1.5) svg_string += "</g>\n" return svg_string | 3abdde2d4415b99e072401aa95cc310d13046e05 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7609/3abdde2d4415b99e072401aa95cc310d13046e05/gencards.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
11451,
67,
72,
1385,
12,
2890,
16,
290,
16,
619,
16,
677,
4672,
9804,
67,
1080,
273,
2213,
87,
9,
74,
9,
87,
9,
74,
9,
87,
6,
738,
7566,
32,
75,
64,
82,
282,
2510,
5189,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
11451,
67,
72,
1385,
12,
2890,
16,
290,
16,
619,
16,
677,
4672,
9804,
67,
1080,
273,
2213,
87,
9,
74,
9,
87,
9,
74,
9,
87,
6,
738,
7566,
32,
75,
64,
82,
282,
2510,
5189,
1... |
SuperSocket.close(self) | def close(self): SuperSocket.close(self) if self.promisc: for i in self.iff: | 589b981d7d8ff8631ab148a37a1dfa160b0462f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7311/589b981d7d8ff8631ab148a37a1dfa160b0462f8/scapy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
12,
2890,
4672,
309,
365,
18,
17401,
291,
71,
30,
364,
277,
316,
365,
18,
3048,
30,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
12,
2890,
4672,
309,
365,
18,
17401,
291,
71,
30,
364,
277,
316,
365,
18,
3048,
30,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... | |
class AliasDefinition(PEP253Mixin, GlobalObjectDefinition): | class AliasDefinition(PEP253Mixin, ObjectDefinition): | def output_tp_initBody(self): Output("PyObject *v = NULL;") Output("char *rawdata = NULL;") Output("int rawdatalen = 0;") Output("char *kw[] = {\"itself\", \"rawdata\", 0};") Output() Output("if (!PyArg_ParseTupleAndKeywords(args, kwds, \"|Os#\", kw, &v, &rawdata, &rawdatalen))") Output("return -1;") Output("if (v && rawdata)") OutLbrace() Output("PyErr_SetString(PyExc_TypeError, \"Only one of itself or rawdata may be specified\");") Output("return -1;") OutRbrace() Output("if (!v && !rawdata)") OutLbrace() Output("PyErr_SetString(PyExc_TypeError, \"One of itself or rawdata must be specified\");") Output("return -1;") OutRbrace() Output("if (rawdata)") OutLbrace() Output("if (rawdatalen != sizeof(%s))", self.itselftype) OutLbrace() Output("PyErr_SetString(PyExc_TypeError, \"%s rawdata incorrect size\");", self.itselftype) Output("return -1;") OutRbrace() Output("memcpy(&((%s *)self)->ob_itself, rawdata, rawdatalen);", self.objecttype) Output("return 0;") OutRbrace() Output("if (myPyMac_GetFSRef(v, &((%s *)self)->ob_itself)) return 0;", self.objecttype) Output("return -1;") | 8ed30da29d0fd0d5df3fd27bfcaffe5b4b71a5f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/8ed30da29d0fd0d5df3fd27bfcaffe5b4b71a5f5/filesupport.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
876,
67,
6834,
67,
2738,
2250,
12,
2890,
4672,
3633,
2932,
9413,
921,
380,
90,
273,
3206,
4868,
13,
3633,
2932,
3001,
380,
1899,
892,
273,
3206,
4868,
13,
3633,
2932,
474,
1831,
72,
31... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
876,
67,
6834,
67,
2738,
2250,
12,
2890,
4672,
3633,
2932,
9413,
921,
380,
90,
273,
3206,
4868,
13,
3633,
2932,
3001,
380,
1899,
892,
273,
3206,
4868,
13,
3633,
2932,
474,
1831,
72,
31... |
field._renderer = lambda: self.parent.default_renderers['radio'] | field._renderer = lambda: field.parent.default_renderers['radio'] | def radio(self, options=None): """Render the field as a set of radio buttons.""" field = deepcopy(self) field._renderer = lambda: self.parent.default_renderers['radio'] if options is None: options = self.render_opts.get('options') else: options = _normalized_options(options) field.render_opts = {'options': options} return field | 4af9a644c033b5a584bed1bcc327d2033a0a4c54 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13203/4af9a644c033b5a584bed1bcc327d2033a0a4c54/fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13512,
12,
2890,
16,
702,
33,
7036,
4672,
3536,
3420,
326,
652,
487,
279,
444,
434,
13512,
9502,
12123,
652,
273,
7217,
12,
2890,
13,
652,
6315,
14374,
273,
3195,
30,
652,
18,
2938,
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,
13512,
12,
2890,
16,
702,
33,
7036,
4672,
3536,
3420,
326,
652,
487,
279,
444,
434,
13512,
9502,
12123,
652,
273,
7217,
12,
2890,
13,
652,
6315,
14374,
273,
3195,
30,
652,
18,
2938,
18... |
d.update(self.__axes_range) | d.update(self.get_axes_range()) | def save(self, filename=None, xmin=None, xmax=None, ymin=None, ymax=None, figsize=DEFAULT_FIGSIZE, figure=None, sub=None, savenow=True, dpi=DEFAULT_DPI, axes=None, axes_labels=None, fontsize=None, frame=False, verify=True, aspect_ratio = None, gridlines=None, gridlinesstyle=None, vgridlinesstyle=None, hgridlinesstyle=None): r""" Save the graphics to an image file of type: PNG, PS, EPS, SVG, SOBJ, depending on the file extension you give the filename. Extension types can be: \file{.png}, \file{.ps}, \file{.eps}, \file{.svg}, and \file{.sobj} (for a \sage object you can load later). | cb8ef50c324b324938121dd17f148aed10daf69f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/cb8ef50c324b324938121dd17f148aed10daf69f/plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
2890,
16,
1544,
33,
7036,
16,
13777,
33,
7036,
16,
14016,
33,
7036,
16,
15763,
33,
7036,
16,
15275,
33,
7036,
16,
14697,
33,
5280,
67,
5236,
4574,
16,
7837,
33,
7036,
16,
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,
1923,
12,
2890,
16,
1544,
33,
7036,
16,
13777,
33,
7036,
16,
14016,
33,
7036,
16,
15763,
33,
7036,
16,
15275,
33,
7036,
16,
14697,
33,
5280,
67,
5236,
4574,
16,
7837,
33,
7036,
16,
7... |
vals['res_model'] = "report.document.user" | if not vals.get('res_id', False) and context.get('default_res_id',False): vals['res_id']=context.get('default_res_id',False) if not vals.get('res_model', False) and context.get('default_res_model',False): vals['res_model']=context.get('default_res_model',False) | def create(self, cr, uid, vals, context={}): vals['title']=vals['name'] vals['parent_id'] = context.get('parent_id',False) or vals.get('parent_id',False) | f47eae52203d4d43bc0e45ff3b2a094943f01118 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/f47eae52203d4d43bc0e45ff3b2a094943f01118/document.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2890,
16,
4422,
16,
4555,
16,
5773,
16,
819,
12938,
4672,
5773,
3292,
2649,
3546,
33,
4524,
3292,
529,
3546,
5773,
3292,
2938,
67,
350,
3546,
273,
819,
18,
588,
2668,
2938,
67... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2890,
16,
4422,
16,
4555,
16,
5773,
16,
819,
12938,
4672,
5773,
3292,
2649,
3546,
33,
4524,
3292,
529,
3546,
5773,
3292,
2938,
67,
350,
3546,
273,
819,
18,
588,
2668,
2938,
67... |
args = [ arg[2:-1] for arg in args ] | args = [ arg[2:-1] for arg in args ] | def _parse_args(self, handler): args = list(handler.args) if handler.type == 'user': args = [ arg[2:-1] for arg in args ] # strip ${} default_count = len(handler.defaults) if default_count == 0: required = args[:] defaults = [] else: required = args[:-default_count] defaults = zip(args[-default_count:], list(handler.defaults)) varargs = handler.varargs if handler.type == 'user' and varargs is not None: varargs = varargs[2:-1] return required, defaults, varargs | cb95dea07e96d54d843c0aed351e0ed955bfdd79 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7408/cb95dea07e96d54d843c0aed351e0ed955bfdd79/libdoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2670,
67,
1968,
12,
2890,
16,
1838,
4672,
833,
273,
666,
12,
4176,
18,
1968,
13,
309,
1838,
18,
723,
422,
296,
1355,
4278,
833,
273,
306,
1501,
63,
22,
30,
17,
21,
65,
364,
15... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2670,
67,
1968,
12,
2890,
16,
1838,
4672,
833,
273,
666,
12,
4176,
18,
1968,
13,
309,
1838,
18,
723,
422,
296,
1355,
4278,
833,
273,
306,
1501,
63,
22,
30,
17,
21,
65,
364,
15... |
this = apply(_quickfix.new_UnderlyingSymbol, args) | this = _quickfix.new_UnderlyingSymbol(*args) | def __init__(self, *args): this = apply(_quickfix.new_UnderlyingSymbol, 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,
14655,
6291,
5335,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
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,
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,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
14655,
6291,
5335,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
30,
... |
shown on each ruler | shown on each ruler. | def ruler_frame(lower_left, upper_right, ticks=4, sub_ticks=4, **kwds): """ Draw a frame made of 3D rulers, with major and minor ticks. INPUT: - ``lower_left`` - the lower left corner of the frame, as a list, tuple, or vector - ``upper_right`` - the upper right corner of the frame, as a list, tuple, or vector - ``ticks`` - (default: 4) the number of major ticks shown on each ruler - ``sub_ticks`` - (default: 4) the number of shown subdivisions between each major tick Type ``line3d.options`` for a dictionary of the default options for lines which are also available. EXAMPLES: A ruler frame:: sage: from sage.plot.plot3d.shapes2 import ruler_frame sage: F = ruler_frame([1,2,3],vector([2,3,4])); F A ruler frame with some options:: sage: F = ruler_frame([1,2,3],vector([2,3,4]),ticks=6, sub_ticks=2, color='red'); F """ return ruler(lower_left, (upper_right[0], lower_left[1], lower_left[2]), ticks=ticks, sub_ticks=sub_ticks, absolute=True, **kwds) \ + ruler(lower_left, (lower_left[0], upper_right[1], lower_left[2]), ticks=ticks, sub_ticks=sub_ticks, absolute=True, **kwds) \ + ruler(lower_left, (lower_left[0], lower_left[1], upper_right[2]), ticks=ticks, sub_ticks=sub_ticks, absolute=True, **kwds) | c85cd8e70aed89c86059888b9925f160e190c0a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/c85cd8e70aed89c86059888b9925f160e190c0a7/shapes2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
436,
17040,
67,
3789,
12,
8167,
67,
4482,
16,
3854,
67,
4083,
16,
13003,
33,
24,
16,
720,
67,
11767,
33,
24,
16,
2826,
25577,
4672,
3536,
10184,
279,
2623,
7165,
434,
890,
40,
436,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
436,
17040,
67,
3789,
12,
8167,
67,
4482,
16,
3854,
67,
4083,
16,
13003,
33,
24,
16,
720,
67,
11767,
33,
24,
16,
2826,
25577,
4672,
3536,
10184,
279,
2623,
7165,
434,
890,
40,
436,
3... |
assert(self.i18nMan._init, True) | assert self.i18nMan._init | def CanOpen(self, location): """ Called by wxPython to determine if the c{I18nFileSystemHandler} can open a given file type. | afcba0385c26d4b4b8a74364547f5330c57cadf4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9228/afcba0385c26d4b4b8a74364547f5330c57cadf4/i18nmanager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4480,
3678,
12,
2890,
16,
2117,
4672,
3536,
11782,
635,
7075,
15774,
358,
4199,
309,
326,
276,
95,
45,
2643,
82,
11785,
1503,
97,
848,
1696,
279,
864,
585,
618,
18,
2,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4480,
3678,
12,
2890,
16,
2117,
4672,
3536,
11782,
635,
7075,
15774,
358,
4199,
309,
326,
276,
95,
45,
2643,
82,
11785,
1503,
97,
848,
1696,
279,
864,
585,
618,
18,
2,
-100,
-100,
-100... |
"""Reads structure from exiting xml file and returns atoms object in a list | """Reads structure from exiting xml file. | def read_exciting(fileobj, index=-1): """Reads structure from exiting xml file and returns atoms object in a list Parameters ---------- fileobj : File object Filehandle from which data should be read Other parameters ---------------- index : integer -1 Not used in this implementation """ from lxml import etree as ET #parse file into element tree doc = ET.parse(fileobj) root = doc.getroot() speciesnodes = root.find('structure').getiterator('species') symbols = [] positions = [] basevects = [] atoms = None #collect data from tree for speciesnode in speciesnodes: symbol = speciesnode.get('speciesfile').split('.')[0] natoms = speciesnode.getiterator('atom') for atom in natoms: x, y, z = atom.get('coord').split() positions.append([float(x), float(y), float(z)]) symbols.append(symbol) basevectsn = doc.xpath('//basevect/text()') for basevect in basevectsn: x, y, z = basevect.split() basevects.append([float(x) * Bohr, float(y) * Bohr, float(z) * Bohr]) atoms = Atoms(symbols=symbols, cell=basevects) atoms.set_scaled_positions(positions) if 'molecule' in root.find('structure').attrib.keys(): if root.find('structure').attrib['molecule']: atoms.set_pbc(False) else: atoms.set_pbc(True) return atoms | 59a55b9ac73fd158afb853569eee2926e450aead /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5735/59a55b9ac73fd158afb853569eee2926e450aead/exciting.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
10075,
305,
310,
12,
768,
2603,
16,
770,
29711,
21,
4672,
3536,
7483,
3695,
628,
15702,
2025,
585,
18,
225,
7012,
12181,
17041,
294,
1387,
733,
1387,
4110,
628,
1492,
501,
1410,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
10075,
305,
310,
12,
768,
2603,
16,
770,
29711,
21,
4672,
3536,
7483,
3695,
628,
15702,
2025,
585,
18,
225,
7012,
12181,
17041,
294,
1387,
733,
1387,
4110,
628,
1492,
501,
1410,... |
for work in works: | for work in works.values(): | def write_machine_tags(ln, books): key_to_nyt = {} for book in books: for work in book['ol:works']: key_to_nyt[work] = book['nyt'] works = OL.get_many(list(set(key_to_nyt.keys()))) write = {} for work in works: nyt = key_to_nyt[work['key']] tags = ("New York Times bestseller", "nyt:%s=%s" % ("_".join([s.lower() for s in ln.split()]), nyt['bestsellers_date'])) if 'subjects' not in work: work['subjects'] = list(tags) write[work['key']] = work else: for tag in tags: if tag not in work['subjects']: work['subjects'].append(tag) write[work['key']] = work if work['key'] not in write: LOG("INFO", "all tags already present, skipping %s: '%s' by %s" % ( work['key'], nyt['book_details'][0]['title'], nyt['book_details'][0]['author'] )) else: LOG("DEBUG", "Adding tags (%s) to %s" % (", ".join(tags), work['key'])) LOG("INFO", "WRITING MACHINE TAGS FOR %s of %s works" % ( len(write), len(books) )) if write: OL.save_many(write.values(), comment="Adding tags to New York Times %s bestsellers" % ln) | b571c06cf25ebbfeedc3dfb8e65b86da27cffbca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3913/b571c06cf25ebbfeedc3dfb8e65b86da27cffbca/nyt_bestsellers_bot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
9149,
67,
4156,
12,
2370,
16,
6978,
87,
4672,
498,
67,
869,
67,
18538,
88,
273,
2618,
364,
6978,
316,
6978,
87,
30,
364,
1440,
316,
6978,
3292,
355,
30,
18597,
3546,
30,
49... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
9149,
67,
4156,
12,
2370,
16,
6978,
87,
4672,
498,
67,
869,
67,
18538,
88,
273,
2618,
364,
6978,
316,
6978,
87,
30,
364,
1440,
316,
6978,
3292,
355,
30,
18597,
3546,
30,
49... |
cr.execute('select distinct product_id from stock_move where (location_id=%s) or (location_dest_id=%s)',(id,id)) | cr.execute('select distinct product_id from stock_move where (location_id=%s) or (location_dest_id=%s)', (id, id)) | def product_detail(self, cr, uid, id, field, context={}): res = {} res[id] = {} final_value = 0.0 field_to_read = 'virtual_available' if field == 'stock_real_value': field_to_read = 'qty_available' cr.execute('select distinct product_id from stock_move where (location_id=%s) or (location_dest_id=%s)',(id,id)) result = cr.dictfetchall() if result: for r in result: c = (context or {}).copy() c['location'] = id product = self.pool.get('product.product').read(cr, uid, r['product_id'], [field_to_read,'standard_price'], context=c) final_value += (product[field_to_read] * product['standard_price']) return final_value | 369221b47101072e094ad2d02fe2edd2b47690aa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/369221b47101072e094ad2d02fe2edd2b47690aa/stock.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3017,
67,
8992,
12,
2890,
16,
4422,
16,
4555,
16,
612,
16,
652,
16,
819,
12938,
4672,
400,
273,
2618,
400,
63,
350,
65,
273,
2618,
727,
67,
1132,
273,
374,
18,
20,
652,
67,
869,
67... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3017,
67,
8992,
12,
2890,
16,
4422,
16,
4555,
16,
612,
16,
652,
16,
819,
12938,
4672,
400,
273,
2618,
400,
63,
350,
65,
273,
2618,
727,
67,
1132,
273,
374,
18,
20,
652,
67,
869,
67... |
return set([self.target, None]) | return cellset(sure=[self.target], others=False) | def prereferences(self): return set([self.target, None]) | 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,
327,
444,
3816,
2890,
18,
3299,
16,
599,
5717,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30328,
2980,
12,
2890,
4672,
327,
444,
3816,
2890,
18,
3299,
16,
599,
5717,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.