rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
elif elt_id == 'blockFont': if attr.has_key('name') == True: if attr.has_key('size') == False: style.add('FONT', attr['start'], attr['stop'], attr['name']) else: if attr.has_key('leading') == False: attr['size'] = to_float(attr['size']) style.add('FONT', attr['start'], attr['stop'], attr['name'], attr['size']) else: attr['size'] = to_float(attr['size']) attr['leading'] = to_float(attr['leading']) style.add('FONT', attr['start'], attr['stop'], attr['name'], attr['size'], attr['leading']) | def add_table_style(pdf_table_style, id, table_style): """ """ exist = pdf_table_style.get(id, None) if exist is None: style = TableStyle() for elt in table_style: elt_id, attrs, xxx = elt # default start & stop start = (0, 0) stop = (-1, -1) attr = {} # attributes bag for key, value in attrs.iteritems(): key = key[1] # start and stop value if key in ['start', 'stop']: t = value.split(',') _tuple = [] for v in t: try: _tuple.append(int(float(v))) except ValueError: pass if len(_tuple) >= 2: if key == 'start': start = tuple(_tuple) else: stop = tuple(_tuple) else: attr[key] = value attr['start'] = start attr['stop'] = stop if elt_id == 'blockTextColor': if attr.has_key('colorName'): attr['colorName'] = getattr(colors, attr['colorName'], colors.black) style.add('TEXTCOLOR', attr['start'], attr['stop'], attr['colorName']) else: # tag not well formed pass elif elt_id == 'blockFont': if attr.has_key('name') == True: # fontname, optional fontsize and optional leading if attr.has_key('size') == False: style.add('FONT', attr['start'], attr['stop'], attr['name']) else: if attr.has_key('leading') == False: attr['size'] = to_float(attr['size']) style.add('FONT', attr['start'], attr['stop'], attr['name'], attr['size']) else: attr['size'] = to_float(attr['size']) attr['leading'] = to_float(attr['leading']) style.add('FONT', attr['start'], attr['stop'], attr['name'], attr['size'], attr['leading']) else: # tag not well formed pass elif elt_id == 'blockBackground': if attr.has_key('colorName') == True: attr['colorName'] = getattr(colors, attr['colorName'], colors.black) style.add('BACKGROUND', attr['start'], attr['stop'], attr['colorName']) else: # tag not well formed pass elif elt_id == 'blockLeading': if attr.has_key('length') == True: attr['length'] = to_float(attr['length']) style.add('LEADING', attr['start'], attr['stop'], attr['length']) else: # tag not well formed pass elif elt_id == 'blockAlignment': if attr.has_key('value') == True: if attr['value'] not in ['LEFT', 'RIGHT', 'CENTER', 'CENTRE']: attr['value'] = 'LEFT' style.add('ALIGNMENT', attr['start'], attr['stop'], attr['value']) else: # tag not well formed pass elif elt_id == 'blockValign': if attr.has_key('value') == True: if attr['value'] not in ['TOP', 'MIDDLE', 'BOTTOM']: attr['value'] = 'BOTTOM' style.add('VALIGN', attr['start'], attr['stop'], attr['value']) else: # tag not well formed pass elif elt_id in ['blockLeftPadding', 'blockRightPadding', 'blockTopPadding', 'blockBottomPadding']: if attr.has_key('length') == True: attr['length'] = get_value_reportlab(attr['length']) style.add(elt_id[5:].upper(), attr['start'], attr['stop'], attr['length']) else: # tag not well formed pass elif elt_id == 'lineStyle': kind_ok = attr.has_key('kind') color_ok = attr.has_key('colorName') if kind_ok and color_ok: if attr['kind'] not in ['GRID', 'BOX', 'OUTLINE', 'INNERGRID', 'LINEBELOW', 'LINEABOVE', 'LINEBEFORE', 'LINEAFTER']: pass else: attr['colorName'] = getattr(colors, attr['colorName'], colors.black) if attr.has_key('thickness') == False: attr['thickness'] = 1 attr['thickness'] = to_float(attr['thickness'], 1) style.add(attr['kind'], attr['start'], attr['stop'], attr['thickness'], attr['colorName']) else: # tag not well formed pass pdf_table_style[id] = style else: pass | 51b02e012792ad1fcdef1300580c1d6a58548c1f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12681/51b02e012792ad1fcdef1300580c1d6a58548c1f/rml.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
2121,
67,
4060,
12,
7699,
67,
2121,
67,
4060,
16,
612,
16,
1014,
67,
4060,
4672,
3536,
3536,
1005,
273,
8169,
67,
2121,
67,
4060,
18,
588,
12,
350,
16,
599,
13,
309,
1005,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
2121,
67,
4060,
12,
7699,
67,
2121,
67,
4060,
16,
612,
16,
1014,
67,
4060,
4672,
3536,
3536,
1005,
273,
8169,
67,
2121,
67,
4060,
18,
588,
12,
350,
16,
599,
13,
309,
1005,
... | |
sendReport("Demobrowser") | sendReport("Demobrowser",trunkrev) | def main(): if ( isSeleniumServer() ): print("Selenium server seems to be running.") else: seleniumserver() if ( isSeleniumServer() ): invoke_external("svn up " + testConf['simulatorSvn']) clearLogs() invoke_external(getStartCmd('Testrunner', 'IE')) invoke_external(getStartCmd('Testrunner', 'Safari4b')) invoke_external(testConf['logFormat']) sendReport("Testrunner") clearLogs() invoke_external("wscript proxyEnable.vbs") invoke_external(getStartCmd('Demobrowser', 'IE')) invoke_external("wscript proxyDisable.vbs") invoke_external(testConf['logFormat']) sendReport("Demobrowser") invoke_external("wscript ProcessKillLocalSaf.vbs") clearLogs() invoke_external(getStartCmd('Feedreader', 'IE')) invoke_external(testConf['logFormat']) sendReport("Feedreader") clearLogs() invoke_external(getStartCmd('Playground', 'IE')) invoke_external(testConf['logFormat']) sendReport("Playground") else: print("Couldn't contact Selenium server.") | 61a80dd472f991f30df4cad15c5890fa6a589966 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/61a80dd472f991f30df4cad15c5890fa6a589966/test_remote.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
309,
261,
353,
1877,
17327,
2081,
1435,
262,
30,
1172,
2932,
1877,
17327,
1438,
12001,
358,
506,
3549,
1199,
13,
469,
30,
29480,
3567,
1435,
309,
261,
353,
1877,
17327,
2081,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
309,
261,
353,
1877,
17327,
2081,
1435,
262,
30,
1172,
2932,
1877,
17327,
1438,
12001,
358,
506,
3549,
1199,
13,
469,
30,
29480,
3567,
1435,
309,
261,
353,
1877,
17327,
2081,
... |
model.GroupPackageListingAcl.c.statuscode == model.StatusTranslation.c.statuscodeid, model.StatusTranslation.c.statusname=='Approved', | model.GroupPackageListingAcl.c.statuscode == self.approvedStatus, | def vcs(self): '''Return ACLs for the version control system. | 5ecf8fa1d53c193303673a40608632675306b20e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9953/5ecf8fa1d53c193303673a40608632675306b20e/acls.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20255,
12,
2890,
4672,
9163,
990,
10098,
87,
364,
326,
1177,
3325,
2619,
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,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20255,
12,
2890,
4672,
9163,
990,
10098,
87,
364,
326,
1177,
3325,
2619,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
modname = modname + dirname + '.' | modname = dirname + '.' + modname | 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 | 95d1af4e18b93b11953b85f747002d365174eeef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/95d1af4e18b93b11953b85f747002d365174eeef/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... |
self.assertEqual(cl.parsePropsFromForm(create=1), | self.assertEqual(cl.parsePropsFromForm(create=1), | def testMixedMultilink(self): form = cgi.FieldStorage() form.list.append(cgi.MiniFieldStorage('nosy', '1,2')) form.list.append(cgi.MiniFieldStorage('nosy', '3')) cl = client.Client(self.instance, None, {'PATH_INFO':'/'}, form) cl.classname = 'issue' cl.nodeid = None cl.db = self.db self.assertEqual(cl.parsePropsFromForm(create=1), ({('issue', None): {'nosy': ['1','2', '3']}}, [])) | cf3a1ba5bb05cb09dd642ded3a53a72d13c7fc39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/cf3a1ba5bb05cb09dd642ded3a53a72d13c7fc39/test_cgi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
19846,
5049,
330,
754,
12,
2890,
4672,
646,
273,
276,
10052,
18,
974,
3245,
1435,
646,
18,
1098,
18,
6923,
12,
19062,
18,
2930,
77,
974,
3245,
2668,
18050,
93,
2187,
296,
21,
16,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
19846,
5049,
330,
754,
12,
2890,
4672,
646,
273,
276,
10052,
18,
974,
3245,
1435,
646,
18,
1098,
18,
6923,
12,
19062,
18,
2930,
77,
974,
3245,
2668,
18050,
93,
2187,
296,
21,
16,... |
self.printout_item_list(views.downloadingItems, views.pausedItems) | self.printout_item_list(item.Item.downloading_view(), item.Item.paused_view()) | def do_items(self, line): """items -- Lists the items in the feed/playlist/tab selected.""" if self.selection_type is None: print "Error: No tab/feed/playlist selected" return elif self.selection_type == 'feed': feed = self.tab.obj view = feed.items.sort(feed.itemSort.sort) self.printout_item_list(view) view.unlink() elif self.selection_type == 'playlist': playlist = self.tab.obj self.printout_item_list(playlist.getView()) elif self.selection_type == 'downloads': self.printout_item_list(views.downloadingItems, views.pausedItems) elif self.selection_type == 'channel-folder': folder = self.tab.obj allItems = views.items.filterWithIndex( indexes.itemsByChannelFolder, folder) allItemsSorted = allItems.sort(folder.itemSort.sort) self.printout_item_list(allItemsSorted) allItemsSorted.unlink() else: raise ValueError("Unknown tab type") | ba7e51e3e03d9068a7e95e9beba806bfd19f9f19 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12354/ba7e51e3e03d9068a7e95e9beba806bfd19f9f19/interpreter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
3319,
12,
2890,
16,
980,
4672,
3536,
3319,
1493,
11592,
326,
1516,
316,
326,
4746,
19,
1601,
1098,
19,
7032,
3170,
12123,
309,
365,
18,
10705,
67,
723,
353,
599,
30,
1172,
315... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
3319,
12,
2890,
16,
980,
4672,
3536,
3319,
1493,
11592,
326,
1516,
316,
326,
4746,
19,
1601,
1098,
19,
7032,
3170,
12123,
309,
365,
18,
10705,
67,
723,
353,
599,
30,
1172,
315... |
self.processCommand(cmd) | self.processCommand(cmd, None, True) | def run(self): # some default values self.uniqueid = "1337" self.password = "" self.username = "GameBot_"+str(self.cid) self.buffersize = 1 self.truckname = "spectator" while self.runCond: if len(self.startupCommands) > 0: cmd = self.startupCommands.pop(0).strip() if cmd != "": self.logger.debug('executing startup command %s' % cmd) self.processCommand(cmd) repeat = (len(startupCommands) > 0) packet = self.receiveMsg() if not packet is None: # record the used vehicles if packet.command == MSG2_USE_VEHICLE: data = str(packet.data).split('\0') self.oclients[packet.source] = data if self.mode == MODE_RECORD and packet.source in self.recordmask and packet.command in [MSG2_VEHICLE_DATA, MSG2_CHAT]: packet.time = time.time() self.record.buffersize = packet.size self.record.list.append(packet) self.logger.debug('recorded frame %d of client %d, buffersize %d' % (len(self.record.list), packet.source, packet.size)) if self.mode == MODE_RECORD and packet.source in self.recordmask and packet.command == MSG2_DELETE: fn = self.newRecordname() self.saveRecording(fn, self.record) self.sendChat("saved recording as %s (client exited)" % os.path.basename(fn)) self.mode = MODE_NORMAL if self.mode == MODE_RECORD and len(self.record.list) > 1000: fn = self.newRecordname() self.saveRecording(fn, self.record) self.sendChat("saved recording as %s (recording limit reached)" % os.path.basename(fn)) self.mode = MODE_NORMAL if packet.command == MSG2_CHAT: self.processCommand(str(packet.data), packet) | 0704dd527577ab16439fc1c0238a65d2d665d959 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5557/0704dd527577ab16439fc1c0238a65d2d665d959/client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
468,
2690,
805,
924,
365,
18,
6270,
350,
273,
315,
3437,
6418,
6,
365,
18,
3664,
273,
1408,
365,
18,
5053,
273,
315,
12496,
6522,
9548,
15,
701,
12,
2890,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
468,
2690,
805,
924,
365,
18,
6270,
350,
273,
315,
3437,
6418,
6,
365,
18,
3664,
273,
1408,
365,
18,
5053,
273,
315,
12496,
6522,
9548,
15,
701,
12,
2890,
18,
1... |
cssid = wikiutil.quoteWikinameURL(ch).replace('%','') | cssid = "idx" + wikiutil.quoteWikinameURL(ch).replace('%','') | def letter_link(ch): cssid = wikiutil.quoteWikinameURL(ch).replace('%','') return fmt.anchorlink(1, cssid) + fmt.text(ch.replace('~', 'Others')) + fmt.anchorlink(0) | 91dc4b9c10c100cb5efdc225aec6c3910ec50c7f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/888/91dc4b9c10c100cb5efdc225aec6c3910ec50c7f/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9471,
67,
1232,
12,
343,
4672,
3747,
350,
273,
315,
3465,
6,
397,
9050,
1367,
18,
6889,
59,
1766,
267,
339,
1785,
12,
343,
2934,
2079,
29909,
17023,
6134,
327,
1325,
18,
16215,
1232,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9471,
67,
1232,
12,
343,
4672,
3747,
350,
273,
315,
3465,
6,
397,
9050,
1367,
18,
6889,
59,
1766,
267,
339,
1785,
12,
343,
2934,
2079,
29909,
17023,
6134,
327,
1325,
18,
16215,
1232,
1... |
plus() | inc_indent() | def compileNode(node,optns): global pretty global indent ##################################################################################################################### # Recover styling ##################################################################################################################### if pretty: # Recover exclicit breaks if node.get("breakBefore", False) and not node.isFirstChild(True): sep() # Additional explicit break before complex blocks if node.hasParent() and not node.isFirstChild(True) and node.parent.type in ["block", "file"] and node.isComplex(): sep() ##################################################################################################################### # Insert comments before ##################################################################################################################### if pretty: if node.getChild("commentsBefore", False) != None: commentCounter = 0 commentsBefore = node.getChild("commentsBefore") isFirst = node.isFirstChild() previous = node.getPreviousSibling(False, True) if previous and previous.type in ["case", "default"]: inCase = True else: inCase = False inOperation = node.parent.type in ["first", "second", "third"] and node.parent.parent.type == "operation" for child in commentsBefore.children: docComment = child.get("detail") in ["javadoc", "qtdoc"] headComment = child.get("detail") == "header" areaComment = child.get("detail") == "area" divComment = child.get("detail") == "divider" blockComment = child.get("detail") == "block" singleLineBlock = child.get("detail") != "inline" and child.get("multiline") == False if not child.isFirstChild(): pass elif inCase: pass elif singleLineBlock: if child.get("begin"): sep() else: space() elif areaComment and not isFirst: area() elif divComment and not isFirst: divide() elif not isFirst: if docComment: doc() else: sep() elif inOperation: sep() elif not headComment: line() # reindenting first text = child.get("text") if child.get("detail") == "qtdoc": text = comment.qt2javadoc(text) #write(comment.indent(text, INDENTSPACES * indent)) write(comment.indent(text, optns.prettypIndentString * indent)) if singleLineBlock: if docComment: line() elif child.get("end"): sep() else: space() # separator after divider/head comments and after block comments which are not for documentation elif headComment or areaComment or divComment or blockComment: sep() else: line() ##################################################################################################################### # Opening... ##################################################################################################################### # # OPEN: FINALLY ################################## if node.type == "finally": write("finally") # # OPEN: DELETE ################################## elif node.type == "delete": write("delete") space() # # OPEN: THROW ################################## elif node.type == "throw": write("throw") space() # # OPEN: NEW ################################## elif node.type == "instantiation": write("new") space() # # OPEN: RETURN ################################## elif node.type == "return": write("return") if node.hasChildren(): space() # # OPEN: DEFINITION LIST ################################## elif node.type == "definitionList": write("var") space() # # OPEN: BREAK ################################## elif node.type == "break": write("break") if node.get("label", False): space() write(node.get("label", False)) # # OPEN: CONTINUE ################################## elif node.type == "continue": write("continue") if node.get("label", False): space() write(node.get("label", False)) # # OPEN: FUNCTION ################################## elif node.type == "function": write("function") functionName = node.get("name", False) if functionName != None: space() write(functionName) # # OPEN: IDENTIFIER ################################## elif node.type == "identifier": name = node.get("name", False) if name != None: write(name) # # OPEN: DEFINITION ################################## elif node.type == "definition": if node.parent.type != "definitionList": write("var") space() write(node.get("identifier")) # # OPEN: CONSTANT ################################## elif node.type == "constant": if node.get("constantType") == "string": if node.get("detail") == "singlequotes": write("'") else: write('"') write(node.get("value")) if node.get("detail") == "singlequotes": write("'") else: write('"') else: write(node.get("value")) # # OPEN: COMMENT ################################## elif node.type == "comment": if pretty: commentText = node.get("text") # insert a space before and no newline in the case of after comments if node.get("connection") == "after": noline() if optns.prettypCommentsInlinePadding: commentText.strip() commentText = optns.prettypCommentsInlinePadding + commentText else: space() ##space() ##write(node.get("text")) write(commentText) # new line after inline comment (for example for syntactical reasons) #if (node.get("detail") == "inline") or (node.get("multiline") == False): if (node.get("detail") == "inline") or (node.get("end") == True): line() else: space() # # OPEN: RIGHT ################################## elif node.type == "right": if node.parent.type == "accessor": write(".") # # OPEN: ASSIGNMENT ################################## elif node.type == "assignment": if node.parent.type == "definition": oper = node.get("operator", False) # be compact in for-loops compact = inForLoop(node) compileToken(oper, compact) # # OPEN: KEY ################################## elif node.type == "key": if node.parent.type == "accessor": write("[") # # OPEN: GROUP ################################## elif node.type == "group": write("(") # # OPEN: VOID ################################## elif node.type == "void": write("void") write("(") # # OPEN: ARRAY ################################## elif node.type == "array": write("[") if node.hasChildren(True): space(False) # # OPEN: PARAMS ################################## elif node.type == "params": noline() write("(") # # OPEN: CASE ################################## elif node.type == "case": if pretty: # force double new lines if not node.isFirstChild() and not node.getPreviousSibling(True).type == "case": sep() minus() line() write("case") space() # # OPEN: DEFAULT ################################## elif node.type == "default": if pretty: minus() # force double new lines if not node.getPreviousSibling(True).type == "case": sep() write("default") write(":") if pretty: plus() line() # # OPEN: TRY ################################## elif node.type == "switch": # Additional new line before each switch/try if not node.isFirstChild(True) and not node.getChild("commentsBefore", False): prev = node.getPreviousSibling(False, True) # No separation after case statements if prev != None and prev.type in ["case", "default"]: pass else: sep() if node.get("switchType") == "catch": write("try") elif node.get("switchType") == "case": write("switch") # # OPEN: CATCH ################################## elif node.type == "catch": if pretty: # If this statement block or the previous try were not complex, be not complex here, too if not node.getChild("statement").getChild("block").isComplex() and not node.parent.getChild("statement").getChild("block").isComplex(): noline() space() write("catch") # # OPEN: MAP ################################## elif node.type == "map": par = node.parent if pretty: postProcessMap(node) if pretty: # No break before return statement if node.hasParent() and node.parent.type == "expression" and node.parent.parent.type == "return": pass elif ((node.isComplex() and not (optns.prettypOpenCurlyNewlineBefore in "nN")) or (optns.prettypOpenCurlyNewlineBefore in "aA")): line() if optns.prettypOpenCurlyIndentBefore: plus() write("{") if pretty: if node.isComplex(): line() plus() elif node.hasChildren(True): space() # # OPEN: KEYVALUE ################################## elif node.type == "keyvalue": keyString = node.get("key") keyQuote = node.get("quote", False) if keyQuote != None: # print "USE QUOTATION" if keyQuote == "doublequotes": keyString = '"' + keyString + '"' else: keyString = "'" + keyString + "'" elif keyString in config.JSPROTECTED or not KEY.match(keyString): print "Warning: Auto protect key: %s" % keyString keyString = "\"" + keyString + "\"" if pretty and not node.isFirstChild(True) and not node.hasChild("commentsBefore") and node.getChild("value").isComplex(): sep() write(keyString) space(False) # Fill with spaces # Do this only if the parent is complex (many entries) # But not if the value itself is complex if pretty and node.parent.isComplex() and node.parent.get("alignValues"): write(" " * (node.parent.get("maxKeyLength") - len(keyString))) write(":") space(False) # # OPEN: BLOCK ################################## elif node.type == "block": if pretty: if ((node.isComplex() and not (optns.prettypOpenCurlyNewlineBefore in "nN")) or (optns.prettypOpenCurlyNewlineBefore in "aA")): line() else: space() if optns.prettypOpenCurlyIndentBefore: plus() write("{") if pretty: if node.hasChildren(): plus() line() # # OPEN: LOOP ################################## elif node.type == "loop": # Additional new line before each loop if not node.isFirstChild(True) and not node.getChild("commentsBefore", False): prev = node.getPreviousSibling(False, True) # No separation after case statements if prev != None and prev.type in ["case", "default"]: pass elif node.hasChild("elseStatement") or node.getChild("statement").hasBlockChildren(): sep() else: line() loopType = node.get("loopType") if loopType == "IF": write("if") space(False) elif loopType == "WHILE": write("while") space(False) elif loopType == "FOR": write("for") space(False) elif loopType == "DO": write("do") space(False) elif loopType == "WITH": write("with") space(False) else: print "Warning: Unknown loop type: %s" % loopType # # OPEN: ELSE ################################## elif node.type == "elseStatement": if node.hasChild("commentsBefore"): pass elif pretty: if not node.hasChild("block") and not node.hasChild("loop"): pass elif not node.isComplex(): noline() space() write("else") # This is a elseStatement without a block around (a set of {}) if not node.hasChild("block"): space() # # OPEN: EXPRESSION ################################## elif node.type == "expression": if node.parent.type == "loop": loopType = node.parent.get("loopType") # only do-while loops if loopType == "DO": if pretty: stmnt = node.parent.getChild("statement") compact = stmnt.hasChild("block") and not stmnt.getChild("block").isComplex() if compact: noline() space() write("while") if pretty: space() # open expression block of IF/WHILE/DO-WHILE/FOR statements write("(") elif node.parent.type == "catch": # open expression block of CATCH statement write("(") elif node.parent.type == "switch" and node.parent.get("switchType") == "case": # open expression block of SWITCH statement write("(") # # OPEN: FIRST ################################## elif node.type == "first": # for loop if node.parent.type == "loop" and node.parent.get("loopType") == "FOR": write("(") # operation elif node.parent.type == "operation": # operation (var a = -1) if node.parent.get("left", False) == True: compileToken(node.parent.get("operator"), True) # # OPEN: SECOND ################################## elif node.type == "second": # for loop if node.parent.type == "loop" and node.parent.get("loopType") == "FOR": if not node.parent.hasChild("first"): write("(;") # operation elif node.parent.type == "operation": if node.isComplex(): # (?: hook operation) if node.parent.get("operator") == "HOOK": sep() else: line() # # OPEN: THIRD ################################## elif node.type == "third": # for loop if node.parent.type == "loop" and node.parent.get("loopType") == "FOR": if not node.parent.hasChild("second"): if node.parent.hasChild("first"): write(";") space(False) else: write("(;;") # operation elif node.parent.type == "operation": # (?: hook operation) if node.parent.get("operator") == "HOOK": if node.isComplex(): sep() # # OPEN: STATEMENT ################################## elif node.type == "statement": # for loop if node.parent.type == "loop" and node.parent.get("loopType") == "FOR": if node.parent.get("forVariant") == "iter": if not node.parent.hasChild("first") and not node.parent.hasChild("second") and not node.parent.hasChild("third"): write("(;;"); elif not node.parent.hasChild("second") and not node.parent.hasChild("third"): write(";") write(")") if not node.hasChild("block"): space(False) ##################################################################################################################### # Children content ##################################################################################################################### if node.hasChildren(): for child in node.children: if not node.type in ["commentsBefore", "commentsAfter"]: compileNode(child,optns) ##################################################################################################################### # Closing node ##################################################################################################################### # # CLOSE: IDENTIFIER ################################## if node.type == "identifier": if node.hasParent() and node.parent.type == "variable" and not node.isLastChild(True): write(".") elif node.hasParent() and node.parent.type == "label": write(":") # # CLOSE: ACCESSOR ################################## elif node.type == "accessor": if node.hasParent() and node.parent.type == "variable" and not node.isLastChild(True): write(".") # # CLOSE: KEYVALUE ################################## elif node.type == "keyvalue": if node.hasParent() and node.parent.type == "map" and not node.isLastChild(True): noline() write(",") if pretty: commentNode(node) if node.getChild("value").isComplex(): sep() elif node.parent.isComplex(): line() else: space() # # CLOSE: DEFINITION ################################## elif node.type == "definition": if node.hasParent() and node.parent.type == "definitionList" and not node.isLastChild(True): write(",") if pretty: commentNode(node) if node.hasComplexChildren(): line() else: space() # # CLOSE: LEFT ################################## elif node.type == "left": if node.hasParent() and node.parent.type == "assignment": oper = node.parent.get("operator", False) # be compact in for-loops compact = inForLoop(node) compileToken(oper, compact) # # CLOSE: KEY ################################## elif node.type == "key": if node.hasParent() and node.parent.type == "accessor": write("]") # # CLOSE: GROUP ################################## elif node.type == "group": if node.getChildrenLength(True) == 1: noline() write(")") # # CLOSE: VOID ################################## elif node.type == "void": if node.getChildrenLength(True) == 1: noline() write(")") # # CLOSE: ARRAY ################################## elif node.type == "array": if node.hasChildren(True): space(False) write("]") # # CLOSE: PARAMS ################################## elif node.type == "params": write(")") # # CLOSE: MAP ################################## elif node.type == "map": if pretty: if node.isComplex(): line() minus() elif node.hasChildren(True): space() write("}") if pretty: if optns.prettypOpenCurlyIndentBefore: minus() # # CLOSE: SWITCH ################################## elif node.type == "switch": if node.get("switchType") == "case": if pretty: minus() minus() line() write("}") if pretty: commentNode(node) line() if optns.prettypOpenCurlyIndentBefore: minus() # Force a additinal line feed after each switch/try if pretty and not node.isLastChild(): sep() # # CLOSE: CASE ################################## elif node.type == "case": write(":") if pretty: commentNode(node) plus() line() # # CLOSE: BLOCK ################################## elif node.type == "block": if pretty and node.hasChildren(): minus() line() write("}") if pretty: commentNode(node) if node.hasChildren(): # Newline afterwards if node.parent.type == "body" and node.parent.parent.type == "function": # But only when this isn't a function block inside a assignment if node.parent.parent.parent.type in ["right", "params"]: pass elif node.parent.parent.parent.type == "value" and node.parent.parent.parent.parent.type == "keyvalue": pass else: line() else: line() if optns.prettypOpenCurlyIndentBefore: minus() # # CLOSE: LOOP ################################## elif node.type == "loop": if node.get("loopType") == "DO": semicolon() if pretty: commentNode(node) # Force a additinal line feed after each loop if not node.isLastChild(): if node.hasChild("elseStatement"): sep() elif node.getChild("statement").hasBlockChildren(): sep() else: line() # # CLOSE: FUNCTION ################################## elif node.type == "function": if pretty: commentNode(node) if not node.isLastChild() and node.hasParent() and node.parent.type in ["block", "file"]: sep() # # CLOSE: EXPRESSION ################################## elif node.type == "expression": if node.parent.type == "loop": write(")") # e.g. a if-construct without a block {} if node.parent.getChild("statement").hasChild("block"): pass elif node.parent.getChild("statement").hasChild("emptyStatement"): pass elif node.parent.type == "loop" and node.parent.get("loopType") == "DO": pass else: space(False) elif node.parent.type == "catch": write(")") elif node.parent.type == "switch" and node.parent.get("switchType") == "case": write(")") if pretty: commentNode(node) line() if optns.prettypOpenCurlyIndentBefore: plus() write("{") if pretty: plus() plus() # # CLOSE: FIRST ################################## elif node.type == "first": # for loop if node.parent.type == "loop" and node.parent.get("loopType") == "FOR": if node.parent.get("forVariant") == "iter": write(";") if node.parent.hasChild("second"): space(False) # operation elif node.parent.type == "operation" and node.parent.get("left", False) != True: oper = node.parent.get("operator") # be compact in for loops compact = inForLoop(node) compileToken(oper, compact) # # CLOSE: SECOND ################################## elif node.type == "second": # for loop if node.parent.type == "loop" and node.parent.get("loopType") == "FOR": write(";") if node.parent.hasChild("third"): space(False) # operation elif node.parent.type == "operation": # (?: hook operation) if node.parent.get("operator") == "HOOK": noline() space(False) write(":") space(False) # # CLOSE: OTHER ################################## if node.hasParent() and not node.type in ["comment", "commentsBefore", "commentsAfter"]: # Add comma dividers between statements in these parents if node.parent.type in ["array", "params", "statementList"]: if not node.isLastChild(True): write(",") if pretty: commentNode(node) if node.isComplex(): line() else: space() # Semicolon handling elif node.type in ["group", "block", "assignment", "call", "operation", "definitionList", "return", "break", "continue", "delete", "accessor", "instantiation", "throw", "variable", "emptyStatement"]: # Default semicolon handling if node.parent.type in ["block", "file"]: semicolon() if pretty: commentNode(node) line() if node.isComplex() and not node.isLastChild(): sep() # Special handling for switch statements elif node.parent.type == "statement" and node.parent.parent.type == "switch" and node.parent.parent.get("switchType") == "case": semicolon() if pretty: commentNode(node) line() if node.isComplex() and not node.isLastChild(): sep() # Special handling for loops (e.g. if) without blocks {} elif ( node.parent.type in ["statement", "elseStatement"] and not node.parent.hasChild("block") and node.parent.parent.type == "loop" ): semicolon() if pretty: commentNode(node) line() if node.isComplex() and not node.isLastChild(): sep() # # CLOSE: OTHER ################################## if pretty: # Rest of the after comments (not inserted previously) commentNode(node) | 6ae6ed47bd06d9e4a84ff98ecaaaa5baa53ddb47 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5718/6ae6ed47bd06d9e4a84ff98ecaaaa5baa53ddb47/compiler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4074,
907,
12,
2159,
16,
3838,
2387,
4672,
225,
2552,
7517,
2552,
3504,
377,
28256,
10140,
5516,
1970,
468,
868,
3165,
16253,
2456,
28256,
10140,
5516,
1970,
225,
309,
7517,
30,
468,
868,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4074,
907,
12,
2159,
16,
3838,
2387,
4672,
225,
2552,
7517,
2552,
3504,
377,
28256,
10140,
5516,
1970,
468,
868,
3165,
16253,
2456,
28256,
10140,
5516,
1970,
225,
309,
7517,
30,
468,
868,
... |
if hasattr(stream, 'name'): title = os.path.splitext(os.path.basename(stream.name))[0] else: title = 'Unknown' | title = 'Unknown' | def get_metadata(stream): """ Return metadata as a L{MetaInfo} object """ if hasattr(stream, 'name'): title = os.path.splitext(os.path.basename(stream.name))[0] else: title = 'Unknown' mi = MetaInformation(title, ['Unknown']) stream.seek(0) try: info = PdfFileReader(stream).getDocumentInfo() if info.title: mi.title = info.title if info.author: src = info.author.split('&') authors = [] for au in src: authors += au.split(',') mi.authors = authors mi.author = info.author if info.subject: mi.category = info.subject except Exception, err: msg = u'Couldn\'t read metadata from pdf: %s with error %s'%(mi.title, unicode(err)) print >>sys.stderr, msg.encode('utf8') return mi | 822bec157cd7494a7acbbfac0a8711e805b6613b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9125/822bec157cd7494a7acbbfac0a8711e805b6613b/pdf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4165,
12,
3256,
4672,
3536,
2000,
1982,
487,
279,
511,
95,
2781,
966,
97,
733,
3536,
2077,
273,
296,
4874,
11,
12837,
273,
6565,
5369,
12,
2649,
16,
10228,
4874,
19486,
1407,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4165,
12,
3256,
4672,
3536,
2000,
1982,
487,
279,
511,
95,
2781,
966,
97,
733,
3536,
2077,
273,
296,
4874,
11,
12837,
273,
6565,
5369,
12,
2649,
16,
10228,
4874,
19486,
1407,
... |
self_repr = repr (self) | self_repr = repr(self) | def handle_error (self): nil, t, v, tbinfo = compact_traceback() | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
1636,
261,
2890,
4672,
515,
16,
268,
16,
331,
16,
8739,
1376,
273,
6739,
67,
21696,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1636,
261,
2890,
4672,
515,
16,
268,
16,
331,
16,
8739,
1376,
273,
6739,
67,
21696,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
keyword = "debug_list" caption = "Debug Printing" default_classprefs = ( IntParam('best_width', 200), IntParam('best_height', 500), IntParam('min_width', 100), IntParam('min_height', 100), BoolParam('springtab', True), BoolParam('show', False), ) def __init__(self, parent, *args, **kwargs): Sidebar.__init__(self, parent, *args, **kwargs) self.debuglist = DebugClass(self.frame) items = self.debuglist.getItems() wx.CheckListBox.__init__(self, parent, choices=items, pos=(9000,9000)) assert self.dprint(items) for i in range(len(items)): self.Check(i, self.debuglist.isChecked(i)) self.Bind(wx.EVT_CHECKLISTBOX, self.OnCheckListBox) | def action(self, index=-1, multiplier=1): """ Turn on or off the debug logging for the selected class """ assert self.dprint("DebugClass.action: id(self)=%x name=%s index=%d id(itemlist)=%x" % (id(self),self.name,index,id(DebugClass.itemlist))) kls=DebugClass.itemlist[index]['item'] DebugClass.itemlist[index]['checked']=not DebugClass.itemlist[index]['checked'] if DebugClass.itemlist[index]['checked']: kls.debuglevel=1 else: kls.debuglevel=0 assert self.dprint("class=%s debuglevel=%d" % (kls,kls.debuglevel)) | 56ac591d312ea693f3992735f261bc9a7c0cde45 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11522/56ac591d312ea693f3992735f261bc9a7c0cde45/debug_classes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1301,
12,
2890,
16,
770,
29711,
21,
16,
15027,
33,
21,
4672,
3536,
22425,
603,
578,
3397,
326,
1198,
2907,
364,
326,
3170,
667,
3536,
1815,
365,
18,
72,
1188,
2932,
2829,
797,
18,
1128... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1301,
12,
2890,
16,
770,
29711,
21,
16,
15027,
33,
21,
4672,
3536,
22425,
603,
578,
3397,
326,
1198,
2907,
364,
326,
3170,
667,
3536,
1815,
365,
18,
72,
1188,
2932,
2829,
797,
18,
1128... | |
return PrioritiserInterface.findMatchedJobs(self, constraint) | def findMatchedJobs(self, constraint): """ _findMatchedJobs_ | 13e1427903eb8f858c07db082bf2a1862b744b31 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8887/13e1427903eb8f858c07db082bf2a1862b744b31/LCGAdvanced.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
15400,
7276,
12,
2890,
16,
4954,
4672,
3536,
389,
4720,
15400,
7276,
67,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
15400,
7276,
12,
2890,
16,
4954,
4672,
3536,
389,
4720,
15400,
7276,
67,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
for ((pfile, pmod, pfunc), (cfile, cmod, cfunc)) in calls: | for ((pfile, pmod, pfunc), (cfile, cmod, cfunc)) in sorted(self.callers.keys()): | def write_results(self, show_missing=True, summary=False, coverdir=None): """ @param coverdir """ if self.calledfuncs: print() print("functions called:") calls = self.calledfuncs.keys() calls.sort() for filename, modulename, funcname in calls: print(("filename: %s, modulename: %s, funcname: %s" % (filename, modulename, funcname))) | 5c520650703056cb427980cc1e5ac4862a1317f0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/5c520650703056cb427980cc1e5ac4862a1317f0/trace.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
4717,
12,
2890,
16,
2405,
67,
7337,
33,
5510,
16,
4916,
33,
8381,
16,
5590,
1214,
33,
7036,
4672,
3536,
632,
891,
5590,
1214,
3536,
309,
365,
18,
11777,
17728,
30,
1172,
1435... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
4717,
12,
2890,
16,
2405,
67,
7337,
33,
5510,
16,
4916,
33,
8381,
16,
5590,
1214,
33,
7036,
4672,
3536,
632,
891,
5590,
1214,
3536,
309,
365,
18,
11777,
17728,
30,
1172,
1435... |
self.pool.get('account.invoice').write(cr, uid, ids, {'invoice_line':[]}, context=context) | self.pool.get('account.invoice').write(cr, uid, ids, {'invoice_line':[]}, context=ctx) | def button_reset_taxes(self, cr, uid, ids, context=None): if not context: context = {} ait_obj = self.pool.get('account.invoice.tax') for id in ids: cr.execute("DELETE FROM account_invoice_tax WHERE invoice_id=%s", (id,)) partner = self.browse(cr, uid, id, context=context).partner_id if partner.lang: context.update({'lang': partner.lang}) for taxe in ait_obj.compute(cr, uid, id, context=context).values(): ait_obj.create(cr, uid, taxe) # Update the stored value (fields.function), so we write to trigger recompute self.pool.get('account.invoice').write(cr, uid, ids, {'invoice_line':[]}, context=context) return True | 43fe238c96c27d923e41eb6276a02dd700d48ed9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/43fe238c96c27d923e41eb6276a02dd700d48ed9/invoice.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3568,
67,
6208,
67,
8066,
281,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
309,
486,
819,
30,
819,
273,
2618,
279,
305,
67,
2603,
273,
365,
18,
6011,
18,
588,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3568,
67,
6208,
67,
8066,
281,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
309,
486,
819,
30,
819,
273,
2618,
279,
305,
67,
2603,
273,
365,
18,
6011,
18,
588,
... |
nodes = [] nodes.extend(flatten_nodes(self.nodes)) return tuple(nodes) | nodelist = [] nodelist.extend(flatten_nodes(self.nodes)) return tuple(nodelist) | def getChildNodes(self): nodes = [] nodes.extend(flatten_nodes(self.nodes)) return tuple(nodes) | 101b9307b0d9de62f324ef9ffa6e83f8040af642 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/101b9307b0d9de62f324ef9ffa6e83f8040af642/ast.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23895,
12,
2890,
4672,
2199,
273,
5378,
2199,
18,
14313,
12,
16940,
67,
4690,
12,
2890,
18,
4690,
3719,
327,
3193,
12,
4690,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
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,
23895,
12,
2890,
4672,
2199,
273,
5378,
2199,
18,
14313,
12,
16940,
67,
4690,
12,
2890,
18,
4690,
3719,
327,
3193,
12,
4690,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
"-Wno-import", | "-Wno-import", | def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ for pth in ('/System/Library/Frameworks', '/Library/Frameworks'): basedir = os.path.join(pth, name) if os.path.exists(basedir): if (headername is None) or os.path.exists(os.path.join(basedir, "Headers", headername)): return packages, extensions return [], [] | c7327c87d5a2f44301555206c46d8ef6ed97cf84 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/97/c7327c87d5a2f44301555206c46d8ef6ed97cf84/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
971,
3219,
2421,
12,
529,
16,
5907,
16,
4418,
16,
1446,
529,
33,
7036,
4672,
3536,
2000,
326,
5907,
471,
4418,
309,
326,
8257,
1704,
16,
578,
2795,
1008,
6035,
309,
486,
18,
3536,
364,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
971,
3219,
2421,
12,
529,
16,
5907,
16,
4418,
16,
1446,
529,
33,
7036,
4672,
3536,
2000,
326,
5907,
471,
4418,
309,
326,
8257,
1704,
16,
578,
2795,
1008,
6035,
309,
486,
18,
3536,
364,... |
elif dY>=0 and dX<0: | elif dY>0 and dX<0: | def scatterPointer(A=None,B=None): """ Expects two ordered pairs as tuples (x1,y1) and (x2,y2)... Then this defines an angle. From this angle we orient a triangle point and return this as a tuple of requested size. This can be plotted by the scatter plot to point in a particular orientation. The direction right(0,0)->(1,0) is angle 0 radians, then we rotate counter clockwise from there... What is returned in a three element tuple (numsides,style,angle) which can be put into a plot call via marker=X as a **kwarg """ if A == None or B == None: return (3,0,0) if( A != type(tuple()) and len(A) != 2) \ or \ ( B != type(tuple()) and len(B) != 2): return (3,0,0) # # Calculate orientation of triangle # Ang = arcsin(dY/dX) dY=float(B[-1]-A[-1]) dX=float(B[0]-A[0]) if dY>=0 and dX>=0: myAngle=arctan(dY/dX) elif dY>=0 and dX<0: myAngle=pi-arctan(dY/dX) elif dY<0 and dX<0: myAngle=arctan(dY/dX)+pi elif dY<0 and dX>0: myAngle=(2.0*pi)-arctan(dY/dX) else: myAngle=0 return (3,0,myAngle) | 0aae795f34e87fdf3988ad1f607c71be6b045d53 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/0aae795f34e87fdf3988ad1f607c71be6b045d53/followupPDSurface.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14644,
4926,
12,
37,
33,
7036,
16,
38,
33,
7036,
4672,
3536,
15510,
87,
2795,
5901,
5574,
487,
10384,
261,
92,
21,
16,
93,
21,
13,
471,
261,
92,
22,
16,
93,
22,
13,
2777,
9697,
333... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14644,
4926,
12,
37,
33,
7036,
16,
38,
33,
7036,
4672,
3536,
15510,
87,
2795,
5901,
5574,
487,
10384,
261,
92,
21,
16,
93,
21,
13,
471,
261,
92,
22,
16,
93,
22,
13,
2777,
9697,
333... |
except Exception: logging.getLogger('report').exception() | except Exception, e: logging.getLogger('report').exception(e) | def _child_get(node, self=None, tagname=None): for n in node: if self and self.localcontext and n.get('rml_loop'): for ctx in eval(n.get('rml_loop'),{}, self.localcontext): self.localcontext.update(ctx) if (tagname is None) or (n.tag==tagname): if n.get('rml_except', False): try: eval(n.get('rml_except'), {}, self.localcontext) except GeneratorExit: continue except Exception: logging.getLogger('report').exception() continue if n.get('rml_tag'): try: (tag,attr) = eval(n.get('rml_tag'),{}, self.localcontext) n2 = copy.deepcopy(n) n2.tag = tag n2.attrib.update(attr) yield n2 except GeneratorExit: yield n except Exception: logging.getLogger('report').exception() yield n else: yield n continue if self and self.localcontext and n.get('rml_except'): try: eval(n.get('rml_except'), {}, self.localcontext) except GeneratorExit: continue except Exception: logging.getLogger('report').exception() continue if self and self.localcontext and n.get('rml_tag'): try: (tag,attr) = eval(n.get('rml_tag'),{}, self.localcontext) n2 = copy.deepcopy(n) n2.tag = tag n2.attrib.update(attr or {}) yield n2 tagname = '' except GeneratorExit: pass except Exception: logging.getLogger('report').exception() pass if (tagname is None) or (n.tag==tagname): yield n | 63ea63200eaa26abcd908ea7fc53a75a2c7512bf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/63ea63200eaa26abcd908ea7fc53a75a2c7512bf/utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3624,
67,
588,
12,
2159,
16,
365,
33,
7036,
16,
25586,
33,
7036,
4672,
364,
290,
316,
756,
30,
309,
365,
471,
365,
18,
3729,
2472,
471,
290,
18,
588,
2668,
86,
781,
67,
6498,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3624,
67,
588,
12,
2159,
16,
365,
33,
7036,
16,
25586,
33,
7036,
4672,
364,
290,
316,
756,
30,
309,
365,
471,
365,
18,
3729,
2472,
471,
290,
18,
588,
2668,
86,
781,
67,
6498,
... |
(perdate, ithperd)) | (game.perdate, ithperd)) | def score(): "Compute player's score." timused = game.state.date - game.indate iskill = game.skill if (timused == 0 or (game.state.remkl + len(game.state.kcmdr) + game.state.nscrem) != 0) and timused < 5.0: timused = 5.0 perdate = killrate() ithperd = 500*perdate + 0.5 iwon = 0 if game.gamewon: iwon = 100*game.skill if game.ship == 'E': klship = 0 elif game.ship == 'F': klship = 1 else: klship = 2 iscore = 10*(game.inkling - game.state.remkl) \ + 50*(game.incom - len(game.state.kcmdr)) \ + ithperd + iwon \ + 20*(game.inrom - game.state.nromrem) \ + 200*(game.inscom - game.state.nscrem) \ - game.state.nromrem \ - badpoints() if not game.alive: iscore -= 200 skip(2) prout(_("Your score --")) if game.inrom - game.state.nromrem: prout(_("%6d Romulans destroyed %5d") % (game.inrom - game.state.nromrem, 20*(game.inrom - game.state.nromrem))) if game.state.nromrem and game.gamewon: prout(_("%6d Romulans captured %5d") % (game.state.nromrem, game.state.nromrem)) if game.inkling - game.state.remkl: prout(_("%6d ordinary Klingons destroyed %5d") % (game.inkling - game.state.remkl, 10*(game.inkling - game.state.remkl))) if game.incom - len(game.state.kcmdr): prout(_("%6d Klingon commanders destroyed %5d") % (game.incom - len(game.state.kcmdr), 50*(game.incom - len(game.state.kcmdr)))) if game.inscom - game.state.nscrem: prout(_("%6d Super-Commander destroyed %5d") % (game.inscom - game.state.nscrem, 200*(game.inscom - game.state.nscrem))) if ithperd: prout(_("%6.2f Klingons per stardate %5d") % (perdate, ithperd)) if game.state.starkl: prout(_("%6d stars destroyed by your action %5d") % (game.state.starkl, -5*game.state.starkl)) if game.state.nplankl: prout(_("%6d planets destroyed by your action %5d") % (game.state.nplankl, -10*game.state.nplankl)) if (game.options & OPTION_WORLDS) and game.state.nworldkl: prout(_("%6d inhabited planets destroyed by your action %5d") % (game.state.nworldkl, -300*game.state.nworldkl)) if game.state.basekl: prout(_("%6d bases destroyed by your action %5d") % (game.state.basekl, -100*game.state.basekl)) if game.nhelp: prout(_("%6d calls for help from starbase %5d") % (game.nhelp, -45*game.nhelp)) if game.casual: prout(_("%6d casualties incurred %5d") % (game.casual, -game.casual)) if game.abandoned: prout(_("%6d crew abandoned in space %5d") % (game.abandoned, -3*game.abandoned)) if klship: prout(_("%6d ship(s) lost or destroyed %5d") % (klship, -100*klship)) if not game.alive: prout(_("Penalty for getting yourself killed -200")) if game.gamewon: proutn(_("Bonus for winning ")) if game.skill == SKILL_NOVICE: proutn(_("Novice game ")) elif game.skill == SKILL_FAIR: proutn(_("Fair game ")) elif game.skill == SKILL_GOOD: proutn(_("Good game ")) elif game.skill == SKILL_EXPERT: proutn(_("Expert game ")) elif game.skill == SKILL_EMERITUS: proutn(_("Emeritus game")) prout(" %5d" % iwon) skip(1) prout(_("TOTAL SCORE %5d") % iscore) | 65ebc303124b932f39a34d20faaa702d07854b82 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3176/65ebc303124b932f39a34d20faaa702d07854b82/sst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4462,
13332,
315,
7018,
7291,
1807,
4462,
1199,
1658,
3668,
273,
7920,
18,
2019,
18,
712,
300,
7920,
18,
267,
712,
353,
16418,
273,
7920,
18,
7771,
737,
309,
261,
8584,
3668,
422,
374,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4462,
13332,
315,
7018,
7291,
1807,
4462,
1199,
1658,
3668,
273,
7920,
18,
2019,
18,
712,
300,
7920,
18,
267,
712,
353,
16418,
273,
7920,
18,
7771,
737,
309,
261,
8584,
3668,
422,
374,
... |
print "trying with failsafe" | def logging_set_from_cfg(cfg, logfile=None): if logfile is None: try: open(def_log_file,"a").close() logfile = def_log_file except IOError as e: if e.errno == errno.EACCES: logfile = "/dev/null" else: raise logcfg=util.get_cfg_option_str(cfg, "log_cfg", "built_in") failsafe = "%s\n%s" % (built_in_log_base, built_in_log_clougLogHandlerLog) builtin = False if logcfg.lower() == "built_in": logcfg = "%s\n%s" % (built_in_log_base, built_in_log_cloudLogHandlerSyslog) builtin = True logcfg=logcfg.replace("__CLOUDINIT_LOGGER_FILE__",logfile) try: logging.config.fileConfig(StringIO.StringIO(logcfg)) print "using logfile = %s" % logcfg return except: if not builtin: sys.stderr.write("Warning, setting config.fileConfig failed\n") print "trying with failsafe" failsafe=failsafe.replace("__CLOUDINIT_LOGGER_FILE__",logfile) logging.config.fileConfig(StringIO.StringIO(failsafe)) | 367e4c45e3331ccfb05928526581e33936c46516 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10142/367e4c45e3331ccfb05928526581e33936c46516/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2907,
67,
542,
67,
2080,
67,
7066,
12,
7066,
16,
15204,
33,
7036,
4672,
309,
15204,
353,
599,
30,
775,
30,
1696,
12,
536,
67,
1330,
67,
768,
10837,
69,
20387,
4412,
1435,
15204,
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,
2907,
67,
542,
67,
2080,
67,
7066,
12,
7066,
16,
15204,
33,
7036,
4672,
309,
15204,
353,
599,
30,
775,
30,
1696,
12,
536,
67,
1330,
67,
768,
10837,
69,
20387,
4412,
1435,
15204,
273,
... | |
logger.info("[favoritos.py] savebookmark") | logger.info("[favoritos.py] savebookmark") | def savebookmark(titulo,url,thumbnail,server,plot): logger.info("[favoritos.py] savebookmark") # No va bien ms que en Windows #bookmarkfiledescriptor,bookmarkfilepath = tempfile.mkstemp(suffix=".txt",prefix="",dir=BOOKMARK_PATH) # Crea el directorio de favoritos si no existe if not usingsamba: try: os.mkdir(BOOKMARK_PATH) except: pass # Lee todos los ficheros if usingsamba: ficheros = samba.get_files(BOOKMARK_PATH) else: ficheros = os.listdir(BOOKMARK_PATH) ficheros.sort() # Averigua el ltimo nmero filenumber = int( ficheros[len(ficheros)-1][0:-4] )+1 # Genera el contenido filecontent = "" filecontent = filecontent + urllib.quote_plus(downloadtools.limpia_nombre_excepto_1(titulo))+'\n' filecontent = filecontent + urllib.quote_plus(url)+'\n' filecontent = filecontent + urllib.quote_plus(thumbnail)+'\n' filecontent = filecontent + urllib.quote_plus(server)+'\n' filecontent = filecontent + urllib.quote_plus(downloadtools.limpia_nombre_excepto_1(plot))+'\n' # Genera el nombre de fichero filename = '%08d.txt' % filenumber logger.info("[favoritos.py] savebookmark filename="+filename) # Graba el fichero if not usingsamba: fullfilename = os.path.join(BOOKMARK_PATH,filename) bookmarkfile = open(fullfilename,"w") bookmarkfile.write(filecontent) bookmarkfile.flush(); bookmarkfile.close() else: samba.write_file(filename, filecontent, BOOKMARK_PATH) | cbf56e6d608cebe07c475b175224048b25f3957e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2004/cbf56e6d608cebe07c475b175224048b25f3957e/favoritos.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
3618,
3355,
12,
88,
305,
26478,
16,
718,
16,
14904,
16,
3567,
16,
4032,
4672,
1194,
18,
1376,
2932,
63,
19731,
280,
305,
538,
18,
2074,
65,
1923,
3618,
3355,
7923,
225,
468,
2631... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
3618,
3355,
12,
88,
305,
26478,
16,
718,
16,
14904,
16,
3567,
16,
4032,
4672,
1194,
18,
1376,
2932,
63,
19731,
280,
305,
538,
18,
2074,
65,
1923,
3618,
3355,
7923,
225,
468,
2631... |
if xmin < 0.5: self._ax1.set_xlim(0.5,xmax) | if xmin == 0.0: self._ax1.set_xlim(0.5,xmax) | def show_colorscale(self,vmin='default',vmid='default',vmax='default',stretch='linear',exponent=2,cmap='default'): ''' Show a colorscale image of the FITS file Optional Keyword Arguments: *vmin*: [ float ] Minimum pixel value to show (default is to use the 0.25% percentile) *vmax*: [ float ] Maximum pixel value to show (default is to use the 99.97% percentile) *stretch*: [ 'linear' | 'log' | 'sqrt' | 'arcsinh' | 'power' ] The stretch function to use *exponent*: [ float ] If stretch is set to 'power', this is the exponent to use *cmap*: [ string ] The name of the colormap to use ''' if cmap=='default': cmap = self._get_colormap_default() min_auto = type(vmin) == str mid_auto = type(vmid) == str max_auto = type(vmax) == str # The set of available functions cmap = mpl.cm.get_cmap(cmap,1000) vmin_auto,vmax_auto = self._auto_v(0.0025),self._auto_v(0.9975) | 716a9f4b19a48fe4980e11bfafa70ab162c9e001 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13232/716a9f4b19a48fe4980e11bfafa70ab162c9e001/aplpy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
67,
9724,
1869,
12,
2890,
16,
90,
1154,
2218,
1886,
2187,
3489,
350,
2218,
1886,
2187,
90,
1896,
2218,
1886,
2187,
334,
20783,
2218,
12379,
2187,
24045,
33,
22,
16,
22738,
2218,
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,
2405,
67,
9724,
1869,
12,
2890,
16,
90,
1154,
2218,
1886,
2187,
3489,
350,
2218,
1886,
2187,
90,
1896,
2218,
1886,
2187,
334,
20783,
2218,
12379,
2187,
24045,
33,
22,
16,
22738,
2218,
18... |
del self.return_fields[key] | del valid_fields[key] | def call(self, auth, node_id_or_hostname_list = None, return_fields = None): # Authenticated function assert self.caller is not None | eae096fafed0efd0fd3d392c772aac9f3a5a731c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7598/eae096fafed0efd0fd3d392c772aac9f3a5a731c/AdmGetNodes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
745,
12,
2890,
16,
1357,
16,
756,
67,
350,
67,
280,
67,
10358,
67,
1098,
273,
599,
16,
327,
67,
2821,
273,
599,
4672,
468,
3123,
6096,
445,
1815,
365,
18,
16140,
353,
486,
599,
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,
745,
12,
2890,
16,
1357,
16,
756,
67,
350,
67,
280,
67,
10358,
67,
1098,
273,
599,
16,
327,
67,
2821,
273,
599,
4672,
468,
3123,
6096,
445,
1815,
365,
18,
16140,
353,
486,
599,
2,
... |
raise 'slowbadnode exception' | raise Exception, 'slowbadnode exception' | def build(self, **kw): # Appears to take a while to build, allowing faster builds to # overlap. Time duration is not especially important, but if # it is faster than slowgoodnode then these could complete # while the scheduler is sleeping. time.sleep(0.05) raise 'slowbadnode exception' | b61dd0582573b8fd3ef5c4bd7a091f20fad07d84 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12817/b61dd0582573b8fd3ef5c4bd7a091f20fad07d84/JobTests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
12,
2890,
16,
2826,
9987,
4672,
468,
1716,
347,
5913,
358,
4862,
279,
1323,
358,
1361,
16,
15632,
12063,
10736,
358,
468,
7227,
18,
225,
2647,
3734,
353,
486,
29440,
10802,
16,
149... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
12,
2890,
16,
2826,
9987,
4672,
468,
1716,
347,
5913,
358,
4862,
279,
1323,
358,
1361,
16,
15632,
12063,
10736,
358,
468,
7227,
18,
225,
2647,
3734,
353,
486,
29440,
10802,
16,
149... |
""" Compares against item[some index] """ | """Compares against item[some index].""" | def render_value(self, value): return "instance of %s" % type(value) | 2e7b15abd167a17bf8f880c7e0bd7891362e04de /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/873/2e7b15abd167a17bf8f880c7e0bd7891362e04de/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
1132,
12,
2890,
16,
460,
4672,
327,
315,
1336,
434,
738,
87,
6,
738,
618,
12,
1132,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
1132,
12,
2890,
16,
460,
4672,
327,
315,
1336,
434,
738,
87,
6,
738,
618,
12,
1132,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
dialog.myvbox.add(table) | dialog.vbox.add(table) | def BuildHTTPAuth(summary, message, prefillUser = None, prefillPassword = None): """Ask the user for HTTP login information for a location, identified to the user by its URL and the domain string provided by the server requesting the authorization. Default values can be provided for prefilling the form. If the user submits information, it's returned as a (user, password) tuple. Otherwise, if the user presses Cancel or similar, None is returned.""" dialog = gtk.Dialog(summary, None, (), (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OK, gtk.RESPONSE_OK)) dialog.set_default_size(425, -1) table = gtk.Table() dialog.myvbox.add(table) label = gtk.Label() label.set_line_wrap(True) label.set_selectable(True) label.set_markup(message) label.set_padding (6, 6) table.attach (label, 0, 2, 0, 1, gtk.FILL, gtk.FILL) label = gtk.Label() label.set_markup(_("Username:")) label.set_padding (6, 6) label.set_alignment (1.0, 0.5) table.attach (label, 0, 1, 1, 2, gtk.FILL, gtk.FILL) dialog.user = gtk.Entry() if (prefillUser != None): dialog.user.set_text(prefillUser) table.attach (dialog.user, 1, 2, 1, 2, gtk.FILL | gtk.EXPAND, gtk.FILL, 6, 6) label = gtk.Label() label.set_markup(_("Password:")) label.set_padding (6, 6) label.set_alignment (1.0, 0.5) table.attach (label, 0, 1, 2, 3, gtk.FILL, gtk.FILL) dialog.password = gtk.Entry() dialog.password.set_visibility(False) dialog.password.set_activates_default(True) if (prefillPassword != None): dialog.password.set_text(prefillPassword) table.attach (dialog.password, 1, 2, 2, 3, gtk.FILL | gtk.EXPAND, gtk.FILL, 6, 6) table.show_all() dialog.set_default_response (gtk.RESPONSE_OK) return dialog | 0a68407442fc11d9610a116cedb01b9c1eaea0ac /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12354/0a68407442fc11d9610a116cedb01b9c1eaea0ac/UIBackendDelegate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3998,
3693,
1730,
12,
7687,
16,
883,
16,
675,
5935,
1299,
273,
599,
16,
675,
5935,
3913,
273,
599,
4672,
3536,
23663,
326,
729,
364,
2239,
3925,
1779,
364,
279,
2117,
16,
9283,
358,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3998,
3693,
1730,
12,
7687,
16,
883,
16,
675,
5935,
1299,
273,
599,
16,
675,
5935,
3913,
273,
599,
4672,
3536,
23663,
326,
729,
364,
2239,
3925,
1779,
364,
279,
2117,
16,
9283,
358,
32... |
url, annotations)} | url, annotations), 'raw_href': url} | def preview_to_hdf(self, req, content, length, mimetype, filename, url=None, annotations=None): """Prepares a rendered preview of the given `content`. | e0ab87618defe595284685c17b4ecdb21167e14d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/e0ab87618defe595284685c17b4ecdb21167e14d/api.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10143,
67,
869,
67,
26428,
12,
2890,
16,
1111,
16,
913,
16,
769,
16,
12595,
16,
1544,
16,
880,
33,
7036,
16,
5617,
33,
7036,
4672,
3536,
18486,
279,
7935,
10143,
434,
326,
864,
1375,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10143,
67,
869,
67,
26428,
12,
2890,
16,
1111,
16,
913,
16,
769,
16,
12595,
16,
1544,
16,
880,
33,
7036,
16,
5617,
33,
7036,
4672,
3536,
18486,
279,
7935,
10143,
434,
326,
864,
1375,
... |
return '& | return '& | def convertentity(m): if m.group(1)=='#': try: return chr(int(m.group(2))) except XValueError: return '&#%s;' % m.group(2) try: return htmlentitydefs.entitydefs[m.group(2)] except KeyError: return ('&%s;' % m.group(2)).decode('ISO-8859-1') | 882d67c8fe0f86c4b7052562c51b41df492db552 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9947/882d67c8fe0f86c4b7052562c51b41df492db552/traduisons.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
1096,
12,
81,
4672,
309,
312,
18,
1655,
12,
21,
13,
18920,
7,
4278,
775,
30,
327,
4513,
12,
474,
12,
81,
18,
1655,
12,
22,
20349,
1335,
1139,
23610,
30,
327,
21312,
9,
87,
43... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
1096,
12,
81,
4672,
309,
312,
18,
1655,
12,
21,
13,
18920,
7,
4278,
775,
30,
327,
4513,
12,
474,
12,
81,
18,
1655,
12,
22,
20349,
1335,
1139,
23610,
30,
327,
21312,
9,
87,
43... |
InstallTools.setMySQLPasswords(mysqlPassword) | InstallTools.setMySQLPasswords( mysqlPassword ) | def export_installDatabase( self, dbName, mysqlPassword=None ): """ Install a DIRAC database named dbName """ if mysqlPassword : InstallTools.setMySQLPasswords(mysqlPassword) return InstallTools.installDatabase( dbName ) | 1a39061cbe8c426f97cd62e1939b4621f5328450 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/1a39061cbe8c426f97cd62e1939b4621f5328450/SystemAdministratorHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3359,
67,
5425,
4254,
12,
365,
16,
15158,
16,
7219,
3913,
33,
7036,
262,
30,
3536,
10284,
279,
18544,
2226,
2063,
4141,
15158,
3536,
309,
7219,
3913,
294,
10284,
10348,
18,
542,
28723,
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,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3359,
67,
5425,
4254,
12,
365,
16,
15158,
16,
7219,
3913,
33,
7036,
262,
30,
3536,
10284,
279,
18544,
2226,
2063,
4141,
15158,
3536,
309,
7219,
3913,
294,
10284,
10348,
18,
542,
28723,
3... |
context.currentRecord.code = [ pa ] | context.currentRecord.target = pa | def parse_SETLOC(self, context, operands): retval = False if operands: expr = Expression(context, operands) if expr.complete: pa = expr.value context.currentRecord.code = [ pa ] context.currentRecord.complete = True context.loc = pa retval = True else: context.error("missing operand") return retval | 1bc9bc702b1a6f16b93c22e262ed22dfd4b79b9e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8152/1bc9bc702b1a6f16b93c22e262ed22dfd4b79b9e/directive.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
4043,
29450,
12,
2890,
16,
819,
16,
14883,
4672,
5221,
273,
1083,
309,
14883,
30,
3065,
273,
5371,
12,
2472,
16,
14883,
13,
309,
3065,
18,
6226,
30,
6790,
273,
3065,
18,
1132... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4043,
29450,
12,
2890,
16,
819,
16,
14883,
4672,
5221,
273,
1083,
309,
14883,
30,
3065,
273,
5371,
12,
2472,
16,
14883,
13,
309,
3065,
18,
6226,
30,
6790,
273,
3065,
18,
1132... |
renderer.props.font = gaupol.conf.editor.custom_font | renderer.props.font = font | def _on_conf_editor_notify_use_custom_font(self, *args): """Apply the new font to all columns.""" if not gaupol.conf.editor.use_custom_font: return for column in self.get_columns(): renderer = column.get_cell_renderers()[0] if hasattr(renderer.props, "font"): renderer.props.font = gaupol.conf.editor.custom_font self.columns_autosize() | 291190c9545ba99bd346ec4b8617293ee26489b1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12852/291190c9545ba99bd346ec4b8617293ee26489b1/view.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
265,
67,
3923,
67,
9177,
67,
12336,
67,
1202,
67,
3662,
67,
5776,
12,
2890,
16,
380,
1968,
4672,
3536,
7001,
326,
394,
3512,
358,
777,
2168,
12123,
309,
486,
18812,
416,
355,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
265,
67,
3923,
67,
9177,
67,
12336,
67,
1202,
67,
3662,
67,
5776,
12,
2890,
16,
380,
1968,
4672,
3536,
7001,
326,
394,
3512,
358,
777,
2168,
12123,
309,
486,
18812,
416,
355,
18,
... |
user = self.fas.cache[collectionEntry.owner] | user = self.fas.cache[collection_entry.owner] | def id(self, collectionId): # pylint: disable-msg=C0103 '''Return a page with information on a particular Collection ''' try: collectionId = int(collectionId) except ValueError: error = dict(status = False, title = self.app_title + ' -- Invalid Collection Id', message = 'The collectionId you were linked to is not a' \ ' valid id. If you received this error from a' \ ' link on the fedoraproject.org website, please' \ ' report it.') if request.params.get('tg_format', 'html') != 'json': error['tg_template'] = 'pkgdb.templates.errors' return error | d0ea7754e4b0eb9d223e9b48c71f42ad0c5ab68c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9953/d0ea7754e4b0eb9d223e9b48c71f42ad0c5ab68c/collections.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
612,
12,
2890,
16,
1849,
548,
4672,
468,
7601,
30,
4056,
17,
3576,
33,
39,
1611,
4630,
9163,
990,
279,
1363,
598,
1779,
603,
279,
6826,
2200,
9163,
775,
30,
1849,
548,
273,
509,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
612,
12,
2890,
16,
1849,
548,
4672,
468,
7601,
30,
4056,
17,
3576,
33,
39,
1611,
4630,
9163,
990,
279,
1363,
598,
1779,
603,
279,
6826,
2200,
9163,
775,
30,
1849,
548,
273,
509,
12,
... |
def sqlrepr(cls, value): return cls._connection.sqlrepr(value) | def sqlrepr(cls, value, connection=None): return (connection or cls._connection).sqlrepr(value) | def sqlrepr(cls, value): return cls._connection.sqlrepr(value) | 037450d58325667d5fa7c8539afdd8393fe0bff2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6718/037450d58325667d5fa7c8539afdd8393fe0bff2/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1847,
12715,
12,
6429,
16,
460,
4672,
327,
2028,
6315,
4071,
18,
4669,
12715,
12,
1132,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
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,
1847,
12715,
12,
6429,
16,
460,
4672,
327,
2028,
6315,
4071,
18,
4669,
12715,
12,
1132,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
if product == 'docs': ret_dict['concerns_just_documentation'] = True | ret_dict['concerns_just_documentation'] = (product == 'docs') | def extract_tracker_specific_data(xml_data, ret_dict): # Make modifications to ret_dict using provided metadata keywords_text = mysite.customs.bugtrackers.bugzilla.get_tag_text_from_xml(xml_data, 'keywords') keywords = map(lambda s: s.strip(), keywords_text.split(',')) ret_dict['good_for_newcomers'] = ('junior-jobs' in keywords) # Remove 'JJ:' from title if present if ret_dict['title'].startswith("JJ:"): ret_dict['title'] = ret_dict['title'][3:].strip() # Set 'concerns_just_documentation' if needed product = mysite.customs.bugtrackers.bugzilla.get_tag_text_from_xml(xml_data, 'product') if product == 'docs': ret_dict['concerns_just_documentation'] = True # Then pass ret_dict back return ret_dict | 8cba92de8630e6c1f78b3764988384bf704ad6e6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11976/8cba92de8630e6c1f78b3764988384bf704ad6e6/bugzilla_instances.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
67,
16543,
67,
12524,
67,
892,
12,
2902,
67,
892,
16,
325,
67,
1576,
4672,
468,
4344,
17953,
358,
325,
67,
1576,
1450,
2112,
1982,
7093,
67,
955,
273,
312,
1900,
1137,
18,
3662,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
67,
16543,
67,
12524,
67,
892,
12,
2902,
67,
892,
16,
325,
67,
1576,
4672,
468,
4344,
17953,
358,
325,
67,
1576,
1450,
2112,
1982,
7093,
67,
955,
273,
312,
1900,
1137,
18,
3662,
... |
contains='sequences') read_and_call(uhandle, consumer.database_info, contains='sequences') | contains='sequences;') read_and_call(uhandle, consumer.database_info, contains='sequences;') | def _scan_database_info(self, uhandle, consumer): attempt_read_and_call(uhandle, consumer.noevent, start='<p>') read_and_call(uhandle, consumer.database_info, contains='Database') # Sagar Damle reported that databases can consist of multiple lines. read_and_call_until(uhandle, consumer.database_info, contains='sequences') read_and_call(uhandle, consumer.database_info, contains='sequences') read_and_call(uhandle, consumer.noevent, blank=1) read_and_call(uhandle, consumer.noevent, contains='problems or questions') if attempt_read_and_call(uhandle, consumer.noevent, contains="BLASTFORM"): while 1: line = uhandle.peekline() if is_blank_line(line): break elif string.find(line, "Query=") >= 0: break consumer.noevent(uhandle.readline()) if attempt_read_and_call(uhandle, consumer.noevent, contains="Taxonomy reports"): read_and_call(uhandle, consumer.noevent, start="<BR>") attempt_read_and_call(uhandle, consumer.noevent, start="<PRE>") read_and_call_while(uhandle, consumer.noevent, blank=1) | 661df77cb6a3e1555d80be78c07588b81f29f248 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7167/661df77cb6a3e1555d80be78c07588b81f29f248/NCBIWWW.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9871,
67,
6231,
67,
1376,
12,
2890,
16,
582,
4110,
16,
4765,
4672,
4395,
67,
896,
67,
464,
67,
1991,
12,
89,
4110,
16,
4765,
18,
2135,
2575,
16,
787,
2218,
32,
84,
1870,
13,
8... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9871,
67,
6231,
67,
1376,
12,
2890,
16,
582,
4110,
16,
4765,
4672,
4395,
67,
896,
67,
464,
67,
1991,
12,
89,
4110,
16,
4765,
18,
2135,
2575,
16,
787,
2218,
32,
84,
1870,
13,
8... |
if dtype is not None: formats = sb.dtype(dtype) | def fromarrays(arrayList, dtype=None, shape=None, formats=None, names=None, titles=None, aligned=0, byteorder=None): """ create a record array from a (flat) list of arrays >>> x1=array([1,2,3,4]) >>> x2=array(['a','dd','xyz','12']) >>> x3=array([1.1,2,3,4]) >>> r=fromarrays([x1,x2,x3],names='a,b,c') >>> print r[1] (2, 'dd', 2.0) >>> x1[1]=34 >>> r.a array([1, 2, 3, 4]) """ if dtype is not None: formats = sb.dtype(dtype) if shape is None or shape == 0: shape = arrayList[0].shape if isinstance(shape, int): shape = (shape,) if formats is None: # go through each object in the list to see if it is an ndarray # and determine the formats. formats = '' for obj in arrayList: if not isinstance(obj, sb.ndarray): raise ValueError, "item in the array list must be an ndarray." formats += _typestr[obj.dtype.type] if issubclass(obj.dtype.type, nt.flexible): formats += `obj.itemsize` formats += ',' formats=formats[:-1] for obj in arrayList: if obj.shape != shape: raise ValueError, "array has different shape" if isinstance(formats, sb.dtype): descr = formats _names = descr.names else: parsed = format_parser(formats, names, titles, aligned, byteorder) _names = parsed._names descr = parsed._descr _array = recarray(shape, descr) # populate the record array (makes a copy) for i in range(len(arrayList)): _array[_names[i]] = arrayList[i] return _array | e43820609750d9035623af82e11cf7501bf9cc4c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/e43820609750d9035623af82e11cf7501bf9cc4c/records.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
628,
16223,
12,
1126,
682,
16,
3182,
33,
7036,
16,
2179,
33,
7036,
16,
6449,
33,
7036,
16,
1257,
33,
7036,
16,
14693,
33,
7036,
16,
13939,
33,
20,
16,
1160,
1019,
33,
7036,
4672,
353... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
628,
16223,
12,
1126,
682,
16,
3182,
33,
7036,
16,
2179,
33,
7036,
16,
6449,
33,
7036,
16,
1257,
33,
7036,
16,
14693,
33,
7036,
16,
13939,
33,
20,
16,
1160,
1019,
33,
7036,
4672,
353... | |
tagname = 'collection:criteria_help' | tagname = 'collection:criteria_description' | def getCategoryElements(self, category): tagnames = self._registry[category].keys() tagnames.sort() return tagnames | efa37e708400b6ab67b7886cfeb15ba40448f2ef /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11941/efa37e708400b6ab67b7886cfeb15ba40448f2ef/TaggedValueSupport.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19110,
3471,
12,
2890,
16,
3150,
4672,
1047,
1973,
273,
365,
6315,
9893,
63,
4743,
8009,
2452,
1435,
1047,
1973,
18,
3804,
1435,
327,
1047,
1973,
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,
0,
0,
0,
0,
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,
19110,
3471,
12,
2890,
16,
3150,
4672,
1047,
1973,
273,
365,
6315,
9893,
63,
4743,
8009,
2452,
1435,
1047,
1973,
18,
3804,
1435,
327,
1047,
1973,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
node = self.__convert_eol( node ) | node = self.__convert_eol( node, srcdmp.get_rev_nr() ) | def __process_rev( self, srcdmp, dstdmp ): """Process one revision.""" | 03d768509b4c7e580bf8896746b9db8672aa7762 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13212/03d768509b4c7e580bf8896746b9db8672aa7762/eolfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2567,
67,
9083,
12,
365,
16,
1705,
72,
1291,
16,
3046,
72,
1291,
262,
30,
3536,
2227,
1245,
6350,
12123,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2567,
67,
9083,
12,
365,
16,
1705,
72,
1291,
16,
3046,
72,
1291,
262,
30,
3536,
2227,
1245,
6350,
12123,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def parentLink(self, page): """ Return link to parent page """ _ = self.request.getText parent = page.getParentPage() if parent is None: return '' return parent.link_to(self.request, _("Parent Page", formatted=False)) | def editbarItems(self, page): """ Return list of items to show on the editbar | 442c361ad0eafc7263088f1c7f4b10077de7d450 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/888/442c361ad0eafc7263088f1c7f4b10077de7d450/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3874,
3215,
3126,
12,
2890,
16,
1363,
4672,
3536,
2000,
666,
434,
1516,
358,
2405,
603,
326,
3874,
3215,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
3874,
3215,
3126,
12,
2890,
16,
1363,
4672,
3536,
2000,
666,
434,
1516,
358,
2405,
603,
326,
3874,
3215,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
m=re.match(r'(?P<feature>[A-Za-z0-9][A-Za-z0-9\-]*)',each) | m=re.match(r'(?P<feature>[A-Za-z0-9][A-Za-z0-9\-]*) ?',each) | def ehlo(self, name=''): """ SMTP 'ehlo' command. Hostname to send for this command defaults to the FQDN of the local host. """ self.esmtp_features = {} self.putcmd("ehlo", name or self.local_hostname) (code,msg)=self.getreply() # According to RFC1869 some (badly written) # MTA's will disconnect on an ehlo. Toss an exception if # that happens -ddm if code == -1 and len(msg) == 0: self.close() raise SMTPServerDisconnected("Server not connected") self.ehlo_resp=msg if code != 250: return (code,msg) self.does_esmtp=1 #parse the ehlo response -ddm resp=self.ehlo_resp.split('\n') del resp[0] for each in resp: m=re.match(r'(?P<feature>[A-Za-z0-9][A-Za-z0-9\-]*)',each) if m: feature=m.group("feature").lower() params=m.string[m.end("feature"):].strip() self.esmtp_features[feature]=params return (code,msg) | a664689380d00b5813bcab4c6e355ff0611fc62e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/a664689380d00b5813bcab4c6e355ff0611fc62e/smtplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20124,
383,
12,
2890,
16,
508,
2218,
11,
4672,
3536,
18102,
296,
73,
76,
383,
11,
1296,
18,
17423,
358,
1366,
364,
333,
1296,
3467,
358,
326,
23127,
8609,
434,
326,
1191,
1479,
18,
353... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20124,
383,
12,
2890,
16,
508,
2218,
11,
4672,
3536,
18102,
296,
73,
76,
383,
11,
1296,
18,
17423,
358,
1366,
364,
333,
1296,
3467,
358,
326,
23127,
8609,
434,
326,
1191,
1479,
18,
353... |
timeInHours = math.ceil(timeInSecs/60) | timeInHours = math.ceil(timeInSecs/3600.0) | def getExecutionCost(self): timeInSecs = self.getExecutionTime() timeInHours = math.ceil(timeInSecs/60) return timeInHours * self.scenario.wn_cost | 17a74745d6af68944dbcdcb6021d02b56790ddde /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12376/17a74745d6af68944dbcdcb6021d02b56790ddde/CloudMachine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21220,
8018,
12,
2890,
4672,
813,
382,
25059,
273,
365,
18,
588,
3210,
950,
1435,
813,
382,
14910,
273,
4233,
18,
311,
330,
12,
957,
382,
25059,
19,
5718,
713,
18,
20,
13,
327,
813,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21220,
8018,
12,
2890,
4672,
813,
382,
25059,
273,
365,
18,
588,
3210,
950,
1435,
813,
382,
14910,
273,
4233,
18,
311,
330,
12,
957,
382,
25059,
19,
5718,
713,
18,
20,
13,
327,
813,
... |
raise URLError('file not on local host') | raise urllib2.URLError('file not on local host') | def open_local_file(self, req): import mimetypes import mimetools host = req.get_host() file = req.get_selector() localfile = urllib.url2pathname(file) stats = os.stat(localfile) size = stats[stat.ST_SIZE] modified = rfc822.formatdate(stats[stat.ST_MTIME]) mtype = mimetypes.guess_type(file)[0] if host: host, port = urllib.splitport(host) if port or socket.gethostbyname(host) not in self.get_names(): raise URLError('file not on local host') fo = open(localfile,'rb') brange = req.headers.get('Range',None) brange = range_header_to_tuple(brange) assert brange != () if brange: (fb,lb) = brange if lb == '': lb = size if fb < 0 or fb > size or lb > size: raise RangeError('Requested Range Not Satisfiable') size = (lb - fb) fo = RangeableFileObject(fo, (fb,lb)) headers = mimetools.Message(StringIO( 'Content-Type: %s\nContent-Length: %d\nLast-modified: %s\n' % (mtype or 'text/plain', size, modified))) return urllib.addinfourl(fo, headers, 'file:'+file) | 910f95a098f1a90682e47d55fc5c2b6a80026f06 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7001/910f95a098f1a90682e47d55fc5c2b6a80026f06/byterange.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
3729,
67,
768,
12,
2890,
16,
1111,
4672,
1930,
20369,
15180,
1930,
20369,
278,
8192,
1479,
273,
1111,
18,
588,
67,
2564,
1435,
585,
273,
1111,
18,
588,
67,
9663,
1435,
1191,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
3729,
67,
768,
12,
2890,
16,
1111,
4672,
1930,
20369,
15180,
1930,
20369,
278,
8192,
1479,
273,
1111,
18,
588,
67,
2564,
1435,
585,
273,
1111,
18,
588,
67,
9663,
1435,
1191,
... |
'exe', | '.exe', | def locateQt4Command(env, command, qtdir) : suffixes = [ '-qt4', '-qt4.exe', '4', '4.exe', '', 'exe', ] | 3e583d7f5390b8bdda69341f0789d2a7f0d6e263 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1456/3e583d7f5390b8bdda69341f0789d2a7f0d6e263/qt4.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10627,
23310,
24,
2189,
12,
3074,
16,
1296,
16,
25672,
1214,
13,
294,
18333,
273,
306,
2400,
23311,
24,
2187,
2400,
23311,
24,
18,
14880,
2187,
296,
24,
2187,
296,
24,
18,
14880,
2187,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10627,
23310,
24,
2189,
12,
3074,
16,
1296,
16,
25672,
1214,
13,
294,
18333,
273,
306,
2400,
23311,
24,
2187,
2400,
23311,
24,
18,
14880,
2187,
296,
24,
2187,
296,
24,
18,
14880,
2187,
... |
' OR '.join((sql_clause,) * len(sub_ids)), reduce(lambda x, y: x + list(y), cursor.fetchall(), [])) | ' OR '.join((sql_clause,) * len(fetchall)), reduce(lambda x, y: x + list(y), fetchall, [])) | def _validate(self, cursor, user, ids, context=None): super(ModelSQL, self)._validate(cursor, user, ids, context=context) if cursor.has_constraint(): return # Works only for a single transaction for _, sql, error in self._sql_constraints: m = _RE_UNIQUE.match(sql) if m: sql = m.group(1) sql_clause = ' AND '.join('%s = %%s' % \ i for i in sql.split(',')) sql_clause = '(id != %s AND ' + sql_clause + ')' | cadc9c40f064aeefa2d0edb542e61d7abe269f8d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9266/cadc9c40f064aeefa2d0edb542e61d7abe269f8d/modelsql.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5662,
12,
2890,
16,
3347,
16,
729,
16,
3258,
16,
819,
33,
7036,
4672,
2240,
12,
1488,
3997,
16,
365,
2934,
67,
5662,
12,
9216,
16,
729,
16,
3258,
16,
819,
33,
2472,
13,
309,
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,
389,
5662,
12,
2890,
16,
3347,
16,
729,
16,
3258,
16,
819,
33,
7036,
4672,
2240,
12,
1488,
3997,
16,
365,
2934,
67,
5662,
12,
9216,
16,
729,
16,
3258,
16,
819,
33,
2472,
13,
309,
3... |
if not self.currentCategory in ("", categoryName): | if not self.currentCategory in (None, categoryName): | def FilterTable(self, widget, target = 0): text = widget.get_text().lower() cols = self.LastCols foundPlugin = False | ef823f6c47b523e2d29f59b25c8c86da6040c31f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1272/ef823f6c47b523e2d29f59b25c8c86da6040c31f/Window.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4008,
1388,
12,
2890,
16,
3604,
16,
1018,
273,
374,
4672,
977,
273,
3604,
18,
588,
67,
955,
7675,
8167,
1435,
5347,
273,
365,
18,
3024,
8011,
1392,
3773,
273,
1083,
2,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4008,
1388,
12,
2890,
16,
3604,
16,
1018,
273,
374,
4672,
977,
273,
3604,
18,
588,
67,
955,
7675,
8167,
1435,
5347,
273,
365,
18,
3024,
8011,
1392,
3773,
273,
1083,
2,
-100,
-100,
-100... |
msglist = self.__check_action( dump.get_rev_nr(), node ) | msglist = self.__check_action( revnr, node ) | def execute( self, dumpfilename ): """ Check a dump file. | 54fd7bcefe430648fa52336cc3ccf63025fcea6e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13212/54fd7bcefe430648fa52336cc3ccf63025fcea6e/tools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
365,
16,
4657,
3459,
262,
30,
3536,
2073,
279,
4657,
585,
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,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
365,
16,
4657,
3459,
262,
30,
3536,
2073,
279,
4657,
585,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
parent.insert(index - 1, child) | parent.insert(index, child) | def _find(tree, element): if element.tag == 'xpath': res = tree.xpath(element.get('expr')) if res: return res[0] return None | 9d6087762dd5a6985487ccda803fa283ba87ff99 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9266/9d6087762dd5a6985487ccda803fa283ba87ff99/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4720,
12,
3413,
16,
930,
4672,
309,
930,
18,
2692,
422,
296,
18644,
4278,
400,
273,
2151,
18,
18644,
12,
2956,
18,
588,
2668,
8638,
26112,
309,
400,
30,
327,
400,
63,
20,
65,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
389,
4720,
12,
3413,
16,
930,
4672,
309,
930,
18,
2692,
422,
296,
18644,
4278,
400,
273,
2151,
18,
18644,
12,
2956,
18,
588,
2668,
8638,
26112,
309,
400,
30,
327,
400,
63,
20,
65,
32... |
the small cell) and n,m are indices of the Wannier functions.""" | the small cell) and n,m are indices of the Wannier functions. """ | def get_hopping(self, R, calc): """Returns the matrix H(R)_nm=<0,n|H|R,m>. | 4a5018bb3ebbfcce6b1fa8b75bc159dea1dd6769 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1380/4a5018bb3ebbfcce6b1fa8b75bc159dea1dd6769/wannier.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
18444,
1382,
12,
2890,
16,
534,
16,
7029,
4672,
3536,
1356,
326,
3148,
670,
12,
54,
13,
67,
15094,
27127,
20,
16,
82,
96,
44,
96,
54,
16,
81,
18652,
2,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
18444,
1382,
12,
2890,
16,
534,
16,
7029,
4672,
3536,
1356,
326,
3148,
670,
12,
54,
13,
67,
15094,
27127,
20,
16,
82,
96,
44,
96,
54,
16,
81,
18652,
2,
-100,
-100,
-100,
-... |
def CheckoutDirs(directory, branch, cvsroot, dirlist): arglist = ['cvs', '-Q', '-d', cvsroot, 'co', '-P', '-N'] | def CheckoutDirs(directory, cvsroot, dirlist, date=None, branch=None): arglist = ['cvs', '-d', cvsroot, 'co', '-P', '-N'] if date is not None: arglist.extend(['-D', date]) | def CheckoutDirs(directory, branch, cvsroot, dirlist): arglist = ['cvs', '-Q', '-d', cvsroot, 'co', '-P', '-N'] if branch is not None: arglist.extend(['-r', branch]) arglist.extend(["mozilla/%s" % dir for dir in dirlist]) check_call(arglist, cwd=directory) | 761396e753954c9db2b0154e0e80366bdc29d8ff /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13067/761396e753954c9db2b0154e0e80366bdc29d8ff/cvs2hg-import.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29153,
9872,
12,
5149,
16,
276,
6904,
3085,
16,
1577,
1098,
16,
1509,
33,
7036,
16,
3803,
33,
7036,
4672,
31805,
273,
10228,
71,
6904,
2187,
2400,
72,
2187,
276,
6904,
3085,
16,
296,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29153,
9872,
12,
5149,
16,
276,
6904,
3085,
16,
1577,
1098,
16,
1509,
33,
7036,
16,
3803,
33,
7036,
4672,
31805,
273,
10228,
71,
6904,
2187,
2400,
72,
2187,
276,
6904,
3085,
16,
296,
2... |
return pywikibot.comms.data.request(self, path, method="PUT", body=data) | return http.request(self, path, method="PUT", body=data) | def getUrl(self, path, retry=True, sysop=False, data=None, compress=True, no_hostname=False, cookie_only=False): """DEPRECATED. | 409e3c2e653057fbcea6603535cec0fb3658a3b3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9005/409e3c2e653057fbcea6603535cec0fb3658a3b3/site.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8928,
12,
2890,
16,
589,
16,
3300,
33,
5510,
16,
2589,
556,
33,
8381,
16,
501,
33,
7036,
16,
8099,
33,
5510,
16,
1158,
67,
10358,
33,
8381,
16,
3878,
67,
3700,
33,
8381,
4672,
3536,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8928,
12,
2890,
16,
589,
16,
3300,
33,
5510,
16,
2589,
556,
33,
8381,
16,
501,
33,
7036,
16,
8099,
33,
5510,
16,
1158,
67,
10358,
33,
8381,
16,
3878,
67,
3700,
33,
8381,
4672,
3536,
... |
headers = response.HeaderDict( {'content-type': 'text/html', 'status': '200 OK'}) | status = '200 OK' | def application(environ, start_response): form = wsgilib.parse_formvars(environ, include_get_vars=True) headers = response.HeaderDict( {'content-type': 'text/html', 'status': '200 OK'}) form['environ'] = environ form['headers'] = headers res = func(*args, **form.mixed()) status = headers.pop('status') start_response(status, headers.headeritems()) return [res] | bfceb7aa266724f818b7696526816d18411f0d39 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12946/bfceb7aa266724f818b7696526816d18411f0d39/middleware.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2521,
12,
28684,
16,
787,
67,
2740,
4672,
646,
273,
341,
1055,
330,
495,
18,
2670,
67,
687,
4699,
12,
28684,
16,
2341,
67,
588,
67,
4699,
33,
5510,
13,
1267,
273,
296,
6976,
7791,
11... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2521,
12,
28684,
16,
787,
67,
2740,
4672,
646,
273,
341,
1055,
330,
495,
18,
2670,
67,
687,
4699,
12,
28684,
16,
2341,
67,
588,
67,
4699,
33,
5510,
13,
1267,
273,
296,
6976,
7791,
11... |
self._port_handle.RtsEnable = level def setDTR(self, level=1): | self._port_handle.RtsEnable = bool(level) def setDTR(self, level=True): | def setRTS(self, level=1): """Set terminal status line: Request To Send""" if not self._port_handle: raise portNotOpenError self._port_handle.RtsEnable = level | f163508a56e9c4a0cd51d4294add9531bc4f03ca /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10955/f163508a56e9c4a0cd51d4294add9531bc4f03ca/serialcli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
54,
8047,
12,
2890,
16,
1801,
33,
21,
4672,
3536,
694,
8651,
1267,
980,
30,
1567,
2974,
2479,
8395,
309,
486,
365,
6315,
655,
67,
4110,
30,
1002,
1756,
1248,
3678,
668,
365,
6315,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
54,
8047,
12,
2890,
16,
1801,
33,
21,
4672,
3536,
694,
8651,
1267,
980,
30,
1567,
2974,
2479,
8395,
309,
486,
365,
6315,
655,
67,
4110,
30,
1002,
1756,
1248,
3678,
668,
365,
6315,... |
hlines = point3d([0,0,0], pointsize = 0.01, rgbcolor = (1,1,1)) | hlines = point3d([0,0,0], pointsize = 0.01, rgbcolor = rgbcolor) | def render_wireframe(self): """ For polytopes in 2 or 3 dimensions, returns the edges as a list of lines. | dbdb3fc1a2e2ea33a2d2ecc78afb66bc9cc5cd48 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/dbdb3fc1a2e2ea33a2d2ecc78afb66bc9cc5cd48/polyhedra.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
14538,
3789,
12,
2890,
4672,
3536,
2457,
7573,
3669,
281,
316,
576,
578,
890,
5769,
16,
1135,
326,
5231,
487,
279,
666,
434,
2362,
18,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
14538,
3789,
12,
2890,
4672,
3536,
2457,
7573,
3669,
281,
316,
576,
578,
890,
5769,
16,
1135,
326,
5231,
487,
279,
666,
434,
2362,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
else: yield word, True | def search(self, length, constraints, more_constraints=None): for word in self.lengths[length]: if self._predicate(constraints, word): if more_constraints is not None: filled_constraints = [(l, cs + [(i, word[j])]) for j, (i, l, cs) in enumerate(more_constraints)] for args in filled_constraints: if not self.has_matches(*args): yield word, False break else: yield word, True else: yield word, True | 1b413e61bc1faa486503c945be62a0da8380d752 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6427/1b413e61bc1faa486503c945be62a0da8380d752/word.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
12,
2890,
16,
769,
16,
6237,
16,
1898,
67,
11967,
33,
7036,
4672,
364,
2076,
316,
365,
18,
14907,
63,
2469,
14542,
309,
365,
6315,
18344,
12,
11967,
16,
2076,
4672,
309,
1898,
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,
1623,
12,
2890,
16,
769,
16,
6237,
16,
1898,
67,
11967,
33,
7036,
4672,
364,
2076,
316,
365,
18,
14907,
63,
2469,
14542,
309,
365,
6315,
18344,
12,
11967,
16,
2076,
4672,
309,
1898,
67... | |
if not callable(callback): callback = print_line | if callback is None: callback = print_line | def retrlines(self, cmd, callback = None): '''Retrieve data in line mode. The argument is a RETR or LIST command. The callback function (2nd argument) is called for each line, with trailing CRLF stripped. This creates a new port for you. print_line() is the default callback.''' if not callable(callback): callback = print_line resp = self.sendcmd('TYPE A') conn = self.transfercmd(cmd) fp = conn.makefile('rb') while 1: line = fp.readline() if self.debugging > 2: print '*retr*', `line` if not line: break if line[-2:] == CRLF: line = line[:-2] elif line[-1:] == '\n': line = line[:-1] callback(line) fp.close() conn.close() return self.voidresp() | e874fc304e0ea29fc9608023b3f153b566e0acef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e874fc304e0ea29fc9608023b3f153b566e0acef/ftplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17343,
3548,
12,
2890,
16,
1797,
16,
1348,
273,
599,
4672,
9163,
5767,
501,
316,
980,
1965,
18,
1021,
1237,
353,
279,
10366,
54,
578,
15130,
1296,
18,
1021,
1348,
445,
261,
22,
4880,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17343,
3548,
12,
2890,
16,
1797,
16,
1348,
273,
599,
4672,
9163,
5767,
501,
316,
980,
1965,
18,
1021,
1237,
353,
279,
10366,
54,
578,
15130,
1296,
18,
1021,
1348,
445,
261,
22,
4880,
1... |
files in those directories. | files in those directories. | def expand_dirs(files, basepath = ""): """ Replace the entries in files that correspond to directories with the list of files in those directories. """ if basepath: lb = len(basepath)+1 else: lb = 0 newlist = [] for f in files: base = os.path.join(basepath, f) if os.path.isdir(base): for root, ds, fs in os.walk(base): for ff in fs: newlist.append(os.path.join(root,ff)[lb:]) else: newlist.append(f) return newlist | 45993a34c5f74021aee867971469dbe2b823fad7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9140/45993a34c5f74021aee867971469dbe2b823fad7/make_patch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4542,
67,
8291,
12,
2354,
16,
23853,
273,
1408,
4672,
3536,
6910,
326,
3222,
316,
1390,
716,
4325,
358,
6402,
598,
326,
666,
434,
1390,
316,
5348,
6402,
18,
3536,
309,
23853,
30,
7831,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4542,
67,
8291,
12,
2354,
16,
23853,
273,
1408,
4672,
3536,
6910,
326,
3222,
316,
1390,
716,
4325,
358,
6402,
598,
326,
666,
434,
1390,
316,
5348,
6402,
18,
3536,
309,
23853,
30,
7831,
... |
for l in handle: lines += [ l ] res_match = res_match or self.ex_resolution.search( l ) if first_model_only and l[:6] == 'ENDMDL': break if res_match: if res_match.groups()[0] == 'NOT APPLICABLE': infos['resolution'] = self.NMR_RESOLUTION else: infos['resolution'] = float( res_match.groups()[0] ) else: raise BlastError, 'No resolution record found in PDB.' return lines, infos | for l in handle: lines += [ l ] res_match = res_match or self.ex_resolution.search( l ) if first_model_only and l[:6] == 'ENDMDL': break if res_match: if res_match.groups()[0] == 'NOT APPLICABLE': infos['resolution'] = self.NMR_RESOLUTION else: infos['resolution'] = float( res_match.groups()[0] ) else: raise BlastError, 'No resolution record found in PDB.' return lines, infos | def parsePdbFromHandle(self, handle, first_model_only=True ): | d1d0f0dde1db9aab3ed06b90b829e6ce5f0be3a0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/482/d1d0f0dde1db9aab3ed06b90b829e6ce5f0be3a0/TemplateSearcher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
52,
1966,
1265,
3259,
12,
2890,
16,
1640,
16,
1122,
67,
2284,
67,
3700,
33,
5510,
262,
30,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
52,
1966,
1265,
3259,
12,
2890,
16,
1640,
16,
1122,
67,
2284,
67,
3700,
33,
5510,
262,
30,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return time.time() | return time.localtime(time.time()) | def getTime(self): """Subclasses may override this to provide an alternate time to display""" return time.time() | e96d2abb94bbef12791c059c3c391e7ced021415 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6757/e96d2abb94bbef12791c059c3c391e7ced021415/vfdwidgets.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6135,
12,
2890,
4672,
3536,
1676,
4701,
2026,
3849,
333,
358,
5615,
392,
12184,
813,
358,
2562,
8395,
327,
813,
18,
957,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6135,
12,
2890,
4672,
3536,
1676,
4701,
2026,
3849,
333,
358,
5615,
392,
12184,
813,
358,
2562,
8395,
327,
813,
18,
957,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
re_filename_version = re.compile(r'\D%s\D*\.es[mp]' % plugin_version) | re_filename_version = re.compile(r'\D%s\D*\.es[mp]' % plugin_version, re.IGNORECASE) | def __setattr__(self, item, value): self.__setitem__(item, value) | 07c6564afc09f1eae18d93180e08f3e41b8bb49e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2827/07c6564afc09f1eae18d93180e08f3e41b8bb49e/mlox.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
1747,
972,
12,
2890,
16,
761,
16,
460,
4672,
365,
16186,
542,
1726,
972,
12,
1726,
16,
460,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
1747,
972,
12,
2890,
16,
761,
16,
460,
4672,
365,
16186,
542,
1726,
972,
12,
1726,
16,
460,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
Redirector.redirect(self) | def redirect(self): Redirector.redirect(self) self.addLogEntry() | d06b69fb05d2caacc88f8983a8f607b2f1a0672b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10164/d06b69fb05d2caacc88f8983a8f607b2f1a0672b/redirector.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3136,
12,
2890,
4672,
365,
18,
1289,
25548,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
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,
3136,
12,
2890,
4672,
365,
18,
1289,
25548,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
if filter(lambda vf: vf in self.fields, virtual_fields): raise SchemaError, 'Virtual field %s clashes with a preexisting field in the database.' % vf | for vf in virtual_fields: if vf in self.fields: raise SchemaError, 'Virtual field %s clashes with a preexisting field in the database.' % vf | def __init__(self, formatter, db, *virtual_fields): assert isinstance(formatter, Formatter) or formatter is None assert isinstance(db, SimpleDatabaseWrapper) self.formatter = formatter self.db = db self.fields = db.get_columns() if filter(lambda vf: vf in self.fields, virtual_fields): raise SchemaError, 'Virtual field %s clashes with a preexisting field in the database.' % vf self.virtual_fields = virtual_fields | 1abec58e5ce04c80730a3efd5e8dcbfec0be517f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4025/1abec58e5ce04c80730a3efd5e8dcbfec0be517f/schema.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4453,
16,
1319,
16,
380,
12384,
67,
2821,
4672,
1815,
1549,
12,
12354,
16,
14924,
13,
578,
4453,
353,
599,
1815,
1549,
12,
1966,
16,
4477,
4254,
3611,
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,
2738,
972,
12,
2890,
16,
4453,
16,
1319,
16,
380,
12384,
67,
2821,
4672,
1815,
1549,
12,
12354,
16,
14924,
13,
578,
4453,
353,
599,
1815,
1549,
12,
1966,
16,
4477,
4254,
3611,
13... |
"Some the norm of the gradient on some atoms exceeds the " "threshold (%.1e > %.1e). The current implementation of the " "ConstrainExt treatment only works on optimized geometries." % ( | "The rmsd of the gradient on some atoms exceeds the threshold " "(%.1e > %.1e). The current implementation of the ConstrainExt " "treatment only works on optimized geometries." % ( | def compute_hessian(self, molecule, do_modes): """See :meth:`Treatment.compute_hessian` | 40f032063e149e171bf1871da0ae9eecc5a7f997 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11051/40f032063e149e171bf1871da0ae9eecc5a7f997/nma.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3671,
67,
76,
20529,
12,
2890,
16,
13661,
16,
741,
67,
19282,
4672,
3536,
9704,
294,
27305,
28288,
56,
6150,
475,
18,
9200,
67,
76,
20529,
68,
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,
0,
0,
0,
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,
3671,
67,
76,
20529,
12,
2890,
16,
13661,
16,
741,
67,
19282,
4672,
3536,
9704,
294,
27305,
28288,
56,
6150,
475,
18,
9200,
67,
76,
20529,
68,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
newRolloverAt = self.rolloverAt + (daysToWait * (60 * 60 * 24)) if not utc: | newRolloverAt = result + (daysToWait * (60 * 60 * 24)) if not self.utc: | def __init__(self, filename, when='h', interval=1, backupCount=0, encoding=None, delay=0, utc=False): BaseRotatingHandler.__init__(self, filename, 'a', encoding, delay) self.when = when.upper() self.backupCount = backupCount self.utc = utc # Calculate the real rollover interval, which is just the number of # seconds between rollovers. Also set the filename suffix used when # a rollover occurs. Current 'when' events supported: # S - Seconds # M - Minutes # H - Hours # D - Days # midnight - roll over at midnight # W{0-6} - roll over on a certain day; 0 - Monday # # Case of the 'when' specifier is not important; lower or upper case # will work. currentTime = int(time.time()) if self.when == 'S': self.interval = 1 # one second self.suffix = "%Y-%m-%d_%H-%M-%S" self.extMatch = r"^\d{4}-\d{2}-\d{2}_\d{2}-\d{2}-\d{2}$" elif self.when == 'M': self.interval = 60 # one minute self.suffix = "%Y-%m-%d_%H-%M" self.extMatch = r"^\d{4}-\d{2}-\d{2}_\d{2}-\d{2}$" elif self.when == 'H': self.interval = 60 * 60 # one hour self.suffix = "%Y-%m-%d_%H" self.extMatch = r"^\d{4}-\d{2}-\d{2}_\d{2}$" elif self.when == 'D' or self.when == 'MIDNIGHT': self.interval = 60 * 60 * 24 # one day self.suffix = "%Y-%m-%d" self.extMatch = r"^\d{4}-\d{2}-\d{2}$" elif self.when.startswith('W'): self.interval = 60 * 60 * 24 * 7 # one week if len(self.when) != 2: raise ValueError("You must specify a day for weekly rollover from 0 to 6 (0 is Monday): %s" % self.when) if self.when[1] < '0' or self.when[1] > '6': raise ValueError("Invalid day specified for weekly rollover: %s" % self.when) self.dayOfWeek = int(self.when[1]) self.suffix = "%Y-%m-%d" self.extMatch = r"^\d{4}-\d{2}-\d{2}$" else: raise ValueError("Invalid rollover interval specified: %s" % self.when) | 0061f8f2feaaecf221a87fa35b3ffd306596404e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/0061f8f2feaaecf221a87fa35b3ffd306596404e/handlers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1544,
16,
1347,
2218,
76,
2187,
3673,
33,
21,
16,
5114,
1380,
33,
20,
16,
2688,
33,
7036,
16,
4624,
33,
20,
16,
9439,
33,
8381,
4672,
3360,
8570,
1776,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1544,
16,
1347,
2218,
76,
2187,
3673,
33,
21,
16,
5114,
1380,
33,
20,
16,
2688,
33,
7036,
16,
4624,
33,
20,
16,
9439,
33,
8381,
4672,
3360,
8570,
1776,... |
if line == '*** EOOH ***' + os.linesep or line == '': | if line == '*** EOOH ***' + os.linesep or not line: | def get_message(self, key): """Return a Message representation or raise a KeyError.""" start, stop = self._lookup(key) self._file.seek(start) self._file.readline() # Skip '1,' line specifying labels. original_headers = StringIO.StringIO() while True: line = self._file.readline() if line == '*** EOOH ***' + os.linesep or line == '': break original_headers.write(line.replace(os.linesep, '\n')) visible_headers = StringIO.StringIO() while True: line = self._file.readline() if line == os.linesep or line == '': break visible_headers.write(line.replace(os.linesep, '\n')) body = self._file.read(stop - self._file.tell()).replace(os.linesep, '\n') msg = BabylMessage(original_headers.getvalue() + body) msg.set_visible(visible_headers.getvalue()) if key in self._labels: msg.set_labels(self._labels[key]) return msg | d373ead37954e8a4f6d449fdc08084eb0c428c76 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/d373ead37954e8a4f6d449fdc08084eb0c428c76/mailbox.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2150,
12,
2890,
16,
498,
4672,
3536,
990,
279,
2350,
4335,
578,
1002,
279,
4999,
12123,
787,
16,
2132,
273,
365,
6315,
8664,
12,
856,
13,
365,
6315,
768,
18,
16508,
12,
1937,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2150,
12,
2890,
16,
498,
4672,
3536,
990,
279,
2350,
4335,
578,
1002,
279,
4999,
12123,
787,
16,
2132,
273,
365,
6315,
8664,
12,
856,
13,
365,
6315,
768,
18,
16508,
12,
1937,
... |
auth_header = 'Proxy-Authorization' | auth_header = 'Proxy-authorization' | def http_error_401(self, req, fp, code, msg, headers): host = urlparse.urlparse(req.get_full_url())[1] return self.http_error_auth_reqed('www-authenticate', host, req, headers) | 78369cba63bbebebc5a0d9d184eb858f3ea1268a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/78369cba63bbebebc5a0d9d184eb858f3ea1268a/urllib2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1062,
67,
1636,
67,
27002,
12,
2890,
16,
1111,
16,
4253,
16,
981,
16,
1234,
16,
1607,
4672,
1479,
273,
15185,
18,
718,
2670,
12,
3658,
18,
588,
67,
2854,
67,
718,
10756,
63,
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,
1062,
67,
1636,
67,
27002,
12,
2890,
16,
1111,
16,
4253,
16,
981,
16,
1234,
16,
1607,
4672,
1479,
273,
15185,
18,
718,
2670,
12,
3658,
18,
588,
67,
2854,
67,
718,
10756,
63,
21,
65,
... |
Indexed sequence of elements [5.0000000000000000, 0, 0, 0, 0] | Indexed sequence: [5.00000000000000, 0, 0, 0, 0] | def fft(self): """ Wraps the gsl FastFourierTransform.forward in fft.pyx. If the length is a power of 2 then this automatically uses the radix2 method. If the number of sample points in the input is a power of 2 then the wrapper for the GSL function gsl_fft_complex_radix2_forward is automatically called. Otherwise, gsl_fft_complex_forward is used. | 431e77dd49c749a75ebdd4465e177155608021e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9417/431e77dd49c749a75ebdd4465e177155608021e6/dft.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15741,
12,
2890,
4672,
3536,
678,
7506,
326,
314,
2069,
9545,
42,
24775,
4059,
18,
11565,
316,
15741,
18,
2074,
92,
18,
225,
971,
326,
769,
353,
279,
7212,
434,
576,
1508,
333,
6635,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15741,
12,
2890,
4672,
3536,
678,
7506,
326,
314,
2069,
9545,
42,
24775,
4059,
18,
11565,
316,
15741,
18,
2074,
92,
18,
225,
971,
326,
769,
353,
279,
7212,
434,
576,
1508,
333,
6635,
4... |
return val, _quote( dumps(val) ) | return val, _quote( dumps(val).decode('latin-1') ) | def value_encode(self, val): return val, _quote( dumps(val) ) | 26547c170d08aef825a140b86868c82fbab44447 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/26547c170d08aef825a140b86868c82fbab44447/Cookie.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
460,
67,
3015,
12,
2890,
16,
1244,
4672,
327,
1244,
16,
389,
6889,
12,
6711,
12,
1125,
13,
262,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
460,
67,
3015,
12,
2890,
16,
1244,
4672,
327,
1244,
16,
389,
6889,
12,
6711,
12,
1125,
13,
262,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
obj = "built/tmp/"+obj | obj = PREFIX+"/tmp/"+obj | def CompileRES(obj=0,src=0,ipath=[],opts=[]): if ((obj==0)|(src==0)): sys.exit("syntax error in CompileRES directive"); fullsrc = CxxFindSource(src, ipath) if (fullsrc == 0): sys.exit("Cannot find source file "+src) obj = "built/tmp/"+obj wdep = CxxCalcDependencies(fullsrc, ipath, []) if (COMPILER=="MSVC7"): if (older(obj, wdep)): cmd = 'rc.exe /d "NDEBUG" /l 0x409' for x in ipath: cmd = cmd + " /I " + x; cmd = cmd + ' /fo"' + obj + '"' cmd = cmd + ' "'+ fullsrc + '"' oscmd(cmd) updatefiledate(obj) if (COMPILER=="LINUXA"): sys.exit("Can only compile RES files on Windows.") | 4a71a3ad56d88a79d9aba6c9d9fa1abc8c3a885e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8543/4a71a3ad56d88a79d9aba6c9d9fa1abc8c3a885e/makepanda.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16143,
7031,
12,
2603,
33,
20,
16,
4816,
33,
20,
16,
625,
421,
22850,
6487,
4952,
33,
8526,
4672,
309,
14015,
2603,
631,
20,
14047,
12,
4816,
631,
20,
3719,
30,
2589,
18,
8593,
2932,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16143,
7031,
12,
2603,
33,
20,
16,
4816,
33,
20,
16,
625,
421,
22850,
6487,
4952,
33,
8526,
4672,
309,
14015,
2603,
631,
20,
14047,
12,
4816,
631,
20,
3719,
30,
2589,
18,
8593,
2932,
... |
raise PLCAuthenticationFailure, "Requestor IP %s does not mach node IP %s" % \ | raise PLCAuthenticationFailure, "Requestor IP %s does not match node IP %s" % \ | def check(self, method, auth, *args): # Method.type_check() should have checked that all of the # mandatory fields were present. assert auth.has_key('node_id') | 8917859edac0280102ada9b484f16eb8c61c9bfb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7598/8917859edac0280102ada9b484f16eb8c61c9bfb/Auth.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
12,
2890,
16,
707,
16,
1357,
16,
380,
1968,
4672,
468,
2985,
18,
723,
67,
1893,
1435,
1410,
1240,
5950,
716,
777,
434,
326,
468,
11791,
1466,
4591,
3430,
18,
1815,
1357,
18,
5332,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
12,
2890,
16,
707,
16,
1357,
16,
380,
1968,
4672,
468,
2985,
18,
723,
67,
1893,
1435,
1410,
1240,
5950,
716,
777,
434,
326,
468,
11791,
1466,
4591,
3430,
18,
1815,
1357,
18,
5332,... |
ser = self.btmc.getService() obex = self.btmc.getServiceObex() print "BT BtmodGUIupdate [info] power:"+str(s)+"; visibility:"+str(v)+" services:"+str(ser)+" obxeftpd:"+str(obex) | print "BT BtmodGUIupdate [info] power:"+str(s)+"; visibility:"+str(v) | def BtmodGUIupdate(self): s = self.btmc.getPower() v = self.btmc.getVisibility() ser = self.btmc.getService() obex = self.btmc.getServiceObex() print "BT BtmodGUIupdate [info] power:"+str(s)+"; visibility:"+str(v)+" services:"+str(ser)+" obxeftpd:"+str(obex) if s == 1: self.toggle1.show() if v: self.toggle1.state_set(1) else: self.toggle1.state_set(0) | 96df52ecbc51e86f029c1e5a29cf17a34ae92540 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11428/96df52ecbc51e86f029c1e5a29cf17a34ae92540/shr_bt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
605,
88,
1711,
43,
5370,
2725,
12,
2890,
4672,
272,
273,
365,
18,
23602,
13952,
18,
588,
13788,
1435,
331,
273,
365,
18,
23602,
13952,
18,
588,
10135,
1435,
1172,
315,
38,
56,
605,
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,
605,
88,
1711,
43,
5370,
2725,
12,
2890,
4672,
272,
273,
365,
18,
23602,
13952,
18,
588,
13788,
1435,
331,
273,
365,
18,
23602,
13952,
18,
588,
10135,
1435,
1172,
315,
38,
56,
605,
88,... |
('C:\\Program Files', 'Microsoft Visual Studio 8', 'Common7', 'IDE', 'devenv.com'), | def initialize_build_tool(self): """ Initializes the Visual Studio .build_tool parameter, searching %PATH% and %PATHEXT% for a devenv.{exe,bat,...} executable, and falling back to a hard-coded default (on the current drive) if necessary. """ super(TestGypMSVS, self).initialize_build_tool() if not self.build_tool: # We didn't find 'devenv' on the path. Just hard-code a default, # and revisit this if it becomes important. possible = [ ('C:\\Program Files', 'Microsoft Visual Studio 8', 'Common7', 'IDE', 'devenv.com'), | 8d0de159c5891d010f9280fc78f70e6e3f9f242f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6220/8d0de159c5891d010f9280fc78f70e6e3f9f242f/TestGyp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
67,
3510,
67,
6738,
12,
2890,
4672,
3536,
10188,
3128,
326,
26832,
934,
4484,
263,
3510,
67,
6738,
1569,
16,
15300,
738,
4211,
9,
471,
738,
4211,
4142,
9,
364,
279,
4461,
3074,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
67,
3510,
67,
6738,
12,
2890,
4672,
3536,
10188,
3128,
326,
26832,
934,
4484,
263,
3510,
67,
6738,
1569,
16,
15300,
738,
4211,
9,
471,
738,
4211,
4142,
9,
364,
279,
4461,
3074,
2... | |
raise ValueError, "Incorrect length of data produced" | raise IOError, "Incorrect length of data produced" | def _read_eof(self): # We've read to the end of the file, so we have to rewind in order # to reread the 8 bytes containing the CRC and the file size. # We check the that the computed CRC and size of the # uncompressed data matches the stored values. Note that the size # stored is the true file size mod 2**32. self.fileobj.seek(-8, 1) crc32 = read32(self.fileobj) isize = U32(read32(self.fileobj)) # may exceed 2GB if U32(crc32) != U32(self.crc): raise ValueError, "CRC check failed" elif isize != LOWU32(self.size): raise ValueError, "Incorrect length of data produced" | 04ea4fbe05eaed009801243ce743503068de45af /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/04ea4fbe05eaed009801243ce743503068de45af/gzip.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
896,
67,
9339,
12,
2890,
4672,
468,
1660,
8081,
855,
358,
326,
679,
434,
326,
585,
16,
1427,
732,
1240,
358,
12881,
316,
1353,
468,
358,
436,
264,
684,
326,
1725,
1731,
4191,
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,
389,
896,
67,
9339,
12,
2890,
4672,
468,
1660,
8081,
855,
358,
326,
679,
434,
326,
585,
16,
1427,
732,
1240,
358,
12881,
316,
1353,
468,
358,
436,
264,
684,
326,
1725,
1731,
4191,
326,... |
sys.exit(False) | sys.exit(1) | def main(): """Support mirobridge from the command line returns True """ global localhostname, simulation, verbose, storagegroups, ffmpeg, channel_id, channel_num global flat, download_sleeptime, channel_watch_only, channel_mythvideo_only, channel_new_watch_copy global vid_graphics_dirs, imagemagick, statistics, requirements_are_met global graphic_suffix, graphic_path_suffix, graphic_name_suffix global mythcommflag_recordings, mythcommflag_videos global local_only parser = OptionParser(usage=u"%prog usage: mirobridge -huevstdociVHSCWM [parameters]\n") parser.add_option( "-e", "--examples", action="store_true", default=False, dest="examples", help=u"Display examples for executing the jamu script") parser.add_option( "-v", "--version", action="store_true", default=False, dest="version", help=u"Display version and author information") parser.add_option( "-s", "--simulation", action="store_true", default=False, dest="simulation", help=u"Simulation (dry run), no files are copied, symlinks created or MythTV data bases altered. If option (-n) is NOT specified Miro auto downloads WILL take place. See option (-n) help for details.") parser.add_option( "-t", "--testenv", action="store_true", default=False, dest="testenv", help=u"Test that the local environment can run all mirobridge functionality") parser.add_option( "-n", "--no_autodownload", action="store_true", default=False, dest="no_autodownload", help=u"Do not perform Miro Channel updates, video expiry and auto-downloadings. Default is to perform all perform all Channel maintenance features.") parser.add_option( "-o", "--nosubdirs", action="store_true", default=False, dest="nosubdirs", help=u"Organise MythVideo's Miro directory WITHOUT Miro channel subdirectories. The default is to have Channel subdirectories.") parser.add_option( "-c", "--channel", metavar="CHANNEL_ID:CHANNEL_NUM", default="", dest="channel", help=u'Specifies the channel id that is used for Miros unplayed recordings. Enter as "xxxx:yyy". Default is 9999:999. Be warned that once you change the default channel_id "9999" you must always use this option!') #parser.add_option( "-i", "--import", metavar="CONFIGFILE", default="", dest="import", # help=u'Import Miro exported configuration file and or channel changes.') parser.add_option( "-V", "--verbose", action="store_true", default=False, dest="verbose", help=u"Display verbose messages when processing") parser.add_option( "-H", "--hostname", metavar="HOSTNAME", default="", dest="hostname", help=u"MythTV Backend hostname mirobridge is to up date") parser.add_option( "-S", "--sleeptime", metavar="SLEEP_DELAY_SECONDS", default="", dest="sleeptime", help=u"The amount of seconds to wait for an auto download to start.\nThe default is 60 seconds, but this may need to be adjusted for slower Internet connections.") parser.add_option( "-C", "--addchannel", metavar="ICONFILE_PATH", default="OFF", dest="addchannel", help=u'Add a Miro Channel record to MythTV. This gets rid of the "#9999 #9999" on the Watch Recordings screen and replaces it with the usual\nthe channel number and channel name.\nThe default if not overridden by the (-c) option is channel number 999.\nIf a filename and path is supplied it will be set as the channels icon. Make sure your override channel number is NOT one of your current MythTV channel numbers.\nThis option is typically only used once as there can only be one Miro channel record at a time.') parser.add_option( "-N", "--new_watch_copy", action="store_true", default=False, dest="new_watch_copy", help=u'For ALL Miro Channels: Use the "Watch Recording" screen to watch new Miro downloads then once watched copy the videos, icons, screen shot and metadata to MythVideo. Once coping is complete delete the video from Miro.\nThis option overrides any "mirobridge.conf" settings.') parser.add_option( "-W", "--watch_only", action="store_true", default=False, dest="watch_only", help=u'For ALL Miro Channels: Only use "Watch Recording" never move any Miro videos to MythVideo.\nThis option overrides any "mirobridge.conf" settings.') parser.add_option( "-M", "--mythvideo_only", action="store_true", default=False, dest="mythvideo_only", help=u'For ALL Miro Channel videos: Copy newly downloaded Miro videos to MythVideo and removed from Miro. These Miro videos never appear in the MythTV "Watch Recording" screen.\nThis option overrides any "mirobridge.conf" settings.') opts, args = parser.parse_args() if opts.examples: # Display example information sys.stdout.write(examples_txt+'\n') sys.exit(True) if opts.version: # Display program information sys.stdout.write(u"\nTitle: (%s); Version: description(%s); Author: (%s)\n%s\n" % ( __title__, __version__, __author__, __purpose__ )) sys.exit(True) if opts.testenv: test_environment = True else: test_environment = False # Verify that Miro is not currently running if isMiroRunning(): sys.exit(False) # Verify that only None or one of the mutually exclusive (-W), (-M) and (-N) options is being used x = 0 if opts.new_watch_copy: x+=1 if opts.watch_only: x+=1 if opts.mythvideo_only: x+=1 if x > 1: logger.critical(u"The (-W), (-M) and (-N) options are mutually exclusive, so only one can be specified at a time.") sys.exit(False) # Set option related global variables simulation = opts.simulation verbose = opts.verbose if opts.hostname: # Override localhostname if the user specified an hostname localhostname = opts.hostname # Validate settings # Make sure mirobridge is to update a real MythTV backend if not mythdb.getSetting(u'BackendServerIP', hostname = localhostname): logger.critical(u"The MythTV backend (%s) is not a MythTV backend." % localhostname) if test_environment: requirements_are_met = False else: sys.exit(False) ## Video base directory and current version and revision numbers base_video_dir = config.get(prefs.MOVIES_DIRECTORY) miro_version_rev = u"%s r%s" % (config.get(prefs.APP_VERSION), config.get(prefs.APP_REVISION_NUM)) displayMessage(u"Miro Version (%s)" % (miro_version_rev)) displayMessage(u"Base Miro Video Directory (%s)" % (base_video_dir,)) logger.info(u'') # Verify Miro version sufficent and Video file configuration correct. if not os.path.isdir(base_video_dir): logger.critical(u"The Miro Videos directory (%s) does not exist." % str(base_video_dir)) if test_environment: requirements_are_met = False else: sys.exit(False) if config.get(prefs.APP_VERSION) < u"2.0.3": logger.critical(u"The installed version of Miro (%s) is too old. It must be at least v2.0.3 or higher." % config.get(prefs.APP_VERSION)) if test_environment: requirements_are_met = False else: sys.exit(False) # Get storage groups if getStorageGroups() == False: logger.critical(u"Retrieving storage groups from the MythTV data base failed") if test_environment: requirements_are_met = False else: sys.exit(False) elif not u'default' in storagegroups.keys(): logger.critical(u"There must be a 'Default' storage group") if test_environment: requirements_are_met = False else: sys.exit(False) if opts.channel: channel = opts.channel.split(u':') if len(channel) != 2: logger.critical(u"The Channel (%s) must be in the format xxx:yyy with x an y all numeric." % str(opts.channel)) if test_environment: requirements_are_met = False else: sys.exit(False) elif not _can_int(channel[0]) or not _can_int(channel[1]): logger.critical(u"The Channel_id (%s) and Channel_num (%s) must be numeric." % (channel[0], channel[1])) if test_environment: requirements_are_met = False else: sys.exit(False) else: channel_id = int(channel[0]) channel_num = int(channel[1]) if opts.sleeptime: if not _can_int(opts.sleeptime): logger.critical(u"Auto-dewnload sleep time (%s) must be numeric." % str(opts.sleeptime)) if test_environment: requirements_are_met = False else: sys.exit(False) else: download_sleeptime = float(opts.sleeptime) getMythtvDirectories() # Initialize all the Video and graphics directory dictionary if opts.nosubdirs: # Did the user want a flat MythVideo "Miro" directory structure? flat = True # Get the values in the mirobridge.conf configuration file setUseroptions() if opts.watch_only: # ALL Miro videos will only be viewed in the MythTV "Watch Recordings" screen channel_watch_only = [u'all'] if opts.mythvideo_only: # ALL Miro videos will be copied to MythVideo and removed from Miro channel_mythvideo_only = {u'all': vid_graphics_dirs[u'mythvideo']+u'Miro/'} # Once watched ALL Miro videos will be copied to MythVideo and removed from Miro if opts.new_watch_copy: channel_new_watch_copy = {u'all': vid_graphics_dirs[u'mythvideo']+u'Miro/'} # Verify that "Mythvideo Only" and "New-Watch-Copy" channels do not clash if len(channel_mythvideo_only) and len(channel_new_watch_copy): for key in channel_mythvideo_only.keys(): if key in channel_new_watch_copy.keys(): logger.critical(u'The Miro Channel (%s) cannot be used as both a "Mythvideo Only" and "New-Watch-Copy" channel.' % key) if test_environment: requirements_are_met = False else: sys.exit(False) # Verify that ImageMagick is installed ret = useImageMagick(u"convert -version") if ret < 0 or ret > 1: logger.critical(u"ImageMagick must be installed, graphics cannot be resized or converted to the required graphics format (e.g. jpg and or png)") if test_environment: requirements_are_met = False else: sys.exit(False) # Verify that mythcommflag is installed mythcommflagpath = getlocationMythcommflag() if mythcommflagpath: mythcommflag_recordings = mythcommflag_recordings % mythcommflagpath mythcommflag_videos = mythcommflag_videos % mythcommflagpath else: logger.critical(u"mythcommflag must be installed so that Miro video seek tables can be built.") if test_environment: requirements_are_met = False else: sys.exit(False) if opts.testenv: # All tests passed getVideoDetails(u"") # Test that ffmpeg is available if ffmpeg and requirements_are_met: logger.info(u"The environment test passed !\n\n") sys.exit(True) else: logger.critical(u"The environment test FAILED. See previously displayed error messages!") sys.exit(False) if opts.addchannel != u'OFF': # Add a Miro Channel record - Should only be done once createChannelRecord(opts.addchannel, channel_id, channel_num) logger.info(u"The Miro Channel record has been successfully created !\n\n") sys.exit(True) ########################################### # Mainlogic for all Miro and MythTV bridge ########################################### # # Start the Miro Front and Backend - This allows mirobridge to execute actions on the Miro backend # displayMessage(u"Starting Miro Frontend and Backend") startup.initialize(config.get(prefs.THEME_NAME)) app.cli_events = EventHandler() app.cli_events.connect_to_signals() startup.startup() app.cli_events.startup_event.wait() if app.cli_events.startup_failure: logger.critical(u"Starting Miro Frontend and Backend failed: (%s)" % app.cli_events.startup_failure[0]) print_text(app.cli_events.startup_failure[1]) app.controller.shutdown() time.sleep(5) # Let the shutdown processing complete sys.exit(False) app.cli_interpreter = MiroInterpreter() if opts.verbose: app.cli_interpreter.verbose = True else: app.cli_interpreter.verbose = False app.cli_interpreter.simulation = opts.simulation app.cli_interpreter.videofiles = [] app.cli_interpreter.downloading = False app.cli_interpreter.icon_cache_dir = config.get(prefs.ICON_CACHE_DIRECTORY) app.cli_interpreter.imagemagick = imagemagick app.cli_interpreter.statistics = statistics if config.get(prefs.APP_VERSION) < u"2.5.0": app.renderer = app.cli_interpreter else: app.movie_data_program_info = app.cli_interpreter.movie_data_program_info # # Optionally Update Miro feeds and # download any "autodownloadable" videos which are pending # if not opts.no_autodownload: if opts.verbose: app.cli_interpreter.verbose = False app.cli_interpreter.do_mythtv_getunwatched(u'') before_download = len(app.cli_interpreter.videofiles) if opts.verbose: app.cli_interpreter.verbose = True app.cli_interpreter.do_mythtv_update_autodownload(u'') time.sleep(download_sleeptime) firsttime = True while True: app.cli_interpreter.do_mythtv_check_downloading(u'') if app.cli_interpreter.downloading: time.sleep(30) firsttime = False continue elif firsttime: time.sleep(download_sleeptime) firsttime = False continue else: break if opts.verbose: app.cli_interpreter.verbose = False app.cli_interpreter.do_mythtv_getunwatched(u'') after_download = len(app.cli_interpreter.videofiles) statistics[u'Miros_videos_downloaded'] = after_download - before_download if opts.verbose: app.cli_interpreter.verbose = True # Deal with orphaned oldrecorded records. # These records indicate that the MythTV user deleted the video from the Watched Recordings screen # or from MythVideo # These video items must also be deleted from Miro videostodelete = getOldrecordedOrphans() if len(videostodelete): displayMessage(u"Starting Miro delete of videos deleted in the MythTV Watched Recordings screen.") for video in videostodelete: # Completely remove the video and item information from Miro app.cli_interpreter.do_mythtv_item_remove([video[u'title'], video[u'subtitle']]) # # Collect the set of played Miro video files # app.cli_interpreter.videofiles = getPlayedMiroVideos() # # Updated the played status of items # if app.cli_interpreter.videofiles: displayMessage(u"Starting Miro update of watched MythTV videos") app.cli_interpreter.do_mythtv_updatewatched(u'') # # Get the unwatched videos details from Miro # app.cli_interpreter.do_mythtv_getunwatched(u'') unwatched = app.cli_interpreter.videofiles # # Get the watched videos details from Miro # app.cli_interpreter.do_mythtv_getwatched(u'') watched = app.cli_interpreter.videofiles # # Remove any duplicate Miro videoes from the unwatched or watched list of Miro videos # This means that Miro has duplicates due to a Miro/Channel website issue # These videos should not be added to the MythTV Watch Recordings screen # unwatched_copy = [] for item in unwatched: unwatched_copy.append(item) for item in unwatched_copy: # Check for a duplicate against already watched Miro videos for x in watched: if item[u'channelTitle'] == x[u'channelTitle'] and item[u'title'] == x[u'title']: try: unwatched.remove(item) # Completely remove this duplicate video and item information from Miro app.cli_interpreter.do_mythtv_item_remove(item[u'videoFilename']) displayMessage(u"Skipped adding a duplicate Miro video to the MythTV Watch Recordings screen (%s - %s) which is already in MythVideo.\nSometimes a Miro channel has the same video downloaded multiple times.\nThis is a Miro/Channel web site issue and often rectifies itself overtime." % (item[u'channelTitle'], item[u'title'])) except ValueError: pass duplicates = [] for item in unwatched_copy: dup_flag = 0 for x in unwatched: # Check for a duplicate against un-watched Miro videos if item[u'channelTitle'] == x[u'channelTitle'] and item[u'title'] == x[u'title']: dup_flag+=1 if dup_flag > 1: for x in duplicates: if item[u'channelTitle'] == x[u'channelTitle'] and item[u'title'] == x[u'title']: break else: duplicates.append(item) for duplicate in duplicates: try: unwatched.remove(duplicate) # Completely remove this duplicate video and item information from Miro app.cli_interpreter.do_mythtv_item_remove(duplicate[u'videoFilename']) displayMessage(u"Skipped adding a Miro video to the MythTV Watch Recordings screen (%s - %s) as there are duplicate 'new' video items.\nSometimes a Miro channel has the same video downloaded multiple times.\nThis is a Miro/Channel web site issue and often rectifies itself overtime." % (duplicate[u'channelTitle'], duplicate[u'title'])) except ValueError: pass # # Deal with any Channel videos that are to be copied and removed from Miro # copy_items = [] # Copy unwatched and watched Miro videos (all or only selected Channels) if u'all' in channel_mythvideo_only: for array in [watched, unwatched]: for item in array: copy_items.append(item) elif len(channel_mythvideo_only): for array in [watched, unwatched]: for video in array: if filter(is_not_punct_char, video[u'channelTitle'].lower()) in channel_mythvideo_only.keys(): copy_items.append(video) # Copy ONLY watched Miro videos (all or only selected Channels) if u'all' in channel_new_watch_copy: for video in watched: copy_items.append(video) elif len(channel_new_watch_copy): for video in watched: if filter(is_not_punct_char, video[u'channelTitle'].lower()) in channel_new_watch_copy.keys(): copy_items.append(video) channels_to_copy = {} for key in channel_mythvideo_only.keys(): channels_to_copy[key] = channel_mythvideo_only[key] for key in channel_new_watch_copy.keys(): channels_to_copy[key] = channel_new_watch_copy[key] for video in copy_items: dir_key = filter(is_not_punct_char, video[u'channelTitle'].lower()) # Create the subdirectories to copy the video into directory_coverart = False if not os.path.isdir(channels_to_copy[dir_key]): if simulation: logger.info(u"Simulation: Creating the MythVideo directory (%s)." % (channels_to_copy[dir_key])) else: os.makedirs(channels_to_copy[dir_key]) directory_coverart = True # If the directory was just created it needs coverart else: if video[u'channel_icon']: ext = getExtention(video[u'channel_icon']) if not os.path.isfile(u"%s%s.%s" % (channels_to_copy[dir_key], video[u'channelTitle'].lower(), ext)): directory_coverart = True # If the directory was just created it needs coverart elif video[u'item_icon']: ext = getExtention(video[u'item_icon']) if not os.path.isfile(u"%s%s - %s.%s" % (channels_to_copy[dir_key], video[u'channelTitle'].lower(), video[u'title'].lower(), ext)): directory_coverart = True # If the directory was just created it needs coverart # Copy the Channel icon located in the posters/coverart directory if directory_coverart and video[u'channel_icon']: ext = getExtention(video[u'channel_icon']) tmp_path = channels_to_copy[dir_key][:-1] foldername = tmp_path[tmp_path.rindex(u'/')+1:] dirpath = u"%s%s" % (channels_to_copy[dir_key], u'folder.jpg') dirpath2 = u"%s%s" % (channels_to_copy[dir_key], u'folder.png') if os.path.isfile(dirpath) or os.path.isfile(dirpath2): # See if a folder cover already exists pass else: if simulation: logger.info(u"Simulation: Copy a Channel Icon (%s) for directory (%s)." % (video[u'channel_icon'], dirpath)) else: try: # Miro Channel icon copy for the new subdirectory useImageMagick(u'convert "%s" "%s"' % (video[u'channel_icon'], dirpath)) except: logger.critical(u"Copy a Channel Icon (%s) for directory (%s) failed." % (video[u'channel_icon'], dirpath)) # Gracefully close the Miro database and shutdown the Miro Front and Back ends app.controller.shutdown() time.sleep(5) # Let the shutdown processing complete sys.exit(False) # Copy the Miro video file save_video_filename = video[u'videoFilename'] # This filename is needed later for deleting in Miro ext = getExtention(video[u'videoFilename']) if ext.lower() == u'm4v': ext = u'mpg' filepath = u"%s%s - %s.%s" % (channels_to_copy[dir_key], video[u'channelTitle'], video[u'title'], ext) if simulation: logger.info(u"Simulation: Copying the Miro video (%s) to the MythVideo directory (%s)." % (video[u'videoFilename'], filepath)) else: try: # Miro video copied into a MythVideo directory shutil.copy2(video[u'videoFilename'], filepath) statistics[u'Miros_MythVideos_copied']+=1 if u'mythvideo' in storagegroups.keys() and not local_only: video[u'videoFilename'] = filepath.replace(storagegroups[u'mythvideo'], u'') else: video[u'videoFilename'] = filepath except: logger.critical(u"Copying the Miro video (%s) to the MythVideo directory (%s).\n This maybe a permissions error (mirobridge.py does not have permission to write to the directory)." % (video[u'videoFilename'], filepath)) # Gracefully close the Miro database and shutdown the Miro Front and Back ends app.controller.shutdown() time.sleep(5) # Let the shutdown processing complete sys.exit(False) # Copy the Channel or item's icon if video[u'channel_icon'] and not video[u'channelTitle'].lower() in channel_icon_override: pass else: if video[u'item_icon']: video[u'channel_icon'] = video[u'item_icon'] if video[u'channel_icon']: ext = getExtention(video[u'channel_icon']) if video[u'channelTitle'].lower() in channel_icon_override: filepath = u"%s%s - %s%s.%s" % (vid_graphics_dirs[u'posterdir'], video[u'channelTitle'], video[u'title'], graphic_suffix[u'posterdir'], ext) else: filepath = u"%s%s%s.%s" % (vid_graphics_dirs[u'posterdir'], video[u'channelTitle'], graphic_suffix[u'posterdir'], ext) # There may already be a Channel icon available or it is a symlink which needs to be replaced if not os.path.isfile(filepath) or os.path.islink(filepath): if simulation: logger.info(u"Simulation: Copying the Channel Icon (%s) to the poster directory (%s)." % (video[u'channel_icon'], filepath)) else: try: # Miro Channel icon copied into a MythVideo directory try: # Remove any old symlink file os.remove(filepath) except OSError: pass shutil.copy2(video[u'channel_icon'], filepath) if u'posterdir' in storagegroups.keys() and not local_only: video[u'channel_icon'] = filepath.replace(storagegroups[u'posterdir'], u'') else: video[u'channel_icon'] = filepath except: logger.critical(u"Copying the Channel Icon (%s) to the poster directory (%s).\n This maybe a permissions error (mirobridge.py does not have permission to write to the directory)." % (video[u'channel_icon'], filepath)) # Gracefully close the Miro database and shutdown the Miro Front and Back ends app.controller.shutdown() time.sleep(5) # Let the shutdown processing complete sys.exit(False) else: if u'posterdir' in storagegroups.keys() and not local_only: video[u'channel_icon'] = filepath.replace(storagegroups[u'posterdir'], u'') else: video[u'channel_icon'] = filepath # There may already be a Screenshot available or it is a symlink which needs to be replaced if video[u'screenshot']: ext = getExtention(video[u'screenshot']) filepath = u"%s%s - %s%s.%s" % (vid_graphics_dirs[u'episodeimagedir'], video[u'channelTitle'], video[u'title'], graphic_suffix[u'episodeimagedir'], ext) else: filepath = u'' if not os.path.isfile(filepath) or os.path.islink(filepath): if video[u'screenshot']: if simulation: logger.info(u"Simulation: Copying the Screenshot (%s) to the Screenshot directory (%s)." % (video[u'screenshot'], filepath)) else: try: # Miro Channel icon copied into a MythVideo directory try: # Remove any old symlink file os.remove(filepath) except OSError: pass shutil.copy2(video[u'screenshot'], filepath) displayMessage(u"Copied Miro screenshot file (%s) to MythVideo (%s)" % (video[u'screenshot'], filepath)) if u'episodeimagedir' in storagegroups.keys() and not local_only: video[u'screenshot'] = filepath.replace(storagegroups[u'episodeimagedir'], u'') else: video[u'screenshot'] = filepath except: logger.critical(u"Copying the Screenshot (%s) to the Screenshot directory (%s).\n This maybe a permissions error (mirobridge.py does not have permission to write to the directory)." % (video[u'screenshot'], filepath)) # Gracefully close the Miro database and shutdown the Miro Front and Back ends app.controller.shutdown() time.sleep(5) # Let the shutdown processing complete sys.exit(False) elif video[u'screenshot']: if u'episodeimagedir' in storagegroups.keys() and not local_only: video[u'screenshot'] = filepath.replace(storagegroups[u'episodeimagedir'], u'') else: video[u'screenshot'] = filepath video[u'copied'] = True # Mark this video item as being copied # Completely remove the video and item information from Miro app.cli_interpreter.do_mythtv_item_remove(save_video_filename) # Gracefully close the Miro database and shutdown the Miro Front and Back ends app.controller.shutdown() time.sleep(5) # Let the shutdown processing complete # # Add and delete MythTV (Watch Recordings) Miro recorded records # Add and remove symlinks for Miro video files # # Check if the user does not want any channels Added to the "Watch Recordings" screen if channel_mythvideo_only.has_key(u'all'): for video in unwatched: watched.append(video) unwatched = [] else: if len(channel_mythvideo_only): unwatched_copy = [] for video in unwatched: if not filter(is_not_punct_char, video[u'channelTitle'].lower()) in channel_mythvideo_only.keys(): unwatched_copy.append(video) else: watched.append(video) unwatched = unwatched_copy statistics[u'Total_unwatched'] = len(unwatched) if not len(unwatched): displayMessage(u"There are no Miro unwatched video items to add as MythTV Recorded videos.") if not updateMythRecorded(unwatched): logger.critical(u"Updating MythTV Recording with Miro video files failed." % str(base_video_dir)) sys.exit(False) # # Add and delete MythVideo records for played Miro Videos # Add and delete symbolic links to Miro Videos and subdirectories # Add and delete symbolic links to coverart/Miro icons and Miro screenshots/fanart # if len(channel_watch_only): # If the user does not want any channels moved to MythVideo exit if channel_watch_only[0].lower() == u'all': printStatistics() return True if not len(watched): displayMessage(u"There are no Miro watched items to add to MythVideo") if not updateMythVideo(watched): logger.critical(u"Updating MythVideo with Miro video files failed.") sys.exit(False) printStatistics() return True | 0f178cb606ce1cfb96840e30bd489d420b041e6d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13713/0f178cb606ce1cfb96840e30bd489d420b041e6d/mirobridge.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
3536,
6289,
312,
11373,
18337,
628,
326,
1296,
980,
1135,
1053,
3536,
2552,
1191,
10358,
16,
14754,
16,
3988,
16,
2502,
4650,
16,
6875,
19951,
16,
1904,
67,
350,
16,
1904,
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,
2774,
13332,
3536,
6289,
312,
11373,
18337,
628,
326,
1296,
980,
1135,
1053,
3536,
2552,
1191,
10358,
16,
14754,
16,
3988,
16,
2502,
4650,
16,
6875,
19951,
16,
1904,
67,
350,
16,
1904,
6... |
sys.stderr.write("Unable to connect to %s\n" % PW_XMLRPC_URL) | sys.stderr.write("Unable to connect to %s\n" % url) | def main(): try: opts, args = getopt.getopt(sys.argv[2:], 's:p:w:d:n:') except getopt.GetoptError, err: print str(err) usage() if len(sys.argv) < 2: usage() action = sys.argv[1].lower() filt = Filter() submitter_str = "" delegate_str = "" for name, value in opts: if name == '-s': filt.add("state", value) elif name == '-p': filt.add("project", value) elif name == '-w': submitter_str = value elif name == '-d': delegate_str = value elif name == '-n': try: filt.add("max_count", int(value)) except: sys.stderr.write("Invalid maximum count '%s'\n" % value) usage() else: sys.stderr.write("Unknown option '%s'\n" % name) usage() if len(args) > 1: sys.stderr.write("Too many arguments specified\n") usage() try: rpc = xmlrpclib.Server(PW_XMLRPC_URL) except: sys.stderr.write("Unable to connect to %s\n" % PW_XMLRPC_URL) sys.exit(1) if action == 'list' or action == 'search': if len(args) > 0: filt.add("name__icontains", args[0]) action_list(rpc, filt, submitter_str, delegate_str) elif action.startswith('project'): action_projects(rpc) elif action.startswith('state'): action_states(rpc) elif action == 'view': try: patch_id = int(args[0]) except: sys.stderr.write("Invalid patch ID given\n") sys.exit(1) s = rpc.patch_get_mbox(patch_id) if len(s) > 0: print s elif action == 'get' or action == 'save': try: patch_id = int(args[0]) except: sys.stderr.write("Invalid patch ID given\n") sys.exit(1) action_get(rpc, patch_id) elif action == 'apply': try: patch_id = int(args[0]) except: sys.stderr.write("Invalid patch ID given\n") sys.exit(1) action_apply(rpc, patch_id) else: sys.stderr.write("Unknown action '%s'\n" % action) usage() | 4b41c609084eff2ab49e1a7501314a0fa57450c4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7754/4b41c609084eff2ab49e1a7501314a0fa57450c4/pwclient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
18,
19485,
63,
22,
30,
6487,
296,
87,
30,
84,
30,
91,
30,
72,
30,
82,
2497,
13,
1335,
336,
3838,
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,
2774,
13332,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
18,
19485,
63,
22,
30,
6487,
296,
87,
30,
84,
30,
91,
30,
72,
30,
82,
2497,
13,
1335,
336,
3838,
18,
... |
options: -p, --port=PORT: serial port, a number, defualt = 0 or a device name -b, --baud=BAUD: baudrate, default 9600 -r, --rtscts: enable RTS/CTS flow control (default off) -x, --xonxoff: enable software flow control (default off) -P, --localport: TCP/IP port on which to run the server (default 7777) """ % sys.argv[0] | def shortcut(self): """connect the serial port to the tcp port by copying everything from one side to the other""" self.alive = True self.thread_read = threading.Thread(target=self.reader) self.thread_read.setDaemon(1) self.thread_read.start() self.writer() def reader(self): """loop forever and copy serial->socket""" while self.alive: try: data = self.serial.read(1) n = self.serial.inWaiting() if n: data = data + self.serial.read(n) if data: self.socket.sendall(data) except socket.error, msg: print msg break self.alive = False def writer(self): """loop forever and copy socket->serial""" while self.alive: try: data = self.socket.recv(1024) if not data: break self.serial.write(data) except socket.error, msg: print msg break self.alive = False self.thread_read.join() def stop(self): """Stop copying""" if self.alive: self.alive = False self.thread_read.join() | def usage(): print >>sys.stderr, """USAGE: %s [options] Simple Terminal Programm for the serial port. options: -p, --port=PORT: serial port, a number, defualt = 0 or a device name -b, --baud=BAUD: baudrate, default 9600 -r, --rtscts: enable RTS/CTS flow control (default off) -x, --xonxoff: enable software flow control (default off) -P, --localport: TCP/IP port on which to run the server (default 7777) """ % sys.argv[0] | d1bc025a5ffd45b7cb45bdc2b2b0210119acfd93 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10955/d1bc025a5ffd45b7cb45bdc2b2b0210119acfd93/tcp_serial_redirect.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
1671,
9499,
18,
11241,
16,
3536,
29550,
30,
738,
87,
306,
2116,
65,
4477,
18778,
13586,
81,
364,
326,
2734,
1756,
18,
225,
1652,
10995,
12,
2890,
4672,
3536,
3612,
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,
4084,
13332,
1172,
1671,
9499,
18,
11241,
16,
3536,
29550,
30,
738,
87,
306,
2116,
65,
4477,
18778,
13586,
81,
364,
326,
2734,
1756,
18,
225,
1652,
10995,
12,
2890,
4672,
3536,
3612,
326... |
output = get_output(['bzr', 'revno'], cwd = self.srcdir) return output.strip() | else: cmd = ['bzr', 'revision-info', '--tree', '-d', self.srcdir] return get_output(cmd).strip() | def tree_id(self): if not os.path.exists(self.srcdir): return None output = get_output(['bzr', 'revno'], cwd = self.srcdir) return output.strip() | 6bb6439fa76a3dadc9bdb5c0828322c6c7dd6015 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4596/6bb6439fa76a3dadc9bdb5c0828322c6c7dd6015/bzr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2151,
67,
350,
12,
2890,
4672,
309,
486,
1140,
18,
803,
18,
1808,
12,
2890,
18,
4816,
1214,
4672,
327,
599,
876,
273,
336,
67,
2844,
12,
3292,
25292,
86,
2187,
296,
9083,
2135,
17337,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2151,
67,
350,
12,
2890,
4672,
309,
486,
1140,
18,
803,
18,
1808,
12,
2890,
18,
4816,
1214,
4672,
327,
599,
876,
273,
336,
67,
2844,
12,
3292,
25292,
86,
2187,
296,
9083,
2135,
17337,
... |
data += '\r\n' | def send_all(self, data): data += '\r\n' while len(data): sent = self.send(data) if sent is None: raise Exception("Other end disconnected!") data = buffer(data, sent) | 00e7df83227e719cd83ef075a5a552541da7c79c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1298/00e7df83227e719cd83ef075a5a552541da7c79c/async_sub.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
454,
12,
2890,
16,
501,
4672,
1323,
562,
12,
892,
4672,
3271,
273,
365,
18,
4661,
12,
892,
13,
309,
3271,
353,
599,
30,
1002,
1185,
2932,
8290,
679,
17853,
4442,
13,
501,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
454,
12,
2890,
16,
501,
4672,
1323,
562,
12,
892,
4672,
3271,
273,
365,
18,
4661,
12,
892,
13,
309,
3271,
353,
599,
30,
1002,
1185,
2932,
8290,
679,
17853,
4442,
13,
501,
2... | |
log("Adding file: "+f) self.add_file(f) | log("Adding hashfile: %s" % f) self.load_hashfile(f) | def __init__(self, initial_files=[]): self.init_window() self.new_hashfile() | 4ea1f13de038d4f844826cb7bd3925ffd32e0440 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2200/4ea1f13de038d4f844826cb7bd3925ffd32e0440/parano.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2172,
67,
2354,
33,
8526,
4672,
365,
18,
2738,
67,
5668,
1435,
365,
18,
2704,
67,
2816,
768,
1435,
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,
1001,
2738,
972,
12,
2890,
16,
2172,
67,
2354,
33,
8526,
4672,
365,
18,
2738,
67,
5668,
1435,
365,
18,
2704,
67,
2816,
768,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
modname = modulename(path) | modname = inspect.getmodulename(path) | def writedocs(dir, pkgpath='', done={}): """Write out HTML documentation for all modules in a directory tree.""" for file in os.listdir(dir): path = os.path.join(dir, file) if ispackage(path): writedocs(path, pkgpath + file + '.') elif os.path.isfile(path): modname = modulename(path) if modname: modname = pkgpath + modname if not done.has_key(modname): done[modname] = 1 writedoc(modname) | 4483cbd7eb6854684bc5af9c43d558ab8a2bcacf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/4483cbd7eb6854684bc5af9c43d558ab8a2bcacf/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2518,
329,
22280,
12,
1214,
16,
3475,
803,
2218,
2187,
2731,
12938,
4672,
3536,
3067,
596,
3982,
7323,
364,
777,
4381,
316,
279,
1867,
2151,
12123,
364,
585,
316,
1140,
18,
1098,
1214,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2518,
329,
22280,
12,
1214,
16,
3475,
803,
2218,
2187,
2731,
12938,
4672,
3536,
3067,
596,
3982,
7323,
364,
777,
4381,
316,
279,
1867,
2151,
12123,
364,
585,
316,
1140,
18,
1098,
1214,
1... |
if not exists(dest_stat): | if not stat_exists(dest_stat): | def compare_files(src_path, dest_path): '''see what the differences are between src and dest, and fix it if not a dry run src_path is the file in the synctool/overlay tree dest_path is the file in the system UPDATE_CACHE is a name cache of files that have been updated it helps avoiding duplicate checks for files that have multiple classes done is a local boolean saying if a path has been checked need_update is a local boolean saying if a path needs to be updated return value is 0 when file is not changed, 1 when file is updated | 5e0798d5f145c39a12da9b70f041cd15b7c8fd9a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13401/5e0798d5f145c39a12da9b70f041cd15b7c8fd9a/synctool.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3400,
67,
2354,
12,
4816,
67,
803,
16,
1570,
67,
803,
4672,
9163,
5946,
4121,
326,
16440,
854,
3086,
1705,
471,
1570,
16,
471,
2917,
518,
309,
486,
279,
10299,
1086,
225,
1705,
67,
803... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3400,
67,
2354,
12,
4816,
67,
803,
16,
1570,
67,
803,
4672,
9163,
5946,
4121,
326,
16440,
854,
3086,
1705,
471,
1570,
16,
471,
2917,
518,
309,
486,
279,
10299,
1086,
225,
1705,
67,
803... |
statusbar.push(0, _(datetime.today().strftime("%H:%M") + ": The watch \"" + watch.name + "\" has changed.")) | statusbar.push(0, (datetime.today().strftime("%H:%M") + " - " + _('The watch "%s" has changed.') % watch.name)) | def mark_watch_status(self, status, id): """ show the right icon for the status from the watch. """ watch = self.specto.watch_db[id] statusbar = self.wTree.get_widget("statusbar1") icon = self.get_icon("error", 50, False) try: if status == "checking": icon = self.get_icon("reload", 0, False) statusbar.push(0, _(datetime.today().strftime("%H:%M") + ": The watch \"" + watch.name + "\" is checking.")) elif status == "idle": self.tray.show_tooltip() #check if all watches are cleared if watch.changed == True: icon = self.get_icon(watch.icon, 0, False) else: icon = self.get_icon(watch.icon, 50, False) statusbar.push(0, _(datetime.today().strftime("%H:%M") + ": The watch \"" + watch.name + "\" is idle.")) elif status == "no-network": statusbar.push(0, _(datetime.today().strftime("%H:%M") + ": The network connection seems to be down, network watches will not check until then.")) self.tray.show_tooltip() icon = self.get_icon(watch.icon, 50, False) elif status == "network": icon = self.get_icon(watch.icon, 50, False) elif status == "idle-clear": self.tray.show_tooltip() #check if all watches are cleared if watch.changed == True: icon = self.get_icon(watch.icon, 0, False) statusbar.push(0, _(datetime.today().strftime("%H:%M") + ": The watch \"" + watch.name + "\" is cleared.")) else: icon = self.get_icon(watch.icon, 50, False) elif status == "clear": self.clear_watch(None, watch.id) icon = self.get_icon(watch.icon, 50, False) elif status == "error": statusbar.push(0, _(datetime.today().strftime("%H:%M") + ": The watch \"" + watch.name + "\" has a problem.")) balloon_icon = self.get_icon("error", 50, True) icon = self.get_icon("error", 50, False) self.balloon.show_toast( _("The watch, <b>%s</b>, has a problem. You may need to check the error log.") % watch.name, balloon_icon, urgency="critical") if self.specto.specto_gconf.get_entry("use_problem_sound"): problem_sound = self.specto.specto_gconf.get_entry("problem_sound") gnome.sound_play(problem_sound) elif status == "changed": statusbar.push(0, _(datetime.today().strftime("%H:%M") + ": The watch \"" + watch.name + "\" has changed.")) self.toggle_changed(id) self.tray.show_tooltip() balloon_icon = self.get_icon(watch.icon, 0, True) self.balloon.show_toast(watch.get_balloon_text(), balloon_icon, name=watch.name) icon = self.get_icon(watch.icon, 0, False) if self.specto.specto_gconf.get_entry("use_changed_sound"): changed_sound = self.specto.specto_gconf.get_entry("changed_sound") gnome.sound_play(changed_sound) elif status == "mark-changed": self.toggle_changed(id) self.tray.show_tooltip() icon = self.get_icon(watch.icon, 0, False) self.model.set_value(self.iter[id], 1, icon) try: model, iter = self.treeview.get_selection().get_selected() id2 = int(model.get_value(iter, 3)) if id == id2: self.show_watch_info() except: pass except: self.specto.logger.log(_("There was an error marking the watch status"), "error", watch.name) | d53b6e4e10ed6fc90a7c917f60bc63bb2358ed7b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10818/d53b6e4e10ed6fc90a7c917f60bc63bb2358ed7b/notifier.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2267,
67,
7585,
67,
2327,
12,
2890,
16,
1267,
16,
612,
4672,
3536,
2405,
326,
2145,
4126,
364,
326,
1267,
628,
326,
4267,
18,
3536,
4267,
273,
365,
18,
13234,
83,
18,
7585,
67,
1966,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2267,
67,
7585,
67,
2327,
12,
2890,
16,
1267,
16,
612,
4672,
3536,
2405,
326,
2145,
4126,
364,
326,
1267,
628,
326,
4267,
18,
3536,
4267,
273,
365,
18,
13234,
83,
18,
7585,
67,
1966,
... |
else: | except IOError, e: | def __init__(self, filename=None): if filename is None: filename = os.path.expanduser("~/.sipclient/sipclient.ini") self.file = None self.parser = ConfigParser.SafeConfigParser() try: self.file = open(filename, 'r+') self.parser.readfp(self.file) except IOError, e: if e.errno == 2: # No such file self.file = open(filename, 'w+') else: raise ConfigurationBackendError(str(e)) | f81a808fdd8d1e6c68aa5cd796006c8a78167358 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5703/f81a808fdd8d1e6c68aa5cd796006c8a78167358/configfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1544,
33,
7036,
4672,
309,
1544,
353,
599,
30,
1544,
273,
1140,
18,
803,
18,
12320,
1355,
2932,
98,
15865,
28477,
2625,
19,
28477,
2625,
18,
8767,
7923,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1544,
33,
7036,
4672,
309,
1544,
353,
599,
30,
1544,
273,
1140,
18,
803,
18,
12320,
1355,
2932,
98,
15865,
28477,
2625,
19,
28477,
2625,
18,
8767,
7923,
... |
self.xmin = xmin self.xmax = xmax self.ymin = ymin self.ymax = ymax | self.xtail = float(xtail) self.xhead = float(xhead) self.ytail = float(ytail) self.yhead = float(yhead) | def __init__(self, xmin, ymin, xmax, ymax, options): """ Create an arrow graphics primitive. | 9feabf5491f4dee6756eab6732cf107f17b213a0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/9feabf5491f4dee6756eab6732cf107f17b213a0/plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
13777,
16,
15763,
16,
14016,
16,
15275,
16,
702,
4672,
3536,
1788,
392,
12274,
17313,
8225,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
13777,
16,
15763,
16,
14016,
16,
15275,
16,
702,
4672,
3536,
1788,
392,
12274,
17313,
8225,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
if verbose: print 'unpack tuple wrong size' try: a, b = t raise TestFailed except ValueError: pass | Now for some failures | def __getitem__(self, i): if i >= 0 and i < 3: return i raise IndexError | 3981511070311e958bd2cd48b1ab16b24f8b350e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3981511070311e958bd2cd48b1ab16b24f8b350e/test_unpack.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
277,
4672,
309,
277,
1545,
374,
471,
277,
411,
890,
30,
327,
277,
1002,
10195,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
277,
4672,
309,
277,
1545,
374,
471,
277,
411,
890,
30,
327,
277,
1002,
10195,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.module_generators = [self(1)] | self.module_generators = [self(Integer(1))] | def __init__(self, type): self.cartanType = CartanType(type) self._name = "The spin crystal for type %s"%type self.index_set = self.cartanType.index_set() self.module_generators = [self(1)] | 2d35c1ab95e546ef454d5cbe7fcb53e83992802c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/2d35c1ab95e546ef454d5cbe7fcb53e83992802c/spins.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
618,
4672,
365,
18,
11848,
304,
559,
273,
17695,
304,
559,
12,
723,
13,
365,
6315,
529,
273,
315,
1986,
12490,
4422,
31365,
364,
618,
738,
87,
28385,
723... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
618,
4672,
365,
18,
11848,
304,
559,
273,
17695,
304,
559,
12,
723,
13,
365,
6315,
529,
273,
315,
1986,
12490,
4422,
31365,
364,
618,
738,
87,
28385,
723... |
this = apply(_quickfix.new_NoTradingSessions, args) | this = _quickfix.new_NoTradingSessions(*args) | def __init__(self, *args): this = apply(_quickfix.new_NoTradingSessions, 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,
2279,
1609,
7459,
13566,
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,
2279,
1609,
7459,
13566,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,... |
self.assert_(groups[4] == hostname, | self.assertEqual(groups[4], hostname, | def test_create_tmp(self, repetitions=10): # Create files in tmp directory hostname = socket.gethostname() if '/' in hostname: hostname = hostname.replace('/', r'\057') if ':' in hostname: hostname = hostname.replace(':', r'\072') pid = os.getpid() pattern = re.compile(r"(?P<time>\d+)\.M(?P<M>\d{1,6})P(?P<P>\d+)" r"Q(?P<Q>\d+)\.(?P<host>[^:/]+)") previous_groups = None for x in range(repetitions): tmp_file = self._box._create_tmp() head, tail = os.path.split(tmp_file.name) self.assertEqual(head, os.path.abspath(os.path.join(self._path, "tmp")), "File in wrong location: '%s'" % head) match = pattern.match(tail) self.assert_(match != None, "Invalid file name: '%s'" % tail) groups = match.groups() if previous_groups != None: self.assert_(int(groups[0] >= previous_groups[0]), "Non-monotonic seconds: '%s' before '%s'" % (previous_groups[0], groups[0])) self.assert_(int(groups[1] >= previous_groups[1]) or groups[0] != groups[1], "Non-monotonic milliseconds: '%s' before '%s'" % (previous_groups[1], groups[1])) self.assert_(int(groups[2]) == pid, "Process ID mismatch: '%s' should be '%s'" % (groups[2], pid)) self.assertEqual(int(groups[3]), int(previous_groups[3]) + 1, "Non-sequential counter: '%s' before '%s'" % (previous_groups[3], groups[3])) self.assert_(groups[4] == hostname, "Host name mismatch: '%s' should be '%s'" % (groups[4], hostname)) previous_groups = groups tmp_file.write(_sample_message) tmp_file.seek(0) self.assertEqual(tmp_file.read(), _sample_message) tmp_file.close() file_count = len(os.listdir(os.path.join(self._path, "tmp"))) self.assert_(file_count == repetitions, "Wrong file count: '%s' should be '%s'" % (file_count, repetitions)) | fc9997a71def3361507ae020d7f678e347d8646b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/fc9997a71def3361507ae020d7f678e347d8646b/test_mailbox.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2640,
67,
5645,
12,
2890,
16,
22265,
5029,
33,
2163,
4672,
468,
1788,
1390,
316,
1853,
1867,
5199,
273,
2987,
18,
75,
546,
669,
529,
1435,
309,
2023,
316,
5199,
30,
5199,
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,
1842,
67,
2640,
67,
5645,
12,
2890,
16,
22265,
5029,
33,
2163,
4672,
468,
1788,
1390,
316,
1853,
1867,
5199,
273,
2987,
18,
75,
546,
669,
529,
1435,
309,
2023,
316,
5199,
30,
5199,
273... |
AbelianGroup( 6, [3, 7, 16, 2003, 3001, 4001]) | Abelian Group isomorphic to Z/3Z x Z/7Z x Z/16Z x Z/2003Z x Z/3001Z x Z/4001Z | def __init__(self, ambient, gens, names="f"): """ EXAMPLES: sage: F = AbelianGroup(5,[30,64,729],names = list("abcde")) sage: a,b,c,d,e = F.gens() sage: F.subgroup([a^3,b]) AbelianGroup( 2, [0, 0]) sage: F.subgroup([c]) AbelianGroup( 3, [2, 3, 5]) sage: F.subgroup([a,c]) AbelianGroup( 4, [0, 2, 3, 5]) sage: F.subgroup([a,b*c]) AbelianGroup( 2, [0, 0]) sage: F.subgroup([b*c,d]) AbelianGroup( 2, [0, 64]) sage: F.subgroup([a*b,c^6,d],names = list("xyz")) AbelianGroup( 3, [0, 5, 64]) sage: G = F.subgroup([a*b,c^6,d],names = list("xyz")) sage: G AbelianGroup( 3, [0, 5, 64]) sage: print G Subgroup of Abelian group on 5 generators (a, b, c, d, e) with invariants [0, 0, 30, 64, 729] generated by [a*b, c^6, d] with elementary divisors [0, 5, 64] sage: x,y,z = G.gens() sage: x.order() Infinity sage: y.order() 5 sage: z.order() 64 sage: A = AbelianGroup(5,[3, 5, 5, 7, 8], names = "abcde") sage: a,b,c,d,e = A.gens() sage: A.subgroup([a,b]) AbelianGroup( 2, [3, 5]) sage: A.subgroup([a,b,c,d^2,e]) AbelianGroup( 5, [3, 5, 5, 7, 8]) sage: A.subgroup([a,b,c,d^2,e^2]) AbelianGroup( 5, [3, 4, 5, 5, 7]) sage: B = A.subgroup([a^3,b,c,d,e^2]); B AbelianGroup( 4, [4, 5, 5, 7]) sage: B.invariants() [4, 5, 5, 7] sage: A = AbelianGroup(4,[1009, 2003, 3001, 4001], names = "abcd") sage: a,b,c,d = A.gens() sage: B = A.subgroup([a^3,b,c,d]) sage: B.invariants() [1009, 2003, 3001, 4001] sage: A.order() 24266473210027 sage: B.order() 24266473210027 sage: A = AbelianGroup(4,[1008, 2003, 3001, 4001], names = "abcd") sage: a,b,c,d = A.gens() sage: B = A.subgroup([a^3,b,c,d]) sage: B AbelianGroup( 6, [3, 7, 16, 2003, 3001, 4001]) sage: print B Subgroup of Abelian group on 4 generators (a, b, c, d) with invariants [1008, 2003, 3001, 4001] generated by [a^3, b, c, d] with elementary divisors [3, 7, 16, 2003, 3001, 4001] Infinite groups can also be handled: sage: G = AbelianGroup([3,4,0], names = "abc") sage: a,b,c = G.gens() sage: F = G.subgroup([a,b^2,c]); F AbelianGroup( 3, [0, 3, 4]) sage: F.invariants() [0, 3, 4] sage: F.gens() [a, b^2, c] sage: F.order() Infinity | 474e9cd21e5543c10385340d5e9747ad7d0f1773 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/474e9cd21e5543c10385340d5e9747ad7d0f1773/abelian_group.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
13232,
1979,
16,
314,
773,
16,
1257,
1546,
74,
6,
4672,
3536,
225,
5675,
8900,
11386,
30,
272,
410,
30,
478,
273,
9771,
292,
2779,
1114,
12,
25,
16,
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,
1001,
2738,
972,
12,
2890,
16,
13232,
1979,
16,
314,
773,
16,
1257,
1546,
74,
6,
4672,
3536,
225,
5675,
8900,
11386,
30,
272,
410,
30,
478,
273,
9771,
292,
2779,
1114,
12,
25,
16,
63... |
(QRegExp(r'".*"'), self.stringFormat)] | (QRegExp(r'".*"'), self.stringFormat), (QRegExp(r" | def __init__(self, parent=None): self.keywordFormat = QTextCharFormat() self.keywordFormat.setForeground(QBrush(Qt.blue)) self.keywordFormat.setFontWeight(QFont.Bold) self.stringFormat = QTextCharFormat() self.stringFormat.setForeground(QBrush(Qt.green)) self.stringFormat.setFontWeight(QFont.Bold) self.defFormat = QTextCharFormat() self.defFormat.setForeground(QBrush(Qt.black)) self.defFormat.setFontWeight(QFont.Bold) self.keywords = ["def", "if", "else", "elif", "for", "while", "with", "try", "except", "finally", "not", "in", "lambda", "None", "import", "class", "return", "print", "yield", "break", "continue", "raise", "or", "and", "True", "False", "pass"] self.rules = [(QRegExp(r"\b%s\b" % keyword), self.keywordFormat) for keyword in self.keywords] + \ [(QRegExp(r"\bclass|\bdef\s+([A-Za-z]+[A-Za-z0-9]+)\s*\("), self.defFormat), (QRegExp(r"'.*'"), self.stringFormat), (QRegExp(r'".*"'), self.stringFormat)] QSyntaxHighlighter.__init__(self, parent) | 5edc35a83e9f2d9bf232cafcb6e7c3265e4dd4e3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6366/5edc35a83e9f2d9bf232cafcb6e7c3265e4dd4e3/OWPythonScript.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
33,
7036,
4672,
365,
18,
11041,
1630,
273,
30337,
2156,
1630,
1435,
365,
18,
11041,
1630,
18,
542,
23206,
12,
53,
19114,
1218,
12,
23310,
18,
14081,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
33,
7036,
4672,
365,
18,
11041,
1630,
273,
30337,
2156,
1630,
1435,
365,
18,
11041,
1630,
18,
542,
23206,
12,
53,
19114,
1218,
12,
23310,
18,
14081,
... |
self.states[cfile] = tool.InstallConfigFile(cfile) | self.states[cfile] = tl[0].InstallConfigFile(cfile) | def __init__(self, config, setup, times, drivers, dryrun): self.config = config self.times = times self.dryrun = dryrun self.times['initialization'] = time.time() self.setup = setup self.tools = [] self.states = {} self.whitelist = [] self.blacklist = [] self.removal = [] self.logger = logging.getLogger("Bcfg2.Client.Frame") for driver in drivers[:]: if driver not in Bcfg2.Client.Tools.drivers and \ isinstance(driver, types.StringType): self.logger.error("Tool driver %s is not available" % driver) drivers.remove(driver) tclass = {} for tool in drivers: if not isinstance(tool, types.StringType): tclass[time.time()] = tool tool_class = "Bcfg2.Client.Tools.%s" % tool try: tclass[tool] = getattr(__import__(tool_class, globals(), locals(), ['*']), tool) except ImportError: continue except: self.logger.error("Tool %s unexpectedly failed to load" % tool, exc_info=1) | cd2e6e27203f3c61ad421afd5ea85b3603611bd3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11867/cd2e6e27203f3c61ad421afd5ea85b3603611bd3/Frame.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
642,
16,
3875,
16,
4124,
16,
16118,
16,
10299,
2681,
4672,
365,
18,
1425,
273,
642,
365,
18,
8293,
273,
4124,
365,
18,
25011,
2681,
273,
10299,
2681,
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,
1001,
2738,
972,
12,
2890,
16,
642,
16,
3875,
16,
4124,
16,
16118,
16,
10299,
2681,
4672,
365,
18,
1425,
273,
642,
365,
18,
8293,
273,
4124,
365,
18,
25011,
2681,
273,
10299,
2681,
365... |
os.chmod(p, stat.S_IMODE(st.st_mode) | stat.S_IXGRP) | os.chmod(p, stat.S_IMODE(st.st_mode) | stat.S_IWGRP) os.chown(p, -1, gid) | def buildPython(): print "Building a universal python" buildDir = os.path.join(WORKDIR, '_bld', 'python') rootDir = os.path.join(WORKDIR, '_root') if os.path.exists(buildDir): shutil.rmtree(buildDir) if os.path.exists(rootDir): shutil.rmtree(rootDir) os.mkdir(buildDir) os.mkdir(rootDir) os.mkdir(os.path.join(rootDir, 'empty-dir')) curdir = os.getcwd() os.chdir(buildDir) # Not sure if this is still needed, the original build script # claims that parts of the install assume python.exe exists. os.symlink('python', os.path.join(buildDir, 'python.exe')) # Extract the version from the configure file, needed to calculate # several paths. version = getVersion() print "Running configure..." runCommand("%s -C --enable-framework --enable-universalsdk=%s LDFLAGS='-g -L%s/libraries/usr/local/lib' OPT='-g -O3 -I%s/libraries/usr/local/include' 2>&1"%( shellQuote(os.path.join(SRCDIR, 'configure')), shellQuote(SDKPATH), shellQuote(WORKDIR)[1:-1], shellQuote(WORKDIR)[1:-1])) print "Running make" runCommand("make") print "Runing make frameworkinstall" runCommand("make frameworkinstall DESTDIR=%s"%( shellQuote(rootDir))) print "Runing make frameworkinstallextras" runCommand("make frameworkinstallextras DESTDIR=%s"%( shellQuote(rootDir))) print "Copy required shared libraries" if os.path.exists(os.path.join(WORKDIR, 'libraries', 'Library')): runCommand("mv %s/* %s"%( shellQuote(os.path.join( WORKDIR, 'libraries', 'Library', 'Frameworks', 'Python.framework', 'Versions', getVersion(), 'lib')), shellQuote(os.path.join(WORKDIR, '_root', 'Library', 'Frameworks', 'Python.framework', 'Versions', getVersion(), 'lib')))) print "Fix file modes" frmDir = os.path.join(rootDir, 'Library', 'Frameworks', 'Python.framework') for dirpath, dirnames, filenames in os.walk(frmDir): for dn in dirnames: os.chmod(os.path.join(dirpath, dn), 0775) for fn in filenames: if os.path.islink(fn): continue # "chmod g+w $fn" p = os.path.join(dirpath, fn) st = os.stat(p) os.chmod(p, stat.S_IMODE(st.st_mode) | stat.S_IXGRP) # We added some directories to the search path during the configure # phase. Remove those because those directories won't be there on # the end-users system. path =os.path.join(rootDir, 'Library', 'Frameworks', 'Python.framework', 'Versions', version, 'lib', 'python%s'%(version,), 'config', 'Makefile') fp = open(path, 'r') data = fp.read() fp.close() data = data.replace('-L%s/libraries/usr/local/lib'%(WORKDIR,), '') data = data.replace('-I%s/libraries/usr/local/include'%(WORKDIR,), '') fp = open(path, 'w') fp.write(data) fp.close() # Add symlinks in /usr/local/bin, using relative links usr_local_bin = os.path.join(rootDir, 'usr', 'local', 'bin') to_framework = os.path.join('..', '..', '..', 'Library', 'Frameworks', 'Python.framework', 'Versions', version, 'bin') if os.path.exists(usr_local_bin): shutil.rmtree(usr_local_bin) os.makedirs(usr_local_bin) for fn in os.listdir( os.path.join(frmDir, 'Versions', version, 'bin')): os.symlink(os.path.join(to_framework, fn), os.path.join(usr_local_bin, fn)) os.chdir(curdir) | a1cf44de4c085d733944b2fc3c20735f048e321d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a1cf44de4c085d733944b2fc3c20735f048e321d/build-installer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
15774,
13332,
1172,
315,
16713,
279,
26182,
5790,
6,
225,
1361,
1621,
273,
1140,
18,
803,
18,
5701,
12,
10566,
4537,
16,
2070,
70,
1236,
2187,
296,
8103,
6134,
15393,
273,
1140,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
15774,
13332,
1172,
315,
16713,
279,
26182,
5790,
6,
225,
1361,
1621,
273,
1140,
18,
803,
18,
5701,
12,
10566,
4537,
16,
2070,
70,
1236,
2187,
296,
8103,
6134,
15393,
273,
1140,
18... |
parser.add_option("-D", "--decoder", type="string", default="c", | parser.add_option("-D", "--decoder", type="string", default="f", | def __init__(self, frame, panel, vbox, argv): stdgui.gui_flow_graph.__init__(self) | 4047af29e93c40d46df88c0a76b158a083d6b630 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10611/4047af29e93c40d46df88c0a76b158a083d6b630/gsm_scan.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2623,
16,
6594,
16,
331,
2147,
16,
5261,
4672,
2044,
20292,
18,
20292,
67,
2426,
67,
4660,
16186,
2738,
972,
12,
2890,
13,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2623,
16,
6594,
16,
331,
2147,
16,
5261,
4672,
2044,
20292,
18,
20292,
67,
2426,
67,
4660,
16186,
2738,
972,
12,
2890,
13,
2,
-100,
-100,
-100,
-100,
-10... |
del self.m_hw_inter; gc.collect() del self.m_buffer_mgr; gc.collect() del self.m_cam; gc.collect() | del self.m_hw_inter; gc.collect() del self.m_buffer_mgr; gc.collect() del self.m_cam; gc.collect() | def __del__(self): del self.m_ct_buffer, self.m_ct_image, self.m_ct_saving, self.m_ct_acq del self.m_ct; gc.collect() | d2bef78ebc2a8eb103a5c3aa41204818eed8c9a0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10371/d2bef78ebc2a8eb103a5c3aa41204818eed8c9a0/FrelonAcq.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
3771,
972,
12,
2890,
4672,
1464,
365,
18,
81,
67,
299,
67,
4106,
16,
365,
18,
81,
67,
299,
67,
2730,
16,
365,
18,
81,
67,
299,
67,
87,
5339,
16,
365,
18,
81,
67,
299,
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
3771,
972,
12,
2890,
4672,
1464,
365,
18,
81,
67,
299,
67,
4106,
16,
365,
18,
81,
67,
299,
67,
2730,
16,
365,
18,
81,
67,
299,
67,
87,
5339,
16,
365,
18,
81,
67,
299,
67,
... |
command += '--py-cfg=' + step2[sample['conditions']]['outputname']+ ' \\\n' | command += '--py-cfg=' + step2[sample['RECOtag']]['outputname']+ ' \\\n' | def main(argv) : """ prepareRelValworkflows prepare workflows for chained processing of RelVal samples - parse file holding cmsDriver commands for 1st and 2nd steps - prepare workflows - prepare WorkflowInjector:Input script - prepare ForceMerge script - prepare DBSMigrationToGlobal script - prepare PhEDExInjection script - prepare local DBS query script required parameters --samples <textfile> : list of RelVal sample parameter-sets in plain text file, one sample per line, # marks comment --version <processing version> : processing version (v1, v2, ... ) --DBSURL <URL> : URL of the local DBS (http://cmsdbsprod.cern.ch/cms_dbs_prod_local_07/servlet/DBSServlet, http://cmssrv46.fnal.gov:8080/DBS126/servlet/DBSServlet) optional parameters : --lumi <number> : initial run for generation (default: 666666), set it to 777777 for high statistics samples --event <number> : initial event number --help (-h) : help --debug (-d) : debug statements """ # default try: version = os.environ.get("CMSSW_VERSION") except: print '' print 'CMSSW version cannot be determined from $CMSSW_VERSION' sys.exit(2) try: architecture = os.environ.get("SCRAM_ARCH") except: print '' print 'CMSSW architecture cannot be determined from $SCRAM_ARCH' sys.exit(2) samples = None processing_version = None initial_run = "666666" initial_event = None debug = 0 DBSURL = None try: opts, args = getopt.getopt(argv, "", ["help", "debug", "samples=", "version=", "DBSURL=", "event=", "lumi="]) except getopt.GetoptError: print main.__doc__ sys.exit(2) # check command line parameter for opt, arg in opts : if opt == "--help" : print main.__doc__ sys.exit() elif opt == "--debug" : debug = 1 elif opt == "--samples" : samples = arg elif opt == "--version" : processing_version = arg | b74a22b85cc9cbbc45fc20dac1245123cb4ff30c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8887/b74a22b85cc9cbbc45fc20dac1245123cb4ff30c/prepareRelValWorkflows.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
13,
294,
3536,
225,
2911,
1971,
3053,
13815,
87,
225,
2911,
31738,
364,
20269,
4929,
434,
4275,
3053,
5216,
225,
300,
1109,
585,
19918,
6166,
4668,
4364,
364,
404,
334,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
13,
294,
3536,
225,
2911,
1971,
3053,
13815,
87,
225,
2911,
31738,
364,
20269,
4929,
434,
4275,
3053,
5216,
225,
300,
1109,
585,
19918,
6166,
4668,
4364,
364,
404,
334,
... |
def RunTest(self, test): | def RunTest(self, src_root, test): | def RunTest(self, test): """Run tests and collect the .coverage file | 1581ad170e9c9d3a92c66b377c35a5abc747dc4c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9392/1581ad170e9c9d3a92c66b377c35a5abc747dc4c/coverage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1939,
4709,
12,
2890,
16,
1705,
67,
3085,
16,
1842,
4672,
3536,
1997,
7434,
471,
3274,
326,
263,
16356,
585,
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,
1939,
4709,
12,
2890,
16,
1705,
67,
3085,
16,
1842,
4672,
3536,
1997,
7434,
471,
3274,
326,
263,
16356,
585,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
exposure: isrExposure""" + channelSnap + """ | exposureKey: isrExposure""" + channelSnap + """ | def isrProcess(f): print >>f, """ appStage: { name: isrInputRaw parallelClass: lsst.pex.harness.IOStage.InputStageParallel eventTopic: None stagePolicy: { parameters: { butler: @PT1Pipe/butlerInput.paf inputItems: {""" for channelX in (0, 1): for channelY in (0, 1, 2, 3, 4, 5, 6, 7): for snap in (0, 1): channelName = '"%d,%d"' % (channelX, channelY) channelSnap = "%d%d_%d" % (channelX, channelY, snap) print >>f, """ isrExposure""" + channelSnap + """: { datasetType: raw datasetId: { fromJobIdentity: "visit" "raft" "sensor" set: { snap: """ + str(snap) + """ channel: """ + channelName + """ } } }""" print >>f, """ } } } }""" for channelX in (0, 1): for channelY in (0, 1, 2, 3, 4, 5, 6, 7): channelName = '"%d,%d"' % (channelX, channelY) channelId = "%d%d" % (channelX, channelY) print >>f, """ appStage: { name: isrInput""" + channelId + """ parallelClass: lsst.pex.harness.IOStage.InputStageParallel eventTopic: None stagePolicy: { parameters: { butler: @PT1Pipe/butlerInput.paf inputItems: { biasExposure: { datasetType: bias datasetId: { fromJobIdentity: "raft" "sensor" set: { channel: """ + channelName + """ } } } darkExposure: { datasetType: dark datasetId: { fromJobIdentity: "raft" "sensor" set: { channel: """ + channelName + """ } } } flatExposure: { datasetType: flat datasetId: { fromJobIdentity: "raft" "sensor" set: { channel: """ + channelName + """ } } } } } } }""" for snap in (0, 1): channelSnap = "%d%d_%d" % (channelX, channelY, snap) print >>f, """ appStage: { name: isrSaturation""" + channelSnap + """ parallelClass: lsst.ip.pipeline.IsrSaturationStageParallel eventTopic: None stagePolicy: { inputKeys: { exposure: isrExposure""" + channelSnap + """ } outputKeys: { saturationMaskedExposure: isrExposure""" + channelSnap + """ } } } appStage: { name: isrOverscan""" + channelSnap + """ parallelClass: lsst.ip.pipeline.IsrOverscanStageParallel eventTopic: None stagePolicy: { inputKeys: { exposure: isrExposure""" + channelSnap + """ } outputKeys: { overscanCorrectedExposure: isrExposure""" + channelSnap + """ } } } appStage: { name: isrBias""" + channelSnap + """ parallelClass: lsst.ip.pipeline.IsrBiasStageParallel eventTopic: None stagePolicy: { inputKeys: { exposure: isrExposure""" + channelSnap + """ biasexposure: biasExposure } outputKeys: { biasSubtractedExposure: isrExposure""" + channelSnap + """ } } } appStage: { name: isrVariance""" + channelSnap + """ parallelClass: lsst.ip.pipeline.IsrVarianceStageParallel eventTopic: None stagePolicy: { inputKeys: { exposure: isrExposure""" + channelSnap + """ } outputKeys: { varianceAddedExposure: isrExposure""" + channelSnap + """ } } } appStage: { name: isrDark""" + channelSnap + """ parallelClass: lsst.ip.pipeline.IsrDarkStageParallel eventTopic: None stagePolicy: { inputKeys: { exposure: isrExposure""" + channelSnap + """ darkexposure: darkExposure } outputKeys: { darkSubtractedExposure: isrExposure""" + channelSnap + """ } } } appStage: { name: isrFlat""" + channelSnap + """ parallelClass: lsst.ip.pipeline.IsrFlatStageParallel eventTopic: None stagePolicy: { inputKeys: { exposure: isrExposure""" + channelSnap + """ flatexposure: flatExposure } outputKeys: { darkSubtractedExposure: isrExposure""" + channelSnap + """ } parameters: @PT1Pipe/ISR-flat.paf outputKeys: { flatCorrectedExposure: isrExposure""" + channelSnap + """ } } } appStage: { name: isrSdqaAmp""" + channelSnap + """ parallelClass: lsst.sdqa.pipeline.IsrSdqaStageParallel eventTopic: None stagePolicy: { inputKeys: { exposure: isrExposure""" + channelSnap + """ } parameters: @PT1Pipe/ISR-sdqaAmp.paf outputKeys: { isrPersistableSdqaRatingVectorKey: sdqaRatingVector""" + str(snap) + """ } } }""" pass # end of snap loop print >>f, """ appStage: { name: isrOutput""" + channelId + """ parallelClass: lsst.pex.harness.IOStage.OutputStageParallel eventTopic: None stagePolicy: { parameters: { butler: @PT1Pipe/butlerUpdate.paf outputItems: { sdqaRatingVector0: { datasetType: sdqaAmp datasetId: { fromJobIdentity: "visit" "raft" "sensor" set: { snap: 0 channel: """ + channelName + """ } } } sdqaRatingVector1: { datasetType: sdqaAmp datasetId: { fromJobIdentity: "visit" "raft" "sensor" set: { snap: 1 channel: """ + channelName + """ } } } } } } }""" | 303dfdf62e16f4c3c6657c8635b2192f2d5ed3f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6538/303dfdf62e16f4c3c6657c8635b2192f2d5ed3f4/createImSimPipe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
86,
2227,
12,
74,
4672,
1172,
1671,
74,
16,
3536,
595,
8755,
30,
288,
508,
30,
353,
86,
1210,
4809,
7230,
797,
30,
7180,
334,
18,
84,
338,
18,
76,
1303,
403,
18,
4294,
8755,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
86,
2227,
12,
74,
4672,
1172,
1671,
74,
16,
3536,
595,
8755,
30,
288,
508,
30,
353,
86,
1210,
4809,
7230,
797,
30,
7180,
334,
18,
84,
338,
18,
76,
1303,
403,
18,
4294,
8755,
1... |
if not self.plugin.workerThread: self.plugin.workerThread = MediaMonkeyWorkerThread(self.plugin) self.plugin.workerThread.Start(100.0) self.plugin.workerThread.CallWait(partial( self.plugin.workerThread.WriteToMMdatabase, attrib, arrayValue0[ndx], arrayValue1[ndx] )) | if self.plugin.checkWorkerThread(): self.plugin.workerThread.CallWait(partial( self.plugin.workerThread.WriteToMMdatabase, attrib, arrayValue0[ndx], arrayValue1[ndx] )) | def __call__(self, i, arrayValue0, arrayValue1): ndx = [itm[0] for itm in self.propertiesList].index([it[0] for it in SONG_TABLE_FIELDS][i]) tmpList=[] attrib = [itm[2] for itm in SONG_TABLE_FIELDS][i] if not self.plugin.workerThread: self.plugin.workerThread = MediaMonkeyWorkerThread(self.plugin) self.plugin.workerThread.Start(100.0) self.plugin.workerThread.CallWait(partial( self.plugin.workerThread.WriteToMMdatabase, attrib, arrayValue0[ndx], arrayValue1[ndx] )) | d5260163cbd4fbc67849ace2ade2149e354e4a3f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8076/d5260163cbd4fbc67849ace2ade2149e354e4a3f/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
277,
16,
526,
620,
20,
16,
526,
620,
21,
4672,
5346,
92,
273,
306,
305,
81,
63,
20,
65,
364,
23907,
316,
365,
18,
4738,
682,
8009,
1615,
3816,
305,
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,
1001,
1991,
972,
12,
2890,
16,
277,
16,
526,
620,
20,
16,
526,
620,
21,
4672,
5346,
92,
273,
306,
305,
81,
63,
20,
65,
364,
23907,
316,
365,
18,
4738,
682,
8009,
1615,
3816,
305,
6... |
panelC = ThrusterCurrentPanel(parent, eventHub, []) | panelC = ThrusterCurrentPanel(parent, eventHub, thrusters) | def getPanels(subsystems, parent): eventHub = core.Subsystem.getSubsystemOfType(core.QueuedEventHub, subsystems) vehicle = core.Subsystem.getSubsystemOfType(ext.vehicle.IVehicle, subsystems) if vehicle is not None: # Get All the current Thrusters the vehicle has thrusters = [] names = vehicle.getDeviceNames() for i in range(0,len(names)): device = vehicle.getDevice(names[i]) if isinstance(device, ext.vehicle.device.IThruster): thrusters.append(device) # Only create the panel if there are thrusters on the vehicle if len(thrusters): paneInfo = wx.aui.AuiPaneInfo().Name("Thrusters") paneInfo = paneInfo.Caption("Thrusters").Bottom() paneInfoC = wx.aui.AuiPaneInfo().Name("TCurrents") paneInfoC = paneInfo.Caption("Thrusters Currents").Bottom() panel = ThrusterPanel(parent, eventHub, thrusters) panelC = ThrusterCurrentPanel(parent, eventHub, []) return [(paneInfo, panel, [vehicle]), (paneInfoC, panelC, [vehicle])] return [] | 81e0dc93eacad05b37f42cdfedc022e19b8fb6b0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10608/81e0dc93eacad05b37f42cdfedc022e19b8fb6b0/panels.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1689,
304,
10558,
12,
1717,
4299,
87,
16,
982,
4672,
871,
8182,
273,
2922,
18,
28150,
18,
588,
28150,
18859,
12,
3644,
18,
21039,
1133,
8182,
16,
15359,
87,
13,
225,
24815,
273,
2922,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
304,
10558,
12,
1717,
4299,
87,
16,
982,
4672,
871,
8182,
273,
2922,
18,
28150,
18,
588,
28150,
18859,
12,
3644,
18,
21039,
1133,
8182,
16,
15359,
87,
13,
225,
24815,
273,
2922,
... |
rmin *= regex.min if regex.max and rmax: rmax *= regex.max else: rmax = None regex = regex.regex | if not (rmin == 0 and rmax == 1): rmin *= regex.min if regex.max and rmax: rmax *= regex.max else: rmax = None regex = regex.regex | def __init__(self, regex, rmin, rmax): # Optimisations cls = regex.__class__ if cls == RegexRepeat: # (a{n,p}){x,y) => a{n*x,p*y} rmin *= regex.min if regex.max and rmax: rmax *= regex.max else: rmax = None regex = regex.regex elif cls == RegexOr: rmin, rmax, regex = optimizeRepeatOr(rmin, rmax, regex) | 924fa1961d04c463659ee5e87427400ba26d4e67 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9327/924fa1961d04c463659ee5e87427400ba26d4e67/regex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3936,
16,
436,
1154,
16,
436,
1896,
4672,
468,
19615,
291,
1012,
2028,
273,
3936,
16186,
1106,
972,
309,
2028,
422,
15078,
16750,
30,
468,
261,
69,
95,
8... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3936,
16,
436,
1154,
16,
436,
1896,
4672,
468,
19615,
291,
1012,
2028,
273,
3936,
16186,
1106,
972,
309,
2028,
422,
15078,
16750,
30,
468,
261,
69,
95,
8... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.