rem stringlengths 1 226k | add stringlengths 0 227k | context stringlengths 6 326k | meta stringlengths 143 403 | input_ids listlengths 256 256 | attention_mask listlengths 256 256 | labels listlengths 128 128 |
|---|---|---|---|---|---|---|
if len(self.selected_paths) > 0: from rabbitvcs.ui.delete import Delete Delete(self.selected_paths).start() sleep(1) self.initialize_items() | self.delete_items(widget, data) | def on_context_delete_activated(self, widget, data=None): if len(self.selected_paths) > 0: from rabbitvcs.ui.delete import Delete Delete(self.selected_paths).start() sleep(1) # sleep so the items can be fully deleted before init self.initialize_items() | 604a1a509f4c6c48c41f7cbcd5ffbc24e2024fb0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5119/604a1a509f4c6c48c41f7cbcd5ffbc24e2024fb0/commit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
2472,
67,
3733,
67,
18836,
12,
2890,
16,
3604,
16,
501,
33,
7036,
4672,
309,
562,
12,
2890,
18,
8109,
67,
4481,
13,
405,
374,
30,
628,
767,
70,
3682,
18982,
18,
4881,
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,
603,
67,
2472,
67,
3733,
67,
18836,
12,
2890,
16,
3604,
16,
501,
33,
7036,
4672,
309,
562,
12,
2890,
18,
8109,
67,
4481,
13,
405,
374,
30,
628,
767,
70,
3682,
18982,
18,
4881,
18,
... |
idx = get_idx(idxID) | def perform_modifyindex(idxID, ln=CFG_SITE_LANG, idxNAME='', idxDESC='', callback='yes', confirm=-1): """form to modify an index name. idxID - the index name to change. idxNAME - new name of index idxDESC - description of index content""" subtitle = "" output = "" if idxID not in [-1, "-1"]: subtitle = """<a name="2"></a>1. Modify index name. <small>[<a title="See guide" href="%s/help/admin/bibindex-admin-guide">?</a>]</small>""" % CFG_SITE_URL if confirm in [-1, "-1"]: idx = get_idx(idxID) idxNAME = idx[0][1] idxDESC = idx[0][2] text = """ <span class="adminlabel">Index name</span> <input class="admin_w200" type="text" name="idxNAME" value="%s" /><br /> <span class="adminlabel">Index description</span> <textarea class="admin_w200" name="idxDESC">%s</textarea><br /> """ % (idxNAME, idxDESC) output += createhiddenform(action="modifyindex#1", text=text, button="Modify", idxID=idxID, ln=ln, confirm=1) if idxID > -1 and idxNAME and confirm in [1, "1"]: res = modify_idx(idxID, idxNAME, idxDESC) output += write_outcome(res) elif confirm in [1, "1"]: output += """<br /><b><span class="info">Please give a name for the index.</span></b>""" else: output = """No index to modify.""" body = [output] if callback: return perform_editindex(idxID, ln, "perform_modifyindex", addadminbox(subtitle, body)) else: return addadminbox(subtitle, body) | 9bb5a2cc734da75518f660295446063e9601e25d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/9bb5a2cc734da75518f660295446063e9601e25d/bibindexadminlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
17042,
1615,
12,
3465,
734,
16,
7211,
33,
19727,
67,
20609,
67,
10571,
16,
2067,
1985,
2218,
2187,
2067,
10964,
2218,
2187,
1348,
2218,
9707,
2187,
6932,
29711,
21,
4672,
3536,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
17042,
1615,
12,
3465,
734,
16,
7211,
33,
19727,
67,
20609,
67,
10571,
16,
2067,
1985,
2218,
2187,
2067,
10964,
2218,
2187,
1348,
2218,
9707,
2187,
6932,
29711,
21,
4672,
3536,
... | |
977:'j', | 977:'J', | def _applyAttributes(obj, attr): for k, v in attr.items(): if type(v) is TupleType and v[0]=='relative': #AR 20/5/2000 - remove 1.5.2-ism #v = v[1]+getattr(obj,k,0) if hasattr(obj, k): v = v[1]+getattr(obj,k) else: v = v[1] setattr(obj,k,v) | 88a77a2b378347c828d6b5fdd40cc8f514d53b12 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/88a77a2b378347c828d6b5fdd40cc8f514d53b12/paraparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9010,
2498,
12,
2603,
16,
1604,
4672,
364,
417,
16,
331,
316,
1604,
18,
3319,
13332,
309,
618,
12,
90,
13,
353,
7257,
559,
471,
331,
63,
20,
65,
18920,
11626,
4278,
468,
985,
42... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9010,
2498,
12,
2603,
16,
1604,
4672,
364,
417,
16,
331,
316,
1604,
18,
3319,
13332,
309,
618,
12,
90,
13,
353,
7257,
559,
471,
331,
63,
20,
65,
18920,
11626,
4278,
468,
985,
42... |
log(Log.Info, "serial", "Running at %d without a line timeout of %d." % (self._serial.baudrate, self._serial.timeout)) | log(Log.Info, "serial", "Running at %d with a line timeout of %f." % (self._serial.baudrate, self._serial.timeout)) | def __init__(self): attempts = 0 devices = ["ttyUSB0", "ttyUSB1", "ttyS0", "ttyS1"] while attempts < 5 * len(devices): for device in devices: try: log(Log.Info, "serial", "Trying /dev/%s" % device) self._serial = serial.Serial("/dev/%s" % device,getConfig("serial_baudrate"), timeout=getConfig("serial_line_timeout")) log(Log.Info, "serial", "Using /dev/%s for serial communication." % device) log(Log.Info, "serial", "Running at %d without a line timeout of %d." % (self._serial.baudrate, self._serial.timeout)) self._handler = _SerialHandler(self) return except: attempts += 1 log(Log.Error, "serial", "FATAL: Failed to initialize a serial device after 5 attempts, we're going nowhere.") fatalError("No serial device") | 4e78d73df7d207532be3cff22ede7990ab6727de /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12317/4e78d73df7d207532be3cff22ede7990ab6727de/Serial.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
7531,
273,
374,
7166,
273,
8247,
5512,
24128,
20,
3113,
315,
5512,
24128,
21,
3113,
315,
5512,
55,
20,
3113,
315,
5512,
55,
21,
11929,
1323,
7531,
411,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
7531,
273,
374,
7166,
273,
8247,
5512,
24128,
20,
3113,
315,
5512,
24128,
21,
3113,
315,
5512,
55,
20,
3113,
315,
5512,
55,
21,
11929,
1323,
7531,
411,
... |
(?:[ ]+|$) | ([ ]+|$) | def comment(self, match): if not match.string[match.end():].strip() \ and self.state_machine.is_next_line_blank(): # an empty comment? return [nodes.comment()], 1 # "A tiny but practical wart." indented, indent, offset, blank_finish = \ self.state_machine.get_first_known_indented(match.end()) text = '\n'.join(indented) return [nodes.comment(text, text)], blank_finish | 72a0c19a34dcc90353f2d799116ebcadd510f22a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8194/72a0c19a34dcc90353f2d799116ebcadd510f22a/states.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2879,
12,
2890,
16,
845,
4672,
309,
486,
845,
18,
1080,
63,
1916,
18,
409,
13332,
8009,
6406,
1435,
521,
471,
365,
18,
2019,
67,
9149,
18,
291,
67,
4285,
67,
1369,
67,
12111,
13332,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2879,
12,
2890,
16,
845,
4672,
309,
486,
845,
18,
1080,
63,
1916,
18,
409,
13332,
8009,
6406,
1435,
521,
471,
365,
18,
2019,
67,
9149,
18,
291,
67,
4285,
67,
1369,
67,
12111,
13332,
... |
item, cookie = self.tree.GetNextChild(self.root, cookie) | def showPandaObjectChildren(self): #import pdb;set_trace() self.shouldShowPandaObjChildren = not self.shouldShowPandaObjChildren item, cookie = self.tree.GetFirstChild(self.root) while item: if self.shouldShowPandaObjChildren: self.addPandaObjectChildren(item) else: self.removePandaObjectChildren(item) # continue iteration to the next child item, cookie = self.tree.GetNextChild(self.root, cookie) | 4c963911ae77789c683ea00b008f4a4e67b108d1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7242/4c963911ae77789c683ea00b008f4a4e67b108d1/SceneGraphUI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
52,
464,
69,
921,
4212,
12,
2890,
4672,
468,
5666,
10892,
31,
542,
67,
5129,
1435,
365,
18,
13139,
5706,
52,
464,
69,
2675,
4212,
273,
486,
365,
18,
13139,
5706,
52,
464,
69,
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,
2405,
52,
464,
69,
921,
4212,
12,
2890,
4672,
468,
5666,
10892,
31,
542,
67,
5129,
1435,
365,
18,
13139,
5706,
52,
464,
69,
2675,
4212,
273,
486,
365,
18,
13139,
5706,
52,
464,
69,
2... | |
u"""calls the named function in userFunctions with arguments (these are positional, not keyword, arguments): if postDownloadFunction: directory, filename, rssItemNode, retrievedLink, downloadDict, threadName | u"""calls the named function in userFunctions with arguments (these are positional, not keyword, arguments): if postDownloadFunction: directory, filename, rssItemNode, retrievedLink, downloadDict, threadName | def callUserFunction( functionName, *args ): u"""calls the named function in userFunctions with arguments (these are positional, not keyword, arguments): if postDownloadFunction: directory, filename, rssItemNode, retrievedLink, downloadDict, threadName if postScanFunction: page, ppage, retrievedLink, and threadName directory: name of the directory the file was saved to filename: name of the file the downloaded data was saved to rssItemNode: the feedparser entry for the item we are downloading. This will have been altered such that the original ['link'] element is now at ['oldlink'] and the ['link'] element has been made to be friendly with urllib2RetrievePage and mechRetrievePage retrievedLink: the resultant url from the retrieval. May be different from ['link'] and ['oldlink'] in a number of ways (percent quoting and character encoding, in particular, plus any changes to the url from server redirection, etc.) downloadDict: a dictionary representing the download<x> options. keys are: 'localTrue' (corresponding to download<x>) ; 'False' ; 'True' ; 'Dir' ; 'minSize' ; and 'maxSize' corresponding to their analogues in download<x>. threadName: the name of the config entry. to be accessed like getConfig()['threads'][threadName] page: the raw feed fetched from the server ppage: the feedparser parsed feed retrievedLink: the url that was sent by the server """ global userFunctions logStatusMsg( u"attempting a user function", 5) if not hasattr(userFunctions, functionName): logStatusMsg( u"module does not have function named %s called from thread %s" % (functionName, threadName), 1) return None userFunct = getattr(userFunctions, functionName) userFunct( *args ) | 633e00b171a777d923e4aead2f2717108d53a3b9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1664/633e00b171a777d923e4aead2f2717108d53a3b9/rssdler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
745,
1299,
2083,
12,
14117,
16,
380,
1968,
262,
30,
582,
8395,
12550,
326,
4141,
445,
316,
729,
7503,
598,
1775,
261,
451,
3392,
854,
16780,
16,
486,
4932,
16,
1775,
4672,
309,
1603,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
745,
1299,
2083,
12,
14117,
16,
380,
1968,
262,
30,
582,
8395,
12550,
326,
4141,
445,
316,
729,
7503,
598,
1775,
261,
451,
3392,
854,
16780,
16,
486,
4932,
16,
1775,
4672,
309,
1603,
7... |
if self.settings["target"] in ["stage1","stage2","stage3"]: | if self.settings["target"] in ["stage1","stage2","stage3","livecd-stage3"]: | def run(self): self.dir_setup() self.unpack_and_bind() try: self.chroot_setup() except: self.unbind() raise #modify the current environment. This is an ugly hack that should be fixed. We need this #to use the os.system() call since we can't specify our own environ: for x in self.settings.keys(): varname="clst_"+x #"/" is replaced with "_", "-" is also replaced with "_" string.replace(varname,"/-","__") if type(self.settings[x])==types.StringType: #prefix to prevent namespace clashes: os.environ[varname]=self.settings[x] elif type(self.settings[x])==types.ListType: os.environ[varname]=string.join(self.settings[x]) self.run_local() if self.settings["target"] in ["stage1","stage2","stage3","livecd-stage3"]: self.preclean() self.unbind() if self.settings["target"] in ["stage1","stage2","stage3"]: #clean is for removing things after bind-mounts are unmounted (general file removal and cleanup) self.clean() if self.settings["target"] in ["stage1","stage2","stage3","livecd-stage1","livecd-stage2"]: self.capture() if self.settings["target"] in ["livecd-stage3"]: self.cdroot_setup() | 5c81cb1034d67d7c8217b4c1012c9034be1a06aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7327/5c81cb1034d67d7c8217b4c1012c9034be1a06aa/targets.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
365,
18,
1214,
67,
8401,
1435,
365,
18,
17309,
67,
464,
67,
4376,
1435,
775,
30,
365,
18,
343,
3085,
67,
8401,
1435,
1335,
30,
365,
18,
318,
4376,
1435,
1002,
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,
1086,
12,
2890,
4672,
365,
18,
1214,
67,
8401,
1435,
365,
18,
17309,
67,
464,
67,
4376,
1435,
775,
30,
365,
18,
343,
3085,
67,
8401,
1435,
1335,
30,
365,
18,
318,
4376,
1435,
1002,
4... |
result.append(fmt.rawHTML('<form action="%s/%s" method="GET" name="%s.form">' % (self.request.getScriptname(), wikiutil.quoteWikinameURL(self.request.page.page_name), self.data_id))) | result.append(fmt.rawHTML('<form action="%s/%s" method="GET" name="%sform">' % (self.request.getScriptname(), wikiutil.quoteWikinameURL(self.request.page.page_name), self.data_id))) | def format(self): fmt = self.request.formatter | ba24fd38ab670508bc3a36a8560be2608e883ea5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/888/ba24fd38ab670508bc3a36a8560be2608e883ea5/browser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
12,
2890,
4672,
1325,
273,
365,
18,
2293,
18,
12354,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
12,
2890,
4672,
1325,
273,
365,
18,
2293,
18,
12354,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
line = cgi.escape(l)) | line = l) | def annotate(): parity = 1 last = None for r, l in fl.annotate(n): try: cnode = ncache[r] except KeyError: cnode = ncache[r] = self.repo.changelog.node(r) try: name = bcache[r] except KeyError: cl = self.repo.changelog.read(cnode) name = cl[1] f = name.find('@') if f >= 0: name = name[:f] bcache[r] = name | 67df6715c948c4f7c6d7d2e72c3c108141d13150 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/67df6715c948c4f7c6d7d2e72c3c108141d13150/hgweb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13795,
13332,
19904,
273,
404,
1142,
273,
599,
364,
436,
16,
328,
316,
1183,
18,
18338,
340,
12,
82,
4672,
775,
30,
276,
2159,
273,
290,
2493,
63,
86,
65,
1335,
4999,
30,
276,
2159,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13795,
13332,
19904,
273,
404,
1142,
273,
599,
364,
436,
16,
328,
316,
1183,
18,
18338,
340,
12,
82,
4672,
775,
30,
276,
2159,
273,
290,
2493,
63,
86,
65,
1335,
4999,
30,
276,
2159,
... |
req.args['type'] = match.group(1) req.args['path'] = match.group(2).replace(':', '/') | req.args['format'] = match.group(1) and 'raw' or '' req.args['type'] = match.group(2) req.args['path'] = match.group(3).replace(':', '/') | def match_request(self, req): match = re.match(r'^/attachment/(ticket|wiki)(?:[/:](.*))?$', req.path_info) if match: req.args['type'] = match.group(1) req.args['path'] = match.group(2).replace(':', '/') return True | 01d1598a9f5a2526e8b49b34e7e07fa896dbaec9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/01d1598a9f5a2526e8b49b34e7e07fa896dbaec9/attachment.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
845,
67,
2293,
12,
2890,
16,
1111,
4672,
845,
273,
283,
18,
1916,
12,
86,
19856,
19,
11461,
19,
12,
16282,
96,
13044,
13,
23203,
16880,
65,
7444,
24783,
8,
2187,
1111,
18,
803,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
845,
67,
2293,
12,
2890,
16,
1111,
4672,
845,
273,
283,
18,
1916,
12,
86,
19856,
19,
11461,
19,
12,
16282,
96,
13044,
13,
23203,
16880,
65,
7444,
24783,
8,
2187,
1111,
18,
803,
67,
1... |
self._safetype.__class__.__name__) | self._safetype.__name__) | def validate(self): """ Data type validation method. This method is called automatically for each I{DataType} instance attribute of an object, whenever this object is appended or updated. @raise AssertionError: if the datatype is required and is empty. @returns: None """ assert isinstance(self.value, self._safetype), \ 'Invalid data type for "%s". Got "%s" instead of "%s".' % \ (self.__class__.__name__, self.value.__class__.__name__, self._safetype.__class__.__name__) assert not self.isRequired or self.value, \ '"%s" attribute is mandatory' % self.__class__.__name__ | b023e66691f6f4254c693d739fb15927ca80f2f1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2504/b023e66691f6f4254c693d739fb15927ca80f2f1/datatypes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
12,
2890,
4672,
3536,
1910,
618,
3379,
707,
18,
225,
1220,
707,
353,
2566,
6635,
364,
1517,
467,
95,
6273,
97,
791,
1566,
434,
392,
733,
16,
17334,
333,
733,
353,
12317,
578,
352... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
12,
2890,
4672,
3536,
1910,
618,
3379,
707,
18,
225,
1220,
707,
353,
2566,
6635,
364,
1517,
467,
95,
6273,
97,
791,
1566,
434,
392,
733,
16,
17334,
333,
733,
353,
12317,
578,
352... |
createReq = testmsg("0100230ABC") createReqObj = parser.parse(createReq) assert(createReqObj.opcode == MCAP_MD_CREATE_MDL_REQ) assert(createReqObj.mdlid == 0x0023) assert(createReqObj.mdepid == 0x0A) assert(createReqObj.conf == 0xBC) | msg = testmsg("0100230ABC") msgObj = parser.parse(msg) assert(msgObj.opcode == MCAP_MD_CREATE_MDL_REQ) assert(msgObj.mdlid == 0x0023) assert(msgObj.mdepid == 0x0A) assert(msgObj.conf == 0xBC) assert(msgObj.encode() == msg) | def test(): createReq = CreateMDLRequest(0x01, 0x01, 0x0001) assert(createReq.mdlid == 0x01) assert(createReq.mdepid == 0x01) assert(createReq.opcode == MCAP_MD_CREATE_MDL_REQ) reconnectReq = ReconnectMDLRequest(0x01) assert(reconnectReq.mdlid == 0x01) assert(reconnectReq.opcode == MCAP_MD_RECONNECT_MDL_REQ) deleteReq = DeleteMDLRequest(0x02) assert(deleteReq.mdlid == 0x02) assert(deleteReq.opcode == MCAP_MD_DELETE_MDL_REQ) abortReq = AbortMDLRequest(0x03) assert(abortReq.mdlid == 0x03) assert(abortReq.opcode == MCAP_MD_ABORT_MDL_REQ) # TEST PARSER parser = MessageParser() # test CreateReq message parsing createReq = testmsg("0100230ABC") createReqObj = parser.parse(createReq) assert(createReqObj.opcode == MCAP_MD_CREATE_MDL_REQ) assert(createReqObj.mdlid == 0x0023) assert(createReqObj.mdepid == 0x0A) assert(createReqObj.conf == 0xBC) # test ReconnectReq message parsing reconnectReq = testmsg("0300AB") reconnectReqObj = parser.parse(reconnectReq) assert(reconnectReqObj.opcode == MCAP_MD_RECONNECT_MDL_REQ) assert(reconnectReqObj.mdlid == 0x00AB) # test AbortReq message parsing abortReq = testmsg("0500AB") abortReqObj = parser.parse(abortReq) assert(abortReqObj.opcode == MCAP_MD_ABORT_MDL_REQ) assert(abortReqObj.mdlid == 0x00AB) # test DeleteReq message parsing deleteReq = testmsg("0700CC") deleteReqObj = parser.parse(deleteReq) assert(deleteReqObj.opcode == MCAP_MD_DELETE_MDL_REQ) assert(deleteReqObj.mdlid == 0x00CC) # test CreateRsp message parsing createRsp = testmsg("0200002307") createRspObj = parser.parse(createRsp) assert(createRspObj.opcode == MCAP_MD_CREATE_MDL_RSP) assert(createRspObj.mdlid == 0x0023) assert(createRspObj.rspcode == MCAP_RSP_SUCCESS) assert(createRspObj.config == 0x07) # test ReconnectRsp message parsing reconnectRsp = testmsg("040200AB") reconnectRspObj = parser.parse(reconnectRsp) assert(reconnectRspObj.opcode == MCAP_MD_RECONNECT_MDL_RSP) assert(reconnectRspObj.mdlid == 0x00AB) assert(reconnectRspObj.rspcode == MCAP_RSP_INVALID_PARAMETER_VALUE) # test AbortRsp message parsing abortRsp = testmsg("0605FFFF") abortRspObj = parser.parse(abortRsp) assert(abortRspObj.opcode == MCAP_MD_ABORT_MDL_RSP) assert(abortRspObj.mdlid == 0xFFFF) assert(abortRspObj.rspcode == MCAP_RSP_INVALID_MDL) # test DeleteRsp message parsing deleteRsp = testmsg("080000CC") deleteRspObj = parser.parse(deleteRsp) assert(deleteRspObj.opcode == MCAP_MD_DELETE_MDL_RSP) assert(deleteRspObj.mdlid == 0x00CC) assert(deleteRspObj.rspcode == MCAP_RSP_SUCCESS) exc = None try: parser.parse(testmsg("8B003344")) except Exception, e: exc = e assert(isinstance(exc, InvalidMessage)) exc = None try: parser.parse(testmsg("01")) except Exception, e: exc = e assert(isinstance(exc, InvalidMessage)) exc = None try: parser.parse("") except Exception, e: exc = e assert(isinstance(exc, InvalidMessage)) print "TESTS OK" | 5ab73709fd24f71f38fc2ed06c5d1fbb3996f217 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8028/5ab73709fd24f71f38fc2ed06c5d1fbb3996f217/mcap_defs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
13332,
752,
6113,
273,
1788,
6188,
48,
691,
12,
20,
92,
1611,
16,
374,
92,
1611,
16,
374,
92,
13304,
13,
1815,
12,
2640,
6113,
18,
1264,
80,
350,
422,
374,
92,
1611,
13,
1815,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
13332,
752,
6113,
273,
1788,
6188,
48,
691,
12,
20,
92,
1611,
16,
374,
92,
1611,
16,
374,
92,
13304,
13,
1815,
12,
2640,
6113,
18,
1264,
80,
350,
422,
374,
92,
1611,
13,
1815,
... |
cur_array += mobjs[1] | cur_array += [mobjs[1]] | def parse(self): values = {} cur_array = [] | 112c38ac822679347605cdd2487193e1af0b539e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7327/112c38ac822679347605cdd2487193e1af0b539e/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
4672,
924,
273,
2618,
662,
67,
1126,
273,
5378,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
4672,
924,
273,
2618,
662,
67,
1126,
273,
5378,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if nickmask == cfg.dc_to_irc_prefix + '*': | LOG.info("TKL: Adding Qline: %s" % nickmask) nick_re = wild_to_regex(nickmask) if nick_re.match(cfg.dc_to_irc_prefix): LOG.error("DC nick prefix is Q-lined! Terminating.") self.transport.loseConnection() reactor.stop() | def handleCmd_TKL(self, prefix, args): | d2de3b5e189c91aafab22e60dc740a5f8730ec31 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12372/d2de3b5e189c91aafab22e60dc740a5f8730ec31/bridge_server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
5931,
67,
56,
47,
48,
12,
2890,
16,
1633,
16,
833,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
5931,
67,
56,
47,
48,
12,
2890,
16,
1633,
16,
833,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
- ``solution_dict`` - (default: False) if True, return a list of dictionaries containing the solutions. | - ``solution_dict`` - bool (default: False); if True or non-zero, return a list of dictionaries containing the solutions. If there are no solutions, return an empty list (rather than a list containing an empty dictionary). Likewise, if there's only a single solution, return a list containing one dictionary with that solution. | def solve_mod(eqns, modulus, solution_dict = False): r""" Return all solutions to an equation or list of equations modulo the given integer modulus. Each equation must involve only polynomials in 1 or many variables. By default the solutions are returned as `n`-tuples, where `n` is the number of variables appearing anywhere in the given equations. The variables are in alphabetical order. INPUT: - ``eqns`` - equation or list of equations - ``modulus`` - an integer - ``solution_dict`` - (default: False) if True, return a list of dictionaries containing the solutions. EXAMPLES:: sage: var('x,y') (x, y) sage: solve_mod([x^2 + 2 == x, x^2 + y == y^2], 14) [(4, 2), (4, 6), (4, 9), (4, 13)] sage: solve_mod([x^2 == 1, 4*x == 11], 15) [(14,)] Fermat's equation modulo 3 with exponent 5:: sage: var('x,y,z') (x, y, z) sage: solve_mod([x^5 + y^5 == z^5], 3) [(0, 0, 0), (0, 1, 1), (0, 2, 2), (1, 0, 1), (1, 1, 2), (1, 2, 0), (2, 0, 2), (2, 1, 0), (2, 2, 1)] We can solve with respect to a bigger modulus if it consists only of small prime factors:: sage: [d] = solve_mod([5*x + y == 3, 2*x - 3*y == 9], 3*5*7*11*19*23*29, solution_dict = True) sage: d[x] 12915279 sage: d[y] 8610183 We solve an simple equation modulo 2:: sage: x,y = var('x,y') sage: solve_mod([x == y], 2) [(0, 0), (1, 1)] .. warning:: The current implementation splits the modulus into prime powers, then naively enumerates all possible solutions and finally combines the solution using the Chinese Remainder Theorem. The interface is good, but the algorithm is horrible if the modulus has some larger prime factors! Sage *does* have the ability to do something much faster in certain cases at least by using Groebner basis, linear algebra techniques, etc. But for a lot of toy problems this function as is might be useful. At least it establishes an interface. """ from sage.rings.all import Integer, Integers, PolynomialRing, factor, crt_basis from sage.misc.all import cartesian_product_iterator from sage.modules.all import vector from sage.matrix.all import matrix if not isinstance(eqns, (list, tuple)): eqns = [eqns] modulus = Integer(modulus) if modulus < 1: raise ValueError, "the modulus must be a positive integer" vars = list(set(sum([list(e.variables()) for e in eqns], []))) vars.sort(cmp = lambda x,y: cmp(repr(x), repr(y))) n = len(vars) factors = [p**i for p,i in factor(modulus)] crt_basis = vector(Integers(modulus), crt_basis(factors)) solutions = [solve_mod_enumerate(eqns, p) for p in factors] ans = [] for solution in cartesian_product_iterator(solutions): solution_mat = matrix(Integers(modulus), solution) ans.append(tuple(c.dot_product(crt_basis) for c in solution_mat.columns())) if solution_dict == True: sol_dict = [dict(zip(vars, solution)) for solution in ans] return sol_dict else: return ans | ad6d02b0399b4002f52131089b1e11e892c25a2c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/ad6d02b0399b4002f52131089b1e11e892c25a2c/relation.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12439,
67,
1711,
12,
11253,
2387,
16,
24770,
16,
6959,
67,
1576,
273,
1083,
4672,
436,
8395,
2000,
777,
22567,
358,
392,
15778,
578,
666,
434,
30369,
26109,
326,
864,
3571,
24770,
18,
83... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12439,
67,
1711,
12,
11253,
2387,
16,
24770,
16,
6959,
67,
1576,
273,
1083,
4672,
436,
8395,
2000,
777,
22567,
358,
392,
15778,
578,
666,
434,
30369,
26109,
326,
864,
3571,
24770,
18,
83... |
request, src_addr = dlg.wait_msg_from(10) | request, src_addr = dlg.wait_msg_from(30) | def test_func(test): pjsua = test.process[0] dlg = sip.Dialog("127.0.0.1", pjsua.inst_param.sip_port, local_port=srv_port, tcp=cfg_file.recvfrom_cfg.tcp) last_cseq = 0 last_method = "" for t in cfg_file.recvfrom_cfg.transaction: # Print transaction title if t.title != "": dlg.trace(t.title) # Run command and expect patterns for c in t.cmds: if c[0] and c[0] != "": pjsua.send(c[0]) if len(c)>1 and c[1] and c[1] != "": pjsua.expect(c[1]) # Wait for request if t.check_cseq: # Absorbs retransmissions cseq = 0 method = last_method while cseq <= last_cseq and method == last_method: request, src_addr = dlg.wait_msg_from(10) if request==None or request=="": raise TestError("Timeout waiting for request") method = request.split(" ", 1)[0] cseq_hval = sip.get_header(request, "CSeq") cseq_hval = cseq_hval.split(" ")[0] cseq = int(cseq_hval) last_cseq = cseq last_method = method else: request, src_addr = dlg.wait_msg_from(10) if request==None or request=="": raise TestError("Timeout waiting for request") # Check for include patterns for pat in t.include: if re.search(pat, request, re.M | re.I)==None: if t.title: tname = " in " + t.title + " transaction" else: tname = "" raise TestError("Pattern " + pat + " not found" + tname) # Check for exclude patterns for pat in t.exclude: if re.search(pat, request, re.M | re.I)!=None: if t.title: tname = " in " + t.title + " transaction" else: tname = "" raise TestError("Excluded pattern " + pat + " found" + tname) # Create response if t.resp_code!=0: response = dlg.create_response(request, t.resp_code, "Status reason") # Add headers to response for h in t.resp_hdr: response = response + h + "\r\n" # Add message body if required if t.body: response = response + t.body # Send response dlg.send_msg(response, src_addr) # Expect something to happen in pjsua if t.expect != "": pjsua.expect(t.expect) # Sync pjsua.sync_stdout() | 2dbbb645cab6718903102c056e3fd473033e9369 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4447/2dbbb645cab6718903102c056e3fd473033e9369/mod_recvfrom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
644,
12,
3813,
4672,
293,
2924,
11886,
273,
1842,
18,
2567,
63,
20,
65,
25840,
273,
10341,
18,
6353,
2932,
14260,
18,
20,
18,
20,
18,
21,
3113,
293,
2924,
11886,
18,
8591,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
644,
12,
3813,
4672,
293,
2924,
11886,
273,
1842,
18,
2567,
63,
20,
65,
25840,
273,
10341,
18,
6353,
2932,
14260,
18,
20,
18,
20,
18,
21,
3113,
293,
2924,
11886,
18,
8591,
... |
help="capture height in pixels") | help="capture height in pixels") | def checkCamera(): if not(camNode.isAvailable()): Log.trace(Log.APP, "Could not open camera") exit(1) | e22509155a0a9ff1f424dc4a889757a78d0bb6d8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7300/e22509155a0a9ff1f424dc4a889757a78d0bb6d8/avg_showcamera.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
16521,
13332,
309,
486,
12,
20133,
907,
18,
291,
5268,
1435,
4672,
1827,
18,
5129,
12,
1343,
18,
7215,
16,
315,
4445,
486,
1696,
10836,
7923,
2427,
12,
21,
13,
282,
2,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
16521,
13332,
309,
486,
12,
20133,
907,
18,
291,
5268,
1435,
4672,
1827,
18,
5129,
12,
1343,
18,
7215,
16,
315,
4445,
486,
1696,
10836,
7923,
2427,
12,
21,
13,
282,
2,
-100,
-100,... |
varBinds.append( (oid, mibInstrIdx[oid](msgVer)) ) | varBinds.append((oid, mibInstrIdx[oid](msgVer))) | def cbFun(transportDispatcher, transportDomain, transportAddress, wholeMsg): while wholeMsg: msgVer = api.decodeMessageVersion(wholeMsg) if api.protoModules.has_key(msgVer): pMod = api.protoModules[msgVer] else: print 'Unsupported SNMP version %s' % msgVer return reqMsg, wholeMsg = decoder.decode( wholeMsg, asn1Spec=pMod.Message(), ) rspMsg = pMod.apiMessage.getResponse(reqMsg) rspPDU = pMod.apiMessage.getPDU(rspMsg) reqPDU = pMod.apiMessage.getPDU(reqMsg) varBinds = []; errorIndex = -1 # GETNEXT PDU if reqPDU.isSameTypeWith(pMod.GetNextRequestPDU()): # Produce response var-binds errorIndex = -1 for oid, val in pMod.apiPDU.getVarBinds(reqPDU): errorIndex = errorIndex + 1 # Search next OID to report nextIdx = bisect.bisect(mibInstr, oid) if nextIdx == len(mibInstr): # Out of MIB pMod.apiPDU.setEndOfMibError(rspPDU, errorIndex) else: # Report value if OID is found varBinds.append( (mibInstr[nextIdx].name, mibInstr[nextIdx](msgVer)) ) elif reqPDU.isSameTypeWith(pMod.GetRequestPDU()): for oid, val in pMod.apiPDU.getVarBinds(reqPDU): if mibInstrIdx.has_key(oid): varBinds.append( (oid, mibInstrIdx[oid](msgVer)) ) else: # No such instance pMod.apiPDU.setNoSuchInstanceError(rspPDU, errorIndex) varBinds = pMod.apiPDU.getVarBinds(reqPDU) break else: # Report unsupported request type pMod.apiPDU.setErrorStatus(rspPDU, 'genErr') pMod.apiPDU.setVarBinds(rspPDU, varBinds) transportDispatcher.sendMessage( encoder.encode(rspMsg), transportDomain, transportAddress ) return wholeMsg | 16d8bf0e639ab07a5ddcfd374a74715eec9a7cc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/587/16d8bf0e639ab07a5ddcfd374a74715eec9a7cc3/implementing-scalar-mib-objects.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2875,
22783,
12,
13049,
6681,
16,
4736,
3748,
16,
4736,
1887,
16,
7339,
3332,
4672,
1323,
7339,
3332,
30,
1234,
3945,
273,
1536,
18,
3922,
1079,
1444,
12,
3350,
790,
3332,
13,
309,
1536,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2875,
22783,
12,
13049,
6681,
16,
4736,
3748,
16,
4736,
1887,
16,
7339,
3332,
4672,
1323,
7339,
3332,
30,
1234,
3945,
273,
1536,
18,
3922,
1079,
1444,
12,
3350,
790,
3332,
13,
309,
1536,... |
if hasattr(txmbr, 'reinstall'): | if txmbr.reinstall: | def txmbr2state(txmbr): state = None if txmbr.output_state in (TS_INSTALL, TS_TRUEINSTALL): if hasattr(txmbr, 'reinstall'): state = 'Reinstall' elif txmbr.downgrades: state = 'Downgrade' if txmbr.output_state == TS_ERASE: if txmbr.downgraded_by: state = 'Downgraded' if state is None: state = _stcode2sttxt.get(txmbr.output_state) if state == 'Install' and txmbr.isDep: state = 'Dep-Install' return state | 10b718b3a09904789de8139dec4f1cd36a43e449 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/10b718b3a09904789de8139dec4f1cd36a43e449/history.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2229,
1627,
86,
22,
2019,
12,
978,
1627,
86,
4672,
919,
273,
599,
309,
2229,
1627,
86,
18,
2844,
67,
2019,
316,
261,
8047,
67,
28865,
16,
15508,
67,
18724,
28865,
4672,
309,
2229,
1627... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2229,
1627,
86,
22,
2019,
12,
978,
1627,
86,
4672,
919,
273,
599,
309,
2229,
1627,
86,
18,
2844,
67,
2019,
316,
261,
8047,
67,
28865,
16,
15508,
67,
18724,
28865,
4672,
309,
2229,
1627... |
id = stream.read_dword() | id = stream.read_fourcc() | def parse_objects(self, stream): | 21397adc91fc95193176fe6bbcd812e8641a4159 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4884/21397adc91fc95193176fe6bbcd812e8641a4159/realmedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
6911,
12,
2890,
16,
1407,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
6911,
12,
2890,
16,
1407,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
row = self._data[docid] | def positions(self, docid, words): """Return the positions in the document for the given document id of the word, word.""" id = self.id | d1f544bec4a452ed42c765c9b0b6e59222700b15 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/d1f544bec4a452ed42c765c9b0b6e59222700b15/UnTextIndex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6865,
12,
2890,
16,
997,
350,
16,
4511,
4672,
3536,
990,
326,
6865,
316,
326,
1668,
364,
326,
864,
1668,
612,
434,
326,
2076,
16,
2076,
12123,
612,
273,
365,
18,
350,
2,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6865,
12,
2890,
16,
997,
350,
16,
4511,
4672,
3536,
990,
326,
6865,
316,
326,
1668,
364,
326,
864,
1668,
612,
434,
326,
2076,
16,
2076,
12123,
612,
273,
365,
18,
350,
2,
-100,
-100,
... | |
sconsOptions += ' -j ' + str(self.options.jobs) | if self.options.jobs != None: sconsOptions += ' -j ' + str(self.options.jobs) | def run(self): sconsOptions = self.options.flavour sconsOptions += ' -j ' + str(self.options.jobs) if self.options.sandboxDir != '': sconsOptions += ' sandboxDir=' + str(self.options.sandboxDir) command = 'scons ' + sconsOptions print 'Executing: ', command runCommand(command) | 0b6980f9983d0ce67dbc2f8eca3289b52a7c95ea /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8259/0b6980f9983d0ce67dbc2f8eca3289b52a7c95ea/Install.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
272,
8559,
1320,
273,
365,
18,
2116,
18,
2242,
842,
477,
309,
365,
18,
2116,
18,
10088,
480,
599,
30,
272,
8559,
1320,
1011,
296,
300,
78,
296,
397,
609,
12,
28... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
272,
8559,
1320,
273,
365,
18,
2116,
18,
2242,
842,
477,
309,
365,
18,
2116,
18,
10088,
480,
599,
30,
272,
8559,
1320,
1011,
296,
300,
78,
296,
397,
609,
12,
28... |
test_stringprep | def countsurprises(expected, actual, action, antiaction, allran, resource_denieds): """returns the number of items in actual that aren't in expected.""" printlist(actual) if not expected.isvalid(): print "Ask someone to teach regrtest.py about which tests are" print "expected to %s on %s." % (action, sys.platform) return 1#Surprising not to know what to expect.... good_surprise = expected.getexpected() - set(actual) if allran and good_surprise: print count(len(good_surprise), 'test'), antiaction, 'unexpectedly:' printlist(good_surprise) bad_surprise = set(actual) - expected.getexpected() - set(resource_denieds) if bad_surprise: print count(len(bad_surprise), action), "unexpected:" printlist(bad_surprise) return len(bad_surprise) | 1b67a88625a0f64c1c14a609c8592a5827500c52 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6753/1b67a88625a0f64c1c14a609c8592a5827500c52/regrtest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6880,
295,
683,
6141,
12,
3825,
16,
3214,
16,
1301,
16,
30959,
1128,
16,
777,
2450,
16,
1058,
67,
13002,
2092,
87,
4672,
3536,
6154,
326,
1300,
434,
1516,
316,
3214,
716,
11526,
1404,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6880,
295,
683,
6141,
12,
3825,
16,
3214,
16,
1301,
16,
30959,
1128,
16,
777,
2450,
16,
1058,
67,
13002,
2092,
87,
4672,
3536,
6154,
326,
1300,
434,
1516,
316,
3214,
716,
11526,
1404,
... | |
search_modifier = tokens[start].text=="|" | search_modifier = tokens[start].text in ("|", "!") | def run(self): tokens = self.tokens i = 0 start = None | 77e93ba625801e9c9f0cf3b1fdb4644a87a19e31 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12391/77e93ba625801e9c9f0cf3b1fdb4644a87a19e31/core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
2430,
273,
365,
18,
7860,
277,
273,
374,
787,
273,
599,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
2430,
273,
365,
18,
7860,
277,
273,
374,
787,
273,
599,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
self.body.insert(0, self.starttag(node, 'div', CLASS='document')) self.body.append('</div>\n') | self.body_prefix.append(self.starttag(node, 'div', CLASS='document')) self.body_suffix.insert(0, '</div>\n') | def depart_document(self, node): self.fragment.extend(self.body) self.body.insert(0, self.starttag(node, 'div', CLASS='document')) self.body.append('</div>\n') | e8388f2f7b1a8a71d667642e1aa5c49cd90820fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1278/e8388f2f7b1a8a71d667642e1aa5c49cd90820fe/html4css1.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26000,
67,
5457,
12,
2890,
16,
756,
4672,
365,
18,
11956,
18,
14313,
12,
2890,
18,
3432,
13,
365,
18,
3432,
18,
6387,
12,
20,
16,
365,
18,
1937,
2692,
12,
2159,
16,
296,
2892,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26000,
67,
5457,
12,
2890,
16,
756,
4672,
365,
18,
11956,
18,
14313,
12,
2890,
18,
3432,
13,
365,
18,
3432,
18,
6387,
12,
20,
16,
365,
18,
1937,
2692,
12,
2159,
16,
296,
2892,
2187,
... |
def fill_command(self, pixbuf, color, opacity): | def fill_command(self, pixbuf, color, opacity=100): | def fill_command(self, pixbuf, color, opacity): if color == "active_color": color = settings['active_glow_color'] if color[0]=="#": color = color[1:] try: f = int(color,16)<<8 except ValueError: print "Theme error: the color attribute for fill should be a six digit hex string eg. \"#FFFFFF\" or the name of a DockBarX color eg. \"active_color\"." raise f += int(int(opacity)*2.56) pixbuf.fill(f) return pixbuf | a072098aaa68b27e216a4833201a78298c5ccd3a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7075/a072098aaa68b27e216a4833201a78298c5ccd3a/dockbarx.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3636,
67,
3076,
12,
2890,
16,
11871,
4385,
16,
2036,
16,
12636,
33,
6625,
4672,
309,
2036,
422,
315,
3535,
67,
3266,
6877,
2036,
273,
1947,
3292,
3535,
67,
75,
821,
67,
3266,
3546,
309... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3636,
67,
3076,
12,
2890,
16,
11871,
4385,
16,
2036,
16,
12636,
33,
6625,
4672,
309,
2036,
422,
315,
3535,
67,
3266,
6877,
2036,
273,
1947,
3292,
3535,
67,
75,
821,
67,
3266,
3546,
309... |
from hedge.timestep import RK4TimeStepper self.forward_stepper = RK4TimeStepper() self.backward_stepper = RK4TimeStepper() | from hedge.timestep.runge_kutta import LSRK4TimeStepper self.forward_stepper = LSRK4TimeStepper() self.backward_stepper = LSRK4TimeStepper() | def __init__(self, t0, y0, dt): self.t = [t0] self.y = [y0] self.dt = dt | 31e907bd81a183ecd21d3d62212c3ad3167c18e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12869/31e907bd81a183ecd21d3d62212c3ad3167c18e5/tools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
268,
20,
16,
677,
20,
16,
3681,
4672,
365,
18,
88,
273,
306,
88,
20,
65,
365,
18,
93,
273,
306,
93,
20,
65,
365,
18,
7510,
273,
3681,
2,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
2738,
972,
12,
2890,
16,
268,
20,
16,
677,
20,
16,
3681,
4672,
365,
18,
88,
273,
306,
88,
20,
65,
365,
18,
93,
273,
306,
93,
20,
65,
365,
18,
7510,
273,
3681,
2,
-100,
-100... |
self.sink.set_property('volume', float(volume)/10) | volume = (volume * self.max_playbin_volume) / 100. self.sink.set_property('volume', volume) | def set_volume_playbin(self, volume): volume = int(volume) if volume < 0: volume=0 if volume > 100: volume=100 self.sink.set_property('volume', float(volume)/10) | 56a690641745e5de48e43c2d6f0dd10f24a0e22c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11626/56a690641745e5de48e43c2d6f0dd10f24a0e22c/gstreamer_renderer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
9491,
67,
1601,
4757,
12,
2890,
16,
3940,
4672,
3940,
273,
509,
12,
9491,
13,
309,
3940,
411,
374,
30,
3940,
33,
20,
309,
3940,
405,
2130,
30,
3940,
33,
6625,
365,
18,
17074... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
9491,
67,
1601,
4757,
12,
2890,
16,
3940,
4672,
3940,
273,
509,
12,
9491,
13,
309,
3940,
411,
374,
30,
3940,
33,
20,
309,
3940,
405,
2130,
30,
3940,
33,
6625,
365,
18,
17074... |
rule.pattern(12), rule.pattern(13), | rule.pattern(14), rule.pattern(15), | def fc_forall_require(rule, arg_patterns, arg_context): engine = rule.rule_base.engine patterns = rule.goal_arg_patterns() if len(arg_patterns) == len(patterns): context = contexts.bc_context(rule) try: if all(itertools.imap(lambda pat, arg: pat.match_pattern(context, context, arg, arg_context), patterns, arg_patterns)): rule.rule_base.num_bc_rules_matched += 1 mark1 = context.mark(True) if rule.pattern(0).match_data(context, context, "forall%d_worked" % context.lookup_data('start_lineno')): context.end_save_all_undo() mark2 = context.mark(True) if rule.pattern(1).match_data(context, context, "not forall%d_worked" % context.lookup_data('start_lineno')): context.end_save_all_undo() flag_3 = False with engine.prove(rule.rule_base.root_name, 'fc_premises', context, (rule.pattern(2), rule.pattern(3), rule.pattern(4), rule.pattern(5), rule.pattern(1), rule.pattern(6), rule.pattern(7), rule.pattern(8), rule.pattern(9), rule.pattern(10), rule.pattern(11),)) \ as gen_3: for x_3 in gen_3: flag_3 = True assert x_3 is None, \ "compiler.fc_forall_require: got unexpected plan from when clause 3" flag_4 = False with engine.prove(rule.rule_base.root_name, 'fc_premises', context, (rule.pattern(2), rule.pattern(4), rule.pattern(12), rule.pattern(13), rule.pattern(0), rule.pattern(6), rule.pattern(14), rule.pattern(15), rule.pattern(16), rule.pattern(11), rule.pattern(17),)) \ as gen_4: for x_4 in gen_4: flag_4 = True assert x_4 is None, \ "compiler.fc_forall_require: got unexpected plan from when clause 4" mark5 = context.mark(True) if rule.pattern(18).match_data(context, context, ("forall%d_worked = True" % context.lookup_data('start_lineno'), context.lookup_data('fn_head1'), "forall%d_worked = False" % context.lookup_data('start_lineno'), context.lookup_data('fn_head2'), ('INDENT', 2), "forall%d_worked = True" % context.lookup_data('start_lineno'), 'POPINDENT', context.lookup_data('fn_tail2'), context.lookup_data('fn_tail1'), "if forall%d_worked:" % context.lookup_data('start_lineno'), ("INDENT", 2))): context.end_save_all_undo() mark6 = context.mark(True) if rule.pattern(19).match_data(context, context, context.lookup_data('decl_lines1') + context.lookup_data('decl_lines2')): context.end_save_all_undo() rule.rule_base.num_bc_rule_successes += 1 yield else: context.end_save_all_undo() context.undo_to_mark(mark6) else: context.end_save_all_undo() context.undo_to_mark(mark5) if not flag_4: raise AssertionError("compiler.fc_forall_require: 'when' clause 4 failed") if not flag_3: raise AssertionError("compiler.fc_forall_require: 'when' clause 3 failed") else: context.end_save_all_undo() context.undo_to_mark(mark2) else: context.end_save_all_undo() context.undo_to_mark(mark1) rule.rule_base.num_bc_rule_failures += 1 finally: context.done() | bd4e660a9ed69b909bf026a87883b9b1a9562934 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14714/bd4e660a9ed69b909bf026a87883b9b1a9562934/compiler_bc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8036,
67,
1884,
454,
67,
6528,
12,
5345,
16,
1501,
67,
13317,
16,
1501,
67,
2472,
4672,
4073,
273,
1720,
18,
5345,
67,
1969,
18,
8944,
6884,
273,
1720,
18,
27354,
67,
3175,
67,
13317,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8036,
67,
1884,
454,
67,
6528,
12,
5345,
16,
1501,
67,
13317,
16,
1501,
67,
2472,
4672,
4073,
273,
1720,
18,
5345,
67,
1969,
18,
8944,
6884,
273,
1720,
18,
27354,
67,
3175,
67,
13317,
... |
ResourceNodes = self._doauditRsc(resource) | def _doaudit(self): '''Check to see if all resources are running in exactly one place in the cluster. | fe96223aad24cf390affab7866cc7e4142055f84 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5112/fe96223aad24cf390affab7866cc7e4142055f84/CTSaudits.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2896,
17413,
12,
2890,
4672,
9163,
1564,
358,
2621,
309,
777,
2703,
854,
3549,
316,
8950,
1245,
3166,
316,
326,
2855,
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,
389,
2896,
17413,
12,
2890,
4672,
9163,
1564,
358,
2621,
309,
777,
2703,
854,
3549,
316,
8950,
1245,
3166,
316,
326,
2855,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
block_dim, grid_dim = select_block_grid_sizes(dev, v_gpu.shape) | block_dim, grid_dim = select_block_grid_sizes(dev, d_gpu.shape) | def diag(v_gpu, dev): """ Construct a diagonal matrix. Constructs a matrix in device memory whose diagonal elements correspond to the elements in the specified array; all non-diagonal elements are set to 0. Parameters ---------- a_obj : pycuda.gpuarray.GPUArray Input array of length `n`. dev : pycuda.driver.Device Device object to be used. Returns ------- d_gpu : pycuda.gpuarray.GPUArray Diagonal matrix of dimensions `[n, n]`. Example ------- >>> import pycuda.driver as drv >>> import pycuda.gpuarray as gpuarray >>> import pycuda.autoinit >>> import numpy as np >>> import linalg >>> linalg.init() >>> v = np.array([1, 2, 3, 4, 5, 6], np.float32) >>> v_gpu = gpuarray.to_gpu(v) >>> d_gpu = diag(v_gpu, pycuda.autoinit.device); >>> np.all(d_gpu.get() == np.diag(v)) True >>> v = np.array([1j, 2j, 3j, 4j, 5j, 6j], np.complex64) >>> v_gpu = gpuarray.to_gpu(v) >>> d_gpu = diag(v_gpu, pycuda.autoinit.device); >>> np.all(d_gpu.get() == np.diag(v)) True """ if v_gpu.dtype not in [np.float32, np.float64, np.complex64, np.complex128]: raise ValueError('unrecognized type') use_double = int(v_gpu.dtype in [np.float64, np.complex128]) use_complex = int(v_gpu.dtype in [np.complex64, np.complex128]) # Get block/grid sizes: max_threads_per_block, max_block_dim, max_grid_dim = get_dev_attrs(dev) block_dim, grid_dim = select_block_grid_sizes(dev, v_gpu.shape) max_blocks_per_grid = max(max_grid_dim) # Set this to False when debugging to make sure the compiled kernel is # not cached: cache_dir=None diag_mod = \ SourceModule(diag_mod_template.substitute(use_double=use_double, use_complex=use_complex, max_threads_per_block=max_threads_per_block, max_blocks_per_grid=max_blocks_per_grid, cols=v_gpu.size), cache_dir=cache_dir) diag = diag_mod.get_function("diag") d_gpu = gpuarray.empty((v_gpu.size, v_gpu.size), v_gpu.dtype) diag(v_gpu.gpudata, d_gpu.gpudata, np.uint32(d_gpu.size), block=block_dim, grid=grid_dim) return d_gpu | 204fd558078a1951e12208ecb7d3abec547c7a0f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14753/204fd558078a1951e12208ecb7d3abec547c7a0f/linalg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6643,
12,
90,
67,
23162,
16,
4461,
4672,
3536,
14291,
279,
15425,
3148,
18,
225,
14291,
87,
279,
3148,
316,
2346,
3778,
8272,
15425,
2186,
4325,
358,
326,
2186,
316,
326,
1269,
526,
31,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6643,
12,
90,
67,
23162,
16,
4461,
4672,
3536,
14291,
279,
15425,
3148,
18,
225,
14291,
87,
279,
3148,
316,
2346,
3778,
8272,
15425,
2186,
4325,
358,
326,
2186,
316,
326,
1269,
526,
31,
... |
g.write( "\t\t\t" + member_style + "Output" + class_name.title() + str(i) + "(\"Output " + str(i) + "\", this),\n" ) | g.write( "\t\t\t" + member_style + "Output" + outputs[i].title() + str(i) + "(\"Output " + str(i) + "\", this),\n" ) | g.write( "#ifndef _BaseProcessing_\n" ) | f68b41981bf4ca00e6a611001345eecbc636154e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1456/f68b41981bf4ca00e6a611001345eecbc636154e/TemplateGenerator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
314,
18,
2626,
12,
6619,
430,
82,
536,
389,
2171,
7798,
22202,
82,
6,
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,
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,
314,
18,
2626,
12,
6619,
430,
82,
536,
389,
2171,
7798,
22202,
82,
6,
262,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if check_port('localhost', 2002): mess = "... aborted!\n" mess += "Start aborted since the server seems to be running.\n" sys.stderr.write(mess) sys.exit(1) | def startstop(stdout='/dev/null', stderr=None, stdin='/dev/null', pidfile='pid.txt', startmsg = 'started with pid %s', action='start' ): if action: try: pf = file(pidfile,'r') pid = int(pf.read().strip()) pf.close() except IOError: pid = None if 'stop' == action or 'restart' == action: if not pid: mess = "Could not stop, pid file '%s' missing.\n" sys.stderr.write(mess % pidfile) if 'stop' == action: sys.exit(1) action = 'start' pid = None else: try: sys.stderr.write("stopping pid %s..." % pid) while 1: os.killpg(pid,SIGTERM) time.sleep(1) except OSError, err: err = str(err) if err.find("No such process") > 0: os.remove(pidfile) sys.stderr.write(" done.\n") if 'stop' == action: sys.exit(0) action = 'start' pid = None else: print str(err) sys.exit(1) if 'start' == action: if pid: mess = "Start aborted since pid file '%s' exists.\n" sys.stderr.write(mess % pidfile) sys.exit(1) sys.stderr.write("going into background...") daemonize(stdout,stderr,stdin,pidfile,startmsg) return if 'fg' == action: if check_port('localhost', 2002): mess = "... aborted!\n" mess += "Start aborted since the server seems to be running.\n" sys.stderr.write(mess) sys.exit(1) if pid: mess = "Start aborted since pid file '%s' exists.\n" sys.stderr.write(mess % pidfile) sys.exit(1) sys.stderr.write("started.\n") return if 'status' == action: if not pid: sys.stderr.write('Status: Stopped\n') else: sys.stderr.write('Status: Running (PID %s) \n'%pid) sys.exit(0) | 47936531d48f17085b457210e7f365b54c835d36 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9481/47936531d48f17085b457210e7f365b54c835d36/oooctl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
5681,
12,
10283,
2218,
19,
5206,
19,
2011,
2187,
4514,
33,
7036,
16,
8801,
2218,
19,
5206,
19,
2011,
2187,
27656,
2218,
6610,
18,
5830,
2187,
787,
3576,
273,
296,
14561,
598,
4231,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
5681,
12,
10283,
2218,
19,
5206,
19,
2011,
2187,
4514,
33,
7036,
16,
8801,
2218,
19,
5206,
19,
2011,
2187,
27656,
2218,
6610,
18,
5830,
2187,
787,
3576,
273,
296,
14561,
598,
4231,
... | |
A value which will be stored in the Column denoted by polymorphic_on, corresponding to the *class identity* of this mapper. | A value which will be stored in the Column denoted by polymorphic_on, corresponding to the *class identity* of this mapper. | def mapper(class_, local_table=None, *args, **params): """Return a new [sqlalchemy.orm#Mapper] object. class\_ The class to be mapped. local_table The table to which the class is mapped, or None if this mapper inherits from another mapper using concrete table inheritance. entity_name A name to be associated with the `class`, to allow alternate mappings for a single class. always_refresh If True, all query operations for this mapped class will overwrite all data within object instances that already exist within the session, erasing any in-memory changes with whatever information was loaded from the database. Usage of this flag is highly discouraged; as an alternative, see the method `populate_existing()` on [sqlalchemy.orm.query#Query]. allow_column_override If True, allows the usage of a ``relation()`` which has the same name as a column in the mapped table. The table column will no longer be mapped. allow_null_pks Indicates that composite primary keys where one or more (but not all) columns contain NULL is a valid primary key. Primary keys which contain NULL values usually indicate that a result row does not contain an entity and should be skipped. batch Indicates that save operations of multiple entities can be batched together for efficiency. setting to False indicates that an instance will be fully saved before saving the next instance, which includes inserting/updating all table rows corresponding to the entity as well as calling all ``MapperExtension`` methods corresponding to the save operation. column_prefix A string which will be prepended to the `key` name of all Columns when creating column-based properties from the given Table. Does not affect explicitly specified column-based properties concrete If True, indicates this mapper should use concrete table inheritance with its parent mapper. extension A [sqlalchemy.orm#MapperExtension] instance or list of ``MapperExtension`` instances which will be applied to all operations by this ``Mapper``. inherits Another ``Mapper`` for which this ``Mapper`` will have an inheritance relationship with. inherit_condition For joined table inheritance, a SQL expression (constructed ``ClauseElement``) which will define how the two tables are joined; defaults to a natural join between the two tables. inherit_foreign_keys when inherit_condition is used and the condition contains no ForeignKey columns, specify the "foreign" columns of the join condition in this list. else leave as None. order_by A single ``Column`` or list of ``Columns`` for which selection operations should use as the default ordering for entities. Defaults to the OID/ROWID of the table if any, or the first primary key column of the table. non_primary Construct a ``Mapper`` that will define only the selection of instances, not their persistence. Any number of non_primary mappers may be created for a particular class. polymorphic_on Used with mappers in an inheritance relationship, a ``Column`` which will identify the class/mapper combination to be used with a particular row. Requires the ``polymorphic_identity`` value to be set for all mappers in the inheritance hierarchy. The column specified by ``polymorphic_on`` is usually a column that resides directly within the base mapper's mapped table; alternatively, it may be a column that is only present within the <selectable> portion of the ``with_polymorphic`` argument. _polymorphic_map Used internally to propagate the full map of polymorphic identifiers to surrogate mappers. polymorphic_identity A value which will be stored in the Column denoted by polymorphic_on, corresponding to the *class identity* of this mapper. polymorphic_fetch specifies how subclasses mapped through joined-table inheritance will be fetched. options are 'union', 'select', and 'deferred'. if the 'with_polymorphic' argument is present, defaults to 'union', otherwise defaults to 'select'. properties A dictionary mapping the string names of object attributes to ``MapperProperty`` instances, which define the persistence behavior of that attribute. Note that the columns in the mapped table are automatically converted into ``ColumnProperty`` instances based on the `key` property of each ``Column`` (although they can be overridden using this dictionary). include_properties An inclusive list of properties to map. Columns present in the mapped table but not present in this list will not be automatically converted into properties. exclude_properties A list of properties not to map. Columns present in the mapped table and present in this list will not be automatically converted into properties. Note that neither this option nor include_properties will allow an end-run around Python inheritance. If mapped class ``B`` inherits from mapped class ``A``, no combination of includes or excludes will allow ``B`` to have fewer properties than its superclass, ``A``. primary_key A list of ``Column`` objects which define the *primary key* to be used against this mapper's selectable unit. This is normally simply the primary key of the `local_table`, but can be overridden here. with_polymorphic A tuple in the form ``(<classes>, <selectable>)`` indicating the default style of "polymorphic" loading, that is, which tables are queried at once. <classes> is any single or list of mappers and/or classes indicating the inherited classes that should be loaded at once. The special value ``'*'`` may be used to indicate all descending classes should be loaded immediately. The second tuple argument <selectable> indicates a selectable that will be used to query for multiple classes. Normally, it is left as None, in which case this mapper will form an outer join from the base mapper's table to that of all desired sub-mappers. When specified, it provides the selectable to be used for polymorphic loading. When with_polymorphic includes mappers which load from a "concrete" inheriting table, the <selectable> argument is required, since it usually requires more complex UNION queries. select_table Deprecated. Synonymous with ``with_polymorphic=('*', <selectable>)``. version_id_col A ``Column`` which must have an integer type that will be used to keep a running *version id* of mapped entities in the database. this is used during save operations to ensure that no other thread or process has updated the instance during the lifetime of the entity, else a ``ConcurrentModificationError`` exception is thrown. """ return Mapper(class_, local_table, *args, **params) | 8b169bdc1a9ad510d1fa7ac55cf02c0a00396ed8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1074/8b169bdc1a9ad510d1fa7ac55cf02c0a00396ed8/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5815,
12,
1106,
67,
16,
1191,
67,
2121,
33,
7036,
16,
380,
1968,
16,
2826,
2010,
4672,
3536,
990,
279,
394,
306,
4669,
24182,
18,
535,
7,
4597,
65,
733,
18,
225,
667,
64,
67,
1021,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5815,
12,
1106,
67,
16,
1191,
67,
2121,
33,
7036,
16,
380,
1968,
16,
2826,
2010,
4672,
3536,
990,
279,
394,
306,
4669,
24182,
18,
535,
7,
4597,
65,
733,
18,
225,
667,
64,
67,
1021,
... |
this = apply(_quickfix.new_UnderlyingMaturityMonthYear, args) | this = _quickfix.new_UnderlyingMaturityMonthYear(*args) | def __init__(self, *args): this = apply(_quickfix.new_UnderlyingMaturityMonthYear, args) try: self.this.append(this) except: self.this = this | 7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
14655,
6291,
15947,
2336,
5445,
5593,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
22... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
14655,
6291,
15947,
2336,
5445,
5593,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
22... |
m2.bio_push(sslbio, sockbio) | def _makefile(self, mode='r', bufsize=1024): # XXX doesn't work socket2 = self.socket.makefile(mode, bufsize) sockbio = m2.bio_new_socket(socket2.fileno(), 1) ssl = m2.ssl_dup(self.ssl) m2.ssl_set_bio(ssl, sockbio, sockbio) sslbio = m2.bio_dup_chain(self.sslbio) #m2.bio_set_ssl(sslbio, ssl, 0) m2.bio_push(sslbio, sockbio) return BIO.IOBuffer(sslbio, mode, bufsize) | 00b626b1ae2f8b02ab6849a0340d53a65bd27866 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8055/00b626b1ae2f8b02ab6849a0340d53a65bd27866/Connection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6540,
768,
12,
2890,
16,
1965,
2218,
86,
2187,
1681,
1467,
33,
2163,
3247,
4672,
468,
11329,
3302,
1404,
1440,
2987,
22,
273,
365,
18,
7814,
18,
6540,
768,
12,
3188,
16,
1681,
146... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6540,
768,
12,
2890,
16,
1965,
2218,
86,
2187,
1681,
1467,
33,
2163,
3247,
4672,
468,
11329,
3302,
1404,
1440,
2987,
22,
273,
365,
18,
7814,
18,
6540,
768,
12,
3188,
16,
1681,
146... | |
sys.stdout.write(s1.replace("\r\n", "\n")) | sys.stdout.write(normalize_output(s1)) | def test_basic_pty(): try: debug("Calling master_open()") master_fd, slave_name = pty.master_open() debug("Got master_fd '%d', slave_name '%s'"%(master_fd, slave_name)) debug("Calling slave_open(%r)"%(slave_name,)) slave_fd = pty.slave_open(slave_name) debug("Got slave_fd '%d'"%slave_fd) except OSError: # " An optional feature could not be imported " ... ? raise TestSkipped, "Pseudo-terminals (seemingly) not functional." if not os.isatty(slave_fd) and sys.platform not in fickle_isatty: raise TestFailed, "slave_fd is not a tty" # IRIX apparently turns \n into \r\n. Allow that, but avoid allowing other # differences (like extra whitespace, trailing garbage, etc.) debug("Writing to slave_fd") os.write(slave_fd, TEST_STRING_1) s1 = os.read(master_fd, 1024) sys.stdout.write(s1.replace("\r\n", "\n")) debug("Writing chunked output") os.write(slave_fd, TEST_STRING_2[:5]) os.write(slave_fd, TEST_STRING_2[5:]) s2 = os.read(master_fd, 1024) sys.stdout.write(s2.replace("\r\n", "\n")) os.close(slave_fd) os.close(master_fd) | d71d12a8762bebceab5dad3d1e6a5d14403d70bc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/d71d12a8762bebceab5dad3d1e6a5d14403d70bc/test_pty.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
13240,
67,
825,
13332,
775,
30,
1198,
2932,
19677,
4171,
67,
3190,
1435,
7923,
4171,
67,
8313,
16,
11735,
67,
529,
273,
293,
4098,
18,
7525,
67,
3190,
1435,
1198,
2932,
15617,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
13240,
67,
825,
13332,
775,
30,
1198,
2932,
19677,
4171,
67,
3190,
1435,
7923,
4171,
67,
8313,
16,
11735,
67,
529,
273,
293,
4098,
18,
7525,
67,
3190,
1435,
1198,
2932,
15617,
... |
else: node_text = node.astext().replace('\n', ' ') self.wikiparser.raw = '[%s %s]' % (target, node_text) self.wikiparser.format(self.formatter) self.strip_paragraph = 0 raise docutils.nodes.SkipNode return | href = re.search('href="([^"]+)"', self.wiki_text) if href: node['refuri'] = href.groups()[0] else: self.wiki_text = self.fixup_wiki_formatting(self.wiki_text) self.add_wiki_markup() | def visit_reference(self, node): target = None # These are the special link schemes that MoinMoin supports. We let # MoinMoin handle these types. moin_link_schemes = ['wiki:', 'attachment:', 'inline:', 'drawing:'] # Do I need to lstrip? TODO: Find this out. Doesn't look like I need to # since I don't when assigning target. if 'refuri' in node.attributes: refuri = node['refuri'] if [i for i in moin_link_schemes if refuri.lstrip().startswith(i)]: target = refuri # What is this? TODO: Figure this out and comment elif ('name' in node.attributes and fully_normalize_name(node['name']) == refuri): target = ':%s:' % (node['name']) # The node should have a whitespace normalized name if the docutlis # restructured text parser would normally fully normalize the name. elif ':' not in refuri: target = ':%s:' % (refuri) if target: self.strip_paragraph = 1 # inline is special. We're not doing a link really, we need # moinmoin to actually insert the attachment. if target.startswith('inline:'): self.wikiparser.raw = target self.wikiparser.format(self.formatter) else: # Sometimes a newline will creep in to the node's text. This # throws the moinmoin regex so a link will not get processed. node_text = node.astext().replace('\n', ' ') self.wikiparser.raw = '[%s %s]' % (target, node_text) self.wikiparser.format(self.formatter) self.strip_paragraph = 0 raise docutils.nodes.SkipNode return html4css1.HTMLTranslator.visit_reference(self, node) | b1e8c31c1276da7b2b2d7f198bb518e5ce112c66 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/b1e8c31c1276da7b2b2d7f198bb518e5ce112c66/rst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
6180,
12,
2890,
16,
756,
4672,
1018,
273,
599,
225,
468,
8646,
854,
326,
4582,
1692,
20436,
716,
490,
885,
49,
885,
6146,
18,
1660,
2231,
468,
490,
885,
49,
885,
1640,
4259,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
6180,
12,
2890,
16,
756,
4672,
1018,
273,
599,
225,
468,
8646,
854,
326,
4582,
1692,
20436,
716,
490,
885,
49,
885,
6146,
18,
1660,
2231,
468,
490,
885,
49,
885,
1640,
4259,
... |
self.maxiter = kwargs.get('maxiter', max(100, 2*self.nlp.n)) | self.maxiter = kwargs.get('maxiter', max(100,2*self.merit.nlp.n)) | def __init__(self, merit, TR, TrSolver, **kwargs): """ Solve the bound-constrained problem | 9a6c4f472b4224b483cf355221f1a3acafaa6be3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13857/9a6c4f472b4224b483cf355221f1a3acafaa6be3/pdmerit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4045,
305,
16,
4235,
16,
840,
27721,
16,
2826,
4333,
4672,
3536,
348,
5390,
326,
2489,
17,
591,
31142,
6199,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4045,
305,
16,
4235,
16,
840,
27721,
16,
2826,
4333,
4672,
3536,
348,
5390,
326,
2489,
17,
591,
31142,
6199,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
border:1px solid white; font-family:Arial,Verdana, sans-serif; font-size:10pt; } | border:1px solid white; font-family:Arial,Verdana, sans-serif; font-size:10pt; } | def __show_page(self, number): global current_log f = self.send_head() if f: f = StringIO() f.write(""" <html><head><title>SAGE Calculator %s</title></head>\n | 6cf90912d43b30422003f1adcb76e6bef700950d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/6cf90912d43b30422003f1adcb76e6bef700950d/server1.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
4500,
67,
2433,
12,
2890,
16,
1300,
4672,
2552,
783,
67,
1330,
284,
273,
365,
18,
4661,
67,
1978,
1435,
309,
284,
30,
284,
273,
15777,
1435,
284,
18,
2626,
2932,
3660,
411,
2620,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
4500,
67,
2433,
12,
2890,
16,
1300,
4672,
2552,
783,
67,
1330,
284,
273,
365,
18,
4661,
67,
1978,
1435,
309,
284,
30,
284,
273,
15777,
1435,
284,
18,
2626,
2932,
3660,
411,
2620,... |
if c == "<": data.previous() | if c in (">", None): | def getAttribute(self): """Return a name,value pair for the next attribute in the stream, if one is found, or None""" data = self.data c = data.skip(spaceCharactersBytes | frozenset("/")) if c == "<": data.previous() return None elif c == ">" or c is None: return None attrName = [] attrValue = [] spaceFound = False #Step 5 attribute name while True: if c == "=" and attrName: break elif c in spaceCharactersBytes: spaceFound=True break elif c in ("/", "<", ">"): return "".join(attrName), "" elif c in asciiUppercaseBytes: attrName.append(c.lower()) else: attrName.append(c) #Step 6 c = data.next() #Step 7 if spaceFound: c = data.skip() #Step 8 if c != "=": data.previous() return "".join(attrName), "" #XXX need to advance position in both spaces and value case #Step 9 data.next() #Step 10 c = data.skip() #Step 11 if c in ("'", '"'): #11.1 quoteChar = c while True: #11.3 c = data.next() if c == quoteChar: data.next() return "".join(attrName), "".join(attrValue) #11.4 elif c in asciiUppercaseBytes: attrValue.append(c.lower()) #11.5 else: attrValue.append(c) elif c in (">", "<"): return "".join(attrName), "" elif c in asciiUppercaseBytes: attrValue.append(c.lower()) elif c is None: return None else: attrValue.append(c) while True: c = data.next() if c in spacesAngleBrackets: return "".join(attrName), "".join(attrValue) elif c in asciiUppercaseBytes: attrValue.append(c.lower()) else: attrValue.append(c) | 47b430e43067ace9442912c2aa9932ccc94ad391 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9368/47b430e43067ace9442912c2aa9932ccc94ad391/inputstream.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4061,
12,
2890,
4672,
3536,
990,
279,
508,
16,
1132,
3082,
364,
326,
1024,
1566,
316,
326,
1407,
16,
309,
1245,
353,
1392,
16,
578,
599,
8395,
501,
273,
365,
18,
892,
276,
273,
501,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4061,
12,
2890,
4672,
3536,
990,
279,
508,
16,
1132,
3082,
364,
326,
1024,
1566,
316,
326,
1407,
16,
309,
1245,
353,
1392,
16,
578,
599,
8395,
501,
273,
365,
18,
892,
276,
273,
501,
... |
l.append(dowrap('<b>%s:</b> %s: %s/%s (%s)' % (translate('reference', 'Reference', as_unicode=1), ev.tracker, ev.ticketnum, ev.comment))) | l.append(dowrap('<b>%s:</b> %s/%s (%s)' % (translate('reference', 'Reference', as_unicode=1), ev.tracker, ev.ticketnum, ev.comment))) | def getFieldValue(issue, field): v = issue.getField(field).get(issue) if isinstance(v, StringType) or isinstance(v, UnicodeType): v = v.replace(chr(13), '') if isinstance(v, StringType): return unicode(v, collector.getSiteEncoding()) return v | cad63a42a87534ef0568850e7c31342349f93d87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1807/cad63a42a87534ef0568850e7c31342349f93d87/pdfwriter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26126,
12,
13882,
16,
652,
4672,
331,
273,
5672,
18,
588,
974,
12,
1518,
2934,
588,
12,
13882,
13,
309,
1549,
12,
90,
16,
31570,
13,
578,
1549,
12,
90,
16,
9633,
559,
4672,
331,
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,
26126,
12,
13882,
16,
652,
4672,
331,
273,
5672,
18,
588,
974,
12,
1518,
2934,
588,
12,
13882,
13,
309,
1549,
12,
90,
16,
31570,
13,
578,
1549,
12,
90,
16,
9633,
559,
4672,
331,
273,... |
We have a(15)=2 because 15 = 4+5+6 and 15 = 1+2+3+4+5. The number of odd divisors of 15 is 4. | We have a(15)=2 because 15 = 4+5+6 and 15 = 1+2+3+4+5. The number of odd divisors of 15 is 4. | def is_number_of_the_third_kind(self, n): r""" This function returns True if and only if $n$ is a number of the third kind. | 2c9ec0e9ee4b6a66dba3cad312fef1c27ffc8925 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/2c9ec0e9ee4b6a66dba3cad312fef1c27ffc8925/sloane_functions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
2696,
67,
792,
67,
5787,
67,
451,
6909,
67,
9224,
12,
2890,
16,
290,
4672,
436,
8395,
1220,
445,
1135,
1053,
309,
471,
1338,
309,
271,
82,
8,
353,
279,
1300,
434,
326,
12126... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
353,
67,
2696,
67,
792,
67,
5787,
67,
451,
6909,
67,
9224,
12,
2890,
16,
290,
4672,
436,
8395,
1220,
445,
1135,
1053,
309,
471,
1338,
309,
271,
82,
8,
353,
279,
1300,
434,
326,
12126... |
self.connected = 1 | self.connected = True | def __init__(self, sock=None, map=None): if map is None: self._map = socket_map else: self._map = map | e87588af659b5c8d8413dbb25e0c1afc0bc0e0ac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/e87588af659b5c8d8413dbb25e0c1afc0bc0e0ac/asyncore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
7313,
33,
7036,
16,
852,
33,
7036,
4672,
309,
852,
353,
599,
30,
365,
6315,
1458,
273,
2987,
67,
1458,
469,
30,
365,
6315,
1458,
273,
852,
2,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
7313,
33,
7036,
16,
852,
33,
7036,
4672,
309,
852,
353,
599,
30,
365,
6315,
1458,
273,
2987,
67,
1458,
469,
30,
365,
6315,
1458,
273,
852,
2,
-100,
-10... |
for nm in self.joint_nm_list: self.r_arm_pub_l.append(rospy.Publisher('r_'+nm+'_controller/command', Float64)) self.l_arm_angles = None self.l_arm_efforts = None for nm in self.joint_nm_list: self.l_arm_pub_l.append(rospy.Publisher('l_'+nm+'_controller/command', Float64)) | self.cur_traj = [None, None] self.cur_traj_timer = [None, None] self.cur_traj_pos = [None, None] | def __init__(self, send_delay=10000000, gripper_point=(0.23, 0.0, 0.0)): log("Loading SimpleArmTrajectory") self.joint_names_list = [['r_shoulder_pan_joint', 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint', 'r_elbow_flex_joint', 'r_forearm_roll_joint', 'r_wrist_flex_joint', 'r_wrist_roll_joint'], ['l_shoulder_pan_joint', 'l_shoulder_lift_joint', 'l_upper_arm_roll_joint', 'l_elbow_flex_joint', 'l_forearm_roll_joint', 'l_wrist_flex_joint', 'l_wrist_roll_joint']] | 3a682eff0bfca2c49f435a978c645b4e046ad110 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8117/3a682eff0bfca2c49f435a978c645b4e046ad110/simple_arm_trajectories.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1366,
67,
10790,
33,
21,
17877,
16,
314,
21335,
457,
67,
1153,
28657,
20,
18,
4366,
16,
374,
18,
20,
16,
374,
18,
20,
3719,
30,
613,
2932,
10515,
4477,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1366,
67,
10790,
33,
21,
17877,
16,
314,
21335,
457,
67,
1153,
28657,
20,
18,
4366,
16,
374,
18,
20,
16,
374,
18,
20,
3719,
30,
613,
2932,
10515,
4477,... |
which sends p[k] to a*p[k]. | which sends $p[k]$ to $a*p[k]$. | def theta(self,a): """ Returns the image of self under the theta automorphism which sends p[k] to a*p[k]. | dea582761431c29dffb004fbfbdb128d545fd352 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/dea582761431c29dffb004fbfbdb128d545fd352/sfa.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7338,
12,
2890,
16,
69,
4672,
3536,
2860,
326,
1316,
434,
365,
3613,
326,
7338,
18472,
7657,
6228,
1492,
9573,
293,
63,
79,
65,
358,
279,
14,
84,
63,
79,
8009,
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,
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,
7338,
12,
2890,
16,
69,
4672,
3536,
2860,
326,
1316,
434,
365,
3613,
326,
7338,
18472,
7657,
6228,
1492,
9573,
293,
63,
79,
65,
358,
279,
14,
84,
63,
79,
8009,
2,
-100,
-100,
-100,
-... |
"Attempt to read ZIP archive that was already closed" | "Attempt to read ZIP archive that was already closed" | def read(self, name): "Return file bytes (as a string) for name" if self.mode not in ("r", "a"): raise RuntimeError, 'read() requires mode "r" or "a"' if not self.fp: raise RuntimeError, \ "Attempt to read ZIP archive that was already closed" zinfo = self.getinfo(name) filepos = self.fp.tell() self.fp.seek(zinfo.file_offset, 0) bytes = self.fp.read(zinfo.compress_size) self.fp.seek(filepos, 0) if zinfo.compress_type == ZIP_STORED: pass elif zinfo.compress_type == ZIP_DEFLATED: if not zlib: raise RuntimeError, \ "De-compression requires the (missing) zlib module" # zlib compress/decompress code by Jeremy Hylton of CNRI dc = zlib.decompressobj(-15) bytes = dc.decompress(bytes) # need to feed in unused pad byte so that zlib won't choke ex = dc.decompress('Z') + dc.flush() if ex: bytes = bytes + ex else: raise BadZipfile, \ "Unsupported compression method %d for file %s" % \ (zinfo.compress_type, name) crc = binascii.crc32(bytes) if crc != zinfo.CRC: raise BadZipfile, "Bad CRC-32 for file %s" % name return bytes | 7e00393d38ad3fc1e6c2d72edde707f0918ae9a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/7e00393d38ad3fc1e6c2d72edde707f0918ae9a8/zipfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
12,
2890,
16,
508,
4672,
315,
990,
585,
1731,
261,
345,
279,
533,
13,
364,
508,
6,
309,
365,
18,
3188,
486,
316,
7566,
86,
3113,
315,
69,
6,
4672,
1002,
7265,
16,
296,
896,
14... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
12,
2890,
16,
508,
4672,
315,
990,
585,
1731,
261,
345,
279,
533,
13,
364,
508,
6,
309,
365,
18,
3188,
486,
316,
7566,
86,
3113,
315,
69,
6,
4672,
1002,
7265,
16,
296,
896,
14... |
- ``labels`` - if False, each edge is a tuple (u,v) of | - ``labels`` - if ``False``, each edge is a tuple `(u,v)` of | def edge_boundary(self, vertices1, vertices2=None, labels=True): """ Returns a list of edges (u,v,l) with u in vertices1 and v in vertices2. If vertices2 is None, then it is set to the complement of vertices1. In a digraph, the external boundary of a vertex v are those vertices u with an arc (v, u). INPUT: - ``labels`` - if False, each edge is a tuple (u,v) of vertices. EXAMPLES:: sage: K = graphs.CompleteBipartiteGraph(9,3) sage: len(K.edge_boundary( [0,1,2,3,4,5,6,7,8], [9,10,11] )) 27 sage: K.size() 27 Note that the edge boundary preserves direction:: sage: K = graphs.CompleteBipartiteGraph(9,3).to_directed() sage: len(K.edge_boundary( [0,1,2,3,4,5,6,7,8], [9,10,11] )) 27 sage: K.size() 54 :: sage: D = DiGraph({0:[1,2], 3:[0]}) sage: D.edge_boundary([0]) [(0, 1, None), (0, 2, None)] sage: D.edge_boundary([0], labels=False) [(0, 1), (0, 2)] """ vertices1 = [v for v in vertices1 if v in self] output = [] if self._directed: output.extend(self.outgoing_edge_iterator(vertices1,labels=labels)) else: output.extend(self.edge_iterator(vertices1,labels=labels)) if vertices2 is not None: output = [e for e in output if (e[1] in vertices2 or e[0] in vertices2) ] else: output = [e for e in output if (e[1] not in vertices1 or e[0] not in vertices1)] return output | fd44ff72780d9960c9cea755d7ae51166bd005a3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/fd44ff72780d9960c9cea755d7ae51166bd005a3/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3591,
67,
16604,
12,
2890,
16,
6928,
21,
16,
6928,
22,
33,
7036,
16,
3249,
33,
5510,
4672,
3536,
2860,
279,
666,
434,
5231,
261,
89,
16,
90,
16,
80,
13,
598,
582,
316,
6928,
21,
47... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3591,
67,
16604,
12,
2890,
16,
6928,
21,
16,
6928,
22,
33,
7036,
16,
3249,
33,
5510,
4672,
3536,
2860,
279,
666,
434,
5231,
261,
89,
16,
90,
16,
80,
13,
598,
582,
316,
6928,
21,
47... |
return retval + " --ldaploadcert=" + self.ldapCert | return retval + " --ldaploadcacert=" + self.ldapCert | def return_data(self): if self.enabled == 0: return "" elif self.ldapServer == "" or self.ldapDN == "": return "" else: retval = " --enableldap --enableldapauth --ldapserver=" + self.ldapServer + " --ldapbasedn=" + self.ldapDN | 15668e754a445736f142e847116e561506d5b359 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5376/15668e754a445736f142e847116e561506d5b359/auth.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
327,
67,
892,
12,
2890,
4672,
309,
365,
18,
5745,
422,
374,
30,
327,
1408,
1327,
365,
18,
14394,
2081,
422,
1408,
578,
365,
18,
14394,
8609,
422,
1408,
30,
327,
1408,
469,
30,
5221,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
327,
67,
892,
12,
2890,
4672,
309,
365,
18,
5745,
422,
374,
30,
327,
1408,
1327,
365,
18,
14394,
2081,
422,
1408,
578,
365,
18,
14394,
8609,
422,
1408,
30,
327,
1408,
469,
30,
5221,
... |
if ( selector == weNewHandler ) handler = upp_new_handler; else if ( selector == weDisposeHandler ) handler = upp_dispose_handler; else if ( selector == weDrawHandler ) handler = upp_draw_handler; else if ( selector == weClickHandler ) handler = upp_click_handler; | if ( selector == weNewHandler ) handler = (UniversalProcPtr)upp_new_handler; else if ( selector == weDisposeHandler ) handler = (UniversalProcPtr)upp_dispose_handler; else if ( selector == weDrawHandler ) handler = (UniversalProcPtr)upp_draw_handler; else if ( selector == weClickHandler ) handler = (UniversalProcPtr)upp_click_handler; | def outputCheckNewArg(self): Output("""if (itself == NULL) { Py_INCREF(Py_None); return Py_None; }""") | 25241d99785698072e6952b37da79b7f441c4b9d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/25241d99785698072e6952b37da79b7f441c4b9d/wastesupport.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
876,
1564,
1908,
4117,
12,
2890,
4672,
3633,
2932,
3660,
430,
261,
1282,
19079,
422,
3206,
13,
288,
4707,
67,
706,
5458,
42,
12,
9413,
67,
7036,
1769,
327,
4707,
67,
7036,
31,
289,
366... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
876,
1564,
1908,
4117,
12,
2890,
4672,
3633,
2932,
3660,
430,
261,
1282,
19079,
422,
3206,
13,
288,
4707,
67,
706,
5458,
42,
12,
9413,
67,
7036,
1769,
327,
4707,
67,
7036,
31,
289,
366... |
AVFileReader('/home/james/Videos/Okra - 79b,100.avi'), 0, True ) ) | AVFileReader('/home/james/Videos/Okra - 79b,100.avi'), 0, False ) ) | def createVideoWidget(): widget = VideoWidget(clock, Pulldown23RemovalFilter( AVFileReader('/home/james/Videos/Okra - 79b,100.avi'), 0, True ) ) widget.drawingArea().show() # Temporary hack to keep the container object around widget.drawingArea().myobj = widget return widget.drawingArea() | 14701b6d36bef642df79ac9ae13addd1500b78ff /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10170/14701b6d36bef642df79ac9ae13addd1500b78ff/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
10083,
4609,
13332,
3604,
273,
14030,
4609,
12,
18517,
16,
14899,
2378,
4366,
24543,
1586,
12,
15068,
812,
2514,
2668,
19,
8712,
19,
78,
753,
19,
58,
19871,
19,
8809,
354,
300,
2651... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
10083,
4609,
13332,
3604,
273,
14030,
4609,
12,
18517,
16,
14899,
2378,
4366,
24543,
1586,
12,
15068,
812,
2514,
2668,
19,
8712,
19,
78,
753,
19,
58,
19871,
19,
8809,
354,
300,
2651... |
y = y.T resultDict = {} ac = 0 for i, v in enumerate(self.Variables): resultDict[v] = y[ac:ac+self.varSizes[i]] ac += self.varSizes[i] | resultDict = dict(self.ooT.vector2point(y.T)) | def solve(self, *args): # mb for future implementation - add some **kwargs here as well if len(args) > 0: raise FuncDesignerException('no args are currently available for the function ode::solve') try: from scipy import integrate except: raise FuncDesignerException('to solve ode you mush have scipy installed, see scipy.org') y, infodict = integrate.odeint(self.func, self.y0, self.timeArray, Dfun = self.derivative, full_output=True) y = y.T resultDict = {} ac = 0 for i, v in enumerate(self.Variables): resultDict[v] = y[ac:ac+self.varSizes[i]] ac += self.varSizes[i] #y = hstack((y, zeros((len(self.timeArray), 1)))) #resultDict = dict(self.ooT.vector2point(y.T)) | 86780e6a1c8ff8db89bad73d3145404217dc7c42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6196/86780e6a1c8ff8db89bad73d3145404217dc7c42/ode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12439,
12,
2890,
16,
380,
1968,
4672,
468,
4903,
364,
3563,
4471,
300,
527,
225,
2690,
2826,
4333,
2674,
487,
5492,
309,
562,
12,
1968,
13,
405,
374,
30,
1002,
6165,
15478,
264,
503,
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,
12439,
12,
2890,
16,
380,
1968,
4672,
468,
4903,
364,
3563,
4471,
300,
527,
225,
2690,
2826,
4333,
2674,
487,
5492,
309,
562,
12,
1968,
13,
405,
374,
30,
1002,
6165,
15478,
264,
503,
2... |
"""Top level function for calculating a Wcs. | """Top level function for calculating a Wcs. | def determineWcs(policy, exposure, sourceSet, log=None, solver=None, doTrim=False, forceImageSize=None): """Top level function for calculating a Wcs. Given an initial guess at a Wcs (hidden inside an exposure) and a set of sources (sourceSet), use astrometry.net to confirm the Wcs, then calculate distortion terms. Input: policy: An lsst.pex.policy.Policy object containing the parameters for the solver exposure lsst.afw.image.Exposure representation of an image and a wcs this provides the initial guess at position and plate scale sourceSet A list of lsst.afw.detection.Source objects, indicating the pixel positions of stars in the field log A lsst.pex.logging.Log object (optional), used for printing progress doTrim Check that all sources lie within the image, and remove those that don't. solver Optionally provide a previously created astrometry.net solver. If not provided one will be created. forceImageSize tuple of (W,H): force this image size, rather than getting it from the Exposure. """ if log is None: #log = StdoutLog() #Write log messages to stdout log = Log.getDefaultLog() log.log(Log.INFO, "In determineWcs") #Short names exp = exposure srcSet = sourceSet if display: frame = 1 ds9.mtv(exposure, frame=frame, title="wcsDet") if doTrim: nStart = len(srcSet) srcSet = trimBadPoints(exp, srcSet) if log: nEnd = len(srcSet) log.log(log.DEBUG, "Kept %i of %i sources after trimming" %(nEnd, nStart)) if display: for s in srcSet: ds9.dot("o", s.getXAstrom(), s.getYAstrom(), size=3, ctype=ds9.RED, frame=frame) #Extract an initial guess wcs if available wcsIn = exp.getWcs() #May be None # Exposure uses the special object "NoWcs" instead of NULL. Because they're special. haswcs = exp.hasWcs() if not haswcs: log.log(log.WARN, "No wcs found on exposure. Doing blind solve") #Setup solver if solver is None: path=os.path.join(os.environ['ASTROMETRY_NET_DATA_DIR'], "metadata.paf") solver = astromNet.GlobalAstrometrySolution(path, log) matchThreshold = policy.get('matchThreshold') solver.setMatchThreshold(matchThreshold) else: solver.reset() #Set solving params log.log(log.DEBUG, "Setting starlist") solver.setStarlist(srcSet) log.log(log.DEBUG, "Setting numBrightObj") solver.setNumBrightObjects( min(policy.get('numBrightStars'), len(srcSet))) if forceImageSize is not None: (W,H) = forceImageSize else: (W,H) = (exp.getWidth(), exp.getHeight()) solver.setImageSize(W, H) solver.setLogLevel(2) #solver.printSolverSettings(stdout) # FIXME -- add policy entry for this... #dscale = policy.get('pixelScaleUncertainty') dscale = None #Do a blind solve if we're told to, or if we don't have an input wcs doBlindSolve = policy.get('blindSolve') or (not haswcs) if doBlindSolve: log.log(log.DEBUG, "Solving with no initial guess at position") isSolved = solver.solve() elif dscale is not None: isSolved = solver.solve(wcsIn, dscale) else: isSolved = solver.solve(wcsIn) #Did we solve? log.log(log.DEBUG, "Finished Solve step.") if not isSolved: log.log(log.WARN, "No solution found, using input Wcs") return [], wcsIn wcs = solver.getWcs() # # Generate a list of catalogue objects in the field. # #First obtain the catalogue-listed positions of stars log.log(log.DEBUG, "Determining match objects") imgSizeInArcsec = wcs.pixelScale() * hypot(W,H) #Do we want magnitude information filterName = chooseFilterName(exposure, policy, solver, log) try: cat = solver.getCatalogue(2*imgSizeInArcsec, filterName) except LsstCppException, e: log.log(Log.WARN, str(e)) log.log(Log.WARN, "Attempting to access catalogue positions and fluxes") version = os.environ['ASTROMETRY_NET_DATA_DIR'] log.log(Log.WARN, "Catalogue version: %s" %(version)) log.log(Log.WARN, "Requested filter: %s" %(filterName)) log.log(Log.WARN, "Available filters: " + str(solver.getCatalogueMetadataFields())) raise matchList=[] #Make sure this stays in scope if True: #Now generate a list of matching objects distInArcsec = policy.get('distanceForCatalogueMatchinArcsec') cleanParam = policy.get('cleaningParameter') matchList = matchSrcAndCatalogue(cat=cat, img=srcSet, wcs=wcs, distInArcsec=distInArcsec, cleanParam=cleanParam) uniq = set([sm.second.getId() for sm in matchList]) if len(matchList) != len(uniq): log.log(Log.WARN, "The list of matches stars contains duplicated reference sources (%i sources, %i unique ids)" % (len(matchList), len(uniq))) if len(matchList) == 0: log.log(Log.WARN, "No matches found between input source and catalogue.") log.log(Log.WARN, "Something in wrong. Defaulting to input wcs") return [], wcsIn log.log(Log.DEBUG, "%i catalogue objects match input source list using linear Wcs" %(len(matchList))) else: #Use list of matches returned by astrometry.net log.log(Log.DEBUG, "Getting matched sources: Fluxes in band %s " %(filterName)) matchList = solver.getMatchedSources(filterName) if policy.get('calculateSip'): sipOrder = policy.get('sipOrder') wcs, matchList = calculateSipTerms(wcs, cat, srcSet, distInArcsec, cleanParam, sipOrder, log) else: log.log(Log.DEBUG, "Updating wcs in input exposure with linear wcs") exposure.setWcs(wcs) #solver.reset() if display: for s1, s2, d in matchList: # plot the catalogue positions ds9.dot("+", s1.getXAstrom(), s1.getYAstrom(), size=3, ctype=ds9.BLUE, frame=frame) return [matchList, wcs] | 684b3a5387671c1befd6e88a491a5a10992a7c05 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6522/684b3a5387671c1befd6e88a491a5a10992a7c05/determineWcs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4199,
59,
2143,
12,
5086,
16,
14620,
16,
1084,
694,
16,
613,
33,
7036,
16,
12776,
33,
7036,
16,
741,
14795,
33,
8381,
16,
2944,
28576,
33,
7036,
4672,
3536,
3401,
1801,
445,
364,
21046... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4199,
59,
2143,
12,
5086,
16,
14620,
16,
1084,
694,
16,
613,
33,
7036,
16,
12776,
33,
7036,
16,
741,
14795,
33,
8381,
16,
2944,
28576,
33,
7036,
4672,
3536,
3401,
1801,
445,
364,
21046... |
for field in defaults.keys(): fld_def = (field in self._columns) and self._columns[field] \ or self._inherit_fields[field][2] if fld_def._type in ('many2one', 'one2one'): if isinstance(defaults[field], (list, tuple)): vals[field] = defaults[field][0] else: vals[field] = defaults[field] else: vals[field] = defaults[field] | vals.update(self.__clean_defaults(defaults)) | def create(self, cursor, user, vals, context=None): """ cursor = database cursor user = user id vals = dictionary of the form {'field_name': field_value, ...} """ if self._table_query: return False | a96cf64513fc4441a3b98a8ec036ca90c333f46d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9266/a96cf64513fc4441a3b98a8ec036ca90c333f46d/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2890,
16,
3347,
16,
729,
16,
5773,
16,
819,
33,
7036,
4672,
3536,
3347,
273,
2063,
3347,
729,
273,
729,
612,
5773,
273,
3880,
434,
326,
646,
13666,
1518,
67,
529,
4278,
652,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2890,
16,
3347,
16,
729,
16,
5773,
16,
819,
33,
7036,
4672,
3536,
3347,
273,
2063,
3347,
729,
273,
729,
612,
5773,
273,
3880,
434,
326,
646,
13666,
1518,
67,
529,
4278,
652,
... |
this = apply(_quickfix.new_LegOptionRatio, args) | this = _quickfix.new_LegOptionRatio(*args) | def __init__(self, *args): this = apply(_quickfix.new_LegOptionRatio, 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,
8329,
1895,
8541,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
8329,
1895,
8541,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
30,
... |
if self.Optional == True : if Filename == None or Filename =='': GenFdsGlobalVariable.VerboseLogger( "Optional Section don't exist!") return '', None | def GenSection(self, OutputPath, ModuleName, SecNum, KeyStringList, FfsInf = None) : """Prepare the parameter of GenSection""" if FfsInf != None : InfFileName = FfsInf.InfFileName SectionType = FfsInf.__ExtendMarco__(self.SectionType) Filename = FfsInf.__ExtendMarco__(self.FileName) """print 'Buile Num: %s' %self.BuildNum""" BuildNum = FfsInf.__ExtendMarco__(self.BuildNum) """print 'After extend Build Num: %s' %self.BuildNum""" """print 'version Num: %s' %self.VersionNum""" VersionNum = FfsInf.__ExtendMarco__(self.VersionNum) """print 'After extend Version Num: %s' %self.VersionNum""" StringData = FfsInf.__ExtendMarco__(self.StringData) else: SectionType = self.SectionType Filename = self.Filename BuildNum = self.BuildNum VerstionNum = self.VersionNum InfFileName = '' if self.Optional == True : if Filename == None or Filename =='': GenFdsGlobalVariable.VerboseLogger( "Optional Section don't exist!") return '', None FileList, IsSect = Section.Section.GetFileList(FfsInf, self.FileType, self.FileExtension) if IsSect : return FileList, self.Alignment | 184406f960c02da0b957160a62999cf6950f3780 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/914/184406f960c02da0b957160a62999cf6950f3780/EfiSection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10938,
5285,
12,
2890,
16,
3633,
743,
16,
5924,
461,
16,
3232,
2578,
16,
1929,
780,
682,
16,
478,
2556,
13149,
273,
599,
13,
294,
3536,
7543,
326,
1569,
434,
10938,
5285,
8395,
309,
47... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10938,
5285,
12,
2890,
16,
3633,
743,
16,
5924,
461,
16,
3232,
2578,
16,
1929,
780,
682,
16,
478,
2556,
13149,
273,
599,
13,
294,
3536,
7543,
326,
1569,
434,
10938,
5285,
8395,
309,
47... | |
tau_err*period*1e6, centre_freq, \ | tau_err*period*1e6, midfreq, \ | def write_toa(summed_pulse, polycos, template_profile, \ timeseries, start_phase=0.0): """Given a SummedPulse generate a TOA and write it to stdout. A polycos file is required. 'template_profile' is simply a numpy array. 'timeseries' is a Datfile object. 'start_phase' is the phase at the start of the profile. """ if template_profile is None: raise ValueError("A template profile MUST be provided.") # This code is taken from Scott Ransom's PRESTO's get_TOAs.py mjdi = int(summed_pulse.mjd) # integer part of MJD mjdf = summed_pulse.mjd - mjdi # fractional part of MJD (phs, freq) = polycos.get_phs_and_freq(mjdi, mjdf) phs -= start_phase period = 1.0/freq # Caclulate offset due to shifting channels to account for DM hifreq = timeseries.infdata.lofreq - timeseries.infdata.chan_width/2.0 + \ timeseries.infdata.BW midfreq = timeseries.infdata.lofreq + timeseries.infdata.BW/2.0 dmdelay = psr_utils.delay_from_DM(timeseries.infdata.DM, midfreq) - \ psr_utils.delay_from_DM(timeseries.infdata.DM, hifreq) dmdelay_mjd = dmdelay/float(psr_utils.SECPERDAY) t0f = mjdf - phs*period/psr_utils.SECPERDAY + dmdelay_mjd t0i = mjdi shift,eshift,snr,esnr,b,errb,ngood = measure_phase(summed_pulse.profile, \ template_profile) # tau and tau_err are the predicted phase of the pulse arrival tau, tau_err = shift/summed_pulse.N, eshift/summed_pulse.N # Note: "error" flags are shift = 0.0 and eshift = 999.0 if (np.fabs(shift) < 1e-7 and np.fabs(eshift-999.0) < 1e-7): raise FFTFitError("Error in FFTFIT. Bad return values.") # Send the TOA to STDOUT toaf = t0f + tau*period/float(psr_utils.SECPERDAY) newdays = int(np.floor(toaf)) centre_freq = timeseries.infdata.lofreq + timeseries.infdata.chan_width * \ timeseries.infdata.numchan/2.0 obs_code = telescopes.telescope_to_id[timeseries.infdata.telescope] psr_utils.write_princeton_toa(t0i+newdays, toaf-newdays, \ tau_err*period*1e6, centre_freq, \ timeseries.infdata.DM, obs=obs_code) | e6a4e8efe30ac55a66af024075ebbda1dcb3c7b4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3485/e6a4e8efe30ac55a66af024075ebbda1dcb3c7b4/dissect.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
12799,
12,
1364,
2937,
67,
84,
24667,
16,
7573,
14445,
16,
1542,
67,
5040,
16,
521,
18677,
16,
787,
67,
13961,
33,
20,
18,
20,
4672,
3536,
6083,
279,
9352,
2937,
52,
24667,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12799,
12,
1364,
2937,
67,
84,
24667,
16,
7573,
14445,
16,
1542,
67,
5040,
16,
521,
18677,
16,
787,
67,
13961,
33,
20,
18,
20,
4672,
3536,
6083,
279,
9352,
2937,
52,
24667,
... |
return request_callback(CRAWLER_SEEDINGSTATS_QUERY, cPickle.dumps(["SELECT * FROM SeedingStats WHERE crawled = 0 and timestamp BETWEEN %s and %s ORDER BY timestamp DESC"%(0, time()), 'UPDATE SeedingStats SET crawled=1 WHERE crawled=0 and timestamp <=0'])) | read_query = "SELECT * FROM SeedingStats WHERE crawled = 0 and timestamp BETWEEN %s and %s ORDER BY timestamp DESC" % (0, time()) write_query = 'UPDATE SeedingStats SET crawled=1 WHERE crawled=0 and timestamp <=0' return request_callback(CRAWLER_SEEDINGSTATS_QUERY, cPickle.dumps([("read", read_query), ("write", write_query)])) | def query_initiator(self, permid, selversion, request_callback): """ Established a new connection. Send a CRAWLER_DATABASE_QUERY request. @param permid The Tribler peer permid @param selversion The oberlay protocol version @param request_callback Call this function one or more times to send the requests: request_callback(message_id, payload) """ if DEBUG: print >>sys.stderr, "crawler: SeedingStatsDB_update_settings_initiator" try: sql_query = "SELECT MAX(timestamp) FROM SeedingStats WHERE permID='%s' ORDER BY timestamp DESC"%bin2str(permid) cursor = self._sqlite_cache_db.execute_read(sql_query) except: print_exc() else: if cursor: res = list(cursor)[0][0] if res is not None: return request_callback(CRAWLER_SEEDINGSTATS_QUERY, cPickle.dumps(["SELECT * FROM SeedingStats WHERE crawled = 0 and timestamp BETWEEN %s and %s ORDER BY timestamp DESC"%(res[0][0], time()), 'UPDATE SeedingStats SET crawled=1 WHERE crawled=0 and timestamp <=%s'%res])) else: return request_callback(CRAWLER_SEEDINGSTATS_QUERY, cPickle.dumps(["SELECT * FROM SeedingStats WHERE crawled = 0 and timestamp BETWEEN %s and %s ORDER BY timestamp DESC"%(0, time()), 'UPDATE SeedingStats SET crawled=1 WHERE crawled=0 and timestamp <=0'])) | 34244b2f74d46ab016eb11199f942371f4603706 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9686/34244b2f74d46ab016eb11199f942371f4603706/SeedingStatsCrawler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
843,
67,
2738,
10620,
12,
2890,
16,
4641,
350,
16,
357,
1589,
16,
590,
67,
3394,
4672,
3536,
17787,
9237,
5992,
279,
394,
1459,
18,
2479,
279,
385,
10821,
14668,
67,
22366,
67,
10753,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
843,
67,
2738,
10620,
12,
2890,
16,
4641,
350,
16,
357,
1589,
16,
590,
67,
3394,
4672,
3536,
17787,
9237,
5992,
279,
394,
1459,
18,
2479,
279,
385,
10821,
14668,
67,
22366,
67,
10753,
... |
(2*13 + O(13^7))*t^2 + (13 + O(13^8))*t + (O(13^7)) | (O(13^7))*t^4 + (2*13 + O(13^7))*t^2 + (13 + O(13^8))*t + (O(13^7)) | def _add_(self, right): """ Returns the sum of self and right. | e9e01a8904ca94f7994c723cd54a5100787e8a31 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/e9e01a8904ca94f7994c723cd54a5100787e8a31/polynomial_padic_capped_relative_dense.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1289,
67,
12,
2890,
16,
2145,
4672,
3536,
2860,
326,
2142,
434,
365,
471,
2145,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1289,
67,
12,
2890,
16,
2145,
4672,
3536,
2860,
326,
2142,
434,
365,
471,
2145,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
users_base = self.users_base | def _lookupuserbyattr(self, name, value, pwd=None): """ returns a record's DN and the groups a uid belongs to as well as a dictionary containing user attributes """ if name == 'dn': if value.find(',') == -1: # micro-optimization: this is not a valid dn because it # doesn't contain any commas; don't bother trying to look it # up msg = '_lookupuserbyattr: not a valid dn "%s"' % value logger.debug(msg) return None, None, None, None | b8fbf1bf5c66363ac4dffa4c0a414ccd0acc76ef /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1858/b8fbf1bf5c66363ac4dffa4c0a414ccd0acc76ef/LDAPUserFolder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8664,
1355,
1637,
1747,
12,
2890,
16,
508,
16,
460,
16,
14720,
33,
7036,
4672,
3536,
1135,
279,
1409,
1807,
18001,
471,
326,
3252,
279,
4555,
11081,
358,
487,
5492,
487,
279,
3880,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8664,
1355,
1637,
1747,
12,
2890,
16,
508,
16,
460,
16,
14720,
33,
7036,
4672,
3536,
1135,
279,
1409,
1807,
18001,
471,
326,
3252,
279,
4555,
11081,
358,
487,
5492,
487,
279,
3880,
... | |
spaceline = spaceline.replace('\'s', ' s') | def display_summary(self, rec, paramDict, proxInfo=None, highlight=1): global nonAsciiRe, asciiFriendly, overescapedAmpRe, unescapeCharent recid = rec.id self.logger.log('Summary requested for record: %s' % (recid)) # highlight search terms in rec.sax if (proxInfo) and highlight: nodeIdxs = proxInfo[::2] wordIdxs = proxInfo[1::2] xps = {} tree = rec.dom.getroottree() walker = rec.dom.getiterator() for x, n in enumerate(walker): if x in nodeIdxs: xps[x] = tree.getpath(n) for x, ni in enumerate(nodeIdxs): wi = wordIdxs[x] wordCount = 0 xp = xps[ni] el = rec.dom.xpath(xp)[0] located = None for c in el.getiterator(): if c.text: spaceline = punctuationRe.sub(' ', c.text) spaceline = spaceline.replace('\'s', ' s') # Words ending in 's are treated as 2 words in proximityInfo - make it so! words = wordRe.findall(spaceline) try: start = sum(map(len, words[:wi - wordCount])) end = start + len(words[wi - wordCount]) except IndexError: wordCount += len(words) else: located = 'text' break if c.tail: spaceline = punctuationRe.sub(' ', c.tail) spaceline = spaceline.replace('\'s', ' s') # Words ending in 's are treated as 2 words in proximityInfo - make it so! words = wordRe.findall(spaceline) try: start = sum(map(len, words[:wi - wordCount])) end = start + len(words[wi - wordCount]) except IndexError: wordCount += len(words) else: located = 'tail' break if located: wp = 0 while words[wi - wordCount][wp] == ' ': wp += 1 start += wp if located == 'text': c.text = c.text[:start] + 'HGHLGHT' + c.text[start:end] + 'THGLHGH' + c.text[end:] elif located == 'tail': c.tail = c.tail[:start] + 'HGHLGHT' + c.tail[start:end] + 'THGLHGH' + c.tail[end:] else: # woops something went seriously wrong raise ValueError(located) | 51c4864bb9efdde7305f1cca91b49e2220b7771c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11263/51c4864bb9efdde7305f1cca91b49e2220b7771c/eadSearchHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2562,
67,
7687,
12,
2890,
16,
1950,
16,
579,
5014,
16,
8617,
966,
33,
7036,
16,
8839,
33,
21,
4672,
2552,
1661,
21363,
426,
16,
11384,
19730,
16,
1879,
16502,
26895,
426,
16,
15568,
78... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2562,
67,
7687,
12,
2890,
16,
1950,
16,
579,
5014,
16,
8617,
966,
33,
7036,
16,
8839,
33,
21,
4672,
2552,
1661,
21363,
426,
16,
11384,
19730,
16,
1879,
16502,
26895,
426,
16,
15568,
78... | |
a = [safe_utf8(i) for i in self._parseField(self.oldValue)] b = [safe_utf8(i) for i in self._parseField(self.newValue)] | a = [safe_unicode(i) for i in self._parseField(self.oldValue)] b = [safe_unicode(i) for i in self._parseField(self.newValue)] | def html_diff(self, context=True, wrapcolumn=40): """Return an HTML table showing differences""" # difflib is not Unicode-aware, so we need to force everything to # utf-8 manually a = [safe_utf8(i) for i in self._parseField(self.oldValue)] b = [safe_utf8(i) for i in self._parseField(self.newValue)] vis_diff = difflib.HtmlDiff(wrapcolumn=wrapcolumn) diff = vis_diff.make_table( a, b, safe_utf8(self.id1), safe_utf8(self.id2), context=context) return diff | db7dab53a4b5309102e3d2a1f624eec1341907d0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11957/db7dab53a4b5309102e3d2a1f624eec1341907d0/TextDiff.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1729,
67,
5413,
12,
2890,
16,
819,
33,
5510,
16,
2193,
2827,
33,
7132,
4672,
3536,
990,
392,
3982,
1014,
17253,
16440,
8395,
468,
1901,
12678,
353,
486,
9633,
17,
30799,
16,
1427,
732,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1729,
67,
5413,
12,
2890,
16,
819,
33,
5510,
16,
2193,
2827,
33,
7132,
4672,
3536,
990,
392,
3982,
1014,
17253,
16440,
8395,
468,
1901,
12678,
353,
486,
9633,
17,
30799,
16,
1427,
732,
... |
INSERT INTO CacheContents VALUES(NULL, ?, ?, ?, ?, ?, ?, ?) | INSERT INTO CacheContents VALUES(NULL, ?, ?, ?, ?, ?, ?, ?, ?) | def addEntry(self, item, withFiles): (name, (oldVersion, oldFlavor), (newVersion, newFlavor), absolute) = \ item | c1fb30ff97c24803d5cb35db4bc1d6376529b6fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/c1fb30ff97c24803d5cb35db4bc1d6376529b6fa/netserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
1622,
12,
2890,
16,
761,
16,
598,
2697,
4672,
261,
529,
16,
261,
1673,
1444,
16,
1592,
2340,
9444,
3631,
261,
2704,
1444,
16,
394,
2340,
9444,
3631,
4967,
13,
273,
521,
761,
2,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
1622,
12,
2890,
16,
761,
16,
598,
2697,
4672,
261,
529,
16,
261,
1673,
1444,
16,
1592,
2340,
9444,
3631,
261,
2704,
1444,
16,
394,
2340,
9444,
3631,
4967,
13,
273,
521,
761,
2,
... |
tests_are_present=True, overrides=overrides_str) | tests_are_present=False, overrides=overrides_str) | def skipped_layout_tests(self, extra_test_files=None): expectations_str = self.test_expectations() overrides_str = self.test_expectations_overrides() test_platform_name = self.test_platform_name() is_debug_mode = False | 9a282cb2ff2dacf0a874503f1d01aa9103b4e6b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/9a282cb2ff2dacf0a874503f1d01aa9103b4e6b3/chromium.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9700,
67,
6741,
67,
16341,
12,
2890,
16,
2870,
67,
3813,
67,
2354,
33,
7036,
4672,
26305,
67,
701,
273,
365,
18,
3813,
67,
12339,
1012,
1435,
9515,
67,
701,
273,
365,
18,
3813,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9700,
67,
6741,
67,
16341,
12,
2890,
16,
2870,
67,
3813,
67,
2354,
33,
7036,
4672,
26305,
67,
701,
273,
365,
18,
3813,
67,
12339,
1012,
1435,
9515,
67,
701,
273,
365,
18,
3813,
67,
1... |
gotone, evt = Evt.WaitNextEvent(-1, 0) | gotone, evt = Evt.WaitNextEvent(0xffff, 0) | def main(): print 'hello world' # XXXX # skip the toolbox initializations, already done # XXXX Should use gestalt here to check for quicktime version Qt.EnterMovies() # Get the movie file fss, ok = macfs.StandardGetFile(QuickTime.MovieFileType) if not ok: sys.exit(0) # Open the window bounds = (175, 75, 175+160, 75+120) theWindow = Win.NewCWindow(bounds, fss.as_tuple()[2], 0, 0, -1, 1, 0) # XXXX Needed? SetGWorld((CGrafPtr)theWindow, nil) Qd.SetPort(theWindow) # Get the movie theMovie = loadMovie(fss) # Relocate to (0, 0) bounds = theMovie.GetMovieBox() bounds = 0, 0, bounds[2]-bounds[0], bounds[3]-bounds[1] theMovie.SetMovieBox(bounds) # Create a controller theController = theMovie.NewMovieController(bounds, QuickTime.mcTopLeftMovie) # Get movie size and update window parameters rv, bounds = theController.MCGetControllerBoundsRect() theWindow.SizeWindow(bounds[2], bounds[3], 0) # XXXX or [3] [2]? Qt.AlignWindow(theWindow, 0) theWindow.ShowWindow() # XXXX MCDoAction(theController, mcActionSetGrowBoxBounds, &maxBounds) theController.MCDoAction(QuickTime.mcActionSetKeysEnabled, '1') # XXXX MCSetActionFilterWithRefCon(theController, movieControllerEventFilter, (long)theWindow) done = 0 while not done: gotone, evt = Evt.WaitNextEvent(-1, 0) (what, message, when, where, modifiers) = evt | c4b8eb34876119e4f3429849fee5be26abd5906b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/c4b8eb34876119e4f3429849fee5be26abd5906b/VerySimplePlayer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
1172,
296,
23711,
9117,
11,
468,
11329,
60,
468,
2488,
326,
5226,
2147,
2172,
7089,
16,
1818,
2731,
468,
11329,
60,
9363,
999,
314,
395,
2390,
2674,
358,
866,
364,
9549,
957... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1172,
296,
23711,
9117,
11,
468,
11329,
60,
468,
2488,
326,
5226,
2147,
2172,
7089,
16,
1818,
2731,
468,
11329,
60,
9363,
999,
314,
395,
2390,
2674,
358,
866,
364,
9549,
957... |
self.atomicnumber = [] | atomicnumber = [] | def process_element(self, element): "Extract atomic number from element" # The types that can be converted to Elements: integers and strings if self.element_basis is None: if isinstance(element, type("string")): self.atomicnumber = ase.data.atomic_numbers[element] else: # Let's hope it is an atomic number or something compatible. self.atomicnumber = element else: self.atomicnumber = [] for e in element: if isinstance(e, type("string")): self.atomicnumber.append(ase.data.atomic_numbers[e]) else: # Let's hope it is an atomic number or something compatible. self.atomicnumber.append(e) assert len(self.atomicnumber) == len(self.bravais_basis) | b054d8fb435784ad9df7f0e582b9cc196051e52e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5572/b054d8fb435784ad9df7f0e582b9cc196051e52e/bravais.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
2956,
12,
2890,
16,
930,
4672,
315,
4976,
7960,
1300,
628,
930,
6,
468,
1021,
1953,
716,
848,
506,
5970,
358,
17219,
30,
12321,
471,
2064,
309,
365,
18,
2956,
67,
23774,
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,
1207,
67,
2956,
12,
2890,
16,
930,
4672,
315,
4976,
7960,
1300,
628,
930,
6,
468,
1021,
1953,
716,
848,
506,
5970,
358,
17219,
30,
12321,
471,
2064,
309,
365,
18,
2956,
67,
23774,
353,... |
if '__WXGTK__' in wx.PlatformInfo: newSize.height = pointSize + 8 | def SetItem(self, item, position, size, pointSize): self.item = item self.SetValue(item.displayName) | 0a27f4ca2cd3fd79d460f99220e89241993dd034 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/0a27f4ca2cd3fd79d460f99220e89241993dd034/CalendarCanvas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1000,
1180,
12,
2890,
16,
761,
16,
1754,
16,
963,
16,
1634,
1225,
4672,
365,
18,
1726,
273,
761,
365,
18,
694,
620,
12,
1726,
18,
5417,
461,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1000,
1180,
12,
2890,
16,
761,
16,
1754,
16,
963,
16,
1634,
1225,
4672,
365,
18,
1726,
273,
761,
365,
18,
694,
620,
12,
1726,
18,
5417,
461,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100... | |
if request.method == 'POST': return redirect('reviewers') else: reviewers = Reviewer.objects.order_by("-id")[offset:limit] if(reviewers): json_subcat = serializers.serialize("json", reviewers) else: json_subcat = 'EOF' return HttpResponse(json_subcat, mimetype="application/javascript") | if request.method == 'POST': return redirect('reviewers') else: reviewers = Reviewer.objects.order_by("-id")[offset:limit] if(reviewers): json_subcat = serializers.serialize("json", reviewers) else: json_subcat = 'EOF' return HttpResponse(json_subcat, mimetype="application/javascript") | def get_reviewers_online(request, offset, limit): if request.method == 'POST': return redirect('reviewers') else: reviewers = Reviewer.objects.order_by("-id")[offset:limit] if(reviewers): json_subcat = serializers.serialize("json", reviewers) else: json_subcat = 'EOF' return HttpResponse(json_subcat, mimetype="application/javascript") | 7759d6eb08a7e6568691e648ed314450c8afa48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11995/7759d6eb08a7e6568691e648ed314450c8afa48e/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
16041,
414,
67,
21026,
12,
2293,
16,
1384,
16,
1800,
4672,
309,
590,
18,
2039,
422,
296,
3798,
4278,
327,
3136,
2668,
16041,
414,
6134,
469,
30,
10725,
414,
273,
21354,
264,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16041,
414,
67,
21026,
12,
2293,
16,
1384,
16,
1800,
4672,
309,
590,
18,
2039,
422,
296,
3798,
4278,
327,
3136,
2668,
16041,
414,
6134,
469,
30,
10725,
414,
273,
21354,
264,
1... |
self._body = self.get_HTML_mail(name,build_url,waterfall_url,failed_step,status_text,change) | self._body = self.get_HTML_mail(name,build,build_url,waterfall_url,failed_step,status_text,change) | def buildMessage(self, name, build, results): """Send an email about the result. Don't attach the patch as MailNotifier.buildMessage do.""" | d09b5709e163d35440f472144fc6a75155c9b191 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12355/d09b5709e163d35440f472144fc6a75155c9b191/mail.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
1079,
12,
2890,
16,
508,
16,
1361,
16,
1686,
4672,
3536,
3826,
392,
2699,
2973,
326,
563,
18,
7615,
1404,
3306,
326,
4729,
487,
11542,
14889,
18,
3510,
1079,
741,
12123,
2,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
1079,
12,
2890,
16,
508,
16,
1361,
16,
1686,
4672,
3536,
3826,
392,
2699,
2973,
326,
563,
18,
7615,
1404,
3306,
326,
4729,
487,
11542,
14889,
18,
3510,
1079,
741,
12123,
2,
-100,
... |
m_methods[num] = method; | m_methods.insert(std::pair<int, objectArrivedPtr>(num, method)); | def generate_dispatcher_implementation(self, objects): #print "Output of implementation for:", outfile = self.outdir + '/Dispatcher.cpp' #print outfile self.out = open(outfile + ".tmp", "w") self.write(copyright) self.write('\n#include <Atlas/Objects/Dispatcher.h>\n\n') self.ns_open(self.base_list) self.write(""" | b3b2311a5b03a1655ca638eb2b96f0da58e33310 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12931/b3b2311a5b03a1655ca638eb2b96f0da58e33310/GenerateDispatcher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
18495,
67,
30810,
12,
2890,
16,
2184,
4672,
468,
1188,
315,
1447,
434,
4471,
364,
2773,
16,
8756,
273,
365,
18,
659,
1214,
397,
1173,
6681,
18,
4057,
84,
11,
468,
1188,
8756,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
18495,
67,
30810,
12,
2890,
16,
2184,
4672,
468,
1188,
315,
1447,
434,
4471,
364,
2773,
16,
8756,
273,
365,
18,
659,
1214,
397,
1173,
6681,
18,
4057,
84,
11,
468,
1188,
8756,... |
xml = '<filename file="%s" />' % f | xml = '<filename file="%s" />' % os.path.basename(f) | def write_abstract_dag(self): """ Write all the nodes in the workflow to the DAX file. """ if not self.__dax_file_path: # this workflow is not dax-compatible, so don't write a dax return try: dagfile = open( self.__dax_file_path, 'w' ) except: raise CondorDAGError, "Cannot open file " + self.__dag_file_path | cec1a043957f226949b65b3fd770ff7c197a21fe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/cec1a043957f226949b65b3fd770ff7c197a21fe/pipeline.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
17801,
67,
30204,
12,
2890,
4672,
3536,
2598,
777,
326,
2199,
316,
326,
6095,
358,
326,
463,
2501,
585,
18,
3536,
309,
486,
365,
16186,
72,
651,
67,
768,
67,
803,
30,
468,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
17801,
67,
30204,
12,
2890,
4672,
3536,
2598,
777,
326,
2199,
316,
326,
6095,
358,
326,
463,
2501,
585,
18,
3536,
309,
486,
365,
16186,
72,
651,
67,
768,
67,
803,
30,
468,
... |
self.ui.debug("Parsing revision %d\n" % revnum) if orig_paths is None: return | def after_received(orig_paths, revnum, author, date, message): if revnum in self.modulemap: new_module = self.modulemap[revnum] if new_module != self.module: self.module = new_module self.reparent(self.module) | de321e18946a5c05d6c8deaff7b6fed8e6ae14c9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11312/de321e18946a5c05d6c8deaff7b6fed8e6ae14c9/subversion.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1839,
67,
15213,
12,
4949,
67,
4481,
16,
5588,
2107,
16,
2869,
16,
1509,
16,
883,
4672,
309,
5588,
2107,
316,
365,
18,
2978,
1458,
30,
394,
67,
2978,
273,
365,
18,
2978,
1458,
63,
90... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1839,
67,
15213,
12,
4949,
67,
4481,
16,
5588,
2107,
16,
2869,
16,
1509,
16,
883,
4672,
309,
5588,
2107,
316,
365,
18,
2978,
1458,
30,
394,
67,
2978,
273,
365,
18,
2978,
1458,
63,
90... | |
self.assert_(int(groups[2]) == pid, | self.assertEqual(int(groups[2]), pid, | 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)) | ea8344797e1a0ebd0b419ce14e16ab25af771fcc /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/ea8344797e1a0ebd0b419ce14e16ab25af771fcc/test_mailbox.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
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... |
if widget.tag == "eLabel": | if w_tag == "eLabel": | def readSkin(screen, skin, names, desktop): if not isinstance(names, list): names = [names] name = "<embedded-in-'%s'>" % screen.__class__.__name__ # try all skins, first existing one have priority for n in names: myscreen, path = lookupScreen(n) if myscreen is not None: # use this name for debug output name = n break # otherwise try embedded skin myscreen = myscreen or getattr(screen, "parsedSkin", None) # try uncompiled embedded skin if myscreen is None and getattr(screen, "skin", None): print "Looking for embedded skin" myscreen = screen.parsedSkin = xml.etree.cElementTree.fromstring(screen.skin) #assert myscreen is not None, "no skin for screen '" + repr(names) + "' found!" if myscreen is None: print "No skin to read..." emptySkin = "<screen></screen>" myscreen = screen.parsedSkin = xml.etree.cElementTree.fromstring(emptySkin) screen.skinAttributes = [ ] skin_path_prefix = getattr(screen, "skin_path", path) collectAttributes(screen.skinAttributes, myscreen, skin_path_prefix, ignore=["name"]) screen.additionalWidgets = [ ] screen.renderer = [ ] visited_components = set() # now walk all widgets for widget in myscreen.findall("widget"): get_attr = widget.attrib.get # ok, we either have 1:1-mapped widgets ('old style'), or 1:n-mapped # widgets (source->renderer). wname = get_attr('name') wsource = get_attr('source') if wname is None and wsource is None: print "widget has no name and no source!" continue if wname: #print "Widget name=", wname visited_components.add(wname) # get corresponding 'gui' object try: attributes = screen[wname].skinAttributes = [ ] except: raise SkinError("component with name '" + wname + "' was not found in skin of screen '" + name + "'!") #print "WARNING: component with name '" + wname + "' was not found in skin of screen '" + name + "'!" | 726a696a8d423d9f994767f2df01e135f07fca96 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6652/726a696a8d423d9f994767f2df01e135f07fca96/skin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
26827,
12,
9252,
16,
18705,
16,
1257,
16,
21304,
4672,
309,
486,
1549,
12,
1973,
16,
666,
4672,
1257,
273,
306,
1973,
65,
225,
508,
273,
3532,
20722,
17,
267,
6627,
9,
87,
28533,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
26827,
12,
9252,
16,
18705,
16,
1257,
16,
21304,
4672,
309,
486,
1549,
12,
1973,
16,
666,
4672,
1257,
273,
306,
1973,
65,
225,
508,
273,
3532,
20722,
17,
267,
6627,
9,
87,
28533,
... |
class Element( Node ): | class Element(Node): | def __delitem__(self, attname_or_tuple): node = self[attname_or_tuple] node.unlink() del self._attrs[node.name] del self._attrsNS[(node.namespaceURI, node.localName)] | 034191d829641c37d224fa2f1c6e99d29ad998d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/034191d829641c37d224fa2f1c6e99d29ad998d9/minidom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
3771,
1726,
972,
12,
2890,
16,
2403,
529,
67,
280,
67,
8052,
4672,
756,
273,
365,
63,
4558,
529,
67,
280,
67,
8052,
65,
756,
18,
318,
1232,
1435,
1464,
365,
6315,
7039,
63,
215... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3771,
1726,
972,
12,
2890,
16,
2403,
529,
67,
280,
67,
8052,
4672,
756,
273,
365,
63,
4558,
529,
67,
280,
67,
8052,
65,
756,
18,
318,
1232,
1435,
1464,
365,
6315,
7039,
63,
215... |
class RemoveSelfProvidedRequiresh(policy.Policy): | class RemoveSelfProvidedRequires(policy.Policy): | def addPluggableRequirements(self, path, fullpath, pkgFiles, macros): """Override in subclasses""" pass | be31d48698d3d0c8cac5a3534f2c0f3b1d71c73f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8747/be31d48698d3d0c8cac5a3534f2c0f3b1d71c73f/packagepolicy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
1749,
30382,
15465,
12,
2890,
16,
589,
16,
15170,
16,
3475,
2697,
16,
24302,
4672,
3536,
6618,
316,
15320,
8395,
1342,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
1749,
30382,
15465,
12,
2890,
16,
589,
16,
15170,
16,
3475,
2697,
16,
24302,
4672,
3536,
6618,
316,
15320,
8395,
1342,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def __getattr__(self, name): | def _dummy(*args): | def __getattr__(self, name): raise error(9, 'Bad file descriptor') | 989966d25708bea632f78cedd70c2f9924187e94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/989966d25708bea632f78cedd70c2f9924187e94/socket.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
21050,
30857,
1968,
4672,
1002,
555,
12,
29,
16,
296,
6434,
585,
4950,
6134,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
21050,
30857,
1968,
4672,
1002,
555,
12,
29,
16,
296,
6434,
585,
4950,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
while fobj.size != fobj.tell(): | while fobj.tell() < ocount: | def _decodeSigSubpackets(fobj): fobj.seek(0) while fobj.size != fobj.tell(): yield PGP_Signature._getNextSubpacket(fobj) | dad368a4dd1570b1d9338861bf62d56a7cf6dab7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8747/dad368a4dd1570b1d9338861bf62d56a7cf6dab7/openpgpfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3922,
8267,
1676,
28717,
12,
27936,
4672,
24705,
18,
16508,
12,
20,
13,
1323,
24705,
18,
88,
1165,
1435,
411,
320,
1883,
30,
2824,
21222,
67,
5374,
6315,
588,
2134,
1676,
11482,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3922,
8267,
1676,
28717,
12,
27936,
4672,
24705,
18,
16508,
12,
20,
13,
1323,
24705,
18,
88,
1165,
1435,
411,
320,
1883,
30,
2824,
21222,
67,
5374,
6315,
588,
2134,
1676,
11482,
12,... |
if not taxep.id: | if not taxep or not taxep.id: | def product_id_change(self, cr, uid, ids, pricelist, product, qty=0, uom=False, qty_uos=0, uos=False, name='', partner_id=False, lang=False, update_tax=True): if partner_id: lang=self.pool.get('res.partner').read(cr, uid, [partner_id])[0]['lang'] context = {'lang':lang} if not product: return {'value': {'price_unit': 0.0, 'notes':'', 'weight' : 0, 'product_uos_qty': qty}, 'domain':{'product_uom':[]}} if not pricelist: raise osv.except_osv('No Pricelist !', 'You have to select a pricelist in the sale form !\nPlease set one before choosing a product.') price = self.pool.get('product.pricelist').price_get(cr,uid,[pricelist], product, qty or 1.0, partner_id, {'uom': uom})[pricelist] if price is False: raise osv.except_osv('No valid pricelist line found !', "Couldn't find a pricelist line matching this product and quantity.\nYou have to change either the product, the quantity or the pricelist.") res = self.pool.get('product.product').read(cr, uid, [product], context=context)[0] | ee0936a83df8c14bfb712d8b14b12a8c1029c2dc /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7397/ee0936a83df8c14bfb712d8b14b12a8c1029c2dc/sale.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3017,
67,
350,
67,
3427,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
846,
335,
5449,
16,
3017,
16,
26667,
33,
20,
16,
582,
362,
33,
8381,
16,
26667,
67,
89,
538,
33,
20,
16,
582,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3017,
67,
350,
67,
3427,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
846,
335,
5449,
16,
3017,
16,
26667,
33,
20,
16,
582,
362,
33,
8381,
16,
26667,
67,
89,
538,
33,
20,
16,
582,
... |
else: | elif peercert: | def format_hash(value): return reduce(lambda x, (i, y): x + y.upper() + ((i % 2 and i + 1 < len(value)) and ':' or ''), enumerate(value), '') | f01486abd03ce948c0d56188c367d5194159fd1d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9151/f01486abd03ce948c0d56188c367d5194159fd1d/pysocket.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
67,
2816,
12,
1132,
4672,
327,
5459,
12,
14661,
619,
16,
261,
77,
16,
677,
4672,
619,
397,
677,
18,
5797,
1435,
397,
14015,
77,
738,
576,
471,
277,
397,
404,
411,
562,
12,
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,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
67,
2816,
12,
1132,
4672,
327,
5459,
12,
14661,
619,
16,
261,
77,
16,
677,
4672,
619,
397,
677,
18,
5797,
1435,
397,
14015,
77,
738,
576,
471,
277,
397,
404,
411,
562,
12,
1132,... |
_('Ticket History')) | _("Ticket History")) | def version_info(t, field=None): path = 'Ticket #%s' % ticket.id # TODO: field info should probably be part of the Resource as well if field: path = tag(path, Markup(' – '), field_labels.get(field, field.capitalize())) if t.version: rev = _('Version %(num)s', num=t.version) shortrev = 'v%d' % t.version else: rev, shortrev = _('Initial Version'), _('initial') return {'path': path, 'rev': rev, 'shortrev': shortrev, 'href': get_resource_url(self.env, t, req.href)} | a8a6442302dc21bfc63206a71113b0375cb3c946 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9317/a8a6442302dc21bfc63206a71113b0375cb3c946/web_ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1177,
67,
1376,
12,
88,
16,
652,
33,
7036,
4672,
589,
273,
296,
13614,
31974,
87,
11,
738,
9322,
18,
350,
468,
2660,
30,
652,
1123,
1410,
8656,
506,
1087,
434,
326,
2591,
487,
5492,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1177,
67,
1376,
12,
88,
16,
652,
33,
7036,
4672,
589,
273,
296,
13614,
31974,
87,
11,
738,
9322,
18,
350,
468,
2660,
30,
652,
1123,
1410,
8656,
506,
1087,
434,
326,
2591,
487,
5492,
... |
if type(facility) == type(int): | if type(facility) == int: | def _facilityMap(self, facility): facility_map = { "KERN": syslog.LOG_KERN, "USER": syslog.LOG_USER, "MAIL": syslog.LOG_MAIL, "DAEMON": syslog.LOG_DAEMON, "AUTH": syslog.LOG_AUTH, "LPR": syslog.LOG_LPR, "NEWS": syslog.LOG_NEWS, "UUCP": syslog.LOG_UUCP, "CRON": syslog.LOG_CRON, "LOCAL0": syslog.LOG_LOCAL0, "LOCAL1": syslog.LOG_LOCAL1, "LOCAL2": syslog.LOG_LOCAL2, "LOCAL3": syslog.LOG_LOCAL3, "LOCAL4": syslog.LOG_LOCAL4, "LOCAL5": syslog.LOG_LOCAL5, "LOCAL6": syslog.LOG_LOCAL6, "LOCAL7": syslog.LOG_LOCAL7,} if type(facility) == type(int): return facility elif facility_map.has_key(facility.upper()): return facility_map[facility.upper()] return syslog.LOG_DAEMON | 3e519e5e10a90d5c916209ce1f2a14387cdb0865 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5445/3e519e5e10a90d5c916209ce1f2a14387cdb0865/yum-updatesd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
11639,
1889,
863,
12,
2890,
16,
28164,
4672,
28164,
67,
1458,
273,
288,
315,
27221,
50,
6877,
16718,
18,
4842,
67,
27221,
50,
16,
315,
4714,
6877,
16718,
18,
4842,
67,
4714,
16,
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,
11639,
1889,
863,
12,
2890,
16,
28164,
4672,
28164,
67,
1458,
273,
288,
315,
27221,
50,
6877,
16718,
18,
4842,
67,
27221,
50,
16,
315,
4714,
6877,
16718,
18,
4842,
67,
4714,
16,
3... |
segs.extend(spectrum) | segs.extend(spectrum.metadata.segments) | def segments(self): """ Return the (uncoalesced) list of segments represented by the Spectra in this SpectrumList. """ segs = segments.segmentlist() for spectrum in self: segs.extend(spectrum) return segs | e04c61ad8714219b9691d55d7b3e2b6e6734a660 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5758/e04c61ad8714219b9691d55d7b3e2b6e6734a660/metaarray.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5155,
12,
2890,
4672,
3536,
2000,
326,
261,
551,
83,
5408,
3263,
13,
666,
434,
5155,
10584,
635,
326,
348,
1181,
354,
316,
333,
348,
13324,
682,
18,
3536,
23114,
273,
5155,
18,
9273,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5155,
12,
2890,
4672,
3536,
2000,
326,
261,
551,
83,
5408,
3263,
13,
666,
434,
5155,
10584,
635,
326,
348,
1181,
354,
316,
333,
348,
13324,
682,
18,
3536,
23114,
273,
5155,
18,
9273,
1... |
def handle_read_event (self): | def handle_read_event(self): | def handle_read_event (self): if self.accepting: # for an accepting socket, getting a read implies # that we are connected if not self.connected: self.connected = 1 self.handle_accept() elif not self.connected: self.handle_connect() self.connected = 1 self.handle_read() else: self.handle_read() | 79991224d1b5f3a4ab074ddac83ef59addf853be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/79991224d1b5f3a4ab074ddac83ef59addf853be/asyncore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
896,
67,
2575,
12,
2890,
4672,
309,
365,
18,
9436,
310,
30,
468,
364,
392,
25806,
2987,
16,
8742,
279,
855,
24168,
468,
716,
732,
854,
5840,
309,
486,
365,
18,
8537,
30,
36... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
896,
67,
2575,
12,
2890,
4672,
309,
365,
18,
9436,
310,
30,
468,
364,
392,
25806,
2987,
16,
8742,
279,
855,
24168,
468,
716,
732,
854,
5840,
309,
486,
365,
18,
8537,
30,
36... |
self.assertTrue(len(self.RequestHandler.myRequests[-1]) >= 2) | self.assertGreaterEqual(len(self.RequestHandler.myRequests[-1]), 2) | def test_two(self): p = xmlrpclib.ServerProxy(URL) self.assertEqual(p.pow(6,8), 6**8) self.assertEqual(p.pow(6,8), 6**8) self.assertEqual(len(self.RequestHandler.myRequests), 1) #we may or may not catch the final "append" with the empty line self.assertTrue(len(self.RequestHandler.myRequests[-1]) >= 2) | d455cd1933b10d60e3797a274b6aab7aa7618f57 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3187/d455cd1933b10d60e3797a274b6aab7aa7618f57/test_xmlrpc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
15415,
12,
2890,
4672,
293,
273,
2025,
13832,
830,
495,
18,
2081,
3886,
12,
1785,
13,
365,
18,
11231,
5812,
12,
84,
18,
23509,
12,
26,
16,
28,
3631,
1666,
636,
28,
13,
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,
1842,
67,
15415,
12,
2890,
4672,
293,
273,
2025,
13832,
830,
495,
18,
2081,
3886,
12,
1785,
13,
365,
18,
11231,
5812,
12,
84,
18,
23509,
12,
26,
16,
28,
3631,
1666,
636,
28,
13,
365,... |
'' | "Make a rational number ... | ... def __init__(self): | 6c095b55f59d5b341fca3a25b0c6d6fa6706d4d6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/6c095b55f59d5b341fca3a25b0c6d6fa6706d4d6/sageinspect.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1372,
377,
1652,
1001,
2738,
972,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1372,
377,
1652,
1001,
2738,
972,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
'Put mouse between an output and input until the horizontal line appears and click. Also if you press control-enter in a cell, a new cell is inserted after it (the current cell is not evaluated).'), | 'Put mouse between an output and input until the horizontal line appears and click. Also if you press control-enter in a cell, a new cell is inserted after it.'), | def help_window(self): help = [ ('Evaluate Input', 'Press shift-enter. You can start several calculations at once. If you press control-enter instead, then a new cell is created after the current one (and the current one is not evaluated).'), ('Timed Evaluation', 'Type "time" at the beginning of the cell.'), ('Evaluate all cells', 'Click <u>Evaluate All</u> in the upper right.'), ('Evaluate cell using <b>GAP, Singular, etc.', 'Put "%gap", "%singular", etc. as the first input line of a cell; the rest of the cell is evaluated in that system.'), ('Typeset a cell', 'Make the first line of the cell "%latex". The rest of the cell should be the body of a latex document. Use \\sage{expr} to access SAGE from within the latex. Evaluated typeset cells hide their input. Use "%latex_debug" for a debugging version.'), ('Typeset a slide', 'Same as typesetting a cell but use "%slide" and "%slide_debug"; will use a large san serif font.'), ('Typesetting', 'Type "latex(objname)" for latex that you can paste into your paper. Type "view(objname)", which will display a nicely typeset image, but requires that <i>latex</i>, <i>gv</i>, and <i>convert</i> are all installed. Type "lprint()" to make it so all output is typeset.'), ('Move between cells', 'Use the up and down arrows on your keyboard.'), ('Interrupt running calculations', 'Click <u>Interrupt</u> in the upper right or press escape in any input cell. This will (attempt) to interrupt SAGE by sending many interrupts for several seconds; if this fails, it restarts SAGE (your worksheet is unchanged, but your session is reset).'), ('Tab completion', 'Press tab while the cursor is on an identifier.'), ('Print worksheet', 'Click the print button.'), ('Help About', 'Type ? immediately after the object or function and press tab.'), ('Source Code', 'Put ?? after the object and press tab.'), ('Hide Input', 'Put %hide at the beginning of the cell. This can be followed by %gap, %latex, %maxima, etc. Note that %hide must be first. Put a blank line at the beginning so the "%hide" does not appear.'), ('Detailed Help', 'Type "help(object)" and press shift-return.'), ('Insert New Cell', 'Put mouse between an output and input until the horizontal line appears and click. Also if you press control-enter in a cell, a new cell is inserted after it (the current cell is not evaluated).'), ('Delete Cell', 'Delete cell contents the press backspace.'), ('Text of Worksheet', 'Click the <u>Text</u> and <u>Doctext</u> links, which are very useful if you need to cut and paste chunks of your session into email or documentation.'), ('History', 'Click the <u>History</u> link for a history of commands entered in any worksheet of this notebook. This appears in a popup window, which you can search (control-F) and copy and paste from.'), ('Hide/Show Output', 'Click on the left side of output to toggle between hidden, shown with word wrap, and shown without word wrap.'), ('Hide/Show All Output', 'Click <u>Hide</u> in the upper right to hide <i>all</i> output. Click <u>Show</u> to show all output.'), ('Variables', 'All variables and functions with a new name that you create during this session are listed on the left. (Note: If you overwrite a predefined variable, e.g., ZZ, it will not appear.)'), ('Objects', 'All objects that you save in <i>any worksheet</i> are listed on the left. Use "save(obj, name)" and "obj = load(name)" to save and load objects.'), ('Loading and Saving Sessions', 'Use "save_session name" to save all variables to an object with given name (if no name is given, defaults to name of worksheet). Use "load_session name" to <i>merge</i> in all variables from a saved session.'), ('Loading and Saving Objects', 'Use "save obj1 obj2 ..." and "load obj1 obj2 ...". This allows very easy moving of objects from one worksheet to another, and saving of objects for later use.'), ('Loading SAGE/Python Scripts', 'Use "load filename.sage" and "load filename.py". Load is relative to the path you started the notebook in. The .sage files are preparsed and .py files are not. You may omit the .sage or .py extension. Files may load other files.'), ('Attaching Scripts', 'Use "attach filename.sage" or "attach filename.py". Attached files are automatically reloaded when the file changes. The file $HOME/.sage/init.sage is attached on startup if it exists.'), ('Saving Worksheets', 'Click <ul>Save</ul> in the upper right to download a complete worksheet to a local .sws file. Note that uploading is not implemented yet except locally (the <i>only</i> thing left is implementing upload of binary data to the server). Note that <i>everything</i> that has been submitted is automatically saved to disk, and is there for you next time you access the notebook.'), ('Restart', 'Type "restart" to restart the SAGE interpreter for a given worksheet. (You have to interrupt first.)'), ('Input Rules', "Code is evaluated by exec'ing (after preparsing). Only the output of the last line of the cell is implicitly printed. If any line starts with \"sage:\" or \">>>\" the entire block is assumed to contain text and examples, so only lines that begin with a prompt are executed. Thus you can paste in complete examples from the docs without any editing, and you can write input cells that contains non-evaluated plain text mixed with examples by starting the block with \">>>\" or including an example."), ('Working Directory', 'Each block of code is run from its own directory. The variable DIR contains the directory from which you started the SAGE notebook. For example, to open a file in that directory, do "open(DIR+\'filename\')".'), ('Customizing the look', 'Learn about cascading style sheets (CSS), then create a file notebook.css in your $HOME/.sage directory. Use "view source" on a notebook web page to see the CSS that you can override.'), ('Emacs Keybindings', 'If you are using GNU/Linux, you can change (or create) a <tt>.gtkrc-2.0</tt> file. Add the line <tt>gtk-key-theme-name = "Emacs"</tt> to it. See <a target="_blank" href="http://kb.mozillazine.org/Emacs_Keybindings_(Firefox)">this page</a> [mozillazine.org] for more details.'), ('More Help', 'Type "help(sage.server.notebook.notebook)" for a detailed discussion of the architecture of the SAGE notebook and a tutorial (or see the SAGE reference manual).'), ] | 76a155f939574af95b5dcf867cdf469199acd323 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/76a155f939574af95b5dcf867cdf469199acd323/notebook.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2809,
67,
5668,
12,
2890,
4672,
2809,
273,
306,
7707,
15369,
2741,
2187,
296,
11840,
4654,
17,
2328,
18,
225,
4554,
848,
787,
11392,
20882,
622,
3647,
18,
225,
971,
1846,
11779,
3325,
17... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2809,
67,
5668,
12,
2890,
4672,
2809,
273,
306,
7707,
15369,
2741,
2187,
296,
11840,
4654,
17,
2328,
18,
225,
4554,
848,
787,
11392,
20882,
622,
3647,
18,
225,
971,
1846,
11779,
3325,
17... |
operands = userDict.keys() | operands = user_dict.keys() | def buildOperandNameMap(userDict, lineno): global operandNameMap operandNameMap = {} for (op_name, val) in userDict.iteritems(): (base_cls_name, dflt_ext, reg_spec, flags, sort_pri) = val[:5] if len(val) > 5: read_code = val[5] else: read_code = None if len(val) > 6: write_code = val[6] else: write_code = None if len(val) > 7: error(lineno, 'error: too many attributes for operand "%s"' % base_cls_name) (dflt_size, dflt_ctype, dflt_is_signed) = operandTypeMap[dflt_ext] # Canonical flag structure is a triple of lists, where each list # indicates the set of flags implied by this operand always, when # used as a source, and when used as a dest, respectively. # For simplicity this can be initialized using a variety of fairly # obvious shortcuts; we convert these to canonical form here. if not flags: # no flags specified (e.g., 'None') flags = ( [], [], [] ) elif isinstance(flags, str): # a single flag: assumed to be unconditional flags = ( [ flags ], [], [] ) elif isinstance(flags, list): # a list of flags: also assumed to be unconditional flags = ( flags, [], [] ) elif isinstance(flags, tuple): # it's a tuple: it should be a triple, # but each item could be a single string or a list (uncond_flags, src_flags, dest_flags) = flags flags = (makeList(uncond_flags), makeList(src_flags), makeList(dest_flags)) # Accumulate attributes of new operand class in tmp_dict tmp_dict = {} for attr in ('dflt_ext', 'reg_spec', 'flags', 'sort_pri', 'dflt_size', 'dflt_ctype', 'dflt_is_signed', 'read_code', 'write_code'): tmp_dict[attr] = eval(attr) tmp_dict['base_name'] = op_name # New class name will be e.g. "IntReg_Ra" cls_name = base_cls_name + '_' + op_name # Evaluate string arg to get class object. Note that the # actual base class for "IntReg" is "IntRegOperand", i.e. we # have to append "Operand". try: base_cls = eval(base_cls_name + 'Operand') except NameError: error(lineno, 'error: unknown operand base class "%s"' % base_cls_name) # The following statement creates a new class called # <cls_name> as a subclass of <base_cls> with the attributes # in tmp_dict, just as if we evaluated a class declaration. operandNameMap[op_name] = type(cls_name, (base_cls,), tmp_dict) # Define operand variables. operands = userDict.keys() operandsREString = (r''' (?<![\w\.]) # neg. lookbehind assertion: prevent partial matches ((%s)(?:\.(\w+))?) # match: operand with optional '.' then suffix (?![\w\.]) # neg. lookahead assertion: prevent partial matches ''' % string.join(operands, '|')) global operandsRE operandsRE = re.compile(operandsREString, re.MULTILINE|re.VERBOSE) # Same as operandsREString, but extension is mandatory, and only two # groups are returned (base and ext, not full name as above). # Used for subtituting '_' for '.' to make C++ identifiers. operandsWithExtREString = (r'(?<![\w\.])(%s)\.(\w+)(?![\w\.])' % string.join(operands, '|')) global operandsWithExtRE operandsWithExtRE = re.compile(operandsWithExtREString, re.MULTILINE) | 2edab51be0ddf2ab546920745ef34147fff0cec8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7385/2edab51be0ddf2ab546920745ef34147fff0cec8/isa_parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
10265,
461,
863,
12,
1355,
5014,
16,
7586,
4672,
2552,
9886,
461,
863,
9886,
461,
863,
273,
2618,
364,
261,
556,
67,
529,
16,
1244,
13,
316,
729,
5014,
18,
2165,
3319,
13332,
261... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
10265,
461,
863,
12,
1355,
5014,
16,
7586,
4672,
2552,
9886,
461,
863,
9886,
461,
863,
273,
2618,
364,
261,
556,
67,
529,
16,
1244,
13,
316,
729,
5014,
18,
2165,
3319,
13332,
261... |
print >> sys.stderr, "* ", j print >> sys.stderr, " ", str(li[j]) if j < len(li) else '-' print >> sys.stderr, " ", str(l0[j]) if j < len(l0) else '-' | print >> mode.diagnostic, "* ", j print >> mode.diagnostic, " ", str(li[j]) if j < len(li) else '-' print >> mode.diagnostic, " ", str(l0[j]) if j < len(l0) else '-' | def __init__(self, inputs, outputs, optimizer, mode, accept_inplace = False, function_builder = Function): """ :type inputs: a list of SymbolicInput instances | 16d6878579a69eb0f4199dbb8e63e98d41505c50 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12438/16d6878579a69eb0f4199dbb8e63e98d41505c50/debugmode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4540,
16,
6729,
16,
13066,
16,
1965,
16,
2791,
67,
267,
964,
273,
1083,
16,
445,
67,
9574,
273,
4284,
4672,
3536,
294,
723,
4540,
30,
279,
666,
434,
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,
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,
4540,
16,
6729,
16,
13066,
16,
1965,
16,
2791,
67,
267,
964,
273,
1083,
16,
445,
67,
9574,
273,
4284,
4672,
3536,
294,
723,
4540,
30,
279,
666,
434,
16... |
'title':self.title_quote(p.Title), | 'title':self.toencoded(self.title_quote(p.Title)), | def pages_rss(self, num=10, REQUEST=None): """ Provide an RSS feed showing this wiki's recently created pages. """ pages = self.pages(sort_on='creation_time', sort_order='reverse', sort_limit=num, isBoring=0) if len(pages) > 0: last_mod = pages[0].getObject().creationTime() else: last_mod = DateTime() if self.handle_modified_headers(last_mod=last_mod, REQUEST=REQUEST): return '' feedtitle = self.folder().title_or_id() + ' new pages' feeddescription = feedtitle feedlanguage = 'en' feeddate = self.folder().bobobase_modification_time().rfc822() wikiurl = self.wikiUrl() REQUEST.RESPONSE.setHeader('Content-Type','text/xml; charset=utf-8') t = """\ | 9518d8429c527129cd9670689ed51cd6798d16eb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5225/9518d8429c527129cd9670689ed51cd6798d16eb/RSS.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4689,
67,
25151,
12,
2890,
16,
818,
33,
2163,
16,
12492,
33,
7036,
4672,
3536,
26569,
392,
31481,
4746,
17253,
333,
9050,
1807,
19907,
2522,
4689,
18,
3536,
4689,
273,
365,
18,
7267,
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,
4689,
67,
25151,
12,
2890,
16,
818,
33,
2163,
16,
12492,
33,
7036,
4672,
3536,
26569,
392,
31481,
4746,
17253,
333,
9050,
1807,
19907,
2522,
4689,
18,
3536,
4689,
273,
365,
18,
7267,
12,... |
raise PLCPermissionDenied,"build.sh failed to create node-specific medium" self.trash.append("%s.log"%node_image) node_image += suffix | raise PLCAPIError,"bootcd/build.sh failed\n%s\n%s"%( build_command,file(log_file).read()) self.trash.append(log_file) | def hexa2 (c): return chr((c>>4)+65) + chr ((c&16)+65) | d27348bcbc24d51e78933eafc13ed1f986991179 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7598/d27348bcbc24d51e78933eafc13ed1f986991179/GetBootMedium.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3827,
69,
22,
261,
71,
4672,
327,
4513,
12443,
71,
9778,
24,
27921,
9222,
13,
397,
4513,
14015,
71,
10,
2313,
27921,
9222,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3827,
69,
22,
261,
71,
4672,
327,
4513,
12443,
71,
9778,
24,
27921,
9222,
13,
397,
4513,
14015,
71,
10,
2313,
27921,
9222,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
path, elyxer = checkProg('a LyX -> HTML converter', ['elyxer.py', 'elyxer'], rc_entry = [ r'\converter lyx html "python -tt $$s/scripts/elyxer.py --directory $$r $$i $$o" ""' ]) if elyxer.find('elyxer') >= 0: | elyxerfound = checkModule('elyxer') if elyxerfound: addToRC(r'''\converter lyx html "python -m elyxer --directory $$r $$i $$o" ""''') else: path, elyxer = checkProg('a LyX -> HTML converter', ['elyxer.py', 'elyxer'], rc_entry = [ r'\converter lyx html "python -tt elyxer.py --directory $$r $$i $$o" ""' ]) if elyxer.find('elyxer') >= 0: elyxerfound = True if elyxerfound: | def checkConverterEntries(): ''' Check all converters (\converter entries) ''' checkProg('the pdflatex program', ['pdflatex $$i'], rc_entry = [ r'\converter pdflatex pdf2 "%%" "latex"' ]) checkProg('XeTeX', ['xelatex $$i'], rc_entry = [ r'\converter xetex pdf4 "%%" "latex"' ]) ''' If we're running LyX in-place then tex2lyx will be found in ../src/tex2lyx. Add this directory to the PATH temporarily and search for tex2lyx. Use PATH to avoid any problems with paths-with-spaces. ''' path_orig = os.environ["PATH"] os.environ["PATH"] = os.path.join('..', 'src', 'tex2lyx') + \ os.pathsep + path_orig checkProg('a LaTeX/Noweb -> LyX converter', ['tex2lyx', 'tex2lyx' + version_suffix], rc_entry = [r'''\converter latex lyx "%% -f $$i $$o" "" | 60ca549de3fbfdae36f34293228872868da33837 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7514/60ca549de3fbfdae36f34293228872868da33837/configure.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
5072,
5400,
13332,
9163,
2073,
777,
19414,
17938,
15747,
3222,
13,
9163,
866,
626,
75,
2668,
5787,
8169,
26264,
5402,
2187,
10228,
7699,
26264,
5366,
77,
17337,
4519,
67,
4099,
273,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
5072,
5400,
13332,
9163,
2073,
777,
19414,
17938,
15747,
3222,
13,
9163,
866,
626,
75,
2668,
5787,
8169,
26264,
5402,
2187,
10228,
7699,
26264,
5366,
77,
17337,
4519,
67,
4099,
273,
3... |
raise TraitError("PathProperty constructor requires a 'ref_name' argument.") | raise TraitError("PathProperty constructor requires a" " 'ref_name' argument.") | def __init__ ( self, default_value = NoDefaultSpecified, **metadata ): ref_name = metadata.get('ref_name') if not ref_name: raise TraitError("PathProperty constructor requires a 'ref_name' argument.") self._names = ref_name.split('.') if len(self._names) < 2: raise TraitError("PathProperty ref_name must have at least two entries in the path."+ " The given ref_name was '%s'" % ref_name) self._ref = weakref.ref(_DumbTmp()) # make weakref to a transient object to force # a re-resolve later without an extra check of # self._ref is None super(PathProperty, self).__init__(default_value, **metadata) | 8586d67f5d42158f614b7fc3ff6c91066cfdb680 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12610/8586d67f5d42158f614b7fc3ff6c91066cfdb680/container.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
365,
16,
805,
67,
1132,
273,
2631,
1868,
17068,
16,
2826,
4165,
262,
30,
1278,
67,
529,
273,
1982,
18,
588,
2668,
1734,
67,
529,
6134,
309,
486,
1278,
67,
529,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
365,
16,
805,
67,
1132,
273,
2631,
1868,
17068,
16,
2826,
4165,
262,
30,
1278,
67,
529,
273,
1982,
18,
588,
2668,
1734,
67,
529,
6134,
309,
486,
1278,
67,
529,
... |
completeuplist=[] uplistnames=[] | completeuplist = [] uplistnames = [] | def upgradepkgs(tsnevral, hinevral, rpmnevral, nulist, uplist, obsoleted_list, obsdict, userlist): # must take user arguments # this is just like update except it must check for obsoleting pkgs first # so if foobar = 1.0 and you have foobar-1.1 in the repo and bazquux1.2 # obsoletes foobar then bazquux would get installed. completeuplist=[] uplistnames=[] for (name, arch) in uplist: uplistnames.append(name) completeuplist.append((name,arch)) log(4,"Updating: %s" % name) for (name, arch) in obsdict.keys(): if obsdict[(name,arch)] not in uplistnames: completeuplist.append((name,arch)) log(4,"Obsolete: %s by %s" % (obsdict[(name,arch)], name)) if len(completeuplist) > 0 : for (name,arch) in completeuplist: ((e, v, r, a, l, i), s)=hinevral._get_data(name,arch) tsnevral.add((name,e,v,r,a,l,i),'u') else: errorlog(1,"No Packages Available for Update or Install") | c730f5aed105593a7e39895118ca0e3a01fd6460 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5445/c730f5aed105593a7e39895118ca0e3a01fd6460/pkgaction.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8400,
25376,
12,
3428,
4644,
18090,
287,
16,
366,
558,
18090,
287,
16,
25228,
4644,
18090,
287,
16,
290,
30994,
16,
582,
17842,
16,
7160,
355,
278,
329,
67,
1098,
16,
7160,
1576,
16,
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,
8400,
25376,
12,
3428,
4644,
18090,
287,
16,
366,
558,
18090,
287,
16,
25228,
4644,
18090,
287,
16,
290,
30994,
16,
582,
17842,
16,
7160,
355,
278,
329,
67,
1098,
16,
7160,
1576,
16,
2... |
self.drawroundbox(content.x + r.x, y0 + r.y, r.width, r.height, r) | if r.x < 0: tx0 -= r.x if r.y < 0: ty0 -= r.y self.drawroundbox(tx0 + r.x, ty0 + r.y, r.width, r.height, r) | def update_content(self): """ update the listing area """ | 31ed124c668b3f507e402823bdf4335bae914a3b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/31ed124c668b3f507e402823bdf4335bae914a3b/tvlisting_area.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
1745,
12,
2890,
4672,
3536,
1089,
326,
11591,
5091,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
1745,
12,
2890,
4672,
3536,
1089,
326,
11591,
5091,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
self.set_menu_contextual_items_visible() | def menukey_press(self, action): self.set_menu_contextual_items_visible() self.mainmenu.popup(None, None, self.position_menu, 0, 0) | 8cbdded67d2cd4af1d043eab95abc449dd591f9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2312/8cbdded67d2cd4af1d043eab95abc449dd591f9b/sonata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3824,
856,
67,
1028,
12,
2890,
16,
1301,
4672,
365,
18,
5254,
5414,
18,
16086,
12,
7036,
16,
599,
16,
365,
18,
3276,
67,
5414,
16,
374,
16,
374,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3824,
856,
67,
1028,
12,
2890,
16,
1301,
4672,
365,
18,
5254,
5414,
18,
16086,
12,
7036,
16,
599,
16,
365,
18,
3276,
67,
5414,
16,
374,
16,
374,
13,
2,
-100,
-100,
-100,
-100,
-100,
... | |
print bold("[error] modifier not valid. Only: CTRL, ALT, SHIFT!") | print bold("> Error: modifier not valid. Only: CTRL, ALT, SHIFT!") | def e17_keys(): try: import pyetun_keys keys=pyetun_keys.get_KEYS() modu=pyetun_keys.get_MODIFIERS() act=pyetun_keys.get_ACTION() par=pyetun_keys.get_PARAMS() for index,i in enumerate(keys): print bold_yellow("[MODIFIER+KEY] "), print modu[index],"+",i, print bold_yellow(" [ACTION] "), print act[index], print bold_yellow(" [ACTION PARAMS] "), print par[index][:-1] print bold_red("> Options: ") print bold_green("[A]DD KEYBINDING <modifier+key> <action> <action_params>") print bold_green("[D]ELETE KEYBINDING <modifier+key>") print "EXAMPLE: a shift+alt+g exec gedit * This example creates a shortcut key (ALT+g) to open gedit *" print "> CTRL+C - Main Menu" valu=raw_input("Option: ") while 1: opt=valu.split(" ")[0] try: if opt=="a": opt, key, action, param=valu.split(None,3) elif opt=="d": key=valu.split(" ")[1] action="" param="" all_mod=["CTRL","ALT","SHIFT"] #opt=t[0] #key=t[1] plus = [x for x in key if x == '+'] nPlus = len(plus) if nPlus==2: mod1, mod2, key_final=key.split("+",2) modifier1=mod1.upper() modifier2=mod2.upper() if modifier1 in all_mod and modifier2 in all_mod: mod='"'+modifier1+"|"+modifier2+'"' else: print bold("[error] modifier not valid. Only: CTRL, ALT, SHIFT!") e17_keys() else: mod, key_final=key.split("+",1) mod=mod.upper() if mod in all_mod: mod='"'+mod+'"' else: print bold("[error] modifier not valid. Only: CTRL, ALT, SHIFT!") except: print bold ("> Error: m00, wrong move! Try again..") e17_keys() if opt=="a": param='"'+param+'"' pyetun_keys.add_key(key_final,mod,action,param) print bold("KEY:"), print key, "ADDED!" e17_keys() elif opt=="d": key_final2='"'+key_final+'"' mod2=mod.split('"')[1] #print mod if key_final2 in keys and mod2 in modu: for inde, i in enumerate(keys): if modu[inde] == mod2 and keys[inde]==key_final2: action=act[inde] param=par[inde] ok=True break else: ok=False if ok==True: pyetun_keys.del_key(key_final,mod,action,param) print bold("KEY:"), print key, "DELETED!" e17_keys() else: print bold("[error] Invalid keybinding!") e17_keys() else: print bold("[error] m000 wrong option!") e17_keys() except KeyboardInterrupt: print "\nOops! exiting ;)" console() | 2dc56bf12f43e29753088b6cfaeea43096646f6a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2281/2dc56bf12f43e29753088b6cfaeea43096646f6a/pyetun.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
425,
4033,
67,
2452,
13332,
775,
30,
1930,
2395,
278,
318,
67,
2452,
1311,
33,
2074,
278,
318,
67,
2452,
18,
588,
67,
16333,
1435,
681,
89,
33,
2074,
278,
318,
67,
2452,
18,
588,
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,
425,
4033,
67,
2452,
13332,
775,
30,
1930,
2395,
278,
318,
67,
2452,
1311,
33,
2074,
278,
318,
67,
2452,
18,
588,
67,
16333,
1435,
681,
89,
33,
2074,
278,
318,
67,
2452,
18,
588,
67,... |
if retstr.find('Online at other IP!'): | if retstr.find('Online at other IP!') != -1: | def online(self, widget, data=None): self.e_user.set_editable(False) self.e_passwd.set_editable(False) self.account[0] = self.e_user.get_text() self.account[2] = self.e_passwd.get_text() self.account[3] = self.e_server.get_text() casnetconf.ops['-u'] = self.account[0] casnetconf.ops['-d'] = self.account[1] casnetconf.ops['-p'] = self.account[2] casnetconf.ops['-ip'] = self.account[3] casnetconf.ops['-m'] = self.account[4] casnetconf.ops['-r'] = self.account[5] casnetconf.ops['-a'] = self.account[6] casnetconf.write_ops() (ret, retstr) = casnet.login(self.account) if ret == False: self.pop_dialog('登录错误', retstr) return False (ret, retstr) = casnet.online(self.account[4]) if ret == False: if retstr.find('Online at other IP!'): casnet.forceoff(self.account) (ret, retstr) = casnet.login(self.account) else: self.pop_dialog('连线错误', 'retstr') return False self.pop_dialog('连接状态', retstr) self.stat(None, None) return True | ff5f65cbaefb102f37aa0e9b4e8324968d2e1e80 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4851/ff5f65cbaefb102f37aa0e9b4e8324968d2e1e80/casnet-gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12365,
12,
2890,
16,
3604,
16,
501,
33,
7036,
4672,
365,
18,
73,
67,
1355,
18,
542,
67,
19653,
12,
8381,
13,
365,
18,
73,
67,
24002,
18,
542,
67,
19653,
12,
8381,
13,
365,
18,
4631... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12365,
12,
2890,
16,
3604,
16,
501,
33,
7036,
4672,
365,
18,
73,
67,
1355,
18,
542,
67,
19653,
12,
8381,
13,
365,
18,
73,
67,
24002,
18,
542,
67,
19653,
12,
8381,
13,
365,
18,
4631... |
self._dict[str8('g')] = f[str8('g')] = b"indented" | self._dict['g'] = f[b'g'] = b"indented" | def test_anydbm_modification(self): self.init_db() f = anydbm.open(_fname, 'c') self._dict[str8('g')] = f[str8('g')] = b"indented" self.read_helper(f) f.close() | 3978b4e32bc06e7ac843145e024f93c61458b012 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/3978b4e32bc06e7ac843145e024f93c61458b012/test_anydbm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2273,
1966,
81,
67,
31064,
12,
2890,
4672,
365,
18,
2738,
67,
1966,
1435,
284,
273,
1281,
1966,
81,
18,
3190,
24899,
12749,
16,
296,
71,
6134,
365,
6315,
1576,
3292,
75,
3546... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2273,
1966,
81,
67,
31064,
12,
2890,
4672,
365,
18,
2738,
67,
1966,
1435,
284,
273,
1281,
1966,
81,
18,
3190,
24899,
12749,
16,
296,
71,
6134,
365,
6315,
1576,
3292,
75,
3546... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.