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 |
|---|---|---|---|---|---|---|
lc = os.getenv('COBBLER_SERVER', '') if lc: lc = 'http://%s:8000/server' % lc | if cs: lc = 'http://%s:8000/server' % cs | def defaults(): d = config.backend_defaults() lc = os.getenv('LAB_CONTROLLER', '') if not lc: lc = os.getenv('COBBLER_SERVER', '') if lc: lc = 'http://%s:8000/server' % lc else: lc = 'http://localhost:5222/' d.update({ 'NAME':'beah_beaker_backend', 'LAB_CONTROLLER':lc, 'HOSTNAME':os.getenv('HOSTNAME') }) return d | a86aa02ebe50702e3a50b69ebb235b52de2fec47 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14755/a86aa02ebe50702e3a50b69ebb235b52de2fec47/beakerlc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3467,
13332,
302,
273,
642,
18,
9993,
67,
7606,
1435,
9109,
273,
1140,
18,
588,
3074,
2668,
48,
2090,
67,
6067,
25353,
2187,
28707,
309,
486,
9109,
30,
309,
2873,
30,
9109,
273,
296,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3467,
13332,
302,
273,
642,
18,
9993,
67,
7606,
1435,
9109,
273,
1140,
18,
588,
3074,
2668,
48,
2090,
67,
6067,
25353,
2187,
28707,
309,
486,
9109,
30,
309,
2873,
30,
9109,
273,
296,
2... |
buildCfg.resetToDefault(option) | self.resetToDefault(option) | def _shouldOverwrite(key, current, new): if key not in new: return False if compat.ConaryVersion().supportsConfigIsDefault(): if (current.isDefault(key) and current[key] == current.getDefaultValue(key) and (not new.isDefault(key) or new[key] != new.getDefaultValue(key))): return True elif (current[key] is current.getDefaultValue(key) or current[key] == current.getDefaultValue(key) and (not new[key] is new.getDefaultValue(key) and not new[key] == new.getDefaultValue(key))): return True return False | 9db06fedaa8095e530e65983f2cd979a8eb94c1c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8749/9db06fedaa8095e530e65983f2cd979a8eb94c1c/buildcfg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
13139,
20832,
12,
856,
16,
783,
16,
394,
4672,
309,
498,
486,
316,
394,
30,
327,
1083,
309,
4796,
18,
442,
814,
1444,
7675,
28064,
809,
2520,
1868,
13332,
309,
261,
2972,
18,
291,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
13139,
20832,
12,
856,
16,
783,
16,
394,
4672,
309,
498,
486,
316,
394,
30,
327,
1083,
309,
4796,
18,
442,
814,
1444,
7675,
28064,
809,
2520,
1868,
13332,
309,
261,
2972,
18,
291,... |
errCode,gfalObject,errMessage = gfal.gfal_init(gfalDict) | try: errCode,gfalObject,errMessage = gfal.gfal_init(gfalDict) except Exception, x: print "Exception __create_gfal_object", x | def __create_gfal_object(self,gfalDict): gLogger.verbose("SRM2Storage.__create_gfal_object: Performing gfal_init.") errCode,gfalObject,errMessage = gfal.gfal_init(gfalDict) if not errCode == 0: errStr = "SRM2Storage.__create_gfal_object: Failed to perform gfal_init:" gLogger.error(errStr,"%s %s" % (errMessage,os.strerror(errCode))) return S_ERROR() else: gLogger.verbose("SRM2Storage.__create_gfal_object: Successfully performed gfal_init.") gLogger.verbose("SRM2Storage.__create_gfal_object:",str(errCode)) gLogger.verbose("SRM2Storage.__create_gfal_object:",str(gfalObject)) gLogger.verbose("SRM2Storage.__create_gfal_object:",str(errMessage)) return S_OK(gfalObject) | c1f0e5cdaaa87b6160ba922ce4774039b3ce6050 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/c1f0e5cdaaa87b6160ba922ce4774039b3ce6050/SRM2Storage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2640,
67,
75,
74,
287,
67,
1612,
12,
2890,
16,
75,
74,
287,
5014,
4672,
314,
3328,
18,
11369,
2932,
55,
8717,
22,
3245,
16186,
2640,
67,
75,
74,
287,
67,
1612,
30,
11217,
310,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2640,
67,
75,
74,
287,
67,
1612,
12,
2890,
16,
75,
74,
287,
5014,
4672,
314,
3328,
18,
11369,
2932,
55,
8717,
22,
3245,
16186,
2640,
67,
75,
74,
287,
67,
1612,
30,
11217,
310,
... |
iq.x = game.state.kscmdr.x + 1 | iq.i = game.state.kscmdr.i + 1 | def supercommander(): "Move the Super Commander." iq = coord(); sc = coord(); ibq = coord(); idelta = coord() basetbl = [] if idebug: prout("== SUPERCOMMANDER") # Decide on being active or passive avoid = ((game.incom - len(game.state.kcmdr) + game.inkling - game.state.remkl)/(game.state.date+0.01-game.indate) < 0.1*game.skill*(game.skill+1.0) or \ (game.state.date-game.indate) < 3.0) if not game.iscate and avoid: # compute move away from Enterprise idelta = game.state.kscmdr-game.quadrant if math.sqrt(idelta.x*idelta.x+idelta.y*idelta.y) > 2.0: # circulate in space idelta.x = game.state.kscmdr.y-game.quadrant.y idelta.y = game.quadrant.x-game.state.kscmdr.x else: # compute distances to starbases if not game.state.baseq: # nothing left to do unschedule(FSCMOVE) return sc = game.state.kscmdr for base in game.state.baseq: basetbl.append((i, (base - sc).distance())) if game.state.baseq > 1: basetbl.sort(lambda x, y: cmp(x[1]. y[1])) # look for nearest base without a commander, no Enterprise, and # without too many Klingons, and not already under attack. ifindit = iwhichb = 0 for (i2, base) in enumerate(game.state.baseq): i = basetbl[i2][0]; # bug in original had it not finding nearest if base==game.quadrant or base==game.battle or not welcoming(base): continue # if there is a commander, and no other base is appropriate, # we will take the one with the commander for cmdr in game.state.kcmdr: if base == cmdr and ifindit != 2: ifindit = 2 iwhichb = i break else: # no commander -- use this one ifindit = 1 iwhichb = i break if ifindit==0: return # Nothing suitable -- wait until next time ibq = game.state.baseq[iwhichb] # decide how to move toward base idelta = ibq - game.state.kscmdr # Maximum movement is 1 quadrant in either or both axes idelta = idelta.sgn() # try moving in both x and y directions # there was what looked like a bug in the Almy C code here, # but it might be this translation is just wrong. iq = game.state.kscmdr + idelta if movescom(iq, avoid): # failed -- try some other maneuvers if idelta.x==0 or idelta.y==0: # attempt angle move if idelta.x != 0: iq.y = game.state.kscmdr.y + 1 if movescom(iq, avoid): iq.y = game.state.kscmdr.y - 1 movescom(iq, avoid) else: iq.x = game.state.kscmdr.x + 1 if movescom(iq, avoid): iq.x = game.state.kscmdr.x - 1 movescom(iq, avoid) else: # try moving just in x or y iq.y = game.state.kscmdr.y if movescom(iq, avoid): iq.y = game.state.kscmdr.y + idelta.y iq.x = game.state.kscmdr.x movescom(iq, avoid) # check for a base if len(game.state.baseq) == 0: unschedule(FSCMOVE) else: for (i, ibq) in enumerate(game.state.baseq): if ibq == game.state.kscmdr and game.state.kscmdr == game.battle: # attack the base if avoid: return # no, don't attack base! game.iseenit = False game.isatb = 1 schedule(FSCDBAS, randreal(1.0, 3.0)) if is_scheduled(FCDBAS): postpone(FSCDBAS, scheduled(FCDBAS)-game.state.date) if not communicating(): return # no warning game.iseenit = True announce() prout(_("Lt. Uhura- \"Captain, the starbase in Quadrant %s") \ % game.state.kscmdr) prout(_(" reports that it is under attack from the Klingon Super-commander.")) proutn(_(" It can survive until stardate %d.\"") \ % int(scheduled(FSCDBAS))) if not game.resting: return prout(_("Mr. Spock- \"Captain, shall we cancel the rest period?\"")) if ja() == False: return game.resting = False game.optime = 0.0; # actually finished return # Check for intelligence report if not idebug and \ (withprob(0.8) or \ (not communicating()) or \ not game.state.galaxy[game.state.kscmdr.x][game.state.kscmdr.y].charted): return announce() prout(_("Lt. Uhura- \"Captain, Starfleet Intelligence reports")) proutn(_(" the Super-commander is in Quadrant %s,") % game.state.kscmdr) return | e67cf36a789c4ab1cd905a9a08e91d219395f538 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3176/e67cf36a789c4ab1cd905a9a08e91d219395f538/sst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2240,
3076,
264,
13332,
315,
7607,
326,
14845,
3498,
264,
1199,
24288,
273,
2745,
5621,
888,
273,
2745,
5621,
9834,
85,
273,
2745,
5621,
612,
8967,
273,
2745,
1435,
2580,
278,
3083,
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,
2240,
3076,
264,
13332,
315,
7607,
326,
14845,
3498,
264,
1199,
24288,
273,
2745,
5621,
888,
273,
2745,
5621,
9834,
85,
273,
2745,
5621,
612,
8967,
273,
2745,
1435,
2580,
278,
3083,
273,
... |
self.__parse_status() | if self.__need_reparse(msg): self.__parse_status() def __need_reparse(self, line): indent = len(re.search(r"^(\t*)", line).group(1)) if indent > 1: return False line = line.lstrip("\t") if line.startswith("START\t"): return False return True | def __record(self, status_code, subdir, operation, status='', epoch_time=None): """ Actual function for recording a single line into the status logs. Should never be called directly, only by job.record as this would bypass the console monitor logging. """ | 7ddbb7c06d2d78c1a6414815de841d9f264f3aa9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12268/7ddbb7c06d2d78c1a6414815de841d9f264f3aa9/server_job.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
3366,
12,
2890,
16,
1267,
67,
710,
16,
16921,
16,
1674,
16,
1267,
2218,
2187,
7632,
67,
957,
33,
7036,
4672,
3536,
23788,
445,
364,
14949,
279,
2202,
980,
1368,
326,
1267,
5963,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3366,
12,
2890,
16,
1267,
67,
710,
16,
16921,
16,
1674,
16,
1267,
2218,
2187,
7632,
67,
957,
33,
7036,
4672,
3536,
23788,
445,
364,
14949,
279,
2202,
980,
1368,
326,
1267,
5963,
... |
def readline(self): | def readline(self, size=-1): if size < 0: size = sys.maxint | def readline(self): bufs = [] readsize = 100 while 1: c = self.read(readsize) i = string.find(c, '\n') if i >= 0 or c == '': bufs.append(c[:i+1]) self._unread(c[i+1:]) return string.join(bufs, '') bufs.append(c) readsize = readsize * 2 | db6b7a680bb447f5c6ea14edab0696d340732c70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/db6b7a680bb447f5c6ea14edab0696d340732c70/gzip.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12023,
12,
2890,
16,
963,
29711,
21,
4672,
309,
963,
411,
374,
30,
963,
273,
2589,
18,
1896,
474,
1681,
87,
273,
5378,
855,
1467,
273,
2130,
1323,
404,
30,
276,
273,
365,
18,
896,
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,
12023,
12,
2890,
16,
963,
29711,
21,
4672,
309,
963,
411,
374,
30,
963,
273,
2589,
18,
1896,
474,
1681,
87,
273,
5378,
855,
1467,
273,
2130,
1323,
404,
30,
276,
273,
365,
18,
896,
12... |
self.logo = False | def __init__(self, namespace = {}, shell='ipython', paint_func=None, idle_func=None): """ Initialization """ StringTerminal.__init__(self) self.paint_func = paint_func self.idle_func = idle_func self.stdout = Outfile (self, sys.stdout.fileno(), self.write_stdout) self.stderr = Outfile (self, sys.stderr.fileno(), self.write_stderr) self.stdin = Infile (self, sys.stdin.fileno(), self.write_stdout) self.sys_stdout = sys.stdout self.sys_stderr = sys.stderr self.sys_stdin = sys.stdin self.input_mode = False | fe073540bf8037e9f3becfb981aa7fc05baf437b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12213/fe073540bf8037e9f3becfb981aa7fc05baf437b/terminal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1981,
273,
10615,
5972,
2218,
9126,
3041,
2187,
12574,
67,
644,
33,
7036,
16,
12088,
67,
644,
33,
7036,
4672,
3536,
26586,
3536,
225,
514,
11336,
16186,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1981,
273,
10615,
5972,
2218,
9126,
3041,
2187,
12574,
67,
644,
33,
7036,
16,
12088,
67,
644,
33,
7036,
4672,
3536,
26586,
3536,
225,
514,
11336,
16186,
27... | |
self._libs, | def printVariantInfo(variantSetNum, variants, variantSets, variantData): if len(variantSets) < 2: # only log when more than 1 set return variantStr = json.dumps(variants,ensure_ascii=False) self._console.head("Processing variant set %s/%s" % (variantSetNum+1, len(variantSets))) | c48cd6507eef14f94c42e505cef4f53d334c06b0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5718/c48cd6507eef14f94c42e505cef4f53d334c06b0/Generator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
9356,
966,
12,
8688,
694,
2578,
16,
12935,
16,
5437,
2785,
16,
5437,
751,
4672,
309,
562,
12,
8688,
2785,
13,
411,
576,
30,
225,
468,
1338,
613,
1347,
1898,
2353,
404,
444,
327,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
9356,
966,
12,
8688,
694,
2578,
16,
12935,
16,
5437,
2785,
16,
5437,
751,
4672,
309,
562,
12,
8688,
2785,
13,
411,
576,
30,
225,
468,
1338,
613,
1347,
1898,
2353,
404,
444,
327,
... | |
try: args = [SongWrapper(args[0])] + list(args[1:]) | try: args = [args[0] and SongWrapper(args[0])] + list(args[1:]) | def invoke_event(self, event, *args): try: try: args = [SongWrapper(args[0])] + list(args[1:]) except IndexError: pass for handlers in self.events[event].values(): for handler in handlers: try: handler(*args) except Exception: print_exc() finally: self.check_change_and_refresh(args[0:1]) | 044abed2942ee94e4c6be61a1bd1dd718bd4a73b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4764/044abed2942ee94e4c6be61a1bd1dd718bd4a73b/plugins.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4356,
67,
2575,
12,
2890,
16,
871,
16,
380,
1968,
4672,
775,
30,
775,
30,
833,
273,
306,
1968,
63,
20,
65,
471,
348,
932,
3611,
12,
1968,
63,
20,
5717,
65,
397,
666,
12,
1968,
63,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4356,
67,
2575,
12,
2890,
16,
871,
16,
380,
1968,
4672,
775,
30,
775,
30,
833,
273,
306,
1968,
63,
20,
65,
471,
348,
932,
3611,
12,
1968,
63,
20,
5717,
65,
397,
666,
12,
1968,
63,
... |
3: annotations.glColor3dv, 4: annotations.glColor4dv, | 3: annotations.glColor3fv, 4: annotations.glColor4fv, | def glMaterial( faces, constant, *args ): """glMaterial -- convenience function to dispatch on argument type If passed a single argument in args, calls: glMaterialfv( faces, constant, args[0] ) else calls: glMaterialf( faces, constant, *args ) """ if len(args) == 1: arg = GLfloatArray.asArray( args[0] ) if arg is None: raise ValueError( """Null value in glMaterial: %s"""%(args,) ) return simple.glMaterialfv( faces, constant, arg ) else: return simple.glMaterialf( faces, constant, *args ) | 467dce018c806dcdcd7024565437b6208ec0bf7f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1545/467dce018c806dcdcd7024565437b6208ec0bf7f/exceptional.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5118,
11790,
12,
11058,
16,
5381,
16,
380,
1968,
262,
30,
3536,
7043,
11790,
1493,
13553,
445,
358,
3435,
603,
1237,
618,
225,
971,
2275,
279,
2202,
1237,
316,
833,
16,
4097,
30,
5118,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5118,
11790,
12,
11058,
16,
5381,
16,
380,
1968,
262,
30,
3536,
7043,
11790,
1493,
13553,
445,
358,
3435,
603,
1237,
618,
225,
971,
2275,
279,
2202,
1237,
316,
833,
16,
4097,
30,
5118,
... |
retcode = subprocess_call(["sed", "-i", "s, | retcode = subprocess_call(["sed", "-i", "s, | def release(self): quiet = config._get('quiet') version = config._get('version') | 0caba114cd86255dcf1be4e04b0b7cd10933fdd0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2758/0caba114cd86255dcf1be4e04b0b7cd10933fdd0/eagle3d.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3992,
12,
2890,
4672,
10902,
273,
642,
6315,
588,
2668,
20380,
6134,
1177,
273,
642,
6315,
588,
2668,
1589,
6134,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3992,
12,
2890,
4672,
10902,
273,
642,
6315,
588,
2668,
20380,
6134,
1177,
273,
642,
6315,
588,
2668,
1589,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
el1 = etree.SubElement(el1, 'draw:frame', attrib=attrib) | el1 = SubElement(el1, 'draw:frame', attrib=attrib) | def generate_figure(self, node, source, destination): caption = None for node1 in node.parent.children: if node1.tagname == 'caption': caption = node1.astext() self.image_count += 1 style_name = 'rstframestyle%d' % self.image_count if 'scale' in node.attributes: try: scale = int(node.attributes['scale']) if scale < 1 or scale > 100: raise ValueError scale = scale * 0.01 except ValueError, e: print 'Error: Invalid scale for image: "%s"' % ( node.attributes['scale'], ) else: scale = 1.0 width = None if 'width' in node.attributes: try: width = int(node.attributes['width']) width = width * (35.278 / 1000.0) width *= scale #attrib['svg:width'] = '%.2fcm' % (width, ) except ValueError, e: print 'Error: Invalid width for image: "%s"' % ( node.attributes['width'], ) height = None if 'height' in node.attributes: try: height = int(node.attributes['height']) height = height * (35.278 / 1000.0) height *= scale #attrib['svg:height'] = '%.2fcm' % (height, ) except ValueError, e: print 'Error: Invalid height for image: "%s"' % ( node.attributes['height'], ) # Add the styles attrib = { 'style:name': style_name, 'style:family': 'graphic', 'style:parent-style-name': 'Frame', } el1 = etree.SubElement(self.automatic_styles, 'style:style', attrib=attrib) halign = 'center' valign = 'top' if 'align' in node.attributes: align = node.attributes['align'].split() for val in align: if val in ('left', 'center', 'right'): halign = val elif val in ('top', 'middle', 'bottom'): valign = val attrib = { 'fo:margin-left': '0cm', 'fo:margin-right': '0cm', 'fo:margin-top': '0cm', 'fo:margin-bottom': '0cm', 'style:wrap': 'dynamic', 'style:number-wrapped-paragraphs': 'no-limit', 'style:vertical-pos': valign, 'style:vertical-rel': 'paragraph', 'style:horizontal-pos': halign, 'style:horizontal-rel': 'paragraph', 'fo:padding': '0cm', 'fo:border': 'none', } el2 = etree.SubElement(el1, 'style:graphic-properties', attrib=attrib) # Add the content attrib = {'text:style-name': 'rststyle-textbody'} el1 = etree.SubElement(self.current_element, 'text:p', attrib=attrib) attrib = { 'draw:style-name': style_name, 'draw:name': 'Frame1', 'text:anchor-type': 'paragraph', 'draw:z-index': '1', } if width is not None: attrib['svg:width'] = '%.2fcm' % (width, ) el1 = etree.SubElement(el1, 'draw:frame', attrib=attrib) attrib = {} if height is not None: attrib['fo:min-height'] = '%.2fcm' % (height, ) el1 = etree.SubElement(el1, 'draw:text-box', attrib=attrib) attrib = {'text:style-name': 'rststyle-caption', } el1 = etree.SubElement(el1, 'text:p', attrib=attrib) # Add the image (frame) inside the figure/caption frame. #ipshell('At visit_image #1') el2 = self.generate_image(node, source, destination, el1) if caption: el2.tail = caption | 57ceb741b8ea9b94d9b9e314a03912d12bd3c5c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1278/57ceb741b8ea9b94d9b9e314a03912d12bd3c5c5/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
19675,
12,
2890,
16,
756,
16,
1084,
16,
2929,
4672,
11006,
273,
599,
364,
756,
21,
316,
756,
18,
2938,
18,
5906,
30,
309,
756,
21,
18,
2692,
529,
422,
296,
15386,
4278,
110... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
19675,
12,
2890,
16,
756,
16,
1084,
16,
2929,
4672,
11006,
273,
599,
364,
756,
21,
316,
756,
18,
2938,
18,
5906,
30,
309,
756,
21,
18,
2692,
529,
422,
296,
15386,
4278,
110... |
self[name] = aid | self[name] = atom | def get_by_id(self, aid): """ return an atom instance for the ID *aid*. | 9664bf48adaf99ead50cfa8b98ea8d478fc464f5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10761/9664bf48adaf99ead50cfa8b98ea8d478fc464f5/atoms.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1637,
67,
350,
12,
2890,
16,
20702,
4672,
3536,
327,
392,
3179,
791,
364,
326,
1599,
380,
20736,
11146,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1637,
67,
350,
12,
2890,
16,
20702,
4672,
3536,
327,
392,
3179,
791,
364,
326,
1599,
380,
20736,
11146,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
index = text.indexOf(expression); | index = expression.indexIn(text) | def highlightBlock(self,text): if self.activated: lentxt = len(text) if text.indexOf('production:') >= 0: self.setCurrentBlockState(1) elif text.indexOf('endlsystem') >= 0: self.setCurrentBlockState(0) elif self.previousBlockState() == -1: self.setCurrentBlockState(0) else: self.setCurrentBlockState(self.previousBlockState()) for i,c in enumerate(text): if str(c.toAscii()) in self.delimiterkeywords: self.setFormat(i, 1, self.delimiterFormat) if self.currentBlockState() == 1: if lentxt > 0 and not str(text[0].toAscii()) in " \t": index = text.indexOf(self.lsysruleExp) if index >= 0: length = self.lsysruleExp.matchedLength() self.setFormat(index, length, self.prodFormat) else: index = text.indexOf(self.lsysruleExp2) if index >= 0: length = self.lsysruleExp2.matchedLength() self.setFormat(index, length, self.prodFormat) for rule in self.rules: expression = rule[0] index = text.indexOf(expression); while index >= 0: length = expression.matchedLength() if ((index == 0 or not text.at(index-1).isLetterOrNumber()) and (index == lentxt or not text.at(index+length).isLetterOrNumber())): self.setFormat(index, length, rule[1]) index = text.indexOf(expression, index + length) for rule in self.exprules: expression = rule[0] index = text.indexOf(expression); while index >= 0: length = expression.matchedLength() if index == 0 or not text.at(index-1).isLetterOrNumber(): self.setFormat(index+rule[1], length-rule[1]-rule[3], rule[2]) index = text.indexOf(expression, index + length) if self.tabviewactivated: index = text.indexOf(self.tabRule); if index >= 0: length = self.tabRule.matchedLength() for i in xrange(index,index+length): if text.at(i).toAscii() == '\t': self.setFormat(i, 1 , self.tabFormat) else: self.setFormat(i, 1 , self.spaceFormat) commentExp = self.commentExp #if self.currentBlockState() == 0 else self.ruleCommentExp index = text.indexOf(commentExp) while index >= 0: length = commentExp.matchedLength() self.setFormat(index, length, self.commentFormat) index = text.indexOf(commentExp,index+length+2) | 8a3d103092b8d7803b6a06874fe68caf66d9b044 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/796/8a3d103092b8d7803b6a06874fe68caf66d9b044/lpycodeeditor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8839,
1768,
12,
2890,
16,
955,
4672,
309,
365,
18,
18836,
30,
328,
319,
15239,
273,
562,
12,
955,
13,
309,
977,
18,
31806,
2668,
17273,
2497,
13,
1545,
374,
30,
365,
18,
542,
3935,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8839,
1768,
12,
2890,
16,
955,
4672,
309,
365,
18,
18836,
30,
328,
319,
15239,
273,
562,
12,
955,
13,
309,
977,
18,
31806,
2668,
17273,
2497,
13,
1545,
374,
30,
365,
18,
542,
3935,
1... |
if type(tup) is tuple and len(tup) == 2: (cline, outname) = tup | if type(tup) is tuple and len(tup) is 3: (cline, outname, linenum) = tup | def selfTest(args=[]): buildOnly = False if len(args) > 0: if "build" in args: buildOnly = True print "doing basic internal build/fill/run/delete/build/delete test." j = JobPersistence("sometest_db") j.buildTables() j.close() print " build and close" selfPopulateAndPrep(j) # clist = j.cmdsWithInput("/tmp/temp1111tempf_other.nc") j.showState() # now, pretend like we're executing. (cline, outname) = (None,None) while True: try: if cline is None: fetch = j.newFetchAndLockTransaction() (cline,outname) = fetch.execute() fetch = None else: print ":::opt skip fetch" except TypeError: print ":::no more lines to run!" break print ":::pretending to run %s" % (cline) j.showState() print ":::fake produce %s" % (outname) cmtcmd = j.newCommitAndFetchTransaction() tup = cmtcmd.execute(outname) cmtcmd = None (cline, outname) = (None,None) print "opt fetch got",tup if type(tup) is tuple and len(tup) == 2: (cline, outname) = tup print "opt got tuple!", tup j.showState() if buildOnly: return j.deleteTables() j.close() print " delete and closed" j.buildTables() j.close() print " build and closed" j.deleteTables() j.close() print " delete and closed" pass | aa6dbde9561cfb726097d6d2202601935b050184 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5203/aa6dbde9561cfb726097d6d2202601935b050184/ssdap_dbutil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
365,
4709,
12,
1968,
33,
8526,
4672,
1361,
3386,
273,
1083,
309,
562,
12,
1968,
13,
405,
374,
30,
309,
315,
3510,
6,
316,
833,
30,
1361,
3386,
273,
1053,
1172,
315,
2896,
310,
5337,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
365,
4709,
12,
1968,
33,
8526,
4672,
1361,
3386,
273,
1083,
309,
562,
12,
1968,
13,
405,
374,
30,
309,
315,
3510,
6,
316,
833,
30,
1361,
3386,
273,
1053,
1172,
315,
2896,
310,
5337,
... |
('create', ('/tmp/xxx',)), ('rename', ('/tmp/xxx', '/tmp/yyy')), ('CREATE', ('/tmp/yyz',)), ('append', ('/tmp/yyz', None, None, 'From: anon@x.y.z\n\ndata...')), ('select', ('/tmp/yyz',)), ('recent', ()), | ('create', ('/tmp/xxx 1',)), ('rename', ('/tmp/xxx 1', '/tmp/yyy')), ('CREATE', ('/tmp/yyz 2',)), ('append', ('/tmp/yyz 2', None, None, 'From: anon@x.y.z\n\ndata...')), ('select', ('/tmp/yyz 2',)), | def Time2Internaldate(date_time): """Convert 'date_time' to IMAP4 INTERNALDATE representation. Return string in form: '"DD-Mmm-YYYY HH:MM:SS +HHMM"' """ dttype = type(date_time) if dttype is type(1): tt = time.localtime(date_time) elif dttype is type(()): tt = date_time elif dttype is type(""): return date_time # Assume in correct format else: raise ValueError dt = time.strftime("%d-%b-%Y %H:%M:%S", tt) if dt[0] == '0': dt = ' ' + dt[1:] if time.daylight and tt[-1]: zone = -time.altzone else: zone = -time.timezone return '"' + dt + " %+02d%02d" % divmod(zone/60, 60) + '"' | 568f22046d54f57ebb15b35bb4692bb3d957b838 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/568f22046d54f57ebb15b35bb4692bb3d957b838/imaplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2647,
22,
3061,
712,
12,
712,
67,
957,
4672,
225,
3536,
2723,
296,
712,
67,
957,
11,
358,
6246,
2203,
24,
18139,
4594,
4335,
18,
225,
2000,
533,
316,
646,
30,
2119,
5698,
17,
49,
702... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2647,
22,
3061,
712,
12,
712,
67,
957,
4672,
225,
3536,
2723,
296,
712,
67,
957,
11,
358,
6246,
2203,
24,
18139,
4594,
4335,
18,
225,
2000,
533,
316,
646,
30,
2119,
5698,
17,
49,
702... |
Complete._fields_ = [("a", c_int)] | Complete._fields_ = [("a", c_long)] | def test_endian_types(self): for tp, fmt, shape, itemtp in endian_types: ob = tp() v = memoryview(ob) try: self.failUnlessEqual(v.format, fmt) self.failUnlessEqual(v.size, sizeof(ob)) self.failUnlessEqual(v.itemsize, sizeof(itemtp)) self.failUnlessEqual(v.shape, shape) # ctypes object always have a non-strided memory block self.failUnlessEqual(v.strides, None) # they are always read/write self.failIf(v.readonly) | 4cdb67bc03ea8044171c49a7a39fa16df2e966a2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/4cdb67bc03ea8044171c49a7a39fa16df2e966a2/test_pep3118.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
22910,
67,
2352,
12,
2890,
4672,
364,
8071,
16,
1325,
16,
2179,
16,
761,
6834,
316,
14759,
67,
2352,
30,
3768,
273,
8071,
1435,
331,
273,
3778,
1945,
12,
947,
13,
775,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
22910,
67,
2352,
12,
2890,
4672,
364,
8071,
16,
1325,
16,
2179,
16,
761,
6834,
316,
14759,
67,
2352,
30,
3768,
273,
8071,
1435,
331,
273,
3778,
1945,
12,
947,
13,
775,
30,
... |
self.table.setColumnCount(5) | self.table.setColumnCount(7) | def __init__(self, parent, items): QDialog.__init__(self, parent) Ui_DeleteMatchingFromDeviceDialog.__init__(self) self.setupUi(self) | 6b3fba80c3f83dac2d60149637dcebe84d302c29 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/6b3fba80c3f83dac2d60149637dcebe84d302c29/delete_matching_from_device.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
1516,
4672,
2238,
6353,
16186,
2738,
972,
12,
2890,
16,
982,
13,
22597,
67,
2613,
9517,
1265,
3654,
6353,
16186,
2738,
972,
12,
2890,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
1516,
4672,
2238,
6353,
16186,
2738,
972,
12,
2890,
16,
982,
13,
22597,
67,
2613,
9517,
1265,
3654,
6353,
16186,
2738,
972,
12,
2890,
13,
365,
1... |
return http.Response(stream = s) | return HTMLResponse(stream = s) | def render(self, ctx): id = self.id(ctx) W = self.worksheet if len(W.compute_cell_id_list()) <= 1: s = 'ignore' else: prev_id = W.delete_cell_with_id(id) s = encode_list(['delete', id, prev_id, W.cell_id_list()]) return http.Response(stream = s) | 39855fabbbbe971c1c1d64566b1625e9c1c6d482 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/39855fabbbbe971c1c1d64566b1625e9c1c6d482/twist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
1103,
4672,
612,
273,
365,
18,
350,
12,
5900,
13,
678,
273,
365,
18,
1252,
8118,
309,
562,
12,
59,
18,
9200,
67,
3855,
67,
350,
67,
1098,
10756,
1648,
404,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
1103,
4672,
612,
273,
365,
18,
350,
12,
5900,
13,
678,
273,
365,
18,
1252,
8118,
309,
562,
12,
59,
18,
9200,
67,
3855,
67,
350,
67,
1098,
10756,
1648,
404,
30,
... |
start = time.clock() | def relErr(x1, x2, reference): if reference != 0.0: return abs(x1-x2)/reference else: return 10e10 | cc3c74edcc16e76752434016e29c0680603c3080 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/885/cc3c74edcc16e76752434016e29c0680603c3080/greeks_in_american.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1279,
2524,
12,
92,
21,
16,
619,
22,
16,
2114,
4672,
309,
2114,
480,
374,
18,
20,
30,
327,
2417,
12,
92,
21,
17,
92,
22,
13176,
6180,
469,
30,
327,
1728,
73,
2163,
225,
2,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1279,
2524,
12,
92,
21,
16,
619,
22,
16,
2114,
4672,
309,
2114,
480,
374,
18,
20,
30,
327,
2417,
12,
92,
21,
17,
92,
22,
13176,
6180,
469,
30,
327,
1728,
73,
2163,
225,
2,
-100,
... | |
'pos_x': pos_x, 'pos_y':pos_y, 'issue_slug': issue_slug | 'pos_x': pos_x, 'pos_y':pos_y, 'issue_slug': issue.slug | def book(c, pos_x, pos_y, issue_slug): response = c.get(reverse('square_book', kwargs={ 'pos_x': pos_x, 'pos_y':pos_y, 'issue_slug': issue_slug })) | e5bec4746bf5105f3b0b6a8536079fc56f5688b2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4038/e5bec4746bf5105f3b0b6a8536079fc56f5688b2/fill.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6978,
12,
71,
16,
949,
67,
92,
16,
949,
67,
93,
16,
5672,
67,
6436,
4672,
766,
273,
276,
18,
588,
12,
9845,
2668,
19719,
67,
3618,
2187,
1205,
5899,
296,
917,
67,
92,
4278,
949,
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,
6978,
12,
71,
16,
949,
67,
92,
16,
949,
67,
93,
16,
5672,
67,
6436,
4672,
766,
273,
276,
18,
588,
12,
9845,
2668,
19719,
67,
3618,
2187,
1205,
5899,
296,
917,
67,
92,
4278,
949,
67... |
@type int: dict | @type types: dict | def encode(self, node, content): """ Add (soap) encoding information @param node: The node to update. @type node: L{Element} @param content: The content for which proccessing has ended. @type content: L{Object} """ if content.type.any(): Typer.auto(node, content.value) return resolved = self.resolver.top(1) if resolved is None: resolved = content.type.resolve() name = resolved.name ns = resolved.namespace() Typer.manual(node, name, ns) | 4972949ba1514adc4511186de73561a556bea6d1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5377/4972949ba1514adc4511186de73561a556bea6d1/marshaller.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2017,
12,
2890,
16,
756,
16,
913,
4672,
3536,
1436,
261,
19215,
13,
2688,
1779,
632,
891,
756,
30,
1021,
756,
358,
1089,
18,
632,
723,
756,
30,
511,
95,
1046,
97,
632,
891,
913,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2017,
12,
2890,
16,
756,
16,
913,
4672,
3536,
1436,
261,
19215,
13,
2688,
1779,
632,
891,
756,
30,
1021,
756,
358,
1089,
18,
632,
723,
756,
30,
511,
95,
1046,
97,
632,
891,
913,
30,
... |
def get(self, section, name, default=None): | def get(self, section, option, default=None): | def get(self, section, name, default=None): """Get the value of a option. | 87f41b8778adea6ff296608ee62d0ab5f3a24bb5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12268/87f41b8778adea6ff296608ee62d0ab5f3a24bb5/test_config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
16,
2442,
16,
1456,
16,
805,
33,
7036,
4672,
3536,
967,
326,
460,
434,
279,
1456,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
16,
2442,
16,
1456,
16,
805,
33,
7036,
4672,
3536,
967,
326,
460,
434,
279,
1456,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
email = email + str return string.strip(comment), string.strip(email) | addr.append(token[1]) return string.join(name, ' '), string.join(addr, '') | def parseaddr(address): import string str = '' email = '' comment = '' backslash = 0 dquote = 0 space = 0 paren = 0 bracket = 0 seen_bracket = 0 for c in address: if backslash: str = str + c backslash = 0 continue if c == '\\': backslash = 1 continue if dquote: if c == '"': dquote = 0 else: str = str + c continue if c == '"': dquote = 1 continue if c in string.whitespace: space = 1 continue if space: str = str + ' ' space = 0 if paren: if c == '(': paren = paren + 1 str = str + c continue if c == ')': paren = paren - 1 if paren == 0: comment = comment + str str = '' continue if c == '(': paren = paren + 1 if bracket: email = email + str str = '' elif not seen_bracket: email = email + str str = '' continue if bracket: if c == '>': bracket = 0 email = email + str str = '' continue if c == '<': bracket = 1 seen_bracket = 1 comment = comment + str str = '' email = '' continue if c == '#' and not bracket and not paren: # rest is comment break str = str + c if str: if seen_bracket: if bracket: email = str else: comment = comment + str else: if paren: comment = comment + str else: email = email + str return string.strip(comment), string.strip(email) | a27c46cb14f5161823e8286256b61e46ad0634c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/a27c46cb14f5161823e8286256b61e46ad0634c5/rfc822.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
4793,
12,
2867,
4672,
1930,
533,
609,
273,
875,
2699,
273,
875,
2879,
273,
875,
23253,
273,
374,
302,
6889,
273,
374,
3476,
273,
374,
22146,
273,
374,
9843,
273,
374,
5881,
67,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
4793,
12,
2867,
4672,
1930,
533,
609,
273,
875,
2699,
273,
875,
2879,
273,
875,
23253,
273,
374,
302,
6889,
273,
374,
3476,
273,
374,
22146,
273,
374,
9843,
273,
374,
5881,
67,
2... |
""" Extract the recordId """ | """ Extract the tag_number for record.""" | def extract_tag_from_record(record, tag_number): """ Extract the recordId """ # first step verify if the record is not already in the database if record: for tag in record.keys(): #Check the recordId if tag == tag_number: return record[tag] return None | c01e7675eac4ac02844b96fe38be4646d43de28c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/c01e7675eac4ac02844b96fe38be4646d43de28c/bibupload.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
67,
2692,
67,
2080,
67,
3366,
12,
3366,
16,
1047,
67,
2696,
4672,
3536,
8152,
326,
1047,
67,
2696,
364,
1409,
12123,
468,
1122,
2235,
3929,
309,
326,
1409,
353,
486,
1818,
316,
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,
2608,
67,
2692,
67,
2080,
67,
3366,
12,
3366,
16,
1047,
67,
2696,
4672,
3536,
8152,
326,
1047,
67,
2696,
364,
1409,
12123,
468,
1122,
2235,
3929,
309,
326,
1409,
353,
486,
1818,
316,
3... |
from whatsthis import createWhatsThis | from whatsthis import createWhatsThis | def hideDashboards(self): self.cookieCutterDashboard.hide() self.extrudeDashboard.hide() self.revolveDashboard.hide() self.depositAtomDashboard.hide() self.datumDispDashboard.hide() # (mark note: this is the datum display toolbar) self.selectMolDashboard.hide() self.selectAtomsDashboard.hide() self.moveMolDashboard.hide() | f333afc599a6d6f7adeb25cee44f264dbe437311 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/f333afc599a6d6f7adeb25cee44f264dbe437311/MWsemantics.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6853,
14830,
87,
12,
2890,
4672,
365,
18,
8417,
15812,
387,
14830,
18,
11248,
1435,
365,
18,
14523,
1317,
14830,
18,
11248,
1435,
365,
18,
9083,
5390,
14830,
18,
11248,
1435,
365,
18,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6853,
14830,
87,
12,
2890,
4672,
365,
18,
8417,
15812,
387,
14830,
18,
11248,
1435,
365,
18,
14523,
1317,
14830,
18,
11248,
1435,
365,
18,
9083,
5390,
14830,
18,
11248,
1435,
365,
18,
32... |
def find_max_invid(self,cr,uid,ids,address_id,type='out',state='confirmed'): | def find_max_invid(self,cr,uid,ids,address_id,state,type): | def find_max_invid(self,cr,uid,ids,address_id,type='out',state='confirmed'): cr.execute("select max(id) from stock_picking where type='%s' and state='%s' and address_id=%d"%(type,state,address_id)) max_picking_id=cr.fetchall()[0][0] cr.execute("select * from stock_picking pc where type='out' and state='confirmed' and address_id=%d"%(address_id)) picking_info=cr.dictfetchall() for data in picking_info: copy_move_line(self,cr,uid,ids,data['id'],max_picking_id) if data['id']<max_picking_id: cr.execute("update stock_picking set state='cancel' where id=%d"%(data['id'])) return True | f711d506f5db46cd8bb41f387aa6e333a3839624 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7339/f711d506f5db46cd8bb41f387aa6e333a3839624/merge_picking.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
1896,
67,
267,
1246,
12,
2890,
16,
3353,
16,
1911,
16,
2232,
16,
2867,
67,
350,
16,
2019,
16,
723,
4672,
225,
4422,
18,
8837,
2932,
4025,
943,
12,
350,
13,
628,
12480,
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,
1104,
67,
1896,
67,
267,
1246,
12,
2890,
16,
3353,
16,
1911,
16,
2232,
16,
2867,
67,
350,
16,
2019,
16,
723,
4672,
225,
4422,
18,
8837,
2932,
4025,
943,
12,
350,
13,
628,
12480,
67,
... |
f.write(" return vp.array[0];\n") | f.write(" return JSVAL_TO_OBJECT(vp.array[0]);\n") | def writeTraceableResultConv(f, type): typeName = getBuiltinOrNativeTypeName(type) if typeName is not None: template = traceableResultConvTemplates.get(typeName) if template is not None: values = { 'errorStr': getFailureString( getTraceInfoDefaultReturn(type), 2) } f.write(substitute(template, values)) return # else fall through; this type isn't supported yet elif isInterfaceType(type): if isVariantType(type): f.write(" JSBool ok = xpc_qsVariantToJsval(lccx, result, " "&vp.array[0]);\n") else: f.write(" JSBool ok = xpc_qsXPCOMObjectToJsval(lccx, " "ToSupports(result), xpc_qsGetWrapperCache(result), " "&NS_GET_IID(%s), &interfaces[k_%s], &vp.array[0]);\n" % (type.name, type.name)) f.write(" if (!ok) {\n"); writeFailure(f, getTraceInfoDefaultReturn(type), 2) f.write(" return vp.array[0];\n") return warn("Unable to convert result of type %s" % typeName) f.write(" !; // TODO - Convert `result` to jsval, store in rval.\n") f.write(" return xpc_qsThrow(cx, NS_ERROR_UNEXPECTED); // FIXME\n") | f54640901f9704aa02f15abc4882b5cd0254cf98 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11102/f54640901f9704aa02f15abc4882b5cd0254cf98/qsgen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
3448,
429,
1253,
17467,
12,
74,
16,
618,
4672,
8173,
273,
2882,
4853,
267,
1162,
9220,
7947,
12,
723,
13,
309,
8173,
353,
486,
599,
30,
1542,
273,
2606,
429,
1253,
17467,
8218,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
3448,
429,
1253,
17467,
12,
74,
16,
618,
4672,
8173,
273,
2882,
4853,
267,
1162,
9220,
7947,
12,
723,
13,
309,
8173,
353,
486,
599,
30,
1542,
273,
2606,
429,
1253,
17467,
8218,
1... |
print "in reParent for %s..." %repr(self.tree.GetItemText(parent)) | def reParent(self, parent, newParent): #import pdb;set_trace() print "in reParent for %s..." %repr(self.tree.GetItemText(parent)) | ca32727cc5bb3298e217074ff838c7a9f8ab45a0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8543/ca32727cc5bb3298e217074ff838c7a9f8ab45a0/SceneGraphUI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
283,
3054,
12,
2890,
16,
982,
16,
24818,
4672,
468,
5666,
10892,
31,
542,
67,
5129,
1435,
1172,
315,
267,
283,
3054,
364,
738,
87,
7070,
738,
12715,
12,
2890,
18,
3413,
18,
967,
1180,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
283,
3054,
12,
2890,
16,
982,
16,
24818,
4672,
468,
5666,
10892,
31,
542,
67,
5129,
1435,
1172,
315,
267,
283,
3054,
364,
738,
87,
7070,
738,
12715,
12,
2890,
18,
3413,
18,
967,
1180,
... | |
for child_pid in CHILD_PIDS: | global CHILD_POBJS unclosed_pobjs = [] for child_pobj in CHILD_POBJS: | def wait_on_children(): for child_pid in CHILD_PIDS: try: pid, code = util.__original_waitpid__(child_pid, os.WNOHANG) if not pid: continue ## Wasn't this one that died elif pid == -1: print >> sys.stderr, "Got -1! Why didn't python raise?" elif pid != child_pid: print >> sys.stderr, "pid (%d) != child_pid (%d)" % (pid, child_pid) # Defensively assume we could get a different pid back if CHILD_EVENTS.get(pid): event = CHILD_EVENTS.pop(pid) event.send(code) except OSError, e: if e[0] != errno.ECHILD: raise e elif CHILD_EVENTS.get(child_pid): # Already dead; signal, but assume success event = CHILD_EVENTS.pop(child_pid) event.send(0) | f20868eae87d6707fe31cb9c4e0cc6c0fc0e6f4d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10078/f20868eae87d6707fe31cb9c4e0cc6c0fc0e6f4d/processes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2529,
67,
265,
67,
5906,
13332,
2552,
6469,
11382,
67,
2419,
38,
6479,
6301,
13783,
67,
1631,
441,
87,
273,
5378,
364,
1151,
67,
1631,
441,
316,
6469,
11382,
67,
2419,
38,
6479,
30,
77... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2529,
67,
265,
67,
5906,
13332,
2552,
6469,
11382,
67,
2419,
38,
6479,
6301,
13783,
67,
1631,
441,
87,
273,
5378,
364,
1151,
67,
1631,
441,
316,
6469,
11382,
67,
2419,
38,
6479,
30,
77... |
p.amplitude = 10**(simplsms_amps[i]/20.0) | p.amplitude = simplsms_amps[i] | def test_peak_detection(self): """test_peak_detection Compare simplsms Peaks with SMS peaks. Exact peak information cannot be retrieved using libsms. Basic peak detection is performed by sms_detectPeaks, but this is called multiple times with different frame sizes by sms_analyze. This peak data cannot be returned from sms_analyze without modifying it, so here we compare the peaks to a slightly modified version of sms_analyze from simplsms. The peak values should be the same as those found by the simplsms find_peaks function. Analyses have to be performed separately due to libsms implementation issues.""" audio, sampling_rate = self.get_audio() simplsms.sms_init() analysis_params = self.simplsms_analysis_params(sampling_rate) analysis_params.iMaxDelayFrames = self.num_frames + 1 if simplsms.sms_initAnalysis(analysis_params) != 0: raise Exception("Error allocating memory for analysis_params") analysis_params.nFrames = self.num_frames sms_header = simplsms.SMS_Header() simplsms.sms_fillHeader(sms_header, analysis_params, "simplsms") | 5daa78a0630c865519e557fde5aed57dcdee4aea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10871/5daa78a0630c865519e557fde5aed57dcdee4aea/sms.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
10244,
67,
27515,
12,
2890,
4672,
3536,
3813,
67,
10244,
67,
27515,
11051,
9330,
20984,
19622,
581,
87,
598,
21297,
25168,
18,
30794,
11148,
1779,
2780,
506,
10295,
1450,
15042,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10244,
67,
27515,
12,
2890,
4672,
3536,
3813,
67,
10244,
67,
27515,
11051,
9330,
20984,
19622,
581,
87,
598,
21297,
25168,
18,
30794,
11148,
1779,
2780,
506,
10295,
1450,
15042,
... |
assert False, "%s attribute of Seismogram not of type %s" % (attr, typ) | msg = "%s attribute of Seismogram not of type %s" assert False, msg % (attr, typ) | def is_attr(self, attr, typ, default, length=False, assertation=False, verbose=False): """ True if attribute of certain type and optional length exists Function is probably most useful for checking if necessary attributes are provided, e.g. when writing seismograms to file | 6b07ccac666cb8c06ac765f82657fcb048f591a3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10470/6b07ccac666cb8c06ac765f82657fcb048f591a3/util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
1747,
12,
2890,
16,
1604,
16,
3815,
16,
805,
16,
769,
33,
8381,
16,
1815,
367,
33,
8381,
16,
3988,
33,
8381,
4672,
3536,
1053,
309,
1566,
434,
8626,
618,
471,
3129,
769,
170... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
1747,
12,
2890,
16,
1604,
16,
3815,
16,
805,
16,
769,
33,
8381,
16,
1815,
367,
33,
8381,
16,
3988,
33,
8381,
4672,
3536,
1053,
309,
1566,
434,
8626,
618,
471,
3129,
769,
170... |
self.ave_rate = self._temporal_rolling_ave(\ time_diff, read_diff, self.ave_rate, self.timescale) | def update(self, amount_read, now=None): if now is None: now = time.time() if amount_read == 0: # if we just started this file, all bets are off self.last_update_time = now self.last_amount_read = 0 self.ave_rate = None return | 9a135f5dabc48230cd64b53699bb78f5386f1a7a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7001/9a135f5dabc48230cd64b53699bb78f5386f1a7a/progress.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
16,
3844,
67,
896,
16,
2037,
33,
7036,
4672,
309,
2037,
353,
599,
30,
2037,
273,
813,
18,
957,
1435,
309,
3844,
67,
896,
422,
374,
30,
468,
309,
732,
2537,
5746,
333,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
16,
3844,
67,
896,
16,
2037,
33,
7036,
4672,
309,
2037,
353,
599,
30,
2037,
273,
813,
18,
957,
1435,
309,
3844,
67,
896,
422,
374,
30,
468,
309,
732,
2537,
5746,
333,... | |
result.append(' '.join([month, year])) return result | results.append(' '.join([month, year])) results.reverse() return results | def month_names(self): """ Return a list of translated month names used for the header of the table. """ result = [] for m in self.months: month = _(safe_unicode(m.strftime('%B'))) year = safe_unicode(str(m.year)) result.append(' '.join([month, year])) return result | ba1fa262578057c39ba9e968f5ae06f45118e0a0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10443/ba1fa262578057c39ba9e968f5ae06f45118e0a0/employees.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3138,
67,
1973,
12,
2890,
4672,
3536,
2000,
279,
666,
434,
9955,
3138,
1257,
1399,
364,
326,
1446,
434,
326,
1014,
18,
3536,
563,
273,
5378,
364,
312,
316,
365,
18,
27584,
30,
3138,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3138,
67,
1973,
12,
2890,
4672,
3536,
2000,
279,
666,
434,
9955,
3138,
1257,
1399,
364,
326,
1446,
434,
326,
1014,
18,
3536,
563,
273,
5378,
364,
312,
316,
365,
18,
27584,
30,
3138,
27... |
return '+(%s)' % op | return ('+', '(', op, ')') | def UPlus(self, expr, op): return '+(%s)' % op | d865e4bb2a2ccd72870204a5984403ca535a7525 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5223/d865e4bb2a2ccd72870204a5984403ca535a7525/emit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
587,
13207,
12,
2890,
16,
3065,
16,
1061,
4672,
327,
15126,
9275,
87,
2506,
738,
1061,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
587,
13207,
12,
2890,
16,
3065,
16,
1061,
4672,
327,
15126,
9275,
87,
2506,
738,
1061,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
is_policy_container=0 objectids=[] | is_policy_container = False objectids = [] | def getChainFor(self, ob): """ monkey-patched by CMFPlacefulWorkflow to look for placeful workflow configurations. """ cbt = self._chains_by_type if type(ob) == type(''): portal_type = ob elif hasattr(aq_base(ob), '_getPortalTypeName'): portal_type = ob._getPortalTypeName() else: portal_type = None if portal_type is None: return () # Take some extra care when ob is a string is_policy_container=0 objectids=[] try: objectids = ob.objectIds() except AttributeError, TypeError: pass if WorkflowPolicyConfig_id in objectids: is_policy_container=1 if type(ob) != type('') and portal_type != None and not is_policy_container: # Inspired by implementation in CPSWorkflowTool.py of CPSCore 3.9.0 # Workflow needs to be determined by true containment not context # so we loop over the actual containers wfpolicyconfig = None current_ob = aq_inner(ob) portal = aq_base(getToolByName(self, 'portal_url').getPortalObject()) while wfpolicyconfig is None and current_ob is not None: if base_hasattr(current_ob, WorkflowPolicyConfig_id): wfpolicyconfig = getattr(current_ob, WorkflowPolicyConfig_id) elif aq_base(current_ob) is portal: break current_ob = aq_inner(aq_parent(current_ob)) if wfpolicyconfig is not None: # Was it here or did we acquire? start_here = base_hasattr(aq_parent(aq_inner(ob)), WorkflowPolicyConfig_id) chain = wfpolicyconfig.getPlacefulChainFor(portal_type, start_here=start_here) if chain is not None: return chain chain = None if cbt is not None: chain = cbt.get(portal_type, None) # Note that if chain is not in cbt or has a value of # None, we use a default chain. if chain is None: chain = self.getDefaultChainFor(ob) if chain is None: return () return chain | e9fc2120ee5c4bdfecc26f88d71d8409ed12d4a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11955/e9fc2120ee5c4bdfecc26f88d71d8409ed12d4a9/workflowtoolPatch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30170,
1290,
12,
2890,
16,
3768,
4672,
3536,
6921,
856,
17,
2272,
329,
635,
385,
13542,
6029,
2706,
8484,
358,
2324,
364,
3166,
2706,
6095,
10459,
18,
3536,
2875,
88,
273,
365,
6315,
230... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30170,
1290,
12,
2890,
16,
3768,
4672,
3536,
6921,
856,
17,
2272,
329,
635,
385,
13542,
6029,
2706,
8484,
358,
2324,
364,
3166,
2706,
6095,
10459,
18,
3536,
2875,
88,
273,
365,
6315,
230... |
if save: import os, vobject new_vcard = vobject.vCard() new_vcard.add("prodid").value = "Arkadas 1.0" if has_child(self.vcard, "uid"): new_vcard.add("uid").value = uuid() if self.vcard.version.value == "3.0": new_vcard.add(self.vcard.n) else: n = self.vcard.n.value.split(";") new_vcard.add("n") new_vcard.n.value = vobject.vcard.Name(n[0], n[1], n[2], n[3], n[4]) new_vcard.add(self.vcard.fn) if self.hasphoto: photo = new_vcard.add("photo") if self.photodatatype == "URI": photo.value_param = "URI" else: photo.encoding_param = "b" photo.value = self.photodata for name in ("label", "mailer", "tz", "geo", "role", "logo", "agent",\ "categories", "sort-string", "sound", "class", "key", ): if has_child(self.vcard, name): new_vcard.add(self.vcard.contents[name][0]) | def switch_mode(self, edit=False, save=False): self.edit = edit self.addButton.set_sensitive(edit) self.saveButton.set_property("visible", edit) self.editButton.set_property("visible", not edit) self.imagechangeButton.set_property("visible", edit) self.imageremoveButton.set_property("visible", edit and self.hasphoto) self.changeButton.set_property("visible", edit) | 337e2628519817abde9df50dbed69c769add8439 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2651/337e2628519817abde9df50dbed69c769add8439/arkadas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1620,
67,
3188,
12,
2890,
16,
3874,
33,
8381,
16,
1923,
33,
8381,
4672,
365,
18,
4619,
273,
3874,
365,
18,
1289,
3616,
18,
542,
67,
23481,
12,
4619,
13,
365,
18,
5688,
3616,
18,
542,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1620,
67,
3188,
12,
2890,
16,
3874,
33,
8381,
16,
1923,
33,
8381,
4672,
365,
18,
4619,
273,
3874,
365,
18,
1289,
3616,
18,
542,
67,
23481,
12,
4619,
13,
365,
18,
5688,
3616,
18,
542,... | |
"debugdate": (debugdate, [('e','extended', None, _('try extended date formats'))], _('debugdata [-e] DATE [RANGE]')), | "debugdate": (debugdate, [('e', 'extended', None, _('try extended date formats'))], _('debugdate [-e] DATE [RANGE]')), | def version_(ui): """output version and copyright information""" ui.write(_("Mercurial Distributed SCM (version %s)\n") % version.get_version()) ui.status(_( "\nCopyright (C) 2005, 2006 Matt Mackall <mpm@selenic.com>\n" "This is free software; see the source for copying conditions. " "There is NO\nwarranty; " "not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" )) | dc5ec188a847abbd7fe6307540e0e54805414600 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/dc5ec188a847abbd7fe6307540e0e54805414600/commands.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1177,
67,
12,
4881,
4672,
3536,
2844,
1177,
471,
22245,
1779,
8395,
5915,
18,
2626,
24899,
2932,
8478,
1397,
649,
27877,
8795,
49,
261,
1589,
738,
87,
5153,
82,
7923,
738,
1177,
18,
588,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1177,
67,
12,
4881,
4672,
3536,
2844,
1177,
471,
22245,
1779,
8395,
5915,
18,
2626,
24899,
2932,
8478,
1397,
649,
27877,
8795,
49,
261,
1589,
738,
87,
5153,
82,
7923,
738,
1177,
18,
588,... |
print `props` | def _createnode(self): ''' create a node based on the contents of the form ''' cl = self.db.classes[self.classname] props = parsePropsFromForm(self.db, cl, self.form) | 32d4c8e2b4ce40eaecf7fc934f6015e4b64db5b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/32d4c8e2b4ce40eaecf7fc934f6015e4b64db5b8/cgi_client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
27350,
20680,
12,
2890,
4672,
9163,
752,
279,
756,
2511,
603,
326,
2939,
434,
326,
646,
9163,
927,
273,
365,
18,
1966,
18,
4701,
63,
2890,
18,
18340,
65,
3458,
273,
1109,
5047,
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,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
27350,
20680,
12,
2890,
4672,
9163,
752,
279,
756,
2511,
603,
326,
2939,
434,
326,
646,
9163,
927,
273,
365,
18,
1966,
18,
4701,
63,
2890,
18,
18340,
65,
3458,
273,
1109,
5047,
12... | |
return unicode(self.msg.fp.read(), errors='ignore') | return self.body | def getBody(self): return unicode(self.msg.fp.read(), errors='ignore') | e4fc328b2ad5db6985e54b3de1089e0f6fe35706 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/e4fc328b2ad5db6985e54b3de1089e0f6fe35706/message.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7587,
12,
2890,
4672,
327,
365,
18,
3432,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7587,
12,
2890,
4672,
327,
365,
18,
3432,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self['partitions'] = self['nr_reduces'] if 'partitions' in kwargs: if 'map' in self: self['nr_reduces'] = self['partitions'] | if 'nr_reduces' in kwargs: self['partitions'] = self['nr_reduces'] if 'map' in self: if self['partitions']: if self['merge_partitions']: self['nr_reduces'] = 1 else: self['nr_reduces'] = self['partitions'] | def __init__(self, *args, **kwargs): super(JobDict, self).__init__(*args, **kwargs) | 0e0fd15a8350d3c94f604b816a229d27a862dda4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/373/0e0fd15a8350d3c94f604b816a229d27a862dda4/core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
4333,
4672,
2240,
12,
2278,
5014,
16,
365,
2934,
972,
2738,
972,
30857,
1968,
16,
2826,
4333,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
4333,
4672,
2240,
12,
2278,
5014,
16,
365,
2934,
972,
2738,
972,
30857,
1968,
16,
2826,
4333,
13,
2,
-100,
-100,
-100,
-100,
-100,
-... |
assert(not ps.getLeaf("Gd11").allCertain()) | assert(ps.getLeaf("Gd11").allCertain()) | def testPredictSplits5(self): print "\ntest 5 begins" ps = PredictSplits("Gd", "Gd04", ['Titan', 'Angel', 'Gargoyle', 'Gargoyle', 'Centaur', 'Centaur', 'Ogre', 'Ogre']) ps.getLeaf("Gd04").revealCreatures(['Titan', 'Angel', 'Gargoyle', 'Gargoyle', 'Centaur', 'Centaur', 'Ogre', 'Ogre']) ps.printLeaves() assert(ps.getLeaf("Gd04").allCertain()) | a1e7652b31db9e2944ecac12c1206a83ec9b73fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3755/a1e7652b31db9e2944ecac12c1206a83ec9b73fd/test_predictsplits.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
21362,
16582,
25,
12,
2890,
4672,
1172,
1548,
496,
395,
1381,
17874,
6,
4250,
273,
19166,
933,
16582,
2932,
43,
72,
3113,
315,
43,
72,
3028,
3113,
10228,
56,
305,
304,
2187,
296,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
21362,
16582,
25,
12,
2890,
4672,
1172,
1548,
496,
395,
1381,
17874,
6,
4250,
273,
19166,
933,
16582,
2932,
43,
72,
3113,
315,
43,
72,
3028,
3113,
10228,
56,
305,
304,
2187,
296,
... |
else | else: | def __init__(data = None) if data == None: quickfix.StringField.__init__(self, 320) else quickfix.StringField.__init__(self, 320, data) | 484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
780,
974,
16186,
2738,
972,
12,
2890,
16,
890,
3462,
13,
469,
30,
9549,
904,
18,
780,
974,
16186,
2738,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
780,
974,
16186,
2738,
972,
12,
2890,
16,
890,
3462,
13,
469,
30,
9549,
904,
18,
780,
974,
16186,
2738,... |
pass | canpatch = True break | def apply_patch(patch): for fileno, filename in enumerate(patch["source"]): f2patch = filename if not exists(f2patch): f2patch = patch["target"][fileno] if not exists(f2patch): warning("source/target file does not exist\n\t--- %s\n\t+++ %s" % (filename, f2patch)) continue if not isfile(f2patch): warning("not a file - %s" % f2patch) continue # validate before patching f2fp = open(f2patch) hunkno = 0 hunk = patch["hunks"][fileno][hunkno] hunkfind = [] hunkreplace = [] validhunks = 0 for lineno, line in enumerate(f2fp): if lineno+1 < hunk["startsrc"]: continue elif lineno+1 == hunk["startsrc"]: hunkfind = [x[1:].rstrip("\n") for x in hunk["text"] if x[0] in " -"] #pprint(hunkfind) hunkreplace = [x[1:].rstrip("\n") for x in hunk["text"] if x[0] in " +"] #pprint(hunkreplace) hunklineno = 0 # todo \ No newline at end of file # check hunks in source file if lineno+1 < hunk["startsrc"]+len(hunkfind): if line.rstrip("\n") == hunkfind[hunklineno]: hunklineno+=1 else: warning("hunk no.%d doesn't match source file %s" % (hunkno+1, filename)) # file may be already patched, but we will chech other hunks anyway hunkno += 1 if hunkno < len(patch["hunks"][fileno]): hunk = patch["hunks"][fileno][hunkno] continue else: break if lineno+1 == hunk["startsrc"]+len(hunkfind): debug("file %s hunk no.%d -- is ready to be patched" % (filename, hunkno+1)) hunkno+=1 validhunks+=1 if hunkno < len(patch["hunks"][fileno]): hunk = patch["hunks"][fileno][hunkno] else: if validhunks == len(patch["hunks"][fileno]): # patch file pass else: if hunkno < len(patch["hunks"][fileno]): warning("premature end of source file %s at hunk %d" % (filename, hunkno+1)) f2fp.close() if validhunks < len(patch["hunks"][fileno]): if check_patched(filename, patch["hunks"][fileno]): warning("file %s is already patched" % filename) else: warning("source file is different - %s" % filename) # todo: check for premature eof | 4c002261ad86932d5cd8217a14b30f603de9067c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4098/4c002261ad86932d5cd8217a14b30f603de9067c/patch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
67,
2272,
12,
2272,
4672,
364,
24256,
16,
1544,
316,
4241,
12,
2272,
9614,
3168,
11929,
4672,
284,
22,
2272,
273,
1544,
309,
486,
1704,
12,
74,
22,
2272,
4672,
284,
22,
2272,
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,
2230,
67,
2272,
12,
2272,
4672,
364,
24256,
16,
1544,
316,
4241,
12,
2272,
9614,
3168,
11929,
4672,
284,
22,
2272,
273,
1544,
309,
486,
1704,
12,
74,
22,
2272,
4672,
284,
22,
2272,
273... |
conn.msg(chan, nick + ': ' + msg) | if chan == nick: conn.msg(chan, msg) else: conn.msg(chan, nick + ': ' + msg) | def reply(msg): conn.msg(chan, nick + ': ' + msg) | dcfea9f496f23929157c5a4ad40f282e4fade8df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9775/dcfea9f496f23929157c5a4ad40f282e4fade8df/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4332,
12,
3576,
4672,
1487,
18,
3576,
12,
7472,
16,
10909,
397,
4290,
296,
397,
1234,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4332,
12,
3576,
4672,
1487,
18,
3576,
12,
7472,
16,
10909,
397,
4290,
296,
397,
1234,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
EdkLogger.info('TOOL_CHAIN_TAG is: %s' % ''.join(build.Opt.TOOL_CHAIN_TAG)) | EdkLogger.info('TOOL_CHAIN_TAG is: %s' % ''.join(elem + ' ' for elem in build.Opt.TOOL_CHAIN_TAG)) | def main(): | fdc20ec6440ef040a5da13b6c57483df8d5210eb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/914/fdc20ec6440ef040a5da13b6c57483df8d5210eb/build.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.get_widget("content_status").set_text(self.status.content) self.get_widget("prop_status").set_text(self.status.metadata) | self.get_widget("content_status").set_text(unicode(self.status.content)) self.get_widget("prop_status").set_text(unicode(self.status.metadata)) | def __init__(self, path, vcs=None, claim_domain=True): rabbitvcs.ui.GladeWidgetWrapper.__init__(self, claim_domain=claim_domain) self.path = path self.vcs = vcs or rabbitvcs.vcs.VCS() self.checker = StatusChecker() self.get_widget("file_name").set_text(os.path.basename(path)) self.status = self.checker.check_status(path, recurse = False, invalidate = False, summary = False) | 8b4bb7b09587b04c72402ec4c45727e2e8d74e55 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5119/8b4bb7b09587b04c72402ec4c45727e2e8d74e55/property_page.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
589,
16,
20255,
33,
7036,
16,
7516,
67,
4308,
33,
5510,
4672,
767,
70,
3682,
18982,
18,
4881,
18,
21308,
2486,
4609,
3611,
16186,
2738,
972,
12,
2890,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
589,
16,
20255,
33,
7036,
16,
7516,
67,
4308,
33,
5510,
4672,
767,
70,
3682,
18982,
18,
4881,
18,
21308,
2486,
4609,
3611,
16186,
2738,
972,
12,
2890,
16... |
if line == '\n' or line == '': | if line == '\n' or not line: | def _install_message(self, message): """Write message contents and return (start, stop).""" start = self._file.tell() if isinstance(message, BabylMessage): special_labels = [] labels = [] for label in message.get_labels(): if label in self._special_labels: special_labels.append(label) else: labels.append(label) self._file.write('1') for label in special_labels: self._file.write(', ' + label) self._file.write(',,') for label in labels: self._file.write(' ' + label + ',') self._file.write(os.linesep) else: self._file.write('1,,' + os.linesep) if isinstance(message, email.message.Message): orig_buffer = StringIO.StringIO() orig_generator = email.generator.Generator(orig_buffer, False, 0) orig_generator.flatten(message) orig_buffer.seek(0) while True: line = orig_buffer.readline() self._file.write(line.replace('\n', os.linesep)) if line == '\n' or line == '': break self._file.write('*** EOOH ***' + os.linesep) if isinstance(message, BabylMessage): vis_buffer = StringIO.StringIO() vis_generator = email.generator.Generator(vis_buffer, False, 0) vis_generator.flatten(message.get_visible()) while True: line = vis_buffer.readline() self._file.write(line.replace('\n', os.linesep)) if line == '\n' or line == '': break else: orig_buffer.seek(0) while True: line = orig_buffer.readline() self._file.write(line.replace('\n', os.linesep)) if line == '\n' or line == '': break while True: buffer = orig_buffer.read(4096) # Buffer size is arbitrary. if buffer == '': break self._file.write(buffer.replace('\n', os.linesep)) elif isinstance(message, str): body_start = message.find('\n\n') + 2 if body_start - 2 != -1: self._file.write(message[:body_start].replace('\n', os.linesep)) self._file.write('*** EOOH ***' + os.linesep) self._file.write(message[:body_start].replace('\n', os.linesep)) self._file.write(message[body_start:].replace('\n', os.linesep)) else: self._file.write('*** EOOH ***' + os.linesep + os.linesep) self._file.write(message.replace('\n', os.linesep)) elif hasattr(message, 'readline'): original_pos = message.tell() first_pass = True while True: line = message.readline() self._file.write(line.replace('\n', os.linesep)) if line == '\n' or line == '': self._file.write('*** EOOH ***' + os.linesep) if first_pass: first_pass = False message.seek(original_pos) else: break while True: buffer = message.read(4096) # Buffer size is arbitrary. if buffer == '': break self._file.write(buffer.replace('\n', os.linesep)) else: raise TypeError('Invalid message type: %s' % type(message)) stop = self._file.tell() return (start, stop) | 3ae5cf1ce9baf6330ccf73291ebfeaee2c111013 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/3ae5cf1ce9baf6330ccf73291ebfeaee2c111013/mailbox.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5425,
67,
2150,
12,
2890,
16,
883,
4672,
3536,
3067,
883,
2939,
471,
327,
261,
1937,
16,
2132,
13,
12123,
787,
273,
365,
6315,
768,
18,
88,
1165,
1435,
309,
1549,
12,
2150,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5425,
67,
2150,
12,
2890,
16,
883,
4672,
3536,
3067,
883,
2939,
471,
327,
261,
1937,
16,
2132,
13,
12123,
787,
273,
365,
6315,
768,
18,
88,
1165,
1435,
309,
1549,
12,
2150,
16,
... |
return self._arg_arg_op_with_imm(gv_x, gv_y, _PPC.xor, _PPC.xori, commutative=True) | return self._arg_arg_op_with_uimm(gv_x, gv_y, _PPC.xor, _PPC.xori, commutative=True) | def op_int_xor(self, gv_x, gv_y): return self._arg_arg_op_with_imm(gv_x, gv_y, _PPC.xor, _PPC.xori, commutative=True) | 1a13bb2e4052fbbe77efb6b6dbf2fa6c38d03672 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6934/1a13bb2e4052fbbe77efb6b6dbf2fa6c38d03672/rgenop.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1061,
67,
474,
67,
31346,
12,
2890,
16,
11404,
67,
92,
16,
11404,
67,
93,
4672,
327,
365,
6315,
3175,
67,
3175,
67,
556,
67,
1918,
67,
381,
81,
12,
75,
90,
67,
92,
16,
11404,
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,
1061,
67,
474,
67,
31346,
12,
2890,
16,
11404,
67,
92,
16,
11404,
67,
93,
4672,
327,
365,
6315,
3175,
67,
3175,
67,
556,
67,
1918,
67,
381,
81,
12,
75,
90,
67,
92,
16,
11404,
67,
... |
pass | setCommandOrder=True | def updateAdvanced(self, slotid): sec = eDVBSatelliteEquipmentControl.getInstance() lnbSat = {} for x in range(1,33): lnbSat[x] = [] for x in self.NimManager.satList: lnb = config.Nims[slotid].advanced.sat[x[1]].lnb.value if lnb != 0: lnbSat[lnb].append(x[1]) for x in range(1,33): if len(lnbSat[x]) > 0: currLnb = config.Nims[slotid].advanced.lnb[x] sec.addLNB() sec.setLNBTunerMask(1 << slotid) if currentConfigSelectionElement(currLnb.lof) == "universal_lnb": sec.setLNBLOFL(9750000) sec.setLNBLOFH(10600000) sec.setLNBThreshold(11750000) elif currentConfigSelectionElement(currLnb.lof) == "c_band": sec.setLNBLOFL(5150000) sec.setLNBLOFH(5150000) sec.setLNBThreshold(5150000) elif currentConfigSelectionElement(currLnb.lof) == "user_defined": sec.setLNBLOFL(currLnb.lofl.value * 1000) sec.setLNBLOFH(currLnb.lofh.value * 1000) sec.setLNBThreshold(currLnb.threshold.value * 1000) if currentConfigSelectionElement(currLnb.output_12v) == "0V": pass elif currentConfigSelectionElement(currLnb.output_12v) == "12V": pass if currentConfigSelectionElement(currLnb.increased_voltage) == "yes": pass else: pass if currentConfigSelectionElement(currLnb.diseqcMode) == "none": pass elif currentConfigSelectionElement(currLnb.diseqcMode) == "1_0": pass elif currentConfigSelectionElement(currLnb.diseqcMode) == "1_1": pass elif currentConfigSelectionElement(currLnb.diseqcMode) == "1_2": pass | 45b15800295dbe7e8aa64c7c97e62ed7a9f0a137 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/45b15800295dbe7e8aa64c7c97e62ed7a9f0a137/NimManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
23618,
12,
2890,
16,
4694,
350,
4672,
1428,
273,
425,
30199,
12692,
270,
19345,
13142,
11568,
3367,
18,
588,
1442,
1435,
328,
6423,
15163,
273,
2618,
364,
619,
316,
1048,
12,
21,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
23618,
12,
2890,
16,
4694,
350,
4672,
1428,
273,
425,
30199,
12692,
270,
19345,
13142,
11568,
3367,
18,
588,
1442,
1435,
328,
6423,
15163,
273,
2618,
364,
619,
316,
1048,
12,
21,
1... |
path = dlg.GetPath() | path = self._suffixPath(dlg.GetPath()) | def OnSaveAs(self, e): dlg = wx.FileDialog(self._ui, message="Save %s as..." % self._type, wildcard=self._wildcard, style = wx.SAVE | wx.CHANGE_DIR) if dlg.ShowModal() != wx.ID_OK: return path = dlg.GetPath() dlg.Destroy() if os.path.exists(path): d = wx.MessageDialog(self._ui, caption="Overwrite file?", message = "There already is a program of that name. Replace it with your program?", style=wx.ICON_QUESTION | wx.OK | wx.CANCEL) if d.ShowModal() != wx.ID_OK: return try: self._tildeSave(path) except Exception, e: self._exception("save", e) else: self._path = path self._canSave = True self._clearModified() | c6246e4c0d475e67432f74cc9ab46e0c78ba4c95 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10214/c6246e4c0d475e67432f74cc9ab46e0c78ba4c95/ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
4755,
1463,
12,
2890,
16,
425,
4672,
25840,
273,
7075,
18,
812,
6353,
12,
2890,
6315,
4881,
16,
883,
1546,
4755,
738,
87,
487,
7070,
738,
365,
6315,
723,
16,
8531,
33,
2890,
6315... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
4755,
1463,
12,
2890,
16,
425,
4672,
25840,
273,
7075,
18,
812,
6353,
12,
2890,
6315,
4881,
16,
883,
1546,
4755,
738,
87,
487,
7070,
738,
365,
6315,
723,
16,
8531,
33,
2890,
6315... |
%s : (?:[ ]+|$) | %s : ([ ]+|$) | def build_table_row(self, rowdata, tableline): row = nodes.row() for cell in rowdata: if cell is None: continue morerows, morecols, offset, cellblock = cell attributes = {} if morerows: attributes['morerows'] = morerows if morecols: attributes['morecols'] = morecols entry = nodes.entry(**attributes) row += entry if ''.join(cellblock): self.nested_parse(cellblock, input_offset=tableline+offset, node=entry) return row | 6782c922e166489b456fc617b1d5765e9532726e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1532/6782c922e166489b456fc617b1d5765e9532726e/states.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
2121,
67,
492,
12,
2890,
16,
1027,
892,
16,
3246,
80,
3027,
4672,
1027,
273,
2199,
18,
492,
1435,
364,
2484,
316,
1027,
892,
30,
309,
2484,
353,
599,
30,
1324,
312,
8922,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
2121,
67,
492,
12,
2890,
16,
1027,
892,
16,
3246,
80,
3027,
4672,
1027,
273,
2199,
18,
492,
1435,
364,
2484,
316,
1027,
892,
30,
309,
2484,
353,
599,
30,
1324,
312,
8922,
5... |
sage: [ value, edges, [ setA, setB ]] = g.max_cut(vertices=True) sage: value == 5*6 | sage: [ value, edges, [ setA, setB ]] = g.max_cut(vertices=True) sage: value == 5*6 | def max_cut(self, value_only=True, use_edge_labels=True, vertices=False, solver=None, verbose=0): r""" Returns a maximum edge cut of the graph. For more information, see the `Wikipedia article on cuts <http://en.wikipedia.org/wiki/Cut_%28graph_theory%29>`_. INPUT: | 5e5675fbbda4b56d6c68a34b01203655c16cdb9e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/5e5675fbbda4b56d6c68a34b01203655c16cdb9e/generic_graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
943,
67,
5150,
12,
2890,
16,
460,
67,
3700,
33,
5510,
16,
999,
67,
7126,
67,
5336,
33,
5510,
16,
6928,
33,
8381,
16,
12776,
33,
7036,
16,
3988,
33,
20,
4672,
436,
8395,
2860,
279,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
943,
67,
5150,
12,
2890,
16,
460,
67,
3700,
33,
5510,
16,
999,
67,
7126,
67,
5336,
33,
5510,
16,
6928,
33,
8381,
16,
12776,
33,
7036,
16,
3988,
33,
20,
4672,
436,
8395,
2860,
279,
... |
gLogger.error(errStr,res['Message']) | gLogger.error( errStr, res['Message'] ) | def executeRequest(self): ################################################ # Get a request from request DB res = self.RequestDBClient.getRequest('register') if not res['OK']: gLogger.info("RegistrationAgent.execute: Failed to get request from database.") return S_OK() elif not res['Value']: gLogger.info("RegistrationAgent.execute: No requests to be executed found.") return S_OK() requestString = res['Value']['RequestString'] requestName = res['Value']['RequestName'] sourceServer = res['Value']['Server'] try: jobID = int(res['Value']['JobID']) except: jobID = 0 gLogger.info("RegistrationAgent.execute: Obtained request %s" % requestName) | 991ec8b0394b656ec2c67f7fb0b500c383f8babd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/991ec8b0394b656ec2c67f7fb0b500c383f8babd/RegistrationAgent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
691,
12,
2890,
4672,
19709,
26487,
13151,
468,
968,
279,
590,
628,
590,
2383,
400,
273,
365,
18,
691,
2290,
1227,
18,
588,
691,
2668,
4861,
6134,
309,
486,
400,
3292,
3141,
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,
1836,
691,
12,
2890,
4672,
19709,
26487,
13151,
468,
968,
279,
590,
628,
590,
2383,
400,
273,
365,
18,
691,
2290,
1227,
18,
588,
691,
2668,
4861,
6134,
309,
486,
400,
3292,
3141,
3546,
... |
leopardid = Animal.insert().execute(Species='Leopard', Lifespan=73.5, | leopardid = Animal.insert().execute(Species=u'Leopard', Lifespan=73.5, | def test_1a_populate(self): Zoo = metadata.tables['Zoo'] Animal = metadata.tables['Animal'] wap = Zoo.insert().execute(Name='Wild Animal Park', Founded=datetime.date(2000, 1, 1), # 59 can give rounding errors with divmod, which # AdapterFromADO needs to correct. Opens=datetime.time(8, 15, 59), LastEscape=datetime.datetime(2004, 7, 29, 5, 6, 7), Admission=4.95, ).last_inserted_ids()[0] sdz = Zoo.insert().execute(Name = 'San Diego Zoo', Founded = datetime.date(1935, 9, 13), Opens = datetime.time(9, 0, 0), Admission = 0, ).last_inserted_ids()[0] Zoo.insert().execute( Name = u'Montr\xe9al Biod\xf4me', Founded = datetime.date(1992, 6, 19), Opens = datetime.time(9, 0, 0), Admission = 11.75, ) seaworld = Zoo.insert().execute( Name = 'Sea_World', Admission = 60).last_inserted_ids()[0] # Let's add a crazy futuristic Zoo to test large date values. lp = Zoo.insert().execute(Name = 'Luna Park', Founded = datetime.date(2072, 7, 17), Opens = datetime.time(0, 0, 0), Admission = 134.95, ).last_inserted_ids()[0] # Animals leopardid = Animal.insert().execute(Species='Leopard', Lifespan=73.5, ).last_inserted_ids()[0] Animal.update(Animal.c.ID==leopardid).execute(ZooID=wap, LastEscape=datetime.datetime(2004, 12, 21, 8, 15, 0, 999907)) lion = Animal.insert().execute(Species='Lion', ZooID=wap).last_inserted_ids()[0] Animal.insert().execute(Species='Slug', Legs=1, Lifespan=.75) tiger = Animal.insert().execute(Species='Tiger', ZooID=sdz ).last_inserted_ids()[0] # Override Legs.default with itself just to make sure it works. Animal.insert().execute(Species='Bear', Legs=4) Animal.insert().execute(Species='Ostrich', Legs=2, Lifespan=103.2) Animal.insert().execute(Species='Centipede', Legs=100) emp = Animal.insert().execute(Species='Emperor Penguin', Legs=2, ZooID=seaworld).last_inserted_ids()[0] adelie = Animal.insert().execute(Species='Adelie Penguin', Legs=2, ZooID=seaworld).last_inserted_ids()[0] Animal.insert().execute(Species='Millipede', Legs=1000000, ZooID=sdz) # Add a mother and child to test relationships bai_yun = Animal.insert().execute(Species='Ape', Name='Bai Yun', Legs=2).last_inserted_ids()[0] Animal.insert().execute(Species='Ape', Name='Hua Mei', Legs=2, MotherID=bai_yun) | 4d7f279d14ca4dd275de58ba11fe28a28a09dc46 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1074/4d7f279d14ca4dd275de58ba11fe28a28a09dc46/zoomark.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
21,
69,
67,
19936,
12,
2890,
4672,
2285,
5161,
273,
1982,
18,
9373,
3292,
62,
5161,
3546,
1922,
2840,
273,
1982,
18,
9373,
3292,
979,
2840,
3546,
225,
341,
438,
273,
2285,
51... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
21,
69,
67,
19936,
12,
2890,
4672,
2285,
5161,
273,
1982,
18,
9373,
3292,
62,
5161,
3546,
1922,
2840,
273,
1982,
18,
9373,
3292,
979,
2840,
3546,
225,
341,
438,
273,
2285,
51... |
print type(nbands) return self.calc.GetWannierLocalizationMatrix(nbands, dirG, kpoint, nextkpoint, G_I, spin) | from Numeric import array, Float return npy.array(self.calc.GetWannierLocalizationMatrix( array(G_I, Float), nbands, array(dirG, Float), kpoint, nextkpoint, spin)) | def get_wannier_localization_matrix(self, nbands, dirG, kpoint, nextkpoint, G_I, spin): print type(nbands) return self.calc.GetWannierLocalizationMatrix(nbands, dirG, kpoint, nextkpoint, G_I, spin) | 7c9410d9b716247f70d769cc251ec92138740669 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5735/7c9410d9b716247f70d769cc251ec92138740669/old.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
91,
1072,
2453,
67,
3729,
1588,
67,
5667,
12,
2890,
16,
4264,
5708,
16,
1577,
43,
16,
417,
1153,
16,
1024,
79,
1153,
16,
611,
67,
45,
16,
12490,
4672,
628,
16980,
1930,
526,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
91,
1072,
2453,
67,
3729,
1588,
67,
5667,
12,
2890,
16,
4264,
5708,
16,
1577,
43,
16,
417,
1153,
16,
1024,
79,
1153,
16,
611,
67,
45,
16,
12490,
4672,
628,
16980,
1930,
526,... |
Returns the overlap of the skew partition skp. | def overlap_aux(skp): """ Returns the overlap of the skew partition skp. EXAMPLES: sage: overlap = sage.combinat.skew_partition.overlap_aux sage: overlap([[],[]]) +Infinity sage: overlap([[1],[]]) +Infinity sage: overlap([[10],[2]]) +Infinity sage: overlap([[10,1],[2]]) -1 """ p,q = skp if len(p) <= 1: return infinity if q == []: return min(p) r = [ q[0] ] + q return min(rowlengths_aux([p,r])) | b6d131dfd55f099c60084912ff7861c93759724b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/b6d131dfd55f099c60084912ff7861c93759724b/skew_partition.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7227,
67,
18196,
12,
7771,
84,
4672,
3536,
5675,
8900,
11386,
30,
272,
410,
30,
7227,
273,
272,
410,
18,
832,
4757,
270,
18,
7771,
359,
67,
10534,
18,
17946,
67,
18196,
272,
410,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7227,
67,
18196,
12,
7771,
84,
4672,
3536,
5675,
8900,
11386,
30,
272,
410,
30,
7227,
273,
272,
410,
18,
832,
4757,
270,
18,
7771,
359,
67,
10534,
18,
17946,
67,
18196,
272,
410,
30,
... | |
properties, the :class:`~admin_tools.dashboard.modules.AppList` | properties, the :class:`~admin_tools.dashboard.modules.Group` | def render_css_classes(self): """ Return a string containing the css classes for the module. | e2f0aa2ca3220cabec8860095a8503ed52aa6d75 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3482/e2f0aa2ca3220cabec8860095a8503ed52aa6d75/modules.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
5212,
67,
4701,
12,
2890,
4672,
3536,
2000,
279,
533,
4191,
326,
3747,
3318,
364,
326,
1605,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
5212,
67,
4701,
12,
2890,
4672,
3536,
2000,
279,
533,
4191,
326,
3747,
3318,
364,
326,
1605,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
self.model=Redland.librdf_new_model(__world__.world, storage.storage, args['options_string']) | self.model=Redland.librdf_new_model(_world.world, storage.storage, args['options_string']) | def __init__(self, storage, **args): """Create an RDF Model (constructor).""" if __debug__: print "Creating RDF.model args=",args self.model=None self.storage=None | 9d200f22543978d0df7fbde12b64052f94f16755 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14754/9d200f22543978d0df7fbde12b64052f94f16755/RDF.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2502,
16,
2826,
1968,
4672,
3536,
1684,
392,
13539,
3164,
261,
12316,
13,
12123,
309,
1001,
4148,
972,
30,
1172,
315,
11092,
13539,
18,
2284,
833,
1546,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2502,
16,
2826,
1968,
4672,
3536,
1684,
392,
13539,
3164,
261,
12316,
13,
12123,
309,
1001,
4148,
972,
30,
1172,
315,
11092,
13539,
18,
2284,
833,
1546,
16... |
self.body.append('}') | self.body.append('}\n') | def depart_caption(self, node): self.body.append('}') | fb3336a6d5cf7ea080d0ead3a5384f168a9030c0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1278/fb3336a6d5cf7ea080d0ead3a5384f168a9030c0/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26000,
67,
15386,
12,
2890,
16,
756,
4672,
365,
18,
3432,
18,
6923,
2668,
1713,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26000,
67,
15386,
12,
2890,
16,
756,
4672,
365,
18,
3432,
18,
6923,
2668,
1713,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
If the modified argument is supplied, it can be a tuple of 9 integers (as returned by gmtime() in the standard Python time module) or a date string in any format supported by feedparser. Regardless, it MUST be in GMT (Greenwich Mean Time). It will be reformatted into an RFC 1123-compliant date and used as the value of an If-Modified-Since request header. | If the modified argument is supplied, it must be a tuple of 9 integers as returned by gmtime() in the standard Python time module. This MUST be in GMT (Greenwich Mean Time). The formatted date/time will be used as the value of an If-Modified-Since request header. | def _open_resource(url_file_stream_or_string, etag, modified, agent, referrer, handlers): """URL, filename, or string --> stream This function lets you define parsers that take any input source (URL, pathname to local or network file, or actual data as a string) and deal with it in a uniform manner. Returned object is guaranteed to have all the basic stdio read methods (read, readline, readlines). Just .close() the object when you're done with it. If the etag argument is supplied, it will be used as the value of an If-None-Match request header. If the modified argument is supplied, it can be a tuple of 9 integers (as returned by gmtime() in the standard Python time module) or a date string in any format supported by feedparser. Regardless, it MUST be in GMT (Greenwich Mean Time). It will be reformatted into an RFC 1123-compliant date and used as the value of an If-Modified-Since request header. If the agent argument is supplied, it will be used as the value of a User-Agent request header. If the referrer argument is supplied, it will be used as the value of a Referer[sic] request header. If handlers is supplied, it is a list of handlers used to build a urllib2 opener. """ if hasattr(url_file_stream_or_string, 'read'): return url_file_stream_or_string if url_file_stream_or_string == '-': return sys.stdin if urlparse.urlparse(url_file_stream_or_string)[0] in ('http', 'https', 'ftp'): if not agent: agent = USER_AGENT # test for inline user:password for basic auth auth = None if base64: urltype, rest = urllib.splittype(url_file_stream_or_string) realhost, rest = urllib.splithost(rest) if realhost: user_passwd, realhost = urllib.splituser(realhost) if user_passwd: url_file_stream_or_string = '%s://%s%s' % (urltype, realhost, rest) auth = base64.encodestring(user_passwd).strip() # iri support try: if isinstance(url_file_stream_or_string,unicode): url_file_stream_or_string = url_file_stream_or_string.encode('idna') else: url_file_stream_or_string = url_file_stream_or_string.decode('utf-8').encode('idna') except: pass # try to open with urllib2 (to use optional headers) request = urllib2.Request(url_file_stream_or_string) request.add_header('User-Agent', agent) if etag: request.add_header('If-None-Match', etag) if type(modified) == type(''): modified = _parse_date(modified) if modified: # format into an RFC 1123-compliant timestamp. We can't use # time.strftime() since the %a and %b directives can be affected # by the current locale, but RFC 2616 states that dates must be # in English. short_weekdays = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] request.add_header('If-Modified-Since', '%s, %02d %s %04d %02d:%02d:%02d GMT' % (short_weekdays[modified[6]], modified[2], months[modified[1] - 1], modified[0], modified[3], modified[4], modified[5])) if referrer: request.add_header('Referer', referrer) if gzip and zlib: request.add_header('Accept-encoding', 'gzip, deflate') elif gzip: request.add_header('Accept-encoding', 'gzip') elif zlib: request.add_header('Accept-encoding', 'deflate') else: request.add_header('Accept-encoding', '') if auth: request.add_header('Authorization', 'Basic %s' % auth) if ACCEPT_HEADER: request.add_header('Accept', ACCEPT_HEADER) request.add_header('A-IM', 'feed') # RFC 3229 support opener = apply(urllib2.build_opener, tuple([_FeedURLHandler()] + handlers)) opener.addheaders = [] # RMK - must clear so we only send our custom User-Agent try: return opener.open(request) finally: opener.close() # JohnD # try to open with native open function (if url_file_stream_or_string is a filename) try: return open(url_file_stream_or_string) except: pass # treat url_file_stream_or_string as string return _StringIO(str(url_file_stream_or_string)) | b46d7e4f5773873813bf0c2abf7f311d20f6ee9d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10695/b46d7e4f5773873813bf0c2abf7f311d20f6ee9d/feedparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3190,
67,
3146,
12,
718,
67,
768,
67,
3256,
67,
280,
67,
1080,
16,
13655,
16,
4358,
16,
4040,
16,
14502,
16,
4919,
4672,
3536,
1785,
16,
1544,
16,
578,
533,
15431,
1407,
225,
12... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3190,
67,
3146,
12,
718,
67,
768,
67,
3256,
67,
280,
67,
1080,
16,
13655,
16,
4358,
16,
4040,
16,
14502,
16,
4919,
4672,
3536,
1785,
16,
1544,
16,
578,
533,
15431,
1407,
225,
12... |
self.active = False self.active_lock = threading.Lock() | def __init__(self, server_address, RequestHandlerClass, certfile): | f08683542eada763321715f558eac5b2baec28e9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/f08683542eada763321715f558eac5b2baec28e9/test_ssl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1438,
67,
2867,
16,
25106,
797,
16,
3320,
768,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1438,
67,
2867,
16,
25106,
797,
16,
3320,
768,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
_tb = f.f_exc_traceback | _tb = tb | def __get_stack(self, ctx, ctid, fException): tid = ctx.m_thread_id | 668d41c30c0b6c60e0b511d5a04e5803f7b2f266 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1662/668d41c30c0b6c60e0b511d5a04e5803f7b2f266/rpdb2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
67,
3772,
12,
2890,
16,
1103,
16,
5691,
350,
16,
284,
503,
4672,
11594,
273,
1103,
18,
81,
67,
5930,
67,
350,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
588,
67,
3772,
12,
2890,
16,
1103,
16,
5691,
350,
16,
284,
503,
4672,
11594,
273,
1103,
18,
81,
67,
5930,
67,
350,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.paragraph_style_stack.append(self.rststyle('blockindent')) | self.paragraph_style_stack.append( self.rststyle('deflist-def-%d' % self.def_list_level)) | def visit_definition(self, node): self.paragraph_style_stack.append(self.rststyle('blockindent')) self.bumped_list_level_stack.append(ListLevel(1)) | aa44d69191842b25559fb6ad24efd5d72ff6b442 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8194/aa44d69191842b25559fb6ad24efd5d72ff6b442/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
6907,
12,
2890,
16,
756,
4672,
365,
18,
22445,
67,
4060,
67,
3772,
18,
6923,
12,
365,
18,
16114,
4060,
2668,
536,
1098,
17,
536,
6456,
72,
11,
738,
365,
18,
536,
67,
1098,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
6907,
12,
2890,
16,
756,
4672,
365,
18,
22445,
67,
4060,
67,
3772,
18,
6923,
12,
365,
18,
16114,
4060,
2668,
536,
1098,
17,
536,
6456,
72,
11,
738,
365,
18,
536,
67,
1098,
... |
J_C = ((-16*Sqrt(2)*alpha**2*((0+1*1j) + beta)*C5*k**1.5*(-9*beta*k - (0+10*1j)*k**2))/ (315.*beta**2) + (4*alpha**2*((0+1*1j) + beta)*C5* (84*Sqrt(2)*k**3.5 - ((0+112*1j)*Sqrt(2)*k**4.5)/beta + ((0+24*1j)*Sqrt(2)*k**3.5*((0+5*1j)*beta + 3*k))/beta))/(315.*beta*k) - (4*alpha**2*((0+1*1j) + beta)*C5* (21*k*(k + kmax)**2.5 + ((0+3*1j)*((0+5*1j)*beta + 3*k)*(k + kmax)**3.5)/beta - ((0+7*1j)*(k + kmax)**4.5)/beta + ((-k + kmax)**2.5*(3*beta*(2*k + 5*kmax) - (0+1*1j)*(2*k**2 + 5*k*kmax - 7*kmax**2)))/beta))/(315.*beta*k) + (4*alpha**2*((0+1*1j) + beta)*C5* ((0+1*1j)*(k - kmin)**2.5*(-2*k**2 - 5*k*kmin + 7*kmin**2 + (0+3*1j)*beta*(2*k + 5*kmin)) + (k + kmin)**2.5*(3*beta*(2*k - 5*kmin) + (0+1*1j)*(2*k**2 - 5*k*kmin - 7*kmin**2))))/(315.*beta**2*k)) | J_C = ((2*alpha**2*(1*1j + beta)**2*C5*kmax**3)/(3.*beta**2) - (2*alpha**2*(1*1j + beta)**2*C5*kmin**3)/(3.*beta**2)) | def J_C(self, k, alpha, beta, C5): """Second method for J_C""" kmax = k[-1] kmin = k[0] J_C = ((-16*Sqrt(2)*alpha**2*((0+1*1j) + beta)*C5*k**1.5*(-9*beta*k - (0+10*1j)*k**2))/ (315.*beta**2) + (4*alpha**2*((0+1*1j) + beta)*C5* (84*Sqrt(2)*k**3.5 - ((0+112*1j)*Sqrt(2)*k**4.5)/beta + ((0+24*1j)*Sqrt(2)*k**3.5*((0+5*1j)*beta + 3*k))/beta))/(315.*beta*k) - (4*alpha**2*((0+1*1j) + beta)*C5* (21*k*(k + kmax)**2.5 + ((0+3*1j)*((0+5*1j)*beta + 3*k)*(k + kmax)**3.5)/beta - ((0+7*1j)*(k + kmax)**4.5)/beta + ((-k + kmax)**2.5*(3*beta*(2*k + 5*kmax) - (0+1*1j)*(2*k**2 + 5*k*kmax - 7*kmax**2)))/beta))/(315.*beta*k) + (4*alpha**2*((0+1*1j) + beta)*C5* ((0+1*1j)*(k - kmin)**2.5*(-2*k**2 - 5*k*kmin + 7*kmin**2 + (0+3*1j)*beta*(2*k + 5*kmin)) + (k + kmin)**2.5*(3*beta*(2*k - 5*kmin) + (0+1*1j)*(2*k**2 - 5*k*kmin - 7*kmin**2))))/(315.*beta**2*k)) return J_C | edeb881ffcba4c83578bb8d976093b154a4016a1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7283/edeb881ffcba4c83578bb8d976093b154a4016a1/analyticsolution.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
804,
67,
39,
12,
2890,
16,
417,
16,
4190,
16,
6796,
16,
385,
25,
4672,
3536,
8211,
707,
364,
804,
67,
39,
8395,
417,
1896,
273,
417,
18919,
21,
65,
417,
1154,
273,
417,
63,
20,
65,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
804,
67,
39,
12,
2890,
16,
417,
16,
4190,
16,
6796,
16,
385,
25,
4672,
3536,
8211,
707,
364,
804,
67,
39,
8395,
417,
1896,
273,
417,
18919,
21,
65,
417,
1154,
273,
417,
63,
20,
65,... |
if opt_name not in options: | if opt_name not in options or options[opt_name] is None: | def create_daemon_context(logfile=None, pidfile=None, **options): if not CAN_DETACH: raise RuntimeError( "This operating system doesn't support detach.") from daemon import DaemonContext # Since without stderr any errors will be silently suppressed, # we need to know that we have access to the logfile if logfile: open(logfile, "a").close() options["pidlock"] = pidfile and acquire_pidlock(pidfile) defaults = {"uid": lambda: os.geteuid(), "gid": lambda: os.getegid(), "umask": lambda: 0, "chroot_directory": lambda: None, "working_directory": lambda: os.getcwd()} for opt_name, opt_default_gen in defaults.items(): if opt_name not in options: options[opt_name] = opt_default_gen() return DaemonContext(chroot_directory=chroot, working_directory=working_directory, umask=umask, pidfile=pidlock, uid=uid, gid=gid) | 802b8b0518e0a7c937d24d51e690372271cea816 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2024/802b8b0518e0a7c937d24d51e690372271cea816/platform.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
21511,
67,
2472,
12,
28806,
33,
7036,
16,
27656,
33,
7036,
16,
2826,
2116,
4672,
309,
486,
22709,
67,
40,
1584,
18133,
30,
1002,
7265,
12,
315,
2503,
16929,
2619,
3302,
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,
752,
67,
21511,
67,
2472,
12,
28806,
33,
7036,
16,
27656,
33,
7036,
16,
2826,
2116,
4672,
309,
486,
22709,
67,
40,
1584,
18133,
30,
1002,
7265,
12,
315,
2503,
16929,
2619,
3302,
1404,
... |
yield "<table class='real'>" | yield "<table class='real'>\n" | def view_build(myself, tree, host, compiler, rev, plain_logs=False): """view one build in detail""" # ensure the params are valid before using them assert host in hosts, "unknown host %s" % host assert compiler in compilers, "unknown compiler %s" % compiler assert tree in trees, "not a build tree %s" % tree uname = "" cflags = "" config = "" build = db.get_build(tree, host, compiler, rev) age_mtime = build.age_mtime() (revision, revision_time) = build.revision_details() status = build_status(myself, tree, host, compiler, rev) if rev: assert re.match("^[0-9a-fA-F]*$", rev) log = build.read_log() err = build.read_err() if log: log = cgi.escape(log) m = re.search("(.*)", log) if m: uname = m.group(1) m = re.search("CFLAGS=(.*)", log) if m: cflags = m.group(1) m = re.search("configure options: (.*)", log) if m: config = m.group(1) if err: err = cgi.escape(err) yield '<h2>Host information:</h2>' host_web_file = "../web/%s.html" % host if os.path.exists(host_web_file): yield util.FileLoad(host_web_file) yield "<table class='real'>" yield "<tr><td>Host:</td><td><a href='%s?function=View+Host;host=%s;tree=%s;"\ "compiler=%s#'>%s</a> - %s</td></tr>" % (myself, host, tree, compiler, host, hosts[host]) yield "<tr><td>Uname:</td><td>%s</td></tr>" % uname yield "<tr><td>Tree:</td><td>%s</td></tr>" % tree_link(myself, tree) yield "<tr><td>Build Revision:</td><td>%s</td></tr>" % revision_link(myself, revision, tree) yield "<tr><td>Build age:</td><td><div class='age'>%s</div></td></tr>" % red_age(age_mtime) yield "<tr><td>Status:</td><td>%s</td></tr>" % status yield "<tr><td>Compiler:</td><td>%s</td></tr>" % compiler yield "<tr><td>CFLAGS:</td><td>%s</td></tr>" % cflags yield "<tr><td>configure options:</td><td>%s</td></tr>" % config yield "".join(show_oldrevs(myself, tree, host, compiler)) # check the head of the output for our magic string rev_var = "" if rev: rev_var = ";revision=%s" % rev yield "<div id='log'>" if not plain_logs: yield "<p>Switch to the <a href='%s?function=View+Build;host=%s;tree=%s"\ ";compiler=%s%s;plain=true' title='Switch to bland, non-javascript,"\ " unstyled view'>Plain View</a></p>" % (myself, host, tree, compiler, rev_var) yield "<div id='actionList'>" # These can be pretty wide -- perhaps we need to # allow them to wrap in some way? if err == "": yield "<h2>No error log available</h2>" else: yield "<h2>Error log:</h2>" yield make_collapsible_html('action', "Error Output", "\n%s" % err, "stderr-0") if log == "": yield "<h2>No build log available</h2>" else: yield "<h2>Build log:</h2>" yield print_log_pretty(log) yield "<p><small>Some of the above icons derived from the <a href='http://www.gnome.org'>Gnome Project</a>'s stock icons.</small></p>" yield "</div>" else: yield "<p>Switch to the <a href='%s?function=View+Build;host=%s;tree=%s;"\ "compiler=%s%s' title='Switch to colourful, javascript-enabled, styled"\ " view'>Enhanced View</a></p>" % (myself, host, tree, compiler, rev_var) if err == "": yield "<h2>No error log available</h2>" else: yield '<h2>Error log:</h2>' yield '<div id="errorLog"><pre>%s</pre></div>' % err if log == "": yield '<h2>No build log available</h2>' else: yield '<h2>Build log:</h2>' yield '<div id="buildLog"><pre>%s</pre></div>' % log yield '</div>' | aded61733b040c3e2918f7cb5990b12cebe2244e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7314/aded61733b040c3e2918f7cb5990b12cebe2244e/build.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1476,
67,
3510,
12,
4811,
2890,
16,
2151,
16,
1479,
16,
5274,
16,
5588,
16,
7351,
67,
10011,
33,
8381,
4672,
3536,
1945,
1245,
1361,
316,
7664,
8395,
468,
3387,
326,
859,
854,
923,
186... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1476,
67,
3510,
12,
4811,
2890,
16,
2151,
16,
1479,
16,
5274,
16,
5588,
16,
7351,
67,
10011,
33,
8381,
4672,
3536,
1945,
1245,
1361,
316,
7664,
8395,
468,
3387,
326,
859,
854,
923,
186... |
if bestparent is None or bestparent[1] > endtime: bestparent = (newprob, endtime, n) | if bestparent is None or besttime > endtime: bestparent = n besttime = endtime | def getpath(self, view, max_size): testpath = self.find_globaltree(self.position, self.angle, view, 0, 1) if testpath: return testpath print "Cannot find global path from current, extending search tree" start = Arty.Node(self.position, self.angle, parent = None, time = 0, freeprob = 1) nodes = [start] | 61e06514249f4a065965dbc16b1504bb428a21ae /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9407/61e06514249f4a065965dbc16b1504bb428a21ae/units.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
803,
12,
2890,
16,
1476,
16,
943,
67,
1467,
4672,
1842,
803,
273,
365,
18,
4720,
67,
6347,
3413,
12,
2890,
18,
3276,
16,
365,
18,
4341,
16,
1476,
16,
374,
16,
404,
13,
309,
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,
336,
803,
12,
2890,
16,
1476,
16,
943,
67,
1467,
4672,
1842,
803,
273,
365,
18,
4720,
67,
6347,
3413,
12,
2890,
18,
3276,
16,
365,
18,
4341,
16,
1476,
16,
374,
16,
404,
13,
309,
18... |
names = map(os.path.normcase, names) | def addsitedir(sitedir): sitedir = makepath(sitedir) if sitedir not in sys.path: sys.path.append(sitedir) # Add path component try: names = os.listdir(sitedir) except os.error: return names = map(os.path.normcase, names) names.sort() for name in names: if name[-4:] == endsep + "pth": addpackage(sitedir, name) | 6e6555e57b217e010de2b7797195ea5d46fe56c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/6e6555e57b217e010de2b7797195ea5d46fe56c2/site.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4831,
16261,
481,
12,
87,
16261,
481,
4672,
10982,
23210,
273,
1221,
803,
12,
87,
16261,
481,
13,
309,
10982,
23210,
486,
316,
2589,
18,
803,
30,
2589,
18,
803,
18,
6923,
12,
87,
16261... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4831,
16261,
481,
12,
87,
16261,
481,
4672,
10982,
23210,
273,
1221,
803,
12,
87,
16261,
481,
13,
309,
10982,
23210,
486,
316,
2589,
18,
803,
30,
2589,
18,
803,
18,
6923,
12,
87,
16261... | |
class FileWriter(LDIFParser): """ Copy LDIF input to a file output object containing all data retrieved | class LDIFCopy(LDIFParser): """ Copy LDIF input to LDIF output containing all data retrieved | def handle(self,dn,entry): """ Append single record to dictionary of all records. """ # Hmm, strictly spoke a normalization of dn should be done before # using it as dictionary key... self.all_records.append((dn,entry)) | 1109caf6eb775a88dbb49d9eace8b53226aba964 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4610/1109caf6eb775a88dbb49d9eace8b53226aba964/ldif.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
12,
2890,
16,
5176,
16,
4099,
4672,
3536,
6181,
2202,
1409,
358,
3880,
434,
777,
3853,
18,
3536,
468,
670,
7020,
16,
23457,
1694,
3056,
279,
13728,
434,
8800,
1410,
506,
2731,
1865... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
12,
2890,
16,
5176,
16,
4099,
4672,
3536,
6181,
2202,
1409,
358,
3880,
434,
777,
3853,
18,
3536,
468,
670,
7020,
16,
23457,
1694,
3056,
279,
13728,
434,
8800,
1410,
506,
2731,
1865... |
if len(self.scaledData) == 0 or len(labels) == 0: | if not self.noJitteringScaledData or len(self.noJitteringScaledData) == 0 or len(labels) == 0: | def updateData(self, labels): self.removeCurves() self.tips.removeAll() | b2f2b60835147b81e5724a3275b610773bc3064b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6366/b2f2b60835147b81e5724a3275b610773bc3064b/OWSurveyPlotGraph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
751,
12,
2890,
16,
3249,
4672,
365,
18,
4479,
2408,
3324,
1435,
365,
18,
88,
7146,
18,
4479,
1595,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
751,
12,
2890,
16,
3249,
4672,
365,
18,
4479,
2408,
3324,
1435,
365,
18,
88,
7146,
18,
4479,
1595,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
l = data.length | l = data.length * 0.1 | def importObjects(reader): scene = Blender.Scene.getCurrent() armObj = Blender.Object.New('Armature', reader.name) armData = Blender.Armature.New() bones = {} # import each bone. for now, just position it at the origin for name, data in reader.bones.iteritems(): bone = Blender.Armature.Bone.New(name) bone.setHead(0.0, 0.0, 0.0) l = data.length d = data.direction bone.setTail(float(d[0]) * l, float(d[1]) * l, float(d[2]) * l) bones[name] = bone # add root bone = Blender.Armature.Bone.New('root') bone.setHead(0.0, 0.0, 0.0); bone.setTail(0.0, 0.0, 0.0); armData.addBone(bone) bones['root'] = bone # run through the hierarchy: for each, parent and add to the armature for set in reader.hierarchy: parent = set[0] children = set[1:] for bone in children: bones[bone].setTail(addVectors(bones[bone].tail, bones[parent].tail)) bones[bone].setHead(addVectors(bones[bone].head, bones[parent].tail)) bones[bone].setParent(bones[parent]) armData.addBone(bones[bone]) armObj.link(armData) scene.link(armObj) armObj.makeDisplayList() Blender.Window.RedrawAll() | f2d9b3f15ddb5086221c24af16608bb7c9f6def6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6757/f2d9b3f15ddb5086221c24af16608bb7c9f6def6/asf_import.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
4710,
12,
10530,
4672,
9065,
273,
8069,
2345,
18,
14370,
18,
588,
3935,
1435,
23563,
2675,
273,
8069,
2345,
18,
921,
18,
1908,
2668,
25583,
1231,
2187,
2949,
18,
529,
13,
23563,
75... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
4710,
12,
10530,
4672,
9065,
273,
8069,
2345,
18,
14370,
18,
588,
3935,
1435,
23563,
2675,
273,
8069,
2345,
18,
921,
18,
1908,
2668,
25583,
1231,
2187,
2949,
18,
529,
13,
23563,
75... |
day=0,select1=False,month_list=0 ,byday=False where id=%s" % (self._table, id)) | day=0,select1='date',month_list=Null ,byday=Null where id=%s" % (self._table, id)) | def _set_rrulestring(self, cr, uid, id, name, value, arg, context): """ Set rule string. @param self: The object pointer @param cr: the current row, from the database cursor, @param id: List of calendar event's ids. @param context: A standard dictionary for contextual values @return: dictionary of rrule value. """ cr.execute("UPDATE %s set freq='',interval=0,count=0,end_date=Null,\ mo=False,tu=False,we=False,th=False,fr=False,sa=False,su=False,\ day=0,select1=False,month_list=0 ,byday=False where id=%s" % (self._table, id)) if not value: return True val = {} for part in value.split(';'): if part.lower().__contains__('freq') and len(value.split(';')) <=2: rrule_type = part.lower()[5:] break else: rrule_type = 'custom' break ans = value.split(';') for i in ans: val[i.split('=')[0].lower()] = i.split('=')[1].lower() if int(val.get('interval')) > 1: #If interval is other than 1 rule is custom rrule_type = 'custom' | be62cac907e916d2ae64f7efd194e7c889eea71e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/be62cac907e916d2ae64f7efd194e7c889eea71e/base_calendar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
542,
67,
523,
1513,
371,
12,
2890,
16,
4422,
16,
4555,
16,
612,
16,
508,
16,
460,
16,
1501,
16,
819,
4672,
3536,
1000,
1720,
533,
18,
632,
891,
365,
30,
1021,
733,
4407,
632,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
542,
67,
523,
1513,
371,
12,
2890,
16,
4422,
16,
4555,
16,
612,
16,
508,
16,
460,
16,
1501,
16,
819,
4672,
3536,
1000,
1720,
533,
18,
632,
891,
365,
30,
1021,
733,
4407,
632,
... |
resources = set() if pkg.resources: for resource in resources: if resource and isinstance(resource, dict): url = resource.get("url") if url: resources.add(url) | def run(self, options, args): spec_from = args[0] spec_to = args[1] index, path = self.index_from_spec(spec_from) index_to, empty_path = self.index_from_spec(spec_to, all_index=True) pkg = index.get(path) # TODO: have to reimport here for this to work. Why? import datapkg.index if not isinstance(index_to, datapkg.index.FileIndex): msg = u'You can only install to the local filesystem' raise Exception(msg) # This is a mess and needs to be sorted out # Need to distinguish Distribution from a simple Package and much else | 210f63cffc9e59fed0017e79dfb6e907f7119400 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12519/210f63cffc9e59fed0017e79dfb6e907f7119400/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
16,
702,
16,
833,
4672,
857,
67,
2080,
273,
833,
63,
20,
65,
857,
67,
869,
273,
833,
63,
21,
65,
770,
16,
589,
273,
365,
18,
1615,
67,
2080,
67,
2793,
12,
2793,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
16,
702,
16,
833,
4672,
857,
67,
2080,
273,
833,
63,
20,
65,
857,
67,
869,
273,
833,
63,
21,
65,
770,
16,
589,
273,
365,
18,
1615,
67,
2080,
67,
2793,
12,
2793,
6... | |
parser = OptionParser(usage="usage: enpgk command [options]", | parser = OptionParser(usage="usage: enpkg command [options]", | def setup_parser(): description = """\ | 72debab2aedde506cd3869e29bd49cb05b8054d7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7707/72debab2aedde506cd3869e29bd49cb05b8054d7/cmdline.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
67,
4288,
13332,
2477,
273,
3536,
64,
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,
3875,
67,
4288,
13332,
2477,
273,
3536,
64,
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... |
headers = con.head(`num`)[3] | headers = conn.head(`num`)[3] | def PollNewsGroup(self, watermark): if (not self.gateway_to_mail or not self.nntp_host or not self.linked_newsgroup): return 0 import nntplib con = nntplib.NNTP(self.nntp_host) r,c,f,l,n = con.group(self.linked_newsgroup) # the (estimated)count, first, and last are numbers returned as # string. We use them as numbers throughout c = int(c) f = int(f) l = int(l) # NEWNEWS is not portable and has synchronization issues... # Use a watermark system instead. if watermark == 0: return l for num in range(max(watermark+1, f, l+1)): try: headers = con.head(`num`)[3] found_to = 0 for header in headers: i = string.find(header, ':') if i > 0 and string.lower(header[:i]) == 'to': found_to = 1 if header[:i] <> 'X-BeenThere': continue if header[i:] == ': %s' % self.GetListEmail(): raise QuickEscape body = con.body(`num`)[3] # Create the pipe to the Mail posting script. Note that it is # not installed executable, so we'll tack on the path to # Python we discovered when we configured Mailman cmd = '%s %s %s nonews' % ( mm_cfg.PYTHON, os.path.join(mm_cfg.SCRIPTS_DIR, 'post'), self._internal_name) file = os.popen(cmd, 'w') file.write(string.join(headers,'\n')) # If there wasn't already a TO: header, add one. if not found_to: file.write("\nTo: %s" % self.GetListEmail()) file.write('\n\n') file.write(string.join(body,'\n')) file.write('\n') file.close() except nntplib.error_temp: pass # Probably canceled, etc... except "QuickEscape": pass # We gated this TO news, don't repost it! return l | 5007ccd8145bf43ed088692bab03c33fe097a7ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/5007ccd8145bf43ed088692bab03c33fe097a7ec/GatewayManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19160,
17948,
1114,
12,
2890,
16,
14377,
4672,
309,
261,
902,
365,
18,
11127,
67,
869,
67,
4408,
578,
486,
365,
18,
82,
496,
84,
67,
2564,
578,
486,
365,
18,
17738,
67,
2704,
1055,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19160,
17948,
1114,
12,
2890,
16,
14377,
4672,
309,
261,
902,
365,
18,
11127,
67,
869,
67,
4408,
578,
486,
365,
18,
82,
496,
84,
67,
2564,
578,
486,
365,
18,
17738,
67,
2704,
1055,
6... |
print "install_lib: compile=%s, optimize=%s" % \ (`self.compile`, `self.optimize`) | def finalize_options (self): | 25a309c0a9abe33755550c2c71d0865ff6c1a72b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/25a309c0a9abe33755550c2c71d0865ff6c1a72b/install_lib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12409,
67,
2116,
261,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12409,
67,
2116,
261,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... | |
user_quit = False command = "quit" | user_quit = False command = "quit" | def read_queue(e, settings, am, account, logger, target_uri, message, dns): global user_quit, lock, queue lock.acquire() sending = False sent = False msg_buf = [] routes = None try: if target_uri is None: print "Press Ctrl+D to stop the program." else: if message is None: print "Press Ctrl+D on an empty line to end input and send the MESSAGE request." else: msg_buf.append(message) queue.put(("eof", None)) while True: command, data = queue.get() if command == "print": print data if command == "core_event": event_name, obj, args = data if event_name == "SIPSessionNewIncoming": obj.reject() elif event_name == "DNSLookupDidFail" and obj is dns: print "DNS lookup failed: %(error)s" % args user_quit = False command = "quit" elif event_name == "DNSLookupDidSucceed" and obj is dns: routes = args["result"] if len(routes) == 0: print "No route found to SIP proxy" user_quit = False command = "quit" else: if sending: command = "send_message" elif event_name == "SIPEngineGotMessage": print 'Received MESSAGE from "%(from_uri)s", Content-Type: %(content_type)s/%(content_subtype)s' % args print args["body"] elif event_name == "SIPEngineGotMessageResponse": if args["code"] / 100 != 2: print "Could not deliver MESSAGE: %(code)d %(reason)s" % args else: print "MESSAGE was accepted by remote party." user_quit = False command = "quit" elif event_name == "SIPAccountRegistrationDidSucceed": route = args['registration'].route print '%s Registered contact "%s" for SIP address %s at %s:%d;transport=%s (expires in %d seconds)' % (datetime.now().replace(microsecond=0), args['contact_uri'], account.id, route.address, route.port, route.transport, args['registration'].expires) elif event_name == "SIPAccountRegistrationDidFail": if args['registration'] is not None: route = args['registration'].route if args['next_route']: next_route = args['next_route'] next_route = 'Trying next route %s:%d;transport=%s.' % (next_route.address, next_route.port, next_route.transport) else: next_route = 'No more routes to try; retrying in %.2f seconds.' % (args['delay']) if 'code' in args: status = '%d %s' % (args['code'], args['reason']) else: status = args['reason'] print '%s Failed to register contact for SIP address %s at %s:%d;transport=%s: %s. %s' % (datetime.now().replace(microsecond=0), account.id, route.address, route.port, route.transport, status, next_route) else: print '%s Failed to register contact for SIP address %s: %s' % (datetime.now().replace(microsecond=0), account.id, args["reason"]) user_quit = False command = "quit" elif event_name == "SIPAccountRegistrationDidEnd": if 'code' in args: print '%s Registration ended: %d %s.' % (datetime.now().replace(microsecond=0), args['code'], args['reason']) else: print '%s Registration ended.' % (datetime.now().replace(microsecond=0),) user_quit = False command = "quit" elif event_name == "SIPEngineGotException": print "An exception occured within the SIP core:" print args["traceback"] elif event_name == "SIPEngineDidFail": user_quit = False command = "quit" if command == "user_input": if not sent: msg_buf.append(data) if command == "eof": if target_uri is None: am.stop() if isinstance(account, BonjourAccount): user_quit = False command = "quit" elif sent: user_quit = False command = "quit" else: sending = True command = "send_message" if command == "send_message": if routes is None: print "Waiting for DNS lookup..." else: sent = True print 'Sending MESSAGE from "%s" to "%s" using proxy %s:%s:%d' % (account.id, target_uri, routes[0].transport, routes[0].address, routes[0].port) if account.id == "bonjour@local": credentials = Credentials(SIPURI(user="bonjour", host="local")) else: credentials = account.credentials send_message(credentials, target_uri, "text", "plain", "\n".join(msg_buf), routes[0]) print "Press Ctrl+D to stop the program." if command == "quit": break except: user_quit = False traceback.print_exc() finally: e.stop() while not queue.empty(): command, data = queue.get() if command == "print": print data logger.stop() if not user_quit: os.kill(os.getpid(), signal.SIGINT) lock.release() | 352b8de8c70dc46f51c361cb51476c7309c65301 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5703/352b8de8c70dc46f51c361cb51476c7309c65301/sip_message.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
4000,
12,
73,
16,
1947,
16,
2125,
16,
2236,
16,
1194,
16,
1018,
67,
1650,
16,
883,
16,
6605,
4672,
2552,
729,
67,
27176,
16,
2176,
16,
2389,
2176,
18,
1077,
1039,
1435,
5431... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
4000,
12,
73,
16,
1947,
16,
2125,
16,
2236,
16,
1194,
16,
1018,
67,
1650,
16,
883,
16,
6605,
4672,
2552,
729,
67,
27176,
16,
2176,
16,
2389,
2176,
18,
1077,
1039,
1435,
5431... |
self._emptyPageText(request) | self._emptyPageText(request) | def send_page(self, msg=None, **keywords): """ Output the formatted page. | b1131dcc69802bd41a999921f4fb7e5e6e2e7eff /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/888/b1131dcc69802bd41a999921f4fb7e5e6e2e7eff/Page.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
2433,
12,
2890,
16,
1234,
33,
7036,
16,
2826,
11771,
4672,
3536,
3633,
326,
4955,
1363,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
2433,
12,
2890,
16,
1234,
33,
7036,
16,
2826,
11771,
4672,
3536,
3633,
326,
4955,
1363,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
sage: w.implicit_suffix_tree() | sage: w.implicit_suffix_tree() | def implicit_suffix_tree(self): r""" Returns the implicit suffix tree of self. The *suffix tree* of a word `w` is a compactification of the suffix trie for `w`. The compactification removes all nodes that have exactly one incoming edge and exactly one outgoing edge. It consists of two components: a tree and a word. Thus, instead of labelling the edges by factors of `w`, we can labelled them by indices of the occurrence of the factors in `w`. See sage.combinat.words.suffix_trees.ImplicitSuffixTree? for more information. EXAMPLES:: | b26df65f0ddf5152d457437c979f7c1b54d965eb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/b26df65f0ddf5152d457437c979f7c1b54d965eb/word.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10592,
67,
8477,
67,
3413,
12,
2890,
4672,
436,
8395,
2860,
326,
10592,
3758,
2151,
434,
365,
18,
225,
1021,
380,
8477,
2151,
14,
434,
279,
2076,
1375,
91,
68,
353,
279,
6739,
1480,
43... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10592,
67,
8477,
67,
3413,
12,
2890,
4672,
436,
8395,
2860,
326,
10592,
3758,
2151,
434,
365,
18,
225,
1021,
380,
8477,
2151,
14,
434,
279,
2076,
1375,
91,
68,
353,
279,
6739,
1480,
43... |
MAXVERSIONS = [("MAX5", "SOFTWARE\\Autodesk\\3DSMAX\\5.0\\MAX-1:409", "uninstallpath", "Cstudio\\Sdk"), ("MAX6", "SOFTWARE\\Autodesk\\3DSMAX\\6.0", "installdir", "maxsdk\\cssdk\\include"), ("MAX7", "SOFTWARE\\Autodesk\\3DSMAX\\7.0", "Installdir", "maxsdk\\include\\CS")] for version,key1,key2,subdir in MAXVERSIONS: | MAXVERSIONINFO = [("MAX6", "SOFTWARE\\Autodesk\\3DSMAX\\6.0", "installdir", "maxsdk\\cssdk\\include"), ("MAX7", "SOFTWARE\\Autodesk\\3DSMAX\\7.0", "Installdir", "maxsdk\\include\\CS"), ("MAX8", "SOFTWARE\\Autodesk\\3DSMAX\\8.0", "Installdir", "maxsdk\\include\\CS"), ] for version,key1,key2,subdir in MAXVERSIONINFO: | def parseopts(args): global COMPILER,OPTIMIZE,OMIT,INSTALLER,GENMAN,SLAVEBUILD global VERSION,COMPRESSOR,DIRECTXSDK,VERBOSE,SLAVEFILE,THREADCOUNT longopts = [ "help","package-info","compiler=","directx-sdk=","slavebuild=", "optimize=","everything","nothing","installer","quiet","verbose", "version=","lzma","no-python","slaves=","threads="] anything = 0 for pkg in PACKAGES: longopts.append("no-"+pkg.lower()) for pkg in PACKAGES: longopts.append("use-"+pkg.lower()) try: opts, extras = getopt.getopt(args, "", longopts) for option,value in opts: if (option=="--help"): raise "usage" elif (option=="--package-info"): raise "package-info" elif (option=="--compiler"): COMPILER=value elif (option=="--directx-sdk"): DIRECTXSDK=value elif (option=="--optimize"): OPTIMIZE=value elif (option=="--quiet"): VERBOSE-=1 elif (option=="--verbose"): VERBOSE+=1 elif (option=="--installer"): INSTALLER=1 elif (option=="--genman"): GENMAN=1 elif (option=="--everything"): OMIT=[] elif (option=="--nothing"): OMIT=PACKAGES[:] elif (option=="--slaves"): SLAVEFILE=value elif (option=="--threads"): THREADCOUNT=int(value) elif (option=="--slavebuild"): SLAVEBUILD=value elif (option=="--version"): VERSION=value if (len(VERSION.split(".")) != 3): raise "usage" elif (option=="--lzma"): COMPRESSOR="lzma" else: for pkg in PACKAGES: if (option=="--use-"+pkg.lower()): if (OMIT.count(pkg)): OMIT.remove(pkg) break for pkg in PACKAGES: if (option=="--no-"+pkg.lower()): if (OMIT.count(pkg)==0): OMIT.append(pkg) break anything = 1 except "package-info": packageInfo() except: usage(0) if (anything==0): usage(0) if (OPTIMIZE=="1"): OPTIMIZE=1 elif (OPTIMIZE=="2"): OPTIMIZE=2 elif (OPTIMIZE=="3"): OPTIMIZE=3 elif (OPTIMIZE=="4"): OPTIMIZE=4 else: usage("Invalid setting for OPTIMIZE") if (COMPILERS.count(COMPILER)==0): usage("Invalid setting for COMPILER: "+COMPILER) | d00f745e1ceedb7d59a09beac4f23f2f45af36fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/d00f745e1ceedb7d59a09beac4f23f2f45af36fe/makepanda.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
4952,
12,
1968,
4672,
2552,
5423,
1102,
14668,
16,
15620,
3445,
15641,
16,
1872,
1285,
16,
28865,
654,
16,
16652,
9560,
16,
55,
2534,
3412,
20215,
2552,
8456,
16,
4208,
22526,
916,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
4952,
12,
1968,
4672,
2552,
5423,
1102,
14668,
16,
15620,
3445,
15641,
16,
1872,
1285,
16,
28865,
654,
16,
16652,
9560,
16,
55,
2534,
3412,
20215,
2552,
8456,
16,
4208,
22526,
916,
... |
except NoReindex, ex: | except ObjectDeleted, ex: | def __call__(self, instance, *args, **kw): ''' Invokes the method. ''' wf = getToolByName(instance, 'portal_workflow', None) if wf is None or not hasattr(wf, 'wrapWorkflowMethod'): # No workflow tool found. try: res = apply(self._m, (instance,) + args, kw) except NoReindex, ex: res = ex.getResult() else: catalog = getToolByName(instance, 'portal_catalog', None) if catalog is not None: catalog.reindexObject(ob) else: res = wf.wrapWorkflowMethod(instance, self._id, self._m, (instance,) + args, kw) return res | 1e562d89aac08565cf665f85d6df9854842b038e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1843/1e562d89aac08565cf665f85d6df9854842b038e/WorkflowCore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
791,
16,
380,
1968,
16,
2826,
9987,
4672,
9163,
22737,
326,
707,
18,
9163,
11578,
273,
336,
6364,
5911,
12,
1336,
16,
296,
24386,
67,
13815,
2187,
599,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
791,
16,
380,
1968,
16,
2826,
9987,
4672,
9163,
22737,
326,
707,
18,
9163,
11578,
273,
336,
6364,
5911,
12,
1336,
16,
296,
24386,
67,
13815,
2187,
599,
1... |
line[i], [], operator='=') | line[i], [], operator='=', context=context) | def process_liness(self, datas, prefix, current_module, model_name, fields_def, position=0): line = datas[position] row = {} translate = {} todo = [] warning = '' data_id = False data_res_id = False is_xml_id = False is_db_id = False ir_model_data_obj = self.pool.get('ir.model.data') # # Import normal fields # for i in range(len(fields)): if i >= len(line): raise Exception(_('Please check that all your lines have %d columns.') % (len(fields),)) if not line[i]: continue field = fields[i] if (len(field)==len(prefix)+1) and field[len(prefix)].endswith(':id'): res_id = False if line[i]: if fields_def[field[len(prefix)][:-3]]['type']=='many2many': res_id = [] for word in line[i].split(config.get('csv_internal_sep')): if '.' in word: module, xml_id = word.rsplit('.', 1) else: module, xml_id = current_module, word id = ir_model_data_obj._get_id(cr, uid, module, xml_id) res_id2 = ir_model_data_obj.read(cr, uid, [id], ['res_id'])[0]['res_id'] if res_id2: res_id.append(res_id2) if len(res_id): res_id = [(6, 0, res_id)] else: if '.' in line[i]: module, xml_id = line[i].rsplit('.', 1) else: module, xml_id = current_module, line[i] id = ir_model_data_obj._get_id(cr, uid, module, xml_id) res_id = ir_model_data_obj.read(cr, uid, [id], ['res_id'])[0]['res_id'] row[field[0][:-3]] = res_id or False continue if (len(field) == len(prefix)+1) and \ len(field[len(prefix)].split(':lang=')) == 2: f, lang = field[len(prefix)].split(':lang=') translate.setdefault(lang, {})[f]=line[i] or False continue if (len(field) == len(prefix)+1) and \ (prefix == field[0:len(prefix)]): if field[len(prefix)] == "id": # XML ID db_id = False is_xml_id = data_id = line[i] d = data_id.split('.') module = len(d)>1 and d[0] or '' name = len(d)>1 and d[1] or d[0] data_ids = ir_model_data_obj.search(cr, uid, [('module','=',module),('model','=',model_name),('name','=',name)]) if len(data_ids): d = ir_model_data_obj.read(cr, uid, data_ids, ['res_id'])[0] db_id = d['res_id'] if is_db_id and not db_id: data_ids = ir_model_data_obj.search(cr, uid, [('module','=',module),('model','=',model_name),('res_id','=',is_db_id)]) if not len(data_ids): ir_model_data_obj.create(cr, uid, {'module':module, 'model':model_name, 'name':name, 'res_id':is_db_id}) db_id = is_db_id if is_db_id and int(db_id) != int(is_db_id): warning += ("Id is not the same than existing one: " + str(is_db_id) + " !\n") logger.notifyChannel("import", netsvc.LOG_ERROR, "Id is not the same than existing one: " + str(is_db_id) + ' !\n') continue | 2bb32450ab1f0606cc2c5a592d2d2fb43ff42b42 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/2bb32450ab1f0606cc2c5a592d2d2fb43ff42b42/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
80,
6336,
12,
2890,
16,
5386,
16,
1633,
16,
783,
67,
2978,
16,
938,
67,
529,
16,
1466,
67,
536,
16,
1754,
33,
20,
4672,
980,
273,
5386,
63,
3276,
65,
1027,
273,
2618,
420... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
80,
6336,
12,
2890,
16,
5386,
16,
1633,
16,
783,
67,
2978,
16,
938,
67,
529,
16,
1466,
67,
536,
16,
1754,
33,
20,
4672,
980,
273,
5386,
63,
3276,
65,
1027,
273,
2618,
420... |
topic_totals = [self._topics[i].N() + otherlambda._topics[i].N() for i in self.num_topics] | topic_totals = [self._topics[i].N() + otherlambda._topics[i].N() for i in xrange(self.num_topics)] | def merge(self, otherlambda, rhot): ''' fold the word probabilities of another DirichletWords object into this one. assumes self.num_topics is the same for both. ''' all_words = self.words() + otherlambda.words() distinct_words = list(set(all_words)) | 5988bdd2be3b131b5a1ef64c56ef02a752104a5e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14025/5988bdd2be3b131b5a1ef64c56ef02a752104a5e/dirichlet_words.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2691,
12,
2890,
16,
1308,
14661,
16,
6259,
352,
4672,
9163,
11590,
326,
2076,
17958,
434,
4042,
8446,
1354,
1810,
7363,
733,
1368,
333,
1245,
18,
13041,
365,
18,
2107,
67,
17905,
353,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2691,
12,
2890,
16,
1308,
14661,
16,
6259,
352,
4672,
9163,
11590,
326,
2076,
17958,
434,
4042,
8446,
1354,
1810,
7363,
733,
1368,
333,
1245,
18,
13041,
365,
18,
2107,
67,
17905,
353,
32... |
return {} | configuration = {} configuration.setdefault('url', cls.DEFAULT_URL_TEMPLATE % projectName) return configuration | def getConfigSettings(projectName='cjklib', section='Connection'): """ Gets the SQL connection parameter from a config file. | 9ef9a7ae43659042b6895aa114e9f82a67ea24b2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11128/9ef9a7ae43659042b6895aa114e9f82a67ea24b2/dbconnector.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4367,
2628,
12,
4406,
461,
2218,
71,
26921,
2941,
2187,
2442,
2218,
1952,
11,
4672,
3536,
11881,
326,
3063,
1459,
1569,
628,
279,
642,
585,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4367,
2628,
12,
4406,
461,
2218,
71,
26921,
2941,
2187,
2442,
2218,
1952,
11,
4672,
3536,
11881,
326,
3063,
1459,
1569,
628,
279,
642,
585,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
import os | def GenerateSConscript(output_filename, spec): """ Generates a SConscript file for a specific target. This generates a SConscript file suitable for building any or all of the target's configurations. A SConscript file may be called multiple times to generate targets for multiple configurations. Consequently, it needs to be ready to build the target for any requested configuration, and therefore contains information about the settings for all configurations (generated into the SConscript file at gyp configuration time) as well as logic for selecting (at SCons build time) the specific configuration being built. The general outline of a generated SConscript file is: -- Header -- Import 'env'. This contains a $CONFIG_NAME construction variable that specifies what configuration to build (e.g. Debug, Release). -- Configurations. This is a dictionary with settings for the different configurations (Debug, Release) under which this target can be built. The values in the dictionary are themselves dictionaries specifying what construction variables should added to the local copy of the imported construction environment (Append), should be removed (FilterOut), and should outright replace the imported values (Replace). -- Clone the imported construction environment and update with the proper configuration settings. -- Initialize the lists of the targets' input files and prerequisites. -- Target-specific actions and rules. These come after the input file and prerequisite initializations because the outputs of the actions and rules may affect the input file list (process_outputs_as_sources) and get added to the list of prerequisites (so that they're guaranteed to be executed before building the target). -- Call the Builder for the target itself. -- Arrange for any copies to be made into installation directories. -- Set up the gyp_target_{name} Alias (phony Node) for the target as the primary handle for building all of the target's pieces. -- Use env.Require() to make sure the prerequisites (explicitly specified, but also including the actions and rules) are built before the target itself. -- Return the gyp_target_{name} Alias to the calling SConstruct file so it can be added to the list of default targets. """ gyp_dir = os.path.split(output_filename)[0] if not gyp_dir: gyp_dir = '.' fp = open(output_filename, 'w') fp.write(header) fp.write('\nImport("env")\n') # fp.write('\n') fp.write('configurations = {\n') for config_name, config in spec['configurations'].iteritems(): fp.write(' \'%s\' : {\n' % config_name) fp.write(' \'Append\' : dict(\n') GenerateConfig(fp, spec, config, ' '*12) fp.write(' ),\n') fp.write(' \'FilterOut\' : dict(\n' ) for key, var in config.get('scons_remove', {}).iteritems(): fp.write(' %s = %s,\n' % (key, repr(var))) fp.write(' ),\n') fp.write(' \'Replace\' : dict(\n' ) scons_settings = config.get('scons_settings', {}) for key in sorted(scons_settings.keys()): val = pprint.pformat(scons_settings[key]) fp.write(' %s = %s,\n' % (key, val)) fp.write(' ),\n') fp.write(' },\n') fp.write('}\n') # fp.write('\n') fp.write('env = env.Clone()') fp.write('\n') fp.write('config = configurations[env[\'CONFIG_NAME\']]\n') fp.write('env.Append(**config[\'Append\'])\n') fp.write('env.FilterOut(**config[\'FilterOut\'])\n') fp.write('env.Replace(**config[\'Replace\'])\n') # sources = spec.get('sources') if sources: pre = '\ninput_files = ChromeFileList([\n ' WriteList(fp, map(repr, sources), preamble=pre, postamble=',\n])\n') else: fp.write('\ninput_files = []\n') fp.write('\n') fp.write('target_files = []\n') prerequisites = spec.get('scons_prerequisites', []) fp.write('prerequisites = %s\n' % pprint.pformat(prerequisites)) actions = spec.get('actions', []) for action in actions: a = ['cd', gyp_dir, '&&'] + action['action'] message = action.get('message') if message: message = repr(message) fp.write(_command_template % { 'inputs' : pprint.pformat(action.get('inputs', [])), 'outputs' : pprint.pformat(action.get('outputs', [])), 'action' : pprint.pformat(a), 'message' : message, }) if action.get('process_outputs_as_sources'): fp.write('input_files.extend(_outputs)\n') fp.write('prerequisites.extend(_outputs)\n') rules = spec.get('rules', []) for rule in rules: name = rule['rule_name'] a = ['cd', gyp_dir, '&&'] + rule['action'] message = rule.get('message') if message: message = repr(message) fp.write(_rule_template % { 'inputs' : pprint.pformat(rule.get('inputs', [])), 'outputs' : pprint.pformat(rule.get('outputs', [])), 'action' : pprint.pformat(a), 'extension' : rule['extension'], 'name' : name, 'message' : message, }) if rule.get('process_outputs_as_sources'): fp.write(' input_files.Replace(%s_file, _outputs)\n' % name) fp.write('prerequisites.extend(_outputs)\n') SConsTypeWriter[spec.get('type')](fp, spec) copies = spec.get('copies', []) for copy in copies: destdir = copy['destination'] files = copy['files'] fmt = '\n_outputs = env.Install(%s,\n %s\n)\n' fp.write(fmt % (repr(destdir), pprint.pformat(files))) fp.write('prerequisites.extend(_outputs)\n') fmt = "\ngyp_target = env.Alias('gyp_target_%s', target_files)\n" fp.write(fmt % spec['target_name']) dependencies = spec.get('scons_dependencies', []) if dependencies: WriteList(fp, dependencies, preamble='env.Requires(gyp_target, [\n ', postamble='\n])\n') fp.write('env.Requires(gyp_target, prerequisites)\n') fp.write('Return("gyp_target")\n') fp.close() | 4dc50fd87bddfa091592f5662d5b1a859d4acf39 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6220/4dc50fd87bddfa091592f5662d5b1a859d4acf39/scons.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6654,
55,
442,
4263,
12,
2844,
67,
3459,
16,
857,
4672,
3536,
31902,
279,
348,
442,
4263,
585,
364,
279,
2923,
1018,
18,
225,
1220,
6026,
279,
348,
442,
4263,
585,
10631,
364,
10504,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6654,
55,
442,
4263,
12,
2844,
67,
3459,
16,
857,
4672,
3536,
31902,
279,
348,
442,
4263,
585,
364,
279,
2923,
1018,
18,
225,
1220,
6026,
279,
348,
442,
4263,
585,
10631,
364,
10504,
1... | |
if v.message != 32 or not self.auto_open: | if v.args[0] != 32 or not self.auto_open: | def request(self, method, url, body=None, headers={}): """Send a complete request to the server.""" | 74efa0a6def44a17e7b2a59c2eb16b3d01c3b9e5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/74efa0a6def44a17e7b2a59c2eb16b3d01c3b9e5/httplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
590,
12,
2890,
16,
707,
16,
880,
16,
1417,
33,
7036,
16,
1607,
12938,
4672,
3536,
3826,
279,
3912,
590,
358,
326,
1438,
12123,
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,
590,
12,
2890,
16,
707,
16,
880,
16,
1417,
33,
7036,
16,
1607,
12938,
4672,
3536,
3826,
279,
3912,
590,
358,
326,
1438,
12123,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
elif expr[i] == ')': | elif expr[i] == ')' or expr[i] == ']': | def buildOperation(self, expr): self.recursionLevel += 1 # Debug info print(self.getDebugPrefix() + " * buildOperation.dirty: " + expr) # Remove unnecessary brackets bracketCounter = 0 i = len(expr) while expr and expr[0] == '(' and expr[len(expr)-1] == ')' and bracketCounter == 0 and i == len(expr): #print("WHIIIIILE") bracketCounter = 1 i = 1 while i < len(expr) and (bracketCounter > 0 or expr[i] == ')'): if expr[i] == '(': bracketCounter += 1 elif expr[i] == ')': bracketCounter -= 1 i += 1 if bracketCounter == 0 and i == len(expr): expr = expr[1:len(expr)-1] #print("NEW EXPR: " + expr) # In order to continue the loop: Adjust i i = len(expr) print(" * buildOperation.clean: " + expr) # Left operand bracketCounter = 0 i = 0 while i < len(expr) and (isVarChar(expr[i]) or expr[i] == '('): while bracketCounter > 0 or (i < len(expr) and expr[i] == '('): if expr[i] == '(': bracketCounter += 1 elif expr[i] == ')': bracketCounter -= 1 if bracketCounter == 0: break i += 1 i += 1 if i == len(expr): self.recursionLevel -= 1 return self.doc.createTextNode(expr) leftOperand = expr[:i] opIndex = i # Operator opIndexEnd = opIndex while opIndexEnd < len(expr) and not isVarChar(expr[opIndexEnd]) and not expr[opIndexEnd] == '(': opIndexEnd += 1 operator = expr[opIndex:opIndexEnd] if leftOperand: opName = self.getOperatorName(operator, Operator.BINARY) else: opName = self.getOperatorName(operator, Operator.UNARY) if not opName: return self.doc.createTextNode(leftOperand) # Right operand bracketCounter = 0 i = opIndex + len(operator) while i < len(expr) and (isVarChar(expr[i]) or expr[i] == '('): while bracketCounter > 0 or (i < len(expr) and expr[i] == '('): if expr[i] == '(': bracketCounter += 1 elif expr[i] == ')': bracketCounter -= 1 if bracketCounter == 0: break i += 1 i += 1 rightOperand = expr[opIndex+len(operator):i] leftOperandNode = None rightOperandNode = None if leftOperand and leftOperand[0] == '(': leftOperandNode = self.buildOperation(leftOperand[1:len(leftOperand)-1]) else: leftOperandNode = self.doc.createTextNode(leftOperand) if rightOperand and rightOperand[0] == '(': rightOperandNode = self.buildOperation(rightOperand[1:len(rightOperand)-1]) else: rightOperandNode = self.doc.createTextNode(rightOperand) #print("---") #print("OP: " + operator) #print(leftOperand) #print(rightOperand) #print("---") node = self.doc.createElement(opName) lNode = self.doc.createElement("value") rNode = self.doc.createElement("value") # Unary operator if leftOperand: node.appendChild(lNode) node.appendChild(rNode) lNode.appendChild(leftOperandNode) rNode.appendChild(rightOperandNode) self.recursionLevel -= 1 return node | 4c217d7807466cdefe0b561d5d9163c266360b72 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14498/4c217d7807466cdefe0b561d5d9163c266360b72/ExpressionParser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
2988,
12,
2890,
16,
3065,
4672,
365,
18,
31347,
2355,
1011,
404,
225,
468,
4015,
1123,
1172,
12,
2890,
18,
588,
2829,
2244,
1435,
397,
315,
380,
1361,
2988,
18,
18013,
30,
315,
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,
1361,
2988,
12,
2890,
16,
3065,
4672,
365,
18,
31347,
2355,
1011,
404,
225,
468,
4015,
1123,
1172,
12,
2890,
18,
588,
2829,
2244,
1435,
397,
315,
380,
1361,
2988,
18,
18013,
30,
315,
3... |
_URL_AND_PUNC = r'((http|https|ftp|mailto|file|about)[:/]+?[%s0-9_\@\.\,\?\!\/\:\;\-\ | _ABSOLUTE_URL=r'((http|https|ftp|mailto|file|about)[:/]+?[%s0-9_\@\.\,\?\!\/\:\;\-\ _ABS_AND_RELATIVE_URL=r'([%s0-9_\@\.\,\?\!\/\:\;\-\ | def doc_strong(self, s, expr = re.compile(r'\*\*([%s%s%s\s]+?)\*\*' % (letters, digits, strongem_punc)).search #expr = re.compile(r'\s*\*\*([ \n\r%s0-9.:/;,\'\"\?\-\_\/\=\-\>\<\(\)]+)\*\*(?!\*|-)' % letters).search, # old expr, inconsistent punc, failed to cross newlines. ): | 323d2889738d6c1b271333f079d64f1975613646 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/323d2889738d6c1b271333f079d64f1975613646/DocumentClass.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
67,
9110,
12,
2890,
16,
272,
16,
3065,
273,
283,
18,
11100,
12,
86,
8314,
12174,
14,
3816,
9,
87,
9,
87,
9,
87,
64,
87,
3737,
16626,
12174,
4035,
738,
261,
26054,
16,
6815,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
67,
9110,
12,
2890,
16,
272,
16,
3065,
273,
283,
18,
11100,
12,
86,
8314,
12174,
14,
3816,
9,
87,
9,
87,
9,
87,
64,
87,
3737,
16626,
12174,
4035,
738,
261,
26054,
16,
6815,
16... |
return iter(self.filepaths) | for item in self.filepaths: yield item | def __iter__(self): """Iterate over file paths""" return iter(self.filepaths) | 7ff4bdbfe3515442db9965bc3b46cd3371013cd9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5729/7ff4bdbfe3515442db9965bc3b46cd3371013cd9/runner.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2165,
972,
12,
2890,
4672,
3536,
14916,
1879,
585,
2953,
8395,
327,
1400,
12,
2890,
18,
768,
4481,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2165,
972,
12,
2890,
4672,
3536,
14916,
1879,
585,
2953,
8395,
327,
1400,
12,
2890,
18,
768,
4481,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
nodes = [] nodes.extend(flatten_nodes(self.nodes)) if self.dest is not None: nodes.append(self.dest) return tuple(nodes) | nodelist = [] nodelist.extend(flatten_nodes(self.nodes)) if self.dest is not None: nodelist.append(self.dest) return tuple(nodelist) | def getChildNodes(self): nodes = [] nodes.extend(flatten_nodes(self.nodes)) if self.dest is not None: nodes.append(self.dest) return tuple(nodes) | 0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23895,
12,
2890,
4672,
2199,
273,
5378,
2199,
18,
14313,
12,
16940,
67,
4690,
12,
2890,
18,
4690,
3719,
309,
365,
18,
10488,
353,
486,
599,
30,
5411,
2199,
18,
6923,
12,
2890,
18,
1048... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23895,
12,
2890,
4672,
2199,
273,
5378,
2199,
18,
14313,
12,
16940,
67,
4690,
12,
2890,
18,
4690,
3719,
309,
365,
18,
10488,
353,
486,
599,
30,
5411,
2199,
18,
6923,
12,
2890,
18,
1048... |
master_socket, slave_socket = socket.socketpair(socket.AF_UNIX, socket.SOCK_STREAM) self.zone_refresh._socket = master_socket master_socket.close() self.assertRaises(ZonemgrException, self.zone_refresh.run_timer) self.zone_refresh._socket = slave_socket | self.zone_refresh._check_sock = self.zone_refresh._master_socket | def test_run_timer(self): """This case will run timer in daemon thread. The zone's next_refresh_time is less than now, so zonemgr will do zone refresh immediately. The zone's state will become "refreshing". Then closing the socket ,the timer will stop, and throw a ZonemgrException.""" time1 = time.time() self.zone_refresh._zonemgr_refresh_info = { ("sd.cn.", "IN"):{ 'last_refresh_time': time1 - 7200, 'next_refresh_time': time1 - 1, 'zone_soa_rdata': 'a.dns.cn. root.cnnic.cn. 2009073105 7200 3600 2419200 21600', 'zone_state': ZONE_OK} } master_socket, slave_socket = socket.socketpair(socket.AF_UNIX, socket.SOCK_STREAM) self.zone_refresh._socket = master_socket master_socket.close() self.assertRaises(ZonemgrException, self.zone_refresh.run_timer) | ddf21e206a3be38788eb385d5fcf57bfca3bac20 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6792/ddf21e206a3be38788eb385d5fcf57bfca3bac20/zonemgr_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2681,
67,
12542,
12,
2890,
4672,
3536,
2503,
648,
903,
1086,
5441,
316,
8131,
2650,
18,
1021,
4157,
1807,
1024,
67,
9144,
67,
957,
353,
5242,
2353,
2037,
16,
1427,
998,
265,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2681,
67,
12542,
12,
2890,
4672,
3536,
2503,
648,
903,
1086,
5441,
316,
8131,
2650,
18,
1021,
4157,
1807,
1024,
67,
9144,
67,
957,
353,
5242,
2353,
2037,
16,
1427,
998,
265,
... |
if not isinstance(parent_docs[-1], NamespaceDoc): return src = _global_name(src, parent_docs) | def _process_fromstar_import(src, parent_docs): """ Handle a statement of the form: >>> from <src> import * If L{IMPORT_HANDLING} is C{'parse'}, then first try to parse the module C{M{<src>}}, and copy all of its exported variables to C{parent_docs[-1]}. Otherwise, try to determine the names of the variables exported by C{M{<src>}}, and create a new variable for each export. If L{IMPORT_STAR_HANDLING} is C{'parse'}, then the list of exports if found by parsing C{M{<src>}}; if it is C{'introspect'}, then the list of exports is found by importing and introspecting C{M{<src>}}. """ # Record the import parent_docs[0].imports.append(src) # mark that it's .*?? if not isinstance(parent_docs[-1], NamespaceDoc): return # If src is package-local, then convert it to a global name. src = _global_name(src, parent_docs) # [xx] add check for if we already have the source docs in our # cache?? if (IMPORT_HANDLING == 'parse' or IMPORT_STAR_HANDLING == 'parse'): # [xx] is this ok? try: module_doc = _find(src) except ImportError: module_doc = None if isinstance(module_doc, ModuleDoc): for name, imp_var in module_doc.variables.items(): # [xx] this is not exactly correct, but close. It # does the wrong thing if a __var__ is explicitly # listed in __all__. if (imp_var.is_public and not (name.startswith('__') and name.endswith('__'))): var_doc = _add_import_var(DottedName(src, name), name, parent_docs[-1]) if IMPORT_HANDLING == 'parse': var_doc.value = imp_var.value # If we got here, then either IMPORT_HANDLING='link' or we # failed to parse the `src` module. if IMPORT_STAR_HANDLING == 'introspect': try: module = __import__(str(src), {}, {}, [0]) except: return # We couldn't import it. if module is None: return # We couldn't import it. if hasattr(module, '__all__'): names = list(module.__all__) else: names = [n for n in dir(module) if not n.startswith('_')] for name in names: _add_import_var(DottedName(src, name), name, parent_docs[-1]) | 4cbc82d4e71678b5f77e6a92ad0b4a6f803a0407 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3512/4cbc82d4e71678b5f77e6a92ad0b4a6f803a0407/docparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2567,
67,
2080,
10983,
67,
5666,
12,
4816,
16,
982,
67,
8532,
4672,
3536,
5004,
279,
3021,
434,
326,
646,
30,
4080,
628,
411,
4816,
34,
1930,
380,
225,
971,
511,
95,
20445,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2567,
67,
2080,
10983,
67,
5666,
12,
4816,
16,
982,
67,
8532,
4672,
3536,
5004,
279,
3021,
434,
326,
646,
30,
4080,
628,
411,
4816,
34,
1930,
380,
225,
971,
511,
95,
20445,
67,
... | |
gnucap = "" | gnucap = ["", ""] | def to_gnucap(self, model): | 13ee6c41f57e9506834260f5eae4b05b66b6faeb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11306/13ee6c41f57e9506834260f5eae4b05b66b6faeb/electric.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
67,
1600,
5286,
438,
12,
2890,
16,
938,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
67,
1600,
5286,
438,
12,
2890,
16,
938,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.input = command_line.CommandLineParser().getArg(0) | self.input = command_line.CommandLineParser().positionalArguments() | def readOptions(self): """ readOptions() -> None Read arguments from the command line """ get = command_line.CommandLineParser().getOption if get('prompt'): self.configuration.pythonPrompt = True if get('nosplash'): self.configuration.showSplash = False self.configuration.debugSignals = get('debugsignals') self.dotVistrails = get('dotVistrails') if not self.dotVistrails: self.dotVistrails = system.defaultDotVistrails() self.configuration.multiHeads = get('multiheads') self.configuration.maximizeWindows = get('maximized') self.configuration.showMovies = get('movies') self.configuration.useCache = get('cache') self.configuration.verbosenessLevel = get('verbose') if get('noninteractive'): self.configuration.interactiveMode = False self.configuration.nologger = get('nologger') self.input = command_line.CommandLineParser().getArg(0) self.workflow = get('workflow') if get('workflow') and not get('noninteractive'): print "Workflow option only allowed in noninteractive mode." sys.exit(1) | 352f7333e8fa53ce990cbd61bca688fa32142178 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6341/352f7333e8fa53ce990cbd61bca688fa32142178/application.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
1320,
12,
2890,
4672,
3536,
855,
1320,
1435,
317,
599,
2720,
1775,
628,
326,
1296,
980,
225,
3536,
336,
273,
1296,
67,
1369,
18,
21391,
2678,
7675,
588,
1895,
309,
336,
2668,
13325,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1320,
12,
2890,
4672,
3536,
855,
1320,
1435,
317,
599,
2720,
1775,
628,
326,
1296,
980,
225,
3536,
336,
273,
1296,
67,
1369,
18,
21391,
2678,
7675,
588,
1895,
309,
336,
2668,
13325,... |
VARS %s site="%s" ifo="%s" frstart="%s" frend="%s" start="%d" end="%d" channel="%s" calcache="%s"\ """ % ( jobname,site,ifo,seg.startpad,seg.endpad,chunk.start,chunk.end,chan, self.config['input'][string.lower(ifo) + '-cal']) | VARS %s site="%s" ifo="%s" frstart="%s" frend="%s" start="%d" end="%d" chunklen="%d" channel="%s" calcache="%s"\ """ % ( jobname,site,ifo,seg.startpad,seg.endpad,chunk.start,chunk.end, chunk.length,chan,self.config['input'][string.lower(ifo) + '-cal']) | def builddag(self,cache,bank,inspiral): chan = self.config['input']['channel-name'] site = chan[0] ifo = chan[0:2] dag_fh = open( self.basename + ".dag", "w" ) print >> dag_fh, "DOT %s.dot UPDATE OVERWRITE" % self.basename # jobs to generate the frame cache files for seg in self.segments: jobname = 'frcache_%s_%d_%d' % (site,seg.startpad,seg.endpad) print >> dag_fh, 'JOB %s %s.frcache.condor' % (jobname,self.basename), if cache: print >> dag_fh, 'done', print >> dag_fh, '\nVARS %s site="%s" frstart="%s" frend="%s"' % ( jobname, site, seg.startpad, seg.endpad ) for i in range(1,len(self.segments)): print >> dag_fh, 'PARENT frcache_%s_%s_%s CHILD frcache_%s_%s_%s' % ( site,self.segments[i-1].startpad,self.segments[i-1].endpad, site,self.segments[i].startpad,self.segments[i].endpad) # jobs to generate the template banks for seg in self.segments: parent = 'frcache_%s_%s_%s' % (site,seg.startpad,seg.endpad) for chunk in seg.chunks: jobname = 'tmpltbank_%s_%s_%s' % (ifo,chunk.start,chunk.end) print >> dag_fh, 'JOB %s %s.tmpltbank.condor' % (jobname,self.basename), if bank: print >> dag_fh, 'done', print >> dag_fh, """ | e9d33d7c74b71221fa79b8f07354e448e7971b07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5758/e9d33d7c74b71221fa79b8f07354e448e7971b07/inspiral_pipeline.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25666,
330,
449,
346,
12,
2890,
16,
2493,
16,
10546,
16,
267,
1752,
481,
287,
4672,
3861,
273,
365,
18,
1425,
3292,
2630,
21712,
4327,
17,
529,
3546,
2834,
273,
3861,
63,
20,
65,
21479... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25666,
330,
449,
346,
12,
2890,
16,
2493,
16,
10546,
16,
267,
1752,
481,
287,
4672,
3861,
273,
365,
18,
1425,
3292,
2630,
21712,
4327,
17,
529,
3546,
2834,
273,
3861,
63,
20,
65,
21479... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_modifytag(fldID, tagID, ln=cdslang, name='', value='', callback='yes', confirm=-1): """form to modify a field. fldID - the field to change.""" subtitle = "" output = "" fld_dict = dict(get_def_name('', "field")) fldID = int(fldID) tagID = int(tagID) tag = get_tags(tagID) if confirm in [-1, "-1"] and not value and not name: name = tag[0][1] value = tag[0][2] subtitle = """<a name="3.1"></a>Modify MARC tag""" text = """ Any modifications will apply to all logical fields using this tag.<br> <span class="adminlabel">Tag value</span> <input class="admin_w200" type="text" name="value" value="%s" /><br> <span class="adminlabel">Comment</span> <input class="admin_w200" type="text" name="name" value="%s" /><br> """ % (value, name) output += createhiddenform(action="modifytag#4.1", text=text, button="Modify", fldID=fldID, tagID=tagID, ln=ln, confirm=1) if name and value and confirm in [1, "1"]: res = modify_tag(tagID, name, value) output += write_outcome(res) try: body = [output, extra] except NameError: body = [output] if callback: return perform_modifyfieldtags(fldID, ln, "perform_modifytag", addadminbox(subtitle, body)) else: return addadminbox(subtitle, body) | 2bfebc745d97514fe63c0e385bb842bede8f697e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/2bfebc745d97514fe63c0e385bb842bede8f697e/bibindexadminlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
17042,
2692,
12,
19794,
734,
16,
1047,
734,
16,
7211,
33,
4315,
2069,
539,
16,
508,
2218,
2187,
460,
2218,
2187,
1348,
2218,
9707,
2187,
6932,
29711,
21,
4672,
3536,
687,
358,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
17042,
2692,
12,
19794,
734,
16,
1047,
734,
16,
7211,
33,
4315,
2069,
539,
16,
508,
2218,
2187,
460,
2218,
2187,
1348,
2218,
9707,
2187,
6932,
29711,
21,
4672,
3536,
687,
358,
... |
if options['labels']: | if options.get('labels', False): | def _render_on_subplot(self, subplot): """ TESTS: | b8f1482102fdad41bf6ccadb60d23d37518592c4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/b8f1482102fdad41bf6ccadb60d23d37518592c4/contour_plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5902,
67,
265,
67,
24523,
12,
2890,
16,
19826,
4672,
3536,
22130,
55,
30,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
5902,
67,
265,
67,
24523,
12,
2890,
16,
19826,
4672,
3536,
22130,
55,
30,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
print dst_geom.ExportToWkt() | print(dst_geom.ExportToWkt()) | def ogr_factory_3(): src_wkt = 'POLYGON((0 0,100 0,100 100,0 0))' exp_wkt = 'MULTIPOLYGON (((0 0,100 0,100 100,0 0)))' src_geom = ogr.CreateGeometryFromWkt( src_wkt ) dst_geom = ogr.ForceToMultiPolygon( src_geom ) if ogrtest.check_feature_geometry( dst_geom, exp_wkt ): print dst_geom.ExportToWkt() return 'fail' src_wkt = 'GEOMETRYCOLLECTION(POLYGON((0 0,100 0,100 100,0 0)))' exp_wkt = 'MULTIPOLYGON (((0 0,100 0,100 100,0 0)))' src_geom = ogr.CreateGeometryFromWkt( src_wkt ) dst_geom = ogr.ForceToMultiPolygon( src_geom ) if ogrtest.check_feature_geometry( dst_geom, exp_wkt ): print dst_geom.ExportToWkt() return 'fail' return 'success' | aa75b013fbb8ec9e8cd52db626b33309de2decf7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10290/aa75b013fbb8ec9e8cd52db626b33309de2decf7/ogr_factory.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
320,
3197,
67,
6848,
67,
23,
13332,
225,
1705,
67,
91,
8629,
273,
296,
14232,
30317,
673,
12443,
20,
374,
16,
6625,
374,
16,
6625,
2130,
16,
20,
374,
13,
2506,
1329,
67,
91,
8629,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
320,
3197,
67,
6848,
67,
23,
13332,
225,
1705,
67,
91,
8629,
273,
296,
14232,
30317,
673,
12443,
20,
374,
16,
6625,
374,
16,
6625,
2130,
16,
20,
374,
13,
2506,
1329,
67,
91,
8629,
27... |
genpluginproject("ppc", "_Cm", libraries=["QuickTimeLib"], outputdir="::Lib:Carbon") | genpluginproject("ppc", "_Cm", libraries=["QuickTimeLib"], stdlibraryflags="Debug, WeakImport", outputdir="::Lib:Carbon") | def genpluginproject(architecture, module, project=None, projectdir=None, sources=[], sourcedirs=[], libraries=[], extradirs=[], extraexportsymbols=[], outputdir=":::Lib:lib-dynload", libraryflags=None, stdlibraryflags=None, prefixname=None): if architecture == "all": # For the time being we generate two project files. Not as nice as # a single multitarget project, but easier to implement for now. genpluginproject("ppc", module, project, projectdir, sources, sourcedirs, libraries, extradirs, extraexportsymbols, outputdir, libraryflags, stdlibraryflags, prefixname) genpluginproject("carbon", module, project, projectdir, sources, sourcedirs, libraries, extradirs, extraexportsymbols, outputdir, libraryflags, stdlibraryflags, prefixname) return templatename = "template-%s" % architecture targetname = "%s.%s" % (module, architecture) dllname = "%s.%s.slb" % (module, architecture) if not project: if architecture != "ppc": project = "%s.%s.mcp"%(module, architecture) else: project = "%s.mcp"%module if not projectdir: projectdir = PROJECTDIR if not sources: sources = [module + 'module.c'] if not sourcedirs: for moduledir in MODULEDIRS: if '%' in moduledir: # For historical reasons an initial _ in the modulename # is not reflected in the folder name if module[0] == '_': modulewithout_ = module[1:] else: modulewithout_ = module moduledir = moduledir % modulewithout_ fn = os.path.join(projectdir, os.path.join(moduledir, sources[0])) if os.path.exists(fn): moduledir, sourcefile = os.path.split(fn) sourcedirs = [relpath(projectdir, moduledir)] sources[0] = sourcefile break else: print "Warning: %s: sourcefile not found: %s"%(module, sources[0]) sourcedirs = [] if prefixname: pass elif architecture == "carbon": prefixname = "mwerks_carbonplugin_config.h" else: prefixname = "mwerks_plugin_config.h" dict = { "sysprefix" : relpath(projectdir, sys.prefix), "sources" : sources, "extrasearchdirs" : sourcedirs + extradirs, "libraries": libraries, "mac_outputdir" : outputdir, "extraexportsymbols" : extraexportsymbols, "mac_targetname" : targetname, "mac_dllname" : dllname, "prefixname" : prefixname, } if libraryflags: dict['libraryflags'] = libraryflags if stdlibraryflags: dict['stdlibraryflags'] = stdlibraryflags mkcwproject.mkproject(os.path.join(projectdir, project), module, dict, force=FORCEREBUILD, templatename=templatename) | 5ee24ae98d191d5a645c2cf67487285de2f2651b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5ee24ae98d191d5a645c2cf67487285de2f2651b/genpluginprojects.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3157,
4094,
4406,
12,
991,
18123,
16,
1605,
16,
1984,
33,
7036,
16,
1984,
1214,
33,
7036,
16,
5550,
22850,
6487,
1084,
8291,
22850,
6487,
14732,
22850,
6487,
7582,
361,
10539,
22850,
6487,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3157,
4094,
4406,
12,
991,
18123,
16,
1605,
16,
1984,
33,
7036,
16,
1984,
1214,
33,
7036,
16,
5550,
22850,
6487,
1084,
8291,
22850,
6487,
14732,
22850,
6487,
7582,
361,
10539,
22850,
6487,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.