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 t.orelse: self.write(" else ") self.dispatch(t.orelse) | self.write(" else ") self.dispatch(t.orelse) self.write(")") | def _IfExp(self, t): self.dispatch(t.body) self.write(" if ") self.dispatch(t.test) if t.orelse: self.write(" else ") self.dispatch(t.orelse) | 124df8398dfcb176fbf568130864aad9c8aac103 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/124df8398dfcb176fbf568130864aad9c8aac103/unparse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2047,
2966,
12,
2890,
16,
268,
4672,
365,
18,
10739,
12,
88,
18,
3432,
13,
365,
18,
2626,
2932,
309,
9369,
365,
18,
10739,
12,
88,
18,
3813,
13,
309,
268,
18,
479,
80,
307,
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2047,
2966,
12,
2890,
16,
268,
4672,
365,
18,
10739,
12,
88,
18,
3432,
13,
365,
18,
2626,
2932,
309,
9369,
365,
18,
10739,
12,
88,
18,
3813,
13,
309,
268,
18,
479,
80,
307,
30... |
self.__proxypeername = (destaddr,destport) def __negotiatehttp(self,destaddr,destport): | self.__proxypeername = (destaddr, destport) def __negotiatehttp(self, destaddr, destport): | def __negotiatesocks4(self,destaddr,destport): """__negotiatesocks4(self,destaddr,destport) Negotiates a connection through a SOCKS4 server. """ # Check if the destination address provided is an IP address rmtrslv = False try: ipaddr = socket.inet_aton(destaddr) except socket.error: # It's a DNS name. Check where it should be resolved. if self.__proxy[3]==True: ipaddr = "\x00\x00\x00\x01" rmtrslv = True else: ipaddr = socket.inet_aton(socket.gethostbyname(destaddr)) # Construct the request packet req = "\x04\x01" + self.__decode(struct.pack(">H",destport)) + ipaddr # The username parameter is considered userid for SOCKS4 if self.__proxy[4] != None: req = req + self.__proxy[4] req = req + "\x00" # DNS name if remote resolving is required # NOTE: This is actually an extension to the SOCKS4 protocol # called SOCKS4A and may not be supported in all cases. if rmtrslv==True: req = req + destaddr + "\x00" self.sendall(req) # Get the response from the server resp = self.__recvall(8) if resp[0] != "\x00": # Bad data self.close() raise GeneralProxyError((1,_generalerrors[1])) if resp[1] != "\x5A": # Server returned an error self.close() if ord(resp[1]) in (91,92,93): self.close() raise Socks4Error((ord(resp[1]),_socks4errors[ord(resp[1])-90])) else: raise Socks4Error((94,_socks4errors[4])) # Get the bound address/port self.__proxysockname = (socket.inet_ntoa(resp[4:]),struct.unpack(">H",bytes(resp[2:4],'utf8'))[0]) if rmtrslv != None: self.__proxypeername = (socket.inet_ntoa(ipaddr),destport) else: self.__proxypeername = (destaddr,destport) | 9c2eaf1c9f74544afe20a86fa591d97eeaa8921c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13138/9c2eaf1c9f74544afe20a86fa591d97eeaa8921c/socks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
14518,
352,
16020,
20641,
24,
12,
2890,
16,
10488,
4793,
16,
10488,
655,
4672,
3536,
972,
14518,
352,
16020,
20641,
24,
12,
2890,
16,
10488,
4793,
16,
10488,
655,
13,
423,
27445,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
14518,
352,
16020,
20641,
24,
12,
2890,
16,
10488,
4793,
16,
10488,
655,
4672,
3536,
972,
14518,
352,
16020,
20641,
24,
12,
2890,
16,
10488,
4793,
16,
10488,
655,
13,
423,
27445,
1... |
Roch\'e Compaan (2 tokens: Roch'e Compaan) | Roch\\'e Compaan (2 tokens: Roch'e Compaan) | def help_all(self): print _(''' | eb552e06b9df2d7c4092851c8b0de350e72c3daf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/eb552e06b9df2d7c4092851c8b0de350e72c3daf/admin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2809,
67,
454,
12,
2890,
4672,
1172,
389,
2668,
6309,
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,
2809,
67,
454,
12,
2890,
4672,
1172,
389,
2668,
6309,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
return eval(command, self.globals, self.locals) | return eval(command, self.globals, self.locals) | def __call__(self, m, search_text=None, filter=None, columns=None, sort=None, group=None): if m.group('name'): if m.group('name') in self.props: text = m.group('text') replace = self.__class__(self.globals, {}, self.props) return replace.go(text) else: return '' if m.group('display'): command = m.group('command') return eval(command, self.globals, self.locals) return '*** unhandled match: %s'%str(m.groupdict()) | aaffa309571b159bf15124ecf5f99d1f0ad7347b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/aaffa309571b159bf15124ecf5f99d1f0ad7347b/htmltemplate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
312,
16,
1623,
67,
955,
33,
7036,
16,
1034,
33,
7036,
16,
2168,
33,
7036,
16,
1524,
33,
7036,
16,
1041,
33,
7036,
4672,
309,
312,
18,
1655,
2668,
529,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
312,
16,
1623,
67,
955,
33,
7036,
16,
1034,
33,
7036,
16,
2168,
33,
7036,
16,
1524,
33,
7036,
16,
1041,
33,
7036,
4672,
309,
312,
18,
1655,
2668,
529,
... |
self.active_table.caption = self.encode(node.astext()) raise nodes.SkipNode | self.push_output_collector(self.active_table.caption) self.context.append('') | def visit_title(self, node): """Append section and other titles.""" # Document title if node.parent.tagname == 'document': title = self.encode(node.astext()) self.title.append(title) self.pdfinfo.append(' pdftitle={%s},' % title) raise nodes.SkipNode # Topic titles (topic, admonition, sidebar) elif (isinstance(node.parent, nodes.topic) or isinstance(node.parent, nodes.admonition) or isinstance(node.parent, nodes.sidebar)): self.fallbacks['title'] = PreambleCmds.title classes = ','.join(node.parent['classes']) if not classes: classes = node.tagname self.out.append('\\DUtitle[%s]{' % classes) self.context.append('}\n') # Table caption elif isinstance(node.parent, nodes.table): # caption must be written after column spec self.active_table.caption = self.encode(node.astext()) raise nodes.SkipNode # Section title else: self.out.append('\n\n') self.out.append('%' + '_' * 75) self.out.append('\n\n') # section_name = self.d_class.section(self.section_level) # number sections? if (self.settings.sectnum_xform # numbering by Docutils or (self.section_level > len(self.d_class.sections))): section_star = '*' else: # LaTeX numbered sections section_star = '' self.out.append(r'\%s%s{' % (section_name, section_star)) # System messages heading in red: if ('system-messages' in node.parent['classes']): self.requirements['color'] = PreambleCmds.color self.out.append('\color{red}') # label and ToC entry: self.context.append(self.bookmark(node) + '}\n') # MAYBE postfix paragraph and subparagraph with \leavemode to # ensure floats stay in the section and text starts on a new line. | 6d0e673df8a8a162ea831fe884be17ae4ef52a46 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5620/6d0e673df8a8a162ea831fe884be17ae4ef52a46/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
2649,
12,
2890,
16,
756,
4672,
3536,
5736,
2442,
471,
1308,
14693,
12123,
468,
4319,
2077,
309,
756,
18,
2938,
18,
2692,
529,
422,
296,
5457,
4278,
2077,
273,
365,
18,
3015,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
2649,
12,
2890,
16,
756,
4672,
3536,
5736,
2442,
471,
1308,
14693,
12123,
468,
4319,
2077,
309,
756,
18,
2938,
18,
2692,
529,
422,
296,
5457,
4278,
2077,
273,
365,
18,
3015,
... |
raise Exception("Cannot calculate the RGB value of the polygon mask because no polygon mask color has been set.") | raise Exception("Cannot calculate the RGB \ value of the polygon mask because no polygon mask color \ has been set.") | def getPolygonMaskColorRGB(self): """ Returns the RGB values for the polygon mask color as a tuple. Each of r,g,b is an integer from 0 to 255. """ if self.polygonMaskColor == None: raise Exception("Cannot calculate the RGB value of the polygon mask because no polygon mask color has been set.") (r,g,b) = self.widget.winfo_rgb(self.polygonMaskColor) return (r/256,g/256,b/256) | 69d13a1b8b2cac1003a5686e7195378d35f89426 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8973/69d13a1b8b2cac1003a5686e7195378d35f89426/MaskedPixelInfo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1689,
355,
4731,
5796,
2957,
11343,
12,
2890,
4672,
3536,
2860,
326,
11510,
924,
364,
326,
7154,
3066,
2036,
487,
279,
3193,
18,
8315,
434,
436,
16,
75,
16,
70,
353,
392,
3571,
628,
37... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1689,
355,
4731,
5796,
2957,
11343,
12,
2890,
4672,
3536,
2860,
326,
11510,
924,
364,
326,
7154,
3066,
2036,
487,
279,
3193,
18,
8315,
434,
436,
16,
75,
16,
70,
353,
392,
3571,
628,
37... |
dir_info = scm.SVN.CaptureStatus(os.path.join(checkout_path, '.')) if [True for d in dir_info if d[0][2] == 'L' and d[1] == checkout_path]: | dir_info = scm.SVN.CaptureStatus(os.path.join(self.checkout_path, '.')) if [True for d in dir_info if d[0][2] == 'L' and d[1] == self.checkout_path]: | def update(self, options, args, file_list): """Runs svn to update or transparently checkout the working copy. | 338ead09dbd34566cb60d324c2eb7366229ad94e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6076/338ead09dbd34566cb60d324c2eb7366229ad94e/gclient_scm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
16,
702,
16,
833,
16,
585,
67,
1098,
4672,
3536,
9361,
5893,
82,
358,
1089,
578,
17270,
715,
13926,
326,
5960,
1610,
18,
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,
1089,
12,
2890,
16,
702,
16,
833,
16,
585,
67,
1098,
4672,
3536,
9361,
5893,
82,
358,
1089,
578,
17270,
715,
13926,
326,
5960,
1610,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
return x * (base**bdigits) >> xbits | return x * (MPBASE(base)**bdigits) >> xbits | def bin_to_radix(x, xbits, base, bdigits): """Changes radix of a fixed-point number; i.e., converts x * 2**xbits to floor(x * 10**bdigits).""" return x * (base**bdigits) >> xbits | 3803309ec86bf9bad40cc4d8623e22de839cb3ce /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11851/3803309ec86bf9bad40cc4d8623e22de839cb3ce/lib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4158,
67,
869,
67,
6012,
697,
12,
92,
16,
619,
6789,
16,
1026,
16,
324,
16649,
4672,
3536,
7173,
19015,
434,
279,
5499,
17,
1153,
1300,
31,
277,
18,
73,
12990,
7759,
619,
380,
576,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4158,
67,
869,
67,
6012,
697,
12,
92,
16,
619,
6789,
16,
1026,
16,
324,
16649,
4672,
3536,
7173,
19015,
434,
279,
5499,
17,
1153,
1300,
31,
277,
18,
73,
12990,
7759,
619,
380,
576,
6... |
self.playerSprite.dx = 0 | self.playerSprite.dx += speed | def update(self): for event in pygame.event.get(): if event.type == pygame.QUIT: sys.exit() speed = 5 | aa6f9694a8ec1b2080db694285871ca092a6098c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14405/aa6f9694a8ec1b2080db694285871ca092a6098c/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
4672,
364,
871,
316,
2395,
13957,
18,
2575,
18,
588,
13332,
309,
871,
18,
723,
422,
2395,
13957,
18,
3500,
1285,
30,
2589,
18,
8593,
1435,
225,
8632,
273,
1381,
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,
1089,
12,
2890,
4672,
364,
871,
316,
2395,
13957,
18,
2575,
18,
588,
13332,
309,
871,
18,
723,
422,
2395,
13957,
18,
3500,
1285,
30,
2589,
18,
8593,
1435,
225,
8632,
273,
1381,
2,
-100... |
if not os.path.isfile(configFiles): print "ERROR!!! Cannot read " + configFiles + ". Please create " + configFiles + " by copying " + configFiles + ".template and filling in the appropriate values." sys.exit(1) | def UseArgs(argv): global gProbename,gOutput,gWithPanda,gGroupBy,gVOName,gEmailTo,gEmailToNames,gEmailSubject,gConfig,gGrid monthly = False weekly = False daily = False configFiles = "gratiareports.conf" if not os.path.isfile(configFiles): print "ERROR!!! Cannot read " + configFiles + ". Please create " + configFiles + " by copying " + configFiles + ".template and filling in the appropriate values." sys.exit(1) if argv is None: argv = sys.argv try: try: opts, args = getopt.getopt(argv[1:], "hm:p:", ["help","config=","monthly","weekly","daily","probe=","output=","with-panda","groupby=","voname=","emailto=","subject=","grid="]) except getopt.error, msg: raise Usage(msg) # more code, unchanged except Usage, err: print >>sys.stderr, err.msg print >>sys.stderr, "for help use --help" return 2 for o, a in opts: if o in ("-m","--monthly"): monthly = True; if o in ("-w","--weekly"): weekly = True; if o in ("-d","--daily"): daily = True; if o in ("-p","--probe"): gProbename = a; if o in ("--output"): gOutput = a if o in ("--with-panda"): gWithPanda = True if o in ("--groupby"): gGroupBy = a if o in ("--voname"): gVOName = a if o in ("--config"): configFiles = [i.strip() for i in a.split(',')] if o in ("--emailto"): gEmailTo = [i.strip() for i in a.split(',')] if o in ("--subject"): gEmailSubject = a if o in ("--grid"): gGrid = a # indicates if we should restrict the queries from summary table by adding Grid="OSG" to the where clause. See RunQuery function for how the query is being manipulated for this purpose. gConfig.read(configFiles) if (gEmailToNames == None and gEmailTo != None): gEmailToNames = ["" for i in gEmailTo] # Get DB connection credentials DBConnectString(configFiles) start = "" end = "" if len(argv) > len(opts) + 1: start = argv[len(opts)+1] if len(argv) > len(opts) + 2: end = argv[len(opts)+2] if monthly: if len(end)>0: print >> sys.stderr, "Warning: With --monthly the 2nd date is ignored" SetMonthlyDate(start) elif weekly: if len(end)>0: print >> sys.stderr, "Warning: With --weekly the 2nd date is ignored" SetWeeklyDate(start) elif daily: if len(end)>0: print >> sys.stderr, "Warning: With --daily the 2nd date is ignored" SetDailyDate(start) else: SetDate(start,end) | da5129b32ffc65c5da6332c2cf48f08f15972171 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/637/da5129b32ffc65c5da6332c2cf48f08f15972171/AccountingReports.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2672,
2615,
12,
19485,
4672,
2552,
314,
9152,
1069,
16,
75,
1447,
16,
75,
1190,
52,
464,
69,
16,
75,
26257,
16,
75,
16169,
461,
16,
75,
4134,
774,
16,
75,
4134,
774,
1557,
16,
75,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2672,
2615,
12,
19485,
4672,
2552,
314,
9152,
1069,
16,
75,
1447,
16,
75,
1190,
52,
464,
69,
16,
75,
26257,
16,
75,
16169,
461,
16,
75,
4134,
774,
16,
75,
4134,
774,
1557,
16,
75,
... | |
xfile = os.path.join(self.__path, filename) | xfile = os.path.join(self.__dir, filename) | def __copyToDisk(self, rfd, filename="xml"): """ Copy the file opened with rfd to a new file on disk, is used to copy XML output on disk. """ filename += '.xml' xfile = os.path.join(self.__path, filename) try: wfd = open(xfile, 'w') except: self.log('ERROR : cannot create file, maybe directory does not exists... [Test.copyToDisk]\n') try: wfd.write(rfd.read()) except: self.log('ERROR : cannot write file [Test.copyToDisk]\n') wfd.close() return xfile | 6a081c2b1e7c702e03fa6a01ec7da7f3a4459e8c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2996/6a081c2b1e7c702e03fa6a01ec7da7f3a4459e8c/ometahtest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
3530,
774,
6247,
12,
2890,
16,
436,
8313,
16,
1544,
1546,
2902,
6,
4672,
3536,
5631,
326,
585,
10191,
598,
436,
8313,
358,
279,
394,
585,
603,
4234,
16,
353,
1399,
358,
1610,
316... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3530,
774,
6247,
12,
2890,
16,
436,
8313,
16,
1544,
1546,
2902,
6,
4672,
3536,
5631,
326,
585,
10191,
598,
436,
8313,
358,
279,
394,
585,
603,
4234,
16,
353,
1399,
358,
1610,
316... |
data = "\x8e\xad\xe8\x01\x00\x00\x00\x00" + doRead(self.fd, 8) | data = doRead(self.fd, 8) (indexNo, storeSize) = unpack("!2I", data) magic = "\x8e\xad\xe8\x01\x00\x00\x00\x00" data = magic + data if indexNo < 1: self.raiseErr("bad index magic") | def __readIndex(self, pad, rpmdb=None): if rpmdb: data = "\x8e\xad\xe8\x01\x00\x00\x00\x00" + doRead(self.fd, 8) else: data = doRead(self.fd, 16) (magic, indexNo, storeSize) = unpack("!8s2I", data) if magic != "\x8e\xad\xe8\x01\x00\x00\x00\x00" or indexNo < 1: self.raiseErr("bad index magic") fmt = doRead(self.fd, 16 * indexNo) fmt2 = doRead(self.fd, storeSize) padfmt = "" if pad != 1: padfmt = doRead(self.fd, (pad - (storeSize % pad)) % pad) return (indexNo, storeSize, data, fmt, fmt2, 16 + len(fmt) + len(fmt2) + len(padfmt)) | 427871e48b993cbe1bec0e26f0693386c8014c95 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/427871e48b993cbe1bec0e26f0693386c8014c95/oldpyrpm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
896,
1016,
12,
2890,
16,
4627,
16,
8715,
27574,
33,
7036,
4672,
309,
8715,
27574,
30,
501,
273,
741,
1994,
12,
2890,
18,
8313,
16,
1725,
13,
261,
1615,
2279,
16,
1707,
1225,
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,
1001,
896,
1016,
12,
2890,
16,
4627,
16,
8715,
27574,
33,
7036,
4672,
309,
8715,
27574,
30,
501,
273,
741,
1994,
12,
2890,
18,
8313,
16,
1725,
13,
261,
1615,
2279,
16,
1707,
1225,
13,
... |
J -- a quaternion ideal. OUTPUT: - a quaternionic fractional ideal. | - ``J`` -- a quaternion ideal. OUTPUT: a quaternionic fractional ideal. | def multiply_by_conjugate(self, J): """ Return product of self and the conjugate Jbar of J. | 1fe7e945a5e69662d3b79300c558387c31fea323 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/1fe7e945a5e69662d3b79300c558387c31fea323/quaternion_algebra.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10194,
67,
1637,
67,
591,
78,
31529,
12,
2890,
16,
804,
4672,
3536,
2000,
3017,
434,
365,
471,
326,
10550,
31529,
804,
3215,
434,
804,
18,
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,
10194,
67,
1637,
67,
591,
78,
31529,
12,
2890,
16,
804,
4672,
3536,
2000,
3017,
434,
365,
471,
326,
10550,
31529,
804,
3215,
434,
804,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
sendmess(mycontext["server_ip"], mycontext["udp_port"], get_mess(512)) | sendmess(mycontext["server_ip"], mycontext["udp_port"], "0" * 512, ip, mycontext["upd_port"]) | def get_mess(bytes): mess = "" for i in range(bytes): mess += "0" return mess | dd7a7f7449d6131cd997bc99b78587b7bf8cb3b6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7995/dd7a7f7449d6131cd997bc99b78587b7bf8cb3b6/BandwidthClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
81,
403,
12,
3890,
4672,
12755,
273,
1408,
364,
277,
316,
1048,
12,
3890,
4672,
12755,
1011,
315,
20,
6,
327,
12755,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
81,
403,
12,
3890,
4672,
12755,
273,
1408,
364,
277,
316,
1048,
12,
3890,
4672,
12755,
1011,
315,
20,
6,
327,
12755,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
order by T.facility_name,J.VOName""" | order by T.facility_name,J.VOName;""" | def RangeSiteVOData(begin, end, with_panda = False): schema = "gratia" select = """\ | 652726a5a77ccef2562ddbe94cbfe26158a8f0db /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/637/652726a5a77ccef2562ddbe94cbfe26158a8f0db/PSACCTReport.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8086,
4956,
16169,
751,
12,
10086,
16,
679,
16,
598,
67,
84,
464,
69,
273,
1083,
4672,
1963,
273,
315,
3197,
270,
1155,
6,
2027,
273,
3536,
64,
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,
8086,
4956,
16169,
751,
12,
10086,
16,
679,
16,
598,
67,
84,
464,
69,
273,
1083,
4672,
1963,
273,
315,
3197,
270,
1155,
6,
2027,
273,
3536,
64,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
cut_distance(Found, 1, 2000) cut_distance(Missed, 1, 2000) | Found = cut_distance(Found, 1, 2000) Missed = cut_distance(Missed, 1, 2000) | def parse_command_line(): parser = OptionParser(version = "%prog CVS $Id$", usage = "%prog [options] [file ...]", description = "%prog computes mass/mass upperlimit") parser.add_option("-i", "--instruments", metavar = "name[,name,...]", help = "Set the list of instruments. Required. Example \"H1,H2,L1\"") parser.add_option("--live-time-program", default = "thinca", metavar = "name", help = "Set the name of the program whose rings will be extracted from the search_summary table. Default = \"thinca\".") parser.add_option("-t", "--output-name-tag", default = "", metavar = "name", help = "Set the file output name tag, real name is 2Dsearchvolume-<tag>-<ifos>.xml") parser.add_option("-f", "--full-data-file", default = "FULL_DATACAT_3.sqlite", metavar = "pattern", help = "File in which to find the full data, example FULL_DATACAT_3.sqlite") parser.add_option("-s", "--inj-data-glob", default = "*INJCAT_3.sqlite", metavar = "pattern", help = "Glob for files to find the inj data, example *INJCAT_3.sqlite") parser.add_option("-b", "--bootstrap-iterations", default = 1, metavar = "integer", type = "int", help = "Number of iterations to compute mean and variance of volume MUST BE GREATER THAN 1 TO GET USABLE NUMBERS, a good number is 10000") parser.add_option("--veto-segments", help = "Load veto segments from this XML document. See ligolw_segments for information on constructing such a document.") parser.add_option("--veto-segments-name", help = "Set the name of the veto segments to use from the XML document.") parser.add_option("--verbose", action = "set_true", help = "Be verbose.") opts, filenames = parser.parse_args() if opts.instruments is None: raise ValueError, "missing required argument --instruments" opts.instruments = lsctables.instrument_set_from_ifos(opts.instruments) opts.injfnames = glob.glob(opts.inj_data_glob) return opts, filenames | eeac68a8437a685899dcc87efbdeead6fb612135 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/eeac68a8437a685899dcc87efbdeead6fb612135/hm_upperlimit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
3076,
67,
1369,
13332,
2082,
273,
18862,
12,
1589,
273,
2213,
14654,
385,
14640,
271,
548,
8,
3113,
4084,
273,
2213,
14654,
306,
2116,
65,
306,
768,
1372,
65,
3113,
2477,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
3076,
67,
1369,
13332,
2082,
273,
18862,
12,
1589,
273,
2213,
14654,
385,
14640,
271,
548,
8,
3113,
4084,
273,
2213,
14654,
306,
2116,
65,
306,
768,
1372,
65,
3113,
2477,
273,
... |
p2cread = GetStdHandle(STD_INPUT_HANDLE) | p2cread = _subprocess.GetStdHandle(_subprocess.STD_INPUT_HANDLE) | def _get_handles(self, stdin, stdout, stderr): """Construct and return tuple with IO objects: p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite """ if stdin is None and stdout is None and stderr is None: return (None, None, None, None, None, None) | bfcbec5091d1f60c18c1f9c12171de7a06cc742c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/bfcbec5091d1f60c18c1f9c12171de7a06cc742c/subprocess.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
24111,
12,
2890,
16,
8801,
16,
3909,
16,
4514,
4672,
3536,
7249,
471,
327,
3193,
598,
1665,
2184,
30,
293,
22,
71,
896,
16,
293,
22,
71,
2626,
16,
276,
22,
84,
896,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
24111,
12,
2890,
16,
8801,
16,
3909,
16,
4514,
4672,
3536,
7249,
471,
327,
3193,
598,
1665,
2184,
30,
293,
22,
71,
896,
16,
293,
22,
71,
2626,
16,
276,
22,
84,
896,
1... |
if entry.getElementsByTagName('Newest'): | if entry.getElementsByTagName('Newest') and entry.getElementsByTagName('Newest')[0].firstChild: | def parse_results(self, raw_xml): """Parse the xml and return a list of dictionaries like: [ {'IDSubtitle': 'foo', 'LinkUseNext': 'foo', 'MovieName': 'foo_movie', ... }, {'IDSubtitle': 'foo', 'LinkUseNext': 'foo', 'MovieName': 'foo_movie', ... }, ...] """ dom = minidom.parseString(raw_xml) #Make the dom from raw xml entries=dom.getElementsByTagName('opensubtitles') #Pull out all entry's result_entries=[] #Make an empty container to fill up and return data = None # fetch the wanted result xml node for entry in entries: if len(entry.getElementsByTagName('results')) > 0: for result in entry.getElementsByTagName('results'): if len(result.getElementsByTagName('subtitle')) > 0: data = result.getElementsByTagName('subtitle') break break #print "data=", data if not data: return [] # catch all subtitles information for entry in data: try: sub_obj = subtitlefile.SubtitleFile(online=True) sub = {} if entry.getElementsByTagName('IDSubtitle'): sub['IDSubtitle'] = { 'IDSubtitle': entry.getElementsByTagName('IDSubtitle')[0].firstChild.data, 'Link': entry.getElementsByTagName('IDSubtitle')[0].getAttribute('Link'), 'LinkImdb': entry.getElementsByTagName('IDSubtitle')[0].getAttribute('LinkImdb'), 'DownloadLink': entry.getElementsByTagName('IDSubtitle')[0].getAttribute('DownloadLink'), 'uuid': entry.getElementsByTagName('IDSubtitle')[0].getAttribute('uuid'), } sub_obj.id = sub['IDSubtitle']['IDSubtitle'] if entry.getElementsByTagName('UserID'): sub['UserID'] = { 'UserID': entry.getElementsByTagName('UserID')[0].firstChild.data, 'Link': entry.getElementsByTagName('UserID')[0].getAttribute('Link'), } if entry.getElementsByTagName('UserNickName'): sub['UserNickName'] = entry.getElementsByTagName('UserNickName')[0].firstChild.data sub_obj._uploader = sub['UserNickName'] if entry.getElementsByTagName('MovieID'): #sub['MovieID'] = entry.getElementsByTagName('MovieID')[0].firstChild.data sub['MovieID'] = { 'MovieID': entry.getElementsByTagName('MovieID')[0].firstChild.data, 'Link': entry.getElementsByTagName('MovieID')[0].getAttribute('Link'), 'LinkImdb': entry.getElementsByTagName('MovieID')[0].getAttribute('LinkImdb'), } if entry.getElementsByTagName('MovieThumb'): sub['MovieThumb'] = entry.getElementsByTagName('MovieThumb')[0].firstChild.data if entry.getElementsByTagName('LinkUseNext'): sub['LinkUseNext'] = entry.getElementsByTagName('LinkUseNext')[0].firstChild.data if entry.getElementsByTagName('LinkZoozle'): sub['LinkZoozle'] = entry.getElementsByTagName('LinkZoozle')[0].firstChild.data if entry.getElementsByTagName('LinkTorrentbar'): sub['LinkTorrentbar'] = entry.getElementsByTagName('LinkTorrentbar')[0].firstChild.data if entry.getElementsByTagName('LinkBoardreader'): sub['LinkBoardreader'] = entry.getElementsByTagName('LinkBoardreader')[0].firstChild.data if entry.getElementsByTagName('MovieName'): sub['MovieName'] = entry.getElementsByTagName('MovieName')[0].firstChild.data if entry.getElementsByTagName('MovieYear'): sub['MovieYear'] = entry.getElementsByTagName('MovieYear')[0].firstChild.data if entry.getElementsByTagName('MovieImdbRating'): sub['MovieImdbRating'] = entry.getElementsByTagName('MovieImdbRating')[0].firstChild.data if entry.getElementsByTagName('MovieImdbID'): sub['MovieImdbID'] = entry.getElementsByTagName('MovieImdbID')[0].firstChild.data if entry.getElementsByTagName('SubAuthorComment'): try: sub['SubAuthorComment'] = entry.getElementsByTagName('SubAuthorComment')[0].firstChild.data except AttributeError: sub['SubAuthorComment'] = entry.getElementsByTagName('SubAuthorComment')[0].firstChild if entry.getElementsByTagName('ISO639'): sub['ISO639'] = { 'ISO639': entry.getElementsByTagName('ISO639')[0].firstChild.data, 'LinkSearch': entry.getElementsByTagName('ISO639')[0].getAttribute('LinkSearch'), 'flag': entry.getElementsByTagName('ISO639')[0].getAttribute('flag'), } sub_obj._languageXX = sub['ISO639']['ISO639'] if entry.getElementsByTagName('LanguageName'): sub['LanguageName'] = entry.getElementsByTagName('LanguageName')[0].firstChild.data sub_obj._languageName = sub['LanguageName'] if entry.getElementsByTagName('SubFormat'): sub['SubFormat'] = entry.getElementsByTagName('SubFormat')[0].firstChild.data if entry.getElementsByTagName('SubSumCD'): sub['SubSumCD'] = entry.getElementsByTagName('SubSumCD')[0].firstChild.data if entry.getElementsByTagName('SubAddDate'): sub['SubAddDate'] = entry.getElementsByTagName('SubAddDate')[0].firstChild.data if entry.getElementsByTagName('SubBad'): sub['SubBad'] = entry.getElementsByTagName('SubBad')[0].firstChild.data if entry.getElementsByTagName('SubRating'): sub['SubRating'] = entry.getElementsByTagName('SubRating')[0].firstChild.data if entry.getElementsByTagName('SubDownloadsCnt'): sub['SubDownloadsCnt'] = entry.getElementsByTagName('SubDownloadsCnt')[0].firstChild.data if entry.getElementsByTagName('SubMovieAka'): sub['SubMovieAka'] = entry.getElementsByTagName('SubMovieAka')[0].firstChild.data if entry.getElementsByTagName('SubDate'): sub['SubDate'] = entry.getElementsByTagName('SubDate')[0].firstChild.data if entry.getElementsByTagName('SubComments'): sub['SubComments'] = entry.getElementsByTagName('SubComments')[0].firstChild.data if entry.getElementsByTagName('TotalSubs'): sub['TotalSubs'] = entry.getElementsByTagName('TotalSubs')[0].firstChild.data if entry.getElementsByTagName('Newest'): sub['Newest'] = entry.getElementsByTagName('Newest')[0].firstChild.data if sub: #result_entries.append(sub) movie = Movie(sub) if sub_obj.id: movie.subtitles.append(sub_obj) result_entries.append(movie) except IndexError, e: pass return result_entries | f4a0b5c76f2474a74fe101030a960e622bef3d59 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1108/f4a0b5c76f2474a74fe101030a960e622bef3d59/search.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
4717,
12,
2890,
16,
1831,
67,
2902,
4672,
3536,
3201,
326,
2025,
471,
327,
279,
666,
434,
16176,
3007,
30,
306,
282,
13666,
734,
1676,
2649,
4278,
296,
11351,
2187,
296,
2098,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
4717,
12,
2890,
16,
1831,
67,
2902,
4672,
3536,
3201,
326,
2025,
471,
327,
279,
666,
434,
16176,
3007,
30,
306,
282,
13666,
734,
1676,
2649,
4278,
296,
11351,
2187,
296,
2098,
... |
sio.write(' <table border="0" cellpadding="0" cellspacing="0">\n') sio.write(' <tr><th class="navbar" align="center">\n') | sio.write(' <table border="0" cellpadding="0" cellspacing=') sio.write('"0">\n <tr><th class="navbar" align="center">\n') | def _write_navbar(self, public, private, where=None, top=0): """ @return: The HTML code for a navigation bar on the given type of page. The navigation bar typically looks like:: [ Package Module Class Tree Index Help ] @rtype: C{string} @param where: An identifier indicating what page we're creating a navigation bar for. This is either a UID (for an object documentation page); or one of the strings C{'tree'}, C{'index'}, and C{'help'}. @type where: C{UID} or C{string} @param top: Whether this is the navigation bar at the top of the page. @type top: C{boolean} """ sio = StringIO() sio.write(self._start_of('Navbar')) sio.write('<table class="navbar" border="0" width="100%"') sio.write(' cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\n') sio.write(' <tr valign="center">\n') | 21a6d8c30a29a133335836c07a6da6e2f0b95f2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/21a6d8c30a29a133335836c07a6da6e2f0b95f2a/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2626,
67,
11589,
3215,
12,
2890,
16,
1071,
16,
3238,
16,
1625,
33,
7036,
16,
1760,
33,
20,
4672,
3536,
632,
2463,
30,
1021,
3982,
981,
364,
279,
10394,
4653,
603,
326,
864,
618,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2626,
67,
11589,
3215,
12,
2890,
16,
1071,
16,
3238,
16,
1625,
33,
7036,
16,
1760,
33,
20,
4672,
3536,
632,
2463,
30,
1021,
3982,
981,
364,
279,
10394,
4653,
603,
326,
864,
618,
... |
def add_node(self, node): | def add_node(self, node, **kwds): | def add_node(self, node): nodes._add_node_class_names([node.__name__]) | b7b483d01f030353be72334a37f5c2153d6c3ffd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5532/b7b483d01f030353be72334a37f5c2153d6c3ffd/application.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
2159,
12,
2890,
16,
756,
16,
2826,
25577,
4672,
2199,
6315,
1289,
67,
2159,
67,
1106,
67,
1973,
3816,
2159,
16186,
529,
972,
5717,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
2159,
12,
2890,
16,
756,
16,
2826,
25577,
4672,
2199,
6315,
1289,
67,
2159,
67,
1106,
67,
1973,
3816,
2159,
16186,
529,
972,
5717,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
"""Returns maximum exponent (= Emin - prec + 1)""" | """Returns maximum exponent (= Emax - prec + 1)""" | def Etop(self): """Returns maximum exponent (= Emin - prec + 1)""" return int(self.Emax - self.prec + 1) | e0f1581babe682552d7eadc4e54636b1c2775f0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e0f1581babe682552d7eadc4e54636b1c2775f0b/decimal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
512,
3669,
12,
2890,
4672,
3536,
1356,
4207,
9100,
261,
33,
512,
1896,
300,
13382,
397,
404,
15574,
327,
509,
12,
2890,
18,
1514,
651,
300,
365,
18,
4036,
397,
404,
13,
2,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
512,
3669,
12,
2890,
4672,
3536,
1356,
4207,
9100,
261,
33,
512,
1896,
300,
13382,
397,
404,
15574,
327,
509,
12,
2890,
18,
1514,
651,
300,
365,
18,
4036,
397,
404,
13,
2,
-100,
-100,
... |
LEShortField("beacon_interval", 0x6400), | LEShortField("beacon_interval", 0x0064), | def unwep(self, key=None, warn=1): if self.FCfield & 0x40 == 0: if warn: warning("No WEP to remove") return if isinstance(self.payload.payload, NoPayload): if key or conf.wepkey: self.payload.decrypt(key) if isinstance(self.payload.payload, NoPayload): if warn: warning("Dot11 can't be decrypted. Check conf.wepkey.") return self.FCfield &= ~0x40 self.payload=self.payload.payload | 9e997e264462646e694ada714420b482033b3cd6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7311/9e997e264462646e694ada714420b482033b3cd6/scapy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
640,
91,
881,
12,
2890,
16,
498,
33,
7036,
16,
1894,
33,
21,
4672,
309,
365,
18,
4488,
1518,
473,
374,
92,
7132,
422,
374,
30,
309,
1894,
30,
3436,
2932,
2279,
678,
10541,
358,
1206,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
640,
91,
881,
12,
2890,
16,
498,
33,
7036,
16,
1894,
33,
21,
4672,
309,
365,
18,
4488,
1518,
473,
374,
92,
7132,
422,
374,
30,
309,
1894,
30,
3436,
2932,
2279,
678,
10541,
358,
1206,... |
if (prj.Project().original_orientation == const.AXIAL): | if (prj.Project().original_orientation == const.CORONAL): flip_image = False else: | def AddNewActor(self, pubsub_evt): """ Create surface actor, save into project and send it to viewer. """ surface_data = pubsub_evt.data | a2f19a0049d9ec69b97156cc0d72d3f341354750 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10228/a2f19a0049d9ec69b97156cc0d72d3f341354750/surface.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1436,
1908,
17876,
12,
2890,
16,
23288,
67,
73,
11734,
4672,
3536,
1788,
9034,
8327,
16,
1923,
1368,
1984,
471,
1366,
518,
358,
14157,
18,
3536,
9034,
67,
892,
273,
23288,
67,
73,
11734,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1436,
1908,
17876,
12,
2890,
16,
23288,
67,
73,
11734,
4672,
3536,
1788,
9034,
8327,
16,
1923,
1368,
1984,
471,
1366,
518,
358,
14157,
18,
3536,
9034,
67,
892,
273,
23288,
67,
73,
11734,... |
class TestPipelineView(unittest.TestCase): | import gui.utils class TestPipelineView(gui.utils.TestVisTrailsGUI): | def setQueryEnabled(self, on): QInteractiveGraphicsView.setQueryEnabled(self, on) if not self.scene().noUpdate and self.scene().controller: self.scene().setupScene(self.scene().controller.current_pipeline) | e4ead7bf32ad908f515d667df8a5b9e728ab1253 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6341/e4ead7bf32ad908f515d667df8a5b9e728ab1253/pipeline_view.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15682,
1526,
12,
2890,
16,
603,
4672,
2238,
26442,
17558,
1767,
18,
542,
1138,
1526,
12,
2890,
16,
603,
13,
309,
486,
365,
18,
23694,
7675,
2135,
1891,
471,
365,
18,
23694,
7675,
5723,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15682,
1526,
12,
2890,
16,
603,
4672,
2238,
26442,
17558,
1767,
18,
542,
1138,
1526,
12,
2890,
16,
603,
13,
309,
486,
365,
18,
23694,
7675,
2135,
1891,
471,
365,
18,
23694,
7675,
5723,
... |
self.assert_(msg.get_labels() == ['filed', 'resent']) | self.assertEqual(msg.get_labels(), ['filed', 'resent']) | def test_labels(self): # Get, set, join, and leave labels msg = mailbox.BabylMessage(_sample_message) self.assertEqual(msg.get_labels(), []) msg.set_labels(['foobar']) self.assertEqual(msg.get_labels(), ['foobar']) msg.set_labels([]) self.assertEqual(msg.get_labels(), []) msg.add_label('filed') self.assertEqual(msg.get_labels(), ['filed']) msg.add_label('resent') self.assert_(msg.get_labels() == ['filed', 'resent']) msg.add_label('resent') self.assert_(msg.get_labels() == ['filed', 'resent']) msg.remove_label('filed') self.assertEqual(msg.get_labels(), ['resent']) msg.add_label('foobar') self.assert_(msg.get_labels() == ['resent', 'foobar']) msg.remove_label('unseen') self.assert_(msg.get_labels() == ['resent', 'foobar']) msg.set_labels(['foobar', 'answered']) self.assert_(msg.get_labels() == ['foobar', 'answered']) | ea8344797e1a0ebd0b419ce14e16ab25af771fcc /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/ea8344797e1a0ebd0b419ce14e16ab25af771fcc/test_mailbox.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5336,
12,
2890,
4672,
468,
968,
16,
444,
16,
1233,
16,
471,
8851,
3249,
1234,
273,
14187,
18,
38,
24383,
80,
1079,
24899,
6358,
67,
2150,
13,
365,
18,
11231,
5812,
12,
3576,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5336,
12,
2890,
4672,
468,
968,
16,
444,
16,
1233,
16,
471,
8851,
3249,
1234,
273,
14187,
18,
38,
24383,
80,
1079,
24899,
6358,
67,
2150,
13,
365,
18,
11231,
5812,
12,
3576,
... |
page = request.query['file'] | self.page = request.query['file'] | def _render(self, request): if request.query.has_key('file'): page = request.query['file'] else: page = 'Index.html' | e908328c6d4929538bca0097bd45da90e1c04b13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/e908328c6d4929538bca0097bd45da90e1c04b13/doc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5902,
12,
2890,
16,
590,
4672,
309,
590,
18,
2271,
18,
5332,
67,
856,
2668,
768,
11,
4672,
365,
18,
2433,
273,
590,
18,
2271,
3292,
768,
3546,
469,
30,
1363,
273,
296,
1016,
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,
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,
5902,
12,
2890,
16,
590,
4672,
309,
590,
18,
2271,
18,
5332,
67,
856,
2668,
768,
11,
4672,
365,
18,
2433,
273,
590,
18,
2271,
3292,
768,
3546,
469,
30,
1363,
273,
296,
1016,
18,... |
subprocess.call(["java", "-Xmx", "2048m", "-cp", "../../../../py4j-java/bin/", "py4j.EchoServer"]) | subprocess.call(["java", "-cp", "../../../../py4j-java/bin/", "py4j.EchoServer"]) | def start_echo_server(): subprocess.call(["java", "-Xmx", "2048m", "-cp", "../../../../py4j-java/bin/", "py4j.EchoServer"]) | 939e96f34eea9288f39c9ebf0af31d6a35de7187 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14200/939e96f34eea9288f39c9ebf0af31d6a35de7187/java_gateway_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
67,
12946,
67,
3567,
13332,
6652,
18,
1991,
3816,
6,
6290,
3113,
3701,
4057,
3113,
315,
16644,
16644,
2074,
24,
78,
17,
6290,
19,
4757,
19,
3113,
315,
2074,
24,
78,
18,
19704,
208... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
67,
12946,
67,
3567,
13332,
6652,
18,
1991,
3816,
6,
6290,
3113,
3701,
4057,
3113,
315,
16644,
16644,
2074,
24,
78,
17,
6290,
19,
4757,
19,
3113,
315,
2074,
24,
78,
18,
19704,
208... |
notebook.save() | notebook.quit_idle_worksheet_processes() | def notebook_idle_check(): notebook.quit_idle_worksheet_processes() global last_idle_time t = walltime() if t > last_idle_time + idle_interval: notebook.save() last_idle_time = t | 97e41df74bc11e6a07770a464910d5dad31f5523 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/97e41df74bc11e6a07770a464910d5dad31f5523/twist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14718,
67,
20390,
67,
1893,
13332,
14718,
18,
27176,
67,
20390,
67,
1252,
8118,
67,
18675,
1435,
2552,
1142,
67,
20390,
67,
957,
268,
273,
17662,
957,
1435,
309,
268,
405,
1142,
67,
2039... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14718,
67,
20390,
67,
1893,
13332,
14718,
18,
27176,
67,
20390,
67,
1252,
8118,
67,
18675,
1435,
2552,
1142,
67,
20390,
67,
957,
268,
273,
17662,
957,
1435,
309,
268,
405,
1142,
67,
2039... |
self.phonebook.save() print >> stdout, _('The entry was saved.') | try: self.phonebook.save() print >> stdout, _('The entry was saved.') except Exception, exp: msg = (exp.strerror if isinstance(exp, EnvironmentError) else exp.message) sys.exit(_('Couldn\'t save the phonebook: %s') % msg) | def edit_entries(self, entries): """Allows interactive editing of entries. If `new` is True, `entry` is identified as new entry""" editor = ConsoleEntryEditor(self.phonebook.supported_fields(), bool(entries[0].parent)) for entry in entries: entry = editor.edit(entry) # check if the user wants to add an empty entry if not entry: question = _('Do you really want to save an emtpy entry?') if not yes_no_question(question): # abort without saving print >> stdout, _('The entry is not saved.') return if entry.parent is None: self.phonebook.add(entry) self.phonebook.save() print >> stdout, _('The entry was saved.') | b5689c1a03356eeb35beeb678f9649fa8fd57715 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2215/b5689c1a03356eeb35beeb678f9649fa8fd57715/tel_console.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3874,
67,
8219,
12,
2890,
16,
3222,
4672,
3536,
19132,
12625,
15755,
434,
3222,
18,
971,
1375,
2704,
68,
353,
1053,
16,
1375,
4099,
68,
353,
9283,
487,
394,
1241,
8395,
4858,
273,
9657,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3874,
67,
8219,
12,
2890,
16,
3222,
4672,
3536,
19132,
12625,
15755,
434,
3222,
18,
971,
1375,
2704,
68,
353,
1053,
16,
1375,
4099,
68,
353,
9283,
487,
394,
1241,
8395,
4858,
273,
9657,
... |
self.assertEqual('<build build="1" config="test"' | self.assertEqual('<build build="1" config="test" name="hal"' | def test_initiate_build(self): config = BuildConfig(self.env, 'test', path='somepath', active=True, recipe='<build></build>') config.insert() platform = TargetPlatform(self.env, config='test', name="Unix") platform.rules.append(('family', 'posix')) platform.insert() build = Build(self.env, 'test', '123', platform.id, slave='hal', rev_time=42) build.insert() | 4d52b7d1a9bcfafde75b6ab4ea0b81428d760da0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4547/4d52b7d1a9bcfafde75b6ab4ea0b81428d760da0/master.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2738,
3840,
67,
3510,
12,
2890,
4672,
642,
273,
3998,
809,
12,
2890,
18,
3074,
16,
296,
3813,
2187,
589,
2218,
19068,
803,
2187,
2695,
33,
5510,
16,
16100,
2218,
32,
3510,
46... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2738,
3840,
67,
3510,
12,
2890,
4672,
642,
273,
3998,
809,
12,
2890,
18,
3074,
16,
296,
3813,
2187,
589,
2218,
19068,
803,
2187,
2695,
33,
5510,
16,
16100,
2218,
32,
3510,
46... |
SyntaxError: assignment to None (<doctest test.test_syntax[18]>, line 1) | SyntaxError: assignment to None (<doctest test.test_syntax[19]>, line 1) | >>> def None(x): | 70e76ec773b0317f9a87ce674bacec91d8b5bdac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/70e76ec773b0317f9a87ce674bacec91d8b5bdac/test_syntax.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4080,
1652,
599,
12,
92,
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,... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4080,
1652,
599,
12,
92,
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... |
except OSError: | except (OSError, DestinationExistsError): | def __init__(self, root_path, thread_synchronize=_thread_synchronize_default, encoding=None, create=False, dir_mode=0700): """ Creates an FS object that represents the OS Filesystem under a given root path | 60e0fafeb3319c1b808c38fc5a58cd773b61ad13 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5579/60e0fafeb3319c1b808c38fc5a58cd773b61ad13/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1365,
67,
803,
16,
2650,
67,
87,
2600,
554,
33,
67,
5930,
67,
87,
2600,
554,
67,
1886,
16,
2688,
33,
7036,
16,
752,
33,
8381,
16,
1577,
67,
3188,
33,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1365,
67,
803,
16,
2650,
67,
87,
2600,
554,
33,
67,
5930,
67,
87,
2600,
554,
67,
1886,
16,
2688,
33,
7036,
16,
752,
33,
8381,
16,
1577,
67,
3188,
33,... |
prompt = "Email (login for uploading to %s): " % options.server email = raw_input(prompt).strip() | email = GetEmail() | def GetUserCredentials(): """Prompts the user for a username and password.""" email = options.email if email is None: prompt = "Email (login for uploading to %s): " % options.server email = raw_input(prompt).strip() password = getpass.getpass("Password for %s: " % email) return (email, password) | a4327d5e68e86191e9ae4afe9ae46d77cdde38ab /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/476/a4327d5e68e86191e9ae4afe9ae46d77cdde38ab/upload.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17330,
6163,
13332,
3536,
13224,
1092,
326,
729,
364,
279,
2718,
471,
2201,
12123,
2699,
273,
702,
18,
3652,
309,
2699,
353,
599,
30,
2699,
273,
968,
4134,
1435,
2201,
273,
31889,
18,
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,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17330,
6163,
13332,
3536,
13224,
1092,
326,
729,
364,
279,
2718,
471,
2201,
12123,
2699,
273,
702,
18,
3652,
309,
2699,
353,
599,
30,
2699,
273,
968,
4134,
1435,
2201,
273,
31889,
18,
58... |
scroll_position_percent=(self.scroller_position-scroller_width/2)/(box_height-scroller_width -margin) | print scroll_position_percent | def do_allocate(self, box, flags): box_width = box.x2 - box.x1 box_height = box.y2 - box.y1 margin = box_width/8 scroller_width = box_width - 2*margin bar_width = box_width/4 bar_height = box_height - 2*margin - scroller_width bar_box = clutter.ActorBox() bar_box.x1 = box_width/2 -bar_width/2 bar_box.y1 = margin + scroller_width/2 bar_box.x2 = bar_box.x1 + bar_width bar_box.y2 = bar_box.y1 + bar_height self.scrollbar_background.allocate(bar_box, flags) scroller_box=clutter.ActorBox() scroller_box.x1 = margin scroller_box.x2 = scroller_box.x1 + scroller_width if self.scroller_position >= box_height-scroller_width +margin : self.scroller_position = box_height-scroller_width +margin if self.scroller_position <= scroller_width/2 : self.scroller_position = scroller_width/2 scroller_box.y1 = self.scroller_position - scroller_width/2 + margin scroller_box.y2 = scroller_box.y1 + scroller_width self.scroller.allocate(scroller_box,flags) scroll_position_percent=(self.scroller_position-scroller_width/2)/(box_height-scroller_width -margin) self.emit("scroll_position",scroll_position_percent) clutter.Actor.do_allocate(self, box, flags) | cd06c85963fa1a4bc894d0804dc749d386be269a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5279/cd06c85963fa1a4bc894d0804dc749d386be269a/scrollbar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
16247,
12,
2890,
16,
3919,
16,
2943,
4672,
3919,
67,
2819,
273,
3919,
18,
92,
22,
300,
3919,
18,
92,
21,
3919,
67,
4210,
273,
3919,
18,
93,
22,
300,
3919,
18,
93,
21,
7333... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16247,
12,
2890,
16,
3919,
16,
2943,
4672,
3919,
67,
2819,
273,
3919,
18,
92,
22,
300,
3919,
18,
92,
21,
3919,
67,
4210,
273,
3919,
18,
93,
22,
300,
3919,
18,
93,
21,
7333... |
Torsion subgroup of Jacobian of the modular curve associated to the congruence subgroup Gamma0(42) | Torsion subgroup of Abelian variety J0(42) of dimension 5 | def field_of_definition(self): """ Return the field over which this finite modular abelian variety subgroup is defined. This is a field over which this subgroup is defined. | d54847b81567aa533334316a466ed6bddbc8638c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/d54847b81567aa533334316a466ed6bddbc8638c/finite_subgroup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
652,
67,
792,
67,
6907,
12,
2890,
4672,
3536,
2000,
326,
652,
1879,
1492,
333,
25922,
681,
2490,
1223,
292,
2779,
1394,
14369,
720,
1655,
353,
2553,
18,
225,
1220,
353,
279,
652,
1879,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
652,
67,
792,
67,
6907,
12,
2890,
4672,
3536,
2000,
326,
652,
1879,
1492,
333,
25922,
681,
2490,
1223,
292,
2779,
1394,
14369,
720,
1655,
353,
2553,
18,
225,
1220,
353,
279,
652,
1879,
... |
methods = self.getMethods(testClass, self.methodPrefix) | methods = [getattr(testClass, "%s%s" % (self.methodPrefix, name)) for name in reflect.prefixedMethodNames(testClass, self.methodPrefix)] | def addTestClass(self, testClass): methods = self.getMethods(testClass, self.methodPrefix) self.testClasses[testClass] = methods self.numTests += len(methods) | cda423dace2f415c004d440ac2e382fc93a8b875 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cda423dace2f415c004d440ac2e382fc93a8b875/unittest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
4709,
797,
12,
2890,
16,
1842,
797,
4672,
2590,
273,
306,
588,
1747,
12,
3813,
797,
16,
2213,
87,
9,
87,
6,
738,
261,
2890,
18,
2039,
2244,
16,
508,
3719,
364,
508,
316,
3037,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4709,
797,
12,
2890,
16,
1842,
797,
4672,
2590,
273,
306,
588,
1747,
12,
3813,
797,
16,
2213,
87,
9,
87,
6,
738,
261,
2890,
18,
2039,
2244,
16,
508,
3719,
364,
508,
316,
3037,
... |
assert test.run( ) == test.expected_result() | assert test.run( local=1 ) == test.expected_result() | def expected_result( self ): """ Precalculated result to check for consistent performance. | 02a455f47c314ceb98f0e0522a8ade5743692ac6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/482/02a455f47c314ceb98f0e0522a8ade5743692ac6/SettingsManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2665,
67,
2088,
12,
365,
262,
30,
3536,
2962,
22113,
563,
358,
866,
364,
11071,
9239,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2665,
67,
2088,
12,
365,
262,
30,
3536,
2962,
22113,
563,
358,
866,
364,
11071,
9239,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
labelId = '' | labelId = None | def addAcl(self, userGroup, trovePattern, label, write, capped, admin): cu = self.db.cursor() | 26f4f246a1a3cefb1f833223a913259960f2efca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/26f4f246a1a3cefb1f833223a913259960f2efca/netauth.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
13538,
12,
2890,
16,
26205,
16,
23432,
537,
3234,
16,
1433,
16,
1045,
16,
3523,
1845,
16,
3981,
4672,
15985,
273,
365,
18,
1966,
18,
9216,
1435,
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,
0,
0,
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,
527,
13538,
12,
2890,
16,
26205,
16,
23432,
537,
3234,
16,
1433,
16,
1045,
16,
3523,
1845,
16,
3981,
4672,
15985,
273,
365,
18,
1966,
18,
9216,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-... |
except Exception, e: | except Exception: | def download(self, cr, uid, ids, download=True, context=None): res = [] for mod in self.browse(cr, uid, ids, context=context): if not mod.url: continue match = re.search('-([a-zA-Z0-9\._-]+)(\.zip)', mod.url, re.I) version = '0' if match: version = match.group(1) if parse_version(mod.installed_version or '0') >= parse_version(version): continue res.append(mod.url) if not download: continue zipfile = urllib.urlopen(mod.url).read() fname = addons.get_module_path(str(mod.name)+'.zip', downloaded=True) try: fp = file(fname, 'wb') fp.write(zipfile) fp.close() except Exception, e: raise orm.except_orm(_('Error'), _('Can not create the module file:\n %s') % (fname,)) terp = self.get_module_info(mod.name) self.write(cr, uid, mod.id, self.get_values_from_terp(terp)) cr.execute('DELETE FROM ir_module_module_dependency ' \ 'WHERE module_id = %s', (mod.id,)) self._update_dependencies(cr, uid, mod.id, terp.get('depends', [])) self._update_category(cr, uid, mod.id, terp.get('category', 'Uncategorized')) # Import module zimp = zipimport.zipimporter(fname) zimp.load_module(mod.name) return res | 730258f248b6a08b04547d31b09884c337625d39 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/730258f248b6a08b04547d31b09884c337625d39/module.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4224,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
4224,
33,
5510,
16,
819,
33,
7036,
4672,
400,
273,
5378,
364,
681,
316,
365,
18,
25731,
12,
3353,
16,
4555,
16,
3258,
16,
819,
33,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4224,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
4224,
33,
5510,
16,
819,
33,
7036,
4672,
400,
273,
5378,
364,
681,
316,
365,
18,
25731,
12,
3353,
16,
4555,
16,
3258,
16,
819,
33,
... |
if df: return DataForm(node=df) | if df: con.Event(NS_REGISTER,REGISTER_DATA_RECEIVED,(agent, DataForm(node=df))) return | def getRegInfo(disp,host,info={}): """ Gets registration form from remote host. You can pre-fill the info dictionary. F.e. if you are requesting info on registering user joey than specify info as {'username':'joey'}. See JEP-0077 for details. 'disp' must be connected dispatcher instance.""" iq=Iq('get',NS_REGISTER,to=host) for i in info.keys(): iq.setTagData(i,info[i]) resp=disp.SendAndWaitForResponse(iq) if not isResultNode(resp): return df=resp.getTag('query',namespace=NS_REGISTER).getTag('x',namespace=NS_DATA) if df: return DataForm(node=df) df=DataForm(typ='form') for i in resp.getQueryPayload(): if type(i)<>type(iq): pass elif i.getName()=='instructions': df.addInstructions(i.getData()) else: df.setField(i.getName()).setValue(i.getData()) return df | 594dd948068e8f3471b40a60454614aaf6ff2681 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7194/594dd948068e8f3471b40a60454614aaf6ff2681/features.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
1617,
966,
12,
25453,
16,
2564,
16,
1376,
12938,
4672,
3536,
11881,
7914,
646,
628,
2632,
1479,
18,
4554,
848,
675,
17,
5935,
326,
1123,
3880,
18,
478,
18,
73,
18,
309,
1846,
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,
336,
1617,
966,
12,
25453,
16,
2564,
16,
1376,
12938,
4672,
3536,
11881,
7914,
646,
628,
2632,
1479,
18,
4554,
848,
675,
17,
5935,
326,
1123,
3880,
18,
478,
18,
73,
18,
309,
1846,
854,... |
pDict = dict( cgi.parse_qsl( params ) ) return ( config[ 'routes.map' ].match( ref ), pDict ) | pDict = dict( cgi.parse_qsl( params ) ) if not ref: ref = "/" return ( config[ 'routes.map' ].match( ref ), pDict ) | def __mapReferer(self): ref = request.environ[ 'HTTP_REFERER' ] ref = ref[ ref.find( "/", 8 ) : ] scriptName = request.environ[ 'SCRIPT_NAME' ] if scriptName: if scriptName[0] != "/": scriptName = "/%s" % scriptName if ref.find( scriptName ) == 0: ref = ref[ len( scriptName ): ] pI = ref.find( '?' ); if pI > -1: params = ref[ pI+1: ] ref = ref[ :pI ] else: params = "" pDict = dict( cgi.parse_qsl( params ) ) return ( config[ 'routes.map' ].match( ref ), pDict ) | a808837c8f1431d1e02fdbb67a8e5983086333a2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12767/a808837c8f1431d1e02fdbb67a8e5983086333a2/userdata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1458,
426,
18459,
12,
2890,
4672,
1278,
273,
590,
18,
28684,
63,
296,
3693,
67,
30269,
654,
11,
308,
1278,
273,
1278,
63,
1278,
18,
4720,
12,
2206,
3113,
1725,
262,
294,
308,
310... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1458,
426,
18459,
12,
2890,
4672,
1278,
273,
590,
18,
28684,
63,
296,
3693,
67,
30269,
654,
11,
308,
1278,
273,
1278,
63,
1278,
18,
4720,
12,
2206,
3113,
1725,
262,
294,
308,
310... |
def create_commIDs(self): | def getCommIDs(self): | def create_commIDs(self): """Construct commIDs. | 07a4e0910f488d81815bfe40d93278299c901a6d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/768/07a4e0910f488d81815bfe40d93278299c901a6d/communities.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12136,
5103,
12,
2890,
4672,
3536,
7249,
1543,
5103,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
336,
12136,
5103,
12,
2890,
4672,
3536,
7249,
1543,
5103,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
out(' <td width="33%" class="index">') | out(' <td width="33%" class="link-index">') | def write_index_section(self, out, items, add_blankline=False): out('<table class="index" width="100%" border="1">\n') num_rows = (len(items)+2)/3 for row in range(num_rows): out(' <tr>\n') for col in range(3): out(' <td width="33%" class="index">') i = col*num_rows+row if i < len(items): name, url, container = items[col*num_rows+row] out('<a href="%s">%s</a>' % (url, name)) if container is not None: out('<br />\n ') out('<font size="-2">(in %s)</font>' % self.href(container)) else: out(' ') out('</td>\n') out(' </tr>\n') if add_blankline and num_rows == 1: out(' <tr>'+3*'<td class="index"> </td>'+'</tr>\n') out('</table>\n') | 5c410b5b6e25df3bdbc6da266f7773518165cb02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/5c410b5b6e25df3bdbc6da266f7773518165cb02/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
1615,
67,
3464,
12,
2890,
16,
596,
16,
1516,
16,
527,
67,
12111,
1369,
33,
8381,
4672,
596,
2668,
32,
2121,
667,
1546,
1615,
6,
1835,
1546,
6625,
16407,
5795,
1546,
21,
6,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
1615,
67,
3464,
12,
2890,
16,
596,
16,
1516,
16,
527,
67,
12111,
1369,
33,
8381,
4672,
596,
2668,
32,
2121,
667,
1546,
1615,
6,
1835,
1546,
6625,
16407,
5795,
1546,
21,
6,
... |
self.body.append('<dt>%s</dt>\n' % self.language.labels[name]) self.body.append(self.starttag(node, 'dd', '')) | self.body.append('<dt class="%s">%s</dt>\n' % (name, self.language.labels[name])) self.body.append(self.starttag(node, 'dd', '', CLASS=name)) | def visit_docinfo_item(self, node, name, meta=1): if meta: meta_tag = '<meta name="%s" content="%s" />\n' \ % (name, self.attval(node.astext())) self.add_meta(meta_tag) self.body.append('<dt>%s</dt>\n' % self.language.labels[name]) self.body.append(self.starttag(node, 'dd', '')) | 3bb6a9d86cc8f92d3328f082abb907bdeb9739ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5620/3bb6a9d86cc8f92d3328f082abb907bdeb9739ab/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
2434,
1376,
67,
1726,
12,
2890,
16,
756,
16,
508,
16,
2191,
33,
21,
4672,
309,
2191,
30,
2191,
67,
2692,
273,
2368,
3901,
508,
11613,
87,
6,
913,
11613,
87,
6,
342,
5333,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
2434,
1376,
67,
1726,
12,
2890,
16,
756,
16,
508,
16,
2191,
33,
21,
4672,
309,
2191,
30,
2191,
67,
2692,
273,
2368,
3901,
508,
11613,
87,
6,
913,
11613,
87,
6,
342,
5333,
... |
self._show_private = 0 self._write_css(directory) self._write_help(directory) | def write(self, directory, verbose=1): """Write the documentation to the given directory.""" if directory in ('', None): directory = './' if directory[-1] != '/': directory = directory + '/' self._show_both = 0 str = self._tree_to_html() open(directory+'epydoc-tree.html', 'w').write(str) | 29127a15ecd548178da747376d81226f0a835ef6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/29127a15ecd548178da747376d81226f0a835ef6/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
1867,
16,
3988,
33,
21,
4672,
3536,
3067,
326,
7323,
358,
326,
864,
1867,
12123,
309,
1867,
316,
7707,
2187,
599,
4672,
1867,
273,
26544,
309,
1867,
18919,
21,
65,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
1867,
16,
3988,
33,
21,
4672,
3536,
3067,
326,
7323,
358,
326,
864,
1867,
12123,
309,
1867,
316,
7707,
2187,
599,
4672,
1867,
273,
26544,
309,
1867,
18919,
21,
65,
... | |
x = np.array([1,2,3], dtype='<i8') | x = np.array([1,2,3], dtype='<q') | def test_roundtrip(self): x = np.array([1,2,3,4,5], dtype='i4') self._check_roundtrip(x) | 8e50ad6e4f3cd6dd80372475771fcf28bf700127 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14925/8e50ad6e4f3cd6dd80372475771fcf28bf700127/test_multiarray.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2260,
25125,
12,
2890,
4672,
619,
273,
1130,
18,
1126,
3816,
21,
16,
22,
16,
23,
16,
24,
16,
25,
6487,
3182,
2218,
77,
24,
6134,
365,
6315,
1893,
67,
2260,
25125,
12,
92,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2260,
25125,
12,
2890,
4672,
619,
273,
1130,
18,
1126,
3816,
21,
16,
22,
16,
23,
16,
24,
16,
25,
6487,
3182,
2218,
77,
24,
6134,
365,
6315,
1893,
67,
2260,
25125,
12,
92,
... |
res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, r2.left(), r2.top(), 21, 21, loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, 'epgclock-fs8.png')))) res.append((eListboxPythonMultiContent.TYPE_TEXT, r2.left() + 25, r2.top(), r2.width(), r2.height(), 0, RT_HALIGN_LEFT, EventName)) else: res.append((eListboxPythonMultiContent.TYPE_TEXT, r2.left(), r2.top(), r2.width(), r2.height(), 0, RT_HALIGN_LEFT, EventName)) | res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, r3.left(), r3.top(), 21, 21, loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, 'epgclock-fs8.png')))) res.append((eListboxPythonMultiContent.TYPE_TEXT, r3.left() + 25, r3.top(), r3.width(), r3.height(), 0, RT_HALIGN_LEFT, EventName)) else: res.append((eListboxPythonMultiContent.TYPE_TEXT, r3.left(), r3.top(), r3.width(), r3.height(), 0, RT_HALIGN_LEFT, EventName)) | def buildSingleEntry(self, eventId, beginTime, duration, EventName): rec=(self.timer.isInTimer(eventId, beginTime, duration, self.service) > ((duration/10)*8)) r1=self.datetime_rect r2=self.descr_rect res = [ None ] # no private data needed t = localtime(beginTime) res.append((eListboxPythonMultiContent.TYPE_TEXT, r1.left(), r1.top(), r1.width(), r1.height(), 0, RT_HALIGN_RIGHT, "%s %02d.%02d, %02d:%02d"%(self.days[t[6]],t[2],t[1],t[3],t[4]))) if rec: res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, r2.left(), r2.top(), 21, 21, loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, 'epgclock-fs8.png')))) res.append((eListboxPythonMultiContent.TYPE_TEXT, r2.left() + 25, r2.top(), r2.width(), r2.height(), 0, RT_HALIGN_LEFT, EventName)) else: res.append((eListboxPythonMultiContent.TYPE_TEXT, r2.left(), r2.top(), r2.width(), r2.height(), 0, RT_HALIGN_LEFT, EventName)) return res | f509eadbf08d0b7e0d5f369e4ed21a20830ab001 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/f509eadbf08d0b7e0d5f369e4ed21a20830ab001/EpgList.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
5281,
1622,
12,
2890,
16,
26004,
16,
2376,
950,
16,
3734,
16,
2587,
461,
4672,
1950,
28657,
2890,
18,
12542,
18,
291,
382,
6777,
12,
2575,
548,
16,
2376,
950,
16,
3734,
16,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
5281,
1622,
12,
2890,
16,
26004,
16,
2376,
950,
16,
3734,
16,
2587,
461,
4672,
1950,
28657,
2890,
18,
12542,
18,
291,
382,
6777,
12,
2575,
548,
16,
2376,
950,
16,
3734,
16,
365,
... |
this = apply(_quickfix.new_MktOfferPx, args) | this = _quickfix.new_MktOfferPx(*args) | def __init__(self, *args): this = apply(_quickfix.new_MktOfferPx, 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,
49,
8629,
10513,
21776,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
49,
8629,
10513,
21776,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
... |
return S_OK(resdict) | return S_OK(resDict) | def getReplicas(self,path): """ Returns replicas for an LFN or list of LFNs """ if type(path) == types.StringType: lfns = [path] elif type(path) == types.ListType: lfns = path else: return S_ERROR('LFCClient.getReplicas: Must supply a path or list of paths') resdict = {} # If we have less than three lfns to query a session doesn't make sense if len(lfns) > 2: self.__openSession() failed = {} successful = {} for lfn in lfns: fullLfn = '%s%s' % (self.prefix,lfn) value,replicaObjects = lfc.lfc_getreplica(fullLfn,'','') if not (value == 0): errno = lfc.cvar.serrno failed[lfn] = lfc.sstrerror(errno) else: successful[lfn] = {} for replica in replicaObjects: se = replica.host pfn = replica.sfn.strip() successful[lfn][se] = pfn if self.session: self.__closeSession() resDict = {'Failed':failed,'Successful':successful} return S_OK(resdict) | 24878006a97fc6c0a40ff01095f00d930f79b1e6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12864/24878006a97fc6c0a40ff01095f00d930f79b1e6/LcgFileCatalogClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5561,
10528,
12,
2890,
16,
803,
4672,
3536,
2860,
21545,
364,
392,
18803,
50,
578,
666,
434,
18803,
10386,
3536,
309,
618,
12,
803,
13,
422,
1953,
18,
780,
559,
30,
18594,
2387,
273,
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,
5561,
10528,
12,
2890,
16,
803,
4672,
3536,
2860,
21545,
364,
392,
18803,
50,
578,
666,
434,
18803,
10386,
3536,
309,
618,
12,
803,
13,
422,
1953,
18,
780,
559,
30,
18594,
2387,
273,
3... |
elif isinstance(value, int): self.simpleElement("integer", str(value)) | elif isinstance(value, (int, long)): self.simpleElement("integer", "%d" % value) | def writeValue(self, value): if isinstance(value, (str, unicode)): self.simpleElement("string", value) elif isinstance(value, bool): # must switch for bool before int, as bool is a # subclass of int... if value: self.simpleElement("true") else: self.simpleElement("false") elif isinstance(value, int): self.simpleElement("integer", str(value)) elif isinstance(value, float): self.simpleElement("real", repr(value)) elif isinstance(value, dict): self.writeDict(value) elif isinstance(value, Data): self.writeData(value) elif isinstance(value, datetime.datetime): self.simpleElement("date", _dateToString(value)) elif isinstance(value, (tuple, list)): self.writeArray(value) else: raise TypeError("unsuported type: %s" % type(value)) | f854880ee6a81c4c2d7d14fcf1917258fcf24611 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/f854880ee6a81c4c2d7d14fcf1917258fcf24611/plistlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26727,
12,
2890,
16,
460,
4672,
309,
1549,
12,
1132,
16,
261,
701,
16,
5252,
3719,
30,
365,
18,
9647,
1046,
2932,
1080,
3113,
460,
13,
1327,
1549,
12,
1132,
16,
1426,
4672,
468,
1297,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26727,
12,
2890,
16,
460,
4672,
309,
1549,
12,
1132,
16,
261,
701,
16,
5252,
3719,
30,
365,
18,
9647,
1046,
2932,
1080,
3113,
460,
13,
1327,
1549,
12,
1132,
16,
1426,
4672,
468,
1297,
... |
self.debug_trace( "found string %s\n", self.data[start:end]) | def next_string(self): index = self.index while self.data[index] in string.whitespace: index = index + 1 start = index while self.data[index] not in string.whitespace: index = index + 1 end = index self.debug_trace( "found string %s\n", self.data[start:end]) return self.data[start:end] | ecf78c969222f7513a2f516b0355728295fb546a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/675/ecf78c969222f7513a2f516b0355728295fb546a/pxlasm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1024,
67,
1080,
12,
2890,
4672,
770,
273,
365,
18,
1615,
1323,
365,
18,
892,
63,
1615,
65,
316,
533,
18,
18777,
30,
770,
273,
770,
397,
404,
787,
273,
770,
1323,
365,
18,
892,
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,
1024,
67,
1080,
12,
2890,
4672,
770,
273,
365,
18,
1615,
1323,
365,
18,
892,
63,
1615,
65,
316,
533,
18,
18777,
30,
770,
273,
770,
397,
404,
787,
273,
770,
1323,
365,
18,
892,
63,
... | |
dir_name = safe( | dir_name = self.safe( | def read_new_catalogue(self, base): head = base p = 0 #print "Head:", hex(head) dir_seq = self.sectors[head + p] dir_start = self.sectors[head+p+1:head+p+5] if dir_start != 'Nick': print 'Not a directory at '+hex(base) #sys.exit() return '', [] p = p + 5 files = [] while ord(self.sectors[head+p]) != 0: old_name = self.sectors[head+p:head+p+10] top_set = 0 counter = 1 for i in old_name: if (ord(i) & 128) != 0: top_set = counter counter = counter + 1 name = safe(self.sectors[head+p:head+p+10]) #print hex(head+p), name load = str2num(4, self.sectors[head+p+10:head+p+14]) exe = str2num(4, self.sectors[head+p+14:head+p+18]) length = str2num(4, self.sectors[head+p+18:head+p+22]) inddiscadd = read_new_address(self.sectors[head+p+22:head+p+25]) newdiratts = str2num(1, self.sectors[head+p+25]) #print hex(head+p+22), #print "addrs:", map(lambda x: map(hex, x), inddiscadd), #print "atts:", hex(newdiratts) if inddiscadd == -1: if (newdiratts & 0x8) != 0: print "Couldn't"+' find directory, "%s"' % name elif length != 0: print "Couldn't"+' find file, "%s"' % name else: # Store a zero length file. This appears to be the # standard behaviour for storing empty files. files.append([name, "", load, exe, length]) #print hex(head+p), hex(head+p+22) else: if (newdiratts & 0x8) != 0: #print '%s -> %s' % (name, hex(inddiscadd)) # Remember that inddiscadd will be a sequence of # pairs of addresses. #print inddiscadd for start, end in inddiscadd: #print hex(start), hex(end), "-->" # Try to interpret the data at the referenced address # as a directory. lower_dir_name, lower_files = \ read_new_catalogue(start) # Store the directory name and file found therein. files.append([name, lower_files]) else: # Remember that inddiscadd will be a sequence of # pairs of addresses. file = "" remaining = length for start, end in inddiscadd: amount = min(remaining, end - start) file = file + self.sectors[start : (start + amount)] remaining = remaining - amount files.append([name, file, load, exe, length]) p = p + 26 # Go to tail of directory structure (0x800 -- 0xc00) tail = head + self.sector_size dir_end = self.sectors[tail+self.sector_size-5:tail+self.sector_size-1] if dir_end != 'Nick': print 'Discrepancy in directory structure' return '', files dir_name = safe( self.sectors[tail+self.sector_size-16:tail+self.sector_size-6] ) #parent = read_new_address( # self.sectors[tail+self.sector_size-38:tail+self.sector_size-35], dir = 1 # ) #print "This directory:", hex(head), "Parent:", hex(parent) parent = \ self.sectors[tail+self.sector_size-38:tail+self.sector_size-35] #256*str2num( # 3, self.sectors[tail+self.sector_size-38:tail+self.sector_size-35] #) dir_title = \ self.sectors[tail+self.sector_size-35:tail+self.sector_size-16] if head == 0x800 and self.disc_type == 'adE': dir_name = '$' if head == 0xc8800 and self.disc_type == 'adEbig': dir_name = '$' endseq = self.sectors[tail+self.sector_size-6] if endseq != dir_seq: print 'Broken directory' return dir_name, files #print '<--' #print return dir_name, files | 25f0ef7dc7411ab5a651cc7127ed79f5bcd54fc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3059/25f0ef7dc7411ab5a651cc7127ed79f5bcd54fc3/ADF2INF.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
2704,
67,
7199,
344,
12,
2890,
16,
1026,
4672,
225,
910,
273,
1026,
293,
273,
374,
225,
468,
1188,
315,
1414,
2773,
16,
3827,
12,
1978,
13,
225,
1577,
67,
5436,
273,
365,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
2704,
67,
7199,
344,
12,
2890,
16,
1026,
4672,
225,
910,
273,
1026,
293,
273,
374,
225,
468,
1188,
315,
1414,
2773,
16,
3827,
12,
1978,
13,
225,
1577,
67,
5436,
273,
365,
18... |
sage: sage_getfile(sage.misc.sageinspect.sage_getfile) | sage: sage_getfile(sagenb.misc.sageinspect.sage_getfile) | ... def __init__(self): | 4d25713f8b0421c8ec86dac00f7ab1999549be38 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11792/4d25713f8b0421c8ec86dac00f7ab1999549be38/sageinspect.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1372,
377,
1652,
1001,
2738,
972,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1372,
377,
1652,
1001,
2738,
972,
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,
-10... |
11/10 11/10 | (11/10) (11/10) | 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) | 22442234d27ccf460643cc9f5ef327c3f778d61e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/22442234d27ccf460643cc9f5ef327c3f778d61e/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,
... |
self.__logRPCQuery( method, args ) | self.__logRemoteQuery( "RPC/%s" % method, args ) | def __doRPC( self, method ): retVal = self.transport.receiveData() if not retVal[ 'OK' ]: gLogger.error( "Error while receiving function arguments", retVal[ 'Message' ] ) return S_ERROR( "Error while receiving function arguments: %s" % retVal[ 'Message' ] ) args = retVal[ 'Value' ] self.__logRPCQuery( method, args ) return self.__RPCCallFunction( method, args ) | 90f88895f97ff24d1d7094e19bb8265cddf28a66 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12864/90f88895f97ff24d1d7094e19bb8265cddf28a66/RequestHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2896,
8087,
12,
365,
16,
707,
262,
30,
12197,
273,
365,
18,
13049,
18,
18149,
751,
1435,
309,
486,
12197,
63,
296,
3141,
11,
308,
30,
314,
3328,
18,
1636,
12,
315,
668,
1323,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2896,
8087,
12,
365,
16,
707,
262,
30,
12197,
273,
365,
18,
13049,
18,
18149,
751,
1435,
309,
486,
12197,
63,
296,
3141,
11,
308,
30,
314,
3328,
18,
1636,
12,
315,
668,
1323,
1... |
view.disconnect(pasted_id) | def disconnect_handlers(self, view): doc = view.get_buffer() loaded_id, saved_id, pasted_id = doc.get_data("AutoTabPluginHandlerIds") doc.disconnect(loaded_id) doc.disconnect(saved_id) view.disconnect(pasted_id) doc.set_data("AutoTabPluginHandlerIds", None) | 2911cc9f04b21f90c99ed91bdcc4be7f5f55ebca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6065/2911cc9f04b21f90c99ed91bdcc4be7f5f55ebca/autotab.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9479,
67,
11046,
12,
2890,
16,
1476,
4672,
997,
273,
1476,
18,
588,
67,
4106,
1435,
4203,
67,
350,
16,
5198,
67,
350,
16,
8854,
329,
67,
350,
273,
997,
18,
588,
67,
892,
2932,
4965,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9479,
67,
11046,
12,
2890,
16,
1476,
4672,
997,
273,
1476,
18,
588,
67,
4106,
1435,
4203,
67,
350,
16,
5198,
67,
350,
16,
8854,
329,
67,
350,
273,
997,
18,
588,
67,
892,
2932,
4965,
... | |
from twisted.web2 import server, http, static, resource, stream | from twisted.web2 import server, http, static, resource, stream, http_headers, responsecode | def startWebserver(): from twisted.internet import reactor from twisted.web2 import server, http, static, resource, stream import webif class ScreenPage(resource.Resource): def render(self, req): global sessions if sessions == [ ]: return http.Response("please wait until enigma has booted") s = stream.ProducerStream() webif.renderPage(s, req, sessions[0]) # login? return http.Response(stream=s) class Toplevel(resource.Resource): addSlash = True def render(self, req): return 'Hello! you want probably go to <a href="/test">the test</a> instead.' child_test = ScreenPage() # "/test" child_hdd = static.File("/hdd") site = server.Site(Toplevel()) reactor.listenTCP(80, http.HTTPFactory(site)) | 982001658e3e55d320d747717fcf8e56c2cec1b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/982001658e3e55d320d747717fcf8e56c2cec1b6/plugin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
3218,
2266,
502,
13332,
628,
2339,
25444,
18,
267,
14726,
1930,
19178,
628,
2339,
25444,
18,
4875,
22,
1930,
1438,
16,
1062,
16,
760,
16,
1058,
16,
1407,
16,
1062,
67,
2485,
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,
787,
3218,
2266,
502,
13332,
628,
2339,
25444,
18,
267,
14726,
1930,
19178,
628,
2339,
25444,
18,
4875,
22,
1930,
1438,
16,
1062,
16,
760,
16,
1058,
16,
1407,
16,
1062,
67,
2485,
16,
7... |
string = _('%d%%') % (value * 100) return string | string = _('%d%%') % (value * 100) return string def percBase1_2Text(value): value = value-1 string = _('%+d%%') % (value * 100) return string | def perc2Text(value): string = _('%d%%') % (value * 100) return string | 9a9902a37229d43ef77e31dcbdff5314b1d5e059 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10927/9a9902a37229d43ef77e31dcbdff5314b1d5e059/TechInfoDlg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26514,
22,
1528,
12,
1132,
4672,
533,
273,
389,
29909,
72,
11438,
6134,
738,
261,
1132,
380,
2130,
13,
327,
533,
225,
1652,
26514,
2171,
21,
67,
22,
1528,
12,
1132,
4672,
460,
273,
460... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26514,
22,
1528,
12,
1132,
4672,
533,
273,
389,
29909,
72,
11438,
6134,
738,
261,
1132,
380,
2130,
13,
327,
533,
225,
1652,
26514,
2171,
21,
67,
22,
1528,
12,
1132,
4672,
460,
273,
460... |
Returns the inertia degree over the ground ring, i.e. 1. INPUT: self -- a local ring OUTPUT: integer -- the inertia degree of this ring, i.e., 1 | Returns the inertia degree over the ground ring: 1 unless overridden. INPUT: self -- a local ring OUTPUT: integer -- the inertia degree of this ring: 1 unless overridden. | def inertia_degree(self): r""" Returns the inertia degree over the ground ring, i.e. 1. | 4705f54d3a8cb1ec355cf5a3a8189d9c2b64e1ac /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/4705f54d3a8cb1ec355cf5a3a8189d9c2b64e1ac/local_generic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
316,
31449,
67,
21361,
12,
2890,
4672,
436,
8395,
2860,
326,
316,
31449,
10782,
1879,
326,
19209,
9221,
16,
277,
18,
73,
18,
404,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
316,
31449,
67,
21361,
12,
2890,
4672,
436,
8395,
2860,
326,
316,
31449,
10782,
1879,
326,
19209,
9221,
16,
277,
18,
73,
18,
404,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
q = "select londiste.node_add_table(%s, %s)" | q = "select * from londiste.node_add_table(%s, %s)" | def cmd_add(self, args = []): q = "select londiste.node_add_table(%s, %s)" self.db_exec_many(q, [self.set_name], args) | 3e7839157f34bfc1472c4a4ab0ff625c2b8c35cf /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/14597/3e7839157f34bfc1472c4a4ab0ff625c2b8c35cf/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1797,
67,
1289,
12,
2890,
16,
833,
273,
5378,
4672,
1043,
273,
315,
4025,
380,
628,
328,
1434,
376,
73,
18,
2159,
67,
1289,
67,
2121,
9275,
87,
16,
738,
87,
2225,
365,
18,
1966,
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,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1797,
67,
1289,
12,
2890,
16,
833,
273,
5378,
4672,
1043,
273,
315,
4025,
380,
628,
328,
1434,
376,
73,
18,
2159,
67,
1289,
67,
2121,
9275,
87,
16,
738,
87,
2225,
365,
18,
1966,
67,
... |
posx = dirx * (1.0 - fsizex*0.5 - 3*fpixelx - (c*(fsizex+6*fpixelx))) posy = diry * (1.0 - fsizey*0.5 - 3*fpixely - (r*(fsizey+6*fpixely))) | posx = dirx * (1.0 - ((c + 0.5) * (fsizex + fpixelx * bordersize))) - (fpixelx * dirx) posy = diry * (1.0 - ((r + 0.5) * (fsizey + fpixely * bordersize))) - (fpixely * diry) | def maintainReadout(self, task): """Access: private. Whenever necessary, rebuilds the entire display from scratch. This is only done when the configuration parameters have changed.""" | f29558832edeca94504f8d6a96592cf0ecdb363c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7242/f29558832edeca94504f8d6a96592cf0ecdb363c/BufferViewer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17505,
1994,
659,
12,
2890,
16,
1562,
4672,
3536,
1862,
30,
3238,
18,
225,
3497,
4009,
502,
4573,
16,
13419,
87,
326,
7278,
2562,
628,
15289,
18,
225,
1220,
353,
1338,
2731,
1347,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17505,
1994,
659,
12,
2890,
16,
1562,
4672,
3536,
1862,
30,
3238,
18,
225,
3497,
4009,
502,
4573,
16,
13419,
87,
326,
7278,
2562,
628,
15289,
18,
225,
1220,
353,
1338,
2731,
1347,
326,
... |
path = path.lstrip("./") | def ImportFromPkgutil(pkgname, c): """ Imports package data from pkgutil into our internal package database. """ timestamp = 0 owner = 0 pkgid = pkgname vers = "1.0" ppath = "./" #get metadata from applepkgdb p = subprocess.Popen(["/usr/sbin/pkgutil", "--pkg-info-plist", pkgid], bufsize=1, stdout=subprocess.PIPE, stderr=subprocess.PIPE) (plist, err) = p.communicate() if plist: pl = FoundationPlist.readPlistFromString(plist) if "install-location" in pl: ppath = pl["install-location"] if "pkg-version" in pl: vers = pl["pkg-version"] if "install-time" in pl: timestamp = pl["install-time"] t = (timestamp, owner, pkgid, vers, ppath, pkgname) c.execute('INSERT INTO pkgs (timestamp, owner, pkgid, vers, ppath, pkgname) values (?, ?, ?, ?, ?, ?)', t) pkgkey = c.lastrowid cmd = ["/usr/sbin/pkgutil", "--files", pkgid] p = subprocess.Popen(cmd, shell=False, bufsize=1, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) while True: line = p.stdout.readline().decode('UTF-8') if not line and (p.poll() != None): break path = line.rstrip("\n") # pkgutil --files pkgid only gives us path info. We don't # really need perms, uid and gid, so we'll just fake them. # if we needed them, we'd have to call # pkgutil --export-plist pkgid and iterate through the # plist. That would be slower, so we'll do things this way... perms = "0000" uid = "0" gid = "0" if path != ".": # special case for MS Office 2008 installers if ppath == "./tmp/com.microsoft.updater/office_location/": ppath = "./Applications/" #prepend the ppath so the paths match the actual install locations path = path.lstrip("./") if ppath.endswith("/"): path = ppath + path else: path = ppath + "/" + path path = path.lstrip("./") t = (path, ) row = c.execute('SELECT path_key from paths where path = ?', t).fetchone() if not row: c.execute('INSERT INTO paths (path) values (?)', t) pathkey = c.lastrowid else: pathkey = row[0] t = (pkgkey, pathkey, uid, gid, perms) c.execute('INSERT INTO pkgs_paths (pkg_key, path_key, uid, gid, perms) values (?, ?, ?, ?, ?)', t) | 96251a968e0781e9c0abf1580bd271f1c0e663d9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6241/96251a968e0781e9c0abf1580bd271f1c0e663d9/removepackages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6164,
1265,
11264,
1367,
12,
10657,
529,
16,
276,
4672,
3536,
2221,
4363,
2181,
501,
628,
3475,
1367,
1368,
3134,
2713,
2181,
2063,
18,
3536,
225,
2858,
273,
374,
3410,
273,
374,
3475,
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,
6164,
1265,
11264,
1367,
12,
10657,
529,
16,
276,
4672,
3536,
2221,
4363,
2181,
501,
628,
3475,
1367,
1368,
3134,
2713,
2181,
2063,
18,
3536,
225,
2858,
273,
374,
3410,
273,
374,
3475,
3... | |
// Statement stack and nested statement handler. def nest(tokenizer, compilerContext, node, func, end) { compilerContext.stmtStack.push(node) var node = func(tokenizer, compilerContext) compilerContext.stmtStack.pop() end && tokenizer.mustMatch(end) return node } /* * Statements :: (tokenizer, compiler context) -> node * * Parses a list of Statements. */ def Statements(tokenizer, compilerContext) { var builder = compilerContext.builder var node = builder.BLOCK$build(tokenizer, compilerContext.blockId++) builder.BLOCK$hoistLets(node) compilerContext.stmtStack.push(node) while (!tokenizer.done && tokenizer.peek(True) != RIGHT_CURLY) builder.BLOCK$addStatement(node, Statement(tokenizer, compilerContext)) compilerContext.stmtStack.pop() builder.BLOCK$finish(node) if (node.needsHoisting) { builder.setHoists(node.id, node.varDecls) // Propagate up to the function. compilerContext.needsHoisting = True } return node } def Block(tokenizer, compilerContext) { tokenizer.mustMatch(LEFT_CURLY) var node = Statements(tokenizer, compilerContext) tokenizer.mustMatch(RIGHT_CURLY) return node } const DECLARED_FORM = 0, EXPRESSED_FORM = 1, STATEMENT_FORM = 2 /* * Statement :: (tokenizer, compiler context) -> node * * Parses a Statement. */ def Statement(tokenizer, compilerContext) { | def nest(tokenizer, compilerContext, node, func, end): """Statement stack and nested statement handler.""" compilerContext.stmtStack.push(node) var node = func(tokenizer, compilerContext) compilerContext.stmtStack.pop() end and tokenizer.mustMatch(end) return node def Statements(tokenizer, compilerContext): """Parses a list of Statements.""" builder = compilerContext.builder node = builder.BLOCK$build(tokenizer, compilerContext.blockId++) builder.BLOCK$hoistLets(node) compilerContext.stmtStack.push(node) while !tokenizer.done and tokenizer.peek(True) != RIGHT_CURLY: builder.BLOCK$addStatement(node, Statement(tokenizer, compilerContext)) compilerContext.stmtStack.pop() builder.BLOCK$finish(node) if node.needsHoisting: builder.setHoists(node.id, node.varDecls) compilerContext.needsHoisting = True return node def Block(tokenizer, compilerContext): tokenizer.mustMatch(LEFT_CURLY) var node = Statements(tokenizer, compilerContext) tokenizer.mustMatch(RIGHT_CURLY) return node DECLARED_FORM = 0 EXPRESSED_FORM = 1 STATEMENT_FORM = 2 def Statement(tokenizer, compilerContext): """Parses a Statement.""" | """Parses the toplevel and def bodies.""" | 58afad4d3cade0a037f53f0a04cb23589df417b1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12949/58afad4d3cade0a037f53f0a04cb23589df417b1/Parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
3536,
6656,
326,
28999,
471,
1652,
25126,
12123,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
3536,
6656,
326,
28999,
471,
1652,
25126,
12123,
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,
... |
create_results_log(results, logdir, missing) | create_results_log(results, logdir, missing, summary=summary, coverdir=coverdir) | def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:m", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir="]) except getopt.error, msg: sys.stderr.write("%s: %s\n" % (sys.argv[0], msg)) sys.stderr.write("Try `%s --help' for more information\n" % sys.argv[0]) sys.exit(1) trace = 0 count = 0 report = 0 no_report = 0 counts_file = None logdir = "." missing = 0 ignore_modules = [] ignore_dirs = [] for opt, val in opts: if opt == "--help": usage(sys.stdout) sys.exit(0) if opt == "--version": sys.stdout.write("trace 2.0\n") sys.exit(0) if opt == "-t" or opt == "--trace": trace = 1 continue if opt == "-c" or opt == "--count": count = 1 continue if opt == "-r" or opt == "--report": report = 1 continue if opt == "-R" or opt == "--no-report": no_report = 1 continue if opt == "-f" or opt == "--file": counts_file = val continue if opt == "-d" or opt == "--logdir": logdir = val continue if opt == "-m" or opt == "--missing": missing = 1 continue if opt == "--ignore-module": ignore_modules.append(val) continue if opt == "--ignore-dir": for s in string.split(val, os.pathsep): s = os.path.expandvars(s) # should I also call expanduser? (after all, could use $HOME) s = string.replace(s, "$prefix", os.path.join(sys.prefix, "lib", "python" + sys.version[:3])) s = string.replace(s, "$exec_prefix", os.path.join(sys.exec_prefix, "lib", "python" + sys.version[:3])) s = os.path.normpath(s) ignore_dirs.append(s) continue assert 0, "Should never get here" if len(prog_argv) == 0: _err_exit("missing name of file to run") if count + trace + report > 1: _err_exit("can only specify one of --trace, --count or --report") if count + trace + report == 0: _err_exit("must specify one of --trace, --count or --report") if report and counts_file is None: _err_exit("--report requires a --file") if report and no_report: _err_exit("cannot specify both --report and --no-report") if logdir is not None: # warn if the directory doesn't exist, but keep on going # (is this the correct behaviour?) if not os.path.isdir(logdir): sys.stderr.write( "trace: WARNING, --logdir directory %s is not available\n" % `logdir`) sys.argv = prog_argv progname = prog_argv[0] if eval(sys.version[:3])>1.3: sys.path[0] = os.path.split(progname)[0] # ??? # everything is ready ignore = Ignore(ignore_modules, ignore_dirs) if trace: t = Trace(ignore) try: run(t.trace, 'execfile(' + `progname` + ')') except IOError, err: _err_exit("Cannot run file %s because: %s" % \ (`sys.argv[0]`, err.strerror)) elif count: t = Coverage(ignore) try: run(t.trace, 'execfile(' + `progname` + ')') except IOError, err: _err_exit("Cannot run file %s because: %s" % \ (`sys.argv[0]`, err.strerror)) except SystemExit: pass results = t.results() # Add another lookup from the program's file name to its import name # This give the right results, but I'm not sure why ... results.modules[progname] = os.path.splitext(progname)[0] if counts_file: # add in archived data, if available try: old_counts, old_modules = marshal.load(open(counts_file, 'rb')) except IOError: pass else: results.update(CoverageResults(old_counts, old_modules)) if not no_report: create_results_log(results, logdir, missing) if counts_file: try: marshal.dump( (results.counts, results.modules), open(counts_file, 'wb')) except IOError, err: _err_exit("Cannot save counts file %s because: %s" % \ (`counts_file`, err.strerror)) elif report: old_counts, old_modules = marshal.load(open(counts_file, 'rb')) results = CoverageResults(old_counts, old_modules) create_results_log(results, logdir, missing) else: assert 0, "Should never get here" | 378f7d565bdce9abec1770309041634877f0ac81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/378f7d565bdce9abec1770309041634877f0ac81/trace.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
273,
599,
4672,
1930,
336,
3838,
225,
309,
5261,
353,
599,
30,
5261,
273,
2589,
18,
19485,
775,
30,
1500,
16,
11243,
67,
19485,
273,
336,
3838,
18,
588,
3838,
12,
1948... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
273,
599,
4672,
1930,
336,
3838,
225,
309,
5261,
353,
599,
30,
5261,
273,
2589,
18,
19485,
775,
30,
1500,
16,
11243,
67,
19485,
273,
336,
3838,
18,
588,
3838,
12,
1948... |
def _get_mo_files(self): | def __get_mo_files(self): | def _get_mo_files(self): | db0a16bb80b05ae5107db243b42aa230a3f39f41 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12852/db0a16bb80b05ae5107db243b42aa230a3f39f41/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
8683,
67,
2354,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
8683,
67,
2354,
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,
... |
if string.find(line1, 'Alignments') >= 0: | if string.find(line2, 'Alignments') >= 0: | def _scan_alignments(self, uhandle, consumer): # Check to see whether I'm at an alignment or database report. # Possibilities: # 1) BLASTP 2.0.14, pairwise alignment # <CENTER><b><FONT color="green">Alignments</FONT></b></CENTER> # <PRE> # ><a name = 121837></a><a href="http://www.ncbi.nlm.nih.gov:80/entre # 2) BLASTP 2.0.10, pairwise alignment # <PRE> # <a name = 120291> </a><a href="http://www.ncbi.nlm.nih.gov:80/entre # 3) BLASTP 2.0.10, master-slave # <PRE> # blast_tmp 1 MFQQIGAVQAKSGTDEPAHPCEKFPPERKCEAVFWKPLPRHEAREILLAARK # 4) BLASTP 2.0.10, 2.0.14, database # <PRE> # Database: Non-redundant SwissProt sequences # 5) BLASTX 2.2.4, pairwise alignment # <CENTER><b><FONT color="green">Alignments</FONT></b></CENTER> # </form> # <script src="blastResult.js"></script><table border="0"><tr><td><FO # <PRE> # 6) Qblast 2.2.10, database (no 'Database' line) # <PRE> # Lambda K H | 48e7839c969cd4cacd78aaf945cf2a1ce25afdea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7167/48e7839c969cd4cacd78aaf945cf2a1ce25afdea/NCBIWWW.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9871,
67,
7989,
1346,
12,
2890,
16,
582,
4110,
16,
4765,
4672,
468,
2073,
358,
2621,
2856,
467,
17784,
622,
392,
8710,
578,
2063,
2605,
18,
468,
6818,
24074,
30,
468,
404,
13,
605... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9871,
67,
7989,
1346,
12,
2890,
16,
582,
4110,
16,
4765,
4672,
468,
2073,
358,
2621,
2856,
467,
17784,
622,
392,
8710,
578,
2063,
2605,
18,
468,
6818,
24074,
30,
468,
404,
13,
605... |
return | notebook.set_current_page(notebook.get_current_page()) | def next_tab(self, term): notebook = self.get_first_parent_notebook(term) notebook.next_page() return | de537fdac7d039188882a2ca9dc22a0ead99d953 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1032/de537fdac7d039188882a2ca9dc22a0ead99d953/terminator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1024,
67,
7032,
12,
2890,
16,
2481,
4672,
14718,
273,
365,
18,
588,
67,
3645,
67,
2938,
67,
24422,
12,
6408,
13,
14718,
18,
4285,
67,
2433,
1435,
327,
225,
2,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1024,
67,
7032,
12,
2890,
16,
2481,
4672,
14718,
273,
365,
18,
588,
67,
3645,
67,
2938,
67,
24422,
12,
6408,
13,
14718,
18,
4285,
67,
2433,
1435,
327,
225,
2,
-100,
-100,
-100,
-100,
... |
return results | return (results, categories_parsed) | def categoryAllElements(CatName, cmlimit = 5000): #action=query&list=categorymembers&cmlimit=500&cmtitle=Category:License_tags """ Category to load all the elements in a category. Limit: 5000 elements. """ wikipedia.output("Loading %s..." % CatName) params = { 'action' :'query', 'list' :'categorymembers', 'cmlimit' :cmlimit, 'cmtitle' :CatName, } data = query.GetData(params, useAPI = True, encodeTitle = False) try: members = data['query']['categorymembers'] except KeyError: if int(cmlimit) != 500: wikipedia.output(u'An Error occured, trying to reload the category.') return categoryAllElements(CatName, cmlimit = 500) else: raise wikipedia.Error(data) if len(members) == int(cmlimit): raise wikipedia.Error(u'The category selected as >= %s elements, limit reached.' % cmlimit) allmembers = members results = list() for subcat in members: ns = subcat['ns'] pageid = subcat['pageid'] title = subcat['title'] if ns == 14: allmembers.extend(categoryAllElements(title)) for member in allmembers: ns = member['ns'] pageid = member['pageid'] title = member['title'] results.append(member) return results | 6ae6882e2ccf7c8ed6dd97bd5e45a15331b8160f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/6ae6882e2ccf7c8ed6dd97bd5e45a15331b8160f/checkimages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3150,
1595,
3471,
12,
11554,
461,
16,
276,
781,
1038,
273,
20190,
4672,
468,
1128,
33,
2271,
10,
1098,
33,
4743,
7640,
10,
71,
781,
1038,
33,
12483,
10,
71,
1010,
1280,
33,
4457,
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,
3150,
1595,
3471,
12,
11554,
461,
16,
276,
781,
1038,
273,
20190,
4672,
468,
1128,
33,
2271,
10,
1098,
33,
4743,
7640,
10,
71,
781,
1038,
33,
12483,
10,
71,
1010,
1280,
33,
4457,
30,
... |
try: | def main(): | def workon(page, links): text = page.get() # Show the title of the page we're working on. # Highlight the title in purple. wikipedia.output(u"\n\n>>> \03{lightpurple}%s\03{default} <<<" % page.title()) for page2 in links: try: target = page2.getRedirectTarget() except (wikipedia.Error,wikipedia.SectionError): continue text = treat(text, page2, target) if text != page.get(): comment = wikipedia.translate(mysite, msg) page.put(text, comment) | 917da8488b661d3839b5bd72accf549658456dff /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/917da8488b661d3839b5bd72accf549658456dff/disambredir.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1440,
265,
12,
2433,
16,
4716,
4672,
977,
273,
1363,
18,
588,
1435,
468,
9674,
326,
2077,
434,
326,
1363,
732,
4565,
5960,
603,
18,
468,
31386,
326,
2077,
316,
5405,
1802,
18,
21137,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1440,
265,
12,
2433,
16,
4716,
4672,
977,
273,
1363,
18,
588,
1435,
468,
9674,
326,
2077,
434,
326,
1363,
732,
4565,
5960,
603,
18,
468,
31386,
326,
2077,
316,
5405,
1802,
18,
21137,
1... |
for column in newClass._columns[:]: | for column in newClass._columns: if d.has_key(column.name) and d[column.name] is None: newClass._columns.remove(column) for column in newClass._columns: | def __new__(cls, className, bases, d): | 6ed274806ff260ec207e5ba1a72e0ab23749734b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8798/6ed274806ff260ec207e5ba1a72e0ab23749734b/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2704,
972,
12,
6429,
16,
2658,
16,
8337,
16,
302,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2704,
972,
12,
6429,
16,
2658,
16,
8337,
16,
302,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
>>> request = TestRequest(form={'field.title': 'NonHackig', | >>> request = TestRequest(form={'field.title': 'NonHacking', | def doctest_CalendarEventEditView_edit(): r"""Tests for CalendarEventEditView editing of new event. Let's create an event: >>> import datetime >>> event = CalendarEvent(title="Hacking", ... dtstart=datetime.datetime(2004, 8, 13, 20, 0), ... duration=datetime.timedelta(minutes=60)) Let's try to edit the event: >>> request = TestRequest(form={'field.title': 'NonHackig', ... 'field.start_date': '2004-09-13', ... 'field.start_time': '15:30', ... 'field.duration': '50', ... 'field.recurrence.used': '', ... 'field.recurrence_type': 'daily', ... 'UPDATE_SUBMIT': 'Edit'}) >>> directlyProvides(event, IContainmentRoot) >>> view = CalendarEventEditTestView(event, request) >>> view.update() '' >>> print view.errors () >>> print view.error None #>>> event.title #u'NonHacking' #>>> event.dtstart #datetime.datetime(2004, 9, 13, 15, 30) #>>> event.duration #datetime.timedelta(0, 3000) #>>> event.location is None #True """ | 6c9883121bd6ad3aecb5a9112b8cd39f814413e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7127/6c9883121bd6ad3aecb5a9112b8cd39f814413e0/test_cal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31263,
395,
67,
7335,
1133,
4666,
1767,
67,
4619,
13332,
436,
8395,
14650,
364,
5542,
1133,
4666,
1767,
15755,
434,
394,
871,
18,
225,
10559,
1807,
752,
392,
871,
30,
225,
4080,
1930,
33... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31263,
395,
67,
7335,
1133,
4666,
1767,
67,
4619,
13332,
436,
8395,
14650,
364,
5542,
1133,
4666,
1767,
15755,
434,
394,
871,
18,
225,
10559,
1807,
752,
392,
871,
30,
225,
4080,
1930,
33... |
before, rest = text.split('@X@EmbeddedFile.location@X@') | before, rest = text.split('@X@EmbeddedFile.location@X@', 1) | def handle_embedded_file(self, text): before, rest = text.split('@X@EmbeddedFile.location@X@') | 5d7bba3f9da5602afaac91a41be90f54e9d7c23b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12927/5d7bba3f9da5602afaac91a41be90f54e9d7c23b/bb9_course.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
20722,
67,
768,
12,
2890,
16,
977,
4672,
1865,
16,
3127,
273,
977,
18,
4939,
2668,
36,
60,
36,
14980,
812,
18,
3562,
36,
60,
36,
6134,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
20722,
67,
768,
12,
2890,
16,
977,
4672,
1865,
16,
3127,
273,
977,
18,
4939,
2668,
36,
60,
36,
14980,
812,
18,
3562,
36,
60,
36,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-100... |
parent.connect(parent.sourceEditor,SIGNAL("textChanged()"),parent.sourceEditor_textChanged) | parent.connect(parent.sourceEditor,SIGNAL("textChanged()"),parent.sourceEditor_textChanged) | def setEditWidget(parent): parent.sourceEditor.hide() parent.sourceEditor = QextScintilla(parent.Source) | 003b98616c9360bcb5917931eb2a3843c60ac796 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2266/003b98616c9360bcb5917931eb2a3843c60ac796/KdeQt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
4666,
4609,
12,
2938,
4672,
982,
18,
3168,
6946,
18,
11248,
1435,
982,
18,
3168,
6946,
273,
2238,
408,
1541,
474,
10745,
12,
2938,
18,
1830,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
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,
444,
4666,
4609,
12,
2938,
4672,
982,
18,
3168,
6946,
18,
11248,
1435,
982,
18,
3168,
6946,
273,
2238,
408,
1541,
474,
10745,
12,
2938,
18,
1830,
13,
2,
-100,
-100,
-100,
-100,
-100,
-... |
except (OSError, IOError): | except (AttributeError, OSError, IOError), msg: | def ReloadFile(self): """Reloads the current file, returns True on success and False if there is a failure. @return: whether file was reloaded or not @rtype: bool | be465202d395d7ea44057f5fb0f88ad831728780 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3530/be465202d395d7ea44057f5fb0f88ad831728780/ed_stc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23086,
812,
12,
2890,
4672,
3536,
13013,
87,
326,
783,
585,
16,
1135,
1053,
603,
2216,
471,
1083,
309,
1915,
353,
279,
5166,
18,
632,
2463,
30,
2856,
585,
1703,
283,
4230,
578,
486,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23086,
812,
12,
2890,
4672,
3536,
13013,
87,
326,
783,
585,
16,
1135,
1053,
603,
2216,
471,
1083,
309,
1915,
353,
279,
5166,
18,
632,
2463,
30,
2856,
585,
1703,
283,
4230,
578,
486,
63... |
(\$) by a dollar sign ($). Don't change a dollar sign preceded or followed by a backtick (`$ or $`), because of strings like | (\\$) by a dollar sign ($). Don't change a dollar sign preceded or followed by a backtick (\`$ or \$`), because of strings like | def process_dollars(s): r"""nodetex Replace dollar signs with backticks. More precisely, do a regular expression search. Replace a plain dollar sign ($) by a backtick (`). Replace an escaped dollar sign (\$) by a dollar sign ($). Don't change a dollar sign preceded or followed by a backtick (`$ or $`), because of strings like "``$HOME``". Don't make any changes on lines starting with more spaces than the first nonempty line in ``s``, because those are indented and hence part of a block of code or examples. This also doesn't replaces dollar signs enclosed in curly braces, to avoid nested math environments. EXAMPLES:: sage: from sage.misc.sagedoc import process_dollars sage: process_dollars('hello') 'hello' sage: process_dollars('some math: $x=y$') 'some math: `x=y`' Replace \$ with $, and don't do anything when backticks are involved:: sage: process_dollars(r'a ``$REAL`` dollar sign: \$') 'a ``$REAL`` dollar sign: $' Don't make any changes on lines indented more than the first nonempty line:: sage: s = '\n first line\n indented $x=y$' sage: s == process_dollars(s) True Don't replace dollar signs enclosed in curly braces:: sage: process_dollars(r'f(n) = 0 \text{ if $n$ is prime}') 'f(n) = 0 \\text{ if $n$ is prime}' This is not perfect: sage: process_dollars(r'$f(n) = 0 \text{ if $n$ is prime}$') '`f(n) = 0 \\text{ if $n$ is prime}$' The regular expression search doesn't find the last $. Fortunately, there don't seem to be any instances of this kind of expression in the Sage library, as of this writing. """ if s.find("$") == -1: return s # find how much leading whitespace s has, for later comparison: # ignore all $ on lines which start with more whitespace. whitespace = re.match(r'\s*\S', s.lstrip('\n')) whitespace = ' ' * (whitespace.end() - 1) # leading whitespace # Indices will be a list of pairs of positions in s, to search between. # If the following search has no matches, then indices will be (0, len(s)). indices = [0] # This searches for "$blah$" inside a pair of curly braces -- # don't change these, since they're probably coming from a nested # math environment. So for each match, search to the left of its # start and to the right of its end, but not in between. for m in re.finditer(r"{[^{}$]*\$([^{}$]*)\$[^{}$]*}", s): indices[-1] = (indices[-1], m.start()) indices.append(m.end()) indices[-1] = (indices[-1], len(s)) # regular expression for $ (not \$, `$, $`, and only on a line # with no extra leading whitespace). # # in detail: # re.compile("^" # beginning of line # + "(%s%)?" % whitespace # + r"""(\S # non whitespace # .*?)? # non-greedy match any non-newline characters # (?<!`|\\)\$(?!`) # $ with negative lookbehind and lookahead # """, re.M | re.X) # # except that this doesn't work, so use the equivalent regular # expression without the 're.X' option. Maybe 'whitespace' gets # eaten up by re.X? regexp = "^" + "(%s)?"%whitespace + r"(\S.*?)?(?<!`|\\)\$(?!`)" dollar = re.compile(regexp, re.M) # regular expression for \$ slashdollar = re.compile(r"\\\$") for start, end in indices: while dollar.search(s, start, end): m = dollar.search(s, start, end) s = s[:m.end()-1] + "`" + s[m.end():] while slashdollar.search(s, start, end): m = slashdollar.search(s, start, end) s = s[:m.start()] + "$" + s[m.end():] return s | 982c933e0d64bffca9aa2218ec37457f6daf45e9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/982c933e0d64bffca9aa2218ec37457f6daf45e9/sagedoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
72,
22382,
5913,
12,
87,
4672,
436,
8395,
19888,
278,
338,
6910,
302,
25442,
21588,
598,
1473,
11767,
18,
225,
16053,
13382,
291,
2357,
16,
741,
279,
6736,
2652,
1623,
18,
225,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
72,
22382,
5913,
12,
87,
4672,
436,
8395,
19888,
278,
338,
6910,
302,
25442,
21588,
598,
1473,
11767,
18,
225,
16053,
13382,
291,
2357,
16,
741,
279,
6736,
2652,
1623,
18,
225,... |
def __init__(self, s): self.__lines = s.split('\n') | def __init__(self, name, data, files=(), dirs=()): self.__name = name self.__data = data self.__files = files self.__dirs = dirs self.__lines = None def __setup(self): if self.__lines: return data = None for dir in self.__dirs: for file in self.__files: file = os.path.join(dir, file) try: fp = open(file) data = fp.read() fp.close() break except IOError: pass if data: break if not data: data = self.__data self.__lines = data.split('\n') | def __init__(self, s): self.__lines = s.split('\n') self.__linecnt = len(self.__lines) | 745bb9de72f04d190bc870f8eb127c4e62497742 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/745bb9de72f04d190bc870f8eb127c4e62497742/site.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
508,
16,
501,
16,
1390,
33,
9334,
7717,
33,
1435,
4672,
365,
16186,
529,
273,
508,
365,
16186,
892,
273,
501,
365,
16186,
2354,
273,
1390,
365,
16186,
82... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
508,
16,
501,
16,
1390,
33,
9334,
7717,
33,
1435,
4672,
365,
16186,
529,
273,
508,
365,
16186,
892,
273,
501,
365,
16186,
2354,
273,
1390,
365,
16186,
82... |
assert ''.join(res.chars) == '<B object>' | assert ''.join(res.chars).startswith('<B object') | def fn(n): if n > 0: x = B(n) else: x = C(n) return str(x) | d67f6fe7260b4c4ee8baa19679b5c86e906c36b2 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6934/d67f6fe7260b4c4ee8baa19679b5c86e906c36b2/test_rtagged.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2295,
12,
82,
4672,
309,
290,
405,
374,
30,
619,
273,
605,
12,
82,
13,
469,
30,
619,
273,
385,
12,
82,
13,
327,
609,
12,
92,
13,
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,
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,
2295,
12,
82,
4672,
309,
290,
405,
374,
30,
619,
273,
605,
12,
82,
13,
469,
30,
619,
273,
385,
12,
82,
13,
327,
609,
12,
92,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if dev_type == 'tap': | if dev_type == 'pci': for dev in dev_config_dict['devs']: XendAPIStore.deregister(dev['uuid'], 'DPCI') elif dev_type == 'tap': | def device_create(self, dev_config): """Create a new device. | 9f7e4bd3df69618f95cb48af6dd9c04f6d9735d7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6195/9f7e4bd3df69618f95cb48af6dd9c04f6d9735d7/XendDomainInfo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2346,
67,
2640,
12,
2890,
16,
4461,
67,
1425,
4672,
3536,
1684,
279,
394,
2346,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2346,
67,
2640,
12,
2890,
16,
4461,
67,
1425,
4672,
3536,
1684,
279,
394,
2346,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
"""intbitset - set difference infinite vs empty""" | """intbitset - set difference, infinite vs empty""" | def test_set_difference_infinite_empty(self): """intbitset - set difference infinite vs empty""" self._helper_test_infinite_vs_empty(self.fncs_list[3]) | 982045c3f21398672e0267f8fbddffc861a01e24 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12027/982045c3f21398672e0267f8fbddffc861a01e24/intbitset_tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
542,
67,
23444,
67,
267,
9551,
67,
5531,
12,
2890,
4672,
3536,
474,
3682,
542,
300,
444,
7114,
16,
14853,
6195,
1008,
8395,
365,
6315,
4759,
67,
3813,
67,
267,
9551,
67,
6904... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
542,
67,
23444,
67,
267,
9551,
67,
5531,
12,
2890,
4672,
3536,
474,
3682,
542,
300,
444,
7114,
16,
14853,
6195,
1008,
8395,
365,
6315,
4759,
67,
3813,
67,
267,
9551,
67,
6904... |
parmsDict = {"linkUrl":"http://www.google.com", "linkText":"Google"} | def testConditionalInclude(self): template = """<!--StartIncludeIf:include-->text<!--EndIncludeIf:include-->""" parmsDict = {"linkUrl":"http://www.google.com", "linkText":"Google"} assert(templateParser().parseTemplate(template, include=True) == "text") assert(templateParser().parseTemplate(template, include=False) == "") | c6c44c612342a8660a5732bbf5c6c50ee5b72ac5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2223/c6c44c612342a8660a5732bbf5c6c50ee5b72ac5/rdw_templating.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
14132,
8752,
12,
2890,
4672,
1542,
273,
3536,
5586,
413,
1685,
8752,
2047,
30,
6702,
413,
34,
955,
5586,
413,
1638,
8752,
2047,
30,
6702,
413,
2984,
3660,
1815,
12,
3202,
2678,
767... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
14132,
8752,
12,
2890,
4672,
1542,
273,
3536,
5586,
413,
1685,
8752,
2047,
30,
6702,
413,
34,
955,
5586,
413,
1638,
8752,
2047,
30,
6702,
413,
2984,
3660,
1815,
12,
3202,
2678,
767... | |
print(keys) print(vals) raise Exception("Number of vals does not equal number of keys") | raise Exception("Number of vals does not equal number of keys. \ Number of vals are: "+str(len(vals))+" and number of keys are: "+str(len(keys))) | def get_differentiated_variable_names(self): """ Extract the names of the differentiated variables in a model. | f764f349d643190118591f5efb0058e97cef2494 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7711/f764f349d643190118591f5efb0058e97cef2494/xmlparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
30738,
10206,
67,
6105,
67,
1973,
12,
2890,
4672,
3536,
8152,
326,
1257,
434,
326,
3775,
10206,
3152,
316,
279,
938,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
30738,
10206,
67,
6105,
67,
1973,
12,
2890,
4672,
3536,
8152,
326,
1257,
434,
326,
3775,
10206,
3152,
316,
279,
938,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
open('/dev/tty', 'w').write('-----\n') | def equal_stats(x,y): x = os.stat(x) y = os.stat(y) return (stat.S_IMODE(x[stat.ST_MODE]) == stat.S_IMODE(y[stat.ST_MODE]) and x[stat.ST_ATIME] == y[stat.ST_ATIME] and x[stat.ST_MTIME] == y[stat.ST_MTIME]) | 7fc91033aabbc2a10358db32578734f3e1f25bc6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7126/7fc91033aabbc2a10358db32578734f3e1f25bc6/BuildDir.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3959,
67,
5296,
12,
92,
16,
93,
4672,
619,
273,
1140,
18,
5642,
12,
92,
13,
677,
273,
1140,
18,
5642,
12,
93,
13,
327,
261,
5642,
18,
55,
67,
3445,
2712,
12,
92,
63,
5642,
18,
88... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3959,
67,
5296,
12,
92,
16,
93,
4672,
619,
273,
1140,
18,
5642,
12,
92,
13,
677,
273,
1140,
18,
5642,
12,
93,
13,
327,
261,
5642,
18,
55,
67,
3445,
2712,
12,
92,
63,
5642,
18,
88... | |
includeType(member.realtype) | resulttype = includeType(member.realtype) | def writeIncludesForMember(member): assert member.kind in ('attribute', 'method') includeType(member.realtype) if member.kind == 'method': for p in member.params: includeType(p.realtype) | 77f7c863c783916adfbfd3df09dc83b3fe318e54 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11102/77f7c863c783916adfbfd3df09dc83b3fe318e54/qsgen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
16815,
1290,
4419,
12,
5990,
4672,
1815,
3140,
18,
9224,
316,
7707,
4589,
2187,
296,
2039,
6134,
563,
723,
273,
2341,
559,
12,
5990,
18,
7688,
723,
13,
309,
3140,
18,
9224,
422,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
16815,
1290,
4419,
12,
5990,
4672,
1815,
3140,
18,
9224,
316,
7707,
4589,
2187,
296,
2039,
6134,
563,
723,
273,
2341,
559,
12,
5990,
18,
7688,
723,
13,
309,
3140,
18,
9224,
422,
... |
@type : C{class 'TranssysInstanceLattice'} @param timesteps; The number of timesteps for the simulator. @type : C{int} | @type transsysLattice: C{class 'TranssysInstanceLattice'} @param timesteps: The number of timesteps for the simulator. @type timesteps: C{int} | def __init__(self, transsysLattice, timesteps=None): """ Constructor of the class. @param transsysLattice: A transsys instance lattice object. L{TranssysInstanceLattice} @type : C{class 'TranssysInstanceLattice'} @param timesteps; The number of timesteps for the simulator. @type : C{int} """ | 4e4693a52c95717018319fd37fd5d71cecb79c4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1770/4e4693a52c95717018319fd37fd5d71cecb79c4f/translattice.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
906,
9499,
48,
24966,
16,
17145,
13058,
33,
7036,
4672,
3536,
11417,
434,
326,
667,
18,
632,
891,
906,
9499,
48,
24966,
30,
432,
906,
9499,
791,
16690,
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,
1001,
2738,
972,
12,
2890,
16,
906,
9499,
48,
24966,
16,
17145,
13058,
33,
7036,
4672,
3536,
11417,
434,
326,
667,
18,
632,
891,
906,
9499,
48,
24966,
30,
432,
906,
9499,
791,
16690,
7... |
cert.setNotBefore(("UTCTime", POW.pkix.time2utc(now))) cert.setNotAfter(("UTCTime", POW.pkix.time2utc(notAfter))) | cert.setNotBefore(("utcTime", POW.pkix.time2utc(now))) cert.setNotAfter(("utcTime", POW.pkix.time2utc(notAfter))) | def issue(self, keypair, subject_key, serial, sia, aia, crldp, cn = None, notAfter = None, as = None, v4 = None, v6 = None, is_ca = True): """Issue a certificate.""" | 6c64a286f5bba47fe4e4f6e2f63d75039e368223 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/119/6c64a286f5bba47fe4e4f6e2f63d75039e368223/x509.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5672,
12,
2890,
16,
25298,
16,
3221,
67,
856,
16,
2734,
16,
272,
1155,
16,
279,
1155,
16,
4422,
18503,
16,
6227,
273,
599,
16,
486,
4436,
273,
599,
16,
487,
273,
599,
16,
331,
24,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5672,
12,
2890,
16,
25298,
16,
3221,
67,
856,
16,
2734,
16,
272,
1155,
16,
279,
1155,
16,
4422,
18503,
16,
6227,
273,
599,
16,
486,
4436,
273,
599,
16,
487,
273,
599,
16,
331,
24,
... |
return self.help_message_datestz | if not show_offset: return self.help_message_datestz else: return self.show_tz(qnick) | def handle_tz(self, input, request_nick): """change or reset the time zone setting | f9afbead5f39e69361c4cf9fa30b466e3d3397ef /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10749/f9afbead5f39e69361c4cf9fa30b466e3d3397ef/bottime.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
12994,
12,
2890,
16,
810,
16,
590,
67,
17091,
4672,
3536,
3427,
578,
2715,
326,
813,
4157,
3637,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
12994,
12,
2890,
16,
810,
16,
590,
67,
17091,
4672,
3536,
3427,
578,
2715,
326,
813,
4157,
3637,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
modname = modname + subname | modname = modname + subname | def getenvironment(self): if self.path: file = self.path dir = os.path.dirname(file) # check if we're part of a package modname = "" while os.path.exists(os.path.join(dir, "__init__.py")): dir, dirname = os.path.split(dir) modname = modname + dirname + '.' subname = _filename_as_modname(self.title) if modname: if subname == "__init__": modname = modname[:-1] # strip trailing period else: modname = modname + subname else: modname = subname if sys.modules.has_key(modname): globals = sys.modules[modname].__dict__ self.globals = {} else: globals = self.globals else: file = '<%s>' % self.title globals = self.globals modname = file return globals, file, modname | b88bfbecebf6bf5ba03c0e87834196a15cabb8fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b88bfbecebf6bf5ba03c0e87834196a15cabb8fd/PyEdit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
10274,
12,
2890,
4672,
309,
365,
18,
803,
30,
585,
273,
365,
18,
803,
1577,
273,
1140,
18,
803,
18,
12287,
12,
768,
13,
468,
866,
309,
732,
4565,
1087,
434,
279,
2181,
16037,
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,
336,
10274,
12,
2890,
4672,
309,
365,
18,
803,
30,
585,
273,
365,
18,
803,
1577,
273,
1140,
18,
803,
18,
12287,
12,
768,
13,
468,
866,
309,
732,
4565,
1087,
434,
279,
2181,
16037,
27... |
r""" Return a dictionary to access variables in \code{self.R} by their names. | """ Return a dictionary to access variables in ``self.R`` by their names. | def variable_dict(self): r""" Return a dictionary to access variables in \code{self.R} by their names. | d2531bfd55e8dc010cd9c1e87cc62d2c514562d4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/d2531bfd55e8dc010cd9c1e87cc62d2c514562d4/sr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2190,
67,
1576,
12,
2890,
4672,
436,
8395,
2000,
279,
3880,
358,
2006,
3152,
316,
521,
710,
95,
2890,
18,
54,
97,
635,
3675,
1257,
18,
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,
2190,
67,
1576,
12,
2890,
4672,
436,
8395,
2000,
279,
3880,
358,
2006,
3152,
316,
521,
710,
95,
2890,
18,
54,
97,
635,
3675,
1257,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
res = super(res_partner, self)._membership_state(cr, uid, ids, name, args, context) for partner in self.browse(cr, uid, ids, context): | res = {} for id in ids: res[id] = 'none' today = time.strftime('%Y-%m-%d') for id in ids: partner_data = self.browse(cr,uid,id) if partner_data.membership_cancel and today > partner_data.membership_cancel: res[id] = 'canceled' continue | def _membership_state(self, cr, uid, ids, name, args, context=None): res = super(res_partner, self)._membership_state(cr, uid, ids, name, args, context) for partner in self.browse(cr, uid, ids, context): if partner.refuse_membership: res[partner.id] = 'canceled' return res | faa8a0435fe9f038779caef3b9a962ea28856704 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7339/faa8a0435fe9f038779caef3b9a962ea28856704/cci_membership.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
19679,
67,
2019,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
833,
16,
819,
33,
7036,
4672,
565,
400,
273,
2618,
364,
612,
316,
3258,
30,
400,
63,
350,
65,
273,
296,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
19679,
67,
2019,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
833,
16,
819,
33,
7036,
4672,
565,
400,
273,
2618,
364,
612,
316,
3258,
30,
400,
63,
350,
65,
273,
296,
6... |
path=pywbem.CIMInstanceName('__Namespace', | path=CIMInstanceName('__Namespace', | def _create_ns(p, handle, ns): # Figure out the flavor of cim server cimom_type = None try: inames = handle.EnumerateInstanceNames('__Namespace', namespace='root') inames = [x['name'] for x in inames] if 'PG_InterOp' in inames: cimom_type = 'pegasus' except pywbem.CIMError, ce: if ce.args[0] != pywbem.CIM_ERR_NOT_FOUND: ce.file_line = (p.parser.file, p.lexer.lineno) raise if not cimom_type: try: inames = handle.EnumerateInstanceNames('CIM_Namespace', namespace='Interop') inames = [x['name'] for x in inames] cimom_type = 'proper' except pywbem.CIMError, ce: ce.file_line = (p.parser.file, p.lexer.lineno) raise if not cimom_type: ce = pywbem.CIMError(pywbem.CIM_ERR_FAILED, 'Unable to determine CIMOM type') ce.file_line = (p.parser.file, p.lexer.lineno) raise ce if cimom_type == 'pegasus': nsl = ns.split('/') if nsl[0] != 'root': ce = pywbem.CIMError(pywbem.CIM_ERR_FAILED, 'Pegasus namespaces must start with "root"') ce.file_line = (p.parser.file, p.lexer.lineno) raise ce for i in range(1, len(nsl)): containing_ns = '/'.join(nsl[:i]) inames = handle.EnumerateInstanceNames('__Namespace', namespace=containing_ns) inames = [x['name'] for x in inames] if nsl[i] not in inames: inst = pywbem.CIMInstance('__Namespace', properties={'Name':nsl[i]}, path=pywbem.CIMInstanceName('__Namespace', keybindings={'Name':nsl[i]}, namespace=containing_ns)) handle.CreateInstance(inst) elif cimom_type == 'proper': inst = pywbem.CIMInstance('CIM_Namespace', properties={'Name': ns}, path=pywbem.CIMInstanceName('CIM_Namespace', namespace='root', keybindings={'Name':ns})) handle.CreateInstance(inst) | d1a547f385819908b15c26774bc5fc75671b5883 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10648/d1a547f385819908b15c26774bc5fc75671b5883/mof_compiler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2640,
67,
2387,
12,
84,
16,
1640,
16,
3153,
4672,
468,
18818,
596,
326,
19496,
434,
276,
381,
1438,
276,
381,
362,
67,
723,
273,
599,
775,
30,
316,
753,
273,
1640,
18,
3572,
126... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2640,
67,
2387,
12,
84,
16,
1640,
16,
3153,
4672,
468,
18818,
596,
326,
19496,
434,
276,
381,
1438,
276,
381,
362,
67,
723,
273,
599,
775,
30,
316,
753,
273,
1640,
18,
3572,
126... |
print ' print ' | print ' if self.sourceFilename: print " print ' | def do_gen_file_header(self): la = self.typelib.GetLibAttr() moduleDoc = self.typelib.GetDocumentation(-1) docDesc = "" if moduleDoc[1]: docDesc = moduleDoc[1] print '# Created by makepy.py version %s from %s' % (makepy_version,os.path.split(self.sourceFilename)[1]) print '# On date: %s' % time.ctime(time.time()) | aa11688412147511961d325aa9cd6aae83c828a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/992/aa11688412147511961d325aa9cd6aae83c828a9/genpy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
4507,
67,
768,
67,
3374,
12,
2890,
4672,
7125,
273,
365,
18,
12846,
30575,
18,
967,
5664,
3843,
1435,
1605,
1759,
273,
365,
18,
12846,
30575,
18,
967,
18905,
19236,
21,
13,
99... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4507,
67,
768,
67,
3374,
12,
2890,
4672,
7125,
273,
365,
18,
12846,
30575,
18,
967,
5664,
3843,
1435,
1605,
1759,
273,
365,
18,
12846,
30575,
18,
967,
18905,
19236,
21,
13,
99... |
xy_data_arrays = map(lambda g: [[g(x, y) for x in xsrange(*ranges[0], include_endpoint=True)] for y in xsrange(*ranges[1], include_endpoint=True)], g) xy_data_array = map(lambda *rows: map(lambda *vals: mangle_neg(vals), *rows), *xy_data_arrays) | xy_data_arrays = numpy.asarray([[[func(x, y) for x in xsrange(*ranges[0], include_endpoint=True)] for y in xsrange(*ranges[1], include_endpoint=True)] for func in g],dtype=float) xy_data_array=numpy.abs(xy_data_arrays.prod(axis=0)) neg_indices = (xy_data_arrays<0).all(axis=0) xy_data_array[neg_indices]=-xy_data_array[neg_indices] | def region_plot(f, xrange, yrange, plot_points, incol, outcol, bordercol, borderstyle, borderwidth): r""" ``region_plot`` takes a boolean function of two variables, `f(x,y)` and plots the region where f is True over the specified ``xrange`` and ``yrange`` as demonstrated below. ``region_plot(f, (xmin, xmax), (ymin, ymax), ...)`` INPUT: - ``f`` -- a boolean function of two variables - ``(xmin, xmax)`` -- 2-tuple, the range of ``x`` values OR 3-tuple ``(x,xmin,xmax)`` - ``(ymin, ymax)`` -- 2-tuple, the range of ``y`` values OR 3-tuple ``(y,ymin,ymax)`` - ``plot_points`` -- integer (default: 100); number of points to plot in each direction of the grid - ``incol`` -- a color (default: ``'blue'``), the color inside the region - ``outcol`` -- a color (default: ``'white'``), the color of the outside of the region If any of these options are specified, the border will be shown as indicated, otherwise it is only implicit (with color ``incol``) as the border of the inside of the region. - ``bordercol`` -- a color (default: ``None``), the color of the border (``'black'`` if ``borderwidth`` or ``borderstyle`` is specified but not ``bordercol``) - ``borderstyle`` -- string (default: 'solid'), one of 'solid', 'dashed', 'dotted', 'dashdot' - ``borderwidth`` -- integer (default: None), the width of the border in pixels EXAMPLES: Here we plot a simple function of two variables:: sage: x,y = var('x,y') sage: region_plot(cos(x^2+y^2) <= 0, (x, -3, 3), (y, -3, 3)) Here we play with the colors:: sage: region_plot(x^2+y^3 < 2, (x, -2, 2), (y, -2, 2), incol='lightblue', bordercol='gray') An even more complicated plot, with dashed borders:: sage: region_plot(sin(x)*sin(y) >= 1/4, (x,-10,10), (y,-10,10), incol='yellow', bordercol='black', borderstyle='dashed', plot_points=250) A disk centered at the origin:: sage: region_plot(x^2+y^2<1, (x,-1,1), (y,-1,1)).show(aspect_ratio=1) A plot with more than one condition:: sage: region_plot([x^2+y^2<1, x<y], (x,-2,2), (y,-2,2)) Since it doesn't look very good, let's increase plot_points:: sage: region_plot([x^2+y^2<1, x<y], (x,-2,2), (y,-2,2), plot_points=400).show(aspect_ratio=1) #long time The first quadrant of the unit circle:: sage: region_plot([y>0, x>0, x^2+y^2<1], (x,-1.1, 1.1), (y,-1.1, 1.1), plot_points = 400).show(aspect_ratio=1) Here is another plot, with a huge border:: sage: region_plot(x*(x-1)*(x+1)+y^2<0, (x, -3, 2), (y, -3, 3), incol='lightblue', bordercol='gray', borderwidth=10, plot_points=50) If we want to keep only the region where x is positive:: sage: region_plot([x*(x-1)*(x+1)+y^2<0, x>-1], (x, -3, 2), (y, -3, 3), incol='lightblue', plot_points=50) Here we have a cut circle:: sage: region_plot([x^2+y^2<4, x>-1], (x, -2, 2), (y, -2, 2), incol='lightblue', bordercol='gray', plot_points=200).show(aspect_ratio=1) """ from sage.plot.plot import Graphics from sage.plot.misc import setup_for_eval_on_grid if not isinstance(f, (list, tuple)): f = [f] f = [equify(g) for g in f] g, ranges = setup_for_eval_on_grid(f, [xrange, yrange], plot_points) xrange,yrange=[r[:2] for r in ranges] xy_data_arrays = map(lambda g: [[g(x, y) for x in xsrange(*ranges[0], include_endpoint=True)] for y in xsrange(*ranges[1], include_endpoint=True)], g) xy_data_array = map(lambda *rows: map(lambda *vals: mangle_neg(vals), *rows), *xy_data_arrays) from matplotlib.colors import ListedColormap incol = rgbcolor(incol) outcol = rgbcolor(outcol) cmap = ListedColormap([incol, outcol]) cmap.set_over(outcol) cmap.set_under(incol) g = Graphics() opt = contour_plot.options.copy() opt.pop('plot_points') opt.pop('fill') opt.pop('contours') opt.pop('frame') g.add_primitive(ContourPlot(xy_data_array, xrange,yrange, dict(plot_points=plot_points, contours=[-1e307, 0, 1e307], cmap=cmap, fill=True, **opt))) if bordercol or borderstyle or borderwidth: cmap = [rgbcolor(bordercol)] if bordercol else ['black'] linestyles = [borderstyle] if borderstyle else None linewidths = [borderwidth] if borderwidth else None opt.pop('linestyles') opt.pop('linewidths') g.add_primitive(ContourPlot(xy_data_array, xrange, yrange, dict(plot_points=plot_points, linestyles=linestyles, linewidths=linewidths, contours=[0], cmap=[bordercol], fill=False, **opt))) return g | b660176b0ce484abd89fe9d40eb554712a6a9e5b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/b660176b0ce484abd89fe9d40eb554712a6a9e5b/contour_plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3020,
67,
4032,
12,
74,
16,
12314,
16,
677,
3676,
16,
3207,
67,
4139,
16,
316,
1293,
16,
596,
1293,
16,
5795,
1293,
16,
5795,
4060,
16,
5795,
2819,
4672,
436,
8395,
12176,
6858,
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,
3020,
67,
4032,
12,
74,
16,
12314,
16,
677,
3676,
16,
3207,
67,
4139,
16,
316,
1293,
16,
596,
1293,
16,
5795,
1293,
16,
5795,
4060,
16,
5795,
2819,
4672,
436,
8395,
12176,
6858,
67,
... |
Return a suggested pixmap name, without extension, depending on | Return a suggested pixmap name, without extension, depending on | def getPixmap(self): """ Return a suggested pixmap name, without extension, depending on current weather. """ return self.pixmap | 432e464601ad8d6fd1d2454b664a04836415266c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4602/432e464601ad8d6fd1d2454b664a04836415266c/pymetar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1689,
697,
1458,
12,
2890,
4672,
3536,
2000,
279,
22168,
11871,
1458,
508,
16,
2887,
2710,
16,
8353,
603,
783,
21534,
18,
3536,
327,
365,
18,
14861,
1458,
2,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1689,
697,
1458,
12,
2890,
4672,
3536,
2000,
279,
22168,
11871,
1458,
508,
16,
2887,
2710,
16,
8353,
603,
783,
21534,
18,
3536,
327,
365,
18,
14861,
1458,
2,
-100,
-100,
-100,
-100,
-100... |
Note: this functions only works if Mark Hammond's win32 | Note: this function only works if Mark Hammond's win32 | def win32_ver(release='',version='',csd='',ptype=''): """ Get additional version information from the Windows Registry and return a tuple (version,csd,ptype) referring to version number, CSD level and OS type (multi/single processor). As a hint: ptype returns 'Uniprocessor Free' on single processor NT machines and 'Multiprocessor Free' on multi processor machines. The 'Free' refers to the OS version being free of debugging code. It could also state 'Checked' which means the OS version uses debugging code, i.e. code that checks arguments, ranges, etc. (Thomas Heller). Note: this functions only works if Mark Hammond's win32 package is installed and obviously only runs on Win32 compatible platforms. """ # XXX Is there any way to find out the processor type on WinXX ? # XXX Is win32 available on Windows CE ? # Adapted from code posted by Karl Putland to comp.lang.python. # Import the needed APIs try: import win32api except ImportError: return release,version,csd,ptype from win32api import RegQueryValueEx,RegOpenKeyEx,RegCloseKey,GetVersionEx from win32con import HKEY_LOCAL_MACHINE,VER_PLATFORM_WIN32_NT,\ VER_PLATFORM_WIN32_WINDOWS # Find out the registry key and some general version infos maj,min,buildno,plat,csd = GetVersionEx() version = '%i.%i.%i' % (maj,min,buildno & 0xFFFF) if csd[:13] == 'Service Pack ': csd = 'SP' + csd[13:] if plat == VER_PLATFORM_WIN32_WINDOWS: regkey = 'SOFTWARE\\Microsoft\\Windows\\CurrentVersion' # Try to guess the release name if maj == 4: if min == 0: release = '95' else: release = '98' elif maj == 5: release = '2000' elif plat == VER_PLATFORM_WIN32_NT: regkey = 'SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion' if maj <= 4: release = 'NT' elif maj == 5: release = '2000' else: if not release: # E.g. Win3.1 with win32s release = '%i.%i' % (maj,min) return release,version,csd,ptype # Open the registry key try: keyCurVer = RegOpenKeyEx(HKEY_LOCAL_MACHINE,regkey) # Get a value to make sure the key exists... RegQueryValueEx(keyCurVer,'SystemRoot') except: return release,version,csd,ptype # Parse values #subversion = _win32_getvalue(keyCurVer, # 'SubVersionNumber', # ('',1))[0] #if subversion: # release = release + subversion # 95a, 95b, etc. build = _win32_getvalue(keyCurVer, 'CurrentBuildNumber', ('',1))[0] ptype = _win32_getvalue(keyCurVer, 'CurrentType', (ptype,1))[0] # Normalize version version = _norm_version(version,build) # Close key RegCloseKey(keyCurVer) return release,version,csd,ptype | 6b6064b420f7d4f9db1b4f4e0133b349984ba8a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/6b6064b420f7d4f9db1b4f4e0133b349984ba8a5/platform.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5657,
1578,
67,
502,
12,
9340,
2218,
2187,
1589,
2218,
2187,
2143,
72,
2218,
2187,
27672,
2218,
11,
4672,
225,
3536,
968,
3312,
1177,
1779,
628,
326,
8202,
5438,
471,
327,
279,
3193,
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,
5657,
1578,
67,
502,
12,
9340,
2218,
2187,
1589,
2218,
2187,
2143,
72,
2218,
2187,
27672,
2218,
11,
4672,
225,
3536,
968,
3312,
1177,
1779,
628,
326,
8202,
5438,
471,
327,
279,
3193,
261... |
print "Maximum for magnitude estimation set: %s at %.3f" % \ | msg = "Maximum for magnitude estimation set: %s at %.3f" % \ | def pick(self, event): #import ipdb; ipdb.set_trace() #We want to round from the picking location to #the time value of the nearest time sample: samp_rate = self.streams[self.stPt][0].stats.sampling_rate pickSample = event.xdata * samp_rate pickSample = round(pickSample) pickSample = pickSample / samp_rate # we need the position of the cursor location # in the seismogram array: xpos = pickSample * samp_rate # Set new P Pick if self.flagPhase==0 and event.key==self.dictKeybindings['setPick']: self.delPLine() self.delPLabel() self.delPsynthLine() self.dicts[self.stPt]['P'] = pickSample self.drawPLine() self.drawPLabel() self.drawPsynthLine() self.drawPsynthLabel() #check if the new P pick lies outside of the Error Picks try: if self.dicts[self.stPt]['P']<self.dicts[self.stPt]['PErr1']: self.delPErr1Line() self.delPErr1() except: pass try: if self.dicts[self.stPt]['P']>self.dicts[self.stPt]['PErr2']: self.delPErr2Line() self.delPErr2() except: pass # Update all subplots self.redraw() # Console output print "P Pick set at %.3f" % self.dicts[self.stPt]['P'] # Set P Pick weight if self.dicts[self.stPt].has_key('P'): if self.flagPhase==0 and event.key==self.dictKeybindings['setPWeight0']: self.delPLabel() self.dicts[self.stPt]['PWeight']=0 self.drawPLabel() self.redraw() print "P Pick weight set to %i"%self.dicts[self.stPt]['PWeight'] if self.flagPhase==0 and event.key==self.dictKeybindings['setPWeight1']: self.delPLabel() self.dicts[self.stPt]['PWeight']=1 print "P Pick weight set to %i"%self.dicts[self.stPt]['PWeight'] self.drawPLabel() self.redraw() if self.flagPhase==0 and event.key==self.dictKeybindings['setPWeight2']: self.delPLabel() self.dicts[self.stPt]['PWeight']=2 print "P Pick weight set to %i"%self.dicts[self.stPt]['PWeight'] self.drawPLabel() self.redraw() if self.flagPhase==0 and event.key==self.dictKeybindings['setPWeight3']: self.delPLabel() self.dicts[self.stPt]['PWeight']=3 print "P Pick weight set to %i"%self.dicts[self.stPt]['PWeight'] self.drawPLabel() self.redraw() # Set P Pick polarity if self.dicts[self.stPt].has_key('P'): if self.flagPhase==0 and event.key==self.dictKeybindings['setPPolUp']: self.delPLabel() self.dicts[self.stPt]['PPol']='up' self.drawPLabel() self.redraw() print "P Pick polarity set to %s"%self.dicts[self.stPt]['PPol'] if self.flagPhase==0 and event.key==self.dictKeybindings['setPPolPoorUp']: self.delPLabel() self.dicts[self.stPt]['PPol']='poorup' self.drawPLabel() self.redraw() print "P Pick polarity set to %s"%self.dicts[self.stPt]['PPol'] if self.flagPhase==0 and event.key==self.dictKeybindings['setPPolDown']: self.delPLabel() self.dicts[self.stPt]['PPol']='down' self.drawPLabel() self.redraw() print "P Pick polarity set to %s"%self.dicts[self.stPt]['PPol'] if self.flagPhase==0 and event.key==self.dictKeybindings['setPPolPoorDown']: self.delPLabel() self.dicts[self.stPt]['PPol']='poordown' self.drawPLabel() self.redraw() print "P Pick polarity set to %s"%self.dicts[self.stPt]['PPol'] # Set P Pick onset if self.dicts[self.stPt].has_key('P'): if self.flagPhase == 0 and event.key == self.dictKeybindings['setPOnsetImpulsive']: self.delPLabel() self.dicts[self.stPt]['POnset'] = 'impulsive' self.drawPLabel() self.redraw() print "P pick onset set to %s" % self.dicts[self.stPt]['POnset'] elif self.flagPhase == 0 and event.key == self.dictKeybindings['setPOnsetEmergent']: self.delPLabel() self.dicts[self.stPt]['POnset'] = 'emergent' self.drawPLabel() self.redraw() print "P pick onset set to %s" % self.dicts[self.stPt]['POnset'] # Set new S Pick if self.flagPhase==1 and event.key==self.dictKeybindings['setPick']: self.delSLine() self.delSLabel() self.delSsynthLine() self.dicts[self.stPt]['S'] = pickSample self.dicts[self.stPt]['Saxind'] = self.axs.index(event.inaxes) self.drawSLine() self.drawSLabel() self.drawSsynthLine() self.drawSsynthLabel() #check if the new S pick lies outside of the Error Picks try: if self.dicts[self.stPt]['S']<self.dicts[self.stPt]['SErr1']: self.delSErr1Line() self.delSErr1() except: pass try: if self.dicts[self.stPt]['S']>self.dicts[self.stPt]['SErr2']: self.delSErr2Line() self.delSErr2() except: pass # Update all subplots self.redraw() # Console output print "S Pick set at %.3f" % self.dicts[self.stPt]['S'] # Set S Pick weight if self.dicts[self.stPt].has_key('S'): if self.flagPhase==1 and event.key==self.dictKeybindings['setSWeight0']: self.delSLabel() self.dicts[self.stPt]['SWeight']=0 self.drawSLabel() self.redraw() print "S Pick weight set to %i"%self.dicts[self.stPt]['SWeight'] if self.flagPhase==1 and event.key==self.dictKeybindings['setSWeight1']: self.delSLabel() self.dicts[self.stPt]['SWeight']=1 self.drawSLabel() self.redraw() print "S Pick weight set to %i"%self.dicts[self.stPt]['SWeight'] if self.flagPhase==1 and event.key==self.dictKeybindings['setSWeight2']: self.delSLabel() self.dicts[self.stPt]['SWeight']=2 self.drawSLabel() self.redraw() print "S Pick weight set to %i"%self.dicts[self.stPt]['SWeight'] if self.flagPhase==1 and event.key==self.dictKeybindings['setSWeight3']: self.delSLabel() self.dicts[self.stPt]['SWeight']=3 self.drawSLabel() self.redraw() print "S Pick weight set to %i"%self.dicts[self.stPt]['SWeight'] # Set S Pick polarity if self.dicts[self.stPt].has_key('S'): if self.flagPhase==1 and event.key==self.dictKeybindings['setSPolUp']: self.delSLabel() self.dicts[self.stPt]['SPol']='up' self.drawSLabel() self.redraw() print "S Pick polarity set to %s"%self.dicts[self.stPt]['SPol'] if self.flagPhase==1 and event.key==self.dictKeybindings['setSPolPoorUp']: self.delSLabel() self.dicts[self.stPt]['SPol']='poorup' self.drawSLabel() self.redraw() print "S Pick polarity set to %s"%self.dicts[self.stPt]['SPol'] if self.flagPhase==1 and event.key==self.dictKeybindings['setSPolDown']: self.delSLabel() self.dicts[self.stPt]['SPol']='down' self.drawSLabel() self.redraw() print "S Pick polarity set to %s"%self.dicts[self.stPt]['SPol'] if self.flagPhase==1 and event.key==self.dictKeybindings['setSPolPoorDown']: self.delSLabel() self.dicts[self.stPt]['SPol']='poordown' self.drawSLabel() self.redraw() print "S Pick polarity set to %s"%self.dicts[self.stPt]['SPol'] # Set S Pick onset if self.dicts[self.stPt].has_key('S'): if self.flagPhase == 1 and event.key == self.dictKeybindings['setSOnsetImpulsive']: self.delSLabel() self.dicts[self.stPt]['SOnset'] = 'impulsive' self.drawSLabel() self.redraw() print "S pick onset set to %s" % self.dicts[self.stPt]['SOnset'] elif self.flagPhase == 1 and event.key == self.dictKeybindings['setSOnsetEmergent']: self.delSLabel() self.dicts[self.stPt]['SOnset'] = 'emergent' self.drawSLabel() self.redraw() print "S pick onset set to %s" % self.dicts[self.stPt]['SOnset'] # Remove P Pick if self.flagPhase==0 and event.key==self.dictKeybindings['delPick']: # Try to remove all existing Pick lines and P Pick variable self.delPLine() self.delP() self.delPWeight() self.delPPol() self.delPOnset() self.delPLabel() # Try to remove existing Pick Error 1 lines and variable self.delPErr1Line() self.delPErr1() # Try to remove existing Pick Error 2 lines and variable self.delPErr2Line() self.delPErr2() # Update all subplots self.redraw() # Remove S Pick if self.flagPhase==1 and event.key==self.dictKeybindings['delPick']: # Try to remove all existing Pick lines and P Pick variable self.delSLine() self.delS() self.delSWeight() self.delSPol() self.delSOnset() self.delSLabel() # Try to remove existing Pick Error 1 lines and variable self.delSErr1Line() self.delSErr1() # Try to remove existing Pick Error 2 lines and variable self.delSErr2Line() self.delSErr2() # Update all subplots self.redraw() # Set new P Pick uncertainties if self.flagPhase==0 and event.key==self.dictKeybindings['setPickError']: # Set Flag to determine scenario try: # Set left Error Pick if pickSample < self.dicts[self.stPt]['P']: errFlag=1 # Set right Error Pick else: errFlag=2 # Set no Error Pick (no P Pick yet) except: return # Case 1 if errFlag==1: # Define global variables seen outside # Remove old lines from the plot before plotting the new ones self.delPErr1Line() # Save time value of sample nearest to error pick self.dicts[self.stPt]['PErr1'] = pickSample # Plot the lines for the P Error pick in all three traces self.drawPErr1Line() # Update all subplots self.redraw() # Console output print "P Error Pick 1 set at %.3f" % \ self.dicts[self.stPt]['PErr1'] # Case 2 if errFlag==2: # Define global variables seen outside # Remove old lines from the plot before plotting the new ones self.delPErr2Line() # Save time value of sample nearest to error pick self.dicts[self.stPt]['PErr2'] = pickSample # Plot the lines for the P Error pick in all three traces self.drawPErr2Line() # Update all subplots self.redraw() # Console output print "P Error Pick 2 set at %.3f" % \ self.dicts[self.stPt]['PErr2'] # Set new S Pick uncertainties if self.flagPhase==1 and event.key==self.dictKeybindings['setPickError']: # Set Flag to determine scenario try: # Set left Error Pick if pickSample < self.dicts[self.stPt]['S']: errFlag=1 # Set right Error Pick else: errFlag=2 # Set no Error Pick (no S Pick yet) except: return # Case 1 if errFlag==1: # Define global variables seen outside # Remove old lines from the plot before plotting the new ones self.delSErr1Line() # Save sample value of error pick (round to integer sample value) self.dicts[self.stPt]['SErr1'] = pickSample # Plot the lines for the S Error pick in all three traces self.drawSErr1Line() # Update all subplots self.redraw() # Console output print "S Error Pick 1 set at %.3f" % \ self.dicts[self.stPt]['SErr1'] # Case 2 if errFlag==2: # Define global variables seen outside # Remove old lines from the plot before plotting the new ones self.delSErr2Line() # Save sample value of error pick (round to integer sample value) self.dicts[self.stPt]['SErr2'] = pickSample # Plot the lines for the S Error pick in all three traces self.drawSErr2Line() # Update all subplots self.redraw() # Console output print "S Error Pick 2 set at %.3f" % \ self.dicts[self.stPt]['SErr2'] # Magnitude estimation picking: if self.flagPhase==2 and event.key==self.dictKeybindings['setMagMin'] and len(self.axs) > 2: if event.inaxes == self.axs[1]: self.delMagMinCross1() ydata=event.inaxes.lines[0].get_ydata() #get the first line hoping that it is the seismogram! cutoffSamples=xpos-self.magPickWindow #remember, how much samples there are before our small window! We have to add this number for our MagMinT estimation! self.dicts[self.stPt]['MagMin1']=np.min(ydata[xpos-self.magPickWindow:xpos+self.magPickWindow]) # save time of magnitude minimum in seconds tmp_magtime = cutoffSamples + np.argmin(ydata[xpos-self.magPickWindow:xpos+self.magPickWindow]) tmp_magtime = tmp_magtime / samp_rate self.dicts[self.stPt]['MagMin1T'] = tmp_magtime #delete old MagMax Pick, if new MagMin Pick is higher try: if self.dicts[self.stPt]['MagMin1'] > self.dicts[self.stPt]['MagMax1']: self.delMagMaxCross1() self.delMagMax1() except: pass self.drawMagMinCross1() self.redraw() print "Minimum for magnitude estimation set: %s at %.3f" % \ (self.dicts[self.stPt]['MagMin1'], self.dicts[self.stPt]['MagMin1T']) elif event.inaxes == self.axs[2]: self.delMagMinCross2() ydata=event.inaxes.lines[0].get_ydata() #get the first line hoping that it is the seismogram! cutoffSamples=xpos-self.magPickWindow #remember, how much samples there are before our small window! We have to add this number for our MagMinT estimation! self.dicts[self.stPt]['MagMin2']=np.min(ydata[xpos-self.magPickWindow:xpos+self.magPickWindow]) # save time of magnitude minimum in seconds tmp_magtime = cutoffSamples + np.argmin(ydata[xpos-self.magPickWindow:xpos+self.magPickWindow]) tmp_magtime = tmp_magtime / samp_rate self.dicts[self.stPt]['MagMin2T'] = tmp_magtime #delete old MagMax Pick, if new MagMin Pick is higher try: if self.dicts[self.stPt]['MagMin2'] > self.dicts[self.stPt]['MagMax2']: self.delMagMaxCross2() self.delMagMax2() except: pass self.drawMagMinCross2() self.redraw() print "Minimum for magnitude estimation set: %s at %.3f" % \ (self.dicts[self.stPt]['MagMin2'], self.dicts[self.stPt]['MagMin2T']) if self.flagPhase==2 and event.key==self.dictKeybindings['setMagMax'] and len(self.axs) > 2: if event.inaxes == self.axs[1]: self.delMagMaxCross1() ydata=event.inaxes.lines[0].get_ydata() #get the first line hoping that it is the seismogram! cutoffSamples=xpos-self.magPickWindow #remember, how much samples there are before our small window! We have to add this number for our MagMinT estimation! self.dicts[self.stPt]['MagMax1']=np.max(ydata[xpos-self.magPickWindow:xpos+self.magPickWindow]) # save time of magnitude maximum in seconds tmp_magtime = cutoffSamples + np.argmax(ydata[xpos-self.magPickWindow:xpos+self.magPickWindow]) tmp_magtime = tmp_magtime / samp_rate self.dicts[self.stPt]['MagMax1T'] = tmp_magtime #delete old MagMax Pick, if new MagMax Pick is higher try: if self.dicts[self.stPt]['MagMin1'] > self.dicts[self.stPt]['MagMax1']: self.delMagMinCross1() self.delMagMin1() except: pass self.drawMagMaxCross1() self.redraw() print "Maximum for magnitude estimation set: %s at %.3f" % \ (self.dicts[self.stPt]['MagMax1'], self.dicts[self.stPt]['MagMax1T']) elif event.inaxes == self.axs[2]: self.delMagMaxCross2() ydata=event.inaxes.lines[0].get_ydata() #get the first line hoping that it is the seismogram! cutoffSamples=xpos-self.magPickWindow #remember, how much samples there are before our small window! We have to add this number for our MagMinT estimation! self.dicts[self.stPt]['MagMax2']=np.max(ydata[xpos-self.magPickWindow:xpos+self.magPickWindow]) # save time of magnitude maximum in seconds tmp_magtime = cutoffSamples + np.argmax(ydata[xpos-self.magPickWindow:xpos+self.magPickWindow]) tmp_magtime = tmp_magtime / samp_rate self.dicts[self.stPt]['MagMax2T'] = tmp_magtime #delete old MagMax Pick, if new MagMax Pick is higher try: if self.dicts[self.stPt]['MagMin2'] > self.dicts[self.stPt]['MagMax2']: self.delMagMinCross2() self.delMagMin2() except: pass self.drawMagMaxCross2() self.redraw() print "Maximum for magnitude estimation set: %s at %.3f" % \ (self.dicts[self.stPt]['MagMax2'],self.dicts[self.stPt]['MagMax2T']) if self.flagPhase == 2 and event.key == self.dictKeybindings['delMagMinMax']: if event.inaxes == self.axs[1]: self.delMagMaxCross1() self.delMagMinCross1() self.delMagMin1() self.delMagMax1() elif event.inaxes == self.axs[2]: self.delMagMaxCross2() self.delMagMinCross2() self.delMagMin2() self.delMagMax2() else: return self.redraw() | 4e8f536428831ce605c623aa5fc17a6b33b5b712 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10346/4e8f536428831ce605c623aa5fc17a6b33b5b712/obspyck.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6002,
12,
2890,
16,
871,
4672,
468,
5666,
2359,
1966,
31,
2359,
1966,
18,
542,
67,
5129,
1435,
468,
3218,
2545,
358,
3643,
628,
326,
6002,
310,
2117,
358,
468,
5787,
813,
460,
434,
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,
6002,
12,
2890,
16,
871,
4672,
468,
5666,
2359,
1966,
31,
2359,
1966,
18,
542,
67,
5129,
1435,
468,
3218,
2545,
358,
3643,
628,
326,
6002,
310,
2117,
358,
468,
5787,
813,
460,
434,
326... |
pager(title + desc + suffix + '\n\n' + text.document(object, name)) | pager(title % (desc + suffix) + '\n\n' + text.document(thing, name)) | def doc(thing, title='Python Library Documentation: '): """Display text documentation, given an object or a path to an object.""" suffix, name = '', None if type(thing) is type(''): try: object = locate(thing) except ErrorDuringImport, value: print value return if not object: print 'no Python documentation found for %s' % repr(thing) return parts = split(thing, '.') if len(parts) > 1: suffix = ' in ' + join(parts[:-1], '.') name = parts[-1] thing = object desc = describe(thing) module = inspect.getmodule(thing) if not suffix and module and module is not thing: suffix = ' in module ' + module.__name__ pager(title + desc + suffix + '\n\n' + text.document(object, name)) | e3dab6b2374c22c9d8ca6567b59533708b7ecddc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/e3dab6b2374c22c9d8ca6567b59533708b7ecddc/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
12,
4274,
16,
2077,
2218,
15774,
18694,
20495,
30,
296,
4672,
3536,
4236,
977,
7323,
16,
864,
392,
733,
578,
279,
589,
358,
392,
733,
12123,
3758,
16,
508,
273,
10226,
599,
309,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
12,
4274,
16,
2077,
2218,
15774,
18694,
20495,
30,
296,
4672,
3536,
4236,
977,
7323,
16,
864,
392,
733,
578,
279,
589,
358,
392,
733,
12123,
3758,
16,
508,
273,
10226,
599,
309,
6... |
self.__tracker.shutter += 1 | self.__tracker.shutter += 5 | def onKeyUp(self, Event): if Event.keystring == "a": self.__tracker.threshold += 1 print "Threshold: ", self.__tracker.threshold elif Event.keystring == "y": self.__tracker.threshold -= 1 print "Threshold: ", self.__tracker.threshold elif Event.keystring == "s": self.__tracker.brightness += 5 print "Brightness: ", self.__tracker.brightness elif Event.keystring == "x": self.__tracker.brightness -= 5 print "Brightness: ", self.__tracker.brightness elif Event.keystring == "d": self.__tracker.exposure += 1 print "Exposure: ", self.__tracker.exposure elif Event.keystring == "c": self.__tracker.exposure -= 1 print "Exposure: ", self.__tracker.exposure elif Event.keystring == "f": self.__tracker.shutter += 1 print "Shutter: ", self.__tracker.shutter elif Event.keystring == "v": self.__tracker.shutter -= 1 print "Shutter: ", self.__tracker.shutter elif Event.keystring == "g": self.__tracker.gain += 1 print "Gain: ", self.__tracker.gain elif Event.keystring == "b": self.__tracker.gain -= 1 print "Gain: ", self.__tracker.gain | 32c6d30b38b70a4a13cdb2c0fe854dd158aeaa21 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7300/32c6d30b38b70a4a13cdb2c0fe854dd158aeaa21/TestTracking.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
653,
1211,
12,
2890,
16,
2587,
4672,
309,
2587,
18,
856,
1080,
422,
315,
69,
6877,
365,
16186,
16543,
18,
8699,
1011,
404,
1172,
315,
7614,
30,
3104,
365,
16186,
16543,
18,
8699,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
653,
1211,
12,
2890,
16,
2587,
4672,
309,
2587,
18,
856,
1080,
422,
315,
69,
6877,
365,
16186,
16543,
18,
8699,
1011,
404,
1172,
315,
7614,
30,
3104,
365,
16186,
16543,
18,
8699,
... |
def usage (error=True): if error: sys.stderr.write (USAGE) sys.exit (1) else: print USAGE sys.exit (0) def warning (msg): | def warning(msg): | def usage (error=True): if error: sys.stderr.write (USAGE) sys.exit (1) else: print USAGE sys.exit (0) | a258ae866ad40d7092b84a6b1737df504976b56c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12637/a258ae866ad40d7092b84a6b1737df504976b56c/fdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
261,
1636,
33,
5510,
4672,
309,
555,
30,
2589,
18,
11241,
18,
2626,
261,
29550,
13,
2589,
18,
8593,
261,
21,
13,
469,
30,
1172,
11836,
2833,
2589,
18,
8593,
261,
20,
13,
225,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
261,
1636,
33,
5510,
4672,
309,
555,
30,
2589,
18,
11241,
18,
2626,
261,
29550,
13,
2589,
18,
8593,
261,
21,
13,
469,
30,
1172,
11836,
2833,
2589,
18,
8593,
261,
20,
13,
225,
2... |
def __hash__(self): """ The hash of self. EXAMPLES: sage: V = QQ^7 sage: V.__hash__() 153079684 -3713095619189944444 sage: U = QQ^7 sage: U.__hash__() 153079684 -3713095619189944444 sage: U is V True """ raise NotImplementedError | def __init__(self, base_ring, rank, degree, sparse=False): """ Create the free module of given rank over the given base_ring. | e486bb9013bae5a0f10562921c7ce3e5fa30872c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/e486bb9013bae5a0f10562921c7ce3e5fa30872c/free_module.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1026,
67,
8022,
16,
6171,
16,
10782,
16,
9387,
33,
8381,
4672,
3536,
1788,
326,
4843,
1605,
434,
864,
6171,
1879,
326,
864,
1026,
67,
8022,
18,
2,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1026,
67,
8022,
16,
6171,
16,
10782,
16,
9387,
33,
8381,
4672,
3536,
1788,
326,
4843,
1605,
434,
864,
6171,
1879,
326,
864,
1026,
67,
8022,
18,
2,
-100,
... | |
multiValue = ','.join(['"'+x.strip()+'"' for x in attrValue]) | multiValue = ','.join(['"'+str(x).strip()+'"' for x in attrValue]) | def buildCondition(self, condDict, older=None, newer=None, timeStamp=None,orderAttribute=False,limit=False): """ Build SQL condition statement from provided condDict and other extra check on a specified time stamp. The conditions dictionary specifies for each attribute one or a List of possible values """ condition = '' conjunction = "WHERE" | 5fbe984b60ef9ff77a8dfa629f59647616463886 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12864/5fbe984b60ef9ff77a8dfa629f59647616463886/DB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
3418,
12,
2890,
16,
6941,
5014,
16,
12156,
33,
7036,
16,
16069,
33,
7036,
16,
18198,
33,
7036,
16,
1019,
1499,
33,
8381,
16,
3595,
33,
8381,
4672,
3536,
3998,
3063,
2269,
3021,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
3418,
12,
2890,
16,
6941,
5014,
16,
12156,
33,
7036,
16,
16069,
33,
7036,
16,
18198,
33,
7036,
16,
1019,
1499,
33,
8381,
16,
3595,
33,
8381,
4672,
3536,
3998,
3063,
2269,
3021,
6... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.