rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
Win(you,1) | self.Win(self.you,1) | def loop (self): isSig=0 if (self.you.isNull()): self.Lose (1) return if (self.arrived==3): if (not self.istarget): curun=VS.getUnit(self.curiter) if (self.enemy): if (curun==self.enemy): self.enemy.setTarget(self.you) self.curiter+=1 if (you.isNull()): self.Lose(1) return if (self.enemy.isNull()): self.Win(you,1) return elif (self.arrived==2): if (VS.getSystemFile()==self.adjsys.DestinationSystem()): self.arrived=3 else: VS.ResetTimeCompression() if (self.you.isNull()): Lose(1) return if (self.enemy.isNull()): Win(you,1) return elif (self.arrived==1): significant=self.significant if (significant.isNull ()): print "sig null" VS.terminateMission(0) else: if (you.getSignificantDistance(significant)<10000.0): if (self.newship==""): self.newship=faction_ships.getRandomFighter(faction) self.enemy=launch.launch_wave_around_unit("Base",self.faction,self.newship,"default",1+self.difficulty,3000.0,4000.0,self.significant) if (self.enemy): if (runaway): self.enemy.setTarget(significant) self.enemy.Jump() self.arrived=2 else: self.arrived=3 else: if (self.adjsys.Execute()): self.arrived=1 self.newship=faction_ships.getRandomFighter(faction) localdestination=self.significant.getName() self.adjsys=go_somewhere_significant(self.you,0,500) VS.IOmessage (0,"bounty mission",self.mplay,"You must destroy the %s unit in this system." % (self.newship)) self.obj=VS.addObjective("Destroy the %s unit" % (self.newship)) if (runaway): #ADD OTHER JUMPING IF STATEMENT CODE HERE VS.IOmessage (3,"bounty mission",self.mplay,"He is running towards the jump point. Catch him!") VS.IOmessage (4,"bounty mission",self.mplay,"he is going to %s" % (localdestination)) else: VS.IOmessage (3,"bounty mission",self.mplay,"Scanners are picking up a metallic object!") VS.IOmessage (4,"bounty mission",self.mplay,"Coordinates appear near %s" % (localdestination)) | a537f39c17600bf6b993994cfcfafc164c3f274f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/a537f39c17600bf6b993994cfcfafc164c3f274f/bounty.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2798,
261,
2890,
4672,
353,
8267,
33,
20,
309,
261,
2890,
18,
19940,
18,
291,
2041,
1435,
4672,
365,
18,
1504,
307,
261,
21,
13,
327,
309,
261,
2890,
18,
5399,
2950,
631,
23,
4672,
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,
2798,
261,
2890,
4672,
353,
8267,
33,
20,
309,
261,
2890,
18,
19940,
18,
291,
2041,
1435,
4672,
365,
18,
1504,
307,
261,
21,
13,
327,
309,
261,
2890,
18,
5399,
2950,
631,
23,
4672,
3... |
icon = os.path.join('data', 'zim.png') mimedir = os.path.join(self.install_data, 'share', 'mime') for cmd in ( ('update-desktop-database',), ('update-mime-database', mimedir), ): print 'Trying: ' + ' '.join(cmd) subprocess.call(cmd) | if not self.skip_cmd: mimedir = os.path.join(self.install_data, 'share', 'mime') for cmd in ( ('update-desktop-database',), ('update-mime-database', mimedir), ): print 'Trying: ' + ' '.join(cmd) subprocess.call(cmd) | def run(self): install_class.run(self) | f114151f03f3be13b2d5f2ca07cd7deed695aff0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4103/f114151f03f3be13b2d5f2ca07cd7deed695aff0/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
3799,
67,
1106,
18,
2681,
12,
2890,
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,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
3799,
67,
1106,
18,
2681,
12,
2890,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
work_queue = WorkQueue(self, self.name) | work_queue = WorkQueue(self.name, self) | def execute(self, options, args, tool): self.options = options self.tool = tool work_queue = WorkQueue(self, self.name) work_queue.run() | 0c1b097c98db817ac403abec055b0f971890ee34 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/0c1b097c98db817ac403abec055b0f971890ee34/queues.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
16,
702,
16,
833,
16,
5226,
4672,
365,
18,
2116,
273,
702,
365,
18,
6738,
273,
5226,
1440,
67,
4000,
273,
4147,
3183,
12,
2890,
18,
529,
16,
365,
13,
1440,
67,
4000,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1836,
12,
2890,
16,
702,
16,
833,
16,
5226,
4672,
365,
18,
2116,
273,
702,
365,
18,
6738,
273,
5226,
1440,
67,
4000,
273,
4147,
3183,
12,
2890,
18,
529,
16,
365,
13,
1440,
67,
4000,
... |
self._background = self.canvas.copy_from_bbox(self.axes.bbox) self._drawPoints() | self._backgroundList = [self.canvas.copy_from_bbox(sp.bbox) for sp in self.subplotArr] for line in self._lineDict.itervalues(): line.subplot.draw_artist(line.line) for subplot in self.subplotArr: self.canvas.blit(subplot.bbox) | def _handleDrawEvent(self, event): """Handle draw event """ self._background = self.canvas.copy_from_bbox(self.axes.bbox) self._drawPoints() | 8f0db37bc375c56ac27469781575815f4f3b008d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6353/8f0db37bc375c56ac27469781575815f4f3b008d/StripChartWdg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4110,
6493,
1133,
12,
2890,
16,
871,
4672,
3536,
3259,
3724,
871,
3536,
365,
6315,
9342,
682,
273,
306,
2890,
18,
15424,
18,
3530,
67,
2080,
67,
20737,
12,
1752,
18,
20737,
13,
36... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4110,
6493,
1133,
12,
2890,
16,
871,
4672,
3536,
3259,
3724,
871,
3536,
365,
6315,
9342,
682,
273,
306,
2890,
18,
15424,
18,
3530,
67,
2080,
67,
20737,
12,
1752,
18,
20737,
13,
36... |
self.update_feed_cache( force_update = gl.update_on_startup) | def new(self): gl = gPodderLib() self.gPodder.resize( gl.main_window_width, gl.main_window_height) self.gPodder.move( gl.main_window_x, gl.main_window_y) while gtk.events_pending(): gtk.main_iteration( False) | e5c6525f9b51cdff147f0e46f17037d9df827077 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12778/e5c6525f9b51cdff147f0e46f17037d9df827077/gpodder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
12,
2890,
4672,
5118,
273,
314,
5800,
765,
5664,
1435,
365,
18,
75,
5800,
765,
18,
15169,
12,
5118,
18,
5254,
67,
5668,
67,
2819,
16,
5118,
18,
5254,
67,
5668,
67,
4210,
13,
365... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
12,
2890,
4672,
5118,
273,
314,
5800,
765,
5664,
1435,
365,
18,
75,
5800,
765,
18,
15169,
12,
5118,
18,
5254,
67,
5668,
67,
2819,
16,
5118,
18,
5254,
67,
5668,
67,
4210,
13,
365... | |
self.subplot = stripChartWdg.getSubplot(subplotInd) | self.subplot = stripChartWdg.subplotArr[subplotInd] | def __init__(self, stripChartWdg, subplotInd, **kargs): """Create a line Inputs: - stripChartWdg: the StripChartWdg to which this _Line belongs - subplotInd: the index of the subplot to which this _Line belongs - doAutoscale: if True then autoscale the y axis - **kargs: keyword arguments for matplotlib Line2D, such as color """ self.subplotInd = subplotInd self.subplot = stripChartWdg.getSubplot(subplotInd) self.line = matplotlib.lines.Line2D([], [], animated=True, **kargs) self.subplot.add_line(self.line) | dc80d77dbf0a5170aeb2ae8bf18c4b9bdeceab8a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6354/dc80d77dbf0a5170aeb2ae8bf18c4b9bdeceab8a/StripChartWdg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2569,
7984,
59,
72,
75,
16,
19826,
3866,
16,
2826,
79,
1968,
4672,
3536,
1684,
279,
980,
225,
24472,
30,
300,
2569,
7984,
59,
72,
75,
30,
326,
15589,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2569,
7984,
59,
72,
75,
16,
19826,
3866,
16,
2826,
79,
1968,
4672,
3536,
1684,
279,
980,
225,
24472,
30,
300,
2569,
7984,
59,
72,
75,
30,
326,
15589,
7... |
vers_minor = string.split (self.target_version, '.')[1] inifile.write ("vers_minor=%s\n" % vers_minor) | inifile.write ("target_version=%s\n" % self.target_version) | def create_inifile (self): # Create an inifile containing data describing the installation. # This could be done without creating a real file, but # a file is (at least) useful for debugging bdist_wininst. | 8a718307e8760854ee5452cdbef49b10400b0ced /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/8a718307e8760854ee5452cdbef49b10400b0ced/bdist_wininst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
267,
430,
398,
261,
2890,
4672,
468,
1788,
392,
316,
430,
398,
4191,
501,
16868,
326,
13193,
18,
468,
1220,
3377,
506,
2731,
2887,
4979,
279,
2863,
585,
16,
1496,
468,
279,
58... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
267,
430,
398,
261,
2890,
4672,
468,
1788,
392,
316,
430,
398,
4191,
501,
16868,
326,
13193,
18,
468,
1220,
3377,
506,
2731,
2887,
4979,
279,
2863,
585,
16,
1496,
468,
279,
58... |
def setBotName(self, name): """Sets the bot's name. The name must be a single word!""" self._botName = string.join(name.split()) self._brain.setBotName(self._botName) | def setBotName(self, newName): "Sets the bot's name. THIS FUNCTION IS DEPRECATED -- use setBotPredicate instead" print "NOTE: Kernel.setBotName() is deprecated. Use Kernel.setBotPredicate() instead." self.setBotPredicate("name", newName) | def setBotName(self, name): """Sets the bot's name. The name must be a single word!""" # Collapse a multi-word name into a single word self._botName = string.join(name.split()) # must update the name in the brain as well self._brain.setBotName(self._botName) | cdb5ca51cf362e7f41cc166060e200bc84fcb1e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6428/cdb5ca51cf362e7f41cc166060e200bc84fcb1e8/Kernel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
6522,
461,
12,
2890,
16,
508,
4672,
3536,
2785,
326,
2512,
1807,
508,
18,
225,
1021,
508,
1297,
506,
279,
2202,
2076,
5,
8395,
468,
1558,
14820,
279,
3309,
17,
1095,
508,
1368,
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,
444,
6522,
461,
12,
2890,
16,
508,
4672,
3536,
2785,
326,
2512,
1807,
508,
18,
225,
1021,
508,
1297,
506,
279,
2202,
2076,
5,
8395,
468,
1558,
14820,
279,
3309,
17,
1095,
508,
1368,
27... |
def flimage_free_rgb(p1): """ flimage_free_rgb(p1) """ _flimage_free_rgb(p1) | def flimage_free_rgb(pImage): """ flimage_free_rgb(pImage) """ _flimage_free_rgb(pImage) | def flimage_free_rgb(p1): """ flimage_free_rgb(p1) """ _flimage_free_rgb(p1) | 8765c710f695de392f6fc7c664c746ec98668b1d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/8765c710f695de392f6fc7c664c746ec98668b1d/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
2730,
67,
9156,
67,
10948,
12,
84,
2040,
4672,
3536,
1183,
2730,
67,
9156,
67,
10948,
12,
84,
2040,
13,
3536,
225,
389,
2242,
2730,
67,
9156,
67,
10948,
12,
84,
2040,
13,
282,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1183,
2730,
67,
9156,
67,
10948,
12,
84,
2040,
4672,
3536,
1183,
2730,
67,
9156,
67,
10948,
12,
84,
2040,
13,
3536,
225,
389,
2242,
2730,
67,
9156,
67,
10948,
12,
84,
2040,
13,
282,
... |
if Language.objects.filter(code__in=[name, name.lower()]).count(): | if Language.objects.filter(code__iexact=name).count(): | def direct_language_match_filename(language_code, path_name): name, ext = os.path.splitext(os.path.basename(path_name)) if name == language_code or name.lower() == language_code.lower(): return True # check file doesn't match another language if Language.objects.filter(code__in=[name, name.lower()]).count(): return False regexp = "^(.{4,}[-_.])?%s$" % language_code return bool(re.match(regexp, name, re.IGNORECASE)) | 740621fb6cfa063c87ae9b67f66389b98c4e1d31 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11388/740621fb6cfa063c87ae9b67f66389b98c4e1d31/project_tree.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2657,
67,
4923,
67,
1916,
67,
3459,
12,
4923,
67,
710,
16,
589,
67,
529,
4672,
508,
16,
1110,
273,
1140,
18,
803,
18,
4939,
408,
12,
538,
18,
803,
18,
13909,
12,
803,
67,
529,
3719... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2657,
67,
4923,
67,
1916,
67,
3459,
12,
4923,
67,
710,
16,
589,
67,
529,
4672,
508,
16,
1110,
273,
1140,
18,
803,
18,
4939,
408,
12,
538,
18,
803,
18,
13909,
12,
803,
67,
529,
3719... |
CppText += IndentText + "tt_TurtlePos[%i] = %s;\n" % (i, Arg.Elements[i].Text) | UpdateTurtle += NextIndent + "tt_TurtlePos[%i] = %s;\n" % (i, Arg.Elements[i].Text) | def GetCppBuiltInInstruction(self, pInstruct, iIndent): IndentText = " " * (iIndent * self.IndentSize) NextIndent = " " * ((iIndent+1) * self.IndentSize) NumTypeGL = self.LogoState.NumType[0] NumTypeMath = "" if self.LogoState.NumType == 'float': NumTypeMath = "f" CppText = "" # get the C++ code for each argument in this instruction ArgText = [] for arg in pInstruct.Arguments: if arg.ArgType == ParamType.LISTCODE: ArgText.append("") else: text = self.GetCppArgument(arg) if text is None: return None ArgText.append(text) # now handle the particular instruction if pInstruct.pProc.FullName == ".setspecial": # .SETSPECIAL return "" elif pInstruct.pProc.FullName == "abs": # ABS CppText += "fabs%s(%s)" % (NumTypeMath, ArgText[0]) elif pInstruct.pProc.FullName == "and": # AND bFirst = True for argtext in ArgText: if bFirst is True: bFirst = False else: CppText += " && " CppText += "(%s)" % argtext elif pInstruct.pProc.FullName == "arctan": # ARCTAN if len(ArgText) == 1: CppText += "atan%s(%s) * tt_DegreeRad" % (NumTypeMath, ArgText[0]) else: CppText += "atan2%s(%s, %s) * tt_DegreeRad" % (NumTypeMath, ArgText[1], ArgText[0]) elif pInstruct.pProc.FullName == "array": # ARRAY CppText += "CArray<%s,1>(" % self.LogoState.NumType if len(pInstruct.Arguments) == 1: CppText += "(int) (%s), 1" % ArgText[0] else: CppText += "(int) (%s), (int) (%s)" % (ArgText[0], ArgText[1]) CppText += ")" elif pInstruct.pProc.FullName == "back": # BACK return self.GetCppBuiltinMove(IndentText, pInstruct.Arguments[0], "-") elif pInstruct.pProc.FullName == "butfirst": # BUTFIRST CppText += "%s.ButFirst()" % ArgText[0] elif pInstruct.pProc.FullName == "butlast": # BUTLAST CppText += "%s.ButLast()" % ArgText[0] elif pInstruct.pProc.FullName == "clean": # CLEAN CppText += IndentText + "wrapper_Clean();\n" elif pInstruct.pProc.FullName == "clearscreen": # CLEARSCREEN # just move to HOME position and call clean CppText += IndentText + "tt_TurtlePos[0] = tt_TurtlePos[1] = 0.5;\n" CppText += IndentText + "tt_TurtleDir = 0.0;\n" CppText += IndentText + "wrapper_Clean();\n" elif pInstruct.pProc.FullName == "cos": # COS CppText += "cos%s((%s) * tt_RadDegree)" % (NumTypeMath, ArgText[0]) elif pInstruct.pProc.FullName == "count": # COUNT CppText += "%s.Length()" % ArgText[0] elif pInstruct.pProc.FullName == "difference": # DIFFERENCE CppText += "(%s) - (%s)" % (ArgText[0], ArgText[1]) elif pInstruct.pProc.FullName in ("do.while", "do.until"): # DO.WHILE, DO.UNTIL CppText += IndentText + "do {\n" for instruct in pInstruct.Arguments[0].Elements[0].pInstruct: codetext = self.GetCppInstruction(instruct, iIndent + 1, True) if codetext is None: return None CppText += codetext if pInstruct.pProc.FullName == "do.while": CppText += IndentText + "} while (%s);\n" % ArgText[1] else: CppText += IndentText + "} while (!(%s));\n" % ArgText[1] elif pInstruct.pProc.FullName == "emptyp": # EMPTYP CppText += "%s.Length() == 0" % ArgText[0] elif pInstruct.pProc.FullName == "erasescreen": # ERASESCREEN CppText += IndentText + "wrapper_Erase();\n" elif pInstruct.pProc.FullName == "exp": # EXP CppText += "exp%s(%s)" % (NumTypeMath, ArgText[0]) elif pInstruct.pProc.FullName == "first": # FIRST CppText += "%s[0]" % ArgText[0] elif pInstruct.pProc.FullName == "for": # FOR my_temp = self.LogoState.TempIdx self.LogoState.TempIdx += 1 varname = pInstruct.pMakeVar.CppName # write code to set the start and limit values for the FOR loop CppText += IndentText + "%s start%02i = %s;\n" % (self.LogoState.NumType, my_temp, ArgText[1]) CppText += IndentText + "%s limit%02i = %s;\n" % (self.LogoState.NumType, my_temp, ArgText[2]) # write code to set the step size if pInstruct.Arguments[3].ArgType == ParamType.NUMBER: CodeList = pInstruct.Arguments[4].Elements[0].pInstruct CppText += IndentText + "%s step%02i = %s;\n" % (self.LogoState.NumType, my_temp, ArgText[3]) else: CodeList = pInstruct.Arguments[3].Elements[0].pInstruct CppText += IndentText + "%s step%02i = start%02i <= limit%02i ? 1.0 : -1.0;\n" % (self.LogoState.NumType, my_temp, my_temp, my_temp) # now write the FOR loop CppText += IndentText + "for (%s = start%02i; (%s - limit%02i) * step%02i <= 0.0; %s += step%02i)\n" % (varname, my_temp, varname, my_temp, my_temp, varname, my_temp) CppText += IndentText + "{\n" for instruct in CodeList: codetext = self.GetCppInstruction(instruct, iIndent + 1, True) if codetext is None: return None CppText += codetext CppText += IndentText + "}\n" elif pInstruct.pProc.FullName == "forever": # FOREVER my_counter = self.LogoState.LoopIdx self.LogoState.LoopIdx += 1 CppText += IndentText + "for (int loop%02i=1; ; loop%02i++)\n%s{\n" % (my_counter, my_counter, IndentText) for instruct in pInstruct.Arguments[0].Elements[0].pInstruct: self.LogoState.InnerLoopIdx = my_counter codetext = self.GetCppInstruction(instruct, iIndent + 1, True) if codetext is None: return None CppText += codetext CppText += IndentText + "}\n" self.LogoState.InnerLoopIdx = -1 elif pInstruct.pProc.FullName == "forward": # FORWARD return self.GetCppBuiltinMove(IndentText, pInstruct.Arguments[0], "+") elif pInstruct.pProc.FullName == "fput": # FPUT CppText += "CList<%s>(%s, %s)" % (self.LogoState.NumType, ArgText[0], ArgText[1]) elif pInstruct.pProc.FullName == "gaussian": # GAUSSIAN CppText += "tt_Gaussian()" elif pInstruct.pProc.FullName == "goto": # GOTO CppText += IndentText + "goto tag_%s;\n" % ArgText[0][1:-1] elif pInstruct.pProc.FullName == "heading": # HEADING CppText += "(tt_TurtleDir < 0.0 ? 360.0+fmod(tt_TurtleDir,360.0) : fmod(tt_TurtleDir,360.0))" elif pInstruct.pProc.FullName == "home": # HOME CppText += IndentText + "tt_TurtlePos[0] = tt_TurtlePos[1] = 0.5;\n" CppText += IndentText + "tt_TurtleDir = 0.0;\n" elif pInstruct.pProc.FullName in ("if", "ifelse"): # IF, IFELSE CppText += IndentText + "if (%s)\n" % ArgText[0] + IndentText + "{\n" for instruct in pInstruct.Arguments[1].Elements[0].pInstruct: codetext = self.GetCppInstruction(instruct, iIndent + 1, True) if codetext is None: return None CppText += codetext if pInstruct.pProc.FullName == "if": CppText += IndentText + "}\n" else: CppText += IndentText + "} else {\n" for instruct in pInstruct.Arguments[2].Elements[0].pInstruct: codetext = self.GetCppInstruction(instruct, iIndent + 1, True) if codetext is None: return None CppText += codetext CppText += IndentText + "}\n" elif pInstruct.pProc.FullName in ("iftrue", "iffalse"): # IFTRUE, IFFALSE if pInstruct.pProc.FullName == "iftrue": CppText += IndentText + "if (tt_TestValue)\n" + IndentText + "{\n" else: CppText += IndentText + "if (!tt_TestValue)\n" + IndentText + "{\n" for instruct in pInstruct.Arguments[0].Elements[0].pInstruct: codetext = self.GetCppInstruction(instruct, iIndent + 1, True) if codetext is None: return None CppText += codetext CppText += IndentText + "}\n" elif pInstruct.pProc.FullName == "int": # INT CppText += "(int) (%s)" % ArgText[0] elif pInstruct.pProc.FullName == "item": # ITEM if pInstruct.Arguments[1].ArgType == ParamType.LISTNUM: CppText += "%s[(int) (%s)-1]" % (ArgText[1], ArgText[0]) elif pInstruct.Arguments[1].ArgType == ParamType.ARRAY: CppText += "%s.Get((int) (%s))" % (ArgText[1], ArgText[0]) elif pInstruct.pProc.FullName == "label": # LABEL CppText += IndentText + "glEnd();\n" CppText += IndentText + "sprintf(tt_LabelText, \"" bFirst = True for arg in pInstruct.Arguments: if bFirst is True: bFirst = False else: CppText += " " if arg.ArgType == ParamType.QUOTEDWORD or arg.ArgType == ParamType.BOOLEAN: CppText += "%s" elif arg.ArgType == ParamType.NUMBER: CppText += "%g" else: print "Syntax error: Invalid parameter type %i (%s) in LABEL instruction." % (arg.ArgType, ParamType.Names[arg.ArgType]) return None CppText += "\"" for i in range(len(pInstruct.Arguments)): arg = pInstruct.Arguments[i] CppText += ", " if arg.ArgType == ParamType.QUOTEDWORD: CppText += ArgText[i] elif arg.ArgType == ParamType.NUMBER: CppText += "(double) (%s)" % ArgText[i] elif arg.ArgType == ParamType.BOOLEAN: CppText += '(%s) ? "True" : "False"' % ArgText[i] CppText += ");\n" CppText += IndentText + "DrawPointText(tt_Font, tt_JustifyVert, tt_JustifyHorz, tt_FontHeight, tt_TurtlePos[0], tt_TurtlePos[1], tt_LabelText);\n" CppText += IndentText + "glBegin(GL_LINES);\n" elif pInstruct.pProc.FullName == "last": # LAST CppText += "%s.Last()" % ArgText[0] elif pInstruct.pProc.FullName == "left": # LEFT CppText += IndentText + "tt_TurtleDir -= %s;\n" % ArgText[0] elif pInstruct.pProc.FullName == "list": # LIST CppText += "CList<%s>(" % self.LogoState.NumType if len(pInstruct.Arguments) <= 4: for i in range(len(pInstruct.Arguments)): if i != 0: CppText += ", " CppText += ArgText[i] else: CppText += "%i" % len(pInstruct.Arguments) for i in range(len(pInstruct.Arguments)): CppText += ", (double) %s" % ArgText[i] CppText += ")" elif pInstruct.pProc.FullName == "ln": # LN CppText += "log%s(%s)" % (NumTypeMath, ArgText[0]) elif pInstruct.pProc.FullName in ("localmake", "make"): # LOCALMAKE, MAKE CppText += IndentText + pInstruct.pMakeVar.CppName + " = " + ArgText[1] + ";\n" elif pInstruct.pProc.FullName == "log10": # LOG10 CppText += "log10%s(%s)" % (NumTypeMath, ArgText[0]) elif pInstruct.pProc.FullName == "lput": # FPUT CppText += "CList<%s>(%s, %s)" % (self.LogoState.NumType, ArgText[1], ArgText[0]) elif pInstruct.pProc.FullName == "mdarray": # MDARRAY if pInstruct.ReturnArrayDim is None: print "Internal error: unknown array dimensions for 'MDARRAY %s'" % ArgText[0] return None if pInstruct.ReturnArrayDim < 2 or pInstruct.ReturnArrayDim > 3: print "Logical error: MDARRAY cannot create an array with %i dimensions" % pInstruct.ReturnArrayDim return None listargtext = self.GetCppListnumExpansion(pInstruct.Arguments[0], pInstruct.ReturnArrayDim, "MDARRAY") if listargtext == None: return None CppText += "CArray<%s,%i>(%s)" % (self.LogoState.NumType, pInstruct.ReturnArrayDim, listargtext) elif pInstruct.pProc.FullName == "mditem": # MDITEM if pInstruct.Arguments[1].Elements[0].Type != ElemType.VAR_VALUE: print "Syntax error: MDITEM requires a variable for the array input, but '%s' was given" % pInstruct.Arguments[1].Elements[0].Text return None ArrayDim = pInstruct.Arguments[1].Elements[0].pVariable.ArrayDim if ArrayDim < 2: print "Logical error: Array '%s' in MDITEM instruction has fewer than 2 dimensions" % pInstruct.Arguments[1].Elements[0].Text return None listargtext = self.GetCppListnumExpansion(pInstruct.Arguments[0], ArrayDim, "MDITEM") if listargtext == None: return None CppText += "%s.Get(%s)" % (ArgText[1], listargtext) elif pInstruct.pProc.FullName == "mdsetitem": # MDSETITEM if pInstruct.Arguments[1].Elements[0].Type != ElemType.VAR_VALUE: print "Syntax error: MDSETITEM requires a variable for the array input, but '%s' was given" % pInstruct.Arguments[1].Elements[0].Text return None ArrayDim = pInstruct.Arguments[1].Elements[0].pVariable.ArrayDim if ArrayDim < 2: print "Logical error: Array '%s' in MDSETITEM instruction has fewer than 2 dimensions" % pInstruct.Arguments[1].Elements[0].Text return None listargtext = self.GetCppListnumExpansion(pInstruct.Arguments[0], ArrayDim, "MDSETITEM") if listargtext == None: return None CppText += IndentText + "%s.Set(%s, %s);\n" % (ArgText[1], ArgText[2], listargtext) elif pInstruct.pProc.FullName == "minus": # MINUS CppText += "-(%s)" % ArgText[0] elif pInstruct.pProc.FullName == "not": # NOT CppText += "!(%s)" % ArgText[0] elif pInstruct.pProc.FullName == "or": # OR bFirst = True for argtext in ArgText: if bFirst is True: bFirst = False else: CppText += " || " CppText += "(%s)" % argtext elif pInstruct.pProc.FullName == "output": # OUTPUT CppText += IndentText + "return %s;\n" % ArgText[0] elif pInstruct.pProc.FullName == "penup": # PENUP CppText += IndentText + "tt_PenDown = false;\n" elif pInstruct.pProc.FullName == "pendown": # PENDOWN CppText += IndentText + "tt_PenDown = true;\n" elif pInstruct.pProc.FullName == "penerase": # PENERASE CppText += IndentText + "tt_PenPaint = false;\n" CppText += IndentText + "glColor3ubv(tt_ColorBackground);\n" elif pInstruct.pProc.FullName == "penpaint": # PENPAINT CppText += IndentText + "tt_PenPaint = true;\n" CppText += IndentText + "glColor3ubv(tt_ColorPen);\n" elif pInstruct.pProc.FullName == "pick": # PICK CppText += "%s.Pick()" % ArgText[0] elif pInstruct.pProc.FullName == "pos": # POS CppText += "CList<%s>(tt_TurtlePos[0], tt_TurtlePos[1])" % self.LogoState.NumType elif pInstruct.pProc.FullName == "power": # POWER CppText += "pow%s(%s, %s)" % (NumTypeMath, ArgText[0], ArgText[1]) elif pInstruct.pProc.FullName == "product": # PRODUCT CppText += "(%s)" % ArgText[0] for argtext in ArgText[1:]: CppText += " * (%s)" % argtext elif pInstruct.pProc.FullName == "quotient": # QUOTIENT if len(ArgText) == 1: CppText += "1.0 / (%s)" % ArgText[0] else: CppText += "(%s) / (%s)" % (ArgText[0], ArgText[1]) elif pInstruct.pProc.FullName == "radarctan": # RADARCTAN if len(ArgText) == 1: CppText += "atan%s(%s)" % (NumTypeMath, ArgText[0]) else: CppText += "atan2%s(%s, %s)" % (NumTypeMath, ArgText[1], ArgText[0]) elif pInstruct.pProc.FullName == "radcos": # RADCOS CppText += "cos%s(%s)" % (NumTypeMath, ArgText[0]) elif pInstruct.pProc.FullName == "radsin": # RADSIN CppText += "sin%s(%s)" % (NumTypeMath, ArgText[0]) elif pInstruct.pProc.FullName == "random": # RANDOM if len(ArgText) == 1: CppText += "tt_Random((int) (%s))" % ArgText[0] else: CppText += "tt_Random((int) (%s), (int) (%s))" % (ArgText[0], ArgText[1]) elif pInstruct.pProc.FullName == "remainder": # REMAINDER CppText += "(int) (%s) %% (int) (%s)" % (ArgText[0], ArgText[1]) elif pInstruct.pProc.FullName == "repcount": # REPCOUNT if self.LogoState.InnerLoopIdx == -1: print "Syntax error: REPCOUNT instruction used outside of a FOREVER or REPEAT loop" return None CppText += "loop%02i" % self.LogoState.InnerLoopIdx elif pInstruct.pProc.FullName == "repeat": # REPEAT my_counter = self.LogoState.LoopIdx self.LogoState.LoopIdx += 1 CppText += IndentText + "for (int loop%02i=1; loop%02i <= %s; loop%02i++)\n" % (my_counter, my_counter, ArgText[0], my_counter) CppText += IndentText + "{\n" for instruct in pInstruct.Arguments[1].Elements[0].pInstruct: self.LogoState.InnerLoopIdx = my_counter codetext = self.GetCppInstruction(instruct, iIndent + 1, True) if codetext is None: return None CppText += codetext CppText += IndentText + "}\n" self.LogoState.InnerLoopIdx = -1 elif pInstruct.pProc.FullName == "rerandom": # RERANDOM if len(ArgText) == 0: CppText += IndentText + "srand(0);\n" else: CppText += IndentText + "srand((int) (%s));\n" % ArgText[0] elif pInstruct.pProc.FullName == "reverse": # REVERSE CppText += "%s.Reverse()" % ArgText[0] elif pInstruct.pProc.FullName == "right": # RIGHT CppText += IndentText + "tt_TurtleDir += %s;\n" % ArgText[0] elif pInstruct.pProc.FullName == "round": # ROUND CppText += "round%s(%s)" % (NumTypeMath, ArgText[0]) elif pInstruct.pProc.FullName == "setbackground": # SETBACKGROUND codetext = self.GetCppBuiltinSetColor(IndentText, pInstruct.Arguments[0], "tt_ColorBackground") if codetext is None: return None CppText += codetext CppText += IndentText + "if (tt_PenPaint == false)\n" CppText += IndentText + " " * self.IndentSize + "glColor3ubv(tt_ColorBackground);\n" elif pInstruct.pProc.FullName == "setfont": # SETFONT CppText += IndentText + "tt_Font = %s;\n" % ArgText[0] elif pInstruct.pProc.FullName == "setfontheight": # SETFONTHEIGHT CppText += IndentText + "tt_FontHeight = %s;\n" % ArgText[0] elif pInstruct.pProc.FullName == "setheading": # SETHEADING CppText += IndentText + "tt_TurtleDir = %s;\n" % ArgText[0] elif pInstruct.pProc.FullName == "setitem": # SETITEM if pInstruct.Arguments[1].Elements[0].Type != ElemType.VAR_VALUE: print "Syntax error: destination array for SETITEM instruction can only be a variable" return None if pInstruct.Arguments[1].Elements[0].pVariable.ArrayDim != 1: print "Logical error: Array '%s' in SETITEM instruction is not 1-dimensional" % pInstruct.Arguments[1].Elements[0].Text return None CppText += IndentText + "%s.Set(%s, (int) (%s));\n" % (ArgText[1], ArgText[2], ArgText[0]) elif pInstruct.pProc.FullName == "setjustifyvert": # SETJUSTIFYVERT CppText += IndentText + "tt_JustifyVert = %s;\n" % ArgText[0] elif pInstruct.pProc.FullName == "setjustifyhorz": # SETJUSTIFYHORZ CppText += IndentText + "tt_JustifyHorz = %s;\n" % ArgText[0] elif pInstruct.pProc.FullName == "setpencolor": # SETPENCOLOR codetext = self.GetCppBuiltinSetColor(IndentText, pInstruct.Arguments[0], "tt_ColorPen") if codetext is None: return None CppText += codetext CppText += IndentText + "if (tt_PenPaint == true)\n" CppText += NextIndent + "glColor3ubv(tt_ColorPen);\n" elif pInstruct.pProc.FullName == "setpensize": # SETPENSIZE CppText += IndentText + "glEnd();\n" CppText += IndentText + "glLineWidth(%s);\n" % ArgText[0] CppText += IndentText + "glBegin(GL_LINES);\n" elif pInstruct.pProc.FullName == "setpos": # SETPOS Arg = pInstruct.Arguments[0] elem0type = Arg.Elements[0].Type CppText += IndentText + "if (tt_PenDown)\n" CppText += NextIndent + "glVertex2%s(tt_TurtlePos[0], tt_TurtlePos[1]);\n" % NumTypeGL if elem0type == ElemType.NUMBER: if len(Arg.Elements) != 2: print "Syntax error: SETPOS instruction takes an immediate list with exactly 2 numbers, but %i were given." % len(Arg.Elements) return None for i in range(2): CppText += IndentText + "tt_TurtlePos[%i] = %s;\n" % (i, Arg.Elements[i].Text) elif elem0type == ElemType.VAR_VALUE: CppText += IndentText + "tt_TurtlePos[0] = %s[0];\n" % (Arg.Elements[0].pVariable.CppName) CppText += IndentText + "tt_TurtlePos[1] = %s[1];\n" % (Arg.Elements[0].pVariable.CppName) elif elem0type == ElemType.FUNC_CALL: my_temp = self.LogoState.TempIdx self.LogoState.TempIdx += 1 codetext = self.GetCppInstruction(Arg.Elements[0].pInstruct, 0, False) if codetext is None: return None CppText += IndentText + "CList<%s> templist%02i = %s;\n" % (self.LogoState.NumType, my_temp, codetext) CppText += IndentText + "tt_TurtlePos[0] = templist%02i[0];\n" % my_temp CppText += IndentText + "tt_TurtlePos[1] = templist%02i[1];\n" % my_temp else: print "Internal error: invalid element type %i '%s' in a List argument for SETPOS." % (elem0type, ElemType.Names[elem0type]) return None CppText += IndentText + "if (tt_PenDown)\n" CppText += NextIndent + "glVertex2%s(tt_TurtlePos[0], tt_TurtlePos[1]);\n" % NumTypeGL elif pInstruct.pProc.FullName == "setscrunch": # SETSCRUNCH CppText += IndentText + "tt_ScrunchXY[0] = %s;\n" % ArgText[0] CppText += IndentText + "tt_ScrunchXY[1] = %s;\n" % ArgText[1] elif pInstruct.pProc.FullName == "setxy": # SETXY CppText += IndentText + "if (tt_PenDown)\n" + IndentText + "{\n" CppText += NextIndent + "glVertex2%s(tt_TurtlePos[0], tt_TurtlePos[1]);\n" % NumTypeGL CppText += NextIndent + "tt_TurtlePos[0] = %s;\n" % ArgText[0] CppText += NextIndent + "tt_TurtlePos[1] = %s;\n" % ArgText[1] CppText += NextIndent + "glVertex2%s(tt_TurtlePos[0], tt_TurtlePos[1]);\n" % NumTypeGL CppText += IndentText + "}\n" + IndentText + "else\n" + IndentText + "{\n" CppText += NextIndent + "tt_TurtlePos[0] = %s;\n" % ArgText[0] CppText += NextIndent + "tt_TurtlePos[1] = %s;\n" % ArgText[1] CppText += IndentText + "}\n" elif pInstruct.pProc.FullName == "setx": # SETX CppText += IndentText + "if (tt_PenDown)\n" + IndentText + "{\n" CppText += NextIndent + "glVertex2%s(tt_TurtlePos[0], tt_TurtlePos[1]);\n" % NumTypeGL CppText += NextIndent + "tt_TurtlePos[0] = %s;\n" % ArgText[0] CppText += NextIndent + "glVertex2%s(tt_TurtlePos[0], tt_TurtlePos[1]);\n" % NumTypeGL CppText += IndentText + "}\n" + IndentText + "else\n" + IndentText + "{\n" CppText += NextIndent + "tt_TurtlePos[0] = %s;\n" % ArgText[0] CppText += IndentText + "}\n" elif pInstruct.pProc.FullName == "sety": # SETY CppText += IndentText + "if (tt_PenDown)\n" + IndentText + "{\n" CppText += NextIndent + "glVertex2%s(tt_TurtlePos[0], tt_TurtlePos[1]);\n" % NumTypeGL CppText += NextIndent + "tt_TurtlePos[1] = %s;\n" % ArgText[0] CppText += NextIndent + "glVertex2%s(tt_TurtlePos[0], tt_TurtlePos[1]);\n" % NumTypeGL CppText += IndentText + "}\n" + IndentText + "else\n" + IndentText + "{\n" CppText += NextIndent + "tt_TurtlePos[1] = %s;\n" % ArgText[0] CppText += IndentText + "}\n" elif pInstruct.pProc.FullName == "sin": # SIN CppText += "sin%s((%s) * tt_RadDegree)" % (NumTypeMath, ArgText[0]) elif pInstruct.pProc.FullName == "sqrt": # SQRT CppText += "sqrt%s(%s)" % (NumTypeMath, ArgText[0]) elif pInstruct.pProc.FullName == "stop": # STOP CppText += IndentText + "return;\n" elif pInstruct.pProc.FullName == "sum": # SUM CppText += "(%s)" % ArgText[0] for argtext in ArgText[1:]: CppText += " + (%s)" % argtext elif pInstruct.pProc.FullName == "tag": # TAG CppText += "tag_%s:\n" % ArgText[0][1:-1] elif pInstruct.pProc.FullName == "test": # TEST CppText += IndentText + "tt_TestValue = (bool) (%s);\n" % ArgText[0] elif pInstruct.pProc.FullName == "towards": # TOWARDS Arg = pInstruct.Arguments[0] elem0type = Arg.Elements[0].Type if elem0type == ElemType.NUMBER: if len(Arg.Elements) != 2: print "Syntax error: TOWARDS instruction takes an immediate list with exactly 2 numbers, but %i were given." % len(Arg.Elements) return None CppText += "(atan2(%s - tt_TurtlePos[0], %s - tt_TurtlePos[1])*tt_DegreeRad)" % (Arg.Elements[0].Text, Arg.Elements[1].Text) elif elem0type == ElemType.VAR_VALUE: CppText += "tt_Towards(%s)" % Arg.Elements[0].pVariable.CppName elif elem0type == ElemType.FUNC_CALL: codetext = self.GetCppInstruction(Arg.Elements[0].pInstruct, 0, False) if codetext is None: return None CppText += "tt_Towards(%s)" % codetext else: print "Internal error: invalid element type %i '%s' in a List argument for TOWARDS." % (elem0type, ElemType.Names[elem0type]) return None elif pInstruct.pProc.FullName == "wait": # WAIT CppText += IndentText + "SDL_Delay((int) ((%s) * 1000 / 60));\n" % ArgText[0] elif pInstruct.pProc.FullName in ("while", "until"): # WHILE, UNTIL if pInstruct.pProc.FullName == "while": CppText += IndentText + "while (%s) {\n" % ArgText[0] else: CppText += IndentText + "while (!(%s)) {\n" % ArgText[0] for instruct in pInstruct.Arguments[1].Elements[0].pInstruct: codetext = self.GetCppInstruction(instruct, iIndent + 1, True) if codetext is None: return None CppText += codetext CppText += IndentText + "}\n" elif pInstruct.pProc.FullName == "window": # WINDOW CppText += IndentText + "tt_UseWrap = false;\n" elif pInstruct.pProc.FullName == "wrap": # WRAP CppText += IndentText + "tt_UseWrap = true;\n" elif pInstruct.pProc.FullName == "xcor": # XCOR CppText += "tt_TurtlePos[0]" elif pInstruct.pProc.FullName == "ycor": # YCOR CppText += "tt_TurtlePos[1]" else: print "Internal error: built-in instruction named '%s' is not implemented" % pInstruct.Name return None return CppText | 150673c3dc5ab46313332bf1deae010112848af5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2419/150673c3dc5ab46313332bf1deae010112848af5/tt_cppwriter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
39,
11858,
16409,
382,
11983,
12,
2890,
16,
293,
382,
1697,
16,
277,
7790,
4672,
28653,
1528,
273,
315,
315,
380,
261,
77,
7790,
380,
365,
18,
7790,
1225,
13,
4804,
7790,
273,
315... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
39,
11858,
16409,
382,
11983,
12,
2890,
16,
293,
382,
1697,
16,
277,
7790,
4672,
28653,
1528,
273,
315,
315,
380,
261,
77,
7790,
380,
365,
18,
7790,
1225,
13,
4804,
7790,
273,
315... |
yield "<h2>Older builds:</h2>" yield "<table class='real'>" yield "<thead><tr><th>Revision</th><th>Status</th></tr></thead>" yield "<tbody>" | yield "<h2>Older builds:</h2>\n" yield "<table class='real'>\n" yield "<thead><tr><th>Revision</th><th>Status</th></tr></thead>\n" yield "<tbody>\n" | def show_oldrevs(self, myself, tree, host, compiler): """show the available old revisions, if any""" old_rev_builds = self.buildfarm.builds.get_old_revs(tree, host, compiler) | 1f985416a874ef995e451af972947ff0cb24b989 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7314/1f985416a874ef995e451af972947ff0cb24b989/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
67,
1673,
266,
6904,
12,
2890,
16,
3399,
2890,
16,
2151,
16,
1479,
16,
5274,
4672,
3536,
4500,
326,
2319,
1592,
18325,
16,
309,
1281,
8395,
1592,
67,
9083,
67,
27324,
225,
273,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
67,
1673,
266,
6904,
12,
2890,
16,
3399,
2890,
16,
2151,
16,
1479,
16,
5274,
4672,
3536,
4500,
326,
2319,
1592,
18325,
16,
309,
1281,
8395,
1592,
67,
9083,
67,
27324,
225,
273,
3... |
def _dom_node(self, dom): return dom.Text(self.data) def _rooted_dom_node(self, domroot): | def _dom_node(self, domroot): | def _dom_node(self, dom): return dom.Text(self.data) | 63986dc09bb8be7acac6756139a831ac047b912d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1278/63986dc09bb8be7acac6756139a831ac047b912d/nodes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9859,
67,
2159,
12,
2890,
16,
4092,
4672,
327,
4092,
18,
1528,
12,
2890,
18,
892,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
9859,
67,
2159,
12,
2890,
16,
4092,
4672,
327,
4092,
18,
1528,
12,
2890,
18,
892,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
], CONTEXT) | ], 0, None, None, CONTEXT) | def test0050char(self): ''' Test Char. ''' char1_id = self.char.create({ 'char': 'Test', }, CONTEXT) self.assert_(char1_id) | 52062c763bf1737b3f2071e48338f60845edc54d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9266/52062c763bf1737b3f2071e48338f60845edc54d/test_tryton.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
713,
3361,
3001,
12,
2890,
4672,
9163,
7766,
3703,
18,
9163,
1149,
21,
67,
350,
273,
365,
18,
3001,
18,
2640,
12590,
296,
3001,
4278,
296,
4709,
2187,
19879,
13862,
13,
365,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
713,
3361,
3001,
12,
2890,
4672,
9163,
7766,
3703,
18,
9163,
1149,
21,
67,
350,
273,
365,
18,
3001,
18,
2640,
12590,
296,
3001,
4278,
296,
4709,
2187,
19879,
13862,
13,
365,
18,
... |
else: continue min_residuals.append("%s:%s" % (chain.chain_id, min(tmp_residuals))) max_residuals.append("%s:%s" % (chain.chain_id, max(tmp_residuals))) | min_residuals.append("%s:%.2f" % (chain.chain_id, float(tmp_min))) max_residuals.append("%s:%.2f" % (chain.chain_id, float(tmp_max))) | def write_summary(self, report_dir): """Write out the TLSMD report to the given directory. """ ## create new directory and move into it old_dir = os.getcwd() if not os.path.isdir(report_dir): os.mkdir(report_dir) os.chdir(report_dir) | ec4439610fe3711d770d92b64609356c80e3f2c3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10674/ec4439610fe3711d770d92b64609356c80e3f2c3/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
7687,
12,
2890,
16,
2605,
67,
1214,
4672,
3536,
3067,
596,
326,
8098,
6188,
2605,
358,
326,
864,
1867,
18,
3536,
7541,
752,
394,
1867,
471,
3635,
1368,
518,
1592,
67,
1214,
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,
1045,
67,
7687,
12,
2890,
16,
2605,
67,
1214,
4672,
3536,
3067,
596,
326,
8098,
6188,
2605,
358,
326,
864,
1867,
18,
3536,
7541,
752,
394,
1867,
471,
3635,
1368,
518,
1592,
67,
1214,
2... |
- ``solution_dict`` - bool (default: False); if True, return a list of dictionaries containing the solutions. | - ``solution_dict`` - bool (default: False); if True or non-zero, return a list of dictionaries containing the solutions. If there are no solutions, return an empty list (rather than a list containing an empty dictionary). Likewise, if there's only a single solution, return a list containing one dictionary with that solution. | def solve(f, *args, **kwds): r""" Algebraically solve an equation or system of equations (over the complex numbers) for given variables. Inequalities and systems of inequalities are also supported. INPUT: - ``f`` - equation or system of equations (given by a list or tuple) - ``*args`` - variables to solve for. - ``solution_dict`` - bool (default: False); if True, return a list of dictionaries containing the solutions. EXAMPLES:: sage: x, y = var('x, y') sage: solve([x+y==6, x-y==4], x, y) [[x == 5, y == 1]] sage: solve([x^2+y^2 == 1, y^2 == x^3 + x + 1], x, y) [[x == -1/2*I*sqrt(3) - 1/2, y == -1/2*sqrt(-I*sqrt(3) + 3)*sqrt(2)], [x == -1/2*I*sqrt(3) - 1/2, y == 1/2*sqrt(-I*sqrt(3) + 3)*sqrt(2)], [x == 1/2*I*sqrt(3) - 1/2, y == -1/2*sqrt(I*sqrt(3) + 3)*sqrt(2)], [x == 1/2*I*sqrt(3) - 1/2, y == 1/2*sqrt(I*sqrt(3) + 3)*sqrt(2)], [x == 0, y == -1], [x == 0, y == 1]] sage: solve([sqrt(x) + sqrt(y) == 5, x + y == 10], x, y) [[x == -5/2*I*sqrt(5) + 5, y == 5/2*I*sqrt(5) + 5], [x == 5/2*I*sqrt(5) + 5, y == -5/2*I*sqrt(5) + 5]] sage: solutions=solve([x^2+y^2 == 1, y^2 == x^3 + x + 1], x, y, solution_dict=True) sage: for solution in solutions: print solution[x].n(digits=3), ",", solution[y].n(digits=3) -0.500 - 0.866*I , -1.27 + 0.341*I -0.500 - 0.866*I , 1.27 - 0.341*I -0.500 + 0.866*I , -1.27 - 0.341*I -0.500 + 0.866*I , 1.27 + 0.341*I 0.000 , -1.00 0.000 , 1.00 Whenever possible, answers will be symbolic, but with systems of equations, at times approximations will be given, due to the underlying algorithm in Maxima:: sage: sols = solve([x^3==y,y^2==x],[x,y]); sols[-1], sols[0] ([x == 0, y == 0], [x == (0.309016994375 + 0.951056516295*I), y == (-0.809016994375 - 0.587785252292*I)]) sage: sols[0][0].rhs().pyobject().parent() Complex Double Field If ``f`` is only one equation or expression, we use the solve method for symbolic expressions, which defaults to exact answers only:: sage: solve([y^6==y],y) [y == e^(2/5*I*pi), y == e^(4/5*I*pi), y == e^(-4/5*I*pi), y == e^(-2/5*I*pi), y == 1, y == 0] sage: solve( [y^6 == y], y)==solve( y^6 == y, y) True .. note:: For more details about solving a single equations, see the documentation for its solve. :: sage: from sage.symbolic.expression import Expression sage: Expression.solve(x^2==1,x) [x == -1, x == 1] We must solve with respect to actual variables:: sage: z = 5 sage: solve([8*z + y == 3, -z +7*y == 0],y,z) Traceback (most recent call last): ... TypeError: 5 is not a valid variable. If we ask for a dictionary for the solutions, we get it:: sage: solve([x^2-1],x,solution_dict=True) [{x: -1}, {x: 1}] sage: solve([x^2-4*x+4],x,solution_dict=True) [{x: 2}] sage: res = solve([x^2 == y, y == 4],x,y,solution_dict=True) sage: for soln in res: print "x: %s, y: %s"%(soln[x], soln[y]) x: 2, y: 4 x: -2, y: 4 If there is a parameter in the answer, that will show up as a new variable. In the following example, ``r1`` is a real free variable (because of the ``r``):: sage: solve([x+y == 3, 2*x+2*y == 6],x,y) [[x == -r1 + 3, y == r1]] Especially with trigonometric functions, the dummy variable may be implicitly an integer (hence the ``z``):: sage: solve([cos(x)*sin(x) == 1/2, x+y == 0],x,y) [[x == 1/4*pi + pi*z38, y == -1/4*pi - pi*z38]] Expressions which are not equations are assumed to be set equal to zero, as with `x` in the following example:: sage: solve([x, y == 2],x,y) [[x == 0, y == 2]] If ``True`` appears in the list of equations it is ignored, and if ``False`` appears in the list then no solutions are returned. E.g., note that the first ``3==3`` evaluates to ``True``, not to a symbolic equation. :: sage: solve([3==3, 1.00000000000000*x^3 == 0], x) [x == 0] sage: solve([1.00000000000000*x^3 == 0], x) [x == 0] Here, the first equation evaluates to ``False``, so there are no solutions:: sage: solve([1==3, 1.00000000000000*x^3 == 0], x) [] Completely symbolic solutions are supported:: sage: var('s,j,b,m,g') (s, j, b, m, g) sage: sys = [ m*(1-s) - b*s*j, b*s*j-g*j ]; sage: solve(sys,s,j) [[s == 1, j == 0], [s == g/b, j == (b - g)*m/(b*g)]] sage: solve(sys,(s,j)) [[s == 1, j == 0], [s == g/b, j == (b - g)*m/(b*g)]] sage: solve(sys,[s,j]) [[s == 1, j == 0], [s == g/b, j == (b - g)*m/(b*g)]] Inequalities can be also solved:: sage: solve(x^2>8,x) [[x < -2*sqrt(2)], [x > 2*sqrt(2)]] TESTS:: sage: solve([sin(x)==x,y^2==x],x,y) [sin(x) == x, y^2 == x] Use use_grobner if no solution is obtained from to_poly_solve:: sage: x,y=var('x y'); c1(x,y)=(x-5)^2+y^2-16; c2(x,y)=(y-3)^2+x^2-9 sage: solve([c1(x,y),c2(x,y)],[x,y]) [[x == -9/68*sqrt(55) + 135/68, y == -15/68*sqrt(5)*sqrt(11) + 123/68], [x == 9/68*sqrt(55) + 135/68, y == 15/68*sqrt(5)*sqrt(11) + 123/68]] """ from sage.symbolic.expression import is_Expression if is_Expression(f): # f is a single expression ans = f.solve(*args,**kwds) return ans elif len(f)==1 and is_Expression(f[0]): # f is a list with a single expression ans = f[0].solve(*args,**kwds) return ans else: # f is a list of such expressions or equations from sage.symbolic.ring import is_SymbolicVariable if len(args)==0: raise TypeError, "Please input variables to solve for." if is_SymbolicVariable(args[0]): variables = args else: variables = tuple(args[0]) for v in variables: if not is_SymbolicVariable(v): raise TypeError, "%s is not a valid variable."%v try: f = [s for s in f if s is not True] except TypeError: raise ValueError, "Unable to solve %s for %s"%(f, args) if any(s is False for s in f): return [] from sage.calculus.calculus import maxima m = maxima(f) try: s = m.solve(variables) except: # if Maxima gave an error, try its to_poly_solve try: s = m.to_poly_solve(variables) except TypeError, mess: # if that gives an error, raise an error. if "Error executing code in Maxima" in str(mess): raise ValueError, "Sage is unable to determine whether the system %s can be solved for %s"%(f,args) else: raise if len(s)==0: # if Maxima's solve gave no solutions, try its to_poly_solve try: s = m.to_poly_solve(variables) except: # if that gives an error, stick with no solutions s = [] if len(s)==0: # if to_poly_solve gave no solutions, try use_grobner try: s = m.to_poly_solve(variables,'use_grobner=true') except: # if that gives an error, stick with no solutions s = [] sol_list = string_to_list_of_solutions(repr(s)) if 'solution_dict' in kwds and kwds['solution_dict']==True: if isinstance(sol_list[0], list): sol_dict=[dict([[eq.left(),eq.right()] for eq in solution]) for solution in sol_list] else: sol_dict=[{eq.left():eq.right()} for eq in sol_list] return sol_dict else: return sol_list | 289f5b4d9eb95aca379cac874aa709bc2e2631eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/289f5b4d9eb95aca379cac874aa709bc2e2631eb/relation.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12439,
12,
74,
16,
380,
1968,
16,
2826,
25577,
4672,
436,
8395,
2262,
29087,
6478,
12439,
392,
15778,
578,
2619,
434,
30369,
261,
1643,
326,
7233,
5600,
13,
364,
864,
3152,
18,
657,
9729... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12439,
12,
74,
16,
380,
1968,
16,
2826,
25577,
4672,
436,
8395,
2262,
29087,
6478,
12439,
392,
15778,
578,
2619,
434,
30369,
261,
1643,
326,
7233,
5600,
13,
364,
864,
3152,
18,
657,
9729... |
def _invoice_hook(self, cursor, user, picking, invoice_id): | def _invoice_hook(self, cr, uid, picking, invoice_id): | def _invoice_hook(self, cursor, user, picking, invoice_id): '''Call after the creation of the invoice''' return | 18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
16119,
67,
4476,
12,
2890,
16,
4422,
16,
4555,
16,
6002,
310,
16,
9179,
67,
350,
4672,
9163,
1477,
1839,
326,
6710,
434,
326,
9179,
26418,
327,
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,
389,
16119,
67,
4476,
12,
2890,
16,
4422,
16,
4555,
16,
6002,
310,
16,
9179,
67,
350,
4672,
9163,
1477,
1839,
326,
6710,
434,
326,
9179,
26418,
327,
2,
-100,
-100,
-100,
-100,
-100,
-1... |
] + getLocaleDataFiles(), | ] + getLocaleDataFiles()+getUserDocsDataFiles(), | def getLocaleDataFiles(): return [(os.path.dirname(f), (f,)) for f in glob("locale/*/LC_MESSAGES/*.mo")] | c8b85a39481b6ba14e578e1d77ac38a56130a760 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9340/c8b85a39481b6ba14e578e1d77ac38a56130a760/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9595,
751,
2697,
13332,
327,
306,
12,
538,
18,
803,
18,
12287,
12,
74,
3631,
261,
74,
16,
3719,
364,
284,
316,
4715,
2932,
6339,
19,
5549,
13394,
67,
26195,
30987,
8683,
7923,
65,
225,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9595,
751,
2697,
13332,
327,
306,
12,
538,
18,
803,
18,
12287,
12,
74,
3631,
261,
74,
16,
3719,
364,
284,
316,
4715,
2932,
6339,
19,
5549,
13394,
67,
26195,
30987,
8683,
7923,
65,
225,... |
print "Area count: %d" % len(areas) | log.debug("Area count: %d" % len(areas)) | def parse(self): print "Parsing: %s" % self.original_file.name.val provider = self.original_file_provider data = provider.get_original_file_data(self.original_file) try: et = ElementTree(file=data) finally: data.close() root = et.getroot() areas = root.findall(self.AREA_XPATH) print "Area count: %d" % len(areas) for i, area in enumerate(areas): result_parameters = area.findall(self.PARAMETER_XPATH) print "Area %d result children: %d" % (i, len(result_parameters)) if len(result_parameters) == 0: print "%s contains no analysis data." % self.get_name() return headers = list() for result_parameter in result_parameters: headers.append(result_parameter.text) columns = self.get_empty_columns(headers) wells = area.findall(self.WELL_XPATH) for well in wells: # Rows and columns are 1-indexed, OMERO wells are 0-indexed row = int(well.get('row')) - 1 column = int(well.get('col')) - 1 try: v = columns['Well'].values wellobj, images = self.get_well_images(row, column) if not wellobj: continue v.append(wellobj.id.val) except: log.exception("ERROR: Failed to get well images") continue results = well.findall(self.RESULT_XPATH) for result in results: name = result.get('name') columns[name].values.append(float(result.text)) return MeasurementParsingResult([columns.values()]) | 2abc05f6ec4c7dd58ee9bb618f839a4be9554279 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12409/2abc05f6ec4c7dd58ee9bb618f839a4be9554279/populate_roi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
4672,
1172,
315,
13963,
30,
738,
87,
6,
738,
365,
18,
8830,
67,
768,
18,
529,
18,
1125,
2893,
273,
365,
18,
8830,
67,
768,
67,
6778,
501,
273,
2893,
18,
588,
67,
88... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
4672,
1172,
315,
13963,
30,
738,
87,
6,
738,
365,
18,
8830,
67,
768,
18,
529,
18,
1125,
2893,
273,
365,
18,
8830,
67,
768,
67,
6778,
501,
273,
2893,
18,
588,
67,
88... |
eq_cycles = 25, | eq_cycles = 0, | def __init__(self, fmodels, model, target_weights, log, time_step = 0.0005, number_of_macro_cycles = 100, temperature = 300., n_steps = 10, eq_cycles = 25, b_target = 1.0, b_target_cycles = 5, tx = 2.0): fmodel = fmodels.fmodel_xray() assert fmodel.xray_structure is model.xray_structure xray_structure_last_updated = model.xray_structure.deep_copy_scatterers() xrs_start = fmodels.fmodel_xray().xray_structure.deep_copy_scatterers() xray_gradient = None reset_velocities = True f_calc_average = None wx = target_weights.xyz_weights_result.wx * \ target_weights.xyz_weights_result.wx_scale # if 1: b_isos = fmodel.xray_structure.scatterers().extract_u_iso()/adptbx.b_as_u(1) assert b_target_cycles != 0 b_decs = (b_isos - b_target)/b_target_cycles # self.xray_structures = [] self.pdb_hierarchy = model.pdb_hierarchy for macro_cycle in xrange(number_of_macro_cycles): print >> log if(macro_cycle == 0): print >> log, "mc: %d r_work=%6.4f r_free=%6.4f"%( macro_cycle, fmodel.r_work(), fmodel.r_free()) assert fmodel.xray_structure is model.xray_structure cd_manager = cartesian_dynamics.cartesian_dynamics( structure = model.xray_structure, restraints_manager = model.restraints_manager, temperature = temperature, n_steps = n_steps, time_step = time_step, initial_velocities_zero_fraction = 0, fmodel = fmodel, xray_target_weight = wx, chem_target_weight = target_weights.xyz_weights_result.w, xray_structure_last_updated = xray_structure_last_updated, shift_update = 0.0, xray_gradient = xray_gradient, reset_velocities = reset_velocities, update_f_calc = False, log = log) reset_velocities = False xray_structure_last_updated = \ cd_manager.xray_structure_last_updated.deep_copy_scatterers() result = xrs_start.distances(other = model.xray_structure).min_max_mean().as_tuple() xray_gradient = cd_manager.xray_gradient assert model.xray_structure is cd_manager.structure fmodel.update_xray_structure( xray_structure = model.xray_structure, update_f_calc = True, update_f_mask = True) if(macro_cycle > 0): print >> log, "mc: %d r_work=%6.4f r_free=%6.4f deviation (max,mean)=%5.3f %5.3f"%( macro_cycle, fmodel.r_work(), fmodel.r_free(),result[1], result[2]) # if(eq_cycles is not None): if(macro_cycle > eq_cycles): self.xray_structures.append(model.xray_structure.deep_copy_scatterers()) else: self.xray_structures.append(model.xray_structure.deep_copy_scatterers()) # f_calc = fmodels.fmodel_xray().f_calc() if(f_calc_average is None): f_calc_average = f_calc else: a_prime = math.exp(-cd_manager.n_steps*time_step/tx) f_calc_data = f_calc.data() f_calc_average_data = f_calc_average.data() f_calc_average_data = a_prime * f_calc_average_data + (1.-a_prime) * f_calc_data f_calc_average = f_calc_average.array(data = f_calc_average_data) fmodel.update(f_calc = f_calc_average) # if 1: b_isos = fmodel.xray_structure.scatterers().extract_u_iso()/adptbx.b_as_u(1) b_isos -= b_decs sel = b_isos <= b_target b_isos = b_isos.set_selected(sel, b_target) fmodels.fmodel_xray().xray_structure.set_b_iso(values = b_isos) # if(macro_cycle > 0): print >> log, "mc: %d r_work=%6.4f r_free=%6.4f deviation (max,mean)=%5.3f %5.3f"%( macro_cycle, fmodel.r_work(), fmodel.r_free(),result[1], result[2]) # Modify occupancies in-place or reset to zero for i_model in xrange(len(self.xray_structures)): self.xray_structures[i_model].set_occupancies( value = (100./len(self.xray_structures))/100) # self.write_pdb(out = open("ta_multi_model.pdb", "w"), log = log) # if 1: fmodel_ = utils.fmodel_simple( xray_structures = self.xray_structures, f_obs = fmodel.f_obs, r_free_flags = fmodel.r_free_flags) print >> log, "FINAL Rwork=%6.4f Rfree=%6.4f" % ( fmodel_.r_work(), fmodel_.r_free()) | f8aeb3adb75b3cab62e66bebe7b524ba8d6a8c20 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/696/f8aeb3adb75b3cab62e66bebe7b524ba8d6a8c20/time_averaging.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
284,
7665,
16,
938,
16,
1018,
67,
9727,
16,
613,
16,
813,
67,
4119,
273,
374,
18,
3784,
25,
16,
1300,
67,
792,
67,
26448,
67,
23976,
273,
2130,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
284,
7665,
16,
938,
16,
1018,
67,
9727,
16,
613,
16,
813,
67,
4119,
273,
374,
18,
3784,
25,
16,
1300,
67,
792,
67,
26448,
67,
23976,
273,
2130,
16,
1... |
return RpcResult(node=node, offline=True) | return RpcResult(node=node, offline=True, call=call) | def _ConnectNode(self, client, node): """Helper for computing one node's address. | 84b455872adb25569baae3904fec7b3c369ac9db /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7542/84b455872adb25569baae3904fec7b3c369ac9db/rpc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5215,
907,
12,
2890,
16,
1004,
16,
756,
4672,
3536,
2276,
364,
20303,
1245,
756,
1807,
1758,
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,
389,
5215,
907,
12,
2890,
16,
1004,
16,
756,
4672,
3536,
2276,
364,
20303,
1245,
756,
1807,
1758,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
text = _('The link/@rel="edit" URI must match the URI returned via the Link: HTTP header during creation.') | text = _('The link/@rel="edit" URI must match the URI returned via the Location: HTTP header during creation.') | def tostring(self): return self.context + ":" + self.text + ":" + self.extra | 62545eb4a0f245496aec57ddf77c32bdf1a873f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5012/62545eb4a0f245496aec57ddf77c32bdf1a873f9/appclienttest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26135,
12,
2890,
4672,
327,
365,
18,
2472,
397,
6153,
397,
365,
18,
955,
397,
6153,
397,
365,
18,
7763,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
26135,
12,
2890,
4672,
327,
365,
18,
2472,
397,
6153,
397,
365,
18,
955,
397,
6153,
397,
365,
18,
7763,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
axe_snp_pca.title.set_text('SNP by PC1(x-axis) vs PC2(y-axis)') sys.stderr.write("Done.\n") def drawMap(self, axe_map, StrainID2PCAPosInfo, phenData, phenotype_col_index, ecotype_info): | axe_snp_pca.set_xlabel('PC1 %.2f%s'%(SNPID2PCAPosInfo.x_var*100, '%')) axe_snp_pca.set_ylabel('PC2 %.2f%s'%(SNPID2PCAPosInfo.y_var*100, '%')) sys.stderr.write("Done.\n") def drawMap(self, axe_map, StrainID2PCAPosInfo, phenData, phenotype_col_index, phenotype_method_id, ecotype_info): | def drawSNPPCA(self, axe_snp_pca, axe_snp_pca_legend, SNPID2PCAPosInfo, lowest_y_value=-0.05): """ 2008-10-07 """ sys.stderr.write("Drawing SNP PCA ...") chr_set = Set() for snp_id in SNPID2PCAPosInfo.snp_id_ls: chr, pos = snp_id.split('_') chr_set.add(chr) chr_ls = list(chr_set) chr_ls.sort() chr2fc = assignMatPlotlibHueColorToLs(chr_ls) drawName2FCLegend(axe_snp_pca_legend, chr_ls, chr2fc, no_face_color=True, font_size=4) for snp_id in SNPID2PCAPosInfo.snp_id_ls: chr, pos = snp_id.split('_') chr_fc = chr2fc[chr] x_value = SNPID2PCAPosInfo.snp_id2pca_x[snp_id] y_value = SNPID2PCAPosInfo.snp_id2pca_y[snp_id] axe_snp_pca.scatter([x_value],[y_value], s=10, linewidth=0.6, edgecolor=chr_fc, facecolor='w', alpha=0.6) img_x_pos = SNPID2PCAPosInfo.snp_id2img_x_pos[snp_id] axe_snp_pca.plot([img_x_pos, x_value], [lowest_y_value, y_value], linestyle='--', alpha=0.2, linewidth=0.3) axe_snp_pca.title.set_text('SNP by PC1(x-axis) vs PC2(y-axis)') sys.stderr.write("Done.\n") | 8b01df4ec5dda455ad1b712723f6e5a54471503a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9645/8b01df4ec5dda455ad1b712723f6e5a54471503a/PlotGroupOfSNPs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
13653,
52,
3513,
37,
12,
2890,
16,
1740,
73,
67,
87,
6782,
67,
2436,
69,
16,
1740,
73,
67,
87,
6782,
67,
2436,
69,
67,
16292,
16,
14204,
16522,
22,
3513,
37,
1616,
966,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
13653,
52,
3513,
37,
12,
2890,
16,
1740,
73,
67,
87,
6782,
67,
2436,
69,
16,
1740,
73,
67,
87,
6782,
67,
2436,
69,
67,
16292,
16,
14204,
16522,
22,
3513,
37,
1616,
966,
16,
1... |
| TUBE_JN_CAP | TUBE_CONTOUR_CLOSED) new_points = zeros([4*(n-2)-1,3],Float) new_colors = zeros([4*(n-2)-1,3],Float) new_radii = zeros([4*(n-2)-1],Float) | | TUBE_JN_CAP | TUBE_CONTOUR_CLOSED) new_points = [ None ] * (4*(n-2)-1) new_colors = [ None ] * (4*(n-2)-1) new_radii = [ 0.0 ] * (4*(n-2)-1) for p in range(0, (4*(n-2)-1)): new_points[p] = [ 0.0 ] * 3 new_colors[p] = [ 0.0 ] * 3 | def drawStrand(points, colors, radii, color_style, shape, arrows): """ Renders a strand shape along points array using colors and radii arrays, optionally with arrows. """ n = len(points) if n>3: # copy colors and radii colors[0] = colors[1] colors[n-1] = colors[n-2] radii[0] = radii[1] radii[n-1] = radii[n-2] # draw the terminal spheres drawer.drawsphere(colors[1],points[1],radii[1],2) drawer.drawsphere(colors[n-2],points[n-2],radii[1],2) # draw the arrows if arrows==1 or arrows==3: # 5' glDisable(GL_COLOR_MATERIAL) drawer.drawpolycone(colors[1], [points[1]+0.25*(points[2]-points[1]), points[1]+0.25*(points[2]-points[1]), points[1]-0.25*(points[2]-points[1]), points[1]-0.25*(points[2]-points[1])], [0.0, 0.0, radii[1]*2.0, radii[1]*2.0, ]) if arrows==2 or arrows==3: # 3' drawer.drawpolycone(colors[n-2], [points[n-2], points[n-2], points[n-2]-0.5*(points[n-3]-points[n-2]), points[n-2]-0.5*(points[n-3]-points[n-2])], [radii[1]*2.0, radii[1]*2.0, 0.0, 0.0]) if shape==1: # draw cylinders gleSetJoinStyle(TUBE_JN_ROUND | TUBE_NORM_PATH_EDGE | TUBE_JN_CAP | TUBE_CONTOUR_CLOSED) #drawer.drawpolycone(colors[1], # points, # radii) if color_style==1: drawer.drawpolycone_multicolor(colors[1], points, colors, radii) else: drawer.drawpolycone(colors[1], points, radii) elif shape==2: # draw spline tube gleSetJoinStyle(TUBE_JN_ANGLE | TUBE_NORM_PATH_EDGE | TUBE_JN_CAP | TUBE_CONTOUR_CLOSED) new_points = zeros([4*(n-2)-1,3],Float) new_colors = zeros([4*(n-2)-1,3],Float) new_radii = zeros([4*(n-2)-1],Float) o = 1 for p in range (1,n-2): for m in range (0,4): t = float(m)/4.0 new_points[o] = self.spline(points, p, t) new_colors[o] = self.spline(colors, p, t) new_radii[o] = self.spline(radii, p, t) o += 1 new_points[o] = self.spline(points, p, 1.0) new_colors[o] = self.spline(colors, p, 1.0) new_radii[o] = self.spline(radii, p, 1.0) o += 1 new_points[0] = 3.0*new_points[1]-3.0*new_points[2]+new_points[3] new_points[o] = 3.0*new_points[o-1]-3.0*new_points[o-2]+new_points[o-3] # draw the tube if color_style==1: drawer.drawpolycone_multicolor( colors[1], new_points, new_colors, new_radii) else: drawer.drawpolycone( colors[1], new_points, new_radii) | cbc143d808cf827d03bc69ee526e2fca8459d46d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/cbc143d808cf827d03bc69ee526e2fca8459d46d/DnaCylinderChunks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
1585,
464,
12,
4139,
16,
5740,
16,
28125,
16,
2036,
67,
4060,
16,
2179,
16,
419,
3870,
4672,
3536,
534,
10130,
279,
16706,
2179,
7563,
3143,
526,
1450,
5740,
471,
28125,
5352,
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,
3724,
1585,
464,
12,
4139,
16,
5740,
16,
28125,
16,
2036,
67,
4060,
16,
2179,
16,
419,
3870,
4672,
3536,
534,
10130,
279,
16706,
2179,
7563,
3143,
526,
1450,
5740,
471,
28125,
5352,
16,
... |
docv = [int(part) for part in docutils.__version__.split('.')] reqv = [int(part) for part in REQUIRES['docutils'].split('.')] if docutils.__version__ < REQUIRES['docutils']: | installed = [int(part) for part in docutils.__version__.split('.')] required = [int(part) for part in REQUIRES['docutils'].split('.')] if installed < required: | def check_requirements(): # Check Python: try: from email.Utils import parseaddr except ImportError: PEP_TYPE_DISPATCH['text/plain'] = None PEP_TYPE_MESSAGES['text/plain'] = ( 'Python %s or better required for "%%(pep_type)s" PEP ' 'processing; %s present (%%(inpath)s).' % (REQUIRES['python'], sys.version.split()[0])) # Check Docutils: try: import docutils except ImportError: PEP_TYPE_DISPATCH['text/x-rst'] = None PEP_TYPE_MESSAGES['text/x-rst'] = ( 'Docutils not present for "%(pep_type)s" PEP file %(inpath)s. ' 'See README.txt for installation.') else: docv = [int(part) for part in docutils.__version__.split('.')] reqv = [int(part) for part in REQUIRES['docutils'].split('.')] if docutils.__version__ < REQUIRES['docutils']: PEP_TYPE_DISPATCH['text/x-rst'] = None PEP_TYPE_MESSAGES['text/x-rst'] = ( 'Docutils must be reinstalled for "%%(pep_type)s" PEP ' 'processing (%%(inpath)s). Version %s or better required; ' '%s present. See README.txt for installation.' % (REQUIRES['docutils'], docutils.__version__)) | e9a8aa624cc901c296c5d7e4fc9490ad09120ff9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8194/e9a8aa624cc901c296c5d7e4fc9490ad09120ff9/pep2html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
16175,
13332,
468,
2073,
6600,
30,
775,
30,
628,
2699,
18,
1989,
1930,
1109,
4793,
1335,
11308,
30,
453,
10541,
67,
2399,
67,
2565,
3118,
5858,
3292,
955,
19,
7446,
3546,
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,
866,
67,
16175,
13332,
468,
2073,
6600,
30,
775,
30,
628,
2699,
18,
1989,
1930,
1109,
4793,
1335,
11308,
30,
453,
10541,
67,
2399,
67,
2565,
3118,
5858,
3292,
955,
19,
7446,
3546,
273,
... |
def addText(self, text): self.text.append("<nobr>" + text + "</nobr>\n") | def addText(self, text, nobr = 1): if nobr: self.text.append("<nobr>" + text + "</nobr>\n") else: self.text.append(text) | def addText(self, text): self.text.append("<nobr>" + text + "</nobr>\n") self.text.ensureVisible(0, self.text.contentsHeight()) | d8d65e757e885ef1615e182a5bd52449cd54aa19 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6366/d8d65e757e885ef1615e182a5bd52449cd54aa19/updateOrange.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25796,
12,
2890,
16,
977,
16,
290,
947,
86,
273,
404,
4672,
309,
290,
947,
86,
30,
365,
18,
955,
18,
6923,
2932,
32,
82,
947,
86,
2984,
397,
977,
397,
6823,
82,
947,
86,
5333,
82,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25796,
12,
2890,
16,
977,
16,
290,
947,
86,
273,
404,
4672,
309,
290,
947,
86,
30,
365,
18,
955,
18,
6923,
2932,
32,
82,
947,
86,
2984,
397,
977,
397,
6823,
82,
947,
86,
5333,
82,
... |
segments = message.get_segments() | segments = [] for seg, offset in get_segments(message): segments.append(seg) | def test_parentheses1(self): text = ( '(Exception: if the Program itself is interactive but does not' ' normally print such an announcement, your work based on the' ' Program is not required to print an announcement.) ') result = [u'(Exception:', u'if the Program itself is interactive but does not normally' u' print such an announcement, your work based on the Program' u' is not required to print an announcement.)'] | f60259a351ba0ec0893ebab283ae29d948ec283a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12681/f60259a351ba0ec0893ebab283ae29d948ec283a/test_i18n.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
13012,
7915,
281,
21,
12,
2890,
4672,
977,
273,
261,
7747,
503,
30,
309,
326,
13586,
6174,
353,
12625,
1496,
1552,
486,
11,
296,
15849,
1172,
4123,
392,
25199,
16,
3433,
1440,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
13012,
7915,
281,
21,
12,
2890,
4672,
977,
273,
261,
7747,
503,
30,
309,
326,
13586,
6174,
353,
12625,
1496,
1552,
486,
11,
296,
15849,
1172,
4123,
392,
25199,
16,
3433,
1440,
... |
raise TypeError("%s not proven to have negative stop" % s_slice) | raise TypeError("%s not proven to have non-negative stop" % s_slice) | def check_negative_slice(s_slice): if isinstance(s_slice.start, SomeInteger) and not s_slice.start.nonneg: raise TypeError("%s not proven to have negative start" % s_slice) if isinstance(s_slice.stop, SomeInteger) and not s_slice.stop.nonneg and\ getattr(s_slice.stop, 'const', 0) != -1: raise TypeError("%s not proven to have negative stop" % s_slice) | 4871022beb11dbe007901608d82ff2256062422f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6934/4871022beb11dbe007901608d82ff2256062422f/binaryop.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
13258,
67,
6665,
12,
87,
67,
6665,
4672,
309,
1549,
12,
87,
67,
6665,
18,
1937,
16,
10548,
4522,
13,
471,
486,
272,
67,
6665,
18,
1937,
18,
5836,
14518,
30,
1002,
3580,
2718... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
13258,
67,
6665,
12,
87,
67,
6665,
4672,
309,
1549,
12,
87,
67,
6665,
18,
1937,
16,
10548,
4522,
13,
471,
486,
272,
67,
6665,
18,
1937,
18,
5836,
14518,
30,
1002,
3580,
2718... |
vals = c.pget('Unknown', flags=db.DB_LAST) | vals = self.cur.pget('Unknown', flags=db.DB_LAST) | def finish_test(self, secDB, txn=None): # 'Blues' should not be in the secondary database vals = secDB.pget('Blues', txn=txn) assert vals == None, vals | c5cf731a4deb710892c9083a468a6d173d791456 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/c5cf731a4deb710892c9083a468a6d173d791456/test_associate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4076,
67,
3813,
12,
2890,
16,
1428,
2290,
16,
7827,
33,
7036,
4672,
468,
296,
4802,
3610,
11,
1410,
486,
506,
316,
326,
9946,
2063,
5773,
273,
1428,
2290,
18,
84,
588,
2668,
4802,
3610... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4076,
67,
3813,
12,
2890,
16,
1428,
2290,
16,
7827,
33,
7036,
4672,
468,
296,
4802,
3610,
11,
1410,
486,
506,
316,
326,
9946,
2063,
5773,
273,
1428,
2290,
18,
84,
588,
2668,
4802,
3610... |
if not isinstance(self.destination, (list, tuple)): | if self.destination and \ not isinstance(self.destination, (list, tuple)): | def _prepare(self, reply): if not reply: return by_node = flatten_reply(reply) if not isinstance(self.destination, (list, tuple)): return by_node.get(self.destination) return by_node | e9cd6b1f98d9d36cf251d75e362b167dd25887c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2024/e9cd6b1f98d9d36cf251d75e362b167dd25887c8/control.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9366,
12,
2890,
16,
4332,
4672,
309,
486,
4332,
30,
327,
635,
67,
2159,
273,
5341,
67,
10629,
12,
10629,
13,
309,
365,
18,
10590,
471,
521,
486,
1549,
12,
2890,
18,
10590,
16,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9366,
12,
2890,
16,
4332,
4672,
309,
486,
4332,
30,
327,
635,
67,
2159,
273,
5341,
67,
10629,
12,
10629,
13,
309,
365,
18,
10590,
471,
521,
486,
1549,
12,
2890,
18,
10590,
16,
2... |
for l in cmds.splitlines(): sys.stderr.write(str(sys.__dict__.get("ps1",ColorPrompt()))) | cmds = cmds.splitlines() cmds.append("") cmds.reverse() while 1: if cmd: sys.stderr.write(sys.__dict__.get("ps2","... ")) else: sys.stderr.write(str(sys.__dict__.get("ps1",ColorPrompt()))) l = cmds.pop() | def autorun_commands(cmds,verb=0): sv = conf.verb try: conf.verb = verb interp = ScapyAutorunInterpreter(globals()) cmd = "" for l in cmds.splitlines(): sys.stderr.write(str(sys.__dict__.get("ps1",ColorPrompt()))) print l cmd += "\n"+l if interp.runsource(cmd): sys.stderr.write(sys.__dict__.get("ps2","... ")) continue if interp.error: return 0 cmd = "" finally: conf.verb = sv try: return _ except NameError: return | 696b8de3c2847b51fc070e92cfb6ad412676dd9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7311/696b8de3c2847b51fc070e92cfb6ad412676dd9b/scapy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2059,
280,
318,
67,
7847,
12,
24680,
16,
16629,
33,
20,
4672,
5893,
273,
2195,
18,
16629,
775,
30,
2195,
18,
16629,
273,
6405,
8174,
273,
2850,
438,
93,
37,
3408,
318,
30010,
12,
16227... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2059,
280,
318,
67,
7847,
12,
24680,
16,
16629,
33,
20,
4672,
5893,
273,
2195,
18,
16629,
775,
30,
2195,
18,
16629,
273,
6405,
8174,
273,
2850,
438,
93,
37,
3408,
318,
30010,
12,
16227... |
return setting._refresh() | try: yield setting._refresh() except: yield self._delSetting(name) | def _refreshSetting(self, name): setting = getattr(self, name) return setting._refresh() | 375a836d99fda7e94fd3e2bc4d60708c52cfeab9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9965/375a836d99fda7e94fd3e2bc4d60708c52cfeab9/wrappers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9144,
5568,
12,
2890,
16,
508,
4672,
3637,
273,
3869,
12,
2890,
16,
508,
13,
327,
3637,
6315,
9144,
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,
389,
9144,
5568,
12,
2890,
16,
508,
4672,
3637,
273,
3869,
12,
2890,
16,
508,
13,
327,
3637,
6315,
9144,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
for a in applets: tokens = a.split("::") if tokens[0].endswith(".desktop"): path = tokens[0] uid = tokens[1] icon, text, name = self.make_row(path) if len (text) < 2: continue; model.append([icon, path, uid, text]) else: path = tokens[0] uid = tokens[1] theme = gtk.icon_theme_get_default () icon = theme.load_icon ("screenlets", 32, 0) text = tokens[0] model.append([icon, path, uid, text]) | for a in applets: tokens = a.split("::") if tokens[0].endswith(".desktop"): path = tokens[0] uid = tokens[1] icon, text, name = self.make_row(path) if len (text) < 2: continue; model.append([icon, path, uid, text]) else: path = tokens[0] uid = tokens[1] theme = gtk.icon_theme_get_default () icon = theme.load_icon ("screenlets", 32, 0) text = tokens[0] model.append([icon, path, uid, text]) | def refresh_icon_list (self, applets, model): | 30bb56994f49caaea99383c3cdc7f4e2a2d375f1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8416/30bb56994f49caaea99383c3cdc7f4e2a2d375f1/awnClass.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4460,
67,
3950,
67,
1098,
261,
2890,
16,
513,
20773,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4460,
67,
3950,
67,
1098,
261,
2890,
16,
513,
20773,
16,
938,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
LabelEntry.set(self, text) | Text.set(self, text) | def set(self, listvalue): """Set a value to a list, joined with spaces.""" text = ' '.join(listvalue) LabelEntry.set(self, text) | f057996c3a6de2d5fabf3ad7997bbd1f796a9e23 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4675/f057996c3a6de2d5fabf3ad7997bbd1f796a9e23/meta.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
12,
2890,
16,
666,
1132,
4672,
3536,
694,
279,
460,
358,
279,
666,
16,
12114,
598,
7292,
12123,
977,
273,
296,
2418,
5701,
12,
1098,
1132,
13,
5287,
1622,
18,
542,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
12,
2890,
16,
666,
1132,
4672,
3536,
694,
279,
460,
358,
279,
666,
16,
12114,
598,
7292,
12123,
977,
273,
296,
2418,
5701,
12,
1098,
1132,
13,
5287,
1622,
18,
542,
12,
2890,
16,
... |
for hit in results.hits] | for hit in results.hits] | def xmlrpc_searchPagesEx(self, query_string, search_type, length, case, mtime, regexp): """ Searches pages for query_string - extended version for compatibility This function, in contrary to searchPages(), doesn't return HTML-formatted data. @param query_string: term to search for @param search_type: "text" or "title" search @param length: length of context preview (in characters) @param case: should the search be case sensitive? @param mtime: only output pages modified after mtime @param regexp: should the query_string be treates as a regular expression? @return: (page name, context preview, page url) """ from MoinMoin import search from MoinMoin.formatter.text_plain import Formatter | b30c5a8b9264f2be10da06019d08a57048df6de4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/888/b30c5a8b9264f2be10da06019d08a57048df6de4/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31811,
67,
3072,
5716,
424,
12,
2890,
16,
843,
67,
1080,
16,
1623,
67,
723,
16,
769,
16,
648,
16,
13158,
16,
7195,
4672,
3536,
5167,
281,
4689,
364,
843,
67,
1080,
300,
7021,
1177,
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,
31811,
67,
3072,
5716,
424,
12,
2890,
16,
843,
67,
1080,
16,
1623,
67,
723,
16,
769,
16,
648,
16,
13158,
16,
7195,
4672,
3536,
5167,
281,
4689,
364,
843,
67,
1080,
300,
7021,
1177,
3... |
assert_array_almost_equal(numpy.matrixmultiply(a,x),b) | assert_array_almost_equal(numpy.dot(a,x),b) | def check_simple_sym(self): a = [[2,3],[3,5]] for lower in [0,1]: for b in ([[1,0],[0,1]],[1,0]): x = solve(a,b,sym_pos=1,lower=lower) assert_array_almost_equal(numpy.matrixmultiply(a,x),b) | 9bd2ebf847b7c0e4bdf3e5d49ab67f415145df68 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/9bd2ebf847b7c0e4bdf3e5d49ab67f415145df68/test_basic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
9647,
67,
8117,
12,
2890,
4672,
279,
273,
12167,
22,
16,
23,
6487,
63,
23,
16,
25,
13563,
364,
2612,
316,
306,
20,
16,
21,
14542,
364,
324,
316,
23265,
63,
21,
16,
20,
648... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
9647,
67,
8117,
12,
2890,
4672,
279,
273,
12167,
22,
16,
23,
6487,
63,
23,
16,
25,
13563,
364,
2612,
316,
306,
20,
16,
21,
14542,
364,
324,
316,
23265,
63,
21,
16,
20,
648... |
LINUX_INSTALLER = r''' | LINUX_INSTALLER = textwrap.dedent(r''' | def linux(self, req): data = get_linux_data(version=self.version_from_filename()) return 'linux.html', data, None | de778713335322d20d0dde0f7e7e6d1ec56b6ad4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9125/de778713335322d20d0dde0f7e7e6d1ec56b6ad4/download.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19725,
12,
2890,
16,
1111,
4672,
501,
273,
336,
67,
20132,
67,
892,
12,
1589,
33,
2890,
18,
1589,
67,
2080,
67,
3459,
10756,
327,
296,
20132,
18,
2620,
2187,
501,
16,
599,
225,
2,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19725,
12,
2890,
16,
1111,
4672,
501,
273,
336,
67,
20132,
67,
892,
12,
1589,
33,
2890,
18,
1589,
67,
2080,
67,
3459,
10756,
327,
296,
20132,
18,
2620,
2187,
501,
16,
599,
225,
2,
-1... |
origin=pre.addDecodedOrigin(fname,[PythonFunction(func)],'AXON') | if isinstance(pre,NetworkArray): dim=pre._nodes[0].dimension else: dim=pre.dimension origin=pre.addDecodedOrigin(fname,[PythonFunction(func,dim)],'AXON') | def _parse_pre(self,pre,func,origin_name): if isinstance(pre,Origin): assert func==None return pre elif isinstance(pre,FunctionInput): assert func==None return pre.getOrigin('origin') elif isinstance(pre,NEFEnsemble) or (hasattr(pre,'getOrigin') and hasattr(pre,'addDecodedOrigin')): if func is not None: if origin_name is None: fname=func.__name__ else: fname=origin_name try: origin=pre.getOrigin(fname) except StructuralException: origin=None if origin is None: origin=pre.addDecodedOrigin(fname,[PythonFunction(func)],'AXON') return origin else: return pre.getOrigin('X') else: raise Exception('Unknown object to connect from') | 90992629c069262ea3b70ae509095f8049706289 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/553/90992629c069262ea3b70ae509095f8049706289/nef.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2670,
67,
1484,
12,
2890,
16,
1484,
16,
644,
16,
10012,
67,
529,
4672,
309,
1549,
12,
1484,
16,
7571,
4672,
1815,
1326,
631,
7036,
327,
675,
1327,
1549,
12,
1484,
16,
2083,
1210,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2670,
67,
1484,
12,
2890,
16,
1484,
16,
644,
16,
10012,
67,
529,
4672,
309,
1549,
12,
1484,
16,
7571,
4672,
1815,
1326,
631,
7036,
327,
675,
1327,
1549,
12,
1484,
16,
2083,
1210,
... |
""" | """ | def lazyload(*keys): """Return a ``MapperOption`` that will convert the property of the given name into a lazy load. Used with ``query.options()``. """ return strategies.EagerLazyOption(keys, lazy=True) | 8b169bdc1a9ad510d1fa7ac55cf02c0a00396ed8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1074/8b169bdc1a9ad510d1fa7ac55cf02c0a00396ed8/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7962,
945,
30857,
2452,
4672,
3536,
990,
279,
12176,
4597,
1895,
10335,
716,
903,
1765,
326,
1272,
434,
326,
864,
508,
1368,
279,
7962,
1262,
18,
225,
10286,
598,
12176,
2271,
18,
2116,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7962,
945,
30857,
2452,
4672,
3536,
990,
279,
12176,
4597,
1895,
10335,
716,
903,
1765,
326,
1272,
434,
326,
864,
508,
1368,
279,
7962,
1262,
18,
225,
10286,
598,
12176,
2271,
18,
2116,
... |
if bodyupdates and stride != 0: bodyupdates.add(None) | if stride != 0: bodyupdates.addunsure(None) | def postupdates(self): bodyupdates = self.bodypostupdates() stride = self.stride() if bodyupdates and stride != 0: bodyupdates.add(None) return bodyupdates | 71e0598bb7dc6d9b90f66161eeb283e8ddccc073 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2040/71e0598bb7dc6d9b90f66161eeb283e8ddccc073/esotope-bfc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1603,
14703,
12,
2890,
4672,
1417,
14703,
273,
365,
18,
70,
369,
879,
669,
14703,
1435,
11084,
273,
365,
18,
27937,
1435,
309,
11084,
480,
374,
30,
1417,
14703,
18,
1289,
318,
2055,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1603,
14703,
12,
2890,
4672,
1417,
14703,
273,
365,
18,
70,
369,
879,
669,
14703,
1435,
11084,
273,
365,
18,
27937,
1435,
309,
11084,
480,
374,
30,
1417,
14703,
18,
1289,
318,
2055,
12,
... |
if self.request.get('SearchableText'): q = {'SearchableText':self.request.get('SearchableText')} | q.update(self.request.form) if q.has_key('sort_on'): del q['sort_on'] if q.has_key('sort_order'): del q['sort_order'] | def url(self): q = {} if self.request.get('SearchableText'): q = {'SearchableText':self.request.get('SearchableText')} if self.sortkey: q['sort_on'] = self.sortkey if self.reverse: q['sort_order'] = 'reverse' return self.request.URL + '?' + make_query(q) | 1bc203a6ee7fd6d563763f9a2e4c204b3bf9ee0f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12249/1bc203a6ee7fd6d563763f9a2e4c204b3bf9ee0f/browser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
880,
12,
2890,
4672,
1043,
273,
2618,
1043,
18,
2725,
12,
2890,
18,
2293,
18,
687,
13,
309,
1043,
18,
5332,
67,
856,
2668,
3804,
67,
265,
11,
4672,
1464,
1043,
3292,
3804,
67,
265,
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,
880,
12,
2890,
4672,
1043,
273,
2618,
1043,
18,
2725,
12,
2890,
18,
2293,
18,
687,
13,
309,
1043,
18,
5332,
67,
856,
2668,
3804,
67,
265,
11,
4672,
1464,
1043,
3292,
3804,
67,
265,
3... |
if args.has_key( "skipWMSAuth" ) : self.skipWMSAuth = ( args['skipWMSAuth'].lower() == 'true' ) | self.skipWMSAuth=args.get("skipWMSAuth",0) | def __init__( self, **args ): | 4dc925f05d54039e085d650ecb265c6c90bd5ab5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8886/4dc925f05d54039e085d650ecb265c6c90bd5ab5/SchedulerGLiteAPI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
2826,
1968,
262,
30,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
2826,
1968,
262,
30,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
output=subprocess.Popen([execname+'.prediff', execname,complog,compiler], stdout=subprocess.PIPE).communicate()[0] | subprocess.Popen(['./'+execname+'.prediff', execname,complog,compiler]).wait() | def kill_proc(p, timeout): k = subprocess.Popen(['kill',str(p.pid)]) k.wait() now = time.time() end_time = now + timeout # give it a little time while end_time > now: if p.poll(): return now = time.time() # use the big hammer (and don't bother waiting) subprocess.Popen(['kill','-9', str(p.pid)]) return | 469a09fcb4fe6f256fa57e8e16e691db1d278b44 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6895/469a09fcb4fe6f256fa57e8e16e691db1d278b44/sub_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8673,
67,
9381,
12,
84,
16,
2021,
4672,
417,
273,
6652,
18,
52,
3190,
12,
3292,
16418,
2187,
701,
12,
84,
18,
6610,
13,
5717,
417,
18,
7048,
1435,
2037,
273,
813,
18,
957,
1435,
679,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8673,
67,
9381,
12,
84,
16,
2021,
4672,
417,
273,
6652,
18,
52,
3190,
12,
3292,
16418,
2187,
701,
12,
84,
18,
6610,
13,
5717,
417,
18,
7048,
1435,
2037,
273,
813,
18,
957,
1435,
679,... |
print 'Detaching image %s from loop device %s' % (self.img, self.loop) | logging.debug('Detaching image %s from loop device %s', self.img, self.loop) | def __detach_img_loop(self): """ Detaches the image file from the loopback device. """ print 'Detaching image %s from loop device %s' % (self.img, self.loop) try: cmd = 'losetup -d %s' % self.loop utils.system(cmd) except error.CmdError, e: e_msg = 'Error detaching image %s from loop device %s: %s' % \ (self.loop, e) raise error.AutotestError(e_msg) | 662f76bda53f3b39610e52556ebe4e8573de519d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12268/662f76bda53f3b39610e52556ebe4e8573de519d/base_partition.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
8238,
497,
67,
6081,
67,
6498,
12,
2890,
4672,
3536,
17867,
281,
326,
1316,
585,
628,
326,
28811,
2346,
18,
3536,
2907,
18,
4148,
2668,
17650,
310,
1316,
738,
87,
628,
2798,
2346,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8238,
497,
67,
6081,
67,
6498,
12,
2890,
4672,
3536,
17867,
281,
326,
1316,
585,
628,
326,
28811,
2346,
18,
3536,
2907,
18,
4148,
2668,
17650,
310,
1316,
738,
87,
628,
2798,
2346,
... |
assert res == (1,"hello") assert sys.getrefcount(res) == 2 | assert_equal(res,(1,"hello")) assert_equal(sys.getrefcount(res),2) | def check_std_args(self,level=5): a = foo() method = "bar2" code = """ py::tuple args(2); args[0] = 1; args[1] = "hello"; return_val = a.mcall(method,args); """ res = inline_tools.inline(code,['a','method']) assert res == (1,"hello") assert sys.getrefcount(res) == 2 | 1a2e32f8d57897230b5265290279639d73dda37e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12971/1a2e32f8d57897230b5265290279639d73dda37e/test_scxx_object.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
5084,
67,
1968,
12,
2890,
16,
2815,
33,
25,
4672,
279,
273,
8431,
1435,
707,
273,
315,
3215,
22,
6,
981,
273,
3536,
2395,
2866,
8052,
833,
12,
22,
1769,
833,
63,
20,
65,
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,
866,
67,
5084,
67,
1968,
12,
2890,
16,
2815,
33,
25,
4672,
279,
273,
8431,
1435,
707,
273,
315,
3215,
22,
6,
981,
273,
3536,
2395,
2866,
8052,
833,
12,
22,
1769,
833,
63,
20,
65,
2... |
if str(arg0.dtype).count('float')==1: | str_dtype = str(arg0.dtype) if str_dtype.count('float32')==1: if arg0.flags.c_contiguous==True or arg0.flags.f_contiguous==True: m=matrix(RDF,arg0.shape[0],arg0.shape[1],0) m._replace_self_with_numpy32(arg0) if arg0.flags.c_contiguous: return m else: return m.transpose() else: raise TypeError('numpy matrix must be either c_contiguous or f_contiguous') elif str_dtype.count('float64')==1: | def matrix(arg0=None, arg1=None, arg2=None, arg3=None, sparse=None): """ Create a matrix. INPUT: Supported formats 1. matrix([sparse=True]): the 0x0 matrix over ZZ 2. matrix(list_of_rows, [sparse=True]): matrix with each row constructed from the list_of_rows 3. matrix(nrows, entries, [sparse=True]): matrix with given number of rows and flat list of entries 4. matrix(nrows, ncols, entries, [sparse=True]): matrix with given number of rows and columns with flat list of entries 5. matrix(ring, list_of_row, [sparse=True]): matrix over ring with rows the elements of the list_of_rows 6. matrix(ring, nrows, entries, [sparse=True]): matrix over ring with given number of rows and entries from the flat list 7. matrix(ring, nrows, ncols, entries, [sparse=True]): matrix over the given ring with given number of rows and columns and entries. 8. matrix(numpy_array) The sparse option is optional, must be explicitly named (i.e., sparse=True), and may be either True or False. The entries can instead be a dictionary of key:value pairs of the form (i,j):x, where i,j are integers instead of a list. If sparse is not specified and the entries are a dictionary, it default to True. OUTPUT: a matrix EXAMPLES: 1. The degenerate matrix input format: sage: m = matrix(); m [] sage: parent(m) Full MatrixSpace of 0 by 0 dense matrices over Integer Ring sage: m = matrix(sparse=True); m [] sage: parent(m) Full MatrixSpace of 0 by 0 sparse matrices over Integer Ring 2. The "matrix(list_of_rows, [sparse])" input format. Notice that SAGE is careful to find a sensible common ring for all the entries (using the Sequence object): sage: x = polygen(QQ) sage: m = matrix([[1/3,2+x],[3,4]]); m [ 1/3 x + 2] [ 3 4] sage: parent(m) Full MatrixSpace of 2 by 2 dense matrices over Univariate Polynomial Ring in x over Rational Field sage: m = matrix([[1,2],[3,4/7]]); m [ 1 2] [ 3 4/7] sage: parent(m) Full MatrixSpace of 2 by 2 dense matrices over Rational Field sage: m = matrix([[1,2,3], [RDF(2), CDF(1,2), 3]]); m [ 1.0 2.0 3.0] [ 2.0 1.0 + 2.0*I 3.0] sage: parent(m) Full MatrixSpace of 2 by 3 dense matrices over Complex Double Field sage: V = GF(7)^2 sage: m = matrix([V.0, V.0+2*V.1], sparse=True); m [1 0] [1 2] sage: parent(m) Full MatrixSpace of 2 by 2 sparse matrices over Finite Field of size 7 3. matrix(nrows, entries, [sparse]): sage: matrix(2,[1,2,3, 4,5,6]) [1 2 3] [4 5 6] sage: matrix(3, [1,2, 3/4, 5/6, 7*x, 8*x]) [ 1 2] [3/4 5/6] [7*x 8*x] The number of rows must divide the number of entries. sage: matrix(5,[1,2,3, 4,5,6]) Traceback (most recent call last): ... TypeError: entries has the wrong length 4. matrix(nrows, ncols, entries, [sparse]): sage: matrix(2,3, [1,2,3, 4,5,6]) [1 2 3] [4 5 6] sage: matrix(3,2, [1,2, 3/4, 5/6, 7*x, 8*x]) [ 1 2] [3/4 5/6] [7*x 8*x] The length of the entry list must be the same as the number of rows times columns. sage: matrix(3,3, [1,2, 3/4, 5/6, 7*x, 8*x]) Traceback (most recent call last): ... TypeError: entries has the wrong length 5. matrix(ring, list_of_row, [sparse]): sage: m = matrix(QQ, [[1,2], [3,4]]); m [1 2] [3 4] sage: parent(m) Full MatrixSpace of 2 by 2 dense matrices over Rational Field sage: m = matrix(GF(7), [[1/3,2/3,1/2], [3/4,4/5,7]]); m [5 3 4] [6 5 0] sage: parent(m) Full MatrixSpace of 2 by 3 dense matrices over Finite Field of size 7 6. matrix(ring, nrows, entries, [sparse]): sage: M = ZZ^4 sage: m = matrix(QQ, [M([1,2,3,4]), M([-1,0,3,4])]); m [ 1 2 3 4] [-1 0 3 4] sage: parent(m) Full MatrixSpace of 2 by 4 dense matrices over Rational Field 7. matrix(ring, nrows, ncols, entries, [sparse]) sage: matrix(QQ, 2, 2, [1,2,3,4]) [1 2] [3 4] sage: matrix(GF(5), 2, 3, range(6)) [0 1 2] [3 4 0] sage: matrix(ZZ, 10, 10, range(100)).parent() Full MatrixSpace of 10 by 10 dense matrices over Integer Ring sage: matrix(ZZ, 10, 10, range(100), sparse=True).parent() Full MatrixSpace of 10 by 10 sparse matrices over Integer Ring sage: R = PolynomialRing(QQ, 9, 'x') sage: A = matrix(R, 3, 3, R.gens()); A [x0 x1 x2] [x3 x4 x5] [x6 x7 x8] sage: det(A) -x2*x4*x6 + x1*x5*x6 + x2*x3*x7 - x0*x5*x7 - x1*x3*x8 + x0*x4*x8 CREATING SPARSE MATRICES FROM DICTS: sage: a = matrix({(1,2):10, (2,3):5/1}) sage: print a, a.parent() [ 0 0 0 0] [ 0 0 10 0] [ 0 0 0 5] Full MatrixSpace of 3 by 4 sparse matrices over Rational Field sage: a = matrix({(1,2):10}) sage: print a, a.is_sparse() [ 0 0 0] [ 0 0 10] True sage: a = matrix(3,{(1,2):10}) sage: print a, a.is_sparse() [ 0 0 0] [ 0 0 10] [ 0 0 0] True sage: a = matrix(3,5,{(1,2):10}) sage: print a, a.is_sparse() [ 0 0 0 0 0] [ 0 0 10 0 0] [ 0 0 0 0 0] True sage: a = matrix(QQ, 3, {(1,2):10}) sage: print a, a.is_sparse() [ 0 0 0] [ 0 0 10] [ 0 0 0] True sage: a = matrix(QQ, 3, {(1,2):10}, sparse=True) sage: print a, a.is_sparse() [ 0 0 0] [ 0 0 10] [ 0 0 0] True sage: a = matrix(QQ, 3, 5, {(1,2):10}, sparse=True) sage: print a, a.is_sparse() [ 0 0 0 0 0] [ 0 0 10 0 0] [ 0 0 0 0 0] True 8. Creating a matrix from a numpy array Any numpy array with a datatype of float or complex may be passed to matrix If the data type is float the result will be a matrix over the real double field. complex numpy arrays will give matrices over the complex double field. The data of the numpy array must be contiguous, so slices of other matrices will raise an exception. sage: import numpy sage: n=numpy.array([[1,2],[3,4]],float) sage: m=matrix(n) sage: n=numpy.array([[numpy.complex(0,1),numpy.complex(0,2)],[3,4]],complex) sage: m=matrix(n) """ if hasattr(arg0, '_matrix_'): if arg1 is None: arg1 = rings.ZZ return arg0._matrix_(arg1) if hasattr(arg1, '_matrix_'): return arg1._matrix_(arg0) if arg0 is None: # 1. matrix([sparse]): # the 0x0 matrix over ZZ # the degenerate matrix ring = rings.ZZ nrows = 0 ncols = 0 entries = [] elif isinstance(arg0, (list, tuple)): # 2. matrix(list_of_rows, [sparse]): # matrix with each row constructed from the list_of_rows # list of rows if not (arg1 is None and arg2 is None and arg3 is None): raise TypeError, "invalid input" nrows = len(arg0) if nrows == 0: ncols = 0 else: ncols = len(arg0[0]) w = sum([list(v) for v in arg0], []) entries, ring = prepare(w) elif isinstance(arg0, dict): # 2. matrix(dict_of_rows, sparse=True): if sparse is None: sparse = True entries, ring = prepare_dict(arg0) nrows = nrows_from_dict(entries) ncols = ncols_from_dict(entries) elif not rings.is_Ring(arg0) and isinstance(arg1, (list, tuple)) and arg2 is None and arg3 is None: # 3. matrix(nrows, entries, [sparse]): # matrix with given number of rows and flat list of entries nrows = int(arg0) entries, ring = prepare(arg1) ncols = len(entries) // nrows elif not rings.is_Ring(arg0) and isinstance(arg1, dict) and arg2 is None and arg3 is None: # 3. matrix(nrows, entries, sparse=True): # matrix with given number of rows and sparse dict of entries if sparse is None: sparse = True nrows = int(arg0) entries, ring = prepare_dict(arg1) ncols = ncols_from_dict(entries) elif not rings.is_Ring(arg0) and isinstance(arg2, (list, tuple)) and arg3 is None: # 4. matrix(nrows, ncols, entries, [sparse]): # matrix with given number of rows and columns with flat list of entries nrows = int(arg0) ncols = int(arg1) entries, ring = prepare(arg2) elif not rings.is_Ring(arg0) and isinstance(arg2, dict) and arg3 is None: # 4. matrix(nrows, ncols, entries, sparse=True): # matrix with given number of rows and columns with flat list of entries if sparse is None: sparse = True nrows = int(arg0) ncols = int(arg1) entries, ring = prepare_dict(arg2) elif rings.is_Ring(arg0) and isinstance(arg1, (list, tuple)) and arg2 is None and arg3 is None: # 5. matrix(ring, list_of_row, [sparse]): # matrix over ring with rows the elements of the list_of_rows ring = arg0 nrows = len(arg1) if nrows == 0: ncols = 0 else: try: ncols = len(arg1[0]) except TypeError: raise TypeError, "If making a matrix with the matrix(ring, list_of_row, [sparse]) constructor, the second input must be a list of rows." entries = sum([list(v) for v in arg1], []) elif rings.is_Ring(arg0) and isinstance(arg1, dict) and arg2 is None and arg3 is None: # 5. matrix(ring, dict, sparse=True): # matrix over ring with rows the elements the dict if sparse is None: sparse = True ring = arg0 entries = arg1 nrows = nrows_from_dict(entries) elif rings.is_Ring(arg0) and isinstance(arg2, (list, tuple)) and arg3 is None: # 6. matrix(ring, nrows, entries, [sparse]): # matrix over ring with given number of rows and entries from the flat list ring = arg0 nrows = int(arg1) entries = arg2 if nrows == 0: ncols = 0 else: ncols = len(entries) // nrows elif rings.is_Ring(arg0) and isinstance(arg2, dict) and arg3 is None: # 6. matrix(ring, nrows, entries, sparse=True) # matrix over ring with given number of rows and entries from the dict if sparse is None: sparse = True ring = arg0 nrows = int(arg1) entries = arg2 if nrows == 0: ncols = 0 else: ncols = ncols_from_dict(entries) elif rings.is_Ring(arg0): # 7. matrix(ring, nrows, ncols, entries, [sparse]): # matrix over the given ring with given number of rows and columns and entries. ring = arg0 nrows = int(arg1) if arg2 is None: ncols = nrows else: ncols = int(arg2) entries = arg3 if isinstance(entries, dict): if sparse is None: sparse = True else: import numpy if isinstance(arg0,numpy.ndarray): if str(arg0.dtype).count('float')==1: if arg0.flags.c_contiguous==True or arg0.flags.f_contiguous==True: m=matrix(RDF,arg0.shape[0],arg0.shape[1],0) m._replace_self_with_numpy(arg0) if arg0.flags.c_contiguous: return m else: return m.transpose() elif str(arg0.dtype).count('complex')==1: if arg0.flags.c_contiguous==True or arg0.flags.f_contiguous==True: m=matrix(CDF,arg0.shape[0],arg0.shape[1],0) m._replace_self_with_numpy(arg0) if arg0.flags.c_contiguous: return m else: return m.transpose() else: raise TypeError, "unknown matrix constructor format. Type matrix? for help" if sparse is None: sparse = False return matrix_space.MatrixSpace(ring, nrows, ncols, sparse=sparse)(entries) | 95d38282532e391dd2680a8bf59b2110c6999282 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/95d38282532e391dd2680a8bf59b2110c6999282/constructor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3148,
12,
3175,
20,
33,
7036,
16,
1501,
21,
33,
7036,
16,
1501,
22,
33,
7036,
16,
1501,
23,
33,
7036,
16,
9387,
33,
7036,
4672,
3536,
1788,
279,
3148,
18,
225,
12943,
30,
19503,
6449... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3148,
12,
3175,
20,
33,
7036,
16,
1501,
21,
33,
7036,
16,
1501,
22,
33,
7036,
16,
1501,
23,
33,
7036,
16,
9387,
33,
7036,
4672,
3536,
1788,
279,
3148,
18,
225,
12943,
30,
19503,
6449... |
base_dir = os.path.split(path)[0] | def date_name(path): """ Takes a file specified by path and returns its name in strftime format %F_%T which is its last modified time """ # Get the modification time from the timestamp of the fill mod_time = datetime.fromtimestamp(os.stat(path).st_mtime) # Grab our parent directory base_dir = os.path.split(path)[0] # Join the two and rename the file dated_path = os.path.join(base_dir, mod_time.strftime('%F_%T')) return dated_path | 73759f96700ef26063b5541b3befb24dbe11c3aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10608/73759f96700ef26063b5541b3befb24dbe11c3aa/backup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1509,
67,
529,
12,
803,
4672,
3536,
23004,
279,
585,
1269,
635,
589,
471,
1135,
2097,
508,
316,
10405,
740,
738,
42,
10185,
56,
1492,
353,
2097,
1142,
4358,
813,
3536,
468,
968,
326,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1509,
67,
529,
12,
803,
4672,
3536,
23004,
279,
585,
1269,
635,
589,
471,
1135,
2097,
508,
316,
10405,
740,
738,
42,
10185,
56,
1492,
353,
2097,
1142,
4358,
813,
3536,
468,
968,
326,
1... | |
base.do('python setup.py sdist register upload', cwd = tagDir) | base.do('python setup.py sdist upload', cwd = tagDir) | def createRelease(self, version, branch): logger.info('Creating release %r for %r from branch %r' %( version, self.pkg, branch)) # 0. Skip creating releases in offline mode. if self.options.offline: logger.info('Offline: Skip creating a release.') return # 1. Create Release Tag branchUrl = self.getBranchURL(branch) tagUrl = self.getTagURL(version) | 7c3c5e22afeb26241999f6634657be24065e4181 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9561/7c3c5e22afeb26241999f6634657be24065e4181/package.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
7391,
12,
2890,
16,
1177,
16,
3803,
4672,
1194,
18,
1376,
2668,
11092,
3992,
738,
86,
364,
738,
86,
628,
3803,
738,
86,
11,
8975,
1177,
16,
365,
18,
10657,
16,
3803,
3719,
468,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
7391,
12,
2890,
16,
1177,
16,
3803,
4672,
1194,
18,
1376,
2668,
11092,
3992,
738,
86,
364,
738,
86,
628,
3803,
738,
86,
11,
8975,
1177,
16,
365,
18,
10657,
16,
3803,
3719,
468,
... |
sage: print is_disjoint(T1, T2) | sage: _, t1, t2, t3 = tau123(T1, T2) sage: U1, U2 = tau_to_bitrade(t1, t2, t3) sage: assert is_bitrade(U1, U2) sage: U1 [0 1 2 3 4] [1 2 3 4 0] [2 3 4 0 1] [3 4 0 1 2] [4 0 1 2 3] sage: U2 [4 0 1 2 3] [0 1 2 3 4] [1 2 3 4 0] [2 3 4 0 1] [3 4 0 1 2] """ c1 = t1.to_cycles() c2 = t2.to_cycles() c3 = t3.to_cycles() pt_to_cycle1 = {} pt_to_cycle2 = {} pt_to_cycle3 = {} for i in range(len(c1)): for j in range(len(c1[i])): pt_to_cycle1[c1[i][j]] = i for i in range(len(c2)): for j in range(len(c2[i])): pt_to_cycle2[c2[i][j]] = i for i in range(len(c3)): for j in range(len(c3[i])): pt_to_cycle3[c3[i][j]] = i n = max(len(c1), len(c2), len(c3)) T1 = LatinSquare(n) T2 = LatinSquare(n) for r in range(len(c1)): for c in range(len(c2)): for s in range(len(c3)): nr_common = len(reduce(sets.Set.intersection, \ [sets.Set(c1[r]), sets.Set(c2[c]), sets.Set(c3[s])])) assert nr_common in [0, 1] if nr_common == 1: T1[r, c] = s for cycle in c1: for pt1 in cycle: pt2 = t1[pt1 - 1] pt3 = t2[pt2 - 1] assert t3[pt3 - 1] == pt1 r = pt_to_cycle1[pt1] c = pt_to_cycle2[pt2] s = pt_to_cycle3[pt3] T2[r, c] = s return T1, T2 def bitrade_from_group(a, b, c, G): """ Given group elements a, b, c in G such that abc = 1 and the subgroups <a>, <b>, <c> intersect (pairwise) only in the identity, construct a bitrade (T1, T2) where rows, columns, and symbols correspond to cosets of <a>, <b>, and <c>, respectively. EXAMPLES: sage: from sage.combinat.matrices.latin import * sage: a, b, c, G = alternating_group_bitrade_generators(1) sage: (T1, T2) = bitrade_from_group(a, b, c, G) sage: T1 [ 0 2 -1 1] [-1 0 1 3] [ 3 -1 0 2] [ 1 3 2 -1] sage: T2 [ 1 0 -1 2] [-1 3 0 1] [ 0 -1 2 3] [ 3 2 1 -1] """ hom = gap.ActionHomomorphism(G, gap.RightCosets(G, gap.TrivialSubgroup(G)), gap.OnRight) t1 = gap.Image(hom, a) t2 = gap.Image(hom, b) t3 = gap.Image(hom, c) t1 = Permutation(str(t1).replace('\n', '')) t2 = Permutation(str(t2).replace('\n', '')) t3 = Permutation(str(t3).replace('\n', '')) return tau_to_bitrade(t1, t2, t3) def is_disjoint(T1, T2): """ The partial latin squares T1 and T2 are disjoint if T1[r, c] != T2[r, c] or T1[r, c] == T2[r, c] == -1 for each cell [r, c]. EXAMPLES: sage: from sage.combinat.matrices.latin import is_disjoint, back_circulant, isotopism sage: is_disjoint(back_circulant(2), back_circulant(2)) False sage: T1 = back_circulant(5) sage: x = isotopism( (0,1,2,3,4) ) sage: y = isotopism(5) sage: z = isotopism(5) sage: T2 = T1.apply_isotopism(x, y, z) sage: is_disjoint(T1, T2) | def is_disjoint(T1, T2): """ The partial latin squares T1 and T2 are disjoint if T1[r, c] != T2[r, c] or T1[r, c] == T2[r, c] == -1 for each cell [r, c]. EXAMPLES: sage: from sage.combinat.matrices.latin import is_disjoint, back_circulant, isotopism sage: is_disjoint(back_circulant(2), back_circulant(2)) False sage: T1 = back_circulant(5) sage: x = isotopism( (0,1,2,3,4) ) sage: y = isotopism(5) # identity sage: z = isotopism(5) # identity sage: T2 = T1.apply_isotopism(x, y, z) sage: print is_disjoint(T1, T2) True """ for i in range(T1.nrows()): for j in range(T1.ncols()): if T1[i, j] < 0 and T2[i, j] < 0: continue if T1[i, j] == T2[i, j]: return False return True | 9087d14f978c663baae98e9a365c4a3aa2a6f24c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/9087d14f978c663baae98e9a365c4a3aa2a6f24c/latin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
2251,
16452,
12,
56,
21,
16,
399,
22,
4672,
3536,
1021,
4702,
30486,
31206,
399,
21,
471,
399,
22,
854,
1015,
16452,
309,
399,
21,
63,
86,
16,
276,
65,
480,
399,
22,
63,
8... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
2251,
16452,
12,
56,
21,
16,
399,
22,
4672,
3536,
1021,
4702,
30486,
31206,
399,
21,
471,
399,
22,
854,
1015,
16452,
309,
399,
21,
63,
86,
16,
276,
65,
480,
399,
22,
63,
8... |
self.__untranslated += 1 | self._untranslated += 1 | def __init__(self, filepath, template): self.__filepath = filepath self.__template = template self.__count = 0 self.__translated = 0 self.__untranslated = 0 self.__fuzzy = 0 self.__porevisiondate = '' self.__potcreationdate = '' self.__translators = [] if os.access(filepath, os.R_OK): #If PO(T) file can read... reMsgId = re.compile('^msgid "(.*)"$', re.IGNORECASE) reMsgStr = re.compile('^msgstr "(.*)"$', re.IGNORECASE) reMsgContinued = re.compile('^"(.*)"$', re.IGNORECASE) reTranslator = re.compile('^# \* (.*)$', re.IGNORECASE) rePoRevisionDate = re.compile('PO-Revision-Date: ([0-9 :\+\-]+)', re.IGNORECASE) rePotCreationDate = re.compile('POT-Creation-Date: ([0-9 :\+\-]+)', re.IGNORECASE) iMsgStarted = 0 sMsgId = '' sMsgStr = '' bIsFuzzy = False bIsMaintainer = False pofile = open(filepath, 'r') for line in pofile: #For all lines... line = line.strip() if line: #If NOT empty line... if line[0] != '#': #If NOT comment line... if reMsgId.findall(line): #If "msgid"... iMsgStarted = 1 tmp = reMsgId.findall(line) sMsgId = tmp[0] elif reMsgStr.findall(line): #If "msgstr"... iMsgStarted = 2 tmp = reMsgStr.findall(line) sMsgStr = tmp[0] elif reMsgContinued.findall(line): #If "msgid" or "msgstr" continued... tmp = reMsgContinued.findall(line) if iMsgStarted == 1: sMsgId = sMsgId + tmp[0] elif iMsgStarted == 2: sMsgStr = sMsgStr + tmp[0] else: #If comment line... iMsgStarted = -1 if line.startswith('#,'): #If "Reference" line... if line.find('fuzzy') > -1: #If "fuzzy"... bIsFuzzy = True elif line.startswith('# Maintainer:'): #If maintainer list starts... bIsMaintainer = True elif line.startswith('# Translators:'): #If translators list starts... bIsMaintainer = False elif reTranslator.findall(line): #If translator/maintainer... translator = reTranslator.findall(line) if re.findall('\<(.*)\>', translator[0]): #If mail address exists... tmp = re.findall('(.*) \<(.*)\>', translator[0]) sName = tmp[0][0] sMail = tmp[0][1] else: #If mail address NOT exists... sName = translator[0] sMail = '' self.__translators.append(Translator(sName, sMail, bIsMaintainer)) else: #If empty line... iMsgStarted = 0 if iMsgStarted == 0: #If NOT inside a translation... if sMsgId != '': self.__count += 1 if bIsFuzzy == False: #If NOT a fuzzy translation... if sMsgStr != '': self.__translated += 1 else: self.__untranslated += 1 else: #If a fuzzy translation... self.__fuzzy += 1 elif sMsgStr != '': tmp = rePoRevisionDate.findall(sMsgStr) if tmp: #If "PO-Revision-Date"... #TODO: Convert to date! self.__porevisiondate = tmp[0] tmp = rePotCreationDate.findall(sMsgStr) if tmp: #If "POT-Creation-Date"... #TODO: Convert to date! self.__potcreationdate = tmp[0] sMsgId = '' sMsgStr = '' bIsFuzzy = False pofile.close() | 569cb008f201fd5615072299951acfa2ed026f12 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5857/569cb008f201fd5615072299951acfa2ed026f12/GetTranslationsStatus.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3608,
16,
1542,
4672,
365,
16186,
10561,
273,
3608,
365,
16186,
3202,
273,
1542,
365,
16186,
1883,
273,
374,
365,
16186,
22899,
273,
374,
365,
16186,
318,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3608,
16,
1542,
4672,
365,
16186,
10561,
273,
3608,
365,
16186,
3202,
273,
1542,
365,
16186,
1883,
273,
374,
365,
16186,
22899,
273,
374,
365,
16186,
318,
... |
notification_center = NotificationCenter() notification_center.post_notification('BonjourAccountRegistrationDidEnd', sender=self.account, data=TimestampedNotificationData()) | NotificationCenter().post_notification('BonjourAccountRegistrationDidEnd', sender=self.account, data=TimestampedNotificationData()) | def _CH_unregister(self, command): if self._register_timer is not None: self._register_timer.cancel() self._register_timer = None old_files = [] for file in (f for f in self._files[:] if f.type=='registration'): old_files.append(file) self._files.remove(file) self._select_proc.kill(RestartSelect) for file in old_files: file.close() notification_center = NotificationCenter() notification_center.post_notification('BonjourAccountRegistrationDidEnd', sender=self.account, data=TimestampedNotificationData()) command.signal() | 8e35ab24bf2b7ebd86f546a9d1d49ec606190fd1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5703/8e35ab24bf2b7ebd86f546a9d1d49ec606190fd1/account.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1792,
67,
318,
4861,
12,
2890,
16,
1296,
4672,
309,
365,
6315,
4861,
67,
12542,
353,
486,
599,
30,
365,
6315,
4861,
67,
12542,
18,
10996,
1435,
365,
6315,
4861,
67,
12542,
273,
59... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1792,
67,
318,
4861,
12,
2890,
16,
1296,
4672,
309,
365,
6315,
4861,
67,
12542,
353,
486,
599,
30,
365,
6315,
4861,
67,
12542,
18,
10996,
1435,
365,
6315,
4861,
67,
12542,
273,
59... |
StructureTest() | StructureTest(dir="minimize", test="0001") | def test_minimize_0001(self): StructureTest() | d4548954f0b2ec61c249ce8e1b4af97c07a52a78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/d4548954f0b2ec61c249ce8e1b4af97c07a52a78/tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1154,
10153,
67,
13304,
12,
2890,
4672,
13348,
4709,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1154,
10153,
67,
13304,
12,
2890,
4672,
13348,
4709,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
menuitem.setAttribute("acceltext", item.shortcuts[-1].XULString()) | menuitem.setAttribute("key","%s-key%d"%(item.action,len(item.shortcuts))) | def addMenubar(self, document): menubarElement = document.getElementById("titlebar-menu") | e4fb6cc8505661f93103216850cd772488489381 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12354/e4fb6cc8505661f93103216850cd772488489381/pybridge.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
49,
275,
373,
297,
12,
2890,
16,
1668,
4672,
21247,
373,
297,
1046,
273,
1668,
18,
24135,
2932,
2649,
3215,
17,
5414,
7923,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
49,
275,
373,
297,
12,
2890,
16,
1668,
4672,
21247,
373,
297,
1046,
273,
1668,
18,
24135,
2932,
2649,
3215,
17,
5414,
7923,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
bmovl plugin fro mplayer | bmovl plugin for mplayer | def update(self, rect): _debug_('update bmovl') update = self.screen.subsurface(rect) os.write(self.bmovl, 'RGBA32 %d %d %d %d %d %d\n' % \ (update.get_width(), update.get_height(), rect[0], rect[1], 0, 0)) os.write(self.bmovl, pygame.image.tostring(update, 'RGBA')) | 2ca9321fde7480a272c9cb0bc365e10c0dfdd20a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/2ca9321fde7480a272c9cb0bc365e10c0dfdd20a/bmovl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
16,
4917,
4672,
389,
4148,
67,
2668,
2725,
18829,
1527,
80,
6134,
1089,
273,
365,
18,
9252,
18,
1717,
18266,
12,
2607,
13,
1140,
18,
2626,
12,
2890,
18,
25709,
1527,
80... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4917,
4672,
389,
4148,
67,
2668,
2725,
18829,
1527,
80,
6134,
1089,
273,
365,
18,
9252,
18,
1717,
18266,
12,
2607,
13,
1140,
18,
2626,
12,
2890,
18,
25709,
1527,
80... |
key, val = row.findAll(u'td') | key = row.findAll(u'th')[0] val = row.findAll(u'td')[0] | def get_quote(self, symbol): url = Yahoo._quote_url.replace(u'SYMBOL', symbol) page = geturl(url) soup = BeautifulSoup(page) company = u' '.join([unicode(item) for item in soup.find(u'h1').contents]) company = stripHTML(company) tables = soup.findAll(u'table') if not tables: raise UnknownSymbol table = tables[0] rows = table.findAll(u'tr') data = {} current_price = 0.0 last_price = 0.0 | 2d79ced007fb67a0f1fb47a406f94ca0b63e2af3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10942/2d79ced007fb67a0f1fb47a406f94ca0b63e2af3/stockquote.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
6889,
12,
2890,
16,
3273,
4672,
880,
273,
1624,
9795,
5161,
6315,
6889,
67,
718,
18,
2079,
12,
89,
11,
22093,
2187,
3273,
13,
1363,
273,
336,
718,
12,
718,
13,
15418,
273,
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,
336,
67,
6889,
12,
2890,
16,
3273,
4672,
880,
273,
1624,
9795,
5161,
6315,
6889,
67,
718,
18,
2079,
12,
89,
11,
22093,
2187,
3273,
13,
1363,
273,
336,
718,
12,
718,
13,
15418,
273,
2... |
'and' : '&&', 'or' : '||', '<': '<' , '>': '>' }; | ' and ' : '&&', ' or ' : '||', '<' : '<' , '>' : '>' }; | def __str__(self): return 'open: \'' + str(self.open) + '\'\nclose: \'' + str(self.close) + '\'' | 6289af17f46fb2f11aea9d918dd0880dd1e18af8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4025/6289af17f46fb2f11aea9d918dd0880dd1e18af8/ch_clean_asp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
327,
296,
3190,
30,
225,
18665,
397,
609,
12,
2890,
18,
3190,
13,
225,
397,
2337,
8314,
82,
4412,
30,
18665,
397,
609,
12,
2890,
18,
4412,
13,
397,
15... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
701,
972,
12,
2890,
4672,
327,
296,
3190,
30,
225,
18665,
397,
609,
12,
2890,
18,
3190,
13,
225,
397,
2337,
8314,
82,
4412,
30,
18665,
397,
609,
12,
2890,
18,
4412,
13,
397,
15... |
counter = self.hit_counter.get(uri, 0) | counter = self.hit_counter.get(method+uri, 0) | def request(self, uri, method="GET", body=None, headers=None, redirections=5): counter = self.hit_counter.get(uri, 0) counter += 1 self.hit_counter[uri] = counter headers, body = self.h.request(uri, method, body, headers, redirections) path = urlparse.urlparse(uri)[2] fname = os.path.join(self.directory, method, path.strip("/") + ".file") if counter >= 2: fname = fname + "." + str(counter) dirname = os.path.dirname(fname) if not os.path.exists(dirname): os.makedirs(dirname) | 6f4d8ba6ee79dce0fbf212a157d9c51e6067a7e0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5012/6f4d8ba6ee79dce0fbf212a157d9c51e6067a7e0/mockhttp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
590,
12,
2890,
16,
2003,
16,
707,
1546,
3264,
3113,
1417,
33,
7036,
16,
1607,
33,
7036,
16,
19611,
87,
33,
25,
4672,
3895,
273,
365,
18,
15989,
67,
7476,
18,
588,
12,
2039,
15,
1650,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
590,
12,
2890,
16,
2003,
16,
707,
1546,
3264,
3113,
1417,
33,
7036,
16,
1607,
33,
7036,
16,
19611,
87,
33,
25,
4672,
3895,
273,
365,
18,
15989,
67,
7476,
18,
588,
12,
2039,
15,
1650,... |
if string.find(line, "warning:") == -1: | if string.find(line, "pdfTeX warning") == -1: | def errors (self): """ Returns true if there was an error during the compilation. """ for line in self.lines: if line[0] == "!": # We check for the substring "warning:" because pdfTeX # sometimes issues warnings (like undefined references) in the # form of errors... | bebabe8d0cd32d7c1fa4d0ec91094782a2e99e1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/bebabe8d0cd32d7c1fa4d0ec91094782a2e99e1f/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1334,
261,
2890,
4672,
3536,
2860,
638,
309,
1915,
1703,
392,
555,
4982,
326,
8916,
18,
3536,
364,
980,
316,
365,
18,
3548,
30,
309,
980,
63,
20,
65,
422,
23717,
30,
468,
1660,
866,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1334,
261,
2890,
4672,
3536,
2860,
638,
309,
1915,
1703,
392,
555,
4982,
326,
8916,
18,
3536,
364,
980,
316,
365,
18,
3548,
30,
309,
980,
63,
20,
65,
422,
23717,
30,
468,
1660,
866,
... |
if info.contents.DeleteOnClose: if info.contents.IsDirectory: | if info.contents.IsDirectory: if info.contents.DeleteOnClose: | def Cleanup(self, path, info): path = normpath(path) if info.contents.DeleteOnClose: if info.contents.IsDirectory: self.fs.removedir(path) self._pending_delete.remove(path) else: (file,_,lock) = self._get_file(info.contents.Context) lock.acquire() try: file.close() self.fs.remove(path) self._pending_delete.remove(path) self._del_file(info.contents.Context) finally: lock.release() info.contents.Context = 0 | 86b05739df224b995133779248dc8dc99fc2fdbe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5579/86b05739df224b995133779248dc8dc99fc2fdbe/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19968,
12,
2890,
16,
589,
16,
1123,
4672,
589,
273,
20446,
12,
803,
13,
309,
1123,
18,
3980,
18,
2520,
2853,
30,
309,
1123,
18,
3980,
18,
2613,
1398,
4605,
30,
365,
18,
2556,
18,
149... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19968,
12,
2890,
16,
589,
16,
1123,
4672,
589,
273,
20446,
12,
803,
13,
309,
1123,
18,
3980,
18,
2520,
2853,
30,
309,
1123,
18,
3980,
18,
2613,
1398,
4605,
30,
365,
18,
2556,
18,
149... |
self.elements[key] = start, val | self.elements[tag] = start, getattr(self, key) | def __fixdict(self, dict): for key, val in dict.items(): if key[:6] == 'start_': key = key[6:] start, end = self.elements.get(key, (None, None)) if start is None: self.elements[key] = val, end elif key[:4] == 'end_': key = key[4:] start, end = self.elements.get(key, (None, None)) if end is None: self.elements[key] = start, val | 85afe3cf7b6468e27cbca4451e87bfc49d31ebb0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/85afe3cf7b6468e27cbca4451e87bfc49d31ebb0/xmllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
904,
1576,
12,
2890,
16,
2065,
4672,
364,
498,
16,
1244,
316,
2065,
18,
3319,
13332,
309,
498,
10531,
26,
65,
422,
296,
1937,
67,
4278,
498,
273,
498,
63,
26,
26894,
787,
16,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
904,
1576,
12,
2890,
16,
2065,
4672,
364,
498,
16,
1244,
316,
2065,
18,
3319,
13332,
309,
498,
10531,
26,
65,
422,
296,
1937,
67,
4278,
498,
273,
498,
63,
26,
26894,
787,
16,
6... |
return self.text | return str(self.text) | def get_clipboard(self): """ Read text from the clipboard Usage: C{clipboard.get_clipboard()} """ self.__execAsync(self.__getClipboard) return self.text | 72bc5f905a0b411c1ba52af4c786f7196b141927 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6143/72bc5f905a0b411c1ba52af4c786f7196b141927/scripting.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
14161,
3752,
12,
2890,
4672,
3536,
2720,
977,
628,
326,
20304,
225,
10858,
30,
385,
95,
14161,
3752,
18,
588,
67,
14161,
3752,
17767,
3536,
365,
16186,
4177,
2771,
12,
2890,
161... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
14161,
3752,
12,
2890,
4672,
3536,
2720,
977,
628,
326,
20304,
225,
10858,
30,
385,
95,
14161,
3752,
18,
588,
67,
14161,
3752,
17767,
3536,
365,
16186,
4177,
2771,
12,
2890,
161... |
self.director = re.search(r"Reie:(.*)<br",self.page) | self.director = re.search(r"Re.ie:(.*)<br",self.page) | def director(self): self.director = re.search(r"Reie:(.*)<br",self.page) if self.director: self.director = gutils.strip_tags(self.director.group(1)) else: self.director = "" | a15c986268b8505d4a169f8d3d399848647f3c0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2687/a15c986268b8505d4a169f8d3d399848647f3c0b/PluginMovieCSFD.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2657,
280,
12,
2890,
4672,
365,
18,
7205,
280,
273,
283,
18,
3072,
12,
86,
6,
426,
18,
1385,
30,
14361,
32,
2848,
3113,
2890,
18,
2433,
13,
309,
365,
18,
7205,
280,
30,
365,
18,
72... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2657,
280,
12,
2890,
4672,
365,
18,
7205,
280,
273,
283,
18,
3072,
12,
86,
6,
426,
18,
1385,
30,
14361,
32,
2848,
3113,
2890,
18,
2433,
13,
309,
365,
18,
7205,
280,
30,
365,
18,
72... |
"incoming|in": (incoming, [], 'hg incoming [SOURCE]'), | "incoming|in": (incoming, [('p', 'patch', None, 'show patch')], 'hg incoming [-p] [SOURCE]'), | def verify(ui, repo): """verify the integrity of the repository""" return repo.verify() | 5056ddad9b2862047b2be18b61c800c861a53a38 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/5056ddad9b2862047b2be18b61c800c861a53a38/commands.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3929,
12,
4881,
16,
3538,
4672,
3536,
8705,
326,
24425,
434,
326,
3352,
8395,
327,
3538,
18,
8705,
1435,
225,
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,
3929,
12,
4881,
16,
3538,
4672,
3536,
8705,
326,
24425,
434,
326,
3352,
8395,
327,
3538,
18,
8705,
1435,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
self.robot._main_part.set_local_force( convertToVector3(ogre.Vector3, force), (0,0,0)) self.robot._main_part.torque = convertToVector3(ogre.Vector3, torque) | def applyForcesAndTorques(self, force, torque): self.robot._main_part.set_local_force( convertToVector3(ogre.Vector3, force), (0,0,0)) self.robot._main_part.torque = convertToVector3(ogre.Vector3, torque) portThruster = self.getDevice('PortThruster') starThruster = self.getDevice('StartboardThruster') foreThruster = self.getDevice('ForeThruster') aftThruster = self.getDevice('AftThruster') # TODO: Fix and check me #starThruster.setForce(force[2] / 2 + 0.5 * torque[1]) #/ 0.1905 #portThruster.setForce(force[2] / 2 - 0.5 * torque[1]) #/ 0.1905 #foreThruster.setForce(force[1] / 2 + 0.5 * torque[0]) #/ 0.3366 #aftThruster.setForce(force[1] / 2 - 0.5 * torque[0]) #/ 0.3366 | 0502a0ec3ee9e5e1dbd649fd297291ba847fa07e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10608/0502a0ec3ee9e5e1dbd649fd297291ba847fa07e/vehicle.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
1290,
764,
1876,
27266,
29896,
12,
2890,
16,
2944,
16,
8934,
1857,
4672,
1756,
1315,
86,
1722,
273,
365,
18,
588,
3654,
2668,
2617,
1315,
86,
1722,
6134,
10443,
1315,
86,
1722,
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,
1290,
764,
1876,
27266,
29896,
12,
2890,
16,
2944,
16,
8934,
1857,
4672,
1756,
1315,
86,
1722,
273,
365,
18,
588,
3654,
2668,
2617,
1315,
86,
1722,
6134,
10443,
1315,
86,
1722,
273... | |
n = sage.rings.integer.Integer(n) | n = Integer(n) | def __call__(self, n, watch=False): n = sage.rings.integer.Integer(n) cmd = 'echo "%s" | %s'%(n, self.__cmd) if watch: t = tmp_filename() os.system('%s | tee %s'%(cmd, t)) ou = open(t).read() os.unlink(t) else: i,o,e = os.popen3(cmd) i.close() ou = e.read() + '\n' + o.read() if 'command not found' in ou: err = ou + '\n' + 'You must install GMP-ECM.\n' err += sage.misc.package.package_mesg('ecm-6.0.1') raise RuntimeError, err return ou | 0eca9f7c00e56c7a5534d537e9194797a26d63e6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/0eca9f7c00e56c7a5534d537e9194797a26d63e6/ecm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
290,
16,
4267,
33,
8381,
4672,
290,
273,
2144,
12,
82,
13,
1797,
273,
296,
12946,
2213,
87,
6,
571,
738,
87,
11,
17105,
82,
16,
365,
16186,
4172,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
290,
16,
4267,
33,
8381,
4672,
290,
273,
2144,
12,
82,
13,
1797,
273,
296,
12946,
2213,
87,
6,
571,
738,
87,
11,
17105,
82,
16,
365,
16186,
4172,
13,
... |
self._ringtone = ringtone | if self.session_manager.ringtone_config.outbound_ringtone is not None: self._ringtone = WaveFile(self.session_manager.ringtone_config.outbound_ringtone) | def new(self, callee_uri, credentials, route, audio=False, chat=False): """Creates a new SIP session to the callee with the requested stream(s). Moves the object from the NULL into the CALLING state.""" with self._lock: if self.state != "NULL": raise RuntimeError("This method can only be called while in the NULL state") if not any([audio, chat]): raise RuntimeError("No media stream requested") inv = Invitation(credentials, callee_uri, route) if audio: audio_rtp = RTPTransport(**self.rtp_options) else: audio_rtp = None if chat: if self.msrp_options.use_relay_outgoing: msrp_relay = MSRPRelaySettings(credentials.uri.host, credentials.uri.user, credentials.password, self.msrp_options.relay_host, self.msrp_options.relay_port, self.msrp_options.relay_use_tls) else: msrp_relay = None msrp_chat = MSRPChat(credentials.uri, callee_uri, True, msrp_relay) else: msrp_chat = None ringtone = WaveFile(self.session_manager.ringtone_config.outbound_ringtone) media_initializer = MediaTransportInitializer(self, self._new_continue, self._new_fail, audio_rtp, msrp_chat) self._inv = inv self.chat_transport = msrp_chat self.session_manager.inv_mapping[inv] = self self._ringtone = ringtone self.direction = "outgoing" self._change_state("CALLING") self.notification_center.post_notification("SCSessionNewOutgoing", self, TimestampedNotificationData(audio=audio)) | 7f10f20e46c1546b9c40950c3ad1460884703461 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3449/7f10f20e46c1546b9c40950c3ad1460884703461/session.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
12,
2890,
16,
14425,
67,
1650,
16,
4448,
16,
1946,
16,
7447,
33,
8381,
16,
7916,
33,
8381,
4672,
3536,
2729,
279,
394,
348,
2579,
1339,
358,
326,
14425,
598,
326,
3764,
1407,
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,
394,
12,
2890,
16,
14425,
67,
1650,
16,
4448,
16,
1946,
16,
7447,
33,
8381,
16,
7916,
33,
8381,
4672,
3536,
2729,
279,
394,
348,
2579,
1339,
358,
326,
14425,
598,
326,
3764,
1407,
12,
... |
":bar", "tracks/atom.pos.bond.df.bins", "tracks/atom.pos.bond.df.cumul.hist", "tracks/atom.pos.bond.df.cumul.hist.error", | ":bar", "tracks/atom.bond.pos.df.bins", "tracks/atom.bond.pos.df.cumul.hist", "tracks/atom.bond.pos.df.cumul.hist.error", | def test_df(self): self.from_xyz("thf01", "pos") self.from_cp2k_ener("thf01") self.execute("tr-ic-psf", ['tracks/atom.pos', 'bond', '1,2,3,4', '5,6,7,8,9,10,11,12', os.path.join(input_dir, "thf01/init.psf")]) # ordinary df, no error bars self.execute("tr-df", glob.glob("tracks/atom.pos.bond.???????.???????") + ["1.0*A", "1.2*A", "20", "tracks/atom.pos.bond.df"]) df_hist = load_track("tracks/atom.pos.bond.df.hist") self.assertAlmostEqual(df_hist.sum(), 1.0, 2) self.execute("tr-plot", [ "--title=C-H bond length distribution", "--xlabel=C-H Distance", "--xunit=A", "--yunit=1", "--ylabel=Frequency", ":bar", "tracks/atom.pos.bond.df.bins", "tracks/atom.pos.bond.df.hist", os.path.join(output_dir, "df_noerror.png"), ]) # cumulative df, no error bars cdf_hist = load_track("tracks/atom.pos.bond.df.cumul.hist") self.assertAlmostEqual(cdf_hist[-1], 1.0, 2) self.execute("tr-plot", [ "--title=Cumulative C-H bond length distribution", "--xlabel=C-H Distance", "--xunit=A", "--yunit=1", "--ylabel=Frequency", ":bar", "tracks/atom.pos.bond.df.bins", "tracks/atom.pos.bond.df.cumul.hist", os.path.join(output_dir, "df_cumul_noerror.png"), ]) # ordinary df, with error bars self.execute("tr-df", glob.glob("tracks/atom.pos.bond.???????.???????") + ["--bin-tracks", "1.0*A", "1.2*A", "20", "tracks/atom.pos.bond.df"]) lines = [] for bin_filename in sorted(glob.glob("tracks/atom.pos.bond.df.bin.???????")): output = self.execute("tr-blav", [bin_filename, "tracks/time", "-b10"]) lines.append(output[0]) self.execute("tr-write", ["tracks/atom.pos.bond.df.hist", "tracks/atom.pos.bond.df.hist.error"], stdin=lines) df_hist_bis = load_track("tracks/atom.pos.bond.df.hist") self.assertAlmostEqual(df_hist_bis.sum(), 1.0, 2) self.assertArraysAlmostEqual(df_hist, df_hist_bis, 1e-5) self.execute("tr-plot", [ "--title=C-H bond length distribution", "--xlabel=C-H Distance", "--xunit=A", "--yunit=1", "--ylabel=Frequency", ":bar", "tracks/atom.pos.bond.df.bins", "tracks/atom.pos.bond.df.hist", "tracks/atom.pos.bond.df.hist.error", os.path.join(output_dir, "df_error.png"), ]) # cumulative df, with error bars lines = [] for bin_filename in sorted(glob.glob("tracks/atom.pos.bond.df.cumul.bin.???????")): output = self.execute("tr-blav", [bin_filename, "tracks/time", "-b10"]) lines.append(output[0]) self.execute("tr-write", ["tracks/atom.pos.bond.df.cumul.hist", "tracks/atom.pos.bond.df.cumul.hist.error"], stdin=lines) cdf_hist_bis = load_track("tracks/atom.pos.bond.df.cumul.hist") self.assertAlmostEqual(cdf_hist_bis[-1], 1.0, 2) self.assertArraysAlmostEqual(cdf_hist, cdf_hist_bis, 1e-5) self.execute("tr-plot", [ "--title=C-H bond length distribution", "--xlabel=C-H Distance", "--xunit=A", "--yunit=1", "--ylabel=Frequency", ":bar", "tracks/atom.pos.bond.df.bins", "tracks/atom.pos.bond.df.cumul.hist", "tracks/atom.pos.bond.df.cumul.hist.error", os.path.join(output_dir, "df_cumul_error.png"), ]) | 180dc223c0ef9ebaa3b178bd709e0cacd8e29052 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11050/180dc223c0ef9ebaa3b178bd709e0cacd8e29052/commands.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2180,
12,
2890,
4672,
365,
18,
2080,
67,
17177,
2932,
451,
74,
1611,
3113,
315,
917,
7923,
365,
18,
2080,
67,
4057,
22,
79,
67,
708,
2932,
451,
74,
1611,
7923,
365,
18,
883... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2180,
12,
2890,
4672,
365,
18,
2080,
67,
17177,
2932,
451,
74,
1611,
3113,
315,
917,
7923,
365,
18,
2080,
67,
4057,
22,
79,
67,
708,
2932,
451,
74,
1611,
7923,
365,
18,
883... |
self.input.append(input) | self.input = self.input + input | def update(self, input): """updates the algorithm with more hashing information.""" self.input.append(input) | 97699db37a7660cb45cb4f14d3907af22642e989 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9938/97699db37a7660cb45cb4f14d3907af22642e989/crypto.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
16,
810,
4672,
3536,
14703,
326,
4886,
598,
1898,
24641,
1779,
12123,
365,
18,
2630,
18,
6923,
12,
2630,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
16,
810,
4672,
3536,
14703,
326,
4886,
598,
1898,
24641,
1779,
12123,
365,
18,
2630,
18,
6923,
12,
2630,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
self.test_thread = threading.Thread(target = Controller.test_thread_func, args = (self,)) | log.debug("Initializing test threads.") T = threading.Thread self.test_thread = T(target = Controller.testing_thread, args = (self,)) self.circuit_thread = T(target = Controller.circuit_build_thread, args = (self,)) self.listen_thread = T(target = Controller.listen_thread, args = (self,)) self.stream_thread = T(target = Controller.stream_management_thread, args = (self,)) self.test_mgmt_thread = T(target = Controller.test_management_thread, args = (self,)) | def init_tests(self): """ Initialize testing infrastructure - sockets, etc. """ log.debug("Initializing test sockets.") for port in self.test_ports: try: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.setblocking(0) sock.bind((config.test_bind_ip, port)) self.test_sockets[port] = sock except socket.error, e: (err, message) = e.args log.error("Could not bind to test port %d: %s", port, message) if err == errno.EACCES: log.error("Run TorBEL as root or a user able to bind to privileged ports.") elif err == errno.EADDRNOTAVAIL: log.error("Please check your network settings.") if config.test_bind_ip: log.error("test_bind_ip in torbel_config.py must be assigned to a working network interface.") log.error("The current value (%s) does not appear to be valid.", config.test_bind_ip) else: log.error("Could not bind to IPADDR_ANY.") # re-raise the error to be caught by the client. raise | 921dc4f6d0461873a6adb949ad90974a0718ad25 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9986/921dc4f6d0461873a6adb949ad90974a0718ad25/torbel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
67,
16341,
12,
2890,
4672,
3536,
9190,
7769,
316,
26150,
300,
16762,
16,
5527,
18,
3536,
613,
18,
4148,
2932,
29782,
1842,
16762,
1199,
13,
364,
1756,
316,
365,
18,
3813,
67,
4363,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
67,
16341,
12,
2890,
4672,
3536,
9190,
7769,
316,
26150,
300,
16762,
16,
5527,
18,
3536,
613,
18,
4148,
2932,
29782,
1842,
16762,
1199,
13,
364,
1756,
316,
365,
18,
3813,
67,
4363,... |
self["VKeyIcon"].hide() self["VirtualKB"].setEnabled(False) self["HelpWindow"].hide() | def layoutFinished(self): self["DNS1"].setText(self.primaryDNS.getText()) self["DNS2"].setText(self.secondaryDNS.getText()) if self.ipConfigEntry.getText() is not None: if self.ipConfigEntry.getText() == "0.0.0.0": self["IP"].setText(_("N/A")) else: self["IP"].setText(self.ipConfigEntry.getText()) else: self["IP"].setText(_("N/A")) if self.netmaskConfigEntry.getText() is not None: if self.netmaskConfigEntry.getText() == "0.0.0.0": self["Mask"].setText(_("N/A")) else: self["Mask"].setText(self.netmaskConfigEntry.getText()) else: self["IP"].setText(_("N/A")) if iNetwork.getAdapterAttribute(self.iface, "gateway"): if self.gatewayConfigEntry.getText() == "0.0.0.0": self["Gatewaytext"].setText(_("Gateway")) self["Gateway"].setText(_("N/A")) else: self["Gatewaytext"].setText(_("Gateway")) self["Gateway"].setText(self.gatewayConfigEntry.getText()) else: self["Gateway"].setText("") self["Gatewaytext"].setText("") self["Adapter"].setText(iNetwork.getFriendlyAdapterName(self.iface)) self["VKeyIcon"].hide() self["VirtualKB"].setEnabled(False) self["HelpWindow"].hide() | f741c4cc282f2f99b86e6ec305604f27216087ba /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6652/f741c4cc282f2f99b86e6ec305604f27216087ba/NetworkSetup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3511,
10577,
12,
2890,
4672,
365,
9614,
11602,
21,
6,
8009,
542,
1528,
12,
2890,
18,
8258,
11602,
18,
588,
1528,
10756,
365,
9614,
11602,
22,
6,
8009,
542,
1528,
12,
2890,
18,
19674,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3511,
10577,
12,
2890,
4672,
365,
9614,
11602,
21,
6,
8009,
542,
1528,
12,
2890,
18,
8258,
11602,
18,
588,
1528,
10756,
365,
9614,
11602,
22,
6,
8009,
542,
1528,
12,
2890,
18,
19674,
1... | |
import gc gc.collect() | test_support.gc_collect() | def __del__(self): Counted.counter -= 1 | 36f4733acef5aa12ca3417779ae3f11e59199f70 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/36f4733acef5aa12ca3417779ae3f11e59199f70/test_descr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
3771,
972,
12,
2890,
4672,
6974,
329,
18,
7476,
3947,
404,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
3771,
972,
12,
2890,
4672,
6974,
329,
18,
7476,
3947,
404,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
r += if_platform_tagged(platform, "enable", lambda: x) | r += if_platform_tagged(platform, "enable", x) | def each_platform(closure): r = "[+ IF - enable undefined +]" for platform in GRUB_PLATFORMS: r += "\nif COND_" + platform + "\n" + closure(platform) + "endif\n" r += "[+ ELSE +]" for platform in GRUB_PLATFORMS: x = "\nif COND_" + platform + "\n" + closure(platform) + "endif\n" r += if_platform_tagged(platform, "enable", lambda: x) r += "[+ ENDIF +]" return r; | c8d22d34fb910911782f3cb62d58a3495edc8286 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9475/c8d22d34fb910911782f3cb62d58a3495edc8286/gentpl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1517,
67,
9898,
12,
20823,
4672,
436,
273,
5158,
15,
11083,
300,
4237,
3109,
397,
4279,
364,
4072,
316,
15228,
3457,
67,
6253,
789,
4983,
55,
30,
436,
1011,
1548,
82,
430,
3492,
40,
95... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1517,
67,
9898,
12,
20823,
4672,
436,
273,
5158,
15,
11083,
300,
4237,
3109,
397,
4279,
364,
4072,
316,
15228,
3457,
67,
6253,
789,
4983,
55,
30,
436,
1011,
1548,
82,
430,
3492,
40,
95... |
def _analytic_update(self, cr, uid, ids, context): if self.called: self.called=False return False obj_line=self.pool.get('account.analytic.line') for line in self.browse(cr, uid, ids, context): | def create_analytic_lines(self, cr, uid, ids, context={}): super(account_move_line, self).create_analytic_lines(cr, uid, ids, context) for line in self.browse(cr, uid, ids, context): | def _analytic_update(self, cr, uid, ids, context): if self.called: self.called=False return False | e130b17c9b01867760d947b06e8bdfaf0f40350a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7397/e130b17c9b01867760d947b06e8bdfaf0f40350a/account_analytic_plans.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
304,
7834,
335,
67,
2725,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
4672,
309,
365,
18,
11777,
30,
365,
18,
11777,
33,
8381,
327,
1083,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
304,
7834,
335,
67,
2725,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
4672,
309,
365,
18,
11777,
30,
365,
18,
11777,
33,
8381,
327,
1083,
2,
-100,
-100,
-100,
-100,
-100,
-... |
"lib", "python" + sys.version[:3]) | "lib", "python" + get_python_version()) | def get_python_lib(plat_specific=0, standard_lib=0, prefix=None): """Return the directory containing the Python library (standard or site additions). If 'plat_specific' is true, return the directory containing platform-specific modules, i.e. any module from a non-pure-Python module distribution; otherwise, return the platform-shared library directory. If 'standard_lib' is true, return the directory containing standard Python library modules; otherwise, return the directory for site-specific modules. If 'prefix' is supplied, use it instead of sys.prefix or sys.exec_prefix -- i.e., ignore 'plat_specific'. """ if prefix is None: prefix = plat_specific and EXEC_PREFIX or PREFIX if os.name == "posix": libpython = os.path.join(prefix, "lib", "python" + sys.version[:3]) if standard_lib: return libpython else: return os.path.join(libpython, "site-packages") elif os.name == "nt": if standard_lib: return os.path.join(prefix, "Lib") else: if sys.version < "2.2": return prefix else: return os.path.join(PREFIX, "Lib", "site-packages") elif os.name == "mac": if plat_specific: if standard_lib: return os.path.join(prefix, "Lib", "lib-dynload") else: return os.path.join(prefix, "Lib", "site-packages") else: if standard_lib: return os.path.join(prefix, "Lib") else: return os.path.join(prefix, "Lib", "site-packages") elif os.name == "os2": if standard_lib: return os.path.join(PREFIX, "Lib") else: return os.path.join(PREFIX, "Lib", "site-packages") else: raise DistutilsPlatformError( "I don't know where Python installs its library " "on platform '%s'" % os.name) | 0ff98b9346f77d6888c29e5c787c5b1b75023efc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ff98b9346f77d6888c29e5c787c5b1b75023efc/sysconfig.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
8103,
67,
2941,
12,
412,
270,
67,
12524,
33,
20,
16,
4529,
67,
2941,
33,
20,
16,
1633,
33,
7036,
4672,
3536,
990,
326,
1867,
4191,
326,
6600,
5313,
261,
10005,
578,
2834,
26... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8103,
67,
2941,
12,
412,
270,
67,
12524,
33,
20,
16,
4529,
67,
2941,
33,
20,
16,
1633,
33,
7036,
4672,
3536,
990,
326,
1867,
4191,
326,
6600,
5313,
261,
10005,
578,
2834,
26... |
obj.msgid_plural = strings[msgid]["plural"] | obj.msgid_plural = polib.unescape(strings[msgid]["plural"]) | def getPotFile(self, content, variants={}): pot = self.createPoFile() strings = self.getPackageStrings(content, variants) | 3310f6c9f519924be5326f471a80702edf090ab6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5718/3310f6c9f519924be5326f471a80702edf090ab6/Locale.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1689,
352,
812,
12,
2890,
16,
913,
16,
12935,
12938,
4672,
5974,
273,
365,
18,
2640,
29198,
812,
1435,
2064,
273,
365,
18,
588,
2261,
7957,
12,
1745,
16,
12935,
13,
2,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1689,
352,
812,
12,
2890,
16,
913,
16,
12935,
12938,
4672,
5974,
273,
365,
18,
2640,
29198,
812,
1435,
2064,
273,
365,
18,
588,
2261,
7957,
12,
1745,
16,
12935,
13,
2,
-100,
-100,
-100... |
else | else: | def __init__(data = None) if data == None: quickfix.StringField.__init__(self, 930) else quickfix.StringField.__init__(self, 930, 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,
2468,
5082,
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,
2468,
5082,
13,
469,
30,
9549,
904,
18,
780,
974,
16186,
2738... |
def dvi(self, directory): self.write(directory) oldpath = os.path.abspath(os.curdir) os.chdir(directory) print 'RUNNING LaTeX' os.system('latex api.tex') os.system('makeindex api.idx') os.system('latex api.tex') os.chdir(oldpath) def write(self, directory): | self._hyperref = 1 def write(self, directory=None, progress_callback=None): """ Write the API documentation for the entire project to the given directory. @type directory: C{string} @param directory: The directory to which output should be written. If no directory is specified, output will be written to the current directory. If the directory does not exist, it will be created. @type progress_callback: C{function} @param progress_callback: A callback function that is called before each file is written, with the name of the created file. @rtype: C{None} @raise OSError: If C{directory} cannot be created, @raise OSError: If any file cannot be created or written to. """ if not directory: directory = os.curdir | def __init__(self, docmap, **kwargs): self._docmap = docmap | 718e913e37bd564ee3425ab6734ad7a7748f8a8a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/718e913e37bd564ee3425ab6734ad7a7748f8a8a/latex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
997,
1458,
16,
2826,
4333,
4672,
365,
6315,
2434,
1458,
273,
997,
1458,
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,
1001,
2738,
972,
12,
2890,
16,
997,
1458,
16,
2826,
4333,
4672,
365,
6315,
2434,
1458,
273,
997,
1458,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
eventlet.sleep(.2) | evt.wait() | def server(): # accept the connection in another greenlet sock, addr = listener.accept() | 017d7871a7559eeb90cb911e57dd5974ec41f4ed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10078/017d7871a7559eeb90cb911e57dd5974ec41f4ed/greenio_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1438,
13332,
468,
2791,
326,
1459,
316,
4042,
10004,
1810,
7313,
16,
3091,
273,
2991,
18,
9436,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1438,
13332,
468,
2791,
326,
1459,
316,
4042,
10004,
1810,
7313,
16,
3091,
273,
2991,
18,
9436,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
self.set_macro("FrameworkSDKDir", net, "sdkinstallroot") | if version > 7.0: self.set_macro("FrameworkSDKDir", net, "sdkinstallrootv1.1") else: self.set_macro("FrameworkSDKDir", net, "sdkinstallroot") | def load_macros(self, version): vsbase = r"Software\Microsoft\VisualStudio\%s.0" % version self.set_macro("VCInstallDir", vsbase + r"\Setup\VC", "productdir") self.set_macro("VSInstallDir", vsbase + r"\Setup\VS", "productdir") net = r"Software\Microsoft\.NETFramework" self.set_macro("FrameworkDir", net, "installroot") self.set_macro("FrameworkSDKDir", net, "sdkinstallroot") | df44db67f6b366e26a94c8d66ba002a2a49d4647 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/df44db67f6b366e26a94c8d66ba002a2a49d4647/msvccompiler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
5821,
6973,
12,
2890,
16,
1177,
4672,
6195,
1969,
273,
436,
6,
21742,
64,
22350,
64,
25780,
510,
4484,
64,
9,
87,
18,
20,
6,
738,
1177,
365,
18,
542,
67,
26448,
2932,
13464... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
5821,
6973,
12,
2890,
16,
1177,
4672,
6195,
1969,
273,
436,
6,
21742,
64,
22350,
64,
25780,
510,
4484,
64,
9,
87,
18,
20,
6,
738,
1177,
365,
18,
542,
67,
26448,
2932,
13464... |
def fl_get_browser_screenlines(ob): """ fl_get_browser_screenlines(ob) -> lines num. """ retval = _fl_get_browser_screenlines(ob) return retval _fl_set_browser_topline = cfuncproto(so_libforms, "fl_set_browser_topline", None, [cty.POINTER(FL_OBJECT), cty.c_int], | def fl_get_browser_screenlines(pObject): """ fl_get_browser_screenlines(pObject) -> lines num. """ retval = _fl_get_browser_screenlines(pObject) return retval _fl_set_browser_topline = cfuncproto(so_libforms, "fl_set_browser_topline", None, [cty.POINTER(FL_OBJECT), cty.c_int], | def fl_get_browser_screenlines(ob): """ fl_get_browser_screenlines(ob) -> lines num. """ retval = _fl_get_browser_screenlines(ob) return retval | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
588,
67,
11213,
67,
9252,
3548,
12,
947,
4672,
3536,
1183,
67,
588,
67,
11213,
67,
9252,
3548,
12,
947,
13,
317,
2362,
818,
18,
3536,
225,
5221,
273,
389,
2242,
67,
588,
67... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
588,
67,
11213,
67,
9252,
3548,
12,
947,
4672,
3536,
1183,
67,
588,
67,
11213,
67,
9252,
3548,
12,
947,
13,
317,
2362,
818,
18,
3536,
225,
5221,
273,
389,
2242,
67,
588,
67... |
os.environ['PYTHONPATH'] = os.pathsep.join(sys.path) cmd = '%s "%s" %s' % (sys.executable, script_fn, args) | pyIntpPath = Preferences.getPythonInterpreterPath() if pyIntpPath == sys.executable: os.environ['PYTHONPATH'] = os.pathsep.join(sys.path) else: os.environ['PYTHONPATH'] = Preferences.pyPath cmd = '%s "%s" %s' % (pyIntpPath, script_fn, args) | def spawnChild(monitor, process, args=''): """Returns an xmlrpclib.Server, a connection to an xml-rpc server, and the input and error streams. """ # Start ChildProcessServerStart.py in a new process. script_fn = os.path.join(os.path.dirname(__file__), 'ChildProcessServerStart.py') os.environ['PYTHONPATH'] = os.pathsep.join(sys.path) cmd = '%s "%s" %s' % (sys.executable, script_fn, args) try: if wx.wxVERSION > (2, 3, 2): flags = wx.wxEXEC_NOHIDE else: flags = 0 pid = wx.wxExecute(cmd, flags, process) line = '' if monitor.isAlive(): istream = process.GetInputStream() estream = process.GetErrorStream() err = '' # read in the port and auth hash while monitor.isAlive() and line.find('\n') < 0: # don't take more time than the process we wait for ;) time.sleep(0.00001) if canReadStream(istream): line = line + istream.read(1) # test for tracebacks on stderr if canReadStream(estream): err = estream.read() errlines = err.split('\n') while not errlines[-1].strip(): del errlines[-1] exctype, excvalue = errlines[-1].split(':') while errlines and errlines[-1][:7] != ' File ': del errlines[-1] if errlines: errfile = ' (%s)' % errlines[-1].strip() else: errfile = '' raise __builtins__[exctype.strip()], (excvalue.strip()+errfile) if not KEEP_STREAMS_OPEN: process.CloseOutput() if monitor.isAlive(): line = line.strip() if not line: raise RuntimeError, ( 'The debug server address could not be read') port, auth = line.strip().split() if USE_TCPWATCH: # Start TCPWatch as a connection forwarder. from thread import start_new_thread new_port = 20202 # Hopefully free def run_tcpwatch(port1, port2): os.system("tcpwatch -L %d:127.0.0.1:%d" % ( int(port1), int(port2))) start_new_thread(run_tcpwatch, (new_port, port)) time.sleep(3) port = new_port trans = TransportWithAuth(auth) server = xmlrpclib.Server( 'http://127.0.0.1:%d' % int(port), trans) return server, istream, estream, pid else: raise RuntimeError, 'The debug server failed to start' except: if monitor.isAlive(): process.CloseOutput() monitor.kill() raise | c84ecd785771d4fce7d026f3da1d50b056b28ea8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/c84ecd785771d4fce7d026f3da1d50b056b28ea8/ChildProcessClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12560,
1763,
12,
10259,
16,
1207,
16,
833,
2218,
11,
4672,
3536,
1356,
392,
2025,
13832,
830,
495,
18,
2081,
16,
279,
1459,
358,
392,
2025,
17,
7452,
1438,
16,
471,
326,
810,
471,
555,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12560,
1763,
12,
10259,
16,
1207,
16,
833,
2218,
11,
4672,
3536,
1356,
392,
2025,
13832,
830,
495,
18,
2081,
16,
279,
1459,
358,
392,
2025,
17,
7452,
1438,
16,
471,
326,
810,
471,
555,... |
f = file(fname) | f = open(fname) | def combine(fname): f = file(fname) fi = iter(f) for line in read(fi, re.compile(r'^Remaining objects:$'), False): pass crack = re.compile(r'([a-zA-Z\d]+) \[(\d+)\] (.*)') addr2rc = {} addr2guts = {} before = 0 for line in read(fi, re.compile(r'^Remaining object addresses:$'), False): m = crack.match(line) if m: addr, addr2rc[addr], addr2guts[addr] = m.groups() before += 1 else: print('??? skipped:', line) after = 0 for line in read(fi, crack, True): after += 1 m = crack.match(line) assert m addr, rc, guts = m.groups() # guts is type name here if addr not in addr2rc: print('??? new object created while tearing down:', line.rstrip()) continue print(addr, end=' ') if rc == addr2rc[addr]: print('[%s]' % rc, end=' ') else: print('[%s->%s]' % (addr2rc[addr], rc), end=' ') print(guts, addr2guts[addr]) f.close() print("%d objects before, %d after" % (before, after)) | 4b28041530ce2dc8f741d544b6f86627348de3ef /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/4b28041530ce2dc8f741d544b6f86627348de3ef/combinerefs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8661,
12,
12749,
4672,
284,
273,
1696,
12,
12749,
13,
225,
7314,
273,
1400,
12,
74,
13,
225,
364,
980,
316,
855,
12,
22056,
16,
283,
18,
11100,
12,
86,
19856,
11429,
2184,
30,
9227,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8661,
12,
12749,
4672,
284,
273,
1696,
12,
12749,
13,
225,
7314,
273,
1400,
12,
74,
13,
225,
364,
980,
316,
855,
12,
22056,
16,
283,
18,
11100,
12,
86,
19856,
11429,
2184,
30,
9227,
... |
self._rising_setting(body, rising=True) | return self._rising_setting(body, rising=True) | def next_rising(self, body): """Find the next time at which the given body rises.""" self._rising_setting(body, rising=True) | 58aa765e5e5ff2da284b6e4f6dd1a78bd23f9a7f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10979/58aa765e5e5ff2da284b6e4f6dd1a78bd23f9a7f/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1024,
67,
86,
13734,
12,
2890,
16,
1417,
4672,
3536,
3125,
326,
1024,
813,
622,
1492,
326,
864,
1417,
436,
6141,
12123,
365,
6315,
86,
13734,
67,
8920,
12,
3432,
16,
436,
13734,
33,
55... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1024,
67,
86,
13734,
12,
2890,
16,
1417,
4672,
3536,
3125,
326,
1024,
813,
622,
1492,
326,
864,
1417,
436,
6141,
12123,
365,
6315,
86,
13734,
67,
8920,
12,
3432,
16,
436,
13734,
33,
55... |
for axis,group,data,subplot in mgr.subplots: | for axis,group,data,cb,subplot in mgr.subplots: | def update(G=None, x=-1, y=-1): mgr = plt.get_current_fig_manager() if G is None: for axis,group,data,subplot in mgr.subplots: if hasattr(group, 'mask'): D = np.where(group.mask,data,np.NaN) else: D = data axis.set_data(D) else: for axis,group,data,subplot in mgr.subplots: axis.set_data(np.empty_like(data)*np.NaN) if hasattr(G, '_connections'): for C in G._connections: for axis,group,data,subplot in mgr.subplots: if C._actual_source is data: try: axis.set_data(C[y,x]) except NotImplementedError: pass | e02ec6ba73972ecb234700295bf10aa4a5906799 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12213/e02ec6ba73972ecb234700295bf10aa4a5906799/display.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
43,
33,
7036,
16,
619,
29711,
21,
16,
677,
29711,
21,
4672,
13333,
273,
5451,
18,
588,
67,
2972,
67,
470,
67,
4181,
1435,
309,
611,
353,
599,
30,
364,
2654,
16,
1655,
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,
1089,
12,
43,
33,
7036,
16,
619,
29711,
21,
16,
677,
29711,
21,
4672,
13333,
273,
5451,
18,
588,
67,
2972,
67,
470,
67,
4181,
1435,
309,
611,
353,
599,
30,
364,
2654,
16,
1655,
16,
... |
lang = gettext.translation(PACKAGE, locale_dir, languages=lang, | lang = gettext.translation(PACKAGE, locale_dir, languages=[lang], | def setlang(lang=None): "Set language" locale_dir = os.path.join(CURRENT_DIR, 'share/locale') if not os.path.isdir(locale_dir): locale_dir = os.path.join(PREFIX, 'share/locale') if not os.path.isdir(locale_dir): gettext.install(PACKAGE, unicode=1) return False if lang: encoding = locale.getdefaultlocale()[1] if encoding == 'utf': encoding = 'UTF-8' if encoding == 'cp1252': encoding = '1252' try: if os.name == 'nt': locale.setlocale(locale.LC_ALL, _LOCALE2WIN32.get(lang, lang) + '.' + encoding) else: locale.setlocale(locale.LC_ALL, lang + '.' + encoding) except: logging.getLogger('translate').warn( _('Unable to set locale %s') % lang + '.' + encoding) lang = gettext.translation(PACKAGE, locale_dir, languages=lang, fallback=True) lang.install(unicode=1) else: try: locale.setlocale(locale.LC_ALL, '') except: logging.getLogger('translate').warn( _('Unable to unset locale')) gettext.bindtextdomain(PACKAGE, locale_dir) gettext.textdomain(PACKAGE) gettext.install(PACKAGE, unicode=1) gtk.glade.bindtextdomain(PACKAGE, locale_dir) | 47e98aa32344a98b529394bb7f58a68131cab4ac /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9151/47e98aa32344a98b529394bb7f58a68131cab4ac/translate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
4936,
12,
4936,
33,
7036,
4672,
315,
694,
2653,
6,
2573,
67,
1214,
273,
1140,
18,
803,
18,
5701,
12,
15487,
67,
4537,
16,
296,
14419,
19,
6339,
6134,
309,
486,
1140,
18,
803,
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,
444,
4936,
12,
4936,
33,
7036,
4672,
315,
694,
2653,
6,
2573,
67,
1214,
273,
1140,
18,
803,
18,
5701,
12,
15487,
67,
4537,
16,
296,
14419,
19,
6339,
6134,
309,
486,
1140,
18,
803,
18... |
help="use libtool") | help="do not use libtool") | def _get_option_parser(): parser = optparse.OptionParser('%prog [options] sources') parser.add_option("", "--format", action="store", dest="format", default="gir", help="format to use, one of gidl, gir") parser.add_option("-i", "--include", action="append", dest="includes", default=[], help="include types for other gidls") parser.add_option("", "--add-include-path", action="append", dest="include_paths", default=[], help="include paths for other GIR files") parser.add_option("", "--program", action="store", dest="program", default=None, help="program to execute") parser.add_option("", "--program-arg", action="append", dest="program_args", default=[], help="extra arguments to program") parser.add_option("", "--libtool", action="store", dest="libtool_path", default=None, help="full path to libtool") parser.add_option("", "--no-libtool", action="store_true", dest="nolibtool", default=False, help="use libtool") parser.add_option("-l", "--library", action="append", dest="libraries", default=[], help="libraries of this unit") parser.add_option("-L", "--library-path", action="append", dest="library_paths", default=[], help="directories to search for libraries") parser.add_option("-n", "--namespace", action="store", dest="namespace_name", help=("name of namespace for this unit, also " "used as --strip-prefix default")) parser.add_option("", "--nsversion", action="store", dest="namespace_version", help="version of namespace for this unit") parser.add_option("", "--strip-prefix", action="store", dest="strip_prefix", default=None, help="remove this prefix from objects and functions") parser.add_option("-o", "--output", action="store", dest="output", help="output to writeout, defaults to stdout") parser.add_option("", "--pkg", action="append", dest="packages", default=[], help="pkg-config packages to get cflags from") parser.add_option("", "--pkg-export", action="append", dest="packages_export", default=[], help="Associated pkg-config packages for this library") parser.add_option("-v", "--verbose", action="store_true", dest="verbose", help="be verbose") parser.add_option("", "--noclosure", action="store_true", dest="noclosure", help="do not delete unknown types") parser.add_option("", "--typelib-xml", action="store_true", dest="typelib_xml", help="Just convert GIR to typelib XML") parser.add_option("", "--inject", action="store_true", dest="inject", help="Inject additional components into GIR XML") parser.add_option("", "--xpath-assertions", action="store", dest="xpath_assertions", help="Use given file to create assertions on GIR content") parser.add_option("", "--c-include", action="append", dest="c_includes", default=[], help="headers which should be included in C programs") group = optparse.OptionGroup(parser, "Preprocessor options") group.add_option("-I", help="Pre-processor include file", action="append", dest="cpp_includes", default=[]) group.add_option("-D", help="Pre-processor define", action="append", dest="cpp_defines", default=[]) group.add_option("-U", help="Pre-processor undefine", action="append", dest="cpp_undefines", default=[]) group.add_option("-p", dest="", help="Ignored") parser.add_option_group(group) return parser | 0057bd81165e93b1cfd2b350759766ecb9140e36 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2770/0057bd81165e93b1cfd2b350759766ecb9140e36/scannermain.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
3482,
67,
4288,
13332,
2082,
273,
2153,
2670,
18,
1895,
2678,
29909,
14654,
306,
2116,
65,
5550,
6134,
2082,
18,
1289,
67,
3482,
2932,
3113,
5238,
2139,
3113,
1301,
1546,
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,
389,
588,
67,
3482,
67,
4288,
13332,
2082,
273,
2153,
2670,
18,
1895,
2678,
29909,
14654,
306,
2116,
65,
5550,
6134,
2082,
18,
1289,
67,
3482,
2932,
3113,
5238,
2139,
3113,
1301,
1546,
2... |
dc.SetPen(wx.Pen(penColor)) | def Draw(self, dc, boundingRect, styles, brushOffset, selected): item = self._item | 614c6e0fec5358c7acde5bbf542101668445ed6a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/614c6e0fec5358c7acde5bbf542101668445ed6a/CalendarCanvas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10184,
12,
2890,
16,
6744,
16,
7552,
6120,
16,
5687,
16,
5186,
1218,
2335,
16,
3170,
4672,
761,
273,
365,
6315,
1726,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10184,
12,
2890,
16,
6744,
16,
7552,
6120,
16,
5687,
16,
5186,
1218,
2335,
16,
3170,
4672,
761,
273,
365,
6315,
1726,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... | |
Update the progressbar | Update the progressbar | def updateProgress(self,name,frac,fread,ftime): ''' Update the progressbar @param name: filename @param frac: Progress fracment (0 -> 1) @param fread: formated string containing BytesRead @param ftime : formated string containing remaining or elapsed time ''' pct = int( frac*100 ) print " %s : %s " % (name,pct) | bcb6ddbb4f981ed03fe8d1171e266e38b77d4fd8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5445/bcb6ddbb4f981ed03fe8d1171e266e38b77d4fd8/callbacks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
5491,
12,
2890,
16,
529,
16,
22187,
16,
74,
896,
16,
9982,
4672,
9163,
2315,
326,
31730,
632,
891,
508,
30,
1544,
632,
891,
12445,
30,
10980,
12445,
475,
261,
20,
317,
404,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
5491,
12,
2890,
16,
529,
16,
22187,
16,
74,
896,
16,
9982,
4672,
9163,
2315,
326,
31730,
632,
891,
508,
30,
1544,
632,
891,
12445,
30,
10980,
12445,
475,
261,
20,
317,
404,
13,
... |
except: | except TypeError: | def _an_element_impl(self): """ Returns an arbitrary element of a free module. | 7f8f223f948e12c9172b086452a98d24651686d8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/7f8f223f948e12c9172b086452a98d24651686d8/free_module.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
304,
67,
2956,
67,
11299,
12,
2890,
4672,
3536,
2860,
392,
11078,
930,
434,
279,
4843,
1605,
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,
389,
304,
67,
2956,
67,
11299,
12,
2890,
4672,
3536,
2860,
392,
11078,
930,
434,
279,
4843,
1605,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
transform_cmd = "xsltproc -v -o %s %s %s" % (self.html_file, self.xsl_file, self.xml_file) | transform_cmd = "xsltproc -o %s %s %s" % (self.html_file, self.xsl_file, self.xml_file) | def transform(self): transform_cmd = "xsltproc -v -o %s %s %s" % (self.html_file, self.xsl_file, self.xml_file) runCommand(transform_cmd) | 56d459e9f05bea1a6dd581ce0dcf014e4da8a175 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12088/56d459e9f05bea1a6dd581ce0dcf014e4da8a175/pretty_gip_info.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2510,
12,
2890,
4672,
2510,
67,
4172,
273,
315,
92,
14414,
9381,
300,
83,
738,
87,
738,
87,
738,
87,
6,
738,
261,
2890,
18,
2620,
67,
768,
16,
365,
18,
30903,
67,
768,
16,
365,
18,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2510,
12,
2890,
4672,
2510,
67,
4172,
273,
315,
92,
14414,
9381,
300,
83,
738,
87,
738,
87,
738,
87,
6,
738,
261,
2890,
18,
2620,
67,
768,
16,
365,
18,
30903,
67,
768,
16,
365,
18,... |
if self.dictOrigin['Program'] == "hyp2000" and \ 'SsynthWeight' in dict: | if 'SsynthWeight' in dict: | def dicts2XML(self): """ Returns information of all dictionaries as xml file """ xml = Element("event") Sub(Sub(xml, "event_id"), "value").text = self.dictEvent['xmlEventID'] event_type = Sub(xml, "event_type") Sub(event_type, "value").text = "manual" Sub(event_type, "user").text = self.username Sub(event_type, "public").text = "%s" % \ self.checkbuttonPublicEvent.get_active() # XXX standard values for unset keys!!!???!!!??? epidists = [] # go through all stream-dictionaries and look for picks for i, dict in enumerate(self.dicts): st = self.streams[i] | 203bac7e5a7142b3cafbb4409d2dad68e568d611 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10470/203bac7e5a7142b3cafbb4409d2dad68e568d611/obspyck.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15838,
22,
4201,
12,
2890,
4672,
3536,
2860,
1779,
434,
777,
16176,
487,
2025,
585,
3536,
2025,
273,
225,
3010,
2932,
2575,
7923,
2592,
12,
1676,
12,
2902,
16,
315,
2575,
67,
350,
6,
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,
15838,
22,
4201,
12,
2890,
4672,
3536,
2860,
1779,
434,
777,
16176,
487,
2025,
585,
3536,
2025,
273,
225,
3010,
2932,
2575,
7923,
2592,
12,
1676,
12,
2902,
16,
315,
2575,
67,
350,
6,
3... |
tags, notag_only = self.intended_tags | tags, notag_only = self.get_selected_tags() | def on_colorchooser_activate(self, widget): #TODO: Color chooser should be refactorized in its own class. Well, in #fact we should have a TagPropertiesEditor (like for project) Also, #color change should be immediate. There's no reason for a Ok/Cancel dialog = gtk.ColorSelectionDialog('Choose color') colorsel = dialog.colorsel colorsel.connect("color_changed", self.on_color_changed) # Get previous color tags, notag_only = self.intended_tags init_color = None if len(tags) == 1: color = tags[0].get_attribute("color") if color != None: colorspec = gtk.gdk.color_parse(color) colorsel.set_previous_color(colorspec) colorsel.set_current_color(colorspec) init_color = colorsel.get_current_color() response = dialog.run() # Check response and set color if required if response != gtk.RESPONSE_OK and init_color: strcolor = gtk.color_selection_palette_to_string([init_color]) tags, notag_only = self.intended_tags for t in tags: t.set_attribute("color", strcolor) self.task_tv.refresh() dialog.destroy() | bfe6d5b75538050c23bfc2e0d6b76f4cf341af5d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7036/bfe6d5b75538050c23bfc2e0d6b76f4cf341af5d/browser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
3266,
2599,
13164,
67,
10014,
12,
2890,
16,
3604,
4672,
468,
6241,
30,
5563,
5011,
13164,
1410,
506,
26627,
1235,
316,
2097,
4953,
667,
18,
678,
1165,
16,
316,
468,
3493,
732,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
3266,
2599,
13164,
67,
10014,
12,
2890,
16,
3604,
4672,
468,
6241,
30,
5563,
5011,
13164,
1410,
506,
26627,
1235,
316,
2097,
4953,
667,
18,
678,
1165,
16,
316,
468,
3493,
732,
... |
dprint(MacroFS.macros) | def unpackVersion1(self, data): macros, recent = data MacroFS.macros.update(macros) dprint(MacroFS.macros) RecentMacros.setStorage(recent) | d77726ef8abb406e3169b9a46422cfcaff76a425 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11522/d77726ef8abb406e3169b9a46422cfcaff76a425/macro.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6167,
1444,
21,
12,
2890,
16,
501,
4672,
24302,
16,
8399,
273,
501,
31203,
4931,
18,
5821,
6973,
18,
2725,
12,
5821,
6973,
13,
225,
868,
2998,
9990,
6973,
18,
542,
3245,
12,
20872,
13,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6167,
1444,
21,
12,
2890,
16,
501,
4672,
24302,
16,
8399,
273,
501,
31203,
4931,
18,
5821,
6973,
18,
2725,
12,
5821,
6973,
13,
225,
868,
2998,
9990,
6973,
18,
542,
3245,
12,
20872,
13,... | |
def handle_error (self): | def handle_error(self): | def handle_error (self): nil, t, v, tbinfo = compact_traceback() | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
1636,
12,
2890,
4672,
515,
16,
268,
16,
331,
16,
8739,
1376,
273,
6739,
67,
21696,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
1636,
12,
2890,
4672,
515,
16,
268,
16,
331,
16,
8739,
1376,
273,
6739,
67,
21696,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
_("activity"): sorting.instance_activity, | def instances(instances): return NamedPager('instances', instances, tiles.instance.row, sorts={_("oldest"): sorting.entity_oldest, _("newest"): sorting.entity_newest, _("activity"): sorting.instance_activity, _("name"): sorting.delegateable_label}, default_sort=sorting.instance_activity) | f5d74e26dc7d5cc9c0cba31aa6def4c55748b8e1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10360/f5d74e26dc7d5cc9c0cba31aa6def4c55748b8e1/pager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3884,
12,
10162,
4672,
327,
9796,
19115,
2668,
10162,
2187,
3884,
16,
12568,
18,
1336,
18,
492,
16,
18524,
5899,
67,
2932,
1673,
395,
6,
4672,
9602,
18,
1096,
67,
1673,
395,
16,
389,
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,
3884,
12,
10162,
4672,
327,
9796,
19115,
2668,
10162,
2187,
3884,
16,
12568,
18,
1336,
18,
492,
16,
18524,
5899,
67,
2932,
1673,
395,
6,
4672,
9602,
18,
1096,
67,
1673,
395,
16,
389,
2... | |
raise UserError, self.gettext(message) handler_class = self.get_handler_class(class_id) | return context.come_back(message) handler_class = get_object_class(class_id) | def new_resource(self, context): class_id = context.get_form_value('class_id') name = context.get_form_value('name') title = context.get_form_value('dc:title') | ec2f0dfc13322a39ff4dc6d7aa9b7b558a8f7d42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/ec2f0dfc13322a39ff4dc6d7aa9b7b558a8f7d42/Folder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
67,
3146,
12,
2890,
16,
819,
4672,
667,
67,
350,
273,
819,
18,
588,
67,
687,
67,
1132,
2668,
1106,
67,
350,
6134,
508,
273,
819,
18,
588,
67,
687,
67,
1132,
2668,
529,
6134,
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,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
67,
3146,
12,
2890,
16,
819,
4672,
667,
67,
350,
273,
819,
18,
588,
67,
687,
67,
1132,
2668,
1106,
67,
350,
6134,
508,
273,
819,
18,
588,
67,
687,
67,
1132,
2668,
529,
6134,
2... |
result = urllib.parse.quote_plus(quote_by_default, safe=quote_by_default) | result = urllib.parse.quote_plus(quote_by_default, safe=quote_by_default) | def test_safe(self): # Test setting 'safe' parameter does what it should do quote_by_default = "<>" result = urllib.parse.quote(quote_by_default, safe=quote_by_default) self.assertEqual(quote_by_default, result, "using quote(): %r != %r" % (quote_by_default, result)) result = urllib.parse.quote_plus(quote_by_default, safe=quote_by_default) self.assertEqual(quote_by_default, result, "using quote_plus(): %r != %r" % (quote_by_default, result)) # Safe expressed as bytes rather than str result = urllib.parse.quote(quote_by_default, safe=b"<>") self.assertEqual(quote_by_default, result, "using quote(): %r != %r" % (quote_by_default, result)) # "Safe" non-ASCII characters should have no effect # (Since URIs are not allowed to have non-ASCII characters) result = urllib.parse.quote("a\xfcb", encoding="latin-1", safe="\xfc") expect = urllib.parse.quote("a\xfcb", encoding="latin-1", safe="") self.assertEqual(expect, result, "using quote(): %r != %r" % (expect, result)) # Same as above, but using a bytes rather than str result = urllib.parse.quote("a\xfcb", encoding="latin-1", safe=b"\xfc") expect = urllib.parse.quote("a\xfcb", encoding="latin-1", safe="") self.assertEqual(expect, result, "using quote(): %r != %r" % (expect, result)) | bd87fd2ff11ac5fb522b0d7f9e61c8f7d63fc3d5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8125/bd87fd2ff11ac5fb522b0d7f9e61c8f7d63fc3d5/test_urllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
4626,
12,
2890,
4672,
468,
7766,
3637,
296,
4626,
11,
1569,
1552,
4121,
518,
1410,
741,
3862,
67,
1637,
67,
1886,
273,
3532,
2984,
563,
273,
11527,
18,
2670,
18,
6889,
12,
68... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4626,
12,
2890,
4672,
468,
7766,
3637,
296,
4626,
11,
1569,
1552,
4121,
518,
1410,
741,
3862,
67,
1637,
67,
1886,
273,
3532,
2984,
563,
273,
11527,
18,
2670,
18,
6889,
12,
68... |
ids2 = obj.pool.get(self._obj).search(cr, user, [(self._fields_id, 'in', ids)], limit=self._limit) | ids2 = obj.pool.get(self._obj).search(cr, user, [(self._fields_id, 'in', ids)], limit=self._limit, context=context) | def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None): if not context: context = {} if not values: values = {} res = {} for id in ids: res[id] = [] ids2 = obj.pool.get(self._obj).search(cr, user, [(self._fields_id, 'in', ids)], limit=self._limit) for r in obj.pool.get(self._obj)._read_flat(cr, user, ids2, [self._fields_id], context=context, load='_classic_write'): res[r[self._fields_id]].append(r['id']) return res | 88085a77d4513c87fbdbb6dcacdbb382be913662 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12853/88085a77d4513c87fbdbb6dcacdbb382be913662/fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
16,
4422,
16,
1081,
16,
3258,
16,
508,
16,
729,
33,
7036,
16,
1384,
33,
20,
16,
819,
33,
7036,
16,
924,
33,
7036,
4672,
309,
486,
819,
30,
819,
273,
2618,
309,
486,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
16,
4422,
16,
1081,
16,
3258,
16,
508,
16,
729,
33,
7036,
16,
1384,
33,
20,
16,
819,
33,
7036,
16,
924,
33,
7036,
4672,
309,
486,
819,
30,
819,
273,
2618,
309,
486,
... |
t = ns + sample._type | t = ns + str(sample._type) | def dump_list(self, obj, tag, typed = 1, ns_map = {}): if Config.debug: print "In dump_list.", "obj=", obj tag = tag or self.gentag() tag = toXMLname(tag) # convert from SOAP 1.2 XML name encoding | debc21c8553d79fe54df587093391551e5247ca6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14538/debc21c8553d79fe54df587093391551e5247ca6/SOAPBuilder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4657,
67,
1098,
12,
2890,
16,
1081,
16,
1047,
16,
9092,
273,
404,
16,
3153,
67,
1458,
273,
2618,
4672,
309,
1903,
18,
4148,
30,
1172,
315,
382,
4657,
67,
1098,
1199,
16,
315,
2603,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4657,
67,
1098,
12,
2890,
16,
1081,
16,
1047,
16,
9092,
273,
404,
16,
3153,
67,
1458,
273,
2618,
4672,
309,
1903,
18,
4148,
30,
1172,
315,
382,
4657,
67,
1098,
1199,
16,
315,
2603,
1... |
if makeBaseUnit(self, unit): | if self.makeBaseUnit(unit): | def makeBaseUnits(self): changed = False for unit in self.units.keys(): if makeBaseUnit(self, unit): changed = True break if changed: self.makeBaseUnits() return changed | 718f91cba069ab291997649266cc495656908c6d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8093/718f91cba069ab291997649266cc495656908c6d/Number.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
2171,
7537,
12,
2890,
4672,
3550,
273,
1083,
364,
2836,
316,
365,
18,
7705,
18,
2452,
13332,
309,
365,
18,
6540,
2171,
2802,
12,
4873,
4672,
3550,
273,
1053,
898,
309,
3550,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
2171,
7537,
12,
2890,
4672,
3550,
273,
1083,
364,
2836,
316,
365,
18,
7705,
18,
2452,
13332,
309,
365,
18,
6540,
2171,
2802,
12,
4873,
4672,
3550,
273,
1053,
898,
309,
3550,
30,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.